@sap-ux/adp-tooling 0.19.5 → 0.19.6

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.
@@ -1,5 +1,6 @@
1
1
  import type { YUIQuestion } from '@sap-ux/inquirer-common';
2
2
  import type { UI5FlexLayer } from '@sap-ux/project-access';
3
+ import { type AppWizard } from '@sap-devx/yeoman-ui-types';
3
4
  import type { ToolsLogger } from '@sap-ux/logger';
4
5
  import { ServiceType, type DescriptorVariant, type NewModelAnswers, type NewModelData } from '../../types';
5
6
  /**
@@ -16,9 +17,10 @@ export declare function getODataVersionFromServiceType(serviceType: ServiceType)
16
17
  * @param {string} projectPath - The root path of the project.
17
18
  * @param {UI5FlexLayer} layer - UI5 Flex layer.
18
19
  * @param {ToolsLogger} [logger] - Optional logger.
20
+ * @param {AppWizard} [appWizard] - Optional AppWizard instance for showing notifications.
19
21
  * @returns {YUIQuestion<NewModelAnswers>[]} The questions/prompts.
20
22
  */
21
- export declare function getPrompts(projectPath: string, layer: UI5FlexLayer, logger?: ToolsLogger): Promise<YUIQuestion<NewModelAnswers>[]>;
23
+ export declare function getPrompts(projectPath: string, layer: UI5FlexLayer, logger?: ToolsLogger, appWizard?: AppWizard): Promise<YUIQuestion<NewModelAnswers>[]>;
22
24
  /**
23
25
  * Builds the NewModelData object from the prompts answers.
24
26
  *
@@ -216,9 +216,10 @@ async function getDestinationChoices(projectPath, logger) {
216
216
  * @param {string} projectPath - The root path of the project.
217
217
  * @param {UI5FlexLayer} layer - UI5 Flex layer.
218
218
  * @param {ToolsLogger} [logger] - Optional logger.
219
+ * @param {AppWizard} [appWizard] - Optional AppWizard instance for showing notifications.
219
220
  * @returns {YUIQuestion<NewModelAnswers>[]} The questions/prompts.
220
221
  */
221
- async function getPrompts(projectPath, layer, logger) {
222
+ async function getPrompts(projectPath, layer, logger, appWizard) {
222
223
  const isCustomerBase = "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */ === layer;
223
224
  const defaultSeviceName = isCustomerBase ? "customer." /* NamespacePrefix.CUSTOMER */ : "" /* NamespacePrefix.EMPTY */;
224
225
  const isCFEnv = await (0, cf_1.isCFEnvironment)(projectPath);
@@ -231,6 +232,9 @@ async function getPrompts(projectPath, layer, logger) {
231
232
  let destinationChoices;
232
233
  if (isCFEnv) {
233
234
  ({ choices: destinationChoices, error: destinationError } = await getDestinationChoices(projectPath, logger));
235
+ if (destinationError) {
236
+ appWizard?.showError(destinationError, yeoman_ui_types_1.MessageType.notification);
237
+ }
234
238
  }
235
239
  const buildResultingUrlMessage = (i18nKey, uri, previousAnswers) => {
236
240
  const destinationUrl = isCFEnv ? previousAnswers?.destination?.Host : abapServiceUrl;
@@ -266,7 +270,7 @@ async function getPrompts(projectPath, layer, logger) {
266
270
  mandatory: true,
267
271
  hint: (0, i18n_1.t)('prompts.destinationTooltip')
268
272
  },
269
- validate: (value) => destinationError ?? (0, project_input_validator_1.validateEmptyString)(value?.Name)
273
+ validate: (value) => (0, project_input_validator_1.validateEmptyString)(value?.Name)
270
274
  },
271
275
  {
272
276
  type: 'input',
@@ -130,7 +130,7 @@
130
130
  "failedToListBtpDestinations": "Failed to list BTP destinations. Error: {{error}}",
131
131
  "destinationServiceNotFoundInMtaYaml": "Destination service instance not found in mta.yaml. Ensure a resource with 'service: destination' is declared.",
132
132
  "noServiceKeysFoundForDestination": "No service keys found for destination service instance '{{serviceInstanceName}}'. Ensure the service is provisioned and try again.",
133
- "errorFetchingDestinations": "Error fetching destinations. Check log for details.",
133
+ "errorFetchingDestinations": "An error occurred when fetching destinations. For more information, see the logs.",
134
134
  "cfPushFailed": "cf push failed for the '{{appName}}' app: {{error}}",
135
135
  "cfEnableSshFailed": "cf enable-ssh failed for the '{{appName}}' app: {{error}}",
136
136
  "cfRestartFailed": "cf restart failed for the '{{appName}}' app: {{error}}"
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
11
11
  },
12
- "version": "0.19.5",
12
+ "version": "0.19.6",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",