@sap/cds-dk 10.0.7 → 10.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/bin/add.js +7 -23
  3. package/bin/bind.js +14 -0
  4. package/bin/build.js +21 -34
  5. package/bin/cds.js +1 -1
  6. package/bin/compile/index.js +16 -41
  7. package/bin/completion/completionFs.js +11 -8
  8. package/bin/completion/index.js +603 -80
  9. package/bin/completion/scripts/cds.fish +620 -0
  10. package/bin/completion/scripts/cds.ps1 +403 -0
  11. package/bin/completion/scripts/cds.sh +327 -0
  12. package/bin/completion/scripts/cds.zsh +296 -0
  13. package/bin/completion/templates/cds-tmpl.fish +65 -0
  14. package/bin/completion/templates/cds-tmpl.ps1 +217 -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 +11 -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/env.js +4 -1
  25. package/bin/export.js +44 -6
  26. package/bin/help/export.md +3 -0
  27. package/bin/help.js +1 -5
  28. package/bin/import.js +9 -0
  29. package/bin/init.js +6 -24
  30. package/bin/inspect.js +8 -0
  31. package/bin/lint.js +5 -3
  32. package/bin/login.js +26 -20
  33. package/bin/minify.js +6 -1
  34. package/bin/pull.js +19 -6
  35. package/bin/push.js +19 -6
  36. package/bin/repl.js +11 -2
  37. package/bin/run.js +12 -1
  38. package/bin/serve.js +13 -2
  39. package/bin/up.js +17 -11
  40. package/{lib → bin}/upgrade/constants.js +1 -1
  41. package/bin/{upgrade.js → upgrade/index.js} +2 -2
  42. package/{lib → bin}/upgrade/preflight/consistency.js +1 -1
  43. package/{lib → bin}/upgrade/preflight/index.js +1 -1
  44. package/{lib → bin}/upgrade/steps/analyze/index.js +1 -1
  45. package/{lib → bin}/upgrade/steps/install.js +1 -1
  46. package/{lib → bin}/upgrade/steps/openrewrite.js +1 -1
  47. package/{lib → bin}/upgrade/steps/removals.js +1 -1
  48. package/{lib → bin}/upgrade/steps/rewrite.js +1 -1
  49. package/{lib → bin}/upgrade/steps/verify.js +1 -1
  50. package/{lib/upgrade/index.js → bin/upgrade/upgrade.js} +2 -2
  51. package/{lib → bin}/upgrade/util/pom.js +2 -2
  52. package/{lib → bin}/upgrade/util/prompt.js +1 -1
  53. package/bin/util/containerize.js +10 -4
  54. package/bin/version.js +10 -1
  55. package/{lib → bin}/watch/hot-reload.js +1 -1
  56. package/bin/{watch.js → watch/index.js} +24 -9
  57. package/{lib → bin}/watch/livereload-connect.js +1 -1
  58. package/{lib → bin}/watch/vite-watch.js +1 -1
  59. package/{lib → bin}/watch/watched.js +2 -2
  60. package/lib/build/constants.js +1 -1
  61. package/lib/build/plugins/fiori/index.js +31 -2
  62. package/lib/build/plugins/internal.js +4 -2
  63. package/lib/build/plugins/mtx-sidecar/index.js +7 -8
  64. package/lib/build/plugins/nodejs/index.js +64 -7
  65. package/lib/build/util.js +2 -4
  66. package/lib/compile/to_asyncapi.js +1 -1
  67. package/lib/env/schema.js +16 -0
  68. package/lib/env/schemas/cds-rc.js +1 -76
  69. package/lib/import/importapi.js +2 -3
  70. package/lib/import/message.js +0 -2
  71. package/lib/init/constants.js +2 -1
  72. package/lib/init/index.js +2 -2
  73. package/lib/init/merge.js +123 -280
  74. package/lib/init/plugin.js +3 -1
  75. package/lib/init/projectReader.js +22 -6
  76. package/lib/init/registries/xs-app.js +3 -5
  77. package/lib/init/template/ai/files/mta.yaml.hbs +1 -1
  78. package/lib/init/template/ai/index.js +14 -2
  79. package/lib/init/template/ams/index.js +2 -2
  80. package/lib/init/template/app-frontend/files/containerize.yaml.hbs +2 -2
  81. package/lib/init/template/app-frontend/index.js +4 -4
  82. package/lib/init/template/application-logging/index.js +2 -2
  83. package/lib/init/template/approuter/files/package.json +1 -1
  84. package/lib/init/template/approuter/index.js +8 -3
  85. package/lib/init/template/attachments/files/package.json.hbs +1 -1
  86. package/lib/init/template/attachments/index.js +2 -2
  87. package/lib/init/template/audit-logging/index.js +2 -2
  88. package/lib/init/template/cloud-logging/files/package.json.hbs +4 -4
  89. package/lib/init/template/cloud-logging/index.js +2 -2
  90. package/lib/init/template/completion/completionSetup.js +36 -39
  91. package/lib/init/template/connectivity/index.js +2 -2
  92. package/lib/init/template/data/as-csv.js +15 -5
  93. package/lib/init/template/data/as-json.js +117 -42
  94. package/lib/init/template/data/index.js +16 -2
  95. package/lib/init/template/destination/index.js +2 -2
  96. package/lib/init/template/dynatrace/files/package.json.hbs +3 -3
  97. package/lib/init/template/dynatrace/index.js +2 -2
  98. package/lib/init/template/enterprise-messaging/index.js +2 -2
  99. package/lib/init/template/enterprise-messaging-shared/index.js +2 -2
  100. package/lib/init/template/extensibility/files/mta.yaml.hbs +11 -0
  101. package/lib/init/template/extensibility/files/xs-security.json.hbs +1 -1
  102. package/lib/init/template/extensibility/index.js +3 -3
  103. package/lib/init/template/github-actions/index.js +2 -2
  104. package/lib/init/template/hana/index.js +3 -2
  105. package/lib/init/template/hana-serverless/files/db/package.json +14 -0
  106. package/lib/init/template/hana-serverless/files/identity.values.yaml.hbs +10 -0
  107. package/lib/init/template/hana-serverless/files/mta.yaml.hbs +64 -0
  108. package/lib/init/template/hana-serverless/files/package.json.hbs +35 -0
  109. package/lib/init/template/hana-serverless/files/src/.hdiconfig +139 -0
  110. package/lib/init/template/hana-serverless/files/undeploy.json +7 -0
  111. package/lib/init/template/hana-serverless/files/values.yaml.hbs +18 -0
  112. package/lib/init/template/hana-serverless/index.js +184 -0
  113. package/lib/init/template/html5-repo/files/containerize.yaml.hbs +2 -2
  114. package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -0
  115. package/lib/init/template/html5-repo/index.js +18 -14
  116. package/lib/init/template/http/index.js +123 -26
  117. package/lib/init/template/ias/index.js +2 -2
  118. package/lib/init/template/kafka/index.js +2 -2
  119. package/lib/init/template/kyma/index.js +7 -5
  120. package/lib/init/template/malware-scanner/index.js +2 -2
  121. package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
  122. package/lib/init/template/multitenancy/index.js +18 -3
  123. package/lib/init/template/notifications/index.js +2 -2
  124. package/lib/init/template/portal/files/mta.yaml.hbs +4 -0
  125. package/lib/init/template/portal/index.js +13 -8
  126. package/lib/init/template/postgres/index.js +2 -2
  127. package/lib/init/template/redis/index.js +2 -2
  128. package/lib/init/template/sample/files/db/currencies.cds +2 -0
  129. package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +1 -1
  130. package/lib/init/template/tiny-sample/files/nodejs/db/data/CatalogService.Books.csv +2 -2
  131. package/lib/init/template/workzone-standard/index.js +5 -5
  132. package/lib/init/template/xsuaa/index.js +20 -2
  133. package/lib/lint/eslintHelp.json +1 -1
  134. package/lib/mtx/auth_manager.js +103 -37
  135. package/lib/mtx/params.js +3 -2
  136. package/lib/mtx/settings_manager.js +45 -28
  137. package/lib/mtx/tenant_action.js +0 -1
  138. package/lib/mtx/util/credentials.js +62 -0
  139. package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
  140. package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
  141. package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
  142. package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
  143. package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
  144. package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
  145. package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
  146. package/node_modules/@cap-js/db-service/lib/search.js +1 -1
  147. package/node_modules/@cap-js/db-service/package.json +1 -1
  148. package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
  149. package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
  150. package/node_modules/@cap-js/sqlite/package.json +3 -3
  151. package/node_modules/@sap/cds/CHANGELOG.md +57 -0
  152. package/node_modules/@sap/cds/app/index.js +5 -4
  153. package/node_modules/@sap/cds/eslint.config.mjs +1 -0
  154. package/node_modules/@sap/cds/lib/compile/minify.js +14 -10
  155. package/node_modules/@sap/cds/lib/env/cds-env.js +1 -1
  156. package/node_modules/@sap/cds/lib/env/cds-requires.js +22 -11
  157. package/node_modules/@sap/cds/lib/env/defaults.js +4 -1
  158. package/node_modules/@sap/cds/lib/env/schemas/cds-rc.js +5 -2
  159. package/node_modules/@sap/cds/lib/plugins.js +9 -5
  160. package/node_modules/@sap/cds/lib/req/spawn.js +1 -1
  161. package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +1 -1
  162. package/node_modules/@sap/cds/lib/srv/srv-models.js +1 -1
  163. package/node_modules/@sap/cds/lib/utils/cds-utils.js +2 -1
  164. package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +2 -3
  165. package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrict.js +8 -1
  166. package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +18 -8
  167. package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +25 -17
  168. package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +9 -3
  169. package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +4 -19
  170. package/node_modules/@sap/cds/libx/_runtime/remote/utils/LruCache.js +42 -0
  171. package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +14 -4
  172. package/node_modules/@sap/cds/libx/_runtime/remote/utils/cloudSdkProvider.js +2 -9
  173. package/node_modules/@sap/cds/libx/_runtime/remote/utils/destinationClient.js +150 -0
  174. package/node_modules/@sap/cds/libx/_runtime/remote/utils/error.js +13 -0
  175. package/node_modules/@sap/cds/libx/_runtime/remote/utils/fetchClient.js +26 -18
  176. package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +34 -23
  177. package/node_modules/@sap/cds/libx/_runtime/remote/utils/token.js +82 -0
  178. package/node_modules/@sap/cds/libx/_runtime/ucl/Service.js +36 -189
  179. package/node_modules/@sap/cds/libx/common/utils/streaming.js +16 -16
  180. package/node_modules/@sap/cds/libx/http/location.js +3 -3
  181. package/node_modules/@sap/cds/libx/odata/middleware/batch.js +16 -10
  182. package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +9 -6
  183. package/node_modules/@sap/cds/libx/odata/middleware/service-document.js +1 -1
  184. package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +19 -3
  185. package/node_modules/@sap/cds/libx/odata/parse/cqn2odata.js +83 -86
  186. package/node_modules/@sap/cds/libx/queue/SchedulingService.js +17 -2
  187. package/node_modules/@sap/cds/libx/queue/processing.js +1 -3
  188. package/node_modules/@sap/cds/libx/rest/RestAdapter.js +3 -7
  189. package/node_modules/@sap/cds/libx/rest/middleware/delete.js +3 -3
  190. package/node_modules/@sap/cds/libx/rest/middleware/parse.js +13 -8
  191. package/node_modules/@sap/cds/libx/rest/middleware/read.js +3 -3
  192. package/node_modules/@sap/cds/libx/rest/middleware/upsert.js +2 -2
  193. package/node_modules/@sap/cds/package.json +1 -1
  194. package/node_modules/@sap/cds-compiler/CHANGELOG.md +75 -8
  195. package/node_modules/@sap/cds-compiler/bin/cdsc.js +2 -2
  196. package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v7.md +46 -19
  197. package/node_modules/@sap/cds-compiler/lib/api/main.js +10 -7
  198. package/node_modules/@sap/cds-compiler/lib/api/options.js +8 -2
  199. package/node_modules/@sap/cds-compiler/lib/base/csnRefs.js +5 -2
  200. package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +4 -0
  201. package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +12 -0
  202. package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +1 -0
  203. package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +8 -7
  204. package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +3 -3
  205. package/node_modules/@sap/cds-compiler/lib/compiler/define.js +301 -75
  206. package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +2 -0
  207. package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +40 -26
  208. package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +45 -60
  209. package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +16 -7
  210. package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +48 -18
  211. package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +7 -6
  212. package/node_modules/@sap/cds-compiler/lib/compiler/tweak-assocs.js +62 -50
  213. package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +29 -14
  214. package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +6 -5
  215. package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -1
  216. package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +1119 -1109
  217. package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +19 -3
  218. package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +10 -16
  219. package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +58 -39
  220. package/node_modules/@sap/cds-compiler/lib/main.d.ts +8 -0
  221. package/node_modules/@sap/cds-compiler/lib/main.js +1 -0
  222. package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +4 -0
  223. package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +2 -1
  224. package/node_modules/@sap/cds-compiler/lib/parsers/XprTree.js +8 -0
  225. package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +22 -1
  226. package/node_modules/@sap/cds-compiler/lib/render/toSql.js +17 -2
  227. package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +6 -1
  228. package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +27 -0
  229. package/node_modules/@sap/cds-compiler/lib/render/utils/standardDatabaseFunctions.js +125 -3
  230. package/node_modules/@sap/cds-compiler/lib/tool-lib/revealInternalProperties.js +2 -1
  231. package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +15 -0
  232. package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +10 -2
  233. package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +22 -6
  234. package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +62 -1
  235. package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
  236. package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +40 -0
  237. package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
  238. package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +20 -0
  239. package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
  240. package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +7 -2
  241. package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
  242. package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +48 -10
  243. package/node_modules/@sap/cds-compiler/package.json +1 -1
  244. package/node_modules/@sap/cds-mtxs/CHANGELOG.md +49 -0
  245. package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
  246. package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +37 -16
  247. package/node_modules/@sap/cds-mtxs/lib/utils.js +23 -7
  248. package/node_modules/@sap/cds-mtxs/package.json +1 -1
  249. package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +63 -8
  250. package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
  251. package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
  252. package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
  253. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
  254. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
  255. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
  256. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
  257. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +30 -16
  258. package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
  259. package/node_modules/@sap/cds-mtxs/srv/model-provider.js +28 -4
  260. package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
  261. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +1 -1
  262. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
  263. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
  264. package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +7 -10
  265. package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
  266. package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
  267. package/node_modules/@sap/xsenv/CHANGELOG.md +7 -0
  268. package/node_modules/@sap/xsenv/package.json +10 -7
  269. package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
  270. package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
  271. package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
  272. package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
  273. package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
  274. package/node_modules/hdb/cfg/VERSION +1 -1
  275. package/node_modules/hdb/lib/protocol/ClientInfo.js +16 -3
  276. package/node_modules/hdb/lib/protocol/Connection.js +1 -0
  277. package/node_modules/hdb/package.json +3 -2
  278. package/node_modules/negotiator/lib/accept.js +54 -0
  279. package/node_modules/negotiator/lib/charset.js +10 -34
  280. package/node_modules/negotiator/lib/encoding.js +9 -30
  281. package/node_modules/negotiator/lib/language.js +15 -36
  282. package/node_modules/negotiator/lib/mediaType.js +16 -134
  283. package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  284. package/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  285. package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  286. package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  287. package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  288. package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  289. package/node_modules/negotiator/package.json +16 -10
  290. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  291. package/node_modules/qs/CHANGELOG.md +15 -0
  292. package/node_modules/qs/README.md +19 -1
  293. package/node_modules/qs/dist/qs.js +21 -21
  294. package/node_modules/qs/eslint.config.mjs +1 -1
  295. package/node_modules/qs/lib/parse.js +3 -4
  296. package/node_modules/qs/lib/stringify.js +23 -8
  297. package/node_modules/qs/lib/utils.js +10 -3
  298. package/node_modules/qs/package.json +4 -4
  299. package/node_modules/qs/test/parse.js +192 -3
  300. package/node_modules/qs/test/stringify.js +317 -0
  301. package/node_modules/qs/test/utils.js +12 -0
  302. package/node_modules/type-is/node_modules/content-type/README.md +2 -0
  303. package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
  304. package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
  305. package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
  306. package/node_modules/type-is/node_modules/content-type/package.json +1 -1
  307. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  308. package/node_modules/ws/package.json +1 -1
  309. package/package.json +2 -2
  310. package/bin/completion/scripts/cds-bash.sh +0 -20
  311. package/bin/completion/scripts/cds-fish.fish +0 -13
  312. package/bin/completion/scripts/cds-ps.ps1 +0 -19
  313. package/bin/completion/scripts/cds-zsh.sh +0 -13
  314. package/lib/deploy/index.js +0 -25
  315. package/lib/import/asyncapi/importAsyncAPI.js +0 -33
  316. package/lib/import/asyncapi/index.js +0 -18
  317. package/lib/import/asyncapi/parserContext.js +0 -454
  318. package/lib/import/asyncapi/utils.js +0 -49
  319. package/node_modules/@sap/cds/libx/_runtime/ucl/queries.js +0 -61
  320. package/node_modules/negotiator/HISTORY.md +0 -114
  321. /package/{lib → bin}/upgrade/context.js +0 -0
  322. /package/{lib → bin}/upgrade/migrations/cds10/migrations.json +0 -0
  323. /package/{lib → bin}/upgrade/preflight/cds-version.js +0 -0
  324. /package/{lib → bin}/upgrade/preflight/project-type.js +0 -0
  325. /package/{lib → bin}/upgrade/steps/analyze/classification.js +0 -0
  326. /package/{lib → bin}/upgrade/steps/analyze/detector.js +0 -0
  327. /package/{lib → bin}/upgrade/steps/analyze/evaluator.js +0 -0
  328. /package/{lib → bin}/upgrade/steps/analyze/reporter.js +0 -0
  329. /package/{lib → bin}/upgrade/steps/analyze/setup.js +0 -0
  330. /package/{lib → bin}/upgrade/steps/analyze/utils/detection.js +0 -0
  331. /package/{lib → bin}/upgrade/steps/analyze/utils/files.js +0 -0
  332. /package/{lib → bin}/upgrade/steps/analyze/utils/grep.js +0 -0
  333. /package/{lib → bin}/upgrade/steps/analyze/utils/yaml.js +0 -0
  334. /package/{lib → bin}/upgrade/util/workspaces.js +0 -0
  335. /package/{lib → bin}/watch/esm-resolve-registration.js +0 -0
  336. /package/{lib → bin}/watch/livereload-server.js +0 -0
  337. /package/{lib → bin}/watch/node-watch.js +0 -0
  338. /package/{lib → bin}/watch/open.js +0 -0
  339. /package/{lib → bin}/watch/watcher.js +0 -0
  340. /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
  341. /package/node_modules/@sap/cds-mtxs/srv/worker/{load.js → model-worker.js} +0 -0
@@ -0,0 +1,327 @@
1
+ #!/bin/bash
2
+ # This file was generated from bin/completion/templates/cds-tmpl.sh by
3
+ # 'cds completion --generate' and is written to bin/completion/scripts/cds.sh.
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
+ # compopt -o nospace suppresses the trailing space bash normally appends after a
18
+ # completion, which is required for path completions (so the user can keep typing
19
+ # a subdirectory) and for flag names (so '=' can follow immediately).
20
+ CDS_COMMAND="cds"
21
+
22
+ _completeCds()
23
+ {
24
+ local current previous cmd
25
+ COMPREPLY=()
26
+ current="${COMP_WORDS[COMP_CWORD]}"
27
+ previous="${COMP_WORDS[COMP_CWORD - 1]}"
28
+ # The subcommand is always the second token (index 1).
29
+ cmd="${COMP_WORDS[1]}"
30
+ # Step 1: resolve single-character shortcuts to their canonical command name
31
+ # so that subsequent case statements only need to handle canonical names.
32
+ case "$cmd" in
33
+ i) cmd=init ;;
34
+ a) cmd=add ;;
35
+ y) cmd=bind ;;
36
+ m) cmd=import ;;
37
+ c) cmd=compile ;;
38
+ p) cmd=parse ;;
39
+ s) cmd=serve ;;
40
+ w) cmd=watch ;;
41
+ e) cmd=env ;;
42
+ b) cmd=build ;;
43
+ d) cmd=deploy ;;
44
+ l) cmd=login ;;
45
+ o) cmd=logout ;;
46
+ t) cmd=test ;;
47
+ v) cmd=version ;;
48
+ h) cmd=help ;;
49
+ r) cmd=repl ;;
50
+ esac
51
+
52
+ # Step 2: top-level — offer all known subcommands when no subcommand has been
53
+ # typed yet (COMP_WORDS includes the command itself, so ≤ 2 means "cds <cursor>").
54
+ if [[ "${#COMP_WORDS[@]}" -le 2 ]]; then
55
+ COMPREPLY=( $(compgen -W ""add" "bind" "build" "compile" "completion" "debug" "deploy" "env" "eval" "export" "gen" "help" "import" "init" "inspect" "lint" "login" "logout" "minify" "mock" "parse" "pull" "push" "repl" "run" "serve" "subscribe" "test" "unsubscribe" "up" "upgrade" "upgrade-tenant" "version" "watch"" -- "$current") )
56
+ compopt -o nospace
57
+ return 0
58
+ fi
59
+
60
+ # Step 3: flag/option completion — only triggered when the token starts with '-'.
61
+ if [[ "$current" == -* ]]; then
62
+ case "$cmd" in
63
+ add) COMPREPLY=( $(compgen -W ""--base" "--cdm" "--cloudevents" "--composition-records" "--content-type" "--data:for" "--dry" "--filter" "--for" "--for-app" "--force" "--into" "--java:mvn" "--keys-only" "--out" "--package" "--plan" "--records" "--sap" "--shell" "--unified-runtime" "--with-telemetry" "--y"" -- "$current") ) ;;
64
+ bind) COMPREPLY=( $(compgen -W ""--credentials" "--exec" "--for" "--kind" "--no-create-service-key" "--on" "--out" "--output-file" "--to" "--to-app-services"" -- "$current") ) ;;
65
+ build) COMPREPLY=( $(compgen -W ""--dest" "--for" "--log-level" "--no-clean" "--no-ws-pack" "--options-model" "--opts" "--project" "--src" "--ws" "--ws-pack"" -- "$current") ) ;;
66
+ compile) COMPREPLY=( $(compgen -W ""--all" "--asyncapi:merged" "--beta" "--clean" "--conceptual" "--dest" "--dialect" "--docs" "--files" "--flavor" "--for" "--from" "--lang" "--locations" "--log-level" "--min" "--odata-version" "--openapi:config-file" "--openapi:diagram" "--openapi:servers" "--openapi:url" "--parse" "--plain" "--resolved" "--service" "--sort" "--sources" "--sql-dialect" "--to"" -- "$current") ) ;;
67
+ completion) COMPREPLY=( $(compgen -W ""--add" "--curr" "--generate" "--line" "--prev" "--profile" "--remove" "--shell"" -- "$current") ) ;;
68
+ debug) COMPREPLY=( $(compgen -W ""--cf" "--force" "--host" "--k8s" "--no-devtools" "--port"" -- "$current") ) ;;
69
+ deploy) COMPREPLY=( $(compgen -W ""--auto-undeploy" "--delta-from" "--dry" "--for" "--model-only" "--no-build" "--no-save" "--on" "--out" "--resolve-bindings" "--script" "--store-credentials" "--to" "--tunnel-address" "--vcap-file" "--with-auto-schema-evolution" "--with-mocks" "--xdry"" -- "$current") ) ;;
70
+ env) COMPREPLY=( $(compgen -W ""--for" "--json" "--keys" "--list" "--mocked" "--process-env" "--properties" "--raw" "--resolve-bindings" "--sources"" -- "$current") ) ;;
71
+ export) COMPREPLY=( $(compgen -W ""--artifact" "--as" "--cleanse" "--data" "--debug" "--dry" "--for" "--from" "--inspect" "--keep" "--mvn" "--plugin" "--reuse" "--services" "--skip" "--texts" "--to"" -- "$current") ) ;;
72
+ import) COMPREPLY=( $(compgen -W ""--as" "--asyncapi" "--config" "--data-product" "--dependencies" "--destination" "--dry" "--edmx" "--for" "--force" "--from" "--group" "--include-namespaces" "--into-namespace" "--keep-namespace" "--name" "--no-copy" "--no-save" "--odata" "--odata-v2-annotations" "--openapi" "--out" "--resolve-bindings" "--rfc" "--services"" -- "$current") ) ;;
73
+ init) COMPREPLY=( $(compgen -W ""--add" "--base" "--force" "--java" "--java:mvn" "--java:package" "--lint:custom" "--lint:custom:example" "--no-db" "--nodejs" "--verbose"" -- "$current") ) ;;
74
+ inspect) COMPREPLY=( $(compgen -W ""--kind" "--list" "--stats"" -- "$current") ) ;;
75
+ lint) COMPREPLY=( $(compgen -W ""--cache" "--cache-file" "--cache-location" "--cache-strategy" "--color" "--concurrency" "--config" "--debug" "--env-info" "--exit-on-fatal-error" "--ext" "--fix" "--fix-dry-run" "--fix-type" "--flag" "--format" "--global" "--help" "--ignore-pattern" "--init" "--inspect-config" "--max-warnings" "--mcp" "--no-color" "--no-config-lookup" "--no-error-on-unmatched-pattern" "--no-ignore" "--no-inline-config" "--no-warn-ignored" "--output-file" "--parser" "--parser-options" "--pass-on-no-patterns" "--pass-on-unpruned-suppressions" "--plugin" "--print-config" "--prune-suppressions" "--quiet" "--report-unused-disable-directives" "--report-unused-disable-directives-severity" "--report-unused-inline-configs" "--rule" "--stats" "--stdin" "--stdin-filename" "--suppress-all" "--suppress-rule" "--suppressions-location" "--version"" -- "$current") ) ;;
76
+ login) COMPREPLY=( $(compgen -W ""--client" "--mtls" "--passcode" "--plain" "--save-refresh-token" "--subdomain" "--user"" -- "$current") ) ;;
77
+ logout) COMPREPLY=( $(compgen -W ""--clear-invalid" "--delete-settings" "--subdomain" "--url"" -- "$current") ) ;;
78
+ minify) COMPREPLY=( $(compgen -W ""--cleanse" "--debug" "--dry" "--inspect" "--keep" "--skip"" -- "$current") ) ;;
79
+ mock) COMPREPLY=( $(compgen -W ""--at" "--from" "--in-memory" "--in-memory?" "--mocked" "--port" "--project" "--projects" "--resolve-bindings" "--service" "--to" "--watch" "--with" "--with-bindings" "--with-mocks" "--with-mtx" "--workers"" -- "$current") ) ;;
80
+ parse) COMPREPLY=( $(compgen -W ""--all" "--asyncapi:merged" "--beta" "--clean" "--conceptual" "--dest" "--dialect" "--docs" "--files" "--flavor" "--for" "--from" "--lang" "--locations" "--log-level" "--min" "--odata-version" "--openapi:config-file" "--openapi:diagram" "--openapi:servers" "--openapi:url" "--parse" "--plain" "--resolved" "--service" "--sort" "--sources" "--sql-dialect" "--to"" -- "$current") ) ;;
81
+ pull) COMPREPLY=( $(compgen -W ""--client" "--from" "--mtls" "--passcode" "--subdomain" "--user"" -- "$current") ) ;;
82
+ push) COMPREPLY=( $(compgen -W ""--async" "--client" "--mtls" "--passcode" "--subdomain" "--sync" "--to" "--user"" -- "$current") ) ;;
83
+ repl) COMPREPLY=( $(compgen -W ""--ql" "--run" "--use"" -- "$current") ) ;;
84
+ run) COMPREPLY=( $(compgen -W ""--at" "--from" "--in-memory" "--in-memory?" "--mocked" "--port" "--project" "--projects" "--resolve-bindings" "--service" "--to" "--watch" "--with" "--with-bindings" "--with-mocks" "--with-mtx" "--workers"" -- "$current") ) ;;
85
+ serve) COMPREPLY=( $(compgen -W ""--at" "--from" "--in-memory" "--in-memory?" "--mocked" "--port" "--project" "--projects" "--resolve-bindings" "--service" "--to" "--watch" "--with" "--with-bindings" "--with-mocks" "--with-mtx" "--workers"" -- "$current") ) ;;
86
+ subscribe) COMPREPLY=( $(compgen -W ""--body" "--local" "--resolve-bindings" "--to" "--user"" -- "$current") ) ;;
87
+ test) COMPREPLY=( $(compgen -W ""--exclude" "--failed" "--files" "--include" "--list" "--passed" "--quiet" "--recent" "--silent" "--timeout" "--unmute" "--verbose" "--workers"" -- "$current") ) ;;
88
+ unsubscribe) COMPREPLY=( $(compgen -W ""--from" "--local" "--resolve-bindings" "--user"" -- "$current") ) ;;
89
+ up) COMPREPLY=( $(compgen -W ""--namespace" "--overlay" "--to"" -- "$current") ) ;;
90
+ upgrade) COMPREPLY=( $(compgen -W ""--at" "--fix" "--local" "--report" "--resolve-bindings" "--user"" -- "$current") ) ;;
91
+ upgrade-tenant) COMPREPLY=( $(compgen -W ""--at" "--local" "--resolve-bindings" "--user"" -- "$current") ) ;;
92
+ version) COMPREPLY=( $(compgen -W ""--abs" "--all" "--depth" "--info" "--json" "--markdown" "--omit"" -- "$current") ) ;;
93
+ watch) COMPREPLY=( $(compgen -W ""--debug" "--exclude" "--experimental-hot-reload" "--ext" "--in-memory" "--in-memory?" "--include" "--inspect" "--inspect-brk" "--livereload" "--open" "--port" "--with-mocks" "--with-mtx"" -- "$current") ) ;;
94
+ esac
95
+ if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
96
+ compopt -o nospace
97
+ return 0
98
+ fi
99
+ fi
100
+
101
+ # Step 3.5: option-value completion — triggered when the previous word is a known option.
102
+ case "$cmd" in
103
+ bind)
104
+ case "$previous" in
105
+ --on) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
106
+ --for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
107
+ -4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
108
+ --out) COMPREPLY=( $(compgen -f -- "$current") ) ; return 0 ;;
109
+ --output-file) COMPREPLY=( $(compgen -f -- "$current") ) ; return 0 ;;
110
+ --credentials) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
111
+ -c) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
112
+ esac ;;
113
+ build)
114
+ case "$previous" in
115
+ --for) COMPREPLY=( $(compgen -W ""hana" "helm" "java" "mtx" "mtx-extension" "mtx-sidecar" "nodejs"" -- "$current") ) ; return 0 ;;
116
+ --log-level) COMPREPLY=( $(compgen -W ""debug" "info" "warn" "error"" -- "$current") ) ; return 0 ;;
117
+ --project) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
118
+ --dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
119
+ --src) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
120
+ esac ;;
121
+ compile)
122
+ case "$previous" in
123
+ --to) COMPREPLY=( $(compgen -W ""json" "yml" "edm" "edmx" "edmx-v2" "edmx-v4" "sql" "hdbtable" "hana" "cdl" "xsuaa" "openapi" "asyncapi"" -- "$current") ) ; return 0 ;;
124
+ --for) COMPREPLY=( $(compgen -W ""odata" "sql"" -- "$current") ) ; return 0 ;;
125
+ --dialect) COMPREPLY=( $(compgen -W ""sqlite" "h2" "postgres" "hana"" -- "$current") ) ; return 0 ;;
126
+ --sql-dialect) COMPREPLY=( $(compgen -W ""sqlite" "h2" "postgres" "hana"" -- "$current") ) ; return 0 ;;
127
+ --log-level) COMPREPLY=( $(compgen -W ""debug" "info" "warn" "error"" -- "$current") ) ; return 0 ;;
128
+ --odata-version) COMPREPLY=( $(compgen -W ""4.0" "4.01"" -- "$current") ) ; return 0 ;;
129
+ --flavor) COMPREPLY=( $(compgen -W ""sources" "files" "parsed" "xtended" "inferred"" -- "$current") ) ; return 0 ;;
130
+ --service) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
131
+ --lang) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
132
+ --dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
133
+ --openapi:config-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
134
+ esac ;;
135
+ completion)
136
+ case "$previous" in
137
+ --shell) COMPREPLY=( $(compgen -W ""bash" "fish" "gitbash" "ps" "zsh"" -- "$current") ) ; return 0 ;;
138
+ esac ;;
139
+ deploy)
140
+ case "$previous" in
141
+ --to) COMPREPLY=( $(compgen -W ""sqlite" "hana"" -- "$current") ) ; return 0 ;;
142
+ --on) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
143
+ --for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
144
+ -4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
145
+ --vcap-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
146
+ --delta-from) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
147
+ esac ;;
148
+ env)
149
+ case "$previous" in
150
+ --for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
151
+ -4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
152
+ esac ;;
153
+ export)
154
+ case "$previous" in
155
+ --as) COMPREPLY=( $(compgen -W ""csn" "cdl"" -- "$current") ) ; return 0 ;;
156
+ --for) COMPREPLY=( $(compgen -W ""npm" "mvn"" -- "$current") ) ; return 0 ;;
157
+ --to) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
158
+ esac ;;
159
+ import)
160
+ case "$previous" in
161
+ --from) COMPREPLY=( $(compgen -W ""asyncapi" "edmx" "openapi"" -- "$current") ) ; return 0 ;;
162
+ --as) COMPREPLY=( $(compgen -W ""cds" "csn" "json"" -- "$current") ) ; return 0 ;;
163
+ --out) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
164
+ -o) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
165
+ esac ;;
166
+ init)
167
+ case "$previous" in
168
+ --java:package) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
169
+ --base) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
170
+ esac ;;
171
+ inspect)
172
+ case "$previous" in
173
+ --kind) COMPREPLY=( $(compgen -W ""entity" "aspect" "type" "service"" -- "$current") ) ; return 0 ;;
174
+ --list) COMPREPLY=( $(compgen -W ""names" "elements" "keys" "associations" "compositions" "ids" "sources" "all"" -- "$current") ) ; return 0 ;;
175
+ -l) COMPREPLY=( $(compgen -W ""names" "elements" "keys" "associations" "compositions" "ids" "sources" "all"" -- "$current") ) ; return 0 ;;
176
+ esac ;;
177
+ parse)
178
+ case "$previous" in
179
+ --to) COMPREPLY=( $(compgen -W ""json" "yml" "edm" "edmx" "edmx-v2" "edmx-v4" "sql" "hdbtable" "hana" "cdl" "xsuaa" "openapi" "asyncapi"" -- "$current") ) ; return 0 ;;
180
+ --for) COMPREPLY=( $(compgen -W ""odata" "sql"" -- "$current") ) ; return 0 ;;
181
+ --dialect) COMPREPLY=( $(compgen -W ""sqlite" "h2" "postgres" "hana"" -- "$current") ) ; return 0 ;;
182
+ --sql-dialect) COMPREPLY=( $(compgen -W ""sqlite" "h2" "postgres" "hana"" -- "$current") ) ; return 0 ;;
183
+ --log-level) COMPREPLY=( $(compgen -W ""debug" "info" "warn" "error"" -- "$current") ) ; return 0 ;;
184
+ --odata-version) COMPREPLY=( $(compgen -W ""4.0" "4.01"" -- "$current") ) ; return 0 ;;
185
+ --flavor) COMPREPLY=( $(compgen -W ""sources" "files" "parsed" "xtended" "inferred"" -- "$current") ) ; return 0 ;;
186
+ --service) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
187
+ --lang) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
188
+ --dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
189
+ --openapi:config-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
190
+ esac ;;
191
+ repl)
192
+ case "$previous" in
193
+ --use) COMPREPLY=( $(compgen -W ""xl" "ql" "entities" "services"" -- "$current") ) ; return 0 ;;
194
+ -u) COMPREPLY=( $(compgen -W ""xl" "ql" "entities" "services"" -- "$current") ) ; return 0 ;;
195
+ --run) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
196
+ -r) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
197
+ esac ;;
198
+ run)
199
+ case "$previous" in
200
+ --to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
201
+ -2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
202
+ --from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
203
+ -f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
204
+ --with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
205
+ -w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
206
+ esac ;;
207
+ serve)
208
+ case "$previous" in
209
+ --to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
210
+ -2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
211
+ --from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
212
+ -f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
213
+ --with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
214
+ -w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
215
+ esac ;;
216
+ up)
217
+ case "$previous" in
218
+ --to) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
219
+ --overlay) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(mtaext)$') ) ; return 0 ;;
220
+ esac ;;
221
+ version)
222
+ case "$previous" in
223
+ --omit) COMPREPLY=( $(compgen -W ""dev" "optional" "peer"" -- "$current") ) ; return 0 ;;
224
+ esac ;;
225
+ watch)
226
+ case "$previous" in
227
+ --to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
228
+ -2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
229
+ --experimental-hot-reload) COMPREPLY=( $(compgen -W ""true" "false"" -- "$current") ) ; return 0 ;;
230
+ --livereload) COMPREPLY=( $(compgen -W ""false"" -- "$current") ) ; return 0 ;;
231
+ --from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
232
+ -f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
233
+ --with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
234
+ -w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
235
+ --include) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
236
+ --exclude) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
237
+ esac ;;
238
+
239
+ esac
240
+
241
+ # Step 3.6: comma-separated option-value completion.
242
+ # Splits $current on commas, filters out already-used values, prepends the prefix.
243
+ case "$cmd" in
244
+ add)
245
+ case "$previous" in
246
+ *)
247
+ [[ "$previous" == -* ]] && return 0
248
+ local prefix="" partial="" IFS=,
249
+ if [[ "$current" == *,* ]]; then
250
+ prefix="${current%,*},"
251
+ partial="${current##*,}"
252
+ else
253
+ partial="$current"
254
+ fi
255
+ local -a _used
256
+ read -ra _used <<< "${prefix%,}"
257
+ local _all=("ai" "ams" "app-frontend" "application-logging" "approuter" "attachments" "audit-logging" "cf-manifest" "cjs" "cloud-logging" "completion" "connectivity" "console" "data" "destination" "dynatrace" "enterprise-messaging" "enterprise-messaging-shared" "event-mesh" "event-mesh-shared" "extensibility" "extension" "file-based-messaging" "github-actions" "h2" "hana" "hana-serverless" "handler" "html5-repo" "http" "ias" "initial" "kafka" "kyma" "lint" "liquibase" "local-messaging" "malware-scanner" "mta" "mtx" "multitenancy" "notifications" "pipeline" "portal" "postgres" "react" "redis" "redis-messaging" "sample" "side-by-side-extensibility" "sqlite" "telemetry" "test" "tiny-sample" "toggles" "typer" "typescript" "ui5" "vue" "workzone" "workzone-standard" "xsuaa")
258
+ for v in "${_all[@]}"; do
259
+ [[ " ${_used[*]} " == *" $v "* ]] && continue
260
+ [[ "$v" == "$partial"* ]] && COMPREPLY+=("$prefix$v")
261
+ done
262
+ [[ ${#COMPREPLY[@]} -gt 0 ]] && { compopt -o nospace; return 0; } ;;
263
+ esac ;;
264
+ init)
265
+ case "$previous" in
266
+ --add)
267
+ local prefix="" partial="" IFS=,
268
+ if [[ "$current" == *,* ]]; then
269
+ prefix="${current%,*},"
270
+ partial="${current##*,}"
271
+ else
272
+ partial="$current"
273
+ fi
274
+ local -a _used
275
+ read -ra _used <<< "${prefix%,}"
276
+ local _all=("ai" "ams" "app-frontend" "application-logging" "approuter" "attachments" "audit-logging" "cf-manifest" "cjs" "cloud-logging" "completion" "connectivity" "console" "data" "destination" "dynatrace" "enterprise-messaging" "enterprise-messaging-shared" "event-mesh" "event-mesh-shared" "extensibility" "extension" "file-based-messaging" "github-actions" "h2" "hana" "hana-serverless" "handler" "html5-repo" "http" "ias" "initial" "kafka" "kyma" "lint" "liquibase" "local-messaging" "malware-scanner" "mta" "mtx" "multitenancy" "notifications" "pipeline" "portal" "postgres" "react" "redis" "redis-messaging" "sample" "side-by-side-extensibility" "sqlite" "telemetry" "test" "tiny-sample" "toggles" "typer" "typescript" "ui5" "vue" "workzone" "workzone-standard" "xsuaa")
277
+ for v in "${_all[@]}"; do
278
+ [[ " ${_used[*]} " == *" $v "* ]] && continue
279
+ [[ "$v" == "$partial"* ]] && COMPREPLY+=("$prefix$v")
280
+ done
281
+ [[ ${#COMPREPLY[@]} -gt 0 ]] && { compopt -o nospace; return 0; } ;;
282
+ esac ;;
283
+
284
+ esac
285
+
286
+ # Step 4: file-sentinel positionals — fill COMPREPLY with files and return.
287
+ case "$cmd" in
288
+ compile) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
289
+ deploy) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
290
+ export) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
291
+ import) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json|xml|edmx)$') ) ;;
292
+ inspect) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
293
+ lint) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(js|ts|cds)$'; compgen -d -- "$current"; }) ) ;;
294
+ minify) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
295
+ parse) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
296
+ repl) COMPREPLY=( $(compgen -d -- "$current") ) ;;
297
+ run) COMPREPLY=( $(compgen -d -- "$current") ) ;;
298
+ serve) COMPREPLY=( $(compgen -d -- "$current") ) ;;
299
+ watch) COMPREPLY=( $(compgen -d -- "$current") ) ;;
300
+ esac
301
+ if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
302
+ compopt -o nospace
303
+ return 0
304
+ fi
305
+
306
+ # Step 4.6: string positionals (e.g. cds help <tab>).
307
+ case "$cmd" in
308
+ help) COMPREPLY=( $(compgen -W ""add" "bind" "build" "compile" "completion" "debug" "deploy" "env" "eval" "export" "gen" "help" "import" "init" "inspect" "lint" "login" "logout" "minify" "mock" "parse" "pull" "push" "repl" "run" "serve" "subscribe" "test" "unsubscribe" "up" "upgrade" "upgrade-tenant" "version" "watch"" -- "$current") ) ;;
309
+ esac
310
+ if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
311
+ compopt -o nospace
312
+ return 0
313
+ fi
314
+
315
+ # Step 5: dynamic fallback — calls 'cds completion' for subcommands whose arguments
316
+ # cannot be determined statically (e.g. service names, model names, unknown flags).
317
+ # Single-quoting $previous/$current prevents bare word 'h' from being interpreted
318
+ # as the 'help' shortcut by the completion handler before it is processed.
319
+ local options
320
+ options=$($CDS_COMMAND completion --shell bash --prev "'$previous'" --curr "'$current'" --line "'${COMP_WORDS[*]}'")
321
+ COMPREPLY=( $(compgen -W "${options}" -- "${current}") )
322
+ compopt -o nospace
323
+ return 0
324
+ }
325
+
326
+ # Register the completion function for the 'cds' command.
327
+ complete -F _completeCds "$CDS_COMMAND"