@sap/cds-dk 7.4.0 → 7.5.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 (179) hide show
  1. package/bin/activate.js +1 -1
  2. package/bin/add.js +6 -4
  3. package/bin/build.js +10 -12
  4. package/bin/cds.js +4 -1
  5. package/bin/deploy/index.js +5 -2
  6. package/bin/eval.js +1 -1
  7. package/bin/extend.js +3 -3
  8. package/bin/login.js +2 -2
  9. package/bin/logout.js +1 -1
  10. package/bin/pull.js +1 -1
  11. package/bin/push.js +5 -5
  12. package/bin/subscribe.js +2 -2
  13. package/bin/unsubscribe.js +2 -2
  14. package/bin/upgrade.js +2 -2
  15. package/bin/version.js +2 -2
  16. package/bin/watch.js +1 -1
  17. package/lib/bind/bindingUtil.js +6 -3
  18. package/lib/bind/cfKeyProvider.js +1 -1
  19. package/lib/bind/userCdsrcJsonStorageProvider.js +1 -1
  20. package/lib/build/buildPlugin.js +6 -12
  21. package/lib/build/buildTaskEngine.js +24 -19
  22. package/lib/build/buildTaskFactory.js +27 -33
  23. package/lib/build/buildTaskProvider.js +1 -1
  24. package/lib/build/buildTaskProviderFactory.js +26 -41
  25. package/lib/build/constants.js +0 -1
  26. package/lib/build/index.js +3 -3
  27. package/lib/build/plugins.js +15 -15
  28. package/lib/build/provider/edmxBuildPlugin.js +6 -7
  29. package/lib/build/provider/fiori/index.js +8 -8
  30. package/lib/build/provider/hana/2migration.js +12 -16
  31. package/lib/build/provider/hana/index.js +5 -7
  32. package/lib/build/provider/hana/template/package.json +1 -1
  33. package/lib/build/provider/internalBuildPlugin.js +0 -8
  34. package/lib/build/provider/internalBuildTaskProvider.js +17 -21
  35. package/lib/build/provider/java/index.js +2 -1
  36. package/lib/build/provider/mtx-extension/index.js +8 -5
  37. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  38. package/lib/build/provider/nodejs/index.js +64 -58
  39. package/lib/compile/openapi/csdl2openapi.js +29 -15
  40. package/lib/compile/openapi/index.js +6 -6
  41. package/lib/deploy/to-hana/hana.js +5 -3
  42. package/lib/env/schema.js +2 -3
  43. package/lib/index.js +68 -28
  44. package/lib/init/add.js +17 -0
  45. package/lib/init/constants.js +5 -3
  46. package/lib/init/index.js +39 -25
  47. package/lib/init/{util/merge.js → merge.js} +32 -20
  48. package/lib/init/{util/mvn.js → mvn.js} +5 -5
  49. package/lib/init/plugin.js +85 -0
  50. package/lib/init/projectReader.js +145 -0
  51. package/lib/init/registries/mta.js +151 -0
  52. package/lib/init/template/{kibana → application-logging}/files/mta.yaml.hbs +3 -3
  53. package/lib/init/template/application-logging/index.js +49 -0
  54. package/lib/init/template/approuter/files/mta.yaml.hbs +11 -11
  55. package/lib/init/template/approuter/files/xs-app.json.hbs +2 -2
  56. package/lib/init/template/approuter/index.js +36 -81
  57. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
  58. package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +4 -4
  59. package/lib/init/template/cf-manifest/index.js +4 -4
  60. package/lib/init/template/connectivity/index.js +22 -35
  61. package/lib/init/template/data/index.js +3 -2
  62. package/lib/init/template/destination/files/values.yaml +9 -0
  63. package/lib/init/template/destination/index.js +15 -47
  64. package/lib/init/template/enterprise-messaging/index.js +26 -58
  65. package/lib/init/template/enterprise-messaging-shared/index.js +23 -39
  66. package/lib/init/template/extensibility/index.js +16 -30
  67. package/lib/init/template/file-based-messaging/index.js +7 -8
  68. package/lib/init/template/h2/index.js +4 -4
  69. package/lib/init/template/hana/files/mta.yaml.hbs +8 -8
  70. package/lib/init/template/hana/index.js +29 -115
  71. package/lib/init/template/helm/files/chart/templates/NOTES.txt +12 -0
  72. package/lib/init/template/helm/files/chart/templates/_deployment_helpers.tpl +82 -0
  73. package/lib/init/template/helm/files/chart/templates/_helpers.tpl +28 -0
  74. package/lib/init/template/helm/files/chart/values.root.schema.json +61 -0
  75. package/lib/init/template/helm/files/chart/values.schema.json +366 -0
  76. package/lib/init/template/helm/{subcharts → files}/web-application/Chart.yaml +1 -1
  77. package/lib/init/template/helm/{subcharts → files}/web-application/templates/_api.tpl +1 -1
  78. package/lib/init/template/helm/{subcharts → files}/web-application/values.yaml +1 -1
  79. package/lib/init/template/helm/index.js +84 -85
  80. package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +10 -0
  81. package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +26 -0
  82. package/lib/init/template/helm-unified-runtime/index.js +91 -0
  83. package/lib/init/template/helm-unified-runtime/lib/build.js +0 -0
  84. package/lib/init/template/helm-unified-runtime/package.json +4 -0
  85. package/lib/init/template/html5-repo/files/values.yaml.hbs +28 -0
  86. package/lib/init/template/html5-repo/index.js +23 -97
  87. package/lib/init/template/java/index.js +3 -3
  88. package/lib/init/template/lint/index.js +2 -2
  89. package/lib/init/template/liquibase/index.js +16 -0
  90. package/lib/init/template/local-messaging/index.js +7 -8
  91. package/lib/init/template/mta/index.js +7 -19
  92. package/lib/init/template/mtx/index.js +2 -2
  93. package/lib/init/template/multitenancy/index.js +38 -89
  94. package/lib/init/template/nodejs/index.js +5 -4
  95. package/lib/init/template/notebook/index.js +1 -1
  96. package/lib/init/template/notifications/index.js +16 -19
  97. package/lib/init/template/pipeline/index.js +1 -1
  98. package/lib/init/template/postgres/index.js +25 -31
  99. package/lib/init/template/redis-messaging/index.js +23 -27
  100. package/lib/init/template/sample/index.js +4 -4
  101. package/lib/init/template/samples/index.js +2 -2
  102. package/lib/init/template/sqlite/files/{package.json.hbs → package.json} +0 -2
  103. package/lib/init/template/sqlite/index.js +6 -10
  104. package/lib/init/template/tiny-sample/index.js +6 -6
  105. package/lib/init/template/toggles/index.js +7 -8
  106. package/lib/init/template/typer/index.js +6 -6
  107. package/lib/init/template/xsuaa/files/mta.yaml.hbs +3 -3
  108. package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -3
  109. package/lib/init/template/xsuaa/index.js +27 -52
  110. package/lib/init/{util/template.js → template.js} +1 -1
  111. package/lib/{client → mtx}/activate.js +15 -11
  112. package/lib/{client → mtx}/auth_manager.js +5 -4
  113. package/lib/{client → mtx}/download_legacy.js +6 -4
  114. package/lib/{client → mtx}/extend.js +14 -9
  115. package/lib/{client → mtx}/index.js +1 -1
  116. package/lib/{client → mtx}/params.js +4 -1
  117. package/lib/{client → mtx}/pull.js +6 -4
  118. package/lib/{client → mtx}/push.js +11 -10
  119. package/lib/{client → mtx}/settings_manager.js +8 -6
  120. package/lib/{client → mtx}/tenant_action.js +9 -8
  121. package/lib/{client/helper/cf_helper.js → mtx/util/cf.js} +4 -3
  122. package/lib/{client/helper/dependency_helper.js → mtx/util/dependencies.js} +1 -0
  123. package/lib/mtx/util/errors.js +27 -0
  124. package/lib/mtx/util/legacy_ext.js +16 -0
  125. package/lib/{client/helper/url_helper.js → mtx/util/urls.js} +12 -1
  126. package/lib/util/fs.js +5 -1
  127. package/lib/util/pruneAxiosErrors.js +35 -18
  128. package/lib/util/write.js +1 -1
  129. package/npm-shrinkwrap.json +27 -27
  130. package/package.json +10 -1
  131. package/lib/client/base_command.js +0 -54
  132. package/lib/init/template/_merging/registry-mta.js +0 -304
  133. package/lib/init/template/helm/Model.d.ts +0 -53
  134. package/lib/init/template/kibana/files/package.json.hbs +0 -17
  135. package/lib/init/template/kibana/index.js +0 -54
  136. package/lib/init/template/templateBase.js +0 -100
  137. package/lib/init/util/md5.js +0 -86
  138. package/lib/init/util/projectReader.js +0 -94
  139. /package/lib/init/{util/indent.js → indent.js} +0 -0
  140. /package/lib/init/template/helm/{subcharts → files}/content-deployment/Chart.yaml +0 -0
  141. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/_helpers.tpl +0 -0
  142. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/job.yaml +0 -0
  143. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/secret.yaml +0 -0
  144. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-account.yaml +0 -0
  145. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-binding.yaml +0 -0
  146. /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.schema.json +0 -0
  147. /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.yaml +0 -0
  148. /package/lib/init/template/helm/{subcharts → files}/service-instance/Chart.yaml +0 -0
  149. /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/_helpers.tpl +0 -0
  150. /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/serviceinstance.yaml +0 -0
  151. /package/lib/init/template/helm/{subcharts → files}/service-instance/values.schema.json +0 -0
  152. /package/lib/init/template/helm/{subcharts → files}/service-instance/values.yaml +0 -0
  153. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/NOTES.txt +0 -0
  154. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/_helpers.tpl +0 -0
  155. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/api-rule.yaml +0 -0
  156. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/deployment.yaml +0 -0
  157. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/network-policy.yaml +0 -0
  158. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/pod-disruption-budget.yaml +0 -0
  159. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/rbac.yaml +0 -0
  160. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/secret.yaml +0 -0
  161. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-account.yaml +0 -0
  162. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-binding.yaml +0 -0
  163. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service.yaml +0 -0
  164. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/virtual-service.yaml +0 -0
  165. /package/lib/init/template/helm/{subcharts → files}/web-application/values.schema.json +0 -0
  166. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/NOTES.txt +0 -0
  167. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_deployment_helpers.tpl +0 -0
  168. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_helpers.tpl +0 -0
  169. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.root.schema.json +0 -0
  170. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.schema.json +0 -0
  171. /package/lib/init/template/postgres/files/{mta.yaml.hbs → mta.yml.hbs} +0 -0
  172. /package/lib/init/{util/xml.js → xml.js} +0 -0
  173. /package/lib/{client/helper/env_helper.js → mtx/util/env.js} +0 -0
  174. /package/lib/{client/helper/fs_helper.js → mtx/util/fs.js} +0 -0
  175. /package/lib/{client/helper → mtx/util}/logging.js +0 -0
  176. /package/lib/{client/helper → mtx/util}/question.js +0 -0
  177. /package/lib/{client/helper/string_helper.js → mtx/util/strings.js} +0 -0
  178. /package/lib/util/{cfUtil.js → cf.js} +0 -0
  179. /package/lib/util/{gitUtil.js → git.js} +0 -0
@@ -11,26 +11,43 @@ require('axios').interceptors.response.use(
11
11
  axError => {
12
12
  const { inspect } = require('util');
13
13
  const { url, method } = axError.config ?? {};
14
- const { response = {} } = axError;
15
- const { status, statusText } = response;
16
- let { data } = response;
17
- if (Buffer.isBuffer(data)) {
18
- data = data.toString();
19
- try {
20
- data = JSON.parse(data);
21
- } catch (error) { /* unexpected; data will be included in error below */ }
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
+ }
22
49
  }
23
- const reason = data?.error /* RFC 6749 */ && (typeof data.error === 'string' ? data.error : inspect(data.error));
24
- const message = (url && method ? `${method.toUpperCase()} ${url} ` : '') +
25
- 'failed' +
26
- (status || statusText ? ':' : '') +
27
- (status ? ` ${status}` : '') +
28
- (statusText ? ` ${statusText}` : '') +
29
- (reason ? `. ${reason}` : '') +
30
- (data ? `. Details: '${data.error_description /* RFC 6749 */ || inspect(data)}'` : '');
31
50
 
32
- const error = stacklessError(message);
33
- error.status = status;
34
51
  if (require('../').debug('req')) {
35
52
  error.cause = axError;
36
53
  }
package/lib/util/write.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line no-unused-vars
2
- const USAGE = ()=>{ //NOSONAR
2
+ const USAGE = ()=>{
3
3
 
4
4
  // with a fully specified target file
5
5
  write ({foo:'bar'}) .to ('some/folder/foo.json')
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "7.4.0",
3
+ "version": "7.5.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "7.4.0",
9
+ "version": "7.5.0",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@sap/cds": "^7",
@@ -39,6 +39,13 @@
39
39
  "node": ">=0.10.0"
40
40
  }
41
41
  },
42
+ "node_modules/@cap-js/cds-types": {
43
+ "version": "0.1.0",
44
+ "license": "SEE LICENSE IN LICENSE",
45
+ "peerDependencies": {
46
+ "@sap/cds": ">=7"
47
+ }
48
+ },
42
49
  "node_modules/@eslint-community/eslint-utils": {
43
50
  "version": "4.4.0",
44
51
  "license": "MIT",
@@ -60,7 +67,7 @@
60
67
  }
61
68
  },
62
69
  "node_modules/@eslint/eslintrc": {
63
- "version": "2.1.3",
70
+ "version": "2.1.4",
64
71
  "license": "MIT",
65
72
  "dependencies": {
66
73
  "ajv": "^6.12.4",
@@ -100,7 +107,7 @@
100
107
  "license": "MIT"
101
108
  },
102
109
  "node_modules/@eslint/js": {
103
- "version": "8.53.0",
110
+ "version": "8.55.0",
104
111
  "license": "MIT",
105
112
  "engines": {
106
113
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -190,14 +197,6 @@
190
197
  "url": "https://github.com/sponsors/sindresorhus"
191
198
  }
192
199
  },
193
- "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": {
194
- "version": "6.3.1",
195
- "license": "ISC",
196
- "optional": true,
197
- "bin": {
198
- "semver": "bin/semver.js"
199
- }
200
- },
201
200
  "node_modules/@nodelib/fs.scandir": {
202
201
  "version": "2.1.5",
203
202
  "license": "MIT",
@@ -249,9 +248,10 @@
249
248
  }
250
249
  },
251
250
  "node_modules/@sap/cds": {
252
- "version": "7.4.0",
251
+ "version": "7.5.0",
253
252
  "license": "SEE LICENSE IN LICENSE",
254
253
  "dependencies": {
254
+ "@cap-js/cds-types": "<1",
255
255
  "@sap/cds-compiler": "^4",
256
256
  "@sap/cds-fiori": "^1",
257
257
  "@sap/cds-foss": "^5.0.0"
@@ -265,7 +265,7 @@
265
265
  }
266
266
  },
267
267
  "node_modules/@sap/cds-compiler": {
268
- "version": "4.4.0",
268
+ "version": "4.5.0",
269
269
  "license": "SEE LICENSE IN LICENSE",
270
270
  "dependencies": {
271
271
  "antlr4": "4.9.3"
@@ -280,7 +280,7 @@
280
280
  }
281
281
  },
282
282
  "node_modules/@sap/cds-fiori": {
283
- "version": "1.1.0",
283
+ "version": "1.2.2",
284
284
  "license": "SEE LICENSE IN LICENSE",
285
285
  "peerDependencies": {
286
286
  "@sap/cds": ">=7",
@@ -301,7 +301,7 @@
301
301
  }
302
302
  },
303
303
  "node_modules/@sap/cds-mtxs": {
304
- "version": "1.13.0",
304
+ "version": "1.14.0",
305
305
  "license": "SEE LICENSE IN LICENSE",
306
306
  "dependencies": {
307
307
  "@sap/hdi-deploy": "^4",
@@ -327,7 +327,7 @@
327
327
  }
328
328
  },
329
329
  "node_modules/@sap/hana-client": {
330
- "version": "2.18.24",
330
+ "version": "2.19.18",
331
331
  "hasInstallScript": true,
332
332
  "license": "SEE LICENSE IN developer-license-3_1.txt",
333
333
  "dependencies": {
@@ -338,7 +338,7 @@
338
338
  }
339
339
  },
340
340
  "node_modules/@sap/hdi": {
341
- "version": "4.5.1",
341
+ "version": "4.5.2",
342
342
  "license": "See LICENSE file",
343
343
  "dependencies": {
344
344
  "async": "3.2.3"
@@ -360,11 +360,11 @@
360
360
  }
361
361
  },
362
362
  "node_modules/@sap/hdi-deploy": {
363
- "version": "4.8.2",
363
+ "version": "4.9.1",
364
364
  "license": "See LICENSE file",
365
365
  "dependencies": {
366
- "@sap/hana-client": "2.18.24",
367
- "@sap/hdi": "4.5.1",
366
+ "@sap/hana-client": "2.19.18",
367
+ "@sap/hdi": "4.5.2",
368
368
  "@sap/xsenv": "3.4.0",
369
369
  "async": "3.2.3",
370
370
  "dotenv": "10.0.0",
@@ -989,13 +989,13 @@
989
989
  }
990
990
  },
991
991
  "node_modules/eslint": {
992
- "version": "8.53.0",
992
+ "version": "8.55.0",
993
993
  "license": "MIT",
994
994
  "dependencies": {
995
995
  "@eslint-community/eslint-utils": "^4.2.0",
996
996
  "@eslint-community/regexpp": "^4.6.1",
997
- "@eslint/eslintrc": "^2.1.3",
998
- "@eslint/js": "8.53.0",
997
+ "@eslint/eslintrc": "^2.1.4",
998
+ "@eslint/js": "8.55.0",
999
999
  "@humanwhocodes/config-array": "^0.11.13",
1000
1000
  "@humanwhocodes/module-importer": "^1.0.1",
1001
1001
  "@nodelib/fs.walk": "^1.2.8",
@@ -1420,7 +1420,7 @@
1420
1420
  }
1421
1421
  },
1422
1422
  "node_modules/globals": {
1423
- "version": "13.23.0",
1423
+ "version": "13.24.0",
1424
1424
  "license": "MIT",
1425
1425
  "dependencies": {
1426
1426
  "type-fest": "^0.20.2"
@@ -1637,7 +1637,7 @@
1637
1637
  }
1638
1638
  },
1639
1639
  "node_modules/ignore": {
1640
- "version": "5.2.4",
1640
+ "version": "5.3.0",
1641
1641
  "license": "MIT",
1642
1642
  "engines": {
1643
1643
  "node": ">= 4"
@@ -3016,7 +3016,7 @@
3016
3016
  "license": "ISC"
3017
3017
  },
3018
3018
  "node_modules/ws": {
3019
- "version": "8.14.2",
3019
+ "version": "8.15.1",
3020
3020
  "license": "MIT",
3021
3021
  "engines": {
3022
3022
  "node": ">=10.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "7.4.0",
3
+ "version": "7.5.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": [
@@ -40,5 +40,14 @@
40
40
  "npm-shrinkwrap.json",
41
41
  "LICENSE"
42
42
  ],
43
+ "overrides": {
44
+ "sqlite3": {
45
+ "@mapbox/node-pre-gyp": {
46
+ "make-dir": {
47
+ "semver": "^7"
48
+ }
49
+ }
50
+ }
51
+ },
43
52
  "_hasShrinkwrap": true
44
53
  }
@@ -1,54 +0,0 @@
1
- const path = require('path');
2
- const fs = require('fs').promises;
3
-
4
- require('../util/pruneAxiosErrors');
5
-
6
- const { getMessage } = require('./helper/logging');
7
-
8
- const MTX_URL_PATH_PREFIX = 'mtx/v1/model/';
9
- const CUSTOM_FILE_URL_SUFFIX = 'customTenantContent';
10
-
11
- module.exports = class BaseCommand {
12
-
13
- static get CUSTOM_FILE_URL_SUFFIX() { return CUSTOM_FILE_URL_SUFFIX; }
14
-
15
- static async checkProject(folder) {
16
- const exists = await fs.access(path.join(folder, 'package.json')).then(() => true).catch(() => false)
17
- return exists;
18
- }
19
-
20
- static handleHttpError(error, params, { url, command } = {}) {
21
- url = url ?? params.get('appUrl');
22
- const prefix = `Request to ${url} failed`;
23
- switch (error.status) {
24
- case 401:
25
- throw getMessage(`${prefix}: invalid authentication.\nRetry with valid passcode${
26
- params.has('passcodeUrl') ? ` from ${params.get('passcodeUrl')}` : ''
27
- } or username/password (required if SaaS app is configured with mocked-auth).`, { error, command });
28
- case 403:
29
- throw getMessage(prefix + ': insufficient authorization. Ensure client has all necessary roles.', { error, command });
30
- case 404:
31
- throw getMessage(prefix + ': resource not found.', { error, command });
32
- case 422:
33
- // Compilation or native-extension error.
34
- throw getMessage(prefix + '.', { error, command });
35
- default:
36
- // Unexpected error should be transparent to user.
37
- throw error;
38
- }
39
- }
40
-
41
- static concatUrls(...parts) {
42
- return parts
43
- .map((p, i) => i === 0
44
- ? p.replace(/\/$/ /*end slash*/, '')
45
- : i === parts.length - 1
46
- ? p.replace(/^\// /*begin slash*/, '')
47
- : p.replace(/^\/|\/$/g /*both*/, ''))
48
- .join('/');
49
- }
50
-
51
- static getMtxApiUrl(url, action) {
52
- return BaseCommand.concatUrls(url, MTX_URL_PATH_PREFIX, action);
53
- }
54
- }
@@ -1,304 +0,0 @@
1
- // Registry of sequence matchers in mta.yaml files
2
-
3
- const srvNode4 = path => ({
4
- in: 'modules',
5
- where: [{
6
- property: 'type',
7
- isEqualTo: 'nodejs',
8
- }, {
9
- property: 'path',
10
- isEqualTo: path
11
- }],
12
- })
13
-
14
- const srvJava4 = path => ({
15
- in: 'modules',
16
- where: [{
17
- property: 'type',
18
- isEqualTo: 'java'
19
- }, {
20
- property: 'path',
21
- isEqualTo: path
22
- }],
23
- })
24
-
25
- const approuter = {
26
- in: 'modules',
27
- where: [{
28
- property: 'type',
29
- isEqualTo: 'approuter.nodejs'
30
- }]
31
- }
32
-
33
- const xsuaa = {
34
- in: 'resources',
35
- where: [{
36
- property: 'parameters.service',
37
- isEqualTo: 'xsuaa',
38
- }]
39
- }
40
-
41
- const destination = {
42
- in: 'resources',
43
- where: [{
44
- property: 'type',
45
- isEqualTo: 'org.cloudfoundry.managed-service',
46
- }, {
47
- property: 'parameters.service',
48
- isEqualTo: 'destination',
49
- }]
50
- }
51
-
52
- const connectivity = {
53
- in: 'resources',
54
- where: [{
55
- property: 'type',
56
- isEqualTo: 'org.cloudfoundry.managed-service',
57
- }, {
58
- property: 'parameters.service',
59
- isEqualTo: 'connectivity',
60
- }]
61
- }
62
-
63
- const redis = {
64
- in: 'resources',
65
- where: [{
66
- property: 'type',
67
- isEqualTo: 'org.cloudfoundry.managed-service',
68
- }, {
69
- property: 'parameters.service',
70
- isEqualTo: 'redis-cache',
71
- }]
72
- }
73
-
74
- const enterpriseMessaging = {
75
- in: 'resources',
76
- where: [{
77
- property: 'type',
78
- isEqualTo: 'org.cloudfoundry.managed-service',
79
- }, {
80
- property: 'parameters.service',
81
- isEqualTo: 'enterprise-messaging',
82
- }]
83
- }
84
-
85
- const kibana = {
86
- in: 'resources',
87
- where: [{
88
- property: 'type',
89
- isEqualTo: 'org.cloudfoundry.managed-service',
90
- }, {
91
- property: 'parameters.service',
92
- isEqualTo: 'application-logs',
93
- }, {
94
- property: 'parameters.service-plan',
95
- isEqualTo: 'lite',
96
- }]
97
- }
98
-
99
- const hdbDeployer = {
100
- in: 'modules',
101
- where: [{
102
- property: 'type',
103
- isEqualTo: 'hdb'
104
- }]
105
- }
106
-
107
- const hdiContainer = {
108
- in: 'resources',
109
- where: [{
110
- property: 'type',
111
- isEqualTo: 'com.sap.xs.hdi-container',
112
- }]
113
- }
114
-
115
- const notificationTypesDeployer = {
116
- in: 'modules',
117
- where: [{
118
- property: 'name',
119
- isEqualTo: 'notification-content-deployment'
120
- }, {
121
- property: 'type',
122
- isEqualTo: 'nodejs'
123
- }]
124
- }
125
-
126
- const serviceManager = {
127
- in: 'resources',
128
- where: [{
129
- property: 'type',
130
- isEqualTo: 'org.cloudfoundry.managed-service',
131
- }, {
132
- property: 'parameters.service',
133
- isEqualTo: 'service-manager',
134
- }, {
135
- property: 'parameters.service-plan',
136
- isEqualTo: 'container'
137
- }]
138
- }
139
-
140
- const postgres = {
141
- in: 'resources',
142
- where: [{
143
- property: 'parameters.service',
144
- isEqualTo: 'postgresql-db',
145
- }]
146
- }
147
-
148
- const postgresDeployer = {
149
- in: 'modules',
150
- where: [{
151
- property: 'type',
152
- isEqualTo: 'nodejs',
153
- }, {
154
- property: 'path',
155
- isEqualTo: 'gen/pg',
156
- }]
157
- }
158
-
159
- const saasRegistry = {
160
- in: 'resources',
161
- where: [{
162
- property: 'type',
163
- isEqualTo: 'org.cloudfoundry.managed-service',
164
- }, {
165
- property: 'parameters.service',
166
- isEqualTo: 'saas-registry',
167
- }]
168
- }
169
-
170
- const srvApi4 = srv => ({
171
- in: [srv, 'provides'],
172
- where: [{
173
- property: 'name',
174
- isEqualTo: 'srv-api'
175
- }, {
176
- property: 'properties.srv-url',
177
- isEqualTo: '${default-url}'
178
- }]
179
- })
180
-
181
- const mtxSidecar4 = path => ({
182
- in: 'modules',
183
- where: [{
184
- property: 'type',
185
- isEqualTo: `nodejs`
186
- }, {
187
- property: 'path',
188
- isEqualTo: path // 'gen/mtx/sidecar' REVISIT: Same build destination for Java/Node.js would simplify this a lot
189
- }]
190
- })
191
-
192
- const providedMtxApiSidecar4 = mtxSidecar => ({
193
- in: [mtxSidecar, 'provides'],
194
- where: [{
195
- property: 'name',
196
- isEqualTo: 'mtx-api'
197
- }, {
198
- property: 'properties.mtx-url',
199
- isEqualTo: '${default-url}'
200
- }]
201
- })
202
-
203
- const requiredMtxApi = {
204
- in: [approuter, 'requires'],
205
- where: [{
206
- property: 'properties.name',
207
- isEqualTo: 'mtx-api'
208
- }, {
209
- property: 'properties.url',
210
- isEqualTo: '~{mtx-url}'
211
- }]
212
- }
213
-
214
- const providedAppApi = {
215
- in: [approuter, 'provides'],
216
- where: [{
217
- property: 'name',
218
- isEqualTo: 'app-api'
219
- }, {
220
- property: 'properties.app-protocol',
221
- isEqualTo: '${protocol}'
222
- }, {
223
- property: 'properties.app-uri',
224
- isEqualTo: '${default-uri}'
225
- }],
226
- }
227
-
228
- const requiredAppApi4 = module => ({
229
- in: [module, 'requires'],
230
- where: [{
231
- property: 'name',
232
- isEqualTo: 'app-api'
233
- }, {
234
- property: 'properties.SUBSCRIPTION_URL',
235
- isEqualTo: '~{app-protocol}://\\${tenant_subdomain}-~{app-uri}'
236
- }]
237
- })
238
-
239
- const requiredMtxSidecarApi4 = srv => ({
240
- in: [srv, 'requires'],
241
- where: [{
242
- property: 'properties.CDS_MULTITENANCY_SIDECAR_URL',
243
- isEqualTo: '~{mtx-url}'
244
- }]
245
- })
246
-
247
- const providedJavaApprouterApi4 = srv => ({
248
- in: [srv, 'requires'],
249
- where: [{
250
- property: 'properties.CDS_MULTITENANCY_APPUI_URL',
251
- isEqualTo: '~{url}'
252
- }]
253
- })
254
-
255
- const providedJavaApprouterApi = {
256
- in: [approuter, 'requires'],
257
- where: [{
258
- property: 'properties.url',
259
- isEqualTo: '${default-url}'
260
- }]
261
- }
262
-
263
- const approuterExtensibility = {
264
- in: 'routes',
265
- where: [{
266
- property: 'source',
267
- isEqualTo: '^/-/cds/.*'
268
- }, {
269
- property: 'destination',
270
- isEqualTo: 'mtx-api',
271
- }, {
272
- property: 'authenticationType',
273
- isEqualTo: 'none',
274
- }]
275
- }
276
-
277
- module.exports = {
278
- srvNode4,
279
- srvJava4,
280
- approuter,
281
- xsuaa,
282
- destination,
283
- connectivity,
284
- enterpriseMessaging,
285
- hdbDeployer,
286
- hdiContainer,
287
- notificationTypesDeployer,
288
- serviceManager,
289
- postgres,
290
- postgresDeployer,
291
- saasRegistry,
292
- redis,
293
- srvApi4,
294
- mtxSidecar4,
295
- providedMtxApiSidecar4,
296
- requiredMtxApi,
297
- requiredMtxSidecarApi4,
298
- providedAppApi,
299
- requiredAppApi4,
300
- providedJavaApprouterApi4,
301
- providedJavaApprouterApi,
302
- kibana,
303
- approuterExtensibility
304
- }
@@ -1,53 +0,0 @@
1
-
2
- /**
3
- * CDS Kubernetes Configuration
4
- */
5
- interface BaseConfig {
6
- /** image prefix */
7
- image: string,
8
- cloudService: string
9
- }
10
-
11
- interface RegistryConfig {
12
- imageRegistry: string
13
- }
14
-
15
- interface DeployConfig {
16
- releaseName: string,
17
- namespace: string,
18
- imagePullSecret: string,
19
- dbSecret: string,
20
- domain: string
21
- }
22
-
23
- interface Service {
24
- binding: string;
25
- name: string;
26
- label: string;
27
- }
28
-
29
- interface ApplicationModel {
30
- isJava: boolean;
31
- destinations: Map<string,string>; // Unfortunately today needed at build time
32
- services: Service[]; // Need to know if destination service is required?
33
- }
34
-
35
- interface BuildModel extends BaseConfig, ApplicationModel {
36
- }
37
-
38
- /**
39
- * Data required at image push and deploy time
40
- */
41
- interface PushModel extends BaseConfig, RegistryConfig {
42
- }
43
-
44
- /**
45
- * Data required at chart add time
46
- */
47
- interface AddChartModel extends BaseConfig, ApplicationModel {
48
- }
49
-
50
- interface Model extends BaseConfig, ApplicationModel {
51
- registry : RegistryConfig,
52
- deployment : DeployConfig
53
- }
@@ -1,17 +0,0 @@
1
- {
2
- {{#isNodejs}}
3
- "cds": {
4
- {{/isNodejs}}
5
- "features": {
6
- {{#profile}}
7
- "[{{profile}}]": {
8
- {{/profile}}
9
- "kibana_formatter": true
10
- {{#profile}}
11
- }
12
- {{/profile}}
13
- }
14
- {{#isNodejs}}
15
- }
16
- {{/isNodejs}}
17
- }