@sap/cds-dk 6.6.2 → 6.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/bin/add.js +5 -3
  3. package/bin/build/all.js +1 -1
  4. package/bin/cds.js +10 -8
  5. package/bin/env.js +4 -6
  6. package/bin/login.js +6 -4
  7. package/bin/migrate.js +0 -1
  8. package/bin/repl.js +1 -1
  9. package/bin/serve.js +7 -0
  10. package/bin/subscribe.js +5 -5
  11. package/bin/unsubscribe.js +4 -5
  12. package/bin/upgrade.js +67 -0
  13. package/bin/watch.js +8 -5
  14. package/lib/bind/bindingManager.js +3 -2
  15. package/lib/bind/cfKeyProvider.js +7 -6
  16. package/lib/bind/userCdsrcJsonStorageProvider.js +5 -4
  17. package/lib/cds.js +12 -0
  18. package/lib/client/activate.js +4 -3
  19. package/lib/client/auth_manager.js +4 -3
  20. package/lib/client/base_command.js +7 -2
  21. package/lib/client/helper/cf_helper.js +12 -11
  22. package/lib/client/helper/dependency_helper.js +3 -2
  23. package/lib/client/helper/logging.js +0 -7
  24. package/lib/client/params.js +4 -2
  25. package/lib/client/settings_manager.js +35 -34
  26. package/lib/client/tenant_action.js +78 -0
  27. package/lib/init/constants.js +1 -1
  28. package/lib/init/index.js +4 -4
  29. package/lib/init/template/_merging/registry-mta.js +31 -46
  30. package/lib/init/template/approuter/files/mta.yaml.hbs +12 -8
  31. package/lib/init/template/approuter/files/xs-app.json.hbs +0 -3
  32. package/lib/init/template/approuter/index.js +26 -34
  33. package/lib/init/template/auditlog/files/mta.yaml.hbs +2 -1
  34. package/lib/init/template/auditlog/index.js +8 -21
  35. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +4 -4
  36. package/lib/init/template/cf-manifest/index.js +2 -1
  37. package/lib/init/template/connectivity/index.js +4 -5
  38. package/lib/init/template/data/index.js +19 -22
  39. package/lib/init/template/destinations/index.js +5 -17
  40. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +2 -1
  41. package/lib/init/template/enterprise-messaging/index.js +7 -19
  42. package/lib/init/template/extensibility/index.js +3 -1
  43. package/lib/init/template/hana/files/mta.yaml.hbs +4 -5
  44. package/lib/init/template/hana/index.js +49 -84
  45. package/lib/init/template/helm/chart/templates/_helpers.tpl +4 -1
  46. package/lib/init/template/helm/files/Chart.yaml.hbs +1 -4
  47. package/lib/init/template/helm/index.js +45 -13
  48. package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +21 -31
  49. package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +3 -12
  50. package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +12 -14
  51. package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +27 -4
  52. package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +0 -2
  53. package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
  54. package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +2 -2
  55. package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +16 -13
  56. package/lib/init/template/helm/subcharts/web-application/templating.md +16 -9
  57. package/lib/init/template/helm/subcharts/web-application/values.md +317 -379
  58. package/lib/init/template/helm/subcharts/web-application/values.schema.json +87 -107
  59. package/lib/init/template/helm/subcharts/web-application/values.yaml +28 -2
  60. package/lib/init/template/html5-repo/index.js +6 -29
  61. package/lib/init/template/java/index.js +1 -1
  62. package/lib/init/template/kibana-logging/files/mta.yaml.hbs +2 -1
  63. package/lib/init/template/kibana-logging/index.js +5 -8
  64. package/lib/init/template/lint/index.js +8 -8
  65. package/lib/init/template/mta/files/mta.yaml.hbs +3 -2
  66. package/lib/init/template/mta/index.js +3 -2
  67. package/lib/init/template/multitenancy/files/mta.yaml.hbs +25 -31
  68. package/lib/init/template/multitenancy/files/{java/mtxs-configmap.yaml → mtxs-configmap-java.yaml} +1 -1
  69. package/lib/init/template/multitenancy/files/{mtxs-configmap.yaml → mtxs-configmap-nodejs.yaml} +5 -1
  70. package/lib/init/template/multitenancy/files/package.json.hbs +28 -0
  71. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +21 -0
  72. package/lib/init/template/multitenancy/files/values.yaml.hbs +16 -9
  73. package/lib/init/template/multitenancy/index.js +51 -99
  74. package/lib/init/template/nodejs/files/.vscode/extensions.json +1 -2
  75. package/lib/init/template/nodejs/files/.vscode/launch.json +2 -2
  76. package/lib/init/template/nodejs/files/.vscode/tasks.json +2 -2
  77. package/lib/init/template/nodejs/files/package.json.hbs +2 -2
  78. package/lib/init/template/nodejs/index.js +4 -3
  79. package/lib/init/template/pipeline/index.js +3 -2
  80. package/lib/init/template/samples/index.js +5 -4
  81. package/lib/init/template/sqlite/files/package.json.hbs +19 -0
  82. package/lib/init/template/sqlite/index.js +11 -0
  83. package/lib/init/template/toggles/index.js +3 -5
  84. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -5
  85. package/lib/init/template/xsuaa/files/values.yaml.hbs +0 -2
  86. package/lib/init/template/xsuaa/index.js +14 -35
  87. package/lib/init/util/commandUtil.js +3 -2
  88. package/lib/init/util/fsUtil.js +19 -2
  89. package/lib/init/util/md5Tracking.js +36 -63
  90. package/lib/init/util/projectReader.js +12 -26
  91. package/lib/lint/Linter.js +0 -3
  92. package/lib/util/exec.js +2 -1
  93. package/lib/util/term.js +1 -1
  94. package/lib/watch/livereload-connect.js +5 -4
  95. package/lib/watch/livereload-server.js +3 -6
  96. package/lib/watch/node-watch.js +1 -1
  97. package/npm-shrinkwrap.json +569 -479
  98. package/package.json +4 -4
  99. package/readme.md +1 -1
  100. package/lib/client/subscription.js +0 -84
  101. package/lib/init/template/approuter/files/chart.yaml +0 -4
  102. package/lib/init/template/auditlog/files/auditlog.yaml +0 -4
  103. package/lib/init/template/destinations/files/destination.yaml +0 -4
  104. package/lib/init/template/enterprise-messaging/files/event-mesh.yaml +0 -4
  105. package/lib/init/template/hana/files/hana-deployer.yaml +0 -4
  106. package/lib/init/template/hana/files/hana.yaml +0 -4
  107. package/lib/init/template/html5-repo/files/html5-apps-deployer.yaml +0 -4
  108. package/lib/init/template/html5-repo/files/html5-apps-repo-host.yaml +0 -4
  109. package/lib/init/template/multitenancy/files/cds.package.json +0 -7
  110. package/lib/init/template/multitenancy/files/cds.package.json.hbs +0 -9
  111. package/lib/init/template/multitenancy/files/dependencies.package.json +0 -5
  112. package/lib/init/template/multitenancy/files/java/.cdsrc.json +0 -22
  113. package/lib/init/template/multitenancy/files/java/package.json +0 -33
  114. package/lib/init/template/multitenancy/files/saas-registry.yaml +0 -4
  115. package/lib/init/template/multitenancy/files/service-manager.yaml +0 -4
  116. package/lib/init/template/multitenancy/files/sidecar.yaml +0 -4
  117. package/lib/init/template/xsuaa/files/xsuaa.yaml +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "6.6.2",
3
+ "version": "6.7.1",
4
4
  "description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [
@@ -16,14 +16,14 @@
16
16
  },
17
17
  "main": "lib/index.js",
18
18
  "dependencies": {
19
- "@sap/cds": "^6.6.0",
19
+ "@sap/cds": "^6.7.0",
20
20
  "@sap/cds-foss": "^4",
21
- "@sap/cds-mtxs": "^1.6.0",
21
+ "@sap/cds-mtxs": "^1.7.0",
22
22
  "@sap/eslint-plugin-cds": "^2.6.0",
23
23
  "axios": ">=0.21",
24
24
  "eslint": "^8",
25
25
  "express": "^4.17.1",
26
- "livereload-js": "^4.0.0",
26
+ "livereload-js": "^4.0.1",
27
27
  "md5": "^2.3.0",
28
28
  "mustache": "^4.0.1",
29
29
  "node-watch": ">=0.7",
package/readme.md CHANGED
@@ -4,7 +4,7 @@ The command line client and development toolkit for the [SAP Cloud Application P
4
4
 
5
5
  See the [documentation](https://cap.cloud.sap/docs/get-started/) for more details.
6
6
 
7
- ## How to Obtain Support**
7
+ ## How to Obtain Support
8
8
 
9
9
  In case you find a bug, please report an [incident](https://cap.cloud.sap/docs/resources/#reporting-incidents) on SAP Support Portal.
10
10
 
@@ -1,84 +0,0 @@
1
- let cds;
2
- const BaseCommand = require('./base_command');
3
- const { CliError } = require('./helper/errors');
4
- const { ParamCollection } = require('./params');
5
- const AuthManager = require('./auth_manager');
6
- const { capitalize } = require('./helper/string_helper');
7
- const { debug } = require('./helper/logging');
8
-
9
- module.exports = class ToggleSubscription extends BaseCommand {
10
-
11
- /**
12
- * @param on {boolean} whether to switch subscription on
13
- */
14
- constructor(on) {
15
- super();
16
- const prefix = on ? '' : 'un';
17
- this.command = prefix + 'subscribe';
18
- this.gerund = prefix + 'subscribing';
19
- this.noun = prefix + 'subscription';
20
- this.preposition = on ? 'to' : 'from';
21
- }
22
-
23
- async run(paramValues, { tenant, local } = {}) {
24
- cds = require('../cds');
25
- let params = new ParamCollection(paramValues);
26
- params.set('skipToken', true); // Token would have insufficient scopes for this command.
27
- if (local) {
28
- // Connect to locally-served MTXS
29
- await this.runWithServer(params, tenant);
30
- } else {
31
- // Connect to running MTXS server
32
- params = await AuthManager.login(params.toEntries());
33
- if (!params.has('username')) {
34
- throw new CliError('Username is required if app URL is given.', { command: this.command });
35
- }
36
- await this.runClientOnly(params, tenant);
37
- }
38
- console.log(`${capitalize(this.noun)} successful.`);
39
- }
40
-
41
- async runClientOnly(params, tenant) {
42
- console.log(capitalize(this.gerund), { tenant }, this.preposition, { url: params.get('appUrl') });
43
- const url = `${params.get('appUrl')}/-/cds/deployment/${this.command}`;
44
- debug(`Sending request to ${url}`);
45
- try {
46
- await require('axios').post(url, { tenant }, params.get('reqAuth'));
47
- } catch (error) {
48
- BaseCommand.handleHttpError(error, params, { url });
49
- }
50
- }
51
-
52
- async runWithServer(params, tenant) {
53
- if (!this.hasMtEnv()) {
54
- throw new CliError('Local multitenant application environment with @sap/cds-mtxs module not found.', { command: this.command });
55
- }
56
-
57
- console.log(capitalize(this.gerund), { tenant });
58
- const { 'cds.xt.DeploymentService': deploymentService } = await cds.serve([
59
- '@sap/cds-mtxs/srv/deployment-service',
60
- '@sap/cds-mtxs/srv/model-provider'
61
- ]);
62
- cds.emit('served');
63
- if (this.command === 'unsubscribe') {
64
- // MTXS doesn't connect automatically because unsubscribe requires no schema changes
65
- await cds.connect.to('db');
66
- }
67
-
68
- await deploymentService[this.command](tenant);
69
-
70
- if (cds.db) {
71
- await cds.disconnect(cds.env.requires.multitenancy?.t0 ?? 't0'); // REVISIT: Ideally not necessary
72
- }
73
- }
74
-
75
- /**
76
- * Check for application environment.
77
- * Fails for edge cases (ignored for now):
78
- * - @sap/cds-mtx application with missing modules (no npm install)
79
- * - dev scenario with both @sap/cds-mtx and @sap/cds-mtxs installed
80
- */
81
- hasMtEnv() {
82
- return cds.requires.multitenancy && !cds.mtx;
83
- }
84
- }
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: web-application
3
- alias: approuter
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: auditlog
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: destination
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: event-mesh
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: content-deployment
3
- alias: hana-deployer
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: hana
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: content-deployment
3
- alias: html5-apps-deployer
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: html5-apps-repo-host
4
- version: 0.1.0
@@ -1,7 +0,0 @@
1
- {
2
- "cds": {
3
- "requires": {
4
- "multitenancy": true
5
- }
6
- }
7
- }
@@ -1,9 +0,0 @@
1
- {
2
- "cds": {
3
- "requires": {
4
- "[{{cap.for}}]": {
5
- "multitenancy": true
6
- }
7
- }
8
- }
9
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "@sap/cds-mtxs": "^1"
4
- }
5
- }
@@ -1,22 +0,0 @@
1
- {
2
- "build": {
3
- "target": ".",
4
- "tasks": [
5
- {
6
- "for": "java"
7
- },
8
- {
9
- "for": "mtx-sidecar"
10
- },
11
- {
12
- "for": "hana",
13
- "options": {
14
- "deploy-format": "hdbtable"
15
- }
16
- }
17
- ]
18
- },
19
- "requires": {
20
- "multitenancy": true
21
- }
22
- }
@@ -1,33 +0,0 @@
1
- {
2
- "name": "cap-mtx-sidecar",
3
- "dependencies": {
4
- "@sap/cds": "^6",
5
- "@sap/cds-mtxs": "^1",
6
- "@sap/xssec": "^3",
7
- "express": "^4",
8
- "hdb": "^0",
9
- "passport": "^0.6.0"
10
- },
11
- "devDependencies": {
12
- "sqlite3": "^5"
13
- },
14
- "scripts": {
15
- "start": "cds run",
16
- "build": "npm ci && npx -p @sap/cds-dk@^6 cds build ../.. --for mtx-sidecar --production && cd gen && npm ci"
17
- },
18
- "cds": {
19
- "requires": {
20
- "[production]": {
21
- "db": "hana-mt",
22
- "auth": "xsuaa"
23
- },
24
- "[development]": {
25
- "db": "sqlite",
26
- "auth": "dummy"
27
- },
28
- "cds.xt.ModelProviderService": "in-sidecar",
29
- "cds.xt.DeploymentService": true,
30
- "cds.xt.SaasProvisioningService": true
31
- }
32
- }
33
- }
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: saas-registry
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: service-manager
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: web-application
3
- alias: sidecar
4
- version: 0.1.0
@@ -1,4 +0,0 @@
1
- dependencies:
2
- - name: service-instance
3
- alias: xsuaa
4
- version: 0.1.0