@openapi-typescript-infra/service 5.8.0 → 5.9.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-typescript-infra/service",
3
- "version": "5.8.0",
3
+ "version": "5.9.0",
4
4
  "description": "An opinionated framework for building configuration driven services - web, api, or ob. Uses OpenAPI, pino logging, express, confit, Typescript and vitest.",
5
5
  "exports": {
6
6
  ".": {
@@ -92,10 +92,10 @@
92
92
  "clean-stack": "^5.2.0",
93
93
  "cookie-parser": "^1.4.7",
94
94
  "dotenv": "^16.4.7",
95
- "express": "^5.0.1",
96
- "express-openapi-validator": "^5.3.9",
95
+ "express": "^5.1.0",
96
+ "express-openapi-validator": "^5.4.7",
97
97
  "glob": "^11.0.1",
98
- "import-in-the-middle": "^1.13.0",
98
+ "import-in-the-middle": "^1.13.1",
99
99
  "minimist": "^1.2.8",
100
100
  "moderndash": "^4.0.0",
101
101
  "pino": "^9.6.0",
@@ -103,33 +103,33 @@
103
103
  "request-ip": "^3.3.0"
104
104
  },
105
105
  "devDependencies": {
106
- "@commitlint/cli": "^19.7.1",
107
- "@commitlint/config-conventional": "^19.7.1",
106
+ "@commitlint/cli": "^19.8.0",
107
+ "@commitlint/config-conventional": "^19.8.0",
108
108
  "@openapi-typescript-infra/coconfig": "^4.6.0",
109
109
  "@semantic-release/commit-analyzer": "^13.0.1",
110
110
  "@semantic-release/exec": "^7.0.3",
111
111
  "@semantic-release/github": "^11.0.1",
112
112
  "@semantic-release/release-notes-generator": "^14.0.3",
113
113
  "@types/cookie-parser": "^1.4.8",
114
- "@types/express": "^5.0.0",
114
+ "@types/express": "^5.0.1",
115
115
  "@types/minimist": "^1.2.5",
116
- "@types/node": "^22.13.5",
116
+ "@types/node": "^22.13.17",
117
117
  "@types/request-ip": "^0.0.41",
118
- "@types/supertest": "^6.0.2",
118
+ "@types/supertest": "^6.0.3",
119
119
  "@typescript-eslint/eslint-plugin": "^7.18.0",
120
120
  "@typescript-eslint/parser": "^7.18.0",
121
121
  "coconfig": "^1.6.1",
122
122
  "eslint": "^8.57.1",
123
123
  "eslint-config-prettier": "^9.1.0",
124
- "eslint-import-resolver-typescript": "^3.8.3",
124
+ "eslint-import-resolver-typescript": "^4.3.1",
125
125
  "eslint-plugin-import": "^2.31.0",
126
126
  "pino-pretty": "^13.0.0",
127
127
  "pinst": "^3.0.0",
128
- "supertest": "^7.0.0",
128
+ "supertest": "^7.1.0",
129
129
  "tsconfig-paths": "^4.2.0",
130
130
  "tsx": "^4.19.3",
131
- "typescript": "^5.7.3",
132
- "vitest": "^3.0.7"
131
+ "typescript": "^5.8.2",
132
+ "vitest": "^3.1.1"
133
133
  },
134
134
  "resolutions": {
135
135
  "qs": "^6.11.0"
@@ -1,6 +1,7 @@
1
1
  import type { BaseConfitSchema } from '@sesamecare-oss/confit';
2
2
  import type { middleware } from 'express-openapi-validator';
3
3
  import type { Level } from 'pino';
4
+ import bodyParser from 'body-parser';
4
5
 
5
6
  export interface ConfigurationItemEnabled {
6
7
  enabled?: boolean;
@@ -28,8 +29,8 @@ export interface ConfigurationSchema extends BaseConfitSchema {
28
29
  etag?: boolean;
29
30
  cookieParser?: boolean;
30
31
  bodyParsers?: {
31
- json?: boolean;
32
- form?: boolean;
32
+ json?: boolean | Parameters<typeof bodyParser.json>[0];
33
+ form?: boolean | Parameters<typeof bodyParser.urlencoded>[0];
33
34
  };
34
35
  // Set static.enabled to true to enable static assets to be served
35
36
  static?: ConfigurationItemEnabled & {
@@ -174,6 +174,7 @@ export async function startApp<
174
174
  }
175
175
 
176
176
  if (routing?.bodyParsers?.json) {
177
+ const jsonArgs = typeof routing.bodyParsers.json === 'object' ? routing.bodyParsers.json : {};
177
178
  app.use(
178
179
  express.json({
179
180
  verify(req, res, buf) {
@@ -182,6 +183,7 @@ export async function startApp<
182
183
  locals.rawBody = buf;
183
184
  }
184
185
  },
186
+ ...jsonArgs,
185
187
  }),
186
188
  );
187
189
  }
@@ -298,8 +300,8 @@ function httpServer<
298
300
 
299
301
  return https.createServer(
300
302
  {
301
- key: config.key ? Buffer.from(config.key) : undefined,
302
- cert: config.certificate ? Buffer.from(config.certificate) : undefined,
303
+ key: config.key ? Buffer.from(config.key as string) : undefined,
304
+ cert: config.certificate ? Buffer.from(config.certificate as string) : undefined,
303
305
  },
304
306
  app,
305
307
  );