@sap-ux/odata-service-inquirer 0.6.13 → 0.7.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/dist/i18n.js CHANGED
@@ -7,6 +7,7 @@ exports.defaultProjectNumber = void 0;
7
7
  exports.initI18nOdataServiceInquirer = initI18nOdataServiceInquirer;
8
8
  exports.t = t;
9
9
  const inquirer_common_1 = require("@sap-ux/inquirer-common");
10
+ const project_input_validator_1 = require("@sap-ux/project-input-validator");
10
11
  const i18next_1 = __importDefault(require("i18next"));
11
12
  const odata_service_inquirer_i18n_json_1 = __importDefault(require("./translations/odata-service-inquirer.i18n.json"));
12
13
  const odataServiceInquirerNamespace = 'odata-service-inquirer';
@@ -34,8 +35,9 @@ async function initI18nOdataServiceInquirer() {
34
35
  }
35
36
  });
36
37
  i18next_1.default.addResourceBundle('en', odataServiceInquirerNamespace, odata_service_inquirer_i18n_json_1.default);
37
- // add the inquirer common i18n resource bundle to ensure all translations are available
38
+ // add other bundles that are used in consumed modules
38
39
  (0, inquirer_common_1.addi18nResourceBundle)();
40
+ (0, project_input_validator_1.addi18nResourceBundle)();
39
41
  }
40
42
  /**
41
43
  * Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
@@ -215,7 +215,7 @@ class ConnectionValidator {
215
215
  return 200;
216
216
  }
217
217
  catch (e) {
218
- logger_helper_1.default.logger.debug(`ConnectionValidator.checkSapService() - error: ${e.message}`);
218
+ logger_helper_1.default.logger.debug(`ConnectionValidator.checkUrl() - error: ${e.message}`);
219
219
  if (e?.isAxiosError) {
220
220
  // Error handling for BAS specific 500 errors
221
221
  if (e?.response?.status.toString().match(/5\d\d/) && isBAS) {
@@ -491,7 +491,7 @@ class ConnectionValidator {
491
491
  odataVersion: requiredOdataVersion
492
492
  });
493
493
  const validationResult = this.getValidationResultFromStatusCode(status);
494
- if (this.validity.reachable && (!this.validity.authRequired || this.validity.authenticated)) {
494
+ if (this.validity.reachable) {
495
495
  this._validatedUrl = destUrl;
496
496
  }
497
497
  if (!this.validity.reachable) {
@@ -504,7 +504,9 @@ class ConnectionValidator {
504
504
  }
505
505
  if (this.validity.authRequired) {
506
506
  return {
507
- valResult: inquirer_common_1.ErrorHandler.getErrorMsgFromType(inquirer_common_1.ERROR_TYPE.AUTH),
507
+ valResult: inquirer_common_1.ErrorHandler.getErrorMsgFromType(inquirer_common_1.ERROR_TYPE.AUTH, destination.Authentication !== btp_utils_1.Authentication.NO_AUTHENTICATION
508
+ ? (0, i18n_1.t)('texts.checkDestinationAuthConfig')
509
+ : undefined),
508
510
  errorType: inquirer_common_1.ERROR_TYPE.AUTH
509
511
  };
510
512
  }
@@ -560,7 +562,7 @@ class ConnectionValidator {
560
562
  isSystem,
561
563
  odataVersion
562
564
  });
563
- logger_helper_1.default.logger.debug(`ConnectionValidator.checkSapServiceUrl() - status: ${status}; url: ${serviceUrl}`);
565
+ logger_helper_1.default.logger.debug(`ConnectionValidator.validateUrl() - status: ${status}; url: ${serviceUrl}`);
564
566
  this.validity.urlFormat = true;
565
567
  this._validatedUrl = serviceUrl;
566
568
  return this.getValidationResultFromStatusCode(status);
@@ -718,7 +720,7 @@ class ConnectionValidator {
718
720
  isSystem,
719
721
  odataVersion
720
722
  });
721
- logger_helper_1.default.logger.debug(`ConnectionValidator.checkSapServiceUrl() - status: ${status}; url: ${url}`);
723
+ logger_helper_1.default.logger.debug(`ConnectionValidator.validateAuth() - status: ${status}; url: ${url}`);
722
724
  // Since an exception was not thrown, this is a valid url
723
725
  this.validity.urlFormat = true;
724
726
  this._validatedUrl = url;
@@ -56,7 +56,9 @@ function getSystemServiceQuestion(connectValidator, promptNamespace, promptOptio
56
56
  (0, service_helper_1.sendDestinationServiceSuccessTelemetryEvent)(answers?.[`${types_1.promptNames.systemSelection}`]?.system);
57
57
  }
58
58
  }
59
- else if (connectValidator.odataService && connectValidator.validatedUrl) {
59
+ else if (connectValidator.odataService &&
60
+ connectValidator.validatedUrl &&
61
+ !(await connectValidator.isAuthRequired())) {
60
62
  // We have connected to a service endpoint, use this service as the only choice
61
63
  const serviceUrl = new URL(connectValidator.destinationUrl ?? connectValidator.validatedUrl);
62
64
  serviceChoices = [
@@ -161,6 +161,7 @@
161
161
  "forUserName": "(for user [{{username}}])",
162
162
  "systemTypeBTP": "BTP",
163
163
  "systemTypeS4HC": "S4HC",
164
- "httpStatus": "http status {{httpStatus}}"
164
+ "httpStatus": "http status {{httpStatus}}",
165
+ "checkDestinationAuthConfig": "Please check the SAP BTP destination authentication configuration."
165
166
  }
166
167
  }
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": "0.6.13",
4
+ "version": "0.7.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",