Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c91e6802ac | ||
|
|
fdd1d86ac7 | ||
|
|
f50afdbd69 | ||
|
|
4bdad98165 | ||
|
|
5289f1a8fd | ||
|
|
a17458b572 | ||
|
|
54db241e28 | ||
|
|
8bcc91aa23 | ||
|
|
780a81229d | ||
|
|
0a17fbcb30 | ||
|
|
7819ad0bad | ||
|
|
06b96d0726 | ||
|
|
07a6540477 | ||
|
|
69403de663 | ||
|
|
a5b54b53cf | ||
|
|
c6b8cbfd0e | ||
|
|
21be9d1bbf | ||
|
|
dff3dd4b89 | ||
|
|
66007e2952 | ||
|
|
1e78d115cc | ||
|
|
5bda368169 | ||
|
|
ea989d8496 | ||
|
|
692ea3ddd2 |
@@ -1,27 +1,34 @@
|
|||||||
const { exec } = require ('child_process')
|
const { exec, execSync } = require ('child_process')
|
||||||
const isWin = process.platform === 'win32'
|
const isWin = process.platform === 'win32'
|
||||||
const express = require ('express')
|
const express = require ('express')
|
||||||
const fs = require ('fs')
|
const fs = require ('fs')
|
||||||
|
const { dirname, relative } = require('path')
|
||||||
|
const axios = require('axios')
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
const { PORT=4444 } = process.env
|
|
||||||
const [,,port=PORT,scope='@capire'] = process.argv
|
|
||||||
const cwd = __dirname
|
const cwd = __dirname
|
||||||
|
const port=process.env.PORT || 4444
|
||||||
|
let scopes = process.argv.filter(a => a.startsWith('@'))
|
||||||
|
if (!scopes.length) scopes = ['@capire']
|
||||||
|
|
||||||
// clean up on start (exit handler might not complete on Windows)
|
// clean up on start (exit handler might not complete on Windows)
|
||||||
exec(isWin ? 'del *.tgz' : 'rm *.tgz', {cwd})
|
exec(isWin ? 'del *.tgz' : 'rm *.tgz', {cwd})
|
||||||
|
|
||||||
|
|
||||||
app.use('/-/:tarball', (req,res,next) => {
|
app.use('/-/:tarball', async (req,res,next) => {
|
||||||
console.debug ('GET', req.params)
|
console.debug ('GET', req.params)
|
||||||
try {
|
try {
|
||||||
const { tarball } = req.params
|
const { tarball } = req.params
|
||||||
const pkgFull = tarball.substring(0, tarball.lastIndexOf('-'))
|
const pkgFull = tarball.substring(0, tarball.lastIndexOf('-'))
|
||||||
const [, pkg ] = /^\w+-(.+)/.exec(pkgFull)
|
const scope = '@'+pkgFull.substring(0, pkgFull.indexOf('-'))
|
||||||
|
const pkg = pkgFull.substring(pkgFull.indexOf('-')+1)
|
||||||
fs.lstat(tarball,(err => {
|
fs.lstat(tarball,(err => {
|
||||||
if (err) console.debug (`npm pack ../${pkg}`)
|
if (err) { // no tgz yet
|
||||||
if (err) exec(`npm pack ../${pkg}`,{cwd},next)
|
const loc = dirname(require.resolve(`${scope}/${pkg}/package.json`))
|
||||||
else next()
|
console.debug (`npm pack ${relative(cwd, loc)}`)
|
||||||
|
exec(`npm pack ${loc}`,{cwd},next)
|
||||||
|
}
|
||||||
|
else next() //> express.static below
|
||||||
}))
|
}))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@@ -31,14 +38,20 @@ app.use('/-/:tarball', (req,res,next) => {
|
|||||||
|
|
||||||
app.use('/-', express.static(__dirname))
|
app.use('/-', express.static(__dirname))
|
||||||
|
|
||||||
app.get('/*', (req,res)=>{
|
app.get('/*', async (req,res)=>{
|
||||||
const urlRegex = /^\/(@[\w-]+)\/(.+)/
|
const urlRegex = /^\/(@[\w-]+)\/(.+)/
|
||||||
const url = decodeURIComponent(req.url)
|
const url = decodeURIComponent(req.url)
|
||||||
console.debug ('GET',url)
|
console.debug ('GET',url)
|
||||||
try {
|
try {
|
||||||
if (!urlRegex.test(url)) return res.sendStatus(404)
|
if (!urlRegex.test(url)) return res.sendStatus(404)
|
||||||
const [, scpe, pkg ] = urlRegex.exec(url)
|
const [, scpe, pkg ] = urlRegex.exec(url)
|
||||||
const package = require (`${scpe}/${pkg}/package.json`)
|
const packageName = `${scpe}/${pkg}`
|
||||||
|
|
||||||
|
// delegate to default registry for @sap/non-cds packages
|
||||||
|
if (scpe === ('@sap') && !packageName.startsWith('@sap/cds')) {
|
||||||
|
return forward(req, res)
|
||||||
|
}
|
||||||
|
const package = require (`${packageName}/package.json`)
|
||||||
const tarball = `${scpe.slice(1)}-${pkg}-${package.version}.tgz`
|
const tarball = `${scpe.slice(1)}-${pkg}-${package.version}.tgz`
|
||||||
// https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
|
// https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
|
||||||
res.json({
|
res.json({
|
||||||
@@ -53,6 +66,8 @@ app.get('/*', (req,res)=>{
|
|||||||
"dist": {
|
"dist": {
|
||||||
"tarball": `${server.url}/-/${tarball}`
|
"tarball": `${server.url}/-/${tarball}`
|
||||||
},
|
},
|
||||||
|
dependencies: package.dependencies,
|
||||||
|
devDependencies: package.devDependencies
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -64,15 +79,32 @@ app.get('/*', (req,res)=>{
|
|||||||
|
|
||||||
const server = app.listen(port, ()=>{
|
const server = app.listen(port, ()=>{
|
||||||
const url = server.url = `http://localhost:${server.address().port}`
|
const url = server.url = `http://localhost:${server.address().port}`
|
||||||
console.log (`npm set ${scope}:registry=${url}`)
|
|
||||||
exec(`npm set ${scope}:registry=${url}`)
|
for (const scope of scopes) {
|
||||||
console.log (`${scope} registry listening on ${url}`)
|
console.log (`npm set ${scope}:registry=${url}`)
|
||||||
|
execSync(`npm set ${scope}:registry=${url}`)
|
||||||
|
}
|
||||||
|
console.log (`registry listening on ${url}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const _exit = ()=>{
|
const _exit = ()=>{
|
||||||
server.close()
|
server.close()
|
||||||
exec(`npm conf rm "${scope}:registry"`, ()=> { process.exit() })
|
for (const scope of scopes) {
|
||||||
|
execSync(`npm conf rm "${scope}:registry"`)
|
||||||
|
}
|
||||||
|
process.exit()
|
||||||
|
}
|
||||||
|
|
||||||
|
async function forward(req, res) {
|
||||||
|
try {
|
||||||
|
const url = `https://registry.npmjs.org${req.url}`
|
||||||
|
const resAxios = await axios.get(url)
|
||||||
|
console.debug('->', decodeURI(url), resAxios.status)
|
||||||
|
return res.json(resAxios.data)
|
||||||
|
} catch (e) {
|
||||||
|
return res.sendStatus(e.response.status)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
process.on ('SIGTERM',_exit)
|
process.on ('SIGTERM',_exit)
|
||||||
|
|||||||
11
fiori-ext/.vscode/settings.json
vendored
Normal file
11
fiori-ext/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"eslint.validate": [
|
||||||
|
"cds",
|
||||||
|
"csn",
|
||||||
|
"csv",
|
||||||
|
"csv",
|
||||||
|
"csv (semicolon)",
|
||||||
|
"tsv",
|
||||||
|
"tab"
|
||||||
|
]
|
||||||
|
}
|
||||||
21
fiori-ext/README.md
Normal file
21
fiori-ext/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Welcome to your Extension Project for the CAP Bookshop Fiori App
|
||||||
|
|
||||||
|
It contains these folders and files, following our recommended project layout:
|
||||||
|
|
||||||
|
| File or Folder | Purpose |
|
||||||
|
|----------------|------------------------------------|
|
||||||
|
| `app/` | content for UI frontends goes here |
|
||||||
|
| `test/` | contet for local tests |
|
||||||
|
| `package.json` | project metadata and configuration |
|
||||||
|
| `readme.md` | this getting started guide |
|
||||||
|
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
- Runs `cds login ...`
|
||||||
|
- Runs `cds pull ...`
|
||||||
|
|
||||||
|
|
||||||
|
## Learn More
|
||||||
|
|
||||||
|
Learn more at https://cap.cloud.sap/docs/get-started/.
|
||||||
25
fiori-ext/app/extension.cds
Normal file
25
fiori-ext/app/extension.cds
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using { OrdersService, sap, sap.capire.orders.Orders } from '@capire/fiori';
|
||||||
|
namespace x_bookshop.extension;
|
||||||
|
|
||||||
|
// Adding 2 new fields for Orders
|
||||||
|
extend Orders with {
|
||||||
|
x_priority : String @assert.range enum {high; medium; low} default 'medium' ;
|
||||||
|
x_salesRegion : Association to SalesRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Value Help for x_salesRegion */
|
||||||
|
entity SalesRegion : sap.common.CodeList {
|
||||||
|
key code : String(11);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- UI ---
|
||||||
|
|
||||||
|
annotate Orders:x_priority with @title : 'Priority';
|
||||||
|
annotate SalesRegion:name with @title : 'Sales Region';
|
||||||
|
|
||||||
|
annotate OrdersService.Orders with @UI.LineItem : [
|
||||||
|
... up to { Value: OrderNo },
|
||||||
|
{ Value : x_priority },
|
||||||
|
{ Value : x_salesRegion.name },
|
||||||
|
...
|
||||||
|
];
|
||||||
49
fiori-ext/package.json
Normal file
49
fiori-ext/package.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "@capire/fiori-ext",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "A simple CAP project.",
|
||||||
|
"repository": "<Add your repository here>",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@sap/cds": "^6"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"sqlite3": "^5.0.4",
|
||||||
|
"@sap/eslint-plugin-cds": "^2.5.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "cds run"
|
||||||
|
},
|
||||||
|
"cds": {
|
||||||
|
"extends": "@capire/fiori"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@sap/cds/recommended"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"es2020": true,
|
||||||
|
"node": true,
|
||||||
|
"jest": true,
|
||||||
|
"mocha": true
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"SELECT": true,
|
||||||
|
"INSERT": true,
|
||||||
|
"UPDATE": true,
|
||||||
|
"DELETE": true,
|
||||||
|
"CREATE": true,
|
||||||
|
"DROP": true,
|
||||||
|
"CDL": true,
|
||||||
|
"CQL": true,
|
||||||
|
"CXL": true,
|
||||||
|
"cds": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-console": "off",
|
||||||
|
"require-atomic-updates": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
fiori-ext/test/data/sap.capire.orders-Orders.csv
Normal file
3
fiori-ext/test/data/sap.capire.orders-Orders.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_priority;Z_SalesRegion_regionCode
|
||||||
|
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;high;AMER
|
||||||
|
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;low;APJ
|
||||||
|
4
fiori-ext/test/data/x_bookshop.extension-SalesRegion.csv
Normal file
4
fiori-ext/test/data/x_bookshop.extension-SalesRegion.csv
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
code;name;descr
|
||||||
|
AMER;Americas;North, Central and South America
|
||||||
|
EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa
|
||||||
|
APJ;Asia Pacific and Japan;Asia Pacific and Japan
|
||||||
|
12
fiori/app/_router/package.json
Normal file
12
fiori/app/_router/package.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "approuter",
|
||||||
|
"dependencies": {
|
||||||
|
"@sap/approuter": "^11.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^16"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "node node_modules/@sap/approuter/approuter.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
23
fiori/app/_router/xs-app.json
Normal file
23
fiori/app/_router/xs-app.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"authenticationMethod": "route",
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"source": "^/app/(.*)$",
|
||||||
|
"target": "$1",
|
||||||
|
"localDir": ".",
|
||||||
|
"authenticationType": "xsuaa",
|
||||||
|
"cacheControl": "no-cache, no-store, must-revalidate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "^/-/cds/.*",
|
||||||
|
"destination": "mtx-api",
|
||||||
|
"authenticationType": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "^/(.*)$",
|
||||||
|
"target": "$1",
|
||||||
|
"destination": "srv-api",
|
||||||
|
"authenticationType": "xsuaa"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
24
fiori/app/xs-app.json
Normal file
24
fiori/app/xs-app.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"authenticationMethod": "route",
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"source": "^/-/cds/.*",
|
||||||
|
"destination": "mtx-api",
|
||||||
|
"authenticationType": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "^/app/(.*)$",
|
||||||
|
"target": "$1",
|
||||||
|
"localDir": ".",
|
||||||
|
"authenticationType": "xsuaa",
|
||||||
|
"cacheControl": "no-cache, no-store, must-revalidate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "^/(.*)$",
|
||||||
|
"target": "$1",
|
||||||
|
"destination": "srv-api",
|
||||||
|
"authenticationType": "xsuaa",
|
||||||
|
"csrfProtection": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
5
fiori/db/data/sap.capire.bookshop-Books_texts.csv
Normal file
5
fiori/db/data/sap.capire.bookshop-Books_texts.csv
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
ID_texts;ID;locale;title;descr
|
||||||
|
201_de;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.
|
||||||
|
201_fr;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.
|
||||||
|
207_de;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
|
||||||
|
207_fr;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.
|
||||||
|
@@ -2,9 +2,14 @@
|
|||||||
// Add Author.age and .lifetime with a DB-specific function
|
// Add Author.age and .lifetime with a DB-specific function
|
||||||
//
|
//
|
||||||
|
|
||||||
using { AdminService } from '@capire/bookshop';
|
using { AdminService, sap.common } from '@capire/bookshop';
|
||||||
|
|
||||||
extend projection AdminService.Authors with {
|
extend projection AdminService.Authors with {
|
||||||
YEARS_BETWEEN(dateOfBirth, dateOfDeath) as age: Integer,
|
YEARS_BETWEEN(dateOfBirth, dateOfDeath) as age: Integer,
|
||||||
YEAR(dateOfBirth) || ' – ' || YEAR(dateOfDeath) as lifetime : String
|
YEAR(dateOfBirth) || ' – ' || YEAR(dateOfDeath) as lifetime : String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Workaround: include Countries table because csv files point to it
|
||||||
|
// TODO fix by ignoring hdbtabledata generation for unused entities
|
||||||
|
annotate common.Countries with @cds.persistence.skip : false;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
using from './db/common';
|
|
||||||
97
fiori/mta.yaml
Normal file
97
fiori/mta.yaml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
_schema-version: '3.1'
|
||||||
|
ID: capire.fiori
|
||||||
|
version: 1.0.0
|
||||||
|
description: "fiori"
|
||||||
|
parameters:
|
||||||
|
enable-parallel-deployments: true
|
||||||
|
build-parameters:
|
||||||
|
before-all:
|
||||||
|
- builder: custom
|
||||||
|
commands:
|
||||||
|
- npx -p @sap/cds-dk cds build --production
|
||||||
|
|
||||||
|
modules:
|
||||||
|
- name: fiori-srv
|
||||||
|
type: nodejs
|
||||||
|
path: gen/srv
|
||||||
|
parameters:
|
||||||
|
buildpack: nodejs_buildpack
|
||||||
|
build-parameters:
|
||||||
|
builder: npm
|
||||||
|
provides:
|
||||||
|
- name: srv-api # required by consumers of CAP services (e.g. approuter)
|
||||||
|
properties:
|
||||||
|
srv-url: ${default-url}
|
||||||
|
- name: mtx-api # potentially required by approuter
|
||||||
|
properties:
|
||||||
|
mtx-url: ${default-url}
|
||||||
|
requires:
|
||||||
|
- name: fiori-db
|
||||||
|
- name: fiori-registry
|
||||||
|
- name: fiori-auth
|
||||||
|
- name: app-api
|
||||||
|
properties:
|
||||||
|
SUBSCRIPTION_URL: ~{app-protocol}://\${tenant_subdomain}-~{app-uri}
|
||||||
|
|
||||||
|
- name: fiori
|
||||||
|
type: approuter.nodejs
|
||||||
|
path: app/_router # from cds.env.folders. Consider also cds.env.build.target -> gen/app
|
||||||
|
parameters:
|
||||||
|
keep-existing-routes: true
|
||||||
|
disk-quota: 256M
|
||||||
|
memory: 256M
|
||||||
|
properties:
|
||||||
|
TENANT_HOST_PATTERN: "^(.*)-${default-uri}"
|
||||||
|
requires:
|
||||||
|
- name: srv-api
|
||||||
|
group: destinations
|
||||||
|
properties:
|
||||||
|
name: srv-api # must be used in xs-app.json as well
|
||||||
|
url: ~{srv-url}
|
||||||
|
forwardAuthToken: true
|
||||||
|
- name: mtx-api
|
||||||
|
group: destinations
|
||||||
|
properties:
|
||||||
|
name: mtx-api # must be used in xs-app.json as well
|
||||||
|
url: ~{mtx-url}
|
||||||
|
- name: fiori-auth
|
||||||
|
provides:
|
||||||
|
- name: app-api
|
||||||
|
properties:
|
||||||
|
app-protocol: ${protocol}
|
||||||
|
app-uri: ${default-uri}
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- name: fiori-db
|
||||||
|
type: org.cloudfoundry.managed-service
|
||||||
|
parameters:
|
||||||
|
service: service-manager
|
||||||
|
service-plan: container
|
||||||
|
- name: fiori-registry
|
||||||
|
type: org.cloudfoundry.managed-service
|
||||||
|
requires:
|
||||||
|
- name: mtx-api
|
||||||
|
parameters:
|
||||||
|
service: saas-registry
|
||||||
|
service-plan: application
|
||||||
|
config:
|
||||||
|
xsappname: fiori-${org}-${space}
|
||||||
|
appName: fiori-${org}-${space}
|
||||||
|
displayName: fiori
|
||||||
|
description: A simple CAP project.
|
||||||
|
category: 'Category'
|
||||||
|
appUrls:
|
||||||
|
getDependencies: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/dependencies
|
||||||
|
onSubscription: ~{mtx-api/mtx-url}/-/cds/saas-provisioning/tenant/{tenantId}
|
||||||
|
onSubscriptionAsync: false
|
||||||
|
onUnSubscriptionAsync: false
|
||||||
|
callbackTimeoutMillis: 300000
|
||||||
|
- name: fiori-auth
|
||||||
|
type: org.cloudfoundry.managed-service
|
||||||
|
parameters:
|
||||||
|
service: xsuaa
|
||||||
|
service-plan: application
|
||||||
|
path: ./xs-security.json
|
||||||
|
config:
|
||||||
|
xsappname: fiori-${org}-${space}
|
||||||
|
tenant-mode: shared
|
||||||
@@ -4,15 +4,24 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capire/bookstore": "*",
|
"@capire/bookstore": "*",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
|
"@sap/cds-mtxs": "^1",
|
||||||
"@sap/cds-odata-v2-adapter-proxy": "^1.9.0",
|
"@sap/cds-odata-v2-adapter-proxy": "^1.9.0",
|
||||||
|
"@sap/xssec": "^3",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
|
"hdb": "^0.19.5",
|
||||||
"passport": ">=0.4.1"
|
"passport": ">=0.4.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cds run --in-memory?",
|
"start": "cds run --in-memory?",
|
||||||
"watch": "cds watch"
|
"watch": "cds watch"
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^16"
|
||||||
|
},
|
||||||
"cds": {
|
"cds": {
|
||||||
|
"features": {
|
||||||
|
"deploy_data_onconflict": "replace"
|
||||||
|
},
|
||||||
"requires": {
|
"requires": {
|
||||||
"ReviewsService": {
|
"ReviewsService": {
|
||||||
"kind": "odata",
|
"kind": "odata",
|
||||||
@@ -34,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"db": {
|
"db": {
|
||||||
"kind": "sql"
|
"kind": "sql-mt"
|
||||||
},
|
},
|
||||||
"db-ext": {
|
"db-ext": {
|
||||||
"[development]": {
|
"[development]": {
|
||||||
@@ -43,10 +52,41 @@
|
|||||||
"[production]": {
|
"[production]": {
|
||||||
"model": "db/hana"
|
"model": "db/hana"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"multitenancy": true,
|
||||||
|
"toggles": true,
|
||||||
|
"extensibility": true,
|
||||||
|
"cds.xt.ExtensibilityService": {
|
||||||
|
"element-prefix": [
|
||||||
|
"x_"
|
||||||
|
],
|
||||||
|
"extension-allowlist": [
|
||||||
|
{
|
||||||
|
"for": [
|
||||||
|
"sap.capire.orders"
|
||||||
|
],
|
||||||
|
"kind": "entity",
|
||||||
|
"new-fields": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"for": [
|
||||||
|
"OrdersService"
|
||||||
|
],
|
||||||
|
"new-entities": 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"[production]": {
|
||||||
|
"auth": {
|
||||||
|
"kind": "xsuaa"
|
||||||
|
},
|
||||||
|
"db": {
|
||||||
|
"kind": "hana-mt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"approuter": {
|
||||||
|
"kind": "cloudfoundry"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"hana": {
|
|
||||||
"deploy-format": "hdbtable"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,4 +5,11 @@ const proxy = require('@sap/cds-odata-v2-adapter-proxy')
|
|||||||
const proxyOpts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
|
const proxyOpts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
|
||||||
cds.on('bootstrap', app => app.use(proxy(proxyOpts)))
|
cds.on('bootstrap', app => app.use(proxy(proxyOpts)))
|
||||||
|
|
||||||
module.exports = require('@capire/bookstore/server.js')
|
module.exports = require('@capire/bookstore/server.js')
|
||||||
|
|
||||||
|
// For didactic reasons in capire, run below services embedded
|
||||||
|
// TODO find a better way to switch this
|
||||||
|
if (cds.requires.multitenancy) {
|
||||||
|
delete cds.env.requires.OrdersService
|
||||||
|
delete cds.env.requires.ReviewsService
|
||||||
|
}
|
||||||
1
fiori/srv/index.cds
Normal file
1
fiori/srv/index.cds
Normal file
@@ -0,0 +1 @@
|
|||||||
|
using from '@capire/bookstore';
|
||||||
51
fiori/xs-security.json
Normal file
51
fiori/xs-security.json
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"scopes": [
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.admin",
|
||||||
|
"description": "admin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.mtcallback",
|
||||||
|
"description": "Subscription via SaaS Registry",
|
||||||
|
"grant-as-authority-to-apps": [
|
||||||
|
"$XSAPPNAME(application,sap-provisioning,tenant-onboarding)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.cds.Subscriber",
|
||||||
|
"description": "Subscribe to applications"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.cds.ExtensionDeveloper",
|
||||||
|
"description": "Extend CAP applications via extension projects"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "$XSAPPNAME.cds.UIFlexDeveloper",
|
||||||
|
"description": "Extend CAP applications via UIFlex extensibility"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": [],
|
||||||
|
"role-templates": [
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"description": "admin",
|
||||||
|
"scope-references": [
|
||||||
|
"$XSAPPNAME.admin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ExtensionDeveloper",
|
||||||
|
"description": "Extension development including UIFlex extensibility",
|
||||||
|
"scope-references": [
|
||||||
|
"$XSAPPNAME.cds.ExtensionDeveloper",
|
||||||
|
"$XSAPPNAME.cds.UIFlexDeveloper"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"authorities-inheritance": false,
|
||||||
|
"authorities": [
|
||||||
|
"$XSAPPNAME.cds.Subscriber",
|
||||||
|
"$XSAPPNAME.cds.ExtensionDeveloper",
|
||||||
|
"$XSAPPNAME.cds.UIFlexDeveloper"
|
||||||
|
]
|
||||||
|
}
|
||||||
2891
package-lock.json
generated
2891
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
subject;rating;reviewer;title;text
|
ID;subject;rating;reviewer;title;text
|
||||||
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.
|
5de47328-2ad2-4449-bb8c-e4000586b687;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.
|
||||||
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.
|
f77ea7a8-01c8-469d-bf9e-80988758a2ee;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.
|
||||||
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.
|
6b7ee8c9-0a18-4716-b333-eb95b7570f4e;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.
|
||||||
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.
|
10403669-7e56-4668-bfb0-2071bbc947f3;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.
|
||||||
|
Reference in New Issue
Block a user