@sap-ux/odata-service-inquirer 2.14.11 → 2.14.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.
|
@@ -15,8 +15,6 @@ const logger_helper_1 = __importDefault(require("../../../logger-helper"));
|
|
|
15
15
|
const prompt_helpers_1 = require("../../../prompt-helpers");
|
|
16
16
|
const service_helper_1 = require("../service-selection/service-helper");
|
|
17
17
|
const value_help_download_1 = require("../external-services/value-help-download");
|
|
18
|
-
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
19
|
-
const sortBy_1 = __importDefault(require("lodash/sortBy"));
|
|
20
18
|
const cliServicePromptName = 'cliServiceSelection';
|
|
21
19
|
/**
|
|
22
20
|
* Get the service selection prompt for an Abap system connection (on-prem or on-btp). The service selection prompt is used to select a service from the system catalog.
|
|
@@ -59,7 +57,7 @@ function getSystemServiceQuestion(connectValidator, promptNamespace, promptOptio
|
|
|
59
57
|
if (serviceChoices.length === 0 ||
|
|
60
58
|
previousSystemUrl !== connectValidator.validatedUrl ||
|
|
61
59
|
previousClient !== connectValidator.validatedClient ||
|
|
62
|
-
!(0,
|
|
60
|
+
!(0, utils_1.areArraysEquivalent)(previousServiceFilter, promptOptions?.serviceFilter)) {
|
|
63
61
|
// if we have a catalog, use it to list services
|
|
64
62
|
if (connectValidator.catalogs[odata_service_writer_1.OdataVersion.v2] || connectValidator.catalogs[odata_service_writer_1.OdataVersion.v4]) {
|
|
65
63
|
serviceChoices = await createServiceChoicesFromCatalog(connectValidator.catalogs, requiredOdataVersion, promptOptions?.serviceFilter);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -73,5 +73,12 @@ export declare function removeCircularFromServiceProvider(serviceProvider: Servi
|
|
|
73
73
|
* @returns the backend system if found or undefined
|
|
74
74
|
*/
|
|
75
75
|
export declare function isBackendSystemKeyExisting(backendSystems: BackendSystem[], url: string, client?: string): BackendSystem | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Compare 2 string arrays without considering ordering.
|
|
78
|
+
*
|
|
79
|
+
* @param array1
|
|
80
|
+
* @param array2
|
|
81
|
+
*/
|
|
82
|
+
export declare function areArraysEquivalent(array1: Array<string> | undefined, array2: Array<string> | undefined): boolean;
|
|
76
83
|
export { PromptState };
|
|
77
84
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.convertODataVersionType = convertODataVersionType;
|
|
|
12
12
|
exports.getDefaultChoiceIndex = getDefaultChoiceIndex;
|
|
13
13
|
exports.removeCircularFromServiceProvider = removeCircularFromServiceProvider;
|
|
14
14
|
exports.isBackendSystemKeyExisting = isBackendSystemKeyExisting;
|
|
15
|
+
exports.areArraysEquivalent = areArraysEquivalent;
|
|
15
16
|
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
16
17
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
17
18
|
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
@@ -160,4 +161,21 @@ function isBackendSystemKeyExisting(backendSystems, url, client) {
|
|
|
160
161
|
const newBackendSystemId = new store_1.BackendSystemKey({ url, client }).getId();
|
|
161
162
|
return backendSystems.find((backendSystem) => store_1.BackendSystemKey.from(backendSystem).getId() === newBackendSystemId);
|
|
162
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Compare 2 string arrays without considering ordering.
|
|
166
|
+
*
|
|
167
|
+
* @param array1
|
|
168
|
+
* @param array2
|
|
169
|
+
*/
|
|
170
|
+
function areArraysEquivalent(array1, array2) {
|
|
171
|
+
// Both undefined, same length or same object ref
|
|
172
|
+
if ((!array1 && !array2) || (array1?.length === 0 && array2?.length === 0) || array1 === array2) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
// If either undefined must be different due to earlier condition
|
|
176
|
+
if (!array1 || !array2) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
return [...array1].sort().toString() === [...array2].sort().toString();
|
|
180
|
+
}
|
|
163
181
|
//# sourceMappingURL=index.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.14.
|
|
4
|
+
"version": "2.14.12",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
"fast-xml-parser": "4.4.1",
|
|
29
29
|
"i18next": "25.3.0",
|
|
30
30
|
"inquirer-autocomplete-prompt": "2.0.1",
|
|
31
|
-
"lodash": "4.17.21",
|
|
32
31
|
"os-name": "4.0.1",
|
|
33
32
|
"@sap-ux/axios-extension": "1.25.6",
|
|
33
|
+
"@sap-ux/btp-utils": "1.1.6",
|
|
34
|
+
"@sap-ux/fiori-generator-shared": "0.13.54",
|
|
34
35
|
"@sap-ux/guided-answers-helper": "0.4.2",
|
|
35
36
|
"@sap-ux/telemetry": "0.6.56",
|
|
36
|
-
"@sap-ux/fiori-generator-shared": "0.13.54",
|
|
37
|
-
"@sap-ux/btp-utils": "1.1.6",
|
|
38
37
|
"@sap-ux/inquirer-common": "0.10.14",
|
|
39
38
|
"@sap-ux/logger": "0.8.0",
|
|
40
39
|
"@sap-ux/nodejs-utils": "0.2.11",
|
|
@@ -47,11 +46,10 @@
|
|
|
47
46
|
"@sap-devx/yeoman-ui-types": "1.14.4",
|
|
48
47
|
"@types/inquirer-autocomplete-prompt": "2.0.2",
|
|
49
48
|
"@types/inquirer": "8.2.6",
|
|
50
|
-
"@types/lodash": "4.14.202",
|
|
51
49
|
"jest-extended": "6.0.0",
|
|
50
|
+
"@sap-ux/fiori-generator-shared": "0.13.54",
|
|
52
51
|
"@sap-ux/fiori-elements-writer": "2.8.42",
|
|
53
52
|
"@sap-ux/fiori-freestyle-writer": "2.5.29",
|
|
54
|
-
"@sap-ux/fiori-generator-shared": "0.13.54",
|
|
55
53
|
"@sap-ux/feature-toggle": "0.3.5",
|
|
56
54
|
"@sap-ux/odata-service-writer": "0.29.8",
|
|
57
55
|
"@sap-ux/cap-config-writer": "0.12.45"
|