@sap-ux/odata-service-inquirer 2.2.3 → 2.2.5

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.
@@ -87,6 +87,7 @@ function getAbapOnBTPSystemQuestions(promptOptions) {
87
87
  * @returns true if the service info is valid, a validation message if the service info is invalid, or a validation link if the service info is not validated but some help is available
88
88
  */
89
89
  async function validateCFServiceInfo(abapService, connectionValidator, requiredOdataVersion, isCli = false) {
90
+ utils_1.PromptState.resetConnectedSystem();
90
91
  const cfAbapServiceName = abapService.label;
91
92
  const uaaCreds = await (0, cf_tools_1.apiGetInstanceCredentials)(cfAbapServiceName); // should be abapService.serviceName in BAS?
92
93
  if (!uaaCreds?.credentials?.uaa) {
@@ -122,6 +123,9 @@ async function validateCFServiceInfo(abapService, connectionValidator, requiredO
122
123
  if (connectionValidator.serviceProvider && (0, utils_1.getPromptHostEnvironment)() !== fiori_generator_shared_1.hostEnvironment.bas) {
123
124
  // Connected system name is only used for VSCode as a default stored system name
124
125
  connectionValidator.connectedSystemName = await (0, btp_utils_1.generateABAPCloudDestinationName)(cfAbapServiceName);
126
+ utils_1.PromptState.odataService.connectedSystem = {
127
+ serviceProvider: connectionValidator.serviceProvider
128
+ };
125
129
  }
126
130
  return true;
127
131
  }
@@ -203,6 +207,7 @@ function getServiceKeyPrompt(connectionValidator) {
203
207
  mandatory: true
204
208
  },
205
209
  validate: async (keyPath) => {
210
+ utils_1.PromptState.resetConnectedSystem();
206
211
  const serviceKeyValResult = (0, validators_1.validateServiceKey)(keyPath);
207
212
  if (typeof serviceKeyValResult === 'string' || typeof serviceKeyValResult === 'boolean') {
208
213
  return serviceKeyValResult;
@@ -77,6 +77,7 @@ function getSystemUrlQuestion(connectValidator, promptNamespace, requiredOdataVe
77
77
  breadcrumb: true
78
78
  },
79
79
  validate: async (url) => {
80
+ utils_1.PromptState.resetConnectedSystem();
80
81
  const valResult = await connectValidator.validateUrl(url, {
81
82
  isSystem: true,
82
83
  odataVersion: (0, utils_1.convertODataVersionType)(requiredOdataVersion)
@@ -30,6 +30,7 @@ exports.CfAbapEnvServiceChoice = 'cfAbapEnvService';
30
30
  */
31
31
  async function connectWithBackendSystem(backendSystem, connectionValidator, requiredOdataVersion) {
32
32
  // Create a new connection with the selected system
33
+ utils_1.PromptState.resetConnectedSystem();
33
34
  let connectValResult = false;
34
35
  if (backendSystem) {
35
36
  // Assumption: non-BAS systems are BackendSystems
@@ -80,6 +81,7 @@ async function connectWithBackendSystem(backendSystem, connectionValidator, requ
80
81
  * @returns the validation result of the destination connection attempt
81
82
  */
82
83
  async function connectWithDestination(destination, connectionValidator, requiredOdataVersion, addServicePath) {
84
+ utils_1.PromptState.resetConnectedSystem();
83
85
  const { valResult: connectValResult, errorType } = await connectionValidator.validateDestination(destination, (0, utils_1.convertODataVersionType)(requiredOdataVersion), addServicePath);
84
86
  // If authentication failed with an auth error, and the system connection auth type is basic, we will defer validation to the credentials prompt.
85
87
  if (errorType === inquirer_common_1.ERROR_TYPE.AUTH && connectionValidator.systemAuthType === 'basic') {
@@ -9,5 +9,6 @@ export declare class PromptState {
9
9
  static odataService: Partial<OdataServiceAnswers>;
10
10
  static isYUI: boolean;
11
11
  static reset(): void;
12
+ static resetConnectedSystem(): void;
12
13
  }
13
14
  //# sourceMappingURL=prompt-state.d.ts.map
@@ -16,6 +16,9 @@ class PromptState {
16
16
  PromptState.odataService[key] = undefined;
17
17
  });
18
18
  }
19
+ static resetConnectedSystem() {
20
+ PromptState.odataService.connectedSystem = undefined;
21
+ }
19
22
  }
20
23
  exports.PromptState = PromptState;
21
24
  //# sourceMappingURL=prompt-state.js.map
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.2.3",
4
+ "version": "2.2.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,12 +30,12 @@
30
30
  "os-name": "4.0.1",
31
31
  "@sap-ux/axios-extension": "1.18.5",
32
32
  "@sap-ux/btp-utils": "1.0.1",
33
- "@sap-ux/fiori-generator-shared": "0.7.28",
33
+ "@sap-ux/fiori-generator-shared": "0.7.29",
34
34
  "@sap-ux/guided-answers-helper": "0.2.1",
35
- "@sap-ux/telemetry": "0.5.60",
36
- "@sap-ux/inquirer-common": "0.6.15",
35
+ "@sap-ux/telemetry": "0.5.61",
36
+ "@sap-ux/inquirer-common": "0.6.16",
37
37
  "@sap-ux/logger": "0.6.0",
38
- "@sap-ux/project-access": "1.29.6",
38
+ "@sap-ux/project-access": "1.29.7",
39
39
  "@sap-ux/project-input-validator": "0.3.4",
40
40
  "@sap-ux/store": "1.0.0"
41
41
  },
@@ -46,12 +46,12 @@
46
46
  "@types/inquirer": "8.2.6",
47
47
  "@types/lodash": "4.14.202",
48
48
  "jest-extended": "3.2.4",
49
- "@sap-ux/fiori-generator-shared": "0.7.28",
50
- "@sap-ux/fiori-elements-writer": "2.1.8",
51
- "@sap-ux/fiori-freestyle-writer": "2.0.14",
49
+ "@sap-ux/fiori-generator-shared": "0.7.29",
50
+ "@sap-ux/fiori-elements-writer": "2.1.11",
51
+ "@sap-ux/fiori-freestyle-writer": "2.0.15",
52
52
  "@sap-ux/feature-toggle": "0.2.3",
53
- "@sap-ux/odata-service-writer": "0.25.9",
54
- "@sap-ux/cap-config-writer": "0.9.7"
53
+ "@sap-ux/odata-service-writer": "0.25.10",
54
+ "@sap-ux/cap-config-writer": "0.9.8"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=18.x"