@sap-ux/cf-deploy-config-inquirer 1.0.12 → 1.0.13

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,4 +1,4 @@
1
- import { isAppStudio, listDestinations, getDisplayName, isAbapEnvironmentOnBtp } from '@sap-ux/btp-utils';
1
+ import { isAppStudio, listDestinations, getDisplayName, isAbapEnvironmentOnBtp, isFullUrlDestination } from '@sap-ux/btp-utils';
2
2
  import LoggerHelper from '../logger-helper.js';
3
3
  import { t } from '../i18n.js';
4
4
  /**
@@ -15,7 +15,8 @@ function createDestinationChoices(destinations = {}) {
15
15
  name: `${getDisplayName(destination) ?? 'Unknown'} - ${destination.Host}`,
16
16
  value: destination.Name,
17
17
  scp: isAbapEnvironmentOnBtp(destination) || false,
18
- url: destination.Host
18
+ url: destination.Host,
19
+ isFullUrl: isFullUrlDestination(destination)
19
20
  }));
20
21
  }
21
22
  /**
@@ -2,7 +2,7 @@ import { searchChoices } from '@sap-ux/inquirer-common';
2
2
  import { t } from '../i18n.js';
3
3
  import { RouterModuleType, promptNames } from '../types.js';
4
4
  import * as validators from './validators.js';
5
- import { isAppStudio } from '@sap-ux/btp-utils';
5
+ import { isAppStudio, isFullUrlDestination } from '@sap-ux/btp-utils';
6
6
  import { getCfSystemChoices, fetchBTPDestinations } from './prompt-helpers.js';
7
7
  import { Severity } from '@sap-devx/yeoman-ui-types';
8
8
  /**
@@ -52,6 +52,17 @@ async function getDestinationNamePrompt(destinationOptions) {
52
52
  validate: (destination) => {
53
53
  return validators.validateDestinationQuestion(destination, !destination && isBAS);
54
54
  },
55
+ additionalMessages: (selectedDestination) => {
56
+ const choice = destinationList.find((c) => c.value === selectedDestination);
57
+ const dest = destinations?.[selectedDestination];
58
+ if (choice?.isFullUrl || (dest && isFullUrlDestination(dest))) {
59
+ return {
60
+ message: t('warning.fullUrlDestination'),
61
+ severity: Severity.warning
62
+ };
63
+ }
64
+ return undefined;
65
+ },
55
66
  source: (prevAnswers, input) => searchChoices(input, destinationList),
56
67
  choices: () => destinationList
57
68
  };
@@ -42,7 +42,8 @@
42
42
  },
43
43
  "warning": {
44
44
  "btpDestinationListWarning": "BTP destinations are only retrieved on SAP Business Application Studio.",
45
- "appFrontendServiceRouterChoice": "You need to have the Application Frontend service enabled for your subaccount."
45
+ "appFrontendServiceRouterChoice": "You need to have the Application Frontend service enabled for your subaccount.",
46
+ "fullUrlDestination": "The selected destination is a full URL destination. The URL path is appended to the destination host, which may cause routing issues."
46
47
  },
47
48
  "info": {
48
49
  "addManagedAppRouter": "Add managed application router is enabled.",
package/dist/types.d.ts CHANGED
@@ -153,6 +153,8 @@ export interface CfSystemChoice {
153
153
  scp?: boolean;
154
154
  /** URL associated with the system choice. */
155
155
  url?: string;
156
+ /** Flag indicating if the destination is a full URL destination. */
157
+ isFullUrl?: boolean;
156
158
  }
157
159
  export {};
158
160
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/cf-deploy-config-inquirer",
3
3
  "description": "Prompts module that can provide prompts for cf deployment config writer",
4
- "version": "1.0.12",
4
+ "version": "1.0.13",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",