@trojs/openapi-server 1.2.4 → 2.0.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.
- package/package.json +6 -5
- package/src/server.js +4 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trojs/openapi-server",
|
|
3
3
|
"description": "OpenAPI Server",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Pieter Wigboldus",
|
|
7
7
|
"url": "https://trojs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@hckrnews/eslint-code-quality": "^0.2.1",
|
|
37
37
|
"@hckrnews/eslint-config": "^3.1.0",
|
|
38
38
|
"@types/express-serve-static-core": "^4.17.41",
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^22.0.0",
|
|
40
40
|
"c8": "^10.0.0",
|
|
41
41
|
"eslint": "^8.23.0",
|
|
42
42
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"express"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@sentry/node": "^
|
|
69
|
+
"@sentry/node": "^8.0.0",
|
|
70
70
|
"ajv-formats": "^3.0.0",
|
|
71
|
-
"body-parser": "^
|
|
71
|
+
"body-parser": "^2.0.0",
|
|
72
72
|
"compression": "^1.7.4",
|
|
73
73
|
"cors": "^2.8.5",
|
|
74
74
|
"express": "^4.19.2",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"url": "https://github.com/sponsors/w3nl"
|
|
82
82
|
},
|
|
83
83
|
"overrides": {
|
|
84
|
-
"semver": "^7.5.3"
|
|
84
|
+
"semver": "^7.5.3",
|
|
85
|
+
"send": "^0.19.0"
|
|
85
86
|
}
|
|
86
87
|
}
|
package/src/server.js
CHANGED
|
@@ -29,6 +29,7 @@ const getOriginResourcePolicy = (origin) => ({
|
|
|
29
29
|
* @typedef {import('./api.js').ApiSchema} ApiSchema
|
|
30
30
|
* @typedef {import('./api.js').Logger} Logger
|
|
31
31
|
* @typedef {import('express').Express} Express
|
|
32
|
+
* @typedef {import('@sentry/types').Integration} Integration
|
|
32
33
|
*/
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -51,6 +52,7 @@ const getOriginResourcePolicy = (origin) => ({
|
|
|
51
52
|
* @property {number=} tracesSampleRate
|
|
52
53
|
* @property {number=} profilesSampleRate
|
|
53
54
|
* @property {string=} release
|
|
55
|
+
* @property {Integration[]=} integrations
|
|
54
56
|
*/
|
|
55
57
|
|
|
56
58
|
/**
|
|
@@ -84,16 +86,11 @@ export const setupServer = async ({
|
|
|
84
86
|
if (sentry) {
|
|
85
87
|
Sentry.init({
|
|
86
88
|
dsn: sentry.dsn,
|
|
87
|
-
integrations: [
|
|
88
|
-
new Sentry.Integrations.Http({ tracing: true }),
|
|
89
|
-
new Sentry.Integrations.Express({ app }),
|
|
90
|
-
],
|
|
91
89
|
tracesSampleRate: sentry.tracesSampleRate || 1.0,
|
|
92
90
|
profilesSampleRate: sentry.profilesSampleRate || 1.0,
|
|
91
|
+
integrations: sentry.integrations || [],
|
|
93
92
|
release: sentry.release,
|
|
94
93
|
});
|
|
95
|
-
|
|
96
|
-
app.use(Sentry.Handlers.requestHandler());
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
app.use(cors(corsOptions));
|
|
@@ -119,7 +116,7 @@ export const setupServer = async ({
|
|
|
119
116
|
});
|
|
120
117
|
|
|
121
118
|
if (sentry) {
|
|
122
|
-
|
|
119
|
+
Sentry.setupExpressErrorHandler(app);
|
|
123
120
|
}
|
|
124
121
|
|
|
125
122
|
return { app };
|