@sap-ux/preview-middleware 0.23.149 → 0.23.151

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/base/flp.js CHANGED
@@ -873,7 +873,7 @@ class FlpSandbox {
873
873
  // CF ADP build path mode: serve built resources directly from build output
874
874
  if ('cfBuildPath' in config) {
875
875
  const manifest = this.setupCfBuildMode(config.cfBuildPath);
876
- configureRta(this.rta, layer, variant.id, false);
876
+ configureRta(this.rta, layer, variant.id, false, true);
877
877
  await this.init(manifest, variant.reference);
878
878
  this.setupAdpCommonHandlers(adp);
879
879
  return;
@@ -925,8 +925,9 @@ function serializeUi5Configuration(config) {
925
925
  * @param layer UI5 flex layer
926
926
  * @param variantId variant identifier
927
927
  * @param isCloud whether this is a cloud project
928
+ * @param isCloudFoundry whether this is a Cloud Foundry ADP scenario
928
929
  */
929
- function configureRta(rta, layer, variantId, isCloud) {
930
+ function configureRta(rta, layer, variantId, isCloud, isCloudFoundry) {
930
931
  if (!rta) {
931
932
  return;
932
933
  }
@@ -935,7 +936,8 @@ function configureRta(rta, layer, variantId, isCloud) {
935
936
  ...rta.options,
936
937
  projectId: variantId,
937
938
  scenario: 'ADAPTATION_PROJECT',
938
- isCloud
939
+ isCloud,
940
+ ...(isCloudFoundry !== undefined && { isCloudFoundry })
939
941
  };
940
942
  for (const editor of rta.endpoints) {
941
943
  editor.pluginScript ??= 'open/ux/preview/client/adp/init';
@@ -112,9 +112,19 @@ sap.ui.define(["sap/base/Log", "sap/ui/model/odata/v2/ODataModel", "sap/ui/model
112
112
  () => oModel.destroy());
113
113
  }
114
114
  getServices() {
115
- const manifest = this.rta.getRootControlInstance().getManifest();
115
+ const rootControl = this.rta.getRootControlInstance();
116
+ const manifest = rootControl.getManifest();
116
117
  const dataSources = manifest?.['sap.app']?.dataSources;
117
- return Object.values(dataSources ?? {}).filter(this.isOdataService).map(this.toOdataServiceInfo);
118
+ const odataServices = Object.values(dataSources ?? {}).filter(this.isOdataService);
119
+ const isCloudFoundry = !!this.rta.getFlexSettings().isCloudFoundry;
120
+ if (isCloudFoundry) {
121
+ const manifestObject = rootControl.getManifestObject();
122
+ return odataServices.map(src => ({
123
+ serviceUrl: manifestObject.resolveUri(src.uri),
124
+ oDataVersion: src.settings?.odataVersion ?? ODataHealthChecker.DEFAULT_ODATA_VERSION
125
+ }));
126
+ }
127
+ return odataServices.map(this.toOdataServiceInfo);
118
128
  }
119
129
  }
120
130
  var __exports = {
@@ -141,10 +141,20 @@ export class ODataHealthChecker {
141
141
  }
142
142
 
143
143
  private getServices(): ODataServiceInfo[] {
144
- const manifest: Manifest = this.rta.getRootControlInstance().getManifest() as unknown as Manifest;
144
+ const rootControl = this.rta.getRootControlInstance();
145
+ const manifest: Manifest = rootControl.getManifest() as unknown as Manifest;
145
146
  const dataSources = manifest?.['sap.app']?.dataSources;
146
- return Object.values(dataSources ?? {})
147
- .filter(this.isOdataService)
148
- .map(this.toOdataServiceInfo);
147
+ const odataServices = Object.values(dataSources ?? {}).filter(this.isOdataService);
148
+
149
+ const isCloudFoundry = !!this.rta.getFlexSettings().isCloudFoundry;
150
+ if (isCloudFoundry) {
151
+ const manifestObject = rootControl.getManifestObject();
152
+ return odataServices.map((src) => ({
153
+ serviceUrl: manifestObject.resolveUri(src.uri),
154
+ oDataVersion: (src.settings?.odataVersion ?? ODataHealthChecker.DEFAULT_ODATA_VERSION)
155
+ }));
156
+ }
157
+
158
+ return odataServices.map(this.toOdataServiceInfo);
149
159
  }
150
160
  }
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%3Apreview-middleware"
11
11
  },
12
- "version": "0.23.149",
12
+ "version": "0.23.151",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "qrcode": "1.5.4",
29
29
  "@sap/bas-sdk": "3.13.3",
30
- "@sap-ux/adp-tooling": "0.18.88",
30
+ "@sap-ux/adp-tooling": "0.18.90",
31
31
  "@sap-ux/btp-utils": "1.1.9",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.20",
33
33
  "@sap-ux/feature-toggle": "0.3.7",
@@ -53,7 +53,7 @@
53
53
  "nock": "13.4.0",
54
54
  "npm-run-all2": "8.0.4",
55
55
  "supertest": "7.2.2",
56
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.25",
56
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.26",
57
57
  "@sap-ux/axios-extension": "1.25.22",
58
58
  "@sap-ux/store": "1.5.9",
59
59
  "@sap-ux/ui5-info": "0.13.14"