@sap-ux/deploy-tooling 0.3.4 → 0.4.1
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/README.md +2 -0
- package/dist/base/deploy.js +17 -5
- package/dist/cli/config.js +3 -2
- package/dist/cli/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ Options:
|
|
|
57
57
|
--verbose verbose log output (default: false)
|
|
58
58
|
--destination <destination> Destination in SAP BTP pointing to an ABAP system
|
|
59
59
|
--url <target-url> URL of target ABAP system
|
|
60
|
+
--service (Optional) Alias for the target SAPUI5 Respository OData Service
|
|
60
61
|
--client <sap-client> Client number of target ABAP system
|
|
61
62
|
--cloud target is an ABAP Cloud system
|
|
62
63
|
--cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
|
|
@@ -89,6 +90,7 @@ Options:
|
|
|
89
90
|
--verbose verbose log output (default: false)
|
|
90
91
|
--destination <destination> Destination in SAP BTP pointing to an ABAP system
|
|
91
92
|
--url <target-url> URL of target ABAP system
|
|
93
|
+
--service (Optional) Alias for the target SAPUI5 Respository OData Service
|
|
92
94
|
--client <sap-client> Client number of target ABAP system
|
|
93
95
|
--cloud target is an ABAP Cloud system
|
|
94
96
|
--cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
|
package/dist/base/deploy.js
CHANGED
|
@@ -71,6 +71,15 @@ function createAbapCloudServiceProvider(options, target, noPrompt, logger) {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Checks if credentials are of basic auth type.
|
|
76
|
+
*
|
|
77
|
+
* @param authOpts credential options
|
|
78
|
+
* @returns boolean
|
|
79
|
+
*/
|
|
80
|
+
function isBasicAuth(authOpts) {
|
|
81
|
+
return !!authOpts && authOpts.password !== undefined;
|
|
82
|
+
}
|
|
74
83
|
/**
|
|
75
84
|
* Enhance axios options and create a service provider instance for an on-premise ABAP system.
|
|
76
85
|
*
|
|
@@ -86,12 +95,15 @@ function createAbapServiceProvider(options, target) {
|
|
|
86
95
|
}
|
|
87
96
|
if (!options.auth) {
|
|
88
97
|
const storedOpts = yield getCredentials(target);
|
|
89
|
-
if (storedOpts
|
|
98
|
+
if (isBasicAuth(storedOpts)) {
|
|
90
99
|
options.auth = {
|
|
91
100
|
username: storedOpts.username,
|
|
92
101
|
password: storedOpts.password
|
|
93
102
|
};
|
|
94
103
|
}
|
|
104
|
+
if (storedOpts === null || storedOpts === void 0 ? void 0 : storedOpts.serviceKeys) {
|
|
105
|
+
throw new Error('This is an ABAP Cloud system, please add the --cloud arg to ensure the correct deployment flow.');
|
|
106
|
+
}
|
|
95
107
|
}
|
|
96
108
|
return (0, axios_extension_1.createForAbap)(options);
|
|
97
109
|
});
|
|
@@ -104,7 +116,7 @@ function createAbapServiceProvider(options, target) {
|
|
|
104
116
|
* @returns service instance
|
|
105
117
|
*/
|
|
106
118
|
function createDeployService(config, logger) {
|
|
107
|
-
var _a, _b, _c;
|
|
119
|
+
var _a, _b, _c, _d;
|
|
108
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
121
|
let provider;
|
|
110
122
|
const options = {};
|
|
@@ -139,7 +151,7 @@ function createDeployService(config, logger) {
|
|
|
139
151
|
else {
|
|
140
152
|
throw new Error('Unable to handle the configuration in the current environment.');
|
|
141
153
|
}
|
|
142
|
-
return provider.getUi5AbapRepository();
|
|
154
|
+
return provider.getUi5AbapRepository((_d = config.target) === null || _d === void 0 ? void 0 : _d.service);
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
/**
|
|
@@ -259,7 +271,7 @@ function tryDeploy(service, config, logger, archive) {
|
|
|
259
271
|
logger.info('Deployment in TestMode completed. A successful TestMode execution does not necessarily mean that your upload will be successful.');
|
|
260
272
|
}
|
|
261
273
|
else {
|
|
262
|
-
logger.info('
|
|
274
|
+
logger.info('Deployment Successful.');
|
|
263
275
|
}
|
|
264
276
|
}
|
|
265
277
|
catch (error) {
|
|
@@ -298,7 +310,7 @@ function tryUndeploy(service, config, logger) {
|
|
|
298
310
|
logger.info('Undeployment in TestMode completed. A successful TestMode execution does not necessarily mean that your undeploy will be successful.');
|
|
299
311
|
}
|
|
300
312
|
else {
|
|
301
|
-
logger.info('
|
|
313
|
+
logger.info('Undeployment Successful.');
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
316
|
catch (error) {
|
package/dist/cli/config.js
CHANGED
|
@@ -133,7 +133,7 @@ function getServiceKey(options, targetUrl) {
|
|
|
133
133
|
* @returns merged target object
|
|
134
134
|
*/
|
|
135
135
|
function mergeTarget(baseTarget, options) {
|
|
136
|
-
var _a, _b, _c;
|
|
136
|
+
var _a, _b, _c, _d;
|
|
137
137
|
const targetUrl = (_a = options.url) !== null && _a !== void 0 ? _a : baseTarget === null || baseTarget === void 0 ? void 0 : baseTarget.url;
|
|
138
138
|
return {
|
|
139
139
|
url: targetUrl,
|
|
@@ -141,7 +141,8 @@ function mergeTarget(baseTarget, options) {
|
|
|
141
141
|
cloud: options.cloud !== undefined ? options.cloud : baseTarget === null || baseTarget === void 0 ? void 0 : baseTarget.cloud,
|
|
142
142
|
destination: (_c = options.destination) !== null && _c !== void 0 ? _c : baseTarget === null || baseTarget === void 0 ? void 0 : baseTarget.destination,
|
|
143
143
|
serviceKey: getServiceKey(options, targetUrl),
|
|
144
|
-
params: options.queryParams ? parseQueryParams(options.queryParams) : undefined
|
|
144
|
+
params: options.queryParams ? parseQueryParams(options.queryParams) : undefined,
|
|
145
|
+
service: (_d = options.service) !== null && _d !== void 0 ? _d : baseTarget === null || baseTarget === void 0 ? void 0 : baseTarget.service
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
/**
|
package/dist/cli/index.js
CHANGED
|
@@ -34,7 +34,8 @@ function createCommand(name) {
|
|
|
34
34
|
.addOption(new commander_1.Option('--destination <destination>', 'Destination in SAP BTP pointing to an ABAP system').conflicts('url'))
|
|
35
35
|
.addOption(new commander_1.Option('--url <target-url>', 'URL of target ABAP system').conflicts('destination'))
|
|
36
36
|
.addOption(new commander_1.Option('--client <sap-client>', 'Client number of target ABAP system').conflicts('destination'))
|
|
37
|
-
.addOption(new commander_1.Option('--cloud', '
|
|
37
|
+
.addOption(new commander_1.Option('--cloud', 'Target is an ABAP Cloud system').conflicts('destination'))
|
|
38
|
+
.addOption(new commander_1.Option('--service <service-path>', 'Target SAPUI5 Repository OData Service'))
|
|
38
39
|
.addOption(new commander_1.Option('--cloud-service-key <file-location>', 'JSON file location with the ABAP cloud service key.').conflicts('destination'))
|
|
39
40
|
.addOption(new commander_1.Option('--cloud-service-env', 'Read ABAP cloud service properties from environment variables or .env file').conflicts(['cloudServiceKey', 'destination']))
|
|
40
41
|
.option('--transport <transport-request>', 'Transport number to record the change in the ABAP system')
|
package/dist/types/index.d.ts
CHANGED
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.
|
|
12
|
+
"version": "0.4.1",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|