sentry-uniapp 1.0.11 → 2.8.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/README.md +112 -143
- package/dist/client.d.ts +38 -40
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +46 -38
- package/dist/client.js.map +1 -1
- package/dist/crossPlatform.d.ts +1 -1
- package/dist/crossPlatform.js +11 -10
- package/dist/crossPlatform.js.map +1 -1
- package/dist/eventbuilder.d.ts +9 -10
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +131 -58
- package/dist/eventbuilder.js.map +1 -1
- package/dist/flags.js +1 -0
- package/dist/flags.js.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -21
- package/dist/index.js.map +1 -1
- package/dist/integrations/globalhandlers.d.ts +10 -44
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +101 -134
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.js +28 -28
- package/dist/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/dist/integrations/index.d.ts +4 -6
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +12 -10
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/router.d.ts +6 -24
- package/dist/integrations/router.d.ts.map +1 -1
- package/dist/integrations/router.js +39 -42
- package/dist/integrations/router.js.map +1 -1
- package/dist/integrations/system.d.ts +5 -16
- package/dist/integrations/system.d.ts.map +1 -1
- package/dist/integrations/system.js +62 -60
- package/dist/integrations/system.js.map +1 -1
- package/dist/parsers.d.ts +2 -2
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +27 -26
- package/dist/parsers.js.map +1 -1
- package/dist/sdk.d.ts +9 -85
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +55 -129
- package/dist/sdk.js.map +1 -1
- package/dist/tracekit.js +35 -33
- package/dist/tracekit.js.map +1 -1
- package/dist/transport.d.ts +7 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +45 -0
- package/dist/transport.js.map +1 -0
- package/dist/transports/index.d.ts +1 -2
- package/dist/transports/index.d.ts.map +1 -1
- package/dist/transports/index.js +4 -4
- package/dist/transports/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -1
- package/dist/version.js.map +1 -1
- package/esm/client.d.ts +38 -40
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js +43 -37
- package/esm/client.js.map +1 -1
- package/esm/crossPlatform.d.ts +1 -1
- package/esm/crossPlatform.js +10 -10
- package/esm/crossPlatform.js.map +1 -1
- package/esm/eventbuilder.d.ts +9 -10
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +125 -52
- package/esm/eventbuilder.js.map +1 -1
- package/esm/flags.js +1 -1
- package/esm/flags.js.map +1 -1
- package/esm/index.d.ts +10 -9
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +13 -8
- package/esm/index.js.map +1 -1
- package/esm/integrations/globalhandlers.d.ts +10 -44
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +99 -133
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.js +25 -26
- package/esm/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/esm/integrations/index.d.ts +4 -6
- package/esm/integrations/index.d.ts.map +1 -1
- package/esm/integrations/index.js +5 -6
- package/esm/integrations/index.js.map +1 -1
- package/esm/integrations/router.d.ts +6 -24
- package/esm/integrations/router.d.ts.map +1 -1
- package/esm/integrations/router.js +37 -41
- package/esm/integrations/router.js.map +1 -1
- package/esm/integrations/system.d.ts +5 -16
- package/esm/integrations/system.d.ts.map +1 -1
- package/esm/integrations/system.js +60 -59
- package/esm/integrations/system.js.map +1 -1
- package/esm/parsers.d.ts +2 -2
- package/esm/parsers.d.ts.map +1 -1
- package/esm/parsers.js +20 -19
- package/esm/parsers.js.map +1 -1
- package/esm/sdk.d.ts +9 -85
- package/esm/sdk.d.ts.map +1 -1
- package/esm/sdk.js +49 -122
- package/esm/sdk.js.map +1 -1
- package/esm/tracekit.js +33 -31
- package/esm/tracekit.js.map +1 -1
- package/esm/transport.d.ts +7 -0
- package/esm/transport.d.ts.map +1 -0
- package/esm/transport.js +41 -0
- package/esm/transport.js.map +1 -0
- package/esm/transports/index.d.ts +1 -2
- package/esm/transports/index.d.ts.map +1 -1
- package/esm/transports/index.js +1 -2
- package/esm/transports/index.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.d.ts.map +1 -1
- package/esm/version.js +2 -2
- package/esm/version.js.map +1 -1
- package/package.json +24 -28
- package/dist/backend.d.ts +0 -41
- package/dist/backend.d.ts.map +0 -1
- package/dist/backend.js +0 -68
- package/dist/backend.js.map +0 -1
- package/dist/helpers.d.ts +0 -35
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js +0 -236
- package/dist/helpers.js.map +0 -1
- package/dist/integrations/linkederrors.d.ts +0 -40
- package/dist/integrations/linkederrors.d.ts.map +0 -1
- package/dist/integrations/linkederrors.js +0 -65
- package/dist/integrations/linkederrors.js.map +0 -1
- package/dist/integrations/trycatch.d.ts +0 -26
- package/dist/integrations/trycatch.d.ts.map +0 -1
- package/dist/integrations/trycatch.js +0 -166
- package/dist/integrations/trycatch.js.map +0 -1
- package/dist/sentry-uniapp.min.js +0 -17
- package/dist/sentry-uniapp.min.js.map +0 -1
- package/dist/transports/base.d.ts +0 -22
- package/dist/transports/base.d.ts.map +0 -1
- package/dist/transports/base.js +0 -28
- package/dist/transports/base.js.map +0 -1
- package/dist/transports/xhr.d.ts +0 -10
- package/dist/transports/xhr.d.ts.map +0 -1
- package/dist/transports/xhr.js +0 -42
- package/dist/transports/xhr.js.map +0 -1
- package/esm/backend.d.ts +0 -41
- package/esm/backend.d.ts.map +0 -1
- package/esm/backend.js +0 -66
- package/esm/backend.js.map +0 -1
- package/esm/helpers.d.ts +0 -35
- package/esm/helpers.d.ts.map +0 -1
- package/esm/helpers.js +0 -229
- package/esm/helpers.js.map +0 -1
- package/esm/integrations/linkederrors.d.ts +0 -40
- package/esm/integrations/linkederrors.d.ts.map +0 -1
- package/esm/integrations/linkederrors.js +0 -63
- package/esm/integrations/linkederrors.js.map +0 -1
- package/esm/integrations/trycatch.d.ts +0 -26
- package/esm/integrations/trycatch.d.ts.map +0 -1
- package/esm/integrations/trycatch.js +0 -164
- package/esm/integrations/trycatch.js.map +0 -1
- package/esm/transports/base.d.ts +0 -22
- package/esm/transports/base.d.ts.map +0 -1
- package/esm/transports/base.js +0 -26
- package/esm/transports/base.js.map +0 -1
- package/esm/transports/xhr.d.ts +0 -10
- package/esm/transports/xhr.d.ts.map +0 -1
- package/esm/transports/xhr.js +0 -40
- package/esm/transports/xhr.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkederrors.js","sourceRoot":"","sources":["../../src/integrations/linkederrors.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,IAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,IAAM,aAAa,GAAG,CAAC,CAAC;AAExB,iCAAiC;AACjC;IAqBE;;OAEG;IACH,sBAAmB,OAA8C;QAA9C,wBAAA,EAAA,YAA8C;QAvBjE;;WAEG;QACa,SAAI,GA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M,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,IAAM,SAAS,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,YAAG,SAAS,GAAK,KAAK,EAAE,CAAC;IACrE,CAAC;IA1DD;;OAEG;IACW,eAAE,GAAW,cAAc,CAAC;IAwD5C,mBAAC;CAAA,AAjED,IAiEC;SAjEY,YAAY","sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, Exception, ExtendedError, Integration } from '@sentry/types';\n\nimport { exceptionFromStacktrace } from '../parsers';\nimport { computeStackTrace } from '../tracekit';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n /**\n * @inheritDoc\n */\n public readonly name: string = LinkedErrors.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'LinkedErrors';\n\n /**\n * @inheritDoc\n */\n private readonly _key: string;\n\n /**\n * @inheritDoc\n */\n private readonly _limit: number;\n\n /**\n * @inheritDoc\n */\n public constructor(options: { key?: string; limit?: number } = {}) {\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n const self = getCurrentHub().getIntegration(LinkedErrors);\n if (self) {\n return self._handler(event, hint);\n }\n return event;\n });\n }\n\n /**\n * @inheritDoc\n */\n private _handler(event: Event, hint?: EventHint): Event | null {\n if (!event.exception || !event.exception.values || !hint || !(hint.originalException instanceof Error)) {\n return event;\n }\n const linkedErrors = this._walkErrorTree(hint.originalException, this._key);\n event.exception.values = [...linkedErrors, ...event.exception.values];\n return event;\n }\n\n /**\n * @inheritDoc\n */\n private _walkErrorTree(error: ExtendedError, key: string, stack: Exception[] = []): Exception[] {\n if (!(error[key] instanceof Error) || stack.length + 1 >= this._limit) {\n return stack;\n }\n const stacktrace = computeStackTrace(error[key]);\n const exception = exceptionFromStacktrace(stacktrace);\n return this._walkErrorTree(error[key], key, [exception, ...stack]);\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Integration } from "@sentry/types";
|
|
2
|
-
/** Wrap timer functions and event targets to catch errors and provide better meta data */
|
|
3
|
-
export declare class TryCatch implements Integration {
|
|
4
|
-
/** JSDoc */
|
|
5
|
-
private _ignoreOnError;
|
|
6
|
-
/**
|
|
7
|
-
* @inheritDoc
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* @inheritDoc
|
|
12
|
-
*/
|
|
13
|
-
static id: string;
|
|
14
|
-
/** JSDoc */
|
|
15
|
-
private _wrapTimeFunction;
|
|
16
|
-
/** JSDoc */
|
|
17
|
-
private _wrapRAF;
|
|
18
|
-
/** JSDoc */
|
|
19
|
-
private _wrapEventTarget;
|
|
20
|
-
/**
|
|
21
|
-
* Wrap timer functions and event targets to catch errors
|
|
22
|
-
* and provide better metadata.
|
|
23
|
-
*/
|
|
24
|
-
setupOnce(): void;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=trycatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trycatch.d.ts","sourceRoot":"","sources":["../../src/integrations/trycatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAK7D,0FAA0F;AAC1F,qBAAa,QAAS,YAAW,WAAW;IAC1C,YAAY;IACZ,OAAO,CAAC,cAAc,CAAa;IAEnC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAe;IAElC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAc;IAEtC,YAAY;IACZ,OAAO,CAAC,iBAAiB;IAczB,YAAY;IACZ,OAAO,CAAC,QAAQ;IAiBhB,YAAY;IACZ,OAAO,CAAC,gBAAgB;IA6FxB;;;OAGG;IACI,SAAS,IAAI,IAAI;CAyCzB"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { fill, getGlobalObject } from "@sentry/utils";
|
|
2
|
-
import { wrap } from "../helpers";
|
|
3
|
-
/** Wrap timer functions and event targets to catch errors and provide better meta data */
|
|
4
|
-
var TryCatch = /** @class */ (function () {
|
|
5
|
-
function TryCatch() {
|
|
6
|
-
/** JSDoc */
|
|
7
|
-
this._ignoreOnError = 0;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
this.name = TryCatch.id;
|
|
12
|
-
}
|
|
13
|
-
/** JSDoc */
|
|
14
|
-
TryCatch.prototype._wrapTimeFunction = function (original) {
|
|
15
|
-
return function () {
|
|
16
|
-
var args = [];
|
|
17
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
18
|
-
args[_i] = arguments[_i];
|
|
19
|
-
}
|
|
20
|
-
var originalCallback = args[0];
|
|
21
|
-
args[0] = wrap(originalCallback, {
|
|
22
|
-
mechanism: {
|
|
23
|
-
data: { function: getFunctionName(original) },
|
|
24
|
-
handled: true,
|
|
25
|
-
type: "instrument"
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return original.apply(this, args);
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
/** JSDoc */
|
|
32
|
-
TryCatch.prototype._wrapRAF = function (original) {
|
|
33
|
-
return function (callback) {
|
|
34
|
-
return original(wrap(callback, {
|
|
35
|
-
mechanism: {
|
|
36
|
-
data: {
|
|
37
|
-
function: "requestAnimationFrame",
|
|
38
|
-
handler: getFunctionName(original)
|
|
39
|
-
},
|
|
40
|
-
handled: true,
|
|
41
|
-
type: "instrument"
|
|
42
|
-
}
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
/** JSDoc */
|
|
47
|
-
TryCatch.prototype._wrapEventTarget = function (target) {
|
|
48
|
-
var global = getGlobalObject();
|
|
49
|
-
var proto = global[target] && global[target].prototype;
|
|
50
|
-
if (!proto ||
|
|
51
|
-
!proto.hasOwnProperty ||
|
|
52
|
-
!proto.hasOwnProperty("addEventListener")) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
fill(proto, "addEventListener", function (original) {
|
|
56
|
-
return function (eventName, fn, options) {
|
|
57
|
-
try {
|
|
58
|
-
// tslint:disable-next-line:no-unbound-method strict-type-predicates
|
|
59
|
-
if (typeof fn.handleEvent === "function") {
|
|
60
|
-
fn.handleEvent = wrap(fn.handleEvent.bind(fn), {
|
|
61
|
-
mechanism: {
|
|
62
|
-
data: {
|
|
63
|
-
function: "handleEvent",
|
|
64
|
-
handler: getFunctionName(fn),
|
|
65
|
-
target: target
|
|
66
|
-
},
|
|
67
|
-
handled: true,
|
|
68
|
-
type: "instrument"
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
// can sometimes get 'Permission denied to access property "handle Event'
|
|
75
|
-
}
|
|
76
|
-
return original.call(this, eventName, wrap(fn, {
|
|
77
|
-
mechanism: {
|
|
78
|
-
data: {
|
|
79
|
-
function: "addEventListener",
|
|
80
|
-
handler: getFunctionName(fn),
|
|
81
|
-
target: target
|
|
82
|
-
},
|
|
83
|
-
handled: true,
|
|
84
|
-
type: "instrument"
|
|
85
|
-
}
|
|
86
|
-
}), options);
|
|
87
|
-
};
|
|
88
|
-
});
|
|
89
|
-
fill(proto, "removeEventListener", function (original) {
|
|
90
|
-
return function (eventName, fn, options) {
|
|
91
|
-
var callback = fn;
|
|
92
|
-
try {
|
|
93
|
-
callback = callback && (callback.__sentry_wrapped__ || callback);
|
|
94
|
-
}
|
|
95
|
-
catch (e) {
|
|
96
|
-
// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
|
|
97
|
-
}
|
|
98
|
-
return original.call(this, eventName, callback, options);
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Wrap timer functions and event targets to catch errors
|
|
104
|
-
* and provide better metadata.
|
|
105
|
-
*/
|
|
106
|
-
TryCatch.prototype.setupOnce = function () {
|
|
107
|
-
this._ignoreOnError = this._ignoreOnError;
|
|
108
|
-
var global = getGlobalObject();
|
|
109
|
-
fill(global, "setTimeout", this._wrapTimeFunction.bind(this));
|
|
110
|
-
fill(global, "setInterval", this._wrapTimeFunction.bind(this));
|
|
111
|
-
fill(global, "requestAnimationFrame", this._wrapRAF.bind(this));
|
|
112
|
-
[
|
|
113
|
-
"EventTarget",
|
|
114
|
-
"Window",
|
|
115
|
-
"Node",
|
|
116
|
-
"ApplicationCache",
|
|
117
|
-
"AudioTrackList",
|
|
118
|
-
"ChannelMergerNode",
|
|
119
|
-
"CryptoOperation",
|
|
120
|
-
"EventSource",
|
|
121
|
-
"FileReader",
|
|
122
|
-
"HTMLUnknownElement",
|
|
123
|
-
"IDBDatabase",
|
|
124
|
-
"IDBRequest",
|
|
125
|
-
"IDBTransaction",
|
|
126
|
-
"KeyOperation",
|
|
127
|
-
"MediaController",
|
|
128
|
-
"MessagePort",
|
|
129
|
-
"ModalWindow",
|
|
130
|
-
"Notification",
|
|
131
|
-
"SVGElementInstance",
|
|
132
|
-
"Screen",
|
|
133
|
-
"TextTrack",
|
|
134
|
-
"TextTrackCue",
|
|
135
|
-
"TextTrackList",
|
|
136
|
-
"WebSocket",
|
|
137
|
-
"WebSocketWorker",
|
|
138
|
-
"Worker",
|
|
139
|
-
"XMLHttpRequest",
|
|
140
|
-
"XMLHttpRequestEventTarget",
|
|
141
|
-
"XMLHttpRequestUpload"
|
|
142
|
-
].forEach(this._wrapEventTarget.bind(this));
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* @inheritDoc
|
|
146
|
-
*/
|
|
147
|
-
TryCatch.id = "TryCatch";
|
|
148
|
-
return TryCatch;
|
|
149
|
-
}());
|
|
150
|
-
export { TryCatch };
|
|
151
|
-
/**
|
|
152
|
-
* Safely extract function name from itself
|
|
153
|
-
*/
|
|
154
|
-
function getFunctionName(fn) {
|
|
155
|
-
try {
|
|
156
|
-
return (fn && fn.name) || "<anonymous>";
|
|
157
|
-
}
|
|
158
|
-
catch (e) {
|
|
159
|
-
// Just accessing custom props in some Selenium environments
|
|
160
|
-
// can cause a "Permission denied" exception (see raven-js#495).
|
|
161
|
-
return "<anonymous>";
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
//# sourceMappingURL=trycatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trycatch.js","sourceRoot":"","sources":["../../src/integrations/trycatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,0FAA0F;AAC1F;IAAA;QACE,YAAY;QACJ,mBAAc,GAAW,CAAC,CAAC;QAEnC;;WAEG;QACI,SAAI,GAAW,QAAQ,CAAC,EAAE,CAAC;IAmLpC,CAAC;IA5KC,YAAY;IACJ,oCAAiB,GAAzB,UAA0B,QAAoB;QAC5C,OAAO;YAAoB,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YACvC,IAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,EAAE;gBAC/B,SAAS,EAAE;oBACT,IAAI,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE;oBAC7C,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,YAAY;iBACnB;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,CAA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,IAAI,CAAC,CAAC,CAAC;QAEhE;YACE,aAAa;YACb,QAAQ;YACR,MAAM;YACN,kBAAkB;YAClB,gBAAgB;YAChB,mBAAmB;YACnB,iBAAiB;YACjB,aAAa;YACb,YAAY;YACZ,oBAAoB;YACpB,aAAa;YACb,YAAY;YACZ,gBAAgB;YAChB,cAAc;YACd,iBAAiB;YACjB,aAAa;YACb,aAAa;YACb,cAAc;YACd,oBAAoB;YACpB,QAAQ;YACR,WAAW;YACX,cAAc;YACd,eAAe;YACf,WAAW;YACX,iBAAiB;YACjB,QAAQ;YACR,gBAAgB;YAChB,2BAA2B;YAC3B,sBAAsB;SACvB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAhLD;;OAEG;IACW,WAAE,GAAW,UAAU,CAAC;IA8KxC,eAAC;CAAA,AA1LD,IA0LC;SA1LY,QAAQ;AA4LrB;;GAEG;AACH,SAAS,eAAe,CAAC,EAAO;IAC9B,IAAI;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC;KACzC;IAAC,OAAO,CAAC,EAAE;QACV,4DAA4D;QAC5D,gEAAgE;QAChE,OAAO,aAAa,CAAC;KACtB;AACH,CAAC","sourcesContent":["import { Integration, WrappedFunction } from \"@sentry/types\";\nimport { fill, getGlobalObject } from \"@sentry/utils\";\n\nimport { wrap } from \"../helpers\";\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n /** JSDoc */\n private _ignoreOnError: number = 0;\n\n /**\n * @inheritDoc\n */\n public name: string = TryCatch.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = \"TryCatch\";\n\n /** JSDoc */\n private _wrapTimeFunction(original: () => void): () => number {\n return function(this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: true,\n type: \"instrument\"\n }\n });\n return original.apply(this, args);\n };\n }\n\n /** JSDoc */\n private _wrapRAF(original: any): (callback: () => void) => any {\n return function(this: any, callback: () => void): () => void {\n return original(\n wrap(callback, {\n mechanism: {\n data: {\n function: \"requestAnimationFrame\",\n handler: getFunctionName(original)\n },\n handled: true,\n type: \"instrument\"\n }\n })\n );\n };\n }\n\n /** JSDoc */\n private _wrapEventTarget(target: string): void {\n const global = getGlobalObject() as { [key: string]: any };\n const proto = global[target] && global[target].prototype;\n\n if (\n !proto ||\n !proto.hasOwnProperty ||\n !proto.hasOwnProperty(\"addEventListener\")\n ) {\n return;\n }\n\n fill(proto, \"addEventListener\", function(\n original: () => void\n ): (\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions\n ) => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): (\n eventName: string,\n fn: EventListenerObject,\n capture?: boolean,\n secure?: boolean\n ) => void {\n try {\n // tslint:disable-next-line:no-unbound-method strict-type-predicates\n if (typeof fn.handleEvent === \"function\") {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n function: \"handleEvent\",\n handler: getFunctionName(fn),\n target\n },\n handled: true,\n type: \"instrument\"\n }\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.call(\n this,\n eventName,\n wrap((fn as any) as WrappedFunction, {\n mechanism: {\n data: {\n function: \"addEventListener\",\n handler: getFunctionName(fn),\n target\n },\n handled: true,\n type: \"instrument\"\n }\n }),\n options\n );\n };\n });\n\n fill(proto, \"removeEventListener\", function(\n original: () => void\n ): (\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions\n ) => () => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions\n ): () => void {\n let callback = (fn as any) as WrappedFunction;\n try {\n callback = callback && (callback.__sentry_wrapped__ || callback);\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return original.call(this, eventName, callback, options);\n };\n });\n }\n\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n public setupOnce(): void {\n this._ignoreOnError = this._ignoreOnError;\n\n const global = getGlobalObject();\n\n fill(global, \"setTimeout\", this._wrapTimeFunction.bind(this));\n fill(global, \"setInterval\", this._wrapTimeFunction.bind(this));\n fill(global, \"requestAnimationFrame\", this._wrapRAF.bind(this));\n\n [\n \"EventTarget\",\n \"Window\",\n \"Node\",\n \"ApplicationCache\",\n \"AudioTrackList\",\n \"ChannelMergerNode\",\n \"CryptoOperation\",\n \"EventSource\",\n \"FileReader\",\n \"HTMLUnknownElement\",\n \"IDBDatabase\",\n \"IDBRequest\",\n \"IDBTransaction\",\n \"KeyOperation\",\n \"MediaController\",\n \"MessagePort\",\n \"ModalWindow\",\n \"Notification\",\n \"SVGElementInstance\",\n \"Screen\",\n \"TextTrack\",\n \"TextTrackCue\",\n \"TextTrackList\",\n \"WebSocket\",\n \"WebSocketWorker\",\n \"Worker\",\n \"XMLHttpRequest\",\n \"XMLHttpRequestEventTarget\",\n \"XMLHttpRequestUpload\"\n ].forEach(this._wrapEventTarget.bind(this));\n }\n}\n\n/**\n * Safely extract function name from itself\n */\nfunction getFunctionName(fn: any): string {\n try {\n return (fn && fn.name) || \"<anonymous>\";\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return \"<anonymous>\";\n }\n}\n"]}
|
package/esm/transports/base.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Event, Response, Transport, TransportOptions } from "@sentry/types";
|
|
2
|
-
import { PromiseBuffer } from "@sentry/utils";
|
|
3
|
-
/** Base Transport class implementation */
|
|
4
|
-
export declare abstract class BaseTransport implements Transport {
|
|
5
|
-
options: TransportOptions;
|
|
6
|
-
/**
|
|
7
|
-
* @inheritDoc
|
|
8
|
-
*/
|
|
9
|
-
url: string;
|
|
10
|
-
/** A simple buffer holding all requests. */
|
|
11
|
-
protected readonly _buffer: PromiseBuffer<Response>;
|
|
12
|
-
constructor(options: TransportOptions);
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
sendEvent(_: Event): PromiseLike<Response>;
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
close(timeout?: number): PromiseLike<boolean>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/transports/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAqB,aAAa,EAAe,MAAM,eAAe,CAAC;AAE9E,0CAA0C;AAC1C,8BAAsB,aAAc,YAAW,SAAS;IAS5B,OAAO,EAAE,gBAAgB;IARnD;;OAEG;IACI,GAAG,EAAE,MAAM,CAAC;IAEnB,4CAA4C;IAC5C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAyB;gBAElD,OAAO,EAAE,gBAAgB;IAInD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC;IAMjD;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;CAGrD"}
|
package/esm/transports/base.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { API } from "@sentry/core";
|
|
2
|
-
import { makePromiseBuffer, SentryError } from "@sentry/utils";
|
|
3
|
-
/** Base Transport class implementation */
|
|
4
|
-
var BaseTransport = /** @class */ (function () {
|
|
5
|
-
function BaseTransport(options) {
|
|
6
|
-
this.options = options;
|
|
7
|
-
/** A simple buffer holding all requests. */
|
|
8
|
-
this._buffer = makePromiseBuffer(30);
|
|
9
|
-
this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
BaseTransport.prototype.sendEvent = function (_) {
|
|
15
|
-
throw new SentryError("Transport Class has to implement `sendEvent` method");
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
BaseTransport.prototype.close = function (timeout) {
|
|
21
|
-
return this._buffer.drain(timeout);
|
|
22
|
-
};
|
|
23
|
-
return BaseTransport;
|
|
24
|
-
}());
|
|
25
|
-
export { BaseTransport };
|
|
26
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9E,0CAA0C;AAC1C;IASE,uBAA0B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QAHnD,4CAA4C;QACzB,YAAO,GAA4B,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAG1E,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,kCAAkC,EAAE,CAAC;IAC5E,CAAC;IAED;;OAEG;IACI,iCAAS,GAAhB,UAAiB,CAAQ;QACvB,MAAM,IAAI,WAAW,CACnB,qDAAqD,CACtD,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,6BAAK,GAAZ,UAAa,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IACH,oBAAC;AAAD,CAAC,AA5BD,IA4BC","sourcesContent":["import { API } from \"@sentry/core\";\nimport { Event, Response, Transport, TransportOptions } from \"@sentry/types\";\nimport { makePromiseBuffer, PromiseBuffer, SentryError } from \"@sentry/utils\";\n\n/** Base Transport class implementation */\nexport abstract class BaseTransport implements Transport {\n /**\n * @inheritDoc\n */\n public url: string;\n\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<Response> = makePromiseBuffer(30);\n\n public constructor(public options: TransportOptions) {\n this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth();\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike<Response> {\n throw new SentryError(\n \"Transport Class has to implement `sendEvent` method\"\n );\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n"]}
|
package/esm/transports/xhr.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Event, Response } from "@sentry/types";
|
|
2
|
-
import { BaseTransport } from "./base";
|
|
3
|
-
/** `XHR` based transport */
|
|
4
|
-
export declare class XHRTransport extends BaseTransport {
|
|
5
|
-
/**
|
|
6
|
-
* @inheritDoc
|
|
7
|
-
*/
|
|
8
|
-
sendEvent(event: Event): PromiseLike<Response>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=xhr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../src/transports/xhr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,4BAA4B;AAC5B,qBAAa,YAAa,SAAQ,aAAa;IAC7C;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC;CAyBtD"}
|
package/esm/transports/xhr.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { eventStatusFromHttpCode } from '@sentry/utils';
|
|
3
|
-
import { sdk } from "../crossPlatform";
|
|
4
|
-
import { BaseTransport } from "./base";
|
|
5
|
-
/** `XHR` based transport */
|
|
6
|
-
var XHRTransport = /** @class */ (function (_super) {
|
|
7
|
-
__extends(XHRTransport, _super);
|
|
8
|
-
function XHRTransport() {
|
|
9
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
XHRTransport.prototype.sendEvent = function (event) {
|
|
15
|
-
var _this = this;
|
|
16
|
-
var request = sdk.request || sdk.httpRequest;
|
|
17
|
-
return this._buffer.add(function () { return new Promise(function (resolve, reject) {
|
|
18
|
-
// tslint:disable-next-line: no-unsafe-any
|
|
19
|
-
request({
|
|
20
|
-
url: _this.url,
|
|
21
|
-
method: "POST",
|
|
22
|
-
data: JSON.stringify(event),
|
|
23
|
-
header: {
|
|
24
|
-
"content-type": "application/json"
|
|
25
|
-
},
|
|
26
|
-
success: function (res) {
|
|
27
|
-
resolve({
|
|
28
|
-
status: eventStatusFromHttpCode(res.statusCode)
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
fail: function (error) {
|
|
32
|
-
reject(error);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}); });
|
|
36
|
-
};
|
|
37
|
-
return XHRTransport;
|
|
38
|
-
}(BaseTransport));
|
|
39
|
-
export { XHRTransport };
|
|
40
|
-
//# sourceMappingURL=xhr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.js","sourceRoot":"","sources":["../../src/transports/xhr.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,4BAA4B;AAC5B;IAAkC,gCAAa;IAA/C;;IA6BA,CAAC;IA5BC;;OAEG;IACI,gCAAS,GAAhB,UAAiB,KAAY;QAA7B,iBAwBC;QAvBC,IAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,WAAW,CAAC;QAE/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,cAAM,OAAA,IAAI,OAAO,CAAW,UAAC,OAAO,EAAE,MAAM;YAC1C,0CAA0C;YAC1C,OAAO,CAAC;gBACN,GAAG,EAAE,KAAI,CAAC,GAAG;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC3B,MAAM,EAAE;oBACN,cAAc,EAAE,kBAAkB;iBACnC;gBACD,OAAO,EAAP,UAAQ,GAA2B;oBACjC,OAAO,CAAC;wBACN,MAAM,EAAE,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC;qBAChD,CAAC,CAAC;gBACL,CAAC;gBACD,IAAI,EAAJ,UAAK,KAAa;oBAChB,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;aACF,CAAC,CAAC;QACL,CAAC,CAAC,EAlBI,CAkBJ,CACH,CAAC;IACJ,CAAC;IACH,mBAAC;AAAD,CAAC,AA7BD,CAAkC,aAAa,GA6B9C","sourcesContent":["import { Event, Response } from \"@sentry/types\";\nimport { eventStatusFromHttpCode } from '@sentry/utils';\n\nimport { sdk } from \"../crossPlatform\";\n\nimport { BaseTransport } from \"./base\";\n\n/** `XHR` based transport */\nexport class XHRTransport extends BaseTransport {\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike<Response> {\n const request = sdk.request || sdk.httpRequest;\n\n return this._buffer.add(\n () => new Promise<Response>((resolve, reject) => {\n // tslint:disable-next-line: no-unsafe-any\n request({\n url: this.url,\n method: \"POST\",\n data: JSON.stringify(event),\n header: {\n \"content-type\": \"application/json\"\n },\n success(res: { statusCode: number }): void {\n resolve({\n status: eventStatusFromHttpCode(res.statusCode)\n });\n },\n fail(error: object): void {\n reject(error);\n }\n });\n })\n );\n }\n}\n"]}
|