@sap/cds-dk 6.8.3 → 7.0.0
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/bin/activate.js +15 -7
- package/bin/add.js +29 -15
- package/bin/bind.js +49 -116
- package/bin/build.js +114 -0
- package/bin/cds.js +67 -24
- package/bin/compile/index.js +2 -2
- package/bin/deploy/index.js +46 -39
- package/bin/deploy/to-hana.js +11 -8
- package/bin/deploy/to-postgres.js +8 -2
- package/bin/deploy/to-sqlite.js +0 -1
- package/bin/env.js +75 -41
- package/bin/eval.js +3 -3
- package/bin/extend.js +17 -10
- package/bin/help.js +22 -21
- package/bin/import.js +10 -7
- package/bin/init.js +38 -17
- package/bin/login.js +69 -55
- package/bin/logout.js +12 -9
- package/bin/migrate.js +10 -4
- package/bin/pull.js +12 -5
- package/bin/push.js +24 -13
- package/bin/repl.js +1 -0
- package/bin/run.js +25 -0
- package/bin/subscribe.js +13 -8
- package/bin/unsubscribe.js +15 -8
- package/bin/upgrade.js +15 -9
- package/bin/util/log.js +24 -0
- package/bin/version.js +124 -0
- package/bin/watch.js +1 -35
- package/bin/watched.js +39 -0
- package/lib/bind/KubernetesApiAccessor.js +2 -2
- package/lib/bind/bindingManager.js +1 -1
- package/lib/bind/bindingUtil.js +0 -9
- package/lib/bind/cfKeyProvider.js +10 -72
- package/lib/bind/index.js +114 -0
- package/lib/bind/kubernetesCredentialsProvider.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +7 -44
- package/lib/build/buildTaskEngine.js +355 -0
- package/lib/build/buildTaskFactory.js +284 -0
- package/lib/build/buildTaskHandler.js +240 -0
- package/lib/build/buildTaskProvider.js +22 -0
- package/lib/build/buildTaskProviderFactory.js +182 -0
- package/lib/build/constants.js +56 -0
- package/lib/build/index.js +21 -0
- package/lib/build/provider/buildTaskHandlerEdmx.js +83 -0
- package/lib/build/provider/buildTaskHandlerFeatureToggles.js +132 -0
- package/lib/build/provider/buildTaskHandlerInternal.js +228 -0
- package/lib/build/provider/buildTaskProviderInternal.js +370 -0
- package/lib/build/provider/fiori/index.js +167 -0
- package/lib/build/provider/hana/2migration.js +179 -0
- package/lib/build/provider/hana/index.js +522 -0
- package/lib/build/provider/hana/migrationtable.js +472 -0
- package/lib/build/provider/hana/template/.hdiconfig-all +163 -0
- package/lib/build/provider/hana/template/.hdiconfig-cloud +137 -0
- package/lib/build/provider/hana/template/.hdinamespace +4 -0
- package/lib/build/provider/hana/template/package.json +12 -0
- package/lib/build/provider/hana/template/undeploy.json +5 -0
- package/lib/build/provider/java/index.js +93 -0
- package/lib/build/provider/java-cf/index.js +1 -0
- package/lib/build/provider/mtx/index.js +37 -0
- package/lib/build/provider/mtx/resourcesTarBuilder.js +94 -0
- package/lib/build/provider/mtx-extension/index.js +131 -0
- package/lib/build/provider/mtx-sidecar/index.js +138 -0
- package/lib/build/provider/node-cf/index.js +1 -0
- package/lib/build/provider/nodejs/index.js +178 -0
- package/lib/build/util.js +263 -0
- package/lib/cds.js +9 -21
- package/lib/client/auth_manager.js +39 -16
- package/lib/client/helper/dependency_helper.js +7 -6
- package/lib/client/push.js +2 -1
- package/lib/client/settings_manager.js +10 -39
- package/lib/deploy/to-hana/hana.js +273 -0
- package/lib/deploy/to-hana/hdiDeployUtil.js +68 -0
- package/lib/deploy/to-hana/mtaUtil.js +171 -0
- package/lib/import/asyncapi/importAsyncAPI.js +3 -2
- package/lib/import/asyncapi/index.js +5 -2
- package/lib/import/asyncapi/parserContext.js +67 -26
- package/lib/import/asyncapi/utils.js +34 -3
- package/lib/import/common.js +40 -30
- package/lib/import/importapi.js +36 -35
- package/lib/index.js +12 -17
- package/lib/init/constants.js +36 -71
- package/lib/init/index.js +18 -52
- package/lib/init/template/_merging/registry-mta.js +21 -3
- package/lib/init/template/approuter/files/mta.yaml.hbs +29 -29
- package/lib/init/template/approuter/files/values.yaml.hbs +5 -5
- package/lib/init/template/approuter/files/xs-app.json.hbs +8 -2
- package/lib/init/template/approuter/index.js +7 -8
- package/lib/init/template/auditlog/files/mta.yaml.hbs +5 -5
- package/lib/init/template/auditlog/files/package.json.hbs +13 -13
- package/lib/init/template/auditlog/index.js +3 -3
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +22 -22
- package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +3 -3
- package/lib/init/template/connectivity/files/mta.yaml.hbs +14 -0
- package/lib/init/template/connectivity/files/package.json.hbs +17 -0
- package/lib/init/template/connectivity/index.js +21 -4
- package/lib/init/template/data/index.js +5 -1
- package/lib/init/template/destination/files/mta.yaml.hbs +14 -0
- package/lib/init/template/destination/files/package.json.hbs +17 -0
- package/lib/init/template/{destinations → destination}/index.js +19 -13
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging/files/xs-security.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +27 -6
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +3 -3
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +5 -5
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +9 -9
- package/lib/init/template/enterprise-messaging-shared/index.js +4 -5
- package/lib/init/template/extensibility/files/package.json.hbs +10 -10
- package/lib/init/template/extensibility/index.js +8 -9
- package/lib/init/template/file-based-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/file-based-messaging/index.js +3 -4
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +21 -21
- package/lib/init/template/hana/files/package.json.hbs +16 -22
- package/lib/init/template/hana/files/values.yaml.hbs +1 -1
- package/lib/init/template/hana/index.js +5 -15
- package/lib/init/template/helm/files/Chart.yaml.hbs +4 -4
- package/lib/init/template/helm/files/values.yaml.hbs +6 -6
- package/lib/init/template/helm/index.js +5 -10
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +37 -31
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +13 -14
- package/lib/init/template/helm/subcharts/content-deployment/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/content-deployment/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.md +116 -116
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/service-instance/templates/_helpers.tpl +9 -9
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +2 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +15 -15
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +2 -0
- package/lib/init/template/helm/subcharts/web-application/templates/NOTES.txt +15 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +23 -23
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +17 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +24 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/values.md +141 -123
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +7 -0
- package/lib/init/template/helm/subcharts/web-application/values.yaml +1 -0
- package/lib/init/template/html5-repo/index.js +4 -5
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/kibana-logging/files/package.json.hbs +9 -9
- package/lib/init/template/kibana-logging/index.js +3 -4
- package/lib/init/template/lint/index.js +3 -3
- package/lib/init/template/mta/files/mta.yaml.hbs +14 -14
- package/lib/init/template/mta/files/package.json +5 -0
- package/lib/init/template/mta/index.js +12 -13
- package/lib/init/template/mtx/index.js +2 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +29 -27
- package/lib/init/template/multitenancy/files/package.json.hbs +17 -14
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -7
- package/lib/init/template/multitenancy/files/values.yaml.hbs +19 -19
- package/lib/init/template/multitenancy/index.js +14 -16
- package/lib/init/template/nodejs/files/package.json.hbs +1 -1
- package/lib/init/template/nodejs/index.js +5 -8
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +5 -5
- package/lib/init/template/redis-messaging/files/package.json.hbs +9 -9
- package/lib/init/template/redis-messaging/index.js +4 -5
- package/lib/init/template/sample/files/app/_i18n/i18n.properties +43 -0
- package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +14 -0
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +114 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +8 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +11 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +129 -0
- package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +57 -0
- package/lib/init/template/sample/files/app/common.cds +263 -0
- package/lib/init/template/sample/files/app/index.html +30 -0
- package/lib/init/template/sample/files/app/services.cds +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -0
- package/lib/init/template/sample/files/db/schema.cds +31 -0
- package/lib/init/template/sample/files/nodejs/admin-service.js +12 -0
- package/lib/init/template/sample/files/nodejs/cat-service.js +26 -0
- package/lib/init/template/sample/files/srv/admin-service.cds +5 -0
- package/lib/init/template/sample/files/srv/cat-service.cds +16 -0
- package/lib/init/template/sample/index.js +24 -0
- package/lib/init/template/sample-tiny/index.js +39 -0
- package/lib/init/template/samples/index.js +5 -56
- package/lib/init/template/sqlite/files/package.json.hbs +13 -13
- package/lib/init/template/sqlite/index.js +2 -2
- package/lib/init/template/templateBase.js +24 -1
- package/lib/init/template/toggles/files/package.json.hbs +10 -10
- package/lib/init/template/toggles/index.js +3 -3
- package/lib/init/template/typer/files/gitignore +1 -0
- package/lib/init/template/typer/files/package.json +8 -0
- package/lib/init/template/typer/files/xsconfig.json +9 -0
- package/lib/init/template/typer/index.js +36 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +12 -12
- package/lib/init/template/xsuaa/files/package.json.hbs +13 -13
- package/lib/init/template/xsuaa/files/values.yaml.hbs +8 -8
- package/lib/init/template/xsuaa/index.js +8 -19
- package/lib/init/util/merge.js +73 -59
- package/lib/init/util/mvn.js +21 -17
- package/lib/init/util/projectReader.js +49 -87
- package/lib/init/util/xml.js +14 -23
- package/lib/util/cfUtil.js +366 -0
- package/lib/util/command.js +3 -3
- package/lib/util/gitUtil.js +55 -0
- package/lib/util/version.js +27 -0
- package/npm-shrinkwrap.json +337 -275
- package/package.json +6 -6
- package/CHANGELOG.md +0 -1460
- package/bin/build/all.js +0 -88
- package/bin/build/index.js +0 -82
- package/lib/compile/index.js +0 -14
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data/my.bookshop-Books.csv +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/db/data-model.cds +0 -0
- /package/lib/init/template/{samples → sample-tiny}/files/nodejs/srv/cat-service.cds.hbs +0 -0
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
# Generated manifest.yml based on template version 0.1.0
|
|
2
|
-
# appName = {{
|
|
3
|
-
# language={{
|
|
4
|
-
# multitenancy={{
|
|
2
|
+
# appName = {{appName}}
|
|
3
|
+
# language={{language}}
|
|
4
|
+
# multitenancy={{isMultitenant}}
|
|
5
5
|
---
|
|
6
6
|
applications:
|
|
7
7
|
# -----------------------------------------------------------------------------------
|
|
8
8
|
# Backend Service
|
|
9
9
|
# -----------------------------------------------------------------------------------
|
|
10
|
-
- name: {{
|
|
10
|
+
- name: {{appName}}-{{srvName}}
|
|
11
11
|
random-route: true # for development only
|
|
12
|
-
{{#
|
|
13
|
-
path: {{&
|
|
12
|
+
{{#isNodejs}}
|
|
13
|
+
path: {{& srvPath}}
|
|
14
14
|
memory: 256M
|
|
15
15
|
buildpack: nodejs_buildpack
|
|
16
|
-
{{/
|
|
17
|
-
{{#
|
|
18
|
-
path: {{&
|
|
16
|
+
{{/isNodejs}}
|
|
17
|
+
{{#isJava}}
|
|
18
|
+
path: {{& srvPath}}/target/{{srvExt.archiveName}}
|
|
19
19
|
memory: 1G
|
|
20
20
|
disk_quota: 512M
|
|
21
21
|
env:
|
|
22
22
|
SPRING_PROFILES_ACTIVE: cloud
|
|
23
23
|
buildpack: java_buildpack
|
|
24
|
-
{{/
|
|
25
|
-
{{#
|
|
24
|
+
{{/isJava}}
|
|
25
|
+
{{#hasRequires}}
|
|
26
26
|
services:
|
|
27
|
-
{{#
|
|
27
|
+
{{#requires}}
|
|
28
28
|
{{#resource.isHana}}
|
|
29
29
|
- {{resource.name}}
|
|
30
30
|
{{/resource.isHana}}
|
|
31
31
|
{{#resource.isXsuaa}}
|
|
32
32
|
- {{resource.name}}
|
|
33
33
|
{{/resource.isXsuaa}}
|
|
34
|
-
{{/
|
|
35
|
-
{{/
|
|
34
|
+
{{/requires}}
|
|
35
|
+
{{/hasRequires}}
|
|
36
36
|
|
|
37
|
-
{{#
|
|
37
|
+
{{#needsSidecar}}
|
|
38
38
|
# -----------------------------------------------------------------------------------
|
|
39
39
|
# HANA Database Content Deployer App
|
|
40
40
|
# -----------------------------------------------------------------------------------
|
|
41
|
-
- name: {{
|
|
42
|
-
path: {{&
|
|
41
|
+
- name: {{appName}}-{{db.0.name}}-deployer
|
|
42
|
+
path: {{& db.0.path}}
|
|
43
43
|
no-route: true
|
|
44
44
|
health-check-type: process
|
|
45
45
|
memory: 256M
|
|
46
46
|
instances: 1
|
|
47
47
|
buildpack: nodejs_buildpack
|
|
48
|
-
{{#
|
|
48
|
+
{{#hasRequires}}
|
|
49
49
|
services:
|
|
50
|
-
{{#
|
|
50
|
+
{{#requires}}
|
|
51
51
|
{{#resource.isHana}}
|
|
52
52
|
- {{resource.name}}
|
|
53
53
|
{{/resource.isHana}}
|
|
54
|
-
{{/
|
|
55
|
-
{{/
|
|
56
|
-
{{/
|
|
54
|
+
{{/requires}}
|
|
55
|
+
{{/hasRequires}}
|
|
56
|
+
{{/needsSidecar}}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Generated services-manifest.yml based on template version 0.1.0
|
|
2
|
-
# appName = {{
|
|
2
|
+
# appName = {{appName}}
|
|
3
3
|
---
|
|
4
4
|
create-services:
|
|
5
|
-
{{#
|
|
5
|
+
{{#requires}}
|
|
6
6
|
# ------------------------------------------------------------
|
|
7
7
|
- name: {{resource.name}}
|
|
8
8
|
{{#resource.isHana}}
|
|
@@ -19,4 +19,4 @@ create-services:
|
|
|
19
19
|
broker: {{resource.service}}
|
|
20
20
|
plan: {{resource.vcap.name}}
|
|
21
21
|
{{/resource.vcap.name}}
|
|
22
|
-
{{/
|
|
22
|
+
{{/requires}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
requires:
|
|
7
|
+
- name: {{appName}}-connectivity
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
- name: {{appName}}-connectivity
|
|
11
|
+
type: org.cloudfoundry.managed-service
|
|
12
|
+
parameters:
|
|
13
|
+
service: connectivity
|
|
14
|
+
service-plan: lite
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const { readProject } = require('../../util/projectReader')
|
|
3
|
-
const { mergeYAML } = require('../../util/merge')
|
|
3
|
+
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
4
4
|
const { copyAndTrack, parseMd5File, writeMd5File } = require('../../util/md5')
|
|
5
|
+
const { srvJava4, srvNode4, connectivity } = require('../_merging/registry-mta')
|
|
5
6
|
|
|
6
7
|
module.exports = class ConnectivityTemplate extends require('../templateBase') {
|
|
7
8
|
|
|
9
|
+
static hasFacet(env) {
|
|
10
|
+
return env.requires.connectivity
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
async run() {
|
|
14
|
+
const projectDescriptor = await readProject(this.options)
|
|
15
|
+
const { configFile } = projectDescriptor
|
|
16
|
+
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
9
17
|
await this.runDependentMerging()
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
async runDependentMerging(context = {}) {
|
|
13
21
|
const projectDescriptor = await readProject(this.options)
|
|
14
|
-
const { hasHelm } = projectDescriptor
|
|
22
|
+
const { isJava, srvPath, hasHelm, hasMta } = projectDescriptor
|
|
23
|
+
|
|
24
|
+
if (hasMta) {
|
|
25
|
+
const srv = (isJava ? srvJava4 : srvNode4)(srvPath)
|
|
26
|
+
const additions = [srv, connectivity]
|
|
27
|
+
const relationships = [{
|
|
28
|
+
insert: [connectivity, 'name'],
|
|
29
|
+
into: [srv, 'requires', 'name']
|
|
30
|
+
}]
|
|
31
|
+
await mergeYAML('mta.yaml', join(__dirname, 'files', 'mta.yaml.hbs'), projectDescriptor, { additions, relationships })
|
|
32
|
+
}
|
|
15
33
|
|
|
16
34
|
if (hasHelm) {
|
|
17
35
|
//in case facet is being added to the already exisiting charts folder
|
|
@@ -20,13 +38,12 @@ module.exports = class ConnectivityTemplate extends require('../templateBase') {
|
|
|
20
38
|
isIndependentCommand = true
|
|
21
39
|
context.oldTrackingData = context.newTrackingData = await parseMd5File(join('chart', '.cds-add-helm-files.md5'))
|
|
22
40
|
}
|
|
23
|
-
|
|
24
41
|
await mergeYAML(
|
|
25
42
|
join('chart', 'values.yaml'),
|
|
26
43
|
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
27
44
|
projectDescriptor,
|
|
28
45
|
{ additions: [{
|
|
29
|
-
in:
|
|
46
|
+
in: 'srv.additionalVolumes',
|
|
30
47
|
where: [{
|
|
31
48
|
property: 'name',
|
|
32
49
|
isEqualTo: 'connectivity-secret'
|
|
@@ -8,6 +8,10 @@ const DEBUG = cds.debug('cli')
|
|
|
8
8
|
module.exports = class DataTemplate extends require('../templateBase') {
|
|
9
9
|
|
|
10
10
|
async run() {
|
|
11
|
+
if (this.options['for']) {
|
|
12
|
+
throw `\nError: Did you mean \`... --data:for\` ?`
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
const env = await this.getEnv();
|
|
12
16
|
|
|
13
17
|
let dest = (typeof this.options.out === 'string') // target folder
|
|
@@ -15,7 +19,7 @@ module.exports = class DataTemplate extends require('../templateBase') {
|
|
|
15
19
|
: getDefaultTargetFolder(env);
|
|
16
20
|
dest = resolve(cds.root, dest);
|
|
17
21
|
|
|
18
|
-
const nameFilter = asRegex(this.options['data:for']
|
|
22
|
+
const nameFilter = asRegex(this.options['data:for'])
|
|
19
23
|
const force = this.options.force;
|
|
20
24
|
|
|
21
25
|
let csn = await cds.compile.to.csn(cds.env.roots) // normal CSN
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
modules:
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
|
+
requires:
|
|
7
|
+
- name: {{appName}}-destination
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
- name: {{appName}}-destination
|
|
11
|
+
type: org.cloudfoundry.managed-service
|
|
12
|
+
parameters:
|
|
13
|
+
service: destination
|
|
14
|
+
service-plan: lite
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const { readProject } = require('../../util/projectReader')
|
|
3
|
-
const { mergeYAML } = require('../../util/merge')
|
|
3
|
+
const { mergeJSON, mergeYAML } = require('../../util/merge')
|
|
4
|
+
const { srvJava4, srvNode4, destination } = require('../_merging/registry-mta')
|
|
4
5
|
const { parseMd5File, writeMd5File } = require('../../util/md5')
|
|
5
6
|
|
|
6
|
-
module.exports = class
|
|
7
|
-
|
|
8
|
-
async canRun() {
|
|
9
|
-
const projectDescriptor = await readProject(this.options)
|
|
10
|
-
const { hasMta, hasHelm } = projectDescriptor.cap
|
|
11
|
-
if (!hasHelm && hasMta) {
|
|
12
|
-
throw `'cds add destinations' is not available for Cloud Foundry yet`
|
|
13
|
-
}
|
|
14
|
-
return true
|
|
15
|
-
}
|
|
7
|
+
module.exports = class DestinationTemplate extends require('../templateBase') {
|
|
16
8
|
|
|
17
9
|
static hasFacet(env) {
|
|
18
10
|
const kinds = { odata: 1, 'odata-v2': 1, 'odata-v4': 1, rest: 1 }
|
|
19
11
|
const mtxServices = { 'cds.xt.SaasProvisioningService': 1, 'cds.xt.DeploymentService': 1, 'cds.xt.ModelProviderService': 1, 'cds.xt.ExtensibilityService': 1 }
|
|
20
12
|
const _fromMtx = service => service in mtxServices
|
|
21
|
-
|
|
13
|
+
const hasDestination = Object.entries(env.requires).some(([service, require]) => !_fromMtx(service) && !kinds[service] && kinds[require.kind])
|
|
14
|
+
return hasDestination || env.requires.destinations
|
|
22
15
|
}
|
|
23
16
|
|
|
24
17
|
async run() {
|
|
18
|
+
const projectDescriptor = await readProject(this.options)
|
|
19
|
+
const { configFile } = projectDescriptor
|
|
20
|
+
await mergeJSON(configFile, join(__dirname, 'files', `package.json.hbs`), projectDescriptor)
|
|
25
21
|
await this.runDependentMerging()
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
async runDependentMerging(context = {}) {
|
|
29
25
|
const projectDescriptor = await readProject(this.options)
|
|
30
|
-
const { hasHelm, hasDestination, hasHtml5Repo } = projectDescriptor
|
|
26
|
+
const { isJava, hasHelm, hasDestination, hasMta, srvPath, hasHtml5Repo } = projectDescriptor
|
|
27
|
+
|
|
28
|
+
if (hasMta) {
|
|
29
|
+
const srv = (isJava ? srvJava4 : srvNode4)(srvPath)
|
|
30
|
+
const additions = [srv, destination]
|
|
31
|
+
const relationships = [{
|
|
32
|
+
insert: [destination, 'name'],
|
|
33
|
+
into: [srv, 'requires', 'name']
|
|
34
|
+
}]
|
|
35
|
+
await mergeYAML('mta.yaml', join(__dirname, 'files', 'mta.yaml.hbs'), projectDescriptor, { additions, relationships })
|
|
36
|
+
}
|
|
31
37
|
|
|
32
38
|
if (hasHelm) {
|
|
33
39
|
//const env = await this.getEnv()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"emname": "{{
|
|
2
|
+
"emname": "{{appName}}-emname",
|
|
3
3
|
"version": "1.1.0",
|
|
4
|
-
"namespace": "default/
|
|
4
|
+
"namespace": "default/{{appName}}/1",
|
|
5
5
|
"options": {
|
|
6
6
|
"management": true,
|
|
7
7
|
"messagingrest": true,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"rules": {
|
|
11
11
|
"topicRules": {
|
|
12
12
|
"publishFilter": [
|
|
13
|
-
"${namespace}
|
|
13
|
+
"${namespace}/*"
|
|
14
14
|
],
|
|
15
15
|
"subscribeFilter": [
|
|
16
16
|
"*"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
6
|
requires:
|
|
7
|
-
- name: {{
|
|
7
|
+
- name: {{appName}}-messaging
|
|
8
8
|
|
|
9
9
|
resources:
|
|
10
|
-
- name: {{
|
|
10
|
+
- name: {{appName}}-messaging
|
|
11
11
|
type: org.cloudfoundry.managed-service
|
|
12
12
|
parameters:
|
|
13
13
|
service: enterprise-messaging
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"cds": {
|
|
4
|
-
{{/
|
|
4
|
+
{{/isNodejs}}
|
|
5
5
|
"requires": {
|
|
6
|
-
{{#
|
|
7
|
-
"[{{
|
|
8
|
-
{{/
|
|
6
|
+
{{#profile}}
|
|
7
|
+
"[{{profile}}]": {
|
|
8
|
+
{{/profile}}
|
|
9
9
|
"messaging": {
|
|
10
10
|
"kind": "enterprise-messaging"
|
|
11
11
|
}
|
|
12
|
-
{{#
|
|
12
|
+
{{#profile}}
|
|
13
13
|
}
|
|
14
|
-
{{/
|
|
14
|
+
{{/profile}}
|
|
15
15
|
}
|
|
16
|
-
{{#
|
|
16
|
+
{{#isNodejs}}
|
|
17
17
|
}
|
|
18
|
-
{{/
|
|
18
|
+
{{/isNodejs}}
|
|
19
19
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopes": [
|
|
3
|
+
{
|
|
4
|
+
"name": "$XSAPPNAME.emmanagement",
|
|
5
|
+
"description": "Enterprise-Messaging Management Access"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "$XSAPPNAME.emcallback",
|
|
9
|
+
"description": "Enterprise-Messaging Callback Access",
|
|
10
|
+
"grant-as-authority-to-apps": [
|
|
11
|
+
"$XSSERVICENAME({{em-service-name}})"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"authorities": [
|
|
16
|
+
"$XSAPPNAME.emmanagement",
|
|
17
|
+
"$XSAPPNAME.mtcallback"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const YAML = require('@sap/cds-foss')('yaml')
|
|
1
2
|
const { join } = require('path')
|
|
2
3
|
const cds = require('../../../cds')
|
|
3
4
|
const { read } = cds.utils
|
|
@@ -9,8 +10,7 @@ const { srvNode4, srvJava4, enterpriseMessaging } = require('../_merging/registr
|
|
|
9
10
|
module.exports = class EnterpriseMessagingTemplate extends require('../templateBase') {
|
|
10
11
|
|
|
11
12
|
async canRun() {
|
|
12
|
-
const
|
|
13
|
-
const { isJava } = projectDescriptor.cap
|
|
13
|
+
const { isJava } = await readProject(this.options)
|
|
14
14
|
if (isJava) throw `'cds add enterprise-messaging' is not available for Java yet`
|
|
15
15
|
return true
|
|
16
16
|
}
|
|
@@ -21,18 +21,17 @@ module.exports = class EnterpriseMessagingTemplate extends require('../templateB
|
|
|
21
21
|
|
|
22
22
|
async run() {
|
|
23
23
|
const projectDescriptor = await readProject(this.options)
|
|
24
|
-
const { configFile } = projectDescriptor
|
|
25
|
-
projectDescriptor.cap.shortcut = !(await read(configFile)).cds?.requires?.messaging?.kind
|
|
24
|
+
const { configFile } = projectDescriptor
|
|
26
25
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
27
|
-
await mergeJSON('event-mesh.json', join(__dirname, 'files', 'event-mesh.json.hbs'), projectDescriptor)
|
|
28
26
|
await this.runDependentMerging()
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
async runDependentMerging(context = {}) {
|
|
32
30
|
const projectDescriptor = await readProject(this.options)
|
|
33
|
-
const { hasHelm, hasMta, isNodejs, srvPath } = projectDescriptor
|
|
31
|
+
const { hasXsuaa, hasHelm, hasMta, isNodejs, srvPath, appName } = projectDescriptor
|
|
34
32
|
|
|
35
33
|
if (hasMta) {
|
|
34
|
+
await mergeJSON('event-mesh.json', join(__dirname, 'files', 'event-mesh.json.hbs'), projectDescriptor)
|
|
36
35
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
37
36
|
await mergeYAML(
|
|
38
37
|
'mta.yaml',
|
|
@@ -48,6 +47,28 @@ module.exports = class EnterpriseMessagingTemplate extends require('../templateB
|
|
|
48
47
|
)
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
if (hasXsuaa) {
|
|
51
|
+
if (hasMta) {
|
|
52
|
+
projectDescriptor['em-service-name'] = YAML.parse(await read('mta.yaml'))?.resources?.find(r => r?.parameters?.service === 'enterprise-messaging')?.name
|
|
53
|
+
} else {
|
|
54
|
+
projectDescriptor['em-service-name'] = `${appName}-messaging`
|
|
55
|
+
}
|
|
56
|
+
await mergeJSON(
|
|
57
|
+
'xs-security.json',
|
|
58
|
+
join(__dirname, 'files', 'xs-security.json.hbs'),
|
|
59
|
+
projectDescriptor,
|
|
60
|
+
{
|
|
61
|
+
additions: [{
|
|
62
|
+
in: 'scopes',
|
|
63
|
+
where: [{ property: 'name', isEqualTo: '$XSAPPNAME.emcallback' }],
|
|
64
|
+
}, {
|
|
65
|
+
in: 'scopes',
|
|
66
|
+
where: [{ property: 'name', isEqualTo: '$XSAPPNAME.emmanagement' }],
|
|
67
|
+
}]
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
51
72
|
if (hasHelm) {
|
|
52
73
|
//in case facet is being added to the already exisiting charts folder
|
|
53
74
|
let isIndependentCommand = false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"emname": "{{
|
|
2
|
+
"emname": "{{appName}}-emname",
|
|
3
3
|
"version": "1.1.0",
|
|
4
|
-
"namespace": "default/
|
|
4
|
+
"namespace": "default/{{appName}}/1",
|
|
5
5
|
"options": {
|
|
6
6
|
"management": true,
|
|
7
7
|
"messagingrest": true,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"rules": {
|
|
11
11
|
"topicRules": {
|
|
12
12
|
"publishFilter": [
|
|
13
|
-
"${namespace}
|
|
13
|
+
"${namespace}/*"
|
|
14
14
|
],
|
|
15
15
|
"subscribeFilter": [
|
|
16
16
|
"*"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
modules:
|
|
3
|
-
- name: {{
|
|
4
|
-
type: {{
|
|
5
|
-
path: {{&
|
|
3
|
+
- name: {{appName}}-srv
|
|
4
|
+
type: {{language}}
|
|
5
|
+
path: {{& srvPath}}
|
|
6
6
|
requires:
|
|
7
|
-
- name: {{
|
|
7
|
+
- name: {{appName}}-messaging
|
|
8
8
|
|
|
9
9
|
resources:
|
|
10
|
-
- name: {{
|
|
10
|
+
- name: {{appName}}-messaging
|
|
11
11
|
type: org.cloudfoundry.managed-service
|
|
12
12
|
parameters:
|
|
13
13
|
service: enterprise-messaging
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@sap/xb-msg-amqp-v100": "^0"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
{{/
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
12
|
"messaging": {
|
|
13
13
|
"kind": "enterprise-messaging-shared"
|
|
14
14
|
}
|
|
15
|
-
{{#
|
|
15
|
+
{{#profile}}
|
|
16
16
|
}
|
|
17
|
-
{{/
|
|
17
|
+
{{/profile}}
|
|
18
18
|
}
|
|
19
|
-
{{#
|
|
19
|
+
{{#isNodejs}}
|
|
20
20
|
}
|
|
21
|
-
{{/
|
|
21
|
+
{{/isNodejs}}
|
|
22
22
|
}
|
|
@@ -8,8 +8,7 @@ const { srvNode4, srvJava4, enterpriseMessaging } = require('../_merging/registr
|
|
|
8
8
|
module.exports = class EnterpriseMessagingSharedTemplate extends require('../templateBase') {
|
|
9
9
|
|
|
10
10
|
async canRun() {
|
|
11
|
-
const
|
|
12
|
-
const { hasMta, hasHelm, isJava } = projectDescriptor.cap
|
|
11
|
+
const { hasMta, hasHelm, isJava } = await readProject(this.options)
|
|
13
12
|
if (isJava) throw `'cds add enterprise-messaging-shared' is not available for Java yet`
|
|
14
13
|
if (hasHelm && !hasMta) throw `'cds add enterprise-messaging-shared' is not available for Kyma yet`
|
|
15
14
|
return true
|
|
@@ -21,8 +20,8 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../tem
|
|
|
21
20
|
|
|
22
21
|
async run() {
|
|
23
22
|
const projectDescriptor = await readProject(this.options)
|
|
24
|
-
const { configFile } = projectDescriptor
|
|
25
|
-
projectDescriptor.
|
|
23
|
+
const { configFile } = projectDescriptor
|
|
24
|
+
projectDescriptor.shortcut = !(await read(configFile)).cds?.requires?.messaging?.kind
|
|
26
25
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
27
26
|
await mergeJSON('event-mesh.json', join(__dirname, 'files', 'event-mesh.json.hbs'), projectDescriptor)
|
|
28
27
|
await this.runDependentMerging()
|
|
@@ -30,7 +29,7 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../tem
|
|
|
30
29
|
|
|
31
30
|
async runDependentMerging() {
|
|
32
31
|
const projectDescriptor = await readProject(this.options)
|
|
33
|
-
const { hasMta, isNodejs, srvPath } = projectDescriptor
|
|
32
|
+
const { hasMta, isNodejs, srvPath } = projectDescriptor
|
|
34
33
|
|
|
35
34
|
if (hasMta) {
|
|
36
35
|
const srv = (isNodejs ? srvNode4 : srvJava4)(srvPath)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@sap/cds-mtxs": "^1"
|
|
4
|
+
"@sap/cds-mtxs": "^1.9"
|
|
5
5
|
},
|
|
6
6
|
"cds": {
|
|
7
|
-
{{/
|
|
7
|
+
{{/isNodejs}}
|
|
8
8
|
"requires": {
|
|
9
|
-
{{#
|
|
10
|
-
"[{{
|
|
11
|
-
{{/
|
|
9
|
+
{{#profile}}
|
|
10
|
+
"[{{profile}}]": {
|
|
11
|
+
{{/profile}}
|
|
12
12
|
"extensibility": true
|
|
13
|
-
{{#
|
|
13
|
+
{{#profile}}
|
|
14
14
|
}
|
|
15
|
-
{{/
|
|
15
|
+
{{/profile}}
|
|
16
16
|
}
|
|
17
|
-
{{#
|
|
17
|
+
{{#isNodejs}}
|
|
18
18
|
}
|
|
19
|
-
{{/
|
|
19
|
+
{{/isNodejs}}
|
|
20
20
|
}
|
|
@@ -3,13 +3,17 @@ const { exists } = cds.utils
|
|
|
3
3
|
const { join } = require('path')
|
|
4
4
|
const { readProject } = require('../../util/projectReader')
|
|
5
5
|
const { mergeJSON } = require('../../util/merge')
|
|
6
|
-
const {
|
|
6
|
+
const { MULTITENANCY } = require('../../constants').OPTIONS
|
|
7
7
|
|
|
8
8
|
module.exports = class ExtensibilityTemplate extends require('../templateBase') {
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
getDependencies() {
|
|
12
|
-
return exists('pom.xml') ? [
|
|
12
|
+
return exists('pom.xml') ? [MULTITENANCY] : [] // REVISIT: Remove this dependency
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getRelatedFacets() {
|
|
16
|
+
return ['approuter']
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
static hasFacet(env) {
|
|
@@ -18,14 +22,14 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
18
22
|
|
|
19
23
|
async run() {
|
|
20
24
|
const projectDescriptor = await readProject(this.options)
|
|
21
|
-
const { configFile } = projectDescriptor
|
|
25
|
+
const { configFile } = projectDescriptor
|
|
22
26
|
await mergeJSON(configFile, join(__dirname, 'files', 'package.json.hbs'), projectDescriptor)
|
|
23
27
|
await this.runDependentMerging()
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
async runDependentMerging() {
|
|
27
31
|
const projectDescriptor = await readProject(this.options)
|
|
28
|
-
const { hasXsuaa
|
|
32
|
+
const { hasXsuaa } = projectDescriptor
|
|
29
33
|
if (hasXsuaa) {
|
|
30
34
|
await mergeJSON(
|
|
31
35
|
'xs-security.json',
|
|
@@ -45,10 +49,5 @@ module.exports = class ExtensibilityTemplate extends require('../templateBase')
|
|
|
45
49
|
}
|
|
46
50
|
)
|
|
47
51
|
}
|
|
48
|
-
if (hasApprouter) {
|
|
49
|
-
const ApprouterTemplate = require(`../approuter`)
|
|
50
|
-
const approuterTemplate = new ApprouterTemplate(this.generator)
|
|
51
|
-
await approuterTemplate.runDependentMerging()
|
|
52
|
-
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
{{#
|
|
2
|
+
{{#isNodejs}}
|
|
3
3
|
"cds": {
|
|
4
|
-
{{/
|
|
4
|
+
{{/isNodejs}}
|
|
5
5
|
"requires": {
|
|
6
|
-
{{#
|
|
7
|
-
"[{{
|
|
8
|
-
{{/
|
|
6
|
+
{{#profile}}
|
|
7
|
+
"[{{profile}}]": {
|
|
8
|
+
{{/profile}}
|
|
9
9
|
"messaging": {
|
|
10
10
|
"kind": "file-based-messaging"
|
|
11
11
|
}
|
|
12
|
-
{{#
|
|
12
|
+
{{#profile}}
|
|
13
13
|
}
|
|
14
|
-
{{/
|
|
14
|
+
{{/profile}}
|
|
15
15
|
}
|
|
16
|
-
{{#
|
|
16
|
+
{{#isNodejs}}
|
|
17
17
|
}
|
|
18
|
-
{{/
|
|
18
|
+
{{/isNodejs}}
|
|
19
19
|
}
|