Comparing version 0.1.1 to 0.1.3
@@ -71,3 +71,3 @@ (function (global, factory) { | ||
var version = "0.1.0"; | ||
var version = "0.1.3"; | ||
@@ -112,2 +112,6 @@ function Sentry(config) { | ||
}; | ||
if (typeof config.release === 'string') { | ||
this.payload.release = config.release; | ||
} | ||
} | ||
@@ -114,0 +118,0 @@ |
{ | ||
"name": "columbidae", | ||
"moduleName": "ColumbidaeJS", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"description": "Error reporter for Stackdriver or Sentry", | ||
@@ -6,0 +6,0 @@ "main": "dist/columbidae.js", |
@@ -27,3 +27,3 @@ import json from 'rollup-plugin-json' | ||
export default { | ||
moduleName: pkg.moduleNam + 'Example', | ||
moduleName: pkg.moduleName + 'Example', | ||
entry: 'src/example.js', | ||
@@ -30,0 +30,0 @@ dest: 'test/public/example.js', |
@@ -43,2 +43,6 @@ import { extractException, sendBeacon } from './util'; | ||
} | ||
if (typeof config.release === 'string') { | ||
this.payload.release = config.release; | ||
} | ||
} | ||
@@ -45,0 +49,0 @@ |
@@ -37,2 +37,3 @@ import assert from 'assert' | ||
if (res.statusCode != 200) { | ||
console.log(res.body); | ||
return reject(new Error(`id:${id} status:${res.statusCode}`)) | ||
@@ -52,2 +53,9 @@ } | ||
describe('Sentry', () => { | ||
after(() => { | ||
const errors = browser.execute('return window.errors').value; | ||
if (errors.length > 0) { | ||
assert(errors); | ||
} | ||
}); | ||
it('send error', () => { | ||
@@ -54,0 +62,0 @@ browser.url(process.env.URL1 || 'http://localhost:3000') |
@@ -1,26 +0,26 @@ | ||
!function(e, n) { | ||
"object" == typeof exports && "undefined" != typeof module ? n(exports) : "function" == typeof define && define.amd ? define([ "exports" ], n) : n(e.undefinedExample = e.undefinedExample || {}); | ||
!function(e, t) { | ||
"object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define([ "exports" ], t) : t(e.ColumbidaeJSExample = e.ColumbidaeJSExample || {}); | ||
}(this, function(e) { | ||
"use strict"; | ||
function n(e, n) { | ||
if ("undefined" != typeof navigator.sendBeacon) return navigator.sendBeacon(e, n); | ||
var t = /*@cc_on @if (@_jscript_version < 10) window.XDomainRequest || @end @*/ window.XMLHttpRequest; | ||
if (void 0 === t) return flase; | ||
var r = new t(); | ||
return r.open("POST", e, !0), r.send(n), !0; | ||
function t(e, t) { | ||
if ("undefined" != typeof navigator.sendBeacon) return navigator.sendBeacon(e, t); | ||
var n = /*@cc_on @if (@_jscript_version < 10) window.XDomainRequest || @end @*/ window.XMLHttpRequest; | ||
if (void 0 === n) return flase; | ||
var r = new n(); | ||
return r.open("POST", e, !0), r.send(t), !0; | ||
} | ||
function t(e) { | ||
var n = null; | ||
return "string" == typeof e.stack && (n = r(e.stack)), { | ||
function n(e) { | ||
var t = null; | ||
return "string" == typeof e.stack && (t = r(e.stack)), { | ||
type: "Error", | ||
value: e.message, | ||
stacktrace: n | ||
stacktrace: t | ||
}; | ||
} | ||
function r(e) { | ||
var n = []; | ||
return [ c, f ].forEach(function(t) { | ||
if (!(n.length > 0)) for (var r = null; null != (r = t.exec(e)); ) { | ||
var t = []; | ||
return [ c, f ].forEach(function(n) { | ||
if (!(t.length > 0)) for (var r = null; null != (r = n.exec(e)); ) { | ||
var i = r[1].trim(); | ||
0 == i.length && (i = "?"), n.unshift({ | ||
0 == i.length && (i = "?"), t.unshift({ | ||
"function": i, | ||
@@ -32,4 +32,4 @@ filename: r[2], | ||
} | ||
}), 0 == n.length ? null : { | ||
frames: n | ||
}), 0 == t.length ? null : { | ||
frames: t | ||
}; | ||
@@ -44,3 +44,3 @@ } | ||
this.start = new Date().getTime(), this.uuidv4 = e.uuidv4, this.sendBeacon = e.sendBeacon, | ||
this.url = "//sentry.io/api/" + e.projectId + "/store/?sentry_version=7&sentry_client=ColumbidaeJS%2F" + x + "&sentry_key=" + e.key, | ||
this.url = "//sentry.io/api/" + e.projectId + "/store/?sentry_version=7&sentry_client=ColumbidaeJS%2F" + l + "&sentry_key=" + e.key, | ||
this.payload = { | ||
@@ -62,3 +62,3 @@ project: e.projectId, | ||
} | ||
}; | ||
}, "string" == typeof e.release && (this.payload.release = e.release); | ||
} | ||
@@ -69,8 +69,8 @@ function o(e) { | ||
function a(e) { | ||
u("crashB: " + e); | ||
s("crashB: " + e); | ||
} | ||
function u(e) { | ||
function s(e) { | ||
throw new Error("crashZ: " + e); | ||
} | ||
function s(e) { | ||
function u(e) { | ||
o(e); | ||
@@ -81,27 +81,27 @@ } | ||
if (void 0 !== e && e.getRandomValues) { | ||
var n = new Uint16Array(8); | ||
e.getRandomValues(n), n[3] = 4095 & n[3] | 16384, n[4] = 16383 & n[4] | 32768; | ||
var t = function(e) { | ||
for (var n = e.toString(16); n.length < 4; ) n = "0" + n; | ||
return n; | ||
var t = new Uint16Array(8); | ||
e.getRandomValues(t), t[3] = 4095 & t[3] | 16384, t[4] = 16383 & t[4] | 32768; | ||
var n = function(e) { | ||
for (var t = e.toString(16); t.length < 4; ) t = "0" + t; | ||
return t; | ||
}; | ||
return t(n[0]) + t(n[1]) + t(n[2]) + t(n[3]) + t(n[4]) + t(n[5]) + t(n[6]) + t(n[7]); | ||
return n(t[0]) + n(t[1]) + n(t[2]) + n(t[3]) + n(t[4]) + n(t[5]) + n(t[6]) + n(t[7]); | ||
} | ||
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(e) { | ||
var n = 16 * Math.random() | 0; | ||
return ("x" === e ? n : 3 & n | 8).toString(16); | ||
var t = 16 * Math.random() | 0; | ||
return ("x" === e ? t : 3 & t | 8).toString(16); | ||
}); | ||
} | ||
var c = /at(.*) \(?(.+):(\d+):(\d+)/g, f = /(.*)@(.+):(\d+):(\d+)/g, x = "0.1.0"; | ||
var c = /at(.*) \(?(.+):(\d+):(\d+)/g, f = /(.*)@(.+):(\d+):(\d+)/g, l = "0.1.3"; | ||
i.prototype.send = function(e) { | ||
var r = this.uuidv4(); | ||
return this.payload.exception.values.push(t(e)), this.payload.extra["session:duration"] = new Date().getTime() - this.start, | ||
this.payload.event_id = r, n(this.url, JSON.stringify(this.payload)), r; | ||
}, e.HelloSentry = function(e, n) { | ||
return this.payload.exception.values.push(n(e)), this.payload.extra["session:duration"] = new Date().getTime() - this.start, | ||
this.payload.event_id = r, t(this.url, JSON.stringify(this.payload)), r; | ||
}, e.HelloSentry = function(e, t) { | ||
e.uuidv4 = d; | ||
var t = new i(e); | ||
var n = new i(e); | ||
try { | ||
s(n); | ||
u(t); | ||
} catch (r) { | ||
return t.send(r); | ||
return n.send(r); | ||
} | ||
@@ -108,0 +108,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155214
34
969