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 backend_1 = require("./backend");
|
6 | var helpers_1 = require("./helpers");
|
7 | var integrations_1 = require("./integrations");
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | var BrowserClient = (function (_super) {
|
15 | tslib_1.__extends(BrowserClient, _super);
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | function BrowserClient(options) {
|
22 | if (options === void 0) { options = {}; }
|
23 | var _this = this;
|
24 | options._metadata = options._metadata || {};
|
25 | options._metadata.sdk = options._metadata.sdk || {
|
26 | name: 'sentry.javascript.browser',
|
27 | packages: [
|
28 | {
|
29 | name: 'npm:@sentry/browser',
|
30 | version: core_1.SDK_VERSION,
|
31 | },
|
32 | ],
|
33 | version: core_1.SDK_VERSION,
|
34 | };
|
35 | _this = _super.call(this, backend_1.BrowserBackend, options) || this;
|
36 | return _this;
|
37 | }
|
38 | |
39 |
|
40 |
|
41 |
|
42 |
|
43 | BrowserClient.prototype.showReportDialog = function (options) {
|
44 | if (options === void 0) { options = {}; }
|
45 |
|
46 | var document = utils_1.getGlobalObject().document;
|
47 | if (!document) {
|
48 | return;
|
49 | }
|
50 | if (!this._isEnabled()) {
|
51 | utils_1.logger.error('Trying to call showReportDialog with Sentry Client disabled');
|
52 | return;
|
53 | }
|
54 | helpers_1.injectReportDialog(tslib_1.__assign(tslib_1.__assign({}, options), { dsn: options.dsn || this.getDsn() }));
|
55 | };
|
56 | |
57 |
|
58 |
|
59 | BrowserClient.prototype._prepareEvent = function (event, scope, hint) {
|
60 | event.platform = event.platform || 'javascript';
|
61 | return _super.prototype._prepareEvent.call(this, event, scope, hint);
|
62 | };
|
63 | |
64 |
|
65 |
|
66 | BrowserClient.prototype._sendEvent = function (event) {
|
67 | var integration = this.getIntegration(integrations_1.Breadcrumbs);
|
68 | if (integration) {
|
69 | integration.addSentryBreadcrumb(event);
|
70 | }
|
71 | _super.prototype._sendEvent.call(this, event);
|
72 | };
|
73 | return BrowserClient;
|
74 | }(core_1.BaseClient));
|
75 | exports.BrowserClient = BrowserClient;
|
76 |
|
\ | No newline at end of file |