@sap/cds-dk 7.9.6 → 8.0.3

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 (291) hide show
  1. package/CHANGELOG.md +2136 -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 +31 -14
  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 +13 -14
  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 +4 -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 +69 -56
  52. package/lib/build/provider/hana/template/package.json +4 -3
  53. package/lib/build/provider/internalBuildPlugin.js +32 -97
  54. package/lib/build/provider/internalBuildTaskProvider.js +12 -48
  55. package/lib/build/provider/java/index.js +2 -3
  56. package/lib/build/provider/mtx/index.js +5 -4
  57. package/lib/build/provider/mtx-extension/index.js +5 -2
  58. package/lib/build/provider/mtx-sidecar/index.js +2 -2
  59. package/lib/build/provider/nodejs/index.js +4 -3
  60. package/lib/build/util.js +83 -12
  61. package/lib/compile/to-mermaid.js +108 -0
  62. package/lib/compile/to_asyncapi.js +7 -0
  63. package/lib/compile/to_openapi.js +7 -0
  64. package/lib/deploy/to-hana/hana.js +37 -34
  65. package/lib/deploy/to-hana/hdiDeployUtil.js +8 -6
  66. package/lib/env/schemas/cds-rc.js +1 -1
  67. package/lib/import/common.js +2 -2
  68. package/lib/import/odata/metadataconverter/MetadataConverter.js +4 -4
  69. package/lib/import/odata/v2parser.js +83 -197
  70. package/lib/import/odata/v4parser.js +1 -38
  71. package/lib/import/openapi/importOpenAPI.js +164 -42
  72. package/lib/index.js +10 -12
  73. package/lib/init/bas.js +91 -0
  74. package/lib/init/constants.js +21 -11
  75. package/lib/init/index.js +72 -150
  76. package/lib/init/merge.js +12 -20
  77. package/lib/init/mvn.js +103 -150
  78. package/lib/init/plugin.js +11 -7
  79. package/lib/init/projectReader.js +53 -20
  80. package/lib/init/registries/mta.js +51 -6
  81. package/lib/init/template/application-logging/files/package.json.hbs +7 -0
  82. package/lib/init/template/application-logging/index.js +13 -1
  83. package/lib/init/template/approuter/files/containerize.yaml.hbs +10 -0
  84. package/lib/init/template/approuter/files/mta.yaml.hbs +1 -2
  85. package/lib/init/template/approuter/files/values.yaml.hbs +19 -4
  86. package/lib/init/template/approuter/files/xs-app.json.hbs +12 -3
  87. package/lib/init/template/approuter/index.js +29 -25
  88. package/lib/init/template/attachments/files/mta.yaml.hbs +14 -0
  89. package/lib/init/template/attachments/files/package.json.hbs +5 -0
  90. package/lib/init/template/attachments/files/values.yaml +7 -0
  91. package/lib/init/template/attachments/index.js +53 -0
  92. package/lib/init/template/{redis-messaging → audit-logging}/files/mta.yaml.hbs +4 -4
  93. package/lib/init/template/audit-logging/files/package.json.hbs +7 -0
  94. package/lib/init/template/audit-logging/index.js +66 -0
  95. package/lib/init/template/cf-manifest/index.js +4 -0
  96. package/lib/init/template/completion/completionSetup.js +54 -33
  97. package/lib/init/template/completion/index.js +7 -1
  98. package/lib/init/template/connectivity/index.js +4 -4
  99. package/lib/init/template/containerize/files/containerize.yaml.hbs +26 -0
  100. package/lib/init/template/containerize/index.js +24 -0
  101. package/lib/init/template/data/index.js +4 -0
  102. package/lib/init/template/destination/files/mta.yaml.hbs +31 -1
  103. package/lib/init/template/destination/files/package.sidecar.json +7 -0
  104. package/lib/init/template/destination/index.js +22 -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/values.yaml.hbs +1 -2
  116. package/lib/init/template/hana/index.js +15 -7
  117. package/lib/init/template/helm/files/Chart.yaml.hbs +2 -3
  118. package/lib/init/template/helm/files/values.schema.json +2173 -0
  119. package/lib/init/template/helm/files/values.yaml.hbs +11 -6
  120. package/lib/init/template/helm/index.js +77 -18
  121. package/lib/init/template/helm-unified-runtime/index.js +19 -56
  122. package/lib/init/template/html5-repo/files/app-package.json.hbs +11 -7
  123. package/lib/init/template/html5-repo/files/manifest.json +13 -0
  124. package/lib/init/template/html5-repo/files/mta.yaml.hbs +14 -33
  125. package/lib/init/template/html5-repo/files/package.sidecar.json +7 -0
  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 +6 -7
  130. package/lib/init/template/html5-repo/index.js +41 -35
  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/files/mta.yaml.hbs +25 -0
  170. package/lib/init/template/redis/files/package.json.hbs +5 -0
  171. package/lib/init/template/redis/index.js +44 -0
  172. package/lib/init/template/redis-messaging/files/package.json.hbs +0 -3
  173. package/lib/init/template/redis-messaging/index.js +8 -18
  174. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_de.properties +3 -0
  175. package/lib/init/template/sample/files/app/admin-books/webapp/i18n/i18n_en.properties +3 -0
  176. package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +13 -1
  177. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n.properties +2 -2
  178. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_de.properties +3 -0
  179. package/lib/init/template/sample/files/app/browse/webapp/i18n/i18n_en.properties +4 -0
  180. package/lib/init/template/sample/files/app/browse/webapp/manifest.json +3 -3
  181. package/lib/init/template/sample/files/app/index.html +1 -1
  182. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +5 -5
  183. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books.csv +6 -6
  184. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Books_texts.csv +5 -5
  185. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Genres.csv +16 -16
  186. package/lib/init/template/sample/files/nodejs/cat-service.js +2 -2
  187. package/lib/init/template/sample/files/package.json.hbs +3 -0
  188. package/lib/init/template/sample/index.js +16 -9
  189. package/lib/init/template/sqlite/index.js +4 -0
  190. package/lib/init/template/tiny-sample/files/nodejs/db/data/my.bookshop-Books.csv +3 -3
  191. package/lib/init/template/tiny-sample/files/nodejs/srv/cat-service.cds.hbs +1 -1
  192. package/lib/init/template/tiny-sample/index.js +4 -0
  193. package/lib/init/template/toggles/files/package.json.hbs +1 -1
  194. package/lib/init/template/toggles/index.js +4 -0
  195. package/lib/init/template/typer/index.js +4 -0
  196. package/lib/init/template/typescript/files/package.json +12 -0
  197. package/lib/init/template/typescript/files/tsconfig.json +13 -0
  198. package/lib/init/template/typescript/index.js +39 -0
  199. package/lib/init/template/workzone/index.js +9 -0
  200. package/lib/init/template/workzone-standard/files/manifest.json.hbs +6 -0
  201. package/lib/init/template/workzone-standard/files/mta.yaml.hbs +59 -0
  202. package/lib/init/template/workzone-standard/index.js +46 -0
  203. package/lib/init/template/xsuaa/files/package.json.hbs +1 -1
  204. package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -2
  205. package/lib/init/template/xsuaa/index.js +11 -7
  206. package/lib/init/validate.js +27 -0
  207. package/lib/lint/generators.js +1 -1
  208. package/lib/lint/io.js +25 -7
  209. package/lib/mtx/auth_manager.js +64 -30
  210. package/lib/mtx/download_legacy.js +2 -2
  211. package/lib/mtx/index.js +0 -4
  212. package/lib/mtx/params.js +32 -38
  213. package/lib/mtx/pull.js +151 -43
  214. package/lib/mtx/push.js +3 -3
  215. package/lib/mtx/settings_manager.js +75 -35
  216. package/lib/mtx/tenant_action.js +1 -1
  217. package/lib/mtx/util/cf.js +1 -1
  218. package/lib/mtx/util/fs.js +26 -1
  219. package/lib/mtx/util/logging.js +7 -3
  220. package/lib/util/command.js +0 -2
  221. package/lib/util/fs.js +2 -3
  222. package/lib/util/question.js +28 -0
  223. package/lib/util/term.js +5 -3
  224. package/npm-shrinkwrap.json +225 -1083
  225. package/package.json +13 -8
  226. package/bin/activate.js +0 -77
  227. package/lib/compile/asyncapi/channels.js +0 -22
  228. package/lib/compile/asyncapi/components/messageTraits/index.js +0 -89
  229. package/lib/compile/asyncapi/components/messages/index.js +0 -173
  230. package/lib/compile/asyncapi/components/schemas/annotations.js +0 -33
  231. package/lib/compile/asyncapi/components/schemas/array.js +0 -8
  232. package/lib/compile/asyncapi/components/schemas/cache.js +0 -14
  233. package/lib/compile/asyncapi/components/schemas/definition.js +0 -187
  234. package/lib/compile/asyncapi/components/schemas/enum.js +0 -16
  235. package/lib/compile/asyncapi/components/schemas/examples.js +0 -10
  236. package/lib/compile/asyncapi/components/schemas/index.js +0 -14
  237. package/lib/compile/asyncapi/components/schemas/localized.js +0 -29
  238. package/lib/compile/asyncapi/components/schemas/primitiveElement.js +0 -41
  239. package/lib/compile/asyncapi/components/schemas/ref.js +0 -45
  240. package/lib/compile/asyncapi/components/schemas/utils.js +0 -108
  241. package/lib/compile/asyncapi/index.js +0 -247
  242. package/lib/compile/asyncapi/message.js +0 -13
  243. package/lib/compile/asyncapi/utils.js +0 -27
  244. package/lib/compile/openapi/csdl2openapi.js +0 -2448
  245. package/lib/compile/openapi/index.js +0 -68
  246. package/lib/init/template/helm/files/chart/templates/NOTES.txt +0 -14
  247. package/lib/init/template/helm/files/chart/templates/_helpers.tpl +0 -28
  248. package/lib/init/template/helm/files/chart/values.root.schema.json +0 -61
  249. package/lib/init/template/helm/files/chart/values.schema.json +0 -366
  250. package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +0 -10
  251. package/lib/init/template/helm-unified-runtime/files/templates/_deployment_helpers.tpl +0 -90
  252. package/lib/init/template/helm-unified-runtime/files/templates/_helpers.tpl +0 -28
  253. package/lib/init/template/helm-unified-runtime/files/values.root.schema.json +0 -61
  254. package/lib/init/template/helm-unified-runtime/files/values.schema.json +0 -366
  255. package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +0 -26
  256. package/lib/init/template/helm-unified-runtime/package.json +0 -4
  257. package/lib/init/template/multitenancy/files/mtxs-configmap-java-approuter.yaml +0 -20
  258. package/lib/init/template/multitenancy/files/mtxs-configmap-java.yaml +0 -18
  259. package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs-approuter.yaml +0 -12
  260. package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs.yaml +0 -12
  261. package/lib/init/template/multitenancy/files/saas-registry-secret.yaml +0 -9
  262. package/lib/init/template/nodejs/files/eslint.config.js +0 -13
  263. package/lib/init/template/notebook/index.js +0 -11
  264. package/lib/init/template/samples/index.js +0 -9
  265. package/lib/mtx/activate.js +0 -238
  266. package/lib/mtx/extend.js +0 -173
  267. package/lib/util/exec.d.ts +0 -54
  268. package/lib/util/exec.js +0 -211
  269. /package/lib/{init/template/approuter/files → build/plugins/helm/files/plugins/approuter}/approuter-configmap.yaml +0 -0
  270. /package/lib/{init/template/connectivity/files → build/plugins/helm/files/plugins/connectivity}/connectivity-proxy-info.yaml +0 -0
  271. /package/lib/{init/template/html5-repo/files → build/plugins/helm/files/plugins/html5-repo}/html5-apps-deployer-configmap.yaml +0 -0
  272. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/_helpers.tpl +0 -0
  273. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/job.yaml +0 -0
  274. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/secret.yaml +0 -0
  275. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-account.yaml +0 -0
  276. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/templates/service-binding.yaml +0 -0
  277. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/content-deployment/values.schema.json +0 -0
  278. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/NOTES.txt +0 -0
  279. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_api.tpl +0 -0
  280. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/_helpers.tpl +0 -0
  281. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/api-rule.yaml +0 -0
  282. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/network-policy.yaml +0 -0
  283. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/rbac.yaml +0 -0
  284. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/secret.yaml +0 -0
  285. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-account.yaml +0 -0
  286. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service-binding.yaml +0 -0
  287. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/service.yaml +0 -0
  288. /package/lib/{init/template/helm/files → build/plugins/helm/files/subcharts}/web-application/templates/virtual-service.yaml +0 -0
  289. /package/lib/{init/template/helm-unified-runtime → build/plugins/helm}/files/templates/NOTES.txt +0 -0
  290. /package/lib/init/template/{nodejs/files → java}/.cdsrc.json +0 -0
  291. /package/lib/init/template/tiny-sample/files/nodejs/db/{data-model.cds → schema.cds} +0 -0
@@ -1,68 +0,0 @@
1
- const csdl2openapi = require('./csdl2openapi')
2
- const cds = require('../../cds')
3
-
4
- module.exports = function processor(csn, options = {}) {
5
- const edmOptions = Object.assign({
6
- odataOpenapiHints: true, // hint to cds-compiler
7
- edm4OpenAPI: true, // downgrades certain OData errors to warnings in cds-compiler
8
- to: 'openapi' // hint to cds.compile.to.edm (usually set by CLI, but also do this in programmatic usages)
9
- }, options)
10
-
11
- // must not be part of function* otherwise thrown errors are swallowed
12
- const csdl = cds.compile.to.edm(csn, edmOptions);
13
-
14
- if (csdl[Symbol.iterator]) { // generator function means multiple services
15
- return _iterate(csdl, csn, options)
16
- } else {
17
- const openApiOptions = toOpenApiOptions(csdl, csn, options)
18
- return _getOpenApi(csdl, openApiOptions);
19
- }
20
- }
21
-
22
- function* _iterate(csdl, csn, options) {
23
- for (let [content, metadata] of csdl) {
24
- if (typeof content === 'string') {
25
- content = JSON.parse(content);
26
- }
27
- const openApiOptions = toOpenApiOptions(content, csn, options)
28
- const openapi = _getOpenApi(content, openApiOptions);
29
- yield [openapi, { file: metadata.file }];
30
- }
31
- }
32
-
33
- function _getOpenApi(csdl, options) {
34
- const openapi = csdl2openapi.csdl2openapi(csdl, options);
35
- return openapi;
36
- }
37
-
38
- function toOpenApiOptions(csdl, csn, options = {}) {
39
- const result = {}
40
- for (const key in options) {
41
- if (/^openapi:(.*)/.test(key) && RegExp.$1) {
42
- result[RegExp.$1] = options[key];
43
- }
44
- else if (key === 'odata-version') {
45
- result['odataVersion'] = options[key];
46
- }
47
- }
48
- if (result.url) {
49
- result.url = result.url.replace(/\/*\$\{service-path\}/g, servicePath(csdl, csn))
50
- }
51
- else { // no 'url' option set: infer URL from service path
52
- result.url = servicePath(csdl, csn) // /catalog
53
- }
54
- return result
55
- }
56
-
57
- function servicePath(csdl, csn) {
58
- if (csdl.$EntityContainer) {
59
- const serviceName = csdl.$EntityContainer.replace(/\.[^.]+$/, '')
60
- const service = csn.definitions[serviceName]
61
-
62
- // if @protocol is 'none' then throw an error
63
- if (service['@protocol'] === 'none') {
64
- throw new Error(`Service "${serviceName}" is annotated with @protocol:'none' which is not supported in openAPI generation.`)
65
- }
66
- return cds.service.path4?.(service) || cds.serve.path4(service)
67
- }
68
- }
@@ -1,14 +0,0 @@
1
- {{- printf "Thank you for installing %s version %s." .Chart.Name .Chart.Version }}
2
-
3
- {{ printf "The release %s is installed in namespace %s." .Release.Name .Release.Namespace }}
4
-
5
- Your services are available at:
6
- {{- $root := . }}
7
- {{- range $name := include "cap.deploymentNames" . | split ";" }}
8
- {{- $deployment := (get $root.Values $name) }}
9
- {{- if $deployment.expose.enabled }}
10
- {{- $ := merge (dict "name" $name "deployment" $deployment) $root }}
11
- {{- $url := include "cap.deploymentHostFull" $ }}
12
- {{ printf "%s - https://%s" $name $url }}
13
- {{- end -}}
14
- {{- end }}
@@ -1,28 +0,0 @@
1
- {{/*
2
- Labels for a component
3
- */}}
4
- {{- define "cap.labels" -}}
5
- helm.sh/revision: {{ .Release.Revision | quote }}
6
- helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
7
- app.kubernetes.io/name: {{ .name }}
8
- app.kubernetes.io/managed-by: {{ .Release.Service }}
9
- app.kubernetes.io/instance: {{ .Release.Name }}
10
- {{- if .Chart.AppVersion }}
11
- app.kubernetes.io/version: {{ .Chart.AppVersion }}
12
- {{- end }}
13
- {{- end -}}
14
-
15
- {{/*
16
- Saas Registry Parameters
17
- */}}
18
- {{- define "cap.service-instance.saasRegistryParameters" -}}
19
- {{- $srvHostFull := include "cap.deploymentHostFull" (merge (dict "name" "srv" "deployment" .Values.srv) . ) }}
20
- {{- if .Values.saasRegistryParameters.bindSidecar }}
21
- {{- $srvHostFull = include "cap.deploymentHostFull" (merge (dict "name" "sidecar" "deployment" .Values.sidecar) . ) }}
22
- {{- end}}
23
- {{- $parameters := .Values.saasRegistryParameters }}
24
- {{- $appUrls := $parameters.appUrls }}
25
- {{- $_ := set $appUrls "getDependencies" (printf "https://%s%s" $srvHostFull $appUrls.getDependencies) }}
26
- {{- $_ := set $appUrls "onSubscription" (printf "https://%s%s" $srvHostFull $appUrls.onSubscription) }}
27
- {{- $parameters | mustToJson }}
28
- {{- end }}
@@ -1,61 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "allOf": [{ "$ref": "./values.schema.json" }],
4
- "properties": {
5
- "srv": {
6
- "$id": "#/properties/srv",
7
- "description": "Deployment",
8
- "$ref": "./charts/web-application/values.schema.json"
9
- },
10
- "approuter": {
11
- "$id": "#/properties/approuter",
12
- "description": "Deployment",
13
- "$ref": "./charts/web-application/values.schema.json"
14
- },
15
- "hana-deployer": {
16
- "$id": "#/properties/hana-deployer",
17
- "description": "Content Deployment",
18
- "$ref": "./charts/content-deployment/values.schema.json"
19
- },
20
- "html5-apps-deployer": {
21
- "$id": "#/properties/html5-apps-deployer",
22
- "description": "Content Deployment",
23
- "$ref": "./charts/content-deployment/values.schema.json"
24
- },
25
- "event-mesh": {
26
- "$id": "#/properties/event-mesh",
27
- "description": "Service Instance",
28
- "$ref": "./charts/service-instance/values.schema.json"
29
- },
30
- "html5-apps-repo-host": {
31
- "$id": "#/properties/html5-apps-repo-host",
32
- "description": "Service Instance",
33
- "$ref": "./charts/service-instance/values.schema.json"
34
- },
35
- "xsuaa": {
36
- "$id": "#/properties/xsuaa",
37
- "description": "Service Instance",
38
- "$ref": "./charts/service-instance/values.schema.json"
39
- },
40
- "destination": {
41
- "$id": "#/properties/destination",
42
- "description": "Service Instance",
43
- "$ref": "./charts/service-instance/values.schema.json"
44
- },
45
- "hana": {
46
- "$id": "#/properties/hana",
47
- "description": "Service Instance",
48
- "$ref": "./charts/service-instance/values.schema.json"
49
- },
50
- "saas-registry": {
51
- "$id": "#/properties/saas-registry",
52
- "description": "Service Instance",
53
- "$ref": "./charts/service-instance/values.schema.json"
54
- },
55
- "service-manager": {
56
- "$id": "#/properties/service-manager",
57
- "description": "Service Instance",
58
- "$ref": "./charts/service-instance/values.schema.json"
59
- }
60
- }
61
- }
@@ -1,366 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "type": "object",
4
- "required": [
5
- "global",
6
- "srv"
7
- ],
8
- "properties": {
9
- "global": {
10
- "$id": "#/properties/global",
11
- "title": "Helm global values",
12
- "description": "For more information, see https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values",
13
- "type": "object",
14
- "required": [
15
- "domain"
16
- ],
17
- "properties": {
18
- "imagePullSecret": {
19
- "$id": "#/properties/global/imagePullSecret",
20
- "title": "Image Pull Secret configuration",
21
- "description": "For more information, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/",
22
- "additionalProperties": false,
23
- "type": "object",
24
- "properties": {
25
- "name": {
26
- "title": "Secret name",
27
- "description": "Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson). Can't be used with the `dockerconfigjson` option.",
28
- "$ref": "#/definitions/KubernetesName"
29
- }
30
- }
31
- },
32
- "domain": {
33
- "$id": "#/properties/global/doamin",
34
- "title": "Domain Name",
35
- "description": "Full-qualified domain name used to access applications in your Kyma cluster",
36
- "type": "string",
37
- "pattern": "[0-9a-z][0-9a-z-.]*"
38
- }
39
- }
40
- },
41
- "srv": {
42
- "$id": "#/properties/srv",
43
- "description": "Deployment"
44
- },
45
- "hana-deployer": {
46
- "$id": "#/properties/hana-deployer",
47
- "description": "Content Deployment"
48
- },
49
- "html5-apps-deployer": {
50
- "$id": "#/properties/html5-apps-deployer",
51
- "description": "Content Deployment"
52
- },
53
- "approuter": {
54
- "$id": "#/properties/approuter",
55
- "description": "Deployment"
56
- },
57
- "event-mesh": {
58
- "$id": "#/properties/event-mesh",
59
- "description": "Service Instance"
60
- },
61
- "html5-apps-repo-host": {
62
- "$id": "#/properties/html5-apps-repo-host",
63
- "description": "Service Instance"
64
- },
65
- "xsuaa": {
66
- "$id": "#/properties/xsuaa",
67
- "description": "Service Instance"
68
- },
69
- "destination": {
70
- "$id": "#/properties/destination",
71
- "description": "Service Instance"
72
- },
73
- "hana": {
74
- "$id": "#/properties/hana",
75
- "description": "Service Instance"
76
- },
77
- "saas-registry": {
78
- "$id": "#/properties/saas-registry",
79
- "description": "Service Instance"
80
- },
81
- "service-manager": {
82
- "$id": "#/properties/service-manager",
83
- "description": "Service Instance"
84
- },
85
- "backendDestinations": {
86
- "$id": "#/properties/backendDestinations",
87
- "title": "Backend Destinations for Approuter or HTML5 Apps Deployer",
88
- "type": "object",
89
- "patternProperties": {
90
- "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
91
- "description": "Name of the backend Destination",
92
- "required": [
93
- "service"
94
- ],
95
- "properties": {
96
- "service": {
97
- "type": "string",
98
- "description": "Target Kubernetes service"
99
- },
100
- "path": {
101
- "type": "string",
102
- "description": "This path will be appended to the URL"
103
- }
104
- }
105
- }
106
- }
107
- }
108
- },
109
- "definitions": {
110
- "KubernetesName": {
111
- "type": "string",
112
- "$comment": "running `kubectl create secret generic invalid_name` will print this regex",
113
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
114
- },
115
- "ServiceInstance": {
116
- "type": "object",
117
- "additionalProperties": false,
118
- "required": [
119
- "serviceOfferingName",
120
- "servicePlanName"
121
- ],
122
- "properties": {
123
- "fullnameOverride": {
124
- "type": "string",
125
- "pattern": "[0-9a-z][0-9a-z-.]*",
126
- "maxLength": 63,
127
- "description": "If present then this will be used instead of the generated name"
128
- },
129
- "enabled": {
130
- "type": "boolean",
131
- "default": true,
132
- "description": "Service instance will be created (default: true)"
133
- },
134
- "serviceOfferingName": {
135
- "type": "string",
136
- "description": "Technical service offering name from service catalog"
137
- },
138
- "servicePlanName": {
139
- "type": "string",
140
- "description": "Technical service plan name from service catalog"
141
- },
142
- "parameters": {
143
- "type": "object",
144
- "description": "Some services support the provisioning of additional configuration parameters during the instance creation. For the list of supported parameters, check the documentation of the particular service offering."
145
- },
146
- "config": {
147
- "type": "string",
148
- "description": "File name of JSON configuration file in chart folder. Values from the file will be copied and placed in the parameters for the service instance. If both parameters and config are specified, the values in parameters override those read from config."
149
- }
150
- }
151
- },
152
- "Image": {
153
- "title": "Image configuration",
154
- "type": "object",
155
- "required": [
156
- "repository"
157
- ],
158
- "additionalProperties": false,
159
- "properties": {
160
- "repository": {
161
- "title": "Repository of the image",
162
- "description": "Should also include the image name (i.e. everything before the `:` sign).",
163
- "type": "string",
164
- "pattern": "^[\\w-./:]*[@sha256]*$"
165
- },
166
- "tag": {
167
- "title": "Image tag",
168
- "description": "Image tag without the name (everything after the `:` sign, potentially including the `@sha256` section at the end).",
169
- "type": "string",
170
- "pattern": "^((?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$"
171
- }
172
- }
173
- },
174
- "Bindings": {
175
- "$id": "#/properties/bindings",
176
- "title": "Service Binding configuration",
177
- "type": "object",
178
- "additionalProperties": false,
179
- "patternProperties": {
180
- "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
181
- "anyOf": [
182
- {
183
- "type": "object",
184
- "additionalProperties": false,
185
- "required": [
186
- "fromSecret"
187
- ],
188
- "properties": {
189
- "fromSecret": {
190
- "description": "Name of a Kubernetes Secret, with the binding content, compliant to the SAP Kubernetes Service Binding spec",
191
- "$ref": "#/definitions/KubernetesName"
192
- }
193
- }
194
- },
195
- {
196
- "type": "object",
197
- "additionalProperties": false,
198
- "properties": {
199
- "serviceInstanceName": {
200
- "description": "Name of a BTP Operator Service Instance, created by the `service-instance` Helm chart. Can't be used with the `serviceInstanceFullname` option.",
201
- "$ref": "#/definitions/KubernetesName"
202
- },
203
- "serviceInstanceFullname": {
204
- "description": "Full name of a BTP Operator Service Instance. Can't be used with the `serviceInstanceName` option.",
205
- "$ref": "#/definitions/KubernetesName"
206
- },
207
- "externalName": {
208
- "description": "The name for the service binding in SAP BTP",
209
- "type": "string"
210
- },
211
- "secretName": {
212
- "description": "The name of the secret where the credentials are stored.",
213
- "$ref": "#/definitions/KubernetesName"
214
- },
215
- "parameters": {
216
- "description": "Some services support the provisioning of additional configuration parameters during the bind request. For the list of supported parameters, check the documentation of the particular service offering.",
217
- "type": "object"
218
- },
219
- "parametersFrom": {
220
- "description": "List of sources to populate parameters.",
221
- "type": "array",
222
- "items": {
223
- "anyOf": [
224
- {
225
- "type": "object",
226
- "description": "Kubernetes Secret as a parameters source.",
227
- "additionalProperties": false,
228
- "properties": {
229
- "secretKeyRef": {
230
- "type": "object",
231
- "additionalProperties": false,
232
- "required": [
233
- "name",
234
- "key"
235
- ],
236
- "properties": {
237
- "name": {
238
- "description": "Name of a Secret.",
239
- "$ref": "#/definitions/KubernetesName"
240
- },
241
- "key": {
242
- "description": "Key in that Secret, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
243
- "type": "string"
244
- }
245
- }
246
- }
247
- }
248
- },
249
- {
250
- "type": "object",
251
- "description": "Kubernetes Config Map as a parameters source.",
252
- "additionalProperties": false,
253
- "properties": {
254
- "configMapKeyRef": {
255
- "type": "object",
256
- "additionalProperties": false,
257
- "required": [
258
- "name",
259
- "key"
260
- ],
261
- "properties": {
262
- "name": {
263
- "description": "Name of a Config Map",
264
- "$ref": "#/definitions/KubernetesName"
265
- },
266
- "key": {
267
- "description": "Key in that Config Map, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
268
- "type": "string"
269
- }
270
- }
271
- }
272
- }
273
- }
274
- ]
275
- }
276
- },
277
- "credentialsRotationPolicy": {
278
- "description": "Holds automatic credentials rotation configuration. For more details, see https://github.com/SAP/sap-btp-service-operator#spec-1",
279
- "type": "object"
280
- }
281
- },
282
- "dependencies": {
283
- "serviceInstanceName": {
284
- "not": {
285
- "required": [
286
- "serviceInstanceFullname"
287
- ]
288
- }
289
- },
290
- "serviceInstanceFullname": {
291
- "not": {
292
- "required": [
293
- "serviceInstanceName"
294
- ]
295
- }
296
- }
297
- }
298
- }
299
- ]
300
- }
301
- }
302
- },
303
- "Resources": {
304
- "title": "Pod resources configuration",
305
- "type": "object",
306
- "additionalProperties": false,
307
- "required": [
308
- "requests",
309
- "limits"
310
- ],
311
- "properties": {
312
- "requests": {
313
- "type": "object",
314
- "description": "Minimal required resources for the application to operate, that will be reserved.",
315
- "additionalProperties": false,
316
- "required": [
317
- "cpu",
318
- "memory"
319
- ],
320
- "properties": {
321
- "cpu": {
322
- "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
323
- "type": [
324
- "string",
325
- "number"
326
- ]
327
- },
328
- "ephemeral-storage": {
329
- "description": "Size of the local ephemeral storage, measured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage",
330
- "type": "string"
331
- },
332
- "memory": {
333
- "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
334
- "type": "string"
335
- }
336
- }
337
- },
338
- "limits": {
339
- "type": "object",
340
- "description": "If a process tries to use more resources than specified in the limits, the system kernel terminates the process that attempted the allocation, with an out of memory (OOM) error.",
341
- "additionalProperties": false,
342
- "required": [
343
- "memory"
344
- ],
345
- "properties": {
346
- "cpu": {
347
- "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
348
- "type": [
349
- "string",
350
- "number"
351
- ]
352
- },
353
- "ephemeral-storage": {
354
- "description": "Size of the local ephemeral storage, measured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage",
355
- "type": "string"
356
- },
357
- "memory": {
358
- "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
359
- "type": "string"
360
- }
361
- }
362
- }
363
- }
364
- }
365
- }
366
- }
@@ -1,10 +0,0 @@
1
- ---
2
- #
3
- # This file is generated by "cds add helm"
4
- apiVersion: v2
5
- name: {{appName}}
6
- description: {{appDescription}}
7
- type: application
8
- version: {{appVersion}}
9
- appVersion: {{appVersion}}
10
-
@@ -1,90 +0,0 @@
1
- {{/*
2
- Get list of deployment names
3
- */}}
4
- {{- define "cap.deploymentNames" -}}
5
- {{- $ := . -}}
6
- {{- $defaultDeployments := (list "srv") -}}
7
- {{- if $.Values.sidecar -}}
8
- {{- $defaultDeployments = (append $defaultDeployments "sidecar") -}}
9
- {{- end -}}
10
- {{- if $.Values.approuter -}}
11
- {{- $defaultDeployments = (append $defaultDeployments "approuter") -}}
12
- {{- end -}}
13
- {{ .deploymentNames | default $defaultDeployments | join ";" }}
14
- {{- end -}}
15
-
16
- {{/*
17
- Create a default fully qualified app name.
18
- We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
19
- If release name contains chart name it will be used as a full name.
20
-
21
- copied from web-application: web-application.fullname
22
-
23
- */}}
24
- {{- define "cap.deploymentHost" -}}
25
- {{- if .deployment.expose.host }}
26
- {{- .deployment.expose.host }}
27
- {{- else }}
28
- {{- $name := (include "cap.web-application.fullname" .) }}
29
- {{- if hasPrefix $name .Release.Namespace }}
30
- {{- .Release.Namespace }}
31
- {{- else }}
32
- {{- printf "%s-%s" $name .Release.Namespace | trunc 63 | trimSuffix "-" }}
33
- {{- end }}
34
- {{- end }}
35
- {{- end }}
36
-
37
- {{- define "cap.web-application.fullname" -}}
38
- {{- if .deployment.fullnameOverride }}
39
- {{- .deployment.fullnameOverride | trunc 63 | trimSuffix "-" }}
40
- {{- else }}
41
- {{- $name := default .name .deployment.nameOverride }}
42
- {{- if contains $name .Release.Name }}
43
- {{- .Release.Name | trunc 63 | trimSuffix "-" }}
44
- {{- else }}
45
- {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
46
- {{- end }}
47
- {{- end }}
48
- {{- end }}
49
-
50
- {{/*
51
- Get FQDN of a deployment
52
- */}}
53
- {{- define "cap.deploymentHostFull" -}}
54
- {{- if not .deployment.expose.enabled }}
55
- {{- printf "%s-%s.%s.svc.cluster.local:8080" .Release.Name .name .Release.Namespace }}
56
- {{- else }}
57
- {{- include "cap.deploymentHost" $ }}.{{ $.Values.global.domain }}
58
- {{- end -}}
59
- {{- end -}}
60
-
61
- {{/*
62
- Backend Destinations
63
- */}}
64
- {{- define "cap.backendDestinations" -}}
65
- {{- $ := . -}}
66
- {{- $root := $.root -}}
67
- {{- $nameKey := "name" -}}
68
- {{- $urlKey := "url" -}}
69
- {{- if $root.Values.backendDestinations }}
70
- {{- $destinations := list -}}
71
- {{- if $.html5 }}
72
- {{- $nameKey = "Name" -}}
73
- {{- $urlKey = "URL" -}}
74
- {{- end -}}
75
- {{- range $destinationName, $destination := $root.Values.backendDestinations -}}
76
- {{- $destination := merge (dict "name" $destinationName) $destination -}}
77
- {{- $deployment := (get $root.Values $destination.service) -}}
78
- {{- $srv := merge (dict "name" $destination.service "destination" $destination "deployment" $deployment) $root -}}
79
- {{- $destinationHost := include "cap.deploymentHostFull" $srv -}}
80
- {{- $protocol := "https" -}}
81
- {{- if not $deployment.expose.enabled }}
82
- {{- $protocol = "http" -}}
83
- {{- end -}}
84
- {{- $currentDestination := dict $nameKey $destination.name $urlKey (print $protocol "://" $destinationHost ) -}}
85
- {{- $currentDestination := merge $currentDestination $.defaultParameters -}}
86
- {{- $destinations = (append $destinations $currentDestination) -}}
87
- {{- end -}}
88
- {{- $destinations | toJson }}
89
- {{- end -}}
90
- {{- end -}}