@sentry/browser 7.0.0-alpha.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.
Files changed (242) hide show
  1. package/README.md +2 -3
  2. package/cjs/client.js +130 -68
  3. package/cjs/client.js.map +1 -1
  4. package/cjs/eventbuilder.js +227 -168
  5. package/cjs/eventbuilder.js.map +1 -1
  6. package/cjs/exports.js +55 -42
  7. package/cjs/exports.js.map +1 -1
  8. package/cjs/flags.js +7 -3
  9. package/cjs/flags.js.map +1 -1
  10. package/cjs/helpers.js +123 -130
  11. package/cjs/helpers.js.map +1 -1
  12. package/cjs/index.js +78 -13
  13. package/cjs/index.js.map +1 -1
  14. package/cjs/integrations/breadcrumbs.js +223 -193
  15. package/cjs/integrations/breadcrumbs.js.map +1 -1
  16. package/cjs/integrations/dedupe.js +183 -143
  17. package/cjs/integrations/dedupe.js.map +1 -1
  18. package/cjs/integrations/globalhandlers.js +212 -171
  19. package/cjs/integrations/globalhandlers.js.map +1 -1
  20. package/cjs/integrations/httpcontext.js +51 -0
  21. package/cjs/integrations/httpcontext.js.map +1 -0
  22. package/cjs/integrations/index.js +18 -14
  23. package/cjs/integrations/index.js.map +1 -1
  24. package/cjs/integrations/linkederrors.js +79 -48
  25. package/cjs/integrations/linkederrors.js.map +1 -1
  26. package/cjs/integrations/trycatch.js +245 -216
  27. package/cjs/integrations/trycatch.js.map +1 -1
  28. package/cjs/sdk.js +168 -108
  29. package/cjs/sdk.js.map +1 -1
  30. package/cjs/stack-parsers.js +134 -83
  31. package/cjs/stack-parsers.js.map +1 -1
  32. package/cjs/transports/fetch.js +34 -80
  33. package/cjs/transports/fetch.js.map +1 -1
  34. package/cjs/transports/index.js +10 -12
  35. package/cjs/transports/index.js.map +1 -1
  36. package/cjs/transports/utils.js +57 -52
  37. package/cjs/transports/utils.js.map +1 -1
  38. package/cjs/transports/xhr.js +53 -63
  39. package/cjs/transports/xhr.js.map +1 -1
  40. package/esm/client.js +128 -67
  41. package/esm/client.js.map +1 -1
  42. package/esm/eventbuilder.js +218 -159
  43. package/esm/eventbuilder.js.map +1 -1
  44. package/esm/exports.js +12 -7
  45. package/esm/exports.js.map +1 -1
  46. package/esm/flags.js +5 -2
  47. package/esm/flags.js.map +1 -1
  48. package/esm/helpers.js +121 -127
  49. package/esm/helpers.js.map +1 -1
  50. package/esm/index.js +28 -10
  51. package/esm/index.js.map +1 -1
  52. package/esm/integrations/breadcrumbs.js +219 -191
  53. package/esm/integrations/breadcrumbs.js.map +1 -1
  54. package/esm/integrations/dedupe.js +180 -141
  55. package/esm/integrations/dedupe.js.map +1 -1
  56. package/esm/integrations/globalhandlers.js +209 -169
  57. package/esm/integrations/globalhandlers.js.map +1 -1
  58. package/esm/integrations/httpcontext.js +49 -0
  59. package/esm/integrations/httpcontext.js.map +1 -0
  60. package/esm/integrations/index.js +7 -7
  61. package/esm/integrations/index.js.map +1 -1
  62. package/esm/integrations/linkederrors.js +75 -45
  63. package/esm/integrations/linkederrors.js.map +1 -1
  64. package/esm/integrations/trycatch.js +242 -214
  65. package/esm/integrations/trycatch.js.map +1 -1
  66. package/esm/sdk.js +164 -105
  67. package/esm/sdk.js.map +1 -1
  68. package/esm/stack-parsers.js +126 -82
  69. package/esm/stack-parsers.js.map +1 -1
  70. package/esm/transports/fetch.js +32 -79
  71. package/esm/transports/fetch.js.map +1 -1
  72. package/esm/transports/index.js +3 -6
  73. package/esm/transports/index.js.map +1 -1
  74. package/esm/transports/utils.js +56 -51
  75. package/esm/transports/utils.js.map +1 -1
  76. package/esm/transports/xhr.js +51 -62
  77. package/esm/transports/xhr.js.map +1 -1
  78. package/package.json +4 -5
  79. package/types/client.d.ts +42 -11
  80. package/types/client.d.ts.map +1 -1
  81. package/types/eventbuilder.d.ts +10 -12
  82. package/types/eventbuilder.d.ts.map +1 -1
  83. package/types/exports.d.ts +7 -6
  84. package/types/exports.d.ts.map +1 -1
  85. package/types/helpers.d.ts +0 -5
  86. package/types/helpers.d.ts.map +1 -1
  87. package/types/index.d.ts +2 -3
  88. package/types/index.d.ts.map +1 -1
  89. package/types/integrations/breadcrumbs.d.ts +6 -7
  90. package/types/integrations/breadcrumbs.d.ts.map +1 -1
  91. package/types/integrations/dedupe.d.ts.map +1 -1
  92. package/types/integrations/globalhandlers.d.ts.map +1 -1
  93. package/types/integrations/{useragent.d.ts → httpcontext.d.ts} +3 -3
  94. package/types/integrations/httpcontext.d.ts.map +1 -0
  95. package/types/integrations/index.d.ts +1 -1
  96. package/types/integrations/index.d.ts.map +1 -1
  97. package/types/integrations/linkederrors.d.ts +3 -3
  98. package/types/integrations/linkederrors.d.ts.map +1 -1
  99. package/types/sdk.d.ts +5 -5
  100. package/types/sdk.d.ts.map +1 -1
  101. package/types/stack-parsers.d.ts +8 -6
  102. package/types/stack-parsers.d.ts.map +1 -1
  103. package/types/transports/fetch.d.ts +6 -15
  104. package/types/transports/fetch.d.ts.map +1 -1
  105. package/types/transports/index.d.ts +2 -5
  106. package/types/transports/index.d.ts.map +1 -1
  107. package/types/transports/types.d.ts +10 -0
  108. package/types/transports/types.d.ts.map +1 -0
  109. package/types/transports/utils.d.ts.map +1 -1
  110. package/types/transports/xhr.d.ts +6 -10
  111. package/types/transports/xhr.d.ts.map +1 -1
  112. package/cjs/backend.d.ts +0 -39
  113. package/cjs/backend.d.ts.map +0 -1
  114. package/cjs/backend.js +0 -58
  115. package/cjs/backend.js.map +0 -1
  116. package/cjs/client.d.ts +0 -33
  117. package/cjs/client.d.ts.map +0 -1
  118. package/cjs/eventbuilder.d.ts +0 -39
  119. package/cjs/eventbuilder.d.ts.map +0 -1
  120. package/cjs/exports.d.ts +0 -9
  121. package/cjs/exports.d.ts.map +0 -1
  122. package/cjs/flags.d.ts +0 -3
  123. package/cjs/flags.d.ts.map +0 -1
  124. package/cjs/helpers.d.ts +0 -52
  125. package/cjs/helpers.d.ts.map +0 -1
  126. package/cjs/index.d.ts +0 -16
  127. package/cjs/index.d.ts.map +0 -1
  128. package/cjs/integrations/breadcrumbs.d.ts +0 -47
  129. package/cjs/integrations/breadcrumbs.d.ts.map +0 -1
  130. package/cjs/integrations/dedupe.d.ts +0 -21
  131. package/cjs/integrations/dedupe.d.ts.map +0 -1
  132. package/cjs/integrations/globalhandlers.d.ts +0 -30
  133. package/cjs/integrations/globalhandlers.d.ts.map +0 -1
  134. package/cjs/integrations/index.d.ts +0 -7
  135. package/cjs/integrations/index.d.ts.map +0 -1
  136. package/cjs/integrations/linkederrors.d.ts +0 -42
  137. package/cjs/integrations/linkederrors.d.ts.map +0 -1
  138. package/cjs/integrations/trycatch.d.ts +0 -33
  139. package/cjs/integrations/trycatch.d.ts.map +0 -1
  140. package/cjs/integrations/useragent.d.ts +0 -17
  141. package/cjs/integrations/useragent.d.ts.map +0 -1
  142. package/cjs/integrations/useragent.js +0 -42
  143. package/cjs/integrations/useragent.js.map +0 -1
  144. package/cjs/sdk.d.ts +0 -112
  145. package/cjs/sdk.d.ts.map +0 -1
  146. package/cjs/stack-parsers.d.ts +0 -7
  147. package/cjs/stack-parsers.d.ts.map +0 -1
  148. package/cjs/transports/base.d.ts +0 -65
  149. package/cjs/transports/base.d.ts.map +0 -1
  150. package/cjs/transports/base.js +0 -141
  151. package/cjs/transports/base.js.map +0 -1
  152. package/cjs/transports/fetch.d.ts +0 -17
  153. package/cjs/transports/fetch.d.ts.map +0 -1
  154. package/cjs/transports/index.d.ts +0 -6
  155. package/cjs/transports/index.d.ts.map +0 -1
  156. package/cjs/transports/new-fetch.d.ts +0 -10
  157. package/cjs/transports/new-fetch.d.ts.map +0 -1
  158. package/cjs/transports/new-fetch.js +0 -27
  159. package/cjs/transports/new-fetch.js.map +0 -1
  160. package/cjs/transports/new-xhr.d.ts +0 -11
  161. package/cjs/transports/new-xhr.d.ts.map +0 -1
  162. package/cjs/transports/new-xhr.js +0 -46
  163. package/cjs/transports/new-xhr.js.map +0 -1
  164. package/cjs/transports/utils.d.ts +0 -48
  165. package/cjs/transports/utils.d.ts.map +0 -1
  166. package/cjs/transports/xhr.d.ts +0 -11
  167. package/cjs/transports/xhr.d.ts.map +0 -1
  168. package/cjs/version.d.ts +0 -2
  169. package/cjs/version.d.ts.map +0 -1
  170. package/cjs/version.js +0 -4
  171. package/cjs/version.js.map +0 -1
  172. package/esm/backend.d.ts +0 -39
  173. package/esm/backend.d.ts.map +0 -1
  174. package/esm/backend.js +0 -57
  175. package/esm/backend.js.map +0 -1
  176. package/esm/client.d.ts +0 -33
  177. package/esm/client.d.ts.map +0 -1
  178. package/esm/eventbuilder.d.ts +0 -39
  179. package/esm/eventbuilder.d.ts.map +0 -1
  180. package/esm/exports.d.ts +0 -9
  181. package/esm/exports.d.ts.map +0 -1
  182. package/esm/flags.d.ts +0 -3
  183. package/esm/flags.d.ts.map +0 -1
  184. package/esm/helpers.d.ts +0 -52
  185. package/esm/helpers.d.ts.map +0 -1
  186. package/esm/index.d.ts +0 -16
  187. package/esm/index.d.ts.map +0 -1
  188. package/esm/integrations/breadcrumbs.d.ts +0 -47
  189. package/esm/integrations/breadcrumbs.d.ts.map +0 -1
  190. package/esm/integrations/dedupe.d.ts +0 -21
  191. package/esm/integrations/dedupe.d.ts.map +0 -1
  192. package/esm/integrations/globalhandlers.d.ts +0 -30
  193. package/esm/integrations/globalhandlers.d.ts.map +0 -1
  194. package/esm/integrations/index.d.ts +0 -7
  195. package/esm/integrations/index.d.ts.map +0 -1
  196. package/esm/integrations/linkederrors.d.ts +0 -42
  197. package/esm/integrations/linkederrors.d.ts.map +0 -1
  198. package/esm/integrations/trycatch.d.ts +0 -33
  199. package/esm/integrations/trycatch.d.ts.map +0 -1
  200. package/esm/integrations/useragent.d.ts +0 -17
  201. package/esm/integrations/useragent.d.ts.map +0 -1
  202. package/esm/integrations/useragent.js +0 -41
  203. package/esm/integrations/useragent.js.map +0 -1
  204. package/esm/sdk.d.ts +0 -112
  205. package/esm/sdk.d.ts.map +0 -1
  206. package/esm/stack-parsers.d.ts +0 -7
  207. package/esm/stack-parsers.d.ts.map +0 -1
  208. package/esm/transports/base.d.ts +0 -65
  209. package/esm/transports/base.d.ts.map +0 -1
  210. package/esm/transports/base.js +0 -140
  211. package/esm/transports/base.js.map +0 -1
  212. package/esm/transports/fetch.d.ts +0 -17
  213. package/esm/transports/fetch.d.ts.map +0 -1
  214. package/esm/transports/index.d.ts +0 -6
  215. package/esm/transports/index.d.ts.map +0 -1
  216. package/esm/transports/new-fetch.d.ts +0 -10
  217. package/esm/transports/new-fetch.d.ts.map +0 -1
  218. package/esm/transports/new-fetch.js +0 -25
  219. package/esm/transports/new-fetch.js.map +0 -1
  220. package/esm/transports/new-xhr.d.ts +0 -11
  221. package/esm/transports/new-xhr.d.ts.map +0 -1
  222. package/esm/transports/new-xhr.js +0 -44
  223. package/esm/transports/new-xhr.js.map +0 -1
  224. package/esm/transports/utils.d.ts +0 -48
  225. package/esm/transports/utils.d.ts.map +0 -1
  226. package/esm/transports/xhr.d.ts +0 -11
  227. package/esm/transports/xhr.d.ts.map +0 -1
  228. package/esm/version.d.ts +0 -2
  229. package/esm/version.d.ts.map +0 -1
  230. package/esm/version.js +0 -3
  231. package/esm/version.js.map +0 -1
  232. package/types/backend.d.ts +0 -39
  233. package/types/backend.d.ts.map +0 -1
  234. package/types/integrations/useragent.d.ts.map +0 -1
  235. package/types/transports/base.d.ts +0 -65
  236. package/types/transports/base.d.ts.map +0 -1
  237. package/types/transports/new-fetch.d.ts +0 -10
  238. package/types/transports/new-fetch.d.ts.map +0 -1
  239. package/types/transports/new-xhr.d.ts +0 -11
  240. package/types/transports/new-xhr.d.ts.map +0 -1
  241. package/types/version.d.ts +0 -2
  242. package/types/version.d.ts.map +0 -1
package/cjs/flags.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;;AAIH,2DAA2D;AAC9C,QAAA,cAAc,GAAG,OAAO,gBAAgB,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC","sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n"]}
1
+ {"version":3,"file":"flags.js","sources":["../../../src/flags.ts"],"sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;;;;"}
package/cjs/helpers.js CHANGED
@@ -1,28 +1,28 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- var tslib_1 = require("tslib");
3
- var core_1 = require("@sentry/core");
4
- var utils_1 = require("@sentry/utils");
5
- var flags_1 = require("./flags");
6
- var global = utils_1.getGlobalObject();
7
- var ignoreOnError = 0;
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var core = require('@sentry/core');
4
+ var utils = require('@sentry/utils');
5
+
6
+ let ignoreOnError = 0;
7
+
8
8
  /**
9
9
  * @hidden
10
10
  */
11
11
  function shouldIgnoreOnError() {
12
- return ignoreOnError > 0;
12
+ return ignoreOnError > 0;
13
13
  }
14
- exports.shouldIgnoreOnError = shouldIgnoreOnError;
14
+
15
15
  /**
16
16
  * @hidden
17
17
  */
18
18
  function ignoreNextOnError() {
19
- // onerror should trigger before setTimeout
20
- ignoreOnError += 1;
21
- setTimeout(function () {
22
- ignoreOnError -= 1;
23
- });
19
+ // onerror should trigger before setTimeout
20
+ ignoreOnError += 1;
21
+ setTimeout(() => {
22
+ ignoreOnError -= 1;
23
+ });
24
24
  }
25
- exports.ignoreNextOnError = ignoreNextOnError;
25
+
26
26
  /**
27
27
  * Instruments the given function and sends an event to Sentry every time the
28
28
  * function throws an exception.
@@ -31,126 +31,119 @@ exports.ignoreNextOnError = ignoreNextOnError;
31
31
  * @returns The wrapped function.
32
32
  * @hidden
33
33
  */
34
- function wrap(fn, options, before) {
35
- // for future readers what this does is wrap a function and then create
36
- // a bi-directional wrapping between them.
37
- //
38
- // example: wrapped = wrap(original);
39
- // original.__sentry_wrapped__ -> wrapped
40
- // wrapped.__sentry_original__ -> original
41
- if (options === void 0) { options = {}; }
42
- if (typeof fn !== 'function') {
43
- return fn;
34
+ function wrap(
35
+ fn,
36
+ options
37
+
38
+ = {},
39
+ before,
40
+ ) {
41
+ // for future readers what this does is wrap a function and then create
42
+ // a bi-directional wrapping between them.
43
+ //
44
+ // example: wrapped = wrap(original);
45
+ // original.__sentry_wrapped__ -> wrapped
46
+ // wrapped.__sentry_original__ -> original
47
+
48
+ if (typeof fn !== 'function') {
49
+ return fn;
50
+ }
51
+
52
+ try {
53
+ // if we're dealing with a function that was previously wrapped, return
54
+ // the original wrapper.
55
+ var wrapper = fn.__sentry_wrapped__;
56
+ if (wrapper) {
57
+ return wrapper;
44
58
  }
45
- try {
46
- // if we're dealing with a function that was previously wrapped, return
47
- // the original wrapper.
48
- var wrapper = fn.__sentry_wrapped__;
49
- if (wrapper) {
50
- return wrapper;
51
- }
52
- // We don't wanna wrap it twice
53
- if (utils_1.getOriginalFunction(fn)) {
54
- return fn;
55
- }
59
+
60
+ // We don't wanna wrap it twice
61
+ if (utils.getOriginalFunction(fn)) {
62
+ return fn;
56
63
  }
57
- catch (e) {
58
- // Just accessing custom props in some Selenium environments
59
- // can cause a "Permission denied" exception (see raven-js#495).
60
- // Bail on wrapping and return the function as-is (defers to window.onerror).
61
- return fn;
62
- }
63
- /* eslint-disable prefer-rest-params */
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
- var sentryWrapped = function () {
66
- var args = Array.prototype.slice.call(arguments);
67
- try {
68
- if (before && typeof before === 'function') {
69
- before.apply(this, arguments);
70
- }
71
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
72
- var wrappedArguments = args.map(function (arg) { return wrap(arg, options); });
73
- // Attempt to invoke user-land function
74
- // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
75
- // means the sentry.javascript SDK caught an error invoking your application code. This
76
- // is expected behavior and NOT indicative of a bug with sentry.javascript.
77
- return fn.apply(this, wrappedArguments);
78
- }
79
- catch (ex) {
80
- ignoreNextOnError();
81
- core_1.withScope(function (scope) {
82
- scope.addEventProcessor(function (event) {
83
- if (options.mechanism) {
84
- utils_1.addExceptionTypeValue(event, undefined, undefined);
85
- utils_1.addExceptionMechanism(event, options.mechanism);
86
- }
87
- event.extra = tslib_1.__assign(tslib_1.__assign({}, event.extra), { arguments: args });
88
- return event;
89
- });
90
- core_1.captureException(ex);
91
- });
92
- throw ex;
93
- }
94
- };
95
- /* eslint-enable prefer-rest-params */
96
- // Accessing some objects may throw
97
- // ref: https://github.com/getsentry/sentry-javascript/issues/1168
64
+ } catch (e) {
65
+ // Just accessing custom props in some Selenium environments
66
+ // can cause a "Permission denied" exception (see raven-js#495).
67
+ // Bail on wrapping and return the function as-is (defers to window.onerror).
68
+ return fn;
69
+ }
70
+
71
+ var sentryWrapped = function () {
72
+ var args = Array.prototype.slice.call(arguments);
73
+
98
74
  try {
99
- for (var property in fn) {
100
- if (Object.prototype.hasOwnProperty.call(fn, property)) {
101
- sentryWrapped[property] = fn[property];
102
- }
103
- }
75
+ if (before && typeof before === 'function') {
76
+ before.apply(this, arguments);
77
+ }
78
+
79
+ var wrappedArguments = args.map((arg) => wrap(arg, options));
80
+
81
+ // Attempt to invoke user-land function
82
+ // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
83
+ // means the sentry.javascript SDK caught an error invoking your application code. This
84
+ // is expected behavior and NOT indicative of a bug with sentry.javascript.
85
+ return fn.apply(this, wrappedArguments);
86
+ } catch (ex) {
87
+ ignoreNextOnError();
88
+
89
+ core.withScope((scope) => {
90
+ scope.addEventProcessor((event) => {
91
+ if (options.mechanism) {
92
+ utils.addExceptionTypeValue(event, undefined, undefined);
93
+ utils.addExceptionMechanism(event, options.mechanism);
94
+ }
95
+
96
+ event.extra = {
97
+ ...event.extra,
98
+ arguments: args,
99
+ };
100
+
101
+ return event;
102
+ });
103
+
104
+ core.captureException(ex);
105
+ });
106
+
107
+ throw ex;
104
108
  }
105
- catch (_oO) { } // eslint-disable-line no-empty
106
- // Signal that this function has been wrapped/filled already
107
- // for both debugging and to prevent it to being wrapped/filled twice
108
- utils_1.markFunctionWrapped(sentryWrapped, fn);
109
- utils_1.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
110
- // Restore original function name (not all browsers allow that)
111
- try {
112
- var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
113
- if (descriptor.configurable) {
114
- Object.defineProperty(sentryWrapped, 'name', {
115
- get: function () {
116
- return fn.name;
117
- },
118
- });
119
- }
120
- // eslint-disable-next-line no-empty
109
+ };
110
+ /* eslint-enable prefer-rest-params */
111
+
112
+ // Accessing some objects may throw
113
+ // ref: https://github.com/getsentry/sentry-javascript/issues/1168
114
+ try {
115
+ for (var property in fn) {
116
+ if (Object.prototype.hasOwnProperty.call(fn, property)) {
117
+ sentryWrapped[property] = fn[property];
118
+ }
121
119
  }
122
- catch (_oO) { }
123
- return sentryWrapped;
120
+ } catch (_oO) {}
121
+ // Signal that this function has been wrapped/filled already
122
+ // for both debugging and to prevent it to being wrapped/filled twice
123
+ utils.markFunctionWrapped(sentryWrapped, fn);
124
+
125
+ utils.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
126
+
127
+ // Restore original function name (not all browsers allow that)
128
+ try {
129
+ var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;
130
+ if (descriptor.configurable) {
131
+ Object.defineProperty(sentryWrapped, 'name', {
132
+ get() {
133
+ return fn.name;
134
+ },
135
+ });
136
+ }
137
+ } catch (_oO) {}
138
+
139
+ return sentryWrapped;
124
140
  }
125
- exports.wrap = wrap;
141
+
126
142
  /**
127
- * Injects the Report Dialog script
128
- * @hidden
143
+ * All properties the report dialog supports
129
144
  */
130
- function injectReportDialog(options) {
131
- if (options === void 0) { options = {}; }
132
- if (!global.document) {
133
- return;
134
- }
135
- if (!options.eventId) {
136
- flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Missing eventId option in showReportDialog call');
137
- return;
138
- }
139
- if (!options.dsn) {
140
- flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Missing dsn option in showReportDialog call');
141
- return;
142
- }
143
- var script = global.document.createElement('script');
144
- script.async = true;
145
- script.src = core_1.getReportDialogEndpoint(options.dsn, options);
146
- if (options.onLoad) {
147
- // eslint-disable-next-line @typescript-eslint/unbound-method
148
- script.onload = options.onLoad;
149
- }
150
- var injectionPoint = global.document.head || global.document.body;
151
- if (injectionPoint) {
152
- injectionPoint.appendChild(script);
153
- }
154
- }
155
- exports.injectReportDialog = injectReportDialog;
156
- //# sourceMappingURL=helpers.js.map
145
+
146
+ exports.ignoreNextOnError = ignoreNextOnError;
147
+ exports.shouldIgnoreOnError = shouldIgnoreOnError;
148
+ exports.wrap = wrap;
149
+ //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"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","sourcesContent":["import { captureException, getReportDialogEndpoint, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getGlobalObject,\n getOriginalFunction,\n logger,\n markFunctionWrapped,\n} from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from './flags';\n\nconst global = getGlobalObject<Window>();\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(() => {\n ignoreOnError -= 1;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n return wrapper;\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sentryWrapped: WrappedFunction = function (this: any): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope((scope: Scope) => {\n scope.addEventProcessor((event: SentryEvent) => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * Injects the Report Dialog script\n * @hidden\n */\nexport function injectReportDialog(options: ReportDialogOptions = {}): void {\n if (!global.document) {\n return;\n }\n\n if (!options.eventId) {\n IS_DEBUG_BUILD && logger.error('Missing eventId option in showReportDialog call');\n return;\n }\n\n if (!options.dsn) {\n IS_DEBUG_BUILD && logger.error('Missing dsn option in showReportDialog call');\n return;\n }\n\n const script = global.document.createElement('script');\n script.async = true;\n script.src = getReportDialogEndpoint(options.dsn, options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n const injectionPoint = global.document.head || global.document.body;\n\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n }\n}\n"]}
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/cjs/index.js CHANGED
@@ -1,17 +1,82 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- var tslib_1 = require("tslib");
3
- tslib_1.__exportStar(require("./exports"), exports);
4
- var core_1 = require("@sentry/core");
5
- var utils_1 = require("@sentry/utils");
6
- var BrowserIntegrations = require("./integrations");
7
- var Transports = require("./transports");
8
- exports.Transports = Transports;
9
- var windowIntegrations = {};
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ require('./exports.js');
4
+ var core = require('@sentry/core');
5
+ var utils = require('@sentry/utils');
6
+ var index = require('./integrations/index.js');
7
+ var client = require('./client.js');
8
+ var fetch = require('./transports/fetch.js');
9
+ var xhr = require('./transports/xhr.js');
10
+ var stackParsers = require('./stack-parsers.js');
11
+ var sdk = require('./sdk.js');
12
+ var globalhandlers = require('./integrations/globalhandlers.js');
13
+ var trycatch = require('./integrations/trycatch.js');
14
+ var breadcrumbs = require('./integrations/breadcrumbs.js');
15
+ var linkederrors = require('./integrations/linkederrors.js');
16
+ var httpcontext = require('./integrations/httpcontext.js');
17
+ var dedupe = require('./integrations/dedupe.js');
18
+
19
+ let windowIntegrations = {};
20
+
10
21
  // This block is needed to add compatibility with the integrations packages when used with a CDN
11
- var _window = utils_1.getGlobalObject();
22
+ var _window = utils.getGlobalObject();
12
23
  if (_window.Sentry && _window.Sentry.Integrations) {
13
- windowIntegrations = _window.Sentry.Integrations;
24
+ windowIntegrations = _window.Sentry.Integrations;
14
25
  }
15
- var INTEGRATIONS = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, windowIntegrations), core_1.Integrations), BrowserIntegrations);
26
+
27
+ var INTEGRATIONS = {
28
+ ...windowIntegrations,
29
+ ...core.Integrations,
30
+ ...index,
31
+ };
32
+
33
+ exports.FunctionToString = core.FunctionToString;
34
+ exports.Hub = core.Hub;
35
+ exports.InboundFilters = core.InboundFilters;
36
+ exports.SDK_VERSION = core.SDK_VERSION;
37
+ exports.Scope = core.Scope;
38
+ exports.addBreadcrumb = core.addBreadcrumb;
39
+ exports.addGlobalEventProcessor = core.addGlobalEventProcessor;
40
+ exports.captureEvent = core.captureEvent;
41
+ exports.captureException = core.captureException;
42
+ exports.captureMessage = core.captureMessage;
43
+ exports.configureScope = core.configureScope;
44
+ exports.createTransport = core.createTransport;
45
+ exports.getCurrentHub = core.getCurrentHub;
46
+ exports.getHubFromCarrier = core.getHubFromCarrier;
47
+ exports.makeMain = core.makeMain;
48
+ exports.setContext = core.setContext;
49
+ exports.setExtra = core.setExtra;
50
+ exports.setExtras = core.setExtras;
51
+ exports.setTag = core.setTag;
52
+ exports.setTags = core.setTags;
53
+ exports.setUser = core.setUser;
54
+ exports.startTransaction = core.startTransaction;
55
+ exports.withScope = core.withScope;
56
+ exports.BrowserClient = client.BrowserClient;
57
+ exports.makeFetchTransport = fetch.makeFetchTransport;
58
+ exports.makeXHRTransport = xhr.makeXHRTransport;
59
+ exports.chromeStackLineParser = stackParsers.chromeStackLineParser;
60
+ exports.defaultStackLineParsers = stackParsers.defaultStackLineParsers;
61
+ exports.defaultStackParser = stackParsers.defaultStackParser;
62
+ exports.geckoStackLineParser = stackParsers.geckoStackLineParser;
63
+ exports.opera10StackLineParser = stackParsers.opera10StackLineParser;
64
+ exports.opera11StackLineParser = stackParsers.opera11StackLineParser;
65
+ exports.winjsStackLineParser = stackParsers.winjsStackLineParser;
66
+ exports.close = sdk.close;
67
+ exports.defaultIntegrations = sdk.defaultIntegrations;
68
+ exports.flush = sdk.flush;
69
+ exports.forceLoad = sdk.forceLoad;
70
+ exports.init = sdk.init;
71
+ exports.lastEventId = sdk.lastEventId;
72
+ exports.onLoad = sdk.onLoad;
73
+ exports.showReportDialog = sdk.showReportDialog;
74
+ exports.wrap = sdk.wrap;
75
+ exports.GlobalHandlers = globalhandlers.GlobalHandlers;
76
+ exports.TryCatch = trycatch.TryCatch;
77
+ exports.Breadcrumbs = breadcrumbs.Breadcrumbs;
78
+ exports.LinkedErrors = linkederrors.LinkedErrors;
79
+ exports.HttpContext = httpcontext.HttpContext;
80
+ exports.Dedupe = dedupe.Dedupe;
16
81
  exports.Integrations = INTEGRATIONS;
17
- //# sourceMappingURL=index.js.map
82
+ //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;AAAA,oDAA0B;AAE1B,qCAAgE;AAChE,uCAAgD;AAEhD,oDAAsD;AACtD,yCAA2C;AAgBJ,gCAAU;AAdjD,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAE5B,gGAAgG;AAChG,IAAM,OAAO,GAAG,uBAAe,EAAU,CAAC;AAC1C,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE;IACjD,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;CAClD;AAED,IAAM,YAAY,0DACb,kBAAkB,GAClB,mBAAgB,GAChB,mBAAmB,CACvB,CAAC;AAEuB,oCAAY","sourcesContent":["export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport * as BrowserIntegrations from './integrations';\nimport * as Transports from './transports';\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, Transports };\n"]}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}