Compare commits

..

19 Commits

Author SHA1 Message Date
Vladislav Leonkev
13af32a865 add changes for fiori service deployment 2025-01-21 12:20:59 +01:00
Vladislav Leonkev
6dacb9cfa2 update dependencies 2025-01-17 11:12:18 +01:00
Vladislav Leonkev
78df7e05c8 keep native_hana_associations only in the root 2025-01-17 11:09:02 +01:00
Vladislav Leonkev
951daa8b43 align native_hana_associations, update dependencies, add default deployment config files 2025-01-16 11:57:43 +01:00
Vladislav Leonkev
1271c6272f add admin role 2025-01-09 15:52:37 +01:00
Vladislav Leonkev
e7e64f313d update versions 2025-01-09 15:51:53 +01:00
Vladislav Leonkev
480a16dfa2 remove bookshop service, rename app router directory 2024-12-20 16:00:36 +01:00
Vladislav Leonkev
44088c63c8 small typo 2024-12-19 09:16:51 +01:00
Vladislav Leonkev
3c5dbab4ff remove destination binding from approuter 2024-12-13 12:49:29 +01:00
Vladislav Leonkev
9cce2a45c9 bookstore: remote service credentials only for production profile 2024-12-12 16:45:54 +01:00
Vladislav Leonkev
37fb78d86e mta.yaml: optimize destinations 2024-12-12 16:04:41 +01:00
Vladislav Leonkev
6e7dc8ef6a Reviews app: provide csrfToken 2024-12-12 16:03:44 +01:00
Vladislav Leonkev
63b004ea4b add OrderChanged event definition 2024-12-12 13:57:04 +01:00
Vladislav Leonkev
1f14460797 receive OrderedBook event 2024-12-11 17:17:30 +01:00
Vladislav Leonkev
db100bfda4 bookshop: include fiori/app/services.cds 2024-12-10 11:54:57 +01:00
Vladislav Leonkev
561dc2881c sym-link vue apps in app/router 2024-12-10 11:51:51 +01:00
Vladislav Leonkev
03afb68ad9 add destinations for bookstore 2024-12-09 20:57:20 +01:00
Vladislav Leonkev
32b0e82c98 deploy orders,reviews,bookstore 2024-12-09 19:49:50 +01:00
Vladislav Leonkev
1a0df4d31d deploy bookshop 2024-12-09 15:45:34 +01:00
59 changed files with 1123 additions and 856 deletions

View File

@@ -24,6 +24,6 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
you any rights to use or access any SAP External Product, or provide any third 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. parties the right to use of access any SAP External Product, through API Calls.
Files: *.* Files: *
Copyright: 2019-2025 SAP SE or an SAP affiliate company and cap-cloud-samples Copyright: 2019-2020 SAP SE or an SAP affiliate company and cap-cloud-samples
License: Apache-2.0 License: Apache-2.0

View File

@@ -1,5 +1,3 @@
# Welcome to cap/samples # Welcome to cap/samples
Find here a collection of samples for the [SAP Cloud Application Programming Model](https://cap.cloud.sap) organized in a simplistic [monorepo setup](samples.md#all-in-one-monorepo). Find here a collection of samples for the [SAP Cloud Application Programming Model](https://cap.cloud.sap) organized in a simplistic [monorepo setup](samples.md#all-in-one-monorepo).
@@ -9,12 +7,20 @@ Find here a collection of samples for the [SAP Cloud Application Programming Mod
![](etc/samples.drawio.svg) ![](etc/samples.drawio.svg)
![](https://github.com/SAP-samples/cloud-cap-samples/workflows/CI/badge.svg) ![](https://github.com/SAP-samples/cloud-cap-samples/workflows/CI/badge.svg)
[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/cloud-cap-samples)](https://api.reuse.software/info/github.com/SAP-samples/cloud-cap-samples)
### Preliminaries ### Preliminaries
Ensure you have the latest LTS version of Node.js, [`@sap/cds-dk`](https://www.npmjs.com/package/@sap/cds-dk) installed globally, `git` and your IDE ready (see [Initial Setup](https://cap.cloud.sap/docs/get-started/#setup)) 1. Ensure you have the latest LTS version of Node.js installed (see [Getting Started](https://cap.cloud.sap/docs/get-started/jumpstart))
2. Install [**@sap/cds-dk**](https://cap.cloud.sap/docs/get-started/) globally:
```sh
npm i -g @sap/cds-dk
```
3. _Optional:_ [Use Visual Studio Code](https://cap.cloud.sap/docs/get-started/tools#vscode)
### Download ### Download

1
app-router/bookshop Symbolic link
View File

@@ -0,0 +1 @@
../bookshop/app/vue

1
app-router/orders Symbolic link
View File

@@ -0,0 +1 @@
../orders/app/orders

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "approuter", "name": "approuter",
"dependencies": { "dependencies": {
"@sap/approuter": "^19.0.0" "@sap/approuter": "^17.0.0"
}, },
"engines": { "engines": {
"node": "^20" "node": "^20"

1
app-router/reviews Symbolic link
View File

@@ -0,0 +1 @@
../reviews/app/vue

View File

@@ -1,5 +1,4 @@
{ {
"welcomeFile": "app/bookshop/index.html",
"routes": [ "routes": [
{ {
"source": "^/app/(.*)$", "source": "^/app/(.*)$",

View File

@@ -1 +0,0 @@
../../bookshop/app/vue

View File

@@ -1 +0,0 @@
../../orders/app/orders

View File

@@ -1 +0,0 @@
../../reviews/app/vue

View File

@@ -1,5 +1,5 @@
ID,locale,title,descr ID_texts,ID,locale,title,descr
201,de,Sturmhöhe,"Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (18181848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts." 0,201,de,Sturmhöhe,"Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (18181848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts."
201,fr,Les Hauts de Hurlevent,"Les Hauts de Hurlevent (titre original : Wuthering Heights), parfois orthographié Les Hauts de Hurle-Vent, est l'unique roman d'Emily Brontë, publié pour la première fois en 1847 sous le pseudonyme dEllis Bell. Loin d'être un récit moralisateur, Emily Brontë achève néanmoins le roman dans une atmosphère sereine, suggérant le triomphe de la paix et du Bien sur la vengeance et le Mal." 1,201,fr,Les Hauts de Hurlevent,"Les Hauts de Hurlevent (titre original : Wuthering Heights), parfois orthographié Les Hauts de Hurle-Vent, est l'unique roman d'Emily Brontë, publié pour la première fois en 1847 sous le pseudonyme dEllis Bell. Loin d'être un récit moralisateur, Emily Brontë achève néanmoins le roman dans une atmosphère sereine, suggérant le triomphe de la paix et du Bien sur la vengeance et le Mal."
207,de,Jane Eyre,"Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte" 2,207,de,Jane Eyre,"Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte"
252,de,Eleonora,"“Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1841 erstveröffentlicht. In ihr geht es um das Paradox der Treue in der Treulosigkeit." 3,252,de,Eleonora,"“Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1841 erstveröffentlicht. In ihr geht es um das Paradox der Treue in der Treulosigkeit."
1 ID_texts ID locale title descr
2 0 201 de Sturmhöhe Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (1818–1848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts.
3 1 201 fr Les Hauts de Hurlevent Les Hauts de Hurlevent (titre original : Wuthering Heights), parfois orthographié Les Hauts de Hurle-Vent, est l'unique roman d'Emily Brontë, publié pour la première fois en 1847 sous le pseudonyme d’Ellis Bell. Loin d'être un récit moralisateur, Emily Brontë achève néanmoins le roman dans une atmosphère sereine, suggérant le triomphe de la paix et du Bien sur la vengeance et le Mal.
4 2 207 de Jane Eyre Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte
5 3 252 de Eleonora “Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1841 erstveröffentlicht. In ihr geht es um das Paradox der Treue in der Treulosigkeit.

View File

@@ -14,8 +14,19 @@
}, },
"dependencies": { "dependencies": {
"@sap/cds": ">=7", "@sap/cds": ">=7",
"@sap/xssec": "^4",
"@cap-js/hana": "^1",
"express": "^4.17.1" "express": "^4.17.1"
}, },
"cds": {
"requires": {
"[production]": {
"auth": "xsuaa",
"db": "hana",
"messaging": "enterprise-messaging"
}
}
},
"scripts": { "scripts": {
"genres": "cds serve test/genres.cds", "genres": "cds serve test/genres.cds",
"start": "cds-serve", "start": "cds-serve",

View File

@@ -2,38 +2,50 @@
"name": "@capire/bookstore", "name": "@capire/bookstore",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0",
"@capire/bookshop": "*", "@capire/bookshop": "*",
"@capire/reviews": "*",
"@capire/orders": "*",
"@capire/common": "*", "@capire/common": "*",
"@capire/data-viewer": "*", "@capire/data-viewer": "*",
"@capire/orders": "*", "@sap-cloud-sdk/http-client": "^3.24.0",
"@capire/reviews": "*", "@sap-cloud-sdk/resilience": "^3.24.0",
"@sap-cloud-sdk/http-client": "^3.26.4",
"@sap-cloud-sdk/resilience": "^3.26.4",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0", "express": "^4.17.1",
"express": "^4.17.1" "@cap-js/hana": "^1"
},
"scripts": {
"start": "cds-serve"
}, },
"cds": { "cds": {
"requires": { "requires": {
"ReviewsService": { "ReviewsService": {
"kind": "odata", "kind": "odata",
"model": "@capire/reviews" "model": "@capire/reviews",
"[production]": {
"credentials": {
"destination": "reviews-dest",
"path": "/reviews"
}
}
}, },
"OrdersService": { "OrdersService": {
"kind": "odata", "kind": "odata",
"model": "@capire/orders" "model": "@capire/orders",
"[production]": {
"credentials": {
"destination": "orders-dest",
"path": "/odata/v4/orders"
}
}
}, },
"messaging": true, "[production]": {
"db": { "auth": "xsuaa",
"kind": "sql" "db": "hana",
"messaging": "enterprise-messaging"
} }
}, },
"log": { "log": {
"service": true "service": true
} }
},
"scripts": {
"start": "cds-serve"
} }
} }

View File

@@ -34,8 +34,7 @@ class DataService extends cds.ApplicationService { init(){
query.SELECT.limit = req.query.SELECT.limit // forward $skip / $top query.SELECT.limit = req.query.SELECT.limit // forward $skip / $top
const dataSource = findDataSource(dataSourceName, entityName) const dataSource = findDataSource(dataSourceName, entityName)
let res = await dataSource.run(query) const res = await dataSource.run(query)
if (!Array.isArray(res)) res = [res] // singleton result
return res.map((line) => { return res.map((line) => {
const record = Object.entries(line).map(([column, data]) => ({ column, data })) const record = Object.entries(line).map(([column, data]) => ({ column, data }))
return { return {

139
db/src/.hdiconfig Normal file
View File

@@ -0,0 +1,139 @@
{
"file_suffixes": {
"csv": {
"plugin_name": "com.sap.hana.di.tabledata.source"
},
"hdbafllangprocedure": {
"plugin_name": "com.sap.hana.di.afllangprocedure"
},
"hdbanalyticprivilege": {
"plugin_name": "com.sap.hana.di.analyticprivilege"
},
"hdbcalculationview": {
"plugin_name": "com.sap.hana.di.calculationview"
},
"hdbcollection": {
"plugin_name": "com.sap.hana.di.collection"
},
"hdbconstraint": {
"plugin_name": "com.sap.hana.di.constraint"
},
"hdbdropcreatetable": {
"plugin_name": "com.sap.hana.di.dropcreatetable"
},
"hdbflowgraph": {
"plugin_name": "com.sap.hana.di.flowgraph"
},
"hdbfunction": {
"plugin_name": "com.sap.hana.di.function"
},
"hdbgraphworkspace": {
"plugin_name": "com.sap.hana.di.graphworkspace"
},
"hdbhadoopmrjob": {
"plugin_name": "com.sap.hana.di.virtualfunctionpackage.hadoop"
},
"hdbindex": {
"plugin_name": "com.sap.hana.di.index"
},
"hdblibrary": {
"plugin_name": "com.sap.hana.di.library"
},
"hdbmigrationtable": {
"plugin_name": "com.sap.hana.di.table.migration"
},
"hdbprocedure": {
"plugin_name": "com.sap.hana.di.procedure"
},
"hdbprojectionview": {
"plugin_name": "com.sap.hana.di.projectionview"
},
"hdbprojectionviewconfig": {
"plugin_name": "com.sap.hana.di.projectionview.config"
},
"hdbreptask": {
"plugin_name": "com.sap.hana.di.reptask"
},
"hdbresultcache": {
"plugin_name": "com.sap.hana.di.resultcache"
},
"hdbrole": {
"plugin_name": "com.sap.hana.di.role"
},
"hdbroleconfig": {
"plugin_name": "com.sap.hana.di.role.config"
},
"hdbsearchruleset": {
"plugin_name": "com.sap.hana.di.searchruleset"
},
"hdbsequence": {
"plugin_name": "com.sap.hana.di.sequence"
},
"hdbstatistics": {
"plugin_name": "com.sap.hana.di.statistics"
},
"hdbstructuredprivilege": {
"plugin_name": "com.sap.hana.di.structuredprivilege"
},
"hdbsynonym": {
"plugin_name": "com.sap.hana.di.synonym"
},
"hdbsynonymconfig": {
"plugin_name": "com.sap.hana.di.synonym.config"
},
"hdbsystemversioning": {
"plugin_name": "com.sap.hana.di.systemversioning"
},
"hdbtable": {
"plugin_name": "com.sap.hana.di.table"
},
"hdbtabledata": {
"plugin_name": "com.sap.hana.di.tabledata"
},
"hdbtabletype": {
"plugin_name": "com.sap.hana.di.tabletype"
},
"hdbtrigger": {
"plugin_name": "com.sap.hana.di.trigger"
},
"hdbview": {
"plugin_name": "com.sap.hana.di.view"
},
"hdbvirtualfunction": {
"plugin_name": "com.sap.hana.di.virtualfunction"
},
"hdbvirtualfunctionconfig": {
"plugin_name": "com.sap.hana.di.virtualfunction.config"
},
"hdbvirtualpackagehadoop": {
"plugin_name": "com.sap.hana.di.virtualpackage.hadoop"
},
"hdbvirtualpackagesparksql": {
"plugin_name": "com.sap.hana.di.virtualpackage.sparksql"
},
"hdbvirtualprocedure": {
"plugin_name": "com.sap.hana.di.virtualprocedure"
},
"hdbvirtualprocedureconfig": {
"plugin_name": "com.sap.hana.di.virtualprocedure.config"
},
"hdbvirtualtable": {
"plugin_name": "com.sap.hana.di.virtualtable"
},
"hdbvirtualtableconfig": {
"plugin_name": "com.sap.hana.di.virtualtable.config"
},
"properties": {
"plugin_name": "com.sap.hana.di.tabledata.properties"
},
"tags": {
"plugin_name": "com.sap.hana.di.tabledata.properties"
},
"txt": {
"plugin_name": "com.sap.hana.di.copyonly"
},
"hdbeshconfig": {
"plugin_name": "com.sap.hana.di.eshconfig"
}
}
}

7
db/undeploy.json Normal file
View File

@@ -0,0 +1,7 @@
[
"src/gen/**/*.hdbview",
"src/gen/**/*.hdbindex",
"src/gen/**/*.hdbconstraint",
"src/gen/**/*_drafts.hdbtable",
"src/gen/**/*.hdbcalculationview"
]

View File

@@ -1,5 +1,7 @@
{ {
"emname": "samples-multi-service-shared-db",
"version": "1.1.0", "version": "1.1.0",
"namespace": "cap/samples/shdb",
"options": { "options": {
"management": true, "management": true,
"messagingrest": true, "messagingrest": true,

View File

@@ -2,10 +2,18 @@
"name": "@capire/fiori", "name": "@capire/fiori",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@capire/bookshop": "*",
"@capire/reviews": "*",
"@capire/orders": "*",
"@capire/common": "*",
"@capire/data-viewer": "*",
"@capire/bookstore": "*", "@capire/bookstore": "*",
"@sap-cloud-sdk/http-client": "^3.24.0",
"@sap-cloud-sdk/resilience": "^3.24.0",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@cap-js-community/odata-v2-adapter": "^1", "@cap-js-community/odata-v2-adapter": "^1",
"express": "^4.17.1" "express": "^4.17.1",
"@cap-js/hana": "^1"
}, },
"devDependencies": { "devDependencies": {
"@cap-js/sqlite": "^1" "@cap-js/sqlite": "^1"
@@ -18,25 +26,36 @@
"requires": { "requires": {
"ReviewsService": { "ReviewsService": {
"kind": "odata", "kind": "odata",
"model": "@capire/reviews" "model": "@capire/reviews",
"[production]": {
"credentials": {
"destination": "reviews-dest",
"path": "/reviews"
}
}
}, },
"OrdersService": { "OrdersService": {
"kind": "odata", "kind": "odata",
"model": "@capire/orders" "model": "@capire/orders",
},
"messaging": {
"[production]": { "[production]": {
"kind": "enterprise-messaging" "credentials": {
}, "destination": "orders-dest",
"[development]": { "path": "/odata/v4/orders"
"kind": "file-based-messaging" }
},
"[hybrid]": {
"kind": "enterprise-messaging-shared"
} }
}, },
"db": { "[production]": {
"kind": "sql" "auth": "xsuaa",
"db": "hana",
"messaging": "enterprise-messaging"
},
"[development]": {
"db": "sql",
"messaging": "file-based-messaging"
},
"[hybrid]": {
"db": "hana",
"messaging": "enterprise-messaging-shared"
}, },
"db-ext": { "db-ext": {
"[development]": { "[development]": {

1
fiori/server.js Normal file
View File

@@ -0,0 +1 @@
require('@capire/bookstore/server')

0
fiori/srv/.gitkeep Normal file
View File

15
hello/README.md Normal file
View File

@@ -0,0 +1,15 @@
# Hello World Getting Started Sample
## Next Steps
- To run the JavaScript implementation, open a new terminal and run `cds watch`.
- To run the TypeScript implementation, open a new terminal and run `cds-ts watch`.
Then call the service at: http://localhost:4004/say/hello(to='world')
## Learn More
Learn more about:
- [Hello World!](https://cap.cloud.sap/docs/get-started/hello-world)
- [Using TypeScript](https://cap.cloud.sap/docs/node.js/typescript)

12
hello/package.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "@capire/hello-world",
"version": "1.0.0",
"scripts": {
"test": "npx jest --silent",
"start": "cds-serve srv/world.cds",
"start:ts": "cds-ts serve srv/world.cds"
},
"dependencies": {
"@sap/cds": ">=5.0.4"
}
}

3
hello/srv/world.cds Normal file
View File

@@ -0,0 +1,3 @@
service say {
function hello (to:String) returns String;
}

7
hello/srv/world.js Normal file
View File

@@ -0,0 +1,7 @@
module.exports = class say {
hello(req) {
let {to} = req.data
if (to === 'me') to = require('os').userInfo().username
return `Hello ${to}!`
}
}

7
hello/srv/world.ts Normal file
View File

@@ -0,0 +1,7 @@
import { Request } from "@sap/cds"
module.exports = class say {
hello(req: Request) {
return `Hello ${req.data.to} from a TypeScript file!`
}
}

5
hello/test/test.http Normal file
View File

@@ -0,0 +1,5 @@
GET http://localhost:4004/odata/v4/say/hello
###
GET http://localhost:4004/odata/v4/say/hello(to='me')
###

13
media/db/data-model.cds Normal file
View File

@@ -0,0 +1,13 @@
namespace sap.capire.media;
entity Media {
key id:Integer;
@Core.MediaType: mediaType
content : LargeBinary ;
@Core.IsMediaType: true
mediaType : String;
fileName : String;
applicationName:String;
}

2
media/index.cds Normal file
View File

@@ -0,0 +1,2 @@
using from './db/data-model';
using from './srv/media-service';

19
media/package.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "@capire/media",
"version": "1.0.0",
"dependencies": {
"lokijs": "^1.5.6"
},
"files": [
"db",
"srv",
"index.cds"
],
"cds": {
"requires": {
"db": {
"kind": "sql"
}
}
}
}

View File

@@ -0,0 +1,9 @@
using { sap.capire.media as db } from '../db/data-model';
namespace sap.capire.media;
@path: '/media-server'
service MediaServer {
entity Media as projection on db.Media ;
}

View File

@@ -0,0 +1,68 @@
const loki = require('lokijs')
const db = new loki('DB')
const mediaDB = db.addCollection('Media')
const { Readable, PassThrough } = require('stream')
module.exports = srv => {
srv.before('CREATE', 'Media', req => {
const obj = mediaDB.insert({ media: '' })
req.data.id = obj.$loki
})
srv.on('UPDATE', 'Media', (req, next) => {
const url = req.path
if (url.includes('content')) {
const id = req.data.id
const obj = mediaDB.get(id)
if (!obj) {
req.reject(404, 'No record found for the ID')
return
}
const stream = new PassThrough()
const chunks = []
stream.on('data', chunk => {
chunks.push(chunk)
})
stream.on('end', () => {
obj.media = Buffer.concat(chunks).toString('base64')
mediaDB.update(obj)
})
req.data.content.pipe(stream)
} else return next()
})
srv.on('READ', 'Media', (req, next) => {
const url = req.path
if (url.includes('content')) {
const id = req.data.id
const mediaObj = mediaDB.get(id)
if (!mediaObj) {
req.reject(404, 'Media not found for the ID')
return
}
const decodedMedia = Buffer.from(
mediaObj.media.split(';base64,').pop(),
'base64'
)
return _formatResult(decodedMedia)
} else return next() //> delegate to next/default handlers
})
srv.on('DELETE', 'Media', (req, next) => {
const id = req.data.id
mediaDB
.chain()
.find({ $loki: id })
.remove()
return next() //> delegate to next/default handlers
})
function _formatResult (decodedMedia) {
const readable = new Readable()
const result = new Array()
readable.push(decodedMedia)
readable.push(null)
result.push({ value: readable })
return result
}
}

BIN
media/test/Test.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

35
media/test/media.http Normal file
View File

@@ -0,0 +1,35 @@
### Requires REST Client for VS Code
### https://marketplace.visualstudio.com/items?itemName=humao.rest-client
###
@protocol = http
@host = localhost
@port = 4004
### Read Pictures
GET {{protocol}}://{{host}}:{{port}}/media-server/Media
Authorization: Basic admin:
### Create Picture with mediatype
POST {{protocol}}://{{host}}:{{port}}/media-server/Media
Authorization: Basic admin:
Accept: application/json
Content-Type: application/json
{
"id": 1,
"mediaType": "image/png"
}
### Upload Binary PNG
PUT {{protocol}}://{{host}}:{{port}}/media-server/Media(1)/content
Authorization: Basic admin:
Content-Type: image/png
< ./Test.png
### Read Binary
GET {{protocol}}://{{host}}:{{port}}/media-server/Media(1)/content
Authorization: Basic admin:
### Delete Image
DELETE {{protocol}}://{{host}}:{{port}}/media-server/Media(1)
Authorization: Basic admin:

View File

@@ -1,6 +1,6 @@
_schema-version: 3.3.0 _schema-version: 3.3.0
ID: capire.samples ID: capire.samples
version: 3.0.0 version: 2.1.0
description: "A monorepo with several samples for CAP." description: "A monorepo with several samples for CAP."
parameters: parameters:
enable-parallel-deployments: true enable-parallel-deployments: true
@@ -9,71 +9,76 @@ build-parameters:
- builder: custom - builder: custom
commands: commands:
- npm ci - npm ci
- npx cds build ./shared-db --for hana --production - npx cds build --for hana --production --ws
- npx cds build ./orders --for nodejs --production --ws-pack - npx cds build ./orders --for nodejs --production --ws-pack
- npx cds build ./reviews --for nodejs --production - npx cds build ./reviews --for nodejs --production --ws-pack
- npx cds build ./bookstore --for nodejs --production --ws-pack - npx cds build ./fiori --for nodejs --production --ws-pack
modules:
- name: bookstore-srv
type: nodejs
path: bookstore/gen/srv
parameters:
instances: 1
buildpack: nodejs_buildpack
build-parameters:
builder: npm
properties:
cds_requires_ReviewsService_credentials: {"destination": "reviews-dest","path": "/reviews"}
cds_requires_OrdersService_credentials: {"destination": "orders-dest","path": "/odata/v4/orders"}
provides:
- name: bookstore-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: samples-db
- name: samples-auth
- name: samples-messaging
- name: samples-destination
modules:
- name: orders-srv - name: orders-srv
type: nodejs type: nodejs
path: orders/gen/srv path: orders/gen/srv
parameters: parameters:
instances: 1
buildpack: nodejs_buildpack buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
build-parameters: build-parameters:
builder: npm builder: npm
provides: provides:
- name: orders-api # required by consumers of CAP services (e.g. approuter) - name: orders-api
properties: properties:
srv-url: ${default-url} srv-url: ${default-url}
requires: requires:
- name: samples-messaging
- name: samples-db - name: samples-db
- name: samples-auth - name: samples-auth
- name: samples-messaging
- name: samples-destination
- name: reviews-srv - name: reviews-srv
type: nodejs type: nodejs
path: reviews/gen/srv path: reviews/gen/srv
parameters: parameters:
instances: 1
buildpack: nodejs_buildpack buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
build-parameters: build-parameters:
builder: npm builder: npm
provides: provides:
- name: reviews-api # required by consumers of CAP services (e.g. approuter) - name: reviews-api
properties: properties:
srv-url: ${default-url} srv-url: ${default-url}
requires: requires:
- name: samples-messaging
- name: samples-db - name: samples-db
- name: samples-auth - name: samples-auth
- name: fiori-srv
type: nodejs
path: fiori/gen/srv
parameters:
buildpack: nodejs_buildpack
readiness-health-check-type: http
readiness-health-check-http-endpoint: /health
disk-quota: 256M
memory: 256M
build-parameters:
builder: npm
provides:
- name: bookstore-api
properties:
srv-url: ${default-url}
requires:
- name: samples-messaging - name: samples-messaging
- name: samples-db
- name: samples-auth
- name: samples-destination - name: samples-destination
- name: samples-db-deployer - name: samples-db-deployer
type: hdb type: hdb
path: shared-db/gen/db path: gen/db
parameters: parameters:
buildpack: nodejs_buildpack buildpack: nodejs_buildpack
requires: requires:
@@ -81,7 +86,7 @@ modules:
- name: samples - name: samples
type: approuter.nodejs type: approuter.nodejs
path: app/router path: app-router
parameters: parameters:
keep-existing-routes: true keep-existing-routes: true
disk-quota: 256M disk-quota: 256M
@@ -90,28 +95,22 @@ modules:
- name: orders-api - name: orders-api
group: destinations group: destinations
properties: properties:
name: orders-api name: orders-api # must be used in xs-app.json as well
url: ~{srv-url} url: ~{srv-url}
forwardAuthToken: true forwardAuthToken: true
- name: reviews-api - name: reviews-api
group: destinations group: destinations
properties: properties:
name: reviews-api name: reviews-api # must be used in xs-app.json as well
url: ~{srv-url} url: ~{srv-url}
forwardAuthToken: true forwardAuthToken: true
- name: bookstore-api - name: bookstore-api
group: destinations group: destinations
properties: properties:
name: bookstore-api name: bookstore-api # must be used in xs-app.json as well
url: ~{srv-url} url: ~{srv-url}
forwardAuthToken: true forwardAuthToken: true
- name: samples-auth - name: samples-auth
- name: samples-destination
provides:
- name: app-api
properties:
app-protocol: ${protocol}
app-uri: ${default-uri}
- name: destination-content - name: destination-content
type: com.sap.application.content type: com.sap.application.content
@@ -145,6 +144,12 @@ modules:
TokenServiceKeyName: xsuaa_service-key TokenServiceKeyName: xsuaa_service-key
resources: resources:
- name: samples-messaging
type: org.cloudfoundry.managed-service
parameters:
service: enterprise-messaging
service-plan: default
path: ./event-mesh.json
- name: samples-db - name: samples-db
type: com.sap.xs.hdi-container type: com.sap.xs.hdi-container
parameters: parameters:
@@ -161,15 +166,6 @@ resources:
config: config:
xsappname: samples-${org}-${space} xsappname: samples-${org}-${space}
tenant-mode: dedicated tenant-mode: dedicated
- name: samples-messaging
type: org.cloudfoundry.managed-service
parameters:
service: enterprise-messaging
service-plan: default
path: ./event-mesh.json
config:
emname: bookstore-${org}-${space}
namespace: cap/samples/${space}
- name: samples-destination - name: samples-destination
type: org.cloudfoundry.managed-service type: org.cloudfoundry.managed-service
parameters: parameters:

View File

@@ -2,18 +2,21 @@
"name": "@capire/orders", "name": "@capire/orders",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0", "@cap-js/hana": "^1",
"@capire/common": "*", "@capire/common": "*",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0" "@sap/xssec": "^4"
},
"scripts": {
"start": "cds-serve"
}, },
"cds": { "cds": {
"requires": { "requires": {
"messaging": true, "[production]": {
"db": true "auth": "xsuaa",
"db": "hana",
"messaging": "enterprise-messaging"
}
} }
},
"scripts": {
"start": "cds-serve"
} }
} }

View File

@@ -3,13 +3,13 @@ using { sap.capire.orders as my } from '../db/schema';
service OrdersService { service OrdersService {
entity Orders as projection on my.Orders; entity Orders as projection on my.Orders;
@odata.draft.bypass
@(requires: 'system-user')
entity OrdersNoDraft as projection on my.Orders;
event OrderChanged { event OrderChanged {
product: String; product: String;
deltaQuantity: Integer; deltaQuantity: Integer;
} }
@odata.draft.bypass
@(requires: 'system-user')
entity OrdersNoDraft as projection on my.Orders;
} }

508
package-lock.json generated
View File

@@ -1,33 +1,36 @@
{ {
"name": "@capire/samples", "name": "@capire/samples",
"version": "3.0.0", "version": "2.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@capire/samples", "name": "@capire/samples",
"version": "3.0.0", "version": "2.1.0",
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"workspaces": [ "workspaces": [
"./bookshop", "./bookshop",
"./bookstore", "./bookstore",
"./common", "./common",
"./data-viewer",
"./fiori", "./fiori",
"./hello",
"./media",
"./orders", "./orders",
"./reviews", "./loggers",
"./etc/data-viewer", "./reviews"
"./etc/loggers"
], ],
"dependencies": { "dependencies": {
"@cap-js/hana": "^1", "@cap-js/hana": "^1",
"@sap/cds": ">=8", "@sap/cds": ">=8"
"@sap/xssec": "^4"
}, },
"devDependencies": { "devDependencies": {
"@cap-js/cds-test": "^0",
"@cap-js/cds-types": "^0", "@cap-js/cds-types": "^0",
"@cap-js/sqlite": "^1", "@cap-js/sqlite": "^1",
"@sap/cds-dk": "^8", "axios": "^1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"eslint": "^9", "eslint": "^9",
"semver": "^7" "semver": "^7"
} }
@@ -36,7 +39,9 @@
"name": "@capire/bookshop", "name": "@capire/bookshop",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1",
"@sap/cds": ">=7", "@sap/cds": ">=7",
"@sap/xssec": "^4",
"express": "^4.17.1" "express": "^4.17.1"
}, },
"devDependencies": { "devDependencies": {
@@ -47,16 +52,15 @@
"name": "@capire/bookstore", "name": "@capire/bookstore",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0", "@cap-js/hana": "^1",
"@capire/bookshop": "*", "@capire/bookshop": "*",
"@capire/common": "*", "@capire/common": "*",
"@capire/data-viewer": "*", "@capire/data-viewer": "*",
"@capire/orders": "*", "@capire/orders": "*",
"@capire/reviews": "*", "@capire/reviews": "*",
"@sap-cloud-sdk/http-client": "^3.26.4", "@sap-cloud-sdk/http-client": "^3.24.0",
"@sap-cloud-sdk/resilience": "^3.26.4", "@sap-cloud-sdk/resilience": "^3.24.0",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0",
"express": "^4.17.1" "express": "^4.17.1"
} }
}, },
@@ -67,21 +71,13 @@
"@sap/cds": "*" "@sap/cds": "*"
} }
}, },
"etc/data-viewer": { "data-viewer": {
"name": "@capire/data-viewer", "name": "@capire/data-viewer",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@sap/cds": ">=5.0.4" "@sap/cds": ">=5.0.4"
} }
}, },
"etc/loggers": {
"name": "@capire/loggers",
"version": "1.0.0",
"dependencies": {
"@sap/cds": ">=5.9",
"express": "^4.17.1"
}
},
"fiori": { "fiori": {
"name": "@capire/fiori", "name": "@capire/fiori",
"version": "1.0.0", "version": "1.0.0",
@@ -95,10 +91,32 @@
"@cap-js/sqlite": "^1" "@cap-js/sqlite": "^1"
} }
}, },
"hello": {
"name": "@capire/hello-world",
"version": "1.0.0",
"dependencies": {
"@sap/cds": ">=5.0.4"
}
},
"loggers": {
"name": "@capire/loggers",
"version": "1.0.0",
"dependencies": {
"@sap/cds": ">=5.9",
"express": "^4.17.1"
}
},
"media": {
"name": "@capire/media",
"version": "1.0.0",
"dependencies": {
"lokijs": "^1.5.6"
}
},
"node_modules/@cap-js-community/odata-v2-adapter": { "node_modules/@cap-js-community/odata-v2-adapter": {
"version": "1.14.2", "version": "1.14.0",
"resolved": "https://registry.npmjs.org/@cap-js-community/odata-v2-adapter/-/odata-v2-adapter-1.14.2.tgz", "resolved": "https://registry.npmjs.org/@cap-js-community/odata-v2-adapter/-/odata-v2-adapter-1.14.0.tgz",
"integrity": "sha512-ZFDvBWHGzMFeruh9Wx828QTPf3zfh0XFOAEYoijaM5T+3koT+lv6p9fdz78pF4IaNhpIpy6Q7eg3EF/ZVllssQ==", "integrity": "sha512-L4yIHml7Pc3dpSiCCJkOADje7kXgMvAIhFx6ZdeWwBnniPiul++8zCbRMIIjjwFKuujTwjoprb7C4IzZdYlAfQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"body-parser": "^1.20.3", "body-parser": "^1.20.3",
@@ -112,29 +130,6 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@cap-js/cds-test": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@cap-js/cds-test/-/cds-test-0.2.0.tgz",
"integrity": "sha512-2qjIW5B10kQziGNz1a3wqpyUlNjsv/A4+nMyGdtPQZgVPtg+SO+mN8C9iZq+NE3EC+vpnztglH2gGS23RivDsg==",
"dev": true,
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"axios": "^1",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0"
},
"bin": {
"cds-test": "bin/test.js",
"chest": "bin/test.js"
},
"engines": {
"node": ">=20"
},
"peerDependencies": {
"@sap/cds": ">=8.8"
}
},
"node_modules/@cap-js/cds-types": { "node_modules/@cap-js/cds-types": {
"version": "0.9.0", "version": "0.9.0",
"resolved": "https://registry.npmjs.org/@cap-js/cds-types/-/cds-types-0.9.0.tgz", "resolved": "https://registry.npmjs.org/@cap-js/cds-types/-/cds-types-0.9.0.tgz",
@@ -148,9 +143,9 @@
} }
}, },
"node_modules/@cap-js/db-service": { "node_modules/@cap-js/db-service": {
"version": "1.18.0", "version": "1.16.2",
"resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.18.0.tgz", "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.16.2.tgz",
"integrity": "sha512-Gv0X+GZx85Op8GZ+xbkt49Nrrha68jPfV5+Uo023Xqsbv7HhoFPkI1t1IVI+isZRz04dx4MW573b0KKGEFDAFg==", "integrity": "sha512-B9XSThHB3McPYBGP1Lty4/I5edD6aCcBFKRLYIqUj2u6gIzHNJXu1TIHicGwWb/e6Plp2+ntwTQ01DgMp6Xgtg==",
"license": "SEE LICENSE", "license": "SEE LICENSE",
"dependencies": { "dependencies": {
"generic-pool": "^3.9.0" "generic-pool": "^3.9.0"
@@ -160,12 +155,12 @@
} }
}, },
"node_modules/@cap-js/hana": { "node_modules/@cap-js/hana": {
"version": "1.7.0", "version": "1.5.2",
"resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.7.0.tgz", "resolved": "https://registry.npmjs.org/@cap-js/hana/-/hana-1.5.2.tgz",
"integrity": "sha512-QaFQAKT6beFIC61I+3BSq4aSmVydzTziEUy/eb+hWZqfUaqZjujgnI9OPrnLaDeE4dZkOGYj/GAGy39t5vaagA==", "integrity": "sha512-8+fxzHHiJEFL0KZtuCKwKFu1HmZA3mvyEfWEbd7w81MSmsvCqkrrKpix0cEvnaG2pahxuAECDthqiQJ3GMLFVQ==",
"license": "SEE LICENSE", "license": "SEE LICENSE",
"dependencies": { "dependencies": {
"@cap-js/db-service": "^1.18.0", "@cap-js/db-service": "^1.16.1",
"hdb": "^0.19.5" "hdb": "^0.19.5"
}, },
"peerDependencies": { "peerDependencies": {
@@ -179,13 +174,13 @@
} }
}, },
"node_modules/@cap-js/sqlite": { "node_modules/@cap-js/sqlite": {
"version": "1.9.0", "version": "1.7.8",
"resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.9.0.tgz", "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.7.8.tgz",
"integrity": "sha512-0Ka6a7W7v5qyL8IiEjKg1oJH1AvLh/bmshHYxovmruKfyDEuEx+Kz8IARKq8oHwmzPCZVV/xXIKnpg/KWesXcA==", "integrity": "sha512-llFn0LGNIdlsfU4KjzyuIMvlQhKxXodq4GIt9yStmmX/av/twwHR8SyUmTJirRH4IkNtpCsuNYpsI+bYO2Xklg==",
"dev": true, "dev": true,
"license": "SEE LICENSE", "license": "SEE LICENSE",
"dependencies": { "dependencies": {
"@cap-js/db-service": "^1.18.0", "@cap-js/db-service": "^1.14.1",
"better-sqlite3": "^11.0.0" "better-sqlite3": "^11.0.0"
}, },
"peerDependencies": { "peerDependencies": {
@@ -205,15 +200,23 @@
"link": true "link": true
}, },
"node_modules/@capire/data-viewer": { "node_modules/@capire/data-viewer": {
"resolved": "etc/data-viewer", "resolved": "data-viewer",
"link": true "link": true
}, },
"node_modules/@capire/fiori": { "node_modules/@capire/fiori": {
"resolved": "fiori", "resolved": "fiori",
"link": true "link": true
}, },
"node_modules/@capire/hello-world": {
"resolved": "hello",
"link": true
},
"node_modules/@capire/loggers": { "node_modules/@capire/loggers": {
"resolved": "etc/loggers", "resolved": "loggers",
"link": true
},
"node_modules/@capire/media": {
"resolved": "media",
"link": true "link": true
}, },
"node_modules/@capire/orders": { "node_modules/@capire/orders": {
@@ -245,9 +248,9 @@
} }
}, },
"node_modules/@eslint-community/eslint-utils": { "node_modules/@eslint-community/eslint-utils": {
"version": "4.5.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz",
"integrity": "sha512-RoV8Xs9eNwiDvhv7M+xcL4PWyRyIXRY/FLp3buU4h1EYfdF7unWUy3dOjPqb3C7rMUewIcqwW850PgS8h1o1yg==", "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -287,13 +290,13 @@
} }
}, },
"node_modules/@eslint/config-array": { "node_modules/@eslint/config-array": {
"version": "0.19.2", "version": "0.19.1",
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz",
"integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@eslint/object-schema": "^2.1.6", "@eslint/object-schema": "^2.1.5",
"debug": "^4.3.1", "debug": "^4.3.1",
"minimatch": "^3.1.2" "minimatch": "^3.1.2"
}, },
@@ -301,20 +304,10 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
} }
}, },
"node_modules/@eslint/config-helpers": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz",
"integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/@eslint/core": { "node_modules/@eslint/core": {
"version": "0.12.0", "version": "0.10.0",
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz",
"integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
@@ -325,9 +318,9 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "3.3.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz",
"integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -349,9 +342,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "9.22.0", "version": "9.18.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz",
"integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -359,9 +352,9 @@
} }
}, },
"node_modules/@eslint/object-schema": { "node_modules/@eslint/object-schema": {
"version": "2.1.6", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz",
"integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
@@ -369,13 +362,13 @@
} }
}, },
"node_modules/@eslint/plugin-kit": { "node_modules/@eslint/plugin-kit": {
"version": "0.2.7", "version": "0.2.5",
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz",
"integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@eslint/core": "^0.12.0", "@eslint/core": "^0.10.0",
"levn": "^0.4.1" "levn": "^0.4.1"
}, },
"engines": { "engines": {
@@ -435,9 +428,9 @@
} }
}, },
"node_modules/@humanwhocodes/retry": { "node_modules/@humanwhocodes/retry": {
"version": "0.4.2", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz",
"integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
@@ -449,51 +442,51 @@
} }
}, },
"node_modules/@sap-cloud-sdk/connectivity": { "node_modules/@sap-cloud-sdk/connectivity": {
"version": "3.26.4", "version": "3.25.0",
"resolved": "https://registry.npmjs.org/@sap-cloud-sdk/connectivity/-/connectivity-3.26.4.tgz", "resolved": "https://registry.npmjs.org/@sap-cloud-sdk/connectivity/-/connectivity-3.25.0.tgz",
"integrity": "sha512-IDG+wJIPiqRz5GoMj/1HDSy5cGIW5MCgyNvBgoZXXH96EEXhJSYLYr/Cjd9+ziyV8TfobMpGrrbqkiBtl9Dqaw==", "integrity": "sha512-mf9TA7brehISMtI/6/RoJ+c+mTyAJOzWVccv/3WrTUrPxmE+m5MZOsXH/rnbwo9ZZ1jw3NlDn1xOPamSq8VD/A==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@sap-cloud-sdk/resilience": "^3.26.4", "@sap-cloud-sdk/resilience": "^3.25.0",
"@sap-cloud-sdk/util": "^3.26.4", "@sap-cloud-sdk/util": "^3.25.0",
"@sap/xsenv": "^5.4.0", "@sap/xsenv": "^5.4.0",
"@sap/xssec": "^4.4.0", "@sap/xssec": "^4.2.7",
"async-retry": "^1.3.3", "async-retry": "^1.3.3",
"axios": "^1.8.1", "axios": "^1.7.9",
"jsonwebtoken": "^9.0.2" "jsonwebtoken": "^9.0.2"
} }
}, },
"node_modules/@sap-cloud-sdk/http-client": { "node_modules/@sap-cloud-sdk/http-client": {
"version": "3.26.4", "version": "3.25.0",
"resolved": "https://registry.npmjs.org/@sap-cloud-sdk/http-client/-/http-client-3.26.4.tgz", "resolved": "https://registry.npmjs.org/@sap-cloud-sdk/http-client/-/http-client-3.25.0.tgz",
"integrity": "sha512-RKNwznwaoq1mqK7OLPKJz91kB9V0Lw52f2PiFbRibhC4xhwDwOhmOp1J/a8toSCBMsv4iasH1xBWg8UrvXgEFg==", "integrity": "sha512-4XQsdHjqFSt7pJ86XmBpCB1JthjqthKY9L/F8SPUfsvTZkm7O6omvgwHXvYpyDNI1cGheyF7CognZ9LyLuYvKw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@sap-cloud-sdk/connectivity": "^3.26.4", "@sap-cloud-sdk/connectivity": "^3.25.0",
"@sap-cloud-sdk/resilience": "^3.26.4", "@sap-cloud-sdk/resilience": "^3.25.0",
"@sap-cloud-sdk/util": "^3.26.4", "@sap-cloud-sdk/util": "^3.25.0",
"axios": "^1.8.1" "axios": "^1.7.9"
} }
}, },
"node_modules/@sap-cloud-sdk/resilience": { "node_modules/@sap-cloud-sdk/resilience": {
"version": "3.26.4", "version": "3.25.0",
"resolved": "https://registry.npmjs.org/@sap-cloud-sdk/resilience/-/resilience-3.26.4.tgz", "resolved": "https://registry.npmjs.org/@sap-cloud-sdk/resilience/-/resilience-3.25.0.tgz",
"integrity": "sha512-g3iWQMvtFIKF4xit58bT7v/Ba8UYC7mZ5eisX8vbDl+uFMyizJcwvtjk6llO5/z7/o/4SysXqRdtmtAPqsv7Sg==", "integrity": "sha512-CVi05HIN/USOXezEkBFCf8d2dsDHbMmoRbVYUHWwaLiZfoAi+pcDUq7pcj8j/CaaiBu5cmaeal0sQN+C3A4FWQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@sap-cloud-sdk/util": "^3.26.4", "@sap-cloud-sdk/util": "^3.25.0",
"async-retry": "^1.3.3", "async-retry": "^1.3.3",
"axios": "^1.8.1", "axios": "^1.7.9",
"opossum": "^8.4.0" "opossum": "^8.4.0"
} }
}, },
"node_modules/@sap-cloud-sdk/util": { "node_modules/@sap-cloud-sdk/util": {
"version": "3.26.4", "version": "3.25.0",
"resolved": "https://registry.npmjs.org/@sap-cloud-sdk/util/-/util-3.26.4.tgz", "resolved": "https://registry.npmjs.org/@sap-cloud-sdk/util/-/util-3.25.0.tgz",
"integrity": "sha512-JwIl9XaYyQsIHSpakWtOYVzLdnJIC9S6gLgpfBBG9DhFLpLuXtq5ywal3oQB0fP/VR3l01MO71XGvElIO8OIyw==", "integrity": "sha512-rNPb9qiN/pbz1C+dBD+IXLqq+vVAqOt5aL34emHLyoGb18VHRIFzkbgmI1HYMZyhLG5EhSeBdKXyLN38YFaJpA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"axios": "^1.8.1", "axios": "^1.7.9",
"chalk": "^4.1.0", "chalk": "^4.1.0",
"logform": "^2.7.0", "logform": "^2.7.0",
"voca": "^1.4.1", "voca": "^1.4.1",
@@ -502,9 +495,9 @@
} }
}, },
"node_modules/@sap/cds": { "node_modules/@sap/cds": {
"version": "8.8.2", "version": "8.6.1",
"resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.8.2.tgz", "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.6.1.tgz",
"integrity": "sha512-KfFXSxf2pVLBKZr9Che8FYJ/VUS/UNngWfSHkGqVPPPjpSOHcW/x/h8x8Aiqk6Ze8WcZIl/2PgyKW4809xPDsQ==", "integrity": "sha512-JYHRrGs6Tgle5Vmj/o3BaQkOBVcroweOrXhhiUVH6twISy+Yi2cWZdTr0EFFEt94FI1dVqvrVnEM67jEjOQImQ==",
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"dependencies": { "dependencies": {
"@sap/cds-compiler": ">=5.1", "@sap/cds-compiler": ">=5.1",
@@ -521,22 +514,18 @@
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"express": "^4", "express": ">=4"
"tar": "^7"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"express": { "express": {
"optional": true "optional": true
},
"tar": {
"optional": true
} }
} }
}, },
"node_modules/@sap/cds-compiler": { "node_modules/@sap/cds-compiler": {
"version": "5.8.2", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.8.2.tgz", "resolved": "https://registry.npmjs.org/@sap/cds-compiler/-/cds-compiler-5.6.0.tgz",
"integrity": "sha512-doEOvu2ZTYjcC8v/UaYESYVjSAnLvuDlit4FurUiPfxiMxsQqwDOtldJGDTb26JpZdIi/GrTWv8qksk6PnpmMA==", "integrity": "sha512-MYhAQNkSQPwi16q738edpHP9JcVH8gunm15+02nQu1Rz59PQDcj7GcWqyb4EGQklKRyMUg/5J4zXKaH1RxKqgA==",
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"dependencies": { "dependencies": {
"antlr4": "4.9.3" "antlr4": "4.9.3"
@@ -550,44 +539,10 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@sap/cds-dk": {
"version": "8.8.2",
"resolved": "https://registry.npmjs.org/@sap/cds-dk/-/cds-dk-8.8.2.tgz",
"integrity": "sha512-eF5wO0SnycDVyr4/xIRFiH7W1VANeB+yQoib9veM4oc7M/jkhB34bDZLdWqK7hpKLZ7k66aLc1SOWjOPLQne7g==",
"dev": true,
"hasShrinkwrap": true,
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@cap-js/asyncapi": "^1.0.0",
"@cap-js/openapi": "^1.0.0",
"@sap/cds": ">=7",
"@sap/cds-foss": "^5.0.0",
"@sap/cds-mtxs": ">=1.9.0",
"@sap/eslint-plugin-cds": "^3.0.1",
"@sap/hdi-deploy": "^5",
"axios": "^1",
"eslint": "^9",
"express": "^4.17.3",
"hdb": "^0",
"livereload-js": "^4.0.1",
"mustache": "^4.0.1",
"node-watch": ">=0.7",
"ws": "^8.4.2",
"xml-js": "^1.6.11"
},
"bin": {
"cds": "bin/cds.js",
"cds-ts": "bin/cds-ts.js",
"cds-tsx": "bin/cds-tsx.js"
},
"optionalDependencies": {
"@cap-js/sqlite": "^1"
}
},
"node_modules/@sap/cds-fiori": { "node_modules/@sap/cds-fiori": {
"version": "1.4.0", "version": "1.2.9",
"resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.4.0.tgz", "resolved": "https://registry.npmjs.org/@sap/cds-fiori/-/cds-fiori-1.2.9.tgz",
"integrity": "sha512-Ge0Lwr2W1jUGepA4uABVB2szA/PBpmZDQt2CZdU1Ihc8LlgcdCoiulEYkiJvX3mTcQJEWCTEEsCNpQUqniEtTw==", "integrity": "sha512-2fOOqqals1OFEgChTip4M62kvD2dDchp52KSMwt7nwFnluVsT7z8UFaU6gfU1jZu7PcumcxV9yHuTvwzwkiW8w==",
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"peerDependencies": { "peerDependencies": {
"@sap/cds": ">=7.6", "@sap/cds": ">=7.6",
@@ -610,12 +565,12 @@
} }
}, },
"node_modules/@sap/xsenv": { "node_modules/@sap/xsenv": {
"version": "5.5.0", "version": "5.4.0",
"resolved": "https://registry.npmjs.org/@sap/xsenv/-/xsenv-5.5.0.tgz", "resolved": "https://registry.npmjs.org/@sap/xsenv/-/xsenv-5.4.0.tgz",
"integrity": "sha512-+FIpnXjDrgtJaN6AxjDRIc5ONd4Yt5UarCqqzRiZjvJaknnkT+b6/ho/va/rg8UdiCAVxn8c4vMVhgjXGc/gmQ==", "integrity": "sha512-O9G71v7S1ZHorDHwNGAbZXmvRvALbeN8Q/j1UgQdKfUcf18re+5CZxKCVUezs2OTBR2KB/tvDFLnlXwHYuwC7A==",
"license": "SEE LICENSE IN LICENSE file", "license": "SEE LICENSE IN LICENSE file",
"dependencies": { "dependencies": {
"debug": "4.4.0", "debug": "4.3.7",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"verror": "1.10.1" "verror": "1.10.1"
}, },
@@ -623,10 +578,27 @@
"node": "^18.0.0 || ^20.0.0 || ^22.0.0" "node": "^18.0.0 || ^20.0.0 || ^22.0.0"
} }
}, },
"node_modules/@sap/xsenv/node_modules/debug": {
"version": "4.3.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/@sap/xssec": { "node_modules/@sap/xssec": {
"version": "4.4.0", "version": "4.2.8",
"resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.4.0.tgz", "resolved": "https://registry.npmjs.org/@sap/xssec/-/xssec-4.2.8.tgz",
"integrity": "sha512-tVPyF6z6lWN2cucT38kkTu6GTmFXhqd/xa0SrExZ+j8K1cNePEIDHvx/zfibubLeb198vyoreW4QOpR9+Vaj4A==", "integrity": "sha512-hTwupdCFdp3ElAF/e4qj6Akgf3N6/C7bq3qggbTeHEdaPVEehYPyxuTsdxb1TVI1vUGlHjB7RUW6aa6n30fP6Q==",
"license": "SAP DEVELOPER LICENSE AGREEMENT", "license": "SAP DEVELOPER LICENSE AGREEMENT",
"dependencies": { "dependencies": {
"debug": "^4.3.4", "debug": "^4.3.4",
@@ -681,9 +653,9 @@
} }
}, },
"node_modules/@types/express-serve-static-core": { "node_modules/@types/express-serve-static-core": {
"version": "5.0.6", "version": "5.0.5",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.5.tgz",
"integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", "integrity": "sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
@@ -703,9 +675,9 @@
"peer": true "peer": true
}, },
"node_modules/@types/http-proxy": { "node_modules/@types/http-proxy": {
"version": "1.17.16", "version": "1.17.15",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.16.tgz", "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz",
"integrity": "sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==", "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
@@ -727,9 +699,9 @@
"peer": true "peer": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.13.10", "version": "22.10.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz",
"integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.20.0" "undici-types": "~6.20.0"
@@ -796,9 +768,9 @@
} }
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.14.1", "version": "8.14.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
"integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -913,9 +885,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.8.3", "version": "1.7.9",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",
@@ -952,9 +924,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/better-sqlite3": { "node_modules/better-sqlite3": {
"version": "11.8.1", "version": "11.8.0",
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.8.1.tgz", "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.8.0.tgz",
"integrity": "sha512-9BxNaBkblMjhJW8sMRZxnxVTRgbRmssZW0Oxc1MPBTfiR+WW21e2Mk4qu8CzrcZb1LwPCnFsfDEzq+SNcBU8eg==", "integrity": "sha512-aKv9s2dir7bsEX5RIjL9HHWB9uQ+f6Vch5B4qmeAOop4Y9OYHX+PNKLr+mpv6+d8L/ZYh4l7H8zPuVMbWkVMLw==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
@@ -1146,9 +1118,9 @@
} }
}, },
"node_modules/call-bind-apply-helpers": { "node_modules/call-bind-apply-helpers": {
"version": "1.0.2", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"es-errors": "^1.3.0", "es-errors": "^1.3.0",
@@ -1159,13 +1131,13 @@
} }
}, },
"node_modules/call-bound": { "node_modules/call-bound": {
"version": "1.0.4", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz",
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"call-bind-apply-helpers": "^1.0.2", "call-bind-apply-helpers": "^1.0.1",
"get-intrinsic": "^1.3.0" "get-intrinsic": "^1.2.6"
}, },
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
@@ -1595,21 +1567,6 @@
"node": ">= 0.4" "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": { "node_modules/escape-html": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -1630,23 +1587,22 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "9.22.0", "version": "9.18.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz",
"integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.12.1", "@eslint-community/regexpp": "^4.12.1",
"@eslint/config-array": "^0.19.2", "@eslint/config-array": "^0.19.0",
"@eslint/config-helpers": "^0.1.0", "@eslint/core": "^0.10.0",
"@eslint/core": "^0.12.0", "@eslint/eslintrc": "^3.2.0",
"@eslint/eslintrc": "^3.3.0", "@eslint/js": "9.18.0",
"@eslint/js": "9.22.0", "@eslint/plugin-kit": "^0.2.5",
"@eslint/plugin-kit": "^0.2.7",
"@humanfs/node": "^0.16.6", "@humanfs/node": "^0.16.6",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@humanwhocodes/retry": "^0.4.2", "@humanwhocodes/retry": "^0.4.1",
"@types/estree": "^1.0.6", "@types/estree": "^1.0.6",
"@types/json-schema": "^7.0.15", "@types/json-schema": "^7.0.15",
"ajv": "^6.12.4", "ajv": "^6.12.4",
@@ -1654,7 +1610,7 @@
"cross-spawn": "^7.0.6", "cross-spawn": "^7.0.6",
"debug": "^4.3.2", "debug": "^4.3.2",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"eslint-scope": "^8.3.0", "eslint-scope": "^8.2.0",
"eslint-visitor-keys": "^4.2.0", "eslint-visitor-keys": "^4.2.0",
"espree": "^10.3.0", "espree": "^10.3.0",
"esquery": "^1.5.0", "esquery": "^1.5.0",
@@ -1691,9 +1647,9 @@
} }
}, },
"node_modules/eslint-scope": { "node_modules/eslint-scope": {
"version": "8.3.0", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
"integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
"dev": true, "dev": true,
"license": "BSD-2-Clause", "license": "BSD-2-Clause",
"dependencies": { "dependencies": {
@@ -2015,9 +1971,9 @@
} }
}, },
"node_modules/flatted": { "node_modules/flatted": {
"version": "3.3.3", "version": "3.3.2",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz",
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@@ -2048,14 +2004,13 @@
} }
}, },
"node_modules/form-data": { "node_modules/form-data": {
"version": "4.0.2", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
"combined-stream": "^1.0.8", "combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"mime-types": "^2.1.12" "mime-types": "^2.1.12"
}, },
"engines": { "engines": {
@@ -2116,17 +2071,17 @@
} }
}, },
"node_modules/get-intrinsic": { "node_modules/get-intrinsic": {
"version": "1.3.0", "version": "1.2.7",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz",
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"call-bind-apply-helpers": "^1.0.2", "call-bind-apply-helpers": "^1.0.1",
"es-define-property": "^1.0.1", "es-define-property": "^1.0.1",
"es-errors": "^1.3.0", "es-errors": "^1.3.0",
"es-object-atoms": "^1.1.1", "es-object-atoms": "^1.0.0",
"function-bind": "^1.1.2", "function-bind": "^1.1.2",
"get-proto": "^1.0.1", "get-proto": "^1.0.0",
"gopd": "^1.2.0", "gopd": "^1.2.0",
"has-symbols": "^1.1.0", "has-symbols": "^1.1.0",
"hasown": "^2.0.2", "hasown": "^2.0.2",
@@ -2218,21 +2173,6 @@
"url": "https://github.com/sponsors/ljharb" "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": { "node_modules/hasown": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
@@ -2348,9 +2288,9 @@
} }
}, },
"node_modules/import-fresh": { "node_modules/import-fresh": {
"version": "3.3.1", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -2658,6 +2598,12 @@
"node": ">= 12.0.0" "node": ">= 12.0.0"
} }
}, },
"node_modules/lokijs": {
"version": "1.5.12",
"resolved": "https://registry.npmjs.org/lokijs/-/lokijs-1.5.12.tgz",
"integrity": "sha512-Q5ALD6JiS6xAUWCwX3taQmgwxyveCtIIuL08+ml0nHwT3k0S/GIFJN+Hd38b1qYIMaE5X++iqsqWVksz7SYW+Q==",
"license": "MIT"
},
"node_modules/loupe": { "node_modules/loupe": {
"version": "2.3.7", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
@@ -2800,9 +2746,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/napi-build-utils": { "node_modules/napi-build-utils": {
"version": "2.0.0", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
@@ -2823,9 +2769,9 @@
} }
}, },
"node_modules/node-abi": { "node_modules/node-abi": {
"version": "3.74.0", "version": "3.73.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.73.0.tgz",
"integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", "integrity": "sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -2848,9 +2794,9 @@
} }
}, },
"node_modules/object-inspect": { "node_modules/object-inspect": {
"version": "1.13.4", "version": "1.13.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz",
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
@@ -3020,9 +2966,9 @@
} }
}, },
"node_modules/prebuild-install": { "node_modules/prebuild-install": {
"version": "7.1.3", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz",
"integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3031,7 +2977,7 @@
"github-from-package": "0.0.0", "github-from-package": "0.0.0",
"minimist": "^1.2.3", "minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3", "mkdirp-classic": "^0.5.3",
"napi-build-utils": "^2.0.0", "napi-build-utils": "^1.0.1",
"node-abi": "^3.3.0", "node-abi": "^3.3.0",
"pump": "^3.0.0", "pump": "^3.0.0",
"rc": "^1.2.7", "rc": "^1.2.7",
@@ -3242,9 +3188,9 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.7.1", "version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
"integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"license": "ISC", "license": "ISC",
"bin": { "bin": {
"semver": "bin/semver.js" "semver": "bin/semver.js"
@@ -3846,19 +3792,19 @@
"name": "@capire/orders", "name": "@capire/orders",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0", "@cap-js/hana": "^1",
"@capire/common": "*", "@capire/common": "*",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0" "@sap/xssec": "^4"
} }
}, },
"reviews": { "reviews": {
"name": "@capire/reviews", "name": "@capire/reviews",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0", "@cap-js/hana": "^1",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0", "@sap/xssec": "^4.2.7",
"express": "^4.17.1" "express": "^4.17.1"
} }
} }

View File

@@ -1,42 +1,49 @@
{ {
"name": "@capire/samples", "name": "@capire/samples",
"version": "3.0.0", "version": "2.1.0",
"description": "A monorepo with several samples for CAP.", "description": "A monorepo with several samples for CAP.",
"repository": "https://github.com/sap-samples/cloud-cap-samples.git", "repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com", "author": "daniel.hutzel@sap.com",
"dependencies": { "dependencies": {
"@sap/cds": ">=8", "@sap/cds": ">=8",
"@cap-js/hana": "^1", "@cap-js/hana": "^1"
"@sap/xssec": "^4"
}, },
"workspaces": [ "workspaces": [
"./bookshop", "./bookshop",
"./bookstore", "./bookstore",
"./common", "./common",
"./data-viewer",
"./fiori", "./fiori",
"./hello",
"./media",
"./orders", "./orders",
"./reviews", "./loggers",
"./etc/data-viewer", "./reviews"
"./etc/loggers"
], ],
"devDependencies": { "devDependencies": {
"@cap-js/cds-test": "^0",
"@cap-js/cds-types": "^0", "@cap-js/cds-types": "^0",
"@cap-js/sqlite": "^1", "@cap-js/sqlite": "^1",
"@sap/cds-dk": "^8", "axios": "^1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"eslint": "^9", "eslint": "^9",
"semver": "^7" "semver": "^7"
}, },
"scripts": { "scripts": {
"build": "mbt build -t gen --mtar mta.tar", "build": "mbt build -t gen --mtar mta.tar",
"deploy": "cf deploy gen/mta.tar", "deploy": "cf deploy gen/mta.tar",
"undeploy": "cf undeploy capire.samples --delete-services --delete-service-keys", "undeploy": "cf undeploy capire.samples --delete-services --delete-service-keys --delete-service-brokers",
"bookshop": "cds watch bookshop", "bookshop": "cds watch bookshop",
"start": "cds watch fiori",
"fiori": "cds watch fiori", "fiori": "cds watch fiori",
"hello": "cds watch hello",
"media": "cds watch media",
"lint": "eslint", "lint": "eslint",
"test": "npx jest --silent", "test": "npx jest --silent",
"jest": "npx jest --silent", "jest": "npx jest --silent",
"mocha": "CDS_TEST_SILENT=y npx mocha" "mocha": "CDS_TEST_SILENT=y npx mocha",
"test:hello": "cd hello && npm test"
}, },
"mocha": { "mocha": {
"recursive": true, "recursive": true,
@@ -46,17 +53,11 @@
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"private": true, "private": true,
"cds": { "cds": {
"requires": {
"destinations": true
},
"sql": { "sql": {
"native_hana_associations": false "native_hana_associations": false
},
"requires": {
"[production]": {
"auth": "xsuaa"
},
"messaging": {
"kind": "enterprise-messaging"
},
"destinations": true
} }
} }
} }

View File

@@ -69,3 +69,25 @@ const reviews = Vue.createApp ({
// initially fill list of my reviews // initially fill list of my reviews
reviews.fetch() reviews.fetch()
axios.interceptors.request.use(csrfToken)
function csrfToken (request) {
if (request.method === 'head' || request.method === 'get') return request
if ('csrfToken' in document) {
request.headers['x-csrf-token'] = document.csrfToken
return request
}
return fetchToken().then(token => {
document.csrfToken = token
request.headers['x-csrf-token'] = document.csrfToken
return request
}).catch(() => {
document.csrfToken = null // set mark to not try again
return request
})
function fetchToken() {
return axios.get('/', { headers: { 'x-csrf-token': 'fetch' } })
.then(res => res.headers['x-csrf-token'])
}
}

View File

@@ -1,5 +1,5 @@
ID;subject;rating;reviewer;title;text ID;subject;rating;reviewer;title;text
1689144d-3b10-4849-bcbe-2408a13e161a;201;5;bob;Intriguing;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 0;201;5;bob;Intriguing;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
1689144d-3b10-4849-bcbe-2408a13e161b;201;4;bob;Fascinating;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id diam maecenas ultricies mi eget mauris pharetra et. Risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pulvinar mattis nunc sed blandit libero. Facilisis magna etiam tempor orci eu. Nec sagittis aliquam malesuada bibendum arcu. Eu consequat ac felis donec. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Tortor posuere ac ut consequat semper viverra nam libero. Amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Scelerisque purus semper eget duis at tellus. Elementum tempus egestas sed sed risus pretium. Arcu dictum varius duis at. Amet luctus venenatis lectus magna fringilla urna. Eget velit aliquet sagittis id consectetur purus ut faucibus. Vitae auctor eu augue ut lectus. Fermentum iaculis eu non diam phasellus vestibulum. 1;201;4;bob;Fascinating;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id diam maecenas ultricies mi eget mauris pharetra et. Risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pulvinar mattis nunc sed blandit libero. Facilisis magna etiam tempor orci eu. Nec sagittis aliquam malesuada bibendum arcu. Eu consequat ac felis donec. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Tortor posuere ac ut consequat semper viverra nam libero. Amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Scelerisque purus semper eget duis at tellus. Elementum tempus egestas sed sed risus pretium. Arcu dictum varius duis at. Amet luctus venenatis lectus magna fringilla urna. Eget velit aliquet sagittis id consectetur purus ut faucibus. Vitae auctor eu augue ut lectus. Fermentum iaculis eu non diam phasellus vestibulum.
1689144d-3b10-4849-bcbe-2408a13e161c;207;2;bob;What is this?;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Libero justo laoreet sit amet cursus sit amet dictum. Nunc faucibus a pellentesque sit. Dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Enim nunc faucibus a pellentesque. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien. Cras ornare arcu dui vivamus. Facilisi etiam dignissim diam quis enim lobortis. Et molestie ac feugiat sed. Urna neque viverra justo nec ultrices dui. Ullamcorper a lacus vestibulum sed arcu non. Volutpat ac tincidunt vitae semper quis. Dignissim sodales ut eu sem. Feugiat in fermentum posuere urna nec. At augue eget arcu dictum varius. 2;207;2;bob;What is this?;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Libero justo laoreet sit amet cursus sit amet dictum. Nunc faucibus a pellentesque sit. Dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Enim nunc faucibus a pellentesque. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien. Cras ornare arcu dui vivamus. Facilisi etiam dignissim diam quis enim lobortis. Et molestie ac feugiat sed. Urna neque viverra justo nec ultrices dui. Ullamcorper a lacus vestibulum sed arcu non. Volutpat ac tincidunt vitae semper quis. Dignissim sodales ut eu sem. Feugiat in fermentum posuere urna nec. At augue eget arcu dictum varius.
1689144d-3b10-4849-bcbe-2408a13e161d;251;3;bob;It's dark...;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Suscipit tellus mauris a diam. Velit aliquet sagittis id consectetur purus ut. Viverra adipiscing at in tellus integer. Vitae elementum curabitur vitae nunc. Mattis ullamcorper velit sed ullamcorper morbi. Diam quis enim lobortis scelerisque. Auctor neque vitae tempus quam pellentesque nec nam aliquam. Semper auctor neque vitae tempus. Quis eleifend quam adipiscing vitae proin. Neque convallis a cras semper auctor neque vitae. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Sit amet consectetur adipiscing elit ut aliquam purus. Pretium quam vulputate dignissim suspendisse. 3;251;3;bob;It's dark...;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Suscipit tellus mauris a diam. Velit aliquet sagittis id consectetur purus ut. Viverra adipiscing at in tellus integer. Vitae elementum curabitur vitae nunc. Mattis ullamcorper velit sed ullamcorper morbi. Diam quis enim lobortis scelerisque. Auctor neque vitae tempus quam pellentesque nec nam aliquam. Semper auctor neque vitae tempus. Quis eleifend quam adipiscing vitae proin. Neque convallis a cras semper auctor neque vitae. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Sit amet consectetur adipiscing elit ut aliquam purus. Pretium quam vulputate dignissim suspendisse.
1 ID subject rating reviewer title text
2 1689144d-3b10-4849-bcbe-2408a13e161a 0 201 5 bob Intriguing Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
3 1689144d-3b10-4849-bcbe-2408a13e161b 1 201 4 bob Fascinating Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id diam maecenas ultricies mi eget mauris pharetra et. Risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pulvinar mattis nunc sed blandit libero. Facilisis magna etiam tempor orci eu. Nec sagittis aliquam malesuada bibendum arcu. Eu consequat ac felis donec. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Tortor posuere ac ut consequat semper viverra nam libero. Amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Scelerisque purus semper eget duis at tellus. Elementum tempus egestas sed sed risus pretium. Arcu dictum varius duis at. Amet luctus venenatis lectus magna fringilla urna. Eget velit aliquet sagittis id consectetur purus ut faucibus. Vitae auctor eu augue ut lectus. Fermentum iaculis eu non diam phasellus vestibulum.
4 1689144d-3b10-4849-bcbe-2408a13e161c 2 207 2 bob What is this? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Libero justo laoreet sit amet cursus sit amet dictum. Nunc faucibus a pellentesque sit. Dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Enim nunc faucibus a pellentesque. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien. Cras ornare arcu dui vivamus. Facilisi etiam dignissim diam quis enim lobortis. Et molestie ac feugiat sed. Urna neque viverra justo nec ultrices dui. Ullamcorper a lacus vestibulum sed arcu non. Volutpat ac tincidunt vitae semper quis. Dignissim sodales ut eu sem. Feugiat in fermentum posuere urna nec. At augue eget arcu dictum varius.
5 1689144d-3b10-4849-bcbe-2408a13e161d 3 251 3 bob It's dark... Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Suscipit tellus mauris a diam. Velit aliquet sagittis id consectetur purus ut. Viverra adipiscing at in tellus integer. Vitae elementum curabitur vitae nunc. Mattis ullamcorper velit sed ullamcorper morbi. Diam quis enim lobortis scelerisque. Auctor neque vitae tempus quam pellentesque nec nam aliquam. Semper auctor neque vitae tempus. Quis eleifend quam adipiscing vitae proin. Neque convallis a cras semper auctor neque vitae. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Sit amet consectetur adipiscing elit ut aliquam purus. Pretium quam vulputate dignissim suspendisse.

View File

@@ -7,28 +7,21 @@
"index.cds" "index.cds"
], ],
"dependencies": { "dependencies": {
"@cap-js/hana": "^1.7.0", "@cap-js/hana": "^1",
"@sap/cds": ">=5", "@sap/cds": ">=5",
"@sap/xssec": "^4.4.0", "@sap/xssec": "^4.2.7",
"express": "^4.17.1" "express": "^4.17.1"
}, },
"scripts": {
"start": "cds-serve"
},
"cds": { "cds": {
"requires": { "requires": {
"messaging": { "[production]": {
"[development]": { "auth": "xsuaa",
"kind": "file-based-messaging" "db": "hana",
}, "messaging": "enterprise-messaging"
"[hybrid]": { }
"kind": "enterprise-messaging-shared"
},
"[production]": {
"kind": "enterprise-messaging"
}
},
"db": true
} }
},
"scripts": {
"start": "cds-serve"
} }
} }

View File

@@ -6,6 +6,12 @@ Each sub directory essentially is an individual npm package arranged in an [all-
![](etc/samples.drawio.svg) ![](etc/samples.drawio.svg)
## [@capire/hello-world](hello)
- A simplistic [Hello World](https://cap.cloud.sap/docs/get-started/hello-world) service using [CDS](https://cap.cloud.sap/docs/cds/) and [cds.services](https://cap.cloud.sap/docs/node.js/api#services-api).
- [Typescript support](https://cap.cloud.sap/docs/node.js/typescript)
## [@capire/bookshop](bookshop) ## [@capire/bookshop](bookshop)
- [Getting Started](https://cap.cloud.sap/docs/get-started/in-a-nutshell) with CAP, briefly introducing: - [Getting Started](https://cap.cloud.sap/docs/get-started/in-a-nutshell) with CAP, briefly introducing:
@@ -54,10 +60,10 @@ Each sub directory essentially is an individual npm package arranged in an [all-
- [@capire/reviews](reviews) - [@capire/reviews](reviews)
- [@capire/orders](orders) - [@capire/orders](orders)
- [@capire/common](common) - [@capire/common](common)
- [@capire/data-viewer](etc/data-viewer) - [@capire/data-viewer](data-viewer)
- [The Vue.js app](bookshop/app/vue) imported from `bookshop` is served as well - [The Vue.js app](bookshop/app/vue) imported from `bookshop` is served as well
- [The Vue.js app](reviews/app/vue) imported from `reviews` is served as well - [The Vue.js app](reviews/app/vue) imported from `reviews` is served as well
- [The Vue.js app](etc/data-viewer/app/data) imported from `data-viewer` is served as well - [The Vue.js app](data-viewer/app/data) imported from `data-viewer` is served as well
- [The Fiori app](orders/app) imported from `orders` is served as well - [The Fiori app](orders/app) imported from `orders` is served as well
- [OpenAPI export + Swagger UI](https://cap.cloud.sap/docs/advanced/openapi) - [OpenAPI export + Swagger UI](https://cap.cloud.sap/docs/advanced/openapi)

View File

@@ -1,3 +0,0 @@
using from '@capire/bookstore';
using from '@capire/reviews';
using from '@capire/orders';

View File

@@ -1,17 +0,0 @@
{
"name": "shared-db",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"cds": {
"sql": {
"native_hana_associations": false
}
}
}

22
test/hello-world.test.js Normal file
View File

@@ -0,0 +1,22 @@
const cds = require('@sap/cds')
describe('cap/samples - Hello world!', () => {
const { GET, expect } = cds.test (__dirname+'/../hello')
it('should say hello with class impl', async () => {
const {data} = await GET `/odata/v4/say/hello(to='world')`
expect(data.value).to.eql('Hello world!')
})
it('should say hello with another impl', async () => {
await cds.serve('say').from(cds.model)
.at('/say-again').in(cds.app)
.with(srv => {
srv.on('hello', (req) => `Hello again ${req.data.to}!`)
})
const {data} = await GET `/say-again/hello(to='world')`
expect(data.value).to.eql('Hello again world!')
})
})

View File

@@ -16,7 +16,13 @@
"description": "Enterprise-Messaging Management Access" "description": "Enterprise-Messaging Management Access"
} }
], ],
"attributes": [], "attributes": [
{
"name": "level",
"description": "level",
"valueType": "s"
}
],
"role-templates": [ "role-templates": [
{ {
"name": "admin", "name": "admin",