@types/sap__approuter 14.3.1 → 14.3.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.
sap__approuter/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for @sap/approuter (https://www.npmjs.com
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sap__approuter.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 23 Nov 2023 10:36:26 GMT
11
+ * Last updated: Wed, 29 Nov 2023 13:08:30 GMT
12
12
  * Dependencies: [@types/http-server](https://npmjs.com/package/@types/http-server), [@types/node](https://npmjs.com/package/@types/node), [@types/verror](https://npmjs.com/package/@types/verror)
13
13
 
14
14
  # Credits
sap__approuter/index.d.ts CHANGED
@@ -60,23 +60,33 @@ declare namespace approuter {
60
60
  */
61
61
  backendTimeout?: (req: IncomingMessage, done: () => void) => void;
62
62
 
63
- /**
64
- * Callback for {@link afterRequestHandler}
65
- *
66
- * @param error - Error object in case of error
67
- * @param incomingResponse - Modified incomingResponse
68
- */
63
+ /** In order to make it easier to write middlewares being agnostic of the route, the `req.url` will be altered to remove the route part and the original URL will be set to this value */
64
+ originalUrl?: string;
65
+
66
+ /** Note: On each request, the application router executes registered middlewares in a certain order and the session is not available to all of them. */
67
+ sessionID?: string;
68
+
69
+ sessionStore?: SessionStore;
69
70
  }
70
71
 
71
72
  /**
72
73
  * A handler for requests, called Middleware.
73
74
  *
75
+ * The generic type T can be used to add custom properties to the request object type
76
+ * this is useful if a middleware adds custom properties to the request object
77
+ *
78
+ * @example
79
+ * interface RequestWithSession = {
80
+ * session?: {}
81
+ * }
82
+ * MiddlewareHandler<RequestWithSession>
83
+ *
74
84
  * @param request - Data of the incoming Request
75
85
  * @param response - Object for the outgoing Response; can be manipulated to alter the response
76
86
  * @param next - Call next to give control back to Application Router Middleware
77
87
  */
78
- type MiddlewareHandler = (
79
- request: AppRouterIncomingMessage,
88
+ type MiddlewareHandler<T = {}> = (
89
+ request: AppRouterIncomingMessage & T,
80
90
  response: ServerResponse,
81
91
  next: (value?: Error | string) => void,
82
92
  ) => void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/sap__approuter",
3
- "version": "14.3.1",
3
+ "version": "14.3.2",
4
4
  "description": "TypeScript definitions for @sap/approuter",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sap__approuter",
6
6
  "license": "MIT",
@@ -29,6 +29,6 @@
29
29
  "@types/node": "*",
30
30
  "@types/verror": "*"
31
31
  },
32
- "typesPublisherContentHash": "548a853deb07456b65e86e1a5ba22f2a32bd4eec6993e15f1774abaab2ec9d36",
33
- "typeScriptVersion": "4.5"
32
+ "typesPublisherContentHash": "e06bafbc8452e284b708f640bc11cef75aef577c429bcd01f0185f0c62f1cb13",
33
+ "typeScriptVersion": "4.6"
34
34
  }