@sentry/browser 7.0.0-beta.0 → 7.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/cjs/client.js +125 -102
- package/cjs/client.js.map +1 -1
- package/cjs/eventbuilder.js +225 -165
- package/cjs/eventbuilder.js.map +1 -1
- package/cjs/exports.js +55 -59
- package/cjs/exports.js.map +1 -1
- package/cjs/flags.js +7 -3
- package/cjs/flags.js.map +1 -1
- package/cjs/helpers.js +123 -96
- package/cjs/helpers.js.map +1 -1
- package/cjs/index.js +77 -10
- package/cjs/index.js.map +1 -1
- package/cjs/integrations/breadcrumbs.js +222 -174
- package/cjs/integrations/breadcrumbs.js.map +1 -1
- package/cjs/integrations/dedupe.js +184 -142
- package/cjs/integrations/dedupe.js.map +1 -1
- package/cjs/integrations/globalhandlers.js +211 -170
- package/cjs/integrations/globalhandlers.js.map +1 -1
- package/cjs/integrations/httpcontext.js +51 -0
- package/cjs/integrations/httpcontext.js.map +1 -0
- package/cjs/integrations/index.js +18 -14
- package/cjs/integrations/index.js.map +1 -1
- package/cjs/integrations/linkederrors.js +81 -50
- package/cjs/integrations/linkederrors.js.map +1 -1
- package/cjs/integrations/trycatch.js +247 -208
- package/cjs/integrations/trycatch.js.map +1 -1
- package/cjs/sdk.js +166 -125
- package/cjs/sdk.js.map +1 -1
- package/cjs/stack-parsers.js +143 -93
- package/cjs/stack-parsers.js.map +1 -1
- package/cjs/transports/fetch.js +30 -15
- package/cjs/transports/fetch.js.map +1 -1
- package/cjs/transports/index.js +10 -6
- package/cjs/transports/index.js.map +1 -1
- package/cjs/transports/utils.js +56 -51
- package/cjs/transports/utils.js.map +1 -1
- package/cjs/transports/xhr.js +40 -30
- package/cjs/transports/xhr.js.map +1 -1
- package/esm/client.js +124 -101
- package/esm/client.js.map +1 -1
- package/esm/eventbuilder.js +218 -158
- package/esm/eventbuilder.js.map +1 -1
- package/esm/exports.js +12 -8
- package/esm/exports.js.map +1 -1
- package/esm/flags.js +5 -2
- package/esm/flags.js.map +1 -1
- package/esm/helpers.js +122 -95
- package/esm/helpers.js.map +1 -1
- package/esm/index.js +27 -7
- package/esm/index.js.map +1 -1
- package/esm/integrations/breadcrumbs.js +218 -171
- package/esm/integrations/breadcrumbs.js.map +1 -1
- package/esm/integrations/dedupe.js +181 -139
- package/esm/integrations/dedupe.js.map +1 -1
- package/esm/integrations/globalhandlers.js +208 -167
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/httpcontext.js +49 -0
- package/esm/integrations/httpcontext.js.map +1 -0
- package/esm/integrations/index.js +7 -7
- package/esm/integrations/index.js.map +1 -1
- package/esm/integrations/linkederrors.js +77 -46
- package/esm/integrations/linkederrors.js.map +1 -1
- package/esm/integrations/trycatch.js +244 -205
- package/esm/integrations/trycatch.js.map +1 -1
- package/esm/sdk.js +163 -123
- package/esm/sdk.js.map +1 -1
- package/esm/stack-parsers.js +134 -91
- package/esm/stack-parsers.js.map +1 -1
- package/esm/transports/fetch.js +28 -13
- package/esm/transports/fetch.js.map +1 -1
- package/esm/transports/index.js +3 -3
- package/esm/transports/index.js.map +1 -1
- package/esm/transports/utils.js +55 -50
- package/esm/transports/utils.js.map +1 -1
- package/esm/transports/xhr.js +38 -28
- package/esm/transports/xhr.js.map +1 -1
- package/package.json +4 -4
- package/types/client.d.ts +3 -2
- package/types/client.d.ts.map +1 -1
- package/types/exports.d.ts +3 -4
- package/types/exports.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/integrations/{useragent.d.ts → httpcontext.d.ts} +3 -3
- package/types/integrations/httpcontext.d.ts.map +1 -0
- package/types/integrations/index.d.ts +1 -1
- package/types/integrations/index.d.ts.map +1 -1
- package/types/sdk.d.ts +2 -2
- package/types/sdk.d.ts.map +1 -1
- package/types/transports/fetch.d.ts +3 -5
- package/types/transports/fetch.d.ts.map +1 -1
- package/types/transports/types.d.ts +10 -0
- package/types/transports/types.d.ts.map +1 -0
- package/types/transports/xhr.d.ts +3 -7
- package/types/transports/xhr.d.ts.map +1 -1
- package/cjs/client.d.ts +0 -63
- package/cjs/client.d.ts.map +0 -1
- package/cjs/eventbuilder.d.ts +0 -37
- package/cjs/eventbuilder.d.ts.map +0 -1
- package/cjs/exports.d.ts +0 -11
- package/cjs/exports.d.ts.map +0 -1
- package/cjs/flags.d.ts +0 -3
- package/cjs/flags.d.ts.map +0 -1
- package/cjs/helpers.d.ts +0 -47
- package/cjs/helpers.d.ts.map +0 -1
- package/cjs/index.d.ts +0 -15
- package/cjs/index.d.ts.map +0 -1
- package/cjs/integrations/breadcrumbs.d.ts +0 -46
- package/cjs/integrations/breadcrumbs.d.ts.map +0 -1
- package/cjs/integrations/dedupe.d.ts +0 -21
- package/cjs/integrations/dedupe.d.ts.map +0 -1
- package/cjs/integrations/globalhandlers.d.ts +0 -30
- package/cjs/integrations/globalhandlers.d.ts.map +0 -1
- package/cjs/integrations/index.d.ts +0 -7
- package/cjs/integrations/index.d.ts.map +0 -1
- package/cjs/integrations/linkederrors.d.ts +0 -42
- package/cjs/integrations/linkederrors.d.ts.map +0 -1
- package/cjs/integrations/trycatch.d.ts +0 -33
- package/cjs/integrations/trycatch.d.ts.map +0 -1
- package/cjs/integrations/useragent.d.ts +0 -17
- package/cjs/integrations/useragent.d.ts.map +0 -1
- package/cjs/integrations/useragent.js +0 -40
- package/cjs/integrations/useragent.js.map +0 -1
- package/cjs/sdk.d.ts +0 -112
- package/cjs/sdk.d.ts.map +0 -1
- package/cjs/stack-parsers.d.ts +0 -9
- package/cjs/stack-parsers.d.ts.map +0 -1
- package/cjs/transports/fetch.d.ts +0 -10
- package/cjs/transports/fetch.d.ts.map +0 -1
- package/cjs/transports/index.d.ts +0 -3
- package/cjs/transports/index.d.ts.map +0 -1
- package/cjs/transports/utils.d.ts +0 -48
- package/cjs/transports/utils.d.ts.map +0 -1
- package/cjs/transports/xhr.d.ts +0 -11
- package/cjs/transports/xhr.d.ts.map +0 -1
- package/cjs/version.d.ts +0 -2
- package/cjs/version.d.ts.map +0 -1
- package/cjs/version.js +0 -4
- package/cjs/version.js.map +0 -1
- package/esm/client.d.ts +0 -63
- package/esm/client.d.ts.map +0 -1
- package/esm/eventbuilder.d.ts +0 -37
- package/esm/eventbuilder.d.ts.map +0 -1
- package/esm/exports.d.ts +0 -11
- package/esm/exports.d.ts.map +0 -1
- package/esm/flags.d.ts +0 -3
- package/esm/flags.d.ts.map +0 -1
- package/esm/helpers.d.ts +0 -47
- package/esm/helpers.d.ts.map +0 -1
- package/esm/index.d.ts +0 -15
- package/esm/index.d.ts.map +0 -1
- package/esm/integrations/breadcrumbs.d.ts +0 -46
- package/esm/integrations/breadcrumbs.d.ts.map +0 -1
- package/esm/integrations/dedupe.d.ts +0 -21
- package/esm/integrations/dedupe.d.ts.map +0 -1
- package/esm/integrations/globalhandlers.d.ts +0 -30
- package/esm/integrations/globalhandlers.d.ts.map +0 -1
- package/esm/integrations/index.d.ts +0 -7
- package/esm/integrations/index.d.ts.map +0 -1
- package/esm/integrations/linkederrors.d.ts +0 -42
- package/esm/integrations/linkederrors.d.ts.map +0 -1
- package/esm/integrations/trycatch.d.ts +0 -33
- package/esm/integrations/trycatch.d.ts.map +0 -1
- package/esm/integrations/useragent.d.ts +0 -17
- package/esm/integrations/useragent.d.ts.map +0 -1
- package/esm/integrations/useragent.js +0 -38
- package/esm/integrations/useragent.js.map +0 -1
- package/esm/sdk.d.ts +0 -112
- package/esm/sdk.d.ts.map +0 -1
- package/esm/stack-parsers.d.ts +0 -9
- package/esm/stack-parsers.d.ts.map +0 -1
- package/esm/transports/fetch.d.ts +0 -10
- package/esm/transports/fetch.d.ts.map +0 -1
- package/esm/transports/index.d.ts +0 -3
- package/esm/transports/index.d.ts.map +0 -1
- package/esm/transports/utils.d.ts +0 -48
- package/esm/transports/utils.d.ts.map +0 -1
- package/esm/transports/xhr.d.ts +0 -11
- package/esm/transports/xhr.d.ts.map +0 -1
- package/esm/version.d.ts +0 -2
- package/esm/version.d.ts.map +0 -1
- package/esm/version.js +0 -3
- package/esm/version.js.map +0 -1
- package/types/integrations/useragent.d.ts.map +0 -1
- package/types/version.d.ts +0 -2
- package/types/version.d.ts.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { GlobalHandlers } from './globalhandlers';
|
|
2
|
-
export { TryCatch } from './trycatch';
|
|
3
|
-
export { Breadcrumbs } from './breadcrumbs';
|
|
4
|
-
export { LinkedErrors } from './linkederrors';
|
|
5
|
-
export { UserAgent } from './useragent';
|
|
6
|
-
export { Dedupe } from './dedupe';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';
|
|
2
|
-
interface LinkedErrorsOptions {
|
|
3
|
-
key: string;
|
|
4
|
-
limit: number;
|
|
5
|
-
}
|
|
6
|
-
/** Adds SDK info to an event. */
|
|
7
|
-
export declare class LinkedErrors implements Integration {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
static id: string;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
readonly name: string;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
private readonly _key;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
private readonly _limit;
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
constructor(options?: Partial<LinkedErrorsOptions>);
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
setupOnce(): void;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
export declare function _handler(parser: StackParser, key: string, limit: number, event: Event, hint?: EventHint): Event | null;
|
|
37
|
-
/**
|
|
38
|
-
* JSDOC
|
|
39
|
-
*/
|
|
40
|
-
export declare function _walkErrorTree(parser: StackParser, limit: number, error: ExtendedError, key: string, stack?: Exception[]): Exception[];
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=linkederrors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkederrors.d.ts","sourceRoot":"","sources":["../../../../src/integrations/linkederrors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AASrG,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iCAAiC;AACjC,qBAAa,YAAa,YAAW,WAAW;IAC9C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAmB;IAE/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAElD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IAEtD;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAK7D;;OAEG;IACI,SAAS,IAAI,IAAI;CAUzB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,EACZ,IAAI,CAAC,EAAE,SAAS,GACf,KAAK,GAAG,IAAI,CAOd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,SAAS,EAAO,GACtB,SAAS,EAAE,CAMb"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Integration } from '@sentry/types';
|
|
2
|
-
/** JSDoc */
|
|
3
|
-
interface TryCatchOptions {
|
|
4
|
-
setTimeout: boolean;
|
|
5
|
-
setInterval: boolean;
|
|
6
|
-
requestAnimationFrame: boolean;
|
|
7
|
-
XMLHttpRequest: boolean;
|
|
8
|
-
eventTarget: boolean | string[];
|
|
9
|
-
}
|
|
10
|
-
/** Wrap timer functions and event targets to catch errors and provide better meta data */
|
|
11
|
-
export declare class TryCatch implements Integration {
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
static id: string;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
name: string;
|
|
20
|
-
/** JSDoc */
|
|
21
|
-
private readonly _options;
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
constructor(options?: Partial<TryCatchOptions>);
|
|
26
|
-
/**
|
|
27
|
-
* Wrap timer functions and event targets to catch errors
|
|
28
|
-
* and provide better metadata.
|
|
29
|
-
*/
|
|
30
|
-
setupOnce(): void;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=trycatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trycatch.d.ts","sourceRoot":"","sources":["../../../../src/integrations/trycatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAuC7D,YAAY;AACZ,UAAU,eAAe;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;CACjC;AAED,0FAA0F;AAC1F,qBAAa,QAAS,YAAW,WAAW;IAC1C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAc;IAEtC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAe;IAElC,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C;;OAEG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAWrD;;;OAGG;IACI,SAAS,IAAI,IAAI;CAyBzB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Integration } from '@sentry/types';
|
|
2
|
-
/** UserAgent */
|
|
3
|
-
export declare class UserAgent implements Integration {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDoc
|
|
6
|
-
*/
|
|
7
|
-
static id: string;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
name: string;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
setupOnce(): void;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=useragent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useragent.d.ts","sourceRoot":"","sources":["../../../../src/integrations/useragent.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAKnD,gBAAgB;AAChB,qBAAa,SAAU,YAAW,WAAW;IAC3C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAe;IAEvC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAgB;IAEnC;;OAEG;IACI,SAAS,IAAI,IAAI;CAyBzB"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
|
|
2
|
-
import { getGlobalObject } from '@sentry/utils';
|
|
3
|
-
const global = getGlobalObject();
|
|
4
|
-
/** UserAgent */
|
|
5
|
-
export class UserAgent {
|
|
6
|
-
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* @inheritDoc
|
|
9
|
-
*/
|
|
10
|
-
this.name = UserAgent.id;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
setupOnce() {
|
|
16
|
-
addGlobalEventProcessor((event) => {
|
|
17
|
-
if (getCurrentHub().getIntegration(UserAgent)) {
|
|
18
|
-
// if none of the information we want exists, don't bother
|
|
19
|
-
if (!global.navigator && !global.location && !global.document) {
|
|
20
|
-
return event;
|
|
21
|
-
}
|
|
22
|
-
// grab as much info as exists and add it to the event
|
|
23
|
-
const url = (event.request && event.request.url) || (global.location && global.location.href);
|
|
24
|
-
const { referrer } = global.document || {};
|
|
25
|
-
const { userAgent } = global.navigator || {};
|
|
26
|
-
const headers = Object.assign(Object.assign(Object.assign({}, (event.request && event.request.headers)), (referrer && { Referer: referrer })), (userAgent && { 'User-Agent': userAgent }));
|
|
27
|
-
const request = Object.assign(Object.assign({}, (url && { url })), { headers });
|
|
28
|
-
return Object.assign(Object.assign({}, event), { request });
|
|
29
|
-
}
|
|
30
|
-
return event;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
UserAgent.id = 'UserAgent';
|
|
38
|
-
//# sourceMappingURL=useragent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useragent.js","sourceRoot":"","sources":["../../../../src/integrations/useragent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,GAAG,eAAe,EAAU,CAAC;AAEzC,gBAAgB;AAChB,MAAM,OAAO,SAAS;IAAtB;QAME;;WAEG;QACI,SAAI,GAAW,SAAS,CAAC,EAAE,CAAC;IA8BrC,CAAC;IA5BC;;OAEG;IACI,SAAS;QACd,uBAAuB,CAAC,CAAC,KAAY,EAAE,EAAE;YACvC,IAAI,aAAa,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;gBAC7C,0DAA0D;gBAC1D,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAC7D,OAAO,KAAK,CAAC;iBACd;gBAED,sDAAsD;gBACtD,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC9F,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;gBAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;gBAE7C,MAAM,OAAO,iDACR,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GACxC,CAAC,QAAQ,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GACnC,CAAC,SAAS,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAC9C,CAAC;gBACF,MAAM,OAAO,mCAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,KAAE,OAAO,GAAE,CAAC;gBAEjD,uCAAY,KAAK,KAAE,OAAO,IAAG;aAC9B;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;;AArCD;;GAEG;AACW,YAAE,GAAW,WAAW,CAAC","sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, Integration } from '@sentry/types';\nimport { getGlobalObject } from '@sentry/utils';\n\nconst global = getGlobalObject<Window>();\n\n/** UserAgent */\nexport class UserAgent implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'UserAgent';\n\n /**\n * @inheritDoc\n */\n public name: string = UserAgent.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event) => {\n if (getCurrentHub().getIntegration(UserAgent)) {\n // if none of the information we want exists, don't bother\n if (!global.navigator && !global.location && !global.document) {\n return event;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (global.location && global.location.href);\n const { referrer } = global.document || {};\n const { userAgent } = global.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...(url && { url }), headers };\n\n return { ...event, request };\n }\n return event;\n });\n }\n}\n"]}
|
package/esm/sdk.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { Hub, Integrations as CoreIntegrations } from '@sentry/core';
|
|
2
|
-
import { BrowserOptions } from './client';
|
|
3
|
-
import { ReportDialogOptions } from './helpers';
|
|
4
|
-
import { Breadcrumbs, Dedupe, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';
|
|
5
|
-
export declare const defaultIntegrations: (CoreIntegrations.FunctionToString | CoreIntegrations.InboundFilters | GlobalHandlers | TryCatch | Breadcrumbs | LinkedErrors | UserAgent | Dedupe)[];
|
|
6
|
-
/**
|
|
7
|
-
* The Sentry Browser SDK Client.
|
|
8
|
-
*
|
|
9
|
-
* To use this SDK, call the {@link init} function as early as possible when
|
|
10
|
-
* loading the web page. To set context information or send manual events, use
|
|
11
|
-
* the provided methods.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
*
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* import { init } from '@sentry/browser';
|
|
18
|
-
*
|
|
19
|
-
* init({
|
|
20
|
-
* dsn: '__DSN__',
|
|
21
|
-
* // ...
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* import { configureScope } from '@sentry/browser';
|
|
29
|
-
* configureScope((scope: Scope) => {
|
|
30
|
-
* scope.setExtra({ battery: 0.7 });
|
|
31
|
-
* scope.setTag({ user_mode: 'admin' });
|
|
32
|
-
* scope.setUser({ id: '4711' });
|
|
33
|
-
* });
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* import { addBreadcrumb } from '@sentry/browser';
|
|
40
|
-
* addBreadcrumb({
|
|
41
|
-
* message: 'My Breadcrumb',
|
|
42
|
-
* // ...
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
*
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* import * as Sentry from '@sentry/browser';
|
|
51
|
-
* Sentry.captureMessage('Hello, world!');
|
|
52
|
-
* Sentry.captureException(new Error('Good bye'));
|
|
53
|
-
* Sentry.captureEvent({
|
|
54
|
-
* message: 'Manual',
|
|
55
|
-
* stacktrace: [
|
|
56
|
-
* // ...
|
|
57
|
-
* ],
|
|
58
|
-
* });
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @see {@link BrowserOptions} for documentation on configuration options.
|
|
62
|
-
*/
|
|
63
|
-
export declare function init(options?: BrowserOptions): void;
|
|
64
|
-
/**
|
|
65
|
-
* Present the user with a report dialog.
|
|
66
|
-
*
|
|
67
|
-
* @param options Everything is optional, we try to fetch all info need from the global scope.
|
|
68
|
-
*/
|
|
69
|
-
export declare function showReportDialog(options?: ReportDialogOptions, hub?: Hub): void;
|
|
70
|
-
/**
|
|
71
|
-
* This is the getter for lastEventId.
|
|
72
|
-
*
|
|
73
|
-
* @returns The last event id of a captured event.
|
|
74
|
-
*/
|
|
75
|
-
export declare function lastEventId(): string | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* This function is here to be API compatible with the loader.
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
export declare function forceLoad(): void;
|
|
81
|
-
/**
|
|
82
|
-
* This function is here to be API compatible with the loader.
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
export declare function onLoad(callback: () => void): void;
|
|
86
|
-
/**
|
|
87
|
-
* Call `flush()` on the current client, if there is one. See {@link Client.flush}.
|
|
88
|
-
*
|
|
89
|
-
* @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
|
|
90
|
-
* the client to wait until all events are sent before resolving the promise.
|
|
91
|
-
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
|
92
|
-
* doesn't (or if there's no client defined).
|
|
93
|
-
*/
|
|
94
|
-
export declare function flush(timeout?: number): PromiseLike<boolean>;
|
|
95
|
-
/**
|
|
96
|
-
* Call `close()` on the current client, if there is one. See {@link Client.close}.
|
|
97
|
-
*
|
|
98
|
-
* @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
|
|
99
|
-
* parameter will cause the client to wait until all events are sent before disabling itself.
|
|
100
|
-
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
|
101
|
-
* doesn't (or if there's no client defined).
|
|
102
|
-
*/
|
|
103
|
-
export declare function close(timeout?: number): PromiseLike<boolean>;
|
|
104
|
-
/**
|
|
105
|
-
* Wrap code within a try/catch block so the SDK is able to capture errors.
|
|
106
|
-
*
|
|
107
|
-
* @param fn A function to wrap.
|
|
108
|
-
*
|
|
109
|
-
* @returns The result of wrapped function call.
|
|
110
|
-
*/
|
|
111
|
-
export declare function wrap(fn: (...args: any) => any): any;
|
|
112
|
-
//# sourceMappingURL=sdk.d.ts.map
|
package/esm/sdk.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,GAAG,EAEH,YAAY,IAAI,gBAAgB,EACjC,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAuC,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAwB,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIxG,eAAO,MAAM,mBAAmB,uJAS/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CA8BvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,EAAE,GAAG,GAAE,GAAqB,GAAG,IAAI,CAyCpG;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAO5D;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAO5D;AAED;;;;;;GAMG;AAEH,wBAAgB,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,CAEnD"}
|
package/esm/stack-parsers.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StackLineParser } from '@sentry/types';
|
|
2
|
-
export declare const chromeStackLineParser: StackLineParser;
|
|
3
|
-
export declare const geckoStackLineParser: StackLineParser;
|
|
4
|
-
export declare const winjsStackLineParser: StackLineParser;
|
|
5
|
-
export declare const opera10StackLineParser: StackLineParser;
|
|
6
|
-
export declare const opera11StackLineParser: StackLineParser;
|
|
7
|
-
export declare const defaultStackLineParsers: StackLineParser[];
|
|
8
|
-
export declare const defaultStackParser: import("@sentry/types").StackParser;
|
|
9
|
-
//# sourceMappingURL=stack-parsers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack-parsers.d.ts","sourceRoot":"","sources":["../../../src/stack-parsers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAqB,MAAM,eAAe,CAAC;AA+D/E,eAAO,MAAM,qBAAqB,EAAE,eAA2C,CAAC;AAoChF,eAAO,MAAM,oBAAoB,EAAE,eAAyC,CAAC;AAa7E,eAAO,MAAM,oBAAoB,EAAE,eAAyC,CAAC;AAS7E,eAAO,MAAM,sBAAsB,EAAE,eAA6C,CAAC;AAUnF,eAAO,MAAM,sBAAsB,EAAE,eAA6C,CAAC;AAEnF,eAAO,MAAM,uBAAuB,mBAAsE,CAAC;AAE3G,eAAO,MAAM,kBAAkB,qCAAgD,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseTransportOptions, Transport } from '@sentry/types';
|
|
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 makeFetchTransport(options: FetchTransportOptions, nativeFetch?: FetchImpl): Transport;
|
|
10
|
-
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAEhH,OAAO,EAAE,SAAS,EAAgC,MAAM,SAAS,CAAC;AAElE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,cAAc,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,GAAE,SAA0C,GACtD,SAAS,CAkBX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -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,CAiB1D"}
|
package/esm/transports/xhr.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseTransportOptions, Transport } from '@sentry/types';
|
|
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 makeXHRTransport(options: XHRTransportOptions): Transport;
|
|
11
|
-
//# sourceMappingURL=xhr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../../src/transports/xhr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAahH,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,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAgCxE"}
|
package/esm/version.d.ts
DELETED
package/esm/version.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,8BAA8B,CAAC"}
|
package/esm/version.js
DELETED
package/esm/version.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,MAAM,CAAC,MAAM,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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useragent.d.ts","sourceRoot":"","sources":["../../../../src/integrations/useragent.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAKnD,gBAAgB;AAChB,qBAAa,SAAU,YAAW,WAAW;IAC3C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAe;IAEvC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAgB;IAEnC;;OAEG;IACI,SAAS,IAAI,IAAI;CAyBzB"}
|
package/types/version.d.ts
DELETED
package/types/version.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,8BAA8B,CAAC"}
|