@strapi/plugin-sentry 5.50.1 → 5.50.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.js","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport
|
|
1
|
+
{"version":3,"file":"sentry.js","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport * as Sentry from '@sentry/node';\nimport type { Config } from '../config';\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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.mjs","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport
|
|
1
|
+
{"version":3,"file":"sentry.mjs","sources":["../../../server/src/services/sentry.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport * as Sentry from '@sentry/node';\nimport type { Config } from '../config';\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,6 +1,6 @@
|
|
|
1
1
|
declare const _default: () => {
|
|
2
2
|
bootstrap: ({ strapi }: {
|
|
3
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
3
|
+
strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
|
|
4
4
|
}) => Promise<void>;
|
|
5
5
|
config: {
|
|
6
6
|
default: {
|
|
@@ -12,7 +12,7 @@ declare const _default: () => {
|
|
|
12
12
|
};
|
|
13
13
|
services: {
|
|
14
14
|
sentry: ({ strapi }: {
|
|
15
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
15
|
+
strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
|
|
16
16
|
}) => {
|
|
17
17
|
init(): /*elided*/ any;
|
|
18
18
|
getInstance(): typeof import("@sentry/node") | null;
|
|
@@ -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;
|
|
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;AAC3C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;yBAyEvB,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-sentry",
|
|
3
|
-
"version": "5.50.
|
|
3
|
+
"version": "5.50.2",
|
|
4
4
|
"description": "Send Strapi error events to Sentry",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -51,18 +51,23 @@
|
|
|
51
51
|
"build:types:server": "run -T tsc -p server/tsconfig.build.json --emitDeclarationOnly",
|
|
52
52
|
"build:types:admin": "run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly",
|
|
53
53
|
"clean": "run -T rimraf dist",
|
|
54
|
-
"lint": "run -T eslint .",
|
|
54
|
+
"lint": "run -T eslint . --max-warnings=0",
|
|
55
|
+
"test:ts:back": "run -T tsc -p server/tsconfig.json",
|
|
56
|
+
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
55
57
|
"test:unit": "run -T jest",
|
|
56
58
|
"test:unit:watch": "run -T jest --watch",
|
|
57
59
|
"watch": "run -T rollup -c -w"
|
|
58
60
|
},
|
|
59
61
|
"dependencies": {
|
|
60
62
|
"@sentry/node": "7.112.2",
|
|
61
|
-
"@strapi/design-system": "2.2.
|
|
62
|
-
"@strapi/icons": "2.2.
|
|
63
|
+
"@strapi/design-system": "2.2.3",
|
|
64
|
+
"@strapi/icons": "2.2.3"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
|
-
"@strapi/strapi": "5.50.
|
|
67
|
+
"@strapi/strapi": "5.50.2",
|
|
68
|
+
"@types/jest": "29.5.2",
|
|
69
|
+
"@types/node": "20.19.41",
|
|
70
|
+
"jest": "29.6.0",
|
|
66
71
|
"react": "18.3.1",
|
|
67
72
|
"react-dom": "18.3.1",
|
|
68
73
|
"react-router-dom": "6.30.3",
|