@strapi/plugin-sentry 0.0.0-experimental.aa365347893dd14731fd93fab01b39386aaedeee → 0.0.0-experimental.abc
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/LICENSE +18 -3
- package/dist/_chunks/{dk-Ht5BJvwV.mjs → dk-D9TLFbt6.mjs} +1 -1
- package/dist/_chunks/dk-D9TLFbt6.mjs.map +1 -0
- package/dist/_chunks/{dk-ACiZv75I.js → dk-NQyAzZiU.js} +1 -1
- package/dist/_chunks/dk-NQyAzZiU.js.map +1 -0
- package/dist/_chunks/{en--hlKpBzk.mjs → en-CegwVP3M.mjs} +1 -1
- package/dist/_chunks/en-CegwVP3M.mjs.map +1 -0
- package/dist/_chunks/{en-vyox7ZSC.js → en-bbgXRWo3.js} +1 -1
- package/dist/_chunks/en-bbgXRWo3.js.map +1 -0
- package/dist/_chunks/{es-tPYrS3N2.js → es-31ok883l.js} +1 -1
- package/dist/_chunks/es-31ok883l.js.map +1 -0
- package/dist/_chunks/{es-21jfFVzQ.mjs → es-DxC1UwjP.mjs} +1 -1
- package/dist/_chunks/es-DxC1UwjP.mjs.map +1 -0
- package/dist/_chunks/{fr-2usi50FD.js → fr-6Xd8HjNA.js} +1 -1
- package/dist/_chunks/fr-6Xd8HjNA.js.map +1 -0
- package/dist/_chunks/{fr-8muIKZms.mjs → fr-BRlwHIG8.mjs} +1 -1
- package/dist/_chunks/fr-BRlwHIG8.mjs.map +1 -0
- package/dist/_chunks/{ko-NdEnkB5D.mjs → ko-C_MXyOM9.mjs} +1 -1
- package/dist/_chunks/ko-C_MXyOM9.mjs.map +1 -0
- package/dist/_chunks/{ko-nuQP7I5M.js → ko-DdXSFVkr.js} +1 -1
- package/dist/_chunks/ko-DdXSFVkr.js.map +1 -0
- package/dist/_chunks/{pl-5DTLh5PW.mjs → pl-6hJT3Sda.mjs} +1 -1
- package/dist/_chunks/pl-6hJT3Sda.mjs.map +1 -0
- package/dist/_chunks/{pl-cdsG7ySn.js → pl-KE2e7O1o.js} +1 -1
- package/dist/_chunks/pl-KE2e7O1o.js.map +1 -0
- package/dist/_chunks/{ru-KtwsGCNm.js → ru-C41W13kt.js} +1 -1
- package/dist/_chunks/ru-C41W13kt.js.map +1 -0
- package/dist/_chunks/{ru-_BJx1_V5.mjs → ru-DnVqFddA.mjs} +1 -1
- package/dist/_chunks/ru-DnVqFddA.mjs.map +1 -0
- package/dist/_chunks/{sv-QDPLOKcT.js → sv-DCUFAW2Z.js} +1 -1
- package/dist/_chunks/sv-DCUFAW2Z.js.map +1 -0
- package/dist/_chunks/{sv-YocrQXH3.mjs → sv-DjL9wmwK.mjs} +1 -1
- package/dist/_chunks/sv-DjL9wmwK.mjs.map +1 -0
- package/dist/_chunks/{tr-nkbjyt2S.mjs → tr-BKL2AN-d.mjs} +1 -1
- package/dist/_chunks/tr-BKL2AN-d.mjs.map +1 -0
- package/dist/_chunks/{tr-W6PupknE.js → tr-DgnL-Yfr.js} +1 -1
- package/dist/_chunks/tr-DgnL-Yfr.js.map +1 -0
- package/dist/_chunks/{vi-10CsgDK2.mjs → vi-DLBe31mD.mjs} +1 -1
- package/dist/_chunks/vi-DLBe31mD.mjs.map +1 -0
- package/dist/_chunks/{vi-hEp1hNio.js → vi-E2aG_wR_.js} +1 -1
- package/dist/_chunks/vi-E2aG_wR_.js.map +1 -0
- package/dist/_chunks/{zh-WWNi5hqs.mjs → zh-5kkOa7U5.mjs} +1 -1
- package/dist/_chunks/zh-5kkOa7U5.mjs.map +1 -0
- package/dist/_chunks/{zh-uRG2X3qF.js → zh-Uq7oN9Sz.js} +1 -1
- package/dist/_chunks/zh-Uq7oN9Sz.js.map +1 -0
- package/dist/admin/index.js +27 -19
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +26 -18
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +2 -2
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +3 -3
- package/dist/server/src/middlewares/sentry.d.ts +2 -2
- package/dist/server/src/middlewares/sentry.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +2 -2
- package/dist/server/src/services/sentry.d.ts +2 -2
- package/dist/server/src/services/sentry.d.ts.map +1 -1
- package/package.json +17 -17
- package/dist/_chunks/dk-ACiZv75I.js.map +0 -1
- package/dist/_chunks/dk-Ht5BJvwV.mjs.map +0 -1
- package/dist/_chunks/en--hlKpBzk.mjs.map +0 -1
- package/dist/_chunks/en-vyox7ZSC.js.map +0 -1
- package/dist/_chunks/es-21jfFVzQ.mjs.map +0 -1
- package/dist/_chunks/es-tPYrS3N2.js.map +0 -1
- package/dist/_chunks/fr-2usi50FD.js.map +0 -1
- package/dist/_chunks/fr-8muIKZms.mjs.map +0 -1
- package/dist/_chunks/ko-NdEnkB5D.mjs.map +0 -1
- package/dist/_chunks/ko-nuQP7I5M.js.map +0 -1
- package/dist/_chunks/pl-5DTLh5PW.mjs.map +0 -1
- package/dist/_chunks/pl-cdsG7ySn.js.map +0 -1
- package/dist/_chunks/ru-KtwsGCNm.js.map +0 -1
- package/dist/_chunks/ru-_BJx1_V5.mjs.map +0 -1
- package/dist/_chunks/sv-QDPLOKcT.js.map +0 -1
- package/dist/_chunks/sv-YocrQXH3.mjs.map +0 -1
- package/dist/_chunks/tr-W6PupknE.js.map +0 -1
- package/dist/_chunks/tr-nkbjyt2S.mjs.map +0 -1
- package/dist/_chunks/vi-10CsgDK2.mjs.map +0 -1
- package/dist/_chunks/vi-hEp1hNio.js.map +0 -1
- package/dist/_chunks/zh-WWNi5hqs.mjs.map +0 -1
- package/dist/_chunks/zh-uRG2X3qF.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -2,7 +2,21 @@ Copyright (c) 2015-present Strapi Solutions SAS
|
|
|
2
2
|
|
|
3
3
|
Portions of the Strapi software are licensed as follows:
|
|
4
4
|
|
|
5
|
-
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined
|
|
5
|
+
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined below.
|
|
6
|
+
|
|
7
|
+
Enterprise License
|
|
8
|
+
|
|
9
|
+
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
|
|
10
|
+
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
|
|
11
|
+
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
|
|
12
|
+
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
|
|
13
|
+
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
|
|
14
|
+
|
|
15
|
+
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
|
|
16
|
+
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
|
|
17
|
+
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
|
|
18
|
+
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
|
|
19
|
+
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
|
|
6
20
|
|
|
7
21
|
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
|
|
8
22
|
|
|
@@ -18,5 +32,6 @@ furnished to do so, subject to the following conditions:
|
|
|
18
32
|
The above copyright notice and this permission notice shall be included in all
|
|
19
33
|
copies or substantial portions of the Software.
|
|
20
34
|
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
37
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dk-D9TLFbt6.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dk-NQyAzZiU.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-CegwVP3M.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-bbgXRWo3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es-31ok883l.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es-DxC1UwjP.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr-6Xd8HjNA.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr-BRlwHIG8.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko-C_MXyOM9.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko-DdXSFVkr.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl-6hJT3Sda.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl-KE2e7O1o.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru-C41W13kt.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru-DnVqFddA.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sv-DCUFAW2Z.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sv-DjL9wmwK.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr-BKL2AN-d.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr-DgnL-Yfr.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-DLBe31mD.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-E2aG_wR_.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-5kkOa7U5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-Uq7oN9Sz.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/admin/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const helperPlugin = require("@strapi/helper-plugin");
|
|
3
2
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
4
3
|
const v = glob[path];
|
|
5
4
|
if (v) {
|
|
@@ -10,7 +9,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
11
|
const name$1 = "@strapi/plugin-sentry";
|
|
13
|
-
const version = "
|
|
12
|
+
const version = "5.0.0-rc.8";
|
|
14
13
|
const description = "Send Strapi error events to Sentry";
|
|
15
14
|
const repository = {
|
|
16
15
|
type: "git",
|
|
@@ -52,33 +51,33 @@ const files = [
|
|
|
52
51
|
"strapi-server.js"
|
|
53
52
|
];
|
|
54
53
|
const scripts = {
|
|
55
|
-
build: "strapi
|
|
54
|
+
build: "strapi-plugin build",
|
|
56
55
|
clean: "run -T rimraf dist",
|
|
57
56
|
lint: "run -T eslint .",
|
|
58
57
|
"test:unit": "run -T jest",
|
|
59
58
|
"test:unit:watch": "run -T jest --watch",
|
|
60
|
-
watch: "strapi
|
|
59
|
+
watch: "strapi-plugin watch"
|
|
61
60
|
};
|
|
62
61
|
const dependencies = {
|
|
63
|
-
"@sentry/node": "
|
|
64
|
-
"@strapi/design-system": "
|
|
65
|
-
"@strapi/
|
|
66
|
-
"@strapi/icons": "1.18.0"
|
|
62
|
+
"@sentry/node": "7.112.2",
|
|
63
|
+
"@strapi/design-system": "2.0.0-rc.7",
|
|
64
|
+
"@strapi/icons": "2.0.0-rc.7"
|
|
67
65
|
};
|
|
68
66
|
const devDependencies = {
|
|
69
|
-
"@strapi/pack-up": "
|
|
70
|
-
"@strapi/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"react-
|
|
74
|
-
"
|
|
67
|
+
"@strapi/pack-up": "5.0.0",
|
|
68
|
+
"@strapi/sdk-plugin": "^5.0.0",
|
|
69
|
+
"@strapi/strapi": "workspace:*",
|
|
70
|
+
react: "18.3.1",
|
|
71
|
+
"react-dom": "18.3.1",
|
|
72
|
+
"react-router-dom": "6.22.3",
|
|
73
|
+
"styled-components": "6.1.8"
|
|
75
74
|
};
|
|
76
75
|
const peerDependencies = {
|
|
77
|
-
"@strapi/strapi": "^
|
|
76
|
+
"@strapi/strapi": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
78
77
|
react: "^17.0.0 || ^18.0.0",
|
|
79
78
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
80
|
-
"react-router-dom": "^
|
|
81
|
-
"styled-components": "^
|
|
79
|
+
"react-router-dom": "^6.0.0",
|
|
80
|
+
"styled-components": "^6.0.0"
|
|
82
81
|
};
|
|
83
82
|
const engines = {
|
|
84
83
|
node: ">=18.0.0 <=20.x.x",
|
|
@@ -108,6 +107,15 @@ const pluginPkg = {
|
|
|
108
107
|
strapi
|
|
109
108
|
};
|
|
110
109
|
const pluginId = "sentry";
|
|
110
|
+
const prefixPluginTranslations = (trad, pluginId2) => {
|
|
111
|
+
if (!pluginId2) {
|
|
112
|
+
throw new TypeError("pluginId can't be empty");
|
|
113
|
+
}
|
|
114
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
115
|
+
acc[`${pluginId2}.${current}`] = trad[current];
|
|
116
|
+
return acc;
|
|
117
|
+
}, {});
|
|
118
|
+
};
|
|
111
119
|
const name = pluginPkg.strapi.name;
|
|
112
120
|
const index = {
|
|
113
121
|
register(app) {
|
|
@@ -121,9 +129,9 @@ const index = {
|
|
|
121
129
|
async registerTrads({ locales }) {
|
|
122
130
|
const importedTrads = await Promise.all(
|
|
123
131
|
locales.map((locale) => {
|
|
124
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => Promise.resolve().then(() => require("../_chunks/dk-
|
|
132
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => Promise.resolve().then(() => require("../_chunks/dk-NQyAzZiU.js")), "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-bbgXRWo3.js")), "./translations/es.json": () => Promise.resolve().then(() => require("../_chunks/es-31ok883l.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("../_chunks/fr-6Xd8HjNA.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("../_chunks/ko-DdXSFVkr.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("../_chunks/pl-KE2e7O1o.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("../_chunks/ru-C41W13kt.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("../_chunks/sv-DCUFAW2Z.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("../_chunks/tr-DgnL-Yfr.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("../_chunks/vi-E2aG_wR_.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("../_chunks/zh-Uq7oN9Sz.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
125
133
|
return {
|
|
126
|
-
data:
|
|
134
|
+
data: prefixPluginTranslations(data, pluginId),
|
|
127
135
|
locale
|
|
128
136
|
};
|
|
129
137
|
}).catch(() => {
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../admin/src/pluginId.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../admin/src/pluginId.ts","../../admin/src/utils/prefixPluginTranslations.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n","import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\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":["pluginId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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,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;;"}
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { prefixPluginTranslations } from "@strapi/helper-plugin";
|
|
2
1
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
3
2
|
const v = glob[path];
|
|
4
3
|
if (v) {
|
|
@@ -9,7 +8,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
10
|
const name$1 = "@strapi/plugin-sentry";
|
|
12
|
-
const version = "
|
|
11
|
+
const version = "5.0.0-rc.8";
|
|
13
12
|
const description = "Send Strapi error events to Sentry";
|
|
14
13
|
const repository = {
|
|
15
14
|
type: "git",
|
|
@@ -51,33 +50,33 @@ const files = [
|
|
|
51
50
|
"strapi-server.js"
|
|
52
51
|
];
|
|
53
52
|
const scripts = {
|
|
54
|
-
build: "strapi
|
|
53
|
+
build: "strapi-plugin build",
|
|
55
54
|
clean: "run -T rimraf dist",
|
|
56
55
|
lint: "run -T eslint .",
|
|
57
56
|
"test:unit": "run -T jest",
|
|
58
57
|
"test:unit:watch": "run -T jest --watch",
|
|
59
|
-
watch: "strapi
|
|
58
|
+
watch: "strapi-plugin watch"
|
|
60
59
|
};
|
|
61
60
|
const dependencies = {
|
|
62
|
-
"@sentry/node": "
|
|
63
|
-
"@strapi/design-system": "
|
|
64
|
-
"@strapi/
|
|
65
|
-
"@strapi/icons": "1.18.0"
|
|
61
|
+
"@sentry/node": "7.112.2",
|
|
62
|
+
"@strapi/design-system": "2.0.0-rc.7",
|
|
63
|
+
"@strapi/icons": "2.0.0-rc.7"
|
|
66
64
|
};
|
|
67
65
|
const devDependencies = {
|
|
68
|
-
"@strapi/pack-up": "
|
|
69
|
-
"@strapi/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"react-
|
|
73
|
-
"
|
|
66
|
+
"@strapi/pack-up": "5.0.0",
|
|
67
|
+
"@strapi/sdk-plugin": "^5.0.0",
|
|
68
|
+
"@strapi/strapi": "workspace:*",
|
|
69
|
+
react: "18.3.1",
|
|
70
|
+
"react-dom": "18.3.1",
|
|
71
|
+
"react-router-dom": "6.22.3",
|
|
72
|
+
"styled-components": "6.1.8"
|
|
74
73
|
};
|
|
75
74
|
const peerDependencies = {
|
|
76
|
-
"@strapi/strapi": "^
|
|
75
|
+
"@strapi/strapi": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
77
76
|
react: "^17.0.0 || ^18.0.0",
|
|
78
77
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
79
|
-
"react-router-dom": "^
|
|
80
|
-
"styled-components": "^
|
|
78
|
+
"react-router-dom": "^6.0.0",
|
|
79
|
+
"styled-components": "^6.0.0"
|
|
81
80
|
};
|
|
82
81
|
const engines = {
|
|
83
82
|
node: ">=18.0.0 <=20.x.x",
|
|
@@ -107,6 +106,15 @@ const pluginPkg = {
|
|
|
107
106
|
strapi
|
|
108
107
|
};
|
|
109
108
|
const pluginId = "sentry";
|
|
109
|
+
const prefixPluginTranslations = (trad, pluginId2) => {
|
|
110
|
+
if (!pluginId2) {
|
|
111
|
+
throw new TypeError("pluginId can't be empty");
|
|
112
|
+
}
|
|
113
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
114
|
+
acc[`${pluginId2}.${current}`] = trad[current];
|
|
115
|
+
return acc;
|
|
116
|
+
}, {});
|
|
117
|
+
};
|
|
110
118
|
const name = pluginPkg.strapi.name;
|
|
111
119
|
const index = {
|
|
112
120
|
register(app) {
|
|
@@ -120,7 +128,7 @@ const index = {
|
|
|
120
128
|
async registerTrads({ locales }) {
|
|
121
129
|
const importedTrads = await Promise.all(
|
|
122
130
|
locales.map((locale) => {
|
|
123
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => import("../_chunks/dk-
|
|
131
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/dk.json": () => import("../_chunks/dk-D9TLFbt6.mjs"), "./translations/en.json": () => import("../_chunks/en-CegwVP3M.mjs"), "./translations/es.json": () => import("../_chunks/es-DxC1UwjP.mjs"), "./translations/fr.json": () => import("../_chunks/fr-BRlwHIG8.mjs"), "./translations/ko.json": () => import("../_chunks/ko-C_MXyOM9.mjs"), "./translations/pl.json": () => import("../_chunks/pl-6hJT3Sda.mjs"), "./translations/ru.json": () => import("../_chunks/ru-DnVqFddA.mjs"), "./translations/sv.json": () => import("../_chunks/sv-DjL9wmwK.mjs"), "./translations/tr.json": () => import("../_chunks/tr-BKL2AN-d.mjs"), "./translations/vi.json": () => import("../_chunks/vi-DLBe31mD.mjs"), "./translations/zh.json": () => import("../_chunks/zh-5kkOa7U5.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
124
132
|
return {
|
|
125
133
|
data: prefixPluginTranslations(data, pluginId),
|
|
126
134
|
locale
|
package/dist/admin/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../admin/src/pluginId.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../admin/src/pluginId.ts","../../admin/src/utils/prefixPluginTranslations.ts","../../admin/src/index.ts"],"sourcesContent":["export const pluginId = 'sentry';\n","type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n","import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\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":["pluginId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,WAAW;ACExB,MAAM,2BAA2B,CAAC,MAAmBA,cAAkC;AACrF,MAAI,CAACA,WAAU;AACP,UAAA,IAAI,UAAU,yBAAyB;AAAA,EAC/C;AACA,SAAO,OAAO,KAAK,IAAI,EAAE,OAAO,CAAC,KAAK,YAAY;AAChD,QAAI,GAAGA,SAAQ,IAAI,OAAO,EAAE,IAAI,KAAK,OAAO;AACrC,WAAA;AAAA,EACT,GAAG,CAAiB,CAAA;AACtB;ACLA,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;"}
|
package/dist/server/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const bootstrap = async ({ strapi }) => {
|
|
|
53
53
|
const createSentryService = (strapi) => {
|
|
54
54
|
let isReady = false;
|
|
55
55
|
let instance = null;
|
|
56
|
-
const config2 = strapi.config.get("plugin
|
|
56
|
+
const config2 = strapi.config.get("plugin::sentry");
|
|
57
57
|
return {
|
|
58
58
|
/**
|
|
59
59
|
* Initialize Sentry service
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +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 {
|
|
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 { Core } 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: Core.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 { Core } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n","import type { Core } from '@strapi/strapi';\nimport type { Config } from 'src/config';\nimport * as Sentry from '@sentry/node';\n\nconst createSentryService = (strapi: Core.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: Core.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,MAAsC;AACtD,QAAM,gBAAwD,OAC3D,OAAO,QAAQ,EACf,QAAQ,QAAQ;AACnB,gBA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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,MAA+B,oBAAoB,MAAM;ACxElF,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;;"}
|
package/dist/server/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ const bootstrap = async ({ strapi }) => {
|
|
|
33
33
|
const createSentryService = (strapi) => {
|
|
34
34
|
let isReady = false;
|
|
35
35
|
let instance = null;
|
|
36
|
-
const config2 = strapi.config.get("plugin
|
|
36
|
+
const config2 = strapi.config.get("plugin::sentry");
|
|
37
37
|
return {
|
|
38
38
|
/**
|
|
39
39
|
* Initialize Sentry service
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","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 {
|
|
1
|
+
{"version":3,"file":"index.mjs","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 { Core } 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: Core.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 { Core } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n","import type { Core } from '@strapi/strapi';\nimport type { Config } from 'src/config';\nimport * as Sentry from '@sentry/node';\n\nconst createSentryService = (strapi: Core.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: Core.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"],"mappings":";AAOA,MAAA,uBAAe,CAAC,EAAE,OAAA,MAAsC;AACtD,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;AAA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jC;AAAA,IACH;AAAA,EAAA;AAEJ;AAEA,MAAe,SAAA,CAAC,EAAE,OAAO,MAA+B,oBAAoB,MAAM;ACxElF,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;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;qCAGT;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;AAAzD,wBAGE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: () => {
|
|
2
2
|
bootstrap: ({ strapi }: {
|
|
3
|
-
strapi: import("@strapi/types").Strapi;
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
4
|
}) => Promise<void>;
|
|
5
5
|
config: {
|
|
6
6
|
default: {
|
|
@@ -12,11 +12,11 @@ declare const _default: () => {
|
|
|
12
12
|
};
|
|
13
13
|
services: {
|
|
14
14
|
sentry: ({ strapi }: {
|
|
15
|
-
strapi: import("@strapi/types").Strapi;
|
|
15
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
16
16
|
}) => {
|
|
17
17
|
init(): any;
|
|
18
18
|
getInstance(): typeof import("@sentry/node") | null;
|
|
19
|
-
sendError(error: Error, configureScope?: ((scope: import("@sentry/
|
|
19
|
+
sendError(error: Error, configureScope?: ((scope: import("@sentry/core").Scope) => void) | undefined): void;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Core } from '@strapi/strapi';
|
|
2
2
|
/**
|
|
3
3
|
* Programmatic sentry middleware. We do not want to expose it in the plugin
|
|
4
4
|
*/
|
|
5
5
|
declare const _default: ({ strapi }: {
|
|
6
|
-
strapi: Strapi;
|
|
6
|
+
strapi: Core.Strapi;
|
|
7
7
|
}) => void;
|
|
8
8
|
export default _default;
|
|
9
9
|
//# sourceMappingURL=sentry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../../../server/src/middlewares/sentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../../../server/src/middlewares/sentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C;;GAEG;qCACyB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;AAAnD,wBAqCE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
sentry: ({ strapi }: {
|
|
3
|
-
strapi: import("@strapi/types").Strapi;
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
4
|
}) => {
|
|
5
5
|
init(): any;
|
|
6
6
|
getInstance(): typeof import("@sentry/node") | null;
|
|
7
|
-
sendError(error: Error, configureScope?: ((scope: import("@sentry/
|
|
7
|
+
sendError(error: Error, configureScope?: ((scope: import("@sentry/core").Scope) => void) | undefined): void;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../../../server/src/services/sentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../../../server/src/services/sentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;qCAwEX;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;IA9D/C;;OAEG;;IA8BH;;OAEG;;IAKH;;OAEG;;;AAqBP,wBAAoF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-sentry",
|
|
3
|
-
"version": "0.0.0-experimental.
|
|
3
|
+
"version": "0.0.0-experimental.abc",
|
|
4
4
|
"description": "Send Strapi error events to Sentry",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,33 +42,33 @@
|
|
|
42
42
|
"strapi-server.js"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
-
"build": "strapi
|
|
45
|
+
"build": "strapi-plugin build",
|
|
46
46
|
"clean": "run -T rimraf dist",
|
|
47
47
|
"lint": "run -T eslint .",
|
|
48
48
|
"test:unit": "run -T jest",
|
|
49
49
|
"test:unit:watch": "run -T jest --watch",
|
|
50
|
-
"watch": "strapi
|
|
50
|
+
"watch": "strapi-plugin watch"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@sentry/node": "
|
|
54
|
-
"@strapi/design-system": "
|
|
55
|
-
"@strapi/
|
|
56
|
-
"@strapi/icons": "1.18.0"
|
|
53
|
+
"@sentry/node": "7.112.2",
|
|
54
|
+
"@strapi/design-system": "2.0.0-rc.7",
|
|
55
|
+
"@strapi/icons": "2.0.0-rc.7"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@strapi/pack-up": "
|
|
60
|
-
"@strapi/
|
|
61
|
-
"
|
|
62
|
-
"react
|
|
63
|
-
"react-
|
|
64
|
-
"
|
|
58
|
+
"@strapi/pack-up": "5.0.0",
|
|
59
|
+
"@strapi/sdk-plugin": "^5.0.0",
|
|
60
|
+
"@strapi/strapi": "0.0.0-experimental.abc",
|
|
61
|
+
"react": "18.3.1",
|
|
62
|
+
"react-dom": "18.3.1",
|
|
63
|
+
"react-router-dom": "6.22.3",
|
|
64
|
+
"styled-components": "6.1.8"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@strapi/strapi": "^
|
|
67
|
+
"@strapi/strapi": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
68
68
|
"react": "^17.0.0 || ^18.0.0",
|
|
69
69
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
70
|
-
"react-router-dom": "^
|
|
71
|
-
"styled-components": "^
|
|
70
|
+
"react-router-dom": "^6.0.0",
|
|
71
|
+
"styled-components": "^6.0.0"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=18.0.0 <=20.x.x",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"description": "Send Strapi error events to Sentry.",
|
|
81
81
|
"kind": "plugin"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "fb442e5e12dd3f611303691bf85a249520ba348b"
|
|
84
84
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dk-ACiZv75I.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dk-Ht5BJvwV.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en--hlKpBzk.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-vyox7ZSC.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"es-21jfFVzQ.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"es-tPYrS3N2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fr-2usi50FD.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fr-8muIKZms.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ko-NdEnkB5D.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ko-nuQP7I5M.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pl-5DTLh5PW.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pl-cdsG7ySn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ru-KtwsGCNm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ru-_BJx1_V5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sv-QDPLOKcT.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sv-YocrQXH3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tr-W6PupknE.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tr-nkbjyt2S.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vi-10CsgDK2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vi-hEp1hNio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zh-WWNi5hqs.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zh-uRG2X3qF.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|