diff --git a/certificates/certificates.db b/certificates/certificates.db new file mode 100644 index 00000000..ce4ccf33 Binary files /dev/null and b/certificates/certificates.db differ diff --git a/certificates/media-store/.cdsrc.json b/certificates/media-store/.cdsrc.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/certificates/media-store/.cdsrc.json @@ -0,0 +1 @@ +{} diff --git a/certificates/media-store/.eslintrc b/certificates/media-store/.eslintrc new file mode 100644 index 00000000..639d13a0 --- /dev/null +++ b/certificates/media-store/.eslintrc @@ -0,0 +1,24 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true, + "jest": true + }, + "parserOptions": { + "ecmaVersion": 2017 + }, + "globals": { + "SELECT": true, + "INSERT": true, + "UPDATE": true, + "DELETE": true, + "CREATE": true, + "DROP": true, + "cds": true + }, + "rules": { + "no-console": "off", + "require-atomic-updates": "off" + } +} diff --git a/certificates/media-store/.gitignore b/certificates/media-store/.gitignore new file mode 100644 index 00000000..74ce3610 --- /dev/null +++ b/certificates/media-store/.gitignore @@ -0,0 +1,29 @@ +# CAP media-store +_out +*.db +connection.properties +default-*.json +gen/ +node_modules/ +target/ + +# Web IDE, App Studio +.che/ +.gen/ + +# MTA +*_mta_build_tmp +*.mtar +mta_archives/ + +# Other +.DS_Store +*.orig +*.log + +*.iml +*.flattened-pom.xml + +# IDEs +# .vscode +# .idea diff --git a/certificates/media-store/.vscode/extensions.json b/certificates/media-store/.vscode/extensions.json new file mode 100644 index 00000000..1daacbd8 --- /dev/null +++ b/certificates/media-store/.vscode/extensions.json @@ -0,0 +1,20 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + // >>>>>>>> Add CDS Editor here as soon it is available of vscode marketplace!, + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "mechatroner.rainbow-csv", + "humao.rest-client", + "alexcvzz.vscode-sqlite", + "hbenl.vscode-mocha-test-adapter", + "sdras.night-owl" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + + ] +} diff --git a/certificates/media-store/.vscode/launch.json b/certificates/media-store/.vscode/launch.json new file mode 100644 index 00000000..3f308a6c --- /dev/null +++ b/certificates/media-store/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "command": "cds run --with-mocks --in-memory?", + "name": "cds run", + "request": "launch", + "type": "node-terminal", + "skipFiles": [ "/**" ] + } + ] +} diff --git a/certificates/media-store/.vscode/settings.json b/certificates/media-store/.vscode/settings.json new file mode 100644 index 00000000..9fefa082 --- /dev/null +++ b/certificates/media-store/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.exclude": { + "**/.gitignore": true, + "**/.git": true, + "**/.vscode": true + } +} diff --git a/certificates/media-store/.vscode/tasks.json b/certificates/media-store/.vscode/tasks.json new file mode 100644 index 00000000..622da99a --- /dev/null +++ b/certificates/media-store/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "shell", + "label": "cds watch", + "command": "cds", + "args": ["watch"], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "type": "shell", + "label": "cds run", + "command": "cds", + "args": ["run", "--with-mocks", "--in-memory?"], + "problemMatcher": [] + } + ] +} diff --git a/certificates/media-store/README.md b/certificates/media-store/README.md new file mode 100644 index 00000000..d1847423 --- /dev/null +++ b/certificates/media-store/README.md @@ -0,0 +1,25 @@ +# Getting Started + +Welcome to your new project. + +It contains these folders and files, following our recommended project layout: + +File or Folder | Purpose +---------|---------- +`app/` | content for UI frontends goes here +`db/` | your domain models and data go here +`srv/` | your service models and code go here +`package.json` | project metadata and configuration +`readme.md` | this getting started guide + + +## Next Steps + +- Open a new terminal and run `cds watch` +- (in VS Code simply choose _**Terminal** > Run Task > cds watch_) +- Start adding content, for example, a [db/schema.cds](db/schema.cds). + + +## Learn More + +Learn more at https://cap.cloud.sap/docs/get-started/. diff --git a/certificates/media-store/package.json b/certificates/media-store/package.json new file mode 100644 index 00000000..cf19c1f2 --- /dev/null +++ b/certificates/media-store/package.json @@ -0,0 +1,18 @@ +{ + "name": "media-store", + "version": "1.0.0", + "description": "A simple CAP project.", + "repository": "", + "license": "UNLICENSED", + "private": true, + "dependencies": { + "@sap/cds": "^4", + "express": "^4" + }, + "devDependencies": { + "sqlite3": "^5" + }, + "scripts": { + "start": "npx cds run" + } +} diff --git a/media-store/.cdsrc.json b/media-store/.cdsrc.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/media-store/.cdsrc.json @@ -0,0 +1 @@ +{} diff --git a/media-store/.eslintrc b/media-store/.eslintrc new file mode 100644 index 00000000..639d13a0 --- /dev/null +++ b/media-store/.eslintrc @@ -0,0 +1,24 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true, + "jest": true + }, + "parserOptions": { + "ecmaVersion": 2017 + }, + "globals": { + "SELECT": true, + "INSERT": true, + "UPDATE": true, + "DELETE": true, + "CREATE": true, + "DROP": true, + "cds": true + }, + "rules": { + "no-console": "off", + "require-atomic-updates": "off" + } +} diff --git a/media-store/.gitignore b/media-store/.gitignore new file mode 100644 index 00000000..74ce3610 --- /dev/null +++ b/media-store/.gitignore @@ -0,0 +1,29 @@ +# CAP media-store +_out +*.db +connection.properties +default-*.json +gen/ +node_modules/ +target/ + +# Web IDE, App Studio +.che/ +.gen/ + +# MTA +*_mta_build_tmp +*.mtar +mta_archives/ + +# Other +.DS_Store +*.orig +*.log + +*.iml +*.flattened-pom.xml + +# IDEs +# .vscode +# .idea diff --git a/media-store/.vscode/extensions.json b/media-store/.vscode/extensions.json new file mode 100644 index 00000000..1daacbd8 --- /dev/null +++ b/media-store/.vscode/extensions.json @@ -0,0 +1,20 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + // >>>>>>>> Add CDS Editor here as soon it is available of vscode marketplace!, + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "mechatroner.rainbow-csv", + "humao.rest-client", + "alexcvzz.vscode-sqlite", + "hbenl.vscode-mocha-test-adapter", + "sdras.night-owl" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + + ] +} diff --git a/media-store/.vscode/launch.json b/media-store/.vscode/launch.json new file mode 100644 index 00000000..3f308a6c --- /dev/null +++ b/media-store/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "command": "cds run --with-mocks --in-memory?", + "name": "cds run", + "request": "launch", + "type": "node-terminal", + "skipFiles": [ "/**" ] + } + ] +} diff --git a/media-store/.vscode/settings.json b/media-store/.vscode/settings.json new file mode 100644 index 00000000..9fefa082 --- /dev/null +++ b/media-store/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.exclude": { + "**/.gitignore": true, + "**/.git": true, + "**/.vscode": true + } +} diff --git a/media-store/.vscode/tasks.json b/media-store/.vscode/tasks.json new file mode 100644 index 00000000..622da99a --- /dev/null +++ b/media-store/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "shell", + "label": "cds watch", + "command": "cds", + "args": ["watch"], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "type": "shell", + "label": "cds run", + "command": "cds", + "args": ["run", "--with-mocks", "--in-memory?"], + "problemMatcher": [] + } + ] +} diff --git a/media-store/README.md b/media-store/README.md new file mode 100644 index 00000000..d1847423 --- /dev/null +++ b/media-store/README.md @@ -0,0 +1,25 @@ +# Getting Started + +Welcome to your new project. + +It contains these folders and files, following our recommended project layout: + +File or Folder | Purpose +---------|---------- +`app/` | content for UI frontends goes here +`db/` | your domain models and data go here +`srv/` | your service models and code go here +`package.json` | project metadata and configuration +`readme.md` | this getting started guide + + +## Next Steps + +- Open a new terminal and run `cds watch` +- (in VS Code simply choose _**Terminal** > Run Task > cds watch_) +- Start adding content, for example, a [db/schema.cds](db/schema.cds). + + +## Learn More + +Learn more at https://cap.cloud.sap/docs/get-started/. diff --git a/media-store/db/schema.cds b/media-store/db/schema.cds new file mode 100644 index 00000000..614d6e3f --- /dev/null +++ b/media-store/db/schema.cds @@ -0,0 +1,82 @@ +namespace sap.capire.media.store; + +aspect NamedEntityAspect { + key ID : Integer; + name : String(120); +} + +aspect ContactInfoAspect { + firstName : String(40); + lastName : String(20); + city : String(40); + state : String(40); + adress : String(70); + country : String(40); + postalCode : String(10); + phone : String(24); + fax : String(24); + email : String(60); +} + +entity MediaTypes : NamedEntityAspect {} +entity Genres : NamedEntityAspect {} +entity Playlists : NamedEntityAspect {} + +entity PlaylistTrack { + key playlist : Association to Playlists; + key track : Association to Tracks; +} + +entity Artists : NamedEntityAspect {} + +entity Albums { + key ID : Integer; + title : String(120); + artist : Association to Artists; +} + +entity Employees : ContactInfoAspect { + key ID : Integer; + reportsTo : Association to Employees; + title : String(20); + birthDate : DateTime; + hireDate : DateTime; +} + +entity Customers : ContactInfoAspect { + key ID : Integer; + company : String(80); + supportRepId : Association to Employees; +} + +entity Invoices { + key ID : Integer; + customer : Association to Customers; + invoiceDate : DateTime; + billingAdress : String(70); + billingCity : String(40); + billingState : String(40); + bilingCountry : String(40); + billingPostalCode : String(40); + total : Decimal(10, 2); +} + +entity InvoiceItems { + key ID : Integer; + invoice : Association to Invoices; + track : Association to Tracks; + unitPrice : Decimal(10, 2); + quantity : Integer; +} + +entity Tracks { + key ID : Integer; + name : String(200); + album : Association to Albums; + mediaType : Association to MediaTypes; + genre : Association to Genres; + composer : String(220); + milliseconds : Integer; + bytes : Integer; + unitPrice : Decimal(10, 2); +} diff --git a/media-store/package.json b/media-store/package.json new file mode 100644 index 00000000..a36c641d --- /dev/null +++ b/media-store/package.json @@ -0,0 +1,28 @@ +{ + "name": "media-store", + "version": "1.0.0", + "description": "A simple CAP project.", + "repository": "", + "license": "UNLICENSED", + "private": true, + "dependencies": { + "@sap/cds": "^4", + "express": "^4" + }, + "devDependencies": { + "sqlite3": "^5" + }, + "scripts": { + "start": "npx cds run" + }, + "cds": { + "requires": { + "db": { + "kind": "sqlite", + "credentials": { + "database": "mychinook.db" + } + } + } + } +} \ No newline at end of file diff --git a/media-store/srv/media-service.cds b/media-store/srv/media-service.cds new file mode 100644 index 00000000..56865f9f --- /dev/null +++ b/media-store/srv/media-service.cds @@ -0,0 +1,5 @@ +using {sap.capire.media.store as my} from '../db/schema'; + +service MediaService { + entity Employees as projection on my.Employees; +}