@strapi/plugin-sentry 4.17.0 → 4.18.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.
Files changed (115) hide show
  1. package/dist/_chunks/{dk-00b47489.js → dk-ACiZv75I.js} +1 -1
  2. package/dist/_chunks/dk-ACiZv75I.js.map +1 -0
  3. package/dist/_chunks/{dk-b05451b4.mjs → dk-Ht5BJvwV.mjs} +1 -1
  4. package/dist/_chunks/dk-Ht5BJvwV.mjs.map +1 -0
  5. package/dist/_chunks/{en-70258e03.mjs → en--hlKpBzk.mjs} +1 -1
  6. package/dist/_chunks/en--hlKpBzk.mjs.map +1 -0
  7. package/dist/_chunks/{en-2dbaca4a.js → en-vyox7ZSC.js} +1 -1
  8. package/dist/_chunks/en-vyox7ZSC.js.map +1 -0
  9. package/dist/_chunks/{es-0812c06d.mjs → es-21jfFVzQ.mjs} +1 -1
  10. package/dist/_chunks/es-21jfFVzQ.mjs.map +1 -0
  11. package/dist/_chunks/{es-4352c0b3.js → es-tPYrS3N2.js} +1 -1
  12. package/dist/_chunks/es-tPYrS3N2.js.map +1 -0
  13. package/dist/_chunks/{fr-81925960.js → fr-2usi50FD.js} +1 -1
  14. package/dist/_chunks/fr-2usi50FD.js.map +1 -0
  15. package/dist/_chunks/{fr-22b3a920.mjs → fr-8muIKZms.mjs} +1 -1
  16. package/dist/_chunks/fr-8muIKZms.mjs.map +1 -0
  17. package/dist/_chunks/{ko-f357ad11.mjs → ko-NdEnkB5D.mjs} +1 -1
  18. package/dist/_chunks/ko-NdEnkB5D.mjs.map +1 -0
  19. package/dist/_chunks/{ko-5ab994e9.js → ko-nuQP7I5M.js} +1 -1
  20. package/dist/_chunks/ko-nuQP7I5M.js.map +1 -0
  21. package/dist/_chunks/{pl-91ad3b57.mjs → pl-5DTLh5PW.mjs} +1 -1
  22. package/dist/_chunks/pl-5DTLh5PW.mjs.map +1 -0
  23. package/dist/_chunks/{pl-5065555b.js → pl-cdsG7ySn.js} +1 -1
  24. package/dist/_chunks/pl-cdsG7ySn.js.map +1 -0
  25. package/dist/_chunks/{ru-c00f24a0.js → ru-KtwsGCNm.js} +1 -1
  26. package/dist/_chunks/ru-KtwsGCNm.js.map +1 -0
  27. package/dist/_chunks/{ru-ea18416d.mjs → ru-_BJx1_V5.mjs} +1 -1
  28. package/dist/_chunks/ru-_BJx1_V5.mjs.map +1 -0
  29. package/dist/_chunks/{sv-a8d028fb.js → sv-QDPLOKcT.js} +1 -1
  30. package/dist/_chunks/sv-QDPLOKcT.js.map +1 -0
  31. package/dist/_chunks/{sv-8f50eca3.mjs → sv-YocrQXH3.mjs} +1 -1
  32. package/dist/_chunks/sv-YocrQXH3.mjs.map +1 -0
  33. package/dist/_chunks/{tr-de905f5b.js → tr-W6PupknE.js} +1 -1
  34. package/dist/_chunks/tr-W6PupknE.js.map +1 -0
  35. package/dist/_chunks/{tr-dca6c197.mjs → tr-nkbjyt2S.mjs} +1 -1
  36. package/dist/_chunks/tr-nkbjyt2S.mjs.map +1 -0
  37. package/dist/_chunks/{vi-22d50e0e.mjs → vi-10CsgDK2.mjs} +1 -1
  38. package/dist/_chunks/vi-10CsgDK2.mjs.map +1 -0
  39. package/dist/_chunks/{vi-6d3d2db0.js → vi-hEp1hNio.js} +1 -1
  40. package/dist/_chunks/vi-hEp1hNio.js.map +1 -0
  41. package/dist/_chunks/{zh-9ec5b9b1.mjs → zh-WWNi5hqs.mjs} +1 -1
  42. package/dist/_chunks/zh-WWNi5hqs.mjs.map +1 -0
  43. package/dist/_chunks/{zh-ac6dac24.js → zh-uRG2X3qF.js} +1 -1
  44. package/dist/_chunks/zh-uRG2X3qF.js.map +1 -0
  45. package/dist/admin/index.js +20 -12
  46. package/dist/admin/index.js.map +1 -1
  47. package/dist/admin/index.mjs +20 -12
  48. package/dist/admin/index.mjs.map +1 -1
  49. package/dist/admin/src/index.d.ts +16 -0
  50. package/dist/admin/src/pluginId.d.ts +1 -0
  51. package/dist/server/index.js +124 -0
  52. package/dist/server/index.js.map +1 -0
  53. package/dist/server/index.mjs +106 -0
  54. package/dist/server/index.mjs.map +1 -0
  55. package/dist/server/src/bootstrap.d.ts +6 -0
  56. package/dist/server/src/bootstrap.d.ts.map +1 -0
  57. package/dist/server/src/config.d.ts +16 -0
  58. package/dist/server/src/config.d.ts.map +1 -0
  59. package/dist/server/src/index.d.ts +24 -0
  60. package/dist/server/src/index.d.ts.map +1 -0
  61. package/dist/server/src/middlewares/sentry.d.ts +9 -0
  62. package/dist/server/src/middlewares/sentry.d.ts.map +1 -0
  63. package/dist/server/src/services/index.d.ts +11 -0
  64. package/dist/server/src/services/index.d.ts.map +1 -0
  65. package/dist/server/src/services/sentry.d.ts +20 -0
  66. package/dist/server/src/services/sentry.d.ts.map +1 -0
  67. package/package.json +18 -11
  68. package/strapi-server.js +1 -1
  69. package/.eslintignore +0 -1
  70. package/.eslintrc +0 -14
  71. package/.gitattributes +0 -103
  72. package/admin/src/index.js +0 -38
  73. package/admin/src/pluginId.js +0 -5
  74. package/admin/src/translations/dk.json +0 -5
  75. package/admin/src/translations/en.json +0 -5
  76. package/admin/src/translations/es.json +0 -5
  77. package/admin/src/translations/fr.json +0 -5
  78. package/admin/src/translations/ko.json +0 -5
  79. package/admin/src/translations/pl.json +0 -5
  80. package/admin/src/translations/ru.json +0 -5
  81. package/admin/src/translations/sv.json +0 -5
  82. package/admin/src/translations/tr.json +0 -5
  83. package/admin/src/translations/vi.json +0 -5
  84. package/admin/src/translations/zh.json +0 -5
  85. package/dist/_chunks/dk-00b47489.js.map +0 -1
  86. package/dist/_chunks/dk-b05451b4.mjs.map +0 -1
  87. package/dist/_chunks/en-2dbaca4a.js.map +0 -1
  88. package/dist/_chunks/en-70258e03.mjs.map +0 -1
  89. package/dist/_chunks/es-0812c06d.mjs.map +0 -1
  90. package/dist/_chunks/es-4352c0b3.js.map +0 -1
  91. package/dist/_chunks/fr-22b3a920.mjs.map +0 -1
  92. package/dist/_chunks/fr-81925960.js.map +0 -1
  93. package/dist/_chunks/ko-5ab994e9.js.map +0 -1
  94. package/dist/_chunks/ko-f357ad11.mjs.map +0 -1
  95. package/dist/_chunks/pl-5065555b.js.map +0 -1
  96. package/dist/_chunks/pl-91ad3b57.mjs.map +0 -1
  97. package/dist/_chunks/ru-c00f24a0.js.map +0 -1
  98. package/dist/_chunks/ru-ea18416d.mjs.map +0 -1
  99. package/dist/_chunks/sv-8f50eca3.mjs.map +0 -1
  100. package/dist/_chunks/sv-a8d028fb.js.map +0 -1
  101. package/dist/_chunks/tr-dca6c197.mjs.map +0 -1
  102. package/dist/_chunks/tr-de905f5b.js.map +0 -1
  103. package/dist/_chunks/vi-22d50e0e.mjs.map +0 -1
  104. package/dist/_chunks/vi-6d3d2db0.js.map +0 -1
  105. package/dist/_chunks/zh-9ec5b9b1.mjs.map +0 -1
  106. package/dist/_chunks/zh-ac6dac24.js.map +0 -1
  107. package/jest.config.js +0 -6
  108. package/packup.config.ts +0 -22
  109. package/server/bootstrap.js +0 -8
  110. package/server/config.js +0 -10
  111. package/server/index.js +0 -11
  112. package/server/middlewares/sentry.js +0 -40
  113. package/server/services/__tests__/sentry.test.js +0 -102
  114. package/server/services/index.js +0 -7
  115. package/server/services/sentry/index.js +0 -85
@@ -0,0 +1,106 @@
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
+ };
106
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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;"}
@@ -0,0 +1,6 @@
1
+ import type { Strapi } from '@strapi/strapi';
2
+ declare const _default: ({ strapi }: {
3
+ strapi: Strapi;
4
+ }) => Promise<void>;
5
+ export default _default;
6
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,16 @@
1
+ import type { NodeOptions } from '@sentry/node';
2
+ export interface Config {
3
+ dsn: string | null;
4
+ sendMetadata: boolean;
5
+ init: NodeOptions;
6
+ }
7
+ declare const _default: {
8
+ default: {
9
+ dsn: null;
10
+ sendMetadata: true;
11
+ init: {};
12
+ };
13
+ validator(): void;
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../server/src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,WAAW,CAAC;CACnB;;;;;;;;;AAED,wBAOE"}
@@ -0,0 +1,24 @@
1
+ declare const _default: () => {
2
+ bootstrap: ({ strapi }: {
3
+ strapi: import("@strapi/types").Strapi;
4
+ }) => Promise<void>;
5
+ config: {
6
+ default: {
7
+ dsn: null;
8
+ sendMetadata: true;
9
+ init: {};
10
+ };
11
+ validator(): void;
12
+ };
13
+ services: {
14
+ sentry: ({ strapi }: {
15
+ strapi: import("@strapi/types").Strapi;
16
+ }) => {
17
+ init(): any;
18
+ getInstance(): typeof import("@sentry/node") | null;
19
+ sendError(error: Error, configureScope?: ((scope: import("@sentry/hub").Scope) => void) | undefined): void;
20
+ };
21
+ };
22
+ };
23
+ export default _default;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,wBAIG"}
@@ -0,0 +1,9 @@
1
+ import type { Strapi } from '@strapi/strapi';
2
+ /**
3
+ * Programmatic sentry middleware. We do not want to expose it in the plugin
4
+ */
5
+ declare const _default: ({ strapi }: {
6
+ strapi: Strapi;
7
+ }) => void;
8
+ export default _default;
9
+ //# sourceMappingURL=sentry.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ sentry: ({ strapi }: {
3
+ strapi: import("@strapi/types").Strapi;
4
+ }) => {
5
+ init(): any;
6
+ getInstance(): typeof import("@sentry/node") | null;
7
+ sendError(error: Error, configureScope?: ((scope: import("@sentry/hub").Scope) => void) | undefined): void;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":";;;;;;;;;AAEA,wBAEE"}
@@ -0,0 +1,20 @@
1
+ import type { Strapi } from '@strapi/strapi';
2
+ import * as Sentry from '@sentry/node';
3
+ declare const _default: ({ strapi }: {
4
+ strapi: Strapi;
5
+ }) => {
6
+ /**
7
+ * Initialize Sentry service
8
+ */
9
+ init(): any;
10
+ /**
11
+ * Expose Sentry instance through a getter
12
+ */
13
+ getInstance(): typeof Sentry | null;
14
+ /**
15
+ * Higher level method to send exception events to Sentry
16
+ */
17
+ sendError(error: Error, configureScope?: ((scope: Sentry.Scope) => void) | undefined): void;
18
+ };
19
+ export default _default;
20
+ //# sourceMappingURL=sentry.d.ts.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-sentry",
3
- "version": "4.17.0",
3
+ "version": "4.18.0",
4
4
  "description": "Send Strapi error events to Sentry",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,35 +22,42 @@
22
22
  ],
23
23
  "exports": {
24
24
  "./strapi-admin": {
25
- "source": "./admin/src/index.js",
25
+ "types": "./dist/admin/src/index.d.ts",
26
+ "source": "./admin/src/index.ts",
26
27
  "import": "./dist/admin/index.mjs",
27
28
  "require": "./dist/admin/index.js",
28
29
  "default": "./dist/admin/index.js"
29
30
  },
30
31
  "./strapi-server": {
31
- "source": "./strapi-server.js",
32
- "require": "./strapi-server.js",
33
- "default": "./strapi-server.js"
32
+ "types": "./dist/server/src/index.d.ts",
33
+ "source": "./server/src/index.ts",
34
+ "import": "./dist/server/index.mjs",
35
+ "require": "./dist/server/index.js",
36
+ "default": "./dist/server/index.js"
34
37
  },
35
38
  "./package.json": "./package.json"
36
39
  },
40
+ "files": [
41
+ "./dist",
42
+ "strapi-server.js"
43
+ ],
37
44
  "scripts": {
38
- "build": "pack-up build",
45
+ "build": "strapi plugin:build --force",
39
46
  "clean": "run -T rimraf dist",
40
47
  "lint": "run -T eslint .",
41
48
  "test:unit": "run -T jest",
42
49
  "test:unit:watch": "run -T jest --watch",
43
- "watch": "pack-up watch"
50
+ "watch": "strapi plugin:watch"
44
51
  },
45
52
  "dependencies": {
46
53
  "@sentry/node": "6.19.7",
47
54
  "@strapi/design-system": "1.14.1",
48
- "@strapi/helper-plugin": "4.17.0",
55
+ "@strapi/helper-plugin": "4.18.0",
49
56
  "@strapi/icons": "1.14.1"
50
57
  },
51
58
  "devDependencies": {
52
- "@strapi/pack-up": "4.17.0",
53
- "@strapi/strapi": "4.17.0",
59
+ "@strapi/pack-up": "4.18.0",
60
+ "@strapi/strapi": "4.18.0",
54
61
  "react": "^18.2.0",
55
62
  "react-dom": "^18.2.0",
56
63
  "react-router-dom": "5.3.4",
@@ -73,5 +80,5 @@
73
80
  "description": "Send Strapi error events to Sentry.",
74
81
  "kind": "plugin"
75
82
  },
76
- "gitHead": "07112073ac7b4ffee57b911a13981bea3e6930cf"
83
+ "gitHead": "e1ede8c55a0e1e22ce20137bf238fc374bd5dd51"
77
84
  }
package/strapi-server.js CHANGED
@@ -1,3 +1,3 @@
1
1
  'use strict';
2
2
 
3
- module.exports = require('./server');
3
+ module.exports = require('./dist/server');
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- dist
package/.eslintrc DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "root": true,
3
- "overrides": [
4
- {
5
- "files": ["admin/**/*"],
6
- "extends": ["custom/front"]
7
- },
8
- {
9
- "files": ["**/*"],
10
- "excludedFiles": ["admin/**/*"],
11
- "extends": ["custom/back"]
12
- }
13
- ]
14
- }
package/.gitattributes DELETED
@@ -1,103 +0,0 @@
1
- # From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
2
-
3
- # Handle line endings automatically for files detected as text
4
- # and leave all files detected as binary untouched.
5
- * text=auto
6
-
7
- #
8
- # The above will handle all files NOT found below
9
- #
10
-
11
- #
12
- ## These files are text and should be normalized (Convert crlf => lf)
13
- #
14
-
15
- # source code
16
- *.php text
17
- *.css text
18
- *.sass text
19
- *.scss text
20
- *.less text
21
- *.styl text
22
- *.js text eol=lf
23
- *.coffee text
24
- *.json text
25
- *.htm text
26
- *.html text
27
- *.xml text
28
- *.svg text
29
- *.txt text
30
- *.ini text
31
- *.inc text
32
- *.pl text
33
- *.rb text
34
- *.py text
35
- *.scm text
36
- *.sql text
37
- *.sh text
38
- *.bat text
39
-
40
- # templates
41
- *.ejs text
42
- *.hbt text
43
- *.jade text
44
- *.haml text
45
- *.hbs text
46
- *.dot text
47
- *.tmpl text
48
- *.phtml text
49
-
50
- # git config
51
- .gitattributes text
52
- .gitignore text
53
- .gitconfig text
54
-
55
- # code analysis config
56
- .jshintrc text
57
- .jscsrc text
58
- .jshintignore text
59
- .csslintrc text
60
-
61
- # misc config
62
- *.yaml text
63
- *.yml text
64
- .editorconfig text
65
-
66
- # build config
67
- *.npmignore text
68
- *.bowerrc text
69
-
70
- # Heroku
71
- Procfile text
72
- .slugignore text
73
-
74
- # Documentation
75
- *.md text
76
- LICENSE text
77
- AUTHORS text
78
-
79
-
80
- #
81
- ## These files are binary and should be left untouched
82
- #
83
-
84
- # (binary is a macro for -text -diff)
85
- *.png binary
86
- *.jpg binary
87
- *.jpeg binary
88
- *.gif binary
89
- *.ico binary
90
- *.mov binary
91
- *.mp4 binary
92
- *.mp3 binary
93
- *.flv binary
94
- *.fla binary
95
- *.swf binary
96
- *.gz binary
97
- *.zip binary
98
- *.7z binary
99
- *.ttf binary
100
- *.eot binary
101
- *.woff binary
102
- *.pyc binary
103
- *.pdf binary
@@ -1,38 +0,0 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
-
3
- import pluginPkg from '../../package.json';
4
-
5
- import pluginId from './pluginId';
6
-
7
- const name = pluginPkg.strapi.name;
8
-
9
- export default {
10
- register(app) {
11
- app.registerPlugin({
12
- id: pluginId,
13
- name,
14
- });
15
- },
16
- bootstrap() {},
17
- async registerTrads({ locales }) {
18
- const importedTrads = await Promise.all(
19
- locales.map((locale) => {
20
- return import(`./translations/${locale}.json`)
21
- .then(({ default: data }) => {
22
- return {
23
- data: prefixPluginTranslations(data, pluginId),
24
- locale,
25
- };
26
- })
27
- .catch(() => {
28
- return {
29
- data: {},
30
- locale,
31
- };
32
- });
33
- })
34
- );
35
-
36
- return Promise.resolve(importedTrads);
37
- },
38
- };
@@ -1,5 +0,0 @@
1
- import pluginPkg from '../../package.json';
2
-
3
- const pluginId = pluginPkg.name.replace(/^@strapi\/plugin-/i, '');
4
-
5
- export default pluginId;
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Send Strapi fejlevents til Sentry.",
3
- "plugin.description.short": "Send Strapi fejlevents til Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Send Strapi error events to Sentry.",
3
- "plugin.description.short": "Send Strapi error events to Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Envíe los eventos de error de Strapi a Sentry.",
3
- "plugin.description.short": "Envíe los eventos de error de Strapi a Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Envoie vos erreurs Strapi à Sentry.",
3
- "plugin.description.short": "Envoie vos erreurs Strapi à Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Strapi 에러 이벤트를 Sentry에 보냅니다.",
3
- "plugin.description.short": "Strapi 에러 이벤트를 Sentry에 보냅니다.",
4
- "plugin.name": "Sentry에"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Wyślij zdarzenia z błędami ze Strapi do Sentry",
3
- "plugin.description.short": "Wyślij zdarzenia z błędami ze Strapi do Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Отсылает записи об ошибках Strapi в Sentry. Иными словами, ведёт журнал событий с ошибками и отправляет их в Sentry.",
3
- "plugin.description.short": "Отсылает записи об ошибках Strapi в Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Skicka felkoder från strapi som Sentry-events.",
3
- "plugin.description.short": "Skicka felkoder från strapi som Sentry-events.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Strapi hata olaylarını Sentry'e ilet.",
3
- "plugin.description.short": "Strapi hata olaylarını Sentry'e ilet.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "Gửi lỗi Strapi lên Sentry.",
3
- "plugin.description.short": "Gửi lỗi Strapi lên Sentry.",
4
- "plugin.name": "Sentry"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "plugin.description.long": "將 Strapi 錯誤事件傳送至 Sentry。",
3
- "plugin.description.short": "將 Strapi 錯誤事件傳送至 Sentry。",
4
- "plugin.name": "Sentry"
5
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"dk-00b47489.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dk-b05451b4.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"en-2dbaca4a.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"en-70258e03.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"es-0812c06d.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"es-4352c0b3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fr-22b3a920.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fr-81925960.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ko-5ab994e9.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ko-f357ad11.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pl-5065555b.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pl-91ad3b57.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ru-c00f24a0.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ru-ea18416d.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sv-8f50eca3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sv-a8d028fb.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tr-dca6c197.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tr-de905f5b.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vi-22d50e0e.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vi-6d3d2db0.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"zh-9ec5b9b1.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"zh-ac6dac24.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/jest.config.js DELETED
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- preset: '../../../jest-preset.unit.js',
5
- displayName: 'Sentry plugin',
6
- };