Socket
Socket
Sign inDemoInstall

@sentry/integrations

Package Overview
Dependencies
Maintainers
10
Versions
385
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/integrations - npm Package Compare versions

Comparing version 5.6.0-beta.4 to 5.6.0

48

build/tracing.js

@@ -406,4 +406,25 @@ (function (__window) {

}
if (this._options.autoStartOnDomReady !== false) {
getGlobalObject().addEventListener('DOMContentLoaded', function () {
Tracing.startTrace(getCurrentHub(), getGlobalObject().location.href);
});
getGlobalObject().document.onreadystatechange = function () {
if (document.readyState === 'complete') {
Tracing.startTrace(getCurrentHub(), getGlobalObject().location.href);
}
};
}
};
/**
* Starts a new trace
* @param hub The hub to start the trace on
* @param transaction Optional transaction
*/
Tracing.startTrace = function (hub, transaction) {
hub.configureScope(function (scope) {
scope.startSpan();
scope.setTransaction(transaction);
});
};
/**
* JSDoc

@@ -447,7 +468,2 @@ */

});
if (isMatchingPattern(url_1, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted = false;
}
if (isWhitelisted && this.setRequestHeader) {

@@ -479,29 +495,23 @@ Object.keys(headers_1).forEach(function (key) {

// @ts-ignore
var hub = getCurrentHub();
var self = hub.getIntegration(Tracing);
var self = getCurrentHub().getIntegration(Tracing);
if (self && self._options.tracingOrigins) {
var url_2 = args[0];
var options = (args[1] = args[1] || {});
var isWhitelisted_1 = false;
var whiteListed_1 = false;
self._options.tracingOrigins.forEach(function (whiteListUrl) {
if (!isWhitelisted_1) {
isWhitelisted_1 = isMatchingPattern(url_2, whiteListUrl);
if (!whiteListed_1) {
whiteListed_1 = isMatchingPattern(url_2, whiteListUrl);
}
});
if (isMatchingPattern(url_2, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted_1 = false;
}
if (isWhitelisted_1) {
if (whiteListed_1) {
if (options.headers) {
if (Array.isArray(options.headers)) {
options.headers = __spread(options.headers, Object.entries(hub.traceHeaders()));
options.headers = __spread(options.headers, Object.entries(getCurrentHub().traceHeaders()));
}
else {
options.headers = __assign({}, options.headers, hub.traceHeaders());
options.headers = __assign({}, options.headers, getCurrentHub().traceHeaders());
}
}
else {
options.headers = hub.traceHeaders();
options.headers = getCurrentHub().traceHeaders();
}

@@ -508,0 +518,0 @@ }

@@ -1,2 +0,2 @@

!function(t){var e={};Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t});!function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,i(r,n.prototype),r}(function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t)}(Error);var a={};function c(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a}function s(t){var e=c();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in e.console&&n[t].__sentry__&&(r[t]=n[t].__sentry_wrapped__,n[t]=n[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){n[t]=r[t]}),o}var f=c(),u="Sentry Logger ",p=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){f.console.log(u+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){f.console.warn(u+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){f.console.error(u+"[Error]: "+t.join(" "))})},t}();f.__SENTRY__=f.__SENTRY__||{};var l,_=f.__SENTRY__.logger||(f.__SENTRY__.logger=new p);function y(t,e,n){if(e in t){var r=t[e],o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:r},__sentry_wrapped__:{enumerable:!1,value:o}})}catch(t){}t[e]=o}}function h(t,e){return n=e,"[object RegExp]"===Object.prototype.toString.call(n)?e.test(t):"string"==typeof e&&t.includes(e);var n}function d(){if(!function(){if(!("fetch"in c()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}())return!1;var t=function(t){return-1!==t.toString().indexOf("native")},e=c(),n=null,r=e.document;if(r){var o=r.createElement("iframe");o.hidden=!0;try{r.head.appendChild(o),o.contentWindow&&o.contentWindow.fetch&&(n=t(o.contentWindow.fetch)),r.head.removeChild(o)}catch(t){_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}}return null===n&&(n=t(e.fetch)),n}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(l||(l={}));var g=function(){function t(e){if(void 0===e&&(e={}),this._options=e,this.name=t.id,!Array.isArray(e.tracingOrigins)||0===e.tracingOrigins.length){var n=["localhost",/^\//];_.warn("Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),_.warn("Sentry: We added a reasonable default for you: "+n),e.tracingOrigins=n}}return t.prototype.setupOnce=function(t,e){!1!==this._options.traceXHR&&this._traceXHR(e),!1!==this._options.traceFetch&&this._traceFetch(e)},t.prototype._traceXHR=function(e){if("XMLHttpRequest"in c()){var n=XMLHttpRequest.prototype;y(n,"open",function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=e().getIntegration(t);return i&&(i._xhrUrl=r[1]),n.apply(this,r)}}),y(n,"send",function(n){return function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=e().getIntegration(t);if(a&&a._xhrUrl&&a._options.tracingOrigins){var c=a._xhrUrl,s=e().traceHeaders(),f=a._options.tracingOrigins.some(function(t){return h(c,t)});h(c,"sentry_key")&&(f=!1),f&&this.setRequestHeader&&Object.keys(s).forEach(function(t){r.setRequestHeader(t,s[t])})}return n.apply(this,o)}})}},t.prototype._traceFetch=function(e){d()&&y(c(),"fetch",function(n){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=e(),f=s.getIntegration(t);if(f&&f._options.tracingOrigins){var u=i[0],p=i[1]=i[1]||{},l=!1;f._options.tracingOrigins.forEach(function(t){l||(l=h(u,t))}),h(u,"sentry_key")&&(l=!1),l&&(p.headers?Array.isArray(p.headers)?p.headers=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t}(p.headers,Object.entries(s.traceHeaders())):p.headers=r({},p.headers,s.traceHeaders()):p.headers=s.traceHeaders())}return n.apply(c(),i)}})},t.id="Tracing",t}();e.Tracing=g,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},Object.assign(t.Sentry.Integrations,e)}(window);
!function(t){var n={};Object.defineProperty(n,"__esModule",{value:!0});var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};var r=function(){return(r=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}var i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var e in n)t.hasOwnProperty(e)||(t[e]=n[e]);return t});!function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return r.message=n,r.name=e.prototype.constructor.name,i(r,e.prototype),r}(function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)})(n,t)}(Error);var a={};function c(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a}function s(t){var n=c();if(!("console"in n))return t();var e=n.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&e[t].__sentry__&&(r[t]=e[t].__sentry_wrapped__,e[t]=e[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){e[t]=r[t]}),o}var u=c(),f="Sentry Logger ",p=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&s(function(){u.console.log(f+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&s(function(){u.console.warn(f+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&s(function(){u.console.error(f+"[Error]: "+t.join(" "))})},t}();u.__SENTRY__=u.__SENTRY__||{};var l,_=u.__SENTRY__.logger||(u.__SENTRY__.logger=new p);function h(t,n,e){if(n in t){var r=t[n],o=e(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:r},__sentry_wrapped__:{enumerable:!1,value:o}})}catch(t){}t[n]=o}}function d(t,n){return e=n,"[object RegExp]"===Object.prototype.toString.call(e)?n.test(t):"string"==typeof n&&t.includes(n);var e}function y(){if(!function(){if(!("fetch"in c()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}())return!1;var t=function(t){return-1!==t.toString().indexOf("native")},n=c(),e=null,r=n.document;if(r){var o=r.createElement("iframe");o.hidden=!0;try{r.head.appendChild(o),o.contentWindow&&o.contentWindow.fetch&&(e=t(o.contentWindow.fetch)),r.head.removeChild(o)}catch(t){_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}}return null===e&&(e=t(n.fetch)),e}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(l||(l={}));var g=function(){function t(n){if(void 0===n&&(n={}),this._options=n,this.name=t.id,!Array.isArray(n.tracingOrigins)||0===n.tracingOrigins.length){var e=["localhost",/^\//];_.warn("Sentry: You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),_.warn("Sentry: We added a reasonable default for you: "+e),n.tracingOrigins=e}}return t.prototype.setupOnce=function(n,e){!1!==this._options.traceXHR&&this._traceXHR(e),!1!==this._options.traceFetch&&this._traceFetch(e),!1!==this._options.autoStartOnDomReady&&(c().addEventListener("DOMContentLoaded",function(){t.startTrace(e(),c().location.href)}),c().document.onreadystatechange=function(){"complete"===document.readyState&&t.startTrace(e(),c().location.href)})},t.startTrace=function(t,n){t.configureScope(function(t){t.startSpan(),t.setTransaction(n)})},t.prototype._traceXHR=function(n){if("XMLHttpRequest"in c()){var e=XMLHttpRequest.prototype;h(e,"open",function(e){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n().getIntegration(t);return i&&(i._xhrUrl=r[1]),e.apply(this,r)}}),h(e,"send",function(e){return function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=n().getIntegration(t);if(a&&a._xhrUrl&&a._options.tracingOrigins){var c=a._xhrUrl,s=n().traceHeaders();a._options.tracingOrigins.some(function(t){return d(c,t)})&&this.setRequestHeader&&Object.keys(s).forEach(function(t){r.setRequestHeader(t,s[t])})}return e.apply(this,o)}})}},t.prototype._traceFetch=function(n){y()&&h(c(),"fetch",function(e){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=n().getIntegration(t);if(s&&s._options.tracingOrigins){var u=i[0],f=i[1]=i[1]||{},p=!1;s._options.tracingOrigins.forEach(function(t){p||(p=d(u,t))}),p&&(f.headers?Array.isArray(f.headers)?f.headers=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(o(arguments[n]));return t}(f.headers,Object.entries(n().traceHeaders())):f.headers=r({},f.headers,n().traceHeaders()):f.headers=n().traceHeaders())}return e.apply(c(),i)}})},t.id="Tracing",t}();n.Tracing=g,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},Object.assign(t.Sentry.Integrations,n)}(window);
//# sourceMappingURL=tracing.min.js.map

@@ -238,4 +238,12 @@ (function (__window) {

this._attachProps = true;
/**
* When set to true, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
this._logErrors = false;
// tslint:disable-next-line: no-unsafe-any
this._Vue = options.Vue || getGlobalObject().Vue;
if (options.logErrors !== undefined) {
this._logErrors = options.logErrors;
}
if (options.attachProps === false) {

@@ -289,2 +297,9 @@ this._attachProps = false;

}
if (_this._logErrors) {
if (process && process.env && process.env.NODE_ENV !== 'production') {
_this._Vue.util.warn("Error in " + info + ": \"" + error.toString() + "\"", vm);
}
// tslint:disable-next-line:no-console
console.error(error);
}
};

@@ -291,0 +306,0 @@ };

@@ -1,2 +0,2 @@

!function(t){var o={};Object.defineProperty(o,"__esModule",{value:!0});var n=function(t,o){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])})(t,o)};var e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,o){return t.__proto__=o,t}:function(t,o){for(var n in o)t.hasOwnProperty(n)||(t[n]=o[n]);return t});!function(t){function o(o){var n=this.constructor,r=t.call(this,o)||this;return r.message=o,r.name=n.prototype.constructor.name,e(r,n.prototype),r}(function(t,o){function e(){this.constructor=t}n(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)})(o,t)}(Error);var r={};function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}function a(t){var o=i();if(!("console"in o))return t();var n=o.console,e={};["debug","info","warn","error","log","assert"].forEach(function(t){t in o.console&&n[t].__sentry__&&(e[t]=n[t].__sentry_wrapped__,n[t]=n[t].__sentry_original__)});var r=t();return Object.keys(e).forEach(function(t){n[t]=e[t]}),r}var c=i(),s="Sentry Logger ",u=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&a(function(){c.console.log(s+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&a(function(){c.console.warn(s+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&a(function(){c.console.error(s+"[Error]: "+t.join(" "))})},t}();c.__SENTRY__=c.__SENTRY__||{};var _,p=c.__SENTRY__.logger||(c.__SENTRY__.logger=new u);!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(_||(_={}));var f=function(){function t(o){void 0===o&&(o={}),this.name=t.id,this._attachProps=!0,this._Vue=o.Vue||i().Vue,!1===o.attachProps&&(this._attachProps=!1)}return t.prototype._formatComponentName=function(t){if(t.$root===t)return"root instance";var o=t._isVue?t.$options.name||t.$options._componentTag:t.name;return(o?"component <"+o+">":"anonymous component")+(t._isVue&&t.$options.__file?" at "+t.$options.__file:"")},t.prototype.setupOnce=function(o,n){var e=this;if(this._Vue&&this._Vue.config){var r=this._Vue.config.errorHandler;this._Vue.config.errorHandler=function(o,i,a){var c,s={};c=i,"[object Object]"===Object.prototype.toString.call(c)&&(s.componentName=e._formatComponentName(i),e._attachProps&&(s.propsData=i.$options.propsData)),void 0!==a&&(s.lifecycleHook=a),n().getIntegration(t)&&setTimeout(function(){n().withScope(function(t){t.setContext("vue",s),n().captureException(o)})}),"function"==typeof r&&r.call(e._Vue,o,i,a)}}else p.error("VueIntegration is missing a Vue instance")},t.id="Vue",t}();o.Vue=f,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},Object.assign(t.Sentry.Integrations,o)}(window);
!function(o){var t={};Object.defineProperty(t,"__esModule",{value:!0});var n=function(o,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var n in t)t.hasOwnProperty(n)&&(o[n]=t[n])})(o,t)};var e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(o,t){return o.__proto__=t,o}:function(o,t){for(var n in t)o.hasOwnProperty(n)||(o[n]=t[n]);return o});!function(o){function t(t){var n=this.constructor,r=o.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,e(r,n.prototype),r}(function(o,t){function e(){this.constructor=o}n(o,t),o.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)})(t,o)}(Error);var r={};function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}function s(o){var t=i();if(!("console"in t))return o();var n=t.console,e={};["debug","info","warn","error","log","assert"].forEach(function(o){o in t.console&&n[o].__sentry__&&(e[o]=n[o].__sentry_wrapped__,n[o]=n[o].__sentry_original__)});var r=o();return Object.keys(e).forEach(function(o){n[o]=e[o]}),r}var c=i(),a="Sentry Logger ",_=function(){function o(){this._enabled=!1}return o.prototype.disable=function(){this._enabled=!1},o.prototype.enable=function(){this._enabled=!0},o.prototype.log=function(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];this._enabled&&s(function(){c.console.log(a+"[Log]: "+o.join(" "))})},o.prototype.warn=function(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];this._enabled&&s(function(){c.console.warn(a+"[Warn]: "+o.join(" "))})},o.prototype.error=function(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];this._enabled&&s(function(){c.console.error(a+"[Error]: "+o.join(" "))})},o}();c.__SENTRY__=c.__SENTRY__||{};var u,p=c.__SENTRY__.logger||(c.__SENTRY__.logger=new _);!function(o){o.PENDING="PENDING",o.RESOLVED="RESOLVED",o.REJECTED="REJECTED"}(u||(u={}));var f=function(){function o(t){void 0===t&&(t={}),this.name=o.id,this._attachProps=!0,this._logErrors=!1,this._Vue=t.Vue||i().Vue,void 0!==t.logErrors&&(this._logErrors=t.logErrors),!1===t.attachProps&&(this._attachProps=!1)}return o.prototype._formatComponentName=function(o){if(o.$root===o)return"root instance";var t=o._isVue?o.$options.name||o.$options._componentTag:o.name;return(t?"component <"+t+">":"anonymous component")+(o._isVue&&o.$options.__file?" at "+o.$options.__file:"")},o.prototype.setupOnce=function(t,n){var e=this;if(this._Vue&&this._Vue.config){var r=this._Vue.config.errorHandler;this._Vue.config.errorHandler=function(t,i,s){var c,a={};c=i,"[object Object]"===Object.prototype.toString.call(c)&&(a.componentName=e._formatComponentName(i),e._attachProps&&(a.propsData=i.$options.propsData)),void 0!==s&&(a.lifecycleHook=s),n().getIntegration(o)&&setTimeout(function(){n().withScope(function(o){o.setContext("vue",a),n().captureException(t)})}),"function"==typeof r&&r.call(e._Vue,t,i,s),e._logErrors&&(process&&process.env&&"production"!==process.env.NODE_ENV&&e._Vue.util.warn("Error in "+s+': "'+t.toString()+'"',i),console.error(t))}}else p.error("VueIntegration is missing a Vue instance")},o.id="Vue",o}();t.Vue=f,o.Sentry=o.Sentry||{},o.Sentry.Integrations=o.Sentry.Integrations||{},Object.assign(o.Sentry.Integrations,t)}(window);
//# sourceMappingURL=vue.min.js.map

@@ -7,2 +7,3 @@ import { EventProcessor, Hub, Integration } from '@sentry/types';

traceXHR?: boolean;
autoStartOnDomReady?: boolean;
}

@@ -38,2 +39,8 @@ /**

/**
* Starts a new trace
* @param hub The hub to start the trace on
* @param transaction Optional transaction
*/
static startTrace(hub: Hub, transaction?: string): void;
/**
* JSDoc

@@ -40,0 +47,0 @@ */

@@ -37,4 +37,25 @@ Object.defineProperty(exports, "__esModule", { value: true });

}
if (this._options.autoStartOnDomReady !== false) {
utils_1.getGlobalObject().addEventListener('DOMContentLoaded', function () {
Tracing.startTrace(getCurrentHub(), utils_1.getGlobalObject().location.href);
});
utils_1.getGlobalObject().document.onreadystatechange = function () {
if (document.readyState === 'complete') {
Tracing.startTrace(getCurrentHub(), utils_1.getGlobalObject().location.href);
}
};
}
};
/**
* Starts a new trace
* @param hub The hub to start the trace on
* @param transaction Optional transaction
*/
Tracing.startTrace = function (hub, transaction) {
hub.configureScope(function (scope) {
scope.startSpan();
scope.setTransaction(transaction);
});
};
/**
* JSDoc

@@ -78,7 +99,2 @@ */

});
if (utils_1.isMatchingPattern(url_1, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted = false;
}
if (isWhitelisted && this.setRequestHeader) {

@@ -110,29 +126,23 @@ Object.keys(headers_1).forEach(function (key) {

// @ts-ignore
var hub = getCurrentHub();
var self = hub.getIntegration(Tracing);
var self = getCurrentHub().getIntegration(Tracing);
if (self && self._options.tracingOrigins) {
var url_2 = args[0];
var options = (args[1] = args[1] || {});
var isWhitelisted_1 = false;
var whiteListed_1 = false;
self._options.tracingOrigins.forEach(function (whiteListUrl) {
if (!isWhitelisted_1) {
isWhitelisted_1 = utils_1.isMatchingPattern(url_2, whiteListUrl);
if (!whiteListed_1) {
whiteListed_1 = utils_1.isMatchingPattern(url_2, whiteListUrl);
}
});
if (utils_1.isMatchingPattern(url_2, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted_1 = false;
}
if (isWhitelisted_1) {
if (whiteListed_1) {
if (options.headers) {
if (Array.isArray(options.headers)) {
options.headers = tslib_1.__spread(options.headers, Object.entries(hub.traceHeaders()));
options.headers = tslib_1.__spread(options.headers, Object.entries(getCurrentHub().traceHeaders()));
}
else {
options.headers = tslib_1.__assign({}, options.headers, hub.traceHeaders());
options.headers = tslib_1.__assign({}, options.headers, getCurrentHub().traceHeaders());
}
}
else {
options.headers = hub.traceHeaders();
options.headers = getCurrentHub().traceHeaders();
}

@@ -139,0 +149,0 @@ }

@@ -22,2 +22,7 @@ import { EventProcessor, Hub, Integration } from '@sentry/types';

/**
* When set to true, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
private readonly _logErrors;
/**
* @inheritDoc

@@ -28,2 +33,3 @@ */

attachProps?: boolean;
logErrors?: boolean;
});

@@ -30,0 +36,0 @@ /** JSDoc */

@@ -19,4 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });

this._attachProps = true;
/**
* When set to true, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
this._logErrors = false;
// tslint:disable-next-line: no-unsafe-any
this._Vue = options.Vue || utils_1.getGlobalObject().Vue;
if (options.logErrors !== undefined) {
this._logErrors = options.logErrors;
}
if (options.attachProps === false) {

@@ -70,2 +78,9 @@ this._attachProps = false;

}
if (_this._logErrors) {
if (process && process.env && process.env.NODE_ENV !== 'production') {
_this._Vue.util.warn("Error in " + info + ": \"" + error.toString() + "\"", vm);
}
// tslint:disable-next-line:no-console
console.error(error);
}
};

@@ -72,0 +87,0 @@ };

@@ -7,2 +7,3 @@ import { EventProcessor, Hub, Integration } from '@sentry/types';

traceXHR?: boolean;
autoStartOnDomReady?: boolean;
}

@@ -38,2 +39,8 @@ /**

/**
* Starts a new trace
* @param hub The hub to start the trace on
* @param transaction Optional transaction
*/
static startTrace(hub: Hub, transaction?: string): void;
/**
* JSDoc

@@ -40,0 +47,0 @@ */

@@ -36,4 +36,25 @@ import * as tslib_1 from "tslib";

}
if (this._options.autoStartOnDomReady !== false) {
getGlobalObject().addEventListener('DOMContentLoaded', function () {
Tracing.startTrace(getCurrentHub(), getGlobalObject().location.href);
});
getGlobalObject().document.onreadystatechange = function () {
if (document.readyState === 'complete') {
Tracing.startTrace(getCurrentHub(), getGlobalObject().location.href);
}
};
}
};
/**
* Starts a new trace
* @param hub The hub to start the trace on
* @param transaction Optional transaction
*/
Tracing.startTrace = function (hub, transaction) {
hub.configureScope(function (scope) {
scope.startSpan();
scope.setTransaction(transaction);
});
};
/**
* JSDoc

@@ -77,7 +98,2 @@ */

});
if (isMatchingPattern(url_1, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted = false;
}
if (isWhitelisted && this.setRequestHeader) {

@@ -109,29 +125,23 @@ Object.keys(headers_1).forEach(function (key) {

// @ts-ignore
var hub = getCurrentHub();
var self = hub.getIntegration(Tracing);
var self = getCurrentHub().getIntegration(Tracing);
if (self && self._options.tracingOrigins) {
var url_2 = args[0];
var options = (args[1] = args[1] || {});
var isWhitelisted_1 = false;
var whiteListed_1 = false;
self._options.tracingOrigins.forEach(function (whiteListUrl) {
if (!isWhitelisted_1) {
isWhitelisted_1 = isMatchingPattern(url_2, whiteListUrl);
if (!whiteListed_1) {
whiteListed_1 = isMatchingPattern(url_2, whiteListUrl);
}
});
if (isMatchingPattern(url_2, 'sentry_key')) {
// If sentry_key is in the url, it's an internal store request to sentry
// we do not want to add the trace header to store requests
isWhitelisted_1 = false;
}
if (isWhitelisted_1) {
if (whiteListed_1) {
if (options.headers) {
if (Array.isArray(options.headers)) {
options.headers = tslib_1.__spread(options.headers, Object.entries(hub.traceHeaders()));
options.headers = tslib_1.__spread(options.headers, Object.entries(getCurrentHub().traceHeaders()));
}
else {
options.headers = tslib_1.__assign({}, options.headers, hub.traceHeaders());
options.headers = tslib_1.__assign({}, options.headers, getCurrentHub().traceHeaders());
}
}
else {
options.headers = hub.traceHeaders();
options.headers = getCurrentHub().traceHeaders();
}

@@ -138,0 +148,0 @@ }

@@ -22,2 +22,7 @@ import { EventProcessor, Hub, Integration } from '@sentry/types';

/**
* When set to true, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
private readonly _logErrors;
/**
* @inheritDoc

@@ -28,2 +33,3 @@ */

attachProps?: boolean;
logErrors?: boolean;
});

@@ -30,0 +36,0 @@ /** JSDoc */

@@ -18,4 +18,12 @@ import { getGlobalObject, isPlainObject, logger } from '@sentry/utils';

this._attachProps = true;
/**
* When set to true, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
this._logErrors = false;
// tslint:disable-next-line: no-unsafe-any
this._Vue = options.Vue || getGlobalObject().Vue;
if (options.logErrors !== undefined) {
this._logErrors = options.logErrors;
}
if (options.attachProps === false) {

@@ -69,2 +77,9 @@ this._attachProps = false;

}
if (_this._logErrors) {
if (process && process.env && process.env.NODE_ENV !== 'production') {
_this._Vue.util.warn("Error in " + info + ": \"" + error.toString() + "\"", vm);
}
// tslint:disable-next-line:no-console
console.error(error);
}
};

@@ -71,0 +86,0 @@ };

{
"name": "@sentry/integrations",
"version": "5.6.0-beta.4",
"version": "5.6.0",
"description": "Pluggable integrations that can be used to enchance JS SDKs",

@@ -19,4 +19,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/types": "5.6.0-beta.4",
"@sentry/utils": "5.6.0-beta.4",
"@sentry/types": "5.6.0",
"@sentry/utils": "5.6.0",
"tslib": "^1.9.3"

@@ -23,0 +23,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc