@sap/cds-dk 7.9.6 → 8.0.3
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 +2136 -0
- package/bin/add.js +18 -52
- package/bin/bind.js +2 -2
- package/bin/build.js +29 -4
- package/bin/cds.js +31 -14
- 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 +13 -14
- 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 +4 -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 +69 -56
- package/lib/build/provider/hana/template/package.json +4 -3
- package/lib/build/provider/internalBuildPlugin.js +32 -97
- package/lib/build/provider/internalBuildTaskProvider.js +12 -48
- 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/provider/nodejs/index.js +4 -3
- 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 +21 -11
- 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 -20
- 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/{redis-messaging → audit-logging}/files/mta.yaml.hbs +4 -4
- 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 +31 -1
- package/lib/init/template/destination/files/package.sidecar.json +7 -0
- package/lib/init/template/destination/index.js +22 -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 +14 -33
- package/lib/init/template/html5-repo/files/package.sidecar.json +7 -0
- 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 +6 -7
- package/lib/init/template/html5-repo/index.js +41 -35
- 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/files/mta.yaml.hbs +25 -0
- package/lib/init/template/redis/files/package.json.hbs +5 -0
- package/lib/init/template/redis/index.js +44 -0
- package/lib/init/template/redis-messaging/files/package.json.hbs +0 -3
- package/lib/init/template/redis-messaging/index.js +8 -18
- 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 +9 -0
- package/lib/init/template/workzone-standard/files/manifest.json.hbs +6 -0
- package/lib/init/template/workzone-standard/files/mta.yaml.hbs +59 -0
- package/lib/init/template/workzone-standard/index.js +46 -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 +225 -1083
- 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
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
const { readProject } = require('../../projectReader')
|
|
2
2
|
const { merge } = require('../../merge')
|
|
3
|
-
const { srv4, destination } = require('../../registries/mta')
|
|
3
|
+
const { srv4, approuter, destination, mtxSidecar4 } = require('../../registries/mta')
|
|
4
4
|
|
|
5
5
|
module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
6
6
|
|
|
7
|
+
static help() {
|
|
8
|
+
return 'SAP BTP Destination Service'
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
static hasInProduction(env) {
|
|
8
12
|
const kinds = { odata: 1, 'odata-v2': 1, 'odata-v4': 1, rest: 1 }
|
|
9
13
|
const mtxServices = { 'cds.xt.SaasProvisioningService': 1, 'cds.xt.DeploymentService': 1, 'cds.xt.ModelProviderService': 1, 'cds.xt.ExtensibilityService': 1 }
|
|
@@ -20,7 +24,11 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
|
20
24
|
|
|
21
25
|
async combine() {
|
|
22
26
|
const project = readProject()
|
|
23
|
-
const { hasHelm, hasHelmUnifiedRuntime, hasMta, srvPath } = project
|
|
27
|
+
const { hasHelm, hasApprouter, hasMultitenancy, hasHelmUnifiedRuntime, hasMta, srvPath, isJava } = project
|
|
28
|
+
|
|
29
|
+
if (hasMultitenancy) {
|
|
30
|
+
await merge(__dirname, 'files/package.sidecar.json').into('mtx/sidecar/package.json')
|
|
31
|
+
}
|
|
24
32
|
|
|
25
33
|
if (hasMta) {
|
|
26
34
|
const srv = srv4(srvPath)
|
|
@@ -29,6 +37,18 @@ module.exports = class DestinationTemplate extends require('../../plugin') {
|
|
|
29
37
|
insert: [destination, 'name'],
|
|
30
38
|
into: [srv, 'requires', 'name']
|
|
31
39
|
}]
|
|
40
|
+
if (hasApprouter) {
|
|
41
|
+
relationships.push({
|
|
42
|
+
insert: [destination, 'name'],
|
|
43
|
+
into: [approuter, 'requires', 'name']
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
if (hasMultitenancy) {
|
|
47
|
+
relationships.push({
|
|
48
|
+
insert: [destination, 'name'],
|
|
49
|
+
into: [mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar'), 'requires', 'name']
|
|
50
|
+
})
|
|
51
|
+
}
|
|
32
52
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { with: project, additions, relationships })
|
|
33
53
|
}
|
|
34
54
|
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
const YAML = require('@sap/cds-foss')('yaml')
|
|
2
1
|
const cds = require('../../../cds')
|
|
3
|
-
const { read } = cds.utils
|
|
2
|
+
const { read, yaml: YAML } = cds.utils
|
|
4
3
|
const { readProject } = require('../../projectReader')
|
|
5
4
|
const { merge } = require('../../merge')
|
|
6
5
|
const { srv4, enterpriseMessaging } = require('../../registries/mta')
|
|
7
6
|
|
|
8
7
|
module.exports = class EnterpriseMessagingTemplate extends require('../../plugin') {
|
|
9
8
|
|
|
9
|
+
static help() {
|
|
10
|
+
return 'messaging via SAP Enterprise Messaging'
|
|
11
|
+
}
|
|
12
|
+
|
|
10
13
|
options() {
|
|
11
14
|
return {
|
|
12
15
|
'cloudevents': {
|
|
13
16
|
type: 'boolean',
|
|
14
17
|
short: 'c',
|
|
15
|
-
help: 'Use CloudEvents formatting',
|
|
18
|
+
help: 'Use CloudEvents formatting.',
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -6,12 +6,16 @@ const { srv4, enterpriseMessaging } = require('../../registries/mta')
|
|
|
6
6
|
|
|
7
7
|
module.exports = class EnterpriseMessagingSharedTemplate extends require('../../plugin') {
|
|
8
8
|
|
|
9
|
+
static help() {
|
|
10
|
+
return 'messaging via shared SAP Enterprise Messaging'
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
options() {
|
|
10
14
|
return {
|
|
11
15
|
'cloudevents': {
|
|
12
16
|
type: 'boolean',
|
|
13
17
|
short: 'c',
|
|
14
|
-
help: 'Use CloudEvents formatting',
|
|
18
|
+
help: 'Use CloudEvents formatting.',
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
}
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
{
|
|
4
4
|
"name": "$XSAPPNAME.cds.ExtensionDeveloper",
|
|
5
5
|
"description": "Extend CAP applications via extension projects"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"name": "$XSAPPNAME.cds.UIFlexDeveloper",
|
|
9
|
-
"description": "Extend CAP applications via UIFlex extensibility"
|
|
10
6
|
}
|
|
11
7
|
],
|
|
12
8
|
"role-templates": [
|
|
@@ -14,13 +10,11 @@
|
|
|
14
10
|
"name": "ExtensionDeveloper",
|
|
15
11
|
"description": "Extension development including UIFlex extensibility",
|
|
16
12
|
"scope-references": [
|
|
17
|
-
"$XSAPPNAME.cds.ExtensionDeveloper"
|
|
18
|
-
"$XSAPPNAME.cds.UIFlexDeveloper"
|
|
13
|
+
"$XSAPPNAME.cds.ExtensionDeveloper"
|
|
19
14
|
]
|
|
20
15
|
}
|
|
21
16
|
],
|
|
22
17
|
"authorities": [
|
|
23
|
-
"$XSAPPNAME.cds.ExtensionDeveloper"
|
|
24
|
-
"$XSAPPNAME.cds.UIFlexDeveloper"
|
|
18
|
+
"$XSAPPNAME.cds.ExtensionDeveloper"
|
|
25
19
|
]
|
|
26
20
|
}
|
|
@@ -6,6 +6,9 @@ const { MULTITENANCY } = require('../../constants').OPTIONS
|
|
|
6
6
|
|
|
7
7
|
module.exports = class ExtensibilityTemplate extends require('../../plugin') {
|
|
8
8
|
|
|
9
|
+
static help() {
|
|
10
|
+
return 'tenant-specific model extensibility'
|
|
11
|
+
}
|
|
9
12
|
|
|
10
13
|
requires() {
|
|
11
14
|
return exists('pom.xml') ? [MULTITENANCY] : [] // REVISIT: Remove this dependency
|
|
@@ -29,7 +32,6 @@ module.exports = class ExtensibilityTemplate extends require('../../plugin') {
|
|
|
29
32
|
project,
|
|
30
33
|
additions: [
|
|
31
34
|
{ in: 'scopes', where: { name: '$XSAPPNAME.cds.ExtensionDeveloper' }},
|
|
32
|
-
{ in: 'scopes', where: { name: '$XSAPPNAME.cds.UIFlexDeveloper' }},
|
|
33
35
|
{ in: 'role-templates', where: { name: 'ExtensionDeveloper' }}
|
|
34
36
|
]
|
|
35
37
|
})
|
|
@@ -4,6 +4,10 @@ const { merge } = require('../../merge')
|
|
|
4
4
|
|
|
5
5
|
module.exports = class FileBasedMessagingTemplate extends require('../../plugin') {
|
|
6
6
|
|
|
7
|
+
static help() {
|
|
8
|
+
return 'messaging via file system'
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
async canRun() {
|
|
8
12
|
const { isJava } = readProject()
|
|
9
13
|
if (isJava) throw `'cds add file-based-messaging' is not available for Java yet`
|
|
@@ -4,6 +4,10 @@ const { H2 } = require('../../constants').OPTIONS
|
|
|
4
4
|
|
|
5
5
|
module.exports = class H2Template extends require('../../plugin') {
|
|
6
6
|
|
|
7
|
+
static help() {
|
|
8
|
+
return 'database support for H2'
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
async canRun() {
|
|
8
12
|
const { isNodejs } = readProject()
|
|
9
13
|
if (isNodejs) throw `'cds add ${H2}' is not available for Node.js`
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deploy",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"
|
|
4
|
+
"hdb": "^0",
|
|
5
|
+
"@sap/hdi-deploy": "^5"
|
|
5
6
|
},
|
|
6
7
|
"engines": {
|
|
7
8
|
"node": "^20.0.0"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"start": "node node_modules/@sap/hdi-deploy/deploy.js",
|
|
11
|
+
"start": "node node_modules/@sap/hdi-deploy/deploy.js --use-hdb",
|
|
11
12
|
"build": "npm i && npx cds build .. --for hana --production"
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#isNodejs}}
|
|
3
2
|
"dependencies": {
|
|
4
|
-
"@
|
|
5
|
-
},
|
|
3
|
+
"@cap-js/hana": "^1"
|
|
4
|
+
}{{#profile}},
|
|
5
|
+
{{#isNodejs}}
|
|
6
6
|
"cds": {
|
|
7
7
|
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#profile}}
|
|
10
9
|
"[{{profile}}]": {
|
|
11
|
-
{{/profile}}
|
|
12
10
|
{{#shortcut}}
|
|
13
11
|
"db": "hana"
|
|
14
12
|
{{/shortcut}}
|
|
@@ -17,11 +15,10 @@
|
|
|
17
15
|
"kind": "hana"
|
|
18
16
|
}
|
|
19
17
|
{{/shortcut}}
|
|
20
|
-
{{#profile}}
|
|
21
18
|
}
|
|
22
|
-
{{/profile}}
|
|
23
19
|
}
|
|
24
20
|
{{#isNodejs}}
|
|
25
21
|
}
|
|
26
22
|
{{/isNodejs}}
|
|
23
|
+
{{/profile}}
|
|
27
24
|
}
|
|
@@ -5,14 +5,16 @@ const { readProject } = require('../../projectReader')
|
|
|
5
5
|
const { merge, removeFromYAML, removeFromYAMLArray } = require('../../merge')
|
|
6
6
|
const mvn = require('../../mvn')
|
|
7
7
|
|
|
8
|
-
const { OPTIONS: { JAVA } } = require('../../constants')
|
|
9
|
-
|
|
10
8
|
const { srv4, hdbDeployer, serviceManager, hdiContainer, mtxSidecar4 } = require('../../registries/mta')
|
|
11
9
|
|
|
12
10
|
module.exports = class HanaTemplate extends require('../../plugin') {
|
|
13
11
|
|
|
12
|
+
static help() {
|
|
13
|
+
return 'database support for SAP HANA'
|
|
14
|
+
}
|
|
15
|
+
|
|
14
16
|
static hasInProduction(env) {
|
|
15
|
-
return env.requires?.db?.kind === 'hana'
|
|
17
|
+
return env.requires?.db?.kind === 'hana' || env.dependencies?.['@cap-js/hana']
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
async run() {
|
|
@@ -26,9 +28,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
26
28
|
|
|
27
29
|
if (isJava) {
|
|
28
30
|
await copy(join(__dirname, 'files', 'db')).to(db.folder)
|
|
29
|
-
|
|
30
|
-
// if called during cds init the project generation call to AT will add settings
|
|
31
|
-
if (!cds.cli.options.add.has(JAVA)) await mvn.execMvn(mvn.getAddHanaCmdArgs())
|
|
31
|
+
await mvn.add('hana')
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
await merge(__dirname, 'files/package.json.hbs').into(configFile, { with: project, forceOverwrite: true }) // REVISIT: forceOverwrite: true as default?
|
|
@@ -42,7 +42,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
42
42
|
|
|
43
43
|
async combine() {
|
|
44
44
|
const project = readProject()
|
|
45
|
-
const { hasMta, hasHelm, hasHelmUnifiedRuntime, hasHtml5Repo, isJava, hasMultitenancy, srvPath } = project
|
|
45
|
+
const { hasMta, hasHelm, hasHelmUnifiedRuntime, hasHtml5Repo, hasContainerize, isJava, hasMultitenancy, srvPath } = project
|
|
46
46
|
|
|
47
47
|
if (hasMta) {
|
|
48
48
|
const srv = srv4(srvPath)
|
|
@@ -98,5 +98,13 @@ module.exports = class HanaTemplate extends require('../../plugin') {
|
|
|
98
98
|
await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
if (hasContainerize && !hasMultitenancy) {
|
|
103
|
+
const additions = [{
|
|
104
|
+
in: 'modules',
|
|
105
|
+
where: { name: `${project.appName}-hana-deployer` }
|
|
106
|
+
}]
|
|
107
|
+
await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions })
|
|
108
|
+
}
|
|
101
109
|
}
|
|
102
110
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
#
|
|
3
|
-
# This file is generated by "cds add helm"
|
|
4
2
|
apiVersion: v2
|
|
5
3
|
name: {{appName}}
|
|
6
4
|
description: {{appDescription}}
|
|
7
5
|
type: application
|
|
8
6
|
version: {{appVersion}}
|
|
9
7
|
appVersion: {{appVersion}}
|
|
10
|
-
|
|
8
|
+
annotations:
|
|
9
|
+
app.kubernetes.io/managed-by: cds-dk/helm
|