@sap/cds-dk 9.3.1 → 9.4.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 (77) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/bin/bind.js +1 -1
  3. package/bin/cds.js +3 -0
  4. package/bin/compile/index.js +53 -3
  5. package/bin/data-products/get-csn-via-dp-cli.js +41 -0
  6. package/bin/data-products/get-csn.js +76 -0
  7. package/bin/data-products/import.js +114 -0
  8. package/bin/data-products/index.js +30 -0
  9. package/bin/data-products/merge-csns.js +46 -0
  10. package/bin/data-products/prepare-csn.js +282 -0
  11. package/bin/data-products/prepare-files.js +69 -0
  12. package/bin/export.js +240 -0
  13. package/bin/help/export.md +37 -0
  14. package/bin/help/import.md +11 -0
  15. package/bin/help/minify.md +23 -0
  16. package/bin/import.js +13 -3
  17. package/bin/inspect.js +226 -0
  18. package/bin/minify.js +123 -0
  19. package/bin/up.js +3 -24
  20. package/bin/util/cli.js +132 -0
  21. package/bin/util/log.js +2 -0
  22. package/bin/version.js +2 -1
  23. package/bin/watch.js +21 -3
  24. package/lib/bind/shared.js +3 -1
  25. package/lib/build/buildTaskEngine.js +2 -1
  26. package/lib/build/plugins/helm/files/templates/NOTES.txt +1 -1
  27. package/lib/build/plugins/helm/index.js +1 -1
  28. package/lib/build/provider/internalBuildTaskProvider.js +3 -3
  29. package/lib/build/provider/nodejs/index.js +62 -3
  30. package/lib/deploy/index.js +1 -1
  31. package/lib/deploy/to-hana/hana.js +18 -16
  32. package/lib/import/odata/v2parser.js +6 -2
  33. package/lib/import/odata/v4parser.js +21 -2
  34. package/lib/import/odata.package.json +4 -4
  35. package/lib/init/constants.js +2 -1
  36. package/lib/init/index.js +2 -0
  37. package/lib/init/mvn.js +3 -2
  38. package/lib/init/projectReader.js +1 -0
  39. package/lib/init/registries/mta.js +6 -0
  40. package/lib/init/template/ams/files/manifest.yml.hbs +1 -1
  41. package/lib/init/template/ams/files/mta.yaml.hbs +1 -1
  42. package/lib/init/template/app-frontend/files/app-package.json.hbs +20 -0
  43. package/lib/init/template/app-frontend/files/index.html.hbs +34 -0
  44. package/lib/init/template/app-frontend/files/manifest.json +13 -0
  45. package/lib/init/template/app-frontend/files/mta.yaml.hbs +71 -0
  46. package/lib/init/template/app-frontend/files/package.json.hbs +17 -0
  47. package/lib/init/template/app-frontend/files/ui5-deploy.yaml.hbs +25 -0
  48. package/lib/init/template/app-frontend/files/ui5.yaml.hbs +6 -0
  49. package/lib/init/template/app-frontend/files/values.yaml.hbs +20 -0
  50. package/lib/init/template/app-frontend/files/xs-app.json.hbs +17 -0
  51. package/lib/init/template/app-frontend/index.js +98 -0
  52. package/lib/init/template/approuter/files/mta.yaml.hbs +0 -2
  53. package/lib/init/template/attachments/index.js +4 -10
  54. package/lib/init/template/audit-logging/files/package.json.hbs +5 -0
  55. package/lib/init/template/github-actions/index.js +0 -2
  56. package/lib/init/template/handler/index.js +1 -0
  57. package/lib/init/template/helm/index.js +5 -1
  58. package/lib/init/template/html5-repo/files/mta.yaml.hbs +9 -2
  59. package/lib/init/template/html5-repo/index.js +0 -3
  60. package/lib/init/template/ias/files/manifest.yml.hbs +1 -1
  61. package/lib/init/template/ias/files/mta.yaml.hbs +6 -5
  62. package/lib/init/template/ias/files/values.yaml.hbs +10 -1
  63. package/lib/init/template/multitenancy/files/mta.yaml.hbs +16 -3
  64. package/lib/init/template/multitenancy/files/package.json.hbs +5 -0
  65. package/lib/init/template/multitenancy/files/values.yaml.hbs +1 -6
  66. package/lib/init/template/portal/files/mta.yaml.hbs +12 -2
  67. package/lib/init/template/sample/files/db/schema.cds +5 -8
  68. package/lib/init/template/typer/files/xsconfig.json +2 -1
  69. package/lib/init/template/typescript/files/package.json +1 -1
  70. package/lib/init/template/typescript/files/tsconfig.json +4 -1
  71. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +4 -0
  72. package/lib/init/template/workzone-standard/index.js +3 -2
  73. package/lib/init/template/xsuaa/files/package.json.hbs +3 -0
  74. package/lib/lint/eslintHelp.json +1 -1
  75. package/lib/util/term.js +2 -4
  76. package/npm-shrinkwrap.json +29 -29
  77. package/package.json +1 -1
@@ -0,0 +1,98 @@
1
+ const { join } = require('path')
2
+ const { readProject } = require('../../projectReader')
3
+ const { merge } = require('../../merge')
4
+ const { srv4, appDeployer, appFront } = require('../../registries/mta')
5
+ const { odataApi } = require('../../registries/xs-app')
6
+ const { renderAndCopy } = require('../../template')
7
+ const { exists } = require('../../../cds').utils
8
+
9
+ module.exports = class extends require('../../plugin') {
10
+
11
+ static help() {
12
+ return 'SAP BTP AppFront service' // TODO: Product name?
13
+ }
14
+
15
+ static hasInProduction(env) {
16
+ return !!env.requires['app-front']
17
+ }
18
+
19
+ async run() {
20
+ const project = readProject()
21
+ const { appUIPaths, apps, appPath, configFile, hasUI5 } = project
22
+ await merge(__dirname, 'files/package.json.hbs').into(configFile, { project })
23
+
24
+ if (hasUI5) {
25
+ for (const { app } of apps) {
26
+ project.app = app
27
+ await merge(__dirname, 'files/ui5.yaml.hbs').into(join(appPath, app, 'ui5.yaml'), { project })
28
+ }
29
+ for (const { app } of apps) {
30
+ project.app = app
31
+ await merge(__dirname, 'files/ui5-deploy.yaml.hbs').into(join(appPath, app, 'ui5-deploy.yaml'), { project })
32
+ }
33
+ }
34
+
35
+ for (const { app } of apps) {
36
+ project.app = app
37
+ await merge(__dirname, 'files/app-package.json.hbs').into(join(appPath, app, 'package.json'), { project })
38
+ if (hasUI5) {
39
+ await renderAndCopy(join(__dirname, 'files/index.html.hbs'), join(appPath, app, 'webapp/index.html'), project)
40
+ }
41
+ }
42
+
43
+ // app deployer requires a manifest.json
44
+ await Promise.all(appUIPaths.map(p =>
45
+ merge(__dirname, 'files/manifest.json')
46
+ .into(join(appPath, p, 'webapp/manifest.json'), { project })
47
+ ))
48
+ }
49
+
50
+ async combine() {
51
+ const project = readProject()
52
+ const { srvPath, appPath, hasMta, apps } = project
53
+
54
+ await Promise.all(apps.map(async ({ app }) => {
55
+ project.app = app
56
+ project.hasIndexHtml = exists(join(appPath, app, 'webapp/index.html'))
57
+ const additions = [odataApi]
58
+ await merge(__dirname, 'files/xs-app.json.hbs').into(join(appPath, app, 'xs-app.json'), { with: project, additions })
59
+ }))
60
+
61
+ // later -> rather consider adding to app-front package.json
62
+ // if (hasMultitenancy) {
63
+ // await merge({ cds: { requires: { 'app-front':true } } }).into('mtx/sidecar/package.json')
64
+ // }
65
+
66
+ if (hasMta) {
67
+ const srv = srv4(srvPath)
68
+ project.apps = apps
69
+ const appModules = project.apps.map(app => ({
70
+ in: 'modules',
71
+ where: { type: 'html5', path: `${appPath}${app.app}` }
72
+ }))
73
+ const additions = [srv, appDeployer, appFront, ...appModules]
74
+ const relationships = [{
75
+ insert: [appFront, 'name'],
76
+ into: [appDeployer, 'requires', 'name'],
77
+ }]
78
+ await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
79
+ with: project,
80
+ additions,
81
+ relationships
82
+ })
83
+ }
84
+
85
+ // When Helm support is added
86
+ // if (hasContainerize) {
87
+ // const additions = [{
88
+ // in: 'modules',
89
+ // where: { name: `${project.appName}-content-deployer` }
90
+ // }]
91
+ // await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions })
92
+ // }
93
+ // if (hasHelm || hasHelmUnifiedRuntime) {
94
+ // await renderAndCopy(join(__dirname, 'files/ui-resources'), 'ui-resources', project)
95
+ // await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
96
+ // }
97
+ }
98
+ }
@@ -10,7 +10,6 @@ modules:
10
10
  {{/hasMultitenancy}}
11
11
  {{/isJava}}
12
12
  requires:
13
- - name: {{appName}}-auth
14
13
  {{#isJava}}
15
14
  - name: app-api{{#hasMultitenancy}}
16
15
  properties:
@@ -84,4 +83,3 @@ resources:
84
83
  oauth2-configuration:
85
84
  redirect-uris:
86
85
  - https://*~{app-api/app-uri}/**
87
-
@@ -1,6 +1,7 @@
1
1
  const { readProject } = require('../../projectReader')
2
2
  const { merge } = require('../../merge')
3
3
  const { srv4, attachments } = require('../../registries/mta')
4
+ const { mvn } = require('../../add')
4
5
 
5
6
  module.exports = class AttachmentsTemplate extends require('../../plugin') {
6
7
 
@@ -16,18 +17,11 @@ module.exports = class AttachmentsTemplate extends require('../../plugin') {
16
17
  return !!env.requires?.attachments || readProject().dependencies?.['@cap-js/attachments']
17
18
  }
18
19
 
19
- async canRun() {
20
- const { isJava } = readProject()
21
- if (isJava) throw `'cds add attachments' is not available for Java yet`
22
- return true
23
- }
24
-
25
20
  async run() {
26
21
  const project = readProject()
27
- const { isNodejs } = project
28
- if (isNodejs) {
29
- await merge(__dirname, 'files/package.json.hbs').into('package.json')
30
- }
22
+ const { isNodejs, isJava } = project
23
+ if (isNodejs) await merge(__dirname, 'files/package.json.hbs').into('package.json')
24
+ if (isJava) await mvn.add('attachments')
31
25
  }
32
26
 
33
27
  async combine() {
@@ -4,4 +4,9 @@
4
4
  "@cap-js/audit-logging": ">=0"
5
5
  }
6
6
  {{/isNodejs}}
7
+ {{#isJava}}
8
+ "requires": {
9
+ "audit-log": true
10
+ }
11
+ {{/isJava}}
7
12
  }
@@ -1,10 +1,8 @@
1
1
  const path = require('node:path')
2
2
  const { execSync } = require('node:child_process')
3
- const term = require('../../../util/term')
4
3
  const { readProject } = require('../../projectReader')
5
4
  const { renderAndCopy } = require('../../template')
6
5
  const cds = require('../../../cds')
7
- const DEBUG = cds.log('add')._debug
8
6
  const { exists, copy } = cds.utils
9
7
 
10
8
  module.exports = class GitHubActionTemplate extends require('../../plugin') {
@@ -56,6 +56,7 @@ async function createNodeHandler(proj) {
56
56
  const nameFilter = filterStringAsRegex(filter)
57
57
 
58
58
  for (const service of csn.services) {
59
+ if (service['@cds.external']) continue
59
60
  if (!service.$location.file) continue
60
61
 
61
62
  proj.serviceName = service.name
@@ -86,7 +86,8 @@ module.exports = class HelmTemplate extends require('../../plugin') {
86
86
  }
87
87
 
88
88
  async combine() {
89
- const { hasDestination, hasEnterpriseMessaging, hasEnterpriseMessagingShared, hasHana, hasMultitenancy, hasXsuaa, hasHtml5Repo, hasApprouter, hasKafka, hasAttachments, hasPortal, hasMalwareScanner, hasDynatrace, hasCloudLogging } = readProject()
89
+ // REVISIT: This must be moved to the respective plugins
90
+ const { hasDestination, hasEnterpriseMessaging, hasEnterpriseMessagingShared, hasHana, hasMultitenancy, hasXsuaa, hasHtml5Repo, hasApprouter, hasKafka, hasAttachments, hasPortal, hasMalwareScanner, hasDynatrace, hasCloudLogging, hasAuditLogging } = readProject()
90
91
 
91
92
  if (hasApprouter) {
92
93
  await this._mergeDependency('web-application', 'approuter')
@@ -143,6 +144,9 @@ module.exports = class HelmTemplate extends require('../../plugin') {
143
144
  if (hasDynatrace) {
144
145
  await this._mergeDependency('service-instance', 'dynatrace')
145
146
  }
147
+ if (hasAuditLogging) {
148
+ await this._mergeDependency('service-instance', 'auditlog')
149
+ }
146
150
  }
147
151
 
148
152
  async _mergeDependency(name, alias) {
@@ -25,11 +25,16 @@ modules:
25
25
  type: com.sap.application.content
26
26
  path: {{#isNodejs}}gen{{/isNodejs}}{{#isJava}}.{{/isJava}}
27
27
  requires:
28
- - name: {{appName}}-auth{{#hasIas}}
28
+ {{#hasXsuaa}}
29
+ - name: {{appName}}-auth
30
+ {{/hasXsuaa}}
31
+ {{#hasIas}}
32
+ - name: {{appName}}-ias
29
33
  parameters:
30
34
  config:
31
35
  credential-type: X509_GENERATED
32
- app-identifier: app-deployer{{/hasIas}}
36
+ app-identifier: app-deployer
37
+ {{/hasIas}}
33
38
  - name: srv-api
34
39
  - name: {{appName}}-html5-repo-host
35
40
  parameters:
@@ -46,6 +51,7 @@ modules:
46
51
  - {{app}}.zip
47
52
  target-path: {{#isNodejs}}{{& appPath }}{{/isNodejs}}{{#isJava}}resources{{/isJava}}
48
53
  {{/apps}}
54
+ {{#hasWorkzoneStandard}}
49
55
  parameters:
50
56
  config:
51
57
  HTML5Runtime_enabled: true
@@ -65,6 +71,7 @@ modules:
65
71
  Authentication: NoAuthentication
66
72
  Type: HTTP
67
73
  ProxyType: Internet
74
+ {{/hasWorkzoneStandard}}
68
75
 
69
76
  {{#apps}}
70
77
  - name: {{strippedAppName}}{{strippedApp}}
@@ -94,9 +94,6 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
94
94
  relationships.push({
95
95
  insert: [html5Runtime, 'name'],
96
96
  into: [approuter, 'requires', 'name'],
97
- }, {
98
- insert: [html5RepoHost, 'name'],
99
- into: [approuter, 'requires', 'name'],
100
97
  })
101
98
  }
102
99
  if (hasMultitenancy) {
@@ -2,7 +2,7 @@
2
2
  applications:
3
3
  - name: {{appName}}-srv
4
4
  services:
5
- - name: {{appName}}-auth
5
+ - name: {{appName}}-ias
6
6
  parameters:
7
7
  credential-type: X509_GENERATED
8
8
  app-identifier: srv
@@ -4,7 +4,7 @@ modules:
4
4
  type: {{language}}
5
5
  path: {{& srvPath}}
6
6
  requires:
7
- - name: {{appName}}-auth
7
+ - name: {{appName}}-ias
8
8
  parameters:
9
9
  config:
10
10
  credential-type: X509_GENERATED
@@ -22,7 +22,7 @@ modules:
22
22
  type: approuter.nodejs
23
23
  path: {{& approuterPath}}
24
24
  requires:
25
- - name: {{appName}}-auth
25
+ - name: {{appName}}-ias
26
26
  parameters:
27
27
  config:
28
28
  credential-type: X509_GENERATED
@@ -32,20 +32,21 @@ modules:
32
32
  properties:
33
33
  url: ~{srv-cert-url}
34
34
  forwardAuthCertificates: true
35
+ forwardAuthToken: true
35
36
  strictSSL: true
36
37
 
37
38
  - name: {{appName}}-mtx
38
39
  type: nodejs
39
40
  path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar
40
41
  requires:
41
- - name: {{appName}}-auth
42
+ - name: {{appName}}-ias
42
43
  parameters:
43
44
  config:
44
45
  credential-type: X509_GENERATED
45
46
  app-identifier: mtx
46
47
 
47
48
  resources:
48
- - name: {{appName}}-auth
49
+ - name: {{appName}}-ias
49
50
  type: org.cloudfoundry.managed-service
50
51
  {{#hasApprouter}}
51
52
  requires:
@@ -53,7 +54,7 @@ resources:
53
54
  {{/hasApprouter}}
54
55
  parameters:
55
56
  service: identity
56
- service-name: {{appName}}-auth
57
+ service-name: {{appName}}-ias
57
58
  service-plan: application
58
59
  config:
59
60
  display-name: {{appName}}
@@ -1,5 +1,8 @@
1
1
  {{#hasMultitenancy}}
2
2
  sidecar:
3
+ expose:
4
+ gateway: default/kyma-mtls-gateway
5
+ host: {{#literal}}"{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert"{{/literal}}
3
6
  bindings:
4
7
  auth:
5
8
  serviceInstanceName: identity
@@ -9,6 +12,9 @@ sidecar:
9
12
  {{/hasMultitenancy}}
10
13
  {{#hasApprouter}}
11
14
  approuter:
15
+ expose:
16
+ gateway: default/kyma-mtls-gateway
17
+ host: {{#literal}}"{{ .Release.Name }}-approuter-{{ .Release.Namespace }}.cert"{{/literal}}
12
18
  bindings:
13
19
  auth:
14
20
  serviceInstanceName: identity
@@ -17,6 +23,9 @@ approuter:
17
23
  app-identifier: approuter
18
24
  {{/hasApprouter}}
19
25
  srv:
26
+ expose:
27
+ gateway: default/kyma-mtls-gateway
28
+ host: {{#literal}}"{{ .Release.Name }}-srv-{{ .Release.Namespace }}.cert"{{/literal}}
20
29
  bindings:
21
30
  auth:
22
31
  serviceInstanceName: identity
@@ -35,10 +44,10 @@ identity:
35
44
  {{#hasXsuaa}}
36
45
  xsuaa-cross-consumption: true
37
46
  {{/hasXsuaa}}
38
- {{#hasApprouter}}
39
47
  oauth2-configuration:
40
48
  token-policy:
41
49
  access-token-format: "jwt"
50
+ {{#hasApprouter}}
42
51
  redirect-uris:
43
52
  {{=<% %>=}}
44
53
  - https://*.{{ tpl .Values.global.domain . }}/login/callback
@@ -39,6 +39,19 @@ modules:
39
39
  routes:
40
40
  - route: "${default-url}"
41
41
  - route: "${default-host}.cert.${default-domain}"{{/hasIas}}
42
+ {{#isNodejs}}
43
+ hooks:
44
+ - name: upgrade-all
45
+ type: task
46
+ phases:
47
+ - blue-green.application.before-start.idle
48
+ - deploy.application.before-start
49
+ parameters:
50
+ name: upgrade
51
+ memory: 512M # increase as required
52
+ disk-quota: 768M # increase as required
53
+ command: cds-mtx upgrade '*'
54
+ {{/isNodejs}}
42
55
  provides:
43
56
  - name: mtx-api
44
57
  properties:
@@ -91,7 +104,7 @@ resources:
91
104
  appName: {{appName}}-${org}-${space}
92
105
  appCallbacks:
93
106
  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{{/isNodejs}}
107
+ 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}}
95
108
  subscriptionCallbacks:
96
109
  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
110
  async:
@@ -101,9 +114,9 @@ resources:
101
114
  displayName: {{appName}}
102
115
  description: Description for {{appName}}
103
116
  category: Category
104
- iasServiceInstanceName: {{appName}}-auth{{#hasXsuaa}}
117
+ iasServiceInstanceName: {{appName}}-ias{{#hasXsuaa}}
105
118
  saasManagerServiceInstanceName: {{appName}}-registry{{/hasXsuaa}}
106
119
  requires:
107
120
  - name: {{#isJava}}srv-api{{/isJava}}{{^isJava}}mtx-api{{/isJava}}
108
- processed-after: [{{#hasXsuaa}}{{appName}}-registry, {{/hasXsuaa}}{{appName}}-auth]
121
+ processed-after: [{{#hasXsuaa}}{{appName}}-registry, {{/hasXsuaa}}{{appName}}-ias]
109
122
  {{/hasIas}}
@@ -19,6 +19,11 @@
19
19
  {{#profile}}
20
20
  }
21
21
  {{/profile}}
22
+ {{^profileSpecified}}
23
+ ,"[with-mtx]": {
24
+ "multitenancy": true
25
+ }
26
+ {{/profileSpecified}}
22
27
  }
23
28
  {{#isNodejs}}
24
29
  }
@@ -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{{/literal}}
53
+ {{#literal}}url: https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert.{{ .Values.global.domain }}/-/cds/sms-provisioning/dependencies/{app_tid}{{/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}}
@@ -87,11 +87,6 @@ sidecar:
87
87
  serviceInstanceName: service-manager
88
88
  image:
89
89
  repository: {{appName}}-sidecar
90
- {{#hasIas}}
91
- expose:
92
- gateway: default/kyma-mtls-gateway
93
- {{#literal}}host: https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.cert.{{ .Values.global.domain }}{{/literal}}
94
- {{/hasIas}}
95
90
  resources:
96
91
  limits:
97
92
  ephemeral-storage: 1G
@@ -37,11 +37,16 @@ modules:
37
37
  name: {{appName}}-portal-key
38
38
  config:
39
39
  content-endpoint: developer
40
- - name: {{appName}}-auth{{#hasIas}}
40
+ {{#hasXsuaa}}
41
+ - name: {{appName}}-auth
42
+ {{/hasXsuaa}}
43
+ {{#hasIas}}
44
+ - name: {{appName}}-ias
41
45
  parameters:
42
46
  config:
43
47
  credential-type: X509_GENERATED
44
- app-identifier: portal-deployer{{/hasIas}}
48
+ app-identifier: portal-deployer
49
+ {{/hasIas}}
45
50
  - name: {{appName}}-html5-repo-host
46
51
  - name: {{appName}}-app-deployer
47
52
  deployed-after:
@@ -63,3 +68,8 @@ resources:
63
68
  type: org.cloudfoundry.managed-service
64
69
  parameters:
65
70
  service: destination
71
+
72
+ - name: {{appName}}-ias
73
+ type: org.cloudfoundry.managed-service
74
+ parameters:
75
+ service: identity
@@ -1,13 +1,9 @@
1
- using {
2
- Currency,
3
- managed,
4
- cuid,
5
- sap
6
- } from '@sap/cds/common';
1
+ using { Currency, managed, sap } from '@sap/cds/common';
7
2
 
8
3
  namespace sap.capire.bookshop;
9
4
 
10
- entity Books : managed, cuid {
5
+ entity Books : managed {
6
+ key ID : Integer;
11
7
  title : localized String(111) @mandatory;
12
8
  descr : localized String(1111);
13
9
  author : Association to Authors @mandatory;
@@ -17,7 +13,8 @@ entity Books : managed, cuid {
17
13
  currency : Currency;
18
14
  }
19
15
 
20
- entity Authors : managed, cuid {
16
+ entity Authors : managed {
17
+ key ID : Integer;
21
18
  name : String(111) @mandatory;
22
19
  dateOfBirth : Date;
23
20
  dateOfDeath : Date;
@@ -2,7 +2,8 @@
2
2
  "compilerOptions": {
3
3
  "moduleResolution": "nodenext",
4
4
  "paths": {
5
- "#cds-models/*": ["./@cds-models/*"]
5
+ "#cds-models/*": ["./@cds-models/*"],
6
+ "@sap/cds": ["./node_modules/@cap-js/cds-types"]
6
7
  }
7
8
  }
8
9
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@cap-js/cds-types": "^0.14.0",
3
+ "@cap-js/cds-types": "^0.15.0",
4
4
  "@types/node": "^22.0.0",
5
5
  "tsx": "^4",
6
6
  "typescript": "^5"
@@ -8,6 +8,9 @@
8
8
  "strict": true,
9
9
  "skipLibCheck": true,
10
10
  "sourceMap": true,
11
- "allowJs": true
11
+ "allowJs": true,
12
+ "paths": {
13
+ "@sap/cds": ["./node_modules/@cap-js/cds-types"]
14
+ }
12
15
  }
13
16
  }
@@ -11,10 +11,12 @@ modules:
11
11
  - name: {{appName}}-destinations
12
12
  type: com.sap.application.content
13
13
  requires:
14
+ {{#hasXsuaa}}
14
15
  - name: {{appName}}-auth
15
16
  parameters:
16
17
  service-key:
17
18
  name: {{appName}}-auth-key
19
+ {{/hasXsuaa}}
18
20
  - name: {{appName}}-html5-repo-host
19
21
  parameters:
20
22
  service-key:
@@ -34,11 +36,13 @@ modules:
34
36
  ServiceInstanceName: {{appName}}-html5-repo-host
35
37
  ServiceKeyName: {{appName}}-html5-repo-host-key
36
38
  sap.cloud.service: {{strippedAppName}}.service
39
+ {{#hasXsuaa}}
37
40
  - Name: {{appName}}-auth
38
41
  Authentication: OAuth2UserTokenExchange
39
42
  ServiceInstanceName: {{appName}}-auth
40
43
  ServiceKeyName: {{appName}}-auth-key
41
44
  sap.cloud.service: {{strippedAppName}}.service
45
+ {{/hasXsuaa}}
42
46
 
43
47
  - name: {{appName}}-mtx
44
48
  type: nodejs
@@ -30,10 +30,11 @@ module.exports = class extends require('../../plugin') {
30
30
  }
31
31
 
32
32
  async run() {
33
- await merge({ cds: { requires: { workzone: true } } }).into('package.json')
33
+ const project = readProject()
34
+ const conf = project.isJava ? { requires: { workzone: true }} : { cds: { requires: { workzone: true } } }
35
+ await merge(conf).into(project.configFile)
34
36
 
35
37
  if (cds.cli.options.cdm) {
36
- const project = readProject()
37
38
  await merge(join(__dirname, 'files/cdm.json.hbs')).into('app/workzone/cdm.json', { project })
38
39
  }
39
40
  }
@@ -6,6 +6,9 @@
6
6
  "cds": {
7
7
  {{/isNodejs}}
8
8
  "requires": {
9
+ {{#hasIas}}
10
+ "xsuaa": true,
11
+ {{/hasIas}}
9
12
  {{#profile}}
10
13
  "[{{profile}}]": {
11
14
  {{/profile}}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "9.35.0",
2
+ "version": "9.37.0",
3
3
  "help": "\n# SYNOPSIS\n\n *cds lint* [options] file.js [file.js] [dir]\n\n Runs environment checks and/or checks the specified models\n based on the ESLint framework\n\n# OPTIONS\n \n Basic configuration:\n --no-config-lookup Disable look up for eslint.config.js\n -c, --config path::String Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs\n --inspect-config Open the config inspector with the current configuration\n --ext [String] Specify additional file extensions to lint\n --global [String] Define global variables\n --parser String Specify the parser to be used\n --parser-options Object Specify parser options\n \n Specify Rules and Plugins:\n --plugin [String] Specify plugins\n --rule Object Specify rules\n \n Fix Problems:\n --fix Automatically fix problems\n --fix-dry-run Automatically fix problems without saving the changes to the file system\n --fix-type Array Specify the types of fixes to apply (directive, problem, suggestion, layout)\n \n Ignore Files:\n --no-ignore Disable use of ignore files and patterns\n --ignore-pattern [String] Patterns of files to ignore\n \n Use stdin:\n --stdin Lint code provided on <STDIN> - default: false\n --stdin-filename String Specify filename to process STDIN as\n \n Handle Warnings:\n --quiet Report errors only - default: false\n --max-warnings Int Number of warnings to trigger nonzero exit code - default: -1\n \n Output:\n -o, --output-file path::String Specify file to write report to\n -f, --format String Use a specific output format - default: stylish\n --color, --no-color Force enabling/disabling of color\n \n Inline configuration comments:\n --no-inline-config Prevent comments from changing config or rules\n --report-unused-disable-directives Adds reported errors for unused eslint-disable and eslint-enable directives\n --report-unused-disable-directives-severity String Chooses severity level for reporting unused eslint-disable and eslint-enable directives - either: off, warn, error, 0, 1, or 2\n --report-unused-inline-configs String Adds reported errors for unused eslint inline config comments - either: off, warn, error, 0, 1, or 2\n \n Caching:\n --cache Only check changed files - default: false\n --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n --cache-location path::String Path to the cache file or directory\n --cache-strategy String Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata\n \n Suppressing Violations:\n --suppress-all Suppress all violations - default: false\n --suppress-rule [String] Suppress specific rules\n --suppressions-location path::String Specify the location of the suppressions file\n --prune-suppressions Prune unused suppressions - default: false\n --pass-on-unpruned-suppressions Ignore unused suppressions - default: false\n \n Miscellaneous:\n --init Run config initialization wizard - default: false\n --env-info Output execution environment information - default: false\n --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched\n --exit-on-fatal-error Exit with exit code 2 in case of fatal error - default: false\n --no-warn-ignored Suppress warnings when the file list includes ignored files\n --pass-on-no-patterns Exit with exit code 0 in case no file patterns are passed\n --debug Output debugging information\n -h, --help Show help\n -v, --version Output the version number\n --print-config path::String Print the configuration for the given file\n --stats Add statistics to the lint report - default: false\n --flag [String] Enable a feature flag\n --mcp Start the ESLint MCP server\n --concurrency Int|String Number of linting threads, auto to choose automatically, off for no multithreading - default: off\n \n",
4
4
  "options": [
5
5
  "--config",
package/lib/util/term.js CHANGED
@@ -13,11 +13,8 @@ const t = module.exports.codes = {
13
13
  orange: '\x1b[38;2;255;140;0m' // darker orange, works with bright and dark background
14
14
  }
15
15
 
16
- Object.defineProperty(module.exports, 'isTTY', { get: () => process.stdout.isTTY && process.stderr.isTTY })
17
- const useColor = module.exports.isTTY && process.env.NO_COLOR !== 'true' || (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== 'false')
18
- module.exports.colors = useColor
19
16
  const as = module.exports.as = (codes, o) => {
20
- return useColor ? (codes + o + t.reset) : ('' + o)
17
+ return format.colors ? (codes + o + t.reset) : ('' + o)
21
18
  }
22
19
 
23
20
  const asErr = module.exports.error = o => DEBUG ? o : as(t.red + t.bold, o)
@@ -37,6 +34,7 @@ const format = module.exports.format = (o, severity='Error', asInternalError=fal
37
34
  default : return format.info (o)
38
35
  }
39
36
  }
37
+ format.colors = process.stdout.isTTY && process.stderr.isTTY && process.env.NO_COLOR !== 'true' || (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== 'false')
40
38
 
41
39
  // decorate.error, .warning, .info
42
40
  // 'Error: foo' -> '[ERROR] foo' (Maven-like, allows for better grepping in logs)