@sap-ux/odata-service-inquirer 2.5.33 → 2.6.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Annotations } from '@sap-ux/axios-extension';
|
|
2
2
|
import type { TemplateType } from '@sap-ux/fiori-elements-writer';
|
|
3
3
|
import type { Question } from 'inquirer';
|
|
4
|
-
import type { AlpTableConfigAnswers, AnnotationGenerationAnswers, EntityPromptOptions, EntitySelectionAnswers, TableConfigAnswers } from '../../types';
|
|
4
|
+
import type { AlpTableConfigAnswers, AnnotationGenerationAnswers, EntityPromptOptions, EntitySelectionAnswers, TableConfigAnswers, PageBuildingBlockAnswers } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Get the questions that may be used to prompt for entity selection and related information, table types, layout options and annotation generation.
|
|
7
7
|
*
|
|
@@ -13,5 +13,5 @@ import type { AlpTableConfigAnswers, AnnotationGenerationAnswers, EntityPromptOp
|
|
|
13
13
|
* If none are provided, or the odata version is not '2', the presentation variant qualifier prompt will not be shown.
|
|
14
14
|
* @returns the prompts used to provide input for system selection and a reference to the answers object which will be populated with the user's responses once `inquirer.prompt` returns
|
|
15
15
|
*/
|
|
16
|
-
export declare function getEntitySelectionQuestions(metadata: string, templateType: TemplateType, isCapService?: boolean, promptOptions?: EntityPromptOptions, annotations?: Annotations): Question<EntitySelectionAnswers & TableConfigAnswers & AnnotationGenerationAnswers & AlpTableConfigAnswers>[];
|
|
16
|
+
export declare function getEntitySelectionQuestions(metadata: string, templateType: TemplateType, isCapService?: boolean, promptOptions?: EntityPromptOptions, annotations?: Annotations): Question<EntitySelectionAnswers & TableConfigAnswers & AnnotationGenerationAnswers & AlpTableConfigAnswers & PageBuildingBlockAnswers>[];
|
|
17
17
|
//# sourceMappingURL=questions.d.ts.map
|
|
@@ -129,6 +129,9 @@ function getEntitySelectionQuestions(metadata, templateType, isCapService = fals
|
|
|
129
129
|
default: 0
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
if (promptOptions?.displayPageBuildingBlockPrompt) {
|
|
133
|
+
entityQuestions.push(...getPageBuildingBlockQuestions());
|
|
134
|
+
}
|
|
132
135
|
entityQuestions.push(...getAddAnnotationQuestions(metadata, templateType, odataVersion, isCapService));
|
|
133
136
|
if (!promptOptions?.hideTableLayoutPrompts) {
|
|
134
137
|
entityQuestions.push(...getTableLayoutQuestions(templateType, odataVersion, isCapService, convertedMetadata));
|
|
@@ -138,6 +141,36 @@ function getEntitySelectionQuestions(metadata, templateType, isCapService = fals
|
|
|
138
141
|
}
|
|
139
142
|
return entityQuestions;
|
|
140
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Get the questions for page building block.
|
|
146
|
+
*
|
|
147
|
+
* @returns the page building block questions
|
|
148
|
+
*/
|
|
149
|
+
function getPageBuildingBlockQuestions() {
|
|
150
|
+
const pageBuildingBlockQuestions = [];
|
|
151
|
+
pageBuildingBlockQuestions.push({
|
|
152
|
+
type: 'confirm',
|
|
153
|
+
name: types_1.EntityPromptNames.addPageBuildingBlock,
|
|
154
|
+
message: (0, i18n_1.t)('prompts.pageBuildingBlock.message'),
|
|
155
|
+
default: false,
|
|
156
|
+
guiOptions: {
|
|
157
|
+
breadcrumb: true
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
// If the user wants to add a Page Building Block, ask for the title
|
|
161
|
+
pageBuildingBlockQuestions.push({
|
|
162
|
+
when: (answers) => answers.addPageBuildingBlock === true,
|
|
163
|
+
type: 'input',
|
|
164
|
+
name: types_1.EntityPromptNames.pageBuildingBlockTitle,
|
|
165
|
+
message: (0, i18n_1.t)('prompts.pageBuildingBlock.titleMessage'),
|
|
166
|
+
guiOptions: {
|
|
167
|
+
breadcrumb: true,
|
|
168
|
+
mandatory: true
|
|
169
|
+
},
|
|
170
|
+
validate: (input) => !!input
|
|
171
|
+
});
|
|
172
|
+
return pageBuildingBlockQuestions;
|
|
173
|
+
}
|
|
141
174
|
/**
|
|
142
175
|
* Get the questions that may be used to prompt for table layout options.
|
|
143
176
|
*
|
|
@@ -144,6 +144,10 @@
|
|
|
144
144
|
"message": "Filter Entity",
|
|
145
145
|
"noEntitiesError": "$t(errors.noRelevantEntities)"
|
|
146
146
|
},
|
|
147
|
+
"pageBuildingBlock": {
|
|
148
|
+
"message": "Add a Page Building Block to the Application?",
|
|
149
|
+
"titleMessage": "Page Title"
|
|
150
|
+
},
|
|
147
151
|
"tableType": {
|
|
148
152
|
"message": "Table Type",
|
|
149
153
|
"hint": "Defines the table type for the list report page.",
|
package/dist/types.d.ts
CHANGED
|
@@ -150,6 +150,8 @@ export declare const EntityPromptNames: {
|
|
|
150
150
|
readonly mainEntity: "mainEntity";
|
|
151
151
|
readonly navigationEntity: "navigationEntity";
|
|
152
152
|
readonly filterEntitySet: "filterEntitySet";
|
|
153
|
+
readonly addPageBuildingBlock: "addPageBuildingBlock";
|
|
154
|
+
readonly pageBuildingBlockTitle: "pageBuildingBlockTitle";
|
|
153
155
|
readonly tableType: "tableType";
|
|
154
156
|
readonly hierarchyQualifier: "hierarchyQualifier";
|
|
155
157
|
readonly addFEOPAnnotations: "addFEOPAnnotations";
|
|
@@ -166,6 +168,15 @@ export interface EntitySelectionAnswers {
|
|
|
166
168
|
[EntityPromptNames.navigationEntity]?: NavigationEntityAnswer;
|
|
167
169
|
[EntityPromptNames.filterEntitySet]?: EntityAnswer;
|
|
168
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Answers related to the Page Building Block prompt.
|
|
173
|
+
*/
|
|
174
|
+
export interface PageBuildingBlockAnswers {
|
|
175
|
+
/** Indicates if the user wants to add a Page Building Block */
|
|
176
|
+
[EntityPromptNames.addPageBuildingBlock]?: boolean;
|
|
177
|
+
/** The title for the Page Building Block, required if addPageBuildingBlock is true */
|
|
178
|
+
[EntityPromptNames.pageBuildingBlockTitle]?: string;
|
|
179
|
+
}
|
|
169
180
|
export interface TableConfigAnswers {
|
|
170
181
|
[EntityPromptNames.tableType]?: TableType;
|
|
171
182
|
[EntityPromptNames.hierarchyQualifier]?: string;
|
|
@@ -184,7 +195,7 @@ export interface AlpTableConfigAnswers {
|
|
|
184
195
|
/**
|
|
185
196
|
* Convienience alias type for the entity related answers
|
|
186
197
|
*/
|
|
187
|
-
export type EntityRelatedAnswers = EntitySelectionAnswers & TableConfigAnswers & AnnotationGenerationAnswers & AlpTableConfigAnswers;
|
|
198
|
+
export type EntityRelatedAnswers = EntitySelectionAnswers & PageBuildingBlockAnswers & TableConfigAnswers & AnnotationGenerationAnswers & AlpTableConfigAnswers;
|
|
188
199
|
export interface CapServiceChoice extends ListChoiceOptions {
|
|
189
200
|
value: CapService;
|
|
190
201
|
}
|
|
@@ -344,6 +355,10 @@ export type EntityPromptOptions = {
|
|
|
344
355
|
* Hides the table layout related prompts when true, default is false.
|
|
345
356
|
*/
|
|
346
357
|
hideTableLayoutPrompts?: boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Used to determine if the display page building block prompt should be displayed.
|
|
360
|
+
*/
|
|
361
|
+
displayPageBuildingBlockPrompt?: boolean;
|
|
347
362
|
};
|
|
348
363
|
export {};
|
|
349
364
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
CHANGED
|
@@ -74,6 +74,8 @@ exports.EntityPromptNames = {
|
|
|
74
74
|
mainEntity: 'mainEntity',
|
|
75
75
|
navigationEntity: 'navigationEntity',
|
|
76
76
|
filterEntitySet: 'filterEntitySet',
|
|
77
|
+
addPageBuildingBlock: 'addPageBuildingBlock',
|
|
78
|
+
pageBuildingBlockTitle: 'pageBuildingBlockTitle',
|
|
77
79
|
tableType: 'tableType',
|
|
78
80
|
hierarchyQualifier: 'hierarchyQualifier',
|
|
79
81
|
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.6.1",
|
|
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.22.5",
|
|
33
33
|
"@sap-ux/btp-utils": "1.1.0",
|
|
34
|
-
"@sap-ux/fiori-generator-shared": "0.13.
|
|
34
|
+
"@sap-ux/fiori-generator-shared": "0.13.10",
|
|
35
35
|
"@sap-ux/guided-answers-helper": "0.4.0",
|
|
36
|
-
"@sap-ux/telemetry": "0.6.
|
|
37
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
36
|
+
"@sap-ux/telemetry": "0.6.17",
|
|
37
|
+
"@sap-ux/inquirer-common": "0.7.36",
|
|
38
38
|
"@sap-ux/logger": "0.7.0",
|
|
39
39
|
"@sap-ux/nodejs-utils": "0.2.2",
|
|
40
40
|
"@sap-ux/project-access": "1.30.12",
|
|
41
41
|
"@sap-ux/project-input-validator": "0.6.17",
|
|
42
|
-
"@sap-ux/store": "1.1.
|
|
42
|
+
"@sap-ux/store": "1.1.3"
|
|
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.
|
|
53
|
-
"@sap-ux/fiori-freestyle-writer": "2.4.
|
|
51
|
+
"@sap-ux/fiori-generator-shared": "0.13.10",
|
|
52
|
+
"@sap-ux/fiori-elements-writer": "2.6.2",
|
|
53
|
+
"@sap-ux/fiori-freestyle-writer": "2.4.38",
|
|
54
54
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
55
55
|
"@sap-ux/odata-service-writer": "0.27.17",
|
|
56
|
-
"@sap-ux/cap-config-writer": "0.
|
|
56
|
+
"@sap-ux/cap-config-writer": "0.12.1"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=20.x"
|