File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ ) .
6
6
7
+ ## Version 0.1.3 - tbd
8
+
9
+ ### Added
10
+
11
+ - Prerequisite for inboxing incoming messages in ` @sap/cds^9 `
12
+
7
13
## Version 0.1.2 - 2024-12-12
8
14
9
15
### Fixed
Original file line number Diff line number Diff line change 1
1
const cds = require ( '@sap/cds' )
2
+ const CDS_8 = cds . version . split ( '.' ) [ 0 ] < 9
3
+
2
4
const express = require ( 'express' )
3
5
const https = require ( 'https' )
4
6
const crypto = require ( 'crypto' )
@@ -25,11 +27,8 @@ const normalizeIncomingMessage = message => {
25
27
headers = { }
26
28
}
27
29
28
- return {
29
- data,
30
- headers,
31
- inbound : true
32
- }
30
+ if ( CDS_8 ) return { data, headers, inbound : true }
31
+ return { data, headers }
33
32
}
34
33
35
34
const usedWebhookEndpoints = new Set ( )
@@ -337,7 +336,8 @@ class EventBroker extends cds.MessagingService {
337
336
const context = { user : cds . User . privileged , _ : msg . _ }
338
337
if ( msg . tenant ) context . tenant = msg . tenant
339
338
340
- await this . tx ( context , tx => tx . emit ( msg ) )
339
+ if ( CDS_8 ) await this . tx ( context , tx => tx . emit ( msg ) )
340
+ else await this . processInboundMsg ( context , msg )
341
341
this . LOG . _debug && this . LOG . debug ( 'Event processed successfully.' )
342
342
return res . status ( 200 ) . json ( { message : 'OK' } )
343
343
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments