@sap/cds-dk 7.5.0 → 7.6.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.
Files changed (67) hide show
  1. package/bin/add.js +28 -24
  2. package/bin/bind.js +59 -32
  3. package/bin/build.js +1 -1
  4. package/bin/cds.js +1 -1
  5. package/bin/env.js +1 -6
  6. package/bin/init.js +7 -3
  7. package/bin/logout.js +2 -2
  8. package/bin/migrate.js +1 -1
  9. package/bin/version.js +1 -0
  10. package/bin/watch.js +8 -1
  11. package/lib/bind/bindingUtil.js +14 -20
  12. package/lib/bind/cfKeyProvider.js +9 -11
  13. package/lib/bind/index.js +4 -2
  14. package/lib/build/buildTaskFactory.js +31 -20
  15. package/lib/build/constants.js +9 -8
  16. package/lib/build/provider/featureToggleBuildPlugin.js +1 -7
  17. package/lib/build/provider/hana/index.js +44 -9
  18. package/lib/build/provider/internalBuildTaskProvider.js +7 -5
  19. package/lib/build/provider/java/index.js +0 -6
  20. package/lib/build/provider/mtx-extension/index.js +2 -1
  21. package/lib/build/provider/mtx-sidecar/index.js +5 -0
  22. package/lib/build/provider/nodejs/index.js +32 -47
  23. package/lib/build/util.js +134 -33
  24. package/lib/compile/openapi/csdl2openapi.js +1 -1
  25. package/lib/deploy/to-hana/hana.js +1 -1
  26. package/lib/env/schema.js +157 -17
  27. package/lib/env/schemas/cds-rc.js +118 -0
  28. package/lib/init/constants.js +1 -1
  29. package/lib/init/merge.js +2 -1
  30. package/lib/init/template/application-logging/index.js +1 -2
  31. package/lib/init/template/approuter/files/mta.yaml.hbs +2 -0
  32. package/lib/init/template/approuter/files/package.json +1 -1
  33. package/lib/init/template/approuter/files/values.yaml.hbs +8 -1
  34. package/lib/init/template/hana/files/undeploy.json +3 -2
  35. package/lib/init/template/helm/files/chart/templates/NOTES.txt +2 -0
  36. package/lib/init/template/helm/files/chart/templates/_deployment_helpers.tpl +10 -2
  37. package/lib/init/template/helm/files/content-deployment/Chart.yaml +1 -1
  38. package/lib/init/template/helm/files/content-deployment/templates/_helpers.tpl +6 -5
  39. package/lib/init/template/helm/files/content-deployment/values.yaml +1 -1
  40. package/lib/init/template/helm/files/service-instance/Chart.yaml +1 -1
  41. package/lib/init/template/helm/files/service-instance/templates/_helpers.tpl +6 -5
  42. package/lib/init/template/helm/files/service-instance/values.yaml +1 -1
  43. package/lib/init/template/helm/files/web-application/Chart.yaml +1 -1
  44. package/lib/init/template/helm/files/web-application/templates/_api.tpl +6 -5
  45. package/lib/init/template/helm/files/web-application/values.yaml +1 -1
  46. package/lib/init/template/helm/index.js +1 -12
  47. package/lib/init/template/helm-unified-runtime/index.js +3 -2
  48. package/lib/init/template/html5-repo/files/values.yaml.hbs +9 -0
  49. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +1 -2
  50. package/lib/init/template/multitenancy/index.js +3 -2
  51. package/lib/init/template/xsuaa/files/package.json.hbs +1 -2
  52. package/lib/mtx/activate.js +1 -1
  53. package/lib/mtx/auth_manager.js +4 -2
  54. package/lib/mtx/download_legacy.js +1 -1
  55. package/lib/mtx/extend.js +2 -2
  56. package/lib/mtx/pull.js +1 -1
  57. package/lib/mtx/push.js +1 -1
  58. package/lib/mtx/settings_manager.js +77 -26
  59. package/lib/mtx/tenant_action.js +1 -1
  60. package/lib/mtx/util/legacy_ext.js +0 -1
  61. package/lib/util/axios.js +66 -0
  62. package/lib/util/cf.js +15 -10
  63. package/npm-shrinkwrap.json +361 -167
  64. package/package.json +1 -1
  65. package/lib/env/schemas/cds-rc.json +0 -101
  66. package/lib/init/template/helm-unified-runtime/lib/build.js +0 -0
  67. package/lib/util/pruneAxiosErrors.js +0 -56
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "7.5.0",
3
+ "version": "7.6.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": [
@@ -1,101 +0,0 @@
1
- {
2
- "title": "JSON schema for CDS-DK configuration",
3
- "$schema": "https://json-schema.org/draft/2020-12/schema",
4
- "description": "This is a JSON schema representation for CDS project configuration",
5
- "type": "object",
6
- "additionalProperties": true,
7
- "properties": {
8
- "build": {
9
- "type": "object",
10
- "description": "Customize CDS build settings.",
11
- "additionalProperties": true,
12
- "properties": {
13
- "target": {
14
- "type": "string",
15
- "description": "Specify the folder which contains generated build results. Defaults to './gen'.",
16
- "format": "uri-reference"
17
- },
18
- "tasks": {
19
- "type": "array",
20
- "description": "Control which tasks 'cds build' will execute on your project modules. This is a typical task configuration: '\"tasks\": [{ \"for\": \"hana\"}];",
21
- "uniqueItems": true,
22
- "default": [
23
- {}
24
- ],
25
- "items": {
26
- "type": "object",
27
- "additionalProperties": true,
28
- "properties": {
29
- "dest": {
30
- "type": "string",
31
- "description": "Optional: Define the destination folder for this build task, relative to build target folder. \nFor example: Destination defined as 'custom' results in an output written to 'gen/custom'.",
32
- "format": "uri-reference"
33
- },
34
- "src": {
35
- "type": "string",
36
- "description": "Optional: Prefer defining 'cds.folders'. Use 'src' if you want it only to be valid for this specific build task, which excludes, for example, 'cds watch'.",
37
- "format": "uri-reference"
38
- },
39
- "for": {
40
- "type": "string",
41
- "description": "Define the target technology for this build task.",
42
- "minLength": 1,
43
- "enum": [
44
- "nodejs",
45
- "java",
46
- "hana",
47
- "mtx-sidecar",
48
- "mtx-extension",
49
- "mtx",
50
- "fiori",
51
- "node-cf",
52
- "java-cf"
53
- ]
54
- },
55
- "options": {
56
- "type": "object",
57
- "description": "Optional: Set target technology specific options for this build task.",
58
- "additionalProperties": true,
59
- "properties": {
60
- "model": {
61
- "$ref": "#/$defs/foldersStringArray"
62
- }
63
- }
64
- }
65
- }
66
- }
67
- }
68
- }
69
- },
70
- "deploy": {
71
- "type": "object",
72
- "description": "Customize 'cds deploy' settings.",
73
- "additionalProperties": true,
74
- "properties": {
75
- "no_save": {
76
- "type": "boolean",
77
- "description": "Do / don't update configuration in package.json.",
78
- "default": true
79
- }
80
- }
81
- }
82
- },
83
- "$defs": {
84
- "foldersStringArray": {
85
- "oneOf": [
86
- {
87
- "type": "string",
88
- "format": "uri-reference"
89
- },
90
- {
91
- "type": "array",
92
- "uniqueItems": true,
93
- "items": {
94
- "type": "string",
95
- "format": "uri-reference"
96
- }
97
- }
98
- ]
99
- }
100
- }
101
- }
@@ -1,56 +0,0 @@
1
- function stacklessError(message) {
2
- const { stackTraceLimit } = Error;
3
- Error.stackTraceLimit = 0;
4
- const error = new Error(message);
5
- Error.stackTraceLimit = stackTraceLimit;
6
- return error;
7
- }
8
-
9
- require('axios').interceptors.response.use(
10
- response => response,
11
- axError => {
12
- const { inspect } = require('util');
13
- const { url, method } = axError.config ?? {};
14
- const { errno, code, response = {} } = axError;
15
- const prefix = (url && method ? `${method.toUpperCase()} ${url} ` : '') + 'failed';
16
-
17
- let error;
18
- if (errno) {
19
- // System error during request.
20
- const message = prefix
21
- + `: ${errno} ${code}`
22
- + (code === 'ENOTFOUND' ? `. Make sure the URL is correct and the server is running.` : '');
23
- error = stacklessError(message);
24
- } else {
25
- // Error after request has been made.
26
- const { status, statusText } = response;
27
- let { data } = response;
28
- if (Buffer.isBuffer(data)) {
29
- data = data.toString();
30
- try {
31
- data = JSON.parse(data);
32
- } catch (error) { /* unexpected; data will be included in error below */
33
- }
34
- }
35
- const inspectData = data && !data.error_description;
36
- const reason = !inspectData && data?.error /* RFC 6749 */ && (typeof data.error === 'string' ? data.error : inspect(data.error));
37
- const details = inspectData ? inspect(data) : data?.error_description /* RFC 6749 */;
38
- const message = prefix +
39
- (status || statusText ? ':' : '') +
40
- (status ? ` ${status}` : '') +
41
- (statusText ? ` ${statusText}` : '') +
42
- (reason ? `. ${reason}` : '') +
43
- (details ? `. Details: ${details}` : '');
44
-
45
- error = stacklessError(message);
46
- if (status) {
47
- error.status = status;
48
- }
49
- }
50
-
51
- if (require('../').debug('req')) {
52
- error.cause = axError;
53
- }
54
- return Promise.reject(error);
55
- }
56
- );