@sap-ux/odata-service-inquirer 2.9.10 → 2.9.12
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.
|
@@ -10,11 +10,11 @@ exports.createSystemChoices = createSystemChoices;
|
|
|
10
10
|
exports.findDefaultSystemSelectionIndex = findDefaultSystemSelectionIndex;
|
|
11
11
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
12
12
|
const inquirer_common_1 = require("@sap-ux/inquirer-common");
|
|
13
|
-
const store_1 = require("@sap-ux/store");
|
|
14
13
|
const i18n_1 = require("../../../../i18n");
|
|
15
14
|
const utils_1 = require("../../../../utils");
|
|
16
15
|
const logger_helper_1 = __importDefault(require("../../../logger-helper"));
|
|
17
16
|
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
17
|
+
const store_1 = require("../../../../utils/store");
|
|
18
18
|
// New system choice value is a hard to guess string to avoid conflicts with existing system names or user named systems
|
|
19
19
|
// since it will be used as a new system value in the system selection prompt.
|
|
20
20
|
exports.NewSystemChoice = '!@£*&937newSystem*X~qy^';
|
|
@@ -33,7 +33,8 @@ async function connectWithBackendSystem(backendKey, connectionValidator, require
|
|
|
33
33
|
// Create a new connection with the selected system
|
|
34
34
|
utils_1.PromptState.resetConnectedSystem();
|
|
35
35
|
let connectValResult = false;
|
|
36
|
-
const
|
|
36
|
+
const backendService = await (0, store_1.getBackendSystemService)();
|
|
37
|
+
const backendSystem = await backendService.read(backendKey);
|
|
37
38
|
if (backendSystem) {
|
|
38
39
|
// Backend systems validation supports using a cached service provider to prevent re-authentication (e.g. re-opening a browser window)
|
|
39
40
|
// In case the user has changed the URL, do not use the cached service provider.
|
|
@@ -179,7 +180,8 @@ async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEn
|
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
else {
|
|
182
|
-
const
|
|
183
|
+
const backendService = await (0, store_1.getBackendSystemService)();
|
|
184
|
+
const backendSystems = await backendService.getAll({ includeSensitiveData: false });
|
|
183
185
|
// Cache the backend systems
|
|
184
186
|
utils_1.PromptState.backendSystemsCache = backendSystems;
|
|
185
187
|
systemChoices = backendSystems.map((system) => {
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.validateSystemName = validateSystemName;
|
|
7
4
|
exports.validateServiceKey = validateServiceKey;
|
|
8
5
|
exports.validateServiceUrl = validateServiceUrl;
|
|
9
6
|
const i18n_1 = require("../../../i18n");
|
|
10
|
-
const store_1 = require("@sap-ux/store");
|
|
11
|
-
const logger_helper_1 = __importDefault(require("../../logger-helper"));
|
|
12
7
|
const node_fs_1 = require("node:fs");
|
|
8
|
+
const store_1 = require("../../../utils/store");
|
|
13
9
|
/**
|
|
14
10
|
* Check if the system name is already in use.
|
|
15
11
|
*
|
|
@@ -17,7 +13,10 @@ const node_fs_1 = require("node:fs");
|
|
|
17
13
|
* @returns true if the system name is already in use, otherwise false
|
|
18
14
|
*/
|
|
19
15
|
async function isSystemNameInUse(systemName) {
|
|
20
|
-
const
|
|
16
|
+
const backendService = await (0, store_1.getBackendSystemService)();
|
|
17
|
+
const backendSystems = await backendService.getAll({
|
|
18
|
+
includeSensitiveData: false
|
|
19
|
+
});
|
|
21
20
|
return !!backendSystems.find((system) => system.name === systemName);
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type BackendSystem, type BackendSystemKey, type Service } from '@sap-ux/store';
|
|
2
|
+
/**
|
|
3
|
+
* Get the backend system service instance.
|
|
4
|
+
*
|
|
5
|
+
* @returns the backend system service instance
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBackendSystemService(): Promise<Service<BackendSystem, BackendSystemKey>>;
|
|
8
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBackendSystemService = getBackendSystemService;
|
|
4
|
+
const store_1 = require("@sap-ux/store");
|
|
5
|
+
/**
|
|
6
|
+
* Get the backend system service instance.
|
|
7
|
+
*
|
|
8
|
+
* @returns the backend system service instance
|
|
9
|
+
*/
|
|
10
|
+
async function getBackendSystemService() {
|
|
11
|
+
const backendService = await (0, store_1.getService)({
|
|
12
|
+
entityName: 'system'
|
|
13
|
+
});
|
|
14
|
+
return backendService;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=store.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.9.
|
|
4
|
+
"version": "2.9.12",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"os-name": "4.0.1",
|
|
32
32
|
"@sap-ux/axios-extension": "1.24.0",
|
|
33
33
|
"@sap-ux/btp-utils": "1.1.4",
|
|
34
|
-
"@sap-ux/fiori-generator-shared": "0.13.
|
|
34
|
+
"@sap-ux/fiori-generator-shared": "0.13.30",
|
|
35
35
|
"@sap-ux/guided-answers-helper": "0.4.0",
|
|
36
|
-
"@sap-ux/telemetry": "0.6.
|
|
37
|
-
"@sap-ux/inquirer-common": "0.8.
|
|
36
|
+
"@sap-ux/telemetry": "0.6.35",
|
|
37
|
+
"@sap-ux/inquirer-common": "0.8.9",
|
|
38
38
|
"@sap-ux/logger": "0.7.0",
|
|
39
39
|
"@sap-ux/nodejs-utils": "0.2.7",
|
|
40
40
|
"@sap-ux/project-access": "1.32.7",
|
|
41
41
|
"@sap-ux/project-input-validator": "0.6.29",
|
|
42
|
-
"@sap-ux/store": "1.
|
|
42
|
+
"@sap-ux/store": "1.3.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@sap-ux/vocabularies-types": "0.13.0",
|
|
@@ -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.
|
|
52
|
-
"@sap-ux/fiori-elements-writer": "2.7.
|
|
53
|
-
"@sap-ux/fiori-freestyle-writer": "2.4.
|
|
51
|
+
"@sap-ux/fiori-generator-shared": "0.13.30",
|
|
52
|
+
"@sap-ux/fiori-elements-writer": "2.7.33",
|
|
53
|
+
"@sap-ux/fiori-freestyle-writer": "2.4.58",
|
|
54
54
|
"@sap-ux/feature-toggle": "0.3.3",
|
|
55
55
|
"@sap-ux/odata-service-writer": "0.27.28",
|
|
56
|
-
"@sap-ux/cap-config-writer": "0.12.
|
|
56
|
+
"@sap-ux/cap-config-writer": "0.12.21"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=20.x"
|