From c89e4e202a67bd9c3aa07cb24d0dfb2cb67e41bc Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Wed, 19 Mar 2025 12:39:00 +0100 Subject: [PATCH] Add ORD plugin & add annotations --- db/schema.cds | 7 ++++++ package-lock.json | 62 ++++++++++++++++++++++++++++++++++++++++++----- package.json | 6 ++++- 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/db/schema.cds b/db/schema.cds index ee6ab76c..031a20ec 100644 --- a/db/schema.cds +++ b/db/schema.cds @@ -9,6 +9,10 @@ using { namespace sap.fe.cap.travel; +@EntityRelationship.entityType : 'sap.samples:Travel' +@ODM.entityName: 'Travel' +@ODM.root +@ObjectModel.compositionRoot entity Travel : managed { key TravelUUID : UUID; TravelID : Integer default 0 @readonly; @@ -30,6 +34,7 @@ annotate Travel with @Capabilities.FilterRestrictions.FilterExpressionRestrictio ]; +@EntityRelationship.entityType : 'sap.samples:Booking' entity Booking : managed { key BookingUUID : UUID; BookingID : Integer @Core.Computed; @@ -48,6 +53,8 @@ entity Booking : managed { and to_Flight.ConnectionID = ConnectionID; }; + +@EntityRelationship.entityType : 'sap.samples:BookingSupplement' entity BookingSupplement : managed { key BookSupplUUID : UUID; BookingSupplementID : Integer @Core.Computed; diff --git a/package-lock.json b/package-lock.json index 75825a07..b2ba53e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ ], "dependencies": { "@cap-js/hana": "^1", + "@cap-js/ord": "^1.2.0", "@sap/cds": ">=8.4.0", "@sap/xssec": "^4", "express": "^4" @@ -2158,6 +2159,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@cap-js/asyncapi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cap-js/asyncapi/-/asyncapi-1.0.3.tgz", + "integrity": "sha512-vZSWKAe+3qfvZDXV5SSFiObGWmqyS9MDyEADb5PLVT8kzO39qGaSDPv/GzI/gwvRfCayGAjU4ThiBKrFA7Gclg==", + "peer": true, + "peerDependencies": { + "@sap/cds": ">=7.6" + } + }, "node_modules/@cap-js/cds-test": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@cap-js/cds-test/-/cds-test-0.2.0.tgz", @@ -2238,6 +2248,32 @@ } } }, + "node_modules/@cap-js/openapi": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@cap-js/openapi/-/openapi-1.2.1.tgz", + "integrity": "sha512-Cs46zxxRaAsDTpKB7Et+eg9YTR1c5AaC+iR9mf3zla9cLhSF1SBgdntrbepZGjA1DQ+GSmOLjRt82lNkAlMJnQ==", + "peer": true, + "dependencies": { + "pluralize": "^8.0.0" + }, + "peerDependencies": { + "@sap/cds": ">=7.6" + } + }, + "node_modules/@cap-js/ord": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@cap-js/ord/-/ord-1.2.0.tgz", + "integrity": "sha512-JRAvnqBkACHOR8XgrpjPMwGf/VNuXxrj5fLVI/t+5f9Tbk1muX0w8rh/oYI+ru7EJDTmkv5ih0na9sySfnB23w==", + "dependencies": { + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@cap-js/asyncapi": "^1.0.0", + "@cap-js/openapi": "^1.0.2", + "@sap/cds": "^8.1.1", + "@sap/cds-compiler": "5.0.6" + } + }, "node_modules/@cap-js/sqlite": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.9.0.tgz", @@ -5313,10 +5349,10 @@ } }, "node_modules/@sap/cds-compiler": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.8.2.tgz", - "integrity": "sha512-doEOvu2ZTYjcC8v/UaYESYVjSAnLvuDlit4FurUiPfxiMxsQqwDOtldJGDTb26JpZdIi/GrTWv8qksk6PnpmMA==", - "license": "SEE LICENSE IN LICENSE", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.0.6.tgz", + "integrity": "sha512-OxLlK3hGWQdMBOYmLw18tpusfb+5G+44yFq28cGegNVlUu1jKtnSu/VIb9fIDYExxbIs9E9J4R2bGmQzaawFFQ==", + "peer": true, "dependencies": { "antlr4": "4.9.3" }, @@ -5354,6 +5390,22 @@ "node": ">=14" } }, + "node_modules/@sap/cds/node_modules/@sap/cds-compiler": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.8.2.tgz", + "integrity": "sha512-doEOvu2ZTYjcC8v/UaYESYVjSAnLvuDlit4FurUiPfxiMxsQqwDOtldJGDTb26JpZdIi/GrTWv8qksk6PnpmMA==", + "dependencies": { + "antlr4": "4.9.3" + }, + "bin": { + "cdsc": "bin/cdsc.js", + "cdshi": "bin/cdshi.js", + "cdsse": "bin/cdsse.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@sap/cf-tools": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@sap/cf-tools/-/cf-tools-3.2.2.tgz", @@ -19754,7 +19806,6 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, "license": "MIT" }, "node_modules/lodash.debounce": { @@ -21738,7 +21789,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, "license": "MIT", "engines": { "node": ">=4" diff --git a/package.json b/package.json index e7cbbd2f..fdde2de0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "@cap-js/hana": "^1", "@sap/cds": ">=8.4.0", "@sap/xssec": "^4", - "express": "^4" + "express": "^4", + "@cap-js/ord": "^1.2.0" }, "devDependencies": { "@cap-js/cds-test": "^0", @@ -41,6 +42,9 @@ "typescript-eslint": "^8.12.2" }, "cds": { + "ord": { + "namespace": "sap.sample" + }, "cdsc": { "newParser": true },