@sap-ux/fiori-app-sub-generator 0.13.21 → 0.13.22
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.
|
@@ -6,6 +6,7 @@ const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
|
6
6
|
const fiori_app_generator_1 = require("../fiori-app-generator");
|
|
7
7
|
const i18n_1 = require("../utils/i18n");
|
|
8
8
|
const transforms_1 = require("./transforms");
|
|
9
|
+
const resolve_1 = require("./resolve");
|
|
9
10
|
/**
|
|
10
11
|
* Generator that allows the creation of a Fiori applications without prompting based on a provided app config.
|
|
11
12
|
*/
|
|
@@ -22,7 +23,11 @@ class FioriAppGeneratorHeadless extends fiori_app_generator_1.FioriAppGenerator
|
|
|
22
23
|
generatorVersion: this.rootGeneratorVersion()
|
|
23
24
|
}));
|
|
24
25
|
try {
|
|
25
|
-
|
|
26
|
+
const appConfig = this.options.appConfig;
|
|
27
|
+
if (appConfig.service?.externalServices) {
|
|
28
|
+
appConfig.service.externalServices = (0, resolve_1.resolveExternalServices)(appConfig.service.externalServices);
|
|
29
|
+
}
|
|
30
|
+
this.state = (0, transforms_1.transformExtState)(appConfig);
|
|
26
31
|
}
|
|
27
32
|
catch (error) {
|
|
28
33
|
this.log((0, i18n_1.t)('logMessages.generatorExiting'));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EntitySetData, ExternalService } from '@sap-ux/axios-extension';
|
|
2
|
+
import type { ExternalServiceConfig } from '@sap-ux/fiori-generator-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Returns inline XML, or reads and returns the contents of the file at the given path.
|
|
5
|
+
*
|
|
6
|
+
* @param metadata The metadata XML string or the path to the metadata file.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveMetadata(metadata: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns an inline array, or reads and parses the JSON file at the given path.
|
|
11
|
+
*
|
|
12
|
+
* @param entityData The entity data array or the path to the JSON file.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveEntityData(entityData: EntitySetData[] | string): EntitySetData[];
|
|
15
|
+
/**
|
|
16
|
+
* Resolves metadata and entityData entries based on their content.
|
|
17
|
+
*
|
|
18
|
+
* @param services External service configurations.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveExternalServices(services: ExternalServiceConfig[]): ExternalService[];
|
|
21
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveMetadata = resolveMetadata;
|
|
4
|
+
exports.resolveEntityData = resolveEntityData;
|
|
5
|
+
exports.resolveExternalServices = resolveExternalServices;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
/**
|
|
9
|
+
* Returns inline XML, or reads and returns the contents of the file at the given path.
|
|
10
|
+
*
|
|
11
|
+
* @param metadata The metadata XML string or the path to the metadata file.
|
|
12
|
+
*/
|
|
13
|
+
function resolveMetadata(metadata) {
|
|
14
|
+
if (metadata.trimStart().startsWith('<')) {
|
|
15
|
+
return metadata;
|
|
16
|
+
}
|
|
17
|
+
const filePath = (0, node_path_1.isAbsolute)(metadata) ? metadata : (0, node_path_1.resolve)(process.cwd(), metadata);
|
|
18
|
+
if (!(0, node_fs_1.existsSync)(filePath)) {
|
|
19
|
+
throw new Error(`Metadata file not found: ${filePath}`);
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return (0, node_fs_1.readFileSync)(filePath, 'utf-8');
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
throw new Error(`Failed to read metadata file: ${filePath}. ${error instanceof Error ? error.message : error}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns an inline array, or reads and parses the JSON file at the given path.
|
|
30
|
+
*
|
|
31
|
+
* @param entityData The entity data array or the path to the JSON file.
|
|
32
|
+
*/
|
|
33
|
+
function resolveEntityData(entityData) {
|
|
34
|
+
if (Array.isArray(entityData)) {
|
|
35
|
+
return entityData;
|
|
36
|
+
}
|
|
37
|
+
const filePath = (0, node_path_1.isAbsolute)(entityData) ? entityData : (0, node_path_1.resolve)(process.cwd(), entityData);
|
|
38
|
+
if (!(0, node_fs_1.existsSync)(filePath)) {
|
|
39
|
+
throw new Error(`Entity data file not found: ${filePath}`);
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse((0, node_fs_1.readFileSync)(filePath, 'utf-8'));
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw new Error(`Failed to read or parse entity data file: ${filePath}. ${error instanceof Error ? error.message : error}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolves metadata and entityData entries based on their content.
|
|
50
|
+
*
|
|
51
|
+
* @param services External service configurations.
|
|
52
|
+
*/
|
|
53
|
+
function resolveExternalServices(services) {
|
|
54
|
+
return services.map((entry) => ({
|
|
55
|
+
...entry,
|
|
56
|
+
metadata: resolveMetadata(entry.metadata),
|
|
57
|
+
entityData: entry.entityData ? resolveEntityData(entry.entityData) : undefined
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -139,7 +139,8 @@ function _setServiceDefaults(floorplan, service) {
|
|
|
139
139
|
servicePath: service?.servicePath,
|
|
140
140
|
client: service?.client,
|
|
141
141
|
edmx: service?.edmx,
|
|
142
|
-
version
|
|
142
|
+
version,
|
|
143
|
+
valueListMetadata: service?.externalServices
|
|
143
144
|
};
|
|
144
145
|
if (service?.destination) {
|
|
145
146
|
serviceDefaults.destinationName = service.destination;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-app-sub-generator",
|
|
3
3
|
"description": "A yeoman (sub) generator that can generate Fiori applications. Not for standalone use.",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.22",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
"uuid": "11.1.0",
|
|
31
31
|
"yeoman-generator": "5.10.0",
|
|
32
32
|
"@sap-ux/annotation-generator": "0.4.49",
|
|
33
|
-
"@sap-ux/axios-extension": "1.25.
|
|
33
|
+
"@sap-ux/axios-extension": "1.25.32",
|
|
34
34
|
"@sap-ux/btp-utils": "1.1.14",
|
|
35
|
-
"@sap-ux/cap-config-writer": "0.12.
|
|
35
|
+
"@sap-ux/cap-config-writer": "0.12.92",
|
|
36
36
|
"@sap-ux/feature-toggle": "0.3.8",
|
|
37
|
-
"@sap-ux/fiori-elements-writer": "2.8.
|
|
38
|
-
"@sap-ux/fiori-freestyle-writer": "2.5.
|
|
39
|
-
"@sap-ux/fiori-generator-shared": "0.13.
|
|
37
|
+
"@sap-ux/fiori-elements-writer": "2.8.127",
|
|
38
|
+
"@sap-ux/fiori-freestyle-writer": "2.5.96",
|
|
39
|
+
"@sap-ux/fiori-generator-shared": "0.13.100",
|
|
40
40
|
"@sap-ux/fiori-tools-settings": "0.2.3",
|
|
41
41
|
"@sap-ux/launch-config": "0.10.85",
|
|
42
|
-
"@sap-ux/odata-service-inquirer": "2.20.
|
|
42
|
+
"@sap-ux/odata-service-inquirer": "2.20.14",
|
|
43
43
|
"@sap-ux/odata-service-writer": "0.31.7",
|
|
44
44
|
"@sap-ux/project-access": "1.35.20",
|
|
45
45
|
"@sap-ux/store": "1.5.13",
|
|
46
46
|
"@sap-ux/telemetry": "0.6.99",
|
|
47
|
-
"@sap-ux/ui5-application-inquirer": "0.17.
|
|
47
|
+
"@sap-ux/ui5-application-inquirer": "0.17.15",
|
|
48
48
|
"@sap-ux/ui5-info": "0.13.20"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"mock-spawn": "0.2.6",
|
|
63
63
|
"rimraf": "6.1.3",
|
|
64
64
|
"yeoman-test": "6.3.0",
|
|
65
|
-
"@sap-ux/deploy-config-sub-generator": "0.5.
|
|
66
|
-
"@sap-ux/flp-config-sub-generator": "0.3.
|
|
67
|
-
"@sap-ux/inquirer-common": "0.11.
|
|
65
|
+
"@sap-ux/deploy-config-sub-generator": "0.5.146",
|
|
66
|
+
"@sap-ux/flp-config-sub-generator": "0.3.190",
|
|
67
|
+
"@sap-ux/inquirer-common": "0.11.39",
|
|
68
68
|
"@sap-ux/jest-file-matchers": "0.2.11",
|
|
69
69
|
"@sap-ux/logger": "0.8.5"
|
|
70
70
|
},
|