@sap-ux/axios-extension 1.4.2 → 1.4.4

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.
@@ -41,11 +41,13 @@ export interface ErrorMessage {
41
41
  * @param options.msg message string returned from gateway
42
42
  * @param options.log logger to be used
43
43
  * @param options.host optional url that should logged as clickable url
44
+ * @param options.isDest optional destination flag
44
45
  */
45
- export declare function prettyPrintMessage({ msg, log, host }: {
46
+ export declare function prettyPrintMessage({ msg, log, host, isDest }: {
46
47
  msg: string;
47
48
  log: Logger;
48
49
  host?: string;
50
+ isDest?: boolean;
49
51
  }): void;
50
52
  /**
51
53
  * Log Gateway errors returned from the S_MGW_ODATA_INNER_ERROR table which is a store of OData Inner Error data. In certain flows,
@@ -33,12 +33,13 @@ function logLevel(severity, msg, log, error = false) {
33
33
  * @param options.msg message string returned from gateway
34
34
  * @param options.log logger to be used
35
35
  * @param options.host optional url that should logged as clickable url
36
+ * @param options.isDest optional destination flag
36
37
  */
37
- function prettyPrintMessage({ msg, log, host }) {
38
+ function prettyPrintMessage({ msg, log, host, isDest = false }) {
38
39
  try {
39
40
  const jsonMsg = JSON.parse(msg);
40
41
  log.info(jsonMsg.message);
41
- logFullURL({ host, path: jsonMsg['longtext_url'], log });
42
+ logFullURL({ host, path: jsonMsg['longtext_url'], log, isDest });
42
43
  if (jsonMsg.details) {
43
44
  jsonMsg.details.forEach((entry) => {
44
45
  logLevel(entry.severity, entry.message, log);
@@ -56,13 +57,17 @@ exports.prettyPrintMessage = prettyPrintMessage;
56
57
  * @param root0.host hostname
57
58
  * @param root0.path path
58
59
  * @param root0.log log
60
+ * @param root0.isDest destination
59
61
  */
60
- function logFullURL({ host, path, log }) {
62
+ function logFullURL({ host, path, log, isDest = false }) {
61
63
  if (host && path) {
62
64
  const base = new url_1.URL(host).origin; // We only care for the origin value
63
65
  // Add this instruction to the user because of this bug in VS Code: https://github.com/microsoft/vscode/issues/144898
64
66
  // It undoes the encoding of special characters in the URL sent to the browser
65
67
  log.info('Please copy/paste this URL in a browser for more details:');
68
+ if (isDest) {
69
+ log.info('(Note: You will need to replace the host in the URL with the internal host, if your destination is configured using an On-Premise SAP Cloud Connector)');
70
+ }
66
71
  log.info(new url_1.URL(path, base).href);
67
72
  }
68
73
  }
@@ -97,7 +97,12 @@ class Ui5AbapRepositoryService extends odata_service_1.ODataService {
97
97
  const response = yield this.updateRepoRequest(!!info, bsp.name, payload, config);
98
98
  // An app can be successfully deployed after a timeout exception, no value in showing exception headers
99
99
  if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a['sap-message']) {
100
- (0, message_1.prettyPrintMessage)({ msg: response.headers['sap-message'], log: this.log, host: frontendUrl });
100
+ (0, message_1.prettyPrintMessage)({
101
+ msg: response.headers['sap-message'],
102
+ log: this.log,
103
+ host: frontendUrl,
104
+ isDest: /\.dest\//.test(config.baseURL)
105
+ });
101
106
  }
102
107
  if (!testMode) {
103
108
  // log url of created/updated app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/axios-extension",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "axios": "1.4.0",
18
18
  "detect-content-type": "1.2.0",
19
- "fast-xml-parser": "4.2.5",
19
+ "fast-xml-parser": "4.2.7",
20
20
  "lodash": "4.17.21",
21
21
  "open": "7.0.3",
22
22
  "qs": "6.7.3",
@@ -26,10 +26,10 @@
26
26
  "@sap-ux/logger": "0.3.7"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/lodash": "4.14.176",
29
+ "@types/lodash": "4.14.197",
30
30
  "nock": "13.2.1",
31
- "supertest": "6.3.2",
32
- "@sap-ux/project-access": "1.13.0"
31
+ "supertest": "6.3.3",
32
+ "@sap-ux/project-access": "1.13.2"
33
33
  },
34
34
  "files": [
35
35
  "dist",