From a1815bdb270ffbb0dbdd624fcf9550daf58f9ae0 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 29 Jan 2025 13:51:01 +0100 Subject: [PATCH 1/7] Explain `req.req` and `req.res` in `cds.EventContext` section --- node.js/events.md | 1 + 1 file changed, 1 insertion(+) diff --git a/node.js/events.md b/node.js/events.md index 294bf50dd..aae6a99ed 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -88,6 +88,7 @@ this.on ('*', req => { ``` Keep in mind that multiple requests (that is, instances of `cds.Request`) may share the same incoming HTTP request and outgoing HTTP response (for example, in case of an OData batch request). +The properties `req.req` and `req.res` can be used to access the express request and response objects of individual requests within a batch request, if the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is used. From e74828597e891f9b208e5d85d35754432562b122 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 29 Jan 2025 14:13:41 +0100 Subject: [PATCH 2/7] Revert "Explain `req.req` and `req.res` in `cds.EventContext` section" This reverts commit a1815bdb270ffbb0dbdd624fcf9550daf58f9ae0. --- node.js/events.md | 1 - 1 file changed, 1 deletion(-) diff --git a/node.js/events.md b/node.js/events.md index aae6a99ed..294bf50dd 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -88,7 +88,6 @@ this.on ('*', req => { ``` Keep in mind that multiple requests (that is, instances of `cds.Request`) may share the same incoming HTTP request and outgoing HTTP response (for example, in case of an OData batch request). -The properties `req.req` and `req.res` can be used to access the express request and response objects of individual requests within a batch request, if the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is used. From e85d5a617f76a7685819f34f41739baac9575889 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 29 Jan 2025 14:59:49 +0100 Subject: [PATCH 3/7] Add `req.req` and `req.res` sections --- node.js/events.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/node.js/events.md b/node.js/events.md index 294bf50dd..b07c3268e 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -251,6 +251,26 @@ Class `cds.Request` extends [`cds.Event`] with additional features to represent +### . req {.property} + +Provides access to the express request object of individual requests within an incoming batch request. + +::: warning Note: +If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is not used, both `.req` and [`.http.req`](#http) refer to the same request object of the incoming batch request. +::: + + + +### . res {.property} + +Provides access to the express response object of individual requests within an incoming batch request. + +::: warning Note: +If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is not used, both `.res` and [`.http.res`](#http) refer to the same response object of the incoming batch request. +::: + + + ### . method {.property} The HTTP method of the incoming request: From c2975dc95b175e5d6d6dde6e270e30578134f293 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 29 Jan 2025 15:00:14 +0100 Subject: [PATCH 4/7] Reference `req.req` and `req.res` sections from `req.http` --- node.js/events.md | 1 + 1 file changed, 1 insertion(+) diff --git a/node.js/events.md b/node.js/events.md index b07c3268e..0db268ab2 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -88,6 +88,7 @@ this.on ('*', req => { ``` Keep in mind that multiple requests (that is, instances of `cds.Request`) may share the same incoming HTTP request and outgoing HTTP response (for example, in case of an OData batch request). +See sections [`req`](#req) and [`res`](#res) of `cds.Request` to learn more about accessing the request and response objects of individual requests within an incoming batch request. From ff804e7c008e9823b13a40eb3f997ad2826ff778 Mon Sep 17 00:00:00 2001 From: Mahati Shankar Date: Thu, 30 Jan 2025 14:08:49 +0100 Subject: [PATCH 5/7] cosmetics --- node.js/events.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node.js/events.md b/node.js/events.md index 0db268ab2..2d95100ac 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -257,7 +257,7 @@ Class `cds.Request` extends [`cds.Event`] with additional features to represent Provides access to the express request object of individual requests within an incoming batch request. ::: warning Note: -If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is not used, both `.req` and [`.http.req`](#http) refer to the same request object of the incoming batch request. +If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.req` and [`.http.req`](#http) refer to the same request object of the incoming batch request. ::: @@ -267,7 +267,7 @@ If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters- Provides access to the express response object of individual requests within an incoming batch request. ::: warning Note: -If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) is not used, both `.res` and [`.http.res`](#http) refer to the same response object of the incoming batch request. +If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.res` and [`.http.res`](#http) refer to the same response object of the incoming batch request. ::: From d2be9e1142a4233ecc2e24271b7b4fc5f436efe3 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Fri, 28 Feb 2025 17:07:59 +0100 Subject: [PATCH 6/7] Remove okra warnings --- node.js/events.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/node.js/events.md b/node.js/events.md index 2d95100ac..c56622243 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -256,20 +256,12 @@ Class `cds.Request` extends [`cds.Event`] with additional features to represent Provides access to the express request object of individual requests within an incoming batch request. -::: warning Note: -If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.req` and [`.http.req`](#http) refer to the same request object of the incoming batch request. -::: - ### . res {.property} Provides access to the express response object of individual requests within an incoming batch request. -::: warning Note: -If the [new OData adapter](../releases/archive/2024/jun24#new-protocol-adapters-ga) isn't used, both `.res` and [`.http.res`](#http) refer to the same response object of the incoming batch request. -::: - ### . method {.property} From a5f95fb51c76164971420b344569f5058992d1fd Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Fri, 28 Feb 2025 17:08:55 +0100 Subject: [PATCH 7/7] Explain non-batch convenience pointer --- node.js/events.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node.js/events.md b/node.js/events.md index c56622243..35363e57b 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -254,13 +254,13 @@ Class `cds.Request` extends [`cds.Event`] with additional features to represent ### . req {.property} -Provides access to the express request object of individual requests within an incoming batch request. +Provides access to the express request object of individual requests within an incoming batch request. For convenience, in the case of non-batch requests, it points to the same request object as [`req.http.req`](#http). ### . res {.property} -Provides access to the express response object of individual requests within an incoming batch request. +Provides access to the express response object of individual requests within an incoming batch request. For convenience, in the case of non-batch requests, it points to the same response object as [`req.http.res`](#http).