@strapi/plugin-sentry 4.17.0 → 4.18.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.
- package/dist/_chunks/{dk-00b47489.js → dk-ACiZv75I.js} +1 -1
- package/dist/_chunks/dk-ACiZv75I.js.map +1 -0
- package/dist/_chunks/{dk-b05451b4.mjs → dk-Ht5BJvwV.mjs} +1 -1
- package/dist/_chunks/dk-Ht5BJvwV.mjs.map +1 -0
- package/dist/_chunks/{en-70258e03.mjs → en--hlKpBzk.mjs} +1 -1
- package/dist/_chunks/en--hlKpBzk.mjs.map +1 -0
- package/dist/_chunks/{en-2dbaca4a.js → en-vyox7ZSC.js} +1 -1
- package/dist/_chunks/en-vyox7ZSC.js.map +1 -0
- package/dist/_chunks/{es-0812c06d.mjs → es-21jfFVzQ.mjs} +1 -1
- package/dist/_chunks/es-21jfFVzQ.mjs.map +1 -0
- package/dist/_chunks/{es-4352c0b3.js → es-tPYrS3N2.js} +1 -1
- package/dist/_chunks/es-tPYrS3N2.js.map +1 -0
- package/dist/_chunks/{fr-81925960.js → fr-2usi50FD.js} +1 -1
- package/dist/_chunks/fr-2usi50FD.js.map +1 -0
- package/dist/_chunks/{fr-22b3a920.mjs → fr-8muIKZms.mjs} +1 -1
- package/dist/_chunks/fr-8muIKZms.mjs.map +1 -0
- package/dist/_chunks/{ko-f357ad11.mjs → ko-NdEnkB5D.mjs} +1 -1
- package/dist/_chunks/ko-NdEnkB5D.mjs.map +1 -0
- package/dist/_chunks/{ko-5ab994e9.js → ko-nuQP7I5M.js} +1 -1
- package/dist/_chunks/ko-nuQP7I5M.js.map +1 -0
- package/dist/_chunks/{pl-91ad3b57.mjs → pl-5DTLh5PW.mjs} +1 -1
- package/dist/_chunks/pl-5DTLh5PW.mjs.map +1 -0
- package/dist/_chunks/{pl-5065555b.js → pl-cdsG7ySn.js} +1 -1
- package/dist/_chunks/pl-cdsG7ySn.js.map +1 -0
- package/dist/_chunks/{ru-c00f24a0.js → ru-KtwsGCNm.js} +1 -1
- package/dist/_chunks/ru-KtwsGCNm.js.map +1 -0
- package/dist/_chunks/{ru-ea18416d.mjs → ru-_BJx1_V5.mjs} +1 -1
- package/dist/_chunks/ru-_BJx1_V5.mjs.map +1 -0
- package/dist/_chunks/{sv-a8d028fb.js → sv-QDPLOKcT.js} +1 -1
- package/dist/_chunks/sv-QDPLOKcT.js.map +1 -0
- package/dist/_chunks/{sv-8f50eca3.mjs → sv-YocrQXH3.mjs} +1 -1
- package/dist/_chunks/sv-YocrQXH3.mjs.map +1 -0
- package/dist/_chunks/{tr-de905f5b.js → tr-W6PupknE.js} +1 -1
- package/dist/_chunks/tr-W6PupknE.js.map +1 -0
- package/dist/_chunks/{tr-dca6c197.mjs → tr-nkbjyt2S.mjs} +1 -1
- package/dist/_chunks/tr-nkbjyt2S.mjs.map +1 -0
- package/dist/_chunks/{vi-22d50e0e.mjs → vi-10CsgDK2.mjs} +1 -1
- package/dist/_chunks/vi-10CsgDK2.mjs.map +1 -0
- package/dist/_chunks/{vi-6d3d2db0.js → vi-hEp1hNio.js} +1 -1
- package/dist/_chunks/vi-hEp1hNio.js.map +1 -0
- package/dist/_chunks/{zh-9ec5b9b1.mjs → zh-WWNi5hqs.mjs} +1 -1
- package/dist/_chunks/zh-WWNi5hqs.mjs.map +1 -0
- package/dist/_chunks/{zh-ac6dac24.js → zh-uRG2X3qF.js} +1 -1
- package/dist/_chunks/zh-uRG2X3qF.js.map +1 -0
- package/dist/admin/index.js +20 -12
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +20 -12
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/src/index.d.ts +16 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/server/index.js +124 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +106 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/server/src/bootstrap.d.ts +6 -0
- package/dist/server/src/bootstrap.d.ts.map +1 -0
- package/dist/server/src/config.d.ts +16 -0
- package/dist/server/src/config.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +24 -0
- package/dist/server/src/index.d.ts.map +1 -0
- package/dist/server/src/middlewares/sentry.d.ts +9 -0
- package/dist/server/src/middlewares/sentry.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +11 -0
- package/dist/server/src/services/index.d.ts.map +1 -0
- package/dist/server/src/services/sentry.d.ts +20 -0
- package/dist/server/src/services/sentry.d.ts.map +1 -0
- package/package.json +18 -11
- package/strapi-server.js +1 -1
- package/.eslintignore +0 -1
- package/.eslintrc +0 -14
- package/.gitattributes +0 -103
- package/admin/src/index.js +0 -38
- package/admin/src/pluginId.js +0 -5
- package/admin/src/translations/dk.json +0 -5
- package/admin/src/translations/en.json +0 -5
- package/admin/src/translations/es.json +0 -5
- package/admin/src/translations/fr.json +0 -5
- package/admin/src/translations/ko.json +0 -5
- package/admin/src/translations/pl.json +0 -5
- package/admin/src/translations/ru.json +0 -5
- package/admin/src/translations/sv.json +0 -5
- package/admin/src/translations/tr.json +0 -5
- package/admin/src/translations/vi.json +0 -5
- package/admin/src/translations/zh.json +0 -5
- package/dist/_chunks/dk-00b47489.js.map +0 -1
- package/dist/_chunks/dk-b05451b4.mjs.map +0 -1
- package/dist/_chunks/en-2dbaca4a.js.map +0 -1
- package/dist/_chunks/en-70258e03.mjs.map +0 -1
- package/dist/_chunks/es-0812c06d.mjs.map +0 -1
- package/dist/_chunks/es-4352c0b3.js.map +0 -1
- package/dist/_chunks/fr-22b3a920.mjs.map +0 -1
- package/dist/_chunks/fr-81925960.js.map +0 -1
- package/dist/_chunks/ko-5ab994e9.js.map +0 -1
- package/dist/_chunks/ko-f357ad11.mjs.map +0 -1
- package/dist/_chunks/pl-5065555b.js.map +0 -1
- package/dist/_chunks/pl-91ad3b57.mjs.map +0 -1
- package/dist/_chunks/ru-c00f24a0.js.map +0 -1
- package/dist/_chunks/ru-ea18416d.mjs.map +0 -1
- package/dist/_chunks/sv-8f50eca3.mjs.map +0 -1
- package/dist/_chunks/sv-a8d028fb.js.map +0 -1
- package/dist/_chunks/tr-dca6c197.mjs.map +0 -1
- package/dist/_chunks/tr-de905f5b.js.map +0 -1
- package/dist/_chunks/vi-22d50e0e.mjs.map +0 -1
- package/dist/_chunks/vi-6d3d2db0.js.map +0 -1
- package/dist/_chunks/zh-9ec5b9b1.mjs.map +0 -1
- package/dist/_chunks/zh-ac6dac24.js.map +0 -1
- package/jest.config.js +0 -6
- package/packup.config.ts +0 -22
- package/server/bootstrap.js +0 -8
- package/server/config.js +0 -10
- package/server/index.js +0 -11
- package/server/middlewares/sentry.js +0 -40
- package/server/services/__tests__/sentry.test.js +0 -102
- package/server/services/index.js +0 -7
- package/server/services/sentry/index.js +0 -85
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dk-ACiZv75I.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dk-Ht5BJvwV.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en--hlKpBzk.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-vyox7ZSC.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es-21jfFVzQ.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es-tPYrS3N2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr-2usi50FD.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr-8muIKZms.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko-NdEnkB5D.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko-nuQP7I5M.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl-5DTLh5PW.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl-cdsG7ySn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru-KtwsGCNm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru-_BJx1_V5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sv-QDPLOKcT.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sv-YocrQXH3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr-W6PupknE.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr-nkbjyt2S.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-10CsgDK2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-hEp1hNio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-WWNi5hqs.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-uRG2X3qF.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/admin/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
const name$1 = "@strapi/plugin-sentry";
|
|
13
|
-
const version = "4.
|
|
13
|
+
const version = "4.17.0";
|
|
14
14
|
const description = "Send Strapi error events to Sentry";
|
|
15
15
|
const repository = {
|
|
16
16
|
type: "git",
|
|
@@ -32,35 +32,42 @@ const maintainers = [
|
|
|
32
32
|
];
|
|
33
33
|
const exports$1 = {
|
|
34
34
|
"./strapi-admin": {
|
|
35
|
-
|
|
35
|
+
types: "./dist/admin/src/index.d.ts",
|
|
36
|
+
source: "./admin/src/index.ts",
|
|
36
37
|
"import": "./dist/admin/index.mjs",
|
|
37
38
|
require: "./dist/admin/index.js",
|
|
38
39
|
"default": "./dist/admin/index.js"
|
|
39
40
|
},
|
|
40
41
|
"./strapi-server": {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
42
|
+
types: "./dist/server/src/index.d.ts",
|
|
43
|
+
source: "./server/src/index.ts",
|
|
44
|
+
"import": "./dist/server/index.mjs",
|
|
45
|
+
require: "./dist/server/index.js",
|
|
46
|
+
"default": "./dist/server/index.js"
|
|
44
47
|
},
|
|
45
48
|
"./package.json": "./package.json"
|
|
46
49
|
};
|
|
50
|
+
const files = [
|
|
51
|
+
"./dist",
|
|
52
|
+
"strapi-server.js"
|
|
53
|
+
];
|
|
47
54
|
const scripts = {
|
|
48
|
-
build: "
|
|
55
|
+
build: "strapi plugin:build --force",
|
|
49
56
|
clean: "run -T rimraf dist",
|
|
50
57
|
lint: "run -T eslint .",
|
|
51
58
|
"test:unit": "run -T jest",
|
|
52
59
|
"test:unit:watch": "run -T jest --watch",
|
|
53
|
-
watch: "
|
|
60
|
+
watch: "strapi plugin:watch"
|
|
54
61
|
};
|
|
55
62
|
const dependencies = {
|
|
56
63
|
"@sentry/node": "6.19.7",
|
|
57
64
|
"@strapi/design-system": "1.14.1",
|
|
58
|
-
"@strapi/helper-plugin": "4.
|
|
65
|
+
"@strapi/helper-plugin": "4.17.0",
|
|
59
66
|
"@strapi/icons": "1.14.1"
|
|
60
67
|
};
|
|
61
68
|
const devDependencies = {
|
|
62
|
-
"@strapi/pack-up": "4.
|
|
63
|
-
"@strapi/strapi": "4.
|
|
69
|
+
"@strapi/pack-up": "4.17.0",
|
|
70
|
+
"@strapi/strapi": "4.17.0",
|
|
64
71
|
react: "^18.2.0",
|
|
65
72
|
"react-dom": "^18.2.0",
|
|
66
73
|
"react-router-dom": "5.3.4",
|
|
@@ -92,6 +99,7 @@ const pluginPkg = {
|
|
|
92
99
|
author,
|
|
93
100
|
maintainers,
|
|
94
101
|
exports: exports$1,
|
|
102
|
+
files,
|
|
95
103
|
scripts,
|
|
96
104
|
dependencies,
|
|
97
105
|
devDependencies,
|
|
@@ -99,7 +107,7 @@ const pluginPkg = {
|
|
|
99
107
|
engines,
|
|
100
108
|
strapi
|
|
101
109
|
};
|
|
102
|
-
const pluginId =
|
|
110
|
+
const pluginId = "sentry";
|
|
103
111
|
const name = pluginPkg.strapi.name;
|
|
104
112
|
const index = {
|
|
105
113
|
register(app) {
|
|
@@ -113,7 +121,7 @@ const index = {
|
|
|
113
121
|
async registerTrads({ locales }) {
|
|
114
122
|
const importedTrads = await Promise.all(
|
|
115
123
|
locales.map((locale) => {
|
|
116
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => Promise.resolve().then(() => require("../_chunks/dk-
|
|
124
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => Promise.resolve().then(() => require("../_chunks/dk-ACiZv75I.js")), "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-vyox7ZSC.js")), "./translations/es.json": () => Promise.resolve().then(() => require("../_chunks/es-tPYrS3N2.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("../_chunks/fr-2usi50FD.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("../_chunks/ko-nuQP7I5M.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("../_chunks/pl-cdsG7ySn.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("../_chunks/ru-KtwsGCNm.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("../_chunks/sv-QDPLOKcT.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("../_chunks/tr-W6PupknE.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("../_chunks/vi-hEp1hNio.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("../_chunks/zh-uRG2X3qF.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
117
125
|
return {
|
|
118
126
|
data: helperPlugin.prefixPluginTranslations(data, pluginId),
|
|
119
127
|
locale
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../admin/src/pluginId.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../admin/src/pluginId.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","import { prefixPluginTranslations } from '@strapi/helper-plugin';\n\nimport pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: any) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["prefixPluginTranslations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,WAAW;ACMxB,MAAM,OAAO,UAAU,OAAO;AAG9B,MAAe,QAAA;AAAA,EACb,SAAS,KAAU;AACjB,QAAI,eAAe;AAAA,MACjB,IAAI;AAAA,MACJ;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EACA,YAAY;AAAA,EAAC;AAAA,EACb,MAAM,cAAc,EAAE,WAAkC;AAChD,UAAA,gBAAgB,MAAM,QAAQ;AAAA,MAClC,QAAQ,IAAI,CAAC,WAAW;AACf,eAAA,qCAA+B,uBAAA,OAAA,EAAA,0BAAA,MAAA,qCAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,qCAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,qCAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,IAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,2BAAA,CAAA,EAAA,CAAA,GAAA,kBAAA,MAAA,OAAA,EACnC,KAAK,CAAC,EAAE,SAAS,KAAA,MAAW;AACpB,iBAAA;AAAA,YACL,MAAMA,aAAAA,yBAAyB,MAAM,QAAQ;AAAA,YAC7C;AAAA,UAAA;AAAA,QACF,CACD,EACA,MAAM,MAAM;AACJ,iBAAA;AAAA,YACL,MAAM,CAAC;AAAA,YACP;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MAAA,CACJ;AAAA,IAAA;AAGI,WAAA,QAAQ,QAAQ,aAAa;AAAA,EACtC;AACF;;"}
|
package/dist/admin/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
const name$1 = "@strapi/plugin-sentry";
|
|
12
|
-
const version = "4.
|
|
12
|
+
const version = "4.17.0";
|
|
13
13
|
const description = "Send Strapi error events to Sentry";
|
|
14
14
|
const repository = {
|
|
15
15
|
type: "git",
|
|
@@ -31,35 +31,42 @@ const maintainers = [
|
|
|
31
31
|
];
|
|
32
32
|
const exports = {
|
|
33
33
|
"./strapi-admin": {
|
|
34
|
-
|
|
34
|
+
types: "./dist/admin/src/index.d.ts",
|
|
35
|
+
source: "./admin/src/index.ts",
|
|
35
36
|
"import": "./dist/admin/index.mjs",
|
|
36
37
|
require: "./dist/admin/index.js",
|
|
37
38
|
"default": "./dist/admin/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./strapi-server": {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
41
|
+
types: "./dist/server/src/index.d.ts",
|
|
42
|
+
source: "./server/src/index.ts",
|
|
43
|
+
"import": "./dist/server/index.mjs",
|
|
44
|
+
require: "./dist/server/index.js",
|
|
45
|
+
"default": "./dist/server/index.js"
|
|
43
46
|
},
|
|
44
47
|
"./package.json": "./package.json"
|
|
45
48
|
};
|
|
49
|
+
const files = [
|
|
50
|
+
"./dist",
|
|
51
|
+
"strapi-server.js"
|
|
52
|
+
];
|
|
46
53
|
const scripts = {
|
|
47
|
-
build: "
|
|
54
|
+
build: "strapi plugin:build --force",
|
|
48
55
|
clean: "run -T rimraf dist",
|
|
49
56
|
lint: "run -T eslint .",
|
|
50
57
|
"test:unit": "run -T jest",
|
|
51
58
|
"test:unit:watch": "run -T jest --watch",
|
|
52
|
-
watch: "
|
|
59
|
+
watch: "strapi plugin:watch"
|
|
53
60
|
};
|
|
54
61
|
const dependencies = {
|
|
55
62
|
"@sentry/node": "6.19.7",
|
|
56
63
|
"@strapi/design-system": "1.14.1",
|
|
57
|
-
"@strapi/helper-plugin": "4.
|
|
64
|
+
"@strapi/helper-plugin": "4.17.0",
|
|
58
65
|
"@strapi/icons": "1.14.1"
|
|
59
66
|
};
|
|
60
67
|
const devDependencies = {
|
|
61
|
-
"@strapi/pack-up": "4.
|
|
62
|
-
"@strapi/strapi": "4.
|
|
68
|
+
"@strapi/pack-up": "4.17.0",
|
|
69
|
+
"@strapi/strapi": "4.17.0",
|
|
63
70
|
react: "^18.2.0",
|
|
64
71
|
"react-dom": "^18.2.0",
|
|
65
72
|
"react-router-dom": "5.3.4",
|
|
@@ -91,6 +98,7 @@ const pluginPkg = {
|
|
|
91
98
|
author,
|
|
92
99
|
maintainers,
|
|
93
100
|
exports,
|
|
101
|
+
files,
|
|
94
102
|
scripts,
|
|
95
103
|
dependencies,
|
|
96
104
|
devDependencies,
|
|
@@ -98,7 +106,7 @@ const pluginPkg = {
|
|
|
98
106
|
engines,
|
|
99
107
|
strapi
|
|
100
108
|
};
|
|
101
|
-
const pluginId =
|
|
109
|
+
const pluginId = "sentry";
|
|
102
110
|
const name = pluginPkg.strapi.name;
|
|
103
111
|
const index = {
|
|
104
112
|
register(app) {
|
|
@@ -112,7 +120,7 @@ const index = {
|
|
|
112
120
|
async registerTrads({ locales }) {
|
|
113
121
|
const importedTrads = await Promise.all(
|
|
114
122
|
locales.map((locale) => {
|
|
115
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => import("../_chunks/dk-
|
|
123
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => import("../_chunks/dk-Ht5BJvwV.mjs"), "./translations/en.json": () => import("../_chunks/en--hlKpBzk.mjs"), "./translations/es.json": () => import("../_chunks/es-21jfFVzQ.mjs"), "./translations/fr.json": () => import("../_chunks/fr-8muIKZms.mjs"), "./translations/ko.json": () => import("../_chunks/ko-NdEnkB5D.mjs"), "./translations/pl.json": () => import("../_chunks/pl-5DTLh5PW.mjs"), "./translations/ru.json": () => import("../_chunks/ru-_BJx1_V5.mjs"), "./translations/sv.json": () => import("../_chunks/sv-YocrQXH3.mjs"), "./translations/tr.json": () => import("../_chunks/tr-nkbjyt2S.mjs"), "./translations/vi.json": () => import("../_chunks/vi-10CsgDK2.mjs"), "./translations/zh.json": () => import("../_chunks/zh-WWNi5hqs.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
116
124
|
return {
|
|
117
125
|
data: prefixPluginTranslations(data, pluginId),
|
|
118
126
|
locale
|
package/dist/admin/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../admin/src/pluginId.
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../admin/src/pluginId.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","import { prefixPluginTranslations } from '@strapi/helper-plugin';\n\nimport pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: any) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,WAAW;ACMxB,MAAM,OAAO,UAAU,OAAO;AAG9B,MAAe,QAAA;AAAA,EACb,SAAS,KAAU;AACjB,QAAI,eAAe;AAAA,MACjB,IAAI;AAAA,MACJ;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EACA,YAAY;AAAA,EAAC;AAAA,EACb,MAAM,cAAc,EAAE,WAAkC;AAChD,UAAA,gBAAgB,MAAM,QAAQ;AAAA,MAClC,QAAQ,IAAI,CAAC,WAAW;AACf,eAAA,qCAA+B,uBAAA,OAAA,EAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,GAAA,0BAAA,MAAA,OAAA,4BAAA,EAAA,CAAA,GAAA,kBAAA,MAAA,OAAA,EACnC,KAAK,CAAC,EAAE,SAAS,KAAA,MAAW;AACpB,iBAAA;AAAA,YACL,MAAM,yBAAyB,MAAM,QAAQ;AAAA,YAC7C;AAAA,UAAA;AAAA,QACF,CACD,EACA,MAAM,MAAM;AACJ,iBAAA;AAAA,YACL,MAAM,CAAC;AAAA,YACP;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MAAA,CACJ;AAAA,IAAA;AAGI,WAAA,QAAQ,QAAQ,aAAa;AAAA,EACtC;AACF;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register(app: any): void;
|
|
3
|
+
bootstrap(): void;
|
|
4
|
+
registerTrads({ locales }: {
|
|
5
|
+
locales: string[];
|
|
6
|
+
}): Promise<({
|
|
7
|
+
data: {
|
|
8
|
+
[x: string]: string;
|
|
9
|
+
};
|
|
10
|
+
locale: string;
|
|
11
|
+
} | {
|
|
12
|
+
data: {};
|
|
13
|
+
locale: string;
|
|
14
|
+
})[]>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pluginId = "sentry";
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Sentry = require("@sentry/node");
|
|
3
|
+
function _interopNamespace(e) {
|
|
4
|
+
if (e && e.__esModule)
|
|
5
|
+
return e;
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const Sentry__namespace = /* @__PURE__ */ _interopNamespace(Sentry);
|
|
22
|
+
const initSentryMiddleware = ({ strapi }) => {
|
|
23
|
+
const sentryService = strapi.plugin("sentry").service("sentry");
|
|
24
|
+
sentryService.init();
|
|
25
|
+
const sentry2 = sentryService.getInstance();
|
|
26
|
+
if (!sentry2) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
strapi.server.use(async (ctx, next) => {
|
|
30
|
+
try {
|
|
31
|
+
await next();
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error instanceof Error) {
|
|
34
|
+
sentryService.sendError(error, (scope) => {
|
|
35
|
+
scope.addEventProcessor((event) => {
|
|
36
|
+
return sentry2.Handlers.parseRequest(event, ctx.request, {
|
|
37
|
+
// Don't parse the transaction name, we'll do it manually
|
|
38
|
+
transaction: false
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
scope.setTag("transaction", `${ctx.method} ${ctx._matchedRoute}`);
|
|
42
|
+
scope.setTag("strapi_version", strapi.config.info.strapi);
|
|
43
|
+
scope.setTag("method", ctx.method);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const bootstrap = async ({ strapi }) => {
|
|
51
|
+
initSentryMiddleware({ strapi });
|
|
52
|
+
};
|
|
53
|
+
const createSentryService = (strapi) => {
|
|
54
|
+
let isReady = false;
|
|
55
|
+
let instance = null;
|
|
56
|
+
const config2 = strapi.config.get("plugin.sentry");
|
|
57
|
+
return {
|
|
58
|
+
/**
|
|
59
|
+
* Initialize Sentry service
|
|
60
|
+
*/
|
|
61
|
+
init() {
|
|
62
|
+
if (instance != null) {
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
if (!config2.dsn) {
|
|
66
|
+
strapi.log.info("@strapi/plugin-sentry is disabled because no Sentry DSN was provided");
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
Sentry__namespace.init({
|
|
71
|
+
dsn: config2.dsn,
|
|
72
|
+
environment: strapi.config.get("environment"),
|
|
73
|
+
...config2.init
|
|
74
|
+
});
|
|
75
|
+
instance = Sentry__namespace;
|
|
76
|
+
isReady = true;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
strapi.log.warn("Could not set up Sentry, make sure you entered a valid DSN");
|
|
79
|
+
}
|
|
80
|
+
return this;
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Expose Sentry instance through a getter
|
|
84
|
+
*/
|
|
85
|
+
getInstance() {
|
|
86
|
+
return instance;
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Higher level method to send exception events to Sentry
|
|
90
|
+
*/
|
|
91
|
+
sendError(error, configureScope) {
|
|
92
|
+
if (!isReady || !instance) {
|
|
93
|
+
strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
instance.withScope((scope) => {
|
|
97
|
+
if (configureScope && config2.sendMetadata) {
|
|
98
|
+
configureScope(scope);
|
|
99
|
+
}
|
|
100
|
+
instance?.captureException(error);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const sentry = ({ strapi }) => createSentryService(strapi);
|
|
106
|
+
const services = {
|
|
107
|
+
sentry
|
|
108
|
+
};
|
|
109
|
+
const config = {
|
|
110
|
+
default: {
|
|
111
|
+
dsn: null,
|
|
112
|
+
sendMetadata: true,
|
|
113
|
+
init: {}
|
|
114
|
+
},
|
|
115
|
+
validator() {
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const index = () => ({
|
|
119
|
+
bootstrap,
|
|
120
|
+
config,
|
|
121
|
+
services
|
|
122
|
+
});
|
|
123
|
+
module.exports = index;
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../server/src/middlewares/sentry.ts","../../server/src/bootstrap.ts","../../server/src/services/sentry.ts","../../server/src/services/index.ts","../../server/src/config.ts","../../server/src/index.ts"],"sourcesContent":["import type { Strapi } from '@strapi/strapi';\nimport type Sentry from '@sentry/node';\nimport type createSentryService from '../services/sentry';\n\n/**\n * Programmatic sentry middleware. We do not want to expose it in the plugin\n */\nexport default ({ strapi }: { strapi: Strapi }) => {\n const sentryService: ReturnType<typeof createSentryService> = strapi\n .plugin('sentry')\n .service('sentry');\n sentryService.init();\n const sentry = sentryService.getInstance();\n\n if (!sentry) {\n // initialization failed\n return;\n }\n\n strapi.server.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n if (error instanceof Error) {\n sentryService.sendError(error, (scope: Sentry.Scope) => {\n scope.addEventProcessor((event) => {\n // Parse Koa context to add error metadata\n return sentry.Handlers.parseRequest(event, ctx.request as Sentry.Request, {\n // Don't parse the transaction name, we'll do it manually\n transaction: false,\n });\n });\n\n // Manually add transaction name\n scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);\n // Manually add Strapi version\n scope.setTag('strapi_version', strapi.config.info.strapi);\n scope.setTag('method', ctx.method);\n });\n }\n\n throw error;\n }\n });\n};\n","import type { Strapi } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n","import type { Strapi } from '@strapi/strapi';\nimport type { Config } from 'src/config';\nimport * as Sentry from '@sentry/node';\n\nconst createSentryService = (strapi: Strapi) => {\n let isReady = false;\n let instance: typeof Sentry | null = null;\n\n // Retrieve user config and merge it with the default one\n const config = strapi.config.get('plugin.sentry') as Config;\n\n return {\n /**\n * Initialize Sentry service\n */\n init() {\n // Make sure there isn't a Sentry instance already running\n if (instance != null) {\n return this;\n }\n\n // Don't init Sentry if no DSN was provided\n if (!config.dsn) {\n strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');\n return this;\n }\n\n try {\n Sentry.init({\n dsn: config.dsn,\n environment: strapi.config.get('environment'),\n ...config.init,\n });\n\n // Store the successfully initialized Sentry instance\n instance = Sentry;\n isReady = true;\n } catch (error) {\n strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');\n }\n\n return this;\n },\n\n /**\n * Expose Sentry instance through a getter\n */\n getInstance() {\n return instance;\n },\n\n /**\n * Higher level method to send exception events to Sentry\n */\n sendError(error: Error, configureScope?: (scope: Sentry.Scope) => void) {\n // Make sure Sentry is ready\n if (!isReady || !instance) {\n strapi.log.warn(\"Sentry wasn't properly initialized, cannot send event\");\n return;\n }\n\n instance.withScope((scope) => {\n // Configure the Sentry scope using the provided callback\n if (configureScope && config.sendMetadata) {\n configureScope(scope);\n }\n\n // Actually send the Error to Sentry\n instance?.captureException(error);\n });\n },\n };\n};\n\nexport default ({ strapi }: { strapi: Strapi }) => createSentryService(strapi);\n","import sentry from './sentry';\n\nexport default {\n sentry,\n};\n","import type { NodeOptions } from '@sentry/node';\n\nexport interface Config {\n dsn: string | null;\n sendMetadata: boolean;\n init: NodeOptions;\n}\n\nexport default {\n default: {\n dsn: null,\n sendMetadata: true,\n init: {},\n } satisfies Config,\n validator() {},\n};\n","import bootstrap from './bootstrap';\nimport services from './services';\nimport config from './config';\n\nexport default () => ({\n bootstrap,\n config,\n services,\n});\n"],"names":["sentry","config","Sentry"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAA,uBAAe,CAAC,EAAE,OAAA,MAAiC;AACjD,QAAM,gBAAwD,OAC3D,OAAO,QAAQ,EACf,QAAQ,QAAQ;AACnB,gBAAc,KAAK;AACb,QAAAA,UAAS,cAAc;AAE7B,MAAI,CAACA,SAAQ;AAEX;AAAA,EACF;AAEA,SAAO,OAAO,IAAI,OAAO,KAAK,SAAS;AACjC,QAAA;AACF,YAAM,KAAK;AAAA,aACJ,OAAO;AACd,UAAI,iBAAiB,OAAO;AACZ,sBAAA,UAAU,OAAO,CAAC,UAAwB;AAChD,gBAAA,kBAAkB,CAAC,UAAU;AAEjC,mBAAOA,QAAO,SAAS,aAAa,OAAO,IAAI,SAA2B;AAAA;AAAA,cAExE,aAAa;AAAA,YAAA,CACd;AAAA,UAAA,CACF;AAGK,gBAAA,OAAO,eAAe,GAAG,IAAI,MAAM,IAAI,IAAI,aAAa,EAAE;AAEhE,gBAAM,OAAO,kBAAkB,OAAO,OAAO,KAAK,MAAM;AAClD,gBAAA,OAAO,UAAU,IAAI,MAAM;AAAA,QAAA,CAClC;AAAA,MACH;AAEM,YAAA;AAAA,IACR;AAAA,EAAA,CACD;AACH;ACzCA,MAAA,YAAe,OAAO,EAAE,OAAA,MAAiC;AAElC,uBAAA,EAAE,QAAQ;AACjC;ACFA,MAAM,sBAAsB,CAAC,WAAmB;AAC9C,MAAI,UAAU;AACd,MAAI,WAAiC;AAGrC,QAAMC,UAAS,OAAO,OAAO,IAAI,eAAe;AAEzC,SAAA;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAEL,UAAI,YAAY,MAAM;AACb,eAAA;AAAA,MACT;AAGI,UAAA,CAACA,QAAO,KAAK;AACR,eAAA,IAAI,KAAK,sEAAsE;AAC/E,eAAA;AAAA,MACT;AAEI,UAAA;AACFC,0BAAO,KAAK;AAAA,UACV,KAAKD,QAAO;AAAA,UACZ,aAAa,OAAO,OAAO,IAAI,aAAa;AAAA,UAC5C,GAAGA,QAAO;AAAA,QAAA,CACX;AAGU,mBAAAC;AACD,kBAAA;AAAA,eACH,OAAO;AACP,eAAA,IAAI,KAAK,4DAA4D;AAAA,MAC9E;AAEO,aAAA;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,cAAc;AACL,aAAA;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,UAAU,OAAc,gBAAgD;AAElE,UAAA,CAAC,WAAW,CAAC,UAAU;AAClB,eAAA,IAAI,KAAK,uDAAuD;AACvE;AAAA,MACF;AAES,eAAA,UAAU,CAAC,UAAU;AAExB,YAAA,kBAAkBD,QAAO,cAAc;AACzC,yBAAe,KAAK;AAAA,QACtB;AAGA,kBAAU,iBAAiB,KAAK;AAAA,MAAA,CACjC;AAAA,IACH;AAAA,EAAA;AAEJ;AAEA,MAAe,SAAA,CAAC,EAAE,OAAO,MAA0B,oBAAoB,MAAM;ACxE7E,MAAe,WAAA;AAAA,EACb;AACF;ACIA,MAAe,SAAA;AAAA,EACb,SAAS;AAAA,IACP,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC;AAAA,EACT;AAAA,EACA,YAAY;AAAA,EAAC;AACf;ACXA,MAAA,QAAe,OAAO;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AACF;;"}
|