@sentry/browser 7.0.0-beta.0 → 7.0.0-beta.1
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 +2 -3
- package/cjs/client.js +125 -102
- package/cjs/client.js.map +1 -1
- package/cjs/eventbuilder.js +225 -165
- package/cjs/eventbuilder.js.map +1 -1
- package/cjs/exports.js +55 -59
- package/cjs/exports.js.map +1 -1
- package/cjs/flags.js +7 -3
- package/cjs/flags.js.map +1 -1
- package/cjs/helpers.js +123 -96
- package/cjs/helpers.js.map +1 -1
- package/cjs/index.js +77 -10
- package/cjs/index.js.map +1 -1
- package/cjs/integrations/breadcrumbs.js +222 -174
- package/cjs/integrations/breadcrumbs.js.map +1 -1
- package/cjs/integrations/dedupe.js +184 -142
- package/cjs/integrations/dedupe.js.map +1 -1
- package/cjs/integrations/globalhandlers.js +211 -170
- package/cjs/integrations/globalhandlers.js.map +1 -1
- package/cjs/integrations/httpcontext.js +51 -0
- package/cjs/integrations/httpcontext.js.map +1 -0
- package/cjs/integrations/index.js +18 -14
- package/cjs/integrations/index.js.map +1 -1
- package/cjs/integrations/linkederrors.js +81 -50
- package/cjs/integrations/linkederrors.js.map +1 -1
- package/cjs/integrations/trycatch.js +247 -208
- package/cjs/integrations/trycatch.js.map +1 -1
- package/cjs/sdk.js +166 -125
- package/cjs/sdk.js.map +1 -1
- package/cjs/stack-parsers.js +143 -93
- package/cjs/stack-parsers.js.map +1 -1
- package/cjs/transports/fetch.js +30 -15
- package/cjs/transports/fetch.js.map +1 -1
- package/cjs/transports/index.js +10 -6
- package/cjs/transports/index.js.map +1 -1
- package/cjs/transports/utils.js +56 -51
- package/cjs/transports/utils.js.map +1 -1
- package/cjs/transports/xhr.js +40 -30
- package/cjs/transports/xhr.js.map +1 -1
- package/esm/client.js +124 -101
- package/esm/client.js.map +1 -1
- package/esm/eventbuilder.js +218 -158
- package/esm/eventbuilder.js.map +1 -1
- package/esm/exports.js +12 -8
- package/esm/exports.js.map +1 -1
- package/esm/flags.js +5 -2
- package/esm/flags.js.map +1 -1
- package/esm/helpers.js +122 -95
- package/esm/helpers.js.map +1 -1
- package/esm/index.js +27 -7
- package/esm/index.js.map +1 -1
- package/esm/integrations/breadcrumbs.js +218 -171
- package/esm/integrations/breadcrumbs.js.map +1 -1
- package/esm/integrations/dedupe.js +181 -139
- package/esm/integrations/dedupe.js.map +1 -1
- package/esm/integrations/globalhandlers.js +208 -167
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/httpcontext.js +49 -0
- package/esm/integrations/httpcontext.js.map +1 -0
- package/esm/integrations/index.js +7 -7
- package/esm/integrations/index.js.map +1 -1
- package/esm/integrations/linkederrors.js +77 -46
- package/esm/integrations/linkederrors.js.map +1 -1
- package/esm/integrations/trycatch.js +244 -205
- package/esm/integrations/trycatch.js.map +1 -1
- package/esm/sdk.js +163 -123
- package/esm/sdk.js.map +1 -1
- package/esm/stack-parsers.js +134 -91
- package/esm/stack-parsers.js.map +1 -1
- package/esm/transports/fetch.js +28 -13
- package/esm/transports/fetch.js.map +1 -1
- package/esm/transports/index.js +3 -3
- package/esm/transports/index.js.map +1 -1
- package/esm/transports/utils.js +55 -50
- package/esm/transports/utils.js.map +1 -1
- package/esm/transports/xhr.js +38 -28
- package/esm/transports/xhr.js.map +1 -1
- package/package.json +4 -4
- package/types/client.d.ts +3 -2
- package/types/client.d.ts.map +1 -1
- package/types/exports.d.ts +3 -4
- package/types/exports.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/integrations/{useragent.d.ts → httpcontext.d.ts} +3 -3
- package/types/integrations/httpcontext.d.ts.map +1 -0
- package/types/integrations/index.d.ts +1 -1
- package/types/integrations/index.d.ts.map +1 -1
- package/types/sdk.d.ts +2 -2
- package/types/sdk.d.ts.map +1 -1
- package/types/transports/fetch.d.ts +3 -5
- package/types/transports/fetch.d.ts.map +1 -1
- package/types/transports/types.d.ts +10 -0
- package/types/transports/types.d.ts.map +1 -0
- package/types/transports/xhr.d.ts +3 -7
- package/types/transports/xhr.d.ts.map +1 -1
- package/cjs/client.d.ts +0 -63
- package/cjs/client.d.ts.map +0 -1
- package/cjs/eventbuilder.d.ts +0 -37
- package/cjs/eventbuilder.d.ts.map +0 -1
- package/cjs/exports.d.ts +0 -11
- package/cjs/exports.d.ts.map +0 -1
- package/cjs/flags.d.ts +0 -3
- package/cjs/flags.d.ts.map +0 -1
- package/cjs/helpers.d.ts +0 -47
- package/cjs/helpers.d.ts.map +0 -1
- package/cjs/index.d.ts +0 -15
- package/cjs/index.d.ts.map +0 -1
- package/cjs/integrations/breadcrumbs.d.ts +0 -46
- package/cjs/integrations/breadcrumbs.d.ts.map +0 -1
- package/cjs/integrations/dedupe.d.ts +0 -21
- package/cjs/integrations/dedupe.d.ts.map +0 -1
- package/cjs/integrations/globalhandlers.d.ts +0 -30
- package/cjs/integrations/globalhandlers.d.ts.map +0 -1
- package/cjs/integrations/index.d.ts +0 -7
- package/cjs/integrations/index.d.ts.map +0 -1
- package/cjs/integrations/linkederrors.d.ts +0 -42
- package/cjs/integrations/linkederrors.d.ts.map +0 -1
- package/cjs/integrations/trycatch.d.ts +0 -33
- package/cjs/integrations/trycatch.d.ts.map +0 -1
- package/cjs/integrations/useragent.d.ts +0 -17
- package/cjs/integrations/useragent.d.ts.map +0 -1
- package/cjs/integrations/useragent.js +0 -40
- package/cjs/integrations/useragent.js.map +0 -1
- package/cjs/sdk.d.ts +0 -112
- package/cjs/sdk.d.ts.map +0 -1
- package/cjs/stack-parsers.d.ts +0 -9
- package/cjs/stack-parsers.d.ts.map +0 -1
- package/cjs/transports/fetch.d.ts +0 -10
- package/cjs/transports/fetch.d.ts.map +0 -1
- package/cjs/transports/index.d.ts +0 -3
- package/cjs/transports/index.d.ts.map +0 -1
- package/cjs/transports/utils.d.ts +0 -48
- package/cjs/transports/utils.d.ts.map +0 -1
- package/cjs/transports/xhr.d.ts +0 -11
- package/cjs/transports/xhr.d.ts.map +0 -1
- package/cjs/version.d.ts +0 -2
- package/cjs/version.d.ts.map +0 -1
- package/cjs/version.js +0 -4
- package/cjs/version.js.map +0 -1
- package/esm/client.d.ts +0 -63
- package/esm/client.d.ts.map +0 -1
- package/esm/eventbuilder.d.ts +0 -37
- package/esm/eventbuilder.d.ts.map +0 -1
- package/esm/exports.d.ts +0 -11
- package/esm/exports.d.ts.map +0 -1
- package/esm/flags.d.ts +0 -3
- package/esm/flags.d.ts.map +0 -1
- package/esm/helpers.d.ts +0 -47
- package/esm/helpers.d.ts.map +0 -1
- package/esm/index.d.ts +0 -15
- package/esm/index.d.ts.map +0 -1
- package/esm/integrations/breadcrumbs.d.ts +0 -46
- package/esm/integrations/breadcrumbs.d.ts.map +0 -1
- package/esm/integrations/dedupe.d.ts +0 -21
- package/esm/integrations/dedupe.d.ts.map +0 -1
- package/esm/integrations/globalhandlers.d.ts +0 -30
- package/esm/integrations/globalhandlers.d.ts.map +0 -1
- package/esm/integrations/index.d.ts +0 -7
- package/esm/integrations/index.d.ts.map +0 -1
- package/esm/integrations/linkederrors.d.ts +0 -42
- package/esm/integrations/linkederrors.d.ts.map +0 -1
- package/esm/integrations/trycatch.d.ts +0 -33
- package/esm/integrations/trycatch.d.ts.map +0 -1
- package/esm/integrations/useragent.d.ts +0 -17
- package/esm/integrations/useragent.d.ts.map +0 -1
- package/esm/integrations/useragent.js +0 -38
- package/esm/integrations/useragent.js.map +0 -1
- package/esm/sdk.d.ts +0 -112
- package/esm/sdk.d.ts.map +0 -1
- package/esm/stack-parsers.d.ts +0 -9
- package/esm/stack-parsers.d.ts.map +0 -1
- package/esm/transports/fetch.d.ts +0 -10
- package/esm/transports/fetch.d.ts.map +0 -1
- package/esm/transports/index.d.ts +0 -3
- package/esm/transports/index.d.ts.map +0 -1
- package/esm/transports/utils.d.ts +0 -48
- package/esm/transports/utils.d.ts.map +0 -1
- package/esm/transports/xhr.d.ts +0 -11
- package/esm/transports/xhr.d.ts.map +0 -1
- package/esm/version.d.ts +0 -2
- package/esm/version.d.ts.map +0 -1
- package/esm/version.js +0 -3
- package/esm/version.js.map +0 -1
- package/types/integrations/useragent.d.ts.map +0 -1
- package/types/version.d.ts +0 -2
- package/types/version.d.ts.map +0 -1
package/esm/helpers.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { withScope, captureException } from '@sentry/core';
|
|
2
|
+
import { getOriginalFunction, addExceptionTypeValue, addExceptionMechanism, markFunctionWrapped, addNonEnumerableProperty } from '@sentry/utils';
|
|
3
|
+
|
|
3
4
|
let ignoreOnError = 0;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* @hidden
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
function shouldIgnoreOnError() {
|
|
10
|
+
return ignoreOnError > 0;
|
|
9
11
|
}
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* @hidden
|
|
12
15
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
function ignoreNextOnError() {
|
|
17
|
+
// onerror should trigger before setTimeout
|
|
18
|
+
ignoreOnError += 1;
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
ignoreOnError -= 1;
|
|
21
|
+
});
|
|
19
22
|
}
|
|
23
|
+
|
|
20
24
|
/**
|
|
21
25
|
* Instruments the given function and sends an event to Sentry every time the
|
|
22
26
|
* function throws an exception.
|
|
@@ -25,94 +29,117 @@ export function ignoreNextOnError() {
|
|
|
25
29
|
* @returns The wrapped function.
|
|
26
30
|
* @hidden
|
|
27
31
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
function wrap(
|
|
33
|
+
fn,
|
|
34
|
+
options
|
|
35
|
+
|
|
36
|
+
= {},
|
|
37
|
+
before,
|
|
38
|
+
) {
|
|
39
|
+
// for future readers what this does is wrap a function and then create
|
|
40
|
+
// a bi-directional wrapping between them.
|
|
41
|
+
//
|
|
42
|
+
// example: wrapped = wrap(original);
|
|
43
|
+
// original.__sentry_wrapped__ -> wrapped
|
|
44
|
+
// wrapped.__sentry_original__ -> original
|
|
45
|
+
|
|
46
|
+
if (typeof fn !== 'function') {
|
|
47
|
+
return fn;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
// if we're dealing with a function that was previously wrapped, return
|
|
52
|
+
// the original wrapper.
|
|
53
|
+
var wrapper = fn.__sentry_wrapped__;
|
|
54
|
+
if (wrapper) {
|
|
55
|
+
return wrapper;
|
|
37
56
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (wrapper) {
|
|
43
|
-
return wrapper;
|
|
44
|
-
}
|
|
45
|
-
// We don't wanna wrap it twice
|
|
46
|
-
if (getOriginalFunction(fn)) {
|
|
47
|
-
return fn;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
// Just accessing custom props in some Selenium environments
|
|
52
|
-
// can cause a "Permission denied" exception (see raven-js#495).
|
|
53
|
-
// Bail on wrapping and return the function as-is (defers to window.onerror).
|
|
54
|
-
return fn;
|
|
57
|
+
|
|
58
|
+
// We don't wanna wrap it twice
|
|
59
|
+
if (getOriginalFunction(fn)) {
|
|
60
|
+
return fn;
|
|
55
61
|
}
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// Attempt to invoke user-land function
|
|
67
|
-
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
68
|
-
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
69
|
-
// is expected behavior and NOT indicative of a bug with sentry.javascript.
|
|
70
|
-
return fn.apply(this, wrappedArguments);
|
|
71
|
-
}
|
|
72
|
-
catch (ex) {
|
|
73
|
-
ignoreNextOnError();
|
|
74
|
-
withScope((scope) => {
|
|
75
|
-
scope.addEventProcessor((event) => {
|
|
76
|
-
if (options.mechanism) {
|
|
77
|
-
addExceptionTypeValue(event, undefined, undefined);
|
|
78
|
-
addExceptionMechanism(event, options.mechanism);
|
|
79
|
-
}
|
|
80
|
-
event.extra = Object.assign(Object.assign({}, event.extra), { arguments: args });
|
|
81
|
-
return event;
|
|
82
|
-
});
|
|
83
|
-
captureException(ex);
|
|
84
|
-
});
|
|
85
|
-
throw ex;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
/* eslint-enable prefer-rest-params */
|
|
89
|
-
// Accessing some objects may throw
|
|
90
|
-
// ref: https://github.com/getsentry/sentry-javascript/issues/1168
|
|
62
|
+
} catch (e) {
|
|
63
|
+
// Just accessing custom props in some Selenium environments
|
|
64
|
+
// can cause a "Permission denied" exception (see raven-js#495).
|
|
65
|
+
// Bail on wrapping and return the function as-is (defers to window.onerror).
|
|
66
|
+
return fn;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var sentryWrapped = function () {
|
|
70
|
+
var args = Array.prototype.slice.call(arguments);
|
|
71
|
+
|
|
91
72
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
if (before && typeof before === 'function') {
|
|
74
|
+
before.apply(this, arguments);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var wrappedArguments = args.map((arg) => wrap(arg, options));
|
|
78
|
+
|
|
79
|
+
// Attempt to invoke user-land function
|
|
80
|
+
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
81
|
+
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
82
|
+
// is expected behavior and NOT indicative of a bug with sentry.javascript.
|
|
83
|
+
return fn.apply(this, wrappedArguments);
|
|
84
|
+
} catch (ex) {
|
|
85
|
+
ignoreNextOnError();
|
|
86
|
+
|
|
87
|
+
withScope((scope) => {
|
|
88
|
+
scope.addEventProcessor((event) => {
|
|
89
|
+
if (options.mechanism) {
|
|
90
|
+
addExceptionTypeValue(event, undefined, undefined);
|
|
91
|
+
addExceptionMechanism(event, options.mechanism);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
event.extra = {
|
|
95
|
+
...event.extra,
|
|
96
|
+
arguments: args,
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return event;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
captureException(ex);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
throw ex;
|
|
97
106
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
get() {
|
|
109
|
-
return fn.name;
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
// eslint-disable-next-line no-empty
|
|
107
|
+
};
|
|
108
|
+
/* eslint-enable prefer-rest-params */
|
|
109
|
+
|
|
110
|
+
// Accessing some objects may throw
|
|
111
|
+
// ref: https://github.com/getsentry/sentry-javascript/issues/1168
|
|
112
|
+
try {
|
|
113
|
+
for (var property in fn) {
|
|
114
|
+
if (Object.prototype.hasOwnProperty.call(fn, property)) {
|
|
115
|
+
sentryWrapped[property] = fn[property];
|
|
116
|
+
}
|
|
114
117
|
}
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
} catch (_oO) {}
|
|
119
|
+
// Signal that this function has been wrapped/filled already
|
|
120
|
+
// for both debugging and to prevent it to being wrapped/filled twice
|
|
121
|
+
markFunctionWrapped(sentryWrapped, fn);
|
|
122
|
+
|
|
123
|
+
addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
|
|
124
|
+
|
|
125
|
+
// Restore original function name (not all browsers allow that)
|
|
126
|
+
try {
|
|
127
|
+
var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;
|
|
128
|
+
if (descriptor.configurable) {
|
|
129
|
+
Object.defineProperty(sentryWrapped, 'name', {
|
|
130
|
+
get() {
|
|
131
|
+
return fn.name;
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
} catch (_oO) {}
|
|
136
|
+
|
|
137
|
+
return sentryWrapped;
|
|
117
138
|
}
|
|
118
|
-
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* All properties the report dialog supports
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
export { ignoreNextOnError, shouldIgnoreOnError, wrap };
|
|
145
|
+
//# sourceMappingURL=helpers.js.map
|
package/esm/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../src/helpers.ts"],"sourcesContent":["import { captureException, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getOriginalFunction,\n markFunctionWrapped,\n} from '@sentry/utils';\n\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"],"names":[],"mappings":";;;AAUA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import { Integrations
|
|
1
|
+
import './exports.js';
|
|
2
|
+
import { Integrations } from '@sentry/core';
|
|
3
|
+
export { FunctionToString, Hub, InboundFilters, SDK_VERSION, Scope, addBreadcrumb, addGlobalEventProcessor, captureEvent, captureException, captureMessage, configureScope, createTransport, getCurrentHub, getHubFromCarrier, makeMain, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, withScope } from '@sentry/core';
|
|
3
4
|
import { getGlobalObject } from '@sentry/utils';
|
|
4
|
-
import * as
|
|
5
|
+
import * as index from './integrations/index.js';
|
|
6
|
+
export { BrowserClient } from './client.js';
|
|
7
|
+
export { makeFetchTransport } from './transports/fetch.js';
|
|
8
|
+
export { makeXHRTransport } from './transports/xhr.js';
|
|
9
|
+
export { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser } from './stack-parsers.js';
|
|
10
|
+
export { close, defaultIntegrations, flush, forceLoad, init, lastEventId, onLoad, showReportDialog, wrap } from './sdk.js';
|
|
11
|
+
export { GlobalHandlers } from './integrations/globalhandlers.js';
|
|
12
|
+
export { TryCatch } from './integrations/trycatch.js';
|
|
13
|
+
export { Breadcrumbs } from './integrations/breadcrumbs.js';
|
|
14
|
+
export { LinkedErrors } from './integrations/linkederrors.js';
|
|
15
|
+
export { HttpContext } from './integrations/httpcontext.js';
|
|
16
|
+
export { Dedupe } from './integrations/dedupe.js';
|
|
17
|
+
|
|
5
18
|
let windowIntegrations = {};
|
|
19
|
+
|
|
6
20
|
// This block is needed to add compatibility with the integrations packages when used with a CDN
|
|
7
|
-
|
|
21
|
+
var _window = getGlobalObject();
|
|
8
22
|
if (_window.Sentry && _window.Sentry.Integrations) {
|
|
9
|
-
|
|
23
|
+
windowIntegrations = _window.Sentry.Integrations;
|
|
10
24
|
}
|
|
11
|
-
|
|
25
|
+
|
|
26
|
+
var INTEGRATIONS = {
|
|
27
|
+
...windowIntegrations,
|
|
28
|
+
...Integrations,
|
|
29
|
+
...index,
|
|
30
|
+
};
|
|
31
|
+
|
|
12
32
|
export { INTEGRATIONS as Integrations };
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nconst _window = getGlobalObject<Window>();\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...CoreIntegrations,\n ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;"}
|