@sentry/browser 7.0.0-alpha.1 → 7.0.0-beta.2

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 (240) hide show
  1. package/README.md +2 -3
  2. package/cjs/client.js +130 -83
  3. package/cjs/client.js.map +1 -1
  4. package/cjs/eventbuilder.js +225 -167
  5. package/cjs/eventbuilder.js.map +1 -1
  6. package/cjs/exports.js +55 -47
  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 +122 -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 -192
  15. package/cjs/integrations/breadcrumbs.js.map +1 -1
  16. package/cjs/integrations/dedupe.js +183 -142
  17. package/cjs/integrations/dedupe.js.map +1 -1
  18. package/cjs/integrations/globalhandlers.js +211 -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 -51
  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 -114
  29. package/cjs/sdk.js.map +1 -1
  30. package/cjs/stack-parsers.js +134 -84
  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 -14
  35. package/cjs/transports/index.js.map +1 -1
  36. package/cjs/transports/utils.js +57 -53
  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 -82
  41. package/esm/client.js.map +1 -1
  42. package/esm/eventbuilder.js +218 -160
  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 +120 -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 -190
  53. package/esm/integrations/breadcrumbs.js.map +1 -1
  54. package/esm/integrations/dedupe.js +180 -140
  55. package/esm/integrations/dedupe.js.map +1 -1
  56. package/esm/integrations/globalhandlers.js +208 -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 +76 -49
  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 -111
  67. package/esm/sdk.js.map +1 -1
  68. package/esm/stack-parsers.js +126 -83
  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 -7
  73. package/esm/transports/index.js.map +1 -1
  74. package/esm/transports/utils.js +56 -52
  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 -4
  79. package/types/client.d.ts +24 -18
  80. package/types/client.d.ts.map +1 -1
  81. package/types/eventbuilder.d.ts +1 -1
  82. package/types/exports.d.ts +5 -5
  83. package/types/exports.d.ts.map +1 -1
  84. package/types/helpers.d.ts +0 -5
  85. package/types/helpers.d.ts.map +1 -1
  86. package/types/index.d.ts +2 -3
  87. package/types/index.d.ts.map +1 -1
  88. package/types/integrations/breadcrumbs.d.ts +6 -7
  89. package/types/integrations/breadcrumbs.d.ts.map +1 -1
  90. package/types/integrations/globalhandlers.d.ts.map +1 -1
  91. package/types/integrations/{useragent.d.ts → httpcontext.d.ts} +3 -3
  92. package/types/integrations/httpcontext.d.ts.map +1 -0
  93. package/types/integrations/index.d.ts +1 -1
  94. package/types/integrations/index.d.ts.map +1 -1
  95. package/types/integrations/linkederrors.d.ts.map +1 -1
  96. package/types/sdk.d.ts +4 -4
  97. package/types/sdk.d.ts.map +1 -1
  98. package/types/stack-parsers.d.ts +7 -6
  99. package/types/stack-parsers.d.ts.map +1 -1
  100. package/types/transports/fetch.d.ts +6 -15
  101. package/types/transports/fetch.d.ts.map +1 -1
  102. package/types/transports/index.d.ts +2 -6
  103. package/types/transports/index.d.ts.map +1 -1
  104. package/types/transports/types.d.ts +10 -0
  105. package/types/transports/types.d.ts.map +1 -0
  106. package/types/transports/utils.d.ts +1 -1
  107. package/types/transports/utils.d.ts.map +1 -1
  108. package/types/transports/xhr.d.ts +6 -10
  109. package/types/transports/xhr.d.ts.map +1 -1
  110. package/cjs/client.d.ts +0 -58
  111. package/cjs/client.d.ts.map +0 -1
  112. package/cjs/eventbuilder.d.ts +0 -37
  113. package/cjs/eventbuilder.d.ts.map +0 -1
  114. package/cjs/exports.d.ts +0 -10
  115. package/cjs/exports.d.ts.map +0 -1
  116. package/cjs/flags.d.ts +0 -3
  117. package/cjs/flags.d.ts.map +0 -1
  118. package/cjs/helpers.d.ts +0 -52
  119. package/cjs/helpers.d.ts.map +0 -1
  120. package/cjs/index.d.ts +0 -16
  121. package/cjs/index.d.ts.map +0 -1
  122. package/cjs/integrations/breadcrumbs.d.ts +0 -47
  123. package/cjs/integrations/breadcrumbs.d.ts.map +0 -1
  124. package/cjs/integrations/dedupe.d.ts +0 -21
  125. package/cjs/integrations/dedupe.d.ts.map +0 -1
  126. package/cjs/integrations/globalhandlers.d.ts +0 -30
  127. package/cjs/integrations/globalhandlers.d.ts.map +0 -1
  128. package/cjs/integrations/index.d.ts +0 -7
  129. package/cjs/integrations/index.d.ts.map +0 -1
  130. package/cjs/integrations/linkederrors.d.ts +0 -42
  131. package/cjs/integrations/linkederrors.d.ts.map +0 -1
  132. package/cjs/integrations/trycatch.d.ts +0 -33
  133. package/cjs/integrations/trycatch.d.ts.map +0 -1
  134. package/cjs/integrations/useragent.d.ts +0 -17
  135. package/cjs/integrations/useragent.d.ts.map +0 -1
  136. package/cjs/integrations/useragent.js +0 -42
  137. package/cjs/integrations/useragent.js.map +0 -1
  138. package/cjs/sdk.d.ts +0 -112
  139. package/cjs/sdk.d.ts.map +0 -1
  140. package/cjs/stack-parsers.d.ts +0 -8
  141. package/cjs/stack-parsers.d.ts.map +0 -1
  142. package/cjs/transports/base.d.ts +0 -65
  143. package/cjs/transports/base.d.ts.map +0 -1
  144. package/cjs/transports/base.js +0 -141
  145. package/cjs/transports/base.js.map +0 -1
  146. package/cjs/transports/fetch.d.ts +0 -17
  147. package/cjs/transports/fetch.d.ts.map +0 -1
  148. package/cjs/transports/index.d.ts +0 -7
  149. package/cjs/transports/index.d.ts.map +0 -1
  150. package/cjs/transports/new-fetch.d.ts +0 -10
  151. package/cjs/transports/new-fetch.d.ts.map +0 -1
  152. package/cjs/transports/new-fetch.js +0 -27
  153. package/cjs/transports/new-fetch.js.map +0 -1
  154. package/cjs/transports/new-xhr.d.ts +0 -11
  155. package/cjs/transports/new-xhr.d.ts.map +0 -1
  156. package/cjs/transports/new-xhr.js +0 -46
  157. package/cjs/transports/new-xhr.js.map +0 -1
  158. package/cjs/transports/setup.d.ts +0 -22
  159. package/cjs/transports/setup.d.ts.map +0 -1
  160. package/cjs/transports/setup.js +0 -44
  161. package/cjs/transports/setup.js.map +0 -1
  162. package/cjs/transports/utils.d.ts +0 -48
  163. package/cjs/transports/utils.d.ts.map +0 -1
  164. package/cjs/transports/xhr.d.ts +0 -11
  165. package/cjs/transports/xhr.d.ts.map +0 -1
  166. package/cjs/version.d.ts +0 -2
  167. package/cjs/version.d.ts.map +0 -1
  168. package/cjs/version.js +0 -4
  169. package/cjs/version.js.map +0 -1
  170. package/esm/client.d.ts +0 -58
  171. package/esm/client.d.ts.map +0 -1
  172. package/esm/eventbuilder.d.ts +0 -37
  173. package/esm/eventbuilder.d.ts.map +0 -1
  174. package/esm/exports.d.ts +0 -10
  175. package/esm/exports.d.ts.map +0 -1
  176. package/esm/flags.d.ts +0 -3
  177. package/esm/flags.d.ts.map +0 -1
  178. package/esm/helpers.d.ts +0 -52
  179. package/esm/helpers.d.ts.map +0 -1
  180. package/esm/index.d.ts +0 -16
  181. package/esm/index.d.ts.map +0 -1
  182. package/esm/integrations/breadcrumbs.d.ts +0 -47
  183. package/esm/integrations/breadcrumbs.d.ts.map +0 -1
  184. package/esm/integrations/dedupe.d.ts +0 -21
  185. package/esm/integrations/dedupe.d.ts.map +0 -1
  186. package/esm/integrations/globalhandlers.d.ts +0 -30
  187. package/esm/integrations/globalhandlers.d.ts.map +0 -1
  188. package/esm/integrations/index.d.ts +0 -7
  189. package/esm/integrations/index.d.ts.map +0 -1
  190. package/esm/integrations/linkederrors.d.ts +0 -42
  191. package/esm/integrations/linkederrors.d.ts.map +0 -1
  192. package/esm/integrations/trycatch.d.ts +0 -33
  193. package/esm/integrations/trycatch.d.ts.map +0 -1
  194. package/esm/integrations/useragent.d.ts +0 -17
  195. package/esm/integrations/useragent.d.ts.map +0 -1
  196. package/esm/integrations/useragent.js +0 -41
  197. package/esm/integrations/useragent.js.map +0 -1
  198. package/esm/sdk.d.ts +0 -112
  199. package/esm/sdk.d.ts.map +0 -1
  200. package/esm/stack-parsers.d.ts +0 -8
  201. package/esm/stack-parsers.d.ts.map +0 -1
  202. package/esm/transports/base.d.ts +0 -65
  203. package/esm/transports/base.d.ts.map +0 -1
  204. package/esm/transports/base.js +0 -140
  205. package/esm/transports/base.js.map +0 -1
  206. package/esm/transports/fetch.d.ts +0 -17
  207. package/esm/transports/fetch.d.ts.map +0 -1
  208. package/esm/transports/index.d.ts +0 -7
  209. package/esm/transports/index.d.ts.map +0 -1
  210. package/esm/transports/new-fetch.d.ts +0 -10
  211. package/esm/transports/new-fetch.d.ts.map +0 -1
  212. package/esm/transports/new-fetch.js +0 -25
  213. package/esm/transports/new-fetch.js.map +0 -1
  214. package/esm/transports/new-xhr.d.ts +0 -11
  215. package/esm/transports/new-xhr.d.ts.map +0 -1
  216. package/esm/transports/new-xhr.js +0 -44
  217. package/esm/transports/new-xhr.js.map +0 -1
  218. package/esm/transports/setup.d.ts +0 -22
  219. package/esm/transports/setup.d.ts.map +0 -1
  220. package/esm/transports/setup.js +0 -42
  221. package/esm/transports/setup.js.map +0 -1
  222. package/esm/transports/utils.d.ts +0 -48
  223. package/esm/transports/utils.d.ts.map +0 -1
  224. package/esm/transports/xhr.d.ts +0 -11
  225. package/esm/transports/xhr.d.ts.map +0 -1
  226. package/esm/version.d.ts +0 -2
  227. package/esm/version.d.ts.map +0 -1
  228. package/esm/version.js +0 -3
  229. package/esm/version.js.map +0 -1
  230. package/types/integrations/useragent.d.ts.map +0 -1
  231. package/types/transports/base.d.ts +0 -65
  232. package/types/transports/base.d.ts.map +0 -1
  233. package/types/transports/new-fetch.d.ts +0 -10
  234. package/types/transports/new-fetch.d.ts.map +0 -1
  235. package/types/transports/new-xhr.d.ts +0 -11
  236. package/types/transports/new-xhr.d.ts.map +0 -1
  237. package/types/transports/setup.d.ts +0 -22
  238. package/types/transports/setup.d.ts.map +0 -1
  239. package/types/version.d.ts +0 -2
  240. package/types/version.d.ts.map +0 -1
@@ -1,65 +0,0 @@
1
- import { APIDetails } from '@sentry/core';
2
- import { Event, Outcome, Response as SentryResponse, SentryRequest, SentryRequestType, Session, Transport, TransportOptions } from '@sentry/types';
3
- import { PromiseBuffer, RateLimits } from '@sentry/utils';
4
- /** Base Transport class implementation */
5
- export declare abstract class BaseTransport implements Transport {
6
- options: TransportOptions;
7
- /**
8
- * @deprecated
9
- */
10
- url: string;
11
- /** Helper to get Sentry API endpoints. */
12
- protected readonly _api: APIDetails;
13
- /** A simple buffer holding all requests. */
14
- protected readonly _buffer: PromiseBuffer<SentryResponse>;
15
- /** Locks transport after receiving rate limits in a response */
16
- protected _rateLimits: RateLimits;
17
- protected _outcomes: {
18
- [key: string]: number;
19
- };
20
- constructor(options: TransportOptions);
21
- /**
22
- * @inheritDoc
23
- */
24
- sendEvent(event: Event): PromiseLike<SentryResponse>;
25
- /**
26
- * @inheritDoc
27
- */
28
- sendSession(session: Session): PromiseLike<SentryResponse>;
29
- /**
30
- * @inheritDoc
31
- */
32
- close(timeout?: number): PromiseLike<boolean>;
33
- /**
34
- * @inheritDoc
35
- */
36
- recordLostEvent(reason: Outcome, category: SentryRequestType): void;
37
- /**
38
- * Send outcomes as an envelope
39
- */
40
- protected _flushOutcomes(): void;
41
- /**
42
- * Handle Sentry repsonse for promise-based transports.
43
- */
44
- protected _handleResponse({ requestType, response, headers, resolve, reject, }: {
45
- requestType: SentryRequestType;
46
- response: Response | XMLHttpRequest;
47
- headers: Record<string, string | null>;
48
- resolve: (value?: SentryResponse | PromiseLike<SentryResponse> | null | undefined) => void;
49
- reject: (reason?: unknown) => void;
50
- }): void;
51
- /**
52
- * Gets the time that given category is disabled until for rate limiting
53
- *
54
- * @deprecated Please use `disabledUntil` from @sentry/utils
55
- */
56
- protected _disabledUntil(requestType: SentryRequestType): Date;
57
- /**
58
- * Checks if a category is rate limited
59
- *
60
- * @deprecated Please use `isRateLimited` from @sentry/utils
61
- */
62
- protected _isRateLimited(requestType: SentryRequestType): boolean;
63
- protected abstract _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<SentryResponse>;
64
- }
65
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMX,MAAM,cAAc,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AAc,CAAC;QACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;QAC3F,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;KACpC,GAAG,IAAI;IAmBR;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE,iBAAiB,GAAG,IAAI;IAK9D;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO;IAKjE,SAAS,CAAC,QAAQ,CAAC,YAAY,CAC7B,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,KAAK,GAAG,OAAO,GAC/B,WAAW,CAAC,cAAc,CAAC;CAC/B"}
@@ -1,141 +0,0 @@
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 utils_2 = require("./utils");
7
- function requestTypeToCategory(ty) {
8
- var tyStr = ty;
9
- return tyStr === 'event' ? 'error' : tyStr;
10
- }
11
- var global = utils_1.getGlobalObject();
12
- /** Base Transport class implementation */
13
- var BaseTransport = /** @class */ (function () {
14
- function BaseTransport(options) {
15
- var _this = this;
16
- this.options = options;
17
- /** A simple buffer holding all requests. */
18
- this._buffer = utils_1.makePromiseBuffer(30);
19
- /** Locks transport after receiving rate limits in a response */
20
- this._rateLimits = {};
21
- this._outcomes = {};
22
- this._api = core_1.initAPIDetails(options.dsn, options._metadata, options.tunnel);
23
- // eslint-disable-next-line deprecation/deprecation
24
- this.url = core_1.getStoreEndpointWithUrlEncodedAuth(this._api.dsn);
25
- if (this.options.sendClientReports && global.document) {
26
- global.document.addEventListener('visibilitychange', function () {
27
- if (global.document.visibilityState === 'hidden') {
28
- _this._flushOutcomes();
29
- }
30
- });
31
- }
32
- }
33
- /**
34
- * @inheritDoc
35
- */
36
- BaseTransport.prototype.sendEvent = function (event) {
37
- return this._sendRequest(core_1.eventToSentryRequest(event, this._api), event);
38
- };
39
- /**
40
- * @inheritDoc
41
- */
42
- BaseTransport.prototype.sendSession = function (session) {
43
- return this._sendRequest(core_1.sessionToSentryRequest(session, this._api), session);
44
- };
45
- /**
46
- * @inheritDoc
47
- */
48
- BaseTransport.prototype.close = function (timeout) {
49
- return this._buffer.drain(timeout);
50
- };
51
- /**
52
- * @inheritDoc
53
- */
54
- BaseTransport.prototype.recordLostEvent = function (reason, category) {
55
- var _a;
56
- if (!this.options.sendClientReports) {
57
- return;
58
- }
59
- // We want to track each category (event, transaction, session) separately
60
- // but still keep the distinction between different type of outcomes.
61
- // We could use nested maps, but it's much easier to read and type this way.
62
- // A correct type for map-based implementation if we want to go that route
63
- // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
64
- var key = requestTypeToCategory(category) + ":" + reason;
65
- flags_1.IS_DEBUG_BUILD && utils_1.logger.log("Adding outcome: " + key);
66
- this._outcomes[key] = ((_a = this._outcomes[key]) !== null && _a !== void 0 ? _a : 0) + 1;
67
- };
68
- /**
69
- * Send outcomes as an envelope
70
- */
71
- BaseTransport.prototype._flushOutcomes = function () {
72
- if (!this.options.sendClientReports) {
73
- return;
74
- }
75
- var outcomes = this._outcomes;
76
- this._outcomes = {};
77
- // Nothing to send
78
- if (!Object.keys(outcomes).length) {
79
- flags_1.IS_DEBUG_BUILD && utils_1.logger.log('No outcomes to flush');
80
- return;
81
- }
82
- flags_1.IS_DEBUG_BUILD && utils_1.logger.log("Flushing outcomes:\n" + JSON.stringify(outcomes, null, 2));
83
- var url = core_1.getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);
84
- var discardedEvents = Object.keys(outcomes).map(function (key) {
85
- var _a = tslib_1.__read(key.split(':'), 2), category = _a[0], reason = _a[1];
86
- return {
87
- reason: reason,
88
- category: category,
89
- quantity: outcomes[key],
90
- };
91
- // TODO: Improve types on discarded_events to get rid of cast
92
- });
93
- var envelope = utils_1.createClientReportEnvelope(discardedEvents, this._api.tunnel && utils_1.dsnToString(this._api.dsn));
94
- try {
95
- utils_2.sendReport(url, utils_1.serializeEnvelope(envelope));
96
- }
97
- catch (e) {
98
- flags_1.IS_DEBUG_BUILD && utils_1.logger.error(e);
99
- }
100
- };
101
- /**
102
- * Handle Sentry repsonse for promise-based transports.
103
- */
104
- BaseTransport.prototype._handleResponse = function (_a) {
105
- var requestType = _a.requestType, response = _a.response, headers = _a.headers, resolve = _a.resolve, reject = _a.reject;
106
- var status = utils_1.eventStatusFromHttpCode(response.status);
107
- this._rateLimits = utils_1.updateRateLimits(this._rateLimits, headers);
108
- // eslint-disable-next-line deprecation/deprecation
109
- if (this._isRateLimited(requestType)) {
110
- flags_1.IS_DEBUG_BUILD &&
111
- // eslint-disable-next-line deprecation/deprecation
112
- utils_1.logger.warn("Too many " + requestType + " requests, backing off until: " + this._disabledUntil(requestType));
113
- }
114
- if (status === 'success') {
115
- resolve({ status: status });
116
- return;
117
- }
118
- reject(response);
119
- };
120
- /**
121
- * Gets the time that given category is disabled until for rate limiting
122
- *
123
- * @deprecated Please use `disabledUntil` from @sentry/utils
124
- */
125
- BaseTransport.prototype._disabledUntil = function (requestType) {
126
- var category = requestTypeToCategory(requestType);
127
- return new Date(utils_1.disabledUntil(this._rateLimits, category));
128
- };
129
- /**
130
- * Checks if a category is rate limited
131
- *
132
- * @deprecated Please use `isRateLimited` from @sentry/utils
133
- */
134
- BaseTransport.prototype._isRateLimited = function (requestType) {
135
- var category = requestTypeToCategory(requestType);
136
- return utils_1.isRateLimited(this._rateLimits, category);
137
- };
138
- return BaseTransport;
139
- }());
140
- exports.BaseTransport = BaseTransport;
141
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","s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WAAW,CAAG,CAAC,CAAC;SAC3G;QAED,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,OAAO,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;YACpB,OAAO;SACR;QAED,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACO,sCAAc,GAAxB,UAAyB,WAA8B;QACrD,IAAM,QAAQ,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,IAAI,IAAI,CAAC,qBAAa,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACO,sCAAc,GAAxB,UAAyB,WAA8B;QACrD,IAAM,QAAQ,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,qBAAa,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAMH,oBAAC;AAAD,CAAC,AAtKD,IAsKC;AAtKqB,sCAAa","sourcesContent":["import {\n APIDetails,\n eventToSentryRequest,\n getEnvelopeEndpointWithUrlEncodedAuth,\n getStoreEndpointWithUrlEncodedAuth,\n initAPIDetails,\n sessionToSentryRequest,\n} from '@sentry/core';\nimport {\n ClientReport,\n Event,\n Outcome,\n Response as SentryResponse,\n SentryRequest,\n SentryRequestType,\n Session,\n Transport,\n TransportOptions,\n} from '@sentry/types';\nimport {\n createClientReportEnvelope,\n disabledUntil,\n dsnToString,\n eventStatusFromHttpCode,\n getGlobalObject,\n isRateLimited,\n logger,\n makePromiseBuffer,\n PromiseBuffer,\n RateLimits,\n serializeEnvelope,\n updateRateLimits,\n} from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from '../flags';\nimport { sendReport } from './utils';\n\nfunction requestTypeToCategory(ty: SentryRequestType): string {\n const tyStr = ty as string;\n return tyStr === 'event' ? 'error' : tyStr;\n}\n\nconst global = getGlobalObject<Window>();\n\n/** Base Transport class implementation */\nexport abstract class BaseTransport implements Transport {\n /**\n * @deprecated\n */\n public url: string;\n\n /** Helper to get Sentry API endpoints. */\n protected readonly _api: APIDetails;\n\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<SentryResponse> = makePromiseBuffer(30);\n\n /** Locks transport after receiving rate limits in a response */\n protected _rateLimits: RateLimits = {};\n\n protected _outcomes: { [key: string]: number } = {};\n\n public constructor(public options: TransportOptions) {\n this._api = initAPIDetails(options.dsn, options._metadata, options.tunnel);\n // eslint-disable-next-line deprecation/deprecation\n this.url = getStoreEndpointWithUrlEncodedAuth(this._api.dsn);\n\n if (this.options.sendClientReports && global.document) {\n global.document.addEventListener('visibilitychange', () => {\n if (global.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike<SentryResponse> {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session): PromiseLike<SentryResponse> {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n\n /**\n * @inheritDoc\n */\n public recordLostEvent(reason: Outcome, category: SentryRequestType): void {\n if (!this.options.sendClientReports) {\n return;\n }\n // We want to track each category (event, transaction, session) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n const key = `${requestTypeToCategory(category)}:${reason}`;\n IS_DEBUG_BUILD && logger.log(`Adding outcome: ${key}`);\n this._outcomes[key] = (this._outcomes[key] ?? 0) + 1;\n }\n\n /**\n * Send outcomes as an envelope\n */\n protected _flushOutcomes(): void {\n if (!this.options.sendClientReports) {\n return;\n }\n\n const outcomes = this._outcomes;\n this._outcomes = {};\n\n // Nothing to send\n if (!Object.keys(outcomes).length) {\n IS_DEBUG_BUILD && logger.log('No outcomes to flush');\n return;\n }\n\n IS_DEBUG_BUILD && logger.log(`Flushing outcomes:\\n${JSON.stringify(outcomes, null, 2)}`);\n\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);\n\n const discardedEvents = Object.keys(outcomes).map(key => {\n const [category, reason] = key.split(':');\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n // TODO: Improve types on discarded_events to get rid of cast\n }) as ClientReport['discarded_events'];\n const envelope = createClientReportEnvelope(discardedEvents, this._api.tunnel && dsnToString(this._api.dsn));\n\n try {\n sendReport(url, serializeEnvelope(envelope));\n } catch (e) {\n IS_DEBUG_BUILD && logger.error(e);\n }\n }\n\n /**\n * Handle Sentry repsonse for promise-based transports.\n */\n protected _handleResponse({\n requestType,\n response,\n headers,\n resolve,\n reject,\n }: {\n requestType: SentryRequestType;\n response: Response | XMLHttpRequest;\n headers: Record<string, string | null>;\n resolve: (value?: SentryResponse | PromiseLike<SentryResponse> | null | undefined) => void;\n reject: (reason?: unknown) => void;\n }): void {\n const status = eventStatusFromHttpCode(response.status);\n\n this._rateLimits = updateRateLimits(this._rateLimits, headers);\n // eslint-disable-next-line deprecation/deprecation\n if (this._isRateLimited(requestType)) {\n IS_DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.warn(`Too many ${requestType} requests, backing off until: ${this._disabledUntil(requestType)}`);\n }\n\n if (status === 'success') {\n resolve({ status });\n return;\n }\n\n reject(response);\n }\n\n /**\n * Gets the time that given category is disabled until for rate limiting\n *\n * @deprecated Please use `disabledUntil` from @sentry/utils\n */\n protected _disabledUntil(requestType: SentryRequestType): Date {\n const category = requestTypeToCategory(requestType);\n return new Date(disabledUntil(this._rateLimits, category));\n }\n\n /**\n * Checks if a category is rate limited\n *\n * @deprecated Please use `isRateLimited` from @sentry/utils\n */\n protected _isRateLimited(requestType: SentryRequestType): boolean {\n const category = requestTypeToCategory(requestType);\n return isRateLimited(this._rateLimits, category);\n }\n\n protected abstract _sendRequest(\n sentryRequest: SentryRequest,\n originalPayload: Event | Session,\n ): PromiseLike<SentryResponse>;\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { Event, Response, SentryRequest, Session, TransportOptions } from '@sentry/types';
2
- import { BaseTransport } from './base';
3
- import { FetchImpl } from './utils';
4
- /** `fetch` based transport */
5
- export declare class FetchTransport extends BaseTransport {
6
- /**
7
- * Fetch API reference which always points to native browser implementation.
8
- */
9
- private _fetch;
10
- constructor(options: TransportOptions, fetchImpl?: FetchImpl);
11
- /**
12
- * @param sentryRequest Prepared SentryRequest to be delivered
13
- * @param originalPayload Original payload used to create SentryRequest
14
- */
15
- protected _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<Response>;
16
- }
17
- //# sourceMappingURL=fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG1F,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAgC,MAAM,SAAS,CAAC;AAElE,8BAA8B;AAC9B,qBAAa,cAAe,SAAQ,aAAa;IAC/C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAe;gBAEV,OAAO,EAAE,gBAAgB,EAAE,SAAS,GAAE,SAA0C;IAKnG;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC;CA+D9G"}
@@ -1,7 +0,0 @@
1
- export { BaseTransport } from './base';
2
- export { FetchTransport } from './fetch';
3
- export { XHRTransport } from './xhr';
4
- export { makeNewFetchTransport } from './new-fetch';
5
- export { makeNewXHRTransport } from './new-xhr';
6
- export { setupBrowserTransport } from './setup';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,10 +0,0 @@
1
- import { BaseTransportOptions, NewTransport } from '@sentry/core';
2
- import { FetchImpl } from './utils';
3
- export interface FetchTransportOptions extends BaseTransportOptions {
4
- requestOptions?: RequestInit;
5
- }
6
- /**
7
- * Creates a Transport that uses the Fetch API to send events to Sentry.
8
- */
9
- export declare function makeNewFetchTransport(options: FetchTransportOptions, nativeFetch?: FetchImpl): NewTransport;
10
- //# sourceMappingURL=new-fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/new-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EAGb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAgC,MAAM,SAAS,CAAC;AAElE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,cAAc,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,GAAE,SAA0C,GACtD,YAAY,CAuBd"}
@@ -1,27 +0,0 @@
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("./utils");
5
- /**
6
- * Creates a Transport that uses the Fetch API to send events to Sentry.
7
- */
8
- function makeNewFetchTransport(options, nativeFetch) {
9
- if (nativeFetch === void 0) { nativeFetch = utils_1.getNativeFetchImplementation(); }
10
- function makeRequest(request) {
11
- var requestOptions = tslib_1.__assign({ body: request.body, method: 'POST', referrerPolicy: 'origin' }, options.requestOptions);
12
- return nativeFetch(options.url, requestOptions).then(function (response) {
13
- return response.text().then(function (body) { return ({
14
- body: body,
15
- headers: {
16
- 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
17
- 'retry-after': response.headers.get('Retry-After'),
18
- },
19
- reason: response.statusText,
20
- statusCode: response.status,
21
- }); });
22
- });
23
- }
24
- return core_1.createTransport({ bufferSize: options.bufferSize }, makeRequest);
25
- }
26
- exports.makeNewFetchTransport = makeNewFetchTransport;
27
- //# sourceMappingURL=new-fetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-fetch.js","sourceRoot":"","sources":["../../../../src/transports/new-fetch.ts"],"names":[],"mappings":";;AAAA,qCAMsB;AAEtB,iCAAkE;AAMlE;;GAEG;AACH,SAAgB,qBAAqB,CACnC,OAA8B,EAC9B,WAAuD;IAAvD,4BAAA,EAAA,cAAyB,oCAA4B,EAAE;IAEvD,SAAS,WAAW,CAAC,OAAyB;QAC5C,IAAM,cAAc,sBAClB,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,QAAQ,IACrB,OAAO,CAAC,cAAc,CAC1B,CAAC;QAEF,OAAO,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;YAC3D,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,CAAC;gBACnC,IAAI,MAAA;gBACJ,OAAO,EAAE;oBACP,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;oBACpE,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;iBACnD;gBACD,MAAM,EAAE,QAAQ,CAAC,UAAU;gBAC3B,UAAU,EAAE,QAAQ,CAAC,MAAM;aAC5B,CAAC,EARkC,CAQlC,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,sBAAe,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,WAAW,CAAC,CAAC;AAC1E,CAAC;AA1BD,sDA0BC","sourcesContent":["import {\n BaseTransportOptions,\n createTransport,\n NewTransport,\n TransportMakeRequestResponse,\n TransportRequest,\n} from '@sentry/core';\n\nimport { FetchImpl, getNativeFetchImplementation } from './utils';\n\nexport interface FetchTransportOptions extends BaseTransportOptions {\n requestOptions?: RequestInit;\n}\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeNewFetchTransport(\n options: FetchTransportOptions,\n nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): NewTransport {\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n ...options.requestOptions,\n };\n\n return nativeFetch(options.url, requestOptions).then(response => {\n return response.text().then(body => ({\n body,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n reason: response.statusText,\n statusCode: response.status,\n }));\n });\n }\n\n return createTransport({ bufferSize: options.bufferSize }, makeRequest);\n}\n"]}
@@ -1,11 +0,0 @@
1
- import { BaseTransportOptions, NewTransport } from '@sentry/core';
2
- export interface XHRTransportOptions extends BaseTransportOptions {
3
- headers?: {
4
- [key: string]: string;
5
- };
6
- }
7
- /**
8
- * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
9
- */
10
- export declare function makeNewXHRTransport(options: XHRTransportOptions): NewTransport;
11
- //# sourceMappingURL=new-xhr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-xhr.d.ts","sourceRoot":"","sources":["../../../../src/transports/new-xhr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EAGb,MAAM,cAAc,CAAC;AAatB,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAiC9E"}
@@ -1,46 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- var core_1 = require("@sentry/core");
3
- var utils_1 = require("@sentry/utils");
4
- /**
5
- * The DONE ready state for XmlHttpRequest
6
- *
7
- * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined
8
- * (e.g. during testing, it is `undefined`)
9
- *
10
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}
11
- */
12
- var XHR_READYSTATE_DONE = 4;
13
- /**
14
- * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
15
- */
16
- function makeNewXHRTransport(options) {
17
- function makeRequest(request) {
18
- return new utils_1.SyncPromise(function (resolve, _reject) {
19
- var xhr = new XMLHttpRequest();
20
- xhr.onreadystatechange = function () {
21
- if (xhr.readyState === XHR_READYSTATE_DONE) {
22
- var response = {
23
- body: xhr.response,
24
- headers: {
25
- 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),
26
- 'retry-after': xhr.getResponseHeader('Retry-After'),
27
- },
28
- reason: xhr.statusText,
29
- statusCode: xhr.status,
30
- };
31
- resolve(response);
32
- }
33
- };
34
- xhr.open('POST', options.url);
35
- for (var header in options.headers) {
36
- if (Object.prototype.hasOwnProperty.call(options.headers, header)) {
37
- xhr.setRequestHeader(header, options.headers[header]);
38
- }
39
- }
40
- xhr.send(request.body);
41
- });
42
- }
43
- return core_1.createTransport({ bufferSize: options.bufferSize }, makeRequest);
44
- }
45
- exports.makeNewXHRTransport = makeNewXHRTransport;
46
- //# sourceMappingURL=new-xhr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-xhr.js","sourceRoot":"","sources":["../../../../src/transports/new-xhr.ts"],"names":[],"mappings":";AAAA,qCAMsB;AACtB,uCAA4C;AAE5C;;;;;;;GAOG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAM9B;;GAEG;AACH,SAAgB,mBAAmB,CAAC,OAA4B;IAC9D,SAAS,WAAW,CAAC,OAAyB;QAC5C,OAAO,IAAI,mBAAW,CAA+B,UAAC,OAAO,EAAE,OAAO;YACpE,IAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;YAEjC,GAAG,CAAC,kBAAkB,GAAG;gBACvB,IAAI,GAAG,CAAC,UAAU,KAAK,mBAAmB,EAAE;oBAC1C,IAAM,QAAQ,GAAG;wBACf,IAAI,EAAE,GAAG,CAAC,QAAQ;wBAClB,OAAO,EAAE;4BACP,sBAAsB,EAAE,GAAG,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;4BACrE,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,aAAa,CAAC;yBACpD;wBACD,MAAM,EAAE,GAAG,CAAC,UAAU;wBACtB,UAAU,EAAE,GAAG,CAAC,MAAM;qBACvB,CAAC;oBACF,OAAO,CAAC,QAAQ,CAAC,CAAC;iBACnB;YACH,CAAC,CAAC;YAEF,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;YAE9B,KAAK,IAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE;gBACpC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;oBACjE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;iBACvD;aACF;YAED,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,sBAAe,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,WAAW,CAAC,CAAC;AAC1E,CAAC;AAjCD,kDAiCC","sourcesContent":["import {\n BaseTransportOptions,\n createTransport,\n NewTransport,\n TransportMakeRequestResponse,\n TransportRequest,\n} from '@sentry/core';\nimport { SyncPromise } from '@sentry/utils';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\nexport interface XHRTransportOptions extends BaseTransportOptions {\n headers?: { [key: string]: string };\n}\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeNewXHRTransport(options: XHRTransportOptions): NewTransport {\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n return new SyncPromise<TransportMakeRequestResponse>((resolve, _reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n const response = {\n body: xhr.response,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n reason: xhr.statusText,\n statusCode: xhr.status,\n };\n resolve(response);\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport({ bufferSize: options.bufferSize }, makeRequest);\n}\n"]}
@@ -1,22 +0,0 @@
1
- import { BaseTransportOptions, NewTransport } from '@sentry/core';
2
- import { Transport } from '@sentry/types';
3
- import { BrowserOptions } from '../client';
4
- export interface BrowserTransportOptions extends BaseTransportOptions {
5
- fetchParams: Record<string, string>;
6
- headers?: Record<string, string>;
7
- sendClientReports?: boolean;
8
- }
9
- /**
10
- * Sets up Browser transports based on the passed `options`. If available, the returned
11
- * transport will use the fetch API. In case fetch is not supported, an XMLHttpRequest
12
- * based transport is created.
13
- *
14
- * @returns an object currently still containing both, the old `Transport` and
15
- * `NewTransport` which will eventually replace `Transport`. Once this is replaced,
16
- * this function will return a ready to use `NewTransport`.
17
- */
18
- export declare function setupBrowserTransport(options: BrowserOptions): {
19
- transport: Transport;
20
- newTransport?: NewTransport;
21
- };
22
- //# sourceMappingURL=setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/transports/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGpB,YAAY,EAEb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM3C,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IAEnE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AAEH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAE,CAkCpH"}
@@ -1,44 +0,0 @@
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 fetch_1 = require("./fetch");
6
- var new_fetch_1 = require("./new-fetch");
7
- var new_xhr_1 = require("./new-xhr");
8
- var xhr_1 = require("./xhr");
9
- /**
10
- * Sets up Browser transports based on the passed `options`. If available, the returned
11
- * transport will use the fetch API. In case fetch is not supported, an XMLHttpRequest
12
- * based transport is created.
13
- *
14
- * @returns an object currently still containing both, the old `Transport` and
15
- * `NewTransport` which will eventually replace `Transport`. Once this is replaced,
16
- * this function will return a ready to use `NewTransport`.
17
- */
18
- // TODO(v7): Adjust return value when NewTransport is the default
19
- function setupBrowserTransport(options) {
20
- if (!options.dsn) {
21
- // We return the noop transport here in case there is no Dsn.
22
- return { transport: new core_1.NoopTransport() };
23
- }
24
- var transportOptions = tslib_1.__assign(tslib_1.__assign({}, options.transportOptions), { dsn: options.dsn, tunnel: options.tunnel, sendClientReports: options.sendClientReports, _metadata: options._metadata });
25
- var api = core_1.initAPIDetails(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel);
26
- var url = core_1.getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel);
27
- if (options.transport) {
28
- return { transport: new options.transport(transportOptions) };
29
- }
30
- if (utils_1.supportsFetch()) {
31
- var requestOptions = tslib_1.__assign({}, transportOptions.fetchParameters);
32
- var newTransport_1 = new_fetch_1.makeNewFetchTransport({ requestOptions: requestOptions, url: url });
33
- var fetchTransport = new fetch_1.FetchTransport(transportOptions);
34
- return { transport: fetchTransport, newTransport: newTransport_1 };
35
- }
36
- var newTransport = new_xhr_1.makeNewXHRTransport({
37
- url: url,
38
- headers: transportOptions.headers,
39
- });
40
- var transport = new xhr_1.XHRTransport(transportOptions);
41
- return { transport: transport, newTransport: newTransport };
42
- }
43
- exports.setupBrowserTransport = setupBrowserTransport;
44
- //# sourceMappingURL=setup.js.map
@@ -1 +0,0 @@
1
- {"version":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,IAAM,YAAY,GAAG,6BAAmB,CAAC;QACvC,GAAG,KAAA;QACH,OAAO,EAAE,gBAAgB,CAAC,OAAO;KAClC,CAAC,CAAC;IACH,IAAM,SAAS,GAAG,IAAI,kBAAY,CAAC,gBAAgB,CAAC,CAAC;IACrD,OAAO,EAAE,SAAS,WAAA,EAAE,YAAY,cAAA,EAAE,CAAC;AACrC,CAAC;AAlCD,sDAkCC","sourcesContent":["import {\n BaseTransportOptions,\n getEnvelopeEndpointWithUrlEncodedAuth,\n initAPIDetails,\n NewTransport,\n NoopTransport,\n} from '@sentry/core';\nimport { Transport, TransportOptions } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\n\nimport { BrowserOptions } from '../client';\nimport { FetchTransport } from './fetch';\nimport { makeNewFetchTransport } from './new-fetch';\nimport { makeNewXHRTransport } from './new-xhr';\nimport { XHRTransport } from './xhr';\n\nexport interface BrowserTransportOptions extends BaseTransportOptions {\n // options to pass into fetch request\n fetchParams: Record<string, string>;\n headers?: Record<string, string>;\n sendClientReports?: boolean;\n}\n\n/**\n * Sets up Browser transports based on the passed `options`. If available, the returned\n * transport will use the fetch API. In case fetch is not supported, an XMLHttpRequest\n * based transport is created.\n *\n * @returns an object currently still containing both, the old `Transport` and\n * `NewTransport` which will eventually replace `Transport`. Once this is replaced,\n * this function will return a ready to use `NewTransport`.\n */\n// TODO(v7): Adjust return value when NewTransport is the default\nexport function setupBrowserTransport(options: BrowserOptions): { transport: Transport; newTransport?: NewTransport } {\n if (!options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return { transport: new NoopTransport() };\n }\n\n const transportOptions: TransportOptions = {\n ...options.transportOptions,\n dsn: options.dsn,\n tunnel: options.tunnel,\n sendClientReports: options.sendClientReports,\n _metadata: options._metadata,\n };\n\n const api = initAPIDetails(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel);\n const url = getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel);\n\n if (options.transport) {\n return { transport: new options.transport(transportOptions) };\n }\n\n if (supportsFetch()) {\n const requestOptions: RequestInit = { ...transportOptions.fetchParameters };\n const newTransport = makeNewFetchTransport({ requestOptions, url });\n const fetchTransport = new FetchTransport(transportOptions);\n return { transport: fetchTransport, newTransport };\n }\n\n const newTransport = makeNewXHRTransport({\n url,\n headers: transportOptions.headers,\n });\n const transport = new XHRTransport(transportOptions);\n return { transport, newTransport };\n}\n"]}
@@ -1,48 +0,0 @@
1
- export declare type FetchImpl = typeof fetch;
2
- /**
3
- * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
4
- * Whenever someone wraps the Fetch API and returns the wrong promise chain,
5
- * this chain becomes orphaned and there is no possible way to capture it's rejections
6
- * other than allowing it bubble up to this very handler. eg.
7
- *
8
- * const f = window.fetch;
9
- * window.fetch = function () {
10
- * const p = f.apply(this, arguments);
11
- *
12
- * p.then(function() {
13
- * console.log('hi.');
14
- * });
15
- *
16
- * return p;
17
- * }
18
- *
19
- * `p.then(function () { ... })` is producing a completely separate promise chain,
20
- * however, what's returned is `p` - the result of original `fetch` call.
21
- *
22
- * This mean, that whenever we use the Fetch API to send our own requests, _and_
23
- * some ad-blocker blocks it, this orphaned chain will _always_ reject,
24
- * effectively causing another event to be captured.
25
- * This makes a whole process become an infinite loop, which we need to somehow
26
- * deal with, and break it in one way or another.
27
- *
28
- * To deal with this issue, we are making sure that we _always_ use the real
29
- * browser Fetch API, instead of relying on what `window.fetch` exposes.
30
- * The only downside to this would be missing our own requests as breadcrumbs,
31
- * but because we are already not doing this, it should be just fine.
32
- *
33
- * Possible failed fetch error messages per-browser:
34
- *
35
- * Chrome: Failed to fetch
36
- * Edge: Failed to Fetch
37
- * Firefox: NetworkError when attempting to fetch resource
38
- * Safari: resource blocked by content blocker
39
- */
40
- export declare function getNativeFetchImplementation(): FetchImpl;
41
- /**
42
- * Sends sdk client report using sendBeacon or fetch as a fallback if available
43
- *
44
- * @param url report endpoint
45
- * @param body report payload
46
- */
47
- export declare function sendReport(url: string, body: string): void;
48
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/transports/utils.ts"],"names":[],"mappings":"AAOA,oBAAY,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,4BAA4B,IAAI,SAAS,CAiCxD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAqB1D"}
@@ -1,11 +0,0 @@
1
- import { Event, Response, SentryRequest, Session } from '@sentry/types';
2
- import { BaseTransport } from './base';
3
- /** `XHR` based transport */
4
- export declare class XHRTransport extends BaseTransport {
5
- /**
6
- * @param sentryRequest Prepared SentryRequest to be delivered
7
- * @param originalPayload Original payload used to create SentryRequest
8
- */
9
- protected _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<Response>;
10
- }
11
- //# sourceMappingURL=xhr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../../src/transports/xhr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,4BAA4B;AAC5B,qBAAa,YAAa,SAAQ,aAAa;IAC7C;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC;CAmD9G"}
package/cjs/version.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const SDK_NAME = "sentry.javascript.browser";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,8BAA8B,CAAC"}
package/cjs/version.js DELETED
@@ -1,4 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- // TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata
3
- exports.SDK_NAME = 'sentry.javascript.browser';
4
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":";AAAA,wGAAwG;AAC3F,QAAA,QAAQ,GAAG,2BAA2B,CAAC","sourcesContent":["// TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata\nexport const SDK_NAME = 'sentry.javascript.browser';\n"]}
package/esm/client.d.ts DELETED
@@ -1,58 +0,0 @@
1
- import { BaseClient, NewTransport, Scope } from '@sentry/core';
2
- import { Event, EventHint, Options, Severity, SeverityLevel, Transport } from '@sentry/types';
3
- import { ReportDialogOptions } from './helpers';
4
- /**
5
- * Configuration options for the Sentry Browser SDK.
6
- * @see BrowserClient for more information.
7
- */
8
- export interface BrowserOptions extends Options {
9
- /**
10
- * A pattern for error URLs which should exclusively be sent to Sentry.
11
- * This is the opposite of {@link Options.denyUrls}.
12
- * By default, all errors will be sent.
13
- */
14
- allowUrls?: Array<string | RegExp>;
15
- /**
16
- * A pattern for error URLs which should not be sent to Sentry.
17
- * To allow certain errors instead, use {@link Options.allowUrls}.
18
- * By default, all errors will be sent.
19
- */
20
- denyUrls?: Array<string | RegExp>;
21
- }
22
- /**
23
- * The Sentry Browser SDK Client.
24
- *
25
- * @see BrowserOptions for documentation on configuration options.
26
- * @see SentryClient for usage documentation.
27
- */
28
- export declare class BrowserClient extends BaseClient<BrowserOptions> {
29
- /**
30
- * Creates a new Browser SDK instance.
31
- *
32
- * @param options Configuration options for this SDK.
33
- */
34
- constructor(options: BrowserOptions | undefined, transport: Transport, newTransport?: NewTransport);
35
- /**
36
- * Show a report dialog to the user to send feedback to a specific event.
37
- *
38
- * @param options Set individual options for the dialog
39
- */
40
- showReportDialog(options?: ReportDialogOptions): void;
41
- /**
42
- * @inheritDoc
43
- */
44
- eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event>;
45
- /**
46
- * @inheritDoc
47
- */
48
- eventFromMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
49
- /**
50
- * @inheritDoc
51
- */
52
- protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null>;
53
- /**
54
- * @inheritDoc
55
- */
56
- protected _sendEvent(event: Event): void;
57
- }
58
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAe,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK9F,OAAO,EAAsB,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGpE;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC3D;;;;OAIG;gBACgB,OAAO,4BAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY;IAgBlG;;;;OAIG;IACI,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,GAAG,IAAI;IAkBhE;;OAEG;IACI,kBA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