@strapi/plugin-sentry 5.48.1 → 5.49.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.
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var Sentry = require('@sentry/node');
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
6
7
|
var n = Object.create(null);
|
|
7
8
|
if (e) {
|
|
8
9
|
Object.keys(e).forEach(function (k) {
|
|
@@ -19,7 +20,7 @@ function _interopNamespaceDefault(e) {
|
|
|
19
20
|
return Object.freeze(n);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
var Sentry__namespace = /*#__PURE__*/
|
|
23
|
+
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
23
24
|
|
|
24
25
|
const createSentryService = (strapi)=>{
|
|
25
26
|
let isReady = false;
|
|
@@ -1 +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":"
|
|
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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-sentry",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.49.0",
|
|
4
4
|
"description": "Send Strapi error events to Sentry",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@strapi/icons": "2.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@strapi/strapi": "5.
|
|
65
|
+
"@strapi/strapi": "5.49.0",
|
|
66
66
|
"react": "18.3.1",
|
|
67
67
|
"react-dom": "18.3.1",
|
|
68
68
|
"react-router-dom": "6.30.3",
|