@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
|
@@ -63,11 +63,16 @@ modules:
|
|
|
63
63
|
type: html5
|
|
64
64
|
path: {{& appPath}}{{app}}
|
|
65
65
|
build-parameters:
|
|
66
|
+
{{#isStatic}}
|
|
67
|
+
build-result: .
|
|
68
|
+
{{/isStatic}}
|
|
69
|
+
{{^isStatic}}
|
|
66
70
|
build-result: dist
|
|
67
71
|
builder: custom
|
|
68
72
|
commands:
|
|
69
73
|
- npm ci
|
|
70
74
|
- npm run build
|
|
75
|
+
{{/isStatic}}
|
|
71
76
|
supported-platforms: []
|
|
72
77
|
{{/apps}}
|
|
73
78
|
|
|
@@ -2,7 +2,7 @@ const { join } = require('path')
|
|
|
2
2
|
const { readProject } = require('../../projectReader')
|
|
3
3
|
const { merge } = require('../../merge')
|
|
4
4
|
const { srv4, html5RepoHost, html5Runtime, xsuaa, appDeployer, approuter, mtxSidecar4 } = require('../../registries/mta')
|
|
5
|
-
const {
|
|
5
|
+
const { srvApi, html5RepoApi } = require('../../registries/xs-app')
|
|
6
6
|
const { exists, read } = require('../../../cds').utils
|
|
7
7
|
|
|
8
8
|
module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
@@ -22,18 +22,18 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
22
22
|
|
|
23
23
|
async run() {
|
|
24
24
|
const project = readProject()
|
|
25
|
-
const {
|
|
25
|
+
const { apps, appPath, configFile } = project
|
|
26
26
|
await merge(__dirname, 'files/package.json.hbs').into(configFile, { project })
|
|
27
27
|
|
|
28
|
-
//
|
|
29
|
-
await Promise.all(
|
|
28
|
+
// Fiori/UI5 apps deploy a manifest.json; static apps (plain index.html) don't
|
|
29
|
+
await Promise.all(apps.filter(a => !a.isStatic).map(({ app }) =>
|
|
30
30
|
merge(__dirname, 'files/manifest.json')
|
|
31
|
-
.into(join(appPath,
|
|
31
|
+
.into(join(appPath, app, 'webapp/manifest.json'), { project })
|
|
32
32
|
))
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async combine() {
|
|
36
|
-
const project = readProject()
|
|
35
|
+
async combine(facet) {
|
|
36
|
+
const project = readProject(facet)
|
|
37
37
|
const {
|
|
38
38
|
isJava, srv, appPath, apps,
|
|
39
39
|
hasApprouter, hasMta, addMta, hasKyma, hasXsuaa, hasMultitenancy, hasUI5,
|
|
@@ -43,7 +43,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
43
43
|
await Promise.all(apps.map(async ({ app }) => {
|
|
44
44
|
project.app = app
|
|
45
45
|
project.hasIndexHtml = exists(join(appPath, app, 'webapp/index.html'))
|
|
46
|
-
const additions = [
|
|
46
|
+
const additions = [srvApi, html5RepoApi]
|
|
47
47
|
await merge(__dirname, 'files/xs-app.json.hbs').into(join(appPath, app, 'xs-app.json'), { with: project, additions })
|
|
48
48
|
const pJsonPath = join(appPath, app, 'package.json')
|
|
49
49
|
const pJson = exists(pJsonPath) ? await read(pJsonPath) : {}
|
|
@@ -73,10 +73,14 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
73
73
|
if (addMta || affected && hasMta) {
|
|
74
74
|
const srvModule = srv4(srv.path)
|
|
75
75
|
project.apps = apps
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const hasApps = apps.length > 0
|
|
77
|
+
const relationships = []
|
|
78
|
+
if (hasApps) {
|
|
79
|
+
relationships.push({
|
|
80
|
+
insert: [html5RepoHost, 'name'],
|
|
81
|
+
into: [appDeployer, 'requires', 'name'],
|
|
82
|
+
})
|
|
83
|
+
}
|
|
80
84
|
const appModules = []
|
|
81
85
|
for (const { app } of project.apps) {
|
|
82
86
|
const html5App = { in: 'modules', where: { type: 'html5', path: `${appPath}${app}` } }
|
|
@@ -101,7 +105,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
101
105
|
into: [isJava ? srvModule : mtxSidecar4('gen/mtx/sidecar'), 'requires', 'name']
|
|
102
106
|
})
|
|
103
107
|
}
|
|
104
|
-
if (hasXsuaa) {
|
|
108
|
+
if (hasXsuaa && hasApps) {
|
|
105
109
|
relationships.push({
|
|
106
110
|
insert: [xsuaa, 'name'],
|
|
107
111
|
into: [appDeployer, 'requires']
|
|
@@ -109,7 +113,7 @@ module.exports = class Html5RepoTemplate extends require('../../plugin') {
|
|
|
109
113
|
}
|
|
110
114
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', {
|
|
111
115
|
with: project,
|
|
112
|
-
additions: [srvModule, appDeployer, html5RepoHost, ...appModules],
|
|
116
|
+
additions: [srvModule, ...(hasApps ? [appDeployer] : []), html5RepoHost, ...appModules],
|
|
113
117
|
relationships
|
|
114
118
|
})
|
|
115
119
|
}
|
|
@@ -101,13 +101,21 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
101
101
|
const autoexposed = c['@cds.autoexposed'] || c['@cds.autoexpose']
|
|
102
102
|
const valuelist = c['@cds.odata.valuelist'] === true
|
|
103
103
|
if (!exposed.size && autoexposed && !valuelist) continue
|
|
104
|
+
const singleton = c['@odata.singleton'] || Object.keys(c).some(k => k.startsWith('@odata.singleton.')) // object form flattens to @odata.singleton.<sub>
|
|
104
105
|
entities.push({
|
|
105
106
|
name: c.name,
|
|
106
|
-
readOnly: (c["@readonly"] || autoexposed ||
|
|
107
|
+
readOnly: (c["@readonly"] || autoexposed || singleton) ?? false,
|
|
108
|
+
insertOnly: c['@insertonly'] ?? false,
|
|
109
|
+
noInsert: c['@Capabilities.InsertRestrictions.Insertable'] === false,
|
|
110
|
+
noUpdate: c['@Capabilities.UpdateRestrictions.Updatable'] === false,
|
|
111
|
+
noDelete: c['@Capabilities.DeleteRestrictions.Deletable'] === false,
|
|
107
112
|
isDraft: c['@odata.draft.enabled'] ?? false,
|
|
108
|
-
keys: c.keys
|
|
113
|
+
keys: c.keys,
|
|
114
|
+
params: c.params,
|
|
115
|
+
boundOps: c.actions,
|
|
116
|
+
elements: c.elements
|
|
109
117
|
})
|
|
110
|
-
} else if (c.kind === 'action') {
|
|
118
|
+
} else if (c.kind === 'action' || c.kind === 'function') {
|
|
111
119
|
actions.push(c)
|
|
112
120
|
}
|
|
113
121
|
}
|
|
@@ -163,47 +171,77 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
163
171
|
const headerAuth = username ? `Authorization: Basic {{username}}:{{password}}` : ''
|
|
164
172
|
const headers = headerAuth ? `Content-Type: application/json\n${headerAuth}` : `Content-Type: application/json`
|
|
165
173
|
|
|
166
|
-
|
|
174
|
+
const usedNames = new Set()
|
|
175
|
+
const uniqueName = base => {
|
|
176
|
+
let name = base, i = 2
|
|
177
|
+
while (usedNames.has(name)) name = `${base}_${i++}`
|
|
178
|
+
usedNames.add(name)
|
|
179
|
+
return name
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
service.urlPaths.forEach((rawUrlPath) => {
|
|
183
|
+
const urlPath = rawUrlPath.replace(/^\//, '') // avoid a double slash when the service path is '/'
|
|
167
184
|
if (service.urlPaths.length > 1) {
|
|
168
185
|
requests.push(`\n# Service endpoint: ${urlPath}`)
|
|
169
186
|
}
|
|
170
187
|
|
|
171
188
|
service.entities.forEach((e) => {
|
|
172
189
|
const entityNameSimple = e.name.slice(serviceName.length + 1)
|
|
173
|
-
const
|
|
174
|
-
const
|
|
190
|
+
const entitySet = entityNameSimple.replace(/\./g, '_') // OData flattens nested names, e.g. E.addr -> E_addr
|
|
191
|
+
const nameSlug = uniqueName(slug(entitySet))
|
|
175
192
|
const requestTitle = `\n### ${entityNameSimple}`
|
|
176
|
-
|
|
193
|
+
|
|
194
|
+
// parameterized entities are addressed as E(p=…)/Set and are read-only
|
|
195
|
+
if (e.params && Object.keys(e.params).length) {
|
|
196
|
+
const args = Object.entries(e.params).map(([n, p]) => `${n}=${sampleParam(p)}`).join(',')
|
|
197
|
+
const url = `{{server}}/${urlPath}${entitySet}(${args})/Set`
|
|
198
|
+
requests.push(`${requestTitle}\n# @name ${nameSlug}_GET\nGET ${url}\n${headerAuth}\n`)
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const url = `{{server}}/${urlPath}${entitySet}`
|
|
203
|
+
if (!e.insertOnly) requests.push(`${requestTitle}\n# @name ${nameSlug}_GET\nGET ${url}\n${headerAuth}\n`) // insert-only entities cannot be read
|
|
177
204
|
if (e.readOnly) return
|
|
178
205
|
|
|
179
206
|
const entityData = payload[`${e.name}`] ? payload[`${e.name}`][0] : null
|
|
180
207
|
if (!entityData) return
|
|
181
208
|
|
|
209
|
+
stripNonWritable(entityData, e.keys, e.elements)
|
|
210
|
+
|
|
182
211
|
if (e.isDraft) {
|
|
183
|
-
const
|
|
184
|
-
|
|
212
|
+
const keyNames = Object.keys(e.keys)
|
|
213
|
+
const activeId = keyPredicate(e.keys, entityData, true)
|
|
214
|
+
keyNames.forEach(k => delete entityData[k]) // draft keys are auto-generated, so drop them from the payload
|
|
185
215
|
const postBody = JSON.stringify(entityData, null, 2)
|
|
186
|
-
generateDraftRequests(requests, requestTitle, url, headers, headerAuth, postBody,
|
|
216
|
+
generateDraftRequests(requests, requestTitle, url, headers, headerAuth, postBody, keyNames, service)
|
|
217
|
+
if (activeId) {
|
|
218
|
+
const instance = `${url}${activeId.replace(/\)$/, ',IsActiveEntity=true)')}`
|
|
219
|
+
generateBoundOps(requests, requestTitle, instance, headers, headerAuth, nameSlug, e.boundOps, serviceName)
|
|
220
|
+
}
|
|
187
221
|
}
|
|
188
222
|
else {
|
|
189
223
|
const postBody = JSON.stringify(entityData, null, 2)
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
224
|
+
if (!e.noInsert) requests.push(`${requestTitle}\n# @name ${nameSlug}_POST\nPOST ${url}\n${headers}\n\n${postBody}\n`)
|
|
225
|
+
const id = e.insertOnly ? undefined : keyPredicate(e.keys, entityData)
|
|
226
|
+
if (id) {
|
|
227
|
+
if (!e.noUpdate) requests.push(`${requestTitle}\n# @name ${nameSlug}_PATCH\nPATCH ${url}${id}\n${headers}\n\n${postBody}\n`)
|
|
228
|
+
if (!e.noDelete) requests.push(`${requestTitle}\n# @name ${nameSlug}_DELETE\nDELETE ${url}${id}\n${headers}\n`)
|
|
229
|
+
const parenId = keyPredicate(e.keys, entityData, true)
|
|
230
|
+
generateBoundOps(requests, requestTitle, `${url}${parenId}`, headers, headerAuth, nameSlug, e.boundOps, serviceName)
|
|
196
231
|
}
|
|
197
|
-
compositeKey ? id = `(${id})` : id = `/${id}`
|
|
198
|
-
requests.push(`${requestTitle}\n# @name ${nameSlug}_POST\nPOST ${url}\n${headers}\n\n${postBody}\n`)
|
|
199
|
-
requests.push(`${requestTitle}\n# @name ${nameSlug}_PATCH\nPATCH ${url}${id}\n${headers}\n\n${postBody}\n`)
|
|
200
|
-
requests.push(`${requestTitle}\n# @name ${nameSlug}_DELETE\nDELETE ${url}${id}\n${headers}\n`)
|
|
201
232
|
}
|
|
202
233
|
})
|
|
203
234
|
|
|
204
235
|
service.actions.forEach((a) => {
|
|
205
236
|
const simpleNameAction = a.name.slice(serviceName.length + 1)
|
|
206
237
|
const url = `{{server}}/${urlPath}${simpleNameAction}`
|
|
238
|
+
const actionSlug = uniqueName(slug(simpleNameAction))
|
|
239
|
+
|
|
240
|
+
if (a.kind === 'function') {
|
|
241
|
+
const args = Object.entries(a.params || {}).map(([n, p]) => `${n}=${literal(p.type, payload[a.name]?.[0]?.[n])}`).join(',')
|
|
242
|
+
requests.push(`\n### ${simpleNameAction}\n# @name ${actionSlug}_GET\nGET ${url}(${args})\n${headerAuth}\n`)
|
|
243
|
+
return
|
|
244
|
+
}
|
|
207
245
|
|
|
208
246
|
let actionPayload = {}
|
|
209
247
|
if (a.params) {
|
|
@@ -211,26 +249,85 @@ module.exports = class HttpTemplate extends require('../../plugin') {
|
|
|
211
249
|
actionPayload[pName] = payload[a.name]?.[0]?.[pName] ?? null
|
|
212
250
|
}
|
|
213
251
|
}
|
|
214
|
-
requests.push(`\n### ${simpleNameAction}\n# @name ${
|
|
252
|
+
requests.push(`\n### ${simpleNameAction}\n# @name ${actionSlug}_POST\nPOST ${url}\n${headers}\n\n${JSON.stringify(actionPayload, null, 2)}\n`)
|
|
215
253
|
})
|
|
216
254
|
|
|
217
255
|
})
|
|
218
256
|
this.#write(requests, serviceName)
|
|
219
257
|
}
|
|
220
258
|
|
|
221
|
-
function generateDraftRequests(requests, title, url, headers, headerAuth, postBody,
|
|
259
|
+
function generateDraftRequests(requests, title, url, headers, headerAuth, postBody, keys, service) {
|
|
222
260
|
const nameDraftsCreate = slug(title+'_Draft_POST')
|
|
261
|
+
const draftVar = k => keys.length > 1 ? `draftID_${k}` : 'draftID'
|
|
262
|
+
const predicate = keys.map(k => `${k}={{${draftVar(k)}}}`).join(',') + ',IsActiveEntity=false'
|
|
263
|
+
const bindings = keys.map(k => `@${draftVar(k)}={{${nameDraftsCreate}.response.body.$.${k}}}`).join('\n')
|
|
223
264
|
requests.push(`${title} Drafts GET\n# @name ${slug(title+'_Drafts_GET')}\nGET ${url}?$filter=(IsActiveEntity eq false)\n${headerAuth}\n`) // unencoded URL for better readability (client can handle this)
|
|
224
265
|
requests.push(`${title} Draft POST\n# @name ${nameDraftsCreate}\nPOST ${url}\n${headers}\n\n${postBody}\n`)
|
|
225
|
-
requests.push(`\n### Result from POST request above\n
|
|
226
|
-
requests.push(`${title} Draft PATCH\n# @name ${slug(title+'_Draft_Patch')}\nPATCH ${url}(${
|
|
227
|
-
requests.push(`${title} Draft Prepare\n# @name ${slug(title+'_Draft_Prepare')}\nPOST ${url}(${
|
|
228
|
-
requests.push(`${title} Draft Activate\n# @name ${slug(title+'_Draft_Activate')}\nPOST ${url}(${
|
|
266
|
+
requests.push(`\n### Result from POST request above\n${bindings}\n`)
|
|
267
|
+
requests.push(`${title} Draft PATCH\n# @name ${slug(title+'_Draft_Patch')}\nPATCH ${url}(${predicate})\n${headers}\n\n${postBody}\n`)
|
|
268
|
+
requests.push(`${title} Draft Prepare\n# @name ${slug(title+'_Draft_Prepare')}\nPOST ${url}(${predicate})/${service.name}.draftPrepare\n${headers}\n\n{}\n`)
|
|
269
|
+
requests.push(`${title} Draft Activate\n# @name ${slug(title+'_Draft_Activate')}\nPOST ${url}(${predicate})/${service.name}.draftActivate\n${headers}\n\n{}\n`)
|
|
229
270
|
}
|
|
230
271
|
|
|
231
272
|
function slug(str) {
|
|
232
273
|
return str.trim().replace(/[#\\. ]/g, '')
|
|
233
274
|
}
|
|
275
|
+
|
|
276
|
+
// drop non-writable fields (readonly/computed/managed) from a request body, keeping keys for addressing
|
|
277
|
+
function stripNonWritable(data, keys, elements) {
|
|
278
|
+
const keyNames = new Set(Object.keys(keys || {}))
|
|
279
|
+
for (const name of Object.keys(data)) {
|
|
280
|
+
if (keyNames.has(name)) continue
|
|
281
|
+
const el = elements?.[name]
|
|
282
|
+
if (el && (el['@readonly'] || el['@Core.Computed'] || el['@cds.on.insert'] || el['@cds.on.update'])) delete data[name]
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// placeholder value for a parameterized-entity argument
|
|
287
|
+
function sampleParam(p) {
|
|
288
|
+
const t = p.type
|
|
289
|
+
if (t === 'cds.String' || t === 'cds.UUID' || t === 'cds.Date' || t === 'cds.DateTime' || t === 'cds.Timestamp') return `''`
|
|
290
|
+
if (t === 'cds.Boolean') return 'true'
|
|
291
|
+
return '0'
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// OData URL literal for a value of the given type
|
|
295
|
+
function literal(type, value) {
|
|
296
|
+
if (value === undefined || value === null) return 'null'
|
|
297
|
+
return type === 'cds.String' ? `'${value}'` : `${value}`
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// key predicate from scalar keys with a sample value; associations, structs, binary types and unseeded keys aren't addressable
|
|
301
|
+
function keyPredicate(keys, data, paren) {
|
|
302
|
+
const notAddressable = new Set(['cds.Association', 'cds.Composition', 'cds.Binary', 'cds.LargeBinary', 'cds.Vector'])
|
|
303
|
+
const scalar = [...(keys || [])].filter(k => !k.is_struct && !notAddressable.has(k.type) && data[k.name] !== undefined)
|
|
304
|
+
if (!scalar.length) return undefined
|
|
305
|
+
const val = k => literal(k.type, data[k.name])
|
|
306
|
+
if (paren || scalar.length > 1) return `(${scalar.map(k => `${k.name}=${val(k)}`).join(',')})`
|
|
307
|
+
return `/${val(scalar[0])}`
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// sample value for a bound-operation parameter
|
|
311
|
+
function sampleValue(type) {
|
|
312
|
+
if (type === 'cds.Boolean') return true
|
|
313
|
+
if (type === 'cds.Integer' || type === 'cds.Int16' || type === 'cds.Int32' || type === 'cds.Int64' || type === 'cds.Decimal' || type === 'cds.Double') return 0
|
|
314
|
+
return ''
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// bound actions (POST body) and functions (GET with inline args) on a single instance
|
|
318
|
+
function generateBoundOps(requests, title, instanceUrl, headers, headerAuth, nameSlug, boundOps, serviceName) {
|
|
319
|
+
for (const [name, op] of Object.entries(boundOps || {})) {
|
|
320
|
+
const params = op.params || {}
|
|
321
|
+
if (op.kind === 'function') {
|
|
322
|
+
const args = Object.entries(params).map(([n, p]) => `${n}=${literal(p.type, sampleValue(p.type))}`).join(',')
|
|
323
|
+
requests.push(`${title} ${name}\n# @name ${nameSlug}_${slug(name)}_GET\nGET ${instanceUrl}/${serviceName}.${name}(${args})\n${headerAuth}\n`)
|
|
324
|
+
} else {
|
|
325
|
+
const body = {}
|
|
326
|
+
for (const [n, p] of Object.entries(params)) body[n] = sampleValue(p.type)
|
|
327
|
+
requests.push(`${title} ${name}\n# @name ${nameSlug}_${slug(name)}_POST\nPOST ${instanceUrl}/${serviceName}.${name}\n${headers}\n\n${JSON.stringify(body, null, 2)}\n`)
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
234
331
|
}
|
|
235
332
|
|
|
236
333
|
async #getHostnameAndAuth(service, csn) {
|
|
@@ -22,8 +22,8 @@ module.exports = class IasTemplate extends require('../../plugin') {
|
|
|
22
22
|
if (isNodejs) await sort('package.json', 'dependencies')
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async combine() {
|
|
26
|
-
const project = readProject()
|
|
25
|
+
async combine(facet) {
|
|
26
|
+
const project = readProject(facet)
|
|
27
27
|
const { isJava, addMta, hasMta, addCfManifest, addKyma, addMultitenancy, hasApprouter, hasMultitenancy, srv } = project
|
|
28
28
|
|
|
29
29
|
if (addMultitenancy) {
|
|
@@ -27,8 +27,8 @@ module.exports = class KafkaTemplate extends require('../../plugin') {
|
|
|
27
27
|
if (isJava) await mvn.add('kafka')
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async combine() {
|
|
31
|
-
const project = readProject()
|
|
30
|
+
async combine(facet) {
|
|
31
|
+
const project = readProject(facet)
|
|
32
32
|
const { addMta, srv, addKyma } = project
|
|
33
33
|
|
|
34
34
|
if (addMta) {
|
|
@@ -73,13 +73,13 @@ module.exports = class KymaTemplate extends require('../../plugin') {
|
|
|
73
73
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
async combine() {
|
|
76
|
+
async combine(facet) {
|
|
77
77
|
// REVISIT: This must be moved to the respective plugins
|
|
78
78
|
const {
|
|
79
|
-
addHana, addMultitenancy, addXsuaa, hasApprouter,
|
|
79
|
+
addHana, addHanaServerless, hasHanaServerless, addMultitenancy, addXsuaa, hasApprouter,
|
|
80
80
|
addApprouter, addIas, addAms, hasXsuaa, hasMultitenancy, addWorkzoneStandard,
|
|
81
81
|
addHtml5Repo, hasHtml5Repo, addAppFrontend
|
|
82
|
-
} = readProject()
|
|
82
|
+
} = readProject(facet)
|
|
83
83
|
|
|
84
84
|
if (addHtml5Repo || addWorkzoneStandard || addApprouter && hasHtml5Repo) {
|
|
85
85
|
if (addHtml5Repo) {
|
|
@@ -106,8 +106,10 @@ module.exports = class KymaTemplate extends require('../../plugin') {
|
|
|
106
106
|
await KymaTemplate.mergeDependency('service-instance', 'subscription-manager')
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
if (addHana || addMultitenancy) {
|
|
110
|
-
if (
|
|
109
|
+
if (addHana || addHanaServerless || addMultitenancy) {
|
|
110
|
+
if (hasHanaServerless) {
|
|
111
|
+
await KymaTemplate.mergeDependency('service-instance', 'db')
|
|
112
|
+
} else if (hasMultitenancy) {
|
|
111
113
|
await KymaTemplate.mergeDependency('service-instance', 'service-manager')
|
|
112
114
|
await KymaTemplate.mergeDependency('content-deployment', 'mtx-upgrade')
|
|
113
115
|
} else {
|
|
@@ -21,8 +21,8 @@ module.exports = class MalwareScannerTemplate extends require('../../plugin') {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async combine() {
|
|
25
|
-
const project = readProject()
|
|
24
|
+
async combine(facet) {
|
|
25
|
+
const project = readProject(facet)
|
|
26
26
|
const { addMta, addKyma, srv } = project
|
|
27
27
|
|
|
28
28
|
if (addMta) {
|
|
@@ -40,11 +40,11 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
|
40
40
|
await copyRenderedJSON(join(__dirname, 'files', 'package.sidecar.json.hbs'), join('mtx', 'sidecar/package.json'), project)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async combine() {
|
|
44
|
-
const project = readProject()
|
|
43
|
+
async combine(facet) {
|
|
44
|
+
const project = readProject(facet)
|
|
45
45
|
const {
|
|
46
46
|
isNodejs, isJava, addMta, hasMta,
|
|
47
|
-
addXsuaa, hasXsuaa, addIas, hasIas, hasHana, addKyma, hasApprouter,
|
|
47
|
+
addXsuaa, hasXsuaa, addIas, hasIas, hasHana, hasHanaServerless, addKyma, hasApprouter,
|
|
48
48
|
srv, appName
|
|
49
49
|
} = project
|
|
50
50
|
|
|
@@ -98,6 +98,21 @@ module.exports = class MultitenancyTemplate extends require('../../plugin') {
|
|
|
98
98
|
`https://{{ .Release.Name }}-sidecar-{{ .Release.Namespace }}.{{ .Values.global.domain }}`
|
|
99
99
|
}}}
|
|
100
100
|
}).into('chart/values.yaml',{ forceOverwrite: true })
|
|
101
|
+
|
|
102
|
+
if (hasHanaServerless) {
|
|
103
|
+
await merge('chart/values.yaml').remove([
|
|
104
|
+
'service-manager',
|
|
105
|
+
'srv.bindings.service-manager',
|
|
106
|
+
'sidecar.bindings.service-manager',
|
|
107
|
+
'mtx-upgrade.bindings.service-manager'
|
|
108
|
+
])
|
|
109
|
+
await merge({
|
|
110
|
+
srv: { bindings: { db: { serviceInstanceName: 'db' } } },
|
|
111
|
+
sidecar: { bindings: { db: { serviceInstanceName: 'db' } } },
|
|
112
|
+
'mtx-upgrade': { bindings: { db: { serviceInstanceName: 'db' } } }
|
|
113
|
+
}).into('chart/values.yaml')
|
|
114
|
+
await merge('chart/Chart.yaml').remove([{ dependencies: { alias: 'service-manager' } }])
|
|
115
|
+
}
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
// cds10 move to if above
|
|
@@ -33,8 +33,8 @@ module.exports = class NotificationsTemplate extends require('../../plugin') {
|
|
|
33
33
|
await merge(__dirname, 'files/package.json.hbs').into(configFile, { project })
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async combine() {
|
|
37
|
-
const project = readProject()
|
|
36
|
+
async combine(facet) {
|
|
37
|
+
const project = readProject(facet)
|
|
38
38
|
const { addMta } = project
|
|
39
39
|
|
|
40
40
|
if (addMta) {
|
|
@@ -17,9 +17,11 @@ modules:
|
|
|
17
17
|
requires:
|
|
18
18
|
- name: {{appName}}-portal
|
|
19
19
|
|
|
20
|
+
{{#withApps}}
|
|
20
21
|
- name: {{appName}}-app-deployer
|
|
21
22
|
type: com.sap.application.content
|
|
22
23
|
path: {{#isNodejs}}gen{{/isNodejs}}{{#isJava}}.{{/isJava}}
|
|
24
|
+
{{/withApps}}
|
|
23
25
|
|
|
24
26
|
- name: {{appName}}-portal-deployer
|
|
25
27
|
type: com.sap.application.content
|
|
@@ -50,9 +52,11 @@ modules:
|
|
|
50
52
|
name: {{appName}}-portal-deployer-ias-key
|
|
51
53
|
{{/hasIas}}
|
|
52
54
|
- name: {{appName}}-html5-repo-host
|
|
55
|
+
{{#withApps}}
|
|
53
56
|
- name: {{appName}}-app-deployer
|
|
54
57
|
deployed-after:
|
|
55
58
|
- {{appName}}-app-deployer
|
|
59
|
+
{{/withApps}}
|
|
56
60
|
|
|
57
61
|
resources:
|
|
58
62
|
- name: {{appName}}-portal
|
|
@@ -27,9 +27,9 @@ module.exports = class PortalTemplate extends require('../../plugin') {
|
|
|
27
27
|
await renderAndCopy(path.join(__dirname, 'files/portal-site'), 'app/portal/portal-site', project)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async combine() {
|
|
31
|
-
const project = readProject()
|
|
32
|
-
const { isJava, addMta, hasMta, srv, addHtml5Repo, addXsuaa, addApprouter, addMultitenancy, addKyma, hasApprouter, hasHtml5Repo, hasMultitenancy, hasXsuaa } = project
|
|
30
|
+
async combine(facet) {
|
|
31
|
+
const project = readProject(facet)
|
|
32
|
+
const { isJava, addMta, hasMta, srv, apps, addHtml5Repo, addXsuaa, addApprouter, addMultitenancy, addKyma, hasApprouter, hasHtml5Repo, hasMultitenancy, hasXsuaa } = project
|
|
33
33
|
|
|
34
34
|
if (addMultitenancy) {
|
|
35
35
|
await merge(__dirname, 'files/package.sidecar.json').into('mtx/sidecar/package.json')
|
|
@@ -37,14 +37,19 @@ module.exports = class PortalTemplate extends require('../../plugin') {
|
|
|
37
37
|
|
|
38
38
|
if (addMta || (addXsuaa || addHtml5Repo || addApprouter || addMultitenancy) && hasMta) {
|
|
39
39
|
const srvModule = srv4(srv.path)
|
|
40
|
-
const
|
|
40
|
+
const hasApps = apps.length > 0
|
|
41
|
+
project.withApps = hasApps
|
|
42
|
+
const additions = [srvModule, portal, ...(hasApps ? [appDeployer] : []), portalDeployer]
|
|
41
43
|
const relationships = [{
|
|
42
44
|
insert: [portal, 'name'],
|
|
43
45
|
into: [portalDeployer, 'requires', 'name']
|
|
44
|
-
}, {
|
|
45
|
-
insert: [appDeployer, 'name'],
|
|
46
|
-
into: [portalDeployer, 'requires', 'name']
|
|
47
46
|
}]
|
|
47
|
+
if (hasApps) {
|
|
48
|
+
relationships.push({
|
|
49
|
+
insert: [appDeployer, 'name'],
|
|
50
|
+
into: [portalDeployer, 'requires', 'name']
|
|
51
|
+
})
|
|
52
|
+
}
|
|
48
53
|
|
|
49
54
|
if (hasXsuaa) {
|
|
50
55
|
relationships.push({
|
|
@@ -81,7 +86,7 @@ module.exports = class PortalTemplate extends require('../../plugin') {
|
|
|
81
86
|
if (addKyma) {
|
|
82
87
|
await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
|
|
83
88
|
await KymaTemplate.mergeDependency('service-instance', 'portal')
|
|
84
|
-
await renderAndCopy(path.join(__dirname, 'files/portal-site'), '
|
|
89
|
+
await renderAndCopy(path.join(__dirname, 'files/portal-site'), path.join(project.html5DeployerPath, 'portal/portal-site'), project)
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
@@ -27,8 +27,8 @@ module.exports = class PostgresTemplate extends require('../../plugin') {
|
|
|
27
27
|
await sort('package.json', 'dependencies')
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async combine() {
|
|
31
|
-
const project = readProject()
|
|
30
|
+
async combine(facet) {
|
|
31
|
+
const project = readProject(facet)
|
|
32
32
|
const { addMta, srv, hasMultitenancy, addKyma, hasKyma, addMultitenancy } = project
|
|
33
33
|
|
|
34
34
|
if (addMta) {
|
|
@@ -24,8 +24,8 @@ module.exports = class extends require('../../plugin') {
|
|
|
24
24
|
await merge(__dirname, 'files/package.json.hbs').into('package.json')
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async combine() {
|
|
28
|
-
const project = readProject()
|
|
27
|
+
async combine(facet) {
|
|
28
|
+
const project = readProject(facet)
|
|
29
29
|
const { addMta, srv } = project
|
|
30
30
|
|
|
31
31
|
if (addMta) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath
|
|
2
2
|
101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire"
|
|
3
3
|
107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire"
|
|
4
|
-
150,Edgar
|
|
4
|
+
150,Edgar Allan Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland"
|
|
5
5
|
170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England"
|
|
@@ -4,7 +4,7 @@ const { readProject } = require('../../projectReader')
|
|
|
4
4
|
const { merge } = require('../../merge')
|
|
5
5
|
const { join } = require('path')
|
|
6
6
|
const { destination, destinations, xsuaa, srv4, html5RepoHost, mtxSidecar4 } = require('../../registries/mta')
|
|
7
|
-
const {
|
|
7
|
+
const { srvApi } = require('../../registries/xs-app')
|
|
8
8
|
|
|
9
9
|
module.exports = class extends require('../../plugin') {
|
|
10
10
|
|
|
@@ -39,8 +39,8 @@ module.exports = class extends require('../../plugin') {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
async combine() {
|
|
43
|
-
const project = readProject()
|
|
42
|
+
async combine(facet) {
|
|
43
|
+
const project = readProject(facet)
|
|
44
44
|
const { isJava, addMta, hasMta, srv, apps, appPath, appUIPaths, addMultitenancy, addXsuaa, strippedAppName } = project
|
|
45
45
|
|
|
46
46
|
await Promise.all(appUIPaths.map(async p => {
|
|
@@ -58,9 +58,9 @@ module.exports = class extends require('../../plugin') {
|
|
|
58
58
|
}))
|
|
59
59
|
|
|
60
60
|
await Promise.all(apps.map(async ({ app }) => {
|
|
61
|
-
const additions = [
|
|
61
|
+
const additions = [srvApi]
|
|
62
62
|
const overwrites = [{
|
|
63
|
-
item: [
|
|
63
|
+
item: [srvApi, 'destination'],
|
|
64
64
|
withValue: `srv-api`
|
|
65
65
|
}]
|
|
66
66
|
project.app = app
|
|
@@ -32,8 +32,8 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
|
|
|
32
32
|
await merge(__dirname, 'files/package.json.hbs').into(configFile, { project, forceOverwrite: true })
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async combine() {
|
|
36
|
-
const project = readProject()
|
|
35
|
+
async combine(facet) {
|
|
36
|
+
const project = readProject(facet)
|
|
37
37
|
const { addMultitenancy, hasMultitenancy, addMta, hasMta, addKyma, isJava, srv, hasKyma } = project
|
|
38
38
|
|
|
39
39
|
const cds = require('../../../../lib')
|
|
@@ -81,6 +81,16 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { project, additions, overwrites, relationships })
|
|
84
|
+
if (project.hasExtensibility) {
|
|
85
|
+
const extTemplate = require('path').join(__dirname, '../extensibility')
|
|
86
|
+
await merge(extTemplate, 'files', 'mta.yaml.hbs').into('mta.yaml', {
|
|
87
|
+
project,
|
|
88
|
+
additions: [
|
|
89
|
+
xsuaa,
|
|
90
|
+
{ in: [xsuaa, 'parameters.config.role-collections'], where: { name: `ExtensionDeveloper (${project.appName} \${org}-\${space})` } }
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
if (addKyma || addMultitenancy && hasKyma) {
|
|
@@ -96,6 +106,14 @@ module.exports = class XsuaaTemplate extends require('../../plugin') {
|
|
|
96
106
|
'role-template-references': [`$XSAPPNAME.${role.name}`],
|
|
97
107
|
}))
|
|
98
108
|
}
|
|
109
|
+
if (project.hasExtensibility) {
|
|
110
|
+
parameters['role-collections'] ??= []
|
|
111
|
+
parameters['role-collections'].push({
|
|
112
|
+
name: `ExtensionDeveloper (${project.appName} {{ .Release.Namespace }})`,
|
|
113
|
+
description: 'generated',
|
|
114
|
+
'role-template-references': ['$XSAPPNAME.ExtensionDeveloper'],
|
|
115
|
+
})
|
|
116
|
+
}
|
|
99
117
|
await merge({ xsuaa: { parameters } }).into('chart/values.yaml')
|
|
100
118
|
await KymaTemplate.mergeDependency('service-instance', 'xsuaa')
|
|
101
119
|
|