Skip to content

Commit

Permalink
CDS 8.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
oklemenz2 committed Sep 4, 2024
1 parent e8aa096 commit 65adc4b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 48 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Version 1.2.0 - 2024-09-02
## Version 1.2.0 - 2024-09-04

### Added

- Support SAP Push Channel Protocol (PCP)
- Option to include or exclude identifiers
- Option to include or exclude current user
- Better CDS context handling
- CDS 8.2 compatibility

## Version 1.1.1 - 2024-08-01

Expand Down
86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@cap-js-community/websocket": "./",
"@cap-js/sqlite": "^1.7.3",
"@eslint/js": "^9.9.1",
"@sap/cds": "^8.1.1",
"@sap/cds": "^8.2.0",
"@sap/cds-dk": "^8.1.2",
"@socket.io/redis-adapter": "^8.3.0",
"@socket.io/redis-streams-adapter": "^0.2.2",
Expand Down
7 changes: 4 additions & 3 deletions src/format/pcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PCPFormat extends BaseFormat {
if (splitPos !== -1) {
const result = {};
const pcpFields = extractPcpFields(data.substring(0, splitPos));
const operation = this.service.operations().find((operation) => {
const operation = Object.values(this.service.operations || {}).find((operation) => {
return (
operation["@websocket.pcp.action"] === (pcpFields["pcp-action"] || MESSAGE) ||
operation["@ws.pcp.action"] === (pcpFields["pcp-action"] || MESSAGE) ||
Expand Down Expand Up @@ -54,10 +54,11 @@ class PCPFormat extends BaseFormat {

compose(event, data) {
const eventDefinition = this.service.events()[event];
const messageElement = eventDefinition?.elements?.find((element) => {
const eventElements = Object.values(eventDefinition?.elements || {});
const messageElement = eventElements.find((element) => {
return element["@websocket.pcp.message"] || element["@ws.pcp.message"];
});
const actionElement = eventDefinition?.elements?.find((element) => {
const actionElement = eventElements.find((element) => {
return element["@websocket.pcp.action"] || element["@ws.pcp.action"];
});
const message =
Expand Down

0 comments on commit 65adc4b

Please sign in to comment.