@sap/cds-dk 10.0.6 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/bin/add.js +7 -23
  3. package/bin/bind.js +10 -0
  4. package/bin/build.js +20 -34
  5. package/bin/cds.js +1 -1
  6. package/bin/compile/index.js +15 -41
  7. package/bin/completion/completionFs.js +11 -8
  8. package/bin/completion/index.js +592 -80
  9. package/bin/completion/scripts/cds.fish +568 -0
  10. package/bin/completion/scripts/cds.ps1 +329 -0
  11. package/bin/completion/scripts/cds.sh +261 -0
  12. package/bin/completion/scripts/cds.zsh +230 -0
  13. package/bin/completion/templates/cds-tmpl.fish +65 -0
  14. package/bin/completion/templates/cds-tmpl.ps1 +208 -0
  15. package/bin/completion/templates/cds-tmpl.sh +93 -0
  16. package/bin/completion/templates/cds-tmpl.zsh +74 -0
  17. package/bin/deploy/index.js +7 -1
  18. package/bin/deploy/options.js +25 -0
  19. package/{lib → bin}/deploy/to-hana/hana.js +8 -8
  20. package/{lib → bin}/deploy/to-hana/hdiDeployUtil.js +1 -1
  21. package/bin/deploy/{to-hana.js → to-hana/index.js} +1 -1
  22. package/{lib → bin}/deploy/to-hana/mtaUtil.js +1 -1
  23. package/bin/deploy/to-sql.js +0 -2
  24. package/bin/export.js +35 -5
  25. package/bin/help/export.md +3 -0
  26. package/bin/help.js +1 -5
  27. package/bin/import.js +6 -0
  28. package/bin/init.js +5 -24
  29. package/bin/inspect.js +6 -0
  30. package/bin/login.js +26 -20
  31. package/bin/pull.js +19 -6
  32. package/bin/push.js +19 -6
  33. package/bin/up.js +14 -11
  34. package/{lib → bin}/upgrade/constants.js +1 -1
  35. package/bin/{upgrade.js → upgrade/index.js} +2 -2
  36. package/{lib → bin}/upgrade/preflight/consistency.js +1 -1
  37. package/{lib → bin}/upgrade/preflight/index.js +1 -1
  38. package/{lib → bin}/upgrade/steps/analyze/index.js +1 -1
  39. package/{lib → bin}/upgrade/steps/install.js +1 -1
  40. package/{lib → bin}/upgrade/steps/openrewrite.js +1 -1
  41. package/{lib → bin}/upgrade/steps/removals.js +1 -1
  42. package/{lib → bin}/upgrade/steps/rewrite.js +1 -1
  43. package/{lib → bin}/upgrade/steps/verify.js +1 -1
  44. package/{lib/upgrade/index.js → bin/upgrade/upgrade.js} +2 -2
  45. package/{lib → bin}/upgrade/util/pom.js +2 -2
  46. package/{lib → bin}/upgrade/util/prompt.js +1 -1
  47. package/bin/util/containerize.js +8 -4
  48. package/bin/version.js +10 -1
  49. package/{lib → bin}/watch/hot-reload.js +1 -1
  50. package/bin/{watch.js → watch/index.js} +17 -9
  51. package/{lib → bin}/watch/livereload-connect.js +1 -1
  52. package/{lib → bin}/watch/vite-watch.js +1 -1
  53. package/{lib → bin}/watch/watched.js +2 -2
  54. package/lib/build/constants.js +1 -1
  55. package/lib/build/plugins/fiori/index.js +31 -2
  56. package/lib/build/plugins/internal.js +4 -2
  57. package/lib/build/plugins/mtx-sidecar/index.js +7 -8
  58. package/lib/build/plugins/nodejs/index.js +64 -7
  59. package/lib/compile/to_asyncapi.js +1 -1
  60. package/lib/env/schema.js +16 -0
  61. package/lib/env/schemas/cds-rc.js +1 -76
  62. package/lib/import/importapi.js +2 -3
  63. package/lib/import/message.js +0 -2
  64. package/lib/init/constants.js +2 -1
  65. package/lib/init/index.js +2 -2
  66. package/lib/init/merge.js +123 -280
  67. package/lib/init/plugin.js +3 -1
  68. package/lib/init/projectReader.js +22 -6
  69. package/lib/init/registries/xs-app.js +3 -5
  70. package/lib/init/template/ai/files/mta.yaml.hbs +1 -1
  71. package/lib/init/template/ai/index.js +14 -2
  72. package/lib/init/template/ams/index.js +2 -2
  73. package/lib/init/template/app-frontend/files/containerize.yaml.hbs +2 -2
  74. package/lib/init/template/app-frontend/index.js +4 -4
  75. package/lib/init/template/application-logging/index.js +2 -2
  76. package/lib/init/template/approuter/files/package.json +1 -1
  77. package/lib/init/template/approuter/index.js +8 -3
  78. package/lib/init/template/attachments/files/package.json.hbs +1 -1
  79. package/lib/init/template/attachments/index.js +2 -2
  80. package/lib/init/template/audit-logging/index.js +2 -2
  81. package/lib/init/template/cloud-logging/files/package.json.hbs +4 -4
  82. package/lib/init/template/cloud-logging/index.js +2 -2
  83. package/lib/init/template/completion/completionSetup.js +36 -39
  84. package/lib/init/template/connectivity/index.js +2 -2
  85. package/lib/init/template/data/as-csv.js +15 -5
  86. package/lib/init/template/data/as-json.js +114 -42
  87. package/lib/init/template/data/index.js +16 -2
  88. package/lib/init/template/destination/index.js +2 -2
  89. package/lib/init/template/dynatrace/files/package.json.hbs +3 -3
  90. package/lib/init/template/dynatrace/index.js +2 -2
  91. package/lib/init/template/enterprise-messaging/index.js +2 -2
  92. package/lib/init/template/enterprise-messaging-shared/index.js +2 -2
  93. package/lib/init/template/extensibility/files/mta.yaml.hbs +11 -0
  94. package/lib/init/template/extensibility/files/xs-security.json.hbs +1 -1
  95. package/lib/init/template/extensibility/index.js +3 -3
  96. package/lib/init/template/github-actions/index.js +2 -2
  97. package/lib/init/template/hana/index.js +3 -2
  98. package/lib/init/template/hana-serverless/files/db/package.json +14 -0
  99. package/lib/init/template/hana-serverless/files/identity.values.yaml.hbs +10 -0
  100. package/lib/init/template/hana-serverless/files/mta.yaml.hbs +64 -0
  101. package/lib/init/template/hana-serverless/files/package.json.hbs +35 -0
  102. package/lib/init/template/hana-serverless/files/src/.hdiconfig +139 -0
  103. package/lib/init/template/hana-serverless/files/undeploy.json +7 -0
  104. package/lib/init/template/hana-serverless/files/values.yaml.hbs +18 -0
  105. package/lib/init/template/hana-serverless/index.js +184 -0
  106. package/lib/init/template/html5-repo/files/containerize.yaml.hbs +2 -2
  107. package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -0
  108. package/lib/init/template/html5-repo/index.js +18 -14
  109. package/lib/init/template/http/index.js +123 -26
  110. package/lib/init/template/ias/index.js +2 -2
  111. package/lib/init/template/kafka/index.js +2 -2
  112. package/lib/init/template/kyma/index.js +7 -5
  113. package/lib/init/template/malware-scanner/index.js +2 -2
  114. package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
  115. package/lib/init/template/multitenancy/index.js +18 -3
  116. package/lib/init/template/nodejs/index.js +4 -2
  117. package/lib/init/template/notifications/index.js +2 -2
  118. package/lib/init/template/portal/files/mta.yaml.hbs +4 -0
  119. package/lib/init/template/portal/index.js +13 -8
  120. package/lib/init/template/postgres/index.js +2 -2
  121. package/lib/init/template/redis/index.js +2 -2
  122. package/lib/init/template/sample/files/db/currencies.cds +2 -0
  123. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +1 -1
  124. package/lib/init/template/tiny-sample/files/nodejs/db/data/CatalogService.Books.csv +2 -2
  125. package/lib/init/template/workzone-standard/index.js +5 -5
  126. package/lib/init/template/xsuaa/index.js +20 -2
  127. package/lib/lint/eslintHelp.json +1 -1
  128. package/lib/mtx/auth_manager.js +103 -37
  129. package/lib/mtx/params.js +3 -2
  130. package/lib/mtx/settings_manager.js +45 -28
  131. package/lib/mtx/tenant_action.js +0 -1
  132. package/lib/mtx/util/credentials.js +62 -0
  133. package/node_modules/@cap-js/openapi/lib/compile/csdl.js +3 -3
  134. package/node_modules/@cap-js/openapi/lib/compile/csdl2openapi.js +111 -103
  135. package/node_modules/@cap-js/openapi/lib/compile/diagram.js +4 -4
  136. package/node_modules/@cap-js/openapi/lib/compile/types.d.ts +3 -1
  137. package/node_modules/@cap-js/openapi/package.json +3 -3
  138. package/node_modules/@sap/cds/CHANGELOG.md +64 -0
  139. package/node_modules/@sap/cds/app/index.js +5 -4
  140. package/node_modules/@sap/cds/eslint.config.mjs +1 -0
  141. package/node_modules/@sap/cds/lib/compile/for/nodejs.js +1 -0
  142. package/node_modules/@sap/cds/lib/compile/minify.js +14 -10
  143. package/node_modules/@sap/cds/lib/env/cds-env.js +1 -1
  144. package/node_modules/@sap/cds/lib/env/cds-requires.js +22 -11
  145. package/node_modules/@sap/cds/lib/env/defaults.js +4 -1
  146. package/node_modules/@sap/cds/lib/env/schemas/cds-rc.js +5 -2
  147. package/node_modules/@sap/cds/lib/plugins.js +9 -5
  148. package/node_modules/@sap/cds/lib/req/spawn.js +1 -1
  149. package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +1 -1
  150. package/node_modules/@sap/cds/lib/srv/srv-models.js +1 -1
  151. package/node_modules/@sap/cds/lib/utils/cds-utils.js +2 -1
  152. package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +2 -3
  153. package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrict.js +8 -1
  154. package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +18 -8
  155. package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +25 -17
  156. package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/authorizedRequest.js +3 -2
  157. package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +9 -3
  158. package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +4 -19
  159. package/node_modules/@sap/cds/libx/_runtime/remote/utils/LruCache.js +42 -0
  160. package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +14 -4
  161. package/node_modules/@sap/cds/libx/_runtime/remote/utils/cloudSdkProvider.js +2 -9
  162. package/node_modules/@sap/cds/libx/_runtime/remote/utils/destinationClient.js +150 -0
  163. package/node_modules/@sap/cds/libx/_runtime/remote/utils/error.js +13 -0
  164. package/node_modules/@sap/cds/libx/_runtime/remote/utils/fetchClient.js +26 -18
  165. package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +34 -23
  166. package/node_modules/@sap/cds/libx/_runtime/remote/utils/token.js +82 -0
  167. package/node_modules/@sap/cds/libx/_runtime/ucl/Service.js +36 -189
  168. package/node_modules/@sap/cds/libx/common/utils/streaming.js +16 -16
  169. package/node_modules/@sap/cds/libx/http/location.js +3 -3
  170. package/node_modules/@sap/cds/libx/odata/middleware/batch.js +16 -10
  171. package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +9 -6
  172. package/node_modules/@sap/cds/libx/odata/middleware/service-document.js +1 -1
  173. package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +19 -3
  174. package/node_modules/@sap/cds/libx/odata/parse/cqn2odata.js +83 -86
  175. package/node_modules/@sap/cds/libx/queue/SchedulingService.js +17 -2
  176. package/node_modules/@sap/cds/libx/queue/processing.js +1 -3
  177. package/node_modules/@sap/cds/libx/rest/RestAdapter.js +3 -7
  178. package/node_modules/@sap/cds/libx/rest/middleware/delete.js +3 -3
  179. package/node_modules/@sap/cds/libx/rest/middleware/parse.js +13 -8
  180. package/node_modules/@sap/cds/libx/rest/middleware/read.js +3 -3
  181. package/node_modules/@sap/cds/libx/rest/middleware/upsert.js +2 -2
  182. package/node_modules/@sap/cds/package.json +1 -1
  183. package/node_modules/@sap/cds-compiler/CHANGELOG.md +60 -8
  184. package/node_modules/@sap/cds-compiler/bin/cdsc.js +2 -2
  185. package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v7.md +46 -19
  186. package/node_modules/@sap/cds-compiler/lib/api/main.js +10 -7
  187. package/node_modules/@sap/cds-compiler/lib/api/options.js +8 -2
  188. package/node_modules/@sap/cds-compiler/lib/base/csnRefs.js +5 -2
  189. package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +4 -0
  190. package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +12 -0
  191. package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +1 -0
  192. package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +8 -7
  193. package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +3 -3
  194. package/node_modules/@sap/cds-compiler/lib/compiler/define.js +301 -75
  195. package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +2 -0
  196. package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +40 -26
  197. package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +45 -60
  198. package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +16 -7
  199. package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +41 -15
  200. package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +7 -6
  201. package/node_modules/@sap/cds-compiler/lib/compiler/tweak-assocs.js +62 -50
  202. package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +29 -14
  203. package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +6 -5
  204. package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -1
  205. package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +1119 -1109
  206. package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +19 -3
  207. package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +10 -16
  208. package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +58 -39
  209. package/node_modules/@sap/cds-compiler/lib/main.d.ts +8 -0
  210. package/node_modules/@sap/cds-compiler/lib/main.js +1 -0
  211. package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +2 -0
  212. package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +2 -1
  213. package/node_modules/@sap/cds-compiler/lib/parsers/XprTree.js +8 -0
  214. package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +22 -1
  215. package/node_modules/@sap/cds-compiler/lib/render/toSql.js +17 -2
  216. package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +6 -1
  217. package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +27 -0
  218. package/node_modules/@sap/cds-compiler/lib/render/utils/standardDatabaseFunctions.js +125 -3
  219. package/node_modules/@sap/cds-compiler/lib/tool-lib/revealInternalProperties.js +2 -1
  220. package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +3 -0
  221. package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +8 -2
  222. package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +22 -6
  223. package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +62 -1
  224. package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +40 -0
  225. package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +1 -0
  226. package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +6 -1
  227. package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +19 -8
  228. package/node_modules/@sap/cds-compiler/package.json +1 -1
  229. package/node_modules/@sap/cds-mtxs/CHANGELOG.md +51 -0
  230. package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +32 -48
  231. package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +35 -16
  232. package/node_modules/@sap/cds-mtxs/cds-plugin.js +18 -0
  233. package/node_modules/@sap/cds-mtxs/lib/migration/migration.js +3 -408
  234. package/node_modules/@sap/cds-mtxs/lib/utils.js +19 -4
  235. package/node_modules/@sap/cds-mtxs/package.json +1 -1
  236. package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +6 -7
  237. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +5 -2
  238. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +6 -5
  239. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.cds +0 -11
  240. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +34 -35
  241. package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +30 -24
  242. package/node_modules/@sap/cds-mtxs/srv/model-provider.js +19 -4
  243. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +6 -3
  244. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi.js +5 -3
  245. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js +3 -2
  246. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/tms.js +17 -0
  247. package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +18 -21
  248. package/node_modules/@sap/xsenv/CHANGELOG.md +7 -0
  249. package/node_modules/@sap/xsenv/package.json +10 -7
  250. package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
  251. package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
  252. package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
  253. package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
  254. package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
  255. package/node_modules/hdb/cfg/VERSION +1 -1
  256. package/node_modules/hdb/lib/protocol/ClientInfo.js +16 -3
  257. package/node_modules/hdb/lib/protocol/Connection.js +1 -0
  258. package/node_modules/hdb/package.json +3 -2
  259. package/node_modules/negotiator/lib/accept.js +54 -0
  260. package/node_modules/negotiator/lib/charset.js +10 -34
  261. package/node_modules/negotiator/lib/encoding.js +9 -30
  262. package/node_modules/negotiator/lib/language.js +15 -36
  263. package/node_modules/negotiator/lib/mediaType.js +16 -134
  264. package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  265. package/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  266. package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  267. package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  268. package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  269. package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  270. package/node_modules/negotiator/package.json +16 -10
  271. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  272. package/node_modules/qs/CHANGELOG.md +15 -0
  273. package/node_modules/qs/README.md +19 -1
  274. package/node_modules/qs/dist/qs.js +21 -21
  275. package/node_modules/qs/eslint.config.mjs +1 -1
  276. package/node_modules/qs/lib/parse.js +3 -4
  277. package/node_modules/qs/lib/stringify.js +23 -8
  278. package/node_modules/qs/lib/utils.js +10 -3
  279. package/node_modules/qs/package.json +4 -4
  280. package/node_modules/qs/test/parse.js +192 -3
  281. package/node_modules/qs/test/stringify.js +317 -0
  282. package/node_modules/qs/test/utils.js +12 -0
  283. package/node_modules/sax/lib/sax.js +27 -9
  284. package/node_modules/sax/package.json +1 -1
  285. package/node_modules/type-is/node_modules/content-type/README.md +2 -0
  286. package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
  287. package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
  288. package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
  289. package/node_modules/type-is/node_modules/content-type/package.json +1 -1
  290. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  291. package/node_modules/ws/package.json +1 -1
  292. package/package.json +5 -5
  293. package/bin/completion/scripts/cds-bash.sh +0 -20
  294. package/bin/completion/scripts/cds-fish.fish +0 -13
  295. package/bin/completion/scripts/cds-ps.ps1 +0 -19
  296. package/bin/completion/scripts/cds-zsh.sh +0 -13
  297. package/lib/deploy/index.js +0 -25
  298. package/lib/import/asyncapi/importAsyncAPI.js +0 -33
  299. package/lib/import/asyncapi/index.js +0 -18
  300. package/lib/import/asyncapi/parserContext.js +0 -372
  301. package/lib/import/asyncapi/utils.js +0 -49
  302. package/lib/init/template/nodejs/files/.gitignore.hbs +0 -34
  303. package/node_modules/@sap/cds/libx/_runtime/ucl/queries.js +0 -61
  304. package/node_modules/@sap/cds-mtxs/lib/migration/extension-project-builder.js +0 -129
  305. package/node_modules/@sap/cds-mtxs/lib/migration/extension-project.js +0 -89
  306. package/node_modules/@sap/cds-mtxs/lib/migration/mtx-adapter.js +0 -230
  307. package/node_modules/negotiator/HISTORY.md +0 -114
  308. /package/{lib → bin}/upgrade/context.js +0 -0
  309. /package/{lib → bin}/upgrade/migrations/cds10/migrations.json +0 -0
  310. /package/{lib → bin}/upgrade/preflight/cds-version.js +0 -0
  311. /package/{lib → bin}/upgrade/preflight/project-type.js +0 -0
  312. /package/{lib → bin}/upgrade/steps/analyze/classification.js +0 -0
  313. /package/{lib → bin}/upgrade/steps/analyze/detector.js +0 -0
  314. /package/{lib → bin}/upgrade/steps/analyze/evaluator.js +0 -0
  315. /package/{lib → bin}/upgrade/steps/analyze/reporter.js +0 -0
  316. /package/{lib → bin}/upgrade/steps/analyze/setup.js +0 -0
  317. /package/{lib → bin}/upgrade/steps/analyze/utils/detection.js +0 -0
  318. /package/{lib → bin}/upgrade/steps/analyze/utils/files.js +0 -0
  319. /package/{lib → bin}/upgrade/steps/analyze/utils/grep.js +0 -0
  320. /package/{lib → bin}/upgrade/steps/analyze/utils/yaml.js +0 -0
  321. /package/{lib → bin}/upgrade/util/workspaces.js +0 -0
  322. /package/{lib → bin}/watch/esm-resolve-registration.js +0 -0
  323. /package/{lib → bin}/watch/livereload-server.js +0 -0
  324. /package/{lib → bin}/watch/node-watch.js +0 -0
  325. /package/{lib → bin}/watch/open.js +0 -0
  326. /package/{lib → bin}/watch/watcher.js +0 -0
@@ -0,0 +1,74 @@
1
+ #!/bin/zsh
2
+ # This file was generated from bin/completion/templates/cds-tmpl.zsh by
3
+ # 'cds completion --generate' and is written to bin/completion/scripts/cds.zsh.
4
+ #
5
+ # Do not edit directly — modify the template and regenerate.
6
+ #
7
+ # Completion strategy (fastest-first):
8
+ # 1. Shortcuts — single-character aliases resolved before any other logic.
9
+ # 2. Top-level — all known subcommands when no subcommand has been typed yet.
10
+ # 3. Flags — matched when the current token starts with '-'.
11
+ # 3.5. Option values — static values for known flags (e.g. --to sqlite).
12
+ # 3.6. Comma values — comma-separable list (e.g. cds add ai,hana).
13
+ # 4. File positionals — files/dirs for subcommands that take a path argument.
14
+ # 4.6. String positionals — fixed word list (e.g. cds help <tab>).
15
+ # 5. Dynamic fallback — calls 'cds completion' for anything not covered above.
16
+ #
17
+ # Zsh uses $words (1-based token array) and $CURRENT (index of cursor token).
18
+ # Completions are added with compadd instead of bash's COMPREPLY.
19
+ # 'case ... esac && return' exits the function when a case arm matched.
20
+
21
+ CDS_COMMAND="cds"
22
+
23
+ _completeCds() {
24
+ local current="${words[CURRENT]}"
25
+ local previous="${words[CURRENT-1]}"
26
+ # The subcommand is always the second token (index 2 in 1-based zsh arrays).
27
+ local cmd="${words[2]}"
28
+ # Step 1: resolve single-character shortcuts to their canonical command name.
29
+ {{SHORTCUT_CASE}}
30
+ # Step 2: top-level — offer all known subcommands when no subcommand has been
31
+ # typed yet ($words is 1-based; ≤ 2 means "cds <cursor>").
32
+ if [[ "${#words[@]}" -le 2 ]]; then
33
+ compadd -S '' -- {{COMMANDS}}
34
+ return
35
+ fi
36
+
37
+ # Step 3: flag/option completion — only triggered when the token starts with '-'.
38
+ # 'case ... esac && return' exits the function when a case arm matched.
39
+ if [[ "$current" == -* ]]; then
40
+ case "$cmd" in
41
+ {{FLAG_CASES}}
42
+ esac && return
43
+ fi
44
+
45
+ # Step 3.5: option-value completion — triggered when the previous word is a known option.
46
+ case "$cmd" in
47
+ {{OPTION_VALUE_CASES}}
48
+ esac
49
+
50
+ # Step 3.6: comma-separated option-value completion.
51
+ case "$cmd" in
52
+ {{COMMA_CASES}}
53
+ esac
54
+
55
+ # Step 4: file-sentinel positionals — emit files and return.
56
+ case "$cmd" in
57
+ {{FILE_CASES}}
58
+ esac
59
+
60
+ # Step 4.6: string positionals (e.g. cds help <tab>) — return after matching.
61
+ case "$cmd" in
62
+ {{STRING_POSITIONAL_CASES}}
63
+ esac && return
64
+
65
+ # Step 5: dynamic fallback — calls 'cds completion' for subcommands whose arguments
66
+ # cannot be determined statically (e.g. service names, model names, unknown flags).
67
+ # Single-quoting $prev/$curr prevents bare word 'h' from being interpreted
68
+ # as the 'help' shortcut by the completion handler before it is processed.
69
+ # compadd -S '' suppresses the trailing space zsh normally appends after a completion.
70
+ compadd -S '' -- $(${CDS_COMMAND} completion --shell zsh --prev "'${words[CURRENT-1]}'" --curr "'${words[CURRENT]}'" --line "'${words[*]}'")
71
+ }
72
+
73
+ # Register the completion function for the 'cds' command.
74
+ compdef _completeCds ${CDS_COMMAND}
@@ -1,6 +1,12 @@
1
- const { options, flags, shortcuts } = require('../../lib/deploy/index.js');
1
+ const { FILE } = require('../completion');
2
+ const { options, flags, shortcuts } = require('./options');
2
3
 
3
4
  module.exports = Object.assign(deploy, {
5
+ staticCompletions: () => ({
6
+ '--to': ['sqlite', 'hana'],
7
+ '--on': ['cf', 'k8s'],
8
+ '_': FILE('cds,json'),
9
+ }),
4
10
  options,
5
11
  flags,
6
12
  shortcuts,
@@ -0,0 +1,25 @@
1
+ module.exports = {
2
+ options: /** @type{const} */([
3
+ '--to',
4
+ '--for',
5
+ '--out',
6
+ '--on',
7
+ '--tunnel-address',
8
+ '--vcap-file',
9
+ '--delta-from'
10
+ ]),
11
+ flags: /** @type{const} */([
12
+ '--resolve-bindings',
13
+ '--no-save',
14
+ '--auto-undeploy',
15
+ '--dry',
16
+ '--xdry',
17
+ '--with-mocks',
18
+ '--store-credentials',
19
+ '--no-build',
20
+ '--model-only',
21
+ '--script',
22
+ '--with-auto-schema-evolution'
23
+ ]),
24
+ shortcuts: ['-2', '-4', '-o', '-n', '', '', '', '-b']
25
+ }
@@ -3,18 +3,18 @@ const path = require('path');
3
3
  const cds = require('../../../lib/cds');
4
4
  const { exists, read, write, mkdirp } = cds.utils;
5
5
 
6
- const { build } = require('../../build');
6
+ const { build } = require('../../../lib/build');
7
7
 
8
8
  const hdi = require('./hdiDeployUtil');
9
- const cfUtil = require('../../util/cf');
9
+ const cfUtil = require('../../../lib/util/cf');
10
10
  const mtaUtil = require('./mtaUtil');
11
11
 
12
- const { bold, info, warn } = require('../../util/term');
12
+ const { bold, info, warn } = require('../../../lib/util/term');
13
13
 
14
- const { bind, storeBindings, env: bindingEnv } = require('../../bind/shared');
15
- const { BUILD_TASK_HANA } = require('../../build/constants');
14
+ const { bind, storeBindings, env: bindingEnv } = require('../../../lib/bind/shared');
15
+ const { BUILD_TASK_HANA } = require('../../../lib/build/constants');
16
16
 
17
- const { options, flags } = require('../index');
17
+ const { options, flags } = require('../options');
18
18
  const allOptions = [...options, ...flags];
19
19
 
20
20
  const DEBUG = cds.debug('cli');
@@ -147,7 +147,7 @@ Therefore, specifying the CDS model is not required when calling 'cds deploy'.`;
147
147
  let bindOptions
148
148
  let usesExistingK8sBinding = false
149
149
 
150
- const { readProject } = require('../../init/projectReader')
150
+ const { readProject } = require('../../../lib/init/projectReader')
151
151
  const { hasKyma, hasMta } = readProject()
152
152
  const onKyma = cds.cli.options.on === 'k8s' || (hasKyma && !hasMta && cds.cli.options.on !== 'cf')
153
153
  if (onKyma) {
@@ -260,7 +260,7 @@ spec:
260
260
  await storeBindings(services, bindOptions)
261
261
  }
262
262
 
263
- const { env4 } = require('../../init/projectReader')
263
+ const { env4 } = require('../../../lib/init/projectReader')
264
264
  if (env4('production').requires?.db?.kind !== 'hana') {
265
265
  console.log(`use ${info('cds add hana')} to configure the project for SAP HANA.\n`);
266
266
  }
@@ -1,5 +1,5 @@
1
1
  const path = require('path');
2
- const { bold } = require('../../util/term');
2
+ const { bold } = require('../../../lib/util/term');
3
3
 
4
4
  const HDI_DEPLOY_LIB = '@sap/hdi-deploy';
5
5
 
@@ -1,5 +1,5 @@
1
1
  exports.deploy = (model, serviceName, options) => {
2
- const hanaDeployer = require('../../lib/deploy/to-hana/hana');
2
+ const hanaDeployer = require('./hana');
3
3
 
4
4
  return hanaDeployer.deploy({
5
5
  ...options,
@@ -1,4 +1,4 @@
1
- const cds = require('../../cds')
1
+ const cds = require('../../../lib/cds')
2
2
 
3
3
  const fs = require('fs').promises
4
4
  const {existsSync} = require('fs')
@@ -1,5 +1,3 @@
1
1
  exports.deploy = function deploy_to_sql (...args) {
2
- // TODO check env.requires.db ...
3
2
  return require('./to-sqlite') .deploy (...args)
4
3
  }
5
- /* eslint no-console: off */
package/bin/export.js CHANGED
@@ -3,7 +3,9 @@ const cds = require ('../lib/cds.js')
3
3
  const { regex4 } = require ('./util/cli.js')
4
4
  const { Minify } = require ('./minify.js')
5
5
  const mvn = require('../lib/init/mvn')
6
+ const term = require('../lib/util/term')
6
7
  const { read, write: cdswrite, exists, mkdirp, local, path, fs } = cds.utils
8
+ const DEBUG = cds.debug('export')
7
9
 
8
10
  class Export extends Minify {
9
11
 
@@ -30,7 +32,8 @@ class Export extends Minify {
30
32
  data: false,
31
33
  as: 'csn',
32
34
  for: 'npm',
33
- force: false,
35
+ artifact: '',
36
+ mvn: '',
34
37
  }
35
38
  static shortcuts = { ...super.shortcuts,
36
39
  to:'2',
@@ -42,6 +45,22 @@ class Export extends Minify {
42
45
  parseArgs (conf) {
43
46
  if (!process.stdout.isTTY) this.options.to = '-'
44
47
  let [sources,o] = super.parseArgs (conf)
48
+ if (o.mvn) {
49
+ o.for = 'mvn'
50
+ o.artifact = o.mvn
51
+ }
52
+ if (o.for === 'mvn') {
53
+ if (!o.mvn)
54
+ console.warn(term.warn(`\n Option --for mvn is deprecated. Use --mvn ${o.artifact || 'groupId:artifactId'} instead.\n`))
55
+ const raw = o.artifact
56
+ if (!raw || !raw.includes(':'))
57
+ throw `\n Maven export requires a --mvn "groupId:artifactId" option.\n`
58
+ const parts = raw.split(':')
59
+ if (parts.length !== 2 || !parts[0] || !parts[1])
60
+ throw `\n Invalid Maven artifact "${raw}". Expected format: "groupId:artifactId".\n`
61
+ const [groupId, artifactId] = parts
62
+ o.artifact = { groupId, artifactId }
63
+ }
45
64
  if (o.from && o.from != '*') { // variant: cds-export <services> --from <models>
46
65
  if (o.services == '/all/') o.services = regex4 (sources)
47
66
  sources = o.from
@@ -108,18 +127,29 @@ class Export extends Minify {
108
127
  }
109
128
 
110
129
  async output (minified,o) {
130
+ const isMvnExport = o.for == 'mvn'
111
131
  if (this.options.to === '-') return super.output (minified)
112
132
  if (this.options.to.endsWith('/*')) this.options.to = this.export_to()
133
+ const rawModuleName = this.options.to
134
+ if (isMvnExport) {
135
+ const { groupId, artifactId } = o.artifact
136
+ this.options.to = path.join(this.options.to, 'src', 'main', 'resources', 'cds', groupId, artifactId)
137
+ }
113
138
  console.log(`\n${this.name}ing APIs to`, cds.utils.local(this.options.to), '...\n')
114
139
  const exports = []; exports.push(...this.export_models (minified))
115
140
  if (o.texts) exports.push (...this.export_texts (minified))
116
141
  if (o.data) exports.push (this.export_data (minified))
117
142
  if (o.for === 'npm') exports.push (this.export_package_json())
118
143
  await Promise.all (exports)
119
- if (o.for === 'mvn') {
120
- // Maven task moves files from the default behaviour to Maven specific locations,
121
- // so we need to await this separately
122
- await mvn.add('cds_export', { 'module-name': o.to })
144
+ if (isMvnExport) {
145
+ const pomPath = path.join(rawModuleName, 'pom.xml')
146
+ if (exists(pomPath)) {
147
+ DEBUG?.(`Skipping mvn.add: pom.xml already exists at ${local(pomPath)}`)
148
+ } else {
149
+ // Maven task modifies pom.xml and sets up the module — await separately
150
+ const { groupId, artifactId } = o.artifact
151
+ await mvn.add('cds_export', { 'to': rawModuleName, 'group-id': groupId, 'artifact-id': artifactId })
152
+ }
123
153
  }
124
154
  console.log()
125
155
  }
@@ -12,6 +12,8 @@
12
12
  *-a | --as* <csn|cdl>
13
13
  *-4 | --for* <npm|mvn>
14
14
 
15
+ *--mvn* <groupId:artifactId> Export for Maven (implies --for mvn)
16
+
15
17
  *-c | --cleanse* <properties>
16
18
  *-k | --keep* <kinds>
17
19
  *-x | --skip* <kinds>
@@ -36,3 +38,4 @@
36
38
  *cds export* -s cat*s --inspect=2
37
39
  *cds export* -s cat*s --as cdl
38
40
  *cds export* -s cat*s
41
+ *cds export* --mvn com.example:my-service --to java-module
package/bin/help.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const cds = require('../lib/cds')
2
2
 
3
3
 
4
- module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, help:`
4
+ module.exports = exports = Object.assign (help, {formatHelp, staticCompletions: () => Object.values(require('./cds').cmds ?? {}), help:`
5
5
  # USAGE
6
6
 
7
7
  *cds* <command> [<args>]
@@ -42,10 +42,6 @@ module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, h
42
42
 
43
43
  `});
44
44
 
45
- async function handleCompletion() {
46
- const cds = require('./cds');
47
- return Object.values(cds.cmds);
48
- }
49
45
 
50
46
  async function help (topic) {
51
47
  await cds.plugins
package/bin/import.js CHANGED
@@ -1,5 +1,10 @@
1
1
  module.exports = Object.assign(_import, {
2
2
  _name: 'import',
3
+ staticCompletions: () => ({
4
+ '--from': ['asyncapi', 'edmx', 'openapi'],
5
+ '--as': ['cds', 'csn', 'json'],
6
+ '_': { type: ':file', ext: ['json', 'xml', 'edmx'] },
7
+ }),
3
8
  options: [ '--services', '--for', '--out', '--as', '--name', '--include-namespaces', '--dependencies', '--from', '--config', '--destination', '--group', '--into-namespace' ],
4
9
  shortcuts: [ '-s', '-4', '-o', '-as', '-n', '-ns', '-d',undefined, '-c', undefined, undefined, '-2', '-', '-f', '-b'],
5
10
  flags: [ '--dry', '--force', '--resolve-bindings', '--no-copy', '--no-save', '--keep-namespace', '--data-product', '--edmx', '--rfc', '--odata', '--openapi', '--asyncapi', '--odata-v2-annotations' ],
@@ -26,6 +31,7 @@ module.exports = Object.assign(_import, {
26
31
  *--asyncapi*
27
32
  *--rfc*
28
33
  Imports the model from the one of the API formats OData EDMX, OpenAPI, AsyncAPI or RFC.
34
+ AsyncAPI requires @cap-js/asyncapi as a project dependency (currently bundled as a fallback)
29
35
 
30
36
  *--data-product*
31
37
  Tells cds import to import a data product. The source must be a valid
package/bin/init.js CHANGED
@@ -1,12 +1,16 @@
1
1
  const { join } = require('path')
2
2
  const { URLS } = require('../lib/init/constants')
3
+ const { DIR, COMMA } = require('../bin/completion')
3
4
 
4
5
  // REVISIT: necessary because module is loaded too early -> shouldn't be necessary
5
6
  const cds = require('../lib/cds')
6
7
  cds.root = join(process.cwd(), process.argv[3]?.startsWith('--') ? '.' : process.argv[3] ?? '')
7
8
 
8
9
  module.exports = Object.assign(init, {
9
- handleCompletion,
10
+ staticCompletions: () => ({
11
+ '--add': COMMA(require('../bin/completion/completionFs').readTemplates([])),
12
+ '--java:package': DIR(),
13
+ }),
10
14
  options: ['--add', '--java:mvn', '--java:package', '--lint:custom', '--lint:custom:example', '--no-db', '--base'],
11
15
  shortcuts: ['-a'],
12
16
  flags: ['--nodejs', '--java', '--force', '--verbose'],
@@ -60,29 +64,6 @@ ${require('../lib/init').help()}
60
64
 
61
65
  `})
62
66
 
63
- async function handleCompletion(currentWord, previousWord, argv, util) {
64
- const allOptionsFlags = [
65
- ...init.options ?? [],
66
- ...init.flags ?? []
67
- ].filter(e => !argv.includes(e));
68
-
69
- if (currentWord?.startsWith('-')) {
70
- return allOptionsFlags;
71
- }
72
-
73
- if (previousWord === '--java:package') {
74
- const excludes = ['_merging'];
75
- return (await util.completionFs.readdir(currentWord, { files: false }))
76
- .filter(e => !excludes.includes(e));
77
- }
78
-
79
- const templates = await util.completionFs.readTemplates(argv);
80
- if (previousWord === '--add' || argv.includes('--add') && previousWord.endsWith(',')) {
81
- return templates;
82
- }
83
-
84
- return allOptionsFlags;
85
- }
86
67
 
87
68
  async function init(args) {
88
69
  console.log()
package/bin/inspect.js CHANGED
@@ -4,7 +4,13 @@ cds inspect model.Req
4
4
  cds inspect model.Requisition --ids
5
5
  */
6
6
 
7
+ const { FILE } = require('./completion');
8
+
7
9
  module.exports = Object.assign (inspect, {
10
+ staticCompletions: () => ({
11
+ '--kind': ['entity', 'aspect', 'type', 'service'],
12
+ '_': FILE('cds,json'),
13
+ }),
8
14
  options: [ '--stats', '--list', '--kind' ],
9
15
  shortcuts: [ '-s', '-l', '-k' ],
10
16
  help: `
package/bin/login.js CHANGED
@@ -85,30 +85,36 @@ module.exports = Object.assign(login, {
85
85
  Note: Productive secrets should not be specified on a command line,
86
86
  since this might expose them to unauthorized users on the same machine!
87
87
 
88
- *-c* | *--client* <clientid>[:<clientsecret>]
88
+ *-c* | *--client* [<clientid>[:<clientsecret>]]
89
89
 
90
90
  Client Credentials (Client ID and optionally Client Secret) for
91
- authentication. If omitted, Client Secret will be queried interactively.
92
-
91
+ authentication. Client Credentials may instead be provided via the
92
+ CDS_LOGIN_CLIENT_ID and CDS_LOGIN_CLIENT_SECRET environment variables,
93
+ which is recommended for CI so that secrets do not appear on the
94
+ command line. Inline values take precedence over the environment. If
95
+ the Client Secret is given neither inline nor via the environment, it is
96
+ queried interactively.
97
+
93
98
  Obtain the Client Credentials from the UAA binding of MTXS.
94
-
99
+
95
100
  Client Credentials will not be saved, only the resulting token.
96
101
 
97
102
  Note: Productive secrets should not be specified on a command line,
98
103
  since this might expose them to unauthorized users on the same machine!
99
104
 
100
- *-m* | *--mtls* <clientid>[:<key>]
105
+ *-m* | *--mtls* [<clientid>]
106
+
107
+ Client-certificate (mTLS) authentication. The Client ID may be given
108
+ inline or via the CDS_LOGIN_CLIENT_ID environment variable. The client
109
+ certificate and its private key are read from the CDS_LOGIN_CLIENT_CERT
110
+ and CDS_LOGIN_CLIENT_KEY environment variables (PEM), which is
111
+ recommended for CI so that key material does not appear on the command
112
+ line. The token is then obtained directly from the authorization
113
+ server over mTLS.
101
114
 
102
- Client Credentials (Client ID and optionally Client-Certificate Private
103
- Key in Base64 encoding) for authentication. If omitted, Private Key will
104
- be queried interactively (avoid newline characters when pasting it).
105
-
106
115
  Obtain the Client Credentials from the UAA binding of MTXS.
107
-
108
- Client Credentials will not be saved, only the resulting token.
109
-
110
- Note: Productive secrets should not be specified on a command line,
111
- since this might expose them to unauthorized users on the same machine!
116
+
117
+ Only the resulting token will be saved.
112
118
 
113
119
  *--save-refresh-token*
114
120
 
@@ -152,14 +158,14 @@ module.exports = Object.assign(login, {
152
158
  async function login ([url], options = {}) {
153
159
  const [username, password] = options.user?.split(':') ?? [];
154
160
  delete options.user;
155
- if (options.client) {
156
- const [clientid, clientsecret] = options.client.split(':');
161
+ if (options.mtls) {
162
+ const { clientid, certificate, key } = require('../lib/mtx/util/credentials').clientCertificate(options.mtls);
163
+ delete options.mtls;
164
+ Object.assign(options, { clientid, certificate, key });
165
+ } else if (options.client) {
166
+ const { clientid, clientsecret } = require('../lib/mtx/util/credentials').clientCredentials(options.client);
157
167
  delete options.client;
158
168
  Object.assign(options, { clientid, clientsecret });
159
- } else if (options.mtls) {
160
- const [clientid, key = 'ask'] = options.mtls.split(':');
161
- delete options.mtls;
162
- Object.assign(options, { clientid, key });
163
169
  }
164
170
  Object.assign(options, {
165
171
  url,
package/bin/pull.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = Object.assign(pull, {
2
- options: ['--subdomain', '--passcode', '--user', '--client', '--from'],
2
+ options: ['--subdomain', '--passcode', '--user', '--client', '--mtls', '--from'],
3
3
  flags: [],
4
- shortcuts: ['-s', '-p', '-u', '-c'],
4
+ shortcuts: ['-s', '-p', '-u', '-c', '-m'],
5
5
  help: `
6
6
  # SYNOPSIS
7
7
 
@@ -42,9 +42,17 @@ module.exports = Object.assign(pull, {
42
42
  Username and optionally password for authentication with Basic Auth in
43
43
  test scenarios.
44
44
 
45
- *-c* | *--client* <clientid>[:<clientsecret>]
45
+ *-c* | *--client* [<clientid>[:<clientsecret>]]
46
46
 
47
- Client ID and optionally Client Secret for authentication.
47
+ Client ID and optionally Client Secret for authentication. May also be
48
+ provided via the CDS_LOGIN_CLIENT_ID and CDS_LOGIN_CLIENT_SECRET
49
+ environment variables. See *cds login* for details.
50
+
51
+ *-m* | *--mtls* [<clientid>]
52
+
53
+ Client-certificate (mTLS) authentication. Client ID inline or via
54
+ CDS_LOGIN_CLIENT_ID; certificate and key via CDS_LOGIN_CLIENT_CERT and
55
+ CDS_LOGIN_CLIENT_KEY. See *cds login* for details.
48
56
 
49
57
  # SEE ALSO
50
58
 
@@ -61,8 +69,11 @@ module.exports = Object.assign(pull, {
61
69
  async function pull([url], options = {}) {
62
70
  const [username, password] = options.user?.split(':') ?? [];
63
71
  delete options.user;
64
- const [clientid, clientsecret] = options.client?.split(':') ?? [];
72
+ const { clientid, clientsecret, certificate, key } = options.mtls
73
+ ? require('../lib/mtx/util/credentials').clientCertificate(options.mtls)
74
+ : require('../lib/mtx/util/credentials').clientCredentials(options.client);
65
75
  delete options.client;
76
+ delete options.mtls;
66
77
  if (options.from) url = options.from;
67
78
  delete options.from;
68
79
 
@@ -72,6 +83,8 @@ async function pull([url], options = {}) {
72
83
  username,
73
84
  password,
74
85
  clientid,
75
- clientsecret
86
+ clientsecret,
87
+ certificate,
88
+ key
76
89
  });
77
90
  }
package/bin/push.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = Object.assign(push, {
2
- options: ['--subdomain', '--passcode', '--user', '--client', '--to', '--async', '--sync'],
2
+ options: ['--subdomain', '--passcode', '--user', '--client', '--mtls', '--to', '--async', '--sync'],
3
3
  flags: [],
4
- shortcuts: ['-s', '-p', '-u', '-c', '-2'],
4
+ shortcuts: ['-s', '-p', '-u', '-c', '-m', '-2'],
5
5
  help: `
6
6
  # SYNOPSIS
7
7
 
@@ -44,9 +44,17 @@ module.exports = Object.assign(push, {
44
44
  Username and optionally password for authentication with Basic Auth in
45
45
  test scenarios.
46
46
 
47
- *-c* | *--client* <clientid>[:<clientsecret>]
47
+ *-c* | *--client* [<clientid>[:<clientsecret>]]
48
48
 
49
- Client ID and optionally Client Secret for authentication.
49
+ Client ID and optionally Client Secret for authentication. May also be
50
+ provided via the CDS_LOGIN_CLIENT_ID and CDS_LOGIN_CLIENT_SECRET
51
+ environment variables. See *cds login* for details.
52
+
53
+ *-m* | *--mtls* [<clientid>]
54
+
55
+ Client-certificate (mTLS) authentication. Client ID inline or via
56
+ CDS_LOGIN_CLIENT_ID; certificate and key via CDS_LOGIN_CLIENT_CERT and
57
+ CDS_LOGIN_CLIENT_KEY. See *cds login* for details.
50
58
 
51
59
  *--async*
52
60
 
@@ -71,15 +79,20 @@ async function push([extArchive], options = {}) {
71
79
 
72
80
  const [username, password] = options.user?.split(':') ?? [];
73
81
  delete options.user;
74
- const [clientid, clientsecret] = options.client?.split(':') ?? [];
82
+ const { clientid, clientsecret, certificate, key } = options.mtls
83
+ ? require('../lib/mtx/util/credentials').clientCertificate(options.mtls)
84
+ : require('../lib/mtx/util/credentials').clientCredentials(options.client);
75
85
  delete options.client;
86
+ delete options.mtls;
76
87
 
77
88
  const args = [{
78
89
  ...options,
79
90
  username,
80
91
  password,
81
92
  clientid,
82
- clientsecret
93
+ clientsecret,
94
+ certificate,
95
+ key
83
96
  }];
84
97
  if (extArchive) {
85
98
  args.push({ extArchive });
package/bin/up.js CHANGED
@@ -1,4 +1,7 @@
1
1
  module.exports = Object.assign(up, {
2
+ staticCompletions: () => ({
3
+ '--to': ['cf', 'k8s'],
4
+ }),
2
5
  options: ['--to', '--namespace', '--overlay'],
3
6
  shortcuts: ['-2', '-n'],
4
7
  flags: [],
@@ -117,7 +120,7 @@ const _mtaextForOverlay = overlay => {
117
120
 
118
121
  async function up() {
119
122
  const project = readProject()
120
- const { apps, appName, hasApprouter, hasXsuaa, isMonorepoMicroservice, hasKyma, hasMta, k8s } = project
123
+ const { approuterPath, html5DeployerPath, apps, appName, hasApprouter, hasXsuaa, isMonorepoMicroservice, hasKyma, hasMta, k8s } = project
121
124
  const toKyma = cds.cli.options.to === 'k8s' || hasKyma && !hasMta, toCf = !toKyma
122
125
 
123
126
  if (cds.cli.options.overlay && toKyma) {
@@ -175,10 +178,10 @@ async function up() {
175
178
  if (!exists('chart') || !exists('containerize.yaml')) run('cds add kyma')
176
179
 
177
180
  if (project.hasHtml5Repo) {
178
- const html5DeployerPath = join(cds.root, cds.env.folders.app, 'html5-deployer', 'resources')
181
+ const html5DeployerResources = join(cds.root, html5DeployerPath, 'resources')
179
182
 
180
183
  if (apps.length > 0) {
181
- await mkdirp(html5DeployerPath)
184
+ await mkdirp(html5DeployerResources)
182
185
  }
183
186
 
184
187
  for (const { app, archiveName } of apps) {
@@ -199,7 +202,7 @@ async function up() {
199
202
  if (needsBuild || process.env.SKIP_CHECK == 'true') {
200
203
  DEBUG?.(dim(`build required for '${app}' – checksums`, { old: storedChecksum, new: currentChecksum }))
201
204
  run(`npm run build --prefix ${appPath}`)
202
- await copy(zipPath).to(html5DeployerPath, `${app}.zip`)
205
+ await copy(zipPath).to(html5DeployerResources, `${app}.zip`)
203
206
  writeStoredChecksum(app, currentChecksum)
204
207
  } else {
205
208
  console.log(info(`Skipping build for UI5 app '${app}' - no changes detected (checksum: ${currentChecksum.substring(0, 8)}...)`))
@@ -209,11 +212,11 @@ async function up() {
209
212
  }
210
213
 
211
214
  if (project.hasAppFrontend) {
212
- const html5DeployerPath = join(cds.root, cds.env.folders.app, 'html5-deployer', 'resources')
215
+ const html5DeployerResources = join(cds.root, html5DeployerPath, 'resources')
213
216
  let isRootApp = true;
214
217
 
215
218
  if (apps.length > 0) {
216
- await mkdirp(html5DeployerPath)
219
+ await mkdirp(html5DeployerResources)
217
220
  }
218
221
 
219
222
  for (const { app } of apps) {
@@ -235,13 +238,13 @@ async function up() {
235
238
  if (needsBuild || process.env.SKIP_CHECK == 'true') {
236
239
  DEBUG?.(dim(`build required for '${app}' – checksums`, { old: storedChecksum, new: currentChecksum }))
237
240
  run(`npm run build --prefix ${appPath}`)
238
- await copy(zipPath).to(html5DeployerPath, `${app}.zip`)
241
+ await copy(zipPath).to(html5DeployerResources, `${app}.zip`)
239
242
  writeStoredChecksum(app, currentChecksum)
240
243
  } else {
241
244
  console.log(info(`Skipping build for React app '${app}' - no changes detected (checksum: ${currentChecksum.substring(0, 8)}...)`))
242
245
  }
243
246
  }
244
-
247
+
245
248
  // for single UI app where Vite app is directly added into app/
246
249
  const appPath = path.join(cds.root, cds.env.folders.app)
247
250
  const rootPkgJson = exists(path.join(appPath, 'package.json'))
@@ -251,7 +254,7 @@ async function up() {
251
254
  const rootZipPath = path.join(appPath, `dist/${appName}.zip`)
252
255
  if(isRootApp) {
253
256
  run(`npm run build --prefix ${appPath}`)
254
- await copy(rootZipPath).to(html5DeployerPath, `${appName}.zip`)
257
+ await copy(rootZipPath).to(html5DeployerResources, `${appName}.zip`)
255
258
  }
256
259
  }
257
260
  }
@@ -332,10 +335,10 @@ async function up() {
332
335
  if (m.path === 'gen/srv') {
333
336
  helmArgs.push(`--set srv.annotations.deployment.deployment-checksum=${m.checksum}`)
334
337
  }
335
- if (m.path === 'app/router') {
338
+ if (m.path === approuterPath) {
336
339
  helmArgs.push(`--set approuter.annotations.deployment.deployment-checksum=${m.checksum}`)
337
340
  }
338
- if (m.path === 'app/html5-deployer') {
341
+ if (m.path === html5DeployerPath) {
339
342
  helmArgs.push(`--set html5-apps-deployer.annotations.job.job-checksum=${m.checksum}`)
340
343
  }
341
344
  if (m.path === 'gen/db') {
@@ -3,7 +3,7 @@
3
3
  const UPGRADE_DIR = '.cds-upgrade'
4
4
  const REPORT_FILE = 'report.md'
5
5
  const FINDINGS_FILE = 'report.yaml'
6
- const JAVA_LATEST = require('../init/constants').MAVEN_ARCHETYPE_VERSION
6
+ const JAVA_LATEST = require('../../lib/init/constants').MAVEN_ARCHETYPE_VERSION
7
7
 
8
8
  // CDS dependencies to rewrite (Node.js)
9
9
  const CDS_DEPS = ['@sap/cds', '@sap/cds-dk']