@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,93 @@
|
|
|
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
|
+
{{SHORTCUT_CASE}}
|
|
33
|
+
# Step 2: top-level — offer all known subcommands when no subcommand has been
|
|
34
|
+
# typed yet (COMP_WORDS includes the command itself, so ≤ 2 means "cds <cursor>").
|
|
35
|
+
if [[ "${#COMP_WORDS[@]}" -le 2 ]]; then
|
|
36
|
+
COMPREPLY=( $(compgen -W "{{COMMANDS}}" -- "$current") )
|
|
37
|
+
compopt -o nospace
|
|
38
|
+
return 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Step 3: flag/option completion — only triggered when the token starts with '-'.
|
|
42
|
+
if [[ "$current" == -* ]]; then
|
|
43
|
+
case "$cmd" in
|
|
44
|
+
{{FLAG_CASES}}
|
|
45
|
+
esac
|
|
46
|
+
if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
|
|
47
|
+
compopt -o nospace
|
|
48
|
+
return 0
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Step 3.5: option-value completion — triggered when the previous word is a known option.
|
|
53
|
+
case "$cmd" in
|
|
54
|
+
{{OPTION_VALUE_CASES}}
|
|
55
|
+
esac
|
|
56
|
+
|
|
57
|
+
# Step 3.6: comma-separated option-value completion.
|
|
58
|
+
# Splits $current on commas, filters out already-used values, prepends the prefix.
|
|
59
|
+
case "$cmd" in
|
|
60
|
+
{{COMMA_CASES}}
|
|
61
|
+
esac
|
|
62
|
+
|
|
63
|
+
# Step 4: file-sentinel positionals — fill COMPREPLY with files and return.
|
|
64
|
+
case "$cmd" in
|
|
65
|
+
{{FILE_CASES}}
|
|
66
|
+
esac
|
|
67
|
+
if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
|
|
68
|
+
compopt -o nospace
|
|
69
|
+
return 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# Step 4.6: string positionals (e.g. cds help <tab>).
|
|
73
|
+
case "$cmd" in
|
|
74
|
+
{{STRING_POSITIONAL_CASES}}
|
|
75
|
+
esac
|
|
76
|
+
if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
|
|
77
|
+
compopt -o nospace
|
|
78
|
+
return 0
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# Step 5: dynamic fallback — calls 'cds completion' for subcommands whose arguments
|
|
82
|
+
# cannot be determined statically (e.g. service names, model names, unknown flags).
|
|
83
|
+
# Single-quoting $previous/$current prevents bare word 'h' from being interpreted
|
|
84
|
+
# as the 'help' shortcut by the completion handler before it is processed.
|
|
85
|
+
local options
|
|
86
|
+
options=$($CDS_COMMAND completion --shell bash --prev "'$previous'" --curr "'$current'" --line "'${COMP_WORDS[*]}'")
|
|
87
|
+
COMPREPLY=( $(compgen -W "${options}" -- "${current}") )
|
|
88
|
+
compopt -o nospace
|
|
89
|
+
return 0
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Register the completion function for the 'cds' command.
|
|
93
|
+
complete -F _completeCds "$CDS_COMMAND"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/bin/zsh
|
|
2
|
+
# This file was generated from bin/completion/templates/cds-tmpl.zsh by
|
|
3
|
+
# 'cds completion --generate' and is written to bin/completion/scripts/cds.zsh.
|
|
4
|
+
#
|
|
5
|
+
# Do not edit directly — modify the template and regenerate.
|
|
6
|
+
#
|
|
7
|
+
# Completion strategy (fastest-first):
|
|
8
|
+
# 1. Shortcuts — single-character aliases resolved before any other logic.
|
|
9
|
+
# 2. Top-level — all known subcommands when no subcommand has been typed yet.
|
|
10
|
+
# 3. Flags — matched when the current token starts with '-'.
|
|
11
|
+
# 3.5. Option values — static values for known flags (e.g. --to sqlite).
|
|
12
|
+
# 3.6. Comma values — comma-separable list (e.g. cds add ai,hana).
|
|
13
|
+
# 4. File positionals — files/dirs for subcommands that take a path argument.
|
|
14
|
+
# 4.6. String positionals — fixed word list (e.g. cds help <tab>).
|
|
15
|
+
# 5. Dynamic fallback — calls 'cds completion' for anything not covered above.
|
|
16
|
+
#
|
|
17
|
+
# Zsh uses $words (1-based token array) and $CURRENT (index of cursor token).
|
|
18
|
+
# Completions are added with compadd instead of bash's COMPREPLY.
|
|
19
|
+
# 'case ... esac && return' exits the function when a case arm matched.
|
|
20
|
+
|
|
21
|
+
CDS_COMMAND="cds"
|
|
22
|
+
|
|
23
|
+
_completeCds() {
|
|
24
|
+
local current="${words[CURRENT]}"
|
|
25
|
+
local previous="${words[CURRENT-1]}"
|
|
26
|
+
# The subcommand is always the second token (index 2 in 1-based zsh arrays).
|
|
27
|
+
local cmd="${words[2]}"
|
|
28
|
+
# Step 1: resolve single-character shortcuts to their canonical command name.
|
|
29
|
+
{{SHORTCUT_CASE}}
|
|
30
|
+
# Step 2: top-level — offer all known subcommands when no subcommand has been
|
|
31
|
+
# typed yet ($words is 1-based; ≤ 2 means "cds <cursor>").
|
|
32
|
+
if [[ "${#words[@]}" -le 2 ]]; then
|
|
33
|
+
compadd -S '' -- {{COMMANDS}}
|
|
34
|
+
return
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Step 3: flag/option completion — only triggered when the token starts with '-'.
|
|
38
|
+
# 'case ... esac && return' exits the function when a case arm matched.
|
|
39
|
+
if [[ "$current" == -* ]]; then
|
|
40
|
+
case "$cmd" in
|
|
41
|
+
{{FLAG_CASES}}
|
|
42
|
+
esac && return
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# Step 3.5: option-value completion — triggered when the previous word is a known option.
|
|
46
|
+
case "$cmd" in
|
|
47
|
+
{{OPTION_VALUE_CASES}}
|
|
48
|
+
esac
|
|
49
|
+
|
|
50
|
+
# Step 3.6: comma-separated option-value completion.
|
|
51
|
+
case "$cmd" in
|
|
52
|
+
{{COMMA_CASES}}
|
|
53
|
+
esac
|
|
54
|
+
|
|
55
|
+
# Step 4: file-sentinel positionals — emit files and return.
|
|
56
|
+
case "$cmd" in
|
|
57
|
+
{{FILE_CASES}}
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
# Step 4.6: string positionals (e.g. cds help <tab>) — return after matching.
|
|
61
|
+
case "$cmd" in
|
|
62
|
+
{{STRING_POSITIONAL_CASES}}
|
|
63
|
+
esac && return
|
|
64
|
+
|
|
65
|
+
# Step 5: dynamic fallback — calls 'cds completion' for subcommands whose arguments
|
|
66
|
+
# cannot be determined statically (e.g. service names, model names, unknown flags).
|
|
67
|
+
# Single-quoting $prev/$curr prevents bare word 'h' from being interpreted
|
|
68
|
+
# as the 'help' shortcut by the completion handler before it is processed.
|
|
69
|
+
# compadd -S '' suppresses the trailing space zsh normally appends after a completion.
|
|
70
|
+
compadd -S '' -- $(${CDS_COMMAND} completion --shell zsh --prev "'${words[CURRENT-1]}'" --curr "'${words[CURRENT]}'" --line "'${words[*]}'")
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Register the completion function for the 'cds' command.
|
|
74
|
+
compdef _completeCds ${CDS_COMMAND}
|
package/bin/deploy/index.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { FILE } = require('../completion');
|
|
2
|
+
const { options, flags, shortcuts } = require('./options');
|
|
2
3
|
|
|
3
4
|
module.exports = Object.assign(deploy, {
|
|
5
|
+
staticCompletions: () => ({
|
|
6
|
+
'--to': ['sqlite', 'hana'],
|
|
7
|
+
'--on': ['cf', 'k8s'],
|
|
8
|
+
'--for': ['development', 'production', 'hybrid'],
|
|
9
|
+
'-4': ['development', 'production', 'hybrid'],
|
|
10
|
+
'--vcap-file': FILE('json'),
|
|
11
|
+
'--delta-from': FILE('json'),
|
|
12
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
13
|
+
}),
|
|
4
14
|
options,
|
|
5
15
|
flags,
|
|
6
16
|
shortcuts,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
options: /** @type{const} */([
|
|
3
|
+
'--to',
|
|
4
|
+
'--for',
|
|
5
|
+
'--out',
|
|
6
|
+
'--on',
|
|
7
|
+
'--tunnel-address',
|
|
8
|
+
'--vcap-file',
|
|
9
|
+
'--delta-from'
|
|
10
|
+
]),
|
|
11
|
+
flags: /** @type{const} */([
|
|
12
|
+
'--resolve-bindings',
|
|
13
|
+
'--no-save',
|
|
14
|
+
'--auto-undeploy',
|
|
15
|
+
'--dry',
|
|
16
|
+
'--xdry',
|
|
17
|
+
'--with-mocks',
|
|
18
|
+
'--store-credentials',
|
|
19
|
+
'--no-build',
|
|
20
|
+
'--model-only',
|
|
21
|
+
'--script',
|
|
22
|
+
'--with-auto-schema-evolution'
|
|
23
|
+
]),
|
|
24
|
+
shortcuts: ['-2', '-4', '-o', '-n', '', '', '', '-b']
|
|
25
|
+
}
|
|
@@ -3,18 +3,18 @@ const path = require('path');
|
|
|
3
3
|
const cds = require('../../../lib/cds');
|
|
4
4
|
const { exists, read, write, mkdirp } = cds.utils;
|
|
5
5
|
|
|
6
|
-
const { build } = require('
|
|
6
|
+
const { build } = require('../../../lib/build');
|
|
7
7
|
|
|
8
8
|
const hdi = require('./hdiDeployUtil');
|
|
9
|
-
const cfUtil = require('
|
|
9
|
+
const cfUtil = require('../../../lib/util/cf');
|
|
10
10
|
const mtaUtil = require('./mtaUtil');
|
|
11
11
|
|
|
12
|
-
const { bold, info, warn } = require('
|
|
12
|
+
const { bold, info, warn } = require('../../../lib/util/term');
|
|
13
13
|
|
|
14
|
-
const { bind, storeBindings, env: bindingEnv } = require('
|
|
15
|
-
const { BUILD_TASK_HANA } = require('
|
|
14
|
+
const { bind, storeBindings, env: bindingEnv } = require('../../../lib/bind/shared');
|
|
15
|
+
const { BUILD_TASK_HANA } = require('../../../lib/build/constants');
|
|
16
16
|
|
|
17
|
-
const { options, flags } = require('../
|
|
17
|
+
const { options, flags } = require('../options');
|
|
18
18
|
const allOptions = [...options, ...flags];
|
|
19
19
|
|
|
20
20
|
const DEBUG = cds.debug('cli');
|
|
@@ -147,7 +147,7 @@ Therefore, specifying the CDS model is not required when calling 'cds deploy'.`;
|
|
|
147
147
|
let bindOptions
|
|
148
148
|
let usesExistingK8sBinding = false
|
|
149
149
|
|
|
150
|
-
const { readProject } = require('
|
|
150
|
+
const { readProject } = require('../../../lib/init/projectReader')
|
|
151
151
|
const { hasKyma, hasMta } = readProject()
|
|
152
152
|
const onKyma = cds.cli.options.on === 'k8s' || (hasKyma && !hasMta && cds.cli.options.on !== 'cf')
|
|
153
153
|
if (onKyma) {
|
|
@@ -260,7 +260,7 @@ spec:
|
|
|
260
260
|
await storeBindings(services, bindOptions)
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
const { env4 } = require('
|
|
263
|
+
const { env4 } = require('../../../lib/init/projectReader')
|
|
264
264
|
if (env4('production').requires?.db?.kind !== 'hana') {
|
|
265
265
|
console.log(`use ${info('cds add hana')} to configure the project for SAP HANA.\n`);
|
|
266
266
|
}
|
package/bin/deploy/to-sql.js
CHANGED
package/bin/env.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
module.exports = Object.assign (env, {
|
|
2
|
+
staticCompletions: () => ({
|
|
3
|
+
'--for': ['development', 'production', 'hybrid'],
|
|
4
|
+
'-4': ['development', 'production', 'hybrid'],
|
|
5
|
+
}),
|
|
2
6
|
options: ['--for', '--mocked'],
|
|
3
7
|
flags: ['--keys', '--properties', '--list', '--json', '--raw', '--process-env', '--resolve-bindings', '--sources'],
|
|
4
8
|
shortcuts: ['-4', 0, '-k', '-p', '-l', '-j', '-r', '-P', '-b'],
|
|
@@ -63,7 +67,6 @@ async function env ([cmd, key, value], options={}) {
|
|
|
63
67
|
)
|
|
64
68
|
|
|
65
69
|
let env = cds.env
|
|
66
|
-
// REVISIT: Currently only read in env.test.js
|
|
67
70
|
env['_home_cds-dk'] = path.resolve(__dirname, '..') // to help tools find the DK
|
|
68
71
|
|
|
69
72
|
if (!options.for && options.mocked || options["resolve-bindings"])
|
package/bin/export.js
CHANGED
|
@@ -3,7 +3,9 @@ const cds = require ('../lib/cds.js')
|
|
|
3
3
|
const { regex4 } = require ('./util/cli.js')
|
|
4
4
|
const { Minify } = require ('./minify.js')
|
|
5
5
|
const mvn = require('../lib/init/mvn')
|
|
6
|
+
const term = require('../lib/util/term')
|
|
6
7
|
const { read, write: cdswrite, exists, mkdirp, local, path, fs } = cds.utils
|
|
8
|
+
const DEBUG = cds.debug('export')
|
|
7
9
|
|
|
8
10
|
class Export extends Minify {
|
|
9
11
|
|
|
@@ -30,7 +32,8 @@ class Export extends Minify {
|
|
|
30
32
|
data: false,
|
|
31
33
|
as: 'csn',
|
|
32
34
|
for: 'npm',
|
|
33
|
-
|
|
35
|
+
artifact: '',
|
|
36
|
+
mvn: '',
|
|
34
37
|
}
|
|
35
38
|
static shortcuts = { ...super.shortcuts,
|
|
36
39
|
to:'2',
|
|
@@ -42,6 +45,22 @@ class Export extends Minify {
|
|
|
42
45
|
parseArgs (conf) {
|
|
43
46
|
if (!process.stdout.isTTY) this.options.to = '-'
|
|
44
47
|
let [sources,o] = super.parseArgs (conf)
|
|
48
|
+
if (o.mvn) {
|
|
49
|
+
o.for = 'mvn'
|
|
50
|
+
o.artifact = o.mvn
|
|
51
|
+
}
|
|
52
|
+
if (o.for === 'mvn') {
|
|
53
|
+
if (!o.mvn)
|
|
54
|
+
console.warn(term.warn(`\n Option --for mvn is deprecated. Use --mvn ${o.artifact || 'groupId:artifactId'} instead.\n`))
|
|
55
|
+
const raw = o.artifact
|
|
56
|
+
if (!raw || !raw.includes(':'))
|
|
57
|
+
throw `\n Maven export requires a --mvn "groupId:artifactId" option.\n`
|
|
58
|
+
const parts = raw.split(':')
|
|
59
|
+
if (parts.length !== 2 || !parts[0] || !parts[1])
|
|
60
|
+
throw `\n Invalid Maven artifact "${raw}". Expected format: "groupId:artifactId".\n`
|
|
61
|
+
const [groupId, artifactId] = parts
|
|
62
|
+
o.artifact = { groupId, artifactId }
|
|
63
|
+
}
|
|
45
64
|
if (o.from && o.from != '*') { // variant: cds-export <services> --from <models>
|
|
46
65
|
if (o.services == '/all/') o.services = regex4 (sources)
|
|
47
66
|
sources = o.from
|
|
@@ -108,18 +127,29 @@ class Export extends Minify {
|
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
async output (minified,o) {
|
|
130
|
+
const isMvnExport = o.for == 'mvn'
|
|
111
131
|
if (this.options.to === '-') return super.output (minified)
|
|
112
132
|
if (this.options.to.endsWith('/*')) this.options.to = this.export_to()
|
|
133
|
+
const rawModuleName = this.options.to
|
|
134
|
+
if (isMvnExport) {
|
|
135
|
+
const { groupId, artifactId } = o.artifact
|
|
136
|
+
this.options.to = path.join(this.options.to, 'src', 'main', 'resources', 'cds', groupId, artifactId)
|
|
137
|
+
}
|
|
113
138
|
console.log(`\n${this.name}ing APIs to`, cds.utils.local(this.options.to), '...\n')
|
|
114
139
|
const exports = []; exports.push(...this.export_models (minified))
|
|
115
140
|
if (o.texts) exports.push (...this.export_texts (minified))
|
|
116
141
|
if (o.data) exports.push (this.export_data (minified))
|
|
117
142
|
if (o.for === 'npm') exports.push (this.export_package_json())
|
|
118
143
|
await Promise.all (exports)
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
if (isMvnExport) {
|
|
145
|
+
const pomPath = path.join(rawModuleName, 'pom.xml')
|
|
146
|
+
if (exists(pomPath)) {
|
|
147
|
+
DEBUG?.(`Skipping mvn.add: pom.xml already exists at ${local(pomPath)}`)
|
|
148
|
+
} else {
|
|
149
|
+
// Maven task modifies pom.xml and sets up the module — await separately
|
|
150
|
+
const { groupId, artifactId } = o.artifact
|
|
151
|
+
await mvn.add('cds_export', { 'to': rawModuleName, 'group-id': groupId, 'artifact-id': artifactId })
|
|
152
|
+
}
|
|
123
153
|
}
|
|
124
154
|
console.log()
|
|
125
155
|
}
|
|
@@ -248,4 +278,12 @@ class Export extends Minify {
|
|
|
248
278
|
|
|
249
279
|
const { DIMMED, RESET } = cds.utils.colors
|
|
250
280
|
|
|
251
|
-
|
|
281
|
+
const { FILE, DIR } = require('./completion')
|
|
282
|
+
module.exports = Object.assign (Export._for_cds_dk(), { Export,
|
|
283
|
+
staticCompletions: () => ({
|
|
284
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
285
|
+
'--to': DIR(),
|
|
286
|
+
'--as': ['csn', 'cdl'],
|
|
287
|
+
'--for': ['npm', 'mvn'],
|
|
288
|
+
})
|
|
289
|
+
})
|
package/bin/help/export.md
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*-a | --as* <csn|cdl>
|
|
13
13
|
*-4 | --for* <npm|mvn>
|
|
14
14
|
|
|
15
|
+
*--mvn* <groupId:artifactId> Export for Maven (implies --for mvn)
|
|
16
|
+
|
|
15
17
|
*-c | --cleanse* <properties>
|
|
16
18
|
*-k | --keep* <kinds>
|
|
17
19
|
*-x | --skip* <kinds>
|
|
@@ -36,3 +38,4 @@
|
|
|
36
38
|
*cds export* -s cat*s --inspect=2
|
|
37
39
|
*cds export* -s cat*s --as cdl
|
|
38
40
|
*cds export* -s cat*s
|
|
41
|
+
*cds export* --mvn com.example:my-service --to java-module
|
package/bin/help.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const cds = require('../lib/cds')
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
module.exports = exports = Object.assign (help, {formatHelp,
|
|
4
|
+
module.exports = exports = Object.assign (help, {formatHelp, staticCompletions: () => Object.values(require('./cds').cmds ?? {}), help:`
|
|
5
5
|
# USAGE
|
|
6
6
|
|
|
7
7
|
*cds* <command> [<args>]
|
|
@@ -42,10 +42,6 @@ module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, h
|
|
|
42
42
|
|
|
43
43
|
`});
|
|
44
44
|
|
|
45
|
-
async function handleCompletion() {
|
|
46
|
-
const cds = require('./cds');
|
|
47
|
-
return Object.values(cds.cmds);
|
|
48
|
-
}
|
|
49
45
|
|
|
50
46
|
async function help (topic) {
|
|
51
47
|
await cds.plugins
|
package/bin/import.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
const { FILE, DIR } = require('./completion')
|
|
1
2
|
module.exports = Object.assign(_import, {
|
|
2
3
|
_name: 'import',
|
|
4
|
+
staticCompletions: () => ({
|
|
5
|
+
'--from': ['asyncapi', 'edmx', 'openapi'],
|
|
6
|
+
'--as': ['cds', 'csn', 'json'],
|
|
7
|
+
'--out': DIR(),
|
|
8
|
+
'-o': DIR(),
|
|
9
|
+
'_': FILE('json,xml,edmx'),
|
|
10
|
+
}),
|
|
3
11
|
options: [ '--services', '--for', '--out', '--as', '--name', '--include-namespaces', '--dependencies', '--from', '--config', '--destination', '--group', '--into-namespace' ],
|
|
4
12
|
shortcuts: [ '-s', '-4', '-o', '-as', '-n', '-ns', '-d',undefined, '-c', undefined, undefined, '-2', '-', '-f', '-b'],
|
|
5
13
|
flags: [ '--dry', '--force', '--resolve-bindings', '--no-copy', '--no-save', '--keep-namespace', '--data-product', '--edmx', '--rfc', '--odata', '--openapi', '--asyncapi', '--odata-v2-annotations' ],
|
|
@@ -26,6 +34,7 @@ module.exports = Object.assign(_import, {
|
|
|
26
34
|
*--asyncapi*
|
|
27
35
|
*--rfc*
|
|
28
36
|
Imports the model from the one of the API formats OData EDMX, OpenAPI, AsyncAPI or RFC.
|
|
37
|
+
AsyncAPI requires @cap-js/asyncapi as a project dependency (currently bundled as a fallback)
|
|
29
38
|
|
|
30
39
|
*--data-product*
|
|
31
40
|
Tells cds import to import a data product. The source must be a valid
|
package/bin/init.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
const { join } = require('path')
|
|
2
2
|
const { URLS } = require('../lib/init/constants')
|
|
3
|
+
const { DIR, COMMA } = require('../bin/completion')
|
|
3
4
|
|
|
4
5
|
// REVISIT: necessary because module is loaded too early -> shouldn't be necessary
|
|
5
6
|
const cds = require('../lib/cds')
|
|
6
7
|
cds.root = join(process.cwd(), process.argv[3]?.startsWith('--') ? '.' : process.argv[3] ?? '')
|
|
7
8
|
|
|
8
9
|
module.exports = Object.assign(init, {
|
|
9
|
-
|
|
10
|
+
staticCompletions: () => ({
|
|
11
|
+
'--add': COMMA(require('../bin/completion/completionFs').readTemplates([])),
|
|
12
|
+
'--java:package': DIR(),
|
|
13
|
+
'--base': DIR(),
|
|
14
|
+
}),
|
|
10
15
|
options: ['--add', '--java:mvn', '--java:package', '--lint:custom', '--lint:custom:example', '--no-db', '--base'],
|
|
11
16
|
shortcuts: ['-a'],
|
|
12
17
|
flags: ['--nodejs', '--java', '--force', '--verbose'],
|
|
@@ -60,29 +65,6 @@ ${require('../lib/init').help()}
|
|
|
60
65
|
|
|
61
66
|
`})
|
|
62
67
|
|
|
63
|
-
async function handleCompletion(currentWord, previousWord, argv, util) {
|
|
64
|
-
const allOptionsFlags = [
|
|
65
|
-
...init.options ?? [],
|
|
66
|
-
...init.flags ?? []
|
|
67
|
-
].filter(e => !argv.includes(e));
|
|
68
|
-
|
|
69
|
-
if (currentWord?.startsWith('-')) {
|
|
70
|
-
return allOptionsFlags;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (previousWord === '--java:package') {
|
|
74
|
-
const excludes = ['_merging'];
|
|
75
|
-
return (await util.completionFs.readdir(currentWord, { files: false }))
|
|
76
|
-
.filter(e => !excludes.includes(e));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const templates = await util.completionFs.readTemplates(argv);
|
|
80
|
-
if (previousWord === '--add' || argv.includes('--add') && previousWord.endsWith(',')) {
|
|
81
|
-
return templates;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return allOptionsFlags;
|
|
85
|
-
}
|
|
86
68
|
|
|
87
69
|
async function init(args) {
|
|
88
70
|
console.log()
|
package/bin/inspect.js
CHANGED
|
@@ -4,7 +4,15 @@ cds inspect model.Req
|
|
|
4
4
|
cds inspect model.Requisition --ids
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
const { FILE } = require('./completion');
|
|
8
|
+
|
|
7
9
|
module.exports = Object.assign (inspect, {
|
|
10
|
+
staticCompletions: () => ({
|
|
11
|
+
'--kind': ['entity', 'aspect', 'type', 'service'],
|
|
12
|
+
'--list': ['names', 'elements', 'keys', 'associations', 'compositions', 'ids', 'sources', 'all'],
|
|
13
|
+
'-l': ['names', 'elements', 'keys', 'associations', 'compositions', 'ids', 'sources', 'all'],
|
|
14
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
15
|
+
}),
|
|
8
16
|
options: [ '--stats', '--list', '--kind' ],
|
|
9
17
|
shortcuts: [ '-s', '-l', '-k' ],
|
|
10
18
|
help: `
|
package/bin/lint.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
const { FILE } = require('./completion')
|
|
1
2
|
const Linter = require('../lib/lint/Linter');
|
|
2
3
|
const linter = new Linter();
|
|
3
4
|
|
|
4
|
-
// cds cli exec expects an executable object with various additional properties.
|
|
5
|
-
// As most of the linting functionality is bound to a class instance, we need to wrap the instance
|
|
6
|
-
// to not lose the this-context and attach the additional properties to the function.
|
|
7
5
|
const lint = (...args) => linter.lint(...args)
|
|
8
6
|
const additionalProperties = Object.entries(linter.init())
|
|
9
7
|
.map(([key, value]) => [key, { value }])
|
|
10
8
|
|
|
11
9
|
Object.defineProperties(lint, Object.fromEntries(additionalProperties))
|
|
12
10
|
|
|
11
|
+
lint.staticCompletions = () => ({
|
|
12
|
+
'_': FILE('js,ts,cds', { dirs: true }),
|
|
13
|
+
})
|
|
14
|
+
|
|
13
15
|
module.exports = lint
|
package/bin/login.js
CHANGED
|
@@ -85,30 +85,36 @@ module.exports = Object.assign(login, {
|
|
|
85
85
|
Note: Productive secrets should not be specified on a command line,
|
|
86
86
|
since this might expose them to unauthorized users on the same machine!
|
|
87
87
|
|
|
88
|
-
*-c* | *--client* <clientid>[:<clientsecret>]
|
|
88
|
+
*-c* | *--client* [<clientid>[:<clientsecret>]]
|
|
89
89
|
|
|
90
90
|
Client Credentials (Client ID and optionally Client Secret) for
|
|
91
|
-
authentication.
|
|
92
|
-
|
|
91
|
+
authentication. Client Credentials may instead be provided via the
|
|
92
|
+
CDS_LOGIN_CLIENT_ID and CDS_LOGIN_CLIENT_SECRET environment variables,
|
|
93
|
+
which is recommended for CI so that secrets do not appear on the
|
|
94
|
+
command line. Inline values take precedence over the environment. If
|
|
95
|
+
the Client Secret is given neither inline nor via the environment, it is
|
|
96
|
+
queried interactively.
|
|
97
|
+
|
|
93
98
|
Obtain the Client Credentials from the UAA binding of MTXS.
|
|
94
|
-
|
|
99
|
+
|
|
95
100
|
Client Credentials will not be saved, only the resulting token.
|
|
96
101
|
|
|
97
102
|
Note: Productive secrets should not be specified on a command line,
|
|
98
103
|
since this might expose them to unauthorized users on the same machine!
|
|
99
104
|
|
|
100
|
-
*-m* | *--mtls* <clientid>
|
|
105
|
+
*-m* | *--mtls* [<clientid>]
|
|
106
|
+
|
|
107
|
+
Client-certificate (mTLS) authentication. The Client ID may be given
|
|
108
|
+
inline or via the CDS_LOGIN_CLIENT_ID environment variable. The client
|
|
109
|
+
certificate and its private key are read from the CDS_LOGIN_CLIENT_CERT
|
|
110
|
+
and CDS_LOGIN_CLIENT_KEY environment variables (PEM), which is
|
|
111
|
+
recommended for CI so that key material does not appear on the command
|
|
112
|
+
line. The token is then obtained directly from the authorization
|
|
113
|
+
server over mTLS.
|
|
101
114
|
|
|
102
|
-
Client Credentials (Client ID and optionally Client-Certificate Private
|
|
103
|
-
Key in Base64 encoding) for authentication. If omitted, Private Key will
|
|
104
|
-
be queried interactively (avoid newline characters when pasting it).
|
|
105
|
-
|
|
106
115
|
Obtain the Client Credentials from the UAA binding of MTXS.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Note: Productive secrets should not be specified on a command line,
|
|
111
|
-
since this might expose them to unauthorized users on the same machine!
|
|
116
|
+
|
|
117
|
+
Only the resulting token will be saved.
|
|
112
118
|
|
|
113
119
|
*--save-refresh-token*
|
|
114
120
|
|
|
@@ -152,14 +158,14 @@ module.exports = Object.assign(login, {
|
|
|
152
158
|
async function login ([url], options = {}) {
|
|
153
159
|
const [username, password] = options.user?.split(':') ?? [];
|
|
154
160
|
delete options.user;
|
|
155
|
-
if (options.
|
|
156
|
-
const
|
|
161
|
+
if (options.mtls) {
|
|
162
|
+
const { clientid, certificate, key } = require('../lib/mtx/util/credentials').clientCertificate(options.mtls);
|
|
163
|
+
delete options.mtls;
|
|
164
|
+
Object.assign(options, { clientid, certificate, key });
|
|
165
|
+
} else if (options.client) {
|
|
166
|
+
const { clientid, clientsecret } = require('../lib/mtx/util/credentials').clientCredentials(options.client);
|
|
157
167
|
delete options.client;
|
|
158
168
|
Object.assign(options, { clientid, clientsecret });
|
|
159
|
-
} else if (options.mtls) {
|
|
160
|
-
const [clientid, key = 'ask'] = options.mtls.split(':');
|
|
161
|
-
delete options.mtls;
|
|
162
|
-
Object.assign(options, { clientid, key });
|
|
163
169
|
}
|
|
164
170
|
Object.assign(options, {
|
|
165
171
|
url,
|
package/bin/minify.js
CHANGED
|
@@ -119,4 +119,9 @@ class Dryifier extends Minifier {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
const { FILE } = require('./completion')
|
|
123
|
+
module.exports = Object.assign (Minify._for_cds_dk(), { Minify,
|
|
124
|
+
staticCompletions: () => ({
|
|
125
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
126
|
+
})
|
|
127
|
+
})
|