express-zod-api 5.3.3 → 5.4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  ## Version 5
4
4
 
5
+ ### v5.4.2
6
+
7
+ - `ramda` version is 0.28.0.
8
+ - The header `X-Powered-By: Express` has been removed according to
9
+ [recommendations](https://expressjs.com/en/advanced/best-practice-security.html).
10
+
11
+ ### v5.4.1
12
+
13
+ - No changes.
14
+
15
+ ### v5.4.1-beta1
16
+
17
+ - Listing the following types as the regular dependencies since certain exported methods refer to them:
18
+ `@types/compression, @types/express, @types/express-fileupload, @types/http-errors, @types/node`.
19
+ - Here is the information that underlies this decision:
20
+ - https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies
21
+ - https://github.com/DefinitelyTyped/DefinitelyTyped/issues/44777#issuecomment-629660992
22
+
23
+ ### v5.4.0
24
+
25
+ - Feature #281: Response compression.
26
+ - You can enable and configure the response compression using the new option `compression` in server configuration
27
+ when using `createServer()` method.
28
+ - In order to receive the compressed response the client should include the following header in the request:
29
+ `Accept-Encoding: gzip, deflate`.
30
+ - Only responses with compressible content types are subject to compression.
31
+ - There is also a default threshold of 1KB that can be configured.
32
+
33
+ ```typescript
34
+ import { createConfig } from "express-zod-api";
35
+
36
+ const config = createConfig({
37
+ server: {
38
+ // enabling and configuring the compression: bool or options
39
+ compression: {
40
+ threshold: "100b",
41
+ },
42
+ // other options
43
+ },
44
+ });
45
+ ```
46
+
5
47
  ### v5.3.3
6
48
 
7
49
  - `ramda` version is 0.27.2.
package/LICENSE CHANGED
@@ -19,238 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
-
24
-
25
- Express - https://github.com/expressjs/express
26
-
27
- (The MIT License)
28
-
29
- Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
30
- Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>
31
- Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
32
-
33
- Permission is hereby granted, free of charge, to any person obtaining
34
- a copy of this software and associated documentation files (the
35
- 'Software'), to deal in the Software without restriction, including
36
- without limitation the rights to use, copy, modify, merge, publish,
37
- distribute, sublicense, and/or sell copies of the Software, and to
38
- permit persons to whom the Software is furnished to do so, subject to
39
- the following conditions:
40
-
41
- The above copyright notice and this permission notice shall be
42
- included in all copies or substantial portions of the Software.
43
-
44
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
45
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
-
52
-
53
-
54
- Zod - https://github.com/colinhacks/zod
55
-
56
- MIT License
57
-
58
- Copyright (c) 2020 Colin McDonnell
59
-
60
- Permission is hereby granted, free of charge, to any person obtaining a copy
61
- of this software and associated documentation files (the "Software"), to deal
62
- in the Software without restriction, including without limitation the rights
63
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64
- copies of the Software, and to permit persons to whom the Software is
65
- furnished to do so, subject to the following conditions:
66
-
67
- The above copyright notice and this permission notice shall be included in all
68
- copies or substantial portions of the Software.
69
-
70
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76
- SOFTWARE.
77
-
78
-
79
-
80
- HTTP Errors - https://github.com/jshttp/http-errors
81
-
82
- The MIT License (MIT)
83
-
84
- Copyright (c) 2014 Jonathan Ong me@jongleberry.com
85
- Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
86
-
87
- Permission is hereby granted, free of charge, to any person obtaining a copy
88
- of this software and associated documentation files (the "Software"), to deal
89
- in the Software without restriction, including without limitation the rights
90
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
91
- copies of the Software, and to permit persons to whom the Software is
92
- furnished to do so, subject to the following conditions:
93
-
94
- The above copyright notice and this permission notice shall be included in
95
- all copies or substantial portions of the Software.
96
-
97
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
101
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
102
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
103
- THE SOFTWARE.
104
-
105
-
106
-
107
- OpenApi3-TS - https://github.com/metadevpro/openapi3-ts
108
-
109
- The MIT License (MIT)
110
-
111
- Copyright (c) 2017-2018 Metadev https://metadev.pro
112
-
113
- Permission is hereby granted, free of charge, to any person obtaining a copy of
114
- this software and associated documentation files (the "Software"), to deal in
115
- the Software without restriction, including without limitation the rights to
116
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
117
- the Software, and to permit persons to whom the Software is furnished to do so,
118
- subject to the following conditions:
119
-
120
- The above copyright notice and this permission notice shall be included in all
121
- copies or substantial portions of the Software.
122
-
123
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
125
- FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
126
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
127
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
128
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
129
-
130
-
131
-
132
- Winston - https://github.com/winstonjs/winston
133
-
134
- Copyright (c) 2010 Charlie Robbins
135
-
136
- Permission is hereby granted, free of charge, to any person obtaining a copy
137
- of this software and associated documentation files (the "Software"), to deal
138
- in the Software without restriction, including without limitation the rights
139
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
140
- copies of the Software, and to permit persons to whom the Software is
141
- furnished to do so, subject to the following conditions:
142
-
143
- The above copyright notice and this permission notice shall be included in
144
- all copies or substantial portions of the Software.
145
-
146
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
151
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
152
- THE SOFTWARE.
153
-
154
-
155
-
156
- Mime - https://github.com/broofa/mime
157
-
158
- The MIT License (MIT)
159
-
160
- Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
161
-
162
- Permission is hereby granted, free of charge, to any person obtaining a copy
163
- of this software and associated documentation files (the "Software"), to deal
164
- in the Software without restriction, including without limitation the rights
165
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
166
- copies of the Software, and to permit persons to whom the Software is
167
- furnished to do so, subject to the following conditions:
168
-
169
- The above copyright notice and this permission notice shall be included in
170
- all copies or substantial portions of the Software.
171
-
172
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
173
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
174
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
175
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
176
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
177
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
178
- THE SOFTWARE.
179
-
180
-
181
-
182
- Express-FileUpload - https://github.com/richardgirges/express-fileupload
183
-
184
- The MIT License (MIT)
185
-
186
- Copyright (c) 2015 Richard Girges
187
-
188
- Permission is hereby granted, free of charge, to any person obtaining a copy
189
- of this software and associated documentation files (the "Software"), to deal
190
- in the Software without restriction, including without limitation the rights
191
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
192
- copies of the Software, and to permit persons to whom the Software is
193
- furnished to do so, subject to the following conditions:
194
-
195
- The above copyright notice and this permission notice shall be included in all
196
- copies or substantial portions of the Software.
197
-
198
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
199
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
200
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
201
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
202
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
203
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
204
- SOFTWARE.
205
-
206
-
207
-
208
- Ramda - https://github.com/ramda/ramda
209
-
210
- The MIT License (MIT)
211
-
212
- Copyright (c) 2013-2018 Scott Sauyet and Michael Hurley
213
-
214
- Permission is hereby granted, free of charge, to any person obtaining a copy
215
- of this software and associated documentation files (the "Software"), to deal
216
- in the Software without restriction, including without limitation the rights
217
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
218
- copies of the Software, and to permit persons to whom the Software is
219
- furnished to do so, subject to the following conditions:
220
-
221
- The above copyright notice and this permission notice shall be included in
222
- all copies or substantial portions of the Software.
223
-
224
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
225
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
226
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
227
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
228
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
229
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
230
- THE SOFTWARE.
231
-
232
-
233
-
234
- Triple-Beam - https://github.com/winstonjs/triple-beam
235
-
236
- MIT License
237
-
238
- Copyright (c) 2017 winstonjs
239
-
240
- Permission is hereby granted, free of charge, to any person obtaining a copy
241
- of this software and associated documentation files (the "Software"), to deal
242
- in the Software without restriction, including without limitation the rights
243
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
244
- copies of the Software, and to permit persons to whom the Software is
245
- furnished to do so, subject to the following conditions:
246
-
247
- The above copyright notice and this permission notice shall be included in all
248
- copies or substantial portions of the Software.
249
-
250
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
251
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
252
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
253
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
254
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
255
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
256
- SOFTWARE.
package/README.md CHANGED
@@ -39,9 +39,10 @@ Start your API server with I/O schema validation and custom middlewares in minut
39
39
  11. [Multiple schemas for one route](#multiple-schemas-for-one-route)
40
40
  12. [Serving static files](#serving-static-files)
41
41
  13. [Customizing input sources](#customizing-input-sources)
42
- 14. [Enabling HTTPS](#enabling-https)
43
- 15. [Informing the frontend about the API](#informing-the-frontend-about-the-api)
44
- 16. [Creating a documentation](#creating-a-documentation)
42
+ 14. [Enabling compression](#enabling-compression)
43
+ 15. [Enabling HTTPS](#enabling-https)
44
+ 16. [Informing the frontend about the API](#informing-the-frontend-about-the-api)
45
+ 17. [Creating a documentation](#creating-a-documentation)
45
46
  5. [Additional hints](#additional-hints)
46
47
  1. [How to test endpoints](#how-to-test-endpoints)
47
48
  2. [Excessive properties in endpoint output](#excessive-properties-in-endpoint-output)
@@ -596,6 +597,32 @@ createConfig({
596
597
  });
597
598
  ```
598
599
 
600
+ ## Enabling compression
601
+
602
+ According to [Express JS best practices guide](http://expressjs.com/en/advanced/best-practice-performance.html)
603
+ it might be a good idea to enable GZIP compression of your API responses. You can achieve and customize it by using the
604
+ corresponding configuration option when using the `createServer()` method.
605
+
606
+ In order to receive the compressed response the client should include the following header in the request:
607
+ `Accept-Encoding: gzip, deflate`. Only responses with compressible content types are subject to compression. There is
608
+ also a default threshold of 1KB that can be configured.
609
+
610
+ ```typescript
611
+ import { createConfig } from "express-zod-api";
612
+
613
+ const config = createConfig({
614
+ server: {
615
+ // compression: true, or:
616
+ compression: {
617
+ // @see https://www.npmjs.com/package/compression#options
618
+ threshold: "100b",
619
+ },
620
+ // ... other options
621
+ },
622
+ // ... other options
623
+ });
624
+ ```
625
+
599
626
  ## Enabling HTTPS
600
627
 
601
628
  The modern API standard often assumes the use of a secure data transfer protocol, confirmed by a TLS certificate, also
package/SECURITY.md CHANGED
@@ -16,6 +16,6 @@
16
16
  Found a vulnerability or other security issue?
17
17
 
18
18
  Please urgently inform me privately by
19
- [email](https://github.com/RobinTail/express-zod-api/blob/master/package.json#L88).
19
+ [email](https://github.com/RobinTail/express-zod-api/blob/master/package.json#L102).
20
20
 
21
21
  I will try to fix it as soon as possible.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import compression from "compression";
2
3
  import { NextHandleFunction } from "connect";
3
4
  import { Express, Request } from "express";
4
5
  import fileUpload from "express-fileupload";
@@ -16,11 +17,13 @@ export interface LoggerConfig {
16
17
  color: boolean;
17
18
  }
18
19
  declare type UploadOptions = Pick<fileUpload.Options, "createParentPath" | "uriDecodeFileNames" | "safeFileNames" | "preserveExtension" | "useTempFiles" | "tempFileDir" | "debug" | "uploadTimeout">;
20
+ declare type CompressionOptions = Pick<compression.CompressionOptions, "threshold" | "level" | "strategy" | "chunkSize" | "memLevel">;
19
21
  export interface ServerConfig {
20
22
  server: {
21
23
  listen: number | string;
22
24
  jsonParser?: NextHandleFunction;
23
25
  upload?: boolean | UploadOptions;
26
+ compression?: boolean | CompressionOptions;
24
27
  };
25
28
  https?: {
26
29
  options: ServerOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"config-type.js","sourceRoot":"","sources":["../src/config-type.ts"],"names":[],"mappings":";;;AAQa,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;CACZ,CAAC;AA0DK,MAAM,YAAY,GAAG,CAG1B,MAAS,EACN,EAAE,CAAC,MAAM,CAAC;AAJF,QAAA,YAAY,gBAIV"}
1
+ {"version":3,"file":"config-type.js","sourceRoot":"","sources":["../src/config-type.ts"],"names":[],"mappings":";;;AASa,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;CACZ,CAAC;AAgEK,MAAM,YAAY,GAAG,CAG1B,MAAS,EACN,EAAE,CAAC,MAAM,CAAC;AAJF,QAAA,YAAY,gBAIV"}
package/dist/server.js CHANGED
@@ -24,6 +24,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.createServer = exports.attachRouting = exports.createNotFoundHandler = exports.createParserFailureHandler = void 0;
26
26
  const express_1 = __importStar(require("express"));
27
+ const compression_1 = __importDefault(require("compression"));
27
28
  const express_fileupload_1 = __importDefault(require("express-fileupload"));
28
29
  const https_1 = __importDefault(require("https"));
29
30
  const errors_1 = require("./errors");
@@ -84,7 +85,15 @@ function createServer(config, routing) {
84
85
  ? (0, logger_1.createLogger)(config.logger)
85
86
  : config.logger;
86
87
  const app = (0, express_1.default)();
88
+ app.disable("x-powered-by");
87
89
  const errorHandler = config.errorHandler || result_handler_1.defaultResultHandler;
90
+ const compressor = config.server.compression
91
+ ? (0, compression_1.default)({
92
+ ...(typeof config.server.compression === "object"
93
+ ? config.server.compression
94
+ : {}),
95
+ })
96
+ : undefined;
88
97
  const jsonParser = config.server.jsonParser || (0, express_1.json)();
89
98
  const multipartParser = config.server.upload
90
99
  ? (0, express_fileupload_1.default)({
@@ -95,7 +104,11 @@ function createServer(config, routing) {
95
104
  parseNested: true,
96
105
  })
97
106
  : undefined;
98
- app.use([jsonParser].concat(multipartParser || []));
107
+ const middlewares = []
108
+ .concat(compressor || [])
109
+ .concat(jsonParser)
110
+ .concat(multipartParser || []);
111
+ app.use(middlewares);
99
112
  app.use((0, exports.createParserFailureHandler)(errorHandler, logger));
100
113
  (0, routing_1.initRouting)({ app, routing, logger, config });
101
114
  app.use((0, exports.createNotFoundHandler)(errorHandler, logger));
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA6E;AAC7E,4EAA4C;AAC5C,kDAA0B;AAG1B,qCAA8C;AAC9C,qDAAkD;AAClD,qCAAwC;AACxC,qDAA2E;AAC3E,uCAAiD;AACjD,8DAA0C;AAInC,MAAM,0BAA0B,GACrC,CAAC,YAA8B,EAAE,MAAc,EAAuB,EAAE,CACxE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;IACjC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,EAAE,CAAC;KACf;IACD,YAAY,CAAC,OAAO,CAAC;QACnB,KAAK;QACL,OAAO;QACP,QAAQ;QACR,MAAM;QACN,KAAK,EAAE,OAAO,CAAC,IAAI;QACnB,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC,CAAC;AAdS,QAAA,0BAA0B,8BAcnC;AAEG,MAAM,qBAAqB,GAChC,CAAC,YAA8B,EAAE,MAAc,EAAkB,EAAE,CACnE,CAAC,OAAO,EAAE,QAAQ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CAAC,GAAG,CAAC,IAAA,6BAAqB,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAErD,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAI,WAAqC,CAAC;IAC1C,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,WAAW,GAAG,eAAK;aAChB,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC;aACvC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE;YAChC,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,KAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;KACN;IAED,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC;AAnDD,oCAmDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config-type.js","sourceRoot":"","sources":["../src/config-type.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;CACZ,CAAC;AA0DF,MAAM,CAAC,MAAM,YAAY,GAAG,CAG1B,MAAS,EACN,EAAE,CAAC,MAAM,CAAC"}
1
+ {"version":3,"file":"config-type.js","sourceRoot":"","sources":["../src/config-type.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;CACZ,CAAC;AAgEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAG1B,MAAS,EACN,EAAE,CAAC,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"type":"module","version":"5.3.3"}
1
+ {"type":"module","version":"5.4.2"}
@@ -1,4 +1,5 @@
1
1
  import express, { json } from "express";
2
+ import compression from "compression";
2
3
  import fileUpload from "express-fileupload";
3
4
  import https from "https";
4
5
  import { ResultHandlerError } from "./errors.js";
@@ -56,7 +57,15 @@ export function createServer(config, routing) {
56
57
  ? createLogger(config.logger)
57
58
  : config.logger;
58
59
  const app = express();
60
+ app.disable("x-powered-by");
59
61
  const errorHandler = config.errorHandler || defaultResultHandler;
62
+ const compressor = config.server.compression
63
+ ? compression({
64
+ ...(typeof config.server.compression === "object"
65
+ ? config.server.compression
66
+ : {}),
67
+ })
68
+ : undefined;
60
69
  const jsonParser = config.server.jsonParser || json();
61
70
  const multipartParser = config.server.upload
62
71
  ? fileUpload({
@@ -67,7 +76,11 @@ export function createServer(config, routing) {
67
76
  parseNested: true,
68
77
  })
69
78
  : undefined;
70
- app.use([jsonParser].concat(multipartParser || []));
79
+ const middlewares = []
80
+ .concat(compressor || [])
81
+ .concat(jsonParser)
82
+ .concat(multipartParser || []);
83
+ app.use(middlewares);
71
84
  app.use(createParserFailureHandler(errorHandler, logger));
72
85
  initRouting({ app, routing, logger, config });
73
86
  app.use(createNotFoundHandler(errorHandler, logger));
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAuC,IAAI,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MA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AG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-zod-api",
3
- "version": "5.3.3",
3
+ "version": "5.4.2",
4
4
  "description": "A Typescript library to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -34,12 +34,18 @@
34
34
  "import": "./dist-esm/index.js"
35
35
  },
36
36
  "dependencies": {
37
+ "@types/compression": "^1.7.2",
38
+ "@types/express": "^4.17.13",
39
+ "@types/express-fileupload": "^1.2.2",
40
+ "@types/http-errors": "^1.8.2",
41
+ "@types/node": "*",
42
+ "compression": "1.7.4",
37
43
  "express": "4.17.2",
38
44
  "express-fileupload": "1.2.1",
39
45
  "http-errors": "2.0.0",
40
46
  "mime": "3.0.0",
41
47
  "openapi3-ts": "2.0.1",
42
- "ramda": "0.27.2",
48
+ "ramda": "0.28.0",
43
49
  "triple-beam": "1.3.0",
44
50
  "winston": "3.4.0",
45
51
  "zod": "3.11.6"
@@ -58,12 +64,8 @@
58
64
  },
59
65
  "devDependencies": {
60
66
  "@tsconfig/node12": "^1.0.9",
61
- "@types/express": "^4.17.13",
62
- "@types/express-fileupload": "^1.1.7",
63
- "@types/http-errors": "^1.8.1",
64
67
  "@types/jest": "^27.0.2",
65
68
  "@types/mime": "^2.0.3",
66
- "@types/node": "*",
67
69
  "@types/node-fetch": "^2.5.12",
68
70
  "@types/ramda": "^0.27.46",
69
71
  "@types/triple-beam": "^1.3.2",