@sentry/browser 6.14.3 → 6.17.0-beta.0
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/bundle.es6.js +1271 -1393
- package/build/bundle.es6.js.map +1 -1
- package/build/bundle.es6.min.js +2 -2
- package/build/bundle.es6.min.js.map +1 -1
- package/build/bundle.js +1367 -1520
- package/build/bundle.js.map +1 -1
- package/build/bundle.min.js +2 -2
- package/build/bundle.min.js.map +1 -1
- package/dist/backend.d.ts +2 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +1 -2
- package/dist/backend.js.map +1 -1
- package/dist/eventbuilder.d.ts +2 -2
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +20 -13
- package/dist/eventbuilder.js.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/exports.js +0 -3
- package/dist/exports.js.map +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +26 -37
- package/dist/helpers.js.map +1 -1
- package/dist/integrations/breadcrumbs.d.ts +0 -20
- package/dist/integrations/breadcrumbs.d.ts.map +1 -1
- package/dist/integrations/breadcrumbs.js +132 -174
- package/dist/integrations/breadcrumbs.js.map +1 -1
- package/dist/integrations/dedupe.d.ts +0 -14
- package/dist/integrations/dedupe.d.ts.map +1 -1
- package/dist/integrations/dedupe.js +126 -126
- package/dist/integrations/dedupe.js.map +1 -1
- package/dist/integrations/globalhandlers.d.ts +7 -25
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +176 -169
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/linkederrors.d.ts +15 -13
- package/dist/integrations/linkederrors.d.ts.map +1 -1
- package/dist/integrations/linkederrors.js +26 -28
- package/dist/integrations/linkederrors.js.map +1 -1
- package/dist/integrations/trycatch.d.ts +0 -8
- package/dist/integrations/trycatch.d.ts.map +1 -1
- package/dist/integrations/trycatch.js +154 -153
- package/dist/integrations/trycatch.js.map +1 -1
- package/dist/integrations/useragent.js +2 -3
- package/dist/integrations/useragent.js.map +1 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +23 -19
- package/dist/sdk.js.map +1 -1
- package/dist/transports/base.d.ts +9 -4
- package/dist/transports/base.d.ts.map +1 -1
- package/dist/transports/base.js +23 -19
- package/dist/transports/base.js.map +1 -1
- package/dist/transports/fetch.d.ts +2 -10
- package/dist/transports/fetch.d.ts.map +1 -1
- package/dist/transports/fetch.js +3 -17
- package/dist/transports/fetch.js.map +1 -1
- package/dist/transports/utils.d.ts.map +1 -1
- package/dist/transports/utils.js +7 -5
- package/dist/transports/utils.js.map +1 -1
- package/dist/transports/xhr.d.ts +2 -10
- package/dist/transports/xhr.d.ts.map +1 -1
- package/dist/transports/xhr.js +3 -17
- package/dist/transports/xhr.js.map +1 -1
- package/esm/backend.d.ts +2 -2
- package/esm/backend.d.ts.map +1 -1
- package/esm/backend.js +1 -2
- package/esm/backend.js.map +1 -1
- package/esm/eventbuilder.d.ts +2 -2
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +21 -14
- package/esm/eventbuilder.js.map +1 -1
- package/esm/exports.d.ts +1 -1
- package/esm/exports.d.ts.map +1 -1
- package/esm/exports.js +0 -1
- package/esm/exports.js.map +1 -1
- package/esm/helpers.d.ts.map +1 -1
- package/esm/helpers.js +28 -39
- package/esm/helpers.js.map +1 -1
- package/esm/integrations/breadcrumbs.d.ts +0 -20
- package/esm/integrations/breadcrumbs.d.ts.map +1 -1
- package/esm/integrations/breadcrumbs.js +134 -176
- package/esm/integrations/breadcrumbs.js.map +1 -1
- package/esm/integrations/dedupe.d.ts +0 -14
- package/esm/integrations/dedupe.d.ts.map +1 -1
- package/esm/integrations/dedupe.js +126 -126
- package/esm/integrations/dedupe.js.map +1 -1
- package/esm/integrations/globalhandlers.d.ts +7 -25
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +178 -171
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/linkederrors.d.ts +15 -13
- package/esm/integrations/linkederrors.d.ts.map +1 -1
- package/esm/integrations/linkederrors.js +24 -28
- package/esm/integrations/linkederrors.js.map +1 -1
- package/esm/integrations/trycatch.d.ts +0 -8
- package/esm/integrations/trycatch.d.ts.map +1 -1
- package/esm/integrations/trycatch.js +155 -154
- package/esm/integrations/trycatch.js.map +1 -1
- package/esm/integrations/useragent.js +2 -3
- package/esm/integrations/useragent.js.map +1 -1
- package/esm/sdk.d.ts.map +1 -1
- package/esm/sdk.js +24 -20
- package/esm/sdk.js.map +1 -1
- package/esm/transports/base.d.ts +9 -4
- package/esm/transports/base.d.ts.map +1 -1
- package/esm/transports/base.js +25 -21
- package/esm/transports/base.js.map +1 -1
- package/esm/transports/fetch.d.ts +2 -10
- package/esm/transports/fetch.d.ts.map +1 -1
- package/esm/transports/fetch.js +3 -17
- package/esm/transports/fetch.js.map +1 -1
- package/esm/transports/utils.d.ts.map +1 -1
- package/esm/transports/utils.js +8 -6
- package/esm/transports/utils.js.map +1 -1
- package/esm/transports/xhr.d.ts +2 -10
- package/esm/transports/xhr.d.ts.map +1 -1
- package/esm/transports/xhr.js +3 -17
- package/esm/transports/xhr.js.map +1 -1
- package/package.json +15 -17
package/dist/backend.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseBackend } from '@sentry/core';
|
|
2
|
-
import { Event, EventHint, Options,
|
|
2
|
+
import { Event, EventHint, Options, SeverityLevel, Transport } from '@sentry/types';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for the Sentry Browser SDK.
|
|
5
5
|
* @see BrowserClient for more information.
|
|
@@ -34,7 +34,7 @@ export declare class BrowserBackend extends BaseBackend<BrowserOptions> {
|
|
|
34
34
|
/**
|
|
35
35
|
* @inheritDoc
|
|
36
36
|
*/
|
|
37
|
-
eventFromMessage(message: string, level?:
|
|
37
|
+
eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
|
|
38
38
|
/**
|
|
39
39
|
* @inheritDoc
|
|
40
40
|
*/
|
package/dist/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMpF;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAElC,yDAAyD;IACzD,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEvC,wDAAwD;IACxD,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,cAAc,CAAC;IAC7D;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAGnF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,aAAsB,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAI7G;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,SAAS;CAsBvC"}
|
package/dist/backend.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
var tslib_1 = require("tslib");
|
|
3
3
|
var core_1 = require("@sentry/core");
|
|
4
|
-
var types_1 = require("@sentry/types");
|
|
5
4
|
var utils_1 = require("@sentry/utils");
|
|
6
5
|
var eventbuilder_1 = require("./eventbuilder");
|
|
7
6
|
var transports_1 = require("./transports");
|
|
@@ -24,7 +23,7 @@ var BrowserBackend = /** @class */ (function (_super) {
|
|
|
24
23
|
* @inheritDoc
|
|
25
24
|
*/
|
|
26
25
|
BrowserBackend.prototype.eventFromMessage = function (message, level, hint) {
|
|
27
|
-
if (level === void 0) { level =
|
|
26
|
+
if (level === void 0) { level = 'info'; }
|
|
28
27
|
return eventbuilder_1.eventFromMessage(this._options, message, level, hint);
|
|
29
28
|
};
|
|
30
29
|
/**
|
package/dist/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":";;AAAA,qCAA2C;
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":";;AAAA,qCAA2C;AAE3C,uCAA8C;AAE9C,+CAAsE;AACtE,2CAA4D;AA4B5D;;;GAGG;AACH;IAAoC,0CAA2B;IAA/D;;IAuCA,CAAC;IAtCC;;OAEG;IACI,2CAAkB,GAAzB,UAA0B,SAAkB,EAAE,IAAgB;QAC5D,OAAO,iCAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IACD;;OAEG;IACI,yCAAgB,GAAvB,UAAwB,OAAe,EAAE,KAA6B,EAAE,IAAgB;QAA/C,sBAAA,EAAA,cAA6B;QACpE,OAAO,+BAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACO,wCAAe,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YACtB,6DAA6D;YAC7D,OAAO,iBAAM,eAAe,WAAE,CAAC;SAChC;QAED,IAAM,gBAAgB,yCACjB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,KACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,EACtB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAC5B,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAClD,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,GACnC,CAAC;QAEF,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;YAC3B,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;SACtD;QACD,IAAI,qBAAa,EAAE,EAAE;YACnB,OAAO,IAAI,2BAAc,CAAC,gBAAgB,CAAC,CAAC;SAC7C;QACD,OAAO,IAAI,yBAAY,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IACH,qBAAC;AAAD,CAAC,AAvCD,CAAoC,kBAAW,GAuC9C;AAvCY,wCAAc","sourcesContent":["import { BaseBackend } from '@sentry/core';\nimport { Event, EventHint, Options, SeverityLevel, Transport } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see BrowserClient for more information.\n */\nexport interface BrowserOptions extends Options {\n /**\n * A pattern for error URLs which should exclusively be sent to Sentry.\n * This is the opposite of {@link Options.denyUrls}.\n * By default, all errors will be sent.\n */\n allowUrls?: Array<string | RegExp>;\n\n /**\n * A pattern for error URLs which should not be sent to Sentry.\n * To allow certain errors instead, use {@link Options.allowUrls}.\n * By default, all errors will be sent.\n */\n denyUrls?: Array<string | RegExp>;\n\n /** @deprecated use {@link Options.allowUrls} instead. */\n whitelistUrls?: Array<string | RegExp>;\n\n /** @deprecated use {@link Options.denyUrls} instead. */\n blacklistUrls?: Array<string | RegExp>;\n}\n\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\nexport class BrowserBackend extends BaseBackend<BrowserOptions> {\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options, exception, hint);\n }\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level: SeverityLevel = 'info', hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options, message, level, hint);\n }\n\n /**\n * @inheritDoc\n */\n protected _setupTransport(): Transport {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return super._setupTransport();\n }\n\n const transportOptions = {\n ...this._options.transportOptions,\n dsn: this._options.dsn,\n tunnel: this._options.tunnel,\n sendClientReports: this._options.sendClientReports,\n _metadata: this._options._metadata,\n };\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n if (supportsFetch()) {\n return new FetchTransport(transportOptions);\n }\n return new XHRTransport(transportOptions);\n }\n}\n"]}
|
package/dist/eventbuilder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Event, EventHint, Options,
|
|
1
|
+
import { Event, EventHint, Options, SeverityLevel } from '@sentry/types';
|
|
2
2
|
/**
|
|
3
3
|
* Builds and Event from a Exception
|
|
4
4
|
* @hidden
|
|
@@ -8,7 +8,7 @@ export declare function eventFromException(options: Options, exception: unknown,
|
|
|
8
8
|
* Builds and Event from a Message
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
|
-
export declare function eventFromMessage(options: Options, message: string, level?:
|
|
11
|
+
export declare function eventFromMessage(options: Options, message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAgBzE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAW7G;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC,CAUpB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,OAAO,EAClB,kBAAkB,CAAC,EAAE,KAAK,EAC1B,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,KAAK,CAqEP;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,KAAK,EAC1B,OAAO,GAAE;IACP,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,KAAK,CAcP"}
|
package/dist/eventbuilder.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
var tslib_1 = require("tslib");
|
|
3
|
-
var types_1 = require("@sentry/types");
|
|
4
3
|
var utils_1 = require("@sentry/utils");
|
|
5
4
|
var parsers_1 = require("./parsers");
|
|
6
5
|
var tracekit_1 = require("./tracekit");
|
|
@@ -14,11 +13,11 @@ function eventFromException(options, exception, hint) {
|
|
|
14
13
|
attachStacktrace: options.attachStacktrace,
|
|
15
14
|
});
|
|
16
15
|
utils_1.addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
|
|
17
|
-
event.level =
|
|
16
|
+
event.level = 'error';
|
|
18
17
|
if (hint && hint.event_id) {
|
|
19
18
|
event.event_id = hint.event_id;
|
|
20
19
|
}
|
|
21
|
-
return utils_1.
|
|
20
|
+
return utils_1.resolvedSyncPromise(event);
|
|
22
21
|
}
|
|
23
22
|
exports.eventFromException = eventFromException;
|
|
24
23
|
/**
|
|
@@ -26,7 +25,7 @@ exports.eventFromException = eventFromException;
|
|
|
26
25
|
* @hidden
|
|
27
26
|
*/
|
|
28
27
|
function eventFromMessage(options, message, level, hint) {
|
|
29
|
-
if (level === void 0) { level =
|
|
28
|
+
if (level === void 0) { level = 'info'; }
|
|
30
29
|
var syntheticException = (hint && hint.syntheticException) || undefined;
|
|
31
30
|
var event = eventFromString(message, syntheticException, {
|
|
32
31
|
attachStacktrace: options.attachStacktrace,
|
|
@@ -35,7 +34,7 @@ function eventFromMessage(options, message, level, hint) {
|
|
|
35
34
|
if (hint && hint.event_id) {
|
|
36
35
|
event.event_id = hint.event_id;
|
|
37
36
|
}
|
|
38
|
-
return utils_1.
|
|
37
|
+
return utils_1.resolvedSyncPromise(event);
|
|
39
38
|
}
|
|
40
39
|
exports.eventFromMessage = eventFromMessage;
|
|
41
40
|
/**
|
|
@@ -52,16 +51,24 @@ function eventFromUnknownInput(exception, syntheticException, options) {
|
|
|
52
51
|
event = parsers_1.eventFromStacktrace(tracekit_1.computeStackTrace(exception));
|
|
53
52
|
return event;
|
|
54
53
|
}
|
|
54
|
+
// If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
|
|
55
|
+
// and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
|
|
56
|
+
// `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
|
|
57
|
+
//
|
|
58
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
|
|
59
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
60
|
+
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
|
|
55
61
|
if (utils_1.isDOMError(exception) || utils_1.isDOMException(exception)) {
|
|
56
|
-
// If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
|
|
57
|
-
// then we just extract the name, code, and message, as they don't provide anything else
|
|
58
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
|
|
59
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
60
62
|
var domException = exception;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
if ('stack' in exception) {
|
|
64
|
+
event = parsers_1.eventFromStacktrace(tracekit_1.computeStackTrace(exception));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
var name_1 = domException.name || (utils_1.isDOMError(domException) ? 'DOMError' : 'DOMException');
|
|
68
|
+
var message = domException.message ? name_1 + ": " + domException.message : name_1;
|
|
69
|
+
event = eventFromString(message, syntheticException, options);
|
|
70
|
+
utils_1.addExceptionTypeValue(event, message);
|
|
71
|
+
}
|
|
65
72
|
if ('code' in domException) {
|
|
66
73
|
event.tags = tslib_1.__assign(tslib_1.__assign({}, event.tags), { 'DOMException.code': "" + domException.code });
|
|
67
74
|
}
|
package/dist/eventbuilder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventbuilder.js","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"eventbuilder.js","sourceRoot":"","sources":["../src/event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G,+BAAqB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvD,KAAK,CAAC,UAAU,GAAG;YACjB,MAAM,UAAA;SACP,CAAC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AApBD,0CAoBC","sourcesContent":["import { Event, EventHint, Options, SeverityLevel } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isPlainObject,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\nimport { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';\nimport { computeStackTrace } from './tracekit';\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromException(options: Options, exception: unknown, hint?: EventHint): PromiseLike<Event> {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(exception, syntheticException, {\n attachStacktrace: options.attachStacktrace,\n });\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n options: Options,\n message: string,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n): PromiseLike<Event> {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(message, syntheticException, {\n attachStacktrace: options.attachStacktrace,\n });\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n exception: unknown,\n syntheticException?: Error,\n options: {\n rejection?: boolean;\n attachStacktrace?: boolean;\n } = {},\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n // eslint-disable-next-line no-param-reassign\n exception = errorEvent.error;\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(message, syntheticException, options);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception as Error)) {\n // we have a real Error object, do nothing\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it is plain Object or Event, serialize it manually and extract options\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n const objectException = exception as Record<string, unknown>;\n event = eventFromPlainObject(objectException, syntheticException, options.rejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(exception as string, syntheticException, options);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n input: string,\n syntheticException?: Error,\n options: {\n attachStacktrace?: boolean;\n } = {},\n): Event {\n const event: Event = {\n message: input,\n };\n\n if (options.attachStacktrace && syntheticException) {\n const stacktrace = computeStackTrace(syntheticException);\n const frames = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames,\n };\n }\n\n return event;\n}\n"]}
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Response,
|
|
1
|
+
export { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, EventStatus, Exception, Response, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
|
|
2
2
|
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/core';
|
|
3
3
|
export { BrowserOptions } from './backend';
|
|
4
4
|
export { BrowserClient } from './client';
|
package/dist/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/exports.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
var types_1 = require("@sentry/types");
|
|
3
|
-
exports.Severity = types_1.Severity;
|
|
4
|
-
exports.Status = types_1.Status;
|
|
5
2
|
var core_1 = require("@sentry/core");
|
|
6
3
|
exports.addGlobalEventProcessor = core_1.addGlobalEventProcessor;
|
|
7
4
|
exports.addBreadcrumb = core_1.addBreadcrumb;
|
package/dist/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":";AAiBA,qCAqBsB;AApBpB,yCAAA,uBAAuB,CAAA;AACvB,+BAAA,aAAa,CAAA;AACb,kCAAA,gBAAgB,CAAA;AAChB,8BAAA,YAAY,CAAA;AACZ,gCAAA,cAAc,CAAA;AACd,gCAAA,cAAc,CAAA;AACd,mCAAA,iBAAiB,CAAA;AACjB,+BAAA,aAAa,CAAA;AACb,qBAAA,GAAG,CAAA;AACH,0BAAA,QAAQ,CAAA;AACR,uBAAA,KAAK,CAAA;AACL,kCAAA,gBAAgB,CAAA;AAChB,6BAAA,WAAW,CAAA;AACX,4BAAA,UAAU,CAAA;AACV,0BAAA,QAAQ,CAAA;AACR,2BAAA,SAAS,CAAA;AACT,wBAAA,MAAM,CAAA;AACN,yBAAA,OAAO,CAAA;AACP,yBAAA,OAAO,CAAA;AACP,2BAAA,SAAS,CAAA;AAIX,mCAAyC;AAAhC,iCAAA,aAAa,CAAA;AACtB,qCAAoE;AAA3D,uCAAA,kBAAkB,CAAA;AAC3B,+CAAsE;AAA7D,4CAAA,kBAAkB,CAAA;AAAE,0CAAA,gBAAgB,CAAA;AAC7C,6BAAwH;AAA/G,oCAAA,mBAAmB,CAAA;AAAE,0BAAA,SAAS,CAAA;AAAE,qBAAA,IAAI,CAAA;AAAE,4BAAA,WAAW,CAAA;AAAE,uBAAA,MAAM,CAAA;AAAE,iCAAA,gBAAgB,CAAA;AAAE,sBAAA,KAAK,CAAA;AAAE,sBAAA,KAAK,CAAA;AAAE,qBAAA,IAAI,CAAA;AACxG,qCAAqC;AAA5B,6BAAA,QAAQ,CAAA","sourcesContent":["export {\n Breadcrumb,\n BreadcrumbHint,\n Request,\n SdkInfo,\n Event,\n EventHint,\n EventStatus,\n Exception,\n Response,\n SeverityLevel,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n configureScope,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n makeMain,\n Scope,\n startTransaction,\n SDK_VERSION,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n withScope,\n} from '@sentry/core';\n\nexport { BrowserOptions } from './backend';\nexport { BrowserClient } from './client';\nexport { injectReportDialog, ReportDialogOptions } from './helpers';\nexport { eventFromException, eventFromMessage } from './eventbuilder';\nexport { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap } from './sdk';\nexport { SDK_NAME } from './version';\n"]}
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAwB,SAAS,EAAS,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAwB,SAAS,EAAS,eAAe,EAAE,MAAM,eAAe,CAAC;AAejG;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAClB,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,SAAS,CAAC;CAClB,EACN,MAAM,CAAC,EAAE,eAAe,GAEvB,GAAG,CAyGL;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAElC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,MAAM,CAAC,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAiC1E"}
|
package/dist/helpers.js
CHANGED
|
@@ -31,19 +31,27 @@ exports.ignoreNextOnError = ignoreNextOnError;
|
|
|
31
31
|
* @hidden
|
|
32
32
|
*/
|
|
33
33
|
function wrap(fn, options, before) {
|
|
34
|
+
// for future readers what this does is wrap a function and then create
|
|
35
|
+
// a bi-directional wrapping between them.
|
|
36
|
+
//
|
|
37
|
+
// example: wrapped = wrap(original);
|
|
38
|
+
// original.__sentry_wrapped__ -> wrapped
|
|
39
|
+
// wrapped.__sentry_original__ -> original
|
|
34
40
|
if (options === void 0) { options = {}; }
|
|
35
41
|
if (typeof fn !== 'function') {
|
|
36
42
|
return fn;
|
|
37
43
|
}
|
|
38
44
|
try {
|
|
45
|
+
// if we're dealing with a function that was previously wrapped, return
|
|
46
|
+
// the original wrapper.
|
|
47
|
+
var wrapper = fn.__sentry_wrapped__;
|
|
48
|
+
if (wrapper) {
|
|
49
|
+
return wrapper;
|
|
50
|
+
}
|
|
39
51
|
// We don't wanna wrap it twice
|
|
40
|
-
if (fn
|
|
52
|
+
if (utils_1.getOriginalFunction(fn)) {
|
|
41
53
|
return fn;
|
|
42
54
|
}
|
|
43
|
-
// If this has already been wrapped in the past, return that wrapped function
|
|
44
|
-
if (fn.__sentry_wrapped__) {
|
|
45
|
-
return fn.__sentry_wrapped__;
|
|
46
|
-
}
|
|
47
55
|
}
|
|
48
56
|
catch (e) {
|
|
49
57
|
// Just accessing custom props in some Selenium environments
|
|
@@ -61,14 +69,6 @@ function wrap(fn, options, before) {
|
|
|
61
69
|
}
|
|
62
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
63
71
|
var wrappedArguments = args.map(function (arg) { return wrap(arg, options); });
|
|
64
|
-
if (fn.handleEvent) {
|
|
65
|
-
// Attempt to invoke user-land function
|
|
66
|
-
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
67
|
-
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
68
|
-
// is expected behavior and NOT indicative of a bug with sentry.javascript.
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
70
|
-
return fn.handleEvent.apply(this, wrappedArguments);
|
|
71
|
-
}
|
|
72
72
|
// Attempt to invoke user-land function
|
|
73
73
|
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
74
74
|
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
@@ -79,13 +79,12 @@ function wrap(fn, options, before) {
|
|
|
79
79
|
ignoreNextOnError();
|
|
80
80
|
core_1.withScope(function (scope) {
|
|
81
81
|
scope.addEventProcessor(function (event) {
|
|
82
|
-
var processedEvent = tslib_1.__assign({}, event);
|
|
83
82
|
if (options.mechanism) {
|
|
84
|
-
utils_1.addExceptionTypeValue(
|
|
85
|
-
utils_1.addExceptionMechanism(
|
|
83
|
+
utils_1.addExceptionTypeValue(event, undefined, undefined);
|
|
84
|
+
utils_1.addExceptionMechanism(event, options.mechanism);
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
return
|
|
86
|
+
event.extra = tslib_1.__assign(tslib_1.__assign({}, event.extra), { arguments: args });
|
|
87
|
+
return event;
|
|
89
88
|
});
|
|
90
89
|
core_1.captureException(ex);
|
|
91
90
|
});
|
|
@@ -103,24 +102,10 @@ function wrap(fn, options, before) {
|
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
catch (_oO) { } // eslint-disable-line no-empty
|
|
106
|
-
fn.prototype = fn.prototype || {};
|
|
107
|
-
sentryWrapped.prototype = fn.prototype;
|
|
108
|
-
Object.defineProperty(fn, '__sentry_wrapped__', {
|
|
109
|
-
enumerable: false,
|
|
110
|
-
value: sentryWrapped,
|
|
111
|
-
});
|
|
112
105
|
// Signal that this function has been wrapped/filled already
|
|
113
106
|
// for both debugging and to prevent it to being wrapped/filled twice
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
enumerable: false,
|
|
117
|
-
value: true,
|
|
118
|
-
},
|
|
119
|
-
__sentry_original__: {
|
|
120
|
-
enumerable: false,
|
|
121
|
-
value: fn,
|
|
122
|
-
},
|
|
123
|
-
});
|
|
107
|
+
utils_1.markFunctionWrapped(sentryWrapped, fn);
|
|
108
|
+
utils_1.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
|
|
124
109
|
// Restore original function name (not all browsers allow that)
|
|
125
110
|
try {
|
|
126
111
|
var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
|
|
@@ -147,16 +132,20 @@ function injectReportDialog(options) {
|
|
|
147
132
|
return;
|
|
148
133
|
}
|
|
149
134
|
if (!options.eventId) {
|
|
150
|
-
utils_1.
|
|
135
|
+
if (utils_1.isDebugBuild()) {
|
|
136
|
+
utils_1.logger.error("Missing eventId option in showReportDialog call");
|
|
137
|
+
}
|
|
151
138
|
return;
|
|
152
139
|
}
|
|
153
140
|
if (!options.dsn) {
|
|
154
|
-
utils_1.
|
|
141
|
+
if (utils_1.isDebugBuild()) {
|
|
142
|
+
utils_1.logger.error("Missing dsn option in showReportDialog call");
|
|
143
|
+
}
|
|
155
144
|
return;
|
|
156
145
|
}
|
|
157
146
|
var script = global.document.createElement('script');
|
|
158
147
|
script.async = true;
|
|
159
|
-
script.src =
|
|
148
|
+
script.src = core_1.getReportDialogEndpoint(options.dsn, options);
|
|
160
149
|
if (options.onLoad) {
|
|
161
150
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
162
151
|
script.onload = options.onLoad;
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;AAAA,qCAAgE;AAEhE,uCAAsG;AAEtG,IAAM,MAAM,GAAG,uBAAe,EAAU,CAAC;AACzC,IAAI,aAAa,GAAW,CAAC,CAAC;AAE9B;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO,aAAa,GAAG,CAAC,CAAC;AAC3B,CAAC;AAFD,kDAEC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,2CAA2C;IAC3C,aAAa,IAAI,CAAC,CAAC;IACnB,UAAU,CAAC;QACT,aAAa,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAND,8CAMC;AAED;;;;;;;GAOG;AACH,SAAgB,IAAI,CAClB,EAAmB,EACnB,OAEM,EACN,MAAwB;IAHxB,wBAAA,EAAA,YAEM;IAIN,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;QAC5B,OAAO,EAAE,CAAC;KACX;IAED,IAAI;QACF,+BAA+B;QAC/B,IAAI,EAAE,CAAC,UAAU,EAAE;YACjB,OAAO,EAAE,CAAC;SACX;QAED,6EAA6E;QAC7E,IAAI,EAAE,CAAC,kBAAkB,EAAE;YACzB,OAAO,EAAE,CAAC,kBAAkB,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,4DAA4D;QAC5D,gEAAgE;QAChE,6EAA6E;QAC7E,OAAO,EAAE,CAAC;KACX;IAED,uCAAuC;IACvC,8DAA8D;IAC9D,IAAM,aAAa,GAAoB;QACrC,IAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEnD,IAAI;YACF,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;gBAC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;QACpB,OAAO;KACR;IAED,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,cAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAChE,OAAO;KACR;IAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,cAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC5D,OAAO;KACR;IAED,IAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,GAAG,IAAI,UAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAEnE,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,6DAA6D;QAC7D,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAChC;IAED,IAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEpE,IAAI,cAAc,EAAE;QAClB,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACpC;AACH,CAAC;AA7BD,gDA6BC","sourcesContent":["import { API, captureException, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, getGlobalObject, logger } from '@sentry/utils';\n\nconst global = getGlobalObject<Window>();\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(() => {\n ignoreOnError -= 1;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // We don't wanna wrap it twice\n if (fn.__sentry__) {\n return fn;\n }\n\n // If this has already been wrapped in the past, return that wrapped function\n if (fn.__sentry_wrapped__) {\n return fn.__sentry_wrapped__;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sentryWrapped: WrappedFunction = function(this: any): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n if (fn.handleEvent) {\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return fn.handleEvent.apply(this, wrappedArguments);\n }\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope((scope: Scope) => {\n scope.addEventProcessor((event: SentryEvent) => {\n const processedEvent = { ...event };\n\n if (options.mechanism) {\n addExceptionTypeValue(processedEvent, undefined, undefined);\n addExceptionMechanism(processedEvent, options.mechanism);\n }\n\n processedEvent.extra = {\n ...processedEvent.extra,\n arguments: args,\n };\n\n return processedEvent;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n fn.prototype = fn.prototype || {};\n sentryWrapped.prototype = fn.prototype;\n\n Object.defineProperty(fn, '__sentry_wrapped__', {\n enumerable: false,\n value: sentryWrapped,\n });\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n Object.defineProperties(sentryWrapped, {\n __sentry__: {\n enumerable: false,\n value: true,\n },\n __sentry_original__: {\n enumerable: false,\n value: fn,\n },\n });\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * Injects the Report Dialog script\n * @hidden\n */\nexport function injectReportDialog(options: ReportDialogOptions = {}): void {\n if (!global.document) {\n return;\n }\n\n if (!options.eventId) {\n logger.error(`Missing eventId option in showReportDialog call`);\n return;\n }\n\n if (!options.dsn) {\n logger.error(`Missing dsn option in showReportDialog call`);\n return;\n }\n\n const script = global.document.createElement('script');\n script.async = true;\n script.src = new API(options.dsn).getReportDialogEndpoint(options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n const injectionPoint = global.document.head || global.document.body;\n\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;AAAA,qCAAoF;AAEpF,uCASuB;AAEvB,IAAM,MAAM,GAAG,uBAAe,EAAU,CAAC;AACzC,IAAI,aAAa,GAAW,CAAC,CAAC;AAE9B;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO,aAAa,GAAG,CAAC,CAAC;AAC3B,CAAC;AAFD,kDAEC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,2CAA2C;IAC3C,aAAa,IAAI,CAAC,CAAC;IACnB,UAAU,CAAC;QACT,aAAa,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAND,8CAMC;AAED;;;;;;;GAOG;AACH,SAAgB,IAAI,CAClB,EAAmB,EACnB,OAEM,EACN,MAAwB;IAGxB,uEAAuE;IACvE,0CAA0C;IAC1C,EAAE;IACF,qCAAqC;IACrC,0CAA0C;IAC1C,2CAA2C;IAX3C,wBAAA,EAAA,YAEM;IAWN,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;QAC5B,OAAO,EAAE,CAAC;KACX;IAED,IAAI;QACF,uEAAuE;QACvE,wBAAwB;QACxB,IAAM,OAAO,GAAG,EAAE,CAAC,kBAAkB,CAAC;QACtC,IAAI,OAAO,EAAE;YACX,OAAO,OAAO,CAAC;SAChB;QAED,+BAA+B;QAC/B,IAAI,2BAAmB,CAAC,EAAE,CAAC,EAAE;YAC3B,OAAO,EAAE,CAAC;SACX;KACF;IAAC,OAAO,CAAC,EAAE;QACV,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KACR;IAED,IAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,GAAG,8BAAuB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE3D,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,6DAA6D;QAC7D,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAChC;IAED,IAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEpE,IAAI,cAAc,EAAE;QAClB,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACpC;AACH,CAAC;AAjCD,gDAiCC","sourcesContent":["import { captureException, getReportDialogEndpoint, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getGlobalObject,\n getOriginalFunction,\n isDebugBuild,\n logger,\n markFunctionWrapped,\n} from '@sentry/utils';\n\nconst global = getGlobalObject<Window>();\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(() => {\n ignoreOnError -= 1;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n return wrapper;\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sentryWrapped: WrappedFunction = function(this: any): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope((scope: Scope) => {\n scope.addEventProcessor((event: SentryEvent) => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * Injects the Report Dialog script\n * @hidden\n */\nexport function injectReportDialog(options: ReportDialogOptions = {}): void {\n if (!global.document) {\n return;\n }\n\n if (!options.eventId) {\n if (isDebugBuild()) {\n logger.error(`Missing eventId option in showReportDialog call`);\n }\n return;\n }\n\n if (!options.dsn) {\n if (isDebugBuild()) {\n logger.error(`Missing dsn option in showReportDialog call`);\n }\n return;\n }\n\n const script = global.document.createElement('script');\n script.async = true;\n script.src = getReportDialogEndpoint(options.dsn, options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n const injectionPoint = global.document.head || global.document.body;\n\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n }\n}\n"]}
|
|
@@ -42,26 +42,6 @@ export declare class Breadcrumbs implements Integration {
|
|
|
42
42
|
* - History API
|
|
43
43
|
*/
|
|
44
44
|
setupOnce(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Creates breadcrumbs from console API calls
|
|
47
|
-
*/
|
|
48
|
-
private _consoleBreadcrumb;
|
|
49
|
-
/**
|
|
50
|
-
* Creates breadcrumbs from DOM API calls
|
|
51
|
-
*/
|
|
52
|
-
private _domBreadcrumb;
|
|
53
|
-
/**
|
|
54
|
-
* Creates breadcrumbs from XHR API calls
|
|
55
|
-
*/
|
|
56
|
-
private _xhrBreadcrumb;
|
|
57
|
-
/**
|
|
58
|
-
* Creates breadcrumbs from fetch API calls
|
|
59
|
-
*/
|
|
60
|
-
private _fetchBreadcrumb;
|
|
61
|
-
/**
|
|
62
|
-
* Creates breadcrumbs from history API calls
|
|
63
|
-
*/
|
|
64
|
-
private _historyBreadcrumb;
|
|
65
45
|
}
|
|
66
46
|
export {};
|
|
67
47
|
//# sourceMappingURL=breadcrumbs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/integrations/breadcrumbs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/integrations/breadcrumbs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAWnD,YAAY;AACZ,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,GAAG;QAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;IACzD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;GAGG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAE9C;;OAEG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAYxD;;OAEG;IACI,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAiB9C;;;;;;;OAOG;IACI,SAAS,IAAI,IAAI;CAiBzB"}
|