@sap-ux/preview-middleware 0.16.174 → 0.17.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/base/flp.js CHANGED
@@ -238,6 +238,14 @@ class FlpSandbox {
238
238
  this.router.use(config_1.PREVIEW_URL.client.path, (0, express_1.static)(config_1.PREVIEW_URL.client.local));
239
239
  // add route for the sandbox html
240
240
  this.router.get(this.config.path, (async (req, res, next) => {
241
+ // karma (connect API) has no request query property
242
+ if (req.query && !req.query['sap-ui-xx-viewCache']) {
243
+ // Redirect to the same URL but add the necessary parameter
244
+ const params = structuredClone(req.query);
245
+ params['sap-ui-xx-viewCache'] = 'false';
246
+ res.redirect(302, `${this.config.path}?${new URLSearchParams(params)}`);
247
+ return;
248
+ }
241
249
  await this.setApplicationDependencies();
242
250
  // inform the user if a html file exists on the filesystem
243
251
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -9,12 +9,12 @@ sap.ui.define(["sap/ui/fl/LrepConnector", "sap/ui/fl/FakeLrepConnector", "./comm
9
9
  * Processes an array of FlexChange objects.
10
10
  * It updates each change object with settings and sends them to a API endpoint.
11
11
  *
12
- * @param {FlexChange[]} changes - Array of FlexChange objects to be processed.
12
+ * @param {FlexChange | FlexChange[]} changes - Array of FlexChange objects to be processed.
13
13
  * @returns {Promise<void>} A promise that resolves when all changes are processed.
14
14
  */
15
15
  async function create(changes) {
16
16
  const settings = getFlexSettings();
17
- await Promise.all(changes.map(change => {
17
+ await Promise.all((Array.isArray(changes) ? changes : [changes]).map(change => {
18
18
  if (settings) {
19
19
  change.support ??= {};
20
20
  change.support.generator = settings.generator;
@@ -25,13 +25,13 @@ interface LoadChangesResult {
25
25
  * Processes an array of FlexChange objects.
26
26
  * It updates each change object with settings and sends them to a API endpoint.
27
27
  *
28
- * @param {FlexChange[]} changes - Array of FlexChange objects to be processed.
28
+ * @param {FlexChange | FlexChange[]} changes - Array of FlexChange objects to be processed.
29
29
  * @returns {Promise<void>} A promise that resolves when all changes are processed.
30
30
  */
31
- export async function create(changes: FlexChange[]): Promise<void> {
31
+ export async function create(changes: FlexChange | FlexChange[]): Promise<void> {
32
32
  const settings = getFlexSettings();
33
33
  await Promise.all(
34
- changes.map((change) => {
34
+ (Array.isArray(changes) ? changes : [changes]).map((change) => {
35
35
  if (settings) {
36
36
  change.support ??= {};
37
37
  change.support.generator = settings.generator;
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.16.174",
12
+ "version": "0.17.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,9 +27,9 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "@sap-ux/logger": "0.6.0",
29
29
  "@sap-ux/feature-toggle": "0.2.3",
30
- "@sap-ux/adp-tooling": "0.12.112",
31
30
  "@sap-ux/btp-utils": "0.17.2",
32
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.32",
31
+ "@sap-ux/adp-tooling": "0.12.112",
32
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.33",
33
33
  "@sap-ux/project-access": "1.29.0"
34
34
  },
35
35
  "devDependencies": {
@@ -46,7 +46,7 @@
46
46
  "supertest": "6.3.3",
47
47
  "@sap-ux-private/playwright": "0.1.0",
48
48
  "dotenv": "16.3.1",
49
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.51",
49
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.52",
50
50
  "@sap-ux/axios-extension": "1.18.1",
51
51
  "@sap-ux/store": "1.0.0",
52
52
  "@sap-ux/ui5-info": "0.8.3",