@sap/cds-dk 7.9.5 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2116 -0
- package/bin/add.js +18 -52
- package/bin/bind.js +2 -2
- package/bin/build.js +29 -4
- package/bin/cds.js +23 -11
- package/bin/compile/index.js +7 -6
- package/bin/completion/index.js +70 -46
- package/bin/completion/scripts/cds-bash.sh +4 -1
- package/bin/completion/scripts/cds-fish.fish +13 -0
- package/bin/completion/scripts/cds-ps.ps1 +2 -1
- package/bin/completion/scripts/cds-zsh.sh +2 -1
- package/bin/deploy/index.js +6 -5
- package/bin/deploy/to-sqlite.js +2 -2
- package/bin/extend.js +19 -50
- package/bin/help.js +2 -2
- package/bin/init.js +10 -77
- package/bin/login.js +13 -5
- package/bin/migrate.js +1 -1
- package/bin/pull.js +11 -0
- package/bin/repl.js +3 -0
- package/bin/test.js +5 -0
- package/bin/version.js +7 -7
- package/bin/watch.js +1 -10
- package/lib/bind/KubernetesApiAccessor.js +10 -9
- package/lib/build/buildTaskEngine.js +11 -7
- package/lib/build/buildTaskFactory.js +15 -43
- package/lib/build/buildTaskProviderFactory.js +16 -44
- package/lib/build/constants.js +3 -3
- package/lib/build/index.js +2 -2
- package/lib/build/{buildPlugin.js → plugin.js} +65 -46
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/Chart.yaml +1 -1
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/values.yaml +1 -1
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/Chart.yaml +1 -1
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/templates/_helpers.tpl +7 -0
- package/lib/build/plugins/helm/files/subcharts/service-instance/templates/servicebinding.yaml +32 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/templates/serviceinstance.yaml +3 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/values.schema.json +63 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/values.yaml +23 -1
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/Chart.yaml +1 -1
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/deployment.yaml +2 -0
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/hpa.yaml +22 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/pod-disruption-budget.yaml +1 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/values.schema.json +49 -0
- package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/values.yaml +8 -2
- package/lib/{init/template/helm/files/chart → build/plugins/helm/files}/templates/_deployment_helpers.tpl +5 -0
- package/lib/build/plugins/helm/files/templates/_helpers.tpl +13 -0
- package/lib/build/plugins/helm/index.js +81 -0
- package/lib/build/plugins.js +12 -15
- package/lib/build/provider/featureToggleBuildPlugin.js +7 -39
- package/lib/build/provider/hana/2migration.js +168 -124
- package/lib/build/provider/hana/index.js +20 -25
- package/lib/build/provider/hana/template/package.json +4 -3
- package/lib/build/provider/internalBuildPlugin.js +32 -97
- package/lib/build/provider/internalBuildTaskProvider.js +10 -46
- package/lib/build/provider/java/index.js +2 -3
- package/lib/build/provider/mtx/index.js +5 -4
- package/lib/build/provider/mtx-extension/index.js +5 -2
- package/lib/build/provider/mtx-sidecar/index.js +2 -2
- package/lib/build/util.js +83 -12
- package/lib/compile/to-mermaid.js +108 -0
- package/lib/compile/to_asyncapi.js +7 -0
- package/lib/compile/to_openapi.js +7 -0
- package/lib/deploy/to-hana/hana.js +37 -34
- package/lib/deploy/to-hana/hdiDeployUtil.js +8 -6
- package/lib/env/schemas/cds-rc.js +1 -1
- package/lib/import/common.js +2 -2
- package/lib/import/odata/metadataconverter/MetadataConverter.js +4 -4
- package/lib/import/odata/v2parser.js +83 -197
- package/lib/import/odata/v4parser.js +1 -38
- package/lib/import/openapi/importOpenAPI.js +164 -42
- package/lib/index.js +10 -12
- package/lib/init/bas.js +91 -0
- package/lib/init/constants.js +16 -10
- package/lib/init/index.js +72 -150
- package/lib/init/merge.js +12 -20
- package/lib/init/mvn.js +103 -150
- package/lib/init/plugin.js +11 -7
- package/lib/init/projectReader.js +53 -19
- package/lib/init/registries/mta.js +51 -6
- package/lib/init/template/application-logging/files/package.json.hbs +7 -0
- package/lib/init/template/application-logging/index.js +13 -1
- package/lib/init/template/approuter/files/containerize.yaml.hbs +10 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +1 -2
- package/lib/init/template/approuter/files/values.yaml.hbs +19 -4
- package/lib/init/template/approuter/files/xs-app.json.hbs +12 -3
- package/lib/init/template/approuter/index.js +29 -25
- package/lib/init/template/attachments/files/mta.yaml.hbs +14 -0
- package/lib/init/template/attachments/files/package.json.hbs +5 -0
- package/lib/init/template/attachments/files/values.yaml +7 -0
- package/lib/init/template/attachments/index.js +53 -0
- package/lib/init/template/audit-logging/files/mta.yaml.hbs +14 -0
- package/lib/init/template/audit-logging/files/package.json.hbs +7 -0
- package/lib/init/template/audit-logging/index.js +66 -0
- package/lib/init/template/cf-manifest/index.js +4 -0
- package/lib/init/template/completion/completionSetup.js +54 -33
- package/lib/init/template/completion/index.js +7 -1
- package/lib/init/template/connectivity/index.js +4 -4
- package/lib/init/template/containerize/files/containerize.yaml.hbs +26 -0
- package/lib/init/template/containerize/index.js +24 -0
- package/lib/init/template/data/index.js +4 -0
- package/lib/init/template/destination/files/mta.yaml.hbs +25 -1
- package/lib/init/template/destination/index.js +12 -2
- package/lib/init/template/enterprise-messaging/index.js +6 -3
- package/lib/init/template/enterprise-messaging-shared/index.js +5 -1
- package/lib/init/template/extensibility/files/package.json.hbs +1 -1
- package/lib/init/template/extensibility/files/xs-security.json.hbs +2 -8
- package/lib/init/template/extensibility/index.js +3 -1
- package/lib/init/template/file-based-messaging/index.js +4 -0
- package/lib/init/template/h2/index.js +4 -0
- package/lib/init/template/hana/files/containerize.yaml.hbs +10 -0
- package/lib/init/template/hana/files/db/package.json +3 -2
- package/lib/init/template/hana/files/package.json.hbs +4 -7
- package/lib/init/template/hana/files/values.yaml.hbs +1 -2
- package/lib/init/template/hana/index.js +15 -7
- package/lib/init/template/helm/files/Chart.yaml.hbs +2 -3
- package/lib/init/template/helm/files/values.schema.json +2173 -0
- package/lib/init/template/helm/files/values.yaml.hbs +11 -6
- package/lib/init/template/helm/index.js +77 -18
- package/lib/init/template/helm-unified-runtime/index.js +19 -56
- package/lib/init/template/html5-repo/files/app-package.json.hbs +11 -7
- package/lib/init/template/html5-repo/files/manifest.json +13 -0
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +41 -8
- package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +21 -0
- package/lib/init/template/html5-repo/files/ui5.yaml.hbs +2 -29
- package/lib/init/template/html5-repo/files/values.yaml.hbs +6 -2
- package/lib/init/template/html5-repo/files/xs-app.json.hbs +21 -8
- package/lib/init/template/html5-repo/index.js +33 -30
- package/lib/init/template/http/index.js +36 -12
- package/lib/init/template/java/index.js +18 -12
- package/lib/init/template/kafka/index.js +4 -0
- package/lib/init/template/lint/index.js +7 -2
- package/lib/init/template/liquibase/index.js +4 -0
- package/lib/init/template/local-messaging/index.js +4 -0
- package/lib/init/template/malware-scanner/files/mta.yaml.hbs +14 -0
- package/lib/init/template/malware-scanner/files/package.json.hbs +17 -0
- package/lib/init/template/malware-scanner/files/values.yaml +7 -0
- package/lib/init/template/malware-scanner/index.js +47 -0
- package/lib/init/template/mta/files/mta.yaml.hbs +3 -3
- package/lib/init/template/mta/files/package.json +1 -1
- package/lib/init/template/mta/index.js +4 -0
- package/lib/init/template/mtx/index.js +4 -0
- package/lib/init/template/multitenancy/files/containerize.yaml.hbs +10 -0
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +0 -1
- package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +6 -5
- package/lib/init/template/multitenancy/files/values.yaml.hbs +14 -24
- package/lib/init/template/multitenancy/index.js +50 -28
- package/lib/init/template/nodejs/files/eslint.config.mjs +2 -0
- package/lib/init/template/nodejs/files/package.json.hbs +2 -3
- package/lib/init/template/nodejs/index.js +4 -0
- package/lib/init/template/notifications/files/mta.yaml.hbs +2 -2
- package/lib/init/template/notifications/index.js +4 -0
- package/lib/init/template/pipeline/files/.pipeline/config.yml +1 -1
- package/lib/init/template/pipeline/files/Jenkinsfile +1 -1
- package/lib/init/template/pipeline/index.js +4 -0
- package/lib/init/template/portal/files/mta.yaml.hbs +52 -0
- package/lib/init/template/portal/files/package.json.hbs +11 -0
- package/lib/init/template/portal/files/package.sidecar.json +7 -0
- package/lib/init/template/portal/files/portal-site/CommonDataModel.json.hbs +97 -0
- package/lib/init/template/portal/files/portal-site/i18n/catalog.properties +1 -0
- package/lib/init/template/portal/files/portal-site/i18n/catalog_de.properties +1 -0
- package/lib/init/template/portal/files/portal-site/i18n/group.properties +1 -0
- package/lib/init/template/portal/files/portal-site/i18n/group_de.properties +1 -0
- package/lib/init/template/portal/index.js +84 -0
- package/lib/init/template/postgres/index.js +5 -1
- package/lib/init/template/redis-messaging/index.js +4 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +13 -1
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +2 -2
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -0
- package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +4 -0
- package/lib/init/template/sample/files/app/browse/webapp/manifest.json +3 -3
- package/lib/init/template/sample/files/app/index.html +1 -1
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -5
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -6
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -5
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -16
- package/lib/init/template/sample/files/nodejs/cat-service.js +2 -2
- package/lib/init/template/sample/files/package.json.hbs +3 -0
- package/lib/init/template/sample/index.js +16 -9
- package/lib/init/template/sqlite/index.js +4 -0
- package/lib/init/template/tiny-sample/files/nodejs/db/data/my.bookshop-Books.csv +3 -3
- package/lib/init/template/tiny-sample/files/nodejs/srv/cat-service.cds.hbs +1 -1
- package/lib/init/template/tiny-sample/index.js +4 -0
- package/lib/init/template/toggles/files/package.json.hbs +1 -1
- package/lib/init/template/toggles/index.js +4 -0
- package/lib/init/template/typer/index.js +4 -0
- package/lib/init/template/typescript/files/package.json +12 -0
- package/lib/init/template/typescript/files/tsconfig.json +13 -0
- package/lib/init/template/typescript/index.js +39 -0
- package/lib/init/template/workzone/index.js +5 -0
- package/lib/init/template/workzone-standard/files/manifest.json.hbs +6 -0
- package/lib/init/template/workzone-standard/index.js +30 -0
- package/lib/init/template/xsuaa/files/package.json.hbs +1 -1
- package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -2
- package/lib/init/template/xsuaa/index.js +11 -7
- package/lib/init/validate.js +27 -0
- package/lib/lint/generators.js +1 -1
- package/lib/lint/io.js +25 -7
- package/lib/mtx/auth_manager.js +64 -30
- package/lib/mtx/download_legacy.js +2 -2
- package/lib/mtx/index.js +0 -4
- package/lib/mtx/params.js +32 -38
- package/lib/mtx/pull.js +151 -43
- package/lib/mtx/push.js +3 -3
- package/lib/mtx/settings_manager.js +75 -35
- package/lib/mtx/tenant_action.js +1 -1
- package/lib/mtx/util/cf.js +1 -1
- package/lib/mtx/util/fs.js +26 -1
- package/lib/mtx/util/logging.js +7 -3
- package/lib/util/command.js +0 -2
- package/lib/util/fs.js +2 -3
- package/lib/util/question.js +28 -0
- package/lib/util/term.js +5 -3
- package/npm-shrinkwrap.json +226 -1087
- package/package.json +13 -8
- package/bin/activate.js +0 -77
- package/lib/compile/asyncapi/channels.js +0 -22
- package/lib/compile/asyncapi/components/messageTraits/index.js +0 -89
- package/lib/compile/asyncapi/components/messages/index.js +0 -173
- package/lib/compile/asyncapi/components/schemas/annotations.js +0 -33
- package/lib/compile/asyncapi/components/schemas/array.js +0 -8
- package/lib/compile/asyncapi/components/schemas/cache.js +0 -14
- package/lib/compile/asyncapi/components/schemas/definition.js +0 -187
- package/lib/compile/asyncapi/components/schemas/enum.js +0 -16
- package/lib/compile/asyncapi/components/schemas/examples.js +0 -10
- package/lib/compile/asyncapi/components/schemas/index.js +0 -14
- package/lib/compile/asyncapi/components/schemas/localized.js +0 -29
- package/lib/compile/asyncapi/components/schemas/primitiveElement.js +0 -41
- package/lib/compile/asyncapi/components/schemas/ref.js +0 -45
- package/lib/compile/asyncapi/components/schemas/utils.js +0 -108
- package/lib/compile/asyncapi/index.js +0 -247
- package/lib/compile/asyncapi/message.js +0 -13
- package/lib/compile/asyncapi/utils.js +0 -27
- package/lib/compile/openapi/csdl2openapi.js +0 -2448
- package/lib/compile/openapi/index.js +0 -68
- package/lib/init/template/helm/files/chart/templates/NOTES.txt +0 -14
- package/lib/init/template/helm/files/chart/templates/_helpers.tpl +0 -28
- package/lib/init/template/helm/files/chart/values.root.schema.json +0 -61
- package/lib/init/template/helm/files/chart/values.schema.json +0 -366
- package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +0 -10
- package/lib/init/template/helm-unified-runtime/files/templates/_deployment_helpers.tpl +0 -90
- package/lib/init/template/helm-unified-runtime/files/templates/_helpers.tpl +0 -28
- package/lib/init/template/helm-unified-runtime/files/values.root.schema.json +0 -61
- package/lib/init/template/helm-unified-runtime/files/values.schema.json +0 -366
- package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +0 -26
- package/lib/init/template/helm-unified-runtime/package.json +0 -4
- package/lib/init/template/multitenancy/files/mtxs-configmap-java-approuter.yaml +0 -20
- package/lib/init/template/multitenancy/files/mtxs-configmap-java.yaml +0 -18
- package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs-approuter.yaml +0 -12
- package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs.yaml +0 -12
- package/lib/init/template/multitenancy/files/saas-registry-secret.yaml +0 -9
- package/lib/init/template/nodejs/files/eslint.config.js +0 -13
- package/lib/init/template/notebook/index.js +0 -11
- package/lib/init/template/samples/index.js +0 -9
- package/lib/mtx/activate.js +0 -238
- package/lib/mtx/extend.js +0 -173
- package/lib/util/exec.d.ts +0 -54
- package/lib/util/exec.js +0 -211
- /package/lib/{init/template/approuter/files → build/plugins/helm/files/plugins/approuter}/approuter-configmap.yaml +0 -0
- /package/lib/{init/template/connectivity/files → build/plugins/helm/files/plugins/connectivity}/connectivity-proxy-info.yaml +0 -0
- /package/lib/{init/template/html5-repo/files → build/plugins/helm/files/plugins/html5-repo}/html5-apps-deployer-configmap.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/_helpers.tpl +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/job.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/secret.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-account.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-binding.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/values.schema.json +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/NOTES.txt +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_api.tpl +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_helpers.tpl +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/api-rule.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/network-policy.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/rbac.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/secret.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-account.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-binding.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service.yaml +0 -0
- /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/virtual-service.yaml +0 -0
- /package/lib/{init/template/helm-unified-runtime → build/plugins/helm}/files/templates/NOTES.txt +0 -0
- /package/lib/init/template/{nodejs/files → java}/.cdsrc.json +0 -0
- /package/lib/init/template/tiny-sample/files/nodejs/db/{data-model.cds → schema.cds} +0 -0
|
@@ -10,9 +10,13 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
10
10
|
|
|
11
11
|
#nodeHost = "http://localhost:4004"
|
|
12
12
|
#javaHost = "http://localhost:8080"
|
|
13
|
-
#defaultOutputDir = "http"
|
|
13
|
+
#defaultOutputDir = "test/http"
|
|
14
14
|
#defaultAuth = `Authorization: Basic alice:`
|
|
15
15
|
|
|
16
|
+
static help() {
|
|
17
|
+
return 'add .http files for modeled services'
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
options() {
|
|
17
21
|
return {
|
|
18
22
|
'filter': {
|
|
@@ -95,7 +99,7 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
95
99
|
for (const c of csn.childrenOf(s.name)) {
|
|
96
100
|
if (c.name.match(filterStringAsRegex(filter))) {
|
|
97
101
|
if (c.name.includes('.texts')) continue
|
|
98
|
-
c.kind === 'entity' ? entities.push(this.#
|
|
102
|
+
c.kind === 'entity' ? entities.push(this.#addEntityInfo(c)) : c.kind === 'action' ? actions.push(c) : null
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
if (entities.length === 0 && actions.length === 0) return
|
|
@@ -111,10 +115,12 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
111
115
|
return services
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
#
|
|
118
|
+
#addEntityInfo(e) {
|
|
115
119
|
return {
|
|
116
120
|
name: e.name,
|
|
117
121
|
readOnly: (e["@readonly"] || e["@cds.autoexpose"] || e['@odata.singleton']) ?? false,
|
|
122
|
+
isDraft: e['@odata.draft.enabled'] ?? false,
|
|
123
|
+
keys: e.keys
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
|
|
@@ -154,19 +160,28 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
154
160
|
const url = `{{server}}/${urlPath}${entityNameSimple}`
|
|
155
161
|
const requestTitle = `\n### ${e.name}`
|
|
156
162
|
requests.push(`${requestTitle}\nGET ${url}\n${headers}\n`)
|
|
157
|
-
if (e.readOnly)
|
|
158
|
-
return
|
|
159
|
-
}
|
|
163
|
+
if (e.readOnly) return
|
|
160
164
|
|
|
161
165
|
const entityData = payload[`${e.name}`] ? payload[`${e.name}`][0] : null
|
|
162
166
|
if (!entityData) return
|
|
163
|
-
// TODO handle ids that are not named ID
|
|
164
|
-
if (!Object.keys(entityData).some(k => k === "ID")) return // no need to write requests for entities without ids
|
|
165
|
-
|
|
166
167
|
const postBody = JSON.stringify(entityData, null, 2)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
|
|
169
|
+
let id
|
|
170
|
+
const compositeKey = Object.keys(e.keys).length > 1
|
|
171
|
+
if (compositeKey) {
|
|
172
|
+
id = e.keys.map(k => k.type === 'cds.String' ? `${k.name}='${entityData[k.name]}'` : `${k.name}=${entityData[k.name]}`).join(',')
|
|
173
|
+
} else {
|
|
174
|
+
id = entityData[Object.keys(e.keys)[0]]
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (e.isDraft) {
|
|
178
|
+
generateDraftRequests(requests, requestTitle, url, headers, postBody, id)
|
|
179
|
+
} else {
|
|
180
|
+
compositeKey ? id = `(${id})` : id = `/${id}`
|
|
181
|
+
requests.push(`${requestTitle}\nPOST ${url}\n${headers}\n\n${postBody}\n`)
|
|
182
|
+
requests.push(`${requestTitle}\nPATCH ${url}${id}\n${headers}\n\n${postBody}\n`)
|
|
183
|
+
requests.push(`${requestTitle}\nDELETE ${url}${id}\n${headers}\n`)
|
|
184
|
+
}
|
|
170
185
|
})
|
|
171
186
|
|
|
172
187
|
service.actions.forEach((a) => {
|
|
@@ -188,6 +203,15 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
188
203
|
})
|
|
189
204
|
this.#write(requests, serviceName)
|
|
190
205
|
}
|
|
206
|
+
|
|
207
|
+
function generateDraftRequests(requests, requestTitle, url, headers, postBody, id) {
|
|
208
|
+
requests.push(`${requestTitle} Drafts \nGET ${url}?$filter=(IsActiveEntity eq false)\n${headers}\n`) // unencoded URL for better readability (client can handle this)
|
|
209
|
+
requests.push(`${requestTitle} Drafts \nPOST ${url}\n${headers}\n\n${postBody}\n`)
|
|
210
|
+
requests.push(`\n### Please paste the server-generated draft id here e.g. ID=101 or ID=101,secodKey='stringValue' \n@draftID = ${id}\n`)
|
|
211
|
+
requests.push(`${requestTitle} Patch Draft \nPATCH ${url}({{draftID}},IsActiveEntity=false)\n${headers}\n\n${postBody}\n`)
|
|
212
|
+
requests.push(`${requestTitle} Prepare Draft \nPOST ${url}({{draftID}},IsActiveEntity=false)/AdminService.draftPrepare\n${headers}\n\n{}\n`)
|
|
213
|
+
requests.push(`${requestTitle} Activate Draft \nPOST ${url}({{draftID}},IsActiveEntity=false)/AdminService.draftActivate\n${headers}\n\n{}\n`)
|
|
214
|
+
}
|
|
191
215
|
}
|
|
192
216
|
|
|
193
217
|
#write(requests, serviceName) {
|
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
const os = require('os')
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
|
-
const { exists, copy, rimraf, fs, path } = cds.utils, { join } = path
|
|
3
|
+
const { exists, copy, rimraf, fs:{promises:{ mkdtemp }}, path } = cds.utils, { join } = path
|
|
4
4
|
const cmd = require('../../../util/command')
|
|
5
5
|
const mvn = require('../../mvn')
|
|
6
|
-
const
|
|
6
|
+
const { bold, info, link } = require('../../../util/term')
|
|
7
7
|
const { URLS, OPTIONS: { NODEJS, JAVA }, COMMAND_ADD } = require('../../constants')
|
|
8
|
+
const { command, options } = cds.cli
|
|
8
9
|
|
|
9
10
|
module.exports = class JavaTemplate extends require('../../plugin') {
|
|
10
11
|
|
|
12
|
+
static help() {
|
|
13
|
+
return 'creates a Java-based project'
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
static hasInProduction() {
|
|
12
|
-
return exists('pom.xml') ||
|
|
17
|
+
return exists('pom.xml') || options?.add?.has(JAVA)
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
async canRun() {
|
|
16
|
-
if (
|
|
21
|
+
if (command === COMMAND_ADD) {
|
|
17
22
|
throw `You can't change the runtime of an existing project.`
|
|
18
23
|
}
|
|
19
|
-
if (
|
|
20
|
-
throw `Only one runtime per project is supported. Specify either ${
|
|
24
|
+
if (options.add?.has(NODEJS)) {
|
|
25
|
+
throw `Only one runtime per project is supported. Specify either ${bold(JAVA)} or ${bold(NODEJS)}.`
|
|
21
26
|
}
|
|
22
27
|
return true
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
async run() {
|
|
26
|
-
const
|
|
31
|
+
const projectName = path.basename(cds.root)
|
|
32
|
+
const { params, artifactId, archetypeVersion } = await mvn.init(projectName)
|
|
27
33
|
console.log(`Using Maven archetype version ${archetypeVersion}`)
|
|
28
34
|
|
|
29
|
-
const temp = await
|
|
35
|
+
const temp = await mkdtemp(join(os.tmpdir(), `${path.basename(cds.root)}_`))
|
|
30
36
|
try {
|
|
31
|
-
await cmd.spawnCommand('mvn',
|
|
32
|
-
await copy(join(temp, artifactId)
|
|
37
|
+
await cmd.spawnCommand('mvn', params, { cwd: temp })
|
|
38
|
+
await copy(join(temp, artifactId)).to(cds.root)
|
|
33
39
|
} catch (err) {
|
|
34
40
|
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
35
|
-
throw `Maven executable 'mvn' not found
|
|
41
|
+
throw `Maven executable 'mvn' not found. Follow ${info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
|
|
36
42
|
}
|
|
37
43
|
throw err;
|
|
38
44
|
} finally {
|
|
@@ -41,6 +47,6 @@ module.exports = class JavaTemplate extends require('../../plugin') {
|
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
async finalize() {
|
|
44
|
-
console.log(`Learn about next steps at ${
|
|
50
|
+
console.log(`Learn about next steps at ${link(URLS.CAPIRE)}`)
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -7,6 +7,10 @@ const mvn = require('../../mvn')
|
|
|
7
7
|
|
|
8
8
|
module.exports = class KafkaTemplate extends require('../../plugin') {
|
|
9
9
|
|
|
10
|
+
static help() {
|
|
11
|
+
return 'messaging via Apache Kafka'
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
static hasInProduction(env) {
|
|
11
15
|
if (exists('pom.xml')) {
|
|
12
16
|
if (!exists('srv/pom.xml')) return false
|
|
@@ -15,6 +15,11 @@ const VSCODE_FILE_ASSOCIATIONS = {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
module.exports = class LintTemplate extends require('../../plugin') {
|
|
18
|
+
|
|
19
|
+
static help() {
|
|
20
|
+
return 'configure cds lint'
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
constructor() {
|
|
19
24
|
super();
|
|
20
25
|
this.customPath = path.join(cds.root, ".eslint");
|
|
@@ -137,7 +142,7 @@ module.exports = class LintTemplate extends require('../../plugin') {
|
|
|
137
142
|
|
|
138
143
|
// Require locally installed ESLint CDS plugin
|
|
139
144
|
if (!eslintPluginLocal) {
|
|
140
|
-
this.missingNpmDependencies["names"].push("@sap/eslint-plugin-cds@^3
|
|
145
|
+
this.missingNpmDependencies["names"].push("@sap/eslint-plugin-cds@^3");
|
|
141
146
|
this.missingNpmDependencies["msgs"].push("ESLint plugin for CDS v>=3.0.0");
|
|
142
147
|
}
|
|
143
148
|
return;
|
|
@@ -153,7 +158,7 @@ module.exports = class LintTemplate extends require('../../plugin') {
|
|
|
153
158
|
const { getConfigPath } = require("@sap/eslint-plugin-cds/lib/api");
|
|
154
159
|
let configPath = getConfigPath(cds.root);
|
|
155
160
|
if (!configPath) {
|
|
156
|
-
configPath = path.join(cds.root, "eslint.config.
|
|
161
|
+
configPath = path.join(cds.root, "eslint.config.mjs");
|
|
157
162
|
}
|
|
158
163
|
await io.sanitizeEslintConfig(configPath, this.customRuleExample);
|
|
159
164
|
}
|
|
@@ -3,6 +3,10 @@ const { readProject } = require('../../projectReader')
|
|
|
3
3
|
|
|
4
4
|
module.exports = class LiquibaseTemplate extends require('../../plugin') {
|
|
5
5
|
|
|
6
|
+
static help() {
|
|
7
|
+
return 'database migration using Liquibase'
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
async canRun() {
|
|
7
11
|
const { isNodejs } = readProject()
|
|
8
12
|
if (isNodejs) throw `'cds add liquibase' is not available for Node.js yet`
|
|
@@ -5,6 +5,10 @@ const { merge } = require('../../merge')
|
|
|
5
5
|
|
|
6
6
|
module.exports = class LocalMessagingTemplate extends require('../../plugin') {
|
|
7
7
|
|
|
8
|
+
static help() {
|
|
9
|
+
return 'messaging via local event bus'
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
async canRun() {
|
|
9
13
|
const { isJava } = readProject()
|
|
10
14
|
if (isJava) throw `'cds add local-messaging' is not available for Java yet`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
requires:
|
|
7
|
+
- name: {{appName}}-malware-scanner
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
- name: {{appName}}-malware-scanner
|
|
11
|
+
type: org.cloudfoundry.managed-service
|
|
12
|
+
parameters:
|
|
13
|
+
service: malware-scanner
|
|
14
|
+
service-plan: clamav
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const { readProject } = require('../../projectReader')
|
|
2
|
+
const { merge } = require('../../merge')
|
|
3
|
+
const { srv4, malwareScanner } = require('../../registries/mta')
|
|
4
|
+
|
|
5
|
+
module.exports = class MalwareScannerTemplate extends require('../../plugin') {
|
|
6
|
+
|
|
7
|
+
static help() {
|
|
8
|
+
return 'SAP Malware Scanning service'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static hasInProduction(env) {
|
|
12
|
+
return !!env.requires['malware-scanner']
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async canRun() {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async run() {
|
|
20
|
+
const project = readProject()
|
|
21
|
+
const { isNodejs } = project
|
|
22
|
+
if (isNodejs) {
|
|
23
|
+
await merge(__dirname, 'files/package.json.hbs').into('package.json', { project })
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async combine() {
|
|
28
|
+
const project = readProject()
|
|
29
|
+
const { hasMta, hasHelm, hasHelmUnifiedRuntime, srvPath } = project
|
|
30
|
+
|
|
31
|
+
if (hasMta) {
|
|
32
|
+
const srv = srv4(srvPath)
|
|
33
|
+
const additions = [srv, malwareScanner ]
|
|
34
|
+
const relationships = [{
|
|
35
|
+
insert: [malwareScanner, 'name'],
|
|
36
|
+
into: [srv, 'requires', 'name']
|
|
37
|
+
}]
|
|
38
|
+
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
|
|
39
|
+
with: project, additions, relationships
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (hasHelm || hasHelmUnifiedRuntime) {
|
|
44
|
+
await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
_schema-version:
|
|
2
|
+
_schema-version: 3.3.0
|
|
3
3
|
ID: {{appId}}
|
|
4
4
|
version: {{appVersion}}
|
|
5
5
|
description: "{{appDescription}}"
|
|
@@ -29,7 +29,7 @@ modules:
|
|
|
29
29
|
parameters:
|
|
30
30
|
buildpack: sap_java_buildpack_jakarta
|
|
31
31
|
readiness-health-check-type: http
|
|
32
|
-
readiness-health-check-http-endpoint: /
|
|
32
|
+
readiness-health-check-http-endpoint: /actuator/health
|
|
33
33
|
properties:
|
|
34
34
|
SPRING_PROFILES_ACTIVE: cloud,sandbox
|
|
35
35
|
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
|
|
@@ -37,7 +37,7 @@ modules:
|
|
|
37
37
|
build-parameters:
|
|
38
38
|
builder: custom
|
|
39
39
|
commands:
|
|
40
|
-
- mvn clean package -DskipTests=true
|
|
40
|
+
- mvn clean package -DskipTests=true --batch-mode
|
|
41
41
|
build-result: target/*-exec.jar
|
|
42
42
|
{{/isJava}}
|
|
43
43
|
provides:
|
|
@@ -8,6 +8,10 @@ const { merge, sort } = require('../../merge')
|
|
|
8
8
|
|
|
9
9
|
module.exports = class MtaTemplate extends require('../../plugin') {
|
|
10
10
|
|
|
11
|
+
static help() {
|
|
12
|
+
return 'Cloud Foundry deployment using mta.yaml'
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
static hasInProduction() {
|
|
12
16
|
return exists('mta.yaml')
|
|
13
17
|
}
|
|
@@ -2,6 +2,10 @@ const { MULTITENANCY, TOGGLES, EXTENSIBILITY } = require('../../constants').OPTI
|
|
|
2
2
|
|
|
3
3
|
module.exports = class MtxTemplate extends require('../../plugin') {
|
|
4
4
|
|
|
5
|
+
static help() {
|
|
6
|
+
return 'multitenancy + toggles + extensibility'
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
requires() {
|
|
6
10
|
return [MULTITENANCY, TOGGLES, EXTENSIBILITY]
|
|
7
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{appName}}-mtx",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@
|
|
5
|
-
"@sap/cds
|
|
6
|
-
"@sap/cds-mtxs": "^
|
|
7
|
-
"@sap/xssec": "^
|
|
4
|
+
"@cap-js/hana": "^1",
|
|
5
|
+
"@sap/cds": "^8",
|
|
6
|
+
"@sap/cds-mtxs": "^2",
|
|
7
|
+
"@sap/xssec": "^4",
|
|
8
8
|
"express": "^4"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"build": "cds build ../.. --for mtx-sidecar --production && npm ci --prefix gen"{{/isJava}}
|
|
16
16
|
},
|
|
17
17
|
"cds": {
|
|
18
|
-
"
|
|
18
|
+
{{#isJava}}"profiles": ["mtx-sidecar", "java"]{{/isJava}}
|
|
19
|
+
{{#isNodejs}}"profile": "mtx-sidecar"{{/isNodejs}}
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -7,34 +7,25 @@ srv:
|
|
|
7
7
|
{{/isJava}}
|
|
8
8
|
service-manager:
|
|
9
9
|
serviceInstanceName: service-manager
|
|
10
|
+
{{#isJava}}
|
|
11
|
+
env:
|
|
12
|
+
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
|
|
13
|
+
{{/isJava}}
|
|
10
14
|
service-manager:
|
|
11
15
|
serviceOfferingName: service-manager
|
|
12
16
|
servicePlanName: container
|
|
13
17
|
saas-registry:
|
|
14
18
|
serviceOfferingName: saas-registry
|
|
15
19
|
servicePlanName: application
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
appUrls:
|
|
26
|
-
{{#isNodejs}}
|
|
27
|
-
getDependencies: "/-/cds/saas-provisioning/dependencies"
|
|
28
|
-
onSubscription: "/-/cds/saas-provisioning/tenant/{tenantId}"
|
|
29
|
-
{{/isNodejs}}
|
|
30
|
-
{{#isJava}}
|
|
31
|
-
getDependencies: "/mt/v1.0/subscriptions/dependencies"
|
|
32
|
-
onSubscription: "/mt/v1.0/subscriptions/tenants/{tenantId}"
|
|
33
|
-
{{/isJava}}
|
|
34
|
-
onSubscriptionAsync: true
|
|
35
|
-
onUnSubscriptionAsync: true
|
|
36
|
-
onUpdateDependenciesAsync: true
|
|
37
|
-
callbackTimeoutMillis: 300000
|
|
20
|
+
parameters:
|
|
21
|
+
displayName: {{appName}}
|
|
22
|
+
description: {{appDescription}}
|
|
23
|
+
category: "CAP Application"
|
|
24
|
+
appUrls:
|
|
25
|
+
onSubscriptionAsync: true
|
|
26
|
+
onUnSubscriptionAsync: true
|
|
27
|
+
onUpdateDependenciesAsync: true
|
|
28
|
+
callbackTimeoutMillis: 300000
|
|
38
29
|
sidecar:
|
|
39
30
|
bindings:
|
|
40
31
|
{{#hasXsuaa}}
|
|
@@ -48,8 +39,7 @@ sidecar:
|
|
|
48
39
|
service-manager:
|
|
49
40
|
serviceInstanceName: service-manager
|
|
50
41
|
image:
|
|
51
|
-
repository:
|
|
52
|
-
tag: latest
|
|
42
|
+
repository: {{appName}}-sidecar
|
|
53
43
|
resources:
|
|
54
44
|
limits:
|
|
55
45
|
ephemeral-storage: 1G
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const cds = require('../../../cds')
|
|
3
|
-
const { read, write
|
|
3
|
+
const { read, write } = cds.utils
|
|
4
4
|
const mvn = require('../../mvn')
|
|
5
5
|
const { readProject } = require('../../projectReader')
|
|
6
|
-
const { merge, sort
|
|
6
|
+
const { merge, sort } = require('../../merge')
|
|
7
7
|
const { copyRenderedJSON } = require('../../../util/fs')
|
|
8
8
|
const {
|
|
9
9
|
srv4, // Server
|
|
@@ -14,6 +14,10 @@ const {
|
|
|
14
14
|
|
|
15
15
|
module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
16
16
|
|
|
17
|
+
static help() {
|
|
18
|
+
return 'schema-based multitenancy support'
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
static hasInProduction(env) {
|
|
18
22
|
const { options } = cds.cli.options
|
|
19
23
|
// REVISIT: Check if this can be simplified
|
|
@@ -28,7 +32,7 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
|
28
32
|
const packageJson = await read('package.json')
|
|
29
33
|
packageJson.workspaces = ['mtx/sidecar']
|
|
30
34
|
await write('package.json', packageJson, { spaces: 2 })
|
|
31
|
-
await mvn.
|
|
35
|
+
await mvn.add('mtx')
|
|
32
36
|
}
|
|
33
37
|
if (isNodejs) await sort('package.json', 'dependencies')
|
|
34
38
|
await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar', 'package.json'), project)
|
|
@@ -36,7 +40,7 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
|
36
40
|
|
|
37
41
|
async combine() {
|
|
38
42
|
const project = readProject()
|
|
39
|
-
const { isNodejs, isJava, hasMta, hasHelm, hasHelmUnifiedRuntime, hasXsuaa, hasHana, srvPath, hasApprouter } = project
|
|
43
|
+
const { isNodejs, isJava, hasMta, hasHelm, hasHelmUnifiedRuntime, hasXsuaa, hasHana, hasContainerize, srvPath, hasApprouter } = project
|
|
40
44
|
|
|
41
45
|
if (hasMta) {
|
|
42
46
|
const srv = srv4(srvPath)
|
|
@@ -84,35 +88,53 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
|
84
88
|
where: { serviceOfferingName: 'xsuaa' }
|
|
85
89
|
}, 'parameters.tenant-mode'], withValue: 'shared'
|
|
86
90
|
}] : []
|
|
87
|
-
|
|
88
|
-
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project, overwrites })
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
envFrom: [{
|
|
92
|
-
configMapRef: {
|
|
93
|
-
name: "{{ .Release.Name }}-mtxs-configmap"
|
|
94
|
-
}
|
|
95
|
-
}]
|
|
96
|
-
}
|
|
92
|
+
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project, overwrites })
|
|
97
93
|
|
|
94
|
+
const domain = hasApprouter ? 'svc.cluster.local:8080' : '{{ .Values.global.domain }}'
|
|
95
|
+
const applicationWorkload = hasApprouter ? 'approuter' : 'srv'
|
|
96
|
+
const serviceCommunicatingWithSaasReg = hasApprouter ? 'approuter' : isNodejs ? 'sidecar' : 'srv';
|
|
98
97
|
await merge({
|
|
99
|
-
...(isNodejs) && { sidecar: envFromObject },
|
|
100
|
-
...(isJava) && { srv: envFromObject },
|
|
101
98
|
'saas-registry': {
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
99
|
+
'parameters': {
|
|
100
|
+
xsappname: `${project.appName}-{{ .Release.Namespace }}`,
|
|
101
|
+
appName: `${project.appName}-{{ .Release.Namespace }}`,
|
|
102
|
+
appUrls: {
|
|
103
|
+
getDependencies: `https://{{ .Release.Name }}-${serviceCommunicatingWithSaasReg}-{{ .Release.Namespace }}.{{ .Values.global.domain }}${isNodejs ? '/-/cds/saas-provisioning' : '/mt/v1.0/subscriptions'}/dependencies`,
|
|
104
|
+
onSubscription: `https://{{ .Release.Name }}-${serviceCommunicatingWithSaasReg}-{{ .Release.Namespace }}.{{ .Values.global.domain }}${isNodejs ? '/-/cds/saas-provisioning/tenant/{tenantId}' : '/mt/v1.0/subscriptions/tenants/{tenantId}'}`,
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
...(isNodejs) && { sidecar: {
|
|
109
|
+
env: {
|
|
110
|
+
SUBSCRIPTION_URL: `https://\${tenant_subdomain}-{{ .Release.Name }}-${applicationWorkload}-{{ .Release.Namespace }}.{{ .Values.global.domain }}`
|
|
111
|
+
}
|
|
112
|
+
}},
|
|
113
|
+
...(isJava) && { srv: {
|
|
114
|
+
env: {
|
|
115
|
+
CDS_MULTITENANCY_APPUI_URL: `https://{{ .Release.Name }}-${applicationWorkload}-{{ .Release.Namespace }}.{{ .Values.global.domain }}`,
|
|
116
|
+
CDS_MULTITENANCY_SIDECAR_URL: `http${hasApprouter ? '' : 's'}://{{ .Release.Name }}-sidecar${hasApprouter ? '.' : '-'}{{ .Release.Namespace }}.${domain}`
|
|
117
|
+
}
|
|
118
|
+
}}
|
|
119
|
+
}).into('chart/values.yaml',{ forceOverwrite: true })
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (hasContainerize) {
|
|
123
|
+
const deletions = []
|
|
124
|
+
if (hasHana) {
|
|
125
|
+
deletions.push({
|
|
126
|
+
item: {
|
|
127
|
+
in: 'modules',
|
|
128
|
+
where: { name: `${project.appName}-hana-deployer` }
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
112
132
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
const additions = [{
|
|
134
|
+
in: 'modules',
|
|
135
|
+
where: { name: `${project.appName}-sidecar` }
|
|
136
|
+
}]
|
|
137
|
+
await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions, deletions })
|
|
116
138
|
}
|
|
117
139
|
|
|
118
140
|
if (hasXsuaa) {
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"private": true,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sap/cds": "^
|
|
9
|
+
"@sap/cds": "^8",
|
|
10
10
|
"express": "^4"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@cap-js/sqlite": "^1",
|
|
14
|
-
"@
|
|
15
|
-
"eslint": "^9"
|
|
14
|
+
"@cap-js/cds-types": "^0.6"
|
|
16
15
|
},
|
|
17
16
|
"scripts": {
|
|
18
17
|
"start": "cds-serve"
|
|
@@ -8,6 +8,10 @@ const { renderAndCopy } = require('../../template')
|
|
|
8
8
|
|
|
9
9
|
module.exports = class NodejsTemplate extends require('../../plugin') {
|
|
10
10
|
|
|
11
|
+
static help() {
|
|
12
|
+
return 'creates a Node.js-based project'
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
static hasInProduction() {
|
|
12
16
|
return !exists('pom.xml') && !cds.cli.options?.add?.has(JAVA)
|
|
13
17
|
}
|
|
@@ -7,11 +7,11 @@ modules:
|
|
|
7
7
|
no-route: true
|
|
8
8
|
no-start: true
|
|
9
9
|
memory: 256MB
|
|
10
|
-
disk-quota:
|
|
10
|
+
disk-quota: 1GB
|
|
11
11
|
tasks:
|
|
12
12
|
- name: notification-content-deployment
|
|
13
13
|
command: "node node_modules/@cap-js/notifications/lib/content-deployment.js"
|
|
14
14
|
memory: 256MB
|
|
15
|
-
disk-quota:
|
|
15
|
+
disk-quota: 1GB
|
|
16
16
|
requires:
|
|
17
17
|
- name: {{appName}}-destination
|