@sap-ux/odata-service-inquirer 2.2.36 → 2.3.1
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.
|
@@ -22,7 +22,6 @@ export type EntitySetFilter = 'filterDraftEnabled' | 'filterAggregateTransformat
|
|
|
22
22
|
*
|
|
23
23
|
* @param edmx metadata string
|
|
24
24
|
* @param options
|
|
25
|
-
* @param options.useEntityTypeAsName Choice options will use the non-namepspaced entity set type as the choice name (label) and value property `entitySetName` when true, otherwise the entity set name will be used.
|
|
26
25
|
* @param options.entitySetFilter
|
|
27
26
|
* `filterDraftEnabled` : Only draft enabled entities wil be returned when true, useful for Form Object Page app generation.
|
|
28
27
|
* `filterAggregateTransformationsOnly` : Only return entity choices that have an aggregate annotation (Aggregation.ApplySupported) with the `Transformations` property set,
|
|
@@ -30,8 +29,7 @@ export type EntitySetFilter = 'filterDraftEnabled' | 'filterAggregateTransformat
|
|
|
30
29
|
* @param options.defaultMainEntityName The default selected entity set name
|
|
31
30
|
* @returns entity options
|
|
32
31
|
*/
|
|
33
|
-
export declare function getEntityChoices(edmx: string, {
|
|
34
|
-
useEntityTypeAsName?: boolean;
|
|
32
|
+
export declare function getEntityChoices(edmx: string, { entitySetFilter, defaultMainEntityName }?: {
|
|
35
33
|
entitySetFilter?: EntitySetFilter;
|
|
36
34
|
defaultMainEntityName?: string;
|
|
37
35
|
}): EntityChoiceOptions;
|
|
@@ -16,7 +16,6 @@ const logger_helper_1 = __importDefault(require("../logger-helper"));
|
|
|
16
16
|
*
|
|
17
17
|
* @param edmx metadata string
|
|
18
18
|
* @param options
|
|
19
|
-
* @param options.useEntityTypeAsName Choice options will use the non-namepspaced entity set type as the choice name (label) and value property `entitySetName` when true, otherwise the entity set name will be used.
|
|
20
19
|
* @param options.entitySetFilter
|
|
21
20
|
* `filterDraftEnabled` : Only draft enabled entities wil be returned when true, useful for Form Object Page app generation.
|
|
22
21
|
* `filterAggregateTransformationsOnly` : Only return entity choices that have an aggregate annotation (Aggregation.ApplySupported) with the `Transformations` property set,
|
|
@@ -24,7 +23,7 @@ const logger_helper_1 = __importDefault(require("../logger-helper"));
|
|
|
24
23
|
* @param options.defaultMainEntityName The default selected entity set name
|
|
25
24
|
* @returns entity options
|
|
26
25
|
*/
|
|
27
|
-
function getEntityChoices(edmx, {
|
|
26
|
+
function getEntityChoices(edmx, { entitySetFilter, defaultMainEntityName } = {}) {
|
|
28
27
|
const choices = [];
|
|
29
28
|
let draftRootIndex;
|
|
30
29
|
let defaultMainEntityIndex;
|
|
@@ -51,15 +50,10 @@ function getEntityChoices(edmx, { useEntityTypeAsName = false, entitySetFilter,
|
|
|
51
50
|
entitySets = convertedMetadata.entitySets;
|
|
52
51
|
}
|
|
53
52
|
entitySets.forEach((entitySet, index) => {
|
|
54
|
-
// Determine whether to use the entity set type name or the entity set name as the choice name.
|
|
55
|
-
// Note that in the case of the entity type name, the namespace will be removed.
|
|
56
|
-
const entitySetChoiceName = useEntityTypeAsName
|
|
57
|
-
? entitySet.entityTypeName.substring(entitySet.entityTypeName.lastIndexOf('.') + 1)
|
|
58
|
-
: entitySet.name;
|
|
59
53
|
const choice = {
|
|
60
|
-
name:
|
|
54
|
+
name: entitySet.name,
|
|
61
55
|
value: {
|
|
62
|
-
entitySetName:
|
|
56
|
+
entitySetName: entitySet.name,
|
|
63
57
|
entitySetType: entitySet.entityTypeName // Fully qualified entity type name
|
|
64
58
|
}
|
|
65
59
|
};
|
|
@@ -62,7 +62,6 @@ function getEntitySelectionQuestions(metadata, templateType, isCapService = fals
|
|
|
62
62
|
entitySetFilter = 'filterAggregateTransformationsOnly';
|
|
63
63
|
}
|
|
64
64
|
const entityChoices = (0, entity_helper_1.getEntityChoices)(metadata, {
|
|
65
|
-
useEntityTypeAsName: templateType === 'ovp',
|
|
66
65
|
defaultMainEntityName: promptOptions?.defaultMainEntityName,
|
|
67
66
|
entitySetFilter
|
|
68
67
|
});
|
|
@@ -74,7 +73,7 @@ function getEntitySelectionQuestions(metadata, templateType, isCapService = fals
|
|
|
74
73
|
const entityQuestions = [];
|
|
75
74
|
// OVP only has filter entity, does not use tables and we do not add annotations
|
|
76
75
|
if (templateType === 'ovp') {
|
|
77
|
-
entityQuestions.push(
|
|
76
|
+
entityQuestions.push(getFilterEntitySetQuestions(entityChoices, useAutoComplete));
|
|
78
77
|
// Return early since OVP does not have table layout prompts
|
|
79
78
|
return entityQuestions;
|
|
80
79
|
}
|
|
@@ -266,18 +265,18 @@ function getAddAnnotationQuestions(metadata, templateType, odataVersion, isCapSe
|
|
|
266
265
|
* @param useAutoComplete Determines if entity related prompts should use auto complete on user input
|
|
267
266
|
* @returns the ovp specific filter entity type selection question
|
|
268
267
|
*/
|
|
269
|
-
function
|
|
268
|
+
function getFilterEntitySetQuestions(entityChoices, useAutoComplete = false) {
|
|
270
269
|
return {
|
|
271
270
|
type: useAutoComplete ? 'autocomplete' : 'list',
|
|
272
|
-
name: types_1.EntityPromptNames.
|
|
273
|
-
message: (0, i18n_1.t)('prompts.
|
|
271
|
+
name: types_1.EntityPromptNames.filterEntitySet,
|
|
272
|
+
message: (0, i18n_1.t)('prompts.filterEntitySet.message'),
|
|
274
273
|
guiOptions: {
|
|
275
274
|
breadcrumb: true
|
|
276
275
|
},
|
|
277
276
|
choices: entityChoices.choices,
|
|
278
277
|
source: (preAnswers, input) => (0, inquirer_common_1.searchChoices)(input, entityChoices.choices),
|
|
279
278
|
default: entityChoices.defaultMainEntityIndex ?? entityChoices.draftRootIndex ?? 0,
|
|
280
|
-
validate: () => (entityChoices.choices.length === 0 ? (0, i18n_1.t)('prompts.
|
|
279
|
+
validate: () => (entityChoices.choices.length === 0 ? (0, i18n_1.t)('prompts.filterEntitySet.noEntitiesError') : true)
|
|
281
280
|
};
|
|
282
281
|
}
|
|
283
282
|
//# sourceMappingURL=questions.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export declare enum promptNames {
|
|
|
139
139
|
export declare const EntityPromptNames: {
|
|
140
140
|
readonly mainEntity: "mainEntity";
|
|
141
141
|
readonly navigationEntity: "navigationEntity";
|
|
142
|
-
readonly
|
|
142
|
+
readonly filterEntitySet: "filterEntitySet";
|
|
143
143
|
readonly tableType: "tableType";
|
|
144
144
|
readonly hierarchyQualifier: "hierarchyQualifier";
|
|
145
145
|
readonly addFEOPAnnotations: "addFEOPAnnotations";
|
|
@@ -154,7 +154,7 @@ export type EntityPromptNames = (typeof EntityPromptNames)[keyof typeof EntityPr
|
|
|
154
154
|
export interface EntitySelectionAnswers {
|
|
155
155
|
[EntityPromptNames.mainEntity]?: EntityAnswer;
|
|
156
156
|
[EntityPromptNames.navigationEntity]?: NavigationEntityAnswer;
|
|
157
|
-
[EntityPromptNames.
|
|
157
|
+
[EntityPromptNames.filterEntitySet]?: EntityAnswer;
|
|
158
158
|
}
|
|
159
159
|
export interface TableConfigAnswers {
|
|
160
160
|
[EntityPromptNames.tableType]?: TableType;
|
package/dist/types.js
CHANGED
|
@@ -73,7 +73,7 @@ var promptNames;
|
|
|
73
73
|
exports.EntityPromptNames = {
|
|
74
74
|
mainEntity: 'mainEntity',
|
|
75
75
|
navigationEntity: 'navigationEntity',
|
|
76
|
-
|
|
76
|
+
filterEntitySet: 'filterEntitySet',
|
|
77
77
|
tableType: 'tableType',
|
|
78
78
|
hierarchyQualifier: 'hierarchyQualifier',
|
|
79
79
|
addFEOPAnnotations: 'addFEOPAnnotations',
|
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.
|
|
4
|
+
"version": "2.3.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"os-name": "4.0.1",
|
|
31
31
|
"@sap-ux/axios-extension": "1.20.0",
|
|
32
32
|
"@sap-ux/btp-utils": "1.0.3",
|
|
33
|
-
"@sap-ux/fiori-generator-shared": "0.
|
|
33
|
+
"@sap-ux/fiori-generator-shared": "0.11.0",
|
|
34
34
|
"@sap-ux/guided-answers-helper": "0.2.2",
|
|
35
|
-
"@sap-ux/telemetry": "0.5.
|
|
36
|
-
"@sap-ux/inquirer-common": "0.6.
|
|
35
|
+
"@sap-ux/telemetry": "0.5.75",
|
|
36
|
+
"@sap-ux/inquirer-common": "0.6.37",
|
|
37
37
|
"@sap-ux/logger": "0.6.0",
|
|
38
|
-
"@sap-ux/project-access": "1.29.
|
|
39
|
-
"@sap-ux/project-input-validator": "0.5.
|
|
38
|
+
"@sap-ux/project-access": "1.29.19",
|
|
39
|
+
"@sap-ux/project-input-validator": "0.5.2",
|
|
40
40
|
"@sap-ux/store": "1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -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.
|
|
50
|
-
"@sap-ux/fiori-elements-writer": "2.
|
|
51
|
-
"@sap-ux/fiori-freestyle-writer": "2.
|
|
49
|
+
"@sap-ux/fiori-generator-shared": "0.11.0",
|
|
50
|
+
"@sap-ux/fiori-elements-writer": "2.3.0",
|
|
51
|
+
"@sap-ux/fiori-freestyle-writer": "2.3.0",
|
|
52
52
|
"@sap-ux/feature-toggle": "0.2.3",
|
|
53
|
-
"@sap-ux/odata-service-writer": "0.26.
|
|
54
|
-
"@sap-ux/cap-config-writer": "0.9.
|
|
53
|
+
"@sap-ux/odata-service-writer": "0.26.14",
|
|
54
|
+
"@sap-ux/cap-config-writer": "0.9.26"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.x"
|