From 480a16dfa248f6d6caabd43fbda127440aa9263b Mon Sep 17 00:00:00 2001 From: Vladislav Leonkev Date: Fri, 20 Dec 2024 15:52:13 +0100 Subject: [PATCH] remove bookshop service, rename app router directory --- app-router/bookshop | 1 + app-router/orders | 1 + {app/router => app-router}/package-lock.json | 0 {app/router => app-router}/package.json | 0 app-router/reviews | 1 + {app/router => app-router}/xs-app.json | 24 +--- app/router/bookshop | 1 - app/router/orders | 1 - app/router/reviews | 1 - {bookshop => bookstore}/srv/fiori.cds | 0 bookstore/srv/mashup.js | 3 +- db/src/.hdiconfig | 139 ------------------- db/undeploy.json | 7 - mta.yaml | 30 +--- 14 files changed, 8 insertions(+), 201 deletions(-) create mode 120000 app-router/bookshop create mode 120000 app-router/orders rename {app/router => app-router}/package-lock.json (100%) rename {app/router => app-router}/package.json (100%) create mode 120000 app-router/reviews rename {app/router => app-router}/xs-app.json (72%) delete mode 120000 app/router/bookshop delete mode 120000 app/router/orders delete mode 120000 app/router/reviews rename {bookshop => bookstore}/srv/fiori.cds (100%) delete mode 100644 db/src/.hdiconfig delete mode 100644 db/undeploy.json diff --git a/app-router/bookshop b/app-router/bookshop new file mode 120000 index 00000000..a1eee5cc --- /dev/null +++ b/app-router/bookshop @@ -0,0 +1 @@ +../bookshop/app/vue \ No newline at end of file diff --git a/app-router/orders b/app-router/orders new file mode 120000 index 00000000..b386dc38 --- /dev/null +++ b/app-router/orders @@ -0,0 +1 @@ +../orders/app/orders \ No newline at end of file diff --git a/app/router/package-lock.json b/app-router/package-lock.json similarity index 100% rename from app/router/package-lock.json rename to app-router/package-lock.json diff --git a/app/router/package.json b/app-router/package.json similarity index 100% rename from app/router/package.json rename to app-router/package.json diff --git a/app-router/reviews b/app-router/reviews new file mode 120000 index 00000000..6842f93a --- /dev/null +++ b/app-router/reviews @@ -0,0 +1 @@ +../reviews/app/vue \ No newline at end of file diff --git a/app/router/xs-app.json b/app-router/xs-app.json similarity index 72% rename from app/router/xs-app.json rename to app-router/xs-app.json index 086dae6f..25827d89 100644 --- a/app/router/xs-app.json +++ b/app-router/xs-app.json @@ -14,19 +14,19 @@ { "source": "^/admin/(.*)$", "target": "/admin/$1", - "destination": "bookshop-api", + "destination": "bookstore-api", "csrfProtection": true }, { "source": "^/browse/(.*)$", "target": "/browse/$1", - "destination": "bookshop-api", + "destination": "bookstore-api", "csrfProtection": true }, { "source": "^/user/(.*)$", "target": "/user/$1", - "destination": "bookshop-api", + "destination": "bookstore-api", "csrfProtection": true }, { @@ -41,24 +41,6 @@ "destination": "reviews-api", "csrfProtection": true }, - { - "source": "^/mashup/admin/(.*)$", - "target": "/admin/$1", - "destination": "bookstore-api", - "csrfProtection": true - }, - { - "source": "^/mashup/browse/(.*)$", - "target": "/browse/$1", - "destination": "bookstore-api", - "csrfProtection": true - }, - { - "source": "^/mashup/user/(.*)$", - "target": "/user/$1", - "destination": "bookstore-api", - "csrfProtection": true - }, { "source": "^(.*)$", "target": "$1", diff --git a/app/router/bookshop b/app/router/bookshop deleted file mode 120000 index eb3ba6dd..00000000 --- a/app/router/bookshop +++ /dev/null @@ -1 +0,0 @@ -../../bookshop/app/vue \ No newline at end of file diff --git a/app/router/orders b/app/router/orders deleted file mode 120000 index 9967c858..00000000 --- a/app/router/orders +++ /dev/null @@ -1 +0,0 @@ -../../orders/app/orders \ No newline at end of file diff --git a/app/router/reviews b/app/router/reviews deleted file mode 120000 index df0bc9ba..00000000 --- a/app/router/reviews +++ /dev/null @@ -1 +0,0 @@ -../../reviews/app/vue \ No newline at end of file diff --git a/bookshop/srv/fiori.cds b/bookstore/srv/fiori.cds similarity index 100% rename from bookshop/srv/fiori.cds rename to bookstore/srv/fiori.cds diff --git a/bookstore/srv/mashup.js b/bookstore/srv/mashup.js index 9a6f742b..fb4daae0 100644 --- a/bookstore/srv/mashup.js +++ b/bookstore/srv/mashup.js @@ -26,8 +26,7 @@ module.exports = async()=>{ // called by server.js // // Create an order with the OrdersService when CatalogService signals a new order // - const messaging = await cds.connect.to('messaging') - messaging.on('CatalogService.OrderedBook', async (msg) => { + CatalogService.on ('OrderedBook', async (msg) => { const { book, quantity, buyer } = msg.data const { title, price } = await db.read (Books, book, b => { b.title, b.price }) return OrdersService.create ('OrdersNoDraft').entries({ diff --git a/db/src/.hdiconfig b/db/src/.hdiconfig deleted file mode 100644 index 03673f20..00000000 --- a/db/src/.hdiconfig +++ /dev/null @@ -1,139 +0,0 @@ -{ - "file_suffixes": { - "csv": { - "plugin_name": "com.sap.hana.di.tabledata.source" - }, - "hdbafllangprocedure": { - "plugin_name": "com.sap.hana.di.afllangprocedure" - }, - "hdbanalyticprivilege": { - "plugin_name": "com.sap.hana.di.analyticprivilege" - }, - "hdbcalculationview": { - "plugin_name": "com.sap.hana.di.calculationview" - }, - "hdbcollection": { - "plugin_name": "com.sap.hana.di.collection" - }, - "hdbconstraint": { - "plugin_name": "com.sap.hana.di.constraint" - }, - "hdbdropcreatetable": { - "plugin_name": "com.sap.hana.di.dropcreatetable" - }, - "hdbflowgraph": { - "plugin_name": "com.sap.hana.di.flowgraph" - }, - "hdbfunction": { - "plugin_name": "com.sap.hana.di.function" - }, - "hdbgraphworkspace": { - "plugin_name": "com.sap.hana.di.graphworkspace" - }, - "hdbhadoopmrjob": { - "plugin_name": "com.sap.hana.di.virtualfunctionpackage.hadoop" - }, - "hdbindex": { - "plugin_name": "com.sap.hana.di.index" - }, - "hdblibrary": { - "plugin_name": "com.sap.hana.di.library" - }, - "hdbmigrationtable": { - "plugin_name": "com.sap.hana.di.table.migration" - }, - "hdbprocedure": { - "plugin_name": "com.sap.hana.di.procedure" - }, - "hdbprojectionview": { - "plugin_name": "com.sap.hana.di.projectionview" - }, - "hdbprojectionviewconfig": { - "plugin_name": "com.sap.hana.di.projectionview.config" - }, - "hdbreptask": { - "plugin_name": "com.sap.hana.di.reptask" - }, - "hdbresultcache": { - "plugin_name": "com.sap.hana.di.resultcache" - }, - "hdbrole": { - "plugin_name": "com.sap.hana.di.role" - }, - "hdbroleconfig": { - "plugin_name": "com.sap.hana.di.role.config" - }, - "hdbsearchruleset": { - "plugin_name": "com.sap.hana.di.searchruleset" - }, - "hdbsequence": { - "plugin_name": "com.sap.hana.di.sequence" - }, - "hdbstatistics": { - "plugin_name": "com.sap.hana.di.statistics" - }, - "hdbstructuredprivilege": { - "plugin_name": "com.sap.hana.di.structuredprivilege" - }, - "hdbsynonym": { - "plugin_name": "com.sap.hana.di.synonym" - }, - "hdbsynonymconfig": { - "plugin_name": "com.sap.hana.di.synonym.config" - }, - "hdbsystemversioning": { - "plugin_name": "com.sap.hana.di.systemversioning" - }, - "hdbtable": { - "plugin_name": "com.sap.hana.di.table" - }, - "hdbtabledata": { - "plugin_name": "com.sap.hana.di.tabledata" - }, - "hdbtabletype": { - "plugin_name": "com.sap.hana.di.tabletype" - }, - "hdbtrigger": { - "plugin_name": "com.sap.hana.di.trigger" - }, - "hdbview": { - "plugin_name": "com.sap.hana.di.view" - }, - "hdbvirtualfunction": { - "plugin_name": "com.sap.hana.di.virtualfunction" - }, - "hdbvirtualfunctionconfig": { - "plugin_name": "com.sap.hana.di.virtualfunction.config" - }, - "hdbvirtualpackagehadoop": { - "plugin_name": "com.sap.hana.di.virtualpackage.hadoop" - }, - "hdbvirtualpackagesparksql": { - "plugin_name": "com.sap.hana.di.virtualpackage.sparksql" - }, - "hdbvirtualprocedure": { - "plugin_name": "com.sap.hana.di.virtualprocedure" - }, - "hdbvirtualprocedureconfig": { - "plugin_name": "com.sap.hana.di.virtualprocedure.config" - }, - "hdbvirtualtable": { - "plugin_name": "com.sap.hana.di.virtualtable" - }, - "hdbvirtualtableconfig": { - "plugin_name": "com.sap.hana.di.virtualtable.config" - }, - "properties": { - "plugin_name": "com.sap.hana.di.tabledata.properties" - }, - "tags": { - "plugin_name": "com.sap.hana.di.tabledata.properties" - }, - "txt": { - "plugin_name": "com.sap.hana.di.copyonly" - }, - "hdbeshconfig": { - "plugin_name": "com.sap.hana.di.eshconfig" - } - } -} diff --git a/db/undeploy.json b/db/undeploy.json deleted file mode 100644 index aa14b9f1..00000000 --- a/db/undeploy.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "src/gen/**/*.hdbview", - "src/gen/**/*.hdbindex", - "src/gen/**/*.hdbconstraint", - "src/gen/**/*_drafts.hdbtable", - "src/gen/**/*.hdbcalculationview" -] diff --git a/mta.yaml b/mta.yaml index 9932a60a..12ffdad3 100644 --- a/mta.yaml +++ b/mta.yaml @@ -10,31 +10,10 @@ build-parameters: commands: - npm ci - npx cds build --for hana --production --ws - - npx cds build ./bookshop --for nodejs --production --ws-pack - npx cds build ./orders --for nodejs --production --ws-pack - npx cds build ./reviews --for nodejs --production --ws-pack - npx cds build ./bookstore --for nodejs --production --ws-pack modules: - - name: bookshop-srv - type: nodejs - path: bookshop/gen/srv - parameters: - buildpack: nodejs_buildpack - readiness-health-check-type: http - readiness-health-check-http-endpoint: /health - disk-quota: 256M - memory: 256M - build-parameters: - builder: npm - provides: - - name: bookshop-api - properties: - srv-url: ${default-url} - requires: - - name: samples-messaging - - name: samples-db - - name: samples-auth - - name: orders-srv type: nodejs path: orders/gen/srv @@ -106,18 +85,12 @@ modules: - name: samples type: approuter.nodejs - path: app/router + path: app-router parameters: keep-existing-routes: true disk-quota: 256M memory: 256M requires: - - name: bookshop-api - group: destinations - properties: - name: bookshop-api # must be used in xs-app.json as well - url: ~{srv-url} - forwardAuthToken: true - name: orders-api group: destinations properties: @@ -141,7 +114,6 @@ modules: - name: destination-content type: com.sap.application.content requires: - - name: bookshop-api - name: orders-api - name: reviews-api - name: bookstore-api