@sap-ux/odata-service-inquirer 2.14.0 → 2.14.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.
@@ -2,10 +2,10 @@ import { type IMessageSeverity } from '@sap-devx/yeoman-ui-types';
2
2
  import { type CatalogService, ServiceType, V2CatalogService } from '@sap-ux/axios-extension';
3
3
  import type { Destination } from '@sap-ux/btp-utils';
4
4
  import { OdataVersion } from '@sap-ux/odata-service-writer';
5
+ import type { ConvertedMetadata } from '@sap-ux/vocabularies-types';
5
6
  import type { ListChoiceOptions } from 'inquirer';
6
7
  import type { ConnectionValidator } from '../../../connectionValidator';
7
8
  import type { ServiceAnswer } from './types';
8
- import type { ConvertedMetadata } from '@sap-ux/vocabularies-types';
9
9
  export declare const telemEventBASServiceSuccess = "SERVICE_INQUIRER_BAS_SUCCESS";
10
10
  /**
11
11
  * Get the service choices from the specified catalogs.
@@ -75,7 +75,7 @@ type ShowCollabDraftWarnOptions = {
75
75
  * and the edmx metadata must be provided
76
76
  * @returns the service selection prompt additional message
77
77
  */
78
- export declare function getSelectedServiceMessage(serviceChoices: ListChoiceOptions<ServiceAnswer>[], selectedService: ServiceAnswer, connectValidator: ConnectionValidator, { requiredOdataVersion, hasAnnotations, showCollabDraftWarnOptions }: {
78
+ export declare function getSelectedServiceMessage(serviceChoices: ListChoiceOptions<ServiceAnswer>[], selectedService: ServiceAnswer | undefined, connectValidator: ConnectionValidator, { requiredOdataVersion, hasAnnotations, showCollabDraftWarnOptions }: {
79
79
  requiredOdataVersion?: OdataVersion;
80
80
  hasAnnotations?: boolean;
81
81
  showCollabDraftWarnOptions?: ShowCollabDraftWarnOptions;
@@ -69,9 +69,9 @@ const createServiceChoices = (serviceInfos) => {
69
69
  * @param numOfRequests the number of catalog service requests made
70
70
  */
71
71
  function logServiceCatalogErrorsForHelp(requestErrors, numOfRequests) {
72
- const catalogRequesErrors = Object.values(requestErrors);
73
- catalogRequesErrors.forEach((error) => {
74
- prompt_helpers_1.errorHandler.logErrorMsgs(error); // Log and process the error -> error type
72
+ const catalogRequesErrors = Object.entries(requestErrors);
73
+ catalogRequesErrors.forEach(([odataVersion, error]) => {
74
+ prompt_helpers_1.errorHandler.logErrorMsgs(error, (0, i18n_1.t)('warnings.missingServices', { odataVersion })); // Error state is set for later processing
75
75
  });
76
76
  // If all requests failed, log a generic message, this will be stored in the error handler
77
77
  if (numOfRequests === catalogRequesErrors.length) {
@@ -122,7 +122,8 @@ async function getServiceChoices(catalogs, serviceFilter) {
122
122
  // Flatten the array of arrays
123
123
  let flatServices = listServicesRequests?.flat() ?? [];
124
124
  logger_helper_1.default.logger.debug(`Number of services available: ${flatServices.length}`);
125
- if (flatServices.length === 0) {
125
+ // If no services or any catalog errors log the message to the error handler for later processing
126
+ if (flatServices.length === 0 || Object.keys(requestErrors).length > 0) {
126
127
  logServiceCatalogErrorsForHelp(requestErrors, catalogs.length);
127
128
  }
128
129
  if (serviceFilter) {
@@ -342,5 +343,12 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
342
343
  };
343
344
  }
344
345
  }
346
+ // If any catalog request errors, show an info message. We know this is a catalog error since there is no service selected.
347
+ if (prompt_helpers_1.errorHandler.getErrorMsg()) {
348
+ return {
349
+ message: `${prompt_helpers_1.errorHandler.getErrorMsg()} ${(0, i18n_1.t)('texts.seeLogForDetails')}`,
350
+ severity: yeoman_ui_types_1.Severity.information
351
+ };
352
+ }
345
353
  }
346
354
  //# sourceMappingURL=service-helper.js.map
@@ -261,7 +261,8 @@
261
261
  "certificateErrors": "A certificate error occurred when connecting to the host: {{-url}}. Certificate error: {{error}}.",
262
262
  "allowingUnauthorizedCertsNode": "Setting the `NODE_TLS_REJECT_UNAUTHORIZED` environment variable to `0` makes TLS connections and HTTPS requests insecure by disabling certificate verification. It is important to understand the security risks when using this setting.",
263
263
  "certErrorIgnoredByNodeSetting": "An SSL certificate error is being ignored by the 'NODE_TLS_REJECT_UNAUTHORIZED=0' Node.js setting. This makes TLS connections and HTTPS requests insecure by disabling certificate verification. For details of the certification error, see the logs.",
264
- "noExternalServiceMetdataFetched": "No external service metadata were fetched. $t(texts.seeLogForDetails)."
264
+ "noExternalServiceMetdataFetched": "No external service metadata were fetched. $t(texts.seeLogForDetails).",
265
+ "missingServices": "OData V{{odataVersion}} services are not available."
265
266
  },
266
267
  "texts": {
267
268
  "suggestedSystemNameClient": ", client {{client}}",
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.14.0",
4
+ "version": "2.14.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -31,14 +31,14 @@
31
31
  "os-name": "4.0.1",
32
32
  "@sap-ux/axios-extension": "1.25.6",
33
33
  "@sap-ux/btp-utils": "1.1.6",
34
- "@sap-ux/fiori-generator-shared": "0.13.50",
34
+ "@sap-ux/fiori-generator-shared": "0.13.51",
35
35
  "@sap-ux/guided-answers-helper": "0.4.2",
36
- "@sap-ux/telemetry": "0.6.52",
37
- "@sap-ux/inquirer-common": "0.10.9",
36
+ "@sap-ux/telemetry": "0.6.53",
37
+ "@sap-ux/inquirer-common": "0.10.10",
38
38
  "@sap-ux/logger": "0.8.0",
39
39
  "@sap-ux/nodejs-utils": "0.2.11",
40
- "@sap-ux/project-access": "1.33.2",
41
- "@sap-ux/project-input-validator": "0.6.42",
40
+ "@sap-ux/project-access": "1.34.0",
41
+ "@sap-ux/project-input-validator": "0.6.43",
42
42
  "@sap-ux/store": "1.4.2"
43
43
  },
44
44
  "devDependencies": {
@@ -48,12 +48,12 @@
48
48
  "@types/inquirer": "8.2.6",
49
49
  "@types/lodash": "4.14.202",
50
50
  "jest-extended": "6.0.0",
51
- "@sap-ux/fiori-generator-shared": "0.13.50",
52
- "@sap-ux/fiori-elements-writer": "2.8.34",
53
- "@sap-ux/fiori-freestyle-writer": "2.5.25",
51
+ "@sap-ux/fiori-generator-shared": "0.13.51",
52
+ "@sap-ux/fiori-elements-writer": "2.8.36",
53
+ "@sap-ux/fiori-freestyle-writer": "2.5.26",
54
54
  "@sap-ux/feature-toggle": "0.3.5",
55
- "@sap-ux/odata-service-writer": "0.29.5",
56
- "@sap-ux/cap-config-writer": "0.12.41"
55
+ "@sap-ux/odata-service-writer": "0.29.6",
56
+ "@sap-ux/cap-config-writer": "0.12.42"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=20.x"