@strapi/plugin-sentry 0.0.0-experimental.62ebf57bb35846666febb5ee2078fe02fe990f57 → 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.
Files changed (153) hide show
  1. package/README.md +1 -1
  2. package/dist/admin/index.js +58 -138
  3. package/dist/admin/index.js.map +1 -1
  4. package/dist/admin/index.mjs +54 -139
  5. package/dist/admin/index.mjs.map +1 -1
  6. package/dist/admin/package.json.js +13 -0
  7. package/dist/admin/package.json.js.map +1 -0
  8. package/dist/admin/package.json.mjs +8 -0
  9. package/dist/admin/package.json.mjs.map +1 -0
  10. package/dist/admin/pluginId.js +6 -0
  11. package/dist/admin/pluginId.js.map +1 -0
  12. package/dist/admin/pluginId.mjs +4 -0
  13. package/dist/admin/pluginId.mjs.map +1 -0
  14. package/dist/admin/src/index.d.ts +2 -1
  15. package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
  16. package/dist/admin/translations/cs.json.js +10 -0
  17. package/dist/admin/translations/cs.json.js.map +1 -0
  18. package/dist/admin/translations/cs.json.mjs +8 -0
  19. package/dist/admin/translations/cs.json.mjs.map +1 -0
  20. package/dist/admin/translations/da.json.js +10 -0
  21. package/dist/admin/translations/da.json.js.map +1 -0
  22. package/dist/admin/translations/da.json.mjs +8 -0
  23. package/dist/admin/translations/da.json.mjs.map +1 -0
  24. package/dist/admin/translations/en.json.js +10 -0
  25. package/dist/admin/translations/en.json.js.map +1 -0
  26. package/dist/admin/translations/en.json.mjs +8 -0
  27. package/dist/admin/translations/en.json.mjs.map +1 -0
  28. package/dist/admin/translations/es.json.js +10 -0
  29. package/dist/admin/translations/es.json.js.map +1 -0
  30. package/dist/admin/translations/es.json.mjs +8 -0
  31. package/dist/admin/translations/es.json.mjs.map +1 -0
  32. package/dist/admin/translations/fr.json.js +10 -0
  33. package/dist/admin/translations/fr.json.js.map +1 -0
  34. package/dist/admin/translations/fr.json.mjs +8 -0
  35. package/dist/admin/translations/fr.json.mjs.map +1 -0
  36. package/dist/admin/translations/ko.json.js +10 -0
  37. package/dist/admin/translations/ko.json.js.map +1 -0
  38. package/dist/admin/translations/ko.json.mjs +8 -0
  39. package/dist/admin/translations/ko.json.mjs.map +1 -0
  40. package/dist/admin/translations/pl.json.js +10 -0
  41. package/dist/admin/translations/pl.json.js.map +1 -0
  42. package/dist/admin/translations/pl.json.mjs +8 -0
  43. package/dist/admin/translations/pl.json.mjs.map +1 -0
  44. package/dist/admin/translations/ru.json.js +10 -0
  45. package/dist/admin/translations/ru.json.js.map +1 -0
  46. package/dist/admin/translations/ru.json.mjs +8 -0
  47. package/dist/admin/translations/ru.json.mjs.map +1 -0
  48. package/dist/admin/translations/sk.json.js +10 -0
  49. package/dist/admin/translations/sk.json.js.map +1 -0
  50. package/dist/admin/translations/sk.json.mjs +8 -0
  51. package/dist/admin/translations/sk.json.mjs.map +1 -0
  52. package/dist/admin/translations/sv.json.js +10 -0
  53. package/dist/admin/translations/sv.json.js.map +1 -0
  54. package/dist/admin/translations/sv.json.mjs +8 -0
  55. package/dist/admin/translations/sv.json.mjs.map +1 -0
  56. package/dist/admin/translations/tr.json.js +10 -0
  57. package/dist/admin/translations/tr.json.js.map +1 -0
  58. package/dist/admin/translations/tr.json.mjs +8 -0
  59. package/dist/admin/translations/tr.json.mjs.map +1 -0
  60. package/dist/admin/translations/uk.json.js +10 -0
  61. package/dist/admin/translations/uk.json.js.map +1 -0
  62. package/dist/admin/translations/uk.json.mjs +8 -0
  63. package/dist/admin/translations/uk.json.mjs.map +1 -0
  64. package/dist/admin/translations/vi.json.js +10 -0
  65. package/dist/admin/translations/vi.json.js.map +1 -0
  66. package/dist/admin/translations/vi.json.mjs +8 -0
  67. package/dist/admin/translations/vi.json.mjs.map +1 -0
  68. package/dist/admin/translations/zh.json.js +10 -0
  69. package/dist/admin/translations/zh.json.js.map +1 -0
  70. package/dist/admin/translations/zh.json.mjs +8 -0
  71. package/dist/admin/translations/zh.json.mjs.map +1 -0
  72. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  73. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  74. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  75. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  76. package/dist/server/bootstrap.js +13 -0
  77. package/dist/server/bootstrap.js.map +1 -0
  78. package/dist/server/bootstrap.mjs +11 -0
  79. package/dist/server/bootstrap.mjs.map +1 -0
  80. package/dist/server/config.js +13 -0
  81. package/dist/server/config.js.map +1 -0
  82. package/dist/server/config.mjs +11 -0
  83. package/dist/server/config.mjs.map +1 -0
  84. package/dist/server/index.js +12 -122
  85. package/dist/server/index.js.map +1 -1
  86. package/dist/server/index.mjs +11 -105
  87. package/dist/server/index.mjs.map +1 -1
  88. package/dist/server/middlewares/sentry.js +39 -0
  89. package/dist/server/middlewares/sentry.js.map +1 -0
  90. package/dist/server/middlewares/sentry.mjs +37 -0
  91. package/dist/server/middlewares/sentry.mjs.map +1 -0
  92. package/dist/server/services/index.js +10 -0
  93. package/dist/server/services/index.js.map +1 -0
  94. package/dist/server/services/index.mjs +8 -0
  95. package/dist/server/services/index.mjs.map +1 -0
  96. package/dist/server/services/sentry.js +84 -0
  97. package/dist/server/services/sentry.js.map +1 -0
  98. package/dist/server/services/sentry.mjs +62 -0
  99. package/dist/server/services/sentry.mjs.map +1 -0
  100. package/dist/server/src/bootstrap.d.ts +2 -2
  101. package/dist/server/src/bootstrap.d.ts.map +1 -1
  102. package/dist/server/src/index.d.ts +4 -4
  103. package/dist/server/src/middlewares/sentry.d.ts +2 -2
  104. package/dist/server/src/middlewares/sentry.d.ts.map +1 -1
  105. package/dist/server/src/services/index.d.ts +3 -3
  106. package/dist/server/src/services/sentry.d.ts +4 -4
  107. package/dist/server/src/services/sentry.d.ts.map +1 -1
  108. package/package.json +25 -21
  109. package/dist/_chunks/dk-ACiZv75I.js +0 -9
  110. package/dist/_chunks/dk-ACiZv75I.js.map +0 -1
  111. package/dist/_chunks/dk-Ht5BJvwV.mjs +0 -9
  112. package/dist/_chunks/dk-Ht5BJvwV.mjs.map +0 -1
  113. package/dist/_chunks/en--hlKpBzk.mjs +0 -9
  114. package/dist/_chunks/en--hlKpBzk.mjs.map +0 -1
  115. package/dist/_chunks/en-vyox7ZSC.js +0 -9
  116. package/dist/_chunks/en-vyox7ZSC.js.map +0 -1
  117. package/dist/_chunks/es-21jfFVzQ.mjs +0 -9
  118. package/dist/_chunks/es-21jfFVzQ.mjs.map +0 -1
  119. package/dist/_chunks/es-tPYrS3N2.js +0 -9
  120. package/dist/_chunks/es-tPYrS3N2.js.map +0 -1
  121. package/dist/_chunks/fr-2usi50FD.js +0 -9
  122. package/dist/_chunks/fr-2usi50FD.js.map +0 -1
  123. package/dist/_chunks/fr-8muIKZms.mjs +0 -9
  124. package/dist/_chunks/fr-8muIKZms.mjs.map +0 -1
  125. package/dist/_chunks/ko-NdEnkB5D.mjs +0 -9
  126. package/dist/_chunks/ko-NdEnkB5D.mjs.map +0 -1
  127. package/dist/_chunks/ko-nuQP7I5M.js +0 -9
  128. package/dist/_chunks/ko-nuQP7I5M.js.map +0 -1
  129. package/dist/_chunks/pl-5DTLh5PW.mjs +0 -9
  130. package/dist/_chunks/pl-5DTLh5PW.mjs.map +0 -1
  131. package/dist/_chunks/pl-cdsG7ySn.js +0 -9
  132. package/dist/_chunks/pl-cdsG7ySn.js.map +0 -1
  133. package/dist/_chunks/ru-KtwsGCNm.js +0 -9
  134. package/dist/_chunks/ru-KtwsGCNm.js.map +0 -1
  135. package/dist/_chunks/ru-_BJx1_V5.mjs +0 -9
  136. package/dist/_chunks/ru-_BJx1_V5.mjs.map +0 -1
  137. package/dist/_chunks/sv-QDPLOKcT.js +0 -9
  138. package/dist/_chunks/sv-QDPLOKcT.js.map +0 -1
  139. package/dist/_chunks/sv-YocrQXH3.mjs +0 -9
  140. package/dist/_chunks/sv-YocrQXH3.mjs.map +0 -1
  141. package/dist/_chunks/tr-W6PupknE.js +0 -9
  142. package/dist/_chunks/tr-W6PupknE.js.map +0 -1
  143. package/dist/_chunks/tr-nkbjyt2S.mjs +0 -9
  144. package/dist/_chunks/tr-nkbjyt2S.mjs.map +0 -1
  145. package/dist/_chunks/vi-10CsgDK2.mjs +0 -9
  146. package/dist/_chunks/vi-10CsgDK2.mjs.map +0 -1
  147. package/dist/_chunks/vi-hEp1hNio.js +0 -9
  148. package/dist/_chunks/vi-hEp1hNio.js.map +0 -1
  149. package/dist/_chunks/zh-WWNi5hqs.mjs +0 -9
  150. package/dist/_chunks/zh-WWNi5hqs.mjs.map +0 -1
  151. package/dist/_chunks/zh-uRG2X3qF.js +0 -9
  152. package/dist/_chunks/zh-uRG2X3qF.js.map +0 -1
  153. package/strapi-server.js +0 -3
@@ -1,106 +1,12 @@
1
- import * as Sentry from "@sentry/node";
2
- const initSentryMiddleware = ({ strapi }) => {
3
- const sentryService = strapi.plugin("sentry").service("sentry");
4
- sentryService.init();
5
- const sentry2 = sentryService.getInstance();
6
- if (!sentry2) {
7
- return;
8
- }
9
- strapi.server.use(async (ctx, next) => {
10
- try {
11
- await next();
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/middlewares/sentry.ts","../../server/src/bootstrap.ts","../../server/src/services/sentry.ts","../../server/src/services/index.ts","../../server/src/config.ts","../../server/src/index.ts"],"sourcesContent":["import type { Strapi } from '@strapi/strapi';\nimport type Sentry from '@sentry/node';\nimport type createSentryService from '../services/sentry';\n\n/**\n * Programmatic sentry middleware. We do not want to expose it in the plugin\n */\nexport default ({ strapi }: { strapi: Strapi }) => {\n const sentryService: ReturnType<typeof createSentryService> = strapi\n .plugin('sentry')\n .service('sentry');\n sentryService.init();\n const sentry = sentryService.getInstance();\n\n if (!sentry) {\n // initialization failed\n return;\n }\n\n strapi.server.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n if (error instanceof Error) {\n sentryService.sendError(error, (scope: Sentry.Scope) => {\n scope.addEventProcessor((event) => {\n // Parse Koa context to add error metadata\n return sentry.Handlers.parseRequest(event, ctx.request as Sentry.Request, {\n // Don't parse the transaction name, we'll do it manually\n transaction: false,\n });\n });\n\n // Manually add transaction name\n scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);\n // Manually add Strapi version\n scope.setTag('strapi_version', strapi.config.info.strapi);\n scope.setTag('method', ctx.method);\n });\n }\n\n throw error;\n }\n });\n};\n","import type { Strapi } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n","import type { Strapi } from '@strapi/strapi';\nimport type { Config } from 'src/config';\nimport * as Sentry from '@sentry/node';\n\nconst createSentryService = (strapi: Strapi) => {\n let isReady = false;\n let instance: typeof Sentry | null = null;\n\n // Retrieve user config and merge it with the default one\n const config = strapi.config.get('plugin.sentry') as Config;\n\n return {\n /**\n * Initialize Sentry service\n */\n init() {\n // Make sure there isn't a Sentry instance already running\n if (instance != null) {\n return this;\n }\n\n // Don't init Sentry if no DSN was provided\n if (!config.dsn) {\n strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');\n return this;\n }\n\n try {\n Sentry.init({\n dsn: config.dsn,\n environment: strapi.config.get('environment'),\n ...config.init,\n });\n\n // Store the successfully initialized Sentry instance\n instance = Sentry;\n isReady = true;\n } catch (error) {\n strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');\n }\n\n return this;\n },\n\n /**\n * Expose Sentry instance through a getter\n */\n getInstance() {\n return instance;\n },\n\n /**\n * Higher level method to send exception events to Sentry\n */\n sendError(error: Error, configureScope?: (scope: Sentry.Scope) => void) {\n // Make sure Sentry is ready\n if (!isReady || !instance) {\n strapi.log.warn(\"Sentry wasn't properly initialized, cannot send event\");\n return;\n }\n\n instance.withScope((scope) => {\n // Configure the Sentry scope using the provided callback\n if (configureScope && config.sendMetadata) {\n configureScope(scope);\n }\n\n // Actually send the Error to Sentry\n instance?.captureException(error);\n });\n },\n };\n};\n\nexport default ({ strapi }: { strapi: Strapi }) => createSentryService(strapi);\n","import sentry from './sentry';\n\nexport default {\n sentry,\n};\n","import type { NodeOptions } from '@sentry/node';\n\nexport interface Config {\n dsn: string | null;\n sendMetadata: boolean;\n init: NodeOptions;\n}\n\nexport default {\n default: {\n dsn: null,\n sendMetadata: true,\n init: {},\n } satisfies Config,\n validator() {},\n};\n","import bootstrap from './bootstrap';\nimport services from './services';\nimport config from './config';\n\nexport default () => ({\n bootstrap,\n config,\n services,\n});\n"],"names":["sentry","config"],"mappings":";AAOA,MAAA,uBAAe,CAAC,EAAE,OAAA,MAAiC;AACjD,QAAM,gBAAwD,OAC3D,OAAO,QAAQ,EACf,QAAQ,QAAQ;AACnB,gBAAc,KAAK;AACb,QAAAA,UAAS,cAAc;AAE7B,MAAI,CAACA,SAAQ;AAEX;AAAA,EACF;AAEA,SAAO,OAAO,IAAI,OAAO,KAAK,SAAS;AACjC,QAAA;AACF,YAAM,KAAK;AAAA,aACJ,OAAO;AACd,UAAI,iBAAiB,OAAO;AACZ,sBAAA,UAAU,OAAO,CAAC,UAAwB;AAChD,gBAAA,kBAAkB,CAAC,UAAU;AAEjC,mBAAOA,QAAO,SAAS,aAAa,OAAO,IAAI,SAA2B;AAAA;AAAA,cAExE,aAAa;AAAA,YAAA,CACd;AAAA,UAAA,CACF;AAGK,gBAAA,OAAO,eAAe,GAAG,IAAI,MAAM,IAAI,IAAI,aAAa,EAAE;AAEhE,gBAAM,OAAO,kBAAkB,OAAO,OAAO,KAAK,MAAM;AAClD,gBAAA,OAAO,UAAU,IAAI,MAAM;AAAA,QAAA,CAClC;AAAA,MACH;AAEM,YAAA;AAAA,IACR;AAAA,EAAA,CACD;AACH;ACzCA,MAAA,YAAe,OAAO,EAAE,OAAA,MAAiC;AAElC,uBAAA,EAAE,QAAQ;AACjC;ACFA,MAAM,sBAAsB,CAAC,WAAmB;AAC9C,MAAI,UAAU;AACd,MAAI,WAAiC;AAGrC,QAAMC,UAAS,OAAO,OAAO,IAAI,eAAe;AAEzC,SAAA;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAEL,UAAI,YAAY,MAAM;AACb,eAAA;AAAA,MACT;AAGI,UAAA,CAACA,QAAO,KAAK;AACR,eAAA,IAAI,KAAK,sEAAsE;AAC/E,eAAA;AAAA,MACT;AAEI,UAAA;AACF,eAAO,KAAK;AAAA,UACV,KAAKA,QAAO;AAAA,UACZ,aAAa,OAAO,OAAO,IAAI,aAAa;AAAA,UAC5C,GAAGA,QAAO;AAAA,QAAA,CACX;AAGU,mBAAA;AACD,kBAAA;AAAA,eACH,OAAO;AACP,eAAA,IAAI,KAAK,4DAA4D;AAAA,MAC9E;AAEO,aAAA;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,cAAc;AACL,aAAA;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,UAAU,OAAc,gBAAgD;AAElE,UAAA,CAAC,WAAW,CAAC,UAAU;AAClB,eAAA,IAAI,KAAK,uDAAuD;AACvE;AAAA,MACF;AAES,eAAA,UAAU,CAAC,UAAU;AAExB,YAAA,kBAAkBA,QAAO,cAAc;AACzC,yBAAe,KAAK;AAAA,QACtB;AAGA,kBAAU,iBAAiB,KAAK;AAAA,MAAA,CACjC;AAAA,IACH;AAAA,EAAA;AAEJ;AAEA,MAAe,SAAA,CAAC,EAAE,OAAO,MAA0B,oBAAoB,MAAM;ACxE7E,MAAe,WAAA;AAAA,EACb;AACF;ACIA,MAAe,SAAA;AAAA,EACb,SAAS;AAAA,IACP,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC;AAAA,EACT;AAAA,EACA,YAAY;AAAA,EAAC;AACf;ACXA,MAAA,QAAe,OAAO;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AACF;"}
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,10 @@
1
+ 'use strict';
2
+
3
+ var sentry = require('./sentry.js');
4
+
5
+ var services = {
6
+ sentry
7
+ };
8
+
9
+ module.exports = services;
10
+ //# sourceMappingURL=index.js.map
@@ -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,8 @@
1
+ import sentry from './sentry.mjs';
2
+
3
+ var services = {
4
+ sentry
5
+ };
6
+
7
+ export { services as default };
8
+ //# sourceMappingURL=index.mjs.map
@@ -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,6 +1,6 @@
1
- import type { Strapi } from '@strapi/strapi';
1
+ import type { Core } from '@strapi/strapi';
2
2
  declare const _default: ({ strapi }: {
3
- strapi: Strapi;
3
+ strapi: Core.Strapi;
4
4
  }) => Promise<void>;
5
5
  export default _default;
6
6
  //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;;YAGD,MAAM;;AAAlD,wBAGE"}
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"}
@@ -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
- init(): any;
17
+ init(): /*elided*/ any;
18
18
  getInstance(): typeof import("@sentry/node") | null;
19
- sendError(error: Error, configureScope?: ((scope: import("@sentry/hub").Scope) => void) | undefined): void;
19
+ sendError(error: Error, configureScope?: (scope: import("@sentry/core").Scope) => void): void;
20
20
  };
21
21
  };
22
22
  };
@@ -1,9 +1,9 @@
1
- import type { Strapi } from '@strapi/strapi';
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,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;;YACmC,MAAM;;AAA5C,wBAqCE"}
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"}
@@ -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
- init(): any;
5
+ init(): /*elided*/ any;
6
6
  getInstance(): typeof import("@sentry/node") | null;
7
- sendError(error: Error, configureScope?: ((scope: import("@sentry/hub").Scope) => void) | undefined): void;
7
+ sendError(error: Error, configureScope?: (scope: import("@sentry/core").Scope) => void): void;
8
8
  };
9
9
  };
10
10
  export default _default;
@@ -1,12 +1,12 @@
1
- import type { Strapi } from '@strapi/strapi';
1
+ import type { Core } from '@strapi/strapi';
2
2
  import * as Sentry from '@sentry/node';
3
3
  declare const _default: ({ strapi }: {
4
- strapi: Strapi;
4
+ strapi: Core.Strapi;
5
5
  }) => {
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?: ((scope: Sentry.Scope) => void) | undefined): void;
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,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;;YAwED,MAAM;;IA9DxC;;OAEG;;IA8BH;;OAEG;;IAKH;;OAEG;;;AAqBP,wBAA+E"}
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.62ebf57bb35846666febb5ee2078fe02fe990f57",
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": "strapi plugin:build --force",
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": "strapi plugin:watch"
57
+ "watch": "run -T rollup -c -w"
51
58
  },
52
59
  "dependencies": {
53
- "@sentry/node": "6.19.7",
54
- "@strapi/design-system": "1.19.0",
55
- "@strapi/helper-plugin": "0.0.0-experimental.62ebf57bb35846666febb5ee2078fe02fe990f57",
56
- "@strapi/icons": "1.19.0"
60
+ "@sentry/node": "7.112.2",
61
+ "@strapi/design-system": "2.2.1",
62
+ "@strapi/icons": "2.2.1"
57
63
  },
58
64
  "devDependencies": {
59
- "@strapi/pack-up": "4.23.0",
60
- "@strapi/strapi": "0.0.0-experimental.62ebf57bb35846666febb5ee2078fe02fe990f57",
61
- "react": "^18.2.0",
62
- "react-dom": "^18.2.0",
63
- "react-router-dom": "5.3.4",
64
- "styled-components": "5.3.3"
65
+ "@strapi/strapi": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
66
+ "react": "18.3.1",
67
+ "react-dom": "18.3.1",
68
+ "react-router-dom": "6.30.3",
69
+ "styled-components": "6.4.1"
65
70
  },
66
71
  "peerDependencies": {
67
- "@strapi/strapi": "^4.0.0",
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": "^5.2.0",
71
- "styled-components": "^5.2.1"
75
+ "react-router-dom": "^6.30.3",
76
+ "styled-components": "^6.0.0"
72
77
  },
73
78
  "engines": {
74
- "node": ">=18.0.0 <=20.x.x",
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": "62ebf57bb35846666febb5ee2078fe02fe990f57"
87
+ }
84
88
  }
@@ -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-ACiZv75I.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dk-ACiZv75I.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,9 +0,0 @@
1
- const dk = {
2
- "plugin.description.long": "Send Strapi fejlevents til Sentry.",
3
- "plugin.description.short": "Send Strapi fejlevents til Sentry.",
4
- "plugin.name": "Sentry"
5
- };
6
- export {
7
- dk as default
8
- };
9
- //# sourceMappingURL=dk-Ht5BJvwV.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dk-Ht5BJvwV.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}