@strapi/plugin-sentry 0.0.0-experimental.62ce06180fe9a772eaeb3d43d238b26644f39f7c → 0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282
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/README.md +1 -1
- package/dist/admin/index.js +58 -146
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +54 -147
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/package.json.js +13 -0
- package/dist/admin/package.json.js.map +1 -0
- package/dist/admin/package.json.mjs +8 -0
- package/dist/admin/package.json.mjs.map +1 -0
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/src/index.d.ts +2 -1
- package/dist/admin/translations/cs.json.js +10 -0
- package/dist/admin/translations/cs.json.js.map +1 -0
- package/dist/admin/translations/cs.json.mjs +8 -0
- package/dist/admin/translations/cs.json.mjs.map +1 -0
- package/dist/admin/translations/da.json.js +10 -0
- package/dist/admin/translations/da.json.js.map +1 -0
- package/dist/admin/translations/da.json.mjs +8 -0
- package/dist/admin/translations/da.json.mjs.map +1 -0
- package/dist/admin/translations/en.json.js +10 -0
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/translations/en.json.mjs +8 -0
- package/dist/admin/translations/en.json.mjs.map +1 -0
- package/dist/admin/translations/es.json.js +10 -0
- package/dist/admin/translations/es.json.js.map +1 -0
- package/dist/admin/translations/es.json.mjs +8 -0
- package/dist/admin/translations/es.json.mjs.map +1 -0
- package/dist/admin/translations/fr.json.js +10 -0
- package/dist/admin/translations/fr.json.js.map +1 -0
- package/dist/admin/translations/fr.json.mjs +8 -0
- package/dist/admin/translations/fr.json.mjs.map +1 -0
- package/dist/admin/translations/ko.json.js +10 -0
- package/dist/admin/translations/ko.json.js.map +1 -0
- package/dist/admin/translations/ko.json.mjs +8 -0
- package/dist/admin/translations/ko.json.mjs.map +1 -0
- package/dist/admin/translations/pl.json.js +10 -0
- package/dist/admin/translations/pl.json.js.map +1 -0
- package/dist/admin/translations/pl.json.mjs +8 -0
- package/dist/admin/translations/pl.json.mjs.map +1 -0
- package/dist/admin/translations/ru.json.js +10 -0
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/translations/ru.json.mjs +8 -0
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/translations/sk.json.js +10 -0
- package/dist/admin/translations/sk.json.js.map +1 -0
- package/dist/admin/translations/sk.json.mjs +8 -0
- package/dist/admin/translations/sk.json.mjs.map +1 -0
- package/dist/admin/translations/sv.json.js +10 -0
- package/dist/admin/translations/sv.json.js.map +1 -0
- package/dist/admin/translations/sv.json.mjs +8 -0
- package/dist/admin/translations/sv.json.mjs.map +1 -0
- package/dist/admin/translations/tr.json.js +10 -0
- package/dist/admin/translations/tr.json.js.map +1 -0
- package/dist/admin/translations/tr.json.mjs +8 -0
- package/dist/admin/translations/tr.json.mjs.map +1 -0
- package/dist/admin/translations/uk.json.js +10 -0
- package/dist/admin/translations/uk.json.js.map +1 -0
- package/dist/admin/translations/uk.json.mjs +8 -0
- package/dist/admin/translations/uk.json.mjs.map +1 -0
- package/dist/admin/translations/vi.json.js +10 -0
- package/dist/admin/translations/vi.json.js.map +1 -0
- package/dist/admin/translations/vi.json.mjs +8 -0
- package/dist/admin/translations/vi.json.mjs.map +1 -0
- package/dist/admin/translations/zh.json.js +10 -0
- package/dist/admin/translations/zh.json.js.map +1 -0
- package/dist/admin/translations/zh.json.mjs +8 -0
- package/dist/admin/translations/zh.json.mjs.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.js +11 -0
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
- package/dist/server/bootstrap.js +13 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +11 -0
- package/dist/server/bootstrap.mjs.map +1 -0
- package/dist/server/config.js +13 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/config.mjs +11 -0
- package/dist/server/config.mjs.map +1 -0
- package/dist/server/index.js +12 -122
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +11 -105
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/middlewares/sentry.js +39 -0
- package/dist/server/middlewares/sentry.js.map +1 -0
- package/dist/server/middlewares/sentry.mjs +37 -0
- package/dist/server/middlewares/sentry.mjs.map +1 -0
- package/dist/server/services/index.js +10 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +8 -0
- package/dist/server/services/index.mjs.map +1 -0
- package/dist/server/services/sentry.js +84 -0
- package/dist/server/services/sentry.js.map +1 -0
- package/dist/server/services/sentry.mjs +62 -0
- package/dist/server/services/sentry.mjs.map +1 -0
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/index.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 +21 -17
- package/dist/_chunks/dk-D9TLFbt6.mjs +0 -9
- package/dist/_chunks/dk-D9TLFbt6.mjs.map +0 -1
- package/dist/_chunks/dk-NQyAzZiU.js +0 -9
- package/dist/_chunks/dk-NQyAzZiU.js.map +0 -1
- package/dist/_chunks/en-CegwVP3M.mjs +0 -9
- package/dist/_chunks/en-CegwVP3M.mjs.map +0 -1
- package/dist/_chunks/en-bbgXRWo3.js +0 -9
- package/dist/_chunks/en-bbgXRWo3.js.map +0 -1
- package/dist/_chunks/es-31ok883l.js +0 -9
- package/dist/_chunks/es-31ok883l.js.map +0 -1
- package/dist/_chunks/es-DxC1UwjP.mjs +0 -9
- package/dist/_chunks/es-DxC1UwjP.mjs.map +0 -1
- package/dist/_chunks/fr-6Xd8HjNA.js +0 -9
- package/dist/_chunks/fr-6Xd8HjNA.js.map +0 -1
- package/dist/_chunks/fr-BRlwHIG8.mjs +0 -9
- package/dist/_chunks/fr-BRlwHIG8.mjs.map +0 -1
- package/dist/_chunks/ko-C_MXyOM9.mjs +0 -9
- package/dist/_chunks/ko-C_MXyOM9.mjs.map +0 -1
- package/dist/_chunks/ko-DdXSFVkr.js +0 -9
- package/dist/_chunks/ko-DdXSFVkr.js.map +0 -1
- package/dist/_chunks/pl-6hJT3Sda.mjs +0 -9
- package/dist/_chunks/pl-6hJT3Sda.mjs.map +0 -1
- package/dist/_chunks/pl-KE2e7O1o.js +0 -9
- package/dist/_chunks/pl-KE2e7O1o.js.map +0 -1
- package/dist/_chunks/ru-C41W13kt.js +0 -9
- package/dist/_chunks/ru-C41W13kt.js.map +0 -1
- package/dist/_chunks/ru-DnVqFddA.mjs +0 -9
- package/dist/_chunks/ru-DnVqFddA.mjs.map +0 -1
- package/dist/_chunks/sv-DCUFAW2Z.js +0 -9
- package/dist/_chunks/sv-DCUFAW2Z.js.map +0 -1
- package/dist/_chunks/sv-DjL9wmwK.mjs +0 -9
- package/dist/_chunks/sv-DjL9wmwK.mjs.map +0 -1
- package/dist/_chunks/tr-BKL2AN-d.mjs +0 -9
- package/dist/_chunks/tr-BKL2AN-d.mjs.map +0 -1
- package/dist/_chunks/tr-DgnL-Yfr.js +0 -9
- package/dist/_chunks/tr-DgnL-Yfr.js.map +0 -1
- package/dist/_chunks/vi-DLBe31mD.mjs +0 -9
- package/dist/_chunks/vi-DLBe31mD.mjs.map +0 -1
- package/dist/_chunks/vi-E2aG_wR_.js +0 -9
- package/dist/_chunks/vi-E2aG_wR_.js.map +0 -1
- package/dist/_chunks/zh-5kkOa7U5.mjs +0 -9
- package/dist/_chunks/zh-5kkOa7U5.mjs.map +0 -1
- package/dist/_chunks/zh-Uq7oN9Sz.js +0 -9
- package/dist/_chunks/zh-Uq7oN9Sz.js.map +0 -1
- package/strapi-server.js +0 -3
package/dist/server/index.mjs
CHANGED
|
@@ -1,106 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} catch (error) {
|
|
13
|
-
if (error instanceof Error) {
|
|
14
|
-
sentryService.sendError(error, (scope) => {
|
|
15
|
-
scope.addEventProcessor((event) => {
|
|
16
|
-
return sentry2.Handlers.parseRequest(event, ctx.request, {
|
|
17
|
-
// Don't parse the transaction name, we'll do it manually
|
|
18
|
-
transaction: false
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
scope.setTag("transaction", `${ctx.method} ${ctx._matchedRoute}`);
|
|
22
|
-
scope.setTag("strapi_version", strapi.config.info.strapi);
|
|
23
|
-
scope.setTag("method", ctx.method);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
throw error;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
const bootstrap = async ({ strapi }) => {
|
|
31
|
-
initSentryMiddleware({ strapi });
|
|
32
|
-
};
|
|
33
|
-
const createSentryService = (strapi) => {
|
|
34
|
-
let isReady = false;
|
|
35
|
-
let instance = null;
|
|
36
|
-
const config2 = strapi.config.get("plugin::sentry");
|
|
37
|
-
return {
|
|
38
|
-
/**
|
|
39
|
-
* Initialize Sentry service
|
|
40
|
-
*/
|
|
41
|
-
init() {
|
|
42
|
-
if (instance != null) {
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
if (!config2.dsn) {
|
|
46
|
-
strapi.log.info("@strapi/plugin-sentry is disabled because no Sentry DSN was provided");
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
Sentry.init({
|
|
51
|
-
dsn: config2.dsn,
|
|
52
|
-
environment: strapi.config.get("environment"),
|
|
53
|
-
...config2.init
|
|
54
|
-
});
|
|
55
|
-
instance = Sentry;
|
|
56
|
-
isReady = true;
|
|
57
|
-
} catch (error) {
|
|
58
|
-
strapi.log.warn("Could not set up Sentry, make sure you entered a valid DSN");
|
|
59
|
-
}
|
|
60
|
-
return this;
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* Expose Sentry instance through a getter
|
|
64
|
-
*/
|
|
65
|
-
getInstance() {
|
|
66
|
-
return instance;
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* Higher level method to send exception events to Sentry
|
|
70
|
-
*/
|
|
71
|
-
sendError(error, configureScope) {
|
|
72
|
-
if (!isReady || !instance) {
|
|
73
|
-
strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
instance.withScope((scope) => {
|
|
77
|
-
if (configureScope && config2.sendMetadata) {
|
|
78
|
-
configureScope(scope);
|
|
79
|
-
}
|
|
80
|
-
instance?.captureException(error);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
const sentry = ({ strapi }) => createSentryService(strapi);
|
|
86
|
-
const services = {
|
|
87
|
-
sentry
|
|
88
|
-
};
|
|
89
|
-
const config = {
|
|
90
|
-
default: {
|
|
91
|
-
dsn: null,
|
|
92
|
-
sendMetadata: true,
|
|
93
|
-
init: {}
|
|
94
|
-
},
|
|
95
|
-
validator() {
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const index = () => ({
|
|
99
|
-
bootstrap,
|
|
100
|
-
config,
|
|
101
|
-
services
|
|
102
|
-
});
|
|
103
|
-
export {
|
|
104
|
-
index as default
|
|
105
|
-
};
|
|
1
|
+
import bootstrap from './bootstrap.mjs';
|
|
2
|
+
import services from './services/index.mjs';
|
|
3
|
+
import config from './config.mjs';
|
|
4
|
+
|
|
5
|
+
var index = (()=>({
|
|
6
|
+
bootstrap,
|
|
7
|
+
config,
|
|
8
|
+
services
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
export { index as default };
|
|
106
12
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../server/src/
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import bootstrap from './bootstrap';\nimport services from './services';\nimport config from './config';\n\nexport default () => ({\n bootstrap,\n config,\n services,\n});\n"],"names":["bootstrap","config","services"],"mappings":";;;;AAIA,YAAe,CAAA,KAAO;AACpBA,QAAAA,SAAAA;AACAC,QAAAA,MAAAA;AACAC,QAAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Programmatic sentry middleware. We do not want to expose it in the plugin
|
|
5
|
+
*/ var initSentryMiddleware = (({ strapi })=>{
|
|
6
|
+
const sentryService = strapi.plugin('sentry').service('sentry');
|
|
7
|
+
sentryService.init();
|
|
8
|
+
const sentry = sentryService.getInstance();
|
|
9
|
+
if (!sentry) {
|
|
10
|
+
// initialization failed
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
strapi.server.use(async (ctx, next)=>{
|
|
14
|
+
try {
|
|
15
|
+
await next();
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (error instanceof Error) {
|
|
18
|
+
sentryService.sendError(error, (scope)=>{
|
|
19
|
+
scope.addEventProcessor((event)=>{
|
|
20
|
+
// Parse Koa context to add error metadata
|
|
21
|
+
return sentry.Handlers.parseRequest(event, ctx.request, {
|
|
22
|
+
// Don't parse the transaction name, we'll do it manually
|
|
23
|
+
transaction: false
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
// Manually add transaction name
|
|
27
|
+
scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);
|
|
28
|
+
// Manually add Strapi version
|
|
29
|
+
scope.setTag('strapi_version', strapi.config.info.strapi);
|
|
30
|
+
scope.setTag('method', ctx.method);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
module.exports = initSentryMiddleware;
|
|
39
|
+
//# sourceMappingURL=sentry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.js","sources":["../../../server/src/middlewares/sentry.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"],"names":["strapi","sentryService","plugin","service","init","sentry","getInstance","server","use","ctx","next","error","Error","sendError","scope","addEventProcessor","event","Handlers","parseRequest","request","transaction","setTag","method","_matchedRoute","config","info"],"mappings":";;AAIA;;AAEC,IACD,2BAAe,CAAA,CAAC,EAAEA,MAAM,EAA2B,GAAA;AACjD,IAAA,MAAMC,gBAAwDD,MAAAA,CAC3DE,MAAM,CAAC,QAAA,CAAA,CACPC,OAAO,CAAC,QAAA,CAAA;AACXF,IAAAA,aAAAA,CAAcG,IAAI,EAAA;IAClB,MAAMC,MAAAA,GAASJ,cAAcK,WAAW,EAAA;AAExC,IAAA,IAAI,CAACD,MAAAA,EAAQ;;AAEX,QAAA;AACF,IAAA;AAEAL,IAAAA,MAAAA,CAAOO,MAAM,CAACC,GAAG,CAAC,OAAOC,GAAAA,EAAKC,IAAAA,GAAAA;QAC5B,IAAI;YACF,MAAMA,IAAAA,EAAAA;AACR,QAAA,CAAA,CAAE,OAAOC,KAAAA,EAAO;AACd,YAAA,IAAIA,iBAAiBC,KAAAA,EAAO;gBAC1BX,aAAAA,CAAcY,SAAS,CAACF,KAAAA,EAAO,CAACG,KAAAA,GAAAA;oBAC9BA,KAAAA,CAAMC,iBAAiB,CAAC,CAACC,KAAAA,GAAAA;;wBAEvB,OAAOX,MAAAA,CAAOY,QAAQ,CAACC,YAAY,CAACF,KAAAA,EAAOP,GAAAA,CAAIU,OAAO,EAAoB;;4BAExEC,WAAAA,EAAa;AACf,yBAAA,CAAA;AACF,oBAAA,CAAA,CAAA;;oBAGAN,KAAAA,CAAMO,MAAM,CAAC,aAAA,EAAe,CAAA,EAAGZ,GAAAA,CAAIa,MAAM,CAAC,CAAC,EAAEb,GAAAA,CAAIc,aAAa,CAAA,CAAE,CAAA;;oBAEhET,KAAAA,CAAMO,MAAM,CAAC,gBAAA,EAAkBrB,MAAAA,CAAOwB,MAAM,CAACC,IAAI,CAACzB,MAAM,CAAA;AACxDc,oBAAAA,KAAAA,CAAMO,MAAM,CAAC,QAAA,EAAUZ,GAAAA,CAAIa,MAAM,CAAA;AACnC,gBAAA,CAAA,CAAA;AACF,YAAA;YAEA,MAAMX,KAAAA;AACR,QAAA;AACF,IAAA,CAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic sentry middleware. We do not want to expose it in the plugin
|
|
3
|
+
*/ var initSentryMiddleware = (({ strapi })=>{
|
|
4
|
+
const sentryService = strapi.plugin('sentry').service('sentry');
|
|
5
|
+
sentryService.init();
|
|
6
|
+
const sentry = sentryService.getInstance();
|
|
7
|
+
if (!sentry) {
|
|
8
|
+
// initialization failed
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
strapi.server.use(async (ctx, next)=>{
|
|
12
|
+
try {
|
|
13
|
+
await next();
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (error instanceof Error) {
|
|
16
|
+
sentryService.sendError(error, (scope)=>{
|
|
17
|
+
scope.addEventProcessor((event)=>{
|
|
18
|
+
// Parse Koa context to add error metadata
|
|
19
|
+
return sentry.Handlers.parseRequest(event, ctx.request, {
|
|
20
|
+
// Don't parse the transaction name, we'll do it manually
|
|
21
|
+
transaction: false
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
// Manually add transaction name
|
|
25
|
+
scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);
|
|
26
|
+
// Manually add Strapi version
|
|
27
|
+
scope.setTag('strapi_version', strapi.config.info.strapi);
|
|
28
|
+
scope.setTag('method', ctx.method);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { initSentryMiddleware as default };
|
|
37
|
+
//# sourceMappingURL=sentry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.mjs","sources":["../../../server/src/middlewares/sentry.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"],"names":["strapi","sentryService","plugin","service","init","sentry","getInstance","server","use","ctx","next","error","Error","sendError","scope","addEventProcessor","event","Handlers","parseRequest","request","transaction","setTag","method","_matchedRoute","config","info"],"mappings":"AAIA;;AAEC,IACD,2BAAe,CAAA,CAAC,EAAEA,MAAM,EAA2B,GAAA;AACjD,IAAA,MAAMC,gBAAwDD,MAAAA,CAC3DE,MAAM,CAAC,QAAA,CAAA,CACPC,OAAO,CAAC,QAAA,CAAA;AACXF,IAAAA,aAAAA,CAAcG,IAAI,EAAA;IAClB,MAAMC,MAAAA,GAASJ,cAAcK,WAAW,EAAA;AAExC,IAAA,IAAI,CAACD,MAAAA,EAAQ;;AAEX,QAAA;AACF,IAAA;AAEAL,IAAAA,MAAAA,CAAOO,MAAM,CAACC,GAAG,CAAC,OAAOC,GAAAA,EAAKC,IAAAA,GAAAA;QAC5B,IAAI;YACF,MAAMA,IAAAA,EAAAA;AACR,QAAA,CAAA,CAAE,OAAOC,KAAAA,EAAO;AACd,YAAA,IAAIA,iBAAiBC,KAAAA,EAAO;gBAC1BX,aAAAA,CAAcY,SAAS,CAACF,KAAAA,EAAO,CAACG,KAAAA,GAAAA;oBAC9BA,KAAAA,CAAMC,iBAAiB,CAAC,CAACC,KAAAA,GAAAA;;wBAEvB,OAAOX,MAAAA,CAAOY,QAAQ,CAACC,YAAY,CAACF,KAAAA,EAAOP,GAAAA,CAAIU,OAAO,EAAoB;;4BAExEC,WAAAA,EAAa;AACf,yBAAA,CAAA;AACF,oBAAA,CAAA,CAAA;;oBAGAN,KAAAA,CAAMO,MAAM,CAAC,aAAA,EAAe,CAAA,EAAGZ,GAAAA,CAAIa,MAAM,CAAC,CAAC,EAAEb,GAAAA,CAAIc,aAAa,CAAA,CAAE,CAAA;;oBAEhET,KAAAA,CAAMO,MAAM,CAAC,gBAAA,EAAkBrB,MAAAA,CAAOwB,MAAM,CAACC,IAAI,CAACzB,MAAM,CAAA;AACxDc,oBAAAA,KAAAA,CAAMO,MAAM,CAAC,QAAA,EAAUZ,GAAAA,CAAIa,MAAM,CAAA;AACnC,gBAAA,CAAA,CAAA;AACF,YAAA;YAEA,MAAMX,KAAAA;AACR,QAAA;AACF,IAAA,CAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import sentry from './sentry';\n\nexport default {\n sentry,\n};\n"],"names":["sentry"],"mappings":";;;;AAEA,eAAe;AACbA,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../server/src/services/index.ts"],"sourcesContent":["import sentry from './sentry';\n\nexport default {\n sentry,\n};\n"],"names":["sentry"],"mappings":";;AAEA,eAAe;AACbA,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Sentry = require('@sentry/node');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
24
|
+
|
|
25
|
+
const createSentryService = (strapi)=>{
|
|
26
|
+
let isReady = false;
|
|
27
|
+
let instance = null;
|
|
28
|
+
// Retrieve user config and merge it with the default one
|
|
29
|
+
const config = strapi.config.get('plugin::sentry');
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
* Initialize Sentry service
|
|
33
|
+
*/ init () {
|
|
34
|
+
// Make sure there isn't a Sentry instance already running
|
|
35
|
+
if (instance != null) {
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
// Don't init Sentry if no DSN was provided
|
|
39
|
+
if (!config.dsn) {
|
|
40
|
+
strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
Sentry__namespace.init({
|
|
45
|
+
dsn: config.dsn,
|
|
46
|
+
environment: strapi.config.get('environment'),
|
|
47
|
+
...config.init
|
|
48
|
+
});
|
|
49
|
+
// Store the successfully initialized Sentry instance
|
|
50
|
+
instance = Sentry__namespace;
|
|
51
|
+
isReady = true;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');
|
|
54
|
+
}
|
|
55
|
+
return this;
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Expose Sentry instance through a getter
|
|
59
|
+
*/ getInstance () {
|
|
60
|
+
return instance;
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Higher level method to send exception events to Sentry
|
|
64
|
+
*/ sendError (error, configureScope) {
|
|
65
|
+
// Make sure Sentry is ready
|
|
66
|
+
if (!isReady || !instance) {
|
|
67
|
+
strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
instance.withScope((scope)=>{
|
|
71
|
+
// Configure the Sentry scope using the provided callback
|
|
72
|
+
if (configureScope && config.sendMetadata) {
|
|
73
|
+
configureScope(scope);
|
|
74
|
+
}
|
|
75
|
+
// Actually send the Error to Sentry
|
|
76
|
+
instance?.captureException(error);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
var sentry = (({ strapi })=>createSentryService(strapi));
|
|
82
|
+
|
|
83
|
+
module.exports = sentry;
|
|
84
|
+
//# sourceMappingURL=sentry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.js","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["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"],"names":["createSentryService","strapi","isReady","instance","config","get","init","dsn","log","info","Sentry","environment","error","warn","getInstance","sendError","configureScope","withScope","scope","sendMetadata","captureException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,sBAAsB,CAACC,MAAAA,GAAAA;AAC3B,IAAA,IAAIC,OAAAA,GAAU,KAAA;AACd,IAAA,IAAIC,QAAAA,GAAiC,IAAA;;AAGrC,IAAA,MAAMC,MAAAA,GAASH,MAAAA,CAAOG,MAAM,CAACC,GAAG,CAAC,gBAAA,CAAA;IAEjC,OAAO;AACL;;QAGAC,IAAAA,CAAAA,GAAAA;;AAEE,YAAA,IAAIH,YAAY,IAAA,EAAM;AACpB,gBAAA,OAAO,IAAI;AACb,YAAA;;YAGA,IAAI,CAACC,MAAAA,CAAOG,GAAG,EAAE;gBACfN,MAAAA,CAAOO,GAAG,CAACC,IAAI,CAAC,sEAAA,CAAA;AAChB,gBAAA,OAAO,IAAI;AACb,YAAA;YAEA,IAAI;AACFC,gBAAAA,iBAAAA,CAAOJ,IAAI,CAAC;AACVC,oBAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfI,oBAAAA,WAAAA,EAAaV,MAAAA,CAAOG,MAAM,CAACC,GAAG,CAAC,aAAA,CAAA;AAC/B,oBAAA,GAAGD,OAAOE;AACZ,iBAAA,CAAA;;gBAGAH,QAAAA,GAAWO,iBAAAA;gBACXR,OAAAA,GAAU,IAAA;AACZ,YAAA,CAAA,CAAE,OAAOU,KAAAA,EAAO;gBACdX,MAAAA,CAAOO,GAAG,CAACK,IAAI,CAAC,4DAAA,CAAA;AAClB,YAAA;AAEA,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEA;;QAGAC,WAAAA,CAAAA,GAAAA;YACE,OAAOX,QAAAA;AACT,QAAA,CAAA;AAEA;;QAGAY,SAAAA,CAAAA,CAAUH,KAAY,EAAEI,cAA8C,EAAA;;YAEpE,IAAI,CAACd,OAAAA,IAAW,CAACC,QAAAA,EAAU;gBACzBF,MAAAA,CAAOO,GAAG,CAACK,IAAI,CAAC,uDAAA,CAAA;AAChB,gBAAA;AACF,YAAA;YAEAV,QAAAA,CAASc,SAAS,CAAC,CAACC,KAAAA,GAAAA;;gBAElB,IAAIF,cAAAA,IAAkBZ,MAAAA,CAAOe,YAAY,EAAE;oBACzCH,cAAAA,CAAeE,KAAAA,CAAAA;AACjB,gBAAA;;AAGAf,gBAAAA,QAAAA,EAAUiB,gBAAAA,CAAiBR,KAAAA,CAAAA;AAC7B,YAAA,CAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;AAEA,aAAe,CAAA,CAAC,EAAEX,MAAM,EAA2B,GAAKD,mBAAAA,CAAoBC,OAAM;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/node';
|
|
2
|
+
|
|
3
|
+
const createSentryService = (strapi)=>{
|
|
4
|
+
let isReady = false;
|
|
5
|
+
let instance = null;
|
|
6
|
+
// Retrieve user config and merge it with the default one
|
|
7
|
+
const config = strapi.config.get('plugin::sentry');
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Initialize Sentry service
|
|
11
|
+
*/ init () {
|
|
12
|
+
// Make sure there isn't a Sentry instance already running
|
|
13
|
+
if (instance != null) {
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
// Don't init Sentry if no DSN was provided
|
|
17
|
+
if (!config.dsn) {
|
|
18
|
+
strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
Sentry.init({
|
|
23
|
+
dsn: config.dsn,
|
|
24
|
+
environment: strapi.config.get('environment'),
|
|
25
|
+
...config.init
|
|
26
|
+
});
|
|
27
|
+
// Store the successfully initialized Sentry instance
|
|
28
|
+
instance = Sentry;
|
|
29
|
+
isReady = true;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');
|
|
32
|
+
}
|
|
33
|
+
return this;
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Expose Sentry instance through a getter
|
|
37
|
+
*/ getInstance () {
|
|
38
|
+
return instance;
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Higher level method to send exception events to Sentry
|
|
42
|
+
*/ sendError (error, configureScope) {
|
|
43
|
+
// Make sure Sentry is ready
|
|
44
|
+
if (!isReady || !instance) {
|
|
45
|
+
strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
instance.withScope((scope)=>{
|
|
49
|
+
// Configure the Sentry scope using the provided callback
|
|
50
|
+
if (configureScope && config.sendMetadata) {
|
|
51
|
+
configureScope(scope);
|
|
52
|
+
}
|
|
53
|
+
// Actually send the Error to Sentry
|
|
54
|
+
instance?.captureException(error);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var sentry = (({ strapi })=>createSentryService(strapi));
|
|
60
|
+
|
|
61
|
+
export { sentry as default };
|
|
62
|
+
//# sourceMappingURL=sentry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.mjs","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["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"],"names":["createSentryService","strapi","isReady","instance","config","get","init","dsn","log","info","Sentry","environment","error","warn","getInstance","sendError","configureScope","withScope","scope","sendMetadata","captureException"],"mappings":";;AAIA,MAAMA,sBAAsB,CAACC,MAAAA,GAAAA;AAC3B,IAAA,IAAIC,OAAAA,GAAU,KAAA;AACd,IAAA,IAAIC,QAAAA,GAAiC,IAAA;;AAGrC,IAAA,MAAMC,MAAAA,GAASH,MAAAA,CAAOG,MAAM,CAACC,GAAG,CAAC,gBAAA,CAAA;IAEjC,OAAO;AACL;;QAGAC,IAAAA,CAAAA,GAAAA;;AAEE,YAAA,IAAIH,YAAY,IAAA,EAAM;AACpB,gBAAA,OAAO,IAAI;AACb,YAAA;;YAGA,IAAI,CAACC,MAAAA,CAAOG,GAAG,EAAE;gBACfN,MAAAA,CAAOO,GAAG,CAACC,IAAI,CAAC,sEAAA,CAAA;AAChB,gBAAA,OAAO,IAAI;AACb,YAAA;YAEA,IAAI;AACFC,gBAAAA,MAAAA,CAAOJ,IAAI,CAAC;AACVC,oBAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfI,oBAAAA,WAAAA,EAAaV,MAAAA,CAAOG,MAAM,CAACC,GAAG,CAAC,aAAA,CAAA;AAC/B,oBAAA,GAAGD,OAAOE;AACZ,iBAAA,CAAA;;gBAGAH,QAAAA,GAAWO,MAAAA;gBACXR,OAAAA,GAAU,IAAA;AACZ,YAAA,CAAA,CAAE,OAAOU,KAAAA,EAAO;gBACdX,MAAAA,CAAOO,GAAG,CAACK,IAAI,CAAC,4DAAA,CAAA;AAClB,YAAA;AAEA,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEA;;QAGAC,WAAAA,CAAAA,GAAAA;YACE,OAAOX,QAAAA;AACT,QAAA,CAAA;AAEA;;QAGAY,SAAAA,CAAAA,CAAUH,KAAY,EAAEI,cAA8C,EAAA;;YAEpE,IAAI,CAACd,OAAAA,IAAW,CAACC,QAAAA,EAAU;gBACzBF,MAAAA,CAAOO,GAAG,CAACK,IAAI,CAAC,uDAAA,CAAA;AAChB,gBAAA;AACF,YAAA;YAEAV,QAAAA,CAASc,SAAS,CAAC,CAACC,KAAAA,GAAAA;;gBAElB,IAAIF,cAAAA,IAAkBZ,MAAAA,CAAOe,YAAY,EAAE;oBACzCH,cAAAA,CAAeE,KAAAA,CAAAA;AACjB,gBAAA;;AAGAf,gBAAAA,QAAAA,EAAUiB,gBAAAA,CAAiBR,KAAAA,CAAAA;AAC7B,YAAA,CAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;AAEA,aAAe,CAAA,CAAC,EAAEX,MAAM,EAA2B,GAAKD,mBAAAA,CAAoBC,OAAM;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;yBAGrB,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;AAAzD,wBAGE"}
|
|
@@ -14,9 +14,9 @@ declare const _default: () => {
|
|
|
14
14
|
sentry: ({ strapi }: {
|
|
15
15
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
16
16
|
}) => {
|
|
17
|
-
init(): any;
|
|
17
|
+
init(): /*elided*/ any;
|
|
18
18
|
getInstance(): typeof import("@sentry/node") | null;
|
|
19
|
-
sendError(error: Error, configureScope?: (
|
|
19
|
+
sendError(error: Error, configureScope?: (scope: import("@sentry/core").Scope) => void): void;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;yBACa,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;AAAnD,wBAqCE"}
|
|
@@ -2,9 +2,9 @@ declare const _default: {
|
|
|
2
2
|
sentry: ({ strapi }: {
|
|
3
3
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
4
|
}) => {
|
|
5
|
-
init(): any;
|
|
5
|
+
init(): /*elided*/ any;
|
|
6
6
|
getInstance(): typeof import("@sentry/node") | null;
|
|
7
|
-
sendError(error: Error, configureScope?: (
|
|
7
|
+
sendError(error: Error, configureScope?: (scope: import("@sentry/core").Scope) => void): void;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -6,7 +6,7 @@ declare const _default: ({ strapi }: {
|
|
|
6
6
|
/**
|
|
7
7
|
* Initialize Sentry service
|
|
8
8
|
*/
|
|
9
|
-
init(): any;
|
|
9
|
+
init(): /*elided*/ any;
|
|
10
10
|
/**
|
|
11
11
|
* Expose Sentry instance through a getter
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@ declare const _default: ({ strapi }: {
|
|
|
14
14
|
/**
|
|
15
15
|
* Higher level method to send exception events to Sentry
|
|
16
16
|
*/
|
|
17
|
-
sendError(error: Error, configureScope?: (
|
|
17
|
+
sendError(error: Error, configureScope?: (scope: Sentry.Scope) => void): void;
|
|
18
18
|
};
|
|
19
19
|
export default _default;
|
|
20
20
|
//# sourceMappingURL=sentry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;yBAwEvB,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;IA9D/C;;OAEG;;IA8BH;;OAEG;;IAKH;;OAEG;qBACc,KAAK,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,KAAK,IAAI;;AAoB1E,wBAAoF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-sentry",
|
|
3
|
-
"version": "0.0.0-experimental.
|
|
3
|
+
"version": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
|
|
4
4
|
"description": "Send Strapi error events to Sentry",
|
|
5
|
+
"homepage": "https://strapi.io",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/strapi/strapi/issues"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/strapi/strapi.git",
|
|
@@ -38,40 +42,41 @@
|
|
|
38
42
|
"./package.json": "./package.json"
|
|
39
43
|
},
|
|
40
44
|
"files": [
|
|
41
|
-
"./dist"
|
|
42
|
-
"strapi-server.js"
|
|
45
|
+
"./dist"
|
|
43
46
|
],
|
|
44
47
|
"scripts": {
|
|
45
|
-
"build": "
|
|
48
|
+
"build": "run -T npm-run-all clean --parallel build:code build:types",
|
|
49
|
+
"build:code": "run -T rollup -c",
|
|
50
|
+
"build:types": "run -T run-p build:types:server build:types:admin",
|
|
51
|
+
"build:types:server": "run -T tsc -p server/tsconfig.build.json --emitDeclarationOnly",
|
|
52
|
+
"build:types:admin": "run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly",
|
|
46
53
|
"clean": "run -T rimraf dist",
|
|
47
54
|
"lint": "run -T eslint .",
|
|
48
55
|
"test:unit": "run -T jest",
|
|
49
56
|
"test:unit:watch": "run -T jest --watch",
|
|
50
|
-
"watch": "
|
|
57
|
+
"watch": "run -T rollup -c -w"
|
|
51
58
|
},
|
|
52
59
|
"dependencies": {
|
|
53
60
|
"@sentry/node": "7.112.2",
|
|
54
|
-
"@strapi/design-system": "2.
|
|
55
|
-
"@strapi/icons": "2.
|
|
61
|
+
"@strapi/design-system": "2.2.1",
|
|
62
|
+
"@strapi/icons": "2.2.1"
|
|
56
63
|
},
|
|
57
64
|
"devDependencies": {
|
|
58
|
-
"@strapi/
|
|
59
|
-
"@strapi/sdk-plugin": "^5.0.0",
|
|
60
|
-
"@strapi/strapi": "0.0.0-experimental.62ce06180fe9a772eaeb3d43d238b26644f39f7c",
|
|
65
|
+
"@strapi/strapi": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
|
|
61
66
|
"react": "18.3.1",
|
|
62
67
|
"react-dom": "18.3.1",
|
|
63
|
-
"react-router-dom": "6.
|
|
64
|
-
"styled-components": "6.1
|
|
68
|
+
"react-router-dom": "6.30.3",
|
|
69
|
+
"styled-components": "6.4.1"
|
|
65
70
|
},
|
|
66
71
|
"peerDependencies": {
|
|
67
|
-
"@strapi/strapi": "
|
|
72
|
+
"@strapi/strapi": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
|
|
68
73
|
"react": "^17.0.0 || ^18.0.0",
|
|
69
74
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
70
|
-
"react-router-dom": "^6.
|
|
75
|
+
"react-router-dom": "^6.30.3",
|
|
71
76
|
"styled-components": "^6.0.0"
|
|
72
77
|
},
|
|
73
78
|
"engines": {
|
|
74
|
-
"node": ">=
|
|
79
|
+
"node": ">=20.19.0 <=26.x.x",
|
|
75
80
|
"npm": ">=6.0.0"
|
|
76
81
|
},
|
|
77
82
|
"strapi": {
|
|
@@ -79,6 +84,5 @@
|
|
|
79
84
|
"displayName": "Sentry",
|
|
80
85
|
"description": "Send Strapi error events to Sentry.",
|
|
81
86
|
"kind": "plugin"
|
|
82
|
-
}
|
|
83
|
-
"gitHead": "62ce06180fe9a772eaeb3d43d238b26644f39f7c"
|
|
87
|
+
}
|
|
84
88
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dk-D9TLFbt6.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const dk = {
|
|
4
|
-
"plugin.description.long": "Send Strapi fejlevents til Sentry.",
|
|
5
|
-
"plugin.description.short": "Send Strapi fejlevents til Sentry.",
|
|
6
|
-
"plugin.name": "Sentry"
|
|
7
|
-
};
|
|
8
|
-
exports.default = dk;
|
|
9
|
-
//# sourceMappingURL=dk-NQyAzZiU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dk-NQyAzZiU.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-CegwVP3M.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const en = {
|
|
4
|
-
"plugin.description.long": "Send Strapi error events to Sentry.",
|
|
5
|
-
"plugin.description.short": "Send Strapi error events to Sentry.",
|
|
6
|
-
"plugin.name": "Sentry"
|
|
7
|
-
};
|
|
8
|
-
exports.default = en;
|
|
9
|
-
//# sourceMappingURL=en-bbgXRWo3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-bbgXRWo3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const es = {
|
|
4
|
-
"plugin.description.long": "Envíe los eventos de error de Strapi a Sentry.",
|
|
5
|
-
"plugin.description.short": "Envíe los eventos de error de Strapi a Sentry.",
|
|
6
|
-
"plugin.name": "Sentry"
|
|
7
|
-
};
|
|
8
|
-
exports.default = es;
|
|
9
|
-
//# sourceMappingURL=es-31ok883l.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"es-31ok883l.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|