@sap-ux/odata-service-writer 0.30.0 → 0.31.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.
@@ -138,20 +138,26 @@ function setDefaultAnnotationsName(service) {
138
138
  }
139
139
  }
140
140
  /**
141
- * Sets client and destination defaults for preview settings.
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 setClientAndDestinationDefaults(service) {
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
- service.previewSettings.client = service.client;
152
+ previewSettings.client = service.client;
148
153
  }
149
154
  if (service.destination && !service.previewSettings?.destination) {
150
- service.previewSettings.destination = service.destination.name;
155
+ previewSettings.destination = service.destination.name;
151
156
  if (service.destination.instance) {
152
- service.previewSettings.destinationInstance = service.destination.instance;
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
- service.previewSettings = service.previewSettings ?? {};
196
- const explicitPreviewPath = service.previewSettings.path;
197
- service.previewSettings.path =
198
- service.previewSettings.path ?? `/${service.path?.split('/').find((s) => s !== '') ?? ''}`;
199
- service.previewSettings.url = service.previewSettings.url ?? service.url ?? 'http://localhost';
200
- setClientAndDestinationDefaults(service);
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.30.0",
12
+ "version": "0.31.0",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [
@@ -24,14 +24,14 @@
24
24
  "@sap-ux/annotation-converter": "0.10.21",
25
25
  "ejs": "3.1.10",
26
26
  "fast-xml-parser": "5.4.1",
27
- "i18next": "25.8.12",
27
+ "i18next": "25.8.18",
28
28
  "mem-fs": "2.1.0",
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.62",
33
- "@sap-ux/project-access": "1.35.13",
34
- "@sap-ux/ui5-config": "0.29.21"
32
+ "@sap-ux/mockserver-config-writer": "0.9.64",
33
+ "@sap-ux/project-access": "1.35.14",
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.22"
45
+ "@sap-ux/axios-extension": "1.25.24"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=20.x"