@sap/cds-dk 9.4.3 → 9.5.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/bin/compile/index.js +1 -1
  3. package/bin/export.js +1 -1
  4. package/bin/help.js +0 -1
  5. package/bin/import.js +8 -3
  6. package/bin/repl.js +7 -11
  7. package/bin/up.js +150 -20
  8. package/bin/util/containerize.js +66 -25
  9. package/bin/version.js +4 -4
  10. package/lib/bind/k8s.js +1 -1
  11. package/lib/build/plugins/helm/files/templates/_deployment_helpers.tpl +1 -1
  12. package/lib/build/plugins/helm/index.js +1 -1
  13. package/lib/build/provider/hana/2migration.js +16 -24
  14. package/lib/build/provider/hana/index.js +1 -1
  15. package/lib/build/provider/hana/template/.hdiconfig-all +7 -1
  16. package/lib/build/provider/hana/template/package.json +1 -1
  17. package/lib/build/provider/internalBuildPlugin.js +15 -1
  18. package/lib/build/provider/java/index.js +12 -1
  19. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  20. package/lib/build/provider/nodejs/index.js +2 -1
  21. package/lib/build/util.js +3 -3
  22. package/lib/compile/to_openapi.js +1 -5
  23. package/lib/import/common.js +2 -1
  24. package/lib/import/odata/ParserContext.js +1 -0
  25. package/lib/import/odata/v4parser.js +48 -3
  26. package/lib/import/openapi/importOpenAPI.js +6 -1
  27. package/lib/init/constants.js +1 -1
  28. package/lib/init/index.js +15 -6
  29. package/lib/init/merge.js +16 -0
  30. package/lib/init/projectReader.js +19 -4
  31. package/lib/init/registries/mta.js +2 -2
  32. package/lib/init/template/ams/index.js +1 -1
  33. package/lib/init/template/app-frontend/files/app-package.json.hbs +1 -7
  34. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +20 -1
  35. package/lib/init/template/app-frontend/index.js +0 -4
  36. package/lib/init/template/application-logging/index.js +9 -14
  37. package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
  38. package/lib/init/template/approuter/index.js +6 -7
  39. package/lib/init/template/cloud-logging/index.js +2 -3
  40. package/lib/init/template/containerize/files/containerize.yaml.hbs +17 -2
  41. package/lib/init/template/containerize/index.js +0 -4
  42. package/lib/init/template/data/as-json.js +18 -20
  43. package/lib/init/template/dynatrace/index.js +0 -2
  44. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +16 -1
  45. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +20 -0
  46. package/lib/init/template/github-actions/index.js +5 -8
  47. package/lib/init/template/hana/files/db/package.json +2 -2
  48. package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
  49. package/lib/init/template/hana/index.js +3 -5
  50. package/lib/init/template/helm/index.js +2 -7
  51. package/lib/init/template/helm-unified-runtime/index.js +0 -4
  52. package/lib/init/template/html5-repo/files/app-package.json.hbs +1 -7
  53. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +20 -1
  54. package/lib/init/template/html5-repo/index.js +6 -12
  55. package/lib/init/template/ias/files/values.yaml.hbs +6 -6
  56. package/lib/init/template/ias/index.js +12 -20
  57. package/lib/init/template/kyma/index.js +14 -1
  58. package/lib/init/template/malware-scanner/files/mta.yaml.hbs +3 -1
  59. package/lib/init/template/malware-scanner/files/values.yaml +3 -1
  60. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -3
  61. package/lib/init/template/multitenancy/files/values.yaml.hbs +8 -0
  62. package/lib/init/template/multitenancy/index.js +8 -3
  63. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  64. package/lib/init/template/pipeline/files/app-package.json.hbs +1 -7
  65. package/lib/init/template/pipeline/files/ui5.yaml.hbs +20 -1
  66. package/lib/init/template/pipeline/index.js +1 -2
  67. package/lib/init/template/portal/files/mta.yaml.hbs +5 -3
  68. package/lib/init/template/portal/index.js +3 -6
  69. package/lib/init/template/sample/files/_i18n/i18n_de.properties +12 -0
  70. package/lib/init/template/sample/files/_i18n/i18n_en.properties +21 -0
  71. package/lib/init/template/sample/files/_i18n/i18n_fr.properties +20 -0
  72. package/lib/init/template/sample/files/_i18n/messages_de.properties +34 -0
  73. package/lib/init/template/sample/files/_i18n/messages_en.properties +34 -0
  74. package/lib/init/template/sample/files/_i18n/messages_fr.properties +34 -0
  75. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +0 -26
  76. package/lib/init/template/sample/files/app/_i18n/i18n_en.properties +8 -0
  77. package/lib/init/template/sample/files/app/admin-authors/fiori-service.cds +52 -0
  78. package/lib/init/template/sample/files/app/admin-authors/webapp/Component.js.hbs +3 -0
  79. package/lib/init/template/sample/files/app/admin-authors/webapp/i18n/i18n.properties +11 -0
  80. package/lib/init/template/sample/files/app/admin-authors/webapp/manifest.json +130 -0
  81. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +81 -88
  82. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js.hbs +3 -0
  83. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n.properties +10 -2
  84. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +24 -48
  85. package/lib/init/template/sample/files/app/appconfig/fioriSandboxConfig.json +54 -3
  86. package/lib/init/template/sample/files/app/browse/fiori-service.cds +30 -30
  87. package/lib/init/template/sample/files/app/browse/webapp/Component.js.hbs +3 -0
  88. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +10 -3
  89. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +18 -23
  90. package/lib/init/template/sample/files/app/common.cds +126 -158
  91. package/lib/init/template/sample/files/app/fiori-apps.html +30 -0
  92. package/lib/init/template/sample/files/app/genres/fiori-service.cds +33 -0
  93. package/lib/init/template/sample/files/app/genres/tree-view.cds +42 -0
  94. package/lib/init/template/sample/files/app/genres/value-help.cds +6 -0
  95. package/lib/init/template/sample/files/app/genres/webapp/Component.js.hbs +3 -0
  96. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n.properties +4 -0
  97. package/lib/init/template/sample/files/app/genres/webapp/i18n/i18n_de.properties +2 -0
  98. package/lib/init/template/sample/files/app/genres/webapp/manifest.json +126 -0
  99. package/lib/init/template/sample/files/app/services.cds +6 -2
  100. package/lib/init/template/sample/files/db/currencies.cds +13 -0
  101. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +5 -5
  102. package/lib/init/template/sample/files/db/data/{sap.capire.bookshop-Books_texts.csv → sap.capire.bookshop-Books.texts.csv} +4 -4
  103. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +42 -15
  104. package/lib/init/template/sample/files/db/data/sap.common-Currencies.csv +12 -0
  105. package/lib/init/template/sample/files/db/data/sap.common-Currencies.texts.csv +15 -0
  106. package/lib/init/template/sample/files/db/hana/index.cds +10 -0
  107. package/lib/init/template/sample/files/db/schema.cds +35 -22
  108. package/lib/init/template/sample/files/db/sqlite/index.cds +10 -0
  109. package/lib/init/template/sample/files/package.json.hbs +14 -1
  110. package/lib/init/template/sample/files/srv/access-control.cds +3 -0
  111. package/lib/init/template/sample/files/srv/admin-service.cds +3 -2
  112. package/lib/init/template/sample/files/srv/cat-service.cds +7 -11
  113. package/lib/init/template/sample/index.js +26 -17
  114. package/lib/init/template/telemetry/index.js +1 -3
  115. package/lib/init/template/typescript/files/package.json +1 -1
  116. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +0 -5
  117. package/lib/init/template/workzone-standard/index.js +0 -1
  118. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -0
  119. package/lib/init/template/xsuaa/index.js +3 -5
  120. package/lib/lint/Linter.js +10 -4
  121. package/lib/lint/eslintHelp.json +1 -1
  122. package/lib/mtx/tenant_action.js +12 -4
  123. package/lib/util/checksum.js +32 -0
  124. package/lib/util/question.js +60 -7
  125. package/npm-shrinkwrap.json +59 -35
  126. package/package.json +2 -2
  127. package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +0 -25
  128. package/lib/init/template/github-actions/files/cf-setup/action.yaml +0 -53
  129. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +0 -25
  130. package/lib/init/template/pipeline/files/ui5-deploy.yaml.hbs +0 -25
  131. package/lib/init/template/sample/files/app/_i18n/i18n.properties +0 -29
  132. package/lib/init/template/sample/files/app/admin-books/webapp/Component.js +0 -8
  133. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +0 -3
  134. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +0 -3
  135. package/lib/init/template/sample/files/app/browse/webapp/Component.js +0 -7
  136. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +0 -3
  137. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +0 -4
  138. package/lib/init/template/sample/files/app/index.html +0 -32
@@ -1,6 +1,7 @@
1
1
  const cds = require('../../../cds')
2
2
  const { merge, sort } = require('../../merge')
3
3
 
4
+ const mvn = require('../../mvn')
4
5
  const { readProject } = require('../../projectReader')
5
6
  const { srv4, mtxSidecar4, approuter } = require('../../registries/mta')
6
7
 
@@ -32,6 +33,7 @@ module.exports = class extends require('../../plugin') {
32
33
  await sort('package.json', 'dependencies')
33
34
  } else if (isJava) {
34
35
  await merge(__dirname, 'files/java-cdsrc.json.hbs').into('.cdsrc.json', { with: project })
36
+ await mvn.add('APPLICATION_LOGGING')
35
37
  }
36
38
  }
37
39
 
@@ -50,7 +52,6 @@ module.exports = class extends require('../../plugin') {
50
52
  const additions = [cloudLogging], relationships = []
51
53
  const srv = srv4(srvPath)
52
54
  if (addMta) {
53
- additions.push(srv)
54
55
  relationships.push({
55
56
  insert: [cloudLogging, 'name'],
56
57
  into: [srv, 'requires', 'name']
@@ -58,14 +59,12 @@ module.exports = class extends require('../../plugin') {
58
59
  }
59
60
  if (addMultitenancy) {
60
61
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
61
- additions.push(mtxSidecar)
62
62
  relationships.push({
63
63
  insert: [cloudLogging, 'name'],
64
64
  into: [mtxSidecar, 'requires', 'name']
65
65
  })
66
66
  }
67
67
  if (addApprouter) {
68
- additions.push(approuter)
69
68
  relationships.push({
70
69
  insert: [cloudLogging, 'name'],
71
70
  into: [approuter, 'requires', 'name']
@@ -2,10 +2,25 @@
2
2
  _schema-version: '1.0'
3
3
  repository: {{& imageRegistry}}
4
4
  tag: latest
5
- {{#isJava}}
5
+ {{#hasHelmUnifiedRuntime}}
6
+ {{#isJava}}
6
7
  before-all:
8
+ - helm dependency update ./gen/chart
7
9
  - mvn clean package -DskipTests=true --batch-mode
8
- {{/isJava}}
10
+ {{/isJava}}
11
+ {{/hasHelmUnifiedRuntime}}
12
+ {{^hasJava}}
13
+ {{#hasHelmUnifiedRuntime}}
14
+ before-all:
15
+ - helm dependency update ./gen/chart
16
+ {{/hasHelmUnifiedRuntime}}
17
+ {{/hasJava}}
18
+ {{^hasHelmUnifiedRuntime}}
19
+ {{#hasJava}}
20
+ before-all:
21
+ - mvn clean package -DskipTests=true --batch-mode
22
+ {{/hasJava}}
23
+ {{/hasHelmUnifiedRuntime}}
9
24
  modules:
10
25
  - name: {{appName}}-srv
11
26
  build-parameters:
@@ -5,10 +5,6 @@ const { merge } = require('../../merge')
5
5
 
6
6
  module.exports = class ContainerizeTemplate extends require('../../plugin') {
7
7
 
8
- static help() {
9
- return 'containerization using ctz CLI'
10
- }
11
-
12
8
  static hasInProduction () {
13
9
  return exists('containerize.yaml')
14
10
  }
@@ -12,7 +12,7 @@ const MAX_ASSOC_DEPTH = 5
12
12
  * @param {object} csn the model
13
13
  * @param {Number} numRecords the number of records to be created for each artifact
14
14
  * @param {{referenceData? : Record<string, string}} options misc. options
15
- * @returns {Record<string, object[]>} the filled data
15
+ * @returns {Promise<Record<string, object[]>>} the filled data
16
16
  */
17
17
  const asJson = module.exports = async (data, csn, numRecords=1, options={}) => {
18
18
  let { referenceData, contentType, artifact='entity' } = options
@@ -66,10 +66,10 @@ const asJson = module.exports = async (data, csn, numRecords=1, options={}) => {
66
66
  data[name] = uniqRecords(data[name], artifact)
67
67
  }
68
68
  for (let [key, d] of Object.entries(data)) {
69
- if (contentType === 'json' && d.deleteReference && !d.keepReferece) {
69
+ if (contentType === 'json' && d.deleteReference && !d.keepReference) {
70
70
  delete data[key]
71
71
  }
72
- delete d.keepReferece
72
+ delete d.keepReference
73
73
  delete d.deleteReference
74
74
  uniqRecords(d, csn.definitions[key])
75
75
  }
@@ -235,7 +235,10 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
235
235
  const prec = element.precision ? Math.min(Math.pow(10, element.precision - scale) - 1, Number.MAX_SAFE_INTEGER) : 100
236
236
  const range = { from: 0, to: prec }
237
237
  annotatedIntRange(element, range)
238
- return +(randomDecimalInRange(range).toFixed(scale))
238
+ if (scale === 0) return randomIntInRange(range)
239
+ const intPart = randomIntInRange(range)
240
+ const frac = Math.floor(randomUnit() * Math.pow(10, scale))
241
+ return +(intPart + frac / Math.pow(10, scale)).toFixed(scale)
239
242
  }
240
243
  case 'cds.Double': {
241
244
  const range = {from: 0, to: 100}
@@ -287,7 +290,7 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
287
290
  else if (!targetRecords) // target entity is not in the list of entities to be created
288
291
  return
289
292
 
290
- if (targetRecords.length > 0) { // use record generated by following asociation
293
+ if (targetRecords.length > 0) { // use record generated by following association
291
294
  targetRecord = targetRecords.at(-1) // make sure the localized record references the newly generated texts
292
295
  } else {
293
296
  targetRecord = fillRecord({}, randomNumber(), target, csn, data, artifact, depth+1, referenceData)
@@ -295,7 +298,7 @@ function dataForField(element, artifact, csn, record, data, parent, depth, refer
295
298
  targetRecords.push(targetRecord)
296
299
  uniqRecords(targetRecords, target)
297
300
  }
298
- if (parent && (parent.name != artifact.name)) data[target.name].keepReferece = true
301
+ if (parent && (parent.name != artifact.name)) data[target.name].keepReference = true
299
302
  }
300
303
  }
301
304
 
@@ -371,7 +374,7 @@ asJson.randomFromReferenceData = function(entity, csn, referenceData) {
371
374
  /* whether the given name matches the entity or one of its projections */
372
375
  function matchesEntityOrProjection(name, entity, csn) {
373
376
  if (name === entity?.name) return true
374
- // follow simle projections
377
+ // follow simple projections
375
378
  const p = entity?.query?.SELECT || entity?.projection
376
379
  if (p?.from?.ref?.length === 1) {
377
380
  if (p.from.ref[0] === name) return true
@@ -551,21 +554,13 @@ function randomDateInRange(dateRange) {
551
554
  return returnDate
552
555
  }
553
556
 
554
- function randomDecimalInRange(decimalRange) {
555
- const max = decimalRange.to
556
- const min = decimalRange.from
557
- const num = max === 0 ? 0 : min + (randomNumber() % (max - min))
558
- let dec = randomNumber()
559
- const divider = Math.pow(10, dec.toString().length)
560
- dec = dec / divider
561
- const returnValue = num + dec
562
- return returnValue
557
+ function randomDecimalInRange({ from: min, to: max }) {
558
+ return min + randomUnit() * (max - min)
563
559
  }
564
560
 
565
- function randomIntInRange(intRange) {
566
- const max = intRange.to
567
- const min = intRange.from
568
- return min + (randomNumber() % max)
561
+ function randomIntInRange({ from: min, to: max }) {
562
+ const span = Math.max(0, max - min + 1)
563
+ return min + Math.floor(randomUnit() * span)
569
564
  }
570
565
 
571
566
  const p = 5651;
@@ -575,3 +570,6 @@ function randomNumber() {
575
570
  counter = (counter * counter) % M
576
571
  return counter;
577
572
  }
573
+ function randomUnit() {
574
+ return randomNumber() / (M - 1) // ~[0,1]
575
+ }
@@ -37,7 +37,6 @@ module.exports = class extends require('../../plugin') {
37
37
  const additions = [dynatrace], relationships = []
38
38
  if (addMta) {
39
39
  const srv = srv4(srvPath)
40
- additions.push(srv)
41
40
  relationships.push({
42
41
  insert: [dynatrace, 'name'],
43
42
  into: [srv, 'requires', 'name']
@@ -45,7 +44,6 @@ module.exports = class extends require('../../plugin') {
45
44
  }
46
45
  if (addMultitenancy) {
47
46
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
48
- additions.push(mtxSidecar)
49
47
  relationships.push({
50
48
  insert: [dynatrace, 'name'],
51
49
  into: [mtxSidecar, 'requires', 'name']
@@ -29,7 +29,22 @@ jobs:
29
29
  - uses: actions/setup-node@v5
30
30
  with:
31
31
  node-version: 22
32
- - uses: ./.github/actions/cf-setup
32
+ {{#isJava}}
33
+ - uses: actions/setup-java@v5
34
+ with:
35
+ distribution: sapmachine
36
+ java-version: 21
37
+ cache: maven
38
+ {{#sap}}
39
+ - name: Install Maven
40
+ run: |
41
+ MAVEN_VERSION=3.9.6
42
+ curl -fsSL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -o maven.tgz
43
+ tar -xzf maven.tgz
44
+ echo "${PWD}/apache-maven-${MAVEN_VERSION}/bin" >> "$GITHUB_PATH"
45
+ {{/sap}}
46
+ {{/isJava}}
47
+ - uses: cap-js/cf-setup@v1
33
48
  with:
34
49
  cf-api: {{#literal}}${{ vars.CF_API }}{{/literal}}
35
50
  cf-org: {{#literal}}${{ vars.CF_ORG }}{{/literal}}
@@ -21,4 +21,24 @@ jobs:
21
21
  node-version: 22
22
22
  - uses: actions/checkout@v5
23
23
  - run: npm install
24
+ {{#isJava}}
25
+ - uses: actions/setup-java@v5
26
+ with:
27
+ distribution: sapmachine
28
+ java-version: 21
29
+ cache: maven
30
+ {{#sap}}
31
+ - name: Install Maven
32
+ run: |
33
+ MAVEN_VERSION=3.9.6
34
+ curl -fsSL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -o maven.tgz
35
+ tar -xzf maven.tgz
36
+ echo "${PWD}/apache-maven-${MAVEN_VERSION}/bin" >> "$GITHUB_PATH"
37
+ {{/sap}}
38
+ {{/isJava}}
39
+ {{#isNodejs}}
24
40
  - run: npm test
41
+ {{/isNodejs}}
42
+ {{#isJava}}
43
+ - run: mvn test -B
44
+ {{/isJava}}
@@ -24,9 +24,11 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
24
24
  }
25
25
 
26
26
  async run() {
27
+ const { hasMta, hasHelm, isJava } = readProject()
27
28
  const test = `.github/workflows/test.yaml`
28
- if (!exists(test) || cds.cli.options.force) {
29
- await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), test, { sap: cds.cli.options.sap })
29
+ const { force, sap } = cds.cli.options
30
+ if (!exists(test) || force) {
31
+ await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), test, { sap, isJava })
30
32
  } else {
31
33
  console.log('> skipping ' + test)
32
34
  }
@@ -41,8 +43,7 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
41
43
  githubSlug = '<org/repo>'
42
44
  // console.log(`\ncould not determine GitHub URL for the project – replace '<org/repo>' in ${release}`, DEBUG ? error : '')
43
45
  }
44
- const { hasMta, hasHelm } = readProject()
45
- await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { sap: cds.cli.options.sap, githubSlug, hasMta, hasHelm })
46
+ await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { isJava, sap: cds.cli.options.sap, githubSlug, hasMta, hasHelm })
46
47
  } else {
47
48
  console.log('> skipping ' + release)
48
49
  }
@@ -57,10 +58,6 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
57
58
  if (force || !exists(cf)) {
58
59
  await renderAndCopy(path.join(__dirname, 'files/workflows/cf.yaml.hbs'), cf, project)
59
60
  }
60
- const cfSetup = '.github/actions/cf-setup'
61
- if (force || !exists(cfSetup)) {
62
- await copy(path.join(__dirname, 'files/cf-setup'), cfSetup)
63
- }
64
61
  }
65
62
  if (addHelm) {
66
63
  const kyma = '.github/workflows/kyma.yaml'
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "deploy",
3
3
  "dependencies": {
4
- "hdb": "^0",
4
+ "hdb": "^2.0.0",
5
5
  "@sap/hdi-deploy": "^5"
6
6
  },
7
7
  "engines": {
8
- "node": "^22.0.0"
8
+ "node": "^24.0.0"
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node node_modules/@sap/hdi-deploy/deploy.js --use-hdb --parameter com.sap.hana.di.table/try_fast_table_migration=true",
@@ -6,7 +6,6 @@ modules:
6
6
  requires:
7
7
  - name: {{appName}}-db
8
8
 
9
- {{^hasMultitenancy}}
10
9
  - name: {{appName}}-db-deployer
11
10
  type: hdb
12
11
  path: {{& db.path}}
@@ -20,15 +19,12 @@ modules:
20
19
  {{/isJava}}
21
20
  requires:
22
21
  - name: {{appName}}-db
23
- {{/hasMultitenancy}}
24
22
 
25
- {{#hasMultitenancy}}
26
23
  - name: {{appName}}-mtx
27
24
  type: nodejs
28
25
  path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
29
26
  requires:
30
27
  - name: {{appName}}-db
31
- {{/hasMultitenancy}}
32
28
 
33
29
  resources:
34
30
  - name: {{appName}}-db
@@ -23,8 +23,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
23
23
  const { isJava, configFile, db } = project
24
24
  project.shortcut = !exists(configFile) || typeof (await read(configFile)).cds?.requires?.db !== 'object'
25
25
 
26
- // REVISIT: Let cds build generate those by default
27
- await merge(__dirname, 'files/src/.hdiconfig').into(join(db.folder, 'src/.hdiconfig'))
26
+ // cds10: Let cds build generate this by default
28
27
  await merge(__dirname, 'files/undeploy.json').into(join(db.folder, 'undeploy.json'))
29
28
 
30
29
  if (isJava) {
@@ -46,7 +45,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
46
45
  const project = readProject()
47
46
  const { addMta, hasMta, addHelm, addHelmUnifiedRuntime, addMultitenancy, addContainerize, isJava, hasHelm, hasHelmUnifiedRuntime, hasMultitenancy, srvPath } = project
48
47
 
49
- if (addMta || (addMultitenancy && hasMta)) {
48
+ if (addMta || addMultitenancy && hasMta) {
50
49
  const srv = srv4(srvPath)
51
50
  const db = hasMultitenancy ? serviceManager : hdiContainer
52
51
  const deletions = hasMultitenancy ? [{
@@ -82,13 +81,12 @@ module.exports = class HanaTemplate extends require('../../plugin') {
82
81
 
83
82
  const modules = hasMultitenancy ? [srv] : [srv, hdbDeployer]
84
83
  await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
85
- with: project, additions: [...modules, db].filter(a => a), deletions, relationships
84
+ with: project, additions: [...modules, db], deletions, relationships
86
85
  })
87
86
  }
88
87
 
89
88
  if (!hasMultitenancy && (addHelm || addHelmUnifiedRuntime)) {
90
89
  await merge(__dirname, 'files', 'values.yaml.hbs').into('chart/values.yaml', { with: project })
91
-
92
90
  }
93
91
 
94
92
  if (addMultitenancy && (hasHelm || hasHelmUnifiedRuntime)) {
@@ -9,15 +9,10 @@ const { mvn } = require('../../add')
9
9
 
10
10
  module.exports = class HelmTemplate extends require('../../plugin') {
11
11
 
12
- static help() {
13
- return 'Kyma deployment using Helm charts'
14
- }
15
-
16
12
  options() {
17
13
  return {
18
14
  'y': {
19
15
  type: 'boolean',
20
- help: 'If provided, the default values will be used for all prompts.'
21
16
  }
22
17
  }
23
18
  }
@@ -58,8 +53,8 @@ module.exports = class HelmTemplate extends require('../../plugin') {
58
53
  if (t) tag = t
59
54
  }
60
55
  if (!cds.cli.options.y && !cds.cli.options.force) {
61
- registry ??= await ask4(`registry server: `)
62
- domain ??= await ask4(`cluster domain: `)
56
+ registry ??= await ask4([`registry server: `])
57
+ domain ??= await ask4([`cluster domain: `])
63
58
  }
64
59
  }
65
60
  project.registry = registry ?? '<registry-server>'
@@ -8,10 +8,6 @@ const { merge } = require('../../merge')
8
8
 
9
9
  module.exports = class HelmUnifiedRuntimeTemplate extends require('../helm') {
10
10
 
11
- static help() {
12
- return 'Kyma deployment using Unified Runtime Helm charts'
13
- }
14
-
15
11
  options() {
16
12
  return {
17
13
  'internal-unified-runtime-charts': {
@@ -3,18 +3,12 @@
3
3
  "version": "1.0.0",
4
4
  "main": "webapp/index.html",
5
5
  "scripts": {
6
- "build": "ui5 build preload --clean-dest --config ui5-deploy.yaml",
7
- "build-local": "ui5 build preload --clean-dest",
6
+ "build": "ui5 build preload --clean-dest",
8
7
  "start": "ui5 serve"
9
8
  },
10
9
  "devDependencies": {
11
10
  "@ui5/cli": "^4",
12
11
  "ui5-task-zipper": "^3"
13
- },
14
- "ui5": {
15
- "dependencies": [
16
- "ui5-task-zipper"
17
- ]
18
12
  }
19
13
  {{/hasUI5}}
20
14
  }
@@ -1,6 +1,25 @@
1
1
  ---
2
2
  # yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
3
- specVersion: '3.1'
3
+ specVersion: '4.0'
4
4
  metadata:
5
5
  name: {{app}}
6
6
  type: application
7
+ resources:
8
+ configuration:
9
+ propertiesFileSourceEncoding: UTF-8
10
+ builder:
11
+ resources:
12
+ excludes:
13
+ - "/test/**"
14
+ - "/localService/**"
15
+ customTasks:
16
+ - name: ui5-task-zipper
17
+ afterTask: generateVersionInfo
18
+ configuration:
19
+ archiveName: {{app}}
20
+ additionalFiles:
21
+ - xs-app.json
22
+ {{#isTypescript}}
23
+ - name: ui5-tooling-transpile-task
24
+ afterTask: replaceVersion
25
+ {{/isTypescript}}
@@ -38,7 +38,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
38
38
  const {
39
39
  isJava, srvPath, appPath, apps,
40
40
  hasApprouter, addApprouter, addContainerize, addMultitenancy, addWorkzoneStandard,
41
- addSample, hasMta, addMta, hasXsuaa, hasMultitenancy, hasWorkzoneStandard, addHelm, addHelmUnifiedRuntime, hasUI5
41
+ addSample, hasMta, addMta, hasXsuaa, hasMultitenancy, addHelm, addHelmUnifiedRuntime, hasUI5
42
42
  } = project
43
43
 
44
44
  await Promise.all(apps.map(async ({ app }) => {
@@ -59,10 +59,6 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
59
59
  project.app = app
60
60
  await merge(__dirname, 'files/ui5.yaml.hbs').into(join(appPath, app, 'ui5.yaml'), { project })
61
61
  }
62
- for (const { app } of apps) {
63
- project.app = app
64
- await merge(__dirname, 'files/ui5-deploy.yaml.hbs').into(join(appPath, app, 'ui5-deploy.yaml'), { project })
65
- }
66
62
  }
67
63
 
68
64
  if (addMultitenancy) {
@@ -79,18 +75,12 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
79
75
  const appModules = []
80
76
  for (const { app } of project.apps) {
81
77
  const html5App = { in: 'modules', where: { type: 'html5', path: `${appPath}${app}` } }
82
- appModules.push(html5App)
83
78
  relationships.push({
84
79
  insert: [html5App],
85
80
  into: [appDeployer, 'build-parameters.requires'],
86
81
  })
87
82
  }
88
- const additions = [srv, appDeployer, html5RepoHost, ...appModules]
89
- if (hasApprouter || hasWorkzoneStandard || hasMultitenancy) {
90
- additions.push(html5Runtime)
91
- }
92
83
  if (hasApprouter) {
93
- additions.push(approuter)
94
84
  relationships.push({
95
85
  insert: [html5Runtime, 'name'],
96
86
  into: [approuter, 'requires', 'name'],
@@ -101,6 +91,10 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
101
91
  insert: [html5Runtime, 'name'],
102
92
  into: [isJava ? srv : mtxSidecar4('gen/mtx/sidecar'), 'requires', 'name']
103
93
  })
94
+ relationships.push({
95
+ insert: [html5RepoHost, 'name'],
96
+ into: [isJava ? srv : mtxSidecar4('gen/mtx/sidecar'), 'requires', 'name']
97
+ })
104
98
  }
105
99
  if (hasXsuaa) {
106
100
  relationships.push({
@@ -110,7 +104,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
110
104
  }
111
105
  await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
112
106
  with: project,
113
- additions,
107
+ additions: [srv, appDeployer, html5RepoHost, ...appModules],
114
108
  relationships
115
109
  })
116
110
  }
@@ -1,7 +1,7 @@
1
1
  {{#hasMultitenancy}}
2
2
  sidecar:
3
3
  expose:
4
- gateway: default/kyma-mtls-gateway
4
+ gateway: {{#literal}}"{{ .Release.Namespace }}/kyma-mtls-gateway"{{/literal}}
5
5
  host: {{#literal}}"{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert"{{/literal}}
6
6
  bindings:
7
7
  auth:
@@ -13,18 +13,18 @@ sidecar:
13
13
  {{#hasApprouter}}
14
14
  approuter:
15
15
  expose:
16
- gateway: default/kyma-mtls-gateway
16
+ gateway: {{#literal}}"{{ .Release.Namespace }}/kyma-mtls-gateway"{{/literal}}
17
17
  host: {{#literal}}"{{ .Release.Name }}-approuter-{{ .Release.Namespace }}.cert"{{/literal}}
18
18
  bindings:
19
19
  auth:
20
20
  serviceInstanceName: identity
21
- parameters:
22
- credential-type: X509_GENERATED
23
- app-identifier: approuter
21
+ parameters:
22
+ credential-type: X509_GENERATED
23
+ app-identifier: approuter
24
24
  {{/hasApprouter}}
25
25
  srv:
26
26
  expose:
27
- gateway: default/kyma-mtls-gateway
27
+ gateway: {{#literal}}"{{ .Release.Namespace }}/kyma-mtls-gateway"{{/literal}}
28
28
  host: {{#literal}}"{{ .Release.Name }}-srv-{{ .Release.Namespace }}.cert"{{/literal}}
29
29
  bindings:
30
30
  auth:
@@ -1,8 +1,7 @@
1
1
  const { readProject } = require('../../projectReader')
2
2
  const { merge, sort } = require('../../merge')
3
3
  const { srv4, approuter, ias, mtxSidecar4 } = require('../../registries/mta')
4
- const cds = require('../../../cds')
5
- const { exists, read } = cds.utils
4
+ const { exists, read } = require('../../../cds').utils
6
5
 
7
6
  module.exports = class IasTemplate extends require('../../plugin') {
8
7
 
@@ -11,10 +10,7 @@ module.exports = class IasTemplate extends require('../../plugin') {
11
10
  }
12
11
 
13
12
  static hasInProduction(env) {
14
- // REVISIT: Ugly, find more generic solution
15
- return env.requires?.auth?.kind === 'ias' ||
16
- cds.cli.argv?.[0]?.includes('ias') || cds.cli.argv?.[0]?.includes('ams') ||
17
- cds.cli.options?.add?.has('ias') || cds.cli.options?.add?.has('ams') || false
13
+ return env.requires?.auth?.kind === 'ias'
18
14
  }
19
15
 
20
16
  async run() {
@@ -28,7 +24,7 @@ module.exports = class IasTemplate extends require('../../plugin') {
28
24
 
29
25
  async combine() {
30
26
  const project = readProject()
31
- const { isJava, addMta, hasMta, addCfManifest, addHelm, addHelmUnifiedRuntime, addApprouter, addMultitenancy, srvPath } = project
27
+ const { isJava, addMta, hasMta, addCfManifest, addHelm, addHelmUnifiedRuntime, addMultitenancy, hasApprouter, hasMultitenancy, srvPath } = project
32
28
 
33
29
  if (addMultitenancy) {
34
30
  const conf = exists('mtx/sidecar/package.json') ? await read('mtx/sidecar/package.json') : {}
@@ -43,14 +39,14 @@ module.exports = class IasTemplate extends require('../../plugin') {
43
39
  await merge(__dirname, 'files/sidecar.package.json.hbs').into('mtx/sidecar/package.json')
44
40
  }
45
41
 
46
- if (addMta || (addApprouter || addMultitenancy) && hasMta) {
42
+ if (addMta || (hasApprouter || hasMultitenancy) && hasMta) {
47
43
  const srv = srv4(srvPath)
48
44
  const srvIdentityBinding = { in: [srv, 'requires'], where: { 'parameters.config.app-identifier': 'srv' } }
49
45
  const srvCertUrlApi = { in: [srv, 'provides'], where: { 'name': 'srv-api' } }
50
46
  const additions = [srv, ias, srvIdentityBinding, srvCertUrlApi]
51
47
  const overwrites = []
52
48
 
53
- if (addApprouter) {
49
+ if (hasApprouter) {
54
50
  additions.push(approuter)
55
51
  additions.push({ in: [approuter, 'requires'], where: { 'parameters.config.app-identifier': 'approuter' }})
56
52
  const approuterSrvApi = { in: [approuter, 'requires'], where: { 'name': 'srv-api' } }
@@ -59,7 +55,7 @@ module.exports = class IasTemplate extends require('../../plugin') {
59
55
  overwrites.push({ item: [approuterSrvApi, 'properties.forwardAuthCertificates'], withValue: true })
60
56
  overwrites.push({ item: [approuterSrvApi, 'properties.strictSSL'], withValue: true })
61
57
  }
62
- if (addMultitenancy) {
58
+ if (hasMultitenancy) {
63
59
  const mtxSidecar = mtxSidecar4(isJava ? 'mtx/sidecar' : 'gen/mtx/sidecar')
64
60
  const mtxIdentityBinding = { in: [mtxSidecar, 'requires'], where: { 'parameters.config.app-identifier': 'mtx' } }
65
61
  additions.push(mtxSidecar, mtxIdentityBinding)
@@ -74,16 +70,12 @@ module.exports = class IasTemplate extends require('../../plugin') {
74
70
  }
75
71
 
76
72
  if (addCfManifest) {
77
- await this.#combineWithCfManifest(project) // REVISIT: we shouldn't overly promote cf-manifest
78
- }
79
- }
73
+ const srv = { in: 'applications', where: { 'name': `${project.appName}-srv` } }
74
+ const identityBinding = { in: 'services', where: { 'parameters.app-identifier': 'srv' } }
75
+ await merge(__dirname, 'files/manifest.yml.hbs').into('manifest.yml', { project, additions: [srv, identityBinding] })
80
76
 
81
- async #combineWithCfManifest(project) {
82
- const srv = { in: 'applications', where: { 'name': `${project.appName}-srv` } }
83
- const identityBinding = { in: 'services', where: { 'parameters.app-identifier': 'srv' } }
84
- await merge(__dirname, 'files/manifest.yml.hbs').into('manifest.yml', { project, additions: [srv, identityBinding] })
85
-
86
- const identity = { in: 'create-services', where: { 'broker': 'identity' } }
87
- await merge(__dirname, 'files/services-manifest.yml.hbs').into('services-manifest.yml', { project, additions: [identity] })
77
+ const identity = { in: 'create-services', where: { 'broker': 'identity' } }
78
+ await merge(__dirname, 'files/services-manifest.yml.hbs').into('services-manifest.yml', { project, additions: [identity] })
79
+ }
88
80
  }
89
81
  }
@@ -1,10 +1,23 @@
1
+ const cds = require('../../../../lib/cds')
2
+
1
3
  module.exports = class extends require('../../plugin') {
2
4
 
3
5
  static help() {
4
- return 'helm + containerize'
6
+ return 'Kyma deployment using Helm charts'
7
+ }
8
+
9
+ options() {
10
+ return {
11
+ 'unified-runtime': {
12
+ type: 'boolean'
13
+ }
14
+ }
5
15
  }
6
16
 
7
17
  requires() {
18
+ if (cds.cli.options['unified-runtime']) {
19
+ return ['helm-unified-runtime', 'containerize']
20
+ }
8
21
  return ['helm', 'containerize']
9
22
  }
10
23
  }
@@ -11,4 +11,6 @@ resources:
11
11
  type: org.cloudfoundry.managed-service
12
12
  parameters:
13
13
  service: malware-scanner
14
- service-plan: clamav
14
+ service-plan: clamav
15
+ config:
16
+ auth: mTLS
@@ -4,4 +4,6 @@ srv:
4
4
  serviceInstanceName: malware-scanner
5
5
  malware-scanner:
6
6
  serviceOfferingName: malware-scanner
7
- servicePlanName: clamav
7
+ servicePlanName: clamav
8
+ parameters:
9
+ auth: mTLS