CF deploy/prod changes
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori/';
|
using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori';
|
||||||
// using { sap.common } from '@sap/cds/common'; //> TODO this creates duplicated definitions
|
|
||||||
|
|
||||||
namespace Z_bookshop.extension;
|
namespace Z_bookshop.extension;
|
||||||
|
|
||||||
@@ -12,7 +11,6 @@ entity Z_SalesRegion: common.CodeList {
|
|||||||
key regionCode : String(11);
|
key regionCode : String(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --- UI ---
|
// --- UI ---
|
||||||
|
|
||||||
annotate orders.Orders : Z_priority with @title : 'Priority';
|
annotate orders.Orders : Z_priority with @title : 'Priority';
|
||||||
|
|||||||
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
24
fiori/app/_router/xs-app.json
Normal file
24
fiori/app/_router/xs-app.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"csrfProtection": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
98
fiori/mta.yaml
Normal file
98
fiori/mta.yaml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
---
|
||||||
|
_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
|
||||||
@@ -6,13 +6,18 @@
|
|||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"@sap/cds-mtxs": "^1",
|
"@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": {
|
||||||
"requires": {
|
"requires": {
|
||||||
"ReviewsService": {
|
"ReviewsService": {
|
||||||
@@ -49,17 +54,33 @@
|
|||||||
"toggles": true,
|
"toggles": true,
|
||||||
"extensibility": true,
|
"extensibility": true,
|
||||||
"cds.xt.ExtensibilityService": {
|
"cds.xt.ExtensibilityService": {
|
||||||
|
"element-prefix": ["Z_"],
|
||||||
"extension-allowlist": [
|
"extension-allowlist": [
|
||||||
{
|
{
|
||||||
"for": ["sap.capire.orders.Orders"],
|
"for": [
|
||||||
|
"sap.capire.orders.Orders"
|
||||||
|
],
|
||||||
"kind": "entity",
|
"kind": "entity",
|
||||||
"new-fields": 2
|
"new-fields": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"for": ["OrdersService"],
|
"for": [
|
||||||
|
"OrdersService"
|
||||||
|
],
|
||||||
"new-entities": 2
|
"new-entities": 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"[production]": {
|
||||||
|
"auth": {
|
||||||
|
"kind": "xsuaa"
|
||||||
|
},
|
||||||
|
"db": {
|
||||||
|
"kind": "hana-mt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"approuter": {
|
||||||
|
"kind": "cloudfoundry"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hana": {
|
"hana": {
|
||||||
|
|||||||
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"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user