@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.
- package/CHANGELOG.md +106 -0
- package/bin/add.js +7 -23
- package/bin/bind.js +14 -0
- package/bin/build.js +21 -34
- package/bin/cds.js +1 -1
- package/bin/compile/index.js +16 -41
- package/bin/completion/completionFs.js +11 -8
- package/bin/completion/index.js +603 -80
- package/bin/completion/scripts/cds.fish +620 -0
- package/bin/completion/scripts/cds.ps1 +403 -0
- package/bin/completion/scripts/cds.sh +327 -0
- package/bin/completion/scripts/cds.zsh +296 -0
- package/bin/completion/templates/cds-tmpl.fish +65 -0
- package/bin/completion/templates/cds-tmpl.ps1 +217 -0
- package/bin/completion/templates/cds-tmpl.sh +93 -0
- package/bin/completion/templates/cds-tmpl.zsh +74 -0
- package/bin/deploy/index.js +11 -1
- package/bin/deploy/options.js +25 -0
- package/{lib → bin}/deploy/to-hana/hana.js +8 -8
- package/{lib → bin}/deploy/to-hana/hdiDeployUtil.js +1 -1
- package/bin/deploy/{to-hana.js → to-hana/index.js} +1 -1
- package/{lib → bin}/deploy/to-hana/mtaUtil.js +1 -1
- package/bin/deploy/to-sql.js +0 -2
- package/bin/env.js +4 -1
- package/bin/export.js +44 -6
- package/bin/help/export.md +3 -0
- package/bin/help.js +1 -5
- package/bin/import.js +9 -0
- package/bin/init.js +6 -24
- package/bin/inspect.js +8 -0
- package/bin/lint.js +5 -3
- package/bin/login.js +26 -20
- package/bin/minify.js +6 -1
- package/bin/pull.js +19 -6
- package/bin/push.js +19 -6
- package/bin/repl.js +11 -2
- package/bin/run.js +12 -1
- package/bin/serve.js +13 -2
- package/bin/up.js +17 -11
- package/{lib → bin}/upgrade/constants.js +1 -1
- package/bin/{upgrade.js → upgrade/index.js} +2 -2
- package/{lib → bin}/upgrade/preflight/consistency.js +1 -1
- package/{lib → bin}/upgrade/preflight/index.js +1 -1
- package/{lib → bin}/upgrade/steps/analyze/index.js +1 -1
- package/{lib → bin}/upgrade/steps/install.js +1 -1
- package/{lib → bin}/upgrade/steps/openrewrite.js +1 -1
- package/{lib → bin}/upgrade/steps/removals.js +1 -1
- package/{lib → bin}/upgrade/steps/rewrite.js +1 -1
- package/{lib → bin}/upgrade/steps/verify.js +1 -1
- package/{lib/upgrade/index.js → bin/upgrade/upgrade.js} +2 -2
- package/{lib → bin}/upgrade/util/pom.js +2 -2
- package/{lib → bin}/upgrade/util/prompt.js +1 -1
- package/bin/util/containerize.js +10 -4
- package/bin/version.js +10 -1
- package/{lib → bin}/watch/hot-reload.js +1 -1
- package/bin/{watch.js → watch/index.js} +24 -9
- package/{lib → bin}/watch/livereload-connect.js +1 -1
- package/{lib → bin}/watch/vite-watch.js +1 -1
- package/{lib → bin}/watch/watched.js +2 -2
- package/lib/build/constants.js +1 -1
- package/lib/build/plugins/fiori/index.js +31 -2
- package/lib/build/plugins/internal.js +4 -2
- package/lib/build/plugins/mtx-sidecar/index.js +7 -8
- package/lib/build/plugins/nodejs/index.js +64 -7
- package/lib/build/util.js +2 -4
- package/lib/compile/to_asyncapi.js +1 -1
- package/lib/env/schema.js +16 -0
- package/lib/env/schemas/cds-rc.js +1 -76
- package/lib/import/importapi.js +2 -3
- package/lib/import/message.js +0 -2
- package/lib/init/constants.js +2 -1
- package/lib/init/index.js +2 -2
- package/lib/init/merge.js +123 -280
- package/lib/init/plugin.js +3 -1
- package/lib/init/projectReader.js +22 -6
- package/lib/init/registries/xs-app.js +3 -5
- package/lib/init/template/ai/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ai/index.js +14 -2
- package/lib/init/template/ams/index.js +2 -2
- package/lib/init/template/app-frontend/files/containerize.yaml.hbs +2 -2
- package/lib/init/template/app-frontend/index.js +4 -4
- package/lib/init/template/application-logging/index.js +2 -2
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/index.js +8 -3
- package/lib/init/template/attachments/files/package.json.hbs +1 -1
- package/lib/init/template/attachments/index.js +2 -2
- package/lib/init/template/audit-logging/index.js +2 -2
- package/lib/init/template/cloud-logging/files/package.json.hbs +4 -4
- package/lib/init/template/cloud-logging/index.js +2 -2
- package/lib/init/template/completion/completionSetup.js +36 -39
- package/lib/init/template/connectivity/index.js +2 -2
- package/lib/init/template/data/as-csv.js +15 -5
- package/lib/init/template/data/as-json.js +117 -42
- package/lib/init/template/data/index.js +16 -2
- package/lib/init/template/destination/index.js +2 -2
- package/lib/init/template/dynatrace/files/package.json.hbs +3 -3
- package/lib/init/template/dynatrace/index.js +2 -2
- package/lib/init/template/enterprise-messaging/index.js +2 -2
- package/lib/init/template/enterprise-messaging-shared/index.js +2 -2
- package/lib/init/template/extensibility/files/mta.yaml.hbs +11 -0
- package/lib/init/template/extensibility/files/xs-security.json.hbs +1 -1
- package/lib/init/template/extensibility/index.js +3 -3
- package/lib/init/template/github-actions/index.js +2 -2
- package/lib/init/template/hana/index.js +3 -2
- package/lib/init/template/hana-serverless/files/db/package.json +14 -0
- package/lib/init/template/hana-serverless/files/identity.values.yaml.hbs +10 -0
- package/lib/init/template/hana-serverless/files/mta.yaml.hbs +64 -0
- package/lib/init/template/hana-serverless/files/package.json.hbs +35 -0
- package/lib/init/template/hana-serverless/files/src/.hdiconfig +139 -0
- package/lib/init/template/hana-serverless/files/undeploy.json +7 -0
- package/lib/init/template/hana-serverless/files/values.yaml.hbs +18 -0
- package/lib/init/template/hana-serverless/index.js +184 -0
- package/lib/init/template/html5-repo/files/containerize.yaml.hbs +2 -2
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -0
- package/lib/init/template/html5-repo/index.js +18 -14
- package/lib/init/template/http/index.js +123 -26
- package/lib/init/template/ias/index.js +2 -2
- package/lib/init/template/kafka/index.js +2 -2
- package/lib/init/template/kyma/index.js +7 -5
- package/lib/init/template/malware-scanner/index.js +2 -2
- package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
- package/lib/init/template/multitenancy/index.js +18 -3
- package/lib/init/template/notifications/index.js +2 -2
- package/lib/init/template/portal/files/mta.yaml.hbs +4 -0
- package/lib/init/template/portal/index.js +13 -8
- package/lib/init/template/postgres/index.js +2 -2
- package/lib/init/template/redis/index.js +2 -2
- package/lib/init/template/sample/files/db/currencies.cds +2 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +1 -1
- package/lib/init/template/tiny-sample/files/nodejs/db/data/CatalogService.Books.csv +2 -2
- package/lib/init/template/workzone-standard/index.js +5 -5
- package/lib/init/template/xsuaa/index.js +20 -2
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/auth_manager.js +103 -37
- package/lib/mtx/params.js +3 -2
- package/lib/mtx/settings_manager.js +45 -28
- package/lib/mtx/tenant_action.js +0 -1
- package/lib/mtx/util/credentials.js +62 -0
- package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
- package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
- package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
- package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
- package/node_modules/@cap-js/db-service/lib/search.js +1 -1
- package/node_modules/@cap-js/db-service/package.json +1 -1
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
- package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
- package/node_modules/@cap-js/sqlite/package.json +3 -3
- package/node_modules/@sap/cds/CHANGELOG.md +57 -0
- package/node_modules/@sap/cds/app/index.js +5 -4
- package/node_modules/@sap/cds/eslint.config.mjs +1 -0
- package/node_modules/@sap/cds/lib/compile/minify.js +14 -10
- package/node_modules/@sap/cds/lib/env/cds-env.js +1 -1
- package/node_modules/@sap/cds/lib/env/cds-requires.js +22 -11
- package/node_modules/@sap/cds/lib/env/defaults.js +4 -1
- package/node_modules/@sap/cds/lib/env/schemas/cds-rc.js +5 -2
- package/node_modules/@sap/cds/lib/plugins.js +9 -5
- package/node_modules/@sap/cds/lib/req/spawn.js +1 -1
- package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +1 -1
- package/node_modules/@sap/cds/lib/srv/srv-models.js +1 -1
- package/node_modules/@sap/cds/lib/utils/cds-utils.js +2 -1
- package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +2 -3
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrict.js +8 -1
- package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +18 -8
- package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +25 -17
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +9 -3
- package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +4 -19
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/LruCache.js +42 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +14 -4
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/cloudSdkProvider.js +2 -9
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/destinationClient.js +150 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/error.js +13 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/fetchClient.js +26 -18
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +34 -23
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/token.js +82 -0
- package/node_modules/@sap/cds/libx/_runtime/ucl/Service.js +36 -189
- package/node_modules/@sap/cds/libx/common/utils/streaming.js +16 -16
- package/node_modules/@sap/cds/libx/http/location.js +3 -3
- package/node_modules/@sap/cds/libx/odata/middleware/batch.js +16 -10
- package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +9 -6
- package/node_modules/@sap/cds/libx/odata/middleware/service-document.js +1 -1
- package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +19 -3
- package/node_modules/@sap/cds/libx/odata/parse/cqn2odata.js +83 -86
- package/node_modules/@sap/cds/libx/queue/SchedulingService.js +17 -2
- package/node_modules/@sap/cds/libx/queue/processing.js +1 -3
- package/node_modules/@sap/cds/libx/rest/RestAdapter.js +3 -7
- package/node_modules/@sap/cds/libx/rest/middleware/delete.js +3 -3
- package/node_modules/@sap/cds/libx/rest/middleware/parse.js +13 -8
- package/node_modules/@sap/cds/libx/rest/middleware/read.js +3 -3
- package/node_modules/@sap/cds/libx/rest/middleware/upsert.js +2 -2
- package/node_modules/@sap/cds/package.json +1 -1
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +75 -8
- package/node_modules/@sap/cds-compiler/bin/cdsc.js +2 -2
- package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v7.md +46 -19
- package/node_modules/@sap/cds-compiler/lib/api/main.js +10 -7
- package/node_modules/@sap/cds-compiler/lib/api/options.js +8 -2
- package/node_modules/@sap/cds-compiler/lib/base/csnRefs.js +5 -2
- package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +4 -0
- package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +12 -0
- package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +1 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +8 -7
- package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +3 -3
- package/node_modules/@sap/cds-compiler/lib/compiler/define.js +301 -75
- package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +2 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +40 -26
- package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +45 -60
- package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +16 -7
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +48 -18
- package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +7 -6
- package/node_modules/@sap/cds-compiler/lib/compiler/tweak-assocs.js +62 -50
- package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +29 -14
- package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +6 -5
- package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -1
- package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +1119 -1109
- package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +19 -3
- package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +10 -16
- package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +58 -39
- package/node_modules/@sap/cds-compiler/lib/main.d.ts +8 -0
- package/node_modules/@sap/cds-compiler/lib/main.js +1 -0
- package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +4 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/parsers/XprTree.js +8 -0
- package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +22 -1
- package/node_modules/@sap/cds-compiler/lib/render/toSql.js +17 -2
- package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +6 -1
- package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +27 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/standardDatabaseFunctions.js +125 -3
- package/node_modules/@sap/cds-compiler/lib/tool-lib/revealInternalProperties.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +15 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +10 -2
- package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +22 -6
- package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +62 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
- package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +40 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +20 -0
- package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +7 -2
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +48 -10
- package/node_modules/@sap/cds-compiler/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +49 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +37 -16
- package/node_modules/@sap/cds-mtxs/lib/utils.js +23 -7
- package/node_modules/@sap/cds-mtxs/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +63 -8
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +30 -16
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
- package/node_modules/@sap/cds-mtxs/srv/model-provider.js +28 -4
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +7 -10
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
- package/node_modules/@sap/xsenv/CHANGELOG.md +7 -0
- package/node_modules/@sap/xsenv/package.json +10 -7
- package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/hdb/cfg/VERSION +1 -1
- package/node_modules/hdb/lib/protocol/ClientInfo.js +16 -3
- package/node_modules/hdb/lib/protocol/Connection.js +1 -0
- package/node_modules/hdb/package.json +3 -2
- package/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/negotiator/package.json +16 -10
- package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +192 -3
- package/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/qs/test/utils.js +12 -0
- package/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/package.json +2 -2
- package/bin/completion/scripts/cds-bash.sh +0 -20
- package/bin/completion/scripts/cds-fish.fish +0 -13
- package/bin/completion/scripts/cds-ps.ps1 +0 -19
- package/bin/completion/scripts/cds-zsh.sh +0 -13
- package/lib/deploy/index.js +0 -25
- package/lib/import/asyncapi/importAsyncAPI.js +0 -33
- package/lib/import/asyncapi/index.js +0 -18
- package/lib/import/asyncapi/parserContext.js +0 -454
- package/lib/import/asyncapi/utils.js +0 -49
- package/node_modules/@sap/cds/libx/_runtime/ucl/queries.js +0 -61
- package/node_modules/negotiator/HISTORY.md +0 -114
- /package/{lib → bin}/upgrade/context.js +0 -0
- /package/{lib → bin}/upgrade/migrations/cds10/migrations.json +0 -0
- /package/{lib → bin}/upgrade/preflight/cds-version.js +0 -0
- /package/{lib → bin}/upgrade/preflight/project-type.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/classification.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/detector.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/evaluator.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/reporter.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/setup.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/detection.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/files.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/grep.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/yaml.js +0 -0
- /package/{lib → bin}/upgrade/util/workspaces.js +0 -0
- /package/{lib → bin}/watch/esm-resolve-registration.js +0 -0
- /package/{lib → bin}/watch/livereload-server.js +0 -0
- /package/{lib → bin}/watch/node-watch.js +0 -0
- /package/{lib → bin}/watch/open.js +0 -0
- /package/{lib → bin}/watch/watcher.js +0 -0
- /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
- /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"
|