Compare commits
2 Commits
add/custom
...
key-user-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8df9e624a6 | ||
|
|
379ddc9fb0 |
@@ -1,7 +1,7 @@
|
||||
using { Currency, managed, sap } from '@sap/cds/common';
|
||||
using { Currency, managed, sap, extensible } from '@sap/cds/common';
|
||||
namespace sap.capire.bookshop;
|
||||
|
||||
entity Books : managed {
|
||||
entity Books : managed, extensible {
|
||||
key ID : Integer;
|
||||
title : localized String(111);
|
||||
descr : localized String(1111);
|
||||
@@ -13,7 +13,7 @@ entity Books : managed {
|
||||
image : LargeBinary @Core.MediaType : 'image/png';
|
||||
}
|
||||
|
||||
entity Authors : managed {
|
||||
entity Authors : managed, extensible {
|
||||
key ID : Integer;
|
||||
name : String(111);
|
||||
dateOfBirth : Date;
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
"express": "^4.17.1",
|
||||
"passport": "0.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cds/cds-plugin-openapi": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"genres": "cds serve test/genres.cds",
|
||||
"start": "cds run",
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/* eslint-disable require-await */
|
||||
const cds = require('@sap/cds'), { BuildTaskHandler } = cds.build
|
||||
const cdsdk = require('@sap/cds-dk')
|
||||
|
||||
cds.build.register(class OpenApiHandler extends BuildTaskHandler {
|
||||
static get meta() {
|
||||
return {
|
||||
id: 'openapi',
|
||||
runWith: ['node-cf', 'java-cf'],
|
||||
config: { src: cds.env.folders.srv.replace(/\/$/, '') }
|
||||
}
|
||||
}
|
||||
async clean() {
|
||||
return this.remove('openapi-docs')
|
||||
}
|
||||
async build() {
|
||||
const model = await this.model()
|
||||
const { options } = this.task
|
||||
|
||||
// generate openapi files for all services
|
||||
await Promise.all(cds.linked(model).services.map(service => {
|
||||
const openApi = cdsdk.compile.to.openapi(model, {
|
||||
service: service.name,
|
||||
'openapi:diagram': String(options.diagram) === 'true'
|
||||
})
|
||||
this.write(openApi).to(`openapi-docs/${service.name}.openapi3.json`)
|
||||
}))
|
||||
}
|
||||
})
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "@sap/cds-plugin-openapi",
|
||||
"version": "1.0.0",
|
||||
"description": "OpenAPI service specification build plugin",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@sap/cds-dk": "^4"
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,10 @@
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"flexEnabled": true,
|
||||
"config": {
|
||||
"experimentalCAPScenario": true
|
||||
},
|
||||
"dependencies": {
|
||||
"minUI5Version": "1.81.0",
|
||||
"libs": {
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"flexEnabled": true,
|
||||
"config": {
|
||||
"experimentalCAPScenario": true
|
||||
},
|
||||
"dependencies": {
|
||||
"libs": {
|
||||
"sap.fe.templates": {}
|
||||
|
||||
@@ -10,7 +10,21 @@
|
||||
<script>
|
||||
window["sap-ushell-config"] = {
|
||||
defaultRenderer: "fiori2",
|
||||
applications: {}
|
||||
applications: {},
|
||||
bootstrapPlugins: {
|
||||
RuntimeAuthoringPlugin: {
|
||||
component: "sap.ushell.plugins.rta",
|
||||
config: {
|
||||
validateAppVersion: false,
|
||||
},
|
||||
},
|
||||
PersonalizePlugin: {
|
||||
component: "sap.ushell.plugins.rta-personalize",
|
||||
config: {
|
||||
validateAppVersion: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -22,7 +36,12 @@
|
||||
data-sap-ui-frameOptions="allow"
|
||||
></script>
|
||||
<script>
|
||||
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
|
||||
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"));
|
||||
sap.ui
|
||||
.getCore()
|
||||
.getConfiguration()
|
||||
.setFlexibilityServices([{ connector: "SessionStorageConnector" }]);
|
||||
sap.ui.getCore().getConfiguration().setLanguage("en");
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"extensibility": {
|
||||
"kind": "uiflex"
|
||||
},
|
||||
"auth": {
|
||||
"strategy": "dummy"
|
||||
},
|
||||
|
||||
@@ -13,14 +13,13 @@
|
||||
"@capire/media": "./media",
|
||||
"@capire/orders": "./orders",
|
||||
"@capire/reviews": "./reviews",
|
||||
"@sap/cds": "git+https://github.tools.sap/cap/cds#add/customBuildTaskProviders"
|
||||
"@sap/cds": "^5.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.4",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"chai-subset": "^1.6.0",
|
||||
"sqlite3": "^5",
|
||||
"@cds/cds-plugin-openapi": "./cds-plugin-openapi"
|
||||
"sqlite3": "^5"
|
||||
},
|
||||
"scripts": {
|
||||
"cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules",
|
||||
@@ -31,6 +30,7 @@
|
||||
"media": "cds watch media",
|
||||
"mocha": "npx mocha || echo",
|
||||
"jest": "npx jest",
|
||||
"start": "cds watch fiori",
|
||||
"test": "npm run jest -- --silent",
|
||||
"test:hello": "cd hello && npm test"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user