@sap/cds-dk 6.0.2 → 6.0.3

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 CHANGED
@@ -6,6 +6,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  The format is based on [Keep a Changelog](http://keepachangelog.com/).
8
8
 
9
+ ## Version 6.0.3 - 2022-07-14
10
+
11
+ ### Changed
12
+
13
+ - `cds init` uses latest Maven Java archetype version 1.26.0 for creating Java projects.
14
+ - `cds init` now creates Node.js projects with version 6 of `@sap/cds`
15
+
16
+ ### Fixed
17
+
18
+ - `--vcap-file` parameter of `cds deploy` is available again (removed in 6.0.0)
19
+ - `cds add helm:connectivity`: `connectivity.configMapName` was not used for the `connectivity-proxy-info`.
20
+ - `cds add helm:connectivity`: Environment variables added for connectivity service for Java.
21
+ - `cds add helm`: Generation of `xs-security.json` file works on Windows now (`cds compile srv -2 xsuaa` command failed).
22
+
23
+
9
24
  ## Version 6.0.2 - 2022-07-06
10
25
 
11
26
  ### Changed
package/bin/cds.js CHANGED
@@ -67,8 +67,12 @@ const cli = { //NOSONAR
67
67
 
68
68
  const DEBUG = /\b(cli)\b/.test (process.env.DEBUG) && console.error
69
69
 
70
- function _local (id) {
71
- return require.resolve (id, {paths:[process.cwd(), __dirname]})
70
+ function _local (id, _else) {
71
+ try { return require.resolve (id, {paths:[process.cwd(), __dirname]}) }
72
+ catch(e) {
73
+ if (_else) return _else(e)
74
+ else throw e
75
+ }
72
76
  }
73
77
 
74
78
  function _defaultCompile (argv, _force) {
@@ -80,7 +84,7 @@ function _defaultCompile (argv, _force) {
80
84
 
81
85
  function _is_model (argv) {
82
86
  // IMPORTANT: have a separate env here, so that the normal one is not initialized before `cds_cli.args` above
83
- const env = require (_local('@sap/cds/lib/env')).for('cds')
87
+ const env = require (_local('@sap/cds/lib/env/cds-env', ()=>_local('@sap/cds/lib/env'))).for('cds')
84
88
  const cds = require (_local('@sap/cds'))
85
89
  return !!cds.resolve(argv,{env,cache:{}})
86
90
  }
@@ -1,5 +1,5 @@
1
1
  module.exports = Object.assign(deploy, {
2
- options: ['--to', '--tunnel-address'],
2
+ options: ['--to', '--tunnel-address', '--vcap-file'],
3
3
  flags: [ '--no-save', '--auto-undeploy', '--dry', '--with-mocks', '--store-credentials', '--bind' ],
4
4
  shortcuts: ['-2'],
5
5
  help: `
@@ -42,6 +42,12 @@ module.exports = Object.assign(deploy, {
42
42
  Deploy through the given address (host:port) rather than the original
43
43
  database address. The tunnel must have been opened before, e.g. using 'cf ssh'.
44
44
 
45
+ *--vcap-file* (beta feature)
46
+
47
+ Use credentials from the given file when deploying to *SAP HANA*, instead of
48
+ creating new credentials. File must be in *default-env.json* format, with a root
49
+ node *VCAP_SERVICES*.
50
+
45
51
  *--store-credentials* (only in combination with *--to hana*)
46
52
 
47
53
  Stores credentials in *default-env.json file*. This is the former default behavior
@@ -1,11 +1,10 @@
1
- const Config = require('@sap/cds/lib/env')
2
1
  const cds = require('../cds')
3
2
  const LOG = cds.log('bind');
4
3
  const resolveBinding = resolver(LOG);
5
4
  const { platformText, bindingText } = require('./bindingUtil');
6
5
 
7
6
  function getUnresolvedBindings({cwd = process.cwd(), env}) {
8
- if (!env) env = Config.for('cds', cwd)
7
+ if (!env) env = cds.env.for('cds', cwd)
9
8
  if (feature(env) === false || feature(env) === "false") return {}
10
9
 
11
10
  const bindings = {}
@@ -1,6 +1,6 @@
1
1
  const os = require('os');
2
2
 
3
- const MAVEN_ARCHETYPE_VERSION = '1.25.0';
3
+ const MAVEN_ARCHETYPE_VERSION = '1.26.0';
4
4
 
5
5
  const constants = {
6
6
  IS_WIN: (os.platform() === 'win32'),
@@ -8,7 +8,7 @@ const io = require("../../../lint/io");
8
8
  const readline = require("readline");
9
9
 
10
10
  const { OPTION_LINT_DEV, OPTION_LINT_GLOBAL } = require("../../constants");
11
- const { mkdirp, fs } = require("@sap/cds/lib/utils");
11
+ const { mkdirp, fs } = require("@sap/cds").utils;
12
12
  const { getConfigPath, getFileExtensions } = require("@sap/eslint-plugin-cds/lib/api");
13
13
  const generators = require("../../../lint/generators");
14
14
 
@@ -1,5 +1,5 @@
1
+ const cds = require('@sap/cds');
1
2
  const path = require('path');
2
- const Config = require('@sap/cds/lib/env');
3
3
 
4
4
  const TemplateUtil = require('../util/templateUtil');
5
5
 
@@ -59,7 +59,7 @@ module.exports = class TemplateBase {
59
59
  projectPath = this.cwd;
60
60
  }
61
61
 
62
- return Config.for('cds', projectPath);
62
+ return cds.env.for('cds', projectPath);
63
63
  }
64
64
 
65
65
  /**
@@ -1,7 +1,7 @@
1
1
  const path = require('path')
2
2
  const { nullLogger } = require('../util/logger')
3
3
  const { BuildTaskFactory } = require('@sap/cds/bin/build')
4
- const { fs } = require('@sap/cds/lib/utils')
4
+ const { fs } = require('@sap/cds').utils
5
5
  const P_LANGUAGE_JAVA = 'java'
6
6
  const P_LANGUAGE_NODEJS = 'nodejs'
7
7
  const DEFAULT_P_LANGUAGE = P_LANGUAGE_NODEJS
@@ -5,6 +5,12 @@ module.exports = wrapFeature('connectivity', {
5
5
  const model = await context.get('model');
6
6
  const prefix = model.app.name;
7
7
 
8
+ deployment.env = {
9
+ ...(deployment.env || {}),
10
+ CDS_ENVIRONMENT_K8S_SERVICEBINDINGS_CONNECTIVITY_SECRETSPATH: '/bindings/connectivity',
11
+ CDS_ENVIRONMENT_K8S_SERVICEBINDINGS_CONNECTIVITY_SERVICE: 'connectivity'
12
+ };
13
+
8
14
  deployment.additionalVolumes = deployment.additionalVolumes || [];
9
15
  deployment.additionalVolumes.push(
10
16
  {
@@ -1,8 +1,10 @@
1
- {{- $ := merge (dict "name" "connectivity-proxy-info") . }}
1
+ {{- if .Values.connectivity }}
2
+ {{- if or (not (hasKey .Values.connectivity "enabled")) .Values.connectivity.enabled }}
3
+ {{- $ := merge (dict "name" "connectivity-proxy-info") . }}
2
4
  apiVersion: v1
3
5
  kind: ConfigMap
4
6
  metadata:
5
- name: {{ .Release.Name }}-connectivity-proxy-info
7
+ name: {{ .Values.connectivity.configMapName }}
6
8
  namespace: {{ .Release.Namespace }}
7
9
  labels: {{- include "cap.labels" $ | nindent 4 }}
8
10
  data:
@@ -13,4 +15,6 @@ data:
13
15
  onpremise_proxy_ldap_port: "20001"
14
16
  onpremise_proxy_port: "20003"
15
17
  onpremise_proxy_rfc_port: "20001"
16
- onpremise_socks5_proxy_port: "20004"
18
+ onpremise_socks5_proxy_port: "20004"
19
+ {{- end }}
20
+ {{- end }}
@@ -1,12 +1,15 @@
1
- const { exec } = require("../../util/exec");
1
+ const cds = require('../../compile')
2
+ const Path = require('path');
2
3
 
3
4
  async function renderXsSecurityJson(projectPath) {
4
- const result = await exec({
5
- cwd: projectPath,
6
- stdio: ["inherit", "pipe", "inherit"],
7
- })`cds compile srv -2 xsuaa`;
8
- const xsSecurityJson = result.stdout;
9
- return xsSecurityJson;
5
+ const xsSecurityJson = await(async () => {
6
+ try {
7
+ const models = await cds.load(Path.join(projectPath, cds.env.folders.srv))
8
+ return cds.compile.to.xsuaa(models)
9
+ } catch (error) { /* ignore */ }
10
+ })() || { scopes: [], attributes: [], 'role-templates': [], 'authorities-inheritance': false }
11
+
12
+ return JSON.stringify(xsSecurityJson, null, 2);
10
13
  }
11
14
 
12
15
  module.exports = {
@@ -2,7 +2,7 @@ const fs = require("fs");
2
2
  const os = require("os");
3
3
  const cp = require("child_process");
4
4
  const path = require("path");
5
- const { mkdirp } = require("@sap/cds/lib/utils");
5
+ const { mkdirp } = require("@sap/cds").utils;
6
6
  const term = require("../util/term");
7
7
 
8
8
  const IS_WIN = os.platform() === "win32";
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "6.0.2",
9
+ "version": "6.0.3",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
- "@sap/cds": "^6.0.2",
12
+ "@sap/cds": "^6.0.3",
13
13
  "@sap/cds-foss": "^4",
14
14
  "@sap/eslint-plugin-cds": "^2.3.3",
15
15
  "axios": ">=0.21",
@@ -113,8 +113,8 @@
113
113
  }
114
114
  },
115
115
  "node_modules/@sap/cds": {
116
- "version": "6.0.2",
117
- "integrity": "sha512-h0aMcksxQAA+E6Xl9Lf1tNAGQdrC3NHdq9pwJhwXti5W9h11UHzO/1DrLqkzjcppkfRfziYcCWrzLoMOIrChzg==",
116
+ "version": "6.0.3",
117
+ "integrity": "sha512-NcOaFPK+1pTtedTARQ5qDhrYM/DEMZl41gRJnuXZ+e7ly/mU8HsV7sknMAywj4la47MJWWjOOxFiHvjZLWVkJw==",
118
118
  "dependencies": {
119
119
  "@sap/cds-compiler": ">=2.13.0",
120
120
  "@sap/cds-foss": ">=3"
@@ -330,8 +330,8 @@
330
330
  "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
331
331
  },
332
332
  "node_modules/big.js": {
333
- "version": "6.2.0",
334
- "integrity": "sha512-paIKvJiAaOYdLt6MfnvxkDo64lTOV257XYJyX3oJnJQocIclUn+48k6ZerH/c5FxWE6DGJu1TKDYis7tqHg9kg==",
333
+ "version": "6.2.1",
334
+ "integrity": "sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==",
335
335
  "engines": {
336
336
  "node": "*"
337
337
  },
@@ -2551,8 +2551,8 @@
2551
2551
  }
2552
2552
  },
2553
2553
  "@sap/cds": {
2554
- "version": "6.0.2",
2555
- "integrity": "sha512-h0aMcksxQAA+E6Xl9Lf1tNAGQdrC3NHdq9pwJhwXti5W9h11UHzO/1DrLqkzjcppkfRfziYcCWrzLoMOIrChzg==",
2554
+ "version": "6.0.3",
2555
+ "integrity": "sha512-NcOaFPK+1pTtedTARQ5qDhrYM/DEMZl41gRJnuXZ+e7ly/mU8HsV7sknMAywj4la47MJWWjOOxFiHvjZLWVkJw==",
2556
2556
  "requires": {
2557
2557
  "@sap/cds-compiler": ">=2.13.0",
2558
2558
  "@sap/cds-foss": ">=3"
@@ -2705,8 +2705,8 @@
2705
2705
  "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
2706
2706
  },
2707
2707
  "big.js": {
2708
- "version": "6.2.0",
2709
- "integrity": "sha512-paIKvJiAaOYdLt6MfnvxkDo64lTOV257XYJyX3oJnJQocIclUn+48k6ZerH/c5FxWE6DGJu1TKDYis7tqHg9kg=="
2708
+ "version": "6.2.1",
2709
+ "integrity": "sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ=="
2710
2710
  },
2711
2711
  "body-parser": {
2712
2712
  "version": "1.20.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
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,7 +16,7 @@
16
16
  },
17
17
  "main": "lib/index.js",
18
18
  "dependencies": {
19
- "@sap/cds": "^6.0.2",
19
+ "@sap/cds": "^6.0.3",
20
20
  "@sap/cds-foss": "^4",
21
21
  "@sap/eslint-plugin-cds": "^2.3.3",
22
22
  "axios": ">=0.21",