@sap/cds-dk 9.2.1 → 9.3.1

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 (67) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/bin/bind.js +5 -8
  3. package/bin/up.js +19 -13
  4. package/lib/bind/cf.js +4 -0
  5. package/lib/bind/k8s.js +21 -0
  6. package/lib/bind/plugin.js +9 -0
  7. package/lib/build/buildTaskProviderFactory.js +8 -14
  8. package/lib/build/constants.js +1 -0
  9. package/lib/build/index.js +17 -2
  10. package/lib/build/plugin.js +5 -7
  11. package/lib/build/provider/hana/index.js +4 -4
  12. package/lib/env/schemas/cds-rc.js +2 -2
  13. package/lib/import/odata/metadataconverter/MetadataConverter.js +5 -0
  14. package/lib/init/constants.js +3 -2
  15. package/lib/init/projectReader.js +17 -5
  16. package/lib/init/template/ams/index.js +1 -2
  17. package/lib/init/template/approuter/files/containerize.yaml.hbs +1 -1
  18. package/lib/init/template/approuter/index.js +1 -1
  19. package/lib/init/template/data/as-csv.js +10 -7
  20. package/lib/init/template/data/as-json.js +7 -4
  21. package/lib/init/template/enterprise-messaging/index.js +3 -2
  22. package/lib/init/template/enterprise-messaging-shared/index.js +3 -2
  23. package/lib/init/template/extension/files/.base/index.cds +6 -6
  24. package/lib/init/template/extension/index.js +5 -5
  25. package/lib/init/template/github-actions/files/kyma-info/action.yaml +1 -1
  26. package/lib/init/template/github-actions/files/kyma-setup/action.yaml +1 -9
  27. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +25 -12
  28. package/lib/init/template/github-actions/files/workflows/kyma.yaml.hbs +8 -5
  29. package/lib/init/template/github-actions/files/workflows/release.yaml.hbs +30 -0
  30. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +6 -3
  31. package/lib/init/template/github-actions/index.js +28 -14
  32. package/lib/init/template/hana/index.js +2 -1
  33. package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -1
  34. package/lib/init/template/html5-repo/files/package.json.hbs +1 -1
  35. package/lib/init/template/html5-repo/index.js +27 -19
  36. package/lib/init/template/ias/files/mta.yaml.hbs +5 -4
  37. package/lib/init/template/ias/files/values.yaml.hbs +41 -40
  38. package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
  39. package/lib/init/template/mta/files/package.json +1 -1
  40. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -1
  41. package/lib/init/template/multitenancy/files/values.yaml.hbs +1 -1
  42. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -1
  43. package/lib/init/template/nodejs/files/package.json.hbs +3 -9
  44. package/lib/init/template/portal/files/mta.yaml.hbs +5 -1
  45. package/lib/init/template/portal/index.js +0 -1
  46. package/lib/init/template/sample/files/app/_i18n/i18n.properties +15 -0
  47. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +15 -0
  48. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +14 -15
  49. package/lib/init/template/sample/files/app/browse/fiori-service.cds +44 -44
  50. package/lib/init/template/sample/files/app/common.cds +99 -84
  51. package/lib/init/template/sample/files/db/schema.cds +22 -17
  52. package/lib/init/template/sample/files/package.json.hbs +1 -3
  53. package/lib/init/template/sample/files/srv/admin-service.cds +4 -3
  54. package/lib/init/template/sample/files/srv/cat-service.cds +28 -11
  55. package/lib/init/template/tiny-sample/files/nodejs/db/schema.cds +3 -3
  56. package/lib/init/template/typescript/files/package.json +1 -1
  57. package/lib/init/template/ui5/index.js +22 -0
  58. package/lib/init/template/xsuaa/files/mta.yaml.hbs +2 -1
  59. package/lib/init/template/xsuaa/index.js +7 -5
  60. package/lib/lint/eslintHelp.json +5 -3
  61. package/npm-shrinkwrap.json +15 -15
  62. package/package.json +1 -1
  63. package/lib/init/template/github-actions/files/cf-github-deploy/action.yaml +0 -48
  64. package/lib/init/template/sample/files/javascript/admin-service.js.hbs +0 -24
  65. package/lib/init/template/sample/files/javascript/cat-service.js.hbs +0 -43
  66. package/lib/init/template/sample/files/typescript/admin-service.ts.hbs +0 -16
  67. package/lib/init/template/sample/files/typescript/cat-service.ts.hbs +0 -38
@@ -1,5 +1,5 @@
1
1
  const cds = require('../../../cds')
2
- const { read } = cds.utils
2
+ const { read, exists } = cds.utils
3
3
  const { readProject } = require('../../projectReader')
4
4
  const { merge } = require('../../merge')
5
5
  const { srv4, enterpriseMessaging } = require('../../registries/mta')
@@ -38,7 +38,6 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
38
38
  project.cloudevents = cds.cli.options.cloudevents
39
39
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { with: project })
40
40
  }
41
- await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
42
41
  }
43
42
 
44
43
  async combine() {
@@ -60,5 +59,7 @@ module.exports = class EnterpriseMessagingSharedTemplate extends require('../../
60
59
  if (hasHelm || hasHelmUnifiedRuntime) {
61
60
  await merge(__dirname, 'files/values.yaml').into('chart/values.yaml')
62
61
  }
62
+
63
+ if (!exists('event-mesh.json')) await merge(__dirname, 'files/event-mesh.json.hbs').into('event-mesh.json', { project })
63
64
  }
64
65
  }
@@ -1,7 +1,7 @@
1
1
  entity my.bookshop.Books {
2
- key ID : Integer;
3
- title : String @title : 'Title';
4
- stock : Integer @title : 'Stock';
2
+ key ID : Integer;
3
+ title : String @title: 'Title';
4
+ stock : Integer @title: 'Stock';
5
5
  }
6
6
 
7
7
  service CatalogService {
@@ -9,7 +9,7 @@ service CatalogService {
9
9
  }
10
10
 
11
11
  annotate CatalogService.Books with @UI.LineItem: [
12
- { Value: ID },
13
- { Value: title },
14
- { Value: stock },
12
+ {Value: ID},
13
+ {Value: title},
14
+ {Value: stock},
15
15
  ];
@@ -28,7 +28,7 @@ module.exports = class ExtensionProjectTemplate extends require('../../plugin')
28
28
  if (typeof base !== 'string' || !base?.length) base = '@capire/bookshop'
29
29
 
30
30
  const pkgJson = exists('package.json') ? await read('package.json') : { name: 'my-extension-project' }
31
- if (!pkgJson.extends || force) {
31
+ if (force || !pkgJson.extends) {
32
32
  pkgJson.extends = base
33
33
  }
34
34
 
@@ -38,7 +38,7 @@ module.exports = class ExtensionProjectTemplate extends require('../../plugin')
38
38
  }
39
39
  await write('package.json', pkgJson, { spaces: 2 })
40
40
 
41
- if (!exists('.base/package.json') || force) {
41
+ if (force || !exists('.base/package.json')) {
42
42
  await write('.base/package.json', {name: base})
43
43
  }
44
44
 
@@ -56,17 +56,17 @@ module.exports = class ExtensionProjectTemplate extends require('../../plugin')
56
56
  const extensionNamespace = `${namespacify(proj.appName)}.${namespacify(projectSimple)}`
57
57
  const { force } = cds.cli.options
58
58
 
59
- if (!exists('.base/index.cds') || force) {
59
+ if (force || !exists('.base/index.cds')) {
60
60
  await copy(join(__dirname, 'files/.base/index.cds'), '.base/index.cds')
61
61
  }
62
62
 
63
- if (!exists('app/extension.cds') || force) {
63
+ if (force || !exists('app/extension.cds')) {
64
64
  await renderAndCopy(join(__dirname, 'files/app'), 'app', {
65
65
  basePackage: base,
66
66
  extensionNamespace
67
67
  })
68
68
  }
69
- if (!exists('test/data') || force) {
69
+ if (force || !exists('test/data')) {
70
70
  await copy(join(__dirname, 'files/test/data/my.bookshop-Books.csv'), 'test/data/my.bookshop-Books.csv')
71
71
  await copy(join(__dirname, 'files/test/data/Authors.csv'), `test/data/${extensionNamespace}-x_Authors.csv`)
72
72
  }
@@ -12,7 +12,7 @@ runs:
12
12
  steps:
13
13
  - name: Get Events
14
14
  shell: bash
15
- run: kubectl get events --sort-by='.lastTimestamp' | tail -n 10
15
+ run: kubectl get events --sort-by='.lastTimestamp' | tail -n 20
16
16
  - name: Get Pods
17
17
  shell: bash
18
18
  run: kubectl get pods
@@ -43,15 +43,7 @@ runs:
43
43
  shell: bash
44
44
  - run: apt-get install kubectl -y
45
45
  shell: bash
46
- - run: curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
47
- shell: bash
48
- - run: sudo apt-get install apt-transport-https --yes
49
- shell: bash
50
- - run: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
51
- shell: bash
52
- - run: sudo apt-get update
53
- shell: bash
54
- - run: sudo apt-get install helm
46
+ - run: curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
55
47
  shell: bash
56
48
  - run: npm install -g ctz
57
49
  shell: bash
@@ -2,12 +2,19 @@ name: Cloud Foundry
2
2
 
3
3
  on:
4
4
  workflow_call:
5
+ inputs:
6
+ environment:
7
+ default: Staging
8
+ type: string
5
9
  workflow_dispatch:
6
- merge_group:
7
10
  push:
8
11
  branches:
9
12
  - main
10
13
 
14
+ permissions:
15
+ contents: read
16
+ deployments: write
17
+
11
18
  concurrency:
12
19
  group: {{#literal}}cf-${{ github.workflow }}-${{ github.head_ref || github.run_id }}{{/literal}}
13
20
  cancel-in-progress: true
@@ -18,11 +25,11 @@ jobs:
18
25
  deploy:
19
26
  runs-on: {{#sap}}[self-hosted, solinas]{{/sap}}{{^sap}}ubuntu-latest{{/sap}}
20
27
  steps:
21
- - uses: actions/checkout@v4
22
- - uses: actions/setup-node@v4
28
+ - uses: actions/checkout@v5
29
+ - uses: actions/setup-node@v5
23
30
  with:
24
31
  node-version: 22
25
- - uses: ./.github/actions/cf-setup # cap-js/cf-setup@v1
32
+ - uses: ./.github/actions/cf-setup
26
33
  with:
27
34
  cf-api: {{#literal}}${{ vars.CF_API }}{{/literal}}
28
35
  cf-org: {{#literal}}${{ vars.CF_ORG }}{{/literal}}
@@ -32,21 +39,27 @@ jobs:
32
39
  - run: npm install
33
40
  - run: npx cds up
34
41
 
35
- - uses: ./.github/actions/cf-github-deploy
36
- with:
37
- app-name: {{#literal}}${{ env.APP_NAME }}{{/literal}}
38
-
39
42
  {{#hasApprouter}}
40
- - run: cf logs "${{ env.APP_NAME }}" --recent
43
+ - run: cf logs {{#literal}}"${{ env.APP_NAME }}"{{/literal}} --recent
41
44
  if: always()
42
45
  {{/hasApprouter}}
43
- - run: cf logs "${{ env.APP_NAME }}-srv" --recent
46
+ - run: cf logs {{#literal}}"${{ env.APP_NAME }}-srv"{{/literal}} --recent
44
47
  if: always()
45
48
  {{^hasMultitenancy}}
46
- - run: cf logs "${{ env.APP_NAME }}-db-deployer" --recent
49
+ - run: cf logs {{#literal}}"${{ env.APP_NAME }}-db-deployer"{{/literal}} --recent
47
50
  if: always()
48
51
  {{/hasMultitenancy}}
49
52
  {{#hasMultitenancy}}
50
- - run: cf logs "${{ env.APP_NAME }}-mtx" --recent
53
+ - run: cf logs {{#literal}}"${{ env.APP_NAME }}-mtx"{{/literal}} --recent
51
54
  if: always()
52
55
  {{/hasMultitenancy}}
56
+
57
+ - name: Get application URL
58
+ id: route
59
+ shell: bash
60
+ run: |
61
+ {{#literal}}host=$(cf app "${APP_NAME}" | awk '/routes:/ {print $2}' | sed -E 's#^https?://##; s/,.*$//')
62
+ echo "url=https://$host" >> "$GITHUB_OUTPUT"{{/literal}}
63
+ environment:
64
+ name: {{#literal}}${{ inputs.environment || 'Staging' }}{{/literal}}
65
+ url: {{#literal}}${{ steps.route.outputs.url }}{{/literal}}
@@ -3,25 +3,28 @@ name: Kyma
3
3
  on:
4
4
  workflow_call:
5
5
  workflow_dispatch:
6
- merge_group:
7
6
  push:
8
7
  branches:
9
8
  - main
10
9
 
10
+ permissions:
11
+ contents: read
12
+ deployments: write
13
+
11
14
  concurrency:
12
- group: {{#literal}}deploy-${{ github.workflow }}-${{ github.head_ref || github.run_id }}{{/literal}}
15
+ group: {{#literal}}kyma-${{ github.workflow }}-${{ github.head_ref || github.run_id }}{{/literal}}
13
16
  cancel-in-progress: true
14
17
 
15
18
  env:
16
19
  APP_NAME: {{ appName }}
17
20
  jobs:
18
21
  deploy:
19
- runs-on: [self-hosted, {{#sap}}solinas{{/sap}}{{^sap}}ubuntu-latest{{/sap}}]
22
+ runs-on: {{#sap}}[self-hosted, solinas]{{/sap}}{{^sap}}ubuntu-latest{{/sap}}
20
23
  container:
21
24
  image: public.int.repositories.cloud.sap/ubuntu:24.04
22
25
  steps:
23
- - uses: actions/checkout@v4
24
- - uses: actions/setup-node@v4
26
+ - uses: actions/checkout@v5
27
+ - uses: actions/setup-node@v5
25
28
  with:
26
29
  node-version: 22
27
30
  - uses: ./.github/actions/kyma-setup
@@ -0,0 +1,30 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types: [published]
7
+
8
+ permissions:
9
+ contents: read
10
+ deployments: write
11
+
12
+ jobs:
13
+ tests:
14
+ uses: {{& githubSlug}}/.github/workflows/test.yaml@main
15
+ secrets: inherit
16
+ {{#hasMta}}
17
+ deploy-cf:
18
+ needs: [tests]
19
+ uses: {{& githubSlug}}/.github/workflows/cf.yaml@main
20
+ secrets: inherit
21
+ with:
22
+ environment: Production
23
+ {{/hasMta}}{{^hasMta}}{{#hasHelm}}
24
+ deploy-kyma:
25
+ needs: [tests]
26
+ uses: {{& githubSlug}}/.github/workflows/kyma.yaml@main
27
+ secrets: inherit
28
+ with:
29
+ environment: Production
30
+ {{/hasHelm}}{{/hasMta}}
@@ -9,13 +9,16 @@ on:
9
9
  branches:
10
10
  - main
11
11
 
12
+ permissions:
13
+ contents: read
14
+
12
15
  jobs:
13
16
  tests:
14
- runs-on: [self-hosted, {{#sap}}solinas{{/sap}}{{^sap}}ubuntu-latest{{/sap}}]
17
+ runs-on: {{#sap}}[self-hosted, solinas]{{/sap}}{{^sap}}ubuntu-latest{{/sap}}
15
18
  steps:
16
- - uses: actions/setup-node@v4
19
+ - uses: actions/setup-node@v5
17
20
  with:
18
21
  node-version: 22
19
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@v5
20
23
  - run: npm install
21
24
  - run: npm test
@@ -1,7 +1,10 @@
1
1
  const path = require('node:path')
2
+ const { execSync } = require('node:child_process')
3
+ const term = require('../../../util/term')
2
4
  const { readProject } = require('../../projectReader')
3
5
  const { renderAndCopy } = require('../../template')
4
6
  const cds = require('../../../cds')
7
+ const DEBUG = cds.log('add')._debug
5
8
  const { exists, copy } = cds.utils
6
9
 
7
10
  module.exports = class GitHubActionTemplate extends require('../../plugin') {
@@ -23,45 +26,56 @@ module.exports = class GitHubActionTemplate extends require('../../plugin') {
23
26
  }
24
27
 
25
28
  async run() {
26
- const out = '.github/workflows/test.yaml'
27
- if (!exists(out) || cds.cli.options.force) {
28
- await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), out, { sap: cds.cli.options.sap })
29
+ const test = `.github/workflows/test.yaml`
30
+ if (!exists(test) || cds.cli.options.force) {
31
+ await renderAndCopy(path.join(__dirname, 'files/workflows/test.yaml.hbs'), test, { sap: cds.cli.options.sap })
29
32
  } else {
30
- console.log('> skipping ' + out)
33
+ console.log('> skipping ' + test)
34
+ }
35
+
36
+ const release = `.github/workflows/release.yaml`
37
+ if (!exists(release) || cds.cli.options.force) {
38
+
39
+ let githubSlug
40
+ try {
41
+ githubSlug = execSync('git remote get-url origin', { stdio: 'pipe' }).toString().split('/').slice(-2).join('/').trim().replace(/\.git$/, '')
42
+ } catch (error) {
43
+ githubSlug = '<org/repo>'
44
+ // console.log(`\ncould not determine GitHub URL for the project – replace '<org/repo>' in ${release}`, DEBUG ? error : '')
45
+ }
46
+ const { hasMta, hasHelm } = readProject()
47
+ await renderAndCopy(path.join(__dirname, 'files/workflows/release.yaml.hbs'), release, { sap: cds.cli.options.sap, githubSlug, hasMta, hasHelm })
48
+ } else {
49
+ console.log('> skipping ' + release)
31
50
  }
32
51
  }
33
52
 
34
53
  async combine() {
35
54
  const project = readProject()
36
55
  const { hasMta, hasHelm } = project, { force } = cds.cli.options
37
- project.literal = () => text => text
38
56
  project.sap = cds.cli.options.sap
39
57
  if (hasMta) {
40
58
  const cf = '.github/workflows/cf.yaml'
41
- if (!exists(cf) || force) {
59
+ if (force || !exists(cf)) {
42
60
  await renderAndCopy(path.join(__dirname, 'files/workflows/cf.yaml.hbs'), cf, project)
43
61
  }
44
62
  const cfSetup = '.github/actions/cf-setup'
45
- if (!exists(cfSetup) || force) {
63
+ if (force || !exists(cfSetup)) {
46
64
  await copy(path.join(__dirname, 'files/cf-setup'), cfSetup)
47
65
  }
48
- const cfGithub = '.github/actions/cf-github-deploy'
49
- if (!exists(cfGithub) || force) {
50
- await copy(path.join(__dirname, 'files/cf-github-deploy'), cfGithub)
51
- }
52
66
  }
53
67
  if (hasHelm) {
54
68
  const kyma = '.github/workflows/kyma.yaml'
55
- if (!exists(kyma) || force) {
69
+ if (force || !exists(kyma)) {
56
70
  await renderAndCopy(path.join(__dirname, 'files/workflows/kyma.yaml.hbs'), kyma, project)
57
71
  }
58
72
  const kymaSetup = '.github/actions/kyma-setup'
59
- if (!exists(kymaSetup) || force) {
73
+ if (force || !exists(kymaSetup)) {
60
74
  await copy(path.join(__dirname, 'files/kyma-setup'), kymaSetup)
61
75
  }
62
76
 
63
77
  const kymaInfo = '.github/actions/kyma-info'
64
- if (!exists(kymaInfo) || force) {
78
+ if (force || !exists(kymaInfo)) {
65
79
  await copy(path.join(__dirname, 'files/kyma-info'), kymaInfo)
66
80
  }
67
81
  }
@@ -2,7 +2,7 @@ const { join } = require('path')
2
2
  const cds = require('../../../cds')
3
3
  const { read, write, exists, copy, rimraf } = cds.utils
4
4
  const { readProject } = require('../../projectReader')
5
- const { merge } = require('../../merge')
5
+ const { merge, sort } = require('../../merge')
6
6
  const mvn = require('../../mvn')
7
7
 
8
8
  const { srv4, hdbDeployer, serviceManager, hdiContainer, mtxSidecar4 } = require('../../registries/mta')
@@ -39,6 +39,7 @@ module.exports = class HanaTemplate extends require('../../plugin') {
39
39
  delete packageJson.dependencies['@sap/hana-client']
40
40
  await write('package.json', packageJson, { spaces: 2 })
41
41
  }
42
+ await sort('package.json', 'dependencies')
42
43
  }
43
44
 
44
45
  async combine() {
@@ -25,7 +25,11 @@ modules:
25
25
  type: com.sap.application.content
26
26
  path: {{#isNodejs}}gen{{/isNodejs}}{{#isJava}}.{{/isJava}}
27
27
  requires:
28
- - name: {{appName}}-auth
28
+ - name: {{appName}}-auth{{#hasIas}}
29
+ parameters:
30
+ config:
31
+ credential-type: X509_GENERATED
32
+ app-identifier: app-deployer{{/hasIas}}
29
33
  - name: srv-api
30
34
  - name: {{appName}}-html5-repo-host
31
35
  parameters:
@@ -6,7 +6,7 @@
6
6
  {{#profile}}
7
7
  "[{{profile}}]": {
8
8
  {{/profile}}
9
- "html5-runtime": true
9
+ "html5-repo": true
10
10
  {{#profile}}
11
11
  }
12
12
  {{/profile}}
@@ -23,25 +23,9 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
23
23
 
24
24
  async run() {
25
25
  const project = readProject()
26
- const { appUIPaths, apps, appPath, configFile, hasUI5 } = project
26
+ const { appUIPaths, appPath, configFile } = project
27
27
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { project })
28
28
 
29
- if (hasUI5) {
30
- for (const { app } of apps) {
31
- project.app = app
32
- await merge(__dirname, 'files/ui5.yaml.hbs').into(join(appPath, app, 'ui5.yaml'), { project })
33
- }
34
- for (const { app } of apps) {
35
- project.app = app
36
- await merge(__dirname, 'files/ui5-deploy.yaml.hbs').into(join(appPath, app, 'ui5-deploy.yaml'), { project })
37
- }
38
- }
39
-
40
- for (const { app } of apps) {
41
- project.app = app
42
- await merge(__dirname, 'files/app-package.json.hbs').into(join(appPath, app, 'package.json'), { project })
43
- }
44
-
45
29
  // app deployer requires a manifest.json
46
30
  await Promise.all(appUIPaths.map(p =>
47
31
  merge(__dirname, 'files/manifest.json')
@@ -51,17 +35,38 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
51
35
 
52
36
  async combine() {
53
37
  const project = readProject()
54
- const { isJava, srvPath, appPath, hasMta, hasXsuaa, hasMultitenancy, hasWorkzoneStandard, hasHelm, hasHelmUnifiedRuntime, hasApprouter, hasContainerize, apps } = project
38
+ const {
39
+ isJava, srvPath, appPath, apps,
40
+ hasApprouter, hasContainerize, hasMultitenancy, hasWorkzoneStandard,
41
+ hasMta, hasXsuaa, hasHelm, hasHelmUnifiedRuntime, hasUI5
42
+ } = project
55
43
 
56
44
  await Promise.all(apps.map(async ({ app }) => {
57
45
  project.app = app
58
46
  project.hasIndexHtml = exists(join(appPath, app, 'webapp/index.html'))
59
47
  const additions = [odataApi]
60
48
  await merge(__dirname, 'files/xs-app.json.hbs').into(join(appPath, app, 'xs-app.json'), { with: project, additions })
49
+ await merge(__dirname, 'files/app-package.json.hbs').into(join(appPath, app, 'package.json'), { project })
61
50
  }))
62
51
 
52
+ if (hasUI5) {
53
+ for (const { app } of apps) {
54
+ project.app = app
55
+ await merge(__dirname, 'files/app-package.json.hbs').into(join(appPath, app, 'package.json'), { project })
56
+ }
57
+
58
+ for (const { app } of apps) {
59
+ project.app = app
60
+ await merge(__dirname, 'files/ui5.yaml.hbs').into(join(appPath, app, 'ui5.yaml'), { project })
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
+ }
67
+
63
68
  if (hasMultitenancy) {
64
- await merge({ cds: { requires: { 'html5-runtime':true } } }).into('mtx/sidecar/package.json')
69
+ await merge({ cds: { requires: { 'html5-repo': true } } }).into('mtx/sidecar/package.json')
65
70
  }
66
71
 
67
72
  if (hasMta) {
@@ -89,6 +94,9 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
89
94
  relationships.push({
90
95
  insert: [html5Runtime, 'name'],
91
96
  into: [approuter, 'requires', 'name'],
97
+ }, {
98
+ insert: [html5RepoHost, 'name'],
99
+ into: [approuter, 'requires', 'name'],
92
100
  })
93
101
  }
94
102
  if (hasMultitenancy) {
@@ -20,7 +20,7 @@ modules:
20
20
 
21
21
  - name: {{appName}}
22
22
  type: approuter.nodejs
23
- path: app/router
23
+ path: {{& approuterPath}}
24
24
  requires:
25
25
  - name: {{appName}}-auth
26
26
  parameters:
@@ -57,10 +57,13 @@ resources:
57
57
  service-plan: application
58
58
  config:
59
59
  display-name: {{appName}}
60
- {{#hasApprouter}}
61
60
  oauth2-configuration:
61
+ token-policy:
62
+ access-token-format: "jwt"
63
+ {{#hasApprouter}}
62
64
  redirect-uris:
63
65
  - ~{app-api/app-protocol}://*.~{app-api/app-uri}/login/callback
66
+ - ~{app-api/app-protocol}://~{app-api/app-uri}/login/callback
64
67
  post-logout-redirect-uris:
65
68
  - ~{app-api/app-protocol}://*.~{app-api/app-uri}/*/logout.html
66
69
  {{/hasApprouter}}
@@ -71,6 +74,4 @@ resources:
71
74
  {{#hasMultitenancy}}
72
75
  multi-tenant: true
73
76
  {{/hasMultitenancy}}
74
- {{#hasXsuaa}}
75
77
  xsuaa-cross-consumption: true
76
- {{/hasXsuaa}}
@@ -1,49 +1,50 @@
1
1
  {{#hasMultitenancy}}
2
2
  sidecar:
3
- bindings:
4
- auth:
5
- serviceInstanceName: identity
6
- parameters:
7
- credential-type: X509_GENERATED
8
- app-identifier: mtx
3
+ bindings:
4
+ auth:
5
+ serviceInstanceName: identity
6
+ parameters:
7
+ credential-type: X509_GENERATED
8
+ app-identifier: mtx
9
9
  {{/hasMultitenancy}}
10
10
  {{#hasApprouter}}
11
11
  approuter:
12
- bindings:
13
- auth:
14
- serviceInstanceName: identity
15
- parameters:
16
- credential-type: X509_GENERATED
17
- app-identifier: approuter
12
+ bindings:
13
+ auth:
14
+ serviceInstanceName: identity
15
+ parameters:
16
+ credential-type: X509_GENERATED
17
+ app-identifier: approuter
18
18
  {{/hasApprouter}}
19
19
  srv:
20
- bindings:
21
- auth:
22
- serviceInstanceName: identity
23
- parameters:
24
- credential-type: X509_GENERATED
25
- app-identifier: srv
20
+ bindings:
21
+ auth:
22
+ serviceInstanceName: identity
23
+ parameters:
24
+ credential-type: X509_GENERATED
25
+ app-identifier: srv
26
26
 
27
27
  identity:
28
- serviceOfferingName: identity
29
- servicePlanName: application
30
- parameters:
31
- display-name: {{appName}}
32
- {{#hasMultitenancy}}
33
- multi-tenant: true
34
- {{/hasMultitenancy}}
35
- {{#hasXsuaa}}
36
- xsuaa-cross-consumption: true
37
- {{/hasXsuaa}}
38
- {{#hasApprouter}}
39
- oauth2-configuration:
40
- redirect-uris:
41
- {{=<% %>=}}
42
- - https://*.{{ tpl .Values.global.domain . }}/login/callback
43
- <%={{ }}=%>
44
- post-logout-redirect-uris:
45
- {{=<% %>=}}
46
- - https://*.{{ tpl .Values.global.domain . }}/*/logout.html
47
- <%={{ }}=%>
48
- {{/hasApprouter}}
49
-
28
+ serviceOfferingName: identity
29
+ servicePlanName: application
30
+ parameters:
31
+ display-name: {{appName}}
32
+ {{#hasMultitenancy}}
33
+ multi-tenant: true
34
+ {{/hasMultitenancy}}
35
+ {{#hasXsuaa}}
36
+ xsuaa-cross-consumption: true
37
+ {{/hasXsuaa}}
38
+ {{#hasApprouter}}
39
+ oauth2-configuration:
40
+ token-policy:
41
+ access-token-format: "jwt"
42
+ redirect-uris:
43
+ {{=<% %>=}}
44
+ - https://*.{{ tpl .Values.global.domain . }}/login/callback
45
+ <%={{ }}=%>
46
+ post-logout-redirect-uris:
47
+ {{=<% %>=}}
48
+ - https://*.{{ tpl .Values.global.domain . }}/*/logout.html
49
+ <%={{ }}=%>
50
+ {{/hasApprouter}}
@@ -11,7 +11,7 @@ build-parameters:
11
11
  - builder: custom
12
12
  commands:
13
13
  - npm ci
14
- - npx cds build --production
14
+ - npx cds build --production{{#isMonorepoMicroservice}} --ws-pack{{/isMonorepoMicroservice}}
15
15
  {{/isNodejs}}
16
16
  modules:
17
17
  - name: {{appName}}-srv
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@sap/cds-dk": ">=8"
3
+ "@sap/cds-dk": "^9"
4
4
  }
5
5
  }
@@ -91,7 +91,7 @@ resources:
91
91
  appName: {{appName}}-${org}-${space}
92
92
  appCallbacks:
93
93
  dependenciesCallbacks:
94
- url: {{#isJava}}~{srv-api/srv-cert-url}/mt/sms/subscriptions/tenants/{app_tid}/dependencies{{/isJava}}{{#isNodejs}}~{mtx-api/mtx-cert-url}/-/cds/sms-provisioning/dependencies/{app_tid}{{/isNodejs}}
94
+ url: {{#isJava}}~{srv-api/srv-cert-url}/mt/sms/subscriptions/tenants/{app_tid}/dependencies{{/isJava}}{{#isNodejs}}~{mtx-api/mtx-cert-url}/-/cds/sms-provisioning/dependencies{{/isNodejs}}
95
95
  subscriptionCallbacks:
96
96
  url: {{#isJava}}~{srv-api/srv-cert-url}/mt/sms/subscriptions/tenants/{app_tid}{{/isJava}}{{#isNodejs}}~{mtx-api/mtx-cert-url}/-/cds/sms-provisioning/tenant/{app_tid}{{/isNodejs}}
97
97
  async:
@@ -50,7 +50,7 @@ subscription-manager:
50
50
  parameters:
51
51
  appCallbacks:
52
52
  dependenciesCallbacks:
53
- {{#literal}}url: https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert.{{ .Values.global.domain }}/-/cds/sms-provisioning/dependencies/{app_tid}{{/literal}}
53
+ {{#literal}}url: https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert.{{ .Values.global.domain }}/-/cds/sms-provisioning/dependencies{{/literal}}
54
54
  subscriptionCallbacks:
55
55
  {{#literal}}url: https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert.{{ .Values.global.domain }}/-/cds/sms-provisioning/tenant/{app_tid}{{/literal}}
56
56
  appName: {{appName}}
@@ -2,7 +2,6 @@
2
2
  "recommendations": [
3
3
  "SAPSE.vscode-cds",
4
4
  "dbaeumer.vscode-eslint",
5
- "esbenp.prettier-vscode",
6
5
  "mechatroner.rainbow-csv",
7
6
  "qwtel.sqlite-viewer",
8
7
  "humao.rest-client"