@sap/cds-dk 6.6.2 → 6.7.0
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 +24 -1
- package/bin/add.js +5 -3
- package/bin/build/all.js +1 -1
- package/bin/cds.js +10 -8
- package/bin/env.js +4 -6
- package/bin/login.js +6 -4
- package/bin/migrate.js +0 -1
- package/bin/repl.js +1 -1
- package/bin/serve.js +7 -0
- package/bin/subscribe.js +5 -5
- package/bin/unsubscribe.js +4 -5
- package/bin/upgrade.js +67 -0
- package/bin/watch.js +8 -5
- package/lib/bind/bindingManager.js +3 -2
- package/lib/bind/cfKeyProvider.js +7 -6
- package/lib/bind/userCdsrcJsonStorageProvider.js +5 -4
- package/lib/client/activate.js +4 -3
- package/lib/client/auth_manager.js +4 -3
- package/lib/client/base_command.js +7 -2
- package/lib/client/helper/cf_helper.js +12 -11
- package/lib/client/helper/dependency_helper.js +3 -2
- package/lib/client/helper/logging.js +0 -7
- package/lib/client/params.js +4 -2
- package/lib/client/settings_manager.js +35 -34
- package/lib/client/tenant_action.js +78 -0
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +4 -4
- package/lib/init/template/_merging/registry-mta.js +31 -46
- package/lib/init/template/approuter/files/mta.yaml.hbs +12 -8
- package/lib/init/template/approuter/files/xs-app.json.hbs +0 -3
- package/lib/init/template/approuter/index.js +26 -34
- package/lib/init/template/auditlog/files/mta.yaml.hbs +2 -1
- package/lib/init/template/auditlog/index.js +8 -21
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +4 -4
- package/lib/init/template/cf-manifest/index.js +2 -1
- package/lib/init/template/connectivity/index.js +4 -5
- package/lib/init/template/data/index.js +19 -22
- package/lib/init/template/destinations/index.js +5 -17
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +2 -1
- package/lib/init/template/enterprise-messaging/index.js +7 -19
- package/lib/init/template/extensibility/index.js +3 -1
- package/lib/init/template/hana/files/mta.yaml.hbs +4 -5
- package/lib/init/template/hana/index.js +49 -84
- package/lib/init/template/helm/chart/templates/_helpers.tpl +4 -1
- package/lib/init/template/helm/files/Chart.yaml.hbs +1 -4
- package/lib/init/template/helm/index.js +45 -13
- package/lib/init/template/html5-repo/index.js +6 -29
- package/lib/init/template/java/index.js +1 -1
- package/lib/init/template/kibana-logging/files/mta.yaml.hbs +2 -1
- package/lib/init/template/kibana-logging/index.js +5 -8
- package/lib/init/template/lint/index.js +8 -8
- package/lib/init/template/mta/files/mta.yaml.hbs +3 -2
- package/lib/init/template/mta/index.js +3 -2
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +25 -31
- package/lib/init/template/multitenancy/files/{java/mtxs-configmap.yaml → mtxs-configmap-java.yaml} +1 -1
- package/lib/init/template/multitenancy/files/{mtxs-configmap.yaml → mtxs-configmap-nodejs.yaml} +5 -1
- package/lib/init/template/multitenancy/files/package.json.hbs +28 -0
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +21 -0
- package/lib/init/template/multitenancy/files/values.yaml.hbs +15 -8
- package/lib/init/template/multitenancy/index.js +51 -99
- package/lib/init/template/nodejs/files/.vscode/extensions.json +1 -2
- package/lib/init/template/nodejs/files/.vscode/launch.json +2 -2
- package/lib/init/template/nodejs/files/.vscode/tasks.json +2 -2
- package/lib/init/template/nodejs/files/package.json.hbs +2 -2
- package/lib/init/template/nodejs/index.js +4 -3
- package/lib/init/template/pipeline/index.js +3 -2
- package/lib/init/template/samples/index.js +5 -4
- package/lib/init/template/sqlite/files/package.json.hbs +19 -0
- package/lib/init/template/sqlite/index.js +11 -0
- package/lib/init/template/toggles/index.js +3 -5
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -5
- package/lib/init/template/xsuaa/files/values.yaml.hbs +0 -2
- package/lib/init/template/xsuaa/index.js +14 -35
- package/lib/init/util/commandUtil.js +3 -2
- package/lib/init/util/fsUtil.js +19 -2
- package/lib/init/util/md5Tracking.js +36 -63
- package/lib/init/util/projectReader.js +12 -26
- package/lib/lint/Linter.js +0 -3
- package/lib/util/exec.js +2 -1
- package/lib/util/term.js +1 -1
- package/lib/watch/livereload-connect.js +5 -4
- package/lib/watch/livereload-server.js +3 -6
- package/lib/watch/node-watch.js +1 -1
- package/npm-shrinkwrap.json +553 -466
- package/package.json +4 -4
- package/readme.md +1 -1
- package/lib/client/subscription.js +0 -84
- package/lib/init/template/approuter/files/chart.yaml +0 -4
- package/lib/init/template/auditlog/files/auditlog.yaml +0 -4
- package/lib/init/template/destinations/files/destination.yaml +0 -4
- package/lib/init/template/enterprise-messaging/files/event-mesh.yaml +0 -4
- package/lib/init/template/hana/files/hana-deployer.yaml +0 -4
- package/lib/init/template/hana/files/hana.yaml +0 -4
- package/lib/init/template/html5-repo/files/html5-apps-deployer.yaml +0 -4
- package/lib/init/template/html5-repo/files/html5-apps-repo-host.yaml +0 -4
- package/lib/init/template/multitenancy/files/cds.package.json +0 -7
- package/lib/init/template/multitenancy/files/cds.package.json.hbs +0 -9
- package/lib/init/template/multitenancy/files/dependencies.package.json +0 -5
- package/lib/init/template/multitenancy/files/java/.cdsrc.json +0 -22
- package/lib/init/template/multitenancy/files/java/package.json +0 -33
- package/lib/init/template/multitenancy/files/saas-registry.yaml +0 -4
- package/lib/init/template/multitenancy/files/service-manager.yaml +0 -4
- package/lib/init/template/multitenancy/files/sidecar.yaml +0 -4
- 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.
|
|
3
|
+
"version": "6.7.0",
|
|
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.
|
|
19
|
+
"@sap/cds": "^6.7.0",
|
|
20
20
|
"@sap/cds-foss": "^4",
|
|
21
|
-
"@sap/cds-mtxs": "^1.
|
|
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.
|
|
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,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
|
-
}
|