@naturalcycles/backend-lib 9.44.1 → 9.44.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.
@@ -8,7 +8,7 @@ import type { Application, IRouter, NextFunction, Request, Response } from 'expr
8
8
  * `BackendRequest` seems to not conflict with anything right now.
9
9
  * Previous name `ExpressRequest` was clashing with Sentry.
10
10
  */
11
- export interface BackendRequest extends Request {
11
+ export interface BackendRequest<BODY = unknown> extends Request {
12
12
  debug: CommonLogFunction;
13
13
  log: CommonLogFunction;
14
14
  warn: CommonLogFunction;
@@ -19,10 +19,10 @@ export interface BackendRequest extends Request {
19
19
  */
20
20
  userId?: string;
21
21
  /**
22
- * It's set to unknown (instead of `any`) to prevent implicit use of any
22
+ * It defaults to unknown (instead of `any`) to prevent implicit use of any
23
23
  * in unexpected places.
24
24
  */
25
- body: unknown;
25
+ body: BODY;
26
26
  /**
27
27
  * Raw Buffer of the `req.body`, before it's stringified and json-parsed.
28
28
  * Useful for when something mutates `req.body` json (e.g j validation), and you
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/backend-lib",
3
3
  "type": "module",
4
- "version": "9.44.1",
4
+ "version": "9.44.2",
5
5
  "peerDependencies": {
6
6
  "@sentry/node": "^10"
7
7
  },
@@ -29,7 +29,7 @@
29
29
  "@sentry/node": "^10",
30
30
  "@types/ejs": "^3",
31
31
  "fastify": "^5",
32
- "@naturalcycles/dev-lib": "20.12.11"
32
+ "@naturalcycles/dev-lib": "18.4.2"
33
33
  },
34
34
  "exports": {
35
35
  ".": "./dist/index.js",
@@ -9,7 +9,7 @@ import type { Application, IRouter, NextFunction, Request, Response } from 'expr
9
9
  * `BackendRequest` seems to not conflict with anything right now.
10
10
  * Previous name `ExpressRequest` was clashing with Sentry.
11
11
  */
12
- export interface BackendRequest extends Request {
12
+ export interface BackendRequest<BODY = unknown> extends Request {
13
13
  debug: CommonLogFunction
14
14
  log: CommonLogFunction
15
15
  warn: CommonLogFunction
@@ -22,10 +22,10 @@ export interface BackendRequest extends Request {
22
22
  userId?: string
23
23
 
24
24
  /**
25
- * It's set to unknown (instead of `any`) to prevent implicit use of any
25
+ * It defaults to unknown (instead of `any`) to prevent implicit use of any
26
26
  * in unexpected places.
27
27
  */
28
- body: unknown
28
+ body: BODY
29
29
 
30
30
  /**
31
31
  * Raw Buffer of the `req.body`, before it's stringified and json-parsed.