@sap-ux/odata-service-inquirer 2.4.13 → 2.4.15
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.
|
@@ -347,12 +347,6 @@ export declare class ConnectionValidator {
|
|
|
347
347
|
* Reset the validity state.
|
|
348
348
|
*/
|
|
349
349
|
private resetValidity;
|
|
350
|
-
/**
|
|
351
|
-
* Set the rejectUnauthorized option of the global https agent.
|
|
352
|
-
*
|
|
353
|
-
* @param rejectUnauthorized - true to reject unauthorized certificates, false to accept them
|
|
354
|
-
*/
|
|
355
|
-
static setGlobalRejectUnauthorized(rejectUnauthorized: boolean): void;
|
|
356
350
|
}
|
|
357
351
|
export {};
|
|
358
352
|
//# sourceMappingURL=connectionValidator.d.ts.map
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ConnectionValidator = void 0;
|
|
7
7
|
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
8
8
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
9
|
+
const nodejs_utils_1 = require("@sap-ux/nodejs-utils");
|
|
9
10
|
const inquirer_common_1 = require("@sap-ux/inquirer-common");
|
|
10
|
-
const https_1 = __importDefault(require("https"));
|
|
11
11
|
const i18n_1 = require("../i18n");
|
|
12
12
|
const types_1 = require("../types");
|
|
13
13
|
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
@@ -253,7 +253,7 @@ class ConnectionValidator {
|
|
|
253
253
|
// VSCode default extension proxy setting does not allow bypassing cert errors using httpsAgent (as used by Axios)
|
|
254
254
|
// so we must use globalAgent to bypass cert validation
|
|
255
255
|
if (ignoreCertError === true) {
|
|
256
|
-
|
|
256
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(!ignoreCertError);
|
|
257
257
|
}
|
|
258
258
|
if (isBAS) {
|
|
259
259
|
url.searchParams.append('saml2', 'disabled');
|
|
@@ -320,7 +320,7 @@ class ConnectionValidator {
|
|
|
320
320
|
if (await this.shouldIgnoreCertError(axiosConfig)) {
|
|
321
321
|
this._ignoreCertError = true;
|
|
322
322
|
axiosConfig.ignoreCertErrors = true;
|
|
323
|
-
|
|
323
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(false);
|
|
324
324
|
}
|
|
325
325
|
this._axiosConfig = axiosConfig;
|
|
326
326
|
this._serviceProvider = (0, axios_extension_1.create)(this._axiosConfig);
|
|
@@ -407,7 +407,7 @@ class ConnectionValidator {
|
|
|
407
407
|
if (await this.shouldIgnoreCertError(axiosConfig, odataVersion)) {
|
|
408
408
|
this._ignoreCertError = true;
|
|
409
409
|
axiosConfig.ignoreCertErrors = true;
|
|
410
|
-
|
|
410
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(false);
|
|
411
411
|
}
|
|
412
412
|
this._axiosConfig = axiosConfig;
|
|
413
413
|
this._serviceProvider = (0, axios_extension_1.createForAbap)(axiosConfig);
|
|
@@ -456,7 +456,7 @@ class ConnectionValidator {
|
|
|
456
456
|
// The v2 catalog was not available therefore cert errors will not have been seen (hidden by 404), only abap on prem uses axiosConfig directly
|
|
457
457
|
if (this._axiosConfig && (await this.shouldIgnoreCertError(this._axiosConfig, axios_extension_1.ODataVersion.v4))) {
|
|
458
458
|
this._ignoreCertError = true;
|
|
459
|
-
|
|
459
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(false);
|
|
460
460
|
this._axiosConfig = {
|
|
461
461
|
...this._axiosConfig,
|
|
462
462
|
ignoreCertErrors: true
|
|
@@ -880,21 +880,6 @@ class ConnectionValidator {
|
|
|
880
880
|
this._destinationUrl = undefined;
|
|
881
881
|
this._destination = undefined;
|
|
882
882
|
}
|
|
883
|
-
/**
|
|
884
|
-
* Set the rejectUnauthorized option of the global https agent.
|
|
885
|
-
*
|
|
886
|
-
* @param rejectUnauthorized - true to reject unauthorized certificates, false to accept them
|
|
887
|
-
*/
|
|
888
|
-
static setGlobalRejectUnauthorized(rejectUnauthorized) {
|
|
889
|
-
if (https_1.default.globalAgent.options) {
|
|
890
|
-
https_1.default.globalAgent.options.rejectUnauthorized = rejectUnauthorized;
|
|
891
|
-
}
|
|
892
|
-
//@ts-expect-error - fallbackAgent is only present in BoundHttpsProxyAgent implementation and is not part of the Node.js API
|
|
893
|
-
if (https_1.default.globalAgent.fallbackAgent) {
|
|
894
|
-
//@ts-expect-error - fallbackAgent is not typed in Node.js API
|
|
895
|
-
https_1.default.globalAgent.fallbackAgent.options.rejectUnauthorized = rejectUnauthorized;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
883
|
}
|
|
899
884
|
exports.ConnectionValidator = ConnectionValidator;
|
|
900
885
|
//# sourceMappingURL=connectionValidator.js.map
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.validateService = validateService;
|
|
7
7
|
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
8
8
|
const inquirer_common_1 = require("@sap-ux/inquirer-common");
|
|
9
|
+
const nodejs_utils_1 = require("@sap-ux/nodejs-utils");
|
|
9
10
|
const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
|
|
10
11
|
const i18n_1 = require("../../../i18n");
|
|
11
12
|
const types_1 = require("../../../types");
|
|
12
13
|
const utils_1 = require("../../../utils");
|
|
13
|
-
const connectionValidator_1 = require("../../connectionValidator");
|
|
14
14
|
const logger_helper_1 = __importDefault(require("../../logger-helper"));
|
|
15
15
|
const prompt_helpers_1 = require("../../prompt-helpers");
|
|
16
16
|
const validators_1 = require("../../validators");
|
|
@@ -29,7 +29,7 @@ const validators_1 = require("../../validators");
|
|
|
29
29
|
async function validateService(url, { odataService, axiosConfig }, requiredVersion = undefined, ignoreCertError = false) {
|
|
30
30
|
try {
|
|
31
31
|
if (ignoreCertError === true) {
|
|
32
|
-
|
|
32
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(!ignoreCertError);
|
|
33
33
|
}
|
|
34
34
|
const metadata = await odataService.metadata();
|
|
35
35
|
const odataVersionValResult = (0, validators_1.validateODataVersion)(metadata, requiredVersion);
|
|
@@ -92,7 +92,7 @@ async function validateService(url, { odataService, axiosConfig }, requiredVersi
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
finally {
|
|
95
|
-
|
|
95
|
+
(0, nodejs_utils_1.setGlobalRejectUnauthorized)(true);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
//# sourceMappingURL=validators.js.map
|
|
@@ -70,9 +70,15 @@ class LoggerHelper {
|
|
|
70
70
|
LoggerHelper.logger.getLogLevel() === 'trace';
|
|
71
71
|
const debugLogger = LoggerHelper.logger.debug.bind(LoggerHelper.logger);
|
|
72
72
|
interceptors.request.use((request) => {
|
|
73
|
+
// Due to a bug in `axios-logger`, the `baseURL` is not logged if the `url` is falsey.
|
|
74
|
+
if (!request.url) {
|
|
75
|
+
debugLogger(`[@sap-ux/odata-service-inquirer] Request URL: ${request.baseURL}`);
|
|
76
|
+
}
|
|
73
77
|
return AxiosLogger.requestLogger(request, {
|
|
74
78
|
url: true,
|
|
75
79
|
data: true,
|
|
80
|
+
params: true,
|
|
81
|
+
method: true,
|
|
76
82
|
prefixText: '@sap-ux/odata-service-inquirer',
|
|
77
83
|
headers: true,
|
|
78
84
|
logger: debugLogger
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/odata-service-inquirer",
|
|
3
3
|
"description": "Prompts module that can prompt users for inputs required for odata service writing",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.15",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
"@sap-ux/fiori-generator-shared": "0.12.6",
|
|
34
34
|
"@sap-ux/guided-answers-helper": "0.3.0",
|
|
35
35
|
"@sap-ux/telemetry": "0.6.3",
|
|
36
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
36
|
+
"@sap-ux/inquirer-common": "0.7.8",
|
|
37
37
|
"@sap-ux/logger": "0.7.0",
|
|
38
|
+
"@sap-ux/nodejs-utils": "0.2.1",
|
|
38
39
|
"@sap-ux/project-access": "1.30.2",
|
|
39
40
|
"@sap-ux/project-input-validator": "0.6.2",
|
|
40
41
|
"@sap-ux/store": "1.1.0"
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@types/lodash": "4.14.202",
|
|
48
49
|
"jest-extended": "3.2.4",
|
|
49
50
|
"@sap-ux/fiori-generator-shared": "0.12.6",
|
|
50
|
-
"@sap-ux/fiori-elements-writer": "2.4.
|
|
51
|
+
"@sap-ux/fiori-elements-writer": "2.4.13",
|
|
51
52
|
"@sap-ux/fiori-freestyle-writer": "2.4.9",
|
|
52
53
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
53
54
|
"@sap-ux/odata-service-writer": "0.27.5",
|