@sap-ux/environment-check 0.16.86 → 0.17.2
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/archive/index.js +48 -61
- package/dist/archive/index.js.map +1 -1
- package/dist/checks/destination.js +64 -78
- package/dist/checks/destination.js.map +1 -1
- package/dist/checks/endpoint.js +40 -50
- package/dist/checks/endpoint.js.map +1 -1
- package/dist/checks/environment.js +132 -149
- package/dist/checks/environment.js.map +1 -1
- package/dist/checks/get-installed.js +116 -142
- package/dist/checks/get-installed.js.map +1 -1
- package/dist/checks/service-checks.js +120 -142
- package/dist/checks/service-checks.js.map +1 -1
- package/dist/checks/stored-system.js +60 -73
- package/dist/checks/stored-system.js.map +1 -1
- package/dist/checks/workspace.js +53 -69
- package/dist/checks/workspace.js.map +1 -1
- package/dist/cli/index.js +74 -91
- package/dist/cli/index.js.map +1 -1
- package/dist/i18n.js +11 -22
- package/dist/i18n.js.map +1 -1
- package/dist/output/markdown.js +9 -10
- package/dist/output/markdown.js.map +1 -1
- package/dist/output/string.js +4 -4
- package/dist/output/string.js.map +1 -1
- package/dist/output/zip.js +1 -2
- package/dist/output/zip.js.map +1 -1
- package/package.json +8 -8
package/dist/archive/index.js
CHANGED
|
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
@@ -52,42 +43,40 @@ const formatter_1 = require("../formatter");
|
|
|
52
43
|
* @param options.targetFileName - optional file name, defaults to project folder + timestamp + .zip
|
|
53
44
|
* @returns {*} {Promise<{ path: string; size: string }>}
|
|
54
45
|
*/
|
|
55
|
-
function archiveProject({ projectRoot, targetFolder, targetFileName }) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
: targetFileName + '.zip';
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
targetName = `${(0, path_1.basename)(projectRoot)}-${new Date()
|
|
72
|
-
.toISOString()
|
|
73
|
-
.replace('T', '')
|
|
74
|
-
.replace(':', '')
|
|
75
|
-
.substring(0, 14)}.zip`;
|
|
76
|
-
}
|
|
77
|
-
const targetPath = targetFolder ? (0, path_1.join)(targetFolder, targetName) : (0, path_1.join)((0, path_1.dirname)(projectRoot), targetName);
|
|
78
|
-
const writeStream = (0, fs_1.createWriteStream)(targetPath);
|
|
79
|
-
zip.pipe(writeStream);
|
|
80
|
-
zip.on('error', (error) => reject(error));
|
|
81
|
-
for (const file of fileList) {
|
|
82
|
-
zip.file((0, path_1.join)(projectRoot, file), { name: file });
|
|
83
|
-
}
|
|
84
|
-
writeStream.on('close', () => resolve({ path: targetPath, size: (0, formatter_1.byteNumberToSizeString)(zip.pointer()) }));
|
|
85
|
-
zip.finalize().catch((error) => reject(error));
|
|
46
|
+
async function archiveProject({ projectRoot, targetFolder, targetFileName }) {
|
|
47
|
+
if (!(0, fs_1.existsSync)(projectRoot)) {
|
|
48
|
+
return Promise.reject(new Error((0, i18n_1.t)('error.noProjectRoot', { projectRoot })));
|
|
49
|
+
}
|
|
50
|
+
const fileList = await getFileList(projectRoot);
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
try {
|
|
53
|
+
const zip = archiver.default('zip', { zlib: { level: 9 } });
|
|
54
|
+
let targetName = '';
|
|
55
|
+
if (typeof targetFileName === 'string') {
|
|
56
|
+
targetName = targetFileName.toLocaleLowerCase().endsWith('.zip')
|
|
57
|
+
? targetFileName
|
|
58
|
+
: targetFileName + '.zip';
|
|
86
59
|
}
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
else {
|
|
61
|
+
targetName = `${(0, path_1.basename)(projectRoot)}-${new Date()
|
|
62
|
+
.toISOString()
|
|
63
|
+
.replace('T', '')
|
|
64
|
+
.replace(':', '')
|
|
65
|
+
.substring(0, 14)}.zip`;
|
|
89
66
|
}
|
|
90
|
-
|
|
67
|
+
const targetPath = targetFolder ? (0, path_1.join)(targetFolder, targetName) : (0, path_1.join)((0, path_1.dirname)(projectRoot), targetName);
|
|
68
|
+
const writeStream = (0, fs_1.createWriteStream)(targetPath);
|
|
69
|
+
zip.pipe(writeStream);
|
|
70
|
+
zip.on('error', (error) => reject(error));
|
|
71
|
+
for (const file of fileList) {
|
|
72
|
+
zip.file((0, path_1.join)(projectRoot, file), { name: file });
|
|
73
|
+
}
|
|
74
|
+
writeStream.on('close', () => resolve({ path: targetPath, size: (0, formatter_1.byteNumberToSizeString)(zip.pointer()) }));
|
|
75
|
+
zip.finalize().catch((error) => reject(error));
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
reject(error);
|
|
79
|
+
}
|
|
91
80
|
});
|
|
92
81
|
}
|
|
93
82
|
exports.archiveProject = archiveProject;
|
|
@@ -98,24 +87,22 @@ exports.archiveProject = archiveProject;
|
|
|
98
87
|
* @param cwd - working directory, usually the project root
|
|
99
88
|
* @returns - list of files to add to the archive, relative to cwd
|
|
100
89
|
*/
|
|
101
|
-
function getFileList(cwd) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
skip
|
|
117
|
-
});
|
|
118
|
-
return files;
|
|
90
|
+
async function getFileList(cwd) {
|
|
91
|
+
const gitignorePath = (0, path_1.join)(cwd, '.gitignore');
|
|
92
|
+
const hasGitignore = (0, fs_1.existsSync)(gitignorePath);
|
|
93
|
+
const globPattern = hasGitignore ? ['**'] : ['**', '.cdsrc.json', '.extconfig.json'];
|
|
94
|
+
const dot = hasGitignore;
|
|
95
|
+
const ignores = hasGitignore
|
|
96
|
+
? `${(await fs_1.promises.readFile(gitignorePath)).toString()}\n**/.git`
|
|
97
|
+
: ['**/.env', '**/.git', '**/node_modules'];
|
|
98
|
+
const skip = hasGitignore ? undefined : ['**/node_modules/**'];
|
|
99
|
+
const files = await (0, glob_gitignore_1.glob)(globPattern, {
|
|
100
|
+
cwd,
|
|
101
|
+
dot,
|
|
102
|
+
ignore: (0, ignore_1.default)().add(ignores),
|
|
103
|
+
mark: true,
|
|
104
|
+
skip
|
|
119
105
|
});
|
|
106
|
+
return files;
|
|
120
107
|
}
|
|
121
108
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/archive/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/archive/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6D;AAC7D,+BAA+C;AAC/C,mDAAqC;AACrC,mDAAsC;AACtC,oDAA4B;AAC5B,kCAA4B;AAC5B,4CAAsD;AAQtD;;;;;;;;GAQG;AACI,KAAK,UAAU,cAAc,CAAC,EACjC,W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AM,aAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,WAAW;QACnE,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAI,EAAC,WAAW,EAAE;QAClC,GAAG;QACH,GAAG;QACH,MAAM,EAAE,IAAA,gBAAM,GAAE,CAAC,GAAG,CAAC,OAAO,CAAC;QAC7B,IAAI,EAAE,IAAI;QACV,IAAI;KACP,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -26,29 +17,27 @@ const service_checks_1 = require("./service-checks");
|
|
|
26
17
|
* @param password - password
|
|
27
18
|
* @returns messages and destination results
|
|
28
19
|
*/
|
|
29
|
-
function checkBASDestination(destination, username, password) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
});
|
|
20
|
+
async function checkBASDestination(destination, username, password) {
|
|
21
|
+
const logger = (0, logger_1.getLogger)();
|
|
22
|
+
const abapServiceProvider = (0, service_checks_1.getServiceProvider)(destination, username, password);
|
|
23
|
+
// catalog service request
|
|
24
|
+
const { messages: catalogMsgs, result: catalogServiceResult } = await (0, service_checks_1.checkCatalogServices)(abapServiceProvider, destination.Name);
|
|
25
|
+
logger.push(...catalogMsgs);
|
|
26
|
+
const html5DynamicDestination = !!destination['HTML5.DynamicDestination'];
|
|
27
|
+
if (!html5DynamicDestination) {
|
|
28
|
+
logger.push({
|
|
29
|
+
severity: "error" /* Severity.Error */,
|
|
30
|
+
text: (0, i18n_1.t)('error.missingDynamicDestProperty', { destination: destination.Name })
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const destinationResults = {
|
|
34
|
+
catalogService: catalogServiceResult,
|
|
35
|
+
HTML5DynamicDestination: html5DynamicDestination
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
messages: logger.getMessages(),
|
|
39
|
+
destinationResults
|
|
40
|
+
};
|
|
52
41
|
}
|
|
53
42
|
exports.checkBASDestination = checkBASDestination;
|
|
54
43
|
/**
|
|
@@ -66,52 +55,50 @@ exports.needsUsernamePassword = needsUsernamePassword;
|
|
|
66
55
|
*
|
|
67
56
|
* @returns messages, destinations
|
|
68
57
|
*/
|
|
69
|
-
function checkBASDestinations() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
58
|
+
async function checkBASDestinations() {
|
|
59
|
+
const logger = (0, logger_1.getLogger)();
|
|
60
|
+
const destinations = [];
|
|
61
|
+
let url;
|
|
62
|
+
// Reload request
|
|
63
|
+
try {
|
|
64
|
+
await axios_1.default.get((0, btp_utils_1.getAppStudioProxyURL)() + '/reload');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
logger.warn((0, i18n_1.t)('warning.reloadFailure'));
|
|
68
|
+
logger.debug((0, i18n_1.t)('info.urlRequestFailure', {
|
|
69
|
+
url: `${(0, btp_utils_1.getAppStudioProxyURL)() + '/reload'}`,
|
|
70
|
+
error: error.message,
|
|
71
|
+
errorObj: error.toJSON ? JSON.stringify(error.toJSON(), null, 4) : error
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
// Destinations request
|
|
75
|
+
try {
|
|
76
|
+
const basDestinations = await (0, btp_utils_1.listDestinations)();
|
|
77
|
+
for (const basDest in basDestinations) {
|
|
78
|
+
const destination = basDestinations[basDest];
|
|
79
|
+
destination.UrlServiceType = getUrlServiceTypeForDest(destination);
|
|
80
|
+
destinations.push(destination);
|
|
85
81
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
for (const basDest in basDestinations) {
|
|
90
|
-
const destination = basDestinations[basDest];
|
|
91
|
-
destination.UrlServiceType = getUrlServiceTypeForDest(destination);
|
|
92
|
-
destinations.push(destination);
|
|
93
|
-
}
|
|
94
|
-
const destinationNumber = Object.keys(destinations).length;
|
|
95
|
-
if (destinationNumber > 0) {
|
|
96
|
-
logger.info((0, i18n_1.t)('info.numDestinationsFound', { destinationNumber }));
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
logger.warn((0, i18n_1.t)('warning.noDestinationsFound'));
|
|
100
|
-
}
|
|
82
|
+
const destinationNumber = Object.keys(destinations).length;
|
|
83
|
+
if (destinationNumber > 0) {
|
|
84
|
+
logger.info((0, i18n_1.t)('info.numDestinationsFound', { destinationNumber }));
|
|
101
85
|
}
|
|
102
|
-
|
|
103
|
-
logger.
|
|
104
|
-
logger.debug((0, i18n_1.t)('info.urlRequestFailure', {
|
|
105
|
-
url: url,
|
|
106
|
-
error: error.message,
|
|
107
|
-
errorObj: error.toJSON ? JSON.stringify(error.toJSON(), null, 4) : error
|
|
108
|
-
}));
|
|
86
|
+
else {
|
|
87
|
+
logger.warn((0, i18n_1.t)('warning.noDestinationsFound'));
|
|
109
88
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
logger.error((0, i18n_1.t)('error.retrievingDestinations', { error: error.message }));
|
|
92
|
+
logger.debug((0, i18n_1.t)('info.urlRequestFailure', {
|
|
93
|
+
url: url,
|
|
94
|
+
error: error.message,
|
|
95
|
+
errorObj: error.toJSON ? JSON.stringify(error.toJSON(), null, 4) : error
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
messages: logger.getMessages(),
|
|
100
|
+
destinations
|
|
101
|
+
};
|
|
115
102
|
}
|
|
116
103
|
exports.checkBASDestinations = checkBASDestinations;
|
|
117
104
|
/**
|
|
@@ -121,10 +108,9 @@ exports.checkBASDestinations = checkBASDestinations;
|
|
|
121
108
|
* @returns - URL service type, like 'Full Service URL', 'Catalog Service', 'Partial URL'
|
|
122
109
|
*/
|
|
123
110
|
function getUrlServiceTypeForDest(destination) {
|
|
124
|
-
var _a, _b;
|
|
125
111
|
let urlServiceType = "Invalid URL" /* UrlServiceType.InvalidUrl */;
|
|
126
|
-
const odataGen = !!
|
|
127
|
-
const odataAbap = !!
|
|
112
|
+
const odataGen = !!destination.WebIDEUsage?.split(',').find((entry) => entry.trim() === 'odata_gen');
|
|
113
|
+
const odataAbap = !!destination.WebIDEUsage?.split(',').find((entry) => entry.trim() === 'odata_abap');
|
|
128
114
|
const fullUrl = destination.WebIDEAdditionalData === 'full_url';
|
|
129
115
|
if (odataGen && fullUrl && !odataAbap) {
|
|
130
116
|
urlServiceType = "Full Service URL" /* UrlServiceType.FullServiceUrl */;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destination.js","sourceRoot":"","sources":["../../src/checks/destination.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"destination.js","sourceRoot":"","sources":["../../src/checks/destination.ts"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,iDAA2E;AAC3E,sCAAsC;AAEtC,kCAA4B;AAC5B,qDAA4E;AAE5E;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CACrC,WAAqB,EACrB,QAA6B,EAC7B,QAA6B;IAE7B,MAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAE3B,MAAM,mBAAmB,GAAG,IAAA,mCAAkB,EAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEhF,0BAA0B;IAC1B,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,IAAA,qCAAoB,EACtF,mBAAmB,EACnB,WAAW,CAAC,IAAI,CACnB,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IAE5B,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAC1E,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC;YACR,QAAQ,8BAAgB;YACxB,IAAI,EAAE,IAAA,QAAC,EAAC,kCAAkC,EAAE,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;SACjF,CAAC,CAAC;IACP,CAAC;IAED,MAAM,kBAAkB,GAAoB;QACxC,cAAc,EAAE,oBAAoB;QACpC,uBAAuB,EAAE,uBAAuB;KACnD,CAAC;IAEF,OAAO;QACH,QAAQ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ACrG,MAAM,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,YAAY,CAAC,CAAC;IACvG,MAAM,OAAO,GAAG,WAAW,CAAC,oBAAoB,KAAK,UAAU,CAAC;IAEhE,IAAI,QAAQ,IAAI,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;QACpC,cAAc,yDAAgC,CAAC;IACnD,CAAC;SAAM,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;QAC5C,cAAc,2DAAmC,CAAC;IACtD,CAAC;SAAM,IAAI,QAAQ,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,cAAc,gDAA4B,CAAC;IAC/C,CAAC;IACD,OAAO,cAAc,CAAC;AAC1B,CAAC;AAdD,4DAcC"}
|
package/dist/checks/endpoint.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.checkEndpoint = exports.checkEndpoints = void 0;
|
|
13
4
|
const logger_1 = require("../logger");
|
|
@@ -20,25 +11,23 @@ const i18n_1 = require("../i18n");
|
|
|
20
11
|
*
|
|
21
12
|
* @returns messages, SAP systems
|
|
22
13
|
*/
|
|
23
|
-
function checkEndpoints() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
});
|
|
14
|
+
async function checkEndpoints() {
|
|
15
|
+
const logger = (0, logger_1.getLogger)();
|
|
16
|
+
let endpoints = [];
|
|
17
|
+
if ((0, btp_utils_1.isAppStudio)()) {
|
|
18
|
+
const { messages: basDestMsgs, destinations } = await (0, destination_1.checkBASDestinations)();
|
|
19
|
+
endpoints = destinations;
|
|
20
|
+
logger.push(...basDestMsgs);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const { messages: storedSysMsgs, storedSystems } = await (0, stored_system_1.checkStoredSystems)();
|
|
24
|
+
endpoints = storedSystems;
|
|
25
|
+
logger.push(...storedSysMsgs);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
messages: logger.getMessages(),
|
|
29
|
+
endpoints: endpoints
|
|
30
|
+
};
|
|
42
31
|
}
|
|
43
32
|
exports.checkEndpoints = checkEndpoints;
|
|
44
33
|
/**
|
|
@@ -49,28 +38,29 @@ exports.checkEndpoints = checkEndpoints;
|
|
|
49
38
|
* @param password - destination password
|
|
50
39
|
* @returns messages and sapSystem results
|
|
51
40
|
*/
|
|
52
|
-
function checkEndpoint(endpoint, username, password) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
41
|
+
async function checkEndpoint(endpoint, username, password) {
|
|
42
|
+
const logger = (0, logger_1.getLogger)();
|
|
43
|
+
logger.info((0, i18n_1.t)('info.checkingSapSystem', { sapSystem: endpoint.Name }));
|
|
44
|
+
let destinationResults;
|
|
45
|
+
let storedSystemResults;
|
|
46
|
+
if ((0, btp_utils_1.isAppStudio)()) {
|
|
47
|
+
const checkBASDestinationResult = await (0, destination_1.checkBASDestination)(endpoint, username, password);
|
|
48
|
+
destinationResults = checkBASDestinationResult.destinationResults;
|
|
49
|
+
logger.push(...checkBASDestinationResult.messages);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const checkStoredSystemResult = await (0, stored_system_1.checkStoredSystem)(endpoint);
|
|
53
|
+
storedSystemResults = checkStoredSystemResult.storedSystemResults;
|
|
54
|
+
logger.push(...checkStoredSystemResult.messages);
|
|
55
|
+
}
|
|
56
|
+
const endpointResults = {
|
|
57
|
+
...destinationResults,
|
|
58
|
+
...storedSystemResults
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
messages: logger.getMessages(),
|
|
62
|
+
endpointResults
|
|
63
|
+
};
|
|
74
64
|
}
|
|
75
65
|
exports.checkEndpoint = checkEndpoint;
|
|
76
66
|
//# sourceMappingURL=endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/checks/endpoint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/checks/endpoint.ts"],"names":[],"mappings":";;;AACA,sCAAsC;AACtC,iDAAgD;AAChD,+CAA0E;AAC1E,mDAAwE;AACxE,kCAA4B;AAE5B;;;;GAIG;AACI,KAAK,UAAU,cAAc;IAIhC,MAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC3B,IAAI,SAAS,GAAe,EAAE,CAAC;IAE/B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