@sap-ux/adp-tooling 0.18.112 → 0.18.113
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/btp/api.d.ts +22 -0
- package/dist/btp/api.js +63 -0
- package/dist/btp/index.d.ts +2 -0
- package/dist/btp/index.js +18 -0
- package/dist/cf/app/html5-repo.d.ts +1 -8
- package/dist/cf/app/html5-repo.js +7 -30
- package/dist/cf/services/cli.d.ts +27 -0
- package/dist/cf/services/cli.js +49 -0
- package/dist/cf/services/index.d.ts +1 -0
- package/dist/cf/services/index.js +1 -0
- package/dist/cf/services/ssh.d.ts +21 -0
- package/dist/cf/services/ssh.js +64 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/translations/adp-tooling.i18n.json +4 -1
- package/dist/types.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
+
import type { Uaa, BtpDestinationConfig } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Obtain an OAuth2 access token using the client credentials grant.
|
|
5
|
+
*
|
|
6
|
+
* @param uaa - UAA service credentials (clientid, clientsecret, url).
|
|
7
|
+
* @param logger - Optional logger.
|
|
8
|
+
* @returns OAuth2 access token.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getToken(uaa: Uaa, logger?: ToolsLogger): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Get a single destination's configuration from the BTP Destination Configuration API.
|
|
13
|
+
* Note: This calls the BTP Destination Configuration API, not the BAS listDestinations API.
|
|
14
|
+
*
|
|
15
|
+
* @param uri - Destination Configuration API base URI (e.g. https://destination-configuration.cfapps.us20.hana.ondemand.com).
|
|
16
|
+
* @param token - OAuth2 bearer token obtained via {@link getToken}.
|
|
17
|
+
* @param destinationName - Name of the destination to look up.
|
|
18
|
+
* @param logger - Optional logger.
|
|
19
|
+
* @returns The destinationConfiguration object (e.g. Name, ProxyType, URL, Authentication) or undefined on failure.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBtpDestinationConfig(uri: string, token: string, destinationName: string, logger?: ToolsLogger): Promise<BtpDestinationConfig | undefined>;
|
|
22
|
+
//# sourceMappingURL=api.d.ts.map
|
package/dist/btp/api.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getToken = getToken;
|
|
7
|
+
exports.getBtpDestinationConfig = getBtpDestinationConfig;
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const i18n_1 = require("../i18n");
|
|
10
|
+
/**
|
|
11
|
+
* Obtain an OAuth2 access token using the client credentials grant.
|
|
12
|
+
*
|
|
13
|
+
* @param uaa - UAA service credentials (clientid, clientsecret, url).
|
|
14
|
+
* @param logger - Optional logger.
|
|
15
|
+
* @returns OAuth2 access token.
|
|
16
|
+
*/
|
|
17
|
+
async function getToken(uaa, logger) {
|
|
18
|
+
const auth = Buffer.from(`${uaa.clientid}:${uaa.clientsecret}`);
|
|
19
|
+
const options = {
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
22
|
+
'Authorization': 'Basic ' + auth.toString('base64')
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const uri = `${uaa.url}/oauth/token`;
|
|
26
|
+
logger?.debug(`Requesting OAuth token from ${uri}`);
|
|
27
|
+
try {
|
|
28
|
+
const response = await axios_1.default.post(uri, 'grant_type=client_credentials', options);
|
|
29
|
+
logger?.debug('OAuth token obtained successfully');
|
|
30
|
+
return response.data['access_token'];
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
logger?.error(`Failed to obtain OAuth token from ${uri}: ${e.message}`);
|
|
34
|
+
throw new Error((0, i18n_1.t)('error.failedToGetAuthKey', { error: e.message }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get a single destination's configuration from the BTP Destination Configuration API.
|
|
39
|
+
* Note: This calls the BTP Destination Configuration API, not the BAS listDestinations API.
|
|
40
|
+
*
|
|
41
|
+
* @param uri - Destination Configuration API base URI (e.g. https://destination-configuration.cfapps.us20.hana.ondemand.com).
|
|
42
|
+
* @param token - OAuth2 bearer token obtained via {@link getToken}.
|
|
43
|
+
* @param destinationName - Name of the destination to look up.
|
|
44
|
+
* @param logger - Optional logger.
|
|
45
|
+
* @returns The destinationConfiguration object (e.g. Name, ProxyType, URL, Authentication) or undefined on failure.
|
|
46
|
+
*/
|
|
47
|
+
async function getBtpDestinationConfig(uri, token, destinationName, logger) {
|
|
48
|
+
const url = `${uri}/destination-configuration/v1/destinations/${encodeURIComponent(destinationName)}`;
|
|
49
|
+
logger?.debug(`Fetching BTP destination config for "${destinationName}" from ${url}`);
|
|
50
|
+
try {
|
|
51
|
+
const response = await axios_1.default.get(url, {
|
|
52
|
+
headers: { 'Authorization': `Bearer ${token}` }
|
|
53
|
+
});
|
|
54
|
+
const config = response.data?.destinationConfiguration;
|
|
55
|
+
logger?.debug(`Destination "${destinationName}" config: ProxyType=${config?.ProxyType}`);
|
|
56
|
+
return config;
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
logger?.error(`Failed to fetch destination config for "${destinationName}": ${e.message}`);
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
-
import type { HTML5Content, ServiceInfo,
|
|
3
|
-
/**
|
|
4
|
-
* Get the OAuth token from HTML5 repository.
|
|
5
|
-
*
|
|
6
|
-
* @param {Uaa} uaa UAA credentials
|
|
7
|
-
* @returns {Promise<string>} OAuth token
|
|
8
|
-
*/
|
|
9
|
-
export declare function getToken(uaa: Uaa): Promise<string>;
|
|
2
|
+
import type { HTML5Content, ServiceInfo, CfAppParams } from '../../types';
|
|
10
3
|
/**
|
|
11
4
|
* Download zip from HTML5 repository.
|
|
12
5
|
*
|
|
@@ -3,38 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getToken = getToken;
|
|
7
6
|
exports.downloadZip = downloadZip;
|
|
8
7
|
exports.getHtml5RepoCredentials = getHtml5RepoCredentials;
|
|
9
8
|
exports.downloadAppContent = downloadAppContent;
|
|
10
9
|
const axios_1 = __importDefault(require("axios"));
|
|
11
10
|
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
12
11
|
const i18n_1 = require("../../i18n");
|
|
13
|
-
const api_1 = require("
|
|
12
|
+
const api_1 = require("../../btp/api");
|
|
13
|
+
const api_2 = require("../services/api");
|
|
14
14
|
const HTML5_APPS_REPO_RUNTIME = 'html5-apps-repo-runtime';
|
|
15
|
-
/**
|
|
16
|
-
* Get the OAuth token from HTML5 repository.
|
|
17
|
-
*
|
|
18
|
-
* @param {Uaa} uaa UAA credentials
|
|
19
|
-
* @returns {Promise<string>} OAuth token
|
|
20
|
-
*/
|
|
21
|
-
async function getToken(uaa) {
|
|
22
|
-
const auth = Buffer.from(`${uaa.clientid}:${uaa.clientsecret}`);
|
|
23
|
-
const options = {
|
|
24
|
-
headers: {
|
|
25
|
-
'Content-Type': 'application/json',
|
|
26
|
-
'Authorization': 'Basic ' + auth.toString('base64')
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const uri = `${uaa.url}/oauth/token?grant_type=client_credentials`;
|
|
30
|
-
try {
|
|
31
|
-
const response = await axios_1.default.get(uri, options);
|
|
32
|
-
return response.data['access_token'];
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
throw new Error((0, i18n_1.t)('error.failedToGetAuthKey', { error: e.message }));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
15
|
/**
|
|
39
16
|
* Download zip from HTML5 repository.
|
|
40
17
|
*
|
|
@@ -68,17 +45,17 @@ async function downloadZip(token, appHostId, uri) {
|
|
|
68
45
|
*/
|
|
69
46
|
async function getHtml5RepoCredentials(spaceGuid, logger) {
|
|
70
47
|
try {
|
|
71
|
-
let serviceInfo = await (0,
|
|
48
|
+
let serviceInfo = await (0, api_2.getOrCreateServiceInstanceKeys)({
|
|
72
49
|
spaceGuids: [spaceGuid],
|
|
73
50
|
planNames: ['app-runtime'],
|
|
74
51
|
names: [HTML5_APPS_REPO_RUNTIME]
|
|
75
52
|
}, logger);
|
|
76
53
|
if (!serviceInfo?.serviceKeys?.length) {
|
|
77
|
-
const serviceName = await (0,
|
|
78
|
-
await (0,
|
|
54
|
+
const serviceName = await (0, api_2.getServiceNameByTags)(spaceGuid, ['html5-apps-repo-rt']);
|
|
55
|
+
await (0, api_2.createServiceInstance)('app-runtime', HTML5_APPS_REPO_RUNTIME, serviceName, {
|
|
79
56
|
logger
|
|
80
57
|
});
|
|
81
|
-
serviceInfo = await (0,
|
|
58
|
+
serviceInfo = await (0, api_2.getOrCreateServiceInstanceKeys)({ names: [HTML5_APPS_REPO_RUNTIME] }, logger);
|
|
82
59
|
if (!serviceInfo?.serviceKeys?.length) {
|
|
83
60
|
logger.debug((0, i18n_1.t)('error.noUaaCredentialsFoundForHtml5Repo'));
|
|
84
61
|
throw new Error((0, i18n_1.t)('error.cannotFindHtml5RepoRuntime'));
|
|
@@ -103,7 +80,7 @@ async function downloadAppContent(spaceGuid, parameters, logger) {
|
|
|
103
80
|
const appNameVersion = `${appName}-${appVersion}`;
|
|
104
81
|
try {
|
|
105
82
|
const { serviceKeys, serviceInstance } = await getHtml5RepoCredentials(spaceGuid, logger);
|
|
106
|
-
const token = await getToken(serviceKeys[0]?.credentials.uaa);
|
|
83
|
+
const token = await (0, api_1.getToken)(serviceKeys[0]?.credentials.uaa, logger);
|
|
107
84
|
const uri = `${serviceKeys[0]?.credentials.uri}/applications/content/${appNameVersion}?pathSuffixFilter=manifest.json,xs-app.json`;
|
|
108
85
|
const zip = await downloadZip(token, appHostId, uri);
|
|
109
86
|
let admZip;
|
|
@@ -37,4 +37,31 @@ export declare function updateServiceInstance(serviceInstanceName: string, param
|
|
|
37
37
|
* @returns {Promise<T>} The response.
|
|
38
38
|
*/
|
|
39
39
|
export declare function requestCfApi<T = unknown>(url: string): Promise<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Check whether a CF app exists.
|
|
42
|
+
*
|
|
43
|
+
* @param appName - CF app name.
|
|
44
|
+
* @returns True if the app exists.
|
|
45
|
+
*/
|
|
46
|
+
export declare function checkAppExists(appName: string): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Push a minimal no-route CF app from a given directory.
|
|
49
|
+
*
|
|
50
|
+
* @param appName - CF app name.
|
|
51
|
+
* @param appPath - Local path to push.
|
|
52
|
+
* @param args - Additional cf push arguments.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pushApp(appName: string, appPath: string, args?: string[]): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Enable SSH access on a CF app.
|
|
57
|
+
*
|
|
58
|
+
* @param appName - CF app name.
|
|
59
|
+
*/
|
|
60
|
+
export declare function enableSsh(appName: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Restart a CF app using rolling strategy.
|
|
63
|
+
*
|
|
64
|
+
* @param appName - CF app name.
|
|
65
|
+
*/
|
|
66
|
+
export declare function restartApp(appName: string): Promise<void>;
|
|
40
67
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cf/services/cli.js
CHANGED
|
@@ -5,6 +5,10 @@ exports.getServiceKeys = getServiceKeys;
|
|
|
5
5
|
exports.createServiceKey = createServiceKey;
|
|
6
6
|
exports.updateServiceInstance = updateServiceInstance;
|
|
7
7
|
exports.requestCfApi = requestCfApi;
|
|
8
|
+
exports.checkAppExists = checkAppExists;
|
|
9
|
+
exports.pushApp = pushApp;
|
|
10
|
+
exports.enableSsh = enableSsh;
|
|
11
|
+
exports.restartApp = restartApp;
|
|
8
12
|
const cf_tools_1 = require("@sap/cf-tools");
|
|
9
13
|
const i18n_1 = require("../../i18n");
|
|
10
14
|
const ENV = { env: { 'CF_COLOR': 'false' } };
|
|
@@ -141,4 +145,49 @@ async function requestCfApi(url) {
|
|
|
141
145
|
throw new Error((0, i18n_1.t)('error.failedToRequestCFAPI', { error: e.message }));
|
|
142
146
|
}
|
|
143
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Check whether a CF app exists.
|
|
150
|
+
*
|
|
151
|
+
* @param appName - CF app name.
|
|
152
|
+
* @returns True if the app exists.
|
|
153
|
+
*/
|
|
154
|
+
async function checkAppExists(appName) {
|
|
155
|
+
const result = await cf_tools_1.Cli.execute(['app', appName], ENV);
|
|
156
|
+
return result.exitCode === 0;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Push a minimal no-route CF app from a given directory.
|
|
160
|
+
*
|
|
161
|
+
* @param appName - CF app name.
|
|
162
|
+
* @param appPath - Local path to push.
|
|
163
|
+
* @param args - Additional cf push arguments.
|
|
164
|
+
*/
|
|
165
|
+
async function pushApp(appName, appPath, args = []) {
|
|
166
|
+
const result = await cf_tools_1.Cli.execute(['push', appName, '-p', appPath, ...args], ENV);
|
|
167
|
+
if (result.exitCode !== 0) {
|
|
168
|
+
throw new Error((0, i18n_1.t)('error.cfPushFailed', { appName, error: result.stderr }));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Enable SSH access on a CF app.
|
|
173
|
+
*
|
|
174
|
+
* @param appName - CF app name.
|
|
175
|
+
*/
|
|
176
|
+
async function enableSsh(appName) {
|
|
177
|
+
const result = await cf_tools_1.Cli.execute(['enable-ssh', appName], ENV);
|
|
178
|
+
if (result.exitCode !== 0) {
|
|
179
|
+
throw new Error((0, i18n_1.t)('error.cfEnableSshFailed', { appName, error: result.stderr }));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Restart a CF app using rolling strategy.
|
|
184
|
+
*
|
|
185
|
+
* @param appName - CF app name.
|
|
186
|
+
*/
|
|
187
|
+
async function restartApp(appName) {
|
|
188
|
+
const result = await cf_tools_1.Cli.execute(['restart', appName, '--strategy', 'rolling', '--no-wait'], ENV);
|
|
189
|
+
if (result.exitCode !== 0) {
|
|
190
|
+
throw new Error((0, i18n_1.t)('error.cfRestartFailed', { appName, error: result.stderr }));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
144
193
|
//# sourceMappingURL=cli.js.map
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api"), exports);
|
|
18
|
+
__exportStar(require("./ssh"), exports);
|
|
18
19
|
__exportStar(require("./cli"), exports);
|
|
19
20
|
__exportStar(require("./manifest"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
+
/**
|
|
3
|
+
* Default CF app name used for SSH tunneling to the connectivity proxy.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_TUNNEL_APP_NAME = "adp-ssh-tunnel-app";
|
|
6
|
+
/**
|
|
7
|
+
* Ensure a tunnel app exists in CF. If not found, deploy a minimal no-route app
|
|
8
|
+
* using the binary_buildpack with minimum memory so it can serve as an SSH target.
|
|
9
|
+
*
|
|
10
|
+
* @param appName - CF app name.
|
|
11
|
+
* @param logger - Logger instance.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ensureTunnelAppExists(appName: string, logger: ToolsLogger): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Enable SSH on a CF app and restart it.
|
|
16
|
+
*
|
|
17
|
+
* @param appName - CF app name.
|
|
18
|
+
* @param logger - Logger instance.
|
|
19
|
+
*/
|
|
20
|
+
export declare function enableSshAndRestart(appName: string, logger: ToolsLogger): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=ssh.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_TUNNEL_APP_NAME = void 0;
|
|
7
|
+
exports.ensureTunnelAppExists = ensureTunnelAppExists;
|
|
8
|
+
exports.enableSshAndRestart = enableSshAndRestart;
|
|
9
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
const cli_1 = require("./cli");
|
|
13
|
+
/**
|
|
14
|
+
* Default CF app name used for SSH tunneling to the connectivity proxy.
|
|
15
|
+
*/
|
|
16
|
+
exports.DEFAULT_TUNNEL_APP_NAME = 'adp-ssh-tunnel-app';
|
|
17
|
+
/**
|
|
18
|
+
* Ensure a tunnel app exists in CF. If not found, deploy a minimal no-route app
|
|
19
|
+
* using the binary_buildpack with minimum memory so it can serve as an SSH target.
|
|
20
|
+
*
|
|
21
|
+
* @param appName - CF app name.
|
|
22
|
+
* @param logger - Logger instance.
|
|
23
|
+
*/
|
|
24
|
+
async function ensureTunnelAppExists(appName, logger) {
|
|
25
|
+
if (await (0, cli_1.checkAppExists)(appName)) {
|
|
26
|
+
logger.info(`Tunnel app "${appName}" already exists.`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
logger.debug(`Tunnel app "${appName}" not found. Deploying minimal app...`);
|
|
30
|
+
const tmpDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'adp-tunnel-'));
|
|
31
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(tmpDir, '.keep'), '');
|
|
32
|
+
try {
|
|
33
|
+
await (0, cli_1.pushApp)(appName, tmpDir, [
|
|
34
|
+
'--no-route',
|
|
35
|
+
'-m',
|
|
36
|
+
'64M',
|
|
37
|
+
'-k',
|
|
38
|
+
'256M',
|
|
39
|
+
'-b',
|
|
40
|
+
'binary_buildpack',
|
|
41
|
+
'-c',
|
|
42
|
+
'sleep infinity',
|
|
43
|
+
'--health-check-type',
|
|
44
|
+
'process'
|
|
45
|
+
]);
|
|
46
|
+
logger.info(`Tunnel app "${appName}" deployed successfully.`);
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
node_fs_1.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Enable SSH on a CF app and restart it.
|
|
54
|
+
*
|
|
55
|
+
* @param appName - CF app name.
|
|
56
|
+
* @param logger - Logger instance.
|
|
57
|
+
*/
|
|
58
|
+
async function enableSshAndRestart(appName, logger) {
|
|
59
|
+
logger.info(`Enabling SSH on "${appName}"...`);
|
|
60
|
+
await (0, cli_1.enableSsh)(appName);
|
|
61
|
+
logger.info(`Restarting "${appName}"...`);
|
|
62
|
+
await (0, cli_1.restartApp)(appName);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=ssh.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./source"), exports);
|
|
|
23
23
|
__exportStar(require("./ui5"), exports);
|
|
24
24
|
__exportStar(require("./base/cf"), exports);
|
|
25
25
|
__exportStar(require("./cf"), exports);
|
|
26
|
+
__exportStar(require("./btp"), exports);
|
|
26
27
|
__exportStar(require("./base/helper"), exports);
|
|
27
28
|
__exportStar(require("./base/credentials"), exports);
|
|
28
29
|
__exportStar(require("./base/constants"), exports);
|
|
@@ -114,7 +114,10 @@
|
|
|
114
114
|
"noServiceInstanceNameFound": "No serviceInstanceName found in the app-variant-bundler-build configuration",
|
|
115
115
|
"noServiceKeysFoundForInstance": "No service keys found for service instance: {{serviceInstanceName}}",
|
|
116
116
|
"couldNotFetchServiceKeys": "Cannot fetch the service keys. Error: {{error}}",
|
|
117
|
-
"metadataFetchingNotSupportedForCF": "Metadata fetching is not supported for Cloud Foundry projects."
|
|
117
|
+
"metadataFetchingNotSupportedForCF": "Metadata fetching is not supported for Cloud Foundry projects.",
|
|
118
|
+
"cfPushFailed": "cf push failed for the '{{appName}}' app: {{error}}",
|
|
119
|
+
"cfEnableSshFailed": "cf enable-ssh failed for the '{{appName}}' app: {{error}}",
|
|
120
|
+
"cfRestartFailed": "cf restart failed for the '{{appName}}' app: {{error}}"
|
|
118
121
|
},
|
|
119
122
|
"choices": {
|
|
120
123
|
"true": "true",
|
package/dist/types.d.ts
CHANGED
|
@@ -834,6 +834,22 @@ export interface ServiceKeyCredentialsWithTags {
|
|
|
834
834
|
plan: string;
|
|
835
835
|
credentials: ServiceKeys['credentials'] | undefined;
|
|
836
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Destination configuration returned by the BTP Destination Configuration API.
|
|
839
|
+
* Contains the known properties; additional custom properties may also be present.
|
|
840
|
+
*/
|
|
841
|
+
export interface BtpDestinationConfig {
|
|
842
|
+
Name: string;
|
|
843
|
+
Type: string;
|
|
844
|
+
URL: string;
|
|
845
|
+
Authentication: string;
|
|
846
|
+
ProxyType: string;
|
|
847
|
+
Description?: string;
|
|
848
|
+
User?: string;
|
|
849
|
+
Password?: string;
|
|
850
|
+
'sap-client'?: string;
|
|
851
|
+
[key: string]: string | undefined;
|
|
852
|
+
}
|
|
837
853
|
export interface AppRouterEnvOptions {
|
|
838
854
|
'VCAP_SERVICES'?: Record<string, unknown>;
|
|
839
855
|
destinations?: {
|
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%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.18.
|
|
12
|
+
"version": "0.18.113",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|