@sap-ux/environment-check 0.1.0
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/LICENSE +201 -0
- package/README.md +60 -0
- package/bin/envcheck +3 -0
- package/dist/checks/destination.d.ts +30 -0
- package/dist/checks/destination.d.ts.map +1 -0
- package/dist/checks/destination.js +264 -0
- package/dist/checks/destination.js.map +1 -0
- package/dist/checks/environment.d.ts +18 -0
- package/dist/checks/environment.d.ts.map +1 -0
- package/dist/checks/environment.js +175 -0
- package/dist/checks/environment.js.map +1 -0
- package/dist/checks/index.d.ts +3 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +11 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/project-utils.d.ts +17 -0
- package/dist/checks/project-utils.d.ts.map +1 -0
- package/dist/checks/project-utils.js +173 -0
- package/dist/checks/project-utils.js.map +1 -0
- package/dist/checks/workspace.d.ts +12 -0
- package/dist/checks/workspace.d.ts.map +1 -0
- package/dist/checks/workspace.js +91 -0
- package/dist/checks/workspace.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +181 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/formatter.d.ts +16 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +28 -0
- package/dist/formatter.js.map +1 -0
- package/dist/i18n.d.ts +14 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +50 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +29 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +49 -0
- package/dist/logger.js.map +1 -0
- package/dist/output/index.d.ts +3 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +15 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/markdown.d.ts +9 -0
- package/dist/output/markdown.d.ts.map +1 -0
- package/dist/output/markdown.js +243 -0
- package/dist/output/markdown.js.map +1 -0
- package/dist/output/zip.d.ts +19 -0
- package/dist/output/zip.d.ts.map +1 -0
- package/dist/output/zip.js +137 -0
- package/dist/output/zip.js.map +1 -0
- package/dist/translations/env-check.i18n.json +70 -0
- package/dist/types.d.ts +109 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @sap-ux/environment-check
|
|
2
|
+
|
|
3
|
+
Environment check for Business Application Studio destinations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
Npm
|
|
7
|
+
`npm install --save @sap-ux/environment-check`
|
|
8
|
+
|
|
9
|
+
Yarn
|
|
10
|
+
`yarn add @sap-ux/environment-check`
|
|
11
|
+
|
|
12
|
+
Pnpm
|
|
13
|
+
`pnpm add @sap-ux/environment-check`
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import {
|
|
19
|
+
getEnvironment,
|
|
20
|
+
checkBASDestinations,
|
|
21
|
+
checkBASDestination
|
|
22
|
+
} from '@sap/ux-environment-check';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Returns the environment, including ide, versions ...
|
|
26
|
+
*/
|
|
27
|
+
const environmentResults = await getEnvironment();
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Checks the destinations and returns a list
|
|
31
|
+
*/
|
|
32
|
+
const destinationResults = await checkBASDestinations();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Check a BAS destination for v2 & v4 catalog service
|
|
36
|
+
*/
|
|
37
|
+
const destResult = await checkBASDestination(destination, username, password);
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## CLI
|
|
42
|
+
|
|
43
|
+
A CLI application is also available to investigate the environment and destinations.
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
$ envcheck --help
|
|
49
|
+
|
|
50
|
+
Usage
|
|
51
|
+
$ envheck --destination <DESTINATION> --output <OUTPUT> <WORKSPACE_ROOT>
|
|
52
|
+
|
|
53
|
+
Options
|
|
54
|
+
--destination destination to perform deep check, multiple destionations can be passed
|
|
55
|
+
--output json | markdown | verbose | zip format for output, if not specified all messages except 'info' are shown
|
|
56
|
+
|
|
57
|
+
<WORKSPACE_ROOT*> path the root folder of a workspace. Multiple roots can be defined. We search for apps with destinations in workspaces
|
|
58
|
+
```
|
|
59
|
+
## Keywords
|
|
60
|
+
SAP Fiori Tools
|
package/bin/envcheck
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Destination, DestinationResults, ResultMessage } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Check a BAS destination, like catalog service v2 & v4.
|
|
4
|
+
*
|
|
5
|
+
* @param destination - Destination from list of all destinations
|
|
6
|
+
* @param username username
|
|
7
|
+
* @param password password
|
|
8
|
+
* @returns messages and destination results
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkBASDestination(destination: Destination, username?: string | undefined, password?: string | undefined): Promise<{
|
|
11
|
+
messages: ResultMessage[];
|
|
12
|
+
destinationResults: DestinationResults;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether a given destination requires username/password.
|
|
16
|
+
*
|
|
17
|
+
* @param destination - the destination to check
|
|
18
|
+
* @returns boolean if basic auth is required
|
|
19
|
+
*/
|
|
20
|
+
export declare function needsUsernamePassword(destination: Destination): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Checks the destinations and returns a list. Optionally, deep dive into a list of passed destinations.
|
|
23
|
+
*
|
|
24
|
+
* @returns messages, destinations
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkBASDestinations(): Promise<{
|
|
27
|
+
messages: ResultMessage[];
|
|
28
|
+
destinations: Destination[];
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=destination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination.d.ts","sourceRoot":"","sources":["../../src/checks/destination.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa/E;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACrC,WAAW,EAAE,WAAW,EACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAC9B,OAAO,CAAC;IAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAAC,kBAAkB,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAWhF;AA8GD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAEvE;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC;IAClD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,YAAY,EAAE,WAAW,EAAE,CAAC;CAC/B,CAAC,CAsDD"}
|
|
@@ -0,0 +1,264 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.checkBASDestinations = exports.needsUsernamePassword = exports.checkBASDestination = void 0;
|
|
16
|
+
const bas_sdk_1 = require("@sap/bas-sdk");
|
|
17
|
+
const axios_1 = __importDefault(require("axios"));
|
|
18
|
+
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
19
|
+
const logger_1 = require("../logger");
|
|
20
|
+
const formatter_1 = require("../formatter");
|
|
21
|
+
const i18n_1 = require("../i18n");
|
|
22
|
+
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
23
|
+
const catalogMessages = {
|
|
24
|
+
401: (destination, odataVersion) => i18n_1.t('error.401', { odataVersion, destination: destination.Name }),
|
|
25
|
+
403: (destination, odataVersion) => i18n_1.t('error.403', { odataVersion, destination: destination.Name })
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Check a BAS destination, like catalog service v2 & v4.
|
|
29
|
+
*
|
|
30
|
+
* @param destination - Destination from list of all destinations
|
|
31
|
+
* @param username username
|
|
32
|
+
* @param password password
|
|
33
|
+
* @returns messages and destination results
|
|
34
|
+
*/
|
|
35
|
+
function checkBASDestination(destination, username, password) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const logger = logger_1.getLogger();
|
|
38
|
+
logger.info(i18n_1.t('checkingDestination', { destination: destination.Name }));
|
|
39
|
+
const { messages, result: destinationResults } = yield checkCatalogServices(destination, username, password);
|
|
40
|
+
logger.push(...messages);
|
|
41
|
+
return {
|
|
42
|
+
messages: logger.getMessages(),
|
|
43
|
+
destinationResults
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.checkBASDestination = checkBASDestination;
|
|
48
|
+
/**
|
|
49
|
+
* Checks for services from catalog requests.
|
|
50
|
+
*
|
|
51
|
+
* @param destination sap detination
|
|
52
|
+
* @param username username
|
|
53
|
+
* @param password password
|
|
54
|
+
* @returns Result messages and results of catalog requests
|
|
55
|
+
*/
|
|
56
|
+
function checkCatalogServices(destination, username, password) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const messages = [];
|
|
59
|
+
const v2results = yield catalogRequest(axios_extension_1.ODataVersion.v2, destination, username, password);
|
|
60
|
+
messages.push(...v2results.messages);
|
|
61
|
+
const v4results = yield catalogRequest(axios_extension_1.ODataVersion.v4, destination, username, password);
|
|
62
|
+
messages.push(...v4results.messages);
|
|
63
|
+
const html5DynamicDestination = !!destination['HTML5.DynamicDestination'];
|
|
64
|
+
if (!html5DynamicDestination) {
|
|
65
|
+
messages.push({
|
|
66
|
+
severity: "error" /* Error */,
|
|
67
|
+
text: i18n_1.t('error.missingDynamicDestProperty', { destination: destination.Name })
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const result = {
|
|
71
|
+
v2: { results: v2results.result, status: v2results.responseStatus },
|
|
72
|
+
v4: { results: v4results.result, status: v4results.responseStatus },
|
|
73
|
+
HTML5DynamicDestination: html5DynamicDestination
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
messages,
|
|
77
|
+
result
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Performs a catalog request for the given odata version and destination.
|
|
83
|
+
*
|
|
84
|
+
* @param odataVersion odataVersion to be used
|
|
85
|
+
* @param destination destination to be checked
|
|
86
|
+
* @param username username
|
|
87
|
+
* @param password password
|
|
88
|
+
* @returns messages, catalog results, response status
|
|
89
|
+
*/
|
|
90
|
+
function catalogRequest(odataVersion, destination, username, password) {
|
|
91
|
+
var _a, _b, _c, _d;
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const logger = logger_1.getLogger();
|
|
94
|
+
let result;
|
|
95
|
+
let url;
|
|
96
|
+
let responseStatus;
|
|
97
|
+
try {
|
|
98
|
+
const auth = username !== undefined && password !== undefined
|
|
99
|
+
? {
|
|
100
|
+
username,
|
|
101
|
+
password
|
|
102
|
+
}
|
|
103
|
+
: undefined;
|
|
104
|
+
const axiosConfig = {
|
|
105
|
+
baseURL: destination.Host,
|
|
106
|
+
auth: auth
|
|
107
|
+
};
|
|
108
|
+
const provider = axios_extension_1.createForDestination(axiosConfig, destination);
|
|
109
|
+
const catalog = provider.catalog(odataVersion);
|
|
110
|
+
result = yield catalog.listServices();
|
|
111
|
+
if (result.length > 0) {
|
|
112
|
+
const numberOfServices = formatter_1.countNumberOfServices(result);
|
|
113
|
+
logger.info(i18n_1.t('info.numServicesForDestination', {
|
|
114
|
+
odataVersion,
|
|
115
|
+
destination: destination.Name,
|
|
116
|
+
numServicesForDest: formatter_1.getServiceCountText(numberOfServices)
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
responseStatus = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) || ((_b = error === null || error === void 0 ? void 0 : error.cause) === null || _b === void 0 ? void 0 : _b.status);
|
|
122
|
+
logger.error(catalogMessages[responseStatus]
|
|
123
|
+
? catalogMessages[responseStatus](destination, odataVersion)
|
|
124
|
+
: i18n_1.t('error.queryFailure', { odataVersion, destination: destination.Name }));
|
|
125
|
+
const errorJson = error.toJSON ? error.toJSON() : {};
|
|
126
|
+
if ((_d = (_c = errorJson === null || errorJson === void 0 ? void 0 : errorJson.config) === null || _c === void 0 ? void 0 : _c.auth) === null || _d === void 0 ? void 0 : _d.password) {
|
|
127
|
+
delete errorJson.config.auth.password;
|
|
128
|
+
}
|
|
129
|
+
logger.debug(i18n_1.t('error.urlRequestFailure', { url, error: error.message, errorObj: error }));
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
messages: logger.getMessages(),
|
|
133
|
+
result,
|
|
134
|
+
responseStatus
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Returns whether a given destination requires username/password.
|
|
140
|
+
*
|
|
141
|
+
* @param destination - the destination to check
|
|
142
|
+
* @returns boolean if basic auth is required
|
|
143
|
+
*/
|
|
144
|
+
function needsUsernamePassword(destination) {
|
|
145
|
+
return !!destination && destination.Authentication === 'NoAuthentication';
|
|
146
|
+
}
|
|
147
|
+
exports.needsUsernamePassword = needsUsernamePassword;
|
|
148
|
+
/**
|
|
149
|
+
* Checks the destinations and returns a list. Optionally, deep dive into a list of passed destinations.
|
|
150
|
+
*
|
|
151
|
+
* @returns messages, destinations
|
|
152
|
+
*/
|
|
153
|
+
function checkBASDestinations() {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
const logger = logger_1.getLogger();
|
|
156
|
+
const destinations = [];
|
|
157
|
+
let url;
|
|
158
|
+
// Reload request
|
|
159
|
+
try {
|
|
160
|
+
yield axios_1.default.get(btp_utils_1.getAppStudioProxyURL() + '/reload');
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
logger.warn(i18n_1.t('warning.reloadFailure'));
|
|
164
|
+
logger.debug(i18n_1.t('info.urlRequestFailure', {
|
|
165
|
+
url: `${btp_utils_1.getAppStudioProxyURL() + '/reload'}`,
|
|
166
|
+
error: error.message,
|
|
167
|
+
errorObj: error.toJSON ? JSON.stringify(error.toJSON(), null, 4) : error
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
// Destinations request
|
|
171
|
+
try {
|
|
172
|
+
let retrievedDestinations = [];
|
|
173
|
+
if (btp_utils_1.isAppStudio()) {
|
|
174
|
+
const response = yield bas_sdk_1.destinations.getDestinations();
|
|
175
|
+
retrievedDestinations = transformDestination(response);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
// Destination check for VSCode would go here
|
|
179
|
+
}
|
|
180
|
+
for (const destination of retrievedDestinations) {
|
|
181
|
+
destination.UrlServiceType = getUrlServiceTypeForDest(destination);
|
|
182
|
+
destinations.push(destination);
|
|
183
|
+
}
|
|
184
|
+
const destinationNumber = Object.keys(destinations).length;
|
|
185
|
+
if (destinationNumber > 0) {
|
|
186
|
+
logger.info(i18n_1.t('info.numDestinationsFound', { destinationNumber }));
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
logger.warn(i18n_1.t('warning.noDestinationsFound'));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
logger.error(i18n_1.t('error.retrievingDestinations', { error: error.message }));
|
|
194
|
+
logger.debug(i18n_1.t('info.urlRequestFailure', {
|
|
195
|
+
url: url,
|
|
196
|
+
error: error.message,
|
|
197
|
+
errorObj: error.toJSON ? JSON.stringify(error.toJSON(), null, 4) : error
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
messages: logger.getMessages(),
|
|
202
|
+
destinations
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
exports.checkBASDestinations = checkBASDestinations;
|
|
207
|
+
/**
|
|
208
|
+
* Return the URL service type for a given destination.
|
|
209
|
+
*
|
|
210
|
+
* @param destination - destination to check
|
|
211
|
+
* @returns - URL service type, like 'Full Service URL', 'Catalog Service', 'Partial URL'
|
|
212
|
+
*/
|
|
213
|
+
function getUrlServiceTypeForDest(destination) {
|
|
214
|
+
var _a, _b;
|
|
215
|
+
let urlServiceType = "Invalid URL" /* InvalidUrl */;
|
|
216
|
+
const odataGen = !!((_a = destination.WebIDEUsage) === null || _a === void 0 ? void 0 : _a.split(',').find((entry) => entry.trim() === 'odata_gen'));
|
|
217
|
+
const odataAbap = !!((_b = destination.WebIDEUsage) === null || _b === void 0 ? void 0 : _b.split(',').find((entry) => entry.trim() === 'odata_abap'));
|
|
218
|
+
const fullUrl = destination.WebIDEAdditionalData === 'full_url';
|
|
219
|
+
if (odataGen && fullUrl && !odataAbap) {
|
|
220
|
+
urlServiceType = "Full Service URL" /* FullServiceUrl */;
|
|
221
|
+
}
|
|
222
|
+
else if (!odataGen && !fullUrl && odataAbap) {
|
|
223
|
+
urlServiceType = "Catalog Service" /* CatalogServiceUrl */;
|
|
224
|
+
}
|
|
225
|
+
else if (odataGen && !fullUrl && !odataAbap) {
|
|
226
|
+
urlServiceType = "Partial URL" /* PartialUrl */;
|
|
227
|
+
}
|
|
228
|
+
return urlServiceType;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Transforms the destination format to align with @sap-ux/btp-utils Destination type.
|
|
232
|
+
*
|
|
233
|
+
* @param destinationInfo DestinationListInfo[] from '@sap/bas-sdk'
|
|
234
|
+
* @returns list of destinations in new (flat) format
|
|
235
|
+
*/
|
|
236
|
+
function transformDestination(destinationInfo) {
|
|
237
|
+
var _a, _b, _c, _d;
|
|
238
|
+
const destinations = [];
|
|
239
|
+
for (const destInfo of destinationInfo) {
|
|
240
|
+
const answerDestination = {
|
|
241
|
+
Name: destInfo.name,
|
|
242
|
+
Type: 'HTTP',
|
|
243
|
+
Authentication: destInfo.credentials.authentication,
|
|
244
|
+
ProxyType: destInfo.proxyType,
|
|
245
|
+
Description: destInfo.description,
|
|
246
|
+
Host: destInfo.host
|
|
247
|
+
};
|
|
248
|
+
if ((_a = destInfo.basProperties) === null || _a === void 0 ? void 0 : _a.additionalData) {
|
|
249
|
+
answerDestination.WebIDEAdditionalData = destInfo.basProperties.additionalData;
|
|
250
|
+
}
|
|
251
|
+
if ((_b = destInfo.basProperties) === null || _b === void 0 ? void 0 : _b.usage) {
|
|
252
|
+
answerDestination.WebIDEUsage = String(destInfo.basProperties.usage);
|
|
253
|
+
}
|
|
254
|
+
if ((_c = destInfo.basProperties) === null || _c === void 0 ? void 0 : _c.sapClient) {
|
|
255
|
+
answerDestination['sap-client'] = destInfo.basProperties.sapClient;
|
|
256
|
+
}
|
|
257
|
+
if (((_d = destInfo.basProperties) === null || _d === void 0 ? void 0 : _d.html5DynamicDestination) !== undefined) {
|
|
258
|
+
answerDestination['HTML5.DynamicDestination'] = destInfo.basProperties.html5DynamicDestination;
|
|
259
|
+
}
|
|
260
|
+
destinations.push(answerDestination);
|
|
261
|
+
}
|
|
262
|
+
return destinations;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=destination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination.js","sourceRoot":"","sources":["../../src/checks/destination.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,0CAA+D;AAC/D,kDAA0B;AAC1B,iDAAsE;AACtE,sCAAsC;AACtC,4CAA0E;AAG1E,kCAA4B;AAC5B,6DAA6E;AAG7E,MAAM,eAAe,GAAG;IACpB,GAAG,EAAE,CAAC,WAAwB,EAAE,YAA0B,EAAU,EAAE,CAClE,QAAC,CAAC,WAAW,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;IACnE,GAAG,EAAE,CAAC,WAAwB,EAAE,YAA0B,EAAU,EAAE,CAClE,QAAC,CAAC,WAAW,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;CACtE,CAAC;AAEF;;;;;;;GAOG;AACH,SAAsB,mBAAmB,CACrC,WAAwB,EACxB,QAA6B,EAC7B,QAA6B;;QAE7B,MAAM,MAAM,GAAG,kBAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,QAAC,CAAC,qBAA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CheckEnvironmentOptions, Environment, EnvironmentCheckResult, ResultMessage } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Return the environment.
|
|
4
|
+
*
|
|
5
|
+
* @returns environment, including ide, versions, ...
|
|
6
|
+
*/
|
|
7
|
+
export declare function getEnvironment(): Promise<{
|
|
8
|
+
environment: Environment;
|
|
9
|
+
messages: ResultMessage[];
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Check environment includes process.env, list of destinations, details about destinations.
|
|
13
|
+
*
|
|
14
|
+
* @param options - see type CheckEnvironmentOptions, includes destination for deep dive, workspace roots, ...
|
|
15
|
+
* @returns the result, currently as JSON
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkEnvironment(options?: CheckEnvironmentOptions): Promise<EnvironmentCheckResult>;
|
|
18
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/checks/environment.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAER,uBAAuB,EAEvB,WAAW,EACX,sBAAsB,EACtB,aAAa,EAChB,MAAM,UAAU,CAAC;AAIlB;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,CAAC,CAsBvG;AAuFD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA6BzG"}
|