@commercetools-frontend/sentry 24.11.0 → 24.13.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,6 +5,7 @@ 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');
8
9
  var Sentry = require('@sentry/react');
9
10
  var browser = require('@sentry/browser');
10
11
  var history = require('@commercetools-frontend/browser-history');
@@ -39,12 +40,13 @@ function _interopNamespace(e) {
39
40
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
40
41
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
41
42
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
43
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
42
44
  var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
43
45
  var history__default = /*#__PURE__*/_interopDefault(history);
44
46
  var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
45
47
 
46
48
  // NOTE: This string will be replaced on build time with the package version.
47
- var version = "24.11.0";
49
+ var version = "24.13.0";
48
50
 
49
51
  const makeErrorToCapture = error => {
50
52
  if (error instanceof Error) return error;
@@ -91,10 +93,11 @@ const redactUnsafeEventFields = event => {
91
93
  };
92
94
  const boot = () => {
93
95
  if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
96
+ var _context2;
94
97
  Sentry__namespace.init({
95
98
  dsn: window.app.trackingSentry,
96
99
  release: window.app.revision,
97
- environment: `${window.app.env}-${window.app.location}`,
100
+ environment: _concatInstanceProperty__default["default"](_context2 = "".concat(window.app.env, "-")).call(_context2, window.app.location),
98
101
  // In order to reduce the noise in sentry we only track errors that come
99
102
  // from our code and ignore errors that come from other services
100
103
  // https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
@@ -121,7 +124,7 @@ const boot = () => {
121
124
  const sentryScope = Sentry__namespace.getCurrentScope();
122
125
  sentryScope.setTag('role', 'frontend');
123
126
  sentryScope.setTag('applicationName', window.app.applicationName);
124
- sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
127
+ sentryScope.setTag('service', "merchant-center-frontend-".concat(window.app.applicationName));
125
128
  }
126
129
  };
127
130
  const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
@@ -131,7 +134,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
131
134
  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');
132
135
  }
133
136
  if (isEnabled) {
134
- if (extraInfo?.extra) {
137
+ if (extraInfo !== null && extraInfo !== void 0 && extraInfo.extra) {
135
138
  if (isExtraAsObject(extraInfo.extra)) {
136
139
  // See https://docs.sentry.io/platforms/javascript/react/
137
140
  Sentry__namespace.setExtras(extraInfo.extra);
@@ -152,7 +155,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
152
155
  // The error stack should be available in Sentry, so there is no
153
156
  // need to print it in the console as well.
154
157
  // We just notify that an error occurred and provide the error ID.
155
- console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
158
+ console.error("[SENTRY]: An error occured (ID: ".concat(errorId, ")."));
156
159
  return errorId;
157
160
  }
158
161
  console.error('[SENTRY]:', error);
@@ -179,7 +182,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
179
182
  // by only sending the domain part or the email
180
183
  const emailTld = _this.props.user.email.split('@')[1];
181
184
  Sentry__namespace.setUser({
182
- email: `xxx@${emailTld}`,
185
+ email: "xxx@".concat(emailTld),
183
186
  id: _this.props.user.id
184
187
  });
185
188
  }
@@ -5,6 +5,7 @@ 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');
8
9
  var Sentry = require('@sentry/react');
9
10
  var browser = require('@sentry/browser');
10
11
  var history = require('@commercetools-frontend/browser-history');
@@ -39,12 +40,13 @@ function _interopNamespace(e) {
39
40
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
40
41
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
41
42
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
43
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
42
44
  var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
43
45
  var history__default = /*#__PURE__*/_interopDefault(history);
44
46
  var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
45
47
 
46
48
  // NOTE: This string will be replaced on build time with the package version.
47
- var version = "24.11.0";
49
+ var version = "24.13.0";
48
50
 
49
51
  const makeErrorToCapture = error => {
50
52
  if (error instanceof Error) return error;
@@ -91,10 +93,11 @@ const redactUnsafeEventFields = event => {
91
93
  };
92
94
  const boot = () => {
93
95
  if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
96
+ var _context2;
94
97
  Sentry__namespace.init({
95
98
  dsn: window.app.trackingSentry,
96
99
  release: window.app.revision,
97
- environment: `${window.app.env}-${window.app.location}`,
100
+ environment: _concatInstanceProperty__default["default"](_context2 = "".concat(window.app.env, "-")).call(_context2, window.app.location),
98
101
  // In order to reduce the noise in sentry we only track errors that come
99
102
  // from our code and ignore errors that come from other services
100
103
  // https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
@@ -121,7 +124,7 @@ const boot = () => {
121
124
  const sentryScope = Sentry__namespace.getCurrentScope();
122
125
  sentryScope.setTag('role', 'frontend');
123
126
  sentryScope.setTag('applicationName', window.app.applicationName);
124
- sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
127
+ sentryScope.setTag('service', "merchant-center-frontend-".concat(window.app.applicationName));
125
128
  }
126
129
  };
127
130
  const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
@@ -131,7 +134,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
131
134
  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');
132
135
  }
133
136
  if (isEnabled) {
134
- if (extraInfo?.extra) {
137
+ if (extraInfo !== null && extraInfo !== void 0 && extraInfo.extra) {
135
138
  if (isExtraAsObject(extraInfo.extra)) {
136
139
  // See https://docs.sentry.io/platforms/javascript/react/
137
140
  Sentry__namespace.setExtras(extraInfo.extra);
@@ -152,7 +155,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
152
155
  // The error stack should be available in Sentry, so there is no
153
156
  // need to print it in the console as well.
154
157
  // We just notify that an error occurred and provide the error ID.
155
- console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
158
+ console.error("[SENTRY]: An error occured (ID: ".concat(errorId, ")."));
156
159
  return errorId;
157
160
  }
158
161
  console.error('[SENTRY]:', error);
@@ -179,7 +182,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
179
182
  // by only sending the domain part or the email
180
183
  const emailTld = _this.props.user.email.split('@')[1];
181
184
  Sentry__namespace.setUser({
182
- email: `xxx@${emailTld}`,
185
+ email: "xxx@".concat(emailTld),
183
186
  id: _this.props.user.id
184
187
  });
185
188
  }
@@ -1,6 +1,7 @@
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';
4
5
  import * as Sentry from '@sentry/react';
5
6
  import { globalHandlersIntegration } from '@sentry/browser';
6
7
  import history from '@commercetools-frontend/browser-history';
@@ -13,7 +14,7 @@ import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
13
14
  import { PureComponent, Component } from 'react';
14
15
 
15
16
  // NOTE: This string will be replaced on build time with the package version.
16
- var version = "24.11.0";
17
+ var version = "24.13.0";
17
18
 
18
19
  const makeErrorToCapture = error => {
19
20
  if (error instanceof Error) return error;
@@ -60,10 +61,11 @@ const redactUnsafeEventFields = event => {
60
61
  };
61
62
  const boot = () => {
62
63
  if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
64
+ var _context2;
63
65
  Sentry.init({
64
66
  dsn: window.app.trackingSentry,
65
67
  release: window.app.revision,
66
- environment: `${window.app.env}-${window.app.location}`,
68
+ environment: _concatInstanceProperty(_context2 = "".concat(window.app.env, "-")).call(_context2, window.app.location),
67
69
  // In order to reduce the noise in sentry we only track errors that come
68
70
  // from our code and ignore errors that come from other services
69
71
  // https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
@@ -90,7 +92,7 @@ const boot = () => {
90
92
  const sentryScope = Sentry.getCurrentScope();
91
93
  sentryScope.setTag('role', 'frontend');
92
94
  sentryScope.setTag('applicationName', window.app.applicationName);
93
- sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
95
+ sentryScope.setTag('service', "merchant-center-frontend-".concat(window.app.applicationName));
94
96
  }
95
97
  };
96
98
  const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
@@ -100,7 +102,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
100
102
  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');
101
103
  }
102
104
  if (isEnabled) {
103
- if (extraInfo?.extra) {
105
+ if (extraInfo !== null && extraInfo !== void 0 && extraInfo.extra) {
104
106
  if (isExtraAsObject(extraInfo.extra)) {
105
107
  // See https://docs.sentry.io/platforms/javascript/react/
106
108
  Sentry.setExtras(extraInfo.extra);
@@ -121,7 +123,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
121
123
  // The error stack should be available in Sentry, so there is no
122
124
  // need to print it in the console as well.
123
125
  // We just notify that an error occurred and provide the error ID.
124
- console.error(`[SENTRY]: An error occured (ID: ${errorId}).`);
126
+ console.error("[SENTRY]: An error occured (ID: ".concat(errorId, ")."));
125
127
  return errorId;
126
128
  }
127
129
  console.error('[SENTRY]:', error);
@@ -148,7 +150,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
148
150
  // by only sending the domain part or the email
149
151
  const emailTld = _this.props.user.email.split('@')[1];
150
152
  Sentry.setUser({
151
- email: `xxx@${emailTld}`,
153
+ email: "xxx@".concat(emailTld),
152
154
  id: _this.props.user.id
153
155
  });
154
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/sentry",
3
- "version": "24.11.0",
3
+ "version": "24.13.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": "24.11.0",
34
- "@commercetools-frontend/constants": "24.11.0",
33
+ "@commercetools-frontend/browser-history": "24.13.0",
34
+ "@commercetools-frontend/constants": "24.13.0",
35
35
  "@sentry/browser": "7.120.4",
36
36
  "@sentry/react": "7.120.4",
37
37
  "@sentry/types": "7.120.4",