From 88ab48c1d41ccc576eb9f8069d387f38a106c579 Mon Sep 17 00:00:00 2001 From: Markus Ofterdinger Date: Thu, 27 Feb 2025 22:27:57 +0100 Subject: [PATCH 001/180] Showase type cds.Map (#439) - Enhanced Books and Authors with details map - Provide initial data for the details fields in csv files --- db/books.cds | 2 ++ db/data/my.bookshop-Authors.csv | 20 +++++------ db/data/my.bookshop-Books.csv | 12 +++---- .../handlers/CatalogServiceHandler.java | 33 +++++++++++++++---- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/db/books.cds b/db/books.cds index e7aa3928..51703f30 100644 --- a/db/books.cds +++ b/db/books.cds @@ -22,6 +22,7 @@ entity Books : cuid, managed { reviews : Association to many Reviews on reviews.book = $self; isReviewable : TechnicalBooleanFlag not null default true; + details : Map; } entity Authors : cuid, managed { @@ -33,6 +34,7 @@ entity Authors : cuid, managed { placeOfDeath : String; books : Association to many Books on books.author = $self; + details : Map; } // annotations for Data Privacy diff --git a/db/data/my.bookshop-Authors.csv b/db/data/my.bookshop-Authors.csv index 84d7eb44..137f405d 100644 --- a/db/data/my.bookshop-Authors.csv +++ b/db/data/my.bookshop-Authors.csv @@ -1,10 +1,10 @@ -ID;NAME;DATEOFBIRTH;PLACEOFBIRTH;DATEOFDEATH;PLACEOFDEATH -335c7bcd-b826-4f14-a788-e0bf6738617a;Emily Brontë;1818-07-30;Thornton, Yorkshire;1848-12-19;Haworth, Yorkshire -e3da2c2e-72ee-45d5-8def-52964c7b252a;Charlote Brontë;1818-04-21;Thornton, Yorkshire;1855-03-31;Haworth, Yorkshire -e7643aae-2d2f-4656-bb2d-1328ad3c8045;Edgar Allen Poe;1809-01-19;Boston, Massachusetts;1849-10-07;Baltimore, Maryland -3c081d9d-abda-4da9-8b6a-4f4555bb26bc;Richard Carpenter;1929-08-14;King’s Lynn, Norfolk;2012-02-26;Hertfordshire, England -b834ddb0-613a-4edf-8d47-7d80989e1325;Jane Austen;1775-12-16;Steventon, United Kingdom;1817-07-18;Winchester, United Kingdom -a57f75fa-2bda-47b5-ab4d-b644570f29cd;F. Scott Fitzgerald;1896-09-24;Saint Paul, Minnesota;1940-12-21;Los Angeles, California -b22f5293-7eea-49bb-9ee7-17c5de81f1df;Harper Lee;1926-04-28;Monroeville, Alabama;2016-02-19;Monroeville, Alabama -1d2ec887-cbf1-491e-943e-33a2b4f39a6f;Gabriel García Márquez;1927-03-06;Aracataca, Columbia;2014-04-17;Mexico City, Mexico -c0526b1a-9a75-4a43-9133-163325cbbd2b;Truman Capote;1924-09-30;New Orleans, Louisiana;1984-08-25;Los Angeles, California +ID;NAME;DATEOFBIRTH;PLACEOFBIRTH;DATEOFDEATH;PLACEOFDEATH;DETAILS +335c7bcd-b826-4f14-a788-e0bf6738617a;Emily Brontë;1818-07-30;Thornton, Yorkshire;1848-12-19;Haworth, Yorkshire;{"pseudonyms": ["Ellis Bell"]} +e3da2c2e-72ee-45d5-8def-52964c7b252a;Charlote Brontë;1818-04-21;Thornton, Yorkshire;1855-03-31;Haworth, Yorkshire;{"pseudonyms": ["Currer Bell"]} +e7643aae-2d2f-4656-bb2d-1328ad3c8045;Edgar Allen Poe;1809-01-19;Boston, Massachusetts;1849-10-07;Baltimore, Maryland;{"nickname": "The Tomahawk Man"} +3c081d9d-abda-4da9-8b6a-4f4555bb26bc;Richard Carpenter;1929-08-14;King’s Lynn, Norfolk;2012-02-26;Hertfordshire, England;{"nickname": "Kip"} +b834ddb0-613a-4edf-8d47-7d80989e1325;Jane Austen;1775-12-16;Steventon, United Kingdom;1817-07-18;Winchester, United Kingdom;{"pseudonyms": ["By a Lady"], "nickname": "Jenny"} +a57f75fa-2bda-47b5-ab4d-b644570f29cd;F. Scott Fitzgerald;1896-09-24;Saint Paul, Minnesota;1940-12-21;Los Angeles, California;{"nickname": "Scottie"} +b22f5293-7eea-49bb-9ee7-17c5de81f1df;Harper Lee;1926-04-28;Monroeville, Alabama;2016-02-19;Monroeville, Alabama;{"nickname": "Nelle"} +1d2ec887-cbf1-491e-943e-33a2b4f39a6f;Gabriel García Márquez;1927-03-06;Aracataca, Columbia;2014-04-17;Mexico City, Mexico;{"nickname": "Gabo"} +c0526b1a-9a75-4a43-9133-163325cbbd2b;Truman Capote;1924-09-30;New Orleans, Louisiana;1984-08-25;Los Angeles, California;{"nickname": "Bulldog", "pseudonyms": ["Buddy"]} diff --git a/db/data/my.bookshop-Books.csv b/db/data/my.bookshop-Books.csv index e5453379..4b23413b 100644 --- a/db/data/my.bookshop-Books.csv +++ b/db/data/my.bookshop-Books.csv @@ -1,6 +1,6 @@ -ID;TITLE;DESCR;AUTHOR_ID;STOCK;PRICE;CURRENCY_CODE;GENRE_ID;RATING;ISBN -f846b0b9-01d4-4f6d-82a4-d79204f62278;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";335c7bcd-b826-4f14-a788-e0bf6738617a;12;11.11;GBP;103;4.5;979-8698267973 -9b084139-0b1e-43b6-b12a-7b3669d75f02;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";e3da2c2e-72ee-45d5-8def-52964c7b252a;11;12.34;GBP;103;3.0;979-8598716472 -51061ce3-ddde-4d70-a2dc-6314afbcc73e;The Raven;"“The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;333;13.13;USD;117;2.5;978-1092909747 -aebdfc8a-0dfa-4468-bd36-48aabd65e663;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;555;14;USD;117;1.0;979-8669820985 -4a519e61-3c3a-4bd9-ab12-d7e0c5329933;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;3c081d9d-abda-4da9-8b6a-4f4555bb26bc;22;15;EUR;110;4.0;978-3473523023 +ID;TITLE;DESCR;AUTHOR_ID;STOCK;PRICE;CURRENCY_CODE;GENRE_ID;RATING;ISBN;DETAILS +f846b0b9-01d4-4f6d-82a4-d79204f62278;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";335c7bcd-b826-4f14-a788-e0bf6738617a;12;11.11;GBP;103;4.5;979-8698267973;{"pages": 446} +9b084139-0b1e-43b6-b12a-7b3669d75f02;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";e3da2c2e-72ee-45d5-8def-52964c7b252a;11;12.34;GBP;103;3.0;979-8598716472;{"pages": 290} +51061ce3-ddde-4d70-a2dc-6314afbcc73e;The Raven;"“The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;333;13.13;USD;117;2.5;978-1092909747;{"pages": 46} +aebdfc8a-0dfa-4468-bd36-48aabd65e663;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;555;14;USD;117;1.0;979-8669820985;{"pages": 29} +4a519e61-3c3a-4bd9-ab12-d7e0c5329933;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;3c081d9d-abda-4da9-8b6a-4f4555bb26bc;22;15;EUR;110;4.0;978-3473523023;{"pages": 224} diff --git a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java index b36b859e..c9a5b0e7 100644 --- a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java +++ b/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java @@ -13,11 +13,14 @@ import com.sap.cds.Result; import com.sap.cds.Struct; +import com.sap.cds.ql.CQL; import com.sap.cds.ql.Insert; import com.sap.cds.ql.Select; import com.sap.cds.ql.Update; import com.sap.cds.ql.cqn.CqnAnalyzer; import com.sap.cds.ql.cqn.CqnSelect; +import com.sap.cds.ql.cqn.CqnSelectListItem; +import com.sap.cds.ql.cqn.Modifier; import com.sap.cds.reflect.CdsModel; import com.sap.cds.services.ErrorStatuses; import com.sap.cds.services.ServiceException; @@ -74,6 +77,19 @@ class CatalogServiceHandler implements EventHandler { this.analyzer = CqnAnalyzer.create(model); } + @Before(entity = Books_.CDS_NAME) + public void beforeReadBooks(CdsReadEventContext context) { + CqnSelect copy = CQL.copy(context.getCqn(), new Modifier() { + @Override + public List items(List items) { + items.add(CQL.get("details")); + items.add(CQL.get("stock")); + return items; + } + }); + context.setCqn(copy); + } + /** * Invokes some validations before creating a review. * @@ -127,11 +143,20 @@ public void afterAddReview(BooksAddReviewContext context) { @After(event = CqnService.EVENT_READ) public void discountBooks(Stream books) { books.filter(b -> b.getTitle() != null).forEach(b -> { - loadStockIfNotSet(b); discountBooksWithMoreThan111Stock(b, featureToggles.isEnabled("discount")); }); } + @After(event = CqnService.EVENT_READ) + public void bigBooks(Stream books) { + books.filter(b -> b.getDetails() != null).forEach(b -> { + int pages = (int) b.getDetails().get("pages"); + if (pages > 400) { + b.setTitle("%s -- Big Book".formatted(b.getTitle())); + } + }); + } + @After public void setIsReviewable(CdsReadEventContext context, List books) { String user = context.getUserInfo().getName(); @@ -185,10 +210,4 @@ private void discountBooksWithMoreThan111Stock(Books b, boolean premium) { } } - private void loadStockIfNotSet(Books b) { - if (b.getId() != null && b.getStock() == null) { - b.setStock(db.run(Select.from(BOOKS).byId(b.getId()).columns(Books_::stock)).single(Books.class).getStock()); - } - } - } From beaebcad808a7763bb6383e64d8a972648df15fe Mon Sep 17 00:00:00 2001 From: Markus Ofterdinger Date: Fri, 28 Feb 2025 16:47:23 +0100 Subject: [PATCH 002/180] Bump cds-feature-attachments to 1.0.7 (#444) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 74b2b82a..1d04fed4 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 5.15.0 3.5.7 3.8.4 - 1.0.6 + 1.0.7 From 1cc55c4ca2db204966b9044f8ea4d9cf37580e4f Mon Sep 17 00:00:00 2001 From: Markus Ofterdinger Date: Fri, 28 Feb 2025 20:27:10 +0100 Subject: [PATCH 003/180] Leftovers from demonstrating cds.Map (#443) - Remove field details from Books entity - Avoid duplicate items in select list --- db/books.cds | 1 - db/data/my.bookshop-Books.csv | 12 ++++++------ .../bookshop/handlers/CatalogServiceHandler.java | 16 ++++------------ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/db/books.cds b/db/books.cds index 51703f30..82e63043 100644 --- a/db/books.cds +++ b/db/books.cds @@ -22,7 +22,6 @@ entity Books : cuid, managed { reviews : Association to many Reviews on reviews.book = $self; isReviewable : TechnicalBooleanFlag not null default true; - details : Map; } entity Authors : cuid, managed { diff --git a/db/data/my.bookshop-Books.csv b/db/data/my.bookshop-Books.csv index 4b23413b..e5453379 100644 --- a/db/data/my.bookshop-Books.csv +++ b/db/data/my.bookshop-Books.csv @@ -1,6 +1,6 @@ -ID;TITLE;DESCR;AUTHOR_ID;STOCK;PRICE;CURRENCY_CODE;GENRE_ID;RATING;ISBN;DETAILS -f846b0b9-01d4-4f6d-82a4-d79204f62278;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";335c7bcd-b826-4f14-a788-e0bf6738617a;12;11.11;GBP;103;4.5;979-8698267973;{"pages": 446} -9b084139-0b1e-43b6-b12a-7b3669d75f02;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";e3da2c2e-72ee-45d5-8def-52964c7b252a;11;12.34;GBP;103;3.0;979-8598716472;{"pages": 290} -51061ce3-ddde-4d70-a2dc-6314afbcc73e;The Raven;"“The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;333;13.13;USD;117;2.5;978-1092909747;{"pages": 46} -aebdfc8a-0dfa-4468-bd36-48aabd65e663;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;555;14;USD;117;1.0;979-8669820985;{"pages": 29} -4a519e61-3c3a-4bd9-ab12-d7e0c5329933;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;3c081d9d-abda-4da9-8b6a-4f4555bb26bc;22;15;EUR;110;4.0;978-3473523023;{"pages": 224} +ID;TITLE;DESCR;AUTHOR_ID;STOCK;PRICE;CURRENCY_CODE;GENRE_ID;RATING;ISBN +f846b0b9-01d4-4f6d-82a4-d79204f62278;Wuthering Heights;"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.";335c7bcd-b826-4f14-a788-e0bf6738617a;12;11.11;GBP;103;4.5;979-8698267973 +9b084139-0b1e-43b6-b12a-7b3669d75f02;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";e3da2c2e-72ee-45d5-8def-52964c7b252a;11;12.34;GBP;103;3.0;979-8598716472 +51061ce3-ddde-4d70-a2dc-6314afbcc73e;The Raven;"“The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;333;13.13;USD;117;2.5;978-1092909747 +aebdfc8a-0dfa-4468-bd36-48aabd65e663;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";e7643aae-2d2f-4656-bb2d-1328ad3c8045;555;14;USD;117;1.0;979-8669820985 +4a519e61-3c3a-4bd9-ab12-d7e0c5329933;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;3c081d9d-abda-4da9-8b6a-4f4555bb26bc;22;15;EUR;110;4.0;978-3473523023 diff --git a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java index c9a5b0e7..d477c3ff 100644 --- a/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java +++ b/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java @@ -82,8 +82,10 @@ public void beforeReadBooks(CdsReadEventContext context) { CqnSelect copy = CQL.copy(context.getCqn(), new Modifier() { @Override public List items(List items) { - items.add(CQL.get("details")); - items.add(CQL.get("stock")); + CqnSelectListItem stock = CQL.get("stock"); + if (!items.contains(stock)) { + items.add(stock); + } return items; } }); @@ -147,16 +149,6 @@ public void discountBooks(Stream books) { }); } - @After(event = CqnService.EVENT_READ) - public void bigBooks(Stream books) { - books.filter(b -> b.getDetails() != null).forEach(b -> { - int pages = (int) b.getDetails().get("pages"); - if (pages > 400) { - b.setTitle("%s -- Big Book".formatted(b.getTitle())); - } - }); - } - @After public void setIsReviewable(CdsReadEventContext context, List books) { String user = context.getUserInfo().getName(); From df31eb0a1d49d864b467036b360e7ace3d96eb47 Mon Sep 17 00:00:00 2001 From: Marc Becker Date: Thu, 6 Mar 2025 11:56:38 +0100 Subject: [PATCH 004/180] Update CDS Services to 3.8.0 and enable Draft Messages (#445) - Updates @sap/cds-dk to 8.8.0 and CDS Services to 3.8.0 - Enables Draft Messages - Enables OData containment --- .cdsrc.json | 8 +- app/addresses/webapp/manifest.json | 6 +- app/admin/webapp/manifest.json | 6 +- app/browse/webapp/manifest.json | 6 +- app/genres/webapp/manifest.json | 4 +- app/notes/webapp/manifest.json | 4 +- app/orders/webapp/manifest.json | 10 +- app/package-lock.json | 77 +++-- app/reviews/webapp/manifest.json | 6 +- db/package-lock.json | 10 +- mtx/sidecar/package-lock.json | 151 ++++++---- package-lock.json | 266 +++++++++++------- pom.xml | 8 +- srv/notes-mashup.cds | 2 +- .../main/java/my/bookshop/MessageKeys.java | 1 - .../handlers/AdminServiceHandler.java | 15 +- srv/src/main/resources/messages.properties | 3 +- srv/src/main/resources/messages_de.properties | 3 +- 18 files changed, 352 insertions(+), 234 deletions(-) diff --git a/.cdsrc.json b/.cdsrc.json index 751f9d85..8b1c3585 100644 --- a/.cdsrc.json +++ b/.cdsrc.json @@ -5,8 +5,14 @@ "toggles": true }, "profile": "with-mtx-sidecar", + "odata": { + "containment": true + }, "cdsc": { - "newParser": true + "newParser": true, + "beta": { + "draftMessages": true + } }, "sql": { "native_hana_associations": false diff --git a/app/addresses/webapp/manifest.json b/app/addresses/webapp/manifest.json index 5266df52..8a535985 100644 --- a/app/addresses/webapp/manifest.json +++ b/app/addresses/webapp/manifest.json @@ -86,7 +86,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Addresses", + "contextPath" : "/Addresses", "navigation" : { "Addresses" : { "detail" : { @@ -103,7 +103,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Addresses", + "contextPath" : "/Addresses", "navigation" : { "notes" : { "detail" : { @@ -120,7 +120,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "Notes" + "contextPath": "/Addresses/notes" } } } diff --git a/app/admin/webapp/manifest.json b/app/admin/webapp/manifest.json index 4225597f..29ac7e46 100644 --- a/app/admin/webapp/manifest.json +++ b/app/admin/webapp/manifest.json @@ -86,7 +86,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Books", + "contextPath" : "/Books", "navigation" : { "Books" : { "detail" : { @@ -113,7 +113,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Books", + "contextPath" : "/Books", "navigation" : { "Authors" : { "detail" : { @@ -130,7 +130,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Authors" + "contextPath" : "/Authors" } } } diff --git a/app/browse/webapp/manifest.json b/app/browse/webapp/manifest.json index ec7a8840..1b9f2d3f 100644 --- a/app/browse/webapp/manifest.json +++ b/app/browse/webapp/manifest.json @@ -86,7 +86,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Books", + "contextPath" : "/Books", "navigation" : { "Books" : { "detail" : { @@ -103,7 +103,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Books", + "contextPath" : "/Books", "navigation" : { "Authors" : { "detail" : { @@ -120,7 +120,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Authors" + "contextPath" : "/Authors" } } } diff --git a/app/genres/webapp/manifest.json b/app/genres/webapp/manifest.json index ab4a7d46..68d48208 100644 --- a/app/genres/webapp/manifest.json +++ b/app/genres/webapp/manifest.json @@ -82,7 +82,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "GenreHierarchy", + "contextPath" : "/GenreHierarchy", "navigation" : { "GenreHierarchy" : { "detail" : { @@ -107,7 +107,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "GenreHierarchy" + "contextPath": "/GenreHierarchy" } } } diff --git a/app/notes/webapp/manifest.json b/app/notes/webapp/manifest.json index f75a99b2..1a87691c 100644 --- a/app/notes/webapp/manifest.json +++ b/app/notes/webapp/manifest.json @@ -81,7 +81,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Notes", + "contextPath" : "/Notes", "navigation" : { "Notes" : { "detail" : { @@ -98,7 +98,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Notes" + "contextPath" : "/Notes" } } } diff --git a/app/orders/webapp/manifest.json b/app/orders/webapp/manifest.json index 758e31f2..02cf3bcf 100644 --- a/app/orders/webapp/manifest.json +++ b/app/orders/webapp/manifest.json @@ -91,7 +91,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Orders", + "contextPath" : "/Orders", "navigation" : { "Orders" : { "detail" : { @@ -108,7 +108,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "Orders", + "contextPath": "/Orders", "navigation" : { "Items": { "detail": { @@ -135,7 +135,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "OrderItems" + "contextPath": "/Orders/Items" } } }, @@ -145,7 +145,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "Books", + "contextPath": "/Books", "navigation": { "author": { "detail": { @@ -162,7 +162,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet": "Authors" + "contextPath": "/Authors" } } } diff --git a/app/package-lock.json b/app/package-lock.json index 2fe4a66c..f8cf3891 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -497,9 +497,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -510,13 +510,13 @@ } }, "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -879,6 +879,21 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -1072,13 +1087,14 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -1104,17 +1120,17 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -1170,6 +1186,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -1598,9 +1629,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -1899,9 +1930,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/app/reviews/webapp/manifest.json b/app/reviews/webapp/manifest.json index 78dd8f8c..ccf35060 100644 --- a/app/reviews/webapp/manifest.json +++ b/app/reviews/webapp/manifest.json @@ -86,7 +86,7 @@ "name": "sap.fe.templates.ListReport", "options": { "settings" : { - "entitySet" : "Reviews", + "contextPath" : "/Reviews", "navigation" : { "Reviews" : { "detail" : { @@ -103,7 +103,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Reviews", + "contextPath" : "/Reviews", "navigation" : { "Books" : { "detail" : { @@ -120,7 +120,7 @@ "name": "sap.fe.templates.ObjectPage", "options": { "settings" : { - "entitySet" : "Books" + "contextPath" : "/Books" } } } diff --git a/db/package-lock.json b/db/package-lock.json index ad277cf7..cc04938d 100644 --- a/db/package-lock.json +++ b/db/package-lock.json @@ -38,12 +38,12 @@ } }, "node_modules/@sap/hdi-deploy": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.3.2.tgz", - "integrity": "sha512-1QvlrMdeVXCIc2DSLjR5ZIKFz9GVcuC8JvXtifU7bYetajc6mgU5FRR9zseZgrHVdCveeRIURmoPplUl4Hszag==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.4.1.tgz", + "integrity": "sha512-tTdbxFJadgf0cLjTe+O/CgNUOY6ZYUu/eFyALuR2w6V9JRUKSPaZcFM2uMiWbCM5OYJGUGfNRJYRYC6sVIDQRg==", "license": "See LICENSE file", "dependencies": { - "@sap/hdi": "^4.6.0", + "@sap/hdi": "^4.7.0", "@sap/xsenv": "^5.2.0", "async": "^3.2.6", "dotenv": "^16.4.5", @@ -51,7 +51,7 @@ "micromatch": "^4.0.8" }, "engines": { - "node": "^18.0.0 || ^20.0.0" + "node": ">=18.x" }, "peerDependencies": { "@sap/hana-client": "^2 >= 2.6", diff --git a/mtx/sidecar/package-lock.json b/mtx/sidecar/package-lock.json index 23cce481..0e8e11c2 100644 --- a/mtx/sidecar/package-lock.json +++ b/mtx/sidecar/package-lock.json @@ -19,9 +19,9 @@ } }, "node_modules/@cap-js/db-service": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.17.0.tgz", - "integrity": "sha512-n2hna2hh2eg588KmXUvDj2n/1UnlaUcIKSRuQCVDoYnGex8fFP58nqZCJzJnLsr0UYqm5+yO2AK5hwHlvJ2hzA==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.18.0.tgz", + "integrity": "sha512-Gv0X+GZx85Op8GZ+xbkt49Nrrha68jPfV5+Uo023Xqsbv7HhoFPkI1t1IVI+isZRz04dx4MW573b0KKGEFDAFg==", "license": "SEE LICENSE", "dependencies": { "generic-pool": "^3.9.0" @@ -31,12 +31,12 @@ } }, "node_modules/@cap-js/hana": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.6.0.tgz", - "integrity": "sha512-z9TrqwX72yT1WeTsSIaaXD2CTJgVTlklPbvMzKoCaCpnAknKcBSuNyakrmlSRIs8E0ci/YJ2b0mBajQmkOSURg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.7.0.tgz", + "integrity": "sha512-QaFQAKT6beFIC61I+3BSq4aSmVydzTziEUy/eb+hWZqfUaqZjujgnI9OPrnLaDeE4dZkOGYj/GAGy39t5vaagA==", "license": "SEE LICENSE", "dependencies": { - "@cap-js/db-service": "^1.17.0", + "@cap-js/db-service": "^1.18.0", "hdb": "^0.19.5" }, "peerDependencies": { @@ -50,13 +50,13 @@ } }, "node_modules/@cap-js/sqlite": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.8.0.tgz", - "integrity": "sha512-Qd/IrSksT+NWUopwtKnKMSs4pPnzfXJiILycK5CkZH3dKju9xpUvHBYxJF5uXBnN6UOhFURXXyvJ0BArk40nvQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.9.0.tgz", + "integrity": "sha512-0Ka6a7W7v5qyL8IiEjKg1oJH1AvLh/bmshHYxovmruKfyDEuEx+Kz8IARKq8oHwmzPCZVV/xXIKnpg/KWesXcA==", "dev": true, "license": "SEE LICENSE", "dependencies": { - "@cap-js/db-service": "^1.17.0", + "@cap-js/db-service": "^1.18.0", "better-sqlite3": "^11.0.0" }, "peerDependencies": { @@ -64,9 +64,9 @@ } }, "node_modules/@sap/cds": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.7.0.tgz", - "integrity": "sha512-QL5xQIkID3sICYNIlpCfXjvDGKfO6WpuGWVD9x3T6zFzdz409dSOzq2wp7HSWWKsy0HZEPRgsRatYjFx3LMNTA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.8.0.tgz", + "integrity": "sha512-7IYV44HUR3BygEXv+yEa430yfJErT/5Iez0LMvCS1A9lkpYjFhC79p28tnwZjP9ezwiWKOav/qKcF/+gliaCiA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@sap/cds-compiler": ">=5.1", @@ -96,9 +96,9 @@ } }, "node_modules/@sap/cds-compiler": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.7.0.tgz", - "integrity": "sha512-nmKEfYICdFlGaQ7DQz8Jb2KrYDajCYTB8yllcQGwq7nyYE01MM0/1c7N7BRbSOnX5HStZ/MUG9+NQweb9dEOEA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.8.0.tgz", + "integrity": "sha512-cBf9N5g35A69S3n8HWmFDE6MUfogUn26wntF3CC1iQLEocth9Lo/ralerY9KHEd5OQ1nDC3FwDs+AMAA2BT+uA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "antlr4": "4.9.3" @@ -113,9 +113,9 @@ } }, "node_modules/@sap/cds-fiori": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.3.0.tgz", - "integrity": "sha512-PEppgJyc3SO0df5zP2OZG41UKLdsowQLwcsLUSFPzn56MlbFdzaRhO1qXaMhPlQ+bIo19aLOZcAZa9ewkSwS0w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.4.0.tgz", + "integrity": "sha512-Ge0Lwr2W1jUGepA4uABVB2szA/PBpmZDQt2CZdU1Ihc8LlgcdCoiulEYkiJvX3mTcQJEWCTEEsCNpQUqniEtTw==", "license": "SEE LICENSE IN LICENSE", "peerDependencies": { "@sap/cds": ">=7.6", @@ -138,9 +138,9 @@ } }, "node_modules/@sap/cds-mtxs": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@sap/cds-mtxs/-/cds-mtxs-2.5.0.tgz", - "integrity": "sha512-d3R0cBaBdqLWRniZ/vwi/3TtKBCpCFJx5m/4Tg24erufs9e76aeLw7VnNJL24paNWdtiqMXuKFsTuPr4oEu2Vg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@sap/cds-mtxs/-/cds-mtxs-2.6.0.tgz", + "integrity": "sha512-RCTnwXsbY+a3uHN5Kd3u43xz+a+948yXkJjmsdgjz9MtGIZELrZpkjqd1ps67eniTgkrKkBDymRMn8eBIIjyyQ==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@sap/hdi-deploy": ">=4", @@ -176,12 +176,12 @@ } }, "node_modules/@sap/hdi-deploy": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.3.2.tgz", - "integrity": "sha512-1QvlrMdeVXCIc2DSLjR5ZIKFz9GVcuC8JvXtifU7bYetajc6mgU5FRR9zseZgrHVdCveeRIURmoPplUl4Hszag==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.4.1.tgz", + "integrity": "sha512-tTdbxFJadgf0cLjTe+O/CgNUOY6ZYUu/eFyALuR2w6V9JRUKSPaZcFM2uMiWbCM5OYJGUGfNRJYRYC6sVIDQRg==", "license": "See LICENSE file", "dependencies": { - "@sap/hdi": "^4.6.0", + "@sap/hdi": "^4.7.0", "@sap/xsenv": "^5.2.0", "async": "^3.2.6", "dotenv": "^16.4.5", @@ -189,7 +189,7 @@ "micromatch": "^4.0.8" }, "engines": { - "node": "^18.0.0 || ^20.0.0" + "node": ">=18.x" }, "peerDependencies": { "@sap/hana-client": "^2 >= 2.6", @@ -219,9 +219,9 @@ } }, "node_modules/@sap/xssec": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.2.8.tgz", - "integrity": "sha512-hTwupdCFdp3ElAF/e4qj6Akgf3N6/C7bq3qggbTeHEdaPVEehYPyxuTsdxb1TVI1vUGlHjB7RUW6aa6n30fP6Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.4.0.tgz", + "integrity": "sha512-tVPyF6z6lWN2cucT38kkTu6GTmFXhqd/xa0SrExZ+j8K1cNePEIDHvx/zfibubLeb198vyoreW4QOpR9+Vaj4A==", "license": "SAP DEVELOPER LICENSE AGREEMENT", "dependencies": { "debug": "^4.3.4", @@ -281,9 +281,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", + "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -445,9 +445,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -458,13 +458,13 @@ } }, "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -705,6 +705,21 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -873,13 +888,14 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -930,17 +946,17 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -1018,6 +1034,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -1271,9 +1302,9 @@ "license": "MIT" }, "node_modules/node-abi": { - "version": "3.73.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.73.0.tgz", - "integrity": "sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg==", + "version": "3.74.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", + "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", "dev": true, "license": "MIT", "dependencies": { @@ -1296,9 +1327,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -1510,9 +1541,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, "license": "ISC", "bin": { diff --git a/package-lock.json b/package-lock.json index 33197a22..40069c17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,9 +30,9 @@ } }, "node_modules/@cap-js/db-service": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.17.0.tgz", - "integrity": "sha512-n2hna2hh2eg588KmXUvDj2n/1UnlaUcIKSRuQCVDoYnGex8fFP58nqZCJzJnLsr0UYqm5+yO2AK5hwHlvJ2hzA==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.18.0.tgz", + "integrity": "sha512-Gv0X+GZx85Op8GZ+xbkt49Nrrha68jPfV5+Uo023Xqsbv7HhoFPkI1t1IVI+isZRz04dx4MW573b0KKGEFDAFg==", "license": "SEE LICENSE", "dependencies": { "generic-pool": "^3.9.0" @@ -42,12 +42,12 @@ } }, "node_modules/@cap-js/hana": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.6.0.tgz", - "integrity": "sha512-z9TrqwX72yT1WeTsSIaaXD2CTJgVTlklPbvMzKoCaCpnAknKcBSuNyakrmlSRIs8E0ci/YJ2b0mBajQmkOSURg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.7.0.tgz", + "integrity": "sha512-QaFQAKT6beFIC61I+3BSq4aSmVydzTziEUy/eb+hWZqfUaqZjujgnI9OPrnLaDeE4dZkOGYj/GAGy39t5vaagA==", "license": "SEE LICENSE", "dependencies": { - "@cap-js/db-service": "^1.17.0", + "@cap-js/db-service": "^1.18.0", "hdb": "^0.19.5" }, "peerDependencies": { @@ -61,13 +61,13 @@ } }, "node_modules/@cap-js/sqlite": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.8.0.tgz", - "integrity": "sha512-Qd/IrSksT+NWUopwtKnKMSs4pPnzfXJiILycK5CkZH3dKju9xpUvHBYxJF5uXBnN6UOhFURXXyvJ0BArk40nvQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.9.0.tgz", + "integrity": "sha512-0Ka6a7W7v5qyL8IiEjKg1oJH1AvLh/bmshHYxovmruKfyDEuEx+Kz8IARKq8oHwmzPCZVV/xXIKnpg/KWesXcA==", "dev": true, "license": "SEE LICENSE", "dependencies": { - "@cap-js/db-service": "^1.17.0", + "@cap-js/db-service": "^1.18.0", "better-sqlite3": "^11.0.0" }, "peerDependencies": { @@ -75,9 +75,9 @@ } }, "node_modules/@sap/cds": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.7.0.tgz", - "integrity": "sha512-QL5xQIkID3sICYNIlpCfXjvDGKfO6WpuGWVD9x3T6zFzdz409dSOzq2wp7HSWWKsy0HZEPRgsRatYjFx3LMNTA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.8.0.tgz", + "integrity": "sha512-7IYV44HUR3BygEXv+yEa430yfJErT/5Iez0LMvCS1A9lkpYjFhC79p28tnwZjP9ezwiWKOav/qKcF/+gliaCiA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@sap/cds-compiler": ">=5.1", @@ -107,9 +107,9 @@ } }, "node_modules/@sap/cds-compiler": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.7.0.tgz", - "integrity": "sha512-nmKEfYICdFlGaQ7DQz8Jb2KrYDajCYTB8yllcQGwq7nyYE01MM0/1c7N7BRbSOnX5HStZ/MUG9+NQweb9dEOEA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.8.0.tgz", + "integrity": "sha512-cBf9N5g35A69S3n8HWmFDE6MUfogUn26wntF3CC1iQLEocth9Lo/ralerY9KHEd5OQ1nDC3FwDs+AMAA2BT+uA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "antlr4": "4.9.3" @@ -124,9 +124,9 @@ } }, "node_modules/@sap/cds-dk": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@sap/cds-dk/-/cds-dk-8.7.0.tgz", - "integrity": "sha512-RVJsyEX/9IgvbcAKO0d29jzKHzD8NA08fIkbopcAyPMyarc3UG4wAVSFlcsBx+F1WiLd+LVZgs0MdjPtG305lA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@sap/cds-dk/-/cds-dk-8.8.0.tgz", + "integrity": "sha512-61KqUNAbNaaXz7LHfhTBhIryaUDIj1iW9f/XHCbtc+AV8G2O5JcvBUEwf2ROYtvbXlKlZsIe4QewyUP6S78/8w==", "dev": true, "hasShrinkwrap": true, "license": "SEE LICENSE IN LICENSE", @@ -166,7 +166,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/db-service": { - "version": "1.17.0", + "version": "1.17.2", "dev": true, "license": "SEE LICENSE", "optional": true, @@ -178,7 +178,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/openapi": { - "version": "1.1.2", + "version": "1.2.0", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -238,11 +238,11 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/config-array": { - "version": "0.19.1", + "version": "0.19.2", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.5", + "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -251,7 +251,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/core": { - "version": "0.10.0", + "version": "0.12.0", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -262,7 +262,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/eslintrc": { - "version": "3.2.0", + "version": "3.3.0", "dev": true, "license": "MIT", "dependencies": { @@ -284,7 +284,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/js": { - "version": "9.19.0", + "version": "9.21.0", "dev": true, "license": "MIT", "engines": { @@ -292,7 +292,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/object-schema": { - "version": "2.1.5", + "version": "2.1.6", "dev": true, "license": "Apache-2.0", "engines": { @@ -300,11 +300,11 @@ } }, "node_modules/@sap/cds-dk/node_modules/@eslint/plugin-kit": { - "version": "0.2.5", + "version": "0.2.7", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.10.0", + "@eslint/core": "^0.12.0", "levn": "^0.4.1" }, "engines": { @@ -356,7 +356,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@humanwhocodes/retry": { - "version": "0.4.1", + "version": "0.4.2", "dev": true, "license": "Apache-2.0", "engines": { @@ -368,7 +368,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds": { - "version": "8.7.0", + "version": "8.8.0", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -399,7 +399,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds-compiler": { - "version": "5.7.0", + "version": "5.8.0", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -415,7 +415,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds-fiori": { - "version": "1.3.0", + "version": "1.4.0", "dev": true, "license": "SEE LICENSE IN LICENSE", "peerDependencies": { @@ -438,7 +438,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds-mtxs": { - "version": "2.5.0", + "version": "2.6.0", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -451,12 +451,12 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/eslint-plugin-cds": { - "version": "3.1.2", + "version": "3.2.0", "dev": true, "license": "See LICENSE file", "dependencies": { "@sap/cds": ">=7", - "semver": "^7.3.4" + "semver": "^7.7.1" }, "engines": { "node": ">=18" @@ -489,11 +489,11 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/hdi-deploy": { - "version": "5.3.2", + "version": "5.4.1", "dev": true, "license": "See LICENSE file", "dependencies": { - "@sap/hdi": "^4.6.0", + "@sap/hdi": "^4.7.0", "@sap/xsenv": "^5.2.0", "async": "^3.2.6", "dotenv": "^16.4.5", @@ -501,7 +501,7 @@ "micromatch": "^4.0.8" }, "engines": { - "node": "^18.0.0 || ^20.0.0" + "node": ">=18.x" }, "peerDependencies": { "@sap/hana-client": "^2 >= 2.6", @@ -636,7 +636,7 @@ "license": "MIT" }, "node_modules/@sap/cds-dk/node_modules/axios": { - "version": "1.7.9", + "version": "1.8.1", "dev": true, "license": "MIT", "dependencies": { @@ -802,7 +802,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/call-bind-apply-helpers": { - "version": "1.0.1", + "version": "1.0.2", "dev": true, "license": "MIT", "dependencies": { @@ -1099,6 +1099,20 @@ "node": ">= 0.4" } }, + "node_modules/@sap/cds-dk/node_modules/es-set-tostringtag": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/@sap/cds-dk/node_modules/escape-html": { "version": "1.0.3", "dev": true, @@ -1116,20 +1130,20 @@ } }, "node_modules/@sap/cds-dk/node_modules/eslint": { - "version": "9.19.0", + "version": "9.21.0", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.10.0", - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.19.0", - "@eslint/plugin-kit": "^0.2.5", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.1", + "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", @@ -1437,7 +1451,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/flatted": { - "version": "3.3.2", + "version": "3.3.3", "dev": true, "license": "ISC" }, @@ -1461,12 +1475,13 @@ } }, "node_modules/@sap/cds-dk/node_modules/form-data": { - "version": "4.0.1", + "version": "4.0.2", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -1512,16 +1527,16 @@ } }, "node_modules/@sap/cds-dk/node_modules/get-intrinsic": { - "version": "1.2.7", + "version": "1.3.0", "dev": true, "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -1624,6 +1639,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/@sap/cds-dk/node_modules/has-tostringtag": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@sap/cds-dk/node_modules/hasown": { "version": "2.0.2", "dev": true, @@ -1701,7 +1730,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/import-fresh": { - "version": "3.3.0", + "version": "3.3.1", "dev": true, "license": "MIT", "dependencies": { @@ -1993,7 +2022,7 @@ "license": "MIT" }, "node_modules/@sap/cds-dk/node_modules/node-abi": { - "version": "3.73.0", + "version": "3.74.0", "dev": true, "license": "MIT", "optional": true, @@ -2024,7 +2053,7 @@ } }, "node_modules/@sap/cds-dk/node_modules/object-inspect": { - "version": "1.13.3", + "version": "1.13.4", "dev": true, "license": "MIT", "engines": { @@ -2338,7 +2367,7 @@ "license": "ISC" }, "node_modules/@sap/cds-dk/node_modules/semver": { - "version": "7.6.3", + "version": "7.7.1", "dev": true, "license": "ISC", "bin": { @@ -2769,7 +2798,7 @@ "optional": true }, "node_modules/@sap/cds-dk/node_modules/ws": { - "version": "8.18.0", + "version": "8.18.1", "dev": true, "license": "MIT", "engines": { @@ -2830,9 +2859,9 @@ } }, "node_modules/@sap/cds-fiori": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.3.0.tgz", - "integrity": "sha512-PEppgJyc3SO0df5zP2OZG41UKLdsowQLwcsLUSFPzn56MlbFdzaRhO1qXaMhPlQ+bIo19aLOZcAZa9ewkSwS0w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.4.0.tgz", + "integrity": "sha512-Ge0Lwr2W1jUGepA4uABVB2szA/PBpmZDQt2CZdU1Ihc8LlgcdCoiulEYkiJvX3mTcQJEWCTEEsCNpQUqniEtTw==", "license": "SEE LICENSE IN LICENSE", "peerDependencies": { "@sap/cds": ">=7.6", @@ -2855,9 +2884,9 @@ } }, "node_modules/@sap/cds-mtxs": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@sap/cds-mtxs/-/cds-mtxs-2.5.0.tgz", - "integrity": "sha512-d3R0cBaBdqLWRniZ/vwi/3TtKBCpCFJx5m/4Tg24erufs9e76aeLw7VnNJL24paNWdtiqMXuKFsTuPr4oEu2Vg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@sap/cds-mtxs/-/cds-mtxs-2.6.0.tgz", + "integrity": "sha512-RCTnwXsbY+a3uHN5Kd3u43xz+a+948yXkJjmsdgjz9MtGIZELrZpkjqd1ps67eniTgkrKkBDymRMn8eBIIjyyQ==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@sap/hdi-deploy": ">=4", @@ -2893,12 +2922,12 @@ } }, "node_modules/@sap/hdi-deploy": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.3.2.tgz", - "integrity": "sha512-1QvlrMdeVXCIc2DSLjR5ZIKFz9GVcuC8JvXtifU7bYetajc6mgU5FRR9zseZgrHVdCveeRIURmoPplUl4Hszag==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@sap/hdi-deploy/-/hdi-deploy-5.4.1.tgz", + "integrity": "sha512-tTdbxFJadgf0cLjTe+O/CgNUOY6ZYUu/eFyALuR2w6V9JRUKSPaZcFM2uMiWbCM5OYJGUGfNRJYRYC6sVIDQRg==", "license": "See LICENSE file", "dependencies": { - "@sap/hdi": "^4.6.0", + "@sap/hdi": "^4.7.0", "@sap/xsenv": "^5.2.0", "async": "^3.2.6", "dotenv": "^16.4.5", @@ -2906,7 +2935,7 @@ "micromatch": "^4.0.8" }, "engines": { - "node": "^18.0.0 || ^20.0.0" + "node": ">=18.x" }, "peerDependencies": { "@sap/hana-client": "^2 >= 2.6", @@ -2936,9 +2965,9 @@ } }, "node_modules/@sap/xssec": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.2.8.tgz", - "integrity": "sha512-hTwupdCFdp3ElAF/e4qj6Akgf3N6/C7bq3qggbTeHEdaPVEehYPyxuTsdxb1TVI1vUGlHjB7RUW6aa6n30fP6Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.4.0.tgz", + "integrity": "sha512-tVPyF6z6lWN2cucT38kkTu6GTmFXhqd/xa0SrExZ+j8K1cNePEIDHvx/zfibubLeb198vyoreW4QOpR9+Vaj4A==", "license": "SAP DEVELOPER LICENSE AGREEMENT", "dependencies": { "debug": "^4.3.4", @@ -2998,9 +3027,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", + "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -3162,9 +3191,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -3175,13 +3204,13 @@ } }, "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -3422,6 +3451,21 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -3590,13 +3634,14 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -3647,17 +3692,17 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -3735,6 +3780,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -3988,9 +4048,9 @@ "license": "MIT" }, "node_modules/node-abi": { - "version": "3.73.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.73.0.tgz", - "integrity": "sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg==", + "version": "3.74.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", + "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", "dev": true, "license": "MIT", "dependencies": { @@ -4013,9 +4073,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -4227,9 +4287,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, "license": "ISC", "bin": { diff --git a/pom.xml b/pom.xml index 1d04fed4..d0cc5755 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.0 + 3.4.3 @@ -23,9 +23,9 @@ 21 - 3.7.1 - 5.15.0 - 3.5.7 + 3.8.0 + 5.17.0 + 3.5.8 3.8.4 1.0.7 diff --git a/srv/notes-mashup.cds b/srv/notes-mashup.cds index 6dbea08b..e766f0ee 100644 --- a/srv/notes-mashup.cds +++ b/srv/notes-mashup.cds @@ -14,7 +14,7 @@ entity my.bookshop.NoteableAddresses as select from API_BUSINESS_PARTNER.A_Busin @readonly PostalCode as postalCode, @readonly StreetName as street, @readonly HouseNumber as houseNumber, - notes + notes @(odata.contained: false) }; /* diff --git a/srv/src/main/java/my/bookshop/MessageKeys.java b/srv/src/main/java/my/bookshop/MessageKeys.java index 9f217eb9..70e7de3d 100644 --- a/srv/src/main/java/my/bookshop/MessageKeys.java +++ b/srv/src/main/java/my/bookshop/MessageKeys.java @@ -2,7 +2,6 @@ public class MessageKeys { - public static final String QUANTITY_REQUIRE_MINIMUM = "quantity.require.minimum"; public static final String BOOK_REQUIRE_STOCK = "book.require.stock"; public static final String BOOK_ADDED_ORDER = "book.added.order"; public static final String BOOK_MISSING = "book.missing"; diff --git a/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java b/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java index 06ec29c6..ddf2b7fa 100644 --- a/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java +++ b/srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java @@ -111,7 +111,7 @@ public void beforeCreateOrder(Stream orders, EventContext context) { if (book.getStock() < diffQuantity) { // Tip: you can have localized messages and use parameters in your messages messages.error(MessageKeys.BOOK_REQUIRE_STOCK, book.getStock()) - .target("in", ORDERS, o -> o.Items(i -> i.ID().eq(orderItem.getId()).and(i.IsActiveEntity().eq(orderItem.getIsActiveEntity()))).quantity()); + .target(ORDERS, o -> o.Items(i -> i.ID().eq(orderItem.getId()).and(i.IsActiveEntity().eq(orderItem.getIsActiveEntity()))).quantity()); return; // no need to update follow-up values with invalid quantity / stock } @@ -143,7 +143,7 @@ public void patchOrderItems(DraftPatchEventContext context, OrderItems orderItem Integer quantity = orderItem.getQuantity(); String bookId = orderItem.getBookId(); String orderItemId = orderItem.getId(); - BigDecimal amount = calculateAmountInDraft(orderItemId, quantity, bookId, true); + BigDecimal amount = calculateAmountInDraft(orderItemId, quantity, bookId); if (amount != null) { orderItem.setAmount(amount); } @@ -158,11 +158,11 @@ public void patchOrderItems(DraftPatchEventContext context, OrderItems orderItem public void cancelOrderItems(DraftCancelEventContext context) { String orderItemId = (String) analyzer.analyze(context.getCqn()).targetKeys().get(OrderItems.ID); if(orderItemId != null) { - calculateAmountInDraft(orderItemId, 0, null, false); + calculateAmountInDraft(orderItemId, 0, null); } } - private BigDecimal calculateAmountInDraft(String orderItemId, Integer newQuantity, String newBookId, boolean includeWarnings) { + private BigDecimal calculateAmountInDraft(String orderItemId, Integer newQuantity, String newBookId) { Integer quantity = newQuantity; String bookId = newBookId; if (quantity == null && bookId == null) { @@ -192,13 +192,6 @@ private BigDecimal calculateAmountInDraft(String orderItemId, Integer newQuantit return null; // not enough data available } - // only warn about invalid values as we are in draft mode - if(includeWarnings && quantity <= 0) { - // Tip: add additional messages with localized messages from property files - // these messages are transported in sap-messages and do not abort the request - messages.warn(MessageKeys.QUANTITY_REQUIRE_MINIMUM).target(ORDER_ITEMS, i -> i.quantity()); - } - // get the price of the updated book ID if(bookPrice == null) { result = db.run(Select.from(BOOKS).byId(bookId).columns(b -> b.price())); diff --git a/srv/src/main/resources/messages.properties b/srv/src/main/resources/messages.properties index b0e769b8..a65fa2b0 100644 --- a/srv/src/main/resources/messages.properties +++ b/srv/src/main/resources/messages.properties @@ -1,4 +1,3 @@ -quantity.require.minimum = The specified quantity is smaller than 1 book.require.stock = Not enough books on stock (only {0} left) book.added.order = Book successfully added to order book.missing = Book does not exist @@ -10,4 +9,4 @@ review.added = Review added order.exceeds.stock = {0} exceeds stock for book review.add.forbidden=User not allowed to add more than one review for a given book book.import.failed = Import of books failed -book.import.invalid.csv = Invalid CSV structure found - Please check its content \ No newline at end of file +book.import.invalid.csv = Invalid CSV structure found - Please check its content diff --git a/srv/src/main/resources/messages_de.properties b/srv/src/main/resources/messages_de.properties index f498bbe0..d6534814 100644 --- a/srv/src/main/resources/messages_de.properties +++ b/srv/src/main/resources/messages_de.properties @@ -1,4 +1,3 @@ -quantity.require.minimum = Die eingetragene Anzahl ist kleiner als 1 book.require.stock = Nicht genügend Bücher auf Vorrat (nur {0} übrig) book.added.order = Das Buch wurde der Bestellung erfolgreich hinzugefügt book.missing = Das Buch existiert nicht @@ -10,4 +9,4 @@ review.added = Bewertung hinzugefügt order.exceeds.stock = {0} ist mehr als für das Buch auf Vorrat übrig ist review.add.forbidden = Es ist nicht mehr als eine Bewertung pro Buch erlaubt book.import.failed = Bücher Import fehlgeschlagen -book.import.invalid.csv = Die CSV Datei enthält eine ungültige Struktur - Bitte überprüfen Sie den Inhalt \ No newline at end of file +book.import.invalid.csv = Die CSV Datei enthält eine ungültige Struktur - Bitte überprüfen Sie den Inhalt From fcffdec9ac53b791783b2f8bb93202f71efbe541 Mon Sep 17 00:00:00 2001 From: SAP Open Source Program Office Bot <81750448+sap-ospo-bot@users.noreply.github.com> Date: Mon, 10 Mar 2025 09:57:09 +0100 Subject: [PATCH 005/180] [chore]:Reuse API update - Migration from dep5 file to TOML file. (#448) The PR is fixing and updating the Reuse compliance to match the recent Reuse API Specification - we remove the dep5 file and migrate to the toml file. For more details please read the [Reuse Specification](https://reuse.software/spec-3.3/) Co-authored-by: ajinkyapatil8190 --- .reuse/dep5 | 29 ----------------------------- REUSE.toml | 11 +++++++++++ 2 files changed, 11 insertions(+), 29 deletions(-) delete mode 100644 .reuse/dep5 create mode 100644 REUSE.toml diff --git a/.reuse/dep5 b/.reuse/dep5 deleted file mode 100644 index 57d1ebed..00000000 --- a/.reuse/dep5 +++ /dev/null @@ -1,29 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: cloud-cap-samples-java -Upstream-Contact: -Source: https://github.com/SAP-samples/cloud-cap-samples-java -Disclaimer: The code in this project may include calls to APIs (“API Calls”) of - SAP or third-party products or services developed outside of this project - (“External Products”). - “APIs” means application programming interfaces, as well as their respective - specifications and implementing code that allows software to communicate with - other software. - API Calls to External Products are not licensed under the open source license - that governs this project. The use of such API Calls and related External - Products are subject to applicable additional agreements with the relevant - provider of the External Products. In no event shall the open source license - that governs this project grant any rights in or to any External Products,or - alter, expand or supersede any terms of the applicable additional agreements. - If you have a valid license agreement with SAP for the use of a particular SAP - External Product, then you may make use of any API Calls included in this - project’s code for that SAP External Product, subject to the terms of such - license agreement. If you do not have a valid license agreement for the use of - a particular SAP External Product, then you may only make use of any API Calls - in this project for that SAP External Product for your internal, non-productive - and non-commercial test and evaluation of such API Calls. Nothing herein grants - you any rights to use or access any SAP External Product, or provide any third - parties the right to use of access any SAP External Product, through API Calls. - -Files: * -Copyright: 2019-2020 SAP SE or an SAP affiliate company and cap-cloud-samples-java -License: Apache-2.0 diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 00000000..aca2fe39 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,11 @@ +version = 1 +SPDX-PackageName = "cloud-cap-samples-java" +SPDX-PackageSupplier = "" +SPDX-PackageDownloadLocation = "https://github.com/SAP-samples/cloud-cap-samples-java" +SPDX-PackageComment = "The code in this project may include calls to APIs (“API Calls”) of\n SAP or third-party products or services developed outside of this project\n (“External Products”).\n “APIs” means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project’s code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." + +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2019-2020 SAP SE or an SAP affiliate company and cap-cloud-samples-java" +SPDX-License-Identifier = "Apache-2.0" From 5947b742e208198f50868405bdd3fc8390504872 Mon Sep 17 00:00:00 2001 From: Olena Date: Mon, 10 Mar 2025 14:33:15 +0100 Subject: [PATCH 006/180] Modification of Hierarchies (#428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: D070615 Co-authored-by: Adrian Görler Co-authored-by: Marc Becker Co-authored-by: Evgeny Andreev --- README.md | 3 +- app/_i18n/i18n.properties | 7 +- app/_i18n/i18n_de.properties | 6 + app/admin/fiori-service.cds | 84 +++++++++++- app/admin/webapp/manifest.json | 30 +++-- app/appconfig/fioriSandboxConfig.json | 29 +++- app/browse-genres/fiori-service.cds | 22 ++++ app/browse-genres/package.json | 12 ++ app/browse-genres/webapp/Component.js | 3 + app/browse-genres/webapp/i18n/i18n.properties | 2 + .../webapp/i18n/i18n_de.properties | 2 + app/browse-genres/webapp/index.html | 35 +++++ app/browse-genres/webapp/manifest.json | 124 ++++++++++++++++++ app/browse/fiori-service.cds | 13 ++ app/common.cds | 2 - app/fiori.html | 4 +- app/genres/fiori-service.cds | 2 +- app/genres/webapp/i18n/i18n.properties | 4 +- app/genres/webapp/i18n/i18n_de.properties | 4 +- app/index.cds | 1 + app/xs-app.json | 5 + db/books.cds | 21 ++- db/data/my.bookshop-Books.csv | 10 +- db/data/my.bookshop-Contents.csv | 64 +++++++++ db/data/my.bookshop-Genres.csv | 65 ++++----- srv/admin-service.cds | 16 ++- srv/cat-service.cds | 6 + .../handlers/AdminServiceHandler.java | 2 +- .../bookshop/handlers/HierarchyHandler.java | 34 ++--- .../HierarchySiblingActionHandler.java | 75 +++++++++++ .../java/my/bookshop/GenreHierarchyTest.java | 55 ++++---- .../handlers/HierarchyHandlerSorterTest.java | 2 +- 32 files changed, 624 insertions(+), 120 deletions(-) create mode 100644 app/browse-genres/fiori-service.cds create mode 100644 app/browse-genres/package.json create mode 100644 app/browse-genres/webapp/Component.js create mode 100644 app/browse-genres/webapp/i18n/i18n.properties create mode 100644 app/browse-genres/webapp/i18n/i18n_de.properties create mode 100644 app/browse-genres/webapp/index.html create mode 100644 app/browse-genres/webapp/manifest.json create mode 100644 db/data/my.bookshop-Contents.csv create mode 100644 srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java diff --git a/README.md b/README.md index b652330c..29311a48 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,10 @@ User Interface related Features: - [Model Localization](https://cap.cloud.sap/docs/guides/i18n) for [English](app/_i18n/i18n.properties) and [German](app/_i18n/i18n_de.properties) language for static texts - [Custom File Upload extension](app/admin/webapp/extension/Upload.js) which provides a button for uploading `CSV` files - A simple Swagger UI for the CatalogService API at -- UI5 [Tree Table](app/genres/webapp/manifest.json) with Value Help for [GenreHierarchy](app/admin/fiori-service.cds) +- UI5 [Tree Table](app/genres/webapp/manifest.json) with CRUD requests and Value Help for [GenreHierarchy](app/admin/fiori-service.cds). Only on HANA. To check tree table `Contents` embedded into `Books`, please remove `@UI.Hidden` annotation from [Fiori Service](app/admin/fiori-service.cds) - [Custom event handlers](https://cap.cloud.sap/docs/java/provisioning-api) for Tree Table such as the [Custom business logic for GenreHierarchy](srv/src/main/java/my/bookshop/handlers/HierarchyHandler.java). Please note, that Tree Tables must be used with HANA. Custom event handler in this case provides a limited support ment for local testing. +- [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `moveSibling` in the [Admin Service](srv/admin-service.cds). This action demonstrates experimental UI feature [ChangeNextSiblingAction](https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/Hierarchy.md#template_changenextsiblingaction-experimental). The Action implementation is in the [Hierarchy Sibling Action Handler](srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java) CDS Maven Plugin Features: diff --git a/app/_i18n/i18n.properties b/app/_i18n/i18n.properties index a12b718d..94df904d 100644 --- a/app/_i18n/i18n.properties +++ b/app/_i18n/i18n.properties @@ -5,6 +5,7 @@ Created = Created Modified = Modified ModifiedBy = Modified By General = General +Contents = Contents Details = Details Admin = Administrative Translations = Translations @@ -63,7 +64,11 @@ Text = Text Image = Image Genres = Genres Genre = Genre - +PageNumber = Page Number +Informations = Informations +Page = Page +ContentsLevel = Contents Level +ContentsLevels = Contents Levels AddReview = Add Review Notes = Notes diff --git a/app/_i18n/i18n_de.properties b/app/_i18n/i18n_de.properties index 63c111fb..a134ff55 100644 --- a/app/_i18n/i18n_de.properties +++ b/app/_i18n/i18n_de.properties @@ -5,6 +5,7 @@ Created = Angelegt Modified = Bearbeitet ModifiedBy = Bearbeitet von General = Generelles +Contents = Buchinhalt Details = Details Admin = Administratives Translations = Übersetzungen @@ -63,6 +64,11 @@ Text = Text Image = Bild Genres = Genre Genre = Genre +PageNumber = Seitenzahl +Informations = Informationen +Page = Seite +ContentsLevel = Inhaltsebene +ContentsLevels = Inhaltsebenen AddReview = Rezension hinzufügen diff --git a/app/admin/fiori-service.cds b/app/admin/fiori-service.cds index c848916b..813afea9 100644 --- a/app/admin/fiori-service.cds +++ b/app/admin/fiori-service.cds @@ -36,6 +36,13 @@ annotate AdminService.Books with @(UI : { $Type : 'UI.ReferenceFacet', Label : '{i18n>Admin}', Target : '@UI.FieldGroup#Admin' + }, + { + // TODO: should work dynamically + @UI.Hidden, + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Contents}', + Target : 'contents/@UI.PresentationVariant' } ], FieldGroup #General : {Data : [ @@ -60,10 +67,14 @@ annotate AdminService.Books with @(UI : { ]} }); -// Add Value Help for Tree Table + +//////////////////////////////////////////////////////////////////////////// +// +// Value Help for Tree Table +// annotate AdminService.Books with { genre @(Common: { - Label : 'Genre', + Label : '{i18n>Genre}', ValueList: { CollectionPath : 'GenreHierarchy', Parameters : [ @@ -87,6 +98,12 @@ annotate AdminService.GenreHierarchy with { ID @UI.Hidden; }; +@Hierarchy.RecursiveHierarchyActions #GenreHierarchy: { + $Type : 'Hierarchy.RecursiveHierarchyActionsType', + // any name can be the action name with namespace/no bound action name + ChangeNextSiblingAction: 'AdminService.moveSibling', +} + annotate AdminService.GenreHierarchy with @UI: { PresentationVariant #VH: { $Type : 'UI.PresentationVariantType', @@ -96,7 +113,48 @@ annotate AdminService.GenreHierarchy with @UI: { LineItem : [{ $Type: 'UI.DataField', Value: name, - }] + Label : '{i18n>Genre}' + }], +}; + +annotate AdminService.ContentsHierarchy with @UI: { + PresentationVariant : { + $Type : 'UI.PresentationVariantType', + RequestAtLeast: [name], + Visualizations: ['@UI.LineItem'], + }, + LineItem : [{ + $Type: 'UI.DataField', + Value: name, + Label : '{i18n>Name}' + }, + { + $Type: 'UI.DataField', + Value: page, + Label : '{i18n>Page}' + }], + HeaderInfo : { + $Type : 'UI.HeaderInfoType', + TypeName : '{i18n>ContentsLevel}', + TypeNamePlural: '{i18n>ContentsLevels}', + Title : { + $Type: 'UI.DataField', + Value: name, + } + }, + FieldGroup : { + $Type: 'UI.FieldGroupType', + Data : [{ + $Type: 'UI.DataField', + Value: page, + Label : '{i18n>PageNumber}' + }], + }, + Facets : [{ + $Type : 'UI.ReferenceFacet', + Target: '@UI.FieldGroup', + Label : '{i18n>Informations}', + }], }; //////////////////////////////////////////////////////////// @@ -138,6 +196,26 @@ annotate AdminService.Books.texts { } } +//////////////////////////////////////////////////////////// +// +// Annotations for hierarchy ContentsHierarchy +// +annotate AdminService.ContentsHierarchy with @Aggregation.RecursiveHierarchy#ContentsHierarchy: { + $Type: 'Aggregation.RecursiveHierarchyType', + NodeProperty: ID, // identifies a node + ParentNavigationProperty: parent // navigates to a node's parent + }; + +annotate AdminService.ContentsHierarchy with @Hierarchy.RecursiveHierarchy#ContentsHierarchy: { + $Type: 'Hierarchy.RecursiveHierarchyType', + LimitedDescendantCount: LimitedDescendantCount, + DistanceFromRoot: DistanceFromRoot, + DrillState: DrillState, + Matched: Matched, + MatchedDescendantCount: MatchedDescendantCount, + LimitedRank: LimitedRank +}; + annotate AdminService.Books actions { @( Common.SideEffects : { diff --git a/app/admin/webapp/manifest.json b/app/admin/webapp/manifest.json index 29ac7e46..49d05c2c 100644 --- a/app/admin/webapp/manifest.json +++ b/app/admin/webapp/manifest.json @@ -51,7 +51,7 @@ "settings": { "synchronizationMode": "None", "operationMode": "Server", - "autoExpandSelect" : true, + "autoExpandSelect": true, "earlyRequests": true, "groupProperties": { "default": { @@ -74,9 +74,9 @@ "target": "BooksDetails" }, { - "pattern": "Books({key}/author({key2}):?query:", - "name": "AuthorsDetails", - "target": "AuthorsDetails" + "pattern": "Books({key})/contents({key2}):?query:", + "name": "ContentsDetails", + "target": "ContentsDetails" } ], "targets": { @@ -115,22 +115,30 @@ "settings" : { "contextPath" : "/Books", "navigation" : { - "Authors" : { - "detail" : { - "route" : "AuthorsDetails" + "contents": { + "detail": { + "route": "ContentsDetails" + } + } + }, + "controlConfiguration": { + "contents/@com.sap.vocabularies.UI.v1.LineItem": { + "tableSettings": { + "hierarchyQualifier": "ContentsHierarchy", + "type": "TreeTable" } } } } } }, - "AuthorsDetails": { + "ContentsDetails": { "type": "Component", - "id": "AuthorsDetailsList", + "id": "ContentsDetails", "name": "sap.fe.templates.ObjectPage", "options": { - "settings" : { - "contextPath" : "/Authors" + "settings": { + "contextPath": "/Books/contents" } } } diff --git a/app/appconfig/fioriSandboxConfig.json b/app/appconfig/fioriSandboxConfig.json index 48b2ef6a..5c030843 100644 --- a/app/appconfig/fioriSandboxConfig.json +++ b/app/appconfig/fioriSandboxConfig.json @@ -20,7 +20,8 @@ "title": "Browse Books", "description": "Find your favorite book" } - }, { + }, + { "id": "browse-genres", "tileType": "sap.ushell.ui.tile.StaticTile", "properties": { @@ -64,6 +65,15 @@ "title": "Manage Reviews", "description": "Add/edit/delete reviews" } + }, + { + "id": "manage-genres", + "tileType": "sap.ushell.ui.tile.StaticTile", + "properties": { + "targetURL": "#Genres-manage", + "title": "Manage Genres", + "description": "Add/edit/delete genres" + } } ] }, @@ -129,8 +139,8 @@ }, "resolutionResult": { "applicationType": "SAPUI5", - "additionalInformation": "SAPUI5.Component=genres", - "url": "/genres/webapp" + "additionalInformation": "SAPUI5.Component=browse-genres", + "url": "/browse-genres/webapp" } }, "manage-books": { @@ -146,6 +156,19 @@ "url": "/admin/webapp" } }, + "manage-genres": { + "semanticObject": "Genres", + "action": "manage", + "signature": { + "parameters": {}, + "additionalParameters": "allowed" + }, + "resolutionResult": { + "applicationType": "SAPUI5", + "additionalInformation": "SAPUI5.Component=genres", + "url": "/genres/webapp" + } + }, "manage-orders": { "semanticObject": "Orders", "action": "manage", diff --git a/app/browse-genres/fiori-service.cds b/app/browse-genres/fiori-service.cds new file mode 100644 index 00000000..0fe951c0 --- /dev/null +++ b/app/browse-genres/fiori-service.cds @@ -0,0 +1,22 @@ +/* + UI annotations for the Browse GenreHierarchy App +*/ + +using CatalogService from '../../srv/cat-service'; + + +annotate CatalogService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: { + $Type: 'Aggregation.RecursiveHierarchyType', + NodeProperty: ID, // identifies a node + ParentNavigationProperty: parent // navigates to a node's parent + }; + +annotate CatalogService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: { + $Type: 'Hierarchy.RecursiveHierarchyType', + LimitedDescendantCount: LimitedDescendantCount, + DistanceFromRoot: DistanceFromRoot, + DrillState: DrillState, + Matched: Matched, + MatchedDescendantCount: MatchedDescendantCount, + LimitedRank: LimitedRank +}; diff --git a/app/browse-genres/package.json b/app/browse-genres/package.json new file mode 100644 index 00000000..2809c302 --- /dev/null +++ b/app/browse-genres/package.json @@ -0,0 +1,12 @@ +{ + "name": "browse-genres", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/app/browse-genres/webapp/Component.js b/app/browse-genres/webapp/Component.js new file mode 100644 index 00000000..5fa2ad5d --- /dev/null +++ b/app/browse-genres/webapp/Component.js @@ -0,0 +1,3 @@ +sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("browse-genres.Component", { + metadata:{ manifest:'json' } +})) diff --git a/app/browse-genres/webapp/i18n/i18n.properties b/app/browse-genres/webapp/i18n/i18n.properties new file mode 100644 index 00000000..d2792ee9 --- /dev/null +++ b/app/browse-genres/webapp/i18n/i18n.properties @@ -0,0 +1,2 @@ +appTitle=Browse Genres +appDescription=Genres as Tree View diff --git a/app/browse-genres/webapp/i18n/i18n_de.properties b/app/browse-genres/webapp/i18n/i18n_de.properties new file mode 100644 index 00000000..e8714e92 --- /dev/null +++ b/app/browse-genres/webapp/i18n/i18n_de.properties @@ -0,0 +1,2 @@ +appTitle=Zeige Genres +appDescription=Genres als Baumansicht diff --git a/app/browse-genres/webapp/index.html b/app/browse-genres/webapp/index.html new file mode 100644 index 00000000..167596a7 --- /dev/null +++ b/app/browse-genres/webapp/index.html @@ -0,0 +1,35 @@ + + + + + + + Browse Genres + + + + +
+ + diff --git a/app/browse-genres/webapp/manifest.json b/app/browse-genres/webapp/manifest.json new file mode 100644 index 00000000..875c6231 --- /dev/null +++ b/app/browse-genres/webapp/manifest.json @@ -0,0 +1,124 @@ +{ + "_version": "1.8.0", + "sap.app": { + "id": "browse-genres", + "type": "application", + "title": "{{appTitle}}", + "description": "{{appDescription}}", + "applicationVersion": { + "version": "1.0.0" + }, + "dataSources": { + "CatalogService": { + "uri": "/api/browse/", + "type": "OData", + "settings": { + "odataVersion": "4.0" + } + } + }, + "crossNavigation": { + "inbounds": { + "Genres-show": { + "signature": { + "parameters": {}, + "additionalParameters": "allowed" + }, + "semanticObject": "GenreHierarchy", + "action": "show" + } + } + } + }, + "sap.ui5": { + "dependencies": { + "minUI5Version": "1.122.0", + "libs": { + "sap.fe.templates": {} + } + }, + "models": { + "i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "uri": "i18n/i18n.properties" + }, + "": { + "dataSource": "CatalogService", + "settings": { + "synchronizationMode": "None", + "operationMode": "Server", + "autoExpandSelect" : true, + "earlyRequests": true, + "groupProperties": { + "default": { + "submit": "Auto" + } + } + } + } + }, + "routing": { + "routes": [ + { + "pattern": ":?query:", + "name": "GenreHierarchyList", + "target": "GenreHierarchyList" + }, + { + "pattern": "GenreHierarchy({key}):?query:", + "name": "GenreHierarchyDetails", + "target": "GenreHierarchyDetails" + } + ], + "targets": { + "GenreHierarchyList": { + "type": "Component", + "id": "GenreHierarchyList", + "name": "sap.fe.templates.ListReport", + "options": { + "settings" : { + "contextPath" : "/GenreHierarchy", + "navigation" : { + "GenreHierarchy" : { + "detail" : { + "route" : "GenreHierarchyDetails" + } + } + }, + "controlConfiguration": { + "@com.sap.vocabularies.UI.v1.LineItem": { + "tableSettings": { + "hierarchyQualifier": "GenreHierarchy", + "type": "TreeTable" + } + } + } + } + } + }, + "GenreHierarchyDetails": { + "type": "Component", + "id": "GenreHierarchyDetails", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings" : { + "contextPath" : "/GenreHierarchy" + } + } + } + } + }, + "contentDensities": { + "compact": true, + "cozy": true + } + }, + "sap.ui": { + "technology": "UI5", + "fullWidth": false + }, + "sap.fiori": { + "registrationIds": [], + "archeType": "transactional" + } +} diff --git a/app/browse/fiori-service.cds b/app/browse/fiori-service.cds index 953c39dc..07ecb564 100644 --- a/app/browse/fiori-service.cds +++ b/app/browse/fiori-service.cds @@ -161,6 +161,19 @@ annotate CatalogService.Reviews with @(UI : { ]} }); +annotate CatalogService.GenreHierarchy with @UI: { + PresentationVariant : { + $Type : 'UI.PresentationVariantType', + RequestAtLeast: [name], + Visualizations: ['@UI.LineItem'], + }, + LineItem : [{ + $Type: 'UI.DataField', + Value: name, + Label : '{i18n>Genre}' + }], +}; + annotate CatalogService.Books actions { @( Common.SideEffects : { diff --git a/app/common.cds b/app/common.cds index ba638052..f9df40b2 100644 --- a/app/common.cds +++ b/app/common.cds @@ -206,8 +206,6 @@ annotate my.Genres with // Genres Elements // annotate my.Genres with { - ID - @title : '{i18n>ID}'; name @title : '{i18n>Genre}'; } diff --git a/app/fiori.html b/app/fiori.html index 7fa46503..845ec889 100644 --- a/app/fiori.html +++ b/app/fiori.html @@ -14,8 +14,8 @@ }; - - + - - + - - + - - + - - + - - +