@crowdin/app-project-module 0.30.2 → 0.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.
@@ -290,10 +290,11 @@ function convertClientConfig(clientConfig) {
290
290
  const clientId = clientConfig.clientId || process.env.CROWDIN_CLIENT_ID;
291
291
  const clientSecret = clientConfig.clientSecret || process.env.CROWDIN_CLIENT_SECRET;
292
292
  const port = clientConfig.port || process.env.PORT || 3000;
293
+ const sentryDsn = clientConfig.sentryDsn || process.env.SENTRY_DSN;
293
294
  if (!baseUrl || !clientId || !clientSecret) {
294
295
  throw new Error('One of following parameters are not defined [baseUrl, clientId, clientSecret]');
295
296
  }
296
- return Object.assign(Object.assign({}, clientConfig), { baseUrl: baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl, clientId,
297
+ return Object.assign(Object.assign({}, clientConfig), { sentryDsn, baseUrl: baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl, clientId,
297
298
  clientSecret, port: Number(port), dbFolder: clientConfig.dbFolder || (0, path_1.join)(process.cwd(), 'db'), imagePath: clientConfig.imagePath || (0, path_1.join)(process.cwd(), 'logo.png') });
298
299
  }
299
300
  exports.convertClientConfig = convertClientConfig;
@@ -18,4 +18,31 @@
18
18
  margin-left: 10px;
19
19
  }
20
20
  </style>
21
- </head>
21
+ {{#if sentryData}}
22
+ <script
23
+ src="https://browser.sentry-cdn.com/7.60.0/bundle.replay.min.js"
24
+ integrity="sha384-N+VZps2PwFdv9LugkPA8nw+SMI1mGJG7IDe49jaxZlWDDJhHQ+SHakMpwhLQLAka"
25
+ crossorigin="anonymous"
26
+ ></script>
27
+ <script>
28
+ Sentry.init({
29
+ dsn: "{{sentryData.dsn}}",
30
+ environment: "frontend",
31
+ replaysSessionSampleRate: 0,
32
+ replaysOnErrorSampleRate: 1.0,
33
+ integrations: [new Sentry.Replay()],
34
+ });
35
+
36
+ Sentry.configureScope(function(scope) {
37
+ scope.setTag("identifier", "{{sentryData.appIdentifier}}");
38
+
39
+ AP.getContext(contextData => {
40
+ const { user_id, ...rest } = contextData;
41
+
42
+ user_id && scope.setUser({ id: user_id });
43
+ scope.setTags(rest);
44
+ });
45
+ });
46
+ </script>
47
+ {{/if}}
48
+ </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.30.2",
3
+ "version": "0.31.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -32,9 +32,9 @@
32
32
  "devDependencies": {
33
33
  "@babel/preset-react": "^7.22.3",
34
34
  "@emotion/react": "^11.11.1",
35
- "@emotion/styled": "^11.10.6",
35
+ "@emotion/styled": "^11.11.0",
36
36
  "@mui/icons-material": "^5.11.16",
37
- "@mui/material": "^5.11.12",
37
+ "@mui/material": "^5.14.2",
38
38
  "@rjsf/core": "^5.7.3",
39
39
  "@rjsf/mui": "^5.7.3",
40
40
  "@rjsf/utils": "^5.7.3",
@@ -44,14 +44,14 @@
44
44
  "@rollup/plugin-json": "^6.0.0",
45
45
  "@rollup/plugin-node-resolve": "^15.0.1",
46
46
  "@rollup/plugin-replace": "^5.0.2",
47
- "@rollup/plugin-terser": "^0.4.0",
47
+ "@rollup/plugin-terser": "^0.4.3",
48
48
  "@types/amqplib": "^0.10.1",
49
49
  "@types/crypto-js": "^4.1.1",
50
50
  "@types/express": "4.17.17",
51
51
  "@types/express-handlebars": "^5.3.1",
52
52
  "@types/jest": "^29.5.2",
53
53
  "@types/node": "^12.20.55",
54
- "@types/node-cron": "^3.0.7",
54
+ "@types/node-cron": "^3.0.8",
55
55
  "@types/swagger-jsdoc": "^6.0.1",
56
56
  "@typescript-eslint/eslint-plugin": "^2.3.1",
57
57
  "@typescript-eslint/parser": "^2.3.1",