@sap-ux/odata-service-inquirer 2.14.5 → 2.14.7

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.
@@ -40,9 +40,10 @@ export declare function connectWithDestination(destination: Destination, connect
40
40
  *
41
41
  * @param destinationFilters the filters to apply to the destination choices
42
42
  * @param includeCloudFoundryAbapEnvChoice whether to include the Cloud Foundry ABAP environment choice in the list
43
+ * @param hideNewSystem - if true it will prevent adding the 'New System' option to the list
43
44
  * @returns a list of choices for the system selection prompt
44
45
  */
45
- export declare function createSystemChoices(destinationFilters?: Partial<DestinationFilters>, includeCloudFoundryAbapEnvChoice?: boolean): Promise<ListChoiceOptions<SystemSelectionAnswerType>[]>;
46
+ export declare function createSystemChoices(destinationFilters?: Partial<DestinationFilters>, includeCloudFoundryAbapEnvChoice?: boolean, hideNewSystem?: boolean): Promise<ListChoiceOptions<SystemSelectionAnswerType>[]>;
46
47
  /**
47
48
  * Find the default selection index based on the default choice value.
48
49
  *
@@ -138,9 +138,10 @@ function matchesFilters(destination, filters) {
138
138
  *
139
139
  * @param destinationFilters the filters to apply to the destination choices
140
140
  * @param includeCloudFoundryAbapEnvChoice whether to include the Cloud Foundry ABAP environment choice in the list
141
+ * @param hideNewSystem - if true it will prevent adding the 'New System' option to the list
141
142
  * @returns a list of choices for the system selection prompt
142
143
  */
143
- async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEnvChoice = false) {
144
+ async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEnvChoice = false, hideNewSystem = false) {
144
145
  let systemChoices = [];
145
146
  let newSystemChoice;
146
147
  // If this is BAS, return destinations, otherwise return stored backend systems
@@ -190,10 +191,12 @@ async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEn
190
191
  }
191
192
  };
192
193
  });
193
- newSystemChoice = {
194
- name: (0, i18n_1.t)('prompts.systemSelection.newSystemChoiceLabel'),
195
- value: { type: 'newSystemChoice', system: exports.NewSystemChoice }
196
- };
194
+ if (!hideNewSystem) {
195
+ newSystemChoice = {
196
+ name: (0, i18n_1.t)('prompts.systemSelection.newSystemChoiceLabel'),
197
+ value: { type: 'newSystemChoice', system: exports.NewSystemChoice }
198
+ };
199
+ }
197
200
  }
198
201
  systemChoices.sort(({ name: nameA }, { name: nameB }) => nameA.localeCompare(nameB, undefined, { numeric: true, caseFirst: 'lower' }));
199
202
  if (newSystemChoice) {
@@ -99,7 +99,7 @@ async function getSystemSelectionQuestions(promptOptions, connectedSystem) {
99
99
  async function getSystemConnectionQuestions(connectionValidator, promptOptions, cachedConnectedSystem) {
100
100
  const requiredOdataVersion = promptOptions?.serviceSelection?.requiredOdataVersion;
101
101
  const destinationFilters = promptOptions?.systemSelection?.destinationFilters;
102
- const systemChoices = await (0, prompt_helpers_1.createSystemChoices)(destinationFilters, promptOptions?.systemSelection?.includeCloudFoundryAbapEnvChoice);
102
+ const systemChoices = await (0, prompt_helpers_1.createSystemChoices)(destinationFilters, promptOptions?.systemSelection?.includeCloudFoundryAbapEnvChoice, promptOptions?.systemSelection?.hideNewSystem);
103
103
  const defaultChoiceIndex = (0, prompt_helpers_1.findDefaultSystemSelectionIndex)(systemChoices, promptOptions?.systemSelection?.defaultChoice);
104
104
  const shouldOnlyShowDefaultChoice = promptOptions?.systemSelection?.onlyShowDefaultChoice && promptOptions?.systemSelection?.defaultChoice;
105
105
  const questions = [
package/dist/types.d.ts CHANGED
@@ -295,6 +295,10 @@ export type SystemSelectionPromptOptions = {
295
295
  * this option will not be applied and the full list of choices will be presented to the user.
296
296
  */
297
297
  onlyShowDefaultChoice?: boolean;
298
+ /**
299
+ * If true, the 'New System' option is not added to the system selection list.
300
+ */
301
+ hideNewSystem?: boolean;
298
302
  };
299
303
  export type MetadataPromptOptions = {
300
304
  /**
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.5",
4
+ "version": "2.14.7",
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.53",
34
+ "@sap-ux/fiori-generator-shared": "0.13.54",
35
35
  "@sap-ux/guided-answers-helper": "0.4.2",
36
- "@sap-ux/telemetry": "0.6.55",
37
- "@sap-ux/inquirer-common": "0.10.12",
36
+ "@sap-ux/telemetry": "0.6.56",
37
+ "@sap-ux/inquirer-common": "0.10.13",
38
38
  "@sap-ux/logger": "0.8.0",
39
39
  "@sap-ux/nodejs-utils": "0.2.11",
40
- "@sap-ux/project-access": "1.34.1",
41
- "@sap-ux/project-input-validator": "0.6.44",
40
+ "@sap-ux/project-access": "1.34.2",
41
+ "@sap-ux/project-input-validator": "0.6.45",
42
42
  "@sap-ux/store": "1.5.0"
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.53",
52
- "@sap-ux/fiori-elements-writer": "2.8.39",
53
- "@sap-ux/fiori-freestyle-writer": "2.5.28",
51
+ "@sap-ux/fiori-generator-shared": "0.13.54",
52
+ "@sap-ux/fiori-elements-writer": "2.8.40",
53
+ "@sap-ux/fiori-freestyle-writer": "2.5.29",
54
54
  "@sap-ux/feature-toggle": "0.3.5",
55
- "@sap-ux/odata-service-writer": "0.29.7",
56
- "@sap-ux/cap-config-writer": "0.12.44"
55
+ "@sap-ux/odata-service-writer": "0.29.8",
56
+ "@sap-ux/cap-config-writer": "0.12.45"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=20.x"