@strapi/plugin-sentry 5.12.1 → 5.12.3

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 (113) hide show
  1. package/dist/admin/index.js +19 -122
  2. package/dist/admin/index.js.map +1 -1
  3. package/dist/admin/index.mjs +15 -120
  4. package/dist/admin/index.mjs.map +1 -1
  5. package/dist/admin/package.json.js +121 -0
  6. package/dist/admin/package.json.js.map +1 -0
  7. package/dist/admin/package.json.mjs +102 -0
  8. package/dist/admin/package.json.mjs.map +1 -0
  9. package/dist/admin/pluginId.js +6 -0
  10. package/dist/admin/pluginId.js.map +1 -0
  11. package/dist/admin/pluginId.mjs +4 -0
  12. package/dist/admin/pluginId.mjs.map +1 -0
  13. package/dist/admin/{chunks/dk-C64Vk1_X.js → translations/dk.json.js} +2 -2
  14. package/dist/admin/translations/dk.json.js.map +1 -0
  15. package/dist/admin/{chunks/dk-2c1X5YD1.mjs → translations/dk.json.mjs} +1 -1
  16. package/dist/admin/translations/dk.json.mjs.map +1 -0
  17. package/dist/admin/{chunks/en-CzMdlTs0.js → translations/en.json.js} +2 -2
  18. package/dist/admin/translations/en.json.js.map +1 -0
  19. package/dist/admin/{chunks/en-DDCHBy0-.mjs → translations/en.json.mjs} +1 -1
  20. package/dist/admin/translations/en.json.mjs.map +1 -0
  21. package/dist/admin/{chunks/es-l4HaM-C0.js → translations/es.json.js} +2 -2
  22. package/dist/admin/translations/es.json.js.map +1 -0
  23. package/dist/admin/{chunks/es-BnizV7-a.mjs → translations/es.json.mjs} +1 -1
  24. package/dist/admin/translations/es.json.mjs.map +1 -0
  25. package/dist/admin/{chunks/fr-rJIDC4Jx.js → translations/fr.json.js} +2 -2
  26. package/dist/admin/translations/fr.json.js.map +1 -0
  27. package/dist/admin/{chunks/fr-BsXNdB-N.mjs → translations/fr.json.mjs} +1 -1
  28. package/dist/admin/translations/fr.json.mjs.map +1 -0
  29. package/dist/admin/{chunks/ko-CoJrUsj1.js → translations/ko.json.js} +2 -2
  30. package/dist/admin/translations/ko.json.js.map +1 -0
  31. package/dist/admin/{chunks/ko-BrDfWiIr.mjs → translations/ko.json.mjs} +1 -1
  32. package/dist/admin/translations/ko.json.mjs.map +1 -0
  33. package/dist/admin/{chunks/pl-DbPKh3_6.js → translations/pl.json.js} +2 -2
  34. package/dist/admin/translations/pl.json.js.map +1 -0
  35. package/dist/admin/{chunks/pl-6JvJwTZm.mjs → translations/pl.json.mjs} +1 -1
  36. package/dist/admin/translations/pl.json.mjs.map +1 -0
  37. package/dist/admin/{chunks/ru-CgCHTIu5.js → translations/ru.json.js} +2 -2
  38. package/dist/admin/translations/ru.json.js.map +1 -0
  39. package/dist/admin/{chunks/ru-B4OA2fUb.mjs → translations/ru.json.mjs} +1 -1
  40. package/dist/admin/translations/ru.json.mjs.map +1 -0
  41. package/dist/admin/{chunks/sv-DrckibdJ.js → translations/sv.json.js} +2 -2
  42. package/dist/admin/translations/sv.json.js.map +1 -0
  43. package/dist/admin/{chunks/sv-OPAT8f7H.mjs → translations/sv.json.mjs} +1 -1
  44. package/dist/admin/translations/sv.json.mjs.map +1 -0
  45. package/dist/admin/{chunks/tr-DMgP5sU_.js → translations/tr.json.js} +2 -2
  46. package/dist/admin/translations/tr.json.js.map +1 -0
  47. package/dist/admin/{chunks/tr-C8CxtgGx.mjs → translations/tr.json.mjs} +1 -1
  48. package/dist/admin/translations/tr.json.mjs.map +1 -0
  49. package/dist/admin/{chunks/uk-B2xQjt3Y.js → translations/uk.json.js} +2 -2
  50. package/dist/admin/translations/uk.json.js.map +1 -0
  51. package/dist/admin/{chunks/uk-DTdvxZPe.mjs → translations/uk.json.mjs} +1 -1
  52. package/dist/admin/translations/uk.json.mjs.map +1 -0
  53. package/dist/admin/{chunks/vi-CpPssghl.js → translations/vi.json.js} +2 -2
  54. package/dist/admin/translations/vi.json.js.map +1 -0
  55. package/dist/admin/{chunks/vi-D0rPKKIu.mjs → translations/vi.json.mjs} +1 -1
  56. package/dist/admin/translations/vi.json.mjs.map +1 -0
  57. package/dist/admin/{chunks/zh-TX10GrSY.js → translations/zh.json.js} +2 -2
  58. package/dist/admin/translations/zh.json.js.map +1 -0
  59. package/dist/admin/{chunks/zh-MmnOh-xz.mjs → translations/zh.json.mjs} +1 -1
  60. package/dist/admin/translations/zh.json.mjs.map +1 -0
  61. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  62. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  63. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  64. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  65. package/dist/server/bootstrap.js +13 -0
  66. package/dist/server/bootstrap.js.map +1 -0
  67. package/dist/server/bootstrap.mjs +11 -0
  68. package/dist/server/bootstrap.mjs.map +1 -0
  69. package/dist/server/config.js +13 -0
  70. package/dist/server/config.js.map +1 -0
  71. package/dist/server/config.mjs +11 -0
  72. package/dist/server/config.mjs.map +1 -0
  73. package/dist/server/index.js +4 -134
  74. package/dist/server/index.js.map +1 -1
  75. package/dist/server/index.mjs +3 -114
  76. package/dist/server/index.mjs.map +1 -1
  77. package/dist/server/middlewares/sentry.js +39 -0
  78. package/dist/server/middlewares/sentry.js.map +1 -0
  79. package/dist/server/middlewares/sentry.mjs +37 -0
  80. package/dist/server/middlewares/sentry.mjs.map +1 -0
  81. package/dist/server/services/index.js +10 -0
  82. package/dist/server/services/index.js.map +1 -0
  83. package/dist/server/services/index.mjs +8 -0
  84. package/dist/server/services/index.mjs.map +1 -0
  85. package/dist/server/services/sentry.js +83 -0
  86. package/dist/server/services/sentry.js.map +1 -0
  87. package/dist/server/services/sentry.mjs +62 -0
  88. package/dist/server/services/sentry.mjs.map +1 -0
  89. package/package.json +2 -2
  90. package/dist/admin/chunks/dk-2c1X5YD1.mjs.map +0 -1
  91. package/dist/admin/chunks/dk-C64Vk1_X.js.map +0 -1
  92. package/dist/admin/chunks/en-CzMdlTs0.js.map +0 -1
  93. package/dist/admin/chunks/en-DDCHBy0-.mjs.map +0 -1
  94. package/dist/admin/chunks/es-BnizV7-a.mjs.map +0 -1
  95. package/dist/admin/chunks/es-l4HaM-C0.js.map +0 -1
  96. package/dist/admin/chunks/fr-BsXNdB-N.mjs.map +0 -1
  97. package/dist/admin/chunks/fr-rJIDC4Jx.js.map +0 -1
  98. package/dist/admin/chunks/ko-BrDfWiIr.mjs.map +0 -1
  99. package/dist/admin/chunks/ko-CoJrUsj1.js.map +0 -1
  100. package/dist/admin/chunks/pl-6JvJwTZm.mjs.map +0 -1
  101. package/dist/admin/chunks/pl-DbPKh3_6.js.map +0 -1
  102. package/dist/admin/chunks/ru-B4OA2fUb.mjs.map +0 -1
  103. package/dist/admin/chunks/ru-CgCHTIu5.js.map +0 -1
  104. package/dist/admin/chunks/sv-DrckibdJ.js.map +0 -1
  105. package/dist/admin/chunks/sv-OPAT8f7H.mjs.map +0 -1
  106. package/dist/admin/chunks/tr-C8CxtgGx.mjs.map +0 -1
  107. package/dist/admin/chunks/tr-DMgP5sU_.js.map +0 -1
  108. package/dist/admin/chunks/uk-B2xQjt3Y.js.map +0 -1
  109. package/dist/admin/chunks/uk-DTdvxZPe.mjs.map +0 -1
  110. package/dist/admin/chunks/vi-CpPssghl.js.map +0 -1
  111. package/dist/admin/chunks/vi-D0rPKKIu.mjs.map +0 -1
  112. package/dist/admin/chunks/zh-MmnOh-xz.mjs.map +0 -1
  113. package/dist/admin/chunks/zh-TX10GrSY.js.map +0 -1
@@ -6,5 +6,5 @@ var es = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = es;
10
- //# sourceMappingURL=es-l4HaM-C0.js.map
9
+ module.exports = es;
10
+ //# sourceMappingURL=es.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var es = {
5
5
  };
6
6
 
7
7
  export { es as default };
8
- //# sourceMappingURL=es-BnizV7-a.mjs.map
8
+ //# sourceMappingURL=es.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var fr = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = fr;
10
- //# sourceMappingURL=fr-rJIDC4Jx.js.map
9
+ module.exports = fr;
10
+ //# sourceMappingURL=fr.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var fr = {
5
5
  };
6
6
 
7
7
  export { fr as default };
8
- //# sourceMappingURL=fr-BsXNdB-N.mjs.map
8
+ //# sourceMappingURL=fr.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var ko = {
6
6
  "plugin.name": "Sentry에"
7
7
  };
8
8
 
9
- exports.default = ko;
10
- //# sourceMappingURL=ko-CoJrUsj1.js.map
9
+ module.exports = ko;
10
+ //# sourceMappingURL=ko.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var ko = {
5
5
  };
6
6
 
7
7
  export { ko as default };
8
- //# sourceMappingURL=ko-BrDfWiIr.mjs.map
8
+ //# sourceMappingURL=ko.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var pl = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = pl;
10
- //# sourceMappingURL=pl-DbPKh3_6.js.map
9
+ module.exports = pl;
10
+ //# sourceMappingURL=pl.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var pl = {
5
5
  };
6
6
 
7
7
  export { pl as default };
8
- //# sourceMappingURL=pl-6JvJwTZm.mjs.map
8
+ //# sourceMappingURL=pl.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var ru = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = ru;
10
- //# sourceMappingURL=ru-CgCHTIu5.js.map
9
+ module.exports = ru;
10
+ //# sourceMappingURL=ru.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ru.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var ru = {
5
5
  };
6
6
 
7
7
  export { ru as default };
8
- //# sourceMappingURL=ru-B4OA2fUb.mjs.map
8
+ //# sourceMappingURL=ru.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ru.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var sv = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = sv;
10
- //# sourceMappingURL=sv-DrckibdJ.js.map
9
+ module.exports = sv;
10
+ //# sourceMappingURL=sv.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sv.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var sv = {
5
5
  };
6
6
 
7
7
  export { sv as default };
8
- //# sourceMappingURL=sv-OPAT8f7H.mjs.map
8
+ //# sourceMappingURL=sv.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sv.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var tr = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = tr;
10
- //# sourceMappingURL=tr-DMgP5sU_.js.map
9
+ module.exports = tr;
10
+ //# sourceMappingURL=tr.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var tr = {
5
5
  };
6
6
 
7
7
  export { tr as default };
8
- //# sourceMappingURL=tr-C8CxtgGx.mjs.map
8
+ //# sourceMappingURL=tr.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var uk = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = uk;
10
- //# sourceMappingURL=uk-B2xQjt3Y.js.map
9
+ module.exports = uk;
10
+ //# sourceMappingURL=uk.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uk.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var uk = {
5
5
  };
6
6
 
7
7
  export { uk as default };
8
- //# sourceMappingURL=uk-DTdvxZPe.mjs.map
8
+ //# sourceMappingURL=uk.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uk.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var vi = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = vi;
10
- //# sourceMappingURL=vi-CpPssghl.js.map
9
+ module.exports = vi;
10
+ //# sourceMappingURL=vi.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vi.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var vi = {
5
5
  };
6
6
 
7
7
  export { vi as default };
8
- //# sourceMappingURL=vi-D0rPKKIu.mjs.map
8
+ //# sourceMappingURL=vi.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vi.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -6,5 +6,5 @@ var zh = {
6
6
  "plugin.name": "Sentry"
7
7
  };
8
8
 
9
- exports.default = zh;
10
- //# sourceMappingURL=zh-TX10GrSY.js.map
9
+ module.exports = zh;
10
+ //# sourceMappingURL=zh.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -5,4 +5,4 @@ var zh = {
5
5
  };
6
6
 
7
7
  export { zh as default };
8
- //# sourceMappingURL=zh-MmnOh-xz.mjs.map
8
+ //# sourceMappingURL=zh.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const prefixPluginTranslations = (trad, pluginId)=>{
4
+ return Object.keys(trad).reduce((acc, current)=>{
5
+ acc[`${pluginId}.${current}`] = trad[current];
6
+ return acc;
7
+ }, {});
8
+ };
9
+
10
+ exports.prefixPluginTranslations = prefixPluginTranslations;
11
+ //# sourceMappingURL=prefixPluginTranslations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefixPluginTranslations.js","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":";;AAEMA,MAAAA,wBAAAA,GAA2B,CAACC,IAAmBC,EAAAA,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AACpCD,QAAAA,GAAG,CAAC,CAAC,EAAEJ,QAAAA,CAAS,CAAC,EAAEK,OAAQ,CAAA,CAAC,CAAC,GAAGN,IAAI,CAACM,OAAQ,CAAA;QAC7C,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;;;;"}
@@ -0,0 +1,9 @@
1
+ const prefixPluginTranslations = (trad, pluginId)=>{
2
+ return Object.keys(trad).reduce((acc, current)=>{
3
+ acc[`${pluginId}.${current}`] = trad[current];
4
+ return acc;
5
+ }, {});
6
+ };
7
+
8
+ export { prefixPluginTranslations };
9
+ //# sourceMappingURL=prefixPluginTranslations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefixPluginTranslations.mjs","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":"AAEMA,MAAAA,wBAAAA,GAA2B,CAACC,IAAmBC,EAAAA,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AACpCD,QAAAA,GAAG,CAAC,CAAC,EAAEJ,QAAAA,CAAS,CAAC,EAAEK,OAAQ,CAAA,CAAC,CAAC,GAAGN,IAAI,CAACM,OAAQ,CAAA;QAC7C,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;;;;"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var sentry = require('./middlewares/sentry.js');
4
+
5
+ var bootstrap = (async ({ strapi })=>{
6
+ // Initialize the Sentry service exposed by this plugin
7
+ sentry({
8
+ strapi
9
+ });
10
+ });
11
+
12
+ module.exports = bootstrap;
13
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n"],"names":["strapi","initSentryMiddleware"],"mappings":";;;;AAGA,gBAAe,CAAA,OAAO,EAAEA,MAAM,EAA2B,GAAA;;IAEvDC,MAAqB,CAAA;AAAED,QAAAA;AAAO,KAAA,CAAA;AAChC,CAAA;;;;"}
@@ -0,0 +1,11 @@
1
+ import initSentryMiddleware from './middlewares/sentry.mjs';
2
+
3
+ var bootstrap = (async ({ strapi })=>{
4
+ // Initialize the Sentry service exposed by this plugin
5
+ initSentryMiddleware({
6
+ strapi
7
+ });
8
+ });
9
+
10
+ export { bootstrap as default };
11
+ //# sourceMappingURL=bootstrap.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.mjs","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n"],"names":["strapi","initSentryMiddleware"],"mappings":";;AAGA,gBAAe,CAAA,OAAO,EAAEA,MAAM,EAA2B,GAAA;;IAEvDC,oBAAqB,CAAA;AAAED,QAAAA;AAAO,KAAA,CAAA;AAChC,CAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var config = {
4
+ default: {
5
+ dsn: null,
6
+ sendMetadata: true,
7
+ init: {}
8
+ },
9
+ validator () {}
10
+ };
11
+
12
+ module.exports = config;
13
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sources":["../../server/src/config.ts"],"sourcesContent":["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"],"names":["default","dsn","sendMetadata","init","validator"],"mappings":";;AAQA,aAAe;IACbA,OAAS,EAAA;QACPC,GAAK,EAAA,IAAA;QACLC,YAAc,EAAA,IAAA;AACdC,QAAAA,IAAAA,EAAM;AACR,KAAA;IACAC,SAAa,CAAA,GAAA;AACf,CAAE;;;;"}
@@ -0,0 +1,11 @@
1
+ var config = {
2
+ default: {
3
+ dsn: null,
4
+ sendMetadata: true,
5
+ init: {}
6
+ },
7
+ validator () {}
8
+ };
9
+
10
+ export { config as default };
11
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","sources":["../../server/src/config.ts"],"sourcesContent":["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"],"names":["default","dsn","sendMetadata","init","validator"],"mappings":"AAQA,aAAe;IACbA,OAAS,EAAA;QACPC,GAAK,EAAA,IAAA;QACLC,YAAc,EAAA,IAAA;AACdC,QAAAA,IAAAA,EAAM;AACR,KAAA;IACAC,SAAa,CAAA,GAAA;AACf,CAAE;;;;"}
@@ -1,143 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var Sentry = require('@sentry/node');
4
-
5
- function _interopNamespaceDefault(e) {
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n.default = e;
19
- return Object.freeze(n);
20
- }
21
-
22
- var Sentry__namespace = /*#__PURE__*/_interopNamespaceDefault(Sentry);
23
-
24
- /**
25
- * Programmatic sentry middleware. We do not want to expose it in the plugin
26
- */ var initSentryMiddleware = (({ strapi })=>{
27
- const sentryService = strapi.plugin('sentry').service('sentry');
28
- sentryService.init();
29
- const sentry = sentryService.getInstance();
30
- if (!sentry) {
31
- // initialization failed
32
- return;
33
- }
34
- strapi.server.use(async (ctx, next)=>{
35
- try {
36
- await next();
37
- } catch (error) {
38
- if (error instanceof Error) {
39
- sentryService.sendError(error, (scope)=>{
40
- scope.addEventProcessor((event)=>{
41
- // Parse Koa context to add error metadata
42
- return sentry.Handlers.parseRequest(event, ctx.request, {
43
- // Don't parse the transaction name, we'll do it manually
44
- transaction: false
45
- });
46
- });
47
- // Manually add transaction name
48
- scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);
49
- // Manually add Strapi version
50
- scope.setTag('strapi_version', strapi.config.info.strapi);
51
- scope.setTag('method', ctx.method);
52
- });
53
- }
54
- throw error;
55
- }
56
- });
57
- });
58
-
59
- var bootstrap = (async ({ strapi })=>{
60
- // Initialize the Sentry service exposed by this plugin
61
- initSentryMiddleware({
62
- strapi
63
- });
64
- });
65
-
66
- const createSentryService = (strapi)=>{
67
- let isReady = false;
68
- let instance = null;
69
- // Retrieve user config and merge it with the default one
70
- const config = strapi.config.get('plugin::sentry');
71
- return {
72
- /**
73
- * Initialize Sentry service
74
- */ init () {
75
- // Make sure there isn't a Sentry instance already running
76
- if (instance != null) {
77
- return this;
78
- }
79
- // Don't init Sentry if no DSN was provided
80
- if (!config.dsn) {
81
- strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');
82
- return this;
83
- }
84
- try {
85
- Sentry__namespace.init({
86
- dsn: config.dsn,
87
- environment: strapi.config.get('environment'),
88
- ...config.init
89
- });
90
- // Store the successfully initialized Sentry instance
91
- instance = Sentry__namespace;
92
- isReady = true;
93
- } catch (error) {
94
- strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');
95
- }
96
- return this;
97
- },
98
- /**
99
- * Expose Sentry instance through a getter
100
- */ getInstance () {
101
- return instance;
102
- },
103
- /**
104
- * Higher level method to send exception events to Sentry
105
- */ sendError (error, configureScope) {
106
- // Make sure Sentry is ready
107
- if (!isReady || !instance) {
108
- strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
109
- return;
110
- }
111
- instance.withScope((scope)=>{
112
- // Configure the Sentry scope using the provided callback
113
- if (configureScope && config.sendMetadata) {
114
- configureScope(scope);
115
- }
116
- // Actually send the Error to Sentry
117
- instance?.captureException(error);
118
- });
119
- }
120
- };
121
- };
122
- var sentry = (({ strapi })=>createSentryService(strapi));
123
-
124
- var services = {
125
- sentry
126
- };
127
-
128
- var config = {
129
- default: {
130
- dsn: null,
131
- sendMetadata: true,
132
- init: {}
133
- },
134
- validator () {}
135
- };
3
+ var bootstrap = require('./bootstrap.js');
4
+ var index$1 = require('./services/index.js');
5
+ var config = require('./config.js');
136
6
 
137
7
  var index = (()=>({
138
8
  bootstrap,
139
9
  config,
140
- services
10
+ services: index$1
141
11
  }));
142
12
 
143
13
  module.exports = index;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../server/src/middlewares/sentry.ts","../../server/src/bootstrap.ts","../../server/src/services/sentry.ts","../../server/src/services/index.ts","../../server/src/config.ts","../../server/src/index.ts"],"sourcesContent":["import type { Core } from '@strapi/strapi';\nimport type Sentry from '@sentry/node';\nimport type createSentryService from '../services/sentry';\n\n/**\n * Programmatic sentry middleware. We do not want to expose it in the plugin\n */\nexport default ({ strapi }: { strapi: Core.Strapi }) => {\n const sentryService: ReturnType<typeof createSentryService> = strapi\n .plugin('sentry')\n .service('sentry');\n sentryService.init();\n const sentry = sentryService.getInstance();\n\n if (!sentry) {\n // initialization failed\n return;\n }\n\n strapi.server.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n if (error instanceof Error) {\n sentryService.sendError(error, (scope: Sentry.Scope) => {\n scope.addEventProcessor((event) => {\n // Parse Koa context to add error metadata\n return sentry.Handlers.parseRequest(event, ctx.request as Sentry.Request, {\n // Don't parse the transaction name, we'll do it manually\n transaction: false,\n });\n });\n\n // Manually add transaction name\n scope.setTag('transaction', `${ctx.method} ${ctx._matchedRoute}`);\n // Manually add Strapi version\n scope.setTag('strapi_version', strapi.config.info.strapi);\n scope.setTag('method', ctx.method);\n });\n }\n\n throw error;\n }\n });\n};\n","import type { Core } from '@strapi/strapi';\nimport initSentryMiddleware from './middlewares/sentry';\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Initialize the Sentry service exposed by this plugin\n initSentryMiddleware({ strapi });\n};\n","import type { Core } from '@strapi/strapi';\nimport type { Config } from 'src/config';\nimport * as Sentry from '@sentry/node';\n\nconst createSentryService = (strapi: Core.Strapi) => {\n let isReady = false;\n let instance: typeof Sentry | null = null;\n\n // Retrieve user config and merge it with the default one\n const config = strapi.config.get('plugin::sentry') as Config;\n\n return {\n /**\n * Initialize Sentry service\n */\n init() {\n // Make sure there isn't a Sentry instance already running\n if (instance != null) {\n return this;\n }\n\n // Don't init Sentry if no DSN was provided\n if (!config.dsn) {\n strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');\n return this;\n }\n\n try {\n Sentry.init({\n dsn: config.dsn,\n environment: strapi.config.get('environment'),\n ...config.init,\n });\n\n // Store the successfully initialized Sentry instance\n instance = Sentry;\n isReady = true;\n } catch (error) {\n strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');\n }\n\n return this;\n },\n\n /**\n * Expose Sentry instance through a getter\n */\n getInstance() {\n return instance;\n },\n\n /**\n * Higher level method to send exception events to Sentry\n */\n sendError(error: Error, configureScope?: (scope: Sentry.Scope) => void) {\n // Make sure Sentry is ready\n if (!isReady || !instance) {\n strapi.log.warn(\"Sentry wasn't properly initialized, cannot send event\");\n return;\n }\n\n instance.withScope((scope) => {\n // Configure the Sentry scope using the provided callback\n if (configureScope && config.sendMetadata) {\n configureScope(scope);\n }\n\n // Actually send the Error to Sentry\n instance?.captureException(error);\n });\n },\n };\n};\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => createSentryService(strapi);\n","import sentry from './sentry';\n\nexport default {\n sentry,\n};\n","import type { NodeOptions } from '@sentry/node';\n\nexport interface Config {\n dsn: string | null;\n sendMetadata: boolean;\n init: NodeOptions;\n}\n\nexport default {\n default: {\n dsn: null,\n sendMetadata: true,\n init: {},\n } satisfies Config,\n validator() {},\n};\n","import bootstrap from './bootstrap';\nimport services from './services';\nimport config from './config';\n\nexport default () => ({\n bootstrap,\n config,\n services,\n});\n"],"names":["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","initSentryMiddleware","createSentryService","isReady","instance","get","dsn","log","Sentry","environment","warn","configureScope","withScope","sendMetadata","captureException","default","validator","bootstrap","services"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEC,IACD,2BAAe,CAAA,CAAC,EAAEA,MAAM,EAA2B,GAAA;AACjD,IAAA,MAAMC,gBAAwDD,MAC3DE,CAAAA,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,MAAQ,EAAA;;AAEX,QAAA;AACF;AAEAL,IAAAA,MAAAA,CAAOO,MAAM,CAACC,GAAG,CAAC,OAAOC,GAAKC,EAAAA,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ACxElF,eAAe;AACbK,IAAAA;AACF,CAAE;;ACIF,aAAe;IACbmC,OAAS,EAAA;QACPT,GAAK,EAAA,IAAA;QACLO,YAAc,EAAA,IAAA;AACdlC,QAAAA,IAAAA,EAAM;AACR,KAAA;IACAqC,SAAa,CAAA,GAAA;AACf,CAAE;;ACXF,YAAe,CAAA,KAAO;AACpBC,QAAAA,SAAAA;AACAlB,QAAAA,MAAAA;AACAmB,QAAAA;AACF,KAAA,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","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,kBAAAA;AACF,KAAA,CAAC;;;;"}
@@ -1,117 +1,6 @@
1
- import * as Sentry from '@sentry/node';
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
- var bootstrap = (async ({ strapi })=>{
39
- // Initialize the Sentry service exposed by this plugin
40
- initSentryMiddleware({
41
- strapi
42
- });
43
- });
44
-
45
- const createSentryService = (strapi)=>{
46
- let isReady = false;
47
- let instance = null;
48
- // Retrieve user config and merge it with the default one
49
- const config = strapi.config.get('plugin::sentry');
50
- return {
51
- /**
52
- * Initialize Sentry service
53
- */ init () {
54
- // Make sure there isn't a Sentry instance already running
55
- if (instance != null) {
56
- return this;
57
- }
58
- // Don't init Sentry if no DSN was provided
59
- if (!config.dsn) {
60
- strapi.log.info('@strapi/plugin-sentry is disabled because no Sentry DSN was provided');
61
- return this;
62
- }
63
- try {
64
- Sentry.init({
65
- dsn: config.dsn,
66
- environment: strapi.config.get('environment'),
67
- ...config.init
68
- });
69
- // Store the successfully initialized Sentry instance
70
- instance = Sentry;
71
- isReady = true;
72
- } catch (error) {
73
- strapi.log.warn('Could not set up Sentry, make sure you entered a valid DSN');
74
- }
75
- return this;
76
- },
77
- /**
78
- * Expose Sentry instance through a getter
79
- */ getInstance () {
80
- return instance;
81
- },
82
- /**
83
- * Higher level method to send exception events to Sentry
84
- */ sendError (error, configureScope) {
85
- // Make sure Sentry is ready
86
- if (!isReady || !instance) {
87
- strapi.log.warn("Sentry wasn't properly initialized, cannot send event");
88
- return;
89
- }
90
- instance.withScope((scope)=>{
91
- // Configure the Sentry scope using the provided callback
92
- if (configureScope && config.sendMetadata) {
93
- configureScope(scope);
94
- }
95
- // Actually send the Error to Sentry
96
- instance?.captureException(error);
97
- });
98
- }
99
- };
100
- };
101
- var sentry = (({ strapi })=>createSentryService(strapi));
102
-
103
- var services = {
104
- sentry
105
- };
106
-
107
- var config = {
108
- default: {
109
- dsn: null,
110
- sendMetadata: true,
111
- init: {}
112
- },
113
- validator () {}
114
- };
1
+ import bootstrap from './bootstrap.mjs';
2
+ import services from './services/index.mjs';
3
+ import config from './config.mjs';
115
4
 
116
5
  var index = (()=>({
117
6
  bootstrap,