@trojs/openapi-server 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/api.js +8 -4
- package/src/router.js +6 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trojs/openapi-server",
|
|
3
3
|
"description": "OpenAPI Server",
|
|
4
|
-
"version": "1.11.
|
|
4
|
+
"version": "1.11.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Pieter Wigboldus",
|
|
7
7
|
"url": "https://trojs.org/"
|
|
@@ -76,4 +76,4 @@
|
|
|
76
76
|
"send@<=0.19.0": "^0.19.0",
|
|
77
77
|
"cookie@<=0.7.0": "0.7.0"
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
package/src/api.js
CHANGED
|
@@ -22,7 +22,8 @@ import { setupRouter } from './router.js'
|
|
|
22
22
|
* @property {boolean=} strictSpecification
|
|
23
23
|
* @property {boolean=} errorDetails
|
|
24
24
|
* @property {Logger=} logger
|
|
25
|
-
* @property {Function=}
|
|
25
|
+
* @property {Function=} preLog
|
|
26
|
+
* @property {Function=} postLog
|
|
26
27
|
* @property {object=} meta
|
|
27
28
|
* @property {SecurityHandler[]=} securityHandlers
|
|
28
29
|
* @property {Handler=} unauthorizedHandler
|
|
@@ -52,7 +53,8 @@ export class Api {
|
|
|
52
53
|
strictSpecification,
|
|
53
54
|
errorDetails,
|
|
54
55
|
logger,
|
|
55
|
-
|
|
56
|
+
preLog,
|
|
57
|
+
postLog,
|
|
56
58
|
meta,
|
|
57
59
|
securityHandlers,
|
|
58
60
|
unauthorizedHandler,
|
|
@@ -69,7 +71,8 @@ export class Api {
|
|
|
69
71
|
this.strictSpecification = strictSpecification
|
|
70
72
|
this.errorDetails = errorDetails || false
|
|
71
73
|
this.logger = logger || console
|
|
72
|
-
this.
|
|
74
|
+
this.preLog = preLog || undefined
|
|
75
|
+
this.postLog = postLog || undefined
|
|
73
76
|
this.meta = meta || {}
|
|
74
77
|
this.securityHandlers = securityHandlers || []
|
|
75
78
|
this.unauthorizedHandler = unauthorizedHandler || undefined
|
|
@@ -103,7 +106,8 @@ export class Api {
|
|
|
103
106
|
strictSpecification: this.strictSpecification,
|
|
104
107
|
errorDetails: this.errorDetails,
|
|
105
108
|
logger: this.logger,
|
|
106
|
-
|
|
109
|
+
preLog: this.preLog,
|
|
110
|
+
postLog: this.postLog,
|
|
107
111
|
meta: this.meta,
|
|
108
112
|
securityHandlers: this.securityHandlers,
|
|
109
113
|
unauthorizedHandler: this.unauthorizedHandler,
|
package/src/router.js
CHANGED
|
@@ -24,7 +24,8 @@ import { unauthorized } from './handlers/unauthorized.js'
|
|
|
24
24
|
* @param {boolean=} params.strictSpecification
|
|
25
25
|
* @param {boolean=} params.errorDetails
|
|
26
26
|
* @param {Logger=} params.logger
|
|
27
|
-
* @param {Function=} params.
|
|
27
|
+
* @param {Function=} params.preLog
|
|
28
|
+
* @param {Function=} params.postLog
|
|
28
29
|
* @param {object=} params.meta
|
|
29
30
|
* @param {SecurityHandler[]=} params.securityHandlers
|
|
30
31
|
* @param {Handler=} params.unauthorizedHandler
|
|
@@ -40,7 +41,8 @@ export const setupRouter = ({
|
|
|
40
41
|
strictSpecification,
|
|
41
42
|
errorDetails,
|
|
42
43
|
logger,
|
|
43
|
-
|
|
44
|
+
preLog,
|
|
45
|
+
postLog,
|
|
44
46
|
meta,
|
|
45
47
|
securityHandlers = [],
|
|
46
48
|
unauthorizedHandler,
|
|
@@ -81,7 +83,8 @@ export const setupRouter = ({
|
|
|
81
83
|
logger,
|
|
82
84
|
meta,
|
|
83
85
|
mock,
|
|
84
|
-
|
|
86
|
+
preLog,
|
|
87
|
+
postLog
|
|
85
88
|
})
|
|
86
89
|
)
|
|
87
90
|
}
|