express-zod-api 14.0.0-beta1 → 14.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/CHANGELOG.md CHANGED
@@ -9,15 +9,17 @@
9
9
  - You might also need to install `@types/http-errors` if you're using `createHttpError` in your implementation.
10
10
  - `typescript` is a required peer dependency.
11
11
  - Minimum version of `zod` is 3.22.3.
12
- - The following ones are optional peer dependencies: `@types/compression`, `@types/express-fileupload`, `@types/node`.
13
12
  - The class `DependsOnMethodError` is removed — catch `RoutingError` instead if needed.
14
13
  - **Potentially breaking changes**:
15
14
  - The type `FlatObject` changed from `Record<string, any>` to `Record<string, unknown>`.
16
15
  - If a custom `ResultHandler` handles properties of the `output`, it might need to ensure its actual type.
17
- - In case of body parsing failure the `ResultHandler` recieves `null` into its `input` argument instead of raw body.
16
+ - In case of body parsing failure the `ResultHandler` receives `null` into its `input` argument instead of raw body.
18
17
  - Utilize the `request.body` within a custom `ResultHandler` in that case if needed.
19
- - The type of `ResultHandler`'s arguments `input` and `output` are changed from `any` to `FlatObject | null`.
20
- - Unlikely breaking changes:
18
+ - The type of `ResultHandler`'s arguments `input` and `output` is changed from `any` to `FlatObject | null`.
19
+ - Other changes:
20
+ - Ensure having the following packages installed for the types assistance:
21
+ - `yarn add --dev @types/express @types/node @types/http-errors`
22
+ - or `npm install -D @types/express @types/node @types/http-errors`
21
23
  - The property `DependsOnMethod::methods` is renamed to `endpoints`.
22
24
 
23
25
  ```typescript
@@ -29,6 +31,12 @@ import createHttpError from "http-errors";
29
31
 
30
32
  ## Version 12
31
33
 
34
+ ### v12.5.1
35
+
36
+ - Technical update before releasing next major version.
37
+ - I also would like to remind you to upgrade your `zod` (peer dependency) to at least 3.22.3.
38
+ - Check out [the security advice](https://github.com/advisories/GHSA-m95q-7qp3-xv42) to find out why.
39
+
32
40
  ### v12.5.0
33
41
 
34
42
  - Featuring an ability to specify multiple server URLs when generating documentation.
package/README.md CHANGED
@@ -104,12 +104,18 @@ Much can be customized to fit your needs.
104
104
 
105
105
  ## Installation
106
106
 
107
- Run one of the following commands to install the library and its peer dependencies.
107
+ Run one of the following commands to install the library, its peer dependencies and packages for types assistance.
108
108
 
109
109
  ```shell
110
110
  yarn add express-zod-api express zod winston typescript http-errors
111
- # or
111
+ yarn add --dev @types/express @types/node @types/http-errors
112
+ ```
113
+
114
+ or
115
+
116
+ ```shell
112
117
  npm install express-zod-api express zod winston typescript http-errors
118
+ npm install -D @types/express @types/node @types/http-errors
113
119
  ```
114
120
 
115
121
  Add the following option to your `tsconfig.json` file in order to make it work as expected:
@@ -820,9 +826,9 @@ const config = createConfig({
820
826
  const { app, httpServer, httpsServer, logger } = createServer(config, routing);
821
827
  ```
822
828
 
823
- At least you need to specify the port or socket (usually it is 443), certificate and the key, issued by the
824
- certifying authority. For example, you can acquire a free TLS certificate for your API at
825
- [Let's Encrypt](https://letsencrypt.org/).
829
+ Ensure having `@types/node` package installed. At least you need to specify the port or socket (usually it is 443),
830
+ certificate and the key, issued by the certifying authority. For example, you can acquire a free TLS certificate for
831
+ your API at [Let's Encrypt](https://letsencrypt.org/).
826
832
 
827
833
  ## Generating a Frontend Client
828
834
 
package/SECURITY.md CHANGED
@@ -24,6 +24,6 @@
24
24
  Found a vulnerability or other security issue?
25
25
 
26
26
  Please urgently inform me privately by
27
- [email](https://github.com/RobinTail/express-zod-api/blob/master/package.json#L146).
27
+ [email](https://github.com/RobinTail/express-zod-api/blob/master/package.json#L137).
28
28
 
29
29
  I will try to fix it as soon as possible.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-zod-api",
3
- "version": "14.0.0-beta1",
3
+ "version": "14.0.0",
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": {
@@ -46,15 +46,15 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "compression": "1.7.4",
50
- "express-fileupload": "1.4.1",
49
+ "@types/compression": "^1.7.3",
50
+ "@types/express-fileupload": "^1.4.2",
51
+ "compression": "~1.7.4",
52
+ "express-fileupload": "~1.4.1",
51
53
  "openapi3-ts": "^4.1.2",
52
- "ramda": "0.29.1"
54
+ "ramda": "~0.29.1"
53
55
  },
54
56
  "peerDependencies": {
55
- "@types/compression": "^1.7.3",
56
57
  "@types/express": "^4.17.13",
57
- "@types/express-fileupload": "^1.4.2",
58
58
  "@types/http-errors": "^2.0.2",
59
59
  "@types/jest": "*",
60
60
  "@types/node": "*",
@@ -66,22 +66,16 @@
66
66
  "zod": "^3.22.3"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
- "@types/compression": {
70
- "optional": true
71
- },
72
69
  "@types/express": {
73
70
  "optional": true
74
71
  },
75
- "@types/express-fileupload": {
76
- "optional": true
77
- },
78
72
  "@types/http-errors": {
79
73
  "optional": true
80
74
  },
81
- "@types/jest": {
75
+ "@types/node": {
82
76
  "optional": true
83
77
  },
84
- "@types/node": {
78
+ "@types/jest": {
85
79
  "optional": true
86
80
  },
87
81
  "jest": {
@@ -94,14 +88,11 @@
94
88
  "@swc/core": "^1.3.92",
95
89
  "@swc/jest": "^0.2.29",
96
90
  "@tsconfig/node18": "^18.2.1",
97
- "@types/compression": "^1.7.3",
98
91
  "@types/cors": "^2.8.14",
99
92
  "@types/express": "^4.17.17",
100
- "@types/express-fileupload": "^1.4.2",
101
93
  "@types/has-ansi": "^5.0.0",
102
94
  "@types/http-errors": "^2.0.2",
103
95
  "@types/jest": "^29.5.4",
104
- "@types/mime": "^3.0.1",
105
96
  "@types/node": "^20.8.4",
106
97
  "@types/ramda": "^0.29.3",
107
98
  "@types/triple-beam": "^1.3.2",