@sap-ux/deploy-tooling 0.11.3 → 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.
- package/dist/base/deploy.js +1 -3
- package/dist/base/validate.d.ts +2 -0
- package/dist/base/validate.js +27 -4
- package/package.json +3 -3
package/dist/base/deploy.js
CHANGED
|
@@ -238,9 +238,7 @@ function tryDeploy(provider, config, logger, archive) {
|
|
|
238
238
|
if ((0, config_1.isBspConfig)(config.app)) {
|
|
239
239
|
if (config.test === true) {
|
|
240
240
|
const validateOutput = yield (0, validate_1.validateBeforeDeploy)(config, provider, logger);
|
|
241
|
-
|
|
242
|
-
logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
|
|
243
|
-
}
|
|
241
|
+
logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
|
|
244
242
|
}
|
|
245
243
|
const service = getDeployService(provider.getUi5AbapRepository.bind(provider), config, logger);
|
|
246
244
|
yield service.deploy({ archive, bsp: config.app, testMode: config.test, safeMode: config.safe });
|
package/dist/base/validate.d.ts
CHANGED
|
@@ -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[];
|
|
@@ -45,6 +46,7 @@ export declare const summaryMessage: {
|
|
|
45
46
|
export declare function validateBeforeDeploy(config: AbapDeployConfig, provider: AbapServiceProvider, logger: Logger): Promise<ValidationOutput>;
|
|
46
47
|
/**
|
|
47
48
|
* Format a list of summary records that is ready to be printed on the console.
|
|
49
|
+
* The reduce function makes sure a EOL is added at the beginning of the output.
|
|
48
50
|
*
|
|
49
51
|
* @param summary A list of summary records
|
|
50
52
|
* @returns Formatted summary string
|
package/dist/base/validate.js
CHANGED
|
@@ -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);
|
|
@@ -65,6 +67,7 @@ function validateBeforeDeploy(config, provider, logger) {
|
|
|
65
67
|
exports.validateBeforeDeploy = validateBeforeDeploy;
|
|
66
68
|
/**
|
|
67
69
|
* Format a list of summary records that is ready to be printed on the console.
|
|
70
|
+
* The reduce function makes sure a EOL is added at the beginning of the output.
|
|
68
71
|
*
|
|
69
72
|
* @param summary A list of summary records
|
|
70
73
|
* @returns Formatted summary string
|
|
@@ -85,7 +88,7 @@ function formatSummary(summary) {
|
|
|
85
88
|
statusSymbol = (0, chalk_1.yellow)('?');
|
|
86
89
|
break;
|
|
87
90
|
}
|
|
88
|
-
return `${'
|
|
91
|
+
return `${' '.repeat(4)}${statusSymbol} ${next.message}`;
|
|
89
92
|
})
|
|
90
93
|
.reduce((aggregated, current) => {
|
|
91
94
|
return `${aggregated}${os_1.EOL}${current}`;
|
|
@@ -119,7 +122,7 @@ function validateInputTextFormat(input, output, provider, logger) {
|
|
|
119
122
|
processInputValidationResult(result, output);
|
|
120
123
|
result = (0, project_input_validator_1.validateClient)(input.client);
|
|
121
124
|
processInputValidationResult(result, output);
|
|
122
|
-
result = (
|
|
125
|
+
result = validateUrlForOnPremTargetOnly(input.destination, input.url);
|
|
123
126
|
processInputValidationResult(result, output);
|
|
124
127
|
// If all the text validation passed, only show the following success message.
|
|
125
128
|
if (output.result) {
|
|
@@ -130,6 +133,26 @@ function validateInputTextFormat(input, output, provider, logger) {
|
|
|
130
133
|
}
|
|
131
134
|
});
|
|
132
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
|
+
}
|
|
133
156
|
/**
|
|
134
157
|
* Helper function that calls ADT service to retrieve system specific prefix
|
|
135
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.
|
|
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.
|
|
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.
|
|
44
|
+
"@types/adm-zip": "0.5.3",
|
|
45
45
|
"@sap-ux/store": "0.4.0"
|
|
46
46
|
},
|
|
47
47
|
"ui5": {
|