@sap-ux/deploy-tooling 0.11.4 → 0.11.5

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.
@@ -8,6 +8,7 @@ export type ValidationInputs = {
8
8
  transport: string;
9
9
  client: string;
10
10
  url: string;
11
+ destination: string;
11
12
  };
12
13
  export type ValidationOutput = {
13
14
  summary: SummaryRecord[];
@@ -14,6 +14,7 @@ const axios_extension_1 = require("@sap-ux/axios-extension");
14
14
  const chalk_1 = require("chalk");
15
15
  const project_input_validator_1 = require("@sap-ux/project-input-validator");
16
16
  const os_1 = require("os");
17
+ const btp_utils_1 = require("@sap-ux/btp-utils");
17
18
  var SummaryStatus;
18
19
  (function (SummaryStatus) {
19
20
  SummaryStatus[SummaryStatus["Valid"] = 0] = "Valid";
@@ -41,7 +42,7 @@ exports.summaryMessage = {
41
42
  * @returns Validation result and a summary report of identified issues.
42
43
  */
43
44
  function validateBeforeDeploy(config, provider, logger) {
44
- var _a, _b, _c, _d, _e, _f;
45
+ var _a, _b, _c, _d, _e, _f, _g;
45
46
  return __awaiter(this, void 0, void 0, function* () {
46
47
  const output = {
47
48
  summary: [],
@@ -53,7 +54,8 @@ function validateBeforeDeploy(config, provider, logger) {
53
54
  package: (_c = config.app.package) !== null && _c !== void 0 ? _c : '',
54
55
  transport: (_d = config.app.transport) !== null && _d !== void 0 ? _d : '',
55
56
  client: (_e = config.target.client) !== null && _e !== void 0 ? _e : '',
56
- url: (_f = config.target.url) !== null && _f !== void 0 ? _f : ''
57
+ url: (_f = config.target.url) !== null && _f !== void 0 ? _f : '',
58
+ destination: (_g = config.target.destination) !== null && _g !== void 0 ? _g : ''
57
59
  };
58
60
  // output is passed by reference and status updated during the internal pipeline below.
59
61
  yield validateInputTextFormat(input, output, provider, logger);
@@ -86,7 +88,7 @@ function formatSummary(summary) {
86
88
  statusSymbol = (0, chalk_1.yellow)('?');
87
89
  break;
88
90
  }
89
- return `${' '}${statusSymbol} ${next.message}`;
91
+ return `${' '.repeat(4)}${statusSymbol} ${next.message}`;
90
92
  })
91
93
  .reduce((aggregated, current) => {
92
94
  return `${aggregated}${os_1.EOL}${current}`;
@@ -120,7 +122,7 @@ function validateInputTextFormat(input, output, provider, logger) {
120
122
  processInputValidationResult(result, output);
121
123
  result = (0, project_input_validator_1.validateClient)(input.client);
122
124
  processInputValidationResult(result, output);
123
- result = (0, project_input_validator_1.validateUrl)(input.url);
125
+ result = validateUrlForOnPremTargetOnly(input.destination, input.url);
124
126
  processInputValidationResult(result, output);
125
127
  // If all the text validation passed, only show the following success message.
126
128
  if (output.result) {
@@ -131,6 +133,26 @@ function validateInputTextFormat(input, output, provider, logger) {
131
133
  }
132
134
  });
133
135
  }
136
+ /**
137
+ * A wrapper of validateUrl(). It uses same logic in system-access module's createAbapServiceProvider()
138
+ * function to determine the deploy target. Only validate URL for on-prem ABAP deploy target.
139
+ *
140
+ * @param destination
141
+ * @param url
142
+ * @returns
143
+ */
144
+ function validateUrlForOnPremTargetOnly(destination, url) {
145
+ if ((0, btp_utils_1.isAppStudio)() && destination) {
146
+ // No validation required for destination name
147
+ return true;
148
+ }
149
+ else if (url) {
150
+ return (0, project_input_validator_1.validateUrl)(url);
151
+ }
152
+ else {
153
+ return 'Invalid deploy target';
154
+ }
155
+ }
134
156
  /**
135
157
  * Helper function that calls ADT service to retrieve system specific prefix
136
158
  * requirement for Fiori app name.
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Adeploy-tooling"
11
11
  },
12
- "version": "0.11.4",
12
+ "version": "0.11.5",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -37,11 +37,11 @@
37
37
  "@sap-ux/logger": "0.4.0",
38
38
  "@sap-ux/system-access": "0.3.3",
39
39
  "@sap-ux/ui5-config": "0.20.0",
40
- "@sap-ux/project-input-validator": "0.2.0"
40
+ "@sap-ux/project-input-validator": "0.2.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/prompts": "2.4.4",
44
- "@types/adm-zip": "0.5.2",
44
+ "@types/adm-zip": "0.5.3",
45
45
  "@sap-ux/store": "0.4.0"
46
46
  },
47
47
  "ui5": {