@sap-ux/odata-service-writer 0.30.1 → 0.31.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.
- package/dist/data/defaults.js +17 -11
- package/package.json +5 -5
package/dist/data/defaults.js
CHANGED
|
@@ -138,20 +138,26 @@ function setDefaultAnnotationsName(service) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Returns the preview settings for the app configuration based on the service configuration.
|
|
142
142
|
*
|
|
143
143
|
* @param {OdataService} service - the OData service instance
|
|
144
|
+
* @returns {FioriToolsProxyConfigBackend} preview settings
|
|
144
145
|
*/
|
|
145
|
-
function
|
|
146
|
+
function getPreviewSettings(service) {
|
|
147
|
+
const previewSettings = {
|
|
148
|
+
path: service.previewSettings?.path ?? `/${service.path?.split('/').find((s) => s !== '') ?? ''}`,
|
|
149
|
+
url: service.previewSettings?.url ?? service.url ?? 'http://localhost'
|
|
150
|
+
};
|
|
146
151
|
if (service.client && !service.previewSettings?.client) {
|
|
147
|
-
|
|
152
|
+
previewSettings.client = service.client;
|
|
148
153
|
}
|
|
149
154
|
if (service.destination && !service.previewSettings?.destination) {
|
|
150
|
-
|
|
155
|
+
previewSettings.destination = service.destination.name;
|
|
151
156
|
if (service.destination.instance) {
|
|
152
|
-
|
|
157
|
+
previewSettings.destinationInstance = service.destination.instance;
|
|
153
158
|
}
|
|
154
159
|
}
|
|
160
|
+
return previewSettings;
|
|
155
161
|
}
|
|
156
162
|
/**
|
|
157
163
|
* Preserves existing backend configuration when updating a service.
|
|
@@ -192,12 +198,12 @@ function adjustPreviewPathForNewService(service, backends) {
|
|
|
192
198
|
* @param {boolean} update - whether the service update is running (if true, preserves explicitly set previewSettings.path)
|
|
193
199
|
*/
|
|
194
200
|
async function setDefaultPreviewSettings(basePath, service, fs, update = false) {
|
|
195
|
-
|
|
196
|
-
const explicitPreviewPath = service.previewSettings
|
|
197
|
-
service.previewSettings
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
const previewSettings = getPreviewSettings(service);
|
|
202
|
+
const explicitPreviewPath = service.previewSettings?.path;
|
|
203
|
+
service.previewSettings = {
|
|
204
|
+
...previewSettings,
|
|
205
|
+
...service.previewSettings
|
|
206
|
+
};
|
|
201
207
|
const ui5Yamlpath = (0, node_path_1.join)(basePath, project_access_1.FileName.Ui5Yaml);
|
|
202
208
|
if (!fs.exists(ui5Yamlpath)) {
|
|
203
209
|
return;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aodata-service-writer"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.31.1",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"files": [
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"mem-fs-editor": "9.4.0",
|
|
30
30
|
"prettify-xml": "1.2.0",
|
|
31
31
|
"semver": "7.7.4",
|
|
32
|
-
"@sap-ux/mockserver-config-writer": "0.9.
|
|
33
|
-
"@sap-ux/project-access": "1.35.
|
|
34
|
-
"@sap-ux/ui5-config": "0.
|
|
32
|
+
"@sap-ux/mockserver-config-writer": "0.9.65",
|
|
33
|
+
"@sap-ux/project-access": "1.35.15",
|
|
34
|
+
"@sap-ux/ui5-config": "0.30.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@sap-ux/vocabularies-types": "0.15.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/semver": "7.7.1",
|
|
43
43
|
"fs-extra": "11.3.4",
|
|
44
44
|
"lodash": "4.17.23",
|
|
45
|
-
"@sap-ux/axios-extension": "1.25.
|
|
45
|
+
"@sap-ux/axios-extension": "1.25.25"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20.x"
|