From bf61ea10e79e443af8e4d45c7f8872240022cb8b Mon Sep 17 00:00:00 2001 From: Weihua Lu Date: Wed, 26 May 2021 20:48:05 +0800 Subject: [PATCH] feat: refactor, integrate sentry with posthog --- package.json | 1 + resources/js/sentry.min.js | 1 - src/main/frontend/components/settings.cljs | 14 ++--- src/main/frontend/handler.cljs | 17 +----- .../modules/instrumentation/core.cljs | 18 ++++++ .../modules/instrumentation/posthog.cljs | 4 +- .../modules/instrumentation/sentry.cljs | 17 ++++++ src/main/frontend/state.cljs | 11 +--- yarn.lock | 57 +++++++++++++++++++ 9 files changed, 105 insertions(+), 35 deletions(-) delete mode 100644 resources/js/sentry.min.js create mode 100644 src/main/frontend/modules/instrumentation/core.cljs create mode 100644 src/main/frontend/modules/instrumentation/sentry.cljs diff --git a/package.json b/package.json index 2603e6126f9..26300bdd73b 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "dependencies": { "@excalidraw/excalidraw": "^0.4.2", "@kanru/rage-wasm": "^0.2.1", + "@sentry/browser": "^6.4.1", "@tippyjs/react": "^4.2.5", "chokidar": "^3.5.1", "chrono-node": "^2.2.4", diff --git a/resources/js/sentry.min.js b/resources/js/sentry.min.js deleted file mode 100644 index cd517691fa2..00000000000 --- a/resources/js/sentry.min.js +++ /dev/null @@ -1 +0,0 @@ -var Sentry=function(n){var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,r)};function r(n,r){function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var e,i,o,u=function(){return(u=Object.assign||function(n){for(var t,r=1,e=arguments.length;r0)&&!(e=o.next()).done;)u.push(e.value)}catch(n){i={error:n}}finally{try{e&&!e.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}function s(){for(var n=[],t=0;t=200&&t<300?n.Success:429===t?n.RateLimit:t>=400&&t<500?n.Invalid:t>=500?n.Failed:n.Unknown}}(n.Status||(n.Status={}));var a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var r in t)n.hasOwnProperty(r)||(n[r]=t[r]);return n});var f=function(n){function t(t){var r=this.constructor,e=n.call(this,t)||this;return e.message=t,e.name=r.prototype.constructor.name,a(e,r.prototype),e}return r(t,n),t}(Error);function h(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return n instanceof Error}}function l(n){return"[object ErrorEvent]"===Object.prototype.toString.call(n)}function v(n){return"[object DOMError]"===Object.prototype.toString.call(n)}function d(n){return"[object String]"===Object.prototype.toString.call(n)}function p(n){return null===n||"object"!=typeof n&&"function"!=typeof n}function m(n){return"[object Object]"===Object.prototype.toString.call(n)}function y(n){return Boolean(n&&n.then&&"function"==typeof n.then)}var b={};function w(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:b}function g(){var n=w(),t=n.crypto||n.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var e=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return e(r[0])+e(r[1])+e(r[2])+e(r[3])+e(r[4])+e(r[5])+e(r[6])+e(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}function E(n){if(!n)return{};var t=n.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",e=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+e}}function j(n){if(n.message)return n.message;if(n.exception&&n.exception.values&&n.exception.values[0]){var t=n.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||n.event_id||""}return n.event_id||""}function x(n){var t=w();if(!("console"in t))return n();var r=t.console,e={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&r[n].__sentry__&&(e[n]=r[n].__sentry_wrapped__,r[n]=r[n].__sentry_original__)});var i=n();return Object.keys(e).forEach(function(n){r[n]=e[n]}),i}function _(n,t,r,e){void 0===e&&(e={handled:!0,type:"generic"}),n.exception=n.exception||{},n.exception.values=n.exception.values||[],n.exception.values[0]=n.exception.values[0]||{},n.exception.values[0].value=n.exception.values[0].value||t||"",n.exception.values[0].type=n.exception.values[0].type||r||"Error",n.exception.values[0].mechanism=n.exception.values[0].mechanism||e}var S=w(),O="Sentry Logger ",k=function(){function n(){this.t=!1}return n.prototype.disable=function(){this.t=!1},n.prototype.enable=function(){this.t=!0},n.prototype.log=function(){for(var n=[],t=0;tr?N(n,t-1,r):e}function C(n,t){return"domain"===t&&"object"==typeof n&&n.u?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&n===global?"[Global]":"undefined"!=typeof window&&n===window?"[Window]":"undefined"!=typeof document&&n===document?"[Document]":"undefined"!=typeof Event&&n instanceof Event?Object.getPrototypeOf(n)?n.constructor.name:"Event":m(r=n)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":Number.isNaN(n)?"[NaN]":void 0===n?"[undefined]":"function"==typeof n?"[Function: "+(n.name||"")+"]":n;var r}function A(n,t,r,e){if(void 0===r&&(r=1/0),void 0===e&&(e=new R),0===r)return function(n){var t=Object.prototype.toString.call(n);if("string"==typeof n)return n;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var r=C(n);return p(r)?r:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var i=C(t,n);if(p(i))return i;var o=h(t)?function(n){var t={message:n.message,name:n.name,stack:n.stack};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}(t):t,u=Array.isArray(t)?[]:{};if(e.memoize(t))return"[Circular ~]";for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(u[c]=A(c,o[c],r-1,e));return e.unmemoize(t),u}function U(n,t){try{return JSON.parse(JSON.stringify(n,function(n,r){return A(n,r,t)}))}catch(n){return"**non-serializable**"}}var L,M=function(){function n(n){this.s=n,this.h=[]}return n.prototype.isReady=function(){return void 0===this.s||this.length()0&&r(!1)},n);Promise.all(t.h).then(function(){clearTimeout(e),r(!0)}).catch(function(){r(!0)})})},n}();function F(n,t){return void 0===t&&(t=0),"string"!=typeof n||0===t?n:n.length<=t?n:n.substr(0,t)+"..."}function P(n,t){if(!Array.isArray(n))return"";for(var r=[],e=0;e=t)return F(n[0],t);for(var r=n.length;r>0;r--){var e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:F(e,t)}return""}function q(n,t){return r=t,"[object RegExp]"===Object.prototype.toString.call(r)?t.test(n):"string"==typeof t&&n.includes(t);var r}function H(){if(!("fetch"in w()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(n){return!1}}function W(){if(!H())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(n){return!1}}!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(L||(L={}));var B=function(){function n(n){var t=this;this.l=L.PENDING,this.v=[],this.p=function(n){t.m(n,L.RESOLVED)},this.g=function(n){t.m(n,L.REJECTED)},this.m=function(n,r){t.l===L.PENDING&&(y(n)?n.then(t.p,t.g):(t.j=n,t.l=r,t._()))},this._=function(){t.l!==L.PENDING&&(t.l===L.REJECTED?t.v.forEach(function(n){return n.onFail&&n.onFail(t.j)}):t.v.forEach(function(n){return n.onSuccess&&n.onSuccess(t.j)}),t.v=[])},this.S=function(n){t.v=t.v.concat(n),t._()};try{n(this.p,this.g)}catch(n){this.g(n)}}return n.prototype.then=function(t,r){var e=this;return new n(function(n,i){e.S({onFail:function(t){if(r)try{return void n(r(t))}catch(n){return void i(n)}else i(t)},onSuccess:function(r){if(t)try{return void n(t(r))}catch(n){return void i(n)}else n(r)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(t){return new n(function(n){n(t)})},n.reject=function(t){return new n(function(n,r){r(t)})},n}(),J=/^[ \t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \t]*$/,X=function(){function n(n,t,r,e){void 0===n&&(n=g()),void 0===t&&(t=g().substring(16)),this.O=n,this.k=t,this.T=r,this.R=e}return n.prototype.setParent=function(n){return this.R=n,this},n.prototype.setSampled=function(n){return this.T=n,this},n.fromTraceparent=function(t){var r=t.match(J);if(r){var e=void 0;"1"===r[3]?e=!0:"0"===r[3]&&(e=!1);var i=new n(r[1],r[2],e);return new n(r[1],void 0,e,i)}},n.prototype.toTraceparent=function(){var n="";return!0===this.T?n="-1":!1===this.T&&(n="-0"),this.O+"-"+this.k+n},n.prototype.toJSON=function(){return{parent:this.R&&this.R.toJSON()||void 0,sampled:this.T,span_id:this.k,trace_id:this.O}},n}(),z=function(){function n(){this.D=!1,this.I=[],this.N=[],this.C=[],this.A={},this.U={},this.L={},this.M={}}return n.prototype.addScopeListener=function(n){this.I.push(n)},n.prototype.addEventProcessor=function(n){return this.N.push(n),this},n.prototype.F=function(){var n=this;this.D||(this.D=!0,setTimeout(function(){n.I.forEach(function(t){t(n)}),n.D=!1}))},n.prototype.P=function(n,t,r,e){var i=this;return void 0===e&&(e=0),new B(function(o,c){var s=n[e];if(null===t||"function"!=typeof s)o(t);else{var a=s(u({},t),r);y(a)?a.then(function(t){return i.P(n,t,r,e+1).then(o)}).catch(c):i.P(n,a,r,e+1).then(o).catch(c)}})},n.prototype.setUser=function(n){return this.A=U(n),this.F(),this},n.prototype.setTags=function(n){return this.U=u({},this.U,U(n)),this.F(),this},n.prototype.setTag=function(n,t){var r;return this.U=u({},this.U,((r={})[n]=U(t),r)),this.F(),this},n.prototype.setExtras=function(n){return this.L=u({},this.L,U(n)),this.F(),this},n.prototype.setExtra=function(n,t){var r;return this.L=u({},this.L,((r={})[n]=U(t),r)),this.F(),this},n.prototype.setFingerprint=function(n){return this.$=U(n),this.F(),this},n.prototype.setLevel=function(n){return this.q=U(n),this.F(),this},n.prototype.setTransaction=function(n){return this.H=n,this.F(),this},n.prototype.setContext=function(n,t){return this.M[n]=t?U(t):void 0,this.F(),this},n.prototype.setSpan=function(n){return this.W=n,this.F(),this},n.prototype.startSpan=function(n){var t=new X;return t.setParent(n),this.setSpan(t),t},n.prototype.getSpan=function(){return this.W},n.clone=function(t){var r=new n;return Object.assign(r,t,{I:[]}),t&&(r.C=s(t.C),r.U=u({},t.U),r.L=u({},t.L),r.M=u({},t.M),r.A=t.A,r.q=t.q,r.W=t.W,r.H=t.H,r.$=t.$,r.N=s(t.N)),r},n.prototype.clear=function(){return this.C=[],this.U={},this.L={},this.A={},this.M={},this.q=void 0,this.H=void 0,this.$=void 0,this.W=void 0,this.F(),this},n.prototype.addBreadcrumb=function(n,t){var r=(new Date).getTime()/1e3,e=u({timestamp:r},n);return this.C=void 0!==t&&t>=0?s(this.C,[U(e)]).slice(-t):s(this.C,[U(e)]),this.F(),this},n.prototype.clearBreadcrumbs=function(){return this.C=[],this.F(),this},n.prototype.B=function(n){n.fingerprint=n.fingerprint?Array.isArray(n.fingerprint)?n.fingerprint:[n.fingerprint]:[],this.$&&(n.fingerprint=n.fingerprint.concat(this.$)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint},n.prototype.applyToEvent=function(n,t){return this.L&&Object.keys(this.L).length&&(n.extra=u({},this.L,n.extra)),this.U&&Object.keys(this.U).length&&(n.tags=u({},this.U,n.tags)),this.A&&Object.keys(this.A).length&&(n.user=u({},this.A,n.user)),this.M&&Object.keys(this.M).length&&(n.contexts=u({},this.M,n.contexts)),this.q&&(n.level=this.q),this.H&&(n.transaction=this.H),this.W&&(n.contexts=n.contexts||{},n.contexts.trace=this.W),this.B(n),n.breadcrumbs=s(n.breadcrumbs||[],this.C),n.breadcrumbs=n.breadcrumbs.length>0?n.breadcrumbs:void 0,this.P(s(G(),this.N),n,t)},n}();function G(){var n=w();return n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.globalEventProcessors=n.__SENTRY__.globalEventProcessors||[],n.__SENTRY__.globalEventProcessors}function V(n){G().push(n)}var K=3,Z=function(){function n(n,t,r){void 0===t&&(t=new z),void 0===r&&(r=K),this.J=r,this.X=[],this.X.push({client:n,scope:t})}return n.prototype.G=function(n){for(var t,r=[],e=1;e0?n[n.length-1].scope:void 0,r=z.clone(t);return this.getStack().push({client:this.getClient(),scope:r}),r},n.prototype.popScope=function(){return void 0!==this.getStack().pop()},n.prototype.withScope=function(n){var t=this.pushScope();try{n(t)}finally{this.popScope()}},n.prototype.getClient=function(){return this.getStackTop().client},n.prototype.getScope=function(){return this.getStackTop().scope},n.prototype.getStack=function(){return this.X},n.prototype.getStackTop=function(){return this.X[this.X.length-1]},n.prototype.captureException=function(n,t){var r=this.V=g(),e=t;if(!t){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(n){i=n}e={originalException:n,syntheticException:i}}return this.G("captureException",n,u({},e,{event_id:r})),r},n.prototype.captureMessage=function(n,t,r){var e=this.V=g(),i=r;if(!r){var o=void 0;try{throw new Error(n)}catch(n){o=n}i={originalException:n,syntheticException:o}}return this.G("captureMessage",n,t,u({},i,{event_id:e})),e},n.prototype.captureEvent=function(n,t){var r=this.V=g();return this.G("captureEvent",n,u({},t,{event_id:r})),r},n.prototype.lastEventId=function(){return this.V},n.prototype.addBreadcrumb=function(n,t){var r=this.getStackTop();if(r.scope&&r.client){var e=r.client.getOptions&&r.client.getOptions()||{},i=e.beforeBreadcrumb,o=void 0===i?null:i,c=e.maxBreadcrumbs,s=void 0===c?30:c;if(!(s<=0)){var a=(new Date).getTime()/1e3,f=u({timestamp:a},n),h=o?x(function(){return o(f,t)}):f;null!==h&&r.scope.addBreadcrumb(h,Math.min(s,100))}}},n.prototype.setUser=function(n){var t=this.getStackTop();t.scope&&t.scope.setUser(n)},n.prototype.setTags=function(n){var t=this.getStackTop();t.scope&&t.scope.setTags(n)},n.prototype.setExtras=function(n){var t=this.getStackTop();t.scope&&t.scope.setExtras(n)},n.prototype.setTag=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setTag(n,t)},n.prototype.setExtra=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setExtra(n,t)},n.prototype.setContext=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setContext(n,t)},n.prototype.configureScope=function(n){var t=this.getStackTop();t.scope&&t.client&&n(t.scope)},n.prototype.run=function(n){var t=Y(this);try{n(this)}finally{Y(t)}},n.prototype.getIntegration=function(n){var t=this.getClient();if(!t)return null;try{return t.getIntegration(n)}catch(t){return T.warn("Cannot retrieve integration "+n.id+" from the current Hub"),null}},n.prototype.traceHeaders=function(){var n=this.getStackTop();if(n.scope&&n.client){var t=n.scope.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}},n}();function Q(){var n=w();return n.__SENTRY__=n.__SENTRY__||{hub:void 0},n}function Y(n){var t=Q(),r=rn(t);return en(t,n),r}function nn(){var n,t,r=Q();tn(r)&&!rn(r).isOlderThan(K)||en(r,new Z);try{var e=(n=module,t="domain",n.require(t)).active;if(!e)return rn(r);if(!tn(e)||rn(e).isOlderThan(K)){var i=rn(r).getStackTop();en(e,new Z(i.client,z.clone(i.scope)))}return rn(e)}catch(n){return rn(r)}}function tn(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function rn(n){return n&&n.__SENTRY__&&n.__SENTRY__.hub?n.__SENTRY__.hub:(n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.hub=new Z,n.__SENTRY__.hub)}function en(n,t){return!!n&&(n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.hub=t,!0)}function on(n){for(var t=[],r=1;r1&&(l=d.slice(0,-1).join("/"),v=d.pop()),Object.assign(this,{host:s,pass:u,path:l,projectId:v,port:h,protocol:e,user:i})},n.prototype.Z=function(n){this.protocol=n.protocol,this.user=n.user,this.pass=n.pass||"",this.host=n.host,this.port=n.port||"",this.path=n.path||"",this.projectId=n.projectId},n.prototype.Y=function(){var n=this;if(["protocol","user","host","projectId"].forEach(function(t){if(!n[t])throw new f("Invalid Dsn")}),"http"!==this.protocol&&"https"!==this.protocol)throw new f("Invalid Dsn");if(this.port&&Number.isNaN(parseInt(this.port,10)))throw new f("Invalid Dsn")},n}(),an=function(){function n(n){this.dsn=n,this.nn=new sn(n)}return n.prototype.getDsn=function(){return this.nn},n.prototype.getStoreEndpoint=function(){return""+this.tn()+this.getStoreEndpointPath()},n.prototype.getStoreEndpointWithUrlEncodedAuth=function(){var n,t={sentry_key:this.nn.user,sentry_version:"7"};return this.getStoreEndpoint()+"?"+(n=t,Object.keys(n).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(n[t])}).join("&"))},n.prototype.tn=function(){var n=this.nn,t=n.protocol?n.protocol+":":"",r=n.port?":"+n.port:"";return t+"//"+n.host+r},n.prototype.getStoreEndpointPath=function(){var n=this.nn;return(n.path?"/"+n.path:"")+"/api/"+n.projectId+"/store/"},n.prototype.getRequestHeaders=function(n,t){var r=this.nn,e=["Sentry sentry_version=7"];return e.push("sentry_timestamp="+(new Date).getTime()),e.push("sentry_client="+n+"/"+t),e.push("sentry_key="+r.user),r.pass&&e.push("sentry_secret="+r.pass),{"Content-Type":"application/json","X-Sentry-Auth":e.join(", ")}},n.prototype.getReportDialogEndpoint=function(n){void 0===n&&(n={});var t=this.nn,r=this.tn()+(t.path?"/"+t.path:"")+"/api/embed/error-page/",e=[];for(var i in e.push("dsn="+t.toString()),n)if("user"===i){if(!n.user)continue;n.user.name&&e.push("name="+encodeURIComponent(n.user.name)),n.user.email&&e.push("email="+encodeURIComponent(n.user.email))}else e.push(encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return e.length?r+"?"+e.join("&"):r},n}(),fn=[];function hn(n){var t={};return function(n){var t=n.defaultIntegrations&&s(n.defaultIntegrations)||[],r=n.integrations,e=[];if(Array.isArray(r)){var i=r.map(function(n){return n.name}),o=[];t.forEach(function(n){-1===i.indexOf(n.name)&&-1===o.indexOf(n.name)&&(e.push(n),o.push(n.name))}),r.forEach(function(n){-1===o.indexOf(n.name)&&(e.push(n),o.push(n.name))})}else{if("function"!=typeof r)return s(t);e=r(t),e=Array.isArray(e)?e:[e]}return e}(n).forEach(function(n){t[n.name]=n,function(n){-1===fn.indexOf(n.name)&&(n.setupOnce(V,nn),fn.push(n.name),T.log("Integration installed: "+n.name))}(n)}),t}var ln,vn=function(){function n(n,t){this.rn={},this.en=!1,this.in=new n(t),this.on=t,t.dsn&&(this.un=new sn(t.dsn)),this.cn()&&(this.rn=hn(this.on))}return n.prototype.captureException=function(n,t,r){var e=this,i=t&&t.event_id;return this.en=!0,this.sn().eventFromException(n,t).then(function(n){return e.an(n,t,r)}).then(function(n){i=n&&n.event_id,e.en=!1}).catch(function(n){T.error(n),e.en=!1}),i},n.prototype.captureMessage=function(n,t,r,e){var i=this,o=r&&r.event_id;return this.en=!0,(p(n)?this.sn().eventFromMessage(""+n,t,r):this.sn().eventFromException(n,r)).then(function(n){return i.an(n,r,e)}).then(function(n){o=n&&n.event_id,i.en=!1}).catch(function(n){T.error(n),i.en=!1}),o},n.prototype.captureEvent=function(n,t,r){var e=this,i=t&&t.event_id;return this.en=!0,this.an(n,t,r).then(function(n){i=n&&n.event_id,e.en=!1}).catch(function(n){T.error(n),e.en=!1}),i},n.prototype.getDsn=function(){return this.un},n.prototype.getOptions=function(){return this.on},n.prototype.flush=function(n){var t=this;return this.fn(n).then(function(r){return clearInterval(r.interval),t.sn().getTransport().close(n).then(function(n){return r.ready&&n})})},n.prototype.close=function(n){var t=this;return this.flush(n).then(function(n){return t.getOptions().enabled=!1,n})},n.prototype.getIntegrations=function(){return this.rn||{}},n.prototype.getIntegration=function(n){try{return this.rn[n.id]||null}catch(t){return T.warn("Cannot retrieve integration "+n.id+" from the current Client"),null}},n.prototype.fn=function(n){var t=this;return new Promise(function(r){var e=0,i=0;clearInterval(i),i=setInterval(function(){t.en?(e+=1,n&&e>=n&&r({interval:i,ready:!1})):r({interval:i,ready:!0})},1)})},n.prototype.sn=function(){return this.in},n.prototype.cn=function(){return!1!==this.getOptions().enabled&&void 0!==this.un},n.prototype.hn=function(n,t,r){var e=this.getOptions(),i=e.environment,o=e.release,c=e.dist,s=e.maxValueLength,a=void 0===s?250:s,f=u({},n);void 0===f.environment&&void 0!==i&&(f.environment=i),void 0===f.release&&void 0!==o&&(f.release=o),void 0===f.dist&&void 0!==c&&(f.dist=c),f.message&&(f.message=F(f.message,a));var h=f.exception&&f.exception.values&&f.exception.values[0];h&&h.value&&(h.value=F(h.value,a));var l=f.request;l&&l.url&&(l.url=F(l.url,a)),void 0===f.event_id&&(f.event_id=g()),this.ln(f.sdk);var v=B.resolve(f);return t&&(v=t.applyToEvent(f,r)),v},n.prototype.ln=function(n){var t=Object.keys(this.rn);n&&t.length>0&&(n.integrations=t)},n.prototype.an=function(n,t,r){var e=this,i=this.getOptions(),o=i.beforeSend,u=i.sampleRate;return this.cn()?"number"==typeof u&&Math.random()>u?B.reject("This event has been sampled, will not send event."):new B(function(i,u){e.hn(n,r,t).then(function(n){if(null!==n){var r=n;try{if(t&&t.data&&!0===t.data.__sentry__||!o)return e.sn().sendEvent(r),void i(r);var c=o(n,t);if(void 0===c)T.error("`beforeSend` method has to return `null` or a valid event.");else if(y(c))e.vn(c,i,u);else{if(null===(r=c))return T.log("`beforeSend` returned `null`, will not send event."),void i(null);e.sn().sendEvent(r),i(r)}}catch(n){e.captureException(n,{data:{__sentry__:!0},originalException:n}),u("`beforeSend` throw an error, will not send event.")}}else u("An event processor returned null, will not send event.")})}):B.reject("SDK not enabled, will not send event.")},n.prototype.vn=function(n,t,r){var e=this;n.then(function(n){null!==n?(e.sn().sendEvent(n),t(n)):r("`beforeSend` returned `null`, will not send event.")}).catch(function(n){r("beforeSend rejected with "+n)})},n}(),dn=function(){function t(){}return t.prototype.sendEvent=function(t){return Promise.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:n.Status.Skipped})},t.prototype.close=function(n){return Promise.resolve(!0)},t}(),pn=function(){function n(n){this.on=n,this.on.dsn||T.warn("No DSN provided, backend will not do anything."),this.dn=this.pn()}return n.prototype.pn=function(){return new dn},n.prototype.eventFromException=function(n,t){throw new f("Backend has to implement `eventFromException` method")},n.prototype.eventFromMessage=function(n,t,r){throw new f("Backend has to implement `eventFromMessage` method")},n.prototype.sendEvent=function(n){this.dn.sendEvent(n).catch(function(n){T.error("Error while sending event: "+n)})},n.prototype.getTransport=function(){return this.dn},n}();var mn=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){ln=Function.prototype.toString,Function.prototype.toString=function(){for(var n=[],t=0;t|[-a-z]+:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,a=n.stack.split("\n"),f=[],h=/^(.*) is undefined$/.exec(n.message),l=0,v=a.length;l eval")>-1&&(t=c.exec(r[3]))?(r[1]=r[1]||"eval",r[3]=t[1],r[4]=t[2],r[5]=""):0!==l||r[5]||void 0===n.columnNumber||(f[0].column=n.columnNumber+1),e={url:r[3],func:r[1]||jn,args:r[2]?r[2].split(","):[],line:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}!e.func&&e.line&&(e.func=jn),e.context=null,f.push(e)}return f.length?(f[0]&&f[0].line&&!f[0].column&&h&&(f[0].column=null),{mode:"stack",name:n.name,message:n.message,stack:f}):null}function t(n,t,r,e){var i={url:t,line:r};if(i.url&&i.line){if(n.incomplete=!1,i.func||(i.func=jn),i.context||(i.context=null),/ '([^']+)' /.exec(e)&&(i.column=null),n.stack.length>0&&n.stack[0].url===i.url){if(n.stack[0].line===i.line)return!1;if(!n.stack[0].line&&n.stack[0].func===i.func)return n.stack[0].line=i.line,n.stack[0].context=i.context,!1}return n.stack.unshift(i),n.partial=!0,!0}return n.incomplete=!0,!1}function r(n,e){for(var i,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},a=!1,f=r.caller;f&&!a;f=f.caller)if(f!==Rn&&f!==En._n){if(o={url:null,func:jn,args:[],line:null,column:null},f.name?o.func=f.name:(i=u.exec(f.toString()))&&(o.func=i[1]),void 0===o.func)try{o.func=i.input.substring(0,i.input.indexOf("{"))}catch(n){}s[""+f]?a=!0:s[""+f]=!0,c.push(o)}e&&c.splice(0,e);var h={mode:"callers",name:n.name,message:n.message,stack:c};return t(h,n.sourceURL||n.fileName,n.line||n.lineNumber,n.message||n.description),h}function e(t,e){var i=null;e=null==e?0:+e;try{if(i=function(n){var t=n.stacktrace;if(t){for(var r,e=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),u=[],c=0;c"}0!==t.length&&nn().addBreadcrumb({category:"ui."+n,message:t},{event:r,name:n})};zn&&clearTimeout(zn),t?zn=setTimeout(e):e()}}}function Vn(){return function(n){var t;try{t=n.target}catch(n){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(An||Gn("input")(n),clearTimeout(An),An=setTimeout(function(){An=void 0},Bn))}}function Kn(n){for(var t,r=n,e=[],i=0,o=0,u=" > ".length;r&&i++<5&&!("html"===(t=Zn(r))||i>1&&o+e.length*u+t.length>=80);)e.push(t),o+=t.length,r=r.parentNode;return e.reverse().join(" > ")}function Zn(n){var t,r,e,i,o,u=[];if(!n||!n.tagName)return"";if(u.push(n.tagName.toLowerCase()),n.id&&u.push("#"+n.id),(t=n.className)&&d(t))for(r=t.split(/\s+/),o=0;o0)){var i=nn().getIntegration(t);i&&nn().captureEvent(i.An(n,e),{data:{stack:n},originalException:e})}}),this.on.onerror&&(T.log("Global Handler attached: onerror"),kn()),this.on.onunhandledrejection&&(T.log("Global Handler attached: onunhandledrejection"),Tn())},t.prototype.An=function(n,t){if(!d(n.message)&&"onunhandledrejection"!==n.mechanism){var r=n.message;n.message=r.error&&d(r.error.message)?r.error.message:"No error message"}if("onunhandledrejection"===n.mechanism&&n.incomplete)return this.Un(n,t);var e=Nn(n),i={mode:n.mode};n.message&&(i.message=n.message),n.name&&(i.name=n.name);var o=nn().getClient(),u=o&&o.getOptions().maxValueLength||250;return _(e,n.original?F(JSON.stringify(U(n.original)),u):"","onunhandledrejection"===n.mechanism?"UnhandledRejection":"Error",{data:i,handled:!1,type:n.mechanism}),e},t.prototype.Un=function(t,r){var e={level:n.Severity.Error};return p(r)?e.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+r}]}:(e.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with keys: "+$(Object.keys(r).sort())}]},e.extra={__serialized__:N(r)}),e.exception.values&&e.exception.values[0]&&(e.exception.values[0].mechanism={data:u({incomplete:!0,mode:t.mode},t.message&&{message:t.message},t.name&&{name:t.name}),handled:!1,type:t.mechanism}),e},t.id="GlobalHandlers",t}(),Yn=function(){function n(){this.Ln=0,this.name=n.id}return n.prototype.Mn=function(n){return function(){for(var t=[],r=0;r"}catch(n){return""}}var tt,rt=w(),et=function(){function t(n){this.name=t.id,this.on=u({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},n)}return t.prototype.$n=function(){"console"in rt&&["debug","info","warn","error","log","assert"].forEach(function(r){r in rt.console&&D(rt.console,r,function(e){return function(){for(var i=[],o=0;o2?t[2]:void 0;return e&&u(tt,String(e)),n.apply(this,t)}}},t.prototype.Bn=function(){if("XMLHttpRequest"in rt){var n=XMLHttpRequest.prototype;D(n,"open",function(n){return function(){for(var t=[],r=0;r"},handled:!0,type:"instrument"}})})}(n,i)}),"onreadystatechange"in i&&"function"==typeof i.onreadystatechange?D(i,"onreadystatechange",function(n){return Xn(n,{mechanism:{data:{function:"onreadystatechange",handler:n&&n.name||""},handled:!0,type:"instrument"}},o)}):i.onreadystatechange=o,n.apply(this,r)}})}},t.addBreadcrumb=function(n,r){nn().getIntegration(t)&&nn().addBreadcrumb(n,r)},t.prototype.setupOnce=function(){this.on.console&&this.$n(),this.on.dom&&this.qn(),this.on.xhr&&this.Bn(),this.on.fetch&&this.Hn(),this.on.history&&this.Wn()},t.id="Breadcrumbs",t}();function it(t){try{var r=JSON.parse(t);et.addBreadcrumb({category:"sentry",event_id:r.event_id,level:r.level||n.Severity.fromString("error"),message:j(r)},{event:r})}catch(n){T.error("Error while adding sentry type breadcrumb")}}var ot="cause",ut=5,ct=function(){function n(t){void 0===t&&(t={}),this.name=n.id,this.Jn=t.key||ot,this.s=t.limit||ut}return n.prototype.setupOnce=function(){V(function(t,r){var e=nn().getIntegration(n);return e?e.Xn(t,r):t})},n.prototype.Xn=function(n,t){if(!(n.exception&&n.exception.values&&t&&t.originalException instanceof Error))return n;var r=this.zn(t.originalException,this.Jn);return n.exception.values=s(r,n.exception.values),n},n.prototype.zn=function(n,t,r){if(void 0===r&&(r=[]),!(n[t]instanceof Error)||r.length+1>=this.s)return r;var e=In(Rn(n[t]));return this.zn(n[t],t,s([e],r))},n.id="LinkedErrors",n}(),st=w(),at=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){V(function(t){if(nn().getIntegration(n)){if(!st.navigator||!st.location)return t;var r=t.request||{};return r.url=r.url||st.location.href,r.headers=r.headers||{},r.headers["User-Agent"]=st.navigator.userAgent,u({},t,{request:r})}return t})},n.id="UserAgent",n}(),ft=Object.freeze({GlobalHandlers:Qn,TryCatch:Yn,Breadcrumbs:et,LinkedErrors:ct,UserAgent:at}),ht=[new bn,new mn,new Yn,new et,new Qn,new ct,new at];var lt={},vt=w();vt.Sentry&&vt.Sentry.Integrations&&(lt=vt.Sentry.Integrations);var dt=u({},lt,wn,ft);return n.BrowserClient=Wn,n.Hub=Z,n.Integrations=dt,n.SDK_NAME=Hn,n.SDK_VERSION="5.6.1",n.Scope=z,n.Span=X,n.Transports=$n,n.addBreadcrumb=function(n){on("addBreadcrumb",n)},n.addGlobalEventProcessor=V,n.captureEvent=function(n){return on("captureEvent",n)},n.captureException=captureException,n.captureMessage=function(n,t){var r;try{throw new Error(n)}catch(n){r=n}return on("captureMessage",n,t,{originalException:n,syntheticException:r})},n.close=function(n){var t=nn().getClient();return t?t.close(n):Promise.reject(!1)},n.configureScope=function(n){on("configureScope",n)},n.defaultIntegrations=ht,n.flush=function(n){var t=nn().getClient();return t?t.flush(n):Promise.reject(!1)},n.forceLoad=function(){},n.getCurrentHub=nn,n.getHubFromCarrier=rn,n.init=function(n){if(void 0===n&&(n={}),void 0===n.defaultIntegrations&&(n.defaultIntegrations=ht),void 0===n.release){var t=w();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(n.release=t.SENTRY_RELEASE.id)}!function(n,t){!0===t.debug&&T.enable(),nn().bindClient(new n(t))}(Wn,n)},n.lastEventId=function(){return nn().lastEventId()},n.onLoad=function(n){n()},n.setContext=function(n,t){on("setContext",n,t)},n.setExtra=function(n,t){on("setExtra",n,t)},n.setExtras=function(n){on("setExtras",n)},n.setTag=function(n,t){on("setTag",n,t)},n.setTags=function(n){on("setTags",n)},n.setUser=function(n){on("setUser",n)},n.showReportDialog=function(n){void 0===n&&(n={}),n.eventId||(n.eventId=nn().lastEventId());var t=nn().getClient();t&&t.showReportDialog(n)},n.withScope=un,n.wrap=function(n){return Xn(n)()},n}({}); diff --git a/src/main/frontend/components/settings.cljs b/src/main/frontend/components/settings.cljs index b3170bae740..d856614dee8 100644 --- a/src/main/frontend/components/settings.cljs +++ b/src/main/frontend/components/settings.cljs @@ -12,7 +12,7 @@ [frontend.handler.route :as route-handler] [frontend.handler.ui :as ui-handler] [frontend.handler.user :as user-handler] - [frontend.modules.instrumentation.posthog :as posthog] + [frontend.modules.instrumentation.core :as instrument] [frontend.state :as state] [frontend.ui :as ui] [frontend.util :as util] @@ -145,11 +145,6 @@ :width 500 :height 500}]]) -(defn set-sentry-disabled! - [value] - (posthog/opt-out value) - (state/set-sentry-disabled! value)) - (rum/defcs settings < rum/reactive [] (let [preferred-format (state/get-preferred-format) @@ -160,7 +155,7 @@ current-repo (state/get-current-repo) enable-journals? (state/enable-journals? current-repo) enable-encryption? (state/enable-encryption? current-repo) - sentry-disabled? (state/sub :sentry/disabled?) + instrument-disabled? (state/sub :instrument/disabled?) logical-outdenting? (state/logical-outdenting?) enable-tooltip? (state/enable-tooltip?) enable-git-auto-push? (state/enable-git-auto-push? current-repo) @@ -380,8 +375,9 @@ [:p "Logseq will never collect your local graph database or sell your data."] (toggle "usage-diagnostics" (t :settings-page/disable-sentry) - (not sentry-disabled?) - (fn [] (set-sentry-disabled! (not sentry-disabled?))))] + (not instrument-disabled?) + (fn [] (instrument/disable-instrument + (not instrument-disabled?))))] [:hr] diff --git a/src/main/frontend/handler.cljs b/src/main/frontend/handler.cljs index 4c90adfbd88..64ff846ad2c 100644 --- a/src/main/frontend/handler.cljs +++ b/src/main/frontend/handler.cljs @@ -15,7 +15,7 @@ [frontend.handler.repo :as repo-handler] [frontend.handler.ui :as ui-handler] [frontend.idb :as idb] - [frontend.modules.instrumentation.posthog :as posthog] + [frontend.modules.instrumentation.core :as instrument] [frontend.modules.shortcut.core :as shortcut] [frontend.search :as search] [frontend.search.db :as search-db] @@ -143,21 +143,11 @@ [{:url config/local-repo :example? true}])))) -(defn init-sentry! - [] - (when-not (state/sentry-disabled?) - (let [cfg - {:dsn "https://636e9174ffa148c98d2b9d3369661683@o416451.ingest.sentry.io/5311485" - :release (util/format "logseq@%s" version/version) - :environment (if config/dev? "development" "production") - :tracesSampleRate 1.0}] - (.init js/window.Sentry (clj->js cfg))))) - (defn on-load-events [] (set! js/window.onload (fn [] - (when-not config/dev? (init-sentry!))))) + (instrument/init)))) (defn clear-cache! [] @@ -198,8 +188,7 @@ (file-handler/run-writes-chan!) (shortcut/install-shortcuts!) (when (util/electron?) - (el/listen!)) - (posthog/init))) + (el/listen!)))) (defn stop! [] (prn "stop!")) diff --git a/src/main/frontend/modules/instrumentation/core.cljs b/src/main/frontend/modules/instrumentation/core.cljs new file mode 100644 index 00000000000..d3cf7a56620 --- /dev/null +++ b/src/main/frontend/modules/instrumentation/core.cljs @@ -0,0 +1,18 @@ +(ns frontend.modules.instrumentation.core + (:require [frontend.modules.instrumentation.posthog :as posthog] + [frontend.modules.instrumentation.sentry :as sentry] + [frontend.state :as state] + [frontend.storage :as storage])) + +(defn init + [] + (when-not (:instrument/disabled? @state/state) + (posthog/init) + (sentry/init))) + +(defn disable-instrument [disable?] + (state/set-state! :instrument/disabled? disable?) + (storage/set "instrument-disabled" disable?) + (posthog/opt-out disable?) + (when-not disable? + (sentry/init))) diff --git a/src/main/frontend/modules/instrumentation/posthog.cljs b/src/main/frontend/modules/instrumentation/posthog.cljs index 1896b7726e2..0d7edc63923 100644 --- a/src/main/frontend/modules/instrumentation/posthog.cljs +++ b/src/main/frontend/modules/instrumentation/posthog.cljs @@ -33,4 +33,6 @@ (defn opt-out [opt-out?] (if opt-out? (posthog/opt_out_capturing) - (posthog/opt_in_capturing))) + (do + (init) + (posthog/opt_in_capturing)))) diff --git a/src/main/frontend/modules/instrumentation/sentry.cljs b/src/main/frontend/modules/instrumentation/sentry.cljs new file mode 100644 index 00000000000..b2fafbbbe91 --- /dev/null +++ b/src/main/frontend/modules/instrumentation/sentry.cljs @@ -0,0 +1,17 @@ +(ns frontend.modules.instrumentation.sentry + (:require [frontend.version :refer [version]] + [frontend.util :as util] + [frontend.config :as cfg] + ["@sentry/browser" :as Sentry] + ["posthog-js" :as posthog])) + +(def config + {:dsn "https://636e9174ffa148c98d2b9d3369661683@o416451.ingest.sentry.io/5311485" + :release (util/format "logseq@%s" version) + :environment (if cfg/dev? "development" "production") + :integrations [(new posthog/SentryIntegration posthog "logseq" 5311485)] + :debug cfg/dev? + :tracesSampleRate 1.0}) + +(defn init [] + (Sentry/init (clj->js config))) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 846e354a389..7067d2327f1 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -29,7 +29,7 @@ :repo/changed-files nil :nfs/user-granted? {} :nfs/refreshing? nil - :sentry/disabled? (storage/get "sentry-disabled") + :instrument/disabled? (storage/get "instrument-disabled") ;; TODO: how to detect the network reliably? :network/online? true :indexeddb/support? true @@ -1224,15 +1224,6 @@ [value] (set-state! :block/component-editing-mode? value)) -(defn sentry-disabled? - [] - (:sentry/disabled? @state)) - -(defn set-sentry-disabled! - [value] - (set-state! :sentry/disabled? value) - (storage/set "sentry-disabled" value)) - (defn logical-outdenting? [] (:editor/logical-outdenting? diff --git a/yarn.lock b/yarn.lock index 4888441871f..dbad90711a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -242,6 +242,58 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353" integrity sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q== +"@sentry/browser@^6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.4.1.tgz#b6c62736caaade7fdf6638513d9aad138abde2ac" + integrity sha512-3cDud6GWutnJqcnheIq0lPNTsUJbrRLevQ+g1YfawVXFUxfmmY2bOsGd/Mxq17LxYeBHgKTitXv3DU1bsQ+WBQ== + dependencies: + "@sentry/core" "6.4.1" + "@sentry/types" "6.4.1" + "@sentry/utils" "6.4.1" + tslib "^1.9.3" + +"@sentry/core@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.4.1.tgz#789b0071996de5c1a20673f879408926aa3b4fa6" + integrity sha512-Lx13oTiP+Tjvm5VxulcCszNVd2S1wY4viSnr+ygq62ySVERR+t7uOZDSARZ0rZ259GwW6nkbMh9dDmD0d6VCGQ== + dependencies: + "@sentry/hub" "6.4.1" + "@sentry/minimal" "6.4.1" + "@sentry/types" "6.4.1" + "@sentry/utils" "6.4.1" + tslib "^1.9.3" + +"@sentry/hub@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.4.1.tgz#fa9c05ca32674e2e8477120b71084a1c91a5e023" + integrity sha512-7IZRP5buDE6s/c3vWzzPR/ySE+8GUuHPgTEPiDCPOCWwUN11zXDafJDKkJqY3muJfebUKmC/JG67RyBx+XlnlQ== + dependencies: + "@sentry/types" "6.4.1" + "@sentry/utils" "6.4.1" + tslib "^1.9.3" + +"@sentry/minimal@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.4.1.tgz#d3f968c060c3d3cc997071756659e24047b5dd97" + integrity sha512-4x/PRbDZACCKJqjta9EkhiIMyGMf7VgBX13EEWEDVWLP7ymFukBuTr4ap/Tz9429kB/yXZuDGGMIZp/G618H3g== + dependencies: + "@sentry/hub" "6.4.1" + "@sentry/types" "6.4.1" + tslib "^1.9.3" + +"@sentry/types@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.4.1.tgz#7c0a4355a1d04321b901197723a8f55c263226e9" + integrity sha512-sTu/GaLsLYk1AkAqpkMT4+4q665LtZjhV0hkgiTD4N3zPl5uSf1pCIzxPRYjOpe7NEANmWv8U4PaGKGtc2eMfA== + +"@sentry/utils@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.4.1.tgz#55fa7da58898773cbd538e4895fc2e4ec695ecab" + integrity sha512-xJ1uVa5fvg23pXQfulvCIBb9pQ3p1awyd1PapK2AYi+wKjTuYl4B9edmhjRREEQEExznl/d2OVm78fRXLq7M9Q== + dependencies: + "@sentry/types" "6.4.1" + tslib "^1.9.3" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz" @@ -6248,6 +6300,11 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== +tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz"