@sap/cds-dk 7.9.4 → 8.0.2

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 (286) hide show
  1. package/CHANGELOG.md +2116 -0
  2. package/bin/add.js +18 -52
  3. package/bin/bind.js +2 -2
  4. package/bin/build.js +29 -4
  5. package/bin/cds.js +23 -11
  6. package/bin/compile/index.js +7 -6
  7. package/bin/completion/index.js +70 -46
  8. package/bin/completion/scripts/cds-bash.sh +4 -1
  9. package/bin/completion/scripts/cds-fish.fish +13 -0
  10. package/bin/completion/scripts/cds-ps.ps1 +2 -1
  11. package/bin/completion/scripts/cds-zsh.sh +2 -1
  12. package/bin/deploy/index.js +6 -5
  13. package/bin/deploy/to-sqlite.js +2 -2
  14. package/bin/extend.js +19 -50
  15. package/bin/help.js +2 -2
  16. package/bin/init.js +10 -77
  17. package/bin/login.js +13 -5
  18. package/bin/migrate.js +1 -1
  19. package/bin/pull.js +11 -0
  20. package/bin/repl.js +3 -0
  21. package/bin/test.js +5 -0
  22. package/bin/version.js +7 -7
  23. package/bin/watch.js +2 -11
  24. package/lib/bind/KubernetesApiAccessor.js +10 -9
  25. package/lib/build/buildTaskEngine.js +11 -7
  26. package/lib/build/buildTaskFactory.js +15 -43
  27. package/lib/build/buildTaskProviderFactory.js +16 -44
  28. package/lib/build/constants.js +3 -3
  29. package/lib/build/index.js +2 -2
  30. package/lib/build/{buildPlugin.js → plugin.js} +65 -46
  31. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/Chart.yaml +1 -1
  32. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/values.yaml +1 -1
  33. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/Chart.yaml +1 -1
  34. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/templates/_helpers.tpl +7 -0
  35. package/lib/build/plugins/helm/files/subcharts/service-instance/templates/servicebinding.yaml +32 -0
  36. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/templates/serviceinstance.yaml +3 -0
  37. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/values.schema.json +63 -0
  38. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/service-instance/values.yaml +23 -1
  39. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/Chart.yaml +1 -1
  40. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/deployment.yaml +2 -0
  41. package/lib/build/plugins/helm/files/subcharts/web-application/templates/hpa.yaml +22 -0
  42. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/pod-disruption-budget.yaml +1 -0
  43. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/values.schema.json +49 -0
  44. package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/values.yaml +8 -2
  45. package/lib/{init/template/helm/files/chart → build/plugins/helm/files}/templates/_deployment_helpers.tpl +5 -0
  46. package/lib/build/plugins/helm/files/templates/_helpers.tpl +13 -0
  47. package/lib/build/plugins/helm/index.js +81 -0
  48. package/lib/build/plugins.js +12 -15
  49. package/lib/build/provider/featureToggleBuildPlugin.js +7 -39
  50. package/lib/build/provider/hana/2migration.js +168 -124
  51. package/lib/build/provider/hana/index.js +20 -25
  52. package/lib/build/provider/hana/template/.hdiconfig-all +3 -0
  53. package/lib/build/provider/hana/template/.hdiconfig-cloud +3 -0
  54. package/lib/build/provider/hana/template/package.json +4 -3
  55. package/lib/build/provider/internalBuildPlugin.js +32 -97
  56. package/lib/build/provider/internalBuildTaskProvider.js +10 -46
  57. package/lib/build/provider/java/index.js +2 -3
  58. package/lib/build/provider/mtx/index.js +5 -4
  59. package/lib/build/provider/mtx-extension/index.js +5 -2
  60. package/lib/build/provider/mtx-sidecar/index.js +2 -2
  61. package/lib/build/util.js +83 -12
  62. package/lib/compile/to-mermaid.js +108 -0
  63. package/lib/compile/to_asyncapi.js +7 -0
  64. package/lib/compile/to_openapi.js +7 -0
  65. package/lib/deploy/to-hana/hana.js +37 -34
  66. package/lib/deploy/to-hana/hdiDeployUtil.js +8 -6
  67. package/lib/env/schemas/cds-rc.js +1 -1
  68. package/lib/import/common.js +2 -2
  69. package/lib/import/odata/metadataconverter/MetadataConverter.js +4 -4
  70. package/lib/import/odata/v2parser.js +83 -197
  71. package/lib/import/odata/v4parser.js +1 -38
  72. package/lib/import/openapi/importOpenAPI.js +164 -42
  73. package/lib/index.js +10 -12
  74. package/lib/init/bas.js +91 -0
  75. package/lib/init/constants.js +16 -10
  76. package/lib/init/index.js +74 -150
  77. package/lib/init/merge.js +12 -20
  78. package/lib/init/mvn.js +103 -150
  79. package/lib/init/plugin.js +11 -7
  80. package/lib/init/projectReader.js +53 -19
  81. package/lib/init/registries/mta.js +51 -6
  82. package/lib/init/template/application-logging/files/package.json.hbs +7 -0
  83. package/lib/init/template/application-logging/index.js +13 -1
  84. package/lib/init/template/approuter/files/containerize.yaml.hbs +10 -0
  85. package/lib/init/template/approuter/files/mta.yaml.hbs +1 -2
  86. package/lib/init/template/approuter/files/values.yaml.hbs +19 -4
  87. package/lib/init/template/approuter/files/xs-app.json.hbs +12 -3
  88. package/lib/init/template/approuter/index.js +29 -25
  89. package/lib/init/template/attachments/files/mta.yaml.hbs +14 -0
  90. package/lib/init/template/attachments/files/package.json.hbs +5 -0
  91. package/lib/init/template/attachments/files/values.yaml +7 -0
  92. package/lib/init/template/attachments/index.js +53 -0
  93. package/lib/init/template/audit-logging/files/mta.yaml.hbs +14 -0
  94. package/lib/init/template/audit-logging/files/package.json.hbs +7 -0
  95. package/lib/init/template/audit-logging/index.js +66 -0
  96. package/lib/init/template/cf-manifest/index.js +4 -0
  97. package/lib/init/template/completion/completionSetup.js +54 -33
  98. package/lib/init/template/completion/index.js +7 -1
  99. package/lib/init/template/connectivity/index.js +4 -4
  100. package/lib/init/template/containerize/files/containerize.yaml.hbs +26 -0
  101. package/lib/init/template/containerize/index.js +24 -0
  102. package/lib/init/template/data/index.js +4 -0
  103. package/lib/init/template/destination/files/mta.yaml.hbs +25 -1
  104. package/lib/init/template/destination/index.js +12 -2
  105. package/lib/init/template/enterprise-messaging/index.js +6 -3
  106. package/lib/init/template/enterprise-messaging-shared/index.js +5 -1
  107. package/lib/init/template/extensibility/files/package.json.hbs +1 -1
  108. package/lib/init/template/extensibility/files/xs-security.json.hbs +2 -8
  109. package/lib/init/template/extensibility/index.js +3 -1
  110. package/lib/init/template/file-based-messaging/index.js +4 -0
  111. package/lib/init/template/h2/index.js +4 -0
  112. package/lib/init/template/hana/files/containerize.yaml.hbs +10 -0
  113. package/lib/init/template/hana/files/db/package.json +3 -2
  114. package/lib/init/template/hana/files/package.json.hbs +4 -7
  115. package/lib/init/template/hana/files/src/.hdiconfig +3 -0
  116. package/lib/init/template/hana/files/values.yaml.hbs +1 -2
  117. package/lib/init/template/hana/index.js +15 -7
  118. package/lib/init/template/helm/files/Chart.yaml.hbs +2 -3
  119. package/lib/init/template/helm/files/values.schema.json +2173 -0
  120. package/lib/init/template/helm/files/values.yaml.hbs +11 -6
  121. package/lib/init/template/helm/index.js +77 -18
  122. package/lib/init/template/helm-unified-runtime/index.js +19 -56
  123. package/lib/init/template/html5-repo/files/app-package.json.hbs +11 -7
  124. package/lib/init/template/html5-repo/files/manifest.json +13 -0
  125. package/lib/init/template/html5-repo/files/mta.yaml.hbs +41 -8
  126. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +21 -0
  127. package/lib/init/template/html5-repo/files/ui5.yaml.hbs +2 -29
  128. package/lib/init/template/html5-repo/files/values.yaml.hbs +6 -2
  129. package/lib/init/template/html5-repo/files/xs-app.json.hbs +21 -8
  130. package/lib/init/template/html5-repo/index.js +33 -30
  131. package/lib/init/template/http/index.js +36 -12
  132. package/lib/init/template/java/index.js +18 -12
  133. package/lib/init/template/kafka/index.js +4 -0
  134. package/lib/init/template/lint/index.js +7 -2
  135. package/lib/init/template/liquibase/index.js +4 -0
  136. package/lib/init/template/local-messaging/index.js +4 -0
  137. package/lib/init/template/malware-scanner/files/mta.yaml.hbs +14 -0
  138. package/lib/init/template/malware-scanner/files/package.json.hbs +17 -0
  139. package/lib/init/template/malware-scanner/files/values.yaml +7 -0
  140. package/lib/init/template/malware-scanner/index.js +47 -0
  141. package/lib/init/template/mta/files/mta.yaml.hbs +3 -3
  142. package/lib/init/template/mta/files/package.json +1 -1
  143. package/lib/init/template/mta/index.js +4 -0
  144. package/lib/init/template/mtx/index.js +4 -0
  145. package/lib/init/template/multitenancy/files/containerize.yaml.hbs +10 -0
  146. package/lib/init/template/multitenancy/files/mta.yaml.hbs +0 -1
  147. package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
  148. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +6 -5
  149. package/lib/init/template/multitenancy/files/values.yaml.hbs +14 -24
  150. package/lib/init/template/multitenancy/index.js +50 -28
  151. package/lib/init/template/nodejs/files/eslint.config.mjs +2 -0
  152. package/lib/init/template/nodejs/files/package.json.hbs +2 -3
  153. package/lib/init/template/nodejs/index.js +4 -0
  154. package/lib/init/template/notifications/files/mta.yaml.hbs +2 -2
  155. package/lib/init/template/notifications/index.js +4 -0
  156. package/lib/init/template/pipeline/files/.pipeline/config.yml +1 -1
  157. package/lib/init/template/pipeline/files/Jenkinsfile +1 -1
  158. package/lib/init/template/pipeline/index.js +4 -0
  159. package/lib/init/template/portal/files/mta.yaml.hbs +52 -0
  160. package/lib/init/template/portal/files/package.json.hbs +11 -0
  161. package/lib/init/template/portal/files/package.sidecar.json +7 -0
  162. package/lib/init/template/portal/files/portal-site/CommonDataModel.json.hbs +97 -0
  163. package/lib/init/template/portal/files/portal-site/i18n/catalog.properties +1 -0
  164. package/lib/init/template/portal/files/portal-site/i18n/catalog_de.properties +1 -0
  165. package/lib/init/template/portal/files/portal-site/i18n/group.properties +1 -0
  166. package/lib/init/template/portal/files/portal-site/i18n/group_de.properties +1 -0
  167. package/lib/init/template/portal/index.js +84 -0
  168. package/lib/init/template/postgres/index.js +5 -1
  169. package/lib/init/template/redis-messaging/index.js +4 -0
  170. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -0
  171. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -0
  172. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +13 -1
  173. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +2 -2
  174. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -0
  175. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +4 -0
  176. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +3 -3
  177. package/lib/init/template/sample/files/app/index.html +1 -1
  178. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -5
  179. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -6
  180. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -5
  181. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -16
  182. package/lib/init/template/sample/files/nodejs/cat-service.js +2 -2
  183. package/lib/init/template/sample/files/package.json.hbs +3 -0
  184. package/lib/init/template/sample/index.js +16 -9
  185. package/lib/init/template/sqlite/index.js +4 -0
  186. package/lib/init/template/tiny-sample/files/nodejs/db/data/my.bookshop-Books.csv +3 -3
  187. package/lib/init/template/tiny-sample/files/nodejs/srv/cat-service.cds.hbs +1 -1
  188. package/lib/init/template/tiny-sample/index.js +4 -0
  189. package/lib/init/template/toggles/files/package.json.hbs +1 -1
  190. package/lib/init/template/toggles/index.js +4 -0
  191. package/lib/init/template/typer/index.js +4 -0
  192. package/lib/init/template/typescript/files/package.json +12 -0
  193. package/lib/init/template/typescript/files/tsconfig.json +13 -0
  194. package/lib/init/template/typescript/index.js +39 -0
  195. package/lib/init/template/workzone/index.js +5 -0
  196. package/lib/init/template/workzone-standard/files/manifest.json.hbs +6 -0
  197. package/lib/init/template/workzone-standard/index.js +30 -0
  198. package/lib/init/template/xsuaa/files/package.json.hbs +1 -1
  199. package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -2
  200. package/lib/init/template/xsuaa/index.js +11 -7
  201. package/lib/init/validate.js +27 -0
  202. package/lib/lint/generators.js +1 -1
  203. package/lib/lint/io.js +25 -7
  204. package/lib/mtx/auth_manager.js +64 -30
  205. package/lib/mtx/download_legacy.js +2 -2
  206. package/lib/mtx/index.js +0 -4
  207. package/lib/mtx/params.js +32 -38
  208. package/lib/mtx/pull.js +151 -43
  209. package/lib/mtx/push.js +3 -3
  210. package/lib/mtx/settings_manager.js +75 -35
  211. package/lib/mtx/tenant_action.js +1 -1
  212. package/lib/mtx/util/cf.js +1 -1
  213. package/lib/mtx/util/fs.js +26 -1
  214. package/lib/mtx/util/logging.js +7 -3
  215. package/lib/util/command.js +0 -2
  216. package/lib/util/fs.js +2 -3
  217. package/lib/util/question.js +28 -0
  218. package/lib/util/term.js +5 -3
  219. package/npm-shrinkwrap.json +231 -1089
  220. package/package.json +13 -8
  221. package/bin/activate.js +0 -77
  222. package/lib/compile/asyncapi/channels.js +0 -22
  223. package/lib/compile/asyncapi/components/messageTraits/index.js +0 -89
  224. package/lib/compile/asyncapi/components/messages/index.js +0 -173
  225. package/lib/compile/asyncapi/components/schemas/annotations.js +0 -33
  226. package/lib/compile/asyncapi/components/schemas/array.js +0 -8
  227. package/lib/compile/asyncapi/components/schemas/cache.js +0 -14
  228. package/lib/compile/asyncapi/components/schemas/definition.js +0 -187
  229. package/lib/compile/asyncapi/components/schemas/enum.js +0 -16
  230. package/lib/compile/asyncapi/components/schemas/examples.js +0 -10
  231. package/lib/compile/asyncapi/components/schemas/index.js +0 -14
  232. package/lib/compile/asyncapi/components/schemas/localized.js +0 -29
  233. package/lib/compile/asyncapi/components/schemas/primitiveElement.js +0 -41
  234. package/lib/compile/asyncapi/components/schemas/ref.js +0 -45
  235. package/lib/compile/asyncapi/components/schemas/utils.js +0 -108
  236. package/lib/compile/asyncapi/index.js +0 -247
  237. package/lib/compile/asyncapi/message.js +0 -13
  238. package/lib/compile/asyncapi/utils.js +0 -27
  239. package/lib/compile/openapi/csdl2openapi.js +0 -2448
  240. package/lib/compile/openapi/index.js +0 -68
  241. package/lib/init/template/helm/files/chart/templates/NOTES.txt +0 -14
  242. package/lib/init/template/helm/files/chart/templates/_helpers.tpl +0 -28
  243. package/lib/init/template/helm/files/chart/values.root.schema.json +0 -61
  244. package/lib/init/template/helm/files/chart/values.schema.json +0 -366
  245. package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +0 -10
  246. package/lib/init/template/helm-unified-runtime/files/templates/_deployment_helpers.tpl +0 -90
  247. package/lib/init/template/helm-unified-runtime/files/templates/_helpers.tpl +0 -28
  248. package/lib/init/template/helm-unified-runtime/files/values.root.schema.json +0 -61
  249. package/lib/init/template/helm-unified-runtime/files/values.schema.json +0 -366
  250. package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +0 -26
  251. package/lib/init/template/helm-unified-runtime/package.json +0 -4
  252. package/lib/init/template/multitenancy/files/mtxs-configmap-java-approuter.yaml +0 -20
  253. package/lib/init/template/multitenancy/files/mtxs-configmap-java.yaml +0 -18
  254. package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs-approuter.yaml +0 -12
  255. package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs.yaml +0 -12
  256. package/lib/init/template/multitenancy/files/saas-registry-secret.yaml +0 -9
  257. package/lib/init/template/nodejs/files/eslint.config.js +0 -13
  258. package/lib/init/template/notebook/index.js +0 -11
  259. package/lib/init/template/samples/index.js +0 -9
  260. package/lib/mtx/activate.js +0 -238
  261. package/lib/mtx/extend.js +0 -173
  262. package/lib/util/exec.d.ts +0 -54
  263. package/lib/util/exec.js +0 -211
  264. /package/lib/{init/template/approuter/files → build/plugins/helm/files/plugins/approuter}/approuter-configmap.yaml +0 -0
  265. /package/lib/{init/template/connectivity/files → build/plugins/helm/files/plugins/connectivity}/connectivity-proxy-info.yaml +0 -0
  266. /package/lib/{init/template/html5-repo/files → build/plugins/helm/files/plugins/html5-repo}/html5-apps-deployer-configmap.yaml +0 -0
  267. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/_helpers.tpl +0 -0
  268. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/job.yaml +0 -0
  269. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/secret.yaml +0 -0
  270. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-account.yaml +0 -0
  271. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-binding.yaml +0 -0
  272. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/values.schema.json +0 -0
  273. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/NOTES.txt +0 -0
  274. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_api.tpl +0 -0
  275. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_helpers.tpl +0 -0
  276. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/api-rule.yaml +0 -0
  277. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/network-policy.yaml +0 -0
  278. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/rbac.yaml +0 -0
  279. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/secret.yaml +0 -0
  280. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-account.yaml +0 -0
  281. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-binding.yaml +0 -0
  282. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service.yaml +0 -0
  283. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/virtual-service.yaml +0 -0
  284. /package/lib/{init/template/helm-unified-runtime → build/plugins/helm}/files/templates/NOTES.txt +0 -0
  285. /package/lib/init/template/{nodejs/files → java}/.cdsrc.json +0 -0
  286. /package/lib/init/template/tiny-sample/files/nodejs/db/{data-model.cds → schema.cds} +0 -0
@@ -10,9 +10,13 @@ module.exports = class HttpTemplate extends require('../../plugin') {
10
10
 
11
11
  #nodeHost = "http://localhost:4004"
12
12
  #javaHost = "http://localhost:8080"
13
- #defaultOutputDir = "http"
13
+ #defaultOutputDir = "test/http"
14
14
  #defaultAuth = `Authorization: Basic alice:`
15
15
 
16
+ static help() {
17
+ return 'add .http files for modeled services'
18
+ }
19
+
16
20
  options() {
17
21
  return {
18
22
  'filter': {
@@ -95,7 +99,7 @@ module.exports = class HttpTemplate extends require('../../plugin') {
95
99
  for (const c of csn.childrenOf(s.name)) {
96
100
  if (c.name.match(filterStringAsRegex(filter))) {
97
101
  if (c.name.includes('.texts')) continue
98
- c.kind === 'entity' ? entities.push(this.#addNameAndReadOnly(c)) : c.kind === 'action' ? actions.push(c) : null
102
+ c.kind === 'entity' ? entities.push(this.#addEntityInfo(c)) : c.kind === 'action' ? actions.push(c) : null
99
103
  }
100
104
  }
101
105
  if (entities.length === 0 && actions.length === 0) return
@@ -111,10 +115,12 @@ module.exports = class HttpTemplate extends require('../../plugin') {
111
115
  return services
112
116
  }
113
117
 
114
- #addNameAndReadOnly(e) {
118
+ #addEntityInfo(e) {
115
119
  return {
116
120
  name: e.name,
117
121
  readOnly: (e["@readonly"] || e["@cds.autoexpose"] || e['@odata.singleton']) ?? false,
122
+ isDraft: e['@odata.draft.enabled'] ?? false,
123
+ keys: e.keys
118
124
  }
119
125
  }
120
126
 
@@ -154,19 +160,28 @@ module.exports = class HttpTemplate extends require('../../plugin') {
154
160
  const url = `{{server}}/${urlPath}${entityNameSimple}`
155
161
  const requestTitle = `\n### ${e.name}`
156
162
  requests.push(`${requestTitle}\nGET ${url}\n${headers}\n`)
157
- if (e.readOnly) {
158
- return
159
- }
163
+ if (e.readOnly) return
160
164
 
161
165
  const entityData = payload[`${e.name}`] ? payload[`${e.name}`][0] : null
162
166
  if (!entityData) return
163
- // TODO handle ids that are not named ID
164
- if (!Object.keys(entityData).some(k => k === "ID")) return // no need to write requests for entities without ids
165
-
166
167
  const postBody = JSON.stringify(entityData, null, 2)
167
- requests.push(`${requestTitle}\nPOST ${url}\n${headers}\n\n${postBody}\n`)
168
- requests.push(`${requestTitle}\nPATCH ${url}/${entityData.ID}\n${headers}\n\n${postBody}\n`)
169
- requests.push(`${requestTitle}\nDELETE ${url}/${entityData.ID}\n${headers}\n`)
168
+
169
+ let id
170
+ const compositeKey = Object.keys(e.keys).length > 1
171
+ if (compositeKey) {
172
+ id = e.keys.map(k => k.type === 'cds.String' ? `${k.name}='${entityData[k.name]}'` : `${k.name}=${entityData[k.name]}`).join(',')
173
+ } else {
174
+ id = entityData[Object.keys(e.keys)[0]]
175
+ }
176
+
177
+ if (e.isDraft) {
178
+ generateDraftRequests(requests, requestTitle, url, headers, postBody, id)
179
+ } else {
180
+ compositeKey ? id = `(${id})` : id = `/${id}`
181
+ requests.push(`${requestTitle}\nPOST ${url}\n${headers}\n\n${postBody}\n`)
182
+ requests.push(`${requestTitle}\nPATCH ${url}${id}\n${headers}\n\n${postBody}\n`)
183
+ requests.push(`${requestTitle}\nDELETE ${url}${id}\n${headers}\n`)
184
+ }
170
185
  })
171
186
 
172
187
  service.actions.forEach((a) => {
@@ -188,6 +203,15 @@ module.exports = class HttpTemplate extends require('../../plugin') {
188
203
  })
189
204
  this.#write(requests, serviceName)
190
205
  }
206
+
207
+ function generateDraftRequests(requests, requestTitle, url, headers, postBody, id) {
208
+ requests.push(`${requestTitle} Drafts \nGET ${url}?$filter=(IsActiveEntity eq false)\n${headers}\n`) // unencoded URL for better readability (client can handle this)
209
+ requests.push(`${requestTitle} Drafts \nPOST ${url}\n${headers}\n\n${postBody}\n`)
210
+ requests.push(`\n### Please paste the server-generated draft id here e.g. ID=101 or ID=101,secodKey='stringValue' \n@draftID = ${id}\n`)
211
+ requests.push(`${requestTitle} Patch Draft \nPATCH ${url}({{draftID}},IsActiveEntity=false)\n${headers}\n\n${postBody}\n`)
212
+ requests.push(`${requestTitle} Prepare Draft \nPOST ${url}({{draftID}},IsActiveEntity=false)/AdminService.draftPrepare\n${headers}\n\n{}\n`)
213
+ requests.push(`${requestTitle} Activate Draft \nPOST ${url}({{draftID}},IsActiveEntity=false)/AdminService.draftActivate\n${headers}\n\n{}\n`)
214
+ }
191
215
  }
192
216
 
193
217
  #write(requests, serviceName) {
@@ -1,38 +1,44 @@
1
1
  const os = require('os')
2
2
  const cds = require('../../../cds')
3
- const { exists, copy, rimraf, fs, path } = cds.utils, { join } = path
3
+ const { exists, copy, rimraf, fs:{promises:{ mkdtemp }}, path } = cds.utils, { join } = path
4
4
  const cmd = require('../../../util/command')
5
5
  const mvn = require('../../mvn')
6
- const term = require('../../../util/term')
6
+ const { bold, info, link } = require('../../../util/term')
7
7
  const { URLS, OPTIONS: { NODEJS, JAVA }, COMMAND_ADD } = require('../../constants')
8
+ const { command, options } = cds.cli
8
9
 
9
10
  module.exports = class JavaTemplate extends require('../../plugin') {
10
11
 
12
+ static help() {
13
+ return 'creates a Java-based project'
14
+ }
15
+
11
16
  static hasInProduction() {
12
- return exists('pom.xml') || cds.cli.options?.add?.has(JAVA)
17
+ return exists('pom.xml') || options?.add?.has(JAVA)
13
18
  }
14
19
 
15
20
  async canRun() {
16
- if (cds.cli.command === COMMAND_ADD) {
21
+ if (command === COMMAND_ADD) {
17
22
  throw `You can't change the runtime of an existing project.`
18
23
  }
19
- if (cds.cli.options.add?.has(NODEJS)) {
20
- throw `Only one runtime per project is supported. Specify either ${term.bold(JAVA)} or ${term.bold(NODEJS)}.`
24
+ if (options.add?.has(NODEJS)) {
25
+ throw `Only one runtime per project is supported. Specify either ${bold(JAVA)} or ${bold(NODEJS)}.`
21
26
  }
22
27
  return true
23
28
  }
24
29
 
25
30
  async run() {
26
- const { cmdLine, artifactId, archetypeVersion } = await mvn.getGenerateCmdArgs(path.basename(cds.root))
31
+ const projectName = path.basename(cds.root)
32
+ const { params, artifactId, archetypeVersion } = await mvn.init(projectName)
27
33
  console.log(`Using Maven archetype version ${archetypeVersion}`)
28
34
 
29
- const temp = await fs.promises.mkdtemp(join(os.tmpdir(), `${path.basename(cds.root)}_`))
35
+ const temp = await mkdtemp(join(os.tmpdir(), `${path.basename(cds.root)}_`))
30
36
  try {
31
- await cmd.spawnCommand('mvn', cmdLine, { cwd: temp })
32
- await copy(join(temp, artifactId), cds.root);
37
+ await cmd.spawnCommand('mvn', params, { cwd: temp })
38
+ await copy(join(temp, artifactId)).to(cds.root)
33
39
  } catch (err) {
34
40
  if (err.code === 'ENOENT' && err.path === 'mvn') {
35
- throw `Maven executable 'mvn' not found, follow ${term.info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
41
+ throw `Maven executable 'mvn' not found. Follow ${info(URLS.MAVEN_INSTALL_HELP)} and install Maven on your machine.`
36
42
  }
37
43
  throw err;
38
44
  } finally {
@@ -41,6 +47,6 @@ module.exports = class JavaTemplate extends require('../../plugin') {
41
47
  }
42
48
 
43
49
  async finalize() {
44
- console.log(`Learn about next steps at ${term.link(URLS.CAPIRE)}`)
50
+ console.log(`Learn about next steps at ${link(URLS.CAPIRE)}`)
45
51
  }
46
52
  }
@@ -7,6 +7,10 @@ const mvn = require('../../mvn')
7
7
 
8
8
  module.exports = class KafkaTemplate extends require('../../plugin') {
9
9
 
10
+ static help() {
11
+ return 'messaging via Apache Kafka'
12
+ }
13
+
10
14
  static hasInProduction(env) {
11
15
  if (exists('pom.xml')) {
12
16
  if (!exists('srv/pom.xml')) return false
@@ -15,6 +15,11 @@ const VSCODE_FILE_ASSOCIATIONS = {
15
15
  }
16
16
 
17
17
  module.exports = class LintTemplate extends require('../../plugin') {
18
+
19
+ static help() {
20
+ return 'configure cds lint'
21
+ }
22
+
18
23
  constructor() {
19
24
  super();
20
25
  this.customPath = path.join(cds.root, ".eslint");
@@ -137,7 +142,7 @@ module.exports = class LintTemplate extends require('../../plugin') {
137
142
 
138
143
  // Require locally installed ESLint CDS plugin
139
144
  if (!eslintPluginLocal) {
140
- this.missingNpmDependencies["names"].push("@sap/eslint-plugin-cds@^3.0.0");
145
+ this.missingNpmDependencies["names"].push("@sap/eslint-plugin-cds@^3");
141
146
  this.missingNpmDependencies["msgs"].push("ESLint plugin for CDS v>=3.0.0");
142
147
  }
143
148
  return;
@@ -153,7 +158,7 @@ module.exports = class LintTemplate extends require('../../plugin') {
153
158
  const { getConfigPath } = require("@sap/eslint-plugin-cds/lib/api");
154
159
  let configPath = getConfigPath(cds.root);
155
160
  if (!configPath) {
156
- configPath = path.join(cds.root, "eslint.config.js");
161
+ configPath = path.join(cds.root, "eslint.config.mjs");
157
162
  }
158
163
  await io.sanitizeEslintConfig(configPath, this.customRuleExample);
159
164
  }
@@ -3,6 +3,10 @@ const { readProject } = require('../../projectReader')
3
3
 
4
4
  module.exports = class LiquibaseTemplate extends require('../../plugin') {
5
5
 
6
+ static help() {
7
+ return 'database migration using Liquibase'
8
+ }
9
+
6
10
  async canRun() {
7
11
  const { isNodejs } = readProject()
8
12
  if (isNodejs) throw `'cds add liquibase' is not available for Node.js yet`
@@ -5,6 +5,10 @@ const { merge } = require('../../merge')
5
5
 
6
6
  module.exports = class LocalMessagingTemplate extends require('../../plugin') {
7
7
 
8
+ static help() {
9
+ return 'messaging via local event bus'
10
+ }
11
+
8
12
  async canRun() {
9
13
  const { isJava } = readProject()
10
14
  if (isJava) throw `'cds add local-messaging' is not available for Java yet`
@@ -0,0 +1,14 @@
1
+ ---
2
+ modules:
3
+ - name: {{appName}}-srv
4
+ type: {{language}}
5
+ path: {{& srvPath}}
6
+ requires:
7
+ - name: {{appName}}-malware-scanner
8
+
9
+ resources:
10
+ - name: {{appName}}-malware-scanner
11
+ type: org.cloudfoundry.managed-service
12
+ parameters:
13
+ service: malware-scanner
14
+ service-plan: clamav
@@ -0,0 +1,17 @@
1
+ {
2
+ {{#isNodejs}}
3
+ "cds": {
4
+ {{/isNodejs}}
5
+ "requires": {
6
+ {{#profile}}
7
+ "[{{profile}}]": {
8
+ {{/profile}}
9
+ "malware-scanner": true
10
+ {{#profile}}
11
+ }
12
+ {{/profile}}
13
+ }
14
+ {{#isNodejs}}
15
+ }
16
+ {{/isNodejs}}
17
+ }
@@ -0,0 +1,7 @@
1
+ srv:
2
+ bindings:
3
+ malware-scanner:
4
+ serviceInstanceName: malware-scanner
5
+ malware-scanner:
6
+ serviceOfferingName: malware-scanner
7
+ servicePlanName: clamav
@@ -0,0 +1,47 @@
1
+ const { readProject } = require('../../projectReader')
2
+ const { merge } = require('../../merge')
3
+ const { srv4, malwareScanner } = require('../../registries/mta')
4
+
5
+ module.exports = class MalwareScannerTemplate extends require('../../plugin') {
6
+
7
+ static help() {
8
+ return 'SAP Malware Scanning service'
9
+ }
10
+
11
+ static hasInProduction(env) {
12
+ return !!env.requires['malware-scanner']
13
+ }
14
+
15
+ async canRun() {
16
+ return true
17
+ }
18
+
19
+ async run() {
20
+ const project = readProject()
21
+ const { isNodejs } = project
22
+ if (isNodejs) {
23
+ await merge(__dirname, 'files/package.json.hbs').into('package.json', { project })
24
+ }
25
+ }
26
+
27
+ async combine() {
28
+ const project = readProject()
29
+ const { hasMta, hasHelm, hasHelmUnifiedRuntime, srvPath } = project
30
+
31
+ if (hasMta) {
32
+ const srv = srv4(srvPath)
33
+ const additions = [srv, malwareScanner ]
34
+ const relationships = [{
35
+ insert: [malwareScanner, 'name'],
36
+ into: [srv, 'requires', 'name']
37
+ }]
38
+ await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
39
+ with: project, additions, relationships
40
+ })
41
+ }
42
+
43
+ if (hasHelm || hasHelmUnifiedRuntime) {
44
+ await merge(__dirname, 'files', 'values.yaml').into('chart/values.yaml')
45
+ }
46
+ }
47
+ }
@@ -1,5 +1,5 @@
1
1
  ---
2
- _schema-version: '3.1'
2
+ _schema-version: 3.3.0
3
3
  ID: {{appId}}
4
4
  version: {{appVersion}}
5
5
  description: "{{appDescription}}"
@@ -29,7 +29,7 @@ modules:
29
29
  parameters:
30
30
  buildpack: sap_java_buildpack_jakarta
31
31
  readiness-health-check-type: http
32
- readiness-health-check-http-endpoint: /
32
+ readiness-health-check-http-endpoint: /actuator/health
33
33
  properties:
34
34
  SPRING_PROFILES_ACTIVE: cloud,sandbox
35
35
  JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
@@ -37,7 +37,7 @@ modules:
37
37
  build-parameters:
38
38
  builder: custom
39
39
  commands:
40
- - mvn clean package -DskipTests=true
40
+ - mvn clean package -DskipTests=true --batch-mode
41
41
  build-result: target/*-exec.jar
42
42
  {{/isJava}}
43
43
  provides:
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@sap/cds-dk": "^7"
3
+ "@sap/cds-dk": ">=7"
4
4
  }
5
5
  }
@@ -8,6 +8,10 @@ const { merge, sort } = require('../../merge')
8
8
 
9
9
  module.exports = class MtaTemplate extends require('../../plugin') {
10
10
 
11
+ static help() {
12
+ return 'Cloud Foundry deployment using mta.yaml'
13
+ }
14
+
11
15
  static hasInProduction() {
12
16
  return exists('mta.yaml')
13
17
  }
@@ -2,6 +2,10 @@ const { MULTITENANCY, TOGGLES, EXTENSIBILITY } = require('../../constants').OPTI
2
2
 
3
3
  module.exports = class MtxTemplate extends require('../../plugin') {
4
4
 
5
+ static help() {
6
+ return 'multitenancy + toggles + extensibility'
7
+ }
8
+
5
9
  requires() {
6
10
  return [MULTITENANCY, TOGGLES, EXTENSIBILITY]
7
11
  }
@@ -0,0 +1,10 @@
1
+ ---
2
+ modules:
3
+ - name: {{appName}}-sidecar
4
+ build-parameters:
5
+ buildpack:
6
+ type: nodejs
7
+ builder: builder-jammy-base
8
+ path: {{#isNodejs}}gen/{{/isNodejs}}mtx/sidecar{{#isJava}}/gen{{/isJava}}
9
+ env:
10
+ BP_NODE_RUN_SCRIPTS: ""
@@ -8,7 +8,6 @@ modules:
8
8
  {{#isJava}}
9
9
  - name: mtx-api
10
10
  properties:
11
- CDS_MULTITENANCY_MTXS_ENABLED: true
12
11
  CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url}
13
12
  {{/isJava}}
14
13
  provides:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  {{#isNodejs}}
3
3
  "dependencies": {
4
- "@sap/cds-mtxs": "^1.9"
4
+ "@sap/cds-mtxs": "^2"
5
5
  },
6
6
  "cds": {
7
7
  {{/isNodejs}}
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "{{appName}}-mtx",
3
3
  "dependencies": {
4
- "@sap/cds": "^7",
5
- "@sap/cds-hana": "^2",
6
- "@sap/cds-mtxs": "^1.9",
7
- "@sap/xssec": "^3",
4
+ "@cap-js/hana": "^1",
5
+ "@sap/cds": "^8",
6
+ "@sap/cds-mtxs": "^2",
7
+ "@sap/xssec": "^4",
8
8
  "express": "^4"
9
9
  },
10
10
  "devDependencies": {
@@ -15,6 +15,7 @@
15
15
  "build": "cds build ../.. --for mtx-sidecar --production && npm ci --prefix gen"{{/isJava}}
16
16
  },
17
17
  "cds": {
18
- "profile": "mtx-sidecar"
18
+ {{#isJava}}"profiles": ["mtx-sidecar", "java"]{{/isJava}}
19
+ {{#isNodejs}}"profile": "mtx-sidecar"{{/isNodejs}}
19
20
  }
20
21
  }
@@ -7,34 +7,25 @@ srv:
7
7
  {{/isJava}}
8
8
  service-manager:
9
9
  serviceInstanceName: service-manager
10
+ {{#isJava}}
11
+ env:
12
+ CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
13
+ {{/isJava}}
10
14
  service-manager:
11
15
  serviceOfferingName: service-manager
12
16
  servicePlanName: container
13
17
  saas-registry:
14
18
  serviceOfferingName: saas-registry
15
19
  servicePlanName: application
16
- saasRegistryParameters:
17
- xsappname: {{appName}}
18
- appName: {{appName}}
19
- displayName: {{appName}}
20
- description: {{appDescription}}
21
- category: "CAP Application"
22
- {{#isNodejs}}
23
- bindSidecar: true
24
- {{/isNodejs}}
25
- appUrls:
26
- {{#isNodejs}}
27
- getDependencies: "/-/cds/saas-provisioning/dependencies"
28
- onSubscription: "/-/cds/saas-provisioning/tenant/{tenantId}"
29
- {{/isNodejs}}
30
- {{#isJava}}
31
- getDependencies: "/mt/v1.0/subscriptions/dependencies"
32
- onSubscription: "/mt/v1.0/subscriptions/tenants/{tenantId}"
33
- {{/isJava}}
34
- onSubscriptionAsync: true
35
- onUnSubscriptionAsync: true
36
- onUpdateDependenciesAsync: true
37
- callbackTimeoutMillis: 300000
20
+ parameters:
21
+ displayName: {{appName}}
22
+ description: {{appDescription}}
23
+ category: "CAP Application"
24
+ appUrls:
25
+ onSubscriptionAsync: true
26
+ onUnSubscriptionAsync: true
27
+ onUpdateDependenciesAsync: true
28
+ callbackTimeoutMillis: 300000
38
29
  sidecar:
39
30
  bindings:
40
31
  {{#hasXsuaa}}
@@ -48,8 +39,7 @@ sidecar:
48
39
  service-manager:
49
40
  serviceInstanceName: service-manager
50
41
  image:
51
- repository: <your-container-registry>/{{appName}}-sidecar
52
- tag: latest
42
+ repository: {{appName}}-sidecar
53
43
  resources:
54
44
  limits:
55
45
  ephemeral-storage: 1G
@@ -1,9 +1,9 @@
1
1
  const { join } = require('path')
2
2
  const cds = require('../../../cds')
3
- const { read, write, copy } = cds.utils
3
+ const { read, write } = cds.utils
4
4
  const mvn = require('../../mvn')
5
5
  const { readProject } = require('../../projectReader')
6
- const { merge, sort, removeFromYAML } = require('../../merge')
6
+ const { merge, sort } = require('../../merge')
7
7
  const { copyRenderedJSON } = require('../../../util/fs')
8
8
  const {
9
9
  srv4, // Server
@@ -14,6 +14,10 @@ const {
14
14
 
15
15
  module.exports = class MultitenancyTemplate extends require('../../plugin') {
16
16
 
17
+ static help() {
18
+ return 'schema-based multitenancy support'
19
+ }
20
+
17
21
  static hasInProduction(env) {
18
22
  const { options } = cds.cli.options
19
23
  // REVISIT: Check if this can be simplified
@@ -28,7 +32,7 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
28
32
  const packageJson = await read('package.json')
29
33
  packageJson.workspaces = ['mtx/sidecar']
30
34
  await write('package.json', packageJson, { spaces: 2 })
31
- await mvn.execMvn(mvn.getAddArgs('mtx'))
35
+ await mvn.add('mtx')
32
36
  }
33
37
  if (isNodejs) await sort('package.json', 'dependencies')
34
38
  await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar', 'package.json'), project)
@@ -36,7 +40,7 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
36
40
 
37
41
  async combine() {
38
42
  const project = readProject()
39
- const { isNodejs, isJava, hasMta, hasHelm, hasHelmUnifiedRuntime, hasXsuaa, hasHana, srvPath, hasApprouter } = project
43
+ const { isNodejs, isJava, hasMta, hasHelm, hasHelmUnifiedRuntime, hasXsuaa, hasHana, hasContainerize, srvPath, hasApprouter } = project
40
44
 
41
45
  if (hasMta) {
42
46
  const srv = srv4(srvPath)
@@ -84,35 +88,53 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
84
88
  where: { serviceOfferingName: 'xsuaa' }
85
89
  }, 'parameters.tenant-mode'], withValue: 'shared'
86
90
  }] : []
87
-
88
- await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project, overwrites })
89
91
 
90
- const envFromObject = {
91
- envFrom: [{
92
- configMapRef: {
93
- name: "{{ .Release.Name }}-mtxs-configmap"
94
- }
95
- }]
96
- }
92
+ await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project, overwrites })
97
93
 
94
+ const domain = hasApprouter ? 'svc.cluster.local:8080' : '{{ .Values.global.domain }}'
95
+ const applicationWorkload = hasApprouter ? 'approuter' : 'srv'
96
+ const serviceCommunicatingWithSaasReg = hasApprouter ? 'approuter' : isNodejs ? 'sidecar' : 'srv';
98
97
  await merge({
99
- ...(isNodejs) && { sidecar: envFromObject },
100
- ...(isJava) && { srv: envFromObject },
101
98
  'saas-registry': {
102
- parametersFrom: [
103
- {
104
- secretKeyRef: {
105
- name: "{{ .Release.Name }}-saas-registry-secret",
106
- key: "parameters"
107
- }
108
- }
109
- ]
110
- }
111
- }).into('chart/values.yaml', { with: project })
99
+ 'parameters': {
100
+ xsappname: `${project.appName}-{{ .Release.Namespace }}`,
101
+ appName: `${project.appName}-{{ .Release.Namespace }}`,
102
+ appUrls: {
103
+ getDependencies: `https://{{ .Release.Name }}-${serviceCommunicatingWithSaasReg}-{{ .Release.Namespace }}.{{ .Values.global.domain }}${isNodejs ? '/-/cds/saas-provisioning' : '/mt/v1.0/subscriptions'}/dependencies`,
104
+ onSubscription: `https://{{ .Release.Name }}-${serviceCommunicatingWithSaasReg}-{{ .Release.Namespace }}.{{ .Values.global.domain }}${isNodejs ? '/-/cds/saas-provisioning/tenant/{tenantId}' : '/mt/v1.0/subscriptions/tenants/{tenantId}'}`,
105
+ }
106
+ }
107
+ },
108
+ ...(isNodejs) && { sidecar: {
109
+ env: {
110
+ SUBSCRIPTION_URL: `https://\${tenant_subdomain}-{{ .Release.Name }}-${applicationWorkload}-{{ .Release.Namespace }}.{{ .Values.global.domain }}`
111
+ }
112
+ }},
113
+ ...(isJava) && { srv: {
114
+ env: {
115
+ CDS_MULTITENANCY_APPUI_URL: `https://{{ .Release.Name }}-${applicationWorkload}-{{ .Release.Namespace }}.{{ .Values.global.domain }}`,
116
+ CDS_MULTITENANCY_SIDECAR_URL: `http${hasApprouter ? '' : 's'}://{{ .Release.Name }}-sidecar${hasApprouter ? '.' : '-'}{{ .Release.Namespace }}.${domain}`
117
+ }
118
+ }}
119
+ }).into('chart/values.yaml',{ forceOverwrite: true })
120
+ }
121
+
122
+ if (hasContainerize) {
123
+ const deletions = []
124
+ if (hasHana) {
125
+ deletions.push({
126
+ item: {
127
+ in: 'modules',
128
+ where: { name: `${project.appName}-hana-deployer` }
129
+ }
130
+ })
131
+ }
112
132
 
113
- await removeFromYAML(join('chart', 'values.yaml'), ['srv.expose', 'srv.networkSecurity'])
114
- await copy(join(__dirname, 'files', `mtxs-configmap-${isJava ? 'java' : 'nodejs'}${hasApprouter ? '-approuter' : ''}.yaml`)).to('chart', 'templates', 'mtxs-configmap.yaml') // REVISIT: Move to build task
115
- await copy(join(__dirname, 'files', 'saas-registry-secret.yaml')).to('chart', 'templates', 'saas-registry-secret.yaml') // REVISIT: Move to build task
133
+ const additions = [{
134
+ in: 'modules',
135
+ where: { name: `${project.appName}-sidecar` }
136
+ }]
137
+ await merge(__dirname, '/files/containerize.yaml.hbs').into('containerize.yaml', { with: project, additions, deletions })
116
138
  }
117
139
 
118
140
  if (hasXsuaa) {
@@ -0,0 +1,2 @@
1
+ import cds from '@sap/cds/eslint.config.mjs'
2
+ export default [ ...cds.recommended ]
@@ -6,13 +6,12 @@
6
6
  "license": "UNLICENSED",
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@sap/cds": "^7",
9
+ "@sap/cds": "^8",
10
10
  "express": "^4"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@cap-js/sqlite": "^1",
14
- "@sap/eslint-plugin-cds": "^3",
15
- "eslint": "^9"
14
+ "@cap-js/cds-types": "^0.6"
16
15
  },
17
16
  "scripts": {
18
17
  "start": "cds-serve"
@@ -8,6 +8,10 @@ const { renderAndCopy } = require('../../template')
8
8
 
9
9
  module.exports = class NodejsTemplate extends require('../../plugin') {
10
10
 
11
+ static help() {
12
+ return 'creates a Node.js-based project'
13
+ }
14
+
11
15
  static hasInProduction() {
12
16
  return !exists('pom.xml') && !cds.cli.options?.add?.has(JAVA)
13
17
  }
@@ -7,11 +7,11 @@ modules:
7
7
  no-route: true
8
8
  no-start: true
9
9
  memory: 256MB
10
- disk-quota: 256MB
10
+ disk-quota: 1GB
11
11
  tasks:
12
12
  - name: notification-content-deployment
13
13
  command: "node node_modules/@cap-js/notifications/lib/content-deployment.js"
14
14
  memory: 256MB
15
- disk-quota: 256MB
15
+ disk-quota: 1GB
16
16
  requires:
17
17
  - name: {{appName}}-destination