@sap-ux/odata-service-inquirer 1.1.0 → 1.2.0
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.
- package/dist/prompts/datasources/sap-system/service-selection/questions.js +9 -1
- package/dist/prompts/datasources/sap-system/service-selection/service-helper.d.ts +2 -1
- package/dist/prompts/datasources/sap-system/service-selection/service-helper.js +9 -1
- package/dist/prompts/edmx/entity-helper.js +3 -1
- package/dist/translations/odata-service-inquirer.i18n.json +2 -1
- package/package.json +3 -3
|
@@ -81,7 +81,15 @@ function getSystemServiceQuestion(connectValidator, promptNamespace, promptOptio
|
|
|
81
81
|
}
|
|
82
82
|
return serviceChoices;
|
|
83
83
|
},
|
|
84
|
-
additionalMessages: (selectedService) =>
|
|
84
|
+
additionalMessages: (selectedService) => {
|
|
85
|
+
// Additional messages is executed after validation, so we can assume the PromptState has been updated
|
|
86
|
+
let hasBackendAnnotations = false;
|
|
87
|
+
if (selectedService && utils_1.PromptState.odataService.servicePath === selectedService.servicePath) {
|
|
88
|
+
hasBackendAnnotations =
|
|
89
|
+
!!utils_1.PromptState.odataService.annotations && utils_1.PromptState.odataService.annotations.length > 0;
|
|
90
|
+
}
|
|
91
|
+
return (0, service_helper_1.getSelectedServiceMessage)(serviceChoices, selectedService, connectValidator, requiredOdataVersion, hasBackendAnnotations);
|
|
92
|
+
},
|
|
85
93
|
default: () => (0, utils_1.getDefaultChoiceIndex)(serviceChoices),
|
|
86
94
|
// Warning: only executes in YUI and cli when automcomplete is used
|
|
87
95
|
validate: async (service) => {
|
|
@@ -65,7 +65,8 @@ export declare function getSelectedServiceLabel(username: string | undefined): s
|
|
|
65
65
|
* @param selectedService the selected service
|
|
66
66
|
* @param connectValidator the connection validator
|
|
67
67
|
* @param requiredOdataVersion the required OData version for the service
|
|
68
|
+
* @param hasAnnotations used to determine whether to show a warning message that annotations could not be retrieved
|
|
68
69
|
* @returns the service selection prompt additional message
|
|
69
70
|
*/
|
|
70
|
-
export declare function getSelectedServiceMessage(serviceChoices: ListChoiceOptions<ServiceAnswer>[], selectedService: ServiceAnswer, connectValidator: ConnectionValidator, requiredOdataVersion?: OdataVersion): Promise<IMessageSeverity | undefined>;
|
|
71
|
+
export declare function getSelectedServiceMessage(serviceChoices: ListChoiceOptions<ServiceAnswer>[], selectedService: ServiceAnswer, connectValidator: ConnectionValidator, requiredOdataVersion?: OdataVersion, hasAnnotations?: boolean): Promise<IMessageSeverity | undefined>;
|
|
71
72
|
//# sourceMappingURL=service-helper.d.ts.map
|
|
@@ -247,9 +247,10 @@ function getSelectedServiceLabel(username) {
|
|
|
247
247
|
* @param selectedService the selected service
|
|
248
248
|
* @param connectValidator the connection validator
|
|
249
249
|
* @param requiredOdataVersion the required OData version for the service
|
|
250
|
+
* @param hasAnnotations used to determine whether to show a warning message that annotations could not be retrieved
|
|
250
251
|
* @returns the service selection prompt additional message
|
|
251
252
|
*/
|
|
252
|
-
async function getSelectedServiceMessage(serviceChoices, selectedService, connectValidator, requiredOdataVersion) {
|
|
253
|
+
async function getSelectedServiceMessage(serviceChoices, selectedService, connectValidator, requiredOdataVersion, hasAnnotations = true) {
|
|
253
254
|
if (serviceChoices?.length === 0) {
|
|
254
255
|
if (requiredOdataVersion) {
|
|
255
256
|
return {
|
|
@@ -269,6 +270,13 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
|
|
|
269
270
|
if (selectedService) {
|
|
270
271
|
let serviceType = selectedService.serviceType;
|
|
271
272
|
if (selectedService.serviceODataVersion === axios_extension_1.ODataVersion.v2) {
|
|
273
|
+
// Warn if odata service is version is '2' and no annotations are present
|
|
274
|
+
if (!hasAnnotations) {
|
|
275
|
+
return {
|
|
276
|
+
message: (0, i18n_1.t)('prompts.warnings.noAnnotations'),
|
|
277
|
+
severity: yeoman_ui_types_1.Severity.warning
|
|
278
|
+
};
|
|
279
|
+
}
|
|
272
280
|
serviceType = await getServiceType(selectedService.servicePath, selectedService.serviceType, connectValidator.catalogs[axios_extension_1.ODataVersion.v2]);
|
|
273
281
|
}
|
|
274
282
|
if (serviceType && serviceType !== axios_extension_1.ServiceType.UI) {
|
|
@@ -130,13 +130,15 @@ function getNavigationEntityChoices(metadata, odataVersion, mainEntityName) {
|
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Returns only entity sets that have the `Aggregation.ApplySupported` annotation term with the `Transformations` property.
|
|
133
|
+
* This can be found within the entity set annotations or the entity type annotations.
|
|
133
134
|
*
|
|
134
135
|
* @param entitySets the entity sets to filter
|
|
135
136
|
* @returns the filtered entity sets
|
|
136
137
|
*/
|
|
137
138
|
function filterAggregateTransformations(entitySets) {
|
|
138
139
|
return entitySets.filter((entitySet) => {
|
|
139
|
-
return !!entitySet.annotations?.Aggregation?.ApplySupported?.Transformations
|
|
140
|
+
return (!!entitySet.annotations?.Aggregation?.ApplySupported?.Transformations ||
|
|
141
|
+
!!entitySet.entityType?.annotations?.Aggregation?.ApplySupported?.Transformations);
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
144
|
/**
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"warnings": {
|
|
64
64
|
"nonUIServiceTypeWarningMessage": "Please note that {{serviceType}} services, or not classified services, are not intended to be used for the generation of SAP Fiori UI applications",
|
|
65
65
|
"noServicesAvailable": "No services available for the selected system, see logs for further details.",
|
|
66
|
-
"noServicesAvailableForOdataVersion": "There are no V{{odataVersion}} OData services available from the selected system and the template you have chosen supports V{{odataVersion}} OData services only"
|
|
66
|
+
"noServicesAvailableForOdataVersion": "There are no V{{odataVersion}} OData services available from the selected system and the template you have chosen supports V{{odataVersion}} OData services only",
|
|
67
|
+
"noAnnotations": "No backend annotations associated with this service were retrieved and may result in an invalid application being created"
|
|
67
68
|
},
|
|
68
69
|
"systemUrl": {
|
|
69
70
|
"message": "System URL",
|
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": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"@sap-ux/guided-answers-helper": "0.2.0",
|
|
35
35
|
"@sap-ux/inquirer-common": "0.6.4",
|
|
36
36
|
"@sap-ux/telemetry": "0.5.51",
|
|
37
|
+
"@sap-ux/logger": "0.6.0",
|
|
37
38
|
"@sap-ux/project-input-validator": "0.3.4",
|
|
38
39
|
"@sap-ux/project-access": "1.29.0",
|
|
39
|
-
"@sap-ux/logger": "0.6.0",
|
|
40
40
|
"@sap-ux/store": "1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -46,10 +46,10 @@
|
|
|
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.19",
|
|
50
49
|
"@sap-ux/fiori-elements-writer": "2.0.0",
|
|
51
50
|
"@sap-ux/fiori-freestyle-writer": "2.0.0",
|
|
52
51
|
"@sap-ux/feature-toggle": "0.2.3",
|
|
52
|
+
"@sap-ux/fiori-generator-shared": "0.7.19",
|
|
53
53
|
"@sap-ux/odata-service-writer": "0.25.3"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|