@commercetools-frontend/sentry 22.30.2 → 22.31.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.
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
6
6
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
7
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
8
|
var Sentry = require('@sentry/react');
|
|
10
9
|
var browser = require('@sentry/browser');
|
|
11
10
|
var history = require('@commercetools-frontend/browser-history');
|
|
@@ -41,14 +40,13 @@ function _interopNamespace(e) {
|
|
|
41
40
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
42
41
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
43
42
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
44
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
45
43
|
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
46
44
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
47
45
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
48
46
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
49
47
|
|
|
50
48
|
// NOTE: This string will be replaced on build time with the package version.
|
|
51
|
-
var version = "22.
|
|
49
|
+
var version = "22.31.0";
|
|
52
50
|
|
|
53
51
|
const makeErrorToCapture = error => {
|
|
54
52
|
if (error instanceof Error) return error;
|
|
@@ -95,11 +93,10 @@ const redactUnsafeEventFields = event => {
|
|
|
95
93
|
};
|
|
96
94
|
const boot = () => {
|
|
97
95
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
98
|
-
var _context2;
|
|
99
96
|
Sentry__namespace.init({
|
|
100
97
|
dsn: window.app.trackingSentry,
|
|
101
98
|
release: window.app.revision,
|
|
102
|
-
environment:
|
|
99
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
103
100
|
// In order to reduce the noise in sentry we only track errors that come
|
|
104
101
|
// from our code and ignore errors that come from other services
|
|
105
102
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -135,7 +132,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
135
132
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
136
133
|
}
|
|
137
134
|
if (isEnabled) {
|
|
138
|
-
if (extraInfo
|
|
135
|
+
if (extraInfo?.extra) {
|
|
139
136
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
140
137
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
141
138
|
Sentry__namespace.setExtras(extraInfo.extra);
|
|
@@ -149,7 +146,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
149
146
|
// The error stack should be available in Sentry, so there is no
|
|
150
147
|
// need to print it in the console as well.
|
|
151
148
|
// We just notify that an error occurred and provide the error ID.
|
|
152
|
-
console.error(
|
|
149
|
+
console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
|
|
153
150
|
return errorId;
|
|
154
151
|
}
|
|
155
152
|
console.error('[SENTRY]:', error);
|
|
@@ -178,7 +175,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
178
175
|
// by only sending the domain part or the email
|
|
179
176
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
180
177
|
Sentry__namespace.setUser({
|
|
181
|
-
email:
|
|
178
|
+
email: `xxx@${emailTld}`,
|
|
182
179
|
id: _this.props.user.id
|
|
183
180
|
});
|
|
184
181
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
6
6
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
7
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
8
|
var Sentry = require('@sentry/react');
|
|
10
9
|
var browser = require('@sentry/browser');
|
|
11
10
|
var history = require('@commercetools-frontend/browser-history');
|
|
@@ -41,13 +40,12 @@ function _interopNamespace(e) {
|
|
|
41
40
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
42
41
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
43
42
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
44
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
45
43
|
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
46
44
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
47
45
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
48
46
|
|
|
49
47
|
// NOTE: This string will be replaced on build time with the package version.
|
|
50
|
-
var version = "22.
|
|
48
|
+
var version = "22.31.0";
|
|
51
49
|
|
|
52
50
|
const makeErrorToCapture = error => {
|
|
53
51
|
if (error instanceof Error) return error;
|
|
@@ -94,11 +92,10 @@ const redactUnsafeEventFields = event => {
|
|
|
94
92
|
};
|
|
95
93
|
const boot = () => {
|
|
96
94
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
97
|
-
var _context2;
|
|
98
95
|
Sentry__namespace.init({
|
|
99
96
|
dsn: window.app.trackingSentry,
|
|
100
97
|
release: window.app.revision,
|
|
101
|
-
environment:
|
|
98
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
102
99
|
// In order to reduce the noise in sentry we only track errors that come
|
|
103
100
|
// from our code and ignore errors that come from other services
|
|
104
101
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -134,7 +131,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
134
131
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
135
132
|
}
|
|
136
133
|
if (isEnabled) {
|
|
137
|
-
if (extraInfo
|
|
134
|
+
if (extraInfo?.extra) {
|
|
138
135
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
139
136
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
140
137
|
Sentry__namespace.setExtras(extraInfo.extra);
|
|
@@ -148,7 +145,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
148
145
|
// The error stack should be available in Sentry, so there is no
|
|
149
146
|
// need to print it in the console as well.
|
|
150
147
|
// We just notify that an error occurred and provide the error ID.
|
|
151
|
-
console.error(
|
|
148
|
+
console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
|
|
152
149
|
return errorId;
|
|
153
150
|
}
|
|
154
151
|
console.error('[SENTRY]:', error);
|
|
@@ -177,7 +174,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
177
174
|
// by only sending the domain part or the email
|
|
178
175
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
179
176
|
Sentry__namespace.setUser({
|
|
180
|
-
email:
|
|
177
|
+
email: `xxx@${emailTld}`,
|
|
181
178
|
id: _this.props.user.id
|
|
182
179
|
});
|
|
183
180
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
2
2
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
3
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
4
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
5
4
|
import * as Sentry from '@sentry/react';
|
|
6
5
|
import { BrowserTracing } from '@sentry/browser';
|
|
7
6
|
import history from '@commercetools-frontend/browser-history';
|
|
@@ -15,7 +14,7 @@ import _pt from 'prop-types';
|
|
|
15
14
|
import { PureComponent, Component } from 'react';
|
|
16
15
|
|
|
17
16
|
// NOTE: This string will be replaced on build time with the package version.
|
|
18
|
-
var version = "22.
|
|
17
|
+
var version = "22.31.0";
|
|
19
18
|
|
|
20
19
|
const makeErrorToCapture = error => {
|
|
21
20
|
if (error instanceof Error) return error;
|
|
@@ -62,11 +61,10 @@ const redactUnsafeEventFields = event => {
|
|
|
62
61
|
};
|
|
63
62
|
const boot = () => {
|
|
64
63
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
65
|
-
var _context2;
|
|
66
64
|
Sentry.init({
|
|
67
65
|
dsn: window.app.trackingSentry,
|
|
68
66
|
release: window.app.revision,
|
|
69
|
-
environment:
|
|
67
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
70
68
|
// In order to reduce the noise in sentry we only track errors that come
|
|
71
69
|
// from our code and ignore errors that come from other services
|
|
72
70
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -102,7 +100,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
102
100
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
103
101
|
}
|
|
104
102
|
if (isEnabled) {
|
|
105
|
-
if (extraInfo
|
|
103
|
+
if (extraInfo?.extra) {
|
|
106
104
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
107
105
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
108
106
|
Sentry.setExtras(extraInfo.extra);
|
|
@@ -116,7 +114,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
116
114
|
// The error stack should be available in Sentry, so there is no
|
|
117
115
|
// need to print it in the console as well.
|
|
118
116
|
// We just notify that an error occurred and provide the error ID.
|
|
119
|
-
console.error(
|
|
117
|
+
console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
|
|
120
118
|
return errorId;
|
|
121
119
|
}
|
|
122
120
|
console.error('[SENTRY]:', error);
|
|
@@ -145,7 +143,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
145
143
|
// by only sending the domain part or the email
|
|
146
144
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
147
145
|
Sentry.setUser({
|
|
148
|
-
email:
|
|
146
|
+
email: `xxx@${emailTld}`,
|
|
149
147
|
id: _this.props.user.id
|
|
150
148
|
});
|
|
151
149
|
}
|
|
@@ -6,6 +6,10 @@ type SentryUser = {
|
|
|
6
6
|
type Props = {
|
|
7
7
|
user?: SentryUser;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* This component will let sentry know if any information about the user has
|
|
11
|
+
* changed.
|
|
12
|
+
*/
|
|
9
13
|
declare class SentryUserTracker extends PureComponent<Props> {
|
|
10
14
|
static displayName: string;
|
|
11
15
|
componentDidMount(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/sentry",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.31.0",
|
|
4
4
|
"description": "Components to set up Sentry for a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.22.15",
|
|
32
32
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
33
|
-
"@commercetools-frontend/browser-history": "22.
|
|
34
|
-
"@commercetools-frontend/constants": "22.
|
|
33
|
+
"@commercetools-frontend/browser-history": "22.31.0",
|
|
34
|
+
"@commercetools-frontend/constants": "22.31.0",
|
|
35
35
|
"@sentry/browser": "7.117.0",
|
|
36
36
|
"@sentry/react": "7.117.0",
|
|
37
37
|
"@sentry/types": "7.117.0",
|