sentry-uniapp 1.0.12 → 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 +11 -9
- package/dist/client.d.ts +38 -40
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +46 -41
- 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 -128
- 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 -2
- 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 -40
- 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 -121
- 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 -3
- package/esm/version.js.map +1 -1
- package/package.json +23 -27
- 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/package.json +0 -52
- package/dist/sentry-uniapp.min.js +0 -3
- package/dist/sentry-uniapp.min.js.LICENSE.txt +0 -14
- package/dist/sentry-uniapp.min.js.map +0 -1
- package/dist/src/backend.d.ts +0 -41
- package/dist/src/backend.d.ts.map +0 -1
- package/dist/src/backend.js +0 -68
- package/dist/src/backend.js.map +0 -1
- package/dist/src/client.d.ts +0 -55
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -51
- package/dist/src/client.js.map +0 -1
- package/dist/src/crossPlatform.d.ts +0 -18
- package/dist/src/crossPlatform.d.ts.map +0 -1
- package/dist/src/crossPlatform.js +0 -80
- package/dist/src/crossPlatform.js.map +0 -1
- package/dist/src/eventbuilder.d.ts +0 -11
- package/dist/src/eventbuilder.d.ts.map +0 -1
- package/dist/src/eventbuilder.js +0 -79
- package/dist/src/eventbuilder.js.map +0 -1
- package/dist/src/flags.d.ts +0 -3
- package/dist/src/flags.d.ts.map +0 -1
- package/dist/src/flags.js +0 -18
- package/dist/src/flags.js.map +0 -1
- package/dist/src/helpers.d.ts +0 -35
- package/dist/src/helpers.d.ts.map +0 -1
- package/dist/src/helpers.js +0 -236
- package/dist/src/helpers.js.map +0 -1
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -40
- package/dist/src/index.js.map +0 -1
- package/dist/src/integrations/globalhandlers.d.ts +0 -47
- package/dist/src/integrations/globalhandlers.d.ts.map +0 -1
- package/dist/src/integrations/globalhandlers.js +0 -153
- package/dist/src/integrations/globalhandlers.js.map +0 -1
- package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
- package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
- package/dist/src/integrations/ignoreMpcrawlerErrors.js +0 -40
- package/dist/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
- package/dist/src/integrations/index.d.ts +0 -7
- package/dist/src/integrations/index.d.ts.map +0 -1
- package/dist/src/integrations/index.js +0 -14
- package/dist/src/integrations/index.js.map +0 -1
- package/dist/src/integrations/linkederrors.d.ts +0 -40
- package/dist/src/integrations/linkederrors.d.ts.map +0 -1
- package/dist/src/integrations/linkederrors.js +0 -65
- package/dist/src/integrations/linkederrors.js.map +0 -1
- package/dist/src/integrations/router.d.ts +0 -28
- package/dist/src/integrations/router.d.ts.map +0 -1
- package/dist/src/integrations/router.js +0 -47
- package/dist/src/integrations/router.js.map +0 -1
- package/dist/src/integrations/system.d.ts +0 -17
- package/dist/src/integrations/system.d.ts.map +0 -1
- package/dist/src/integrations/system.js +0 -65
- package/dist/src/integrations/system.js.map +0 -1
- package/dist/src/integrations/trycatch.d.ts +0 -26
- package/dist/src/integrations/trycatch.d.ts.map +0 -1
- package/dist/src/integrations/trycatch.js +0 -166
- package/dist/src/integrations/trycatch.js.map +0 -1
- package/dist/src/parsers.d.ts +0 -21
- package/dist/src/parsers.d.ts.map +0 -1
- package/dist/src/parsers.js +0 -97
- package/dist/src/parsers.js.map +0 -1
- package/dist/src/sdk.d.ts +0 -99
- package/dist/src/sdk.d.ts.map +0 -1
- package/dist/src/sdk.js +0 -155
- package/dist/src/sdk.js.map +0 -1
- package/dist/src/tracekit.d.ts +0 -38
- package/dist/src/tracekit.d.ts.map +0 -1
- package/dist/src/tracekit.js +0 -222
- package/dist/src/tracekit.js.map +0 -1
- package/dist/src/transports/base.d.ts +0 -22
- package/dist/src/transports/base.d.ts.map +0 -1
- package/dist/src/transports/base.js +0 -28
- package/dist/src/transports/base.js.map +0 -1
- package/dist/src/transports/index.d.ts +0 -3
- package/dist/src/transports/index.d.ts.map +0 -1
- package/dist/src/transports/index.js +0 -6
- package/dist/src/transports/index.js.map +0 -1
- package/dist/src/transports/xhr.d.ts +0 -10
- package/dist/src/transports/xhr.d.ts.map +0 -1
- package/dist/src/transports/xhr.js +0 -42
- package/dist/src/transports/xhr.js.map +0 -1
- package/dist/src/version.d.ts +0 -3
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -6
- package/dist/src/version.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/dist/utils/debug-build.d.ts +0 -7
- package/dist/utils/debug-build.d.ts.map +0 -1
- package/dist/utils/debug-build.js +0 -9
- package/dist/utils/debug-build.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -16
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -50
- package/dist/utils/logger.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/package.json +0 -52
- package/esm/src/backend.d.ts +0 -41
- package/esm/src/backend.d.ts.map +0 -1
- package/esm/src/backend.js +0 -66
- package/esm/src/backend.js.map +0 -1
- package/esm/src/client.d.ts +0 -55
- package/esm/src/client.d.ts.map +0 -1
- package/esm/src/client.js +0 -49
- package/esm/src/client.js.map +0 -1
- package/esm/src/crossPlatform.d.ts +0 -18
- package/esm/src/crossPlatform.d.ts.map +0 -1
- package/esm/src/crossPlatform.js +0 -77
- package/esm/src/crossPlatform.js.map +0 -1
- package/esm/src/eventbuilder.d.ts +0 -11
- package/esm/src/eventbuilder.d.ts.map +0 -1
- package/esm/src/eventbuilder.js +0 -75
- package/esm/src/eventbuilder.js.map +0 -1
- package/esm/src/flags.d.ts +0 -3
- package/esm/src/flags.d.ts.map +0 -1
- package/esm/src/flags.js +0 -16
- package/esm/src/flags.js.map +0 -1
- package/esm/src/helpers.d.ts +0 -35
- package/esm/src/helpers.d.ts.map +0 -1
- package/esm/src/helpers.js +0 -229
- package/esm/src/helpers.js.map +0 -1
- package/esm/src/index.d.ts +0 -10
- package/esm/src/index.d.ts.map +0 -1
- package/esm/src/index.js +0 -9
- package/esm/src/index.js.map +0 -1
- package/esm/src/integrations/globalhandlers.d.ts +0 -47
- package/esm/src/integrations/globalhandlers.d.ts.map +0 -1
- package/esm/src/integrations/globalhandlers.js +0 -151
- package/esm/src/integrations/globalhandlers.js.map +0 -1
- package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
- package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
- package/esm/src/integrations/ignoreMpcrawlerErrors.js +0 -38
- package/esm/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
- package/esm/src/integrations/index.d.ts +0 -7
- package/esm/src/integrations/index.d.ts.map +0 -1
- package/esm/src/integrations/index.js +0 -7
- package/esm/src/integrations/index.js.map +0 -1
- package/esm/src/integrations/linkederrors.d.ts +0 -40
- package/esm/src/integrations/linkederrors.d.ts.map +0 -1
- package/esm/src/integrations/linkederrors.js +0 -63
- package/esm/src/integrations/linkederrors.js.map +0 -1
- package/esm/src/integrations/router.d.ts +0 -28
- package/esm/src/integrations/router.d.ts.map +0 -1
- package/esm/src/integrations/router.js +0 -45
- package/esm/src/integrations/router.js.map +0 -1
- package/esm/src/integrations/system.d.ts +0 -17
- package/esm/src/integrations/system.d.ts.map +0 -1
- package/esm/src/integrations/system.js +0 -63
- package/esm/src/integrations/system.js.map +0 -1
- package/esm/src/integrations/trycatch.d.ts +0 -26
- package/esm/src/integrations/trycatch.d.ts.map +0 -1
- package/esm/src/integrations/trycatch.js +0 -164
- package/esm/src/integrations/trycatch.js.map +0 -1
- package/esm/src/parsers.d.ts +0 -21
- package/esm/src/parsers.d.ts.map +0 -1
- package/esm/src/parsers.js +0 -91
- package/esm/src/parsers.js.map +0 -1
- package/esm/src/sdk.d.ts +0 -99
- package/esm/src/sdk.d.ts.map +0 -1
- package/esm/src/sdk.js +0 -147
- package/esm/src/sdk.js.map +0 -1
- package/esm/src/tracekit.d.ts +0 -38
- package/esm/src/tracekit.d.ts.map +0 -1
- package/esm/src/tracekit.js +0 -219
- package/esm/src/tracekit.js.map +0 -1
- package/esm/src/transports/base.d.ts +0 -22
- package/esm/src/transports/base.d.ts.map +0 -1
- package/esm/src/transports/base.js +0 -26
- package/esm/src/transports/base.js.map +0 -1
- package/esm/src/transports/index.d.ts +0 -3
- package/esm/src/transports/index.d.ts.map +0 -1
- package/esm/src/transports/index.js +0 -3
- package/esm/src/transports/index.js.map +0 -1
- package/esm/src/transports/xhr.d.ts +0 -10
- package/esm/src/transports/xhr.d.ts.map +0 -1
- package/esm/src/transports/xhr.js +0 -40
- package/esm/src/transports/xhr.js.map +0 -1
- package/esm/src/version.d.ts +0 -3
- package/esm/src/version.d.ts.map +0 -1
- package/esm/src/version.js +0 -4
- package/esm/src/version.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
- package/esm/utils/debug-build.d.ts +0 -7
- package/esm/utils/debug-build.d.ts.map +0 -1
- package/esm/utils/debug-build.js +0 -7
- package/esm/utils/debug-build.js.map +0 -1
- package/esm/utils/logger.d.ts +0 -25
- package/esm/utils/logger.d.ts.map +0 -1
- package/esm/utils/logger.js +0 -42
- package/esm/utils/logger.js.map +0 -1
package/dist/src/parsers.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.prepareFramesForEvent = exports.eventFromStacktrace = exports.eventFromPlainObject = exports.exceptionFromStacktrace = void 0;
|
|
3
|
-
var utils_1 = require("@sentry/utils");
|
|
4
|
-
var tracekit_1 = require("./tracekit");
|
|
5
|
-
var STACKTRACE_LIMIT = 100;
|
|
6
|
-
/**
|
|
7
|
-
* This function creates an exception from an TraceKitStackTrace
|
|
8
|
-
* @param stacktrace TraceKitStackTrace that will be converted to an exception
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
function exceptionFromStacktrace(stacktrace) {
|
|
12
|
-
var frames = prepareFramesForEvent(stacktrace.stack);
|
|
13
|
-
var exception = {
|
|
14
|
-
type: stacktrace.name,
|
|
15
|
-
value: stacktrace.message,
|
|
16
|
-
};
|
|
17
|
-
if (frames && frames.length) {
|
|
18
|
-
exception.stacktrace = { frames: frames };
|
|
19
|
-
}
|
|
20
|
-
// tslint:disable-next-line:strict-type-predicates
|
|
21
|
-
if (exception.type === undefined && exception.value === '') {
|
|
22
|
-
exception.value = 'Unrecoverable error caught';
|
|
23
|
-
}
|
|
24
|
-
return exception;
|
|
25
|
-
}
|
|
26
|
-
exports.exceptionFromStacktrace = exceptionFromStacktrace;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
function eventFromPlainObject(exception, syntheticException, rejection) {
|
|
31
|
-
var event = {
|
|
32
|
-
exception: {
|
|
33
|
-
values: [
|
|
34
|
-
{
|
|
35
|
-
type: utils_1.isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',
|
|
36
|
-
value: "Non-Error " + (rejection ? 'promise rejection' : 'exception') + " captured with keys: " + utils_1.extractExceptionKeysForMessage(exception),
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
extra: {
|
|
41
|
-
__serialized__: utils_1.normalizeToSize(exception),
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
if (syntheticException) {
|
|
45
|
-
var stacktrace = tracekit_1.computeStackTrace(syntheticException);
|
|
46
|
-
var frames_1 = prepareFramesForEvent(stacktrace.stack);
|
|
47
|
-
event.stacktrace = {
|
|
48
|
-
frames: frames_1,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return event;
|
|
52
|
-
}
|
|
53
|
-
exports.eventFromPlainObject = eventFromPlainObject;
|
|
54
|
-
/**
|
|
55
|
-
* @hidden
|
|
56
|
-
*/
|
|
57
|
-
function eventFromStacktrace(stacktrace) {
|
|
58
|
-
var exception = exceptionFromStacktrace(stacktrace);
|
|
59
|
-
return {
|
|
60
|
-
exception: {
|
|
61
|
-
values: [exception],
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.eventFromStacktrace = eventFromStacktrace;
|
|
66
|
-
/**
|
|
67
|
-
* @hidden
|
|
68
|
-
*/
|
|
69
|
-
function prepareFramesForEvent(stack) {
|
|
70
|
-
if (!stack || !stack.length) {
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
var localStack = stack;
|
|
74
|
-
var firstFrameFunction = localStack[0].func || '';
|
|
75
|
-
var lastFrameFunction = localStack[localStack.length - 1].func || '';
|
|
76
|
-
// If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
|
|
77
|
-
if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {
|
|
78
|
-
localStack = localStack.slice(1);
|
|
79
|
-
}
|
|
80
|
-
// If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)
|
|
81
|
-
if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {
|
|
82
|
-
localStack = localStack.slice(0, -1);
|
|
83
|
-
}
|
|
84
|
-
// The frame where the crash happened, should be the last entry in the array
|
|
85
|
-
return localStack
|
|
86
|
-
.map(function (frame) { return ({
|
|
87
|
-
colno: frame.column === null ? undefined : frame.column,
|
|
88
|
-
filename: frame.url || localStack[0].url,
|
|
89
|
-
function: frame.func || '?',
|
|
90
|
-
in_app: true,
|
|
91
|
-
lineno: frame.line === null ? undefined : frame.line,
|
|
92
|
-
}); })
|
|
93
|
-
.slice(0, STACKTRACE_LIMIT)
|
|
94
|
-
.reverse();
|
|
95
|
-
}
|
|
96
|
-
exports.prepareFramesForEvent = prepareFramesForEvent;
|
|
97
|
-
//# sourceMappingURL=parsers.js.map
|
package/dist/src/parsers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/parsers.ts"],"names":[],"mappings":"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","sourcesContent":["import { Event, Exception, StackFrame } from '@sentry/types';\nimport { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';\n\nimport { computeStackTrace, StackFrame as TraceKitStackFrame, StackTrace as TraceKitStackTrace } from './tracekit';\n\nconst STACKTRACE_LIMIT = 100;\n\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\nexport function exceptionFromStacktrace(stacktrace: TraceKitStackTrace): Exception {\n const frames = prepareFramesForEvent(stacktrace.stack);\n\n const exception: Exception = {\n type: stacktrace.name,\n value: stacktrace.message,\n };\n\n if (frames && frames.length) {\n exception.stacktrace = { frames };\n }\n\n // tslint:disable-next-line:strict-type-predicates\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(exception: {}, syntheticException?: Error, rejection?: boolean): Event {\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',\n value: `Non-Error ${rejection ? 'promise rejection' : 'exception'\n } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception),\n },\n };\n\n if (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\n/**\n * @hidden\n */\nexport function eventFromStacktrace(stacktrace: TraceKitStackTrace): Event {\n const exception = exceptionFromStacktrace(stacktrace);\n\n return {\n exception: {\n values: [exception],\n },\n };\n}\n\n/**\n * @hidden\n */\nexport function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[] {\n if (!stack || !stack.length) {\n return [];\n }\n\n let localStack = stack;\n\n const firstFrameFunction = localStack[0].func || '';\n const lastFrameFunction = localStack[localStack.length - 1].func || '';\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n }\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n }\n\n // The frame where the crash happened, should be the last entry in the array\n return localStack\n .map(\n (frame: TraceKitStackFrame): StackFrame => ({\n colno: frame.column === null ? undefined : frame.column,\n filename: frame.url || localStack[0].url,\n function: frame.func || '?',\n in_app: true,\n lineno: frame.line === null ? undefined : frame.line,\n }),\n )\n .slice(0, STACKTRACE_LIMIT)\n .reverse();\n}\n"]}
|
package/dist/src/sdk.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Integrations as CoreIntegrations } from "@sentry/core";
|
|
2
|
-
import { MiniappOptions } from "./backend";
|
|
3
|
-
import { ReportDialogOptions } from "./client";
|
|
4
|
-
import { GlobalHandlers, IgnoreMpcrawlerErrors, LinkedErrors, Router, System, TryCatch } from "./integrations/index";
|
|
5
|
-
export declare const defaultIntegrations: (CoreIntegrations.InboundFilters | CoreIntegrations.FunctionToString | TryCatch | GlobalHandlers | LinkedErrors | System | Router | IgnoreMpcrawlerErrors)[];
|
|
6
|
-
/**
|
|
7
|
-
* The Sentry Uniapp SDK Client.
|
|
8
|
-
*
|
|
9
|
-
* To use this SDK, call the {@link init} function as early as possible when
|
|
10
|
-
* launching the app. To set context information or send manual events, use
|
|
11
|
-
* the provided methods.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```
|
|
15
|
-
* import { init } from 'sentry-uniapp';
|
|
16
|
-
*
|
|
17
|
-
* init({
|
|
18
|
-
* dsn: '__DSN__',
|
|
19
|
-
* // ...
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```
|
|
25
|
-
* import { configureScope } from 'sentry-uniapp';
|
|
26
|
-
*
|
|
27
|
-
* configureScope((scope: Scope) => {
|
|
28
|
-
* scope.setExtra({ battery: 0.7 });
|
|
29
|
-
* scope.setTag({ user_mode: 'admin' });
|
|
30
|
-
* scope.setUser({ id: '4711' });
|
|
31
|
-
* });
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```
|
|
36
|
-
* import { addBreadcrumb } from 'sentry-uniapp';
|
|
37
|
-
*
|
|
38
|
-
* addBreadcrumb({
|
|
39
|
-
* message: 'My Breadcrumb',
|
|
40
|
-
* // ...
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```
|
|
46
|
-
* import * as Sentry from 'sentry-uniapp';
|
|
47
|
-
*
|
|
48
|
-
* Sentry.captureMessage('Hello, world!');
|
|
49
|
-
* Sentry.captureException(new Error('Good bye'));
|
|
50
|
-
* Sentry.captureEvent({
|
|
51
|
-
* message: 'Manual',
|
|
52
|
-
* stacktrace: [
|
|
53
|
-
* // ...
|
|
54
|
-
* ],
|
|
55
|
-
* });
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @see {@link MiniappOptions} for documentation on configuration options.
|
|
59
|
-
*/
|
|
60
|
-
export declare function init(options?: MiniappOptions): void;
|
|
61
|
-
/**
|
|
62
|
-
* Present the user with a report dialog.
|
|
63
|
-
* 向用户显示报告对话框。小程序上暂时不考虑实现该功能。
|
|
64
|
-
*
|
|
65
|
-
* @param options Everything is optional, we try to fetch all info need from the global scope.
|
|
66
|
-
*/
|
|
67
|
-
export declare function showReportDialog(options?: ReportDialogOptions): void;
|
|
68
|
-
/**
|
|
69
|
-
* This is the getter for lastEventId. 获取 lastEventId。
|
|
70
|
-
*
|
|
71
|
-
* @returns The last event id of a captured event.
|
|
72
|
-
*/
|
|
73
|
-
export declare function lastEventId(): string | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* A promise that resolves when all current events have been sent.
|
|
76
|
-
* If you provide a timeout and the queue takes longer to drain the promise returns false.
|
|
77
|
-
* 在发送所有当前事件时会变为 resolved 状态的 promise。如果提供了一个超时时间并且队列需要更长时间来消耗,则 promise 将返回 false。
|
|
78
|
-
*
|
|
79
|
-
* @param timeout Maximum time in ms the client should wait.
|
|
80
|
-
*/
|
|
81
|
-
export declare function flush(timeout?: number): PromiseLike<boolean>;
|
|
82
|
-
/**
|
|
83
|
-
* A promise that resolves when all current events have been sent.
|
|
84
|
-
* If you provide a timeout and the queue takes longer to drain the promise returns false.
|
|
85
|
-
*
|
|
86
|
-
* @param timeout Maximum time in ms the client should wait.
|
|
87
|
-
*/
|
|
88
|
-
export declare function close(timeout?: number): PromiseLike<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* Wrap code within a try/catch block so the SDK is able to capture errors.
|
|
91
|
-
* 在 try / catch 块中包装代码,以便 SDK 能够捕获错误。
|
|
92
|
-
* 实际上是 ./helpers 文件中 warp 方法的进一步封装。
|
|
93
|
-
*
|
|
94
|
-
* @param fn A function to wrap.
|
|
95
|
-
*
|
|
96
|
-
* @returns The result of wrapped function call.
|
|
97
|
-
*/
|
|
98
|
-
export declare function wrap(fn: Function): any;
|
|
99
|
-
//# sourceMappingURL=sdk.d.ts.map
|
package/dist/src/sdk.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,IAAI,gBAAgB,EACjC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAiB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,MAAM,EACN,MAAM,EACN,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,mBAAmB,8JAU/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAavD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAQxE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAM5D;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAM5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,QAAQ,GAAG,GAAG,CAGtC"}
|
package/dist/src/sdk.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.wrap = exports.close = exports.flush = exports.lastEventId = exports.showReportDialog = exports.init = exports.defaultIntegrations = void 0;
|
|
3
|
-
var core_1 = require("@sentry/core");
|
|
4
|
-
var utils_1 = require("@sentry/utils");
|
|
5
|
-
var client_1 = require("./client");
|
|
6
|
-
var helpers_1 = require("./helpers");
|
|
7
|
-
var index_1 = require("./integrations/index");
|
|
8
|
-
exports.defaultIntegrations = [
|
|
9
|
-
new core_1.Integrations.InboundFilters(),
|
|
10
|
-
new core_1.Integrations.FunctionToString(),
|
|
11
|
-
new index_1.TryCatch(),
|
|
12
|
-
new index_1.GlobalHandlers(),
|
|
13
|
-
new index_1.LinkedErrors(),
|
|
14
|
-
new index_1.System(),
|
|
15
|
-
new index_1.Router(),
|
|
16
|
-
new index_1.IgnoreMpcrawlerErrors(),
|
|
17
|
-
];
|
|
18
|
-
/**
|
|
19
|
-
* The Sentry Uniapp SDK Client.
|
|
20
|
-
*
|
|
21
|
-
* To use this SDK, call the {@link init} function as early as possible when
|
|
22
|
-
* launching the app. To set context information or send manual events, use
|
|
23
|
-
* the provided methods.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```
|
|
27
|
-
* import { init } from 'sentry-uniapp';
|
|
28
|
-
*
|
|
29
|
-
* init({
|
|
30
|
-
* dsn: '__DSN__',
|
|
31
|
-
* // ...
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```
|
|
37
|
-
* import { configureScope } from 'sentry-uniapp';
|
|
38
|
-
*
|
|
39
|
-
* configureScope((scope: Scope) => {
|
|
40
|
-
* scope.setExtra({ battery: 0.7 });
|
|
41
|
-
* scope.setTag({ user_mode: 'admin' });
|
|
42
|
-
* scope.setUser({ id: '4711' });
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```
|
|
48
|
-
* import { addBreadcrumb } from 'sentry-uniapp';
|
|
49
|
-
*
|
|
50
|
-
* addBreadcrumb({
|
|
51
|
-
* message: 'My Breadcrumb',
|
|
52
|
-
* // ...
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```
|
|
58
|
-
* import * as Sentry from 'sentry-uniapp';
|
|
59
|
-
*
|
|
60
|
-
* Sentry.captureMessage('Hello, world!');
|
|
61
|
-
* Sentry.captureException(new Error('Good bye'));
|
|
62
|
-
* Sentry.captureEvent({
|
|
63
|
-
* message: 'Manual',
|
|
64
|
-
* stacktrace: [
|
|
65
|
-
* // ...
|
|
66
|
-
* ],
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @see {@link MiniappOptions} for documentation on configuration options.
|
|
71
|
-
*/
|
|
72
|
-
function init(options) {
|
|
73
|
-
if (options === void 0) { options = {}; }
|
|
74
|
-
// 如果将 options.defaultIntegrations 设置为 false,则不会添加默认集成,否则将在内部将其设置为建议的默认集成。
|
|
75
|
-
// tslint:disable-next-line: strict-comparisons
|
|
76
|
-
if (options.defaultIntegrations === undefined) {
|
|
77
|
-
options.defaultIntegrations = exports.defaultIntegrations;
|
|
78
|
-
}
|
|
79
|
-
options.normalizeDepth = options.normalizeDepth || 5;
|
|
80
|
-
if (options.defaultIntegrations) {
|
|
81
|
-
options.defaultIntegrations[3].setExtraOptions(options.extraOptions);
|
|
82
|
-
}
|
|
83
|
-
core_1.initAndBind(client_1.MiniappClient, options);
|
|
84
|
-
}
|
|
85
|
-
exports.init = init;
|
|
86
|
-
/**
|
|
87
|
-
* Present the user with a report dialog.
|
|
88
|
-
* 向用户显示报告对话框。小程序上暂时不考虑实现该功能。
|
|
89
|
-
*
|
|
90
|
-
* @param options Everything is optional, we try to fetch all info need from the global scope.
|
|
91
|
-
*/
|
|
92
|
-
function showReportDialog(options) {
|
|
93
|
-
if (options === void 0) { options = {}; }
|
|
94
|
-
if (!options.eventId) {
|
|
95
|
-
options.eventId = core_1.getCurrentHub().lastEventId();
|
|
96
|
-
}
|
|
97
|
-
var client = core_1.getCurrentHub().getClient();
|
|
98
|
-
if (client) {
|
|
99
|
-
client.showReportDialog(options);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.showReportDialog = showReportDialog;
|
|
103
|
-
/**
|
|
104
|
-
* This is the getter for lastEventId. 获取 lastEventId。
|
|
105
|
-
*
|
|
106
|
-
* @returns The last event id of a captured event.
|
|
107
|
-
*/
|
|
108
|
-
function lastEventId() {
|
|
109
|
-
return core_1.getCurrentHub().lastEventId();
|
|
110
|
-
}
|
|
111
|
-
exports.lastEventId = lastEventId;
|
|
112
|
-
/**
|
|
113
|
-
* A promise that resolves when all current events have been sent.
|
|
114
|
-
* If you provide a timeout and the queue takes longer to drain the promise returns false.
|
|
115
|
-
* 在发送所有当前事件时会变为 resolved 状态的 promise。如果提供了一个超时时间并且队列需要更长时间来消耗,则 promise 将返回 false。
|
|
116
|
-
*
|
|
117
|
-
* @param timeout Maximum time in ms the client should wait.
|
|
118
|
-
*/
|
|
119
|
-
function flush(timeout) {
|
|
120
|
-
var client = core_1.getCurrentHub().getClient();
|
|
121
|
-
if (client) {
|
|
122
|
-
return client.flush(timeout);
|
|
123
|
-
}
|
|
124
|
-
return utils_1.resolvedSyncPromise(false);
|
|
125
|
-
}
|
|
126
|
-
exports.flush = flush;
|
|
127
|
-
/**
|
|
128
|
-
* A promise that resolves when all current events have been sent.
|
|
129
|
-
* If you provide a timeout and the queue takes longer to drain the promise returns false.
|
|
130
|
-
*
|
|
131
|
-
* @param timeout Maximum time in ms the client should wait.
|
|
132
|
-
*/
|
|
133
|
-
function close(timeout) {
|
|
134
|
-
var client = core_1.getCurrentHub().getClient();
|
|
135
|
-
if (client) {
|
|
136
|
-
return client.close(timeout);
|
|
137
|
-
}
|
|
138
|
-
return utils_1.resolvedSyncPromise(false);
|
|
139
|
-
}
|
|
140
|
-
exports.close = close;
|
|
141
|
-
/**
|
|
142
|
-
* Wrap code within a try/catch block so the SDK is able to capture errors.
|
|
143
|
-
* 在 try / catch 块中包装代码,以便 SDK 能够捕获错误。
|
|
144
|
-
* 实际上是 ./helpers 文件中 warp 方法的进一步封装。
|
|
145
|
-
*
|
|
146
|
-
* @param fn A function to wrap.
|
|
147
|
-
*
|
|
148
|
-
* @returns The result of wrapped function call.
|
|
149
|
-
*/
|
|
150
|
-
function wrap(fn) {
|
|
151
|
-
// tslint:disable-next-line: no-unsafe-any
|
|
152
|
-
return helpers_1.wrap(fn)();
|
|
153
|
-
}
|
|
154
|
-
exports.wrap = wrap;
|
|
155
|
-
//# sourceMappingURL=sdk.js.map
|
package/dist/src/sdk.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";;AAAA,qCAIsB;AACtB,uCAAoD;AAGpD,mCAA8D;AAC9D,qCAAiD;AACjD,8CAO8B;AAEjB,QAAA,mBAAmB,GAAG;IACjC,IAAI,mBAAgB,CAAC,cAAc,EAAE;IACrC,IAAI,mBAAgB,CAAC,gBAAgB,EAAE;IACvC,IAAI,gBAAQ,EAAE;IACd,IAAI,sBAAc,EAAE;IACpB,IAAI,oBAAY,EAAE;IAElB,IAAI,cAAM,EAAE;IACZ,IAAI,cAAM,EAAE;IACZ,IAAI,6BAAqB,EAAE;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,SAAgB,IAAI,CAAC,OAA4B;IAA5B,wBAAA,EAAA,YAA4B;IAC/C,0EAA0E;IAC1E,+CAA+C;IAC/C,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QAC7C,OAAO,CAAC,mBAAmB,GAAG,2BAAmB,CAAC;KACnD;IAED,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC;IACrD,IAAI,OAAO,CAAC,mBAAmB,EAAE;QAC9B,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;KAC1F;IAED,kBAAW,CAAC,sBAAa,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAbD,oBAaC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAiC;IAAjC,wBAAA,EAAA,YAAiC;IAChE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,oBAAa,EAAE,CAAC,WAAW,EAAE,CAAC;KACjD;IACD,IAAM,MAAM,GAAG,oBAAa,EAAE,CAAC,SAAS,EAAiB,CAAC;IAC1D,IAAI,MAAM,EAAE;QACV,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;KAClC;AACH,CAAC;AARD,4CAQC;AAED;;;;GAIG;AACH,SAAgB,WAAW;IACzB,OAAO,oBAAa,EAAE,CAAC,WAAW,EAAE,CAAC;AACvC,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CAAC,OAAgB;IACpC,IAAM,MAAM,GAAG,oBAAa,EAAE,CAAC,SAAS,EAAiB,CAAC;IAC1D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC9B;IACD,OAAO,2BAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAND,sBAMC;AAED;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,OAAgB;IACpC,IAAM,MAAM,GAAG,oBAAa,EAAE,CAAC,SAAS,EAAiB,CAAC;IAC1D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC9B;IACD,OAAO,2BAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAND,sBAMC;AAED;;;;;;;;GAQG;AACH,SAAgB,IAAI,CAAC,EAAY;IAC/B,0CAA0C;IAC1C,OAAO,cAAY,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5B,CAAC;AAHD,oBAGC","sourcesContent":["import {\n getCurrentHub,\n initAndBind,\n Integrations as CoreIntegrations,\n} from \"@sentry/core\";\nimport { resolvedSyncPromise } from \"@sentry/utils\";\n\nimport { MiniappOptions } from \"./backend\";\nimport { MiniappClient, ReportDialogOptions } from \"./client\";\nimport { wrap as internalWrap } from \"./helpers\";\nimport {\n GlobalHandlers,\n IgnoreMpcrawlerErrors,\n LinkedErrors,\n Router,\n System,\n TryCatch,\n} from \"./integrations/index\";\n\nexport const defaultIntegrations = [\n new CoreIntegrations.InboundFilters(),\n new CoreIntegrations.FunctionToString(),\n new TryCatch(),\n new GlobalHandlers(),\n new LinkedErrors(),\n\n new System(),\n new Router(),\n new IgnoreMpcrawlerErrors(),\n];\n\n/**\n * The Sentry Uniapp SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * launching the app. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n * ```\n * import { init } from 'sentry-uniapp';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n * import { configureScope } from 'sentry-uniapp';\n *\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n * import { addBreadcrumb } from 'sentry-uniapp';\n *\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n * import * as Sentry from 'sentry-uniapp';\n *\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link MiniappOptions} for documentation on configuration options.\n */\nexport function init(options: MiniappOptions = {}): void {\n // 如果将 options.defaultIntegrations 设置为 false,则不会添加默认集成,否则将在内部将其设置为建议的默认集成。\n // tslint:disable-next-line: strict-comparisons\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n\n options.normalizeDepth = options.normalizeDepth || 5;\n if (options.defaultIntegrations) {\n (options.defaultIntegrations[3] as GlobalHandlers).setExtraOptions(options.extraOptions);\n }\n\n initAndBind(MiniappClient, options);\n}\n\n/**\n * Present the user with a report dialog.\n * 向用户显示报告对话框。小程序上暂时不考虑实现该功能。\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n if (!options.eventId) {\n options.eventId = getCurrentHub().lastEventId();\n }\n const client = getCurrentHub().getClient<MiniappClient>();\n if (client) {\n client.showReportDialog(options);\n }\n}\n\n/**\n * This is the getter for lastEventId. 获取 lastEventId。\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n return getCurrentHub().lastEventId();\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n * 在发送所有当前事件时会变为 resolved 状态的 promise。如果提供了一个超时时间并且队列需要更长时间来消耗,则 promise 将返回 false。\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function flush(timeout?: number): PromiseLike<boolean> {\n const client = getCurrentHub().getClient<MiniappClient>();\n if (client) {\n return client.flush(timeout);\n }\n return resolvedSyncPromise(false);\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function close(timeout?: number): PromiseLike<boolean> {\n const client = getCurrentHub().getClient<MiniappClient>();\n if (client) {\n return client.close(timeout);\n }\n return resolvedSyncPromise(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n * 在 try / catch 块中包装代码,以便 SDK 能够捕获错误。\n * 实际上是 ./helpers 文件中 warp 方法的进一步封装。\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\nexport function wrap(fn: Function): any {\n // tslint:disable-next-line: no-unsafe-any\n return internalWrap(fn)();\n}\n"]}
|
package/dist/src/tracekit.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This was originally forked from https://github.com/occ/TraceKit, but has since been
|
|
3
|
-
* largely modified and is now maintained as part of Sentry JS SDK.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* An object representing a single stack frame.
|
|
7
|
-
* {Object} StackFrame
|
|
8
|
-
* {string} url The JavaScript or HTML file URL.
|
|
9
|
-
* {string} func The function name, or empty for anonymous functions (if guessing did not work).
|
|
10
|
-
* {string[]?} args The arguments passed to the function, if known.
|
|
11
|
-
* {number=} line The line number, if known.
|
|
12
|
-
* {number=} column The column number, if known.
|
|
13
|
-
* {string[]} context An array of source code lines; the middle element corresponds to the correct line#.
|
|
14
|
-
*/
|
|
15
|
-
export interface StackFrame {
|
|
16
|
-
url: string;
|
|
17
|
-
func: string;
|
|
18
|
-
args: string[];
|
|
19
|
-
line: number | null;
|
|
20
|
-
column: number | null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* An object representing a JavaScript stack trace.
|
|
24
|
-
* {Object} StackTrace
|
|
25
|
-
* {string} name The name of the thrown exception.
|
|
26
|
-
* {string} message The exception error message.
|
|
27
|
-
* {TraceKit.StackFrame[]} stack An array of stack frames.
|
|
28
|
-
*/
|
|
29
|
-
export interface StackTrace {
|
|
30
|
-
name: string;
|
|
31
|
-
message: string;
|
|
32
|
-
mechanism?: string;
|
|
33
|
-
stack: StackFrame[];
|
|
34
|
-
failed?: boolean;
|
|
35
|
-
}
|
|
36
|
-
/** JSDoc */
|
|
37
|
-
export declare function computeStackTrace(ex: any): StackTrace;
|
|
38
|
-
//# sourceMappingURL=tracekit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracekit.d.ts","sourceRoot":"","sources":["../../src/tracekit.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAgBD,YAAY;AACZ,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,GAAG,GAAG,UAAU,CAoCrD"}
|
package/dist/src/tracekit.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
// tslint:disable:object-literal-sort-keys
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computeStackTrace = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
// global reference to slice
|
|
6
|
-
var UNKNOWN_FUNCTION = "?";
|
|
7
|
-
// Chromium based browsers: Chrome, Brave, new Opera, new Edge
|
|
8
|
-
var chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[-a-z]+:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
9
|
-
// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
|
|
10
|
-
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
|
|
11
|
-
// We need this specific case for now because we want no other regex to match.
|
|
12
|
-
var gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
13
|
-
var winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
14
|
-
var geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
15
|
-
var chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/;
|
|
16
|
-
var miniapp = /^\s*at (\w.*) \((\w*.js):(\d*):(\d*)/i;
|
|
17
|
-
/** JSDoc */
|
|
18
|
-
function computeStackTrace(ex) {
|
|
19
|
-
// console.log('computeStackTrace', ex)
|
|
20
|
-
// tslint:disable:no-unsafe-any
|
|
21
|
-
var stack = null;
|
|
22
|
-
var popSize = ex && ex.framesToPop;
|
|
23
|
-
try {
|
|
24
|
-
// This must be tried first because Opera 10 *destroys*
|
|
25
|
-
// its stacktrace property if you try to access the stack
|
|
26
|
-
// property first!!
|
|
27
|
-
stack = computeStackTraceFromStacktraceProp(ex);
|
|
28
|
-
if (stack) {
|
|
29
|
-
// console.log('computeStackTraceFromStacktraceProp', stack, popSize, popFrames(stack, popSize))
|
|
30
|
-
return popFrames(stack, popSize);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
// no-empty
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
stack = computeStackTraceFromStackProp(ex);
|
|
38
|
-
if (stack) {
|
|
39
|
-
// console.log('computeStackTraceFromStackProp', stack, popSize, popFrames(stack, popSize))
|
|
40
|
-
return popFrames(stack, popSize);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
// no-empty
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
message: extractMessage(ex),
|
|
48
|
-
name: ex && ex.name,
|
|
49
|
-
stack: [],
|
|
50
|
-
failed: true,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
exports.computeStackTrace = computeStackTrace;
|
|
54
|
-
/** JSDoc */
|
|
55
|
-
// tslint:disable-next-line:cyclomatic-complexity
|
|
56
|
-
function computeStackTraceFromStackProp(ex) {
|
|
57
|
-
// tslint:disable:no-conditional-assignment
|
|
58
|
-
if (!ex || !ex.stack) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
var stack = [];
|
|
62
|
-
var lines = ex.stack.split("\n");
|
|
63
|
-
var isEval;
|
|
64
|
-
var submatch;
|
|
65
|
-
var parts;
|
|
66
|
-
var element;
|
|
67
|
-
// console.log('lines', lines)
|
|
68
|
-
for (var i = 0; i < lines.length; ++i) {
|
|
69
|
-
// console.log(lines[i], chrome.exec(lines[i]), winjs.exec(lines[i]), gecko.exec(lines[i]))
|
|
70
|
-
if ((parts = chrome.exec(lines[i]))) {
|
|
71
|
-
var isNative = parts[2] && parts[2].indexOf("native") === 0; // start of line
|
|
72
|
-
isEval = parts[2] && parts[2].indexOf("eval") === 0; // start of line
|
|
73
|
-
if (isEval && (submatch = chromeEval.exec(parts[2]))) {
|
|
74
|
-
// throw out eval line/column and use top-most line/column number
|
|
75
|
-
parts[2] = submatch[1]; // url
|
|
76
|
-
parts[3] = submatch[2]; // line
|
|
77
|
-
parts[4] = submatch[3]; // column
|
|
78
|
-
}
|
|
79
|
-
element = {
|
|
80
|
-
url: parts[2],
|
|
81
|
-
func: parts[1] || UNKNOWN_FUNCTION,
|
|
82
|
-
args: isNative ? [parts[2]] : [],
|
|
83
|
-
line: parts[3] ? +parts[3] : null,
|
|
84
|
-
column: parts[4] ? +parts[4] : null,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
else if ((parts = winjs.exec(lines[i]))) {
|
|
88
|
-
element = {
|
|
89
|
-
url: parts[2],
|
|
90
|
-
func: parts[1] || UNKNOWN_FUNCTION,
|
|
91
|
-
args: [],
|
|
92
|
-
line: +parts[3],
|
|
93
|
-
column: parts[4] ? +parts[4] : null,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
else if ((parts = gecko.exec(lines[i]))) {
|
|
97
|
-
isEval = parts[3] && parts[3].indexOf(" > eval") > -1;
|
|
98
|
-
if (isEval && (submatch = geckoEval.exec(parts[3]))) {
|
|
99
|
-
// throw out eval line/column and use top-most line number
|
|
100
|
-
parts[1] = parts[1] || "eval";
|
|
101
|
-
parts[3] = submatch[1];
|
|
102
|
-
parts[4] = submatch[2];
|
|
103
|
-
parts[5] = ""; // no column when eval
|
|
104
|
-
}
|
|
105
|
-
else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {
|
|
106
|
-
// FireFox uses this awesome columnNumber property for its top frame
|
|
107
|
-
// Also note, Firefox's column number is 0-based and everything else expects 1-based,
|
|
108
|
-
// so adding 1
|
|
109
|
-
// NOTE: this hack doesn't work if top-most frame is eval
|
|
110
|
-
stack[0].column = ex.columnNumber + 1;
|
|
111
|
-
}
|
|
112
|
-
element = {
|
|
113
|
-
url: parts[3],
|
|
114
|
-
func: parts[1] || UNKNOWN_FUNCTION,
|
|
115
|
-
args: parts[2] ? parts[2].split(",") : [],
|
|
116
|
-
line: parts[4] ? +parts[4] : null,
|
|
117
|
-
column: parts[5] ? +parts[5] : null,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
else if ((parts = miniapp.exec(lines[i]))) {
|
|
121
|
-
element = {
|
|
122
|
-
url: parts[2],
|
|
123
|
-
func: parts[1] || UNKNOWN_FUNCTION,
|
|
124
|
-
args: [],
|
|
125
|
-
line: parts[3] ? +parts[3] : null,
|
|
126
|
-
column: parts[4] ? +parts[4] : null,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
if (!element.func && element.line) {
|
|
133
|
-
element.func = UNKNOWN_FUNCTION;
|
|
134
|
-
}
|
|
135
|
-
stack.push(element);
|
|
136
|
-
}
|
|
137
|
-
if (!stack.length) {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
message: extractMessage(ex),
|
|
142
|
-
name: ex.name,
|
|
143
|
-
stack: stack,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/** JSDoc */
|
|
147
|
-
function computeStackTraceFromStacktraceProp(ex) {
|
|
148
|
-
if (!ex || !ex.stacktrace) {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
// Access and store the stacktrace property before doing ANYTHING
|
|
152
|
-
// else to it because Opera is not very good at providing it
|
|
153
|
-
// reliably in other circumstances.
|
|
154
|
-
var stacktrace = ex.stacktrace;
|
|
155
|
-
var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
156
|
-
var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i;
|
|
157
|
-
var lines = stacktrace.split("\n");
|
|
158
|
-
var stack = [];
|
|
159
|
-
var parts;
|
|
160
|
-
for (var line = 0; line < lines.length; line += 2) {
|
|
161
|
-
// tslint:disable:no-conditional-assignment
|
|
162
|
-
var element = null;
|
|
163
|
-
if ((parts = opera10Regex.exec(lines[line]))) {
|
|
164
|
-
element = {
|
|
165
|
-
url: parts[2],
|
|
166
|
-
func: parts[3],
|
|
167
|
-
args: [],
|
|
168
|
-
line: +parts[1],
|
|
169
|
-
column: null,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
else if ((parts = opera11Regex.exec(lines[line]))) {
|
|
173
|
-
element = {
|
|
174
|
-
url: parts[6],
|
|
175
|
-
func: parts[3] || parts[4],
|
|
176
|
-
args: parts[5] ? parts[5].split(",") : [],
|
|
177
|
-
line: +parts[1],
|
|
178
|
-
column: +parts[2],
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
if (element) {
|
|
182
|
-
if (!element.func && element.line) {
|
|
183
|
-
element.func = UNKNOWN_FUNCTION;
|
|
184
|
-
}
|
|
185
|
-
stack.push(element);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (!stack.length) {
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
message: extractMessage(ex),
|
|
193
|
-
name: ex.name,
|
|
194
|
-
stack: stack,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
/** Remove N number of frames from the stack */
|
|
198
|
-
function popFrames(stacktrace, popSize) {
|
|
199
|
-
try {
|
|
200
|
-
return tslib_1.__assign(tslib_1.__assign({}, stacktrace), { stack: stacktrace.stack.slice(popSize) });
|
|
201
|
-
}
|
|
202
|
-
catch (e) {
|
|
203
|
-
return stacktrace;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* There are cases where stacktrace.message is an Event object
|
|
208
|
-
* https://github.com/getsentry/sentry-javascript/issues/1949
|
|
209
|
-
* In this specific case we try to extract stacktrace.message.error.message
|
|
210
|
-
*/
|
|
211
|
-
function extractMessage(ex) {
|
|
212
|
-
var message = ex && ex.message;
|
|
213
|
-
// console.log('message',message)
|
|
214
|
-
if (!message) {
|
|
215
|
-
return "No error message";
|
|
216
|
-
}
|
|
217
|
-
if (message.error && typeof message.error.message === "string") {
|
|
218
|
-
return message.error.message;
|
|
219
|
-
}
|
|
220
|
-
return message;
|
|
221
|
-
}
|
|
222
|
-
//# sourceMappingURL=tracekit.js.map
|