@sentry/browser 6.6.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle.es6.js +280 -80
- package/build/bundle.es6.js.map +1 -1
- package/build/bundle.es6.min.js +2 -2
- package/build/bundle.es6.min.js.map +1 -1
- package/build/bundle.js +318 -113
- package/build/bundle.js.map +1 -1
- package/build/bundle.min.js +2 -2
- package/build/bundle.min.js.map +1 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +1 -1
- package/dist/backend.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/integrations/breadcrumbs.d.ts +1 -1
- package/dist/integrations/breadcrumbs.d.ts.map +1 -1
- package/dist/integrations/breadcrumbs.js +6 -3
- package/dist/integrations/breadcrumbs.js.map +1 -1
- package/dist/integrations/dedupe.d.ts +35 -0
- package/dist/integrations/dedupe.d.ts.map +1 -0
- package/dist/integrations/dedupe.js +166 -0
- package/dist/integrations/dedupe.js.map +1 -0
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +6 -8
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -1
- package/dist/sdk.d.ts +2 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +1 -0
- package/dist/sdk.js.map +1 -1
- package/dist/transports/base.d.ts.map +1 -1
- package/dist/transports/base.js +2 -2
- package/dist/transports/base.js.map +1 -1
- package/dist/transports/fetch.d.ts.map +1 -1
- package/dist/transports/fetch.js +20 -18
- package/dist/transports/fetch.js.map +1 -1
- package/dist/transports/xhr.d.ts.map +1 -1
- package/dist/transports/xhr.js +21 -19
- package/dist/transports/xhr.js.map +1 -1
- package/esm/backend.d.ts.map +1 -1
- package/esm/backend.js +1 -1
- package/esm/backend.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/integrations/breadcrumbs.d.ts +1 -1
- package/esm/integrations/breadcrumbs.d.ts.map +1 -1
- package/esm/integrations/breadcrumbs.js +6 -3
- package/esm/integrations/breadcrumbs.js.map +1 -1
- package/esm/integrations/dedupe.d.ts +35 -0
- package/esm/integrations/dedupe.d.ts.map +1 -0
- package/esm/integrations/dedupe.js +165 -0
- package/esm/integrations/dedupe.js.map +1 -0
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +6 -8
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/index.d.ts +1 -0
- package/esm/integrations/index.d.ts.map +1 -1
- package/esm/integrations/index.js +1 -0
- package/esm/integrations/index.js.map +1 -1
- package/esm/sdk.d.ts +2 -2
- package/esm/sdk.d.ts.map +1 -1
- package/esm/sdk.js +2 -1
- package/esm/sdk.js.map +1 -1
- package/esm/transports/base.d.ts.map +1 -1
- package/esm/transports/base.js +2 -2
- package/esm/transports/base.js.map +1 -1
- package/esm/transports/fetch.d.ts.map +1 -1
- package/esm/transports/fetch.js +20 -18
- package/esm/transports/fetch.js.map +1 -1
- package/esm/transports/xhr.d.ts.map +1 -1
- package/esm/transports/xhr.js +21 -19
- package/esm/transports/xhr.js.map +1 -1
- package/package.json +5 -5
package/esm/transports/xhr.js
CHANGED
|
@@ -30,29 +30,31 @@ var XHRTransport = /** @class */ (function (_super) {
|
|
|
30
30
|
return Promise.reject({
|
|
31
31
|
event: originalPayload,
|
|
32
32
|
type: sentryRequest.type,
|
|
33
|
-
reason: "Transport locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.",
|
|
33
|
+
reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.",
|
|
34
34
|
status: 429,
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
return this._buffer.add(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
return this._buffer.add(function () {
|
|
38
|
+
return new SyncPromise(function (resolve, reject) {
|
|
39
|
+
var request = new XMLHttpRequest();
|
|
40
|
+
request.onreadystatechange = function () {
|
|
41
|
+
if (request.readyState === 4) {
|
|
42
|
+
var headers = {
|
|
43
|
+
'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),
|
|
44
|
+
'retry-after': request.getResponseHeader('Retry-After'),
|
|
45
|
+
};
|
|
46
|
+
_this._handleResponse({ requestType: sentryRequest.type, response: request, headers: headers, resolve: resolve, reject: reject });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
request.open('POST', sentryRequest.url);
|
|
50
|
+
for (var header in _this.options.headers) {
|
|
51
|
+
if (_this.options.headers.hasOwnProperty(header)) {
|
|
52
|
+
request.setRequestHeader(header, _this.options.headers[header]);
|
|
53
|
+
}
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (_this.options.headers.hasOwnProperty(header)) {
|
|
51
|
-
request.setRequestHeader(header, _this.options.headers[header]);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
request.send(sentryRequest.body);
|
|
55
|
-
}));
|
|
55
|
+
request.send(sentryRequest.body);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
56
58
|
};
|
|
57
59
|
return XHRTransport;
|
|
58
60
|
}(BaseTransport));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.js","sourceRoot":"","sources":["../../src/transports/xhr.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,4BAA4B;AA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AAO,CAAC,kBAAkB,GAAG;oBAC3B,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE;wBAC5B,IAAM,OAAO,GAAG;4BACd,sBAAsB,EAAE,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;4BACzE,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC;yBACxD,CAAC;wBACF,KAAI,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,SAAA,EAAE,OAAO,SAAA,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;qBACxG;gBACH,CAAC,CAAC;gBAEF,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;gBACxC,KAAK,IAAM,MAAM,IAAI,KAAI,CAAC,OAAO,CAAC,OAAO,EAAE;oBACzC,IAAI,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;wBAC/C,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;qBAChE;iBACF;gBACD,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC,CAAC;QApBF,CAoBE,CACL,CAAC;IACJ,CAAC;IACH,mBAAC;AAAD,CAAC,AAxDD,CAAkC,aAAa,GAwD9C","sourcesContent":["import { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Response, SentryRequest, Session } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\n/** `XHR` based transport */\nexport class XHRTransport extends BaseTransport {\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike<Response> {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session): PromiseLike<Response> {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n }\n\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n private _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<Response> {\n if (this._isRateLimited(sentryRequest.type)) {\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: `Transport for ${sentryRequest.type} requests locked till ${this._disabledUntil(\n sentryRequest.type,\n )} due to too many requests.`,\n status: 429,\n });\n }\n\n return this._buffer.add(\n () =>\n new SyncPromise<Response>((resolve, reject) => {\n const request = new XMLHttpRequest();\n\n request.onreadystatechange = (): void => {\n if (request.readyState === 4) {\n const headers = {\n 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': request.getResponseHeader('Retry-After'),\n };\n this._handleResponse({ requestType: sentryRequest.type, response: request, headers, resolve, reject });\n }\n };\n\n request.open('POST', sentryRequest.url);\n for (const header in this.options.headers) {\n if (this.options.headers.hasOwnProperty(header)) {\n request.setRequestHeader(header, this.options.headers[header]);\n }\n }\n request.send(sentryRequest.body);\n }),\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/browser",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.0",
|
|
4
4
|
"description": "Official Sentry SDK for browsers",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@sentry/core": "6.
|
|
20
|
-
"@sentry/types": "6.
|
|
21
|
-
"@sentry/utils": "6.
|
|
19
|
+
"@sentry/core": "6.8.0",
|
|
20
|
+
"@sentry/types": "6.8.0",
|
|
21
|
+
"@sentry/utils": "6.8.0",
|
|
22
22
|
"tslib": "^1.9.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@sentry-internal/eslint-config-sdk": "6.
|
|
25
|
+
"@sentry-internal/eslint-config-sdk": "6.8.0",
|
|
26
26
|
"@types/eslint": "^7.2.0",
|
|
27
27
|
"@types/md5": "2.1.33",
|
|
28
28
|
"btoa": "^1.2.1",
|