@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
|
@@ -3,6 +3,7 @@ const cds = require('../../../cds')
|
|
|
3
3
|
const { normalizePath } = require('../../util')
|
|
4
4
|
const { BUILD_TASK_FIORI, CDS_CONFIG_PATH_SEP } = require('../../constants')
|
|
5
5
|
const DEBUG = cds.debug('cli|build')
|
|
6
|
+
const { exists } = cds.utils
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* With cds 4 service metadata for the UI service binding is no longer created by default.
|
|
@@ -86,7 +87,8 @@ module.exports = class FioriBuildPlugin extends require('../edmx') {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
async _writeEdmxToWebapp(src, dest) {
|
|
89
|
-
const
|
|
90
|
+
const subfolder = this._resolveAppFolder(src)
|
|
91
|
+
const manifestPath = path.join(src, subfolder, 'manifest.json')
|
|
90
92
|
let manifest
|
|
91
93
|
|
|
92
94
|
try {
|
|
@@ -124,10 +126,37 @@ module.exports = class FioriBuildPlugin extends require('../edmx') {
|
|
|
124
126
|
return
|
|
125
127
|
}
|
|
126
128
|
|
|
127
|
-
const edmxPath = path.resolve(path.join(dest,
|
|
129
|
+
const edmxPath = path.resolve(path.join(dest, subfolder), this._strippedUrlPath(localUri))
|
|
128
130
|
return this.write(edmx).to(edmxPath)
|
|
129
131
|
}
|
|
130
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Folder holding manifest.json relative to the UI module root.
|
|
135
|
+
* Defaults: `webapp` (UI5 v4 application), `src` (UI5 v5 component/library);
|
|
136
|
+
* overridable via ui5.yaml path mapping, see https://ui5.github.io/cli/v4/pages/Configuration/#path-mapping
|
|
137
|
+
*/
|
|
138
|
+
_resolveAppFolder(src) {
|
|
139
|
+
for (const yamlFile of ['ui5.yaml', 'ui5-build.yaml']) {
|
|
140
|
+
const yamlPath = path.join(src, yamlFile)
|
|
141
|
+
if (!exists(yamlPath)) {
|
|
142
|
+
continue
|
|
143
|
+
}
|
|
144
|
+
let paths
|
|
145
|
+
try {
|
|
146
|
+
paths = cds.load.yaml(yamlPath)?.resources?.configuration?.paths
|
|
147
|
+
} catch (e) {
|
|
148
|
+
if (e.name !== 'YAMLParseError') throw e // only tolerate malformed yaml
|
|
149
|
+
DEBUG?.(`ignoring malformed [${path.relative(cds.root, yamlPath)}]: ${e.code}`)
|
|
150
|
+
continue
|
|
151
|
+
}
|
|
152
|
+
const mapped = paths?.webapp ?? paths?.src
|
|
153
|
+
if (mapped) {
|
|
154
|
+
return mapped
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return exists(path.join(src, 'src', 'manifest.json')) ? 'src' : 'webapp'
|
|
158
|
+
}
|
|
159
|
+
|
|
131
160
|
_getEdmxForUri(model, appFolder, uri) {
|
|
132
161
|
const uriSegments = this._strippedUrlPath(uri).split('/')
|
|
133
162
|
|
|
@@ -142,10 +142,12 @@ module.exports = class InternalBuildPlugin extends require('./plugin') {
|
|
|
142
142
|
/**
|
|
143
143
|
* Collect and write message bundles from CAP plugins into messages.properties files.
|
|
144
144
|
* @param {string} bundleDest
|
|
145
|
-
* @param {Object} model -
|
|
145
|
+
* @param {Object} model - passed for signature consistency with subclass overrides; not used here
|
|
146
|
+
* as Java does not require neighborhood resolution of plugin i18n files.
|
|
146
147
|
*/
|
|
148
|
+
// eslint-disable-next-line no-unused-vars
|
|
147
149
|
async collectMessageBundles(bundleDest, model) {
|
|
148
|
-
const messageBundle = cds.i18n.bundle4('messages'
|
|
150
|
+
const messageBundle = cds.i18n.bundle4('messages')
|
|
149
151
|
const messagesData = messageBundle.translations4?.(cds.env.i18n.languages) ?? {}
|
|
150
152
|
|
|
151
153
|
// Write messages.properties files for each locale
|
|
@@ -122,14 +122,13 @@ module.exports = class MtxSidecarBuildPlugin extends require('../nodejs') {
|
|
|
122
122
|
// resources are determined based on available database build task, SQLite as fallback
|
|
123
123
|
promises.push(new ResourcesTarBuilder(this).createTar(destMain, model))
|
|
124
124
|
|
|
125
|
-
// copy package.json and .cdsrc.json from project root
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
promises.push(this.copy(cdsrcJson).to(path.join(destMain, '.cdsrc.json')))
|
|
125
|
+
// copy package.json and .cdsrc.json/.cdsrc.yaml from project root
|
|
126
|
+
for (const file of ['package.json', '.cdsrc.json', '.cdsrc.yaml']) {
|
|
127
|
+
if (exists(file)) {
|
|
128
|
+
promises.push(this
|
|
129
|
+
.copy(path.join(cds.root, file))
|
|
130
|
+
.to(path.join(destMain, file)))
|
|
131
|
+
}
|
|
133
132
|
}
|
|
134
133
|
return Promise.all(promises)
|
|
135
134
|
}
|
|
@@ -3,7 +3,7 @@ const { path, exists, rimraf, isdir, read, write } = cds.utils
|
|
|
3
3
|
const cmd = require('../../../util/command')
|
|
4
4
|
const { BuildError, getWorkspaces, findWorkspaceRoot, normalizePath } = require('../../util')
|
|
5
5
|
const { ODATA_VERSION_V2, FOLDER_GEN, CONTENT_EDMX, CONTENT_PACKAGELOCK_JSON,
|
|
6
|
-
CONTENT_NPMRC,
|
|
6
|
+
CONTENT_NPMRC, CONTENT_CDSRC, CONTENT_ENV, CONTENT_DEFAULT_ENV_JSON, FLAVOR_LOCALIZED_EDMX,
|
|
7
7
|
OPTION_WS_PACK, SEVERITY_WARNING } = require('../../constants');
|
|
8
8
|
const LOG = cds.log('cli|build')
|
|
9
9
|
const DEBUG = cds.debug('cli|build')
|
|
@@ -68,6 +68,7 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
68
68
|
if (this.isStagingBuild()) {
|
|
69
69
|
const srcSrv = this.task.src === cds.root ? path.resolve(this.task.src, cds.env.folders.srv) : this.task.src
|
|
70
70
|
await this._copyNativeContent(cds.root, srcSrv, destRoot, destSrv)
|
|
71
|
+
await this.#copyWorkspaceLock(destRoot)
|
|
71
72
|
try {
|
|
72
73
|
// add minimal node engine to effective package.json.
|
|
73
74
|
// CloudFoundry uses this entry to choose the node engine in buildpack and may
|
|
@@ -146,6 +147,18 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
146
147
|
|
|
147
148
|
}
|
|
148
149
|
|
|
150
|
+
// copy the workspace root lock into gen/srv when the module has none, so monorepo deployments install frozen dependencies
|
|
151
|
+
async #copyWorkspaceLock(destRoot) {
|
|
152
|
+
if (this.hasBuildOption(CONTENT_PACKAGELOCK_JSON, false)) return
|
|
153
|
+
if (exists(path.join(destRoot, 'package-lock.json'))) return
|
|
154
|
+
const wsRoot = findWorkspaceRoot(cds.root)
|
|
155
|
+
if (!wsRoot || wsRoot === cds.root) return
|
|
156
|
+
const rootLock = path.join(wsRoot, 'package-lock.json')
|
|
157
|
+
if (!exists(rootLock)) return
|
|
158
|
+
DEBUG?.(`Copying workspace root package-lock.json from '${wsRoot}' into build destination`)
|
|
159
|
+
await this.copy(rootLock).to(path.join(destRoot, 'package-lock.json'))
|
|
160
|
+
}
|
|
161
|
+
|
|
149
162
|
async clean() {
|
|
150
163
|
// staging build content is deleted by default
|
|
151
164
|
if (cds.env.build.target === '.') {
|
|
@@ -175,7 +188,7 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
175
188
|
* @returns the list of files that have been copied
|
|
176
189
|
*/
|
|
177
190
|
async copySrvContent(src, destRoot, destSrv) {
|
|
178
|
-
const srvRootBlockList = RegExp('package\\.json$|package-lock\\.json$|\\.npmrc$|\\.cdsrc\\.json$')
|
|
191
|
+
const srvRootBlockList = RegExp('package\\.json$|package-lock\\.json$|\\.npmrc$|\\.cdsrc\\.json$|\\.cdsrc\\.yaml$')
|
|
179
192
|
const srvBlockList = RegExp('\\.cds$|csn\\.json$|\\.csn$|manifest\\.y.?ml$|\\.env($|\\..*$)|default-env\\.json$|\\.cdsrc-private.json$')
|
|
180
193
|
const srvRootFileNames = []
|
|
181
194
|
|
|
@@ -201,7 +214,7 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
201
214
|
let srvAllowList = "package\\.json$" // always copy package.json, modify only if CONTENT_PACKAGE_JSON is true
|
|
202
215
|
srvAllowList += !this.hasBuildOption(CONTENT_PACKAGELOCK_JSON, false) ? "|package-lock\\.json$" : ""
|
|
203
216
|
srvAllowList += !this.hasBuildOption(CONTENT_NPMRC, false) ? "|\\.npmrc$" : ""
|
|
204
|
-
srvAllowList += !this.hasBuildOption(
|
|
217
|
+
srvAllowList += !this.hasBuildOption(CONTENT_CDSRC, false) ? "|\\.cdsrc\\.json$|\\.cdsrc\\.yaml$" : ""
|
|
205
218
|
srvAllowList += this.hasBuildOption(CONTENT_ENV, true) ? "|\\.env($|\\..*$)" : ""
|
|
206
219
|
srvAllowList += this.hasBuildOption(CONTENT_DEFAULT_ENV_JSON, true) ? "|default-env\\.json$" : ""
|
|
207
220
|
srvAllowList = new RegExp(srvAllowList)
|
|
@@ -228,7 +241,7 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
228
241
|
let srvAllowList = "package\\.json$" // always copy package.json, modify only if CONTENT_PACKAGE_JSON is true
|
|
229
242
|
srvAllowList += !this.hasBuildOption(CONTENT_PACKAGELOCK_JSON, false) ? "|package-lock\\.json$" : ""
|
|
230
243
|
srvAllowList += !this.hasBuildOption(CONTENT_NPMRC, false) ? "|\\.npmrc$" : ""
|
|
231
|
-
srvAllowList += !this.hasBuildOption(
|
|
244
|
+
srvAllowList += !this.hasBuildOption(CONTENT_CDSRC, false) ? "|\\.cdsrc\\.json$|\\.cdsrc\\.yaml$" : ""
|
|
232
245
|
srvAllowList += this.hasBuildOption(CONTENT_ENV, true) ? "|\\.env($|\\..*$)" : ""
|
|
233
246
|
srvAllowList += this.hasBuildOption(CONTENT_DEFAULT_ENV_JSON, true) ? "|default-env\\.json$" : ""
|
|
234
247
|
srvAllowList = new RegExp(srvAllowList)
|
|
@@ -290,18 +303,48 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
305
|
}
|
|
306
|
+
await this._packWorkspaceRoot(dest, wsRoot, appPkg)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async _packWorkspaceRoot(dest, wsRoot, appPkg) {
|
|
310
|
+
if (!wsRoot || wsRoot === cds.root) return
|
|
311
|
+
// The workspace root package is not a member of its own `workspaces` globs, so
|
|
312
|
+
// `getWorkspaces` never returns it. Pack it explicitly when the app depends on it
|
|
313
|
+
// via a `file:` spec that resolves to the workspace root.
|
|
314
|
+
const rootName = require(path.join(wsRoot, 'package.json')).name
|
|
315
|
+
const spec = appPkg.dependencies?.[rootName]
|
|
316
|
+
if (!spec?.startsWith('file:')) return
|
|
317
|
+
if (path.resolve(cds.root, spec.slice('file:'.length)) !== path.resolve(wsRoot)) return
|
|
318
|
+
let pkgDescriptors
|
|
319
|
+
try {
|
|
320
|
+
pkgDescriptors = await NodejsBuildPlugin._execNpmPack(dest, wsRoot)
|
|
321
|
+
} catch (e) {
|
|
322
|
+
DEBUG?.(e)
|
|
323
|
+
throw new BuildError(`Failed to package npm workspace root\n${e.message}`)
|
|
324
|
+
}
|
|
325
|
+
const pkgDescriptor = pkgDescriptors?.find(d => d.name === rootName)
|
|
326
|
+
if (!pkgDescriptor) return
|
|
327
|
+
const { filename: fileName } = pkgDescriptor
|
|
328
|
+
appPkg.dependencies[rootName] = `file:${fileName}`
|
|
329
|
+
this.pushFile(path.join(dest, fileName))
|
|
330
|
+
await this.write(JSON.stringify(appPkg, 0, 2)).to(path.join(dest, 'package.json'))
|
|
293
331
|
}
|
|
294
332
|
|
|
295
333
|
/**
|
|
296
334
|
* @param {import('fs').PathLike} dest - destination folder
|
|
297
335
|
* @param {import('fs').PathLike} wsRoot - workspace root folder
|
|
298
|
-
* @param {string[]} workspaces - list of workspace names
|
|
336
|
+
* @param {string[]} [workspaces] - list of workspace names; when omitted, the workspace root package itself is packed
|
|
299
337
|
* @returns {Promise<object[]>} - array of pack descriptors ({ name, filename, ... })
|
|
300
338
|
* @private
|
|
301
339
|
*/
|
|
302
340
|
static async _execNpmPack(dest, wsRoot, workspaces) {
|
|
303
|
-
const args = ['pack', '--
|
|
304
|
-
workspaces
|
|
341
|
+
const args = ['pack', '--json', `--pack-destination=${dest}`]
|
|
342
|
+
if (workspaces) {
|
|
343
|
+
args.push('--ws')
|
|
344
|
+
workspaces.forEach(w => args.push(`-w=${w}`))
|
|
345
|
+
} else {
|
|
346
|
+
args.push(wsRoot)
|
|
347
|
+
}
|
|
305
348
|
const result = await cmd.spawnCommand('npm', args, { cwd: wsRoot }, true, !!LOG._debug)
|
|
306
349
|
DEBUG?.(result)
|
|
307
350
|
const parsed = JSON.parse(result)
|
|
@@ -309,4 +352,18 @@ module.exports = class NodejsBuildPlugin extends require('../edmx') {
|
|
|
309
352
|
// package name as of npm 12 — normalize to an array of descriptors.
|
|
310
353
|
return Array.isArray(parsed) ? parsed : Object.values(parsed)
|
|
311
354
|
}
|
|
355
|
+
|
|
356
|
+
// Override to pass model for neighborhood resolution of plugin i18n files.
|
|
357
|
+
// Cannot be done in InternalBuildPlugin because Java relies on the model-less behaviour.
|
|
358
|
+
async collectMessageBundles(bundleDest, model) {
|
|
359
|
+
const messageBundle = cds.i18n.bundle4('messages', { model })
|
|
360
|
+
const messagesData = messageBundle.translations4?.(cds.env.i18n.languages) ?? {}
|
|
361
|
+
for (const [locale, messages] of Object.entries(messagesData)) {
|
|
362
|
+
if (Object.keys(messages).length > 0) {
|
|
363
|
+
const fileName = locale ? `messages_${locale}.properties` : 'messages.properties'
|
|
364
|
+
const content = Object.entries(messages).map(([k, v]) => `${k}=${v}`).join('\n') + '\n'
|
|
365
|
+
await this.write(content).to(path.join(bundleDest, fileName))
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
312
369
|
}
|
package/lib/build/util.js
CHANGED
|
@@ -8,7 +8,6 @@ const { exists } = cds.utils
|
|
|
8
8
|
const execAsync = require('node:util').promisify(cp.exec)
|
|
9
9
|
const { isRoot } = require('../util/fs')
|
|
10
10
|
|
|
11
|
-
const IS_WIN = require('node:os').platform() === 'win32'
|
|
12
11
|
const { SEVERITY_ERROR, FILE_EXT_CDS, NODEJS_MODEL_EXCLUDE_LIST } = require('./constants');
|
|
13
12
|
const DEBUG = cds.debug('cli|build')
|
|
14
13
|
|
|
@@ -288,7 +287,7 @@ const _cachedWsRoots = new Map()
|
|
|
288
287
|
* could contain globs. Glob resolution will be supported.
|
|
289
288
|
* The result is cached by workspace root!
|
|
290
289
|
* natively in the future (fs.glob is in experimental state as of Node23).
|
|
291
|
-
* @param {
|
|
290
|
+
* @param {string} wsRoot - the root directory of the workspace
|
|
292
291
|
* @returns {Promise<string[]>} list of package paths, or an empty array if either
|
|
293
292
|
* no workspaces are defined or have not been installed.
|
|
294
293
|
*/
|
|
@@ -302,8 +301,7 @@ async function _execNpmWs(wsRoot) {
|
|
|
302
301
|
try {
|
|
303
302
|
const cmdLine = 'npm ls --ws --json'
|
|
304
303
|
DEBUG?.(`execute ${cmdLine}`)
|
|
305
|
-
|
|
306
|
-
const { stdout } = await execAsync(cmdLine, { shell: IS_WIN, stdio: ['inherit', 'pipe', 'inherit'], cwd: wsRoot })
|
|
304
|
+
const { stdout } = await execAsync(cmdLine, { cwd: wsRoot })
|
|
307
305
|
const jsonResult = JSON.parse(stdout)
|
|
308
306
|
if (jsonResult.dependencies) {
|
|
309
307
|
result = Object.keys(jsonResult.dependencies)
|
package/lib/env/schema.js
CHANGED
|
@@ -26,6 +26,22 @@ function mergePluginSchema(pluginSchema) {
|
|
|
26
26
|
targetSchema._cds_schema_overlays.push('root')
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
if (pluginSchema.export) {
|
|
31
|
+
const exp = targetSchema.$defs?.cdsRoot?.properties?.export?.properties
|
|
32
|
+
if (exp) {
|
|
33
|
+
Object.assign(exp, pluginSchema.export)
|
|
34
|
+
targetSchema._cds_schema_overlays.push('export')
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (pluginSchema.importFrom) {
|
|
39
|
+
const oneOf = targetSchema.$defs?.importOptions?.from?.oneOf
|
|
40
|
+
if (oneOf) {
|
|
41
|
+
oneOf.push(pluginSchema.importFrom)
|
|
42
|
+
targetSchema._cds_schema_overlays.push('importFrom')
|
|
43
|
+
}
|
|
44
|
+
}
|
|
29
45
|
}
|
|
30
46
|
}
|
|
31
47
|
}
|
|
@@ -178,79 +178,8 @@ module.exports = {
|
|
|
178
178
|
type: "object",
|
|
179
179
|
description: "Customize cds compile settings",
|
|
180
180
|
additionalProperties: false,
|
|
181
|
+
// export format settings (e.g. `asyncapi`) are contributed by plugins via their package.json `cds.schema.export`
|
|
181
182
|
properties: {
|
|
182
|
-
asyncapi: {
|
|
183
|
-
type: "object",
|
|
184
|
-
description: "AsyncAPI settings for cds compile",
|
|
185
|
-
additionalProperties: false,
|
|
186
|
-
properties: {
|
|
187
|
-
application_namespace: {
|
|
188
|
-
type: "string",
|
|
189
|
-
description: "The registered namespace of the application"
|
|
190
|
-
},
|
|
191
|
-
merged: {
|
|
192
|
-
type: "object",
|
|
193
|
-
description: "properties that needs to be there when merged option is used",
|
|
194
|
-
additionalProperties: false,
|
|
195
|
-
properties: {
|
|
196
|
-
title: {
|
|
197
|
-
type: "string",
|
|
198
|
-
description: "Title to be used for merged doc"
|
|
199
|
-
},
|
|
200
|
-
version: {
|
|
201
|
-
type: "string",
|
|
202
|
-
description: "Version to be used for merged doc"
|
|
203
|
-
},
|
|
204
|
-
short_text: {
|
|
205
|
-
type: "string",
|
|
206
|
-
description: "Short decription of the AsyncAPIs"
|
|
207
|
-
},
|
|
208
|
-
description: {
|
|
209
|
-
type: "string",
|
|
210
|
-
description: "Description to be used for the merged doc"
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
event_spec_version: {
|
|
215
|
-
type: "string",
|
|
216
|
-
description: "Mentions the version of AsyncAPI spec"
|
|
217
|
-
},
|
|
218
|
-
event_source: {
|
|
219
|
-
type: "string",
|
|
220
|
-
description: "Event source information",
|
|
221
|
-
default: "{region}/{applicationNamespace}/{instanceId}",
|
|
222
|
-
},
|
|
223
|
-
event_source_params: {
|
|
224
|
-
type: "object",
|
|
225
|
-
description: "Parameters related to the source of event",
|
|
226
|
-
default: {
|
|
227
|
-
region: "the region",
|
|
228
|
-
applicationNamespace: "the namespace",
|
|
229
|
-
instanceId: "the instance id"
|
|
230
|
-
},
|
|
231
|
-
additionalProperties: false,
|
|
232
|
-
properties: {
|
|
233
|
-
region: {
|
|
234
|
-
type: "string",
|
|
235
|
-
description: "The regional context of the application"
|
|
236
|
-
},
|
|
237
|
-
applicationNamespace: {
|
|
238
|
-
type: "string",
|
|
239
|
-
description: "The registered namespace of the application"
|
|
240
|
-
},
|
|
241
|
-
instanceId: {
|
|
242
|
-
type: "string",
|
|
243
|
-
description: "The instance id (tenant, installation, ...) of the application."
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
event_characteristics: {
|
|
248
|
-
type: "object",
|
|
249
|
-
description: "The characteristics defined for events",
|
|
250
|
-
additionalProperties: true
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
183
|
}
|
|
255
184
|
},
|
|
256
185
|
// deploy specific schema
|
|
@@ -318,10 +247,6 @@ module.exports = {
|
|
|
318
247
|
importOptions: {
|
|
319
248
|
from: {
|
|
320
249
|
oneOf: [
|
|
321
|
-
{
|
|
322
|
-
const: "asyncapi",
|
|
323
|
-
description: "AsyncAPI specification"
|
|
324
|
-
},
|
|
325
250
|
{
|
|
326
251
|
const: "edmx",
|
|
327
252
|
description: "OData specification"
|
package/lib/import/importapi.js
CHANGED
|
@@ -3,7 +3,6 @@ let { path } = cds.utils;
|
|
|
3
3
|
let common = require('./common');
|
|
4
4
|
let odata = require('./odata');
|
|
5
5
|
let openapi = require('./openapi');
|
|
6
|
-
let asyncapi = require('./asyncapi');
|
|
7
6
|
let messages = require('./message').getMessages();
|
|
8
7
|
|
|
9
8
|
module.exports = Object.assign(cds_import, {
|
|
@@ -97,15 +96,15 @@ async function cds_import_from_openapi(filepath, options = {}) {
|
|
|
97
96
|
|
|
98
97
|
/**
|
|
99
98
|
* This is the import API function to generate CSN from asyncapi files.
|
|
99
|
+
* cds11: remove once @cap-js/asyncapi is a required project dependency
|
|
100
100
|
* @param {string} filepath
|
|
101
101
|
* - a single valid filepath
|
|
102
102
|
* @returns {object} CSN
|
|
103
103
|
*/
|
|
104
104
|
async function cds_import_from_asyncapi(filepath, options = {}) {
|
|
105
|
-
// validates the input file
|
|
106
105
|
filepath = await common.isValidInputFile(path.resolve(process.cwd(), filepath));
|
|
107
106
|
const src = await common.getContentFromFile(filepath);
|
|
108
|
-
let csn = asyncapi.asyncapi2csn(src);
|
|
107
|
+
let csn = require('@cap-js/asyncapi').import.asyncapi2csn(src);
|
|
109
108
|
options.inputFileKind = 'odata';
|
|
110
109
|
return csn;
|
|
111
110
|
}
|
package/lib/import/message.js
CHANGED
|
@@ -18,8 +18,6 @@ const messages = {
|
|
|
18
18
|
MISSING_ASSOCIATION: 'Association is missing in the input file provided. Please check the edmx file.',
|
|
19
19
|
COLLECTION_IN_KEY: 'Key Property of an Entity cannot be of the type Collection.',
|
|
20
20
|
INVALID_OPENAPI_FILE: 'The OpenAPI file is not valid. Specify the correct OpenAPI file.',
|
|
21
|
-
INVALID_ASYNCAPI_FILE: 'The AsyncAPI file is not valid. Specify the correct AsyncAPI file.',
|
|
22
|
-
INVALID_MESSAGE_NAME: 'The message name is not valid.',
|
|
23
21
|
UNRESOLVED_TYPE: 'Could not resolve the type: ',
|
|
24
22
|
NO_RETURN_TYPE: 'No ReturnType found in Function: ',
|
|
25
23
|
INVALID_ENUM_TYPE: 'The Underlying type provided is not supported for the EnumType: ',
|
package/lib/init/constants.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = {
|
|
|
5
5
|
COMMAND_ADD: 'add',
|
|
6
6
|
|
|
7
7
|
JAVA_LTS_VERSIONS: [25],
|
|
8
|
-
MAVEN_ARCHETYPE_VERSION: '5.
|
|
8
|
+
MAVEN_ARCHETYPE_VERSION: '5.1.1',
|
|
9
9
|
|
|
10
10
|
OPTIONS: Object.freeze({
|
|
11
11
|
COMPLETION: 'completion',
|
|
@@ -29,6 +29,7 @@ module.exports = {
|
|
|
29
29
|
IAS: 'ias',
|
|
30
30
|
AMS: 'ams',
|
|
31
31
|
HANA: 'hana',
|
|
32
|
+
HANA_SERVERLESS: 'hana-serverless',
|
|
32
33
|
POSTGRES: 'postgres',
|
|
33
34
|
SQLITE: 'sqlite',
|
|
34
35
|
LIQUIBASE: 'liquibase',
|
package/lib/init/index.js
CHANGED
|
@@ -165,7 +165,7 @@ module.exports = class CDSGenerator {
|
|
|
165
165
|
const added = cds.cli.command === 'add' && cds.cli.argv[0]?.split(',').includes(plugin) || cds.cli.options.add?.has(plugin)
|
|
166
166
|
const inProduction = Plugin.hasInProduction(env4('production')) || added
|
|
167
167
|
DEBUG && console.log(inProduction ? '✅' : '❌', plugin)
|
|
168
|
-
if (inProduction) await template.combine()
|
|
168
|
+
if (inProduction) await template.combine(plugin)
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -237,7 +237,7 @@ module.exports = class CDSGenerator {
|
|
|
237
237
|
const creating = ['java', 'nodejs', 'typescript', 'cjs', 'extension']
|
|
238
238
|
const { command, options, argv } = cds.cli
|
|
239
239
|
const inOptions = option => command === 'init' && options.add.has(option) ||
|
|
240
|
-
command === 'add' && argv
|
|
240
|
+
command === 'add' && argv.flatMap(a => a.split(',')).includes(option)
|
|
241
241
|
if (!exists('pom.xml') && !exists('package.json') && !creating.some(inOptions)) {
|
|
242
242
|
if (command === 'init') {
|
|
243
243
|
const project = argv[0] ? argv[0]+' ' : ''
|