Compare commits

..

6 Commits

Author SHA1 Message Date
Christian Georgi
dff5568618 Better clone path 2020-04-20 17:07:02 +02:00
Christian Georgi
20bb8d8c54 Add package-lock.json, fix readme 2020-04-02 16:00:51 +02:00
Christian Georgi
045e65487c Update readme 2020-03-23 17:08:49 +01:00
Christian Georgi
e660e01b77 Initial HANA config 2020-01-24 12:02:33 +00:00
Christian Georgi
06a9ef0f5b Pinning versions 2020-01-24 09:48:54 +00:00
Christian Georgi
8978799491 Remove superfluous files 2020-01-24 09:43:07 +00:00
14 changed files with 66 additions and 2117 deletions

41
.vscode/launch.json vendored
View File

@@ -5,18 +5,45 @@
"version": "0.2.0",
"configurations": [
{
"name": "bookshop", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ],
"args": [ "--", "cds", "run", "--in-memory" ],
"name": "bookshop",
"request": "launch",
"type": "node",
"runtimeExecutable": "npx",
"runtimeArgs": [
"-n"
],
"args": [
"--",
"cds",
"run",
"--in-memory"
],
"cwd": "${workspaceFolder}/packages/bookshop",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
"skipFiles": [
"<node_internals>/**"
]
},
{
"name": "cds run ...", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ],
"args": [ "--", "cds", "run", "--with-mocks", "--in-memory?" ],
"name": "cds run ...",
"request": "launch",
"type": "node",
"runtimeExecutable": "npx",
"runtimeArgs": [
"-n"
],
"args": [
"--",
"cds",
"run",
"--with-mocks",
"--in-memory?"
],
"cwd": "${workspaceFolder}/packages/${input:service}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
"skipFiles": [
"<node_internals>/**"
]
}
],
"inputs": [
@@ -34,4 +61,4 @@
"default": "bookshop"
}
]
}
}

View File

@@ -11,7 +11,7 @@ In SAP Business Application Studio, open a terminal.
Then clone the repo with this specific branch:
```sh
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week3-unit3
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week3-unit4
cd projects/cloud-cap-samples
```

View File

@@ -8,11 +8,7 @@
"lerna": "npx --no-install lerna -v > /dev/null || npm i lerna --no-save",
"install": "(npm -s run lerna) && lerna bootstrap --hoist",
"cleanup": "lerna clean -y && rm -fr node_modules",
"bookshop": "cds watch packages/bookshop",
"bookshop-enhanced": "cds watch packages/bookshop-enhanced",
"reviews-service": "cds watch packages/reviews-service",
"bookstore": "cds watch packages/bookstore",
"media-server": "cds watch packages/media-server"
"bookshop": "cds watch packages/bookshop"
},
"dependencies": {
"@sap/cds": "^3",

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("admin.Component", {
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("admin.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,9 +24,7 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
"sap.fe": {}
}
},
"models": {

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("bookshop.Component", {
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("bookshop.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,9 +24,7 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
"sap.fe": {}
}
},
"models": {

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("orders.Component", {
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("orders.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,9 +24,7 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
"sap.fe": {}
}
},
"models": {

View File

@@ -1,44 +0,0 @@
####### Generated mta.yaml based on template version 0.2.0
####### appName = capire-bookshop
####### language=nodejs; multiTenant=false
####### approuter=
_schema-version: '3.1'
ID: sap.capire-bookshop
version: 1.0.0
description: "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages."
build-parameters:
before-all:
- builder: custom
commands:
- npm install
- cds build/all
parameters:
enable-parallel-deployments: true
modules:
############## SERVER MODULE ##########################
- name: capire-bookshop-srv
type: nodejs
path: gen/srv
properties:
EXIT: 1 # required by deploy.js task to terminate
############################################################
############## SIDECAR MODULE #########################
- name: db
type: hdb
path: gen/db
parameters:
app-name: capire-bookshop-db
requires:
#### Hana and xsuaa resources extracted from CAP configuration ####
############################################################

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,25 @@
{
"name": "@sap/capire-bookshop",
"version": "1.0.0",
"description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.",
"license": "SAP SAMPLE CODE LICENSE",
"dependencies": {
"@sap/cds": "^3",
"express": "^4",
"sqlite3": "^5.0.0"
},
"scripts": {
"start": "cds run --in-memory?",
"watch": "cds watch"
},
"cds": {
"requires": {
"db": {
"kind": "sql"
}
"name": "@sap/capire-bookshop",
"version": "1.0.0",
"description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.",
"license": "SAP SAMPLE CODE LICENSE",
"dependencies": {
"@sap/cds": "^3",
"express": "^4"
},
"scripts": {
"start": "cds run --in-memory?",
"watch": "cds watch"
},
"cds": {
"requires": {
"db": {
"model": [
"db",
"srv"
],
"kind": "sqlite"
}
}
}
}
}

View File

@@ -10,7 +10,7 @@ service AdminService @(_requires:'authenticated-user') {
annotate AdminService.Orders with @odata.draft.enabled;
// annotate AdminService.Books with @odata.draft.enabled;
// Temporary workaround -> cap/issues#3121
// Temporary workaround -> https://github.wdf.sap.corp/cap/issues/issues/3121
extend service AdminService with {
entity OrderItems as select from my.OrderItems;
}

View File

@@ -23,4 +23,4 @@ async function _reduceStock (req) {
`${OrderItems[i].amount} exceeds stock for book #${OrderItems[i].book_ID}`
)
}))
}
}