@sap-ux/preview-middleware 0.23.136 → 0.23.138

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.
Files changed (2) hide show
  1. package/dist/base/flp.js +7 -37
  2. package/package.json +5 -5
package/dist/base/flp.js CHANGED
@@ -1,44 +1,11 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.FlpSandbox = void 0;
37
4
  const mem_fs_1 = require("mem-fs");
38
5
  const mem_fs_editor_1 = require("mem-fs-editor");
39
6
  const ejs_1 = require("ejs");
40
7
  const express_1 = require("express");
41
- const node_path_1 = __importStar(require("node:path"));
8
+ const node_path_1 = require("node:path");
42
9
  const project_access_1 = require("@sap-ux/project-access");
43
10
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
44
11
  const btp_utils_1 = require("@sap-ux/btp-utils");
@@ -793,7 +760,9 @@ class FlpSandbox {
793
760
  async storeCardManifestHandler(req, res) {
794
761
  try {
795
762
  const { floorplan, localPath, fileName = project_access_1.FileName.Manifest, manifests } = req.body;
796
- const webappPath = await (0, project_access_1.getWebappPath)(node_path_1.default.resolve(), this.fs);
763
+ // getSourcePath() returns the webapp path directly for all project types
764
+ const webappPath = this.utils.getProject().getSourcePath();
765
+ const projectRoot = (0, node_path_1.dirname)(webappPath);
797
766
  const fullPath = (0, node_path_1.join)(webappPath, localPath);
798
767
  const filePath = fileName.endsWith('.json') ? (0, node_path_1.join)(fullPath, fileName) : `${(0, node_path_1.join)(fullPath, fileName)}.json`;
799
768
  const integrationCard = (0, cards_1.getIntegrationCard)(manifests);
@@ -811,7 +780,7 @@ class FlpSandbox {
811
780
  ]
812
781
  }
813
782
  };
814
- const appAccess = await (0, project_access_1.createApplicationAccess)(node_path_1.default.resolve(), this.fs);
783
+ const appAccess = await (0, project_access_1.createApplicationAccess)(projectRoot, this.fs);
815
784
  await appAccess.updateManifestJSON(this.manifest, this.fs);
816
785
  this.fs.commit(() => this.sendResponse(res, 'text/plain', 201, `Files were updated/created`));
817
786
  }
@@ -842,7 +811,8 @@ class FlpSandbox {
842
811
  */
843
812
  async storeI18nKeysHandler(req, res) {
844
813
  try {
845
- const webappPath = await (0, project_access_1.getWebappPath)(node_path_1.default.resolve(), this.fs);
814
+ // getSourcePath() returns the webapp path directly for all project types
815
+ const webappPath = this.utils.getProject().getSourcePath();
846
816
  const i18nConfig = this.manifest['sap.app'].i18n;
847
817
  let i18nPath = 'i18n/i18n.properties';
848
818
  let fallbackLocale;
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.136",
12
+ "version": "0.23.138",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,13 +27,13 @@
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.76",
30
+ "@sap-ux/adp-tooling": "0.18.77",
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.17",
33
33
  "@sap-ux/feature-toggle": "0.3.7",
34
34
  "@sap-ux/logger": "0.8.1",
35
- "@sap-ux/project-access": "1.35.9",
36
- "@sap-ux/system-access": "0.6.58",
35
+ "@sap-ux/project-access": "1.35.10",
36
+ "@sap-ux/system-access": "0.6.59",
37
37
  "@sap-ux/i18n": "0.3.9"
38
38
  },
39
39
  "devDependencies": {
@@ -54,7 +54,7 @@
54
54
  "npm-run-all2": "8.0.4",
55
55
  "supertest": "7.2.2",
56
56
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.23",
57
- "@sap-ux/axios-extension": "1.25.16",
57
+ "@sap-ux/axios-extension": "1.25.17",
58
58
  "@sap-ux/store": "1.5.8",
59
59
  "@sap-ux/ui5-info": "0.13.13"
60
60
  },