@sentry/browser 6.13.2 → 6.14.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.
- package/build/bundle.es6.js +455 -354
- 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 +456 -356
- package/build/bundle.js.map +1 -1
- package/build/bundle.min.js +2 -2
- package/build/bundle.min.js.map +1 -1
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +3 -7
- package/dist/eventbuilder.js.map +1 -1
- package/dist/integrations/trycatch.js +1 -1
- package/dist/integrations/trycatch.js.map +1 -1
- package/dist/transports/base.d.ts.map +1 -1
- package/dist/transports/base.js +8 -6
- package/dist/transports/base.js.map +1 -1
- package/dist/transports/fetch.d.ts +1 -2
- package/dist/transports/fetch.d.ts.map +1 -1
- package/dist/transports/fetch.js +2 -67
- package/dist/transports/fetch.js.map +1 -1
- package/dist/transports/utils.d.ts +48 -0
- package/dist/transports/utils.d.ts.map +1 -0
- package/dist/transports/utils.js +99 -0
- package/dist/transports/utils.js.map +1 -0
- package/dist/transports/xhr.js +1 -1
- package/dist/transports/xhr.js.map +1 -1
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +3 -7
- package/esm/eventbuilder.js.map +1 -1
- package/esm/integrations/trycatch.js +1 -1
- package/esm/integrations/trycatch.js.map +1 -1
- package/esm/transports/base.d.ts.map +1 -1
- package/esm/transports/base.js +9 -7
- package/esm/transports/base.js.map +1 -1
- package/esm/transports/fetch.d.ts +1 -2
- package/esm/transports/fetch.d.ts.map +1 -1
- package/esm/transports/fetch.js +2 -67
- package/esm/transports/fetch.js.map +1 -1
- package/esm/transports/utils.d.ts +48 -0
- package/esm/transports/utils.d.ts.map +1 -0
- package/esm/transports/utils.js +96 -0
- package/esm/transports/utils.js.map +1 -0
- package/esm/transports/xhr.js +1 -1
- package/esm/transports/xhr.js.map +1 -1
- package/package.json +23 -23
package/esm/transports/xhr.js
CHANGED
|
@@ -51,7 +51,7 @@ var XHRTransport = /** @class */ (function (_super) {
|
|
|
51
51
|
};
|
|
52
52
|
request.open('POST', sentryRequest.url);
|
|
53
53
|
for (var header in _this.options.headers) {
|
|
54
|
-
if (_this.options.headers
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) {
|
|
55
55
|
request.setRequestHeader(header, _this.options.headers[header]);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -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;AAC5E,OAAO,EAAS,OAAO,EAAoC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,4BAA4B;AAC5B;IAAkC,gCAAa;IAA/C;;IAoEA,CAAC;IAnEC;;OAEG;IACI,gCAAS,GAAhB,UAAiB,KAAY;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACI,kCAAW,GAAlB,UAAmB,OAAgB;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACK,mCAAY,GAApB,UAAqB,aAA4B,EAAE,eAAgC;QAAnF,iBAgDC;QA/CC,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;YAC3C,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,g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, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Outcome, Response, SentryRequest, Session } from '@sentry/types';\nimport { SentryError, 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 this.recordLostEvent(Outcome.RateLimitBackoff, sentryRequest.type);\n\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\n .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 (Object.prototype.hasOwnProperty.call(this.options.headers, header)) {\n request.setRequestHeader(header, this.options.headers[header]);\n }\n }\n request.send(sentryRequest.body);\n }),\n )\n .then(undefined, reason => {\n // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.\n if (reason instanceof SentryError) {\n this.recordLostEvent(Outcome.QueueOverflow, sentryRequest.type);\n } else {\n this.recordLostEvent(Outcome.NetworkError, sentryRequest.type);\n }\n throw reason;\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.14.2",
|
|
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.14.2",
|
|
20
|
+
"@sentry/types": "6.14.2",
|
|
21
|
+
"@sentry/utils": "6.14.2",
|
|
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.14.2",
|
|
26
26
|
"@types/eslint": "^7.2.0",
|
|
27
27
|
"@types/md5": "2.1.33",
|
|
28
28
|
"btoa": "^1.2.1",
|
|
@@ -54,36 +54,36 @@
|
|
|
54
54
|
"webpack": "^4.30.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
|
-
"build": "run-s build:
|
|
57
|
+
"build": "run-s build:es5 build:esm build:bundle",
|
|
58
58
|
"build:bundle": "rollup --config",
|
|
59
|
-
"build:
|
|
60
|
-
"build:
|
|
61
|
-
"build:dist:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
|
|
62
|
-
"build:es5": "run-s build:dist",
|
|
63
|
-
"build:es5:watch": "run-s build:dist:watch",
|
|
59
|
+
"build:dev": "run-s build:es5 build:esm",
|
|
60
|
+
"build:es5": "tsc -p tsconfig.build.json",
|
|
64
61
|
"build:esm": "tsc -p tsconfig.esm.json",
|
|
62
|
+
"build:watch": "run-p build:es5:watch build:esm:watch build:bundle:watch",
|
|
63
|
+
"build:bundle:watch": "rollup --config --watch",
|
|
64
|
+
"build:dev:watch": "run-p build:es5:watch build:esm:watch",
|
|
65
|
+
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
|
|
65
66
|
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
|
|
66
|
-
"
|
|
67
|
+
"circularDepCheck": "madge --circular src/index.ts",
|
|
67
68
|
"clean": "rimraf dist esm build coverage .rpt2_cache",
|
|
69
|
+
"fix": "run-s fix:eslint fix:prettier",
|
|
70
|
+
"fix:eslint": "eslint . --format stylish --fix",
|
|
71
|
+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
|
|
68
72
|
"link:yarn": "yarn link",
|
|
69
73
|
"lint": "run-s lint:prettier lint:eslint",
|
|
70
|
-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
|
|
71
74
|
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
+
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
|
|
76
|
+
"pack": "npm pack",
|
|
77
|
+
"size:check": "run-p size:check:es5 size:check:es6",
|
|
78
|
+
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
|
|
79
|
+
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
|
|
75
80
|
"test": "run-s test:unit",
|
|
76
81
|
"test:unit": "jest --config test/unit/jest.config.js",
|
|
77
|
-
"test:unit:watch": "jest --config test/unit/jest.config.js --watch",
|
|
78
82
|
"test:integration": "test/integration/run.js",
|
|
79
|
-
"test:integration:watch": "test/integration/run.js --watch",
|
|
80
83
|
"test:integration:checkbrowsers": "node scripts/checkbrowsers.js",
|
|
81
84
|
"test:package": "node test/package/npm-build.js && rm test/package/tmp.js",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
|
|
85
|
-
"pack": "npm pack",
|
|
86
|
-
"circularDepCheck": "madge --circular src/index.ts"
|
|
85
|
+
"test:unit:watch": "jest --config test/unit/jest.config.js --watch",
|
|
86
|
+
"test:integration:watch": "test/integration/run.js --watch"
|
|
87
87
|
},
|
|
88
88
|
"volta": {
|
|
89
89
|
"extends": "../../package.json"
|