@sap-ux/fiori-mcp-server 0.2.0 → 0.2.2
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/index.js +506 -423
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -6256,8 +6256,8 @@ var require_constants = __commonJS({
|
|
|
6256
6256
|
"use strict";
|
|
6257
6257
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6258
6258
|
exports2.MinCdsVersionUi5Plugin = exports2.moduleCacheRoot = exports2.fioriToolsDirectory = exports2.SchemaName = exports2.FioriToolsSettings = exports2.DirName = exports2.FileName = void 0;
|
|
6259
|
-
var
|
|
6260
|
-
var
|
|
6259
|
+
var node_os_1 = require("node:os");
|
|
6260
|
+
var node_path_1 = require("node:path");
|
|
6261
6261
|
exports2.FileName = {
|
|
6262
6262
|
AdaptationConfig: "config.json",
|
|
6263
6263
|
CapJavaApplicationYaml: "application.yaml",
|
|
@@ -6313,8 +6313,8 @@ var require_constants = __commonJS({
|
|
|
6313
6313
|
exports2.SchemaName = {
|
|
6314
6314
|
Ftfs: "ftfs"
|
|
6315
6315
|
};
|
|
6316
|
-
exports2.fioriToolsDirectory = (0,
|
|
6317
|
-
exports2.moduleCacheRoot = (0,
|
|
6316
|
+
exports2.fioriToolsDirectory = (0, node_path_1.join)((0, node_os_1.homedir)(), exports2.FioriToolsSettings.dir);
|
|
6317
|
+
exports2.moduleCacheRoot = (0, node_path_1.join)(exports2.fioriToolsDirectory, exports2.DirName.ModuleCache);
|
|
6318
6318
|
exports2.MinCdsVersionUi5Plugin = "6.8.2";
|
|
6319
6319
|
}
|
|
6320
6320
|
});
|
|
@@ -6441,13 +6441,13 @@ var require_file_access = __commonJS({
|
|
|
6441
6441
|
exports2.deleteFile = deleteFile;
|
|
6442
6442
|
exports2.readDirectory = readDirectory;
|
|
6443
6443
|
exports2.deleteDirectory = deleteDirectory;
|
|
6444
|
-
var
|
|
6444
|
+
var node_fs_1 = require("node:fs");
|
|
6445
6445
|
var json_parse_even_better_errors_1 = __importDefault(require_lib());
|
|
6446
6446
|
async function readFile2(path5, memFs) {
|
|
6447
6447
|
if (memFs) {
|
|
6448
6448
|
return memFs.read(path5);
|
|
6449
6449
|
} else {
|
|
6450
|
-
return
|
|
6450
|
+
return node_fs_1.promises.readFile(path5, { encoding: "utf8" });
|
|
6451
6451
|
}
|
|
6452
6452
|
}
|
|
6453
6453
|
async function readJSON(path5, memFs) {
|
|
@@ -6461,14 +6461,14 @@ var require_file_access = __commonJS({
|
|
|
6461
6461
|
if (memFs) {
|
|
6462
6462
|
return memFs.write(path5, content);
|
|
6463
6463
|
}
|
|
6464
|
-
return
|
|
6464
|
+
return node_fs_1.promises.writeFile(path5, content, { encoding: "utf8" });
|
|
6465
6465
|
}
|
|
6466
6466
|
async function fileExists(path5, memFs) {
|
|
6467
6467
|
try {
|
|
6468
6468
|
if (memFs) {
|
|
6469
6469
|
return memFs.exists(path5);
|
|
6470
6470
|
} else {
|
|
6471
|
-
await
|
|
6471
|
+
await node_fs_1.promises.access(path5);
|
|
6472
6472
|
return true;
|
|
6473
6473
|
}
|
|
6474
6474
|
} catch {
|
|
@@ -6492,16 +6492,16 @@ var require_file_access = __commonJS({
|
|
|
6492
6492
|
if (memFs) {
|
|
6493
6493
|
return memFs.delete(path5);
|
|
6494
6494
|
}
|
|
6495
|
-
return
|
|
6495
|
+
return node_fs_1.promises.unlink(path5);
|
|
6496
6496
|
}
|
|
6497
6497
|
async function readDirectory(path5) {
|
|
6498
|
-
return
|
|
6498
|
+
return node_fs_1.promises.readdir(path5, { encoding: "utf8" });
|
|
6499
6499
|
}
|
|
6500
6500
|
async function deleteDirectory(path5, memFs) {
|
|
6501
6501
|
if (memFs) {
|
|
6502
6502
|
return memFs.delete(path5);
|
|
6503
6503
|
}
|
|
6504
|
-
return
|
|
6504
|
+
return node_fs_1.promises.rm(path5, { recursive: true, force: true });
|
|
6505
6505
|
}
|
|
6506
6506
|
}
|
|
6507
6507
|
});
|
|
@@ -6632,20 +6632,20 @@ var require_file_search = __commonJS({
|
|
|
6632
6632
|
exports2.findFilesByExtension = findFilesByExtension;
|
|
6633
6633
|
exports2.findFileUp = findFileUp;
|
|
6634
6634
|
exports2.getFilePaths = getFilePaths;
|
|
6635
|
-
var
|
|
6635
|
+
var node_path_1 = require("node:path");
|
|
6636
6636
|
var findit2_1 = __importDefault(require_findit2());
|
|
6637
6637
|
var file_access_1 = require_file_access();
|
|
6638
|
-
var
|
|
6638
|
+
var node_fs_1 = require("node:fs");
|
|
6639
6639
|
function getMemFsChanges(changes, fileNames, extensionNames, root) {
|
|
6640
6640
|
const deleted = [];
|
|
6641
6641
|
const modified = [];
|
|
6642
|
-
const filteredChanges = Object.keys(changes).filter((f) => f.startsWith(root.replaceAll(
|
|
6642
|
+
const filteredChanges = Object.keys(changes).filter((f) => f.startsWith(root.replaceAll(node_path_1.sep, node_path_1.posix.sep)) && (fileNames.includes((0, node_path_1.basename)(f)) || extensionNames.includes((0, node_path_1.extname)(f)) || fileNames.length === 0 && extensionNames.length === 0));
|
|
6643
6643
|
for (const file of filteredChanges) {
|
|
6644
6644
|
if (changes[file].state === "deleted") {
|
|
6645
|
-
deleted.push((0,
|
|
6645
|
+
deleted.push((0, node_path_1.join)(file));
|
|
6646
6646
|
}
|
|
6647
6647
|
if (changes[file].state === "modified") {
|
|
6648
|
-
modified.push((0,
|
|
6648
|
+
modified.push((0, node_path_1.join)(file));
|
|
6649
6649
|
}
|
|
6650
6650
|
}
|
|
6651
6651
|
return { deleted, modified };
|
|
@@ -6671,13 +6671,13 @@ var require_file_search = __commonJS({
|
|
|
6671
6671
|
const errors = [];
|
|
6672
6672
|
const finder = (0, findit2_1.default)(options2.root);
|
|
6673
6673
|
finder.on("directory", (dir2, _stat, stop) => {
|
|
6674
|
-
const base = (0,
|
|
6674
|
+
const base = (0, node_path_1.basename)(dir2);
|
|
6675
6675
|
if (excludeFolders.includes(base) || noTraversal && dir2 !== options2.root) {
|
|
6676
6676
|
stop();
|
|
6677
6677
|
}
|
|
6678
6678
|
});
|
|
6679
6679
|
finder.on("file", (file) => {
|
|
6680
|
-
if (extensionNames.includes((0,
|
|
6680
|
+
if (extensionNames.includes((0, node_path_1.extname)(file)) || fileNames.includes((0, node_path_1.basename)(file)) || fileNames.length === 0 && extensionNames.length === 0) {
|
|
6681
6681
|
results.push(file);
|
|
6682
6682
|
}
|
|
6683
6683
|
});
|
|
@@ -6696,24 +6696,24 @@ var require_file_search = __commonJS({
|
|
|
6696
6696
|
}
|
|
6697
6697
|
async function findFiles(filename, root, excludeFolders, memFs) {
|
|
6698
6698
|
const results = await findBy({ fileNames: [filename], root, excludeFolders, memFs });
|
|
6699
|
-
return results.map((f) => (0,
|
|
6699
|
+
return results.map((f) => (0, node_path_1.dirname)(f));
|
|
6700
6700
|
}
|
|
6701
6701
|
function findFilesByExtension(extension, root, excludeFolders, memFs, noTraversal) {
|
|
6702
6702
|
return findBy({ extensionNames: [extension], root, excludeFolders, noTraversal, memFs });
|
|
6703
6703
|
}
|
|
6704
6704
|
async function findFileUp(fileName, startPath, fs5) {
|
|
6705
|
-
const filePath = (0,
|
|
6705
|
+
const filePath = (0, node_path_1.join)(startPath, fileName);
|
|
6706
6706
|
if (await (0, file_access_1.fileExists)(filePath, fs5)) {
|
|
6707
6707
|
return filePath;
|
|
6708
6708
|
} else {
|
|
6709
|
-
return (0,
|
|
6709
|
+
return (0, node_path_1.dirname)(startPath) !== startPath ? findFileUp(fileName, (0, node_path_1.dirname)(startPath), fs5) : void 0;
|
|
6710
6710
|
}
|
|
6711
6711
|
}
|
|
6712
6712
|
async function getFilePaths(dir2) {
|
|
6713
|
-
const entries = await
|
|
6713
|
+
const entries = await node_fs_1.promises.readdir(dir2);
|
|
6714
6714
|
const filePathsPromises = entries.map(async (entry) => {
|
|
6715
|
-
const entryPath = (0,
|
|
6716
|
-
const isDirectory = (await
|
|
6715
|
+
const entryPath = (0, node_path_1.join)(dir2, entry);
|
|
6716
|
+
const isDirectory = (await node_fs_1.promises.stat(entryPath)).isDirectory();
|
|
6717
6717
|
return isDirectory ? getFilePaths(entryPath) : entryPath;
|
|
6718
6718
|
});
|
|
6719
6719
|
const filePaths = await Promise.all(filePathsPromises);
|
|
@@ -6783,34 +6783,34 @@ var require_dependencies2 = __commonJS({
|
|
|
6783
6783
|
exports2.hasDependency = void 0;
|
|
6784
6784
|
exports2.getNodeModulesPath = getNodeModulesPath;
|
|
6785
6785
|
exports2.addPackageDevDependency = addPackageDevDependency;
|
|
6786
|
-
var
|
|
6787
|
-
var
|
|
6786
|
+
var node_fs_1 = require("node:fs");
|
|
6787
|
+
var node_path_1 = require("node:path");
|
|
6788
6788
|
var constants_1 = require_constants();
|
|
6789
6789
|
var file_1 = require_file();
|
|
6790
6790
|
var hasDependency = (packageJson, dependency) => !!(packageJson.dependencies?.[dependency] ?? packageJson.devDependencies?.[dependency]);
|
|
6791
6791
|
exports2.hasDependency = hasDependency;
|
|
6792
6792
|
function getNodeModulesPath(projectRoot, module3) {
|
|
6793
|
-
if (!(0,
|
|
6793
|
+
if (!(0, node_path_1.isAbsolute)(projectRoot)) {
|
|
6794
6794
|
return void 0;
|
|
6795
6795
|
}
|
|
6796
|
-
const { root } = (0,
|
|
6796
|
+
const { root } = (0, node_path_1.parse)(projectRoot);
|
|
6797
6797
|
let currentDir = projectRoot;
|
|
6798
6798
|
let modulesPath;
|
|
6799
6799
|
while (currentDir !== root) {
|
|
6800
|
-
let checkPath = (0,
|
|
6800
|
+
let checkPath = (0, node_path_1.join)(currentDir, "node_modules");
|
|
6801
6801
|
if (module3) {
|
|
6802
|
-
checkPath = (0,
|
|
6802
|
+
checkPath = (0, node_path_1.join)(checkPath, module3, constants_1.FileName.Package);
|
|
6803
6803
|
}
|
|
6804
|
-
if ((0,
|
|
6804
|
+
if ((0, node_fs_1.existsSync)(checkPath)) {
|
|
6805
6805
|
modulesPath = currentDir;
|
|
6806
6806
|
break;
|
|
6807
6807
|
}
|
|
6808
|
-
currentDir = (0,
|
|
6808
|
+
currentDir = (0, node_path_1.dirname)(currentDir);
|
|
6809
6809
|
}
|
|
6810
6810
|
return modulesPath;
|
|
6811
6811
|
}
|
|
6812
6812
|
async function addPackageDevDependency(basePath, depName, depVersion, fs5) {
|
|
6813
|
-
const filePath = (0,
|
|
6813
|
+
const filePath = (0, node_path_1.join)(basePath, constants_1.FileName.Package);
|
|
6814
6814
|
const packageJson = await (0, file_1.readJSON)(filePath, fs5);
|
|
6815
6815
|
packageJson.devDependencies = packageJson.devDependencies ?? {};
|
|
6816
6816
|
if (!packageJson.devDependencies[depName]) {
|
|
@@ -6925,9 +6925,9 @@ var require_module_loader = __commonJS({
|
|
|
6925
6925
|
exports2.loadModuleFromProject = loadModuleFromProject;
|
|
6926
6926
|
exports2.getModule = getModule;
|
|
6927
6927
|
exports2.deleteModule = deleteModule;
|
|
6928
|
-
var
|
|
6928
|
+
var node_fs_1 = require("node:fs");
|
|
6929
6929
|
var promises_1 = require("fs/promises");
|
|
6930
|
-
var
|
|
6930
|
+
var node_path_1 = require("node:path");
|
|
6931
6931
|
var dependencies_1 = require_dependencies2();
|
|
6932
6932
|
var constants_1 = require_constants();
|
|
6933
6933
|
var command_1 = require_command();
|
|
@@ -6950,11 +6950,11 @@ ${error2.toString()}`);
|
|
|
6950
6950
|
}
|
|
6951
6951
|
async function getModule(module3, version3, options2) {
|
|
6952
6952
|
const logger4 = options2?.logger;
|
|
6953
|
-
const moduleDirectory = (0,
|
|
6954
|
-
const modulePackagePath = (0,
|
|
6953
|
+
const moduleDirectory = (0, node_path_1.join)(constants_1.moduleCacheRoot, module3, version3);
|
|
6954
|
+
const modulePackagePath = (0, node_path_1.join)(moduleDirectory, constants_1.FileName.Package);
|
|
6955
6955
|
const installCommand = ["install", "--prefix", moduleDirectory, `${module3}@${version3}`];
|
|
6956
|
-
if (!(0,
|
|
6957
|
-
if ((0,
|
|
6956
|
+
if (!(0, node_fs_1.existsSync)(modulePackagePath)) {
|
|
6957
|
+
if ((0, node_fs_1.existsSync)(moduleDirectory)) {
|
|
6958
6958
|
await (0, promises_1.rm)(moduleDirectory, { recursive: true });
|
|
6959
6959
|
}
|
|
6960
6960
|
await (0, promises_1.mkdir)(moduleDirectory, { recursive: true });
|
|
@@ -6968,8 +6968,8 @@ ${error2.toString()}`);
|
|
|
6968
6968
|
resolvedModule = await loadModuleFromProject(moduleDirectory, module3);
|
|
6969
6969
|
} catch (e) {
|
|
6970
6970
|
logger4?.error(`Failed to load module: ${module3}. Attempting to fix installation.`);
|
|
6971
|
-
const modulePackageLockPath = (0,
|
|
6972
|
-
const command2 = (0,
|
|
6971
|
+
const modulePackageLockPath = (0, node_path_1.join)(moduleDirectory, constants_1.FileName.PackageLock);
|
|
6972
|
+
const command2 = (0, node_fs_1.existsSync)(modulePackageLockPath) ? ["ci"] : installCommand;
|
|
6973
6973
|
await (0, command_1.execNpmCommand)(command2, {
|
|
6974
6974
|
cwd: moduleDirectory,
|
|
6975
6975
|
logger: logger4
|
|
@@ -6979,8 +6979,8 @@ ${error2.toString()}`);
|
|
|
6979
6979
|
return resolvedModule;
|
|
6980
6980
|
}
|
|
6981
6981
|
async function deleteModule(module3, version3) {
|
|
6982
|
-
const moduleDirectory = (0,
|
|
6983
|
-
if ((0,
|
|
6982
|
+
const moduleDirectory = (0, node_path_1.join)(constants_1.moduleCacheRoot, module3, version3);
|
|
6983
|
+
if ((0, node_fs_1.existsSync)(moduleDirectory)) {
|
|
6984
6984
|
await (0, promises_1.rm)(moduleDirectory, { recursive: true });
|
|
6985
6985
|
}
|
|
6986
6986
|
}
|
|
@@ -16079,7 +16079,7 @@ var require_yaml_document = __commonJS({
|
|
|
16079
16079
|
* @memberof YamlDocument
|
|
16080
16080
|
*/
|
|
16081
16081
|
toPathArray(path5) {
|
|
16082
|
-
const result = path5?.toString().split(".").filter((p) => p !== "").map((p) => isNaN(Number(p)) ? p : Number(p));
|
|
16082
|
+
const result = path5?.toString().split(".").filter((p) => p !== "").map((p) => Number.isNaN(Number(p)) ? p : Number(p));
|
|
16083
16083
|
if (!result || result.length === 0) {
|
|
16084
16084
|
throw new errors_1.YAMLError(errors_1.errorTemplate.pathCannotBeEmpty, errors_1.errorCode.pathCannotBeEmpty);
|
|
16085
16085
|
}
|
|
@@ -16130,7 +16130,7 @@ var require_middlewares = __commonJS({
|
|
|
16130
16130
|
exports2.getPreviewMiddlewareConfig = getPreviewMiddlewareConfig;
|
|
16131
16131
|
exports2.getBackendComments = getBackendComments;
|
|
16132
16132
|
exports2.getFioriToolsProxyMiddlewareConfig = getFioriToolsProxyMiddlewareConfig;
|
|
16133
|
-
var
|
|
16133
|
+
var node_path_1 = require("node:path");
|
|
16134
16134
|
function getAppReloadMiddlewareConfig() {
|
|
16135
16135
|
return {
|
|
16136
16136
|
name: "fiori-tools-appreload",
|
|
@@ -16215,7 +16215,7 @@ var require_middlewares = __commonJS({
|
|
|
16215
16215
|
var getMockServerMiddlewareConfig = (basePath, webappPath, dataSourcesConfig, annotationsConfig) => {
|
|
16216
16216
|
const services = [];
|
|
16217
16217
|
dataSourcesConfig.forEach((dataSource) => {
|
|
16218
|
-
const serviceRoot = `.${
|
|
16218
|
+
const serviceRoot = `.${node_path_1.posix.sep}${(0, node_path_1.relative)(basePath, (0, node_path_1.join)(webappPath, "localService", dataSource.serviceName)).replaceAll(node_path_1.sep, node_path_1.posix.sep)}`;
|
|
16219
16219
|
const newServiceData = {
|
|
16220
16220
|
urlPath: dataSource.servicePath.replace(/\/$/, ""),
|
|
16221
16221
|
// Mockserver is sensitive to trailing '/'
|
|
@@ -25408,7 +25408,7 @@ var require_ui5config = __commonJS({
|
|
|
25408
25408
|
var middlewares_1 = require_middlewares();
|
|
25409
25409
|
var constants_1 = require_constants2();
|
|
25410
25410
|
var ajv_1 = __importDefault(require_ajv2());
|
|
25411
|
-
var
|
|
25411
|
+
var node_path_1 = require("node:path");
|
|
25412
25412
|
var promises_1 = require("fs/promises");
|
|
25413
25413
|
var js_yaml_1 = __importDefault(require_js_yaml());
|
|
25414
25414
|
var UI5Config = class _UI5Config {
|
|
@@ -25421,7 +25421,7 @@ var require_ui5config = __commonJS({
|
|
|
25421
25421
|
*/
|
|
25422
25422
|
async validateSchema() {
|
|
25423
25423
|
if (!_UI5Config.validate) {
|
|
25424
|
-
const path5 = (0,
|
|
25424
|
+
const path5 = (0, node_path_1.join)(__dirname, "..", "dist", "schema", "ui5.yaml.json");
|
|
25425
25425
|
const schema = JSON.parse(await (0, promises_1.readFile)(path5, "utf8"));
|
|
25426
25426
|
if (!schema) {
|
|
25427
25427
|
throw Error("The schema file was not found. Validation is not possible.");
|
|
@@ -25824,7 +25824,7 @@ var require_ui5config = __commonJS({
|
|
|
25824
25824
|
if (!mockserverMiddleware) {
|
|
25825
25825
|
throw new Error("Could not find sap-fe-mockserver");
|
|
25826
25826
|
} else {
|
|
25827
|
-
const serviceRoot = `.${
|
|
25827
|
+
const serviceRoot = `.${node_path_1.posix.sep}${(0, node_path_1.relative)(basePath, (0, node_path_1.join)(webappPath, "localService", dataSourceConfig.serviceName)).replaceAll(node_path_1.sep, node_path_1.posix.sep)}`;
|
|
25828
25828
|
const mockserverMiddlewareConfig = mockserverMiddleware?.configuration;
|
|
25829
25829
|
if (mockserverMiddlewareConfig?.services) {
|
|
25830
25830
|
const urlPath = dataSourceConfig.servicePath.replace(/\/$/, "");
|
|
@@ -28754,13 +28754,13 @@ var require_ui5_config = __commonJS({
|
|
|
28754
28754
|
exports2.getAllUi5YamlFileNames = getAllUi5YamlFileNames;
|
|
28755
28755
|
exports2.getMockServerConfig = getMockServerConfig;
|
|
28756
28756
|
exports2.getMockDataPath = getMockDataPath;
|
|
28757
|
-
var
|
|
28757
|
+
var node_path_1 = require("node:path");
|
|
28758
28758
|
var ui5_config_1 = require_dist3();
|
|
28759
28759
|
var constants_1 = require_constants();
|
|
28760
28760
|
var file_1 = require_file();
|
|
28761
28761
|
async function getWebappPath2(appRoot, memFs) {
|
|
28762
|
-
const ui5YamlPath = (0,
|
|
28763
|
-
let webappPath = (0,
|
|
28762
|
+
const ui5YamlPath = (0, node_path_1.join)(appRoot, constants_1.FileName.Ui5Yaml);
|
|
28763
|
+
let webappPath = (0, node_path_1.join)(appRoot, constants_1.DirName.Webapp);
|
|
28764
28764
|
if (await (0, file_1.fileExists)(ui5YamlPath, memFs)) {
|
|
28765
28765
|
const yamlString = await (0, file_1.readFile)(ui5YamlPath, memFs);
|
|
28766
28766
|
const ui5Config = await ui5_config_1.UI5Config.newInstance(yamlString);
|
|
@@ -28768,15 +28768,15 @@ var require_ui5_config = __commonJS({
|
|
|
28768
28768
|
if (relativeWebappPath) {
|
|
28769
28769
|
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, appRoot, memFs);
|
|
28770
28770
|
if (packageJsonPath) {
|
|
28771
|
-
const packageJsonDirPath = (0,
|
|
28772
|
-
webappPath = (0,
|
|
28771
|
+
const packageJsonDirPath = (0, node_path_1.dirname)(packageJsonPath);
|
|
28772
|
+
webappPath = (0, node_path_1.join)(packageJsonDirPath, relativeWebappPath);
|
|
28773
28773
|
}
|
|
28774
28774
|
}
|
|
28775
28775
|
}
|
|
28776
28776
|
return webappPath;
|
|
28777
28777
|
}
|
|
28778
28778
|
async function readUi5Yaml(projectRoot, fileName, memFs, options2) {
|
|
28779
|
-
const ui5YamlPath = (0,
|
|
28779
|
+
const ui5YamlPath = (0, node_path_1.join)(projectRoot, fileName);
|
|
28780
28780
|
if (await (0, file_1.fileExists)(ui5YamlPath, memFs)) {
|
|
28781
28781
|
const yamlString = await (0, file_1.readFile)(ui5YamlPath, memFs);
|
|
28782
28782
|
return await ui5_config_1.UI5Config.newInstance(yamlString, { validateSchema: options2?.validateSchema });
|
|
@@ -28786,7 +28786,7 @@ var require_ui5_config = __commonJS({
|
|
|
28786
28786
|
async function getAllUi5YamlFileNames(projectRoot, memFs) {
|
|
28787
28787
|
try {
|
|
28788
28788
|
const yamlFilePaths = await (0, file_1.findFilesByExtension)(".yaml", projectRoot, [], memFs, true);
|
|
28789
|
-
return yamlFilePaths.map((path5) => (0,
|
|
28789
|
+
return yamlFilePaths.map((path5) => (0, node_path_1.basename)(path5));
|
|
28790
28790
|
} catch (error2) {
|
|
28791
28791
|
throw new Error(`There was an error reading files from the directory '${projectRoot}': ${error2}`);
|
|
28792
28792
|
}
|
|
@@ -28832,7 +28832,7 @@ var require_search = __commonJS({
|
|
|
28832
28832
|
exports2.findAllApps = findAllApps;
|
|
28833
28833
|
exports2.findFioriArtifacts = findFioriArtifacts2;
|
|
28834
28834
|
exports2.findCapProjects = findCapProjects;
|
|
28835
|
-
var
|
|
28835
|
+
var node_path_1 = require("node:path");
|
|
28836
28836
|
var constants_1 = require_constants();
|
|
28837
28837
|
var file_1 = require_file();
|
|
28838
28838
|
var dependencies_1 = require_dependencies2();
|
|
@@ -28869,11 +28869,11 @@ var require_search = __commonJS({
|
|
|
28869
28869
|
}
|
|
28870
28870
|
throw new Error(`Could not find any project root for '${path5}'. Search was done for ${sapuxRequired ? "Fiori elements" : "All"} projects.`);
|
|
28871
28871
|
}
|
|
28872
|
-
let root = (0,
|
|
28872
|
+
let root = (0, node_path_1.dirname)(packageJson);
|
|
28873
28873
|
if (sapuxRequired) {
|
|
28874
28874
|
const sapux = (await (0, file_1.readJSON)(packageJson, memFs)).sapux;
|
|
28875
28875
|
if (!sapux) {
|
|
28876
|
-
root = await findProjectRoot2((0,
|
|
28876
|
+
root = await findProjectRoot2((0, node_path_1.dirname)(root), sapuxRequired, silent, memFs);
|
|
28877
28877
|
}
|
|
28878
28878
|
}
|
|
28879
28879
|
return root;
|
|
@@ -28885,12 +28885,12 @@ var require_search = __commonJS({
|
|
|
28885
28885
|
projectRoot: root
|
|
28886
28886
|
};
|
|
28887
28887
|
} else if (Array.isArray(sapux)) {
|
|
28888
|
-
const pathWithSep = path5.endsWith(
|
|
28889
|
-
const relAppPaths = sapux.map((a) => (0,
|
|
28890
|
-
const relApp = relAppPaths.find((app) => pathWithSep.startsWith((0,
|
|
28888
|
+
const pathWithSep = path5.endsWith(node_path_1.sep) ? path5 : path5 + node_path_1.sep;
|
|
28889
|
+
const relAppPaths = sapux.map((a) => (0, node_path_1.join)(...a.split(/[\\/]/)));
|
|
28890
|
+
const relApp = relAppPaths.find((app) => pathWithSep.startsWith((0, node_path_1.join)(root, app) + node_path_1.sep));
|
|
28891
28891
|
if (relApp) {
|
|
28892
28892
|
return {
|
|
28893
|
-
appRoot: (0,
|
|
28893
|
+
appRoot: (0, node_path_1.join)(root, relApp),
|
|
28894
28894
|
projectRoot: root
|
|
28895
28895
|
};
|
|
28896
28896
|
}
|
|
@@ -28899,9 +28899,9 @@ var require_search = __commonJS({
|
|
|
28899
28899
|
}
|
|
28900
28900
|
async function getAppRootFromWebappPath(webappPath) {
|
|
28901
28901
|
const ui5YamlPath = await (0, file_1.findFileUp)(constants_1.FileName.Ui5Yaml, webappPath);
|
|
28902
|
-
let appRoot = (0,
|
|
28902
|
+
let appRoot = (0, node_path_1.dirname)(webappPath);
|
|
28903
28903
|
if (ui5YamlPath) {
|
|
28904
|
-
const candidate = (0,
|
|
28904
|
+
const candidate = (0, node_path_1.dirname)(ui5YamlPath);
|
|
28905
28905
|
const webapp = await (0, ui5_config_1.getWebappPath)(candidate);
|
|
28906
28906
|
if (webapp === webappPath) {
|
|
28907
28907
|
appRoot = candidate;
|
|
@@ -28932,7 +28932,7 @@ var require_search = __commonJS({
|
|
|
28932
28932
|
if (!appRoot) {
|
|
28933
28933
|
return null;
|
|
28934
28934
|
}
|
|
28935
|
-
cache.files[path5] ??= await (0, file_1.readJSON)((0,
|
|
28935
|
+
cache.files[path5] ??= await (0, file_1.readJSON)((0, node_path_1.join)(appRoot, constants_1.FileName.Package), memFs);
|
|
28936
28936
|
const appPckJson = cache.files[path5];
|
|
28937
28937
|
if (appPckJson.sapux) {
|
|
28938
28938
|
return findRootsWithSapux(appPckJson.sapux, path5, appRoot);
|
|
@@ -28945,7 +28945,7 @@ var require_search = __commonJS({
|
|
|
28945
28945
|
};
|
|
28946
28946
|
} else if (
|
|
28947
28947
|
// Check for freestyle non CAP
|
|
28948
|
-
await (0, file_1.fileExists)((0,
|
|
28948
|
+
await (0, file_1.fileExists)((0, node_path_1.join)(appRoot, constants_1.FileName.Ui5LocalYaml), memFs) && (0, dependencies_1.hasDependency)(appPckJson, "@sap/ux-ui5-tooling")
|
|
28949
28949
|
) {
|
|
28950
28950
|
return {
|
|
28951
28951
|
appRoot,
|
|
@@ -28958,23 +28958,23 @@ var require_search = __commonJS({
|
|
|
28958
28958
|
}
|
|
28959
28959
|
async function findCapProjectRoot(path5, checkForAppRouter = true, options2) {
|
|
28960
28960
|
try {
|
|
28961
|
-
if (!(0,
|
|
28961
|
+
if (!(0, node_path_1.isAbsolute)(path5)) {
|
|
28962
28962
|
return null;
|
|
28963
28963
|
}
|
|
28964
28964
|
const { memFs, cache } = getFindOptions(options2);
|
|
28965
|
-
const { root } = (0,
|
|
28966
|
-
let projectRoot = (0,
|
|
28965
|
+
const { root } = (0, node_path_1.parse)(path5);
|
|
28966
|
+
let projectRoot = (0, node_path_1.dirname)(path5);
|
|
28967
28967
|
while (projectRoot !== root) {
|
|
28968
28968
|
if (!cache.capProjectType.has(projectRoot)) {
|
|
28969
28969
|
cache.capProjectType.set(projectRoot, await (0, cap_1.getCapProjectType)(projectRoot, memFs));
|
|
28970
28970
|
}
|
|
28971
28971
|
const capProjectType = cache.capProjectType.get(projectRoot);
|
|
28972
28972
|
if (capProjectType) {
|
|
28973
|
-
if (checkForAppRouter && (0,
|
|
28973
|
+
if (checkForAppRouter && (0, node_path_1.join)(projectRoot, "app") !== path5 || !checkForAppRouter) {
|
|
28974
28974
|
return projectRoot;
|
|
28975
28975
|
}
|
|
28976
28976
|
}
|
|
28977
|
-
projectRoot = (0,
|
|
28977
|
+
projectRoot = (0, node_path_1.dirname)(projectRoot);
|
|
28978
28978
|
}
|
|
28979
28979
|
} catch {
|
|
28980
28980
|
}
|
|
@@ -28986,7 +28986,7 @@ var require_search = __commonJS({
|
|
|
28986
28986
|
}
|
|
28987
28987
|
async function filterApplications(pathMap, memFs) {
|
|
28988
28988
|
const result = [];
|
|
28989
|
-
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0,
|
|
28989
|
+
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0, node_path_1.basename)(path5) === constants_1.FileName.Manifest);
|
|
28990
28990
|
for (const manifestPath of manifestPaths) {
|
|
28991
28991
|
try {
|
|
28992
28992
|
pathMap.files[manifestPath] ??= await (0, file_1.readJSON)(manifestPath, memFs);
|
|
@@ -28994,8 +28994,8 @@ var require_search = __commonJS({
|
|
|
28994
28994
|
if (!manifest["sap.app"]?.id || manifest["sap.app"].type !== "application") {
|
|
28995
28995
|
continue;
|
|
28996
28996
|
}
|
|
28997
|
-
const roots = await findRootsForPath((0,
|
|
28998
|
-
if (roots && !await (0, file_1.fileExists)((0,
|
|
28997
|
+
const roots = await findRootsForPath((0, node_path_1.dirname)(manifestPath), { memFs, cache: pathMap });
|
|
28998
|
+
if (roots && !await (0, file_1.fileExists)((0, node_path_1.join)(roots.appRoot, ".adp", constants_1.FileName.AdaptationConfig), memFs)) {
|
|
28999
28999
|
result.push({ appRoot: roots.appRoot, projectRoot: roots.projectRoot, manifest, manifestPath });
|
|
29000
29000
|
}
|
|
29001
29001
|
} catch {
|
|
@@ -29007,10 +29007,10 @@ var require_search = __commonJS({
|
|
|
29007
29007
|
const results = [];
|
|
29008
29008
|
const manifestAppDescrVars = Object.keys(pathMap.files).filter((path5) => path5.endsWith(constants_1.FileName.ManifestAppDescrVar));
|
|
29009
29009
|
for (const manifestAppDescrVar of manifestAppDescrVars) {
|
|
29010
|
-
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0,
|
|
29011
|
-
const projectRoot = packageJsonPath ? (0,
|
|
29010
|
+
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0, node_path_1.dirname)(manifestAppDescrVar), memFs);
|
|
29011
|
+
const projectRoot = packageJsonPath ? (0, node_path_1.dirname)(packageJsonPath) : null;
|
|
29012
29012
|
const webappPath = await (0, ui5_config_1.getWebappPath)(projectRoot ?? "", memFs);
|
|
29013
|
-
if (projectRoot && await (0, file_1.fileExists)((0,
|
|
29013
|
+
if (projectRoot && await (0, file_1.fileExists)((0, node_path_1.join)(webappPath, constants_1.FileName.ManifestAppDescrVar), memFs)) {
|
|
29014
29014
|
results.push({ appRoot: projectRoot, manifestAppdescrVariantPath: manifestAppDescrVar });
|
|
29015
29015
|
}
|
|
29016
29016
|
}
|
|
@@ -29018,18 +29018,18 @@ var require_search = __commonJS({
|
|
|
29018
29018
|
}
|
|
29019
29019
|
async function filterExtensions(pathMap, memFs) {
|
|
29020
29020
|
const results = [];
|
|
29021
|
-
const extensionConfigs = Object.keys(pathMap.files).filter((path5) => (0,
|
|
29021
|
+
const extensionConfigs = Object.keys(pathMap.files).filter((path5) => (0, node_path_1.basename)(path5) === constants_1.FileName.ExtConfigJson);
|
|
29022
29022
|
for (const extensionConfig of extensionConfigs) {
|
|
29023
29023
|
try {
|
|
29024
29024
|
let manifest = null;
|
|
29025
|
-
let manifestPath = Object.keys(pathMap).find((path5) => path5.startsWith((0,
|
|
29025
|
+
let manifestPath = Object.keys(pathMap).find((path5) => path5.startsWith((0, node_path_1.dirname)(extensionConfig) + node_path_1.sep) && (0, node_path_1.basename)(path5) === constants_1.FileName.Manifest);
|
|
29026
29026
|
if (manifestPath) {
|
|
29027
29027
|
pathMap.files[manifestPath] ??= await (0, file_1.readJSON)(manifestPath, memFs);
|
|
29028
29028
|
manifest = pathMap.files[manifestPath];
|
|
29029
29029
|
} else {
|
|
29030
29030
|
const manifests = await (0, file_1.findBy)({
|
|
29031
29031
|
fileNames: [constants_1.FileName.Manifest],
|
|
29032
|
-
root: (0,
|
|
29032
|
+
root: (0, node_path_1.dirname)(extensionConfig),
|
|
29033
29033
|
excludeFolders,
|
|
29034
29034
|
memFs
|
|
29035
29035
|
});
|
|
@@ -29039,7 +29039,7 @@ var require_search = __commonJS({
|
|
|
29039
29039
|
}
|
|
29040
29040
|
}
|
|
29041
29041
|
if (manifestPath && manifest) {
|
|
29042
|
-
results.push({ appRoot: (0,
|
|
29042
|
+
results.push({ appRoot: (0, node_path_1.dirname)(extensionConfig), manifest, manifestPath });
|
|
29043
29043
|
}
|
|
29044
29044
|
} catch {
|
|
29045
29045
|
}
|
|
@@ -29048,10 +29048,10 @@ var require_search = __commonJS({
|
|
|
29048
29048
|
}
|
|
29049
29049
|
async function filterDotLibraries(pathMap, manifestPaths, memFs) {
|
|
29050
29050
|
const dotLibraries = [];
|
|
29051
|
-
const dotLibraryPaths = Object.keys(pathMap.files).filter((path5) => (0,
|
|
29051
|
+
const dotLibraryPaths = Object.keys(pathMap.files).filter((path5) => (0, node_path_1.basename)(path5) === constants_1.FileName.Library).map((path5) => (0, node_path_1.dirname)(path5)).filter((path5) => !manifestPaths.map((manifestPath) => (0, node_path_1.dirname)(manifestPath)).includes(path5));
|
|
29052
29052
|
if (dotLibraryPaths) {
|
|
29053
29053
|
for (const libraryPath of dotLibraryPaths) {
|
|
29054
|
-
const projectRoot = (0,
|
|
29054
|
+
const projectRoot = (0, node_path_1.dirname)(await (0, file_1.findFileUp)(constants_1.FileName.Package, (0, node_path_1.dirname)(libraryPath), memFs) ?? libraryPath);
|
|
29055
29055
|
dotLibraries.push({ projectRoot, libraryPath });
|
|
29056
29056
|
}
|
|
29057
29057
|
}
|
|
@@ -29059,16 +29059,16 @@ var require_search = __commonJS({
|
|
|
29059
29059
|
}
|
|
29060
29060
|
async function filterLibraries(pathMap, memFs) {
|
|
29061
29061
|
const results = [];
|
|
29062
|
-
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0,
|
|
29062
|
+
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0, node_path_1.basename)(path5) === constants_1.FileName.Manifest);
|
|
29063
29063
|
results.push(...await filterDotLibraries(pathMap, manifestPaths, memFs));
|
|
29064
29064
|
for (const manifestPath of manifestPaths) {
|
|
29065
29065
|
try {
|
|
29066
29066
|
pathMap.files[manifestPath] ??= await (0, file_1.readJSON)(manifestPath, memFs);
|
|
29067
29067
|
const manifest = pathMap.files[manifestPath];
|
|
29068
29068
|
if (manifest["sap.app"] && manifest["sap.app"].type === "library") {
|
|
29069
|
-
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0,
|
|
29070
|
-
const projectRoot = packageJsonPath ? (0,
|
|
29071
|
-
if (projectRoot && await (0, file_1.fileExists)((0,
|
|
29069
|
+
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0, node_path_1.dirname)(manifestPath), memFs);
|
|
29070
|
+
const projectRoot = packageJsonPath ? (0, node_path_1.dirname)(packageJsonPath) : null;
|
|
29071
|
+
if (projectRoot && await (0, file_1.fileExists)((0, node_path_1.join)(projectRoot, constants_1.FileName.Ui5Yaml), memFs)) {
|
|
29072
29072
|
results.push({ projectRoot, manifestPath, manifest });
|
|
29073
29073
|
}
|
|
29074
29074
|
}
|
|
@@ -29079,14 +29079,14 @@ var require_search = __commonJS({
|
|
|
29079
29079
|
}
|
|
29080
29080
|
async function filterComponents(pathMap, memFs) {
|
|
29081
29081
|
const results = [];
|
|
29082
|
-
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0,
|
|
29082
|
+
const manifestPaths = Object.keys(pathMap.files).filter((path5) => (0, node_path_1.basename)(path5) === constants_1.FileName.Manifest);
|
|
29083
29083
|
for (const manifestPath of manifestPaths) {
|
|
29084
29084
|
try {
|
|
29085
29085
|
pathMap.files[manifestPath] ??= await (0, file_1.readJSON)(manifestPath, memFs);
|
|
29086
29086
|
const manifest = pathMap.files[manifestPath];
|
|
29087
29087
|
if (manifest["sap.app"] && manifest["sap.app"].type === "component") {
|
|
29088
|
-
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0,
|
|
29089
|
-
const projectRoot = packageJsonPath ? (0,
|
|
29088
|
+
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, (0, node_path_1.dirname)(manifestPath), memFs);
|
|
29089
|
+
const projectRoot = packageJsonPath ? (0, node_path_1.dirname)(packageJsonPath) : null;
|
|
29090
29090
|
if (projectRoot) {
|
|
29091
29091
|
results.push({ projectRoot, manifestPath, manifest });
|
|
29092
29092
|
}
|
|
@@ -29150,8 +29150,8 @@ var require_search = __commonJS({
|
|
|
29150
29150
|
root,
|
|
29151
29151
|
excludeFolders: excludeFolders2
|
|
29152
29152
|
});
|
|
29153
|
-
const appYamlsToCheck = Array.from(new Set(filesToCheck.filter((file) => (0,
|
|
29154
|
-
const foldersToCheck = Array.from(new Set(filesToCheck.filter((file) => (0,
|
|
29153
|
+
const appYamlsToCheck = Array.from(new Set(filesToCheck.filter((file) => (0, node_path_1.basename)(file) === constants_1.FileName.CapJavaApplicationYaml).map((file) => (0, node_path_1.dirname)(file))));
|
|
29154
|
+
const foldersToCheck = Array.from(new Set(filesToCheck.filter((file) => (0, node_path_1.basename)(file) !== constants_1.FileName.CapJavaApplicationYaml).map((file) => (0, node_path_1.dirname)(file))));
|
|
29155
29155
|
for (const appYamlToCheck of appYamlsToCheck) {
|
|
29156
29156
|
const capRoot = await findCapProjectRoot(appYamlToCheck);
|
|
29157
29157
|
if (capRoot) {
|
|
@@ -42132,7 +42132,7 @@ var require_commit = __commonJS({
|
|
|
42132
42132
|
"use strict";
|
|
42133
42133
|
var { promisify: promisify3 } = require("util");
|
|
42134
42134
|
var { pipeline: _pipeline } = require("stream");
|
|
42135
|
-
var
|
|
42135
|
+
var pipeline = promisify3(_pipeline);
|
|
42136
42136
|
var { createPendingFilesPassthrough, createCommitTransform } = require_transform();
|
|
42137
42137
|
module2.exports = function(filters, stream, cb) {
|
|
42138
42138
|
if (typeof filters === "function") {
|
|
@@ -42145,7 +42145,7 @@ var require_commit = __commonJS({
|
|
|
42145
42145
|
}
|
|
42146
42146
|
stream = stream || this.store.stream();
|
|
42147
42147
|
filters = filters || [];
|
|
42148
|
-
const promise =
|
|
42148
|
+
const promise = pipeline(
|
|
42149
42149
|
stream,
|
|
42150
42150
|
createPendingFilesPassthrough(),
|
|
42151
42151
|
...filters,
|
|
@@ -42298,7 +42298,7 @@ var require_cap = __commonJS({
|
|
|
42298
42298
|
exports2.satisfiesMinCdsVersion = satisfiesMinCdsVersion;
|
|
42299
42299
|
exports2.hasMinCdsVersion = hasMinCdsVersion;
|
|
42300
42300
|
var child_process_1 = require("child_process");
|
|
42301
|
-
var
|
|
42301
|
+
var node_path_1 = require("node:path");
|
|
42302
42302
|
var constants_1 = require_constants();
|
|
42303
42303
|
var file_1 = require_file();
|
|
42304
42304
|
var module_loader_1 = require_module_loader();
|
|
@@ -42312,7 +42312,7 @@ var require_cap = __commonJS({
|
|
|
42312
42312
|
}
|
|
42313
42313
|
async function isCapJavaProject(projectRoot, capCustomPaths, memFs) {
|
|
42314
42314
|
const srv = capCustomPaths?.srv ?? (await getCapCustomPaths(projectRoot)).srv;
|
|
42315
|
-
return (0, file_1.fileExists)((0,
|
|
42315
|
+
return (0, file_1.fileExists)((0, node_path_1.join)(projectRoot, srv, "src", "main", "resources", constants_1.FileName.CapJavaApplicationYaml), memFs);
|
|
42316
42316
|
}
|
|
42317
42317
|
async function checkFilesInSrvFolder(srvFolderPath, memFs) {
|
|
42318
42318
|
try {
|
|
@@ -42323,7 +42323,7 @@ var require_cap = __commonJS({
|
|
|
42323
42323
|
}
|
|
42324
42324
|
async function getCapProjectType(projectRoot, memFs) {
|
|
42325
42325
|
const capCustomPaths = await getCapCustomPaths(projectRoot);
|
|
42326
|
-
if (!await checkFilesInSrvFolder((0,
|
|
42326
|
+
if (!await checkFilesInSrvFolder((0, node_path_1.join)(projectRoot, capCustomPaths.srv), memFs)) {
|
|
42327
42327
|
return void 0;
|
|
42328
42328
|
}
|
|
42329
42329
|
if (await isCapJavaProject(projectRoot, capCustomPaths, memFs)) {
|
|
@@ -42331,7 +42331,7 @@ var require_cap = __commonJS({
|
|
|
42331
42331
|
}
|
|
42332
42332
|
let packageJson;
|
|
42333
42333
|
try {
|
|
42334
|
-
packageJson = await (0, file_1.readJSON)((0,
|
|
42334
|
+
packageJson = await (0, file_1.readJSON)((0, node_path_1.join)(projectRoot, constants_1.FileName.Package), memFs);
|
|
42335
42335
|
} catch {
|
|
42336
42336
|
}
|
|
42337
42337
|
if (packageJson && isCapNodeJsProject(packageJson)) {
|
|
@@ -42379,7 +42379,7 @@ var require_cap = __commonJS({
|
|
|
42379
42379
|
const capProjectPaths = await getCapCustomPaths(_projectRoot);
|
|
42380
42380
|
const modelPaths = [];
|
|
42381
42381
|
_pathSelection?.forEach((path5) => {
|
|
42382
|
-
modelPaths.push((0,
|
|
42382
|
+
modelPaths.push((0, node_path_1.join)(_projectRoot, capProjectPaths[path5]));
|
|
42383
42383
|
});
|
|
42384
42384
|
const model = await cds.load(modelPaths, { root: _projectRoot });
|
|
42385
42385
|
_logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.home': ${cds.home}`);
|
|
@@ -42442,7 +42442,7 @@ var require_cap = __commonJS({
|
|
|
42442
42442
|
clearCdsResolveCache(cds);
|
|
42443
42443
|
}
|
|
42444
42444
|
for (const cdsEnvRoot of cdsEnvRoots) {
|
|
42445
|
-
const resolvedRoots = cds.resolve((0,
|
|
42445
|
+
const resolvedRoots = cds.resolve((0, node_path_1.join)(projectRoot, cdsEnvRoot), {
|
|
42446
42446
|
skipModelCache: true
|
|
42447
42447
|
}) || [];
|
|
42448
42448
|
for (const resolvedRoot of resolvedRoots) {
|
|
@@ -42483,8 +42483,8 @@ var require_cap = __commonJS({
|
|
|
42483
42483
|
const cdsFiles = [];
|
|
42484
42484
|
for (const source in sources) {
|
|
42485
42485
|
let filename = sources[source].filename;
|
|
42486
|
-
if (typeof filename === "string" && !filename.startsWith(
|
|
42487
|
-
filename = (0,
|
|
42486
|
+
if (typeof filename === "string" && !filename.startsWith(node_path_1.sep)) {
|
|
42487
|
+
filename = (0, node_path_1.join)(node_path_1.sep, filename);
|
|
42488
42488
|
}
|
|
42489
42489
|
if (filename) {
|
|
42490
42490
|
cdsFiles.push(filename);
|
|
@@ -42538,7 +42538,7 @@ var require_cap = __commonJS({
|
|
|
42538
42538
|
}
|
|
42539
42539
|
const cds = "default" in module3 ? module3.default : module3;
|
|
42540
42540
|
if (strict && loadProjectError) {
|
|
42541
|
-
const cdsDependencyVersion = await getCdsVersionFromPackageJson((0,
|
|
42541
|
+
const cdsDependencyVersion = await getCdsVersionFromPackageJson((0, node_path_1.join)(capProjectPath, constants_1.FileName.Package));
|
|
42542
42542
|
if (typeof cdsDependencyVersion === "string") {
|
|
42543
42543
|
const globalCdsVersion = cds.version;
|
|
42544
42544
|
if (getMajorVersion(cdsDependencyVersion) !== getMajorVersion(globalCdsVersion)) {
|
|
@@ -42569,7 +42569,7 @@ var require_cap = __commonJS({
|
|
|
42569
42569
|
function clearCdsResolveCache(cds) {
|
|
42570
42570
|
cds.resolve.cache = {};
|
|
42571
42571
|
}
|
|
42572
|
-
var toAbsoluteUri = (projectRoot, relativeUri) => (0,
|
|
42572
|
+
var toAbsoluteUri = (projectRoot, relativeUri) => (0, node_path_1.join)(projectRoot, relativeUri);
|
|
42573
42573
|
exports2.toAbsoluteUri = toAbsoluteUri;
|
|
42574
42574
|
var toReferenceUri = async (projectRoot, relativeUriFrom, relativeUriTo) => {
|
|
42575
42575
|
let relativeUri = "";
|
|
@@ -42588,8 +42588,8 @@ var require_cap = __commonJS({
|
|
|
42588
42588
|
}
|
|
42589
42589
|
}
|
|
42590
42590
|
if (!relativeUri) {
|
|
42591
|
-
const fromDir = (0,
|
|
42592
|
-
relativeUri = (0,
|
|
42591
|
+
const fromDir = (0, node_path_1.dirname)((0, exports2.toAbsoluteUri)(projectRoot, relativeUriFrom));
|
|
42592
|
+
relativeUri = (0, node_path_1.relative)(fromDir, (0, exports2.toAbsoluteUri)(projectRoot, relativeUriTo));
|
|
42593
42593
|
if (!relativeUri.startsWith(".")) {
|
|
42594
42594
|
relativeUri = "./" + relativeUri;
|
|
42595
42595
|
}
|
|
@@ -42598,14 +42598,14 @@ var require_cap = __commonJS({
|
|
|
42598
42598
|
if (["CDS", "JSON"].includes(fileExtension.toUpperCase())) {
|
|
42599
42599
|
relativeUri = relativeUri.slice(0, relativeUri.length - fileExtension.length - 1);
|
|
42600
42600
|
}
|
|
42601
|
-
return relativeUri.split(
|
|
42601
|
+
return relativeUri.split(node_path_1.sep).join("/");
|
|
42602
42602
|
};
|
|
42603
42603
|
exports2.toReferenceUri = toReferenceUri;
|
|
42604
42604
|
async function getPackageNameInFolder(baseUri, relativeUri) {
|
|
42605
|
-
const refUriParts = relativeUri.split(
|
|
42605
|
+
const refUriParts = relativeUri.split(node_path_1.sep);
|
|
42606
42606
|
const result = { packageName: "", packageFolder: relativeUri };
|
|
42607
42607
|
for (let i = refUriParts.length - 1; i >= 0 && !result.packageName; i--) {
|
|
42608
|
-
const currentFolder = refUriParts.slice(0, i).join(
|
|
42608
|
+
const currentFolder = refUriParts.slice(0, i).join(node_path_1.sep);
|
|
42609
42609
|
result.packageName = await readPackageNameForFolder(baseUri, currentFolder);
|
|
42610
42610
|
if (result.packageName) {
|
|
42611
42611
|
result.packageFolder = currentFolder;
|
|
@@ -42616,7 +42616,7 @@ var require_cap = __commonJS({
|
|
|
42616
42616
|
async function readPackageNameForFolder(baseUri, relativeUri) {
|
|
42617
42617
|
let packageName = "";
|
|
42618
42618
|
try {
|
|
42619
|
-
const path5 = (0,
|
|
42619
|
+
const path5 = (0, node_path_1.normalize)(baseUri + "/" + relativeUri + "/" + constants_1.FileName.Package);
|
|
42620
42620
|
const content = await (0, file_1.readJSON)(path5);
|
|
42621
42621
|
if (typeof content?.name === "string") {
|
|
42622
42622
|
packageName = content.name;
|
|
@@ -42678,7 +42678,7 @@ var require_cap = __commonJS({
|
|
|
42678
42678
|
return version3;
|
|
42679
42679
|
}
|
|
42680
42680
|
function getMajorVersion(versionString) {
|
|
42681
|
-
return parseInt(/\d+/.exec(versionString.split(".")[0])?.[0] ?? "0", 10);
|
|
42681
|
+
return Number.parseInt(/\d+/.exec(versionString.split(".")[0])?.[0] ?? "0", 10);
|
|
42682
42682
|
}
|
|
42683
42683
|
async function getCapServiceName2(projectRoot, datasourceUri) {
|
|
42684
42684
|
const services = (await getCapModelAndServices(projectRoot)).services;
|
|
@@ -42712,16 +42712,16 @@ var require_cap = __commonJS({
|
|
|
42712
42712
|
}
|
|
42713
42713
|
}
|
|
42714
42714
|
async function deleteCapApp(appPath, memFs, logger4) {
|
|
42715
|
-
const appName = (0,
|
|
42715
|
+
const appName = (0, node_path_1.basename)(appPath);
|
|
42716
42716
|
const projectRoot = await (0, search_1.findCapProjectRoot)(appPath);
|
|
42717
42717
|
if (!projectRoot) {
|
|
42718
42718
|
const message = `Project root was not found for CAP application with path '${appPath}'`;
|
|
42719
42719
|
logger4?.error(message);
|
|
42720
42720
|
throw Error(message);
|
|
42721
42721
|
}
|
|
42722
|
-
const packageJsonPath = (0,
|
|
42722
|
+
const packageJsonPath = (0, node_path_1.join)(projectRoot, constants_1.FileName.Package);
|
|
42723
42723
|
const packageJson = await (0, file_1.readJSON)(packageJsonPath, memFs);
|
|
42724
|
-
const cdsFilePaths = [(0,
|
|
42724
|
+
const cdsFilePaths = [(0, node_path_1.join)((0, node_path_1.dirname)(appPath), constants_1.FileName.ServiceCds), (0, node_path_1.join)((0, node_path_1.dirname)(appPath), constants_1.FileName.IndexCds)];
|
|
42725
42725
|
logger4?.info(`Deleting app '${appName}' from CAP project '${projectRoot}'.`);
|
|
42726
42726
|
if (Array.isArray(packageJson.sapux)) {
|
|
42727
42727
|
const posixAppPath = appPath.replace(/\\/g, "/");
|
|
@@ -42739,16 +42739,16 @@ var require_cap = __commonJS({
|
|
|
42739
42739
|
await (0, file_1.deleteDirectory)(appPath, memFs);
|
|
42740
42740
|
logger4?.info(`Directory '${appPath}' deleted.`);
|
|
42741
42741
|
await cleanupCdsFiles(cdsFilePaths, appName, memFs, logger4);
|
|
42742
|
-
if ((await (0, file_1.readDirectory)((0,
|
|
42743
|
-
logger4?.info(`Directory '${(0,
|
|
42744
|
-
await (0, file_1.deleteDirectory)((0,
|
|
42742
|
+
if ((await (0, file_1.readDirectory)((0, node_path_1.dirname)(appPath))).length === 0) {
|
|
42743
|
+
logger4?.info(`Directory '${(0, node_path_1.dirname)(appPath)}' is now empty. Deleting it.`);
|
|
42744
|
+
await (0, file_1.deleteDirectory)((0, node_path_1.dirname)(appPath), memFs);
|
|
42745
42745
|
}
|
|
42746
42746
|
}
|
|
42747
42747
|
async function checkCdsUi5PluginEnabled(basePath, fs5, moreInfo, cdsVersionInfo) {
|
|
42748
42748
|
if (!fs5) {
|
|
42749
42749
|
fs5 = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
42750
42750
|
}
|
|
42751
|
-
const packageJsonPath = (0,
|
|
42751
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, "package.json");
|
|
42752
42752
|
if (!fs5.exists(packageJsonPath)) {
|
|
42753
42753
|
return false;
|
|
42754
42754
|
}
|
|
@@ -42799,7 +42799,7 @@ var require_service = __commonJS({
|
|
|
42799
42799
|
exports2.getMainService = getMainService2;
|
|
42800
42800
|
exports2.getServicesAndAnnotations = getServicesAndAnnotations;
|
|
42801
42801
|
exports2.filterDataSourcesByType = filterDataSourcesByType;
|
|
42802
|
-
var
|
|
42802
|
+
var node_path_1 = require("node:path");
|
|
42803
42803
|
var file_1 = require_file();
|
|
42804
42804
|
function getMainService2(manifest) {
|
|
42805
42805
|
const model = typeof manifest?.["sap.ovp"]?.globalFilterModel === "string" ? manifest["sap.ovp"].globalFilterModel : "";
|
|
@@ -42807,7 +42807,7 @@ var require_service = __commonJS({
|
|
|
42807
42807
|
}
|
|
42808
42808
|
async function getServicesAndAnnotations(manifestPath, manifest, memFs) {
|
|
42809
42809
|
const parsedManifest = manifest ?? await (0, file_1.readJSON)(manifestPath, memFs);
|
|
42810
|
-
const manifestFolder = (0,
|
|
42810
|
+
const manifestFolder = (0, node_path_1.dirname)(manifestPath);
|
|
42811
42811
|
const services = {};
|
|
42812
42812
|
const dataSources = parsedManifest?.["sap.app"]?.dataSources ?? {};
|
|
42813
42813
|
for (const name in dataSources) {
|
|
@@ -42821,7 +42821,7 @@ var require_service = __commonJS({
|
|
|
42821
42821
|
function getServiceSpecification(webappFolder, name, dataSources) {
|
|
42822
42822
|
const dataSource = dataSources[name];
|
|
42823
42823
|
const uri = dataSource.uri;
|
|
42824
|
-
const local = typeof dataSource.settings?.localUri === "string" ? (0,
|
|
42824
|
+
const local = typeof dataSource.settings?.localUri === "string" ? (0, node_path_1.join)(webappFolder, dataSource.settings.localUri) : "";
|
|
42825
42825
|
const odataVersion = dataSource.settings?.odataVersion ?? "2.0";
|
|
42826
42826
|
const annotations = [];
|
|
42827
42827
|
const annotationNames = dataSource.settings?.annotations;
|
|
@@ -42831,7 +42831,7 @@ var require_service = __commonJS({
|
|
|
42831
42831
|
if (annotation) {
|
|
42832
42832
|
annotations.push({
|
|
42833
42833
|
uri: annotation.uri,
|
|
42834
|
-
local: annotation.settings?.localUri ? (0,
|
|
42834
|
+
local: annotation.settings?.localUri ? (0, node_path_1.join)(webappFolder, annotation.settings.localUri) : void 0
|
|
42835
42835
|
});
|
|
42836
42836
|
}
|
|
42837
42837
|
}
|
|
@@ -42856,19 +42856,19 @@ var require_i18n = __commonJS({
|
|
|
42856
42856
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
42857
42857
|
exports2.getI18nPropertiesPaths = getI18nPropertiesPaths;
|
|
42858
42858
|
exports2.getRelativeI18nPropertiesPaths = getRelativeI18nPropertiesPaths;
|
|
42859
|
-
var
|
|
42859
|
+
var node_path_1 = require("node:path");
|
|
42860
42860
|
var file_1 = require_file();
|
|
42861
42861
|
async function getI18nPropertiesPaths(manifestPath, manifest, memFs) {
|
|
42862
42862
|
const parsedManifest = manifest ?? await (0, file_1.readJSON)(manifestPath, memFs);
|
|
42863
|
-
const manifestFolder = (0,
|
|
42863
|
+
const manifestFolder = (0, node_path_1.dirname)(manifestPath);
|
|
42864
42864
|
const relativeI18nPropertiesPaths = getRelativeI18nPropertiesPaths(parsedManifest);
|
|
42865
42865
|
const i18nPropertiesPaths = {
|
|
42866
|
-
"sap.app": (0,
|
|
42866
|
+
"sap.app": (0, node_path_1.join)(manifestFolder, relativeI18nPropertiesPaths["sap.app"]),
|
|
42867
42867
|
models: {}
|
|
42868
42868
|
};
|
|
42869
42869
|
for (const modelKey in relativeI18nPropertiesPaths.models) {
|
|
42870
42870
|
i18nPropertiesPaths.models[modelKey] = {
|
|
42871
|
-
path: (0,
|
|
42871
|
+
path: (0, node_path_1.join)(manifestFolder, relativeI18nPropertiesPaths.models[modelKey].path)
|
|
42872
42872
|
};
|
|
42873
42873
|
}
|
|
42874
42874
|
return i18nPropertiesPaths;
|
|
@@ -42880,18 +42880,18 @@ var require_i18n = __commonJS({
|
|
|
42880
42880
|
};
|
|
42881
42881
|
}
|
|
42882
42882
|
function getI18nAppPath(manifest) {
|
|
42883
|
-
const defaultPath = (0,
|
|
42883
|
+
const defaultPath = (0, node_path_1.join)("i18n/i18n.properties");
|
|
42884
42884
|
if (typeof manifest?.["sap.app"]?.i18n === "string") {
|
|
42885
|
-
return (0,
|
|
42885
|
+
return (0, node_path_1.join)(manifest["sap.app"].i18n);
|
|
42886
42886
|
}
|
|
42887
42887
|
if (typeof manifest?.["sap.app"]?.i18n === "object") {
|
|
42888
42888
|
if ("bundleName" in manifest["sap.app"].i18n) {
|
|
42889
42889
|
const withoutAppId = manifest["sap.app"].i18n.bundleName.replace(manifest["sap.app"].id, "");
|
|
42890
|
-
const i18nPath = `${(0,
|
|
42891
|
-
return (0,
|
|
42890
|
+
const i18nPath = `${(0, node_path_1.join)(...withoutAppId.split("."))}.properties`;
|
|
42891
|
+
return (0, node_path_1.join)(i18nPath);
|
|
42892
42892
|
}
|
|
42893
42893
|
if ("bundleUrl" in manifest["sap.app"].i18n) {
|
|
42894
|
-
return (0,
|
|
42894
|
+
return (0, node_path_1.join)(manifest["sap.app"].i18n.bundleUrl);
|
|
42895
42895
|
}
|
|
42896
42896
|
}
|
|
42897
42897
|
return defaultPath;
|
|
@@ -42905,17 +42905,17 @@ var require_i18n = __commonJS({
|
|
|
42905
42905
|
if (i18nModel.settings) {
|
|
42906
42906
|
if (i18nModel.settings.bundleName) {
|
|
42907
42907
|
const withoutAppId = i18nModel.settings.bundleName.replace(manifest["sap.app"].id, "");
|
|
42908
|
-
const i18nPath = `${(0,
|
|
42909
|
-
result[modelKey] = { path: (0,
|
|
42908
|
+
const i18nPath = `${(0, node_path_1.join)(...withoutAppId.split("."))}.properties`;
|
|
42909
|
+
result[modelKey] = { path: (0, node_path_1.join)(i18nPath) };
|
|
42910
42910
|
continue;
|
|
42911
42911
|
}
|
|
42912
42912
|
if (i18nModel.settings.bundleUrl) {
|
|
42913
|
-
result[modelKey] = { path: (0,
|
|
42913
|
+
result[modelKey] = { path: (0, node_path_1.join)(i18nModel.settings.bundleUrl) };
|
|
42914
42914
|
continue;
|
|
42915
42915
|
}
|
|
42916
42916
|
}
|
|
42917
42917
|
if (i18nModel.uri) {
|
|
42918
|
-
result[modelKey] = { path: (0,
|
|
42918
|
+
result[modelKey] = { path: (0, node_path_1.join)(i18nModel.uri) };
|
|
42919
42919
|
}
|
|
42920
42920
|
}
|
|
42921
42921
|
return result;
|
|
@@ -42954,8 +42954,8 @@ var require_resolve3 = __commonJS({
|
|
|
42954
42954
|
exports2.resolveCapI18nFolderForFile = resolveCapI18nFolderForFile;
|
|
42955
42955
|
exports2.getCapI18nFiles = getCapI18nFiles;
|
|
42956
42956
|
exports2.getCapI18nFolder = getCapI18nFolder;
|
|
42957
|
-
var
|
|
42958
|
-
var
|
|
42957
|
+
var node_path_1 = require("node:path");
|
|
42958
|
+
var node_fs_1 = require("node:fs");
|
|
42959
42959
|
var config_1 = require_config();
|
|
42960
42960
|
function normalizePath(path5) {
|
|
42961
42961
|
if (process.platform === "win32") {
|
|
@@ -42966,17 +42966,17 @@ var require_resolve3 = __commonJS({
|
|
|
42966
42966
|
function pathStartsWith(a, b) {
|
|
42967
42967
|
return normalizePath(a).startsWith(normalizePath(b));
|
|
42968
42968
|
}
|
|
42969
|
-
var nodeModules =
|
|
42969
|
+
var nodeModules = node_path_1.sep + "node_modules";
|
|
42970
42970
|
function resolveCapI18nFolderForFile(root, env3, filePath) {
|
|
42971
42971
|
const { folders } = (0, config_1.getI18nConfiguration)(env3);
|
|
42972
42972
|
function resolve(path5) {
|
|
42973
42973
|
for (const folderName of folders) {
|
|
42974
|
-
const folderPath = (0,
|
|
42975
|
-
if ((0,
|
|
42974
|
+
const folderPath = (0, node_path_1.join)(path5, folderName);
|
|
42975
|
+
if ((0, node_fs_1.existsSync)(folderPath)) {
|
|
42976
42976
|
return folderPath;
|
|
42977
42977
|
}
|
|
42978
42978
|
}
|
|
42979
|
-
const next = (0,
|
|
42979
|
+
const next = (0, node_path_1.dirname)(path5);
|
|
42980
42980
|
if (next.includes(nodeModules)) {
|
|
42981
42981
|
if (next.endsWith(nodeModules)) {
|
|
42982
42982
|
return void 0;
|
|
@@ -42993,7 +42993,7 @@ var require_resolve3 = __commonJS({
|
|
|
42993
42993
|
const i18nFiles = filePaths.reduce((acc, filePath) => {
|
|
42994
42994
|
const i18nFolder = resolveCapI18nFolderForFile(root, env3, filePath);
|
|
42995
42995
|
if (i18nFolder) {
|
|
42996
|
-
const file = (0,
|
|
42996
|
+
const file = (0, node_path_1.join)(i18nFolder, baseFileName);
|
|
42997
42997
|
if (acc.indexOf(file) === -1) {
|
|
42998
42998
|
acc.push(file);
|
|
42999
42999
|
}
|
|
@@ -43007,9 +43007,9 @@ var require_resolve3 = __commonJS({
|
|
|
43007
43007
|
let i18nFolderPath = resolveCapI18nFolderForFile(root, env3, path5);
|
|
43008
43008
|
if (!i18nFolderPath) {
|
|
43009
43009
|
const folder = folders[0];
|
|
43010
|
-
i18nFolderPath = (0,
|
|
43010
|
+
i18nFolderPath = (0, node_path_1.join)(root, folder);
|
|
43011
43011
|
if (!fs5) {
|
|
43012
|
-
await
|
|
43012
|
+
await node_fs_1.promises.mkdir(i18nFolderPath);
|
|
43013
43013
|
}
|
|
43014
43014
|
}
|
|
43015
43015
|
return i18nFolderPath;
|
|
@@ -43026,7 +43026,7 @@ var require_path2 = __commonJS({
|
|
|
43026
43026
|
exports2.capPropertiesPath = capPropertiesPath;
|
|
43027
43027
|
exports2.csvPath = csvPath;
|
|
43028
43028
|
exports2.doesExist = doesExist;
|
|
43029
|
-
var
|
|
43029
|
+
var node_fs_1 = require("node:fs");
|
|
43030
43030
|
var config_1 = require_config();
|
|
43031
43031
|
function jsonPath(path5) {
|
|
43032
43032
|
return `${path5}.json`;
|
|
@@ -43041,7 +43041,7 @@ var require_path2 = __commonJS({
|
|
|
43041
43041
|
}
|
|
43042
43042
|
function doesExist(path5) {
|
|
43043
43043
|
return new Promise((resolve) => {
|
|
43044
|
-
(0,
|
|
43044
|
+
(0, node_fs_1.stat)(path5, (err) => {
|
|
43045
43045
|
if (err) {
|
|
43046
43046
|
resolve(false);
|
|
43047
43047
|
} else {
|
|
@@ -43308,12 +43308,12 @@ var require_read2 = __commonJS({
|
|
|
43308
43308
|
"use strict";
|
|
43309
43309
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
43310
43310
|
exports2.readFile = readFile2;
|
|
43311
|
-
var
|
|
43311
|
+
var node_fs_1 = require("node:fs");
|
|
43312
43312
|
async function readFile2(filePath, fs5) {
|
|
43313
43313
|
if (fs5) {
|
|
43314
43314
|
return fs5.read(filePath);
|
|
43315
43315
|
}
|
|
43316
|
-
return
|
|
43316
|
+
return node_fs_1.promises.readFile(filePath, { encoding: "utf8" });
|
|
43317
43317
|
}
|
|
43318
43318
|
}
|
|
43319
43319
|
});
|
|
@@ -43324,12 +43324,12 @@ var require_write2 = __commonJS({
|
|
|
43324
43324
|
"use strict";
|
|
43325
43325
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
43326
43326
|
exports2.writeFile = writeFile;
|
|
43327
|
-
var
|
|
43327
|
+
var node_fs_1 = require("node:fs");
|
|
43328
43328
|
async function writeFile(filePath, content, fs5) {
|
|
43329
43329
|
if (fs5) {
|
|
43330
43330
|
return fs5.write(filePath, content);
|
|
43331
43331
|
}
|
|
43332
|
-
return
|
|
43332
|
+
return node_fs_1.promises.writeFile(filePath, content, { encoding: "utf8" });
|
|
43333
43333
|
}
|
|
43334
43334
|
}
|
|
43335
43335
|
});
|
|
@@ -47418,7 +47418,7 @@ var require_annotation = __commonJS({
|
|
|
47418
47418
|
}
|
|
47419
47419
|
const { range: { start }, value } = comment;
|
|
47420
47420
|
return {
|
|
47421
|
-
value: parseInt(value.slice(commaIndex + 1, colonIndex === -1 ? void 0 : colonIndex), 10),
|
|
47421
|
+
value: Number.parseInt(value.slice(commaIndex + 1, colonIndex === -1 ? void 0 : colonIndex), 10),
|
|
47422
47422
|
range: text_document_utils_1.Range.create(start.line, start.character + commaIndex + 1, start.line, start.character + (colonIndex === -1 ? value.length : colonIndex))
|
|
47423
47423
|
};
|
|
47424
47424
|
}
|
|
@@ -48495,7 +48495,7 @@ var require_create = __commonJS({
|
|
|
48495
48495
|
"use strict";
|
|
48496
48496
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48497
48497
|
exports2.createCapI18nEntries = createCapI18nEntries;
|
|
48498
|
-
var
|
|
48498
|
+
var node_path_1 = require("node:path");
|
|
48499
48499
|
var utils_1 = require_utils8();
|
|
48500
48500
|
var json_1 = require_json4();
|
|
48501
48501
|
var csv_1 = require_csv3();
|
|
@@ -48503,7 +48503,7 @@ var require_create = __commonJS({
|
|
|
48503
48503
|
async function createCapI18nEntries(root, path5, newI18nEntries, env3, fs5) {
|
|
48504
48504
|
const { baseFileName } = (0, utils_1.getI18nConfiguration)(env3);
|
|
48505
48505
|
const i18nFolderPath = await (0, utils_1.getCapI18nFolder)(root, path5, env3, fs5);
|
|
48506
|
-
const filePath = (0,
|
|
48506
|
+
const filePath = (0, node_path_1.join)(i18nFolderPath, baseFileName);
|
|
48507
48507
|
const updaters = [json_1.tryAddJsonTexts, properties_1.tryAddPropertiesTexts, csv_1.tryAddCsvTexts];
|
|
48508
48508
|
for (const update of updaters) {
|
|
48509
48509
|
const completed = await update(env3, filePath, newI18nEntries, fs5);
|
|
@@ -48538,7 +48538,7 @@ var require_create2 = __commonJS({
|
|
|
48538
48538
|
exports2.removeAndCreateI18nEntries = removeAndCreateI18nEntries;
|
|
48539
48539
|
var utils_1 = require_utils8();
|
|
48540
48540
|
var utils_2 = require_utils9();
|
|
48541
|
-
var
|
|
48541
|
+
var node_path_1 = require("node:path");
|
|
48542
48542
|
async function createPropertiesI18nEntries(i18nFilePath, newI18nEntries, root, fs5) {
|
|
48543
48543
|
if (!fs5 && !await (0, utils_1.doesExist)(i18nFilePath) || fs5 && !fs5.exists(i18nFilePath)) {
|
|
48544
48544
|
await createNewI18nFile(i18nFilePath, root, fs5);
|
|
@@ -48554,7 +48554,7 @@ var require_create2 = __commonJS({
|
|
|
48554
48554
|
async function createNewI18nFile(i18nFilePath, root, fs5) {
|
|
48555
48555
|
let content = "# Resource bundle \n";
|
|
48556
48556
|
if (root) {
|
|
48557
|
-
content = `# This is the resource bundle for ${(0,
|
|
48557
|
+
content = `# This is the resource bundle for ${(0, node_path_1.basename)(root)}
|
|
48558
48558
|
`;
|
|
48559
48559
|
}
|
|
48560
48560
|
return (0, utils_1.writeFile)(i18nFilePath, content, fs5);
|
|
@@ -48756,7 +48756,7 @@ var require_write4 = __commonJS({
|
|
|
48756
48756
|
exports2.createManifestI18nEntries = createManifestI18nEntries;
|
|
48757
48757
|
var i18n_1 = require_dist5();
|
|
48758
48758
|
var __1 = require_project();
|
|
48759
|
-
var
|
|
48759
|
+
var node_path_1 = require("node:path");
|
|
48760
48760
|
var file_1 = require_file();
|
|
48761
48761
|
var promises_1 = require("fs/promises");
|
|
48762
48762
|
async function createCapI18nEntries(root, filePath, newI18nEntries, fs5) {
|
|
@@ -48767,7 +48767,7 @@ var require_write4 = __commonJS({
|
|
|
48767
48767
|
const defaultPath = "i18n/i18n.properties";
|
|
48768
48768
|
const i18nFilePath = i18nPropertiesPaths.models[modelKey]?.path;
|
|
48769
48769
|
if (i18nFilePath) {
|
|
48770
|
-
const dirPath2 = (0,
|
|
48770
|
+
const dirPath2 = (0, node_path_1.dirname)(i18nFilePath);
|
|
48771
48771
|
if (!fs5) {
|
|
48772
48772
|
await (0, promises_1.mkdir)(dirPath2, { recursive: true });
|
|
48773
48773
|
}
|
|
@@ -48786,11 +48786,11 @@ var require_write4 = __commonJS({
|
|
|
48786
48786
|
}
|
|
48787
48787
|
};
|
|
48788
48788
|
await (0, file_1.writeFile)(manifestPath, JSON.stringify(newContent, void 0, 4), fs5);
|
|
48789
|
-
const dirPath = (0,
|
|
48789
|
+
const dirPath = (0, node_path_1.dirname)(defaultPath);
|
|
48790
48790
|
if (!fs5) {
|
|
48791
|
-
await (0, promises_1.mkdir)((0,
|
|
48791
|
+
await (0, promises_1.mkdir)((0, node_path_1.join)((0, node_path_1.dirname)(manifestPath), dirPath), { recursive: true });
|
|
48792
48792
|
}
|
|
48793
|
-
return (0, i18n_1.createPropertiesI18nEntries)((0,
|
|
48793
|
+
return (0, i18n_1.createPropertiesI18nEntries)((0, node_path_1.join)((0, node_path_1.dirname)(manifestPath), defaultPath), newEntries, root, fs5);
|
|
48794
48794
|
}
|
|
48795
48795
|
async function createUI5I18nEntries(root, manifestPath, i18nPropertiesPaths, newEntries, modelKey, fs5) {
|
|
48796
48796
|
return createUI5I18nEntriesBase(root, manifestPath, i18nPropertiesPaths, newEntries, modelKey, fs5);
|
|
@@ -48800,7 +48800,7 @@ var require_write4 = __commonJS({
|
|
|
48800
48800
|
}
|
|
48801
48801
|
async function createManifestI18nEntries(root, i18nPropertiesPaths, newEntries, fs5) {
|
|
48802
48802
|
const i18nFilePath = i18nPropertiesPaths["sap.app"];
|
|
48803
|
-
const dirPath = (0,
|
|
48803
|
+
const dirPath = (0, node_path_1.dirname)(i18nFilePath);
|
|
48804
48804
|
if (!fs5) {
|
|
48805
48805
|
await (0, promises_1.mkdir)(dirPath, { recursive: true });
|
|
48806
48806
|
}
|
|
@@ -48848,12 +48848,12 @@ var require_normalize2 = __commonJS({
|
|
|
48848
48848
|
"use strict";
|
|
48849
48849
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48850
48850
|
exports2.normalizePath = normalizePath;
|
|
48851
|
-
var
|
|
48851
|
+
var node_fs_1 = require("node:fs");
|
|
48852
48852
|
var toUpperCase;
|
|
48853
48853
|
function normalizePath(path5) {
|
|
48854
48854
|
if (process.platform === "win32") {
|
|
48855
48855
|
if (toUpperCase === void 0) {
|
|
48856
|
-
const driveLetter =
|
|
48856
|
+
const driveLetter = node_fs_1.realpathSync.native("\\")[0];
|
|
48857
48857
|
toUpperCase = driveLetter === driveLetter.toUpperCase();
|
|
48858
48858
|
}
|
|
48859
48859
|
const correctedDriveLetter = toUpperCase ? path5.charAt(0).toUpperCase() : path5.charAt(0).toLowerCase();
|
|
@@ -48889,7 +48889,7 @@ var require_info = __commonJS({
|
|
|
48889
48889
|
exports2.getMinUI5VersionFromManifest = getMinUI5VersionFromManifest;
|
|
48890
48890
|
exports2.getMinUI5VersionAsArray = getMinUI5VersionAsArray;
|
|
48891
48891
|
exports2.getMinimumUI5Version = getMinimumUI5Version2;
|
|
48892
|
-
var
|
|
48892
|
+
var node_path_1 = require("node:path");
|
|
48893
48893
|
var constants_1 = require_constants();
|
|
48894
48894
|
var file_1 = require_file();
|
|
48895
48895
|
var cap_1 = require_cap();
|
|
@@ -48898,9 +48898,9 @@ var require_info = __commonJS({
|
|
|
48898
48898
|
var service_1 = require_service();
|
|
48899
48899
|
var ui5_config_1 = require_ui5_config();
|
|
48900
48900
|
var semver_1 = require_semver2();
|
|
48901
|
-
var
|
|
48901
|
+
var path_1 = require_path3();
|
|
48902
48902
|
async function getProject3(root, memFs) {
|
|
48903
|
-
if (!await (0, file_1.fileExists)((0,
|
|
48903
|
+
if (!await (0, file_1.fileExists)((0, node_path_1.join)(root, constants_1.FileName.Package), memFs)) {
|
|
48904
48904
|
throw new Error(`The project root folder '${root}' is not a Fiori project. No 'package.json' found.`);
|
|
48905
48905
|
}
|
|
48906
48906
|
const capProjectType = await (0, cap_1.getCapProjectType)(root);
|
|
@@ -48909,7 +48909,7 @@ var require_info = __commonJS({
|
|
|
48909
48909
|
const appFolders = await getAppFolders(root, memFs);
|
|
48910
48910
|
const apps = await getApps(root, appFolders, memFs);
|
|
48911
48911
|
return {
|
|
48912
|
-
root: (0,
|
|
48912
|
+
root: (0, path_1.normalizePath)(root),
|
|
48913
48913
|
projectType,
|
|
48914
48914
|
apps,
|
|
48915
48915
|
capCustomPaths
|
|
@@ -48917,7 +48917,7 @@ var require_info = __commonJS({
|
|
|
48917
48917
|
}
|
|
48918
48918
|
async function getAppFolders(root, memFs) {
|
|
48919
48919
|
const apps = await (0, search_1.findAllApps)([root], memFs);
|
|
48920
|
-
return apps.length > 0 ? apps.map((app) => (0,
|
|
48920
|
+
return apps.length > 0 ? apps.map((app) => (0, node_path_1.relative)(root, app.appRoot)) : [""];
|
|
48921
48921
|
}
|
|
48922
48922
|
async function getApps(root, appFolders, memFs) {
|
|
48923
48923
|
const apps = {};
|
|
@@ -48930,15 +48930,15 @@ var require_info = __commonJS({
|
|
|
48930
48930
|
return apps;
|
|
48931
48931
|
}
|
|
48932
48932
|
async function getApplicationStructure(root, appFolder, memFs) {
|
|
48933
|
-
const appRoot = (0,
|
|
48933
|
+
const appRoot = (0, node_path_1.join)(root, appFolder);
|
|
48934
48934
|
const absoluteWebappPath = await (0, ui5_config_1.getWebappPath)(appRoot, memFs);
|
|
48935
48935
|
const appType = await getAppType(appRoot, memFs);
|
|
48936
|
-
const manifest = (0,
|
|
48936
|
+
const manifest = (0, node_path_1.join)(absoluteWebappPath, constants_1.FileName.Manifest);
|
|
48937
48937
|
if (!await (0, file_1.fileExists)(manifest, memFs)) {
|
|
48938
48938
|
return void 0;
|
|
48939
48939
|
}
|
|
48940
48940
|
const manifestObject = await (0, file_1.readJSON)(manifest, memFs);
|
|
48941
|
-
const changes = (0,
|
|
48941
|
+
const changes = (0, node_path_1.join)(absoluteWebappPath, constants_1.DirName.Changes);
|
|
48942
48942
|
const i18n = await (0, i18n_1.getI18nPropertiesPaths)(manifest, manifestObject, memFs);
|
|
48943
48943
|
const mainService = (0, service_1.getMainService)(manifestObject);
|
|
48944
48944
|
const services = await (0, service_1.getServicesAndAnnotations)(manifest, manifestObject, memFs);
|
|
@@ -48958,7 +48958,7 @@ var require_info = __commonJS({
|
|
|
48958
48958
|
try {
|
|
48959
48959
|
const webappPath = await (0, ui5_config_1.getWebappPath)(appRoot, memFs);
|
|
48960
48960
|
if (await (0, file_1.fileExists)(webappPath, memFs)) {
|
|
48961
|
-
if (await (0, file_1.fileExists)((0,
|
|
48961
|
+
if (await (0, file_1.fileExists)((0, node_path_1.join)(appRoot, constants_1.FileName.Tsconfig), memFs) && (await (0, file_1.findFilesByExtension)(".ts", webappPath, ignoreFolders, memFs)).length > 0) {
|
|
48962
48962
|
appLanguage = "TypeScript";
|
|
48963
48963
|
} else if ((await (0, file_1.findFilesByExtension)(".js", webappPath, ignoreFolders, memFs)).length > 0) {
|
|
48964
48964
|
appLanguage = "JavaScript";
|
|
@@ -48993,12 +48993,12 @@ var require_info = __commonJS({
|
|
|
48993
48993
|
}
|
|
48994
48994
|
async function getApplicationType(application, memFs) {
|
|
48995
48995
|
let appType;
|
|
48996
|
-
const rootPackageJsonPath = (0,
|
|
48996
|
+
const rootPackageJsonPath = (0, node_path_1.join)(application.projectRoot, constants_1.FileName.Package);
|
|
48997
48997
|
const packageJson = await (0, file_1.fileExists)(rootPackageJsonPath, memFs) ? await (0, file_1.readJSON)(rootPackageJsonPath, memFs) : null;
|
|
48998
48998
|
if (application.projectRoot === application.appRoot) {
|
|
48999
48999
|
appType = packageJson?.sapux ? "SAP Fiori elements" : "SAPUI5 freestyle";
|
|
49000
49000
|
} else if (packageJson) {
|
|
49001
|
-
appType = Array.isArray(packageJson.sapux) && packageJson.sapux.find((relAppPath) => (0,
|
|
49001
|
+
appType = Array.isArray(packageJson.sapux) && packageJson.sapux.find((relAppPath) => (0, node_path_1.join)(application.projectRoot, ...relAppPath.split(/[/\\]/)) === application.appRoot) ? "SAP Fiori elements" : "SAPUI5 freestyle";
|
|
49002
49002
|
} else {
|
|
49003
49003
|
appType = "SAPUI5 freestyle";
|
|
49004
49004
|
}
|
|
@@ -49054,13 +49054,13 @@ var require_mta = __commonJS({
|
|
|
49054
49054
|
exports2.getMtaPath = getMtaPath;
|
|
49055
49055
|
var file_search_1 = require_file_search();
|
|
49056
49056
|
var constants_1 = require_constants();
|
|
49057
|
-
var
|
|
49057
|
+
var node_path_1 = require("node:path");
|
|
49058
49058
|
async function getMtaPath(projectPath, fs5) {
|
|
49059
49059
|
const mtaPath = await (0, file_search_1.findFileUp)(constants_1.FileName.MtaYaml, projectPath, fs5);
|
|
49060
49060
|
if (!mtaPath) {
|
|
49061
49061
|
return void 0;
|
|
49062
49062
|
} else {
|
|
49063
|
-
const mtaFolderPath = (0,
|
|
49063
|
+
const mtaFolderPath = (0, node_path_1.dirname)(mtaPath);
|
|
49064
49064
|
return {
|
|
49065
49065
|
mtaPath,
|
|
49066
49066
|
hasRoot: mtaFolderPath !== projectPath
|
|
@@ -49078,9 +49078,9 @@ var require_specification = __commonJS({
|
|
|
49078
49078
|
exports2.getSpecification = getSpecification;
|
|
49079
49079
|
exports2.refreshSpecificationDistTags = refreshSpecificationDistTags;
|
|
49080
49080
|
exports2.getSpecificationPath = getSpecificationPath;
|
|
49081
|
-
var
|
|
49081
|
+
var node_fs_1 = require("node:fs");
|
|
49082
49082
|
var promises_1 = require("fs/promises");
|
|
49083
|
-
var
|
|
49083
|
+
var node_path_1 = require("node:path");
|
|
49084
49084
|
var semver_1 = require_semver2();
|
|
49085
49085
|
var module_loader_1 = require_module_loader();
|
|
49086
49086
|
var ui5_config_1 = require_ui5_config();
|
|
@@ -49088,12 +49088,12 @@ var require_specification = __commonJS({
|
|
|
49088
49088
|
var constants_1 = require_constants();
|
|
49089
49089
|
var file_1 = require_file();
|
|
49090
49090
|
var command_1 = require_command();
|
|
49091
|
-
var specificationDistTagPath = (0,
|
|
49091
|
+
var specificationDistTagPath = (0, node_path_1.join)(constants_1.fioriToolsDirectory, constants_1.FileName.SpecificationDistTags);
|
|
49092
49092
|
async function getProjectDistTag(root, options2) {
|
|
49093
49093
|
let distTag = "latest";
|
|
49094
49094
|
try {
|
|
49095
49095
|
const webappPath = await (0, ui5_config_1.getWebappPath)(root);
|
|
49096
|
-
const manifest = await (0, file_1.readJSON)((0,
|
|
49096
|
+
const manifest = await (0, file_1.readJSON)((0, node_path_1.join)(webappPath, constants_1.FileName.Manifest));
|
|
49097
49097
|
const minUI5Version = (0, info_1.getMinimumUI5Version)(manifest);
|
|
49098
49098
|
if (minUI5Version && (0, semver_1.valid)(minUI5Version)) {
|
|
49099
49099
|
const [mayor, minor] = minUI5Version.split(".");
|
|
@@ -49105,7 +49105,7 @@ var require_specification = __commonJS({
|
|
|
49105
49105
|
return distTag;
|
|
49106
49106
|
}
|
|
49107
49107
|
async function hasSpecificationDevDependency(root) {
|
|
49108
|
-
const packageJson = await (0, file_1.readJSON)((0,
|
|
49108
|
+
const packageJson = await (0, file_1.readJSON)((0, node_path_1.join)(root, constants_1.FileName.Package));
|
|
49109
49109
|
return !!packageJson.devDependencies?.["@sap/ux-specification"];
|
|
49110
49110
|
}
|
|
49111
49111
|
async function getSpecificationModule(root, options2) {
|
|
@@ -49142,8 +49142,8 @@ var require_specification = __commonJS({
|
|
|
49142
49142
|
const distTags = JSON.parse(distTagsString);
|
|
49143
49143
|
await (0, file_1.writeFile)(specificationDistTagPath, JSON.stringify(distTags, null, 4));
|
|
49144
49144
|
const uniqueVersions = new Set(Object.values(distTags));
|
|
49145
|
-
const specificationCachePath = (0,
|
|
49146
|
-
const removeExistingVersions = (0,
|
|
49145
|
+
const specificationCachePath = (0, node_path_1.join)(constants_1.moduleCacheRoot, "@sap/ux-specification");
|
|
49146
|
+
const removeExistingVersions = (0, node_fs_1.existsSync)(specificationCachePath) ? (await (0, promises_1.readdir)(specificationCachePath, { withFileTypes: true })).filter((d) => d.isDirectory()).filter((d) => !uniqueVersions.has(d.name)).map((d) => d.name) : [];
|
|
49147
49147
|
for (const version3 of removeExistingVersions) {
|
|
49148
49148
|
await (0, module_loader_1.deleteModule)("@sap/ux-specification", version3);
|
|
49149
49149
|
logger4?.debug(`Deleted unused specification module '@sap/ux-specification@${version3}' from cache`);
|
|
@@ -49159,7 +49159,7 @@ var require_specification = __commonJS({
|
|
|
49159
49159
|
}
|
|
49160
49160
|
async function convertDistTagToVersion(distTag, options2) {
|
|
49161
49161
|
const logger4 = options2?.logger;
|
|
49162
|
-
if (!(0,
|
|
49162
|
+
if (!(0, node_fs_1.existsSync)(specificationDistTagPath)) {
|
|
49163
49163
|
logger4?.debug(`Specification dist-tags not found at '${specificationDistTagPath}'. Trying to refresh.`);
|
|
49164
49164
|
await refreshSpecificationDistTags({ logger: logger4 });
|
|
49165
49165
|
}
|
|
@@ -49178,14 +49178,14 @@ var require_specification = __commonJS({
|
|
|
49178
49178
|
if (await hasSpecificationDevDependency(root)) {
|
|
49179
49179
|
const modulePath2 = await (0, module_loader_1.getModulePath)(root, moduleName);
|
|
49180
49180
|
logger4?.debug(`Specification root found in project '${root}'`);
|
|
49181
|
-
return modulePath2.slice(0, modulePath2.lastIndexOf((0,
|
|
49181
|
+
return modulePath2.slice(0, modulePath2.lastIndexOf((0, node_path_1.join)(moduleName)) + (0, node_path_1.join)(moduleName).length);
|
|
49182
49182
|
}
|
|
49183
49183
|
await getSpecificationModule(root, { logger: logger4 });
|
|
49184
49184
|
const version3 = await getSpecificationVersion(root, { logger: logger4 });
|
|
49185
49185
|
logger4?.debug(`Specification not found in project '${root}', using path from cache with version '${version3}'`);
|
|
49186
|
-
const moduleRoot = (0,
|
|
49186
|
+
const moduleRoot = (0, node_path_1.join)(constants_1.moduleCacheRoot, moduleName, version3);
|
|
49187
49187
|
const modulePath = await (0, module_loader_1.getModulePath)(moduleRoot, moduleName);
|
|
49188
|
-
return modulePath.slice(0, modulePath.lastIndexOf((0,
|
|
49188
|
+
return modulePath.slice(0, modulePath.lastIndexOf((0, node_path_1.join)(moduleName)) + (0, node_path_1.join)(moduleName).length);
|
|
49189
49189
|
}
|
|
49190
49190
|
}
|
|
49191
49191
|
});
|
|
@@ -49197,7 +49197,7 @@ var require_access = __commonJS({
|
|
|
49197
49197
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
49198
49198
|
exports2.createApplicationAccess = createApplicationAccess2;
|
|
49199
49199
|
exports2.createProjectAccess = createProjectAccess;
|
|
49200
|
-
var
|
|
49200
|
+
var node_path_1 = require("node:path");
|
|
49201
49201
|
var i18n_1 = require_i18n2();
|
|
49202
49202
|
var info_1 = require_info();
|
|
49203
49203
|
var search_1 = require_search();
|
|
@@ -49344,7 +49344,7 @@ var require_access = __commonJS({
|
|
|
49344
49344
|
* @param memFs - optional mem-fs-editor instance
|
|
49345
49345
|
*/
|
|
49346
49346
|
async updatePackageJSON(packageJson, memFs) {
|
|
49347
|
-
await (0, file_1.updatePackageJSON)((0,
|
|
49347
|
+
await (0, file_1.updatePackageJSON)((0, node_path_1.join)(this.app.appRoot, constants_1.FileName.Package), packageJson, memFs ?? this.options?.fs);
|
|
49348
49348
|
}
|
|
49349
49349
|
/**
|
|
49350
49350
|
* Updates manifest.json file asynchronously by keeping the previous indentation.
|
|
@@ -49453,7 +49453,7 @@ var require_access = __commonJS({
|
|
|
49453
49453
|
options2 = isEditor(fs5) ? { fs: fs5 } : fs5;
|
|
49454
49454
|
}
|
|
49455
49455
|
const project = await (0, info_1.getProject)(app.projectRoot, options2?.fs);
|
|
49456
|
-
const appId = (0,
|
|
49456
|
+
const appId = (0, node_path_1.relative)(project.root, appRoot);
|
|
49457
49457
|
return new ApplicationAccessImp(project, appId, options2);
|
|
49458
49458
|
} catch (error2) {
|
|
49459
49459
|
throw Error(`Error when creating application access for ${appRoot}: ${error2}`);
|
|
@@ -49481,12 +49481,12 @@ var require_script = __commonJS({
|
|
|
49481
49481
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
49482
49482
|
exports2.updatePackageScript = updatePackageScript;
|
|
49483
49483
|
exports2.hasUI5CliV3 = hasUI5CliV3;
|
|
49484
|
-
var
|
|
49484
|
+
var node_path_1 = require("node:path");
|
|
49485
49485
|
var constants_1 = require_constants();
|
|
49486
49486
|
var file_1 = require_file();
|
|
49487
49487
|
var semver_1 = __importDefault(require_semver2());
|
|
49488
49488
|
async function updatePackageScript(basePath, scriptName, script, fs5) {
|
|
49489
|
-
const filePath = (0,
|
|
49489
|
+
const filePath = (0, node_path_1.join)(basePath, constants_1.FileName.Package);
|
|
49490
49490
|
const packageJson = await (0, file_1.readJSON)(filePath, fs5);
|
|
49491
49491
|
if (!packageJson.scripts) {
|
|
49492
49492
|
packageJson.scripts = {};
|
|
@@ -51479,11 +51479,11 @@ var require_helpers = __commonJS({
|
|
|
51479
51479
|
exports2.getLibraryDependencies = getLibraryDependencies;
|
|
51480
51480
|
exports2.getManifestDesc = getManifestDesc;
|
|
51481
51481
|
exports2.getManifestDependencies = getManifestDependencies;
|
|
51482
|
-
var
|
|
51482
|
+
var node_path_1 = require("node:path");
|
|
51483
51483
|
var constants_1 = require_constants7();
|
|
51484
51484
|
var file_1 = require_file();
|
|
51485
51485
|
var constants_2 = require_constants();
|
|
51486
|
-
var
|
|
51486
|
+
var node_fs_1 = require("node:fs");
|
|
51487
51487
|
var fast_xml_parser_1 = require_fxp();
|
|
51488
51488
|
var i18n_1 = require_i18n2();
|
|
51489
51489
|
var i18n_2 = require_dist5();
|
|
@@ -51498,7 +51498,7 @@ var require_helpers = __commonJS({
|
|
|
51498
51498
|
if (libIndex === -1) {
|
|
51499
51499
|
reuseLib = {
|
|
51500
51500
|
name: `${manifest["sap.app"].id}`,
|
|
51501
|
-
path: (0,
|
|
51501
|
+
path: (0, node_path_1.dirname)(manifestPath),
|
|
51502
51502
|
type: reuseType,
|
|
51503
51503
|
uri: manifest["sap.platform.abap"]?.uri ?? "",
|
|
51504
51504
|
dependencies: libDeps,
|
|
@@ -51520,7 +51520,7 @@ var require_helpers = __commonJS({
|
|
|
51520
51520
|
const description = await getLibraryDesc(parsedFile, libraryPath);
|
|
51521
51521
|
libEntry = {
|
|
51522
51522
|
name: `${parsedFile.library.name}`,
|
|
51523
|
-
path: (0,
|
|
51523
|
+
path: (0, node_path_1.dirname)(libraryPath),
|
|
51524
51524
|
type: reuseType,
|
|
51525
51525
|
uri: parsedFile.library?.appData?.manifest?.["sap.platform.abap"]?.uri ?? "",
|
|
51526
51526
|
dependencies: libDeps,
|
|
@@ -51552,7 +51552,7 @@ var require_helpers = __commonJS({
|
|
|
51552
51552
|
...await (0, file_1.findFiles)("library.ts", lib.projectRoot, excludeFolders)
|
|
51553
51553
|
];
|
|
51554
51554
|
for (const manifestPath of manifestPaths) {
|
|
51555
|
-
const manifestFilePath = (0,
|
|
51555
|
+
const manifestFilePath = (0, node_path_1.join)(manifestPath, constants_2.FileName.Manifest);
|
|
51556
51556
|
const manifest = await (0, file_1.readJSON)(manifestFilePath);
|
|
51557
51557
|
const library = await getLibraryFromManifest(manifest, manifestFilePath, reuseLibs, lib.projectRoot);
|
|
51558
51558
|
if (library) {
|
|
@@ -51561,8 +51561,8 @@ var require_helpers = __commonJS({
|
|
|
51561
51561
|
}
|
|
51562
51562
|
for (const libraryPath of libraryPaths) {
|
|
51563
51563
|
try {
|
|
51564
|
-
const libraryFilePath = (0,
|
|
51565
|
-
const library = (await
|
|
51564
|
+
const libraryFilePath = (0, node_path_1.join)(libraryPath, constants_2.FileName.Library);
|
|
51565
|
+
const library = (await node_fs_1.promises.readFile(libraryFilePath, { encoding: "utf8" })).toString();
|
|
51566
51566
|
const libFile = await getLibraryFromLibraryFile(library, libraryFilePath, lib.projectRoot);
|
|
51567
51567
|
updateLibOptions(reuseLibs, libFile);
|
|
51568
51568
|
} catch {
|
|
@@ -51574,7 +51574,7 @@ var require_helpers = __commonJS({
|
|
|
51574
51574
|
};
|
|
51575
51575
|
exports2.getReuseLibs = getReuseLibs;
|
|
51576
51576
|
function getReuseType(libraryPath) {
|
|
51577
|
-
return (0,
|
|
51577
|
+
return (0, node_fs_1.existsSync)((0, node_path_1.join)((0, node_path_1.dirname)(libraryPath), "/library.js")) || (0, node_fs_1.existsSync)((0, node_path_1.join)((0, node_path_1.dirname)(libraryPath), "/library.ts")) ? "library" : "component";
|
|
51578
51578
|
}
|
|
51579
51579
|
function checkDependencies(answers, reuseLibs) {
|
|
51580
51580
|
const missingDeps = [];
|
|
@@ -51596,7 +51596,7 @@ var require_helpers = __commonJS({
|
|
|
51596
51596
|
let libraryDesc = library?.library?.documentation;
|
|
51597
51597
|
if (typeof libraryDesc === "string" && libraryDesc.startsWith("{{")) {
|
|
51598
51598
|
const key = libraryDesc.substring(2, libraryDesc.length - 2);
|
|
51599
|
-
libraryDesc = await geti18nPropertyValue((0,
|
|
51599
|
+
libraryDesc = await geti18nPropertyValue((0, node_path_1.join)((0, node_path_1.dirname)(libraryPath), library.library?.appData?.manifest?.i18n?.toString() ?? ""), key);
|
|
51600
51600
|
}
|
|
51601
51601
|
return libraryDesc?.toString() ?? "";
|
|
51602
51602
|
}
|
|
@@ -58908,7 +58908,7 @@ var require_pipeline = __commonJS({
|
|
|
58908
58908
|
if (typeof streams[streams.length - 1] !== "function") return noop2;
|
|
58909
58909
|
return streams.pop();
|
|
58910
58910
|
}
|
|
58911
|
-
function
|
|
58911
|
+
function pipeline() {
|
|
58912
58912
|
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
58913
58913
|
streams[_key] = arguments[_key];
|
|
58914
58914
|
}
|
|
@@ -58931,7 +58931,7 @@ var require_pipeline = __commonJS({
|
|
|
58931
58931
|
});
|
|
58932
58932
|
return streams.reduce(pipe2);
|
|
58933
58933
|
}
|
|
58934
|
-
module2.exports =
|
|
58934
|
+
module2.exports = pipeline;
|
|
58935
58935
|
}
|
|
58936
58936
|
});
|
|
58937
58937
|
|
|
@@ -78016,7 +78016,7 @@ var require_loader2 = __commonJS({
|
|
|
78016
78016
|
fillPrimitiveTypeProperties(enumType2, raw);
|
|
78017
78017
|
enumType2.isFlags = raw.$IsFlags === true;
|
|
78018
78018
|
enumType2.values = Object.keys(raw).filter((key) => !isValidKey(key)).map((key) => {
|
|
78019
|
-
const value = parseInt(raw[key], 10);
|
|
78019
|
+
const value = Number.parseInt(raw[key], 10);
|
|
78020
78020
|
const enumValue = {
|
|
78021
78021
|
kind: types_1.ENUM_VALUE_KIND,
|
|
78022
78022
|
name: key,
|
|
@@ -79689,7 +79689,7 @@ var require_find_by_position = __commonJS({
|
|
|
79689
79689
|
const segment = segments[i];
|
|
79690
79690
|
if (segment.startsWith("$")) {
|
|
79691
79691
|
if (typeof currentContext === "string") {
|
|
79692
|
-
const offset = parseInt(segment.substring(1), 10);
|
|
79692
|
+
const offset = Number.parseInt(segment.substring(1), 10);
|
|
79693
79693
|
startString = currentContext.substring(0, offset);
|
|
79694
79694
|
remainingString = currentContext.substring(offset);
|
|
79695
79695
|
} else if (typeof currentContext === "object") {
|
|
@@ -79698,9 +79698,9 @@ var require_find_by_position = __commonJS({
|
|
|
79698
79698
|
if (i < segments.length - 1) {
|
|
79699
79699
|
return { found: false, path: path5, startString, remainingString };
|
|
79700
79700
|
}
|
|
79701
|
-
} else if (segment === parseInt(segment, 10).toString() && Array.isArray(currentContext)) {
|
|
79701
|
+
} else if (segment === Number.parseInt(segment, 10).toString() && Array.isArray(currentContext)) {
|
|
79702
79702
|
path5 += convertSegment(segment, false);
|
|
79703
|
-
const index = parseInt(segment, 10);
|
|
79703
|
+
const index = Number.parseInt(segment, 10);
|
|
79704
79704
|
currentContext = currentContext[index];
|
|
79705
79705
|
} else if (typeof currentContext === "object") {
|
|
79706
79706
|
path5 += convertSegment(segment);
|
|
@@ -80303,7 +80303,7 @@ var require_annotations = __commonJS({
|
|
|
80303
80303
|
case "Int":
|
|
80304
80304
|
return {
|
|
80305
80305
|
type: "Int",
|
|
80306
|
-
Int: parseInt(value, 10)
|
|
80306
|
+
Int: Number.parseInt(value, 10)
|
|
80307
80307
|
};
|
|
80308
80308
|
case "Path":
|
|
80309
80309
|
return {
|
|
@@ -81150,7 +81150,7 @@ var require_pointer = __commonJS({
|
|
|
81150
81150
|
path5.push("attributes", "Type", "value");
|
|
81151
81151
|
break;
|
|
81152
81152
|
default:
|
|
81153
|
-
if (isNaN(Number(segment))) {
|
|
81153
|
+
if (Number.isNaN(Number(segment))) {
|
|
81154
81154
|
const { subElement, clearPath, pathSegments } = handleStringSegment(segment, currentElement);
|
|
81155
81155
|
result.subElement = subElement;
|
|
81156
81156
|
path5 = clearPath ? [] : [...path5, ...pathSegments ?? []];
|
|
@@ -81323,11 +81323,11 @@ var require_path4 = __commonJS({
|
|
|
81323
81323
|
"use strict";
|
|
81324
81324
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81325
81325
|
exports2.pathFromUri = pathFromUri;
|
|
81326
|
-
var
|
|
81327
|
-
var
|
|
81328
|
-
var driveLetter = process.platform === "win32" ?
|
|
81326
|
+
var node_fs_1 = require("node:fs");
|
|
81327
|
+
var node_url_1 = require("node:url");
|
|
81328
|
+
var driveLetter = process.platform === "win32" ? node_fs_1.realpathSync.native("\\")[0] : "";
|
|
81329
81329
|
function pathFromUri(uri) {
|
|
81330
|
-
const parsedUri = (0,
|
|
81330
|
+
const parsedUri = (0, node_url_1.fileURLToPath)(uri);
|
|
81331
81331
|
if (process.platform === "win32") {
|
|
81332
81332
|
return toggleCase(parsedUri.charAt(0)) + parsedUri.slice(1);
|
|
81333
81333
|
}
|
|
@@ -81582,8 +81582,8 @@ var require_find2 = __commonJS({
|
|
|
81582
81582
|
const match = mergeMap[key];
|
|
81583
81583
|
if (match) {
|
|
81584
81584
|
const [, targetIndexSegment, termIndexSegment, ...mappedSourceSegments] = match.replace(id, "").split("/");
|
|
81585
|
-
const targetIndex = parseInt(targetIndexSegment, 10);
|
|
81586
|
-
const termIndex = parseInt(termIndexSegment, 10);
|
|
81585
|
+
const targetIndex = Number.parseInt(targetIndexSegment, 10);
|
|
81586
|
+
const termIndex = Number.parseInt(termIndexSegment, 10);
|
|
81587
81587
|
const sourceTerm = file.targets[targetIndex].terms[termIndex];
|
|
81588
81588
|
const internalPointer = (0, pointer_1.convertPointerInAnnotationToInternal)(sourceTerm, "/" + [...mappedSourceSegments, ...mergedSegments.slice(segmentIndex)].join("/"), valueType);
|
|
81589
81589
|
return {
|
|
@@ -98118,7 +98118,7 @@ var require_utils15 = __commonJS({
|
|
|
98118
98118
|
if (value === void 0) {
|
|
98119
98119
|
return true;
|
|
98120
98120
|
}
|
|
98121
|
-
return isNaN(value);
|
|
98121
|
+
return Number.isNaN(value);
|
|
98122
98122
|
};
|
|
98123
98123
|
exports2.hasNaNOrUndefined = hasNaNOrUndefined;
|
|
98124
98124
|
var isDefined = (value) => {
|
|
@@ -99354,7 +99354,7 @@ var require_ast = __commonJS({
|
|
|
99354
99354
|
* @returns Annotation ast node
|
|
99355
99355
|
*/
|
|
99356
99356
|
toTopLevelAnnotation(assignment, location) {
|
|
99357
|
-
if ((0, utils_1.isDefined)(assignment.location) && isNaN(assignment.location.startOffset) && assignment.recoveredNode === true) {
|
|
99357
|
+
if ((0, utils_1.isDefined)(assignment.location) && Number.isNaN(assignment.location.startOffset) && assignment.recoveredNode === true) {
|
|
99358
99358
|
return void 0;
|
|
99359
99359
|
}
|
|
99360
99360
|
if (assignment.children.path) {
|
|
@@ -100904,7 +100904,7 @@ ${indent2}</${element.name}>`));
|
|
|
100904
100904
|
const edits = [];
|
|
100905
100905
|
const openTagRange = (0, xml_odata_annotation_converter_1.transformRange)(element.syntax.openBody);
|
|
100906
100906
|
if (parent.type === "XMLElement") {
|
|
100907
|
-
const index = parseInt(pointer.split("/").slice(-1)[0], 10);
|
|
100907
|
+
const index = Number.parseInt(pointer.split("/").slice(-1)[0], 10);
|
|
100908
100908
|
const { previousContentIndex, startContentIndex } = findContentIndices(index, index, content);
|
|
100909
100909
|
const anchor = getStartAnchor(content, parent, previousContentIndex, startContentIndex);
|
|
100910
100910
|
if (anchor) {
|
|
@@ -101135,7 +101135,7 @@ ${indent2}</${element.name}>`));
|
|
|
101135
101135
|
const groups = pointers.reduce((acc, pointer) => {
|
|
101136
101136
|
const segments = pointer.split("/");
|
|
101137
101137
|
const containerPath = segments.slice(0, -2).join("/");
|
|
101138
|
-
const index = parseInt(segments.slice(-1)[0], 10);
|
|
101138
|
+
const index = Number.parseInt(segments.slice(-1)[0], 10);
|
|
101139
101139
|
const list = acc.get(containerPath);
|
|
101140
101140
|
if (list) {
|
|
101141
101141
|
list.push(index);
|
|
@@ -102216,7 +102216,7 @@ var require_service2 = __commonJS({
|
|
|
102216
102216
|
"use strict";
|
|
102217
102217
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
102218
102218
|
exports2.getLocalEDMXService = getLocalEDMXService;
|
|
102219
|
-
var
|
|
102219
|
+
var node_url_1 = require("node:url");
|
|
102220
102220
|
function getLocalEDMXService(project, serviceName, appName) {
|
|
102221
102221
|
const app = project.apps[adjustAppNameByProjectData(appName, project)];
|
|
102222
102222
|
const service = app?.services[serviceName];
|
|
@@ -102224,10 +102224,10 @@ var require_service2 = __commonJS({
|
|
|
102224
102224
|
throw new Error(`Metadata file for service ${serviceName} in app ${appName} is not found!`);
|
|
102225
102225
|
}
|
|
102226
102226
|
const metadataFilePath = service.local ?? "";
|
|
102227
|
-
const metadataFileUri = (0,
|
|
102227
|
+
const metadataFileUri = (0, node_url_1.pathToFileURL)(metadataFilePath).toString();
|
|
102228
102228
|
const metadataFile = { uri: metadataFileUri, isReadOnly: true };
|
|
102229
102229
|
const serviceAnnotations = service?.annotations ?? [];
|
|
102230
|
-
const uris = serviceAnnotations.map((item) => (0,
|
|
102230
|
+
const uris = serviceAnnotations.map((item) => (0, node_url_1.pathToFileURL)(item.local ?? "").toString());
|
|
102231
102231
|
const backendAnnotationFileIdx = serviceAnnotations.findIndex((annotation, idx) => typeof annotation.local === "string" && typeof annotation.uri === "string" && !uris[idx].endsWith(annotation.uri));
|
|
102232
102232
|
const backendAnnotationFileUri = uris[backendAnnotationFileIdx] ?? "";
|
|
102233
102233
|
const annotationFiles = uris.map((uri) => {
|
|
@@ -105597,12 +105597,12 @@ var require_service3 = __commonJS({
|
|
|
105597
105597
|
"use strict";
|
|
105598
105598
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
105599
105599
|
exports2.getCDSService = getCDSService;
|
|
105600
|
-
var
|
|
105600
|
+
var node_url_1 = require("node:url");
|
|
105601
105601
|
var ux_cds_compiler_facade_1 = require_dist14();
|
|
105602
105602
|
async function getCDSService(projectRoot, serviceName, fileCache, clearCache2 = false) {
|
|
105603
105603
|
const files = await (0, ux_cds_compiler_facade_1.getCdsFiles)(projectRoot, fileCache, clearCache2);
|
|
105604
105604
|
const serviceFiles = files.map((uri) => {
|
|
105605
|
-
return { uri: (0,
|
|
105605
|
+
return { uri: (0, node_url_1.pathToFileURL)(uri).toString(), isReadOnly: uri.indexOf("node_modules") !== -1 };
|
|
105606
105606
|
});
|
|
105607
105607
|
return {
|
|
105608
105608
|
type: "cap-cds",
|
|
@@ -109626,7 +109626,7 @@ var require_find_node = __commonJS({
|
|
|
109626
109626
|
}
|
|
109627
109627
|
function getTermNodes(terms, path5) {
|
|
109628
109628
|
const [, indexString, ...segments] = path5;
|
|
109629
|
-
const index = parseInt(indexString, 10);
|
|
109629
|
+
const index = Number.parseInt(indexString, 10);
|
|
109630
109630
|
let node = terms[index];
|
|
109631
109631
|
const nodes = [];
|
|
109632
109632
|
for (const segment of segments) {
|
|
@@ -110050,7 +110050,7 @@ var require_annotation_file3 = __commonJS({
|
|
|
110050
110050
|
if (options2.position) {
|
|
110051
110051
|
if (pointer) {
|
|
110052
110052
|
const [innerIndex, ...rest] = pointer.split("/").slice(1);
|
|
110053
|
-
const adjustedTermIndex = acc.length + parseInt(innerIndex, 10);
|
|
110053
|
+
const adjustedTermIndex = acc.length + Number.parseInt(innerIndex, 10);
|
|
110054
110054
|
returnValue.pointer = ["", "targets", targetIndex, "terms", adjustedTermIndex, ...rest].join("/");
|
|
110055
110055
|
returnValue.nodeRange = nodeRange;
|
|
110056
110056
|
} else if (assignment.type === cds_annotation_parser_1.ANNOTATION_GROUP_TYPE) {
|
|
@@ -110259,10 +110259,10 @@ var require_misc = __commonJS({
|
|
|
110259
110259
|
"use strict";
|
|
110260
110260
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
110261
110261
|
exports2.toAbsoluteUriString = void 0;
|
|
110262
|
-
var
|
|
110263
|
-
var
|
|
110262
|
+
var node_path_1 = require("node:path");
|
|
110263
|
+
var node_url_1 = require("node:url");
|
|
110264
110264
|
var toAbsoluteUriString = (root, relativeUri) => {
|
|
110265
|
-
return (0,
|
|
110265
|
+
return (0, node_url_1.pathToFileURL)((0, node_path_1.join)(root, relativeUri)).toString();
|
|
110266
110266
|
};
|
|
110267
110267
|
exports2.toAbsoluteUriString = toAbsoluteUriString;
|
|
110268
110268
|
}
|
|
@@ -111645,7 +111645,7 @@ var require_document2 = __commonJS({
|
|
|
111645
111645
|
exports2.getGhostFileDocument = getGhostFileDocument;
|
|
111646
111646
|
exports2.getChildCount = getChildCount;
|
|
111647
111647
|
exports2.getItems = getItems;
|
|
111648
|
-
var
|
|
111648
|
+
var node_url_1 = require("node:url");
|
|
111649
111649
|
var odata_annotation_core_types_1 = require_dist8();
|
|
111650
111650
|
var cds_odata_annotation_converter_1 = require_dist15();
|
|
111651
111651
|
var utils_1 = require_utils13();
|
|
@@ -111681,7 +111681,7 @@ var require_document2 = __commonJS({
|
|
|
111681
111681
|
if (content === void 0 || content === null) {
|
|
111682
111682
|
throw new Error(`File ${file.uri} not found in cache!`);
|
|
111683
111683
|
}
|
|
111684
|
-
const tokenVector = facade.getTokensForUri((0,
|
|
111684
|
+
const tokenVector = facade.getTokensForUri((0, node_url_1.fileURLToPath)(file.uri));
|
|
111685
111685
|
return ignoreComments ? [] : (0, comments_1.collectComments)(tokenVector);
|
|
111686
111686
|
}
|
|
111687
111687
|
function getGhostFileDocument(serviceName, vocabularyService, facade, fileCache, file, metadataCollector, propagatedTargetMap) {
|
|
@@ -112373,8 +112373,8 @@ var require_pointer4 = __commonJS({
|
|
|
112373
112373
|
*/
|
|
112374
112374
|
document(astNode, node, pointer) {
|
|
112375
112375
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112376
|
-
const index = parseInt(indexSegment, 10);
|
|
112377
|
-
if (!isNaN(index)) {
|
|
112376
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112377
|
+
if (!Number.isNaN(index)) {
|
|
112378
112378
|
if (segment === "targets") {
|
|
112379
112379
|
if (segments.length === 0) {
|
|
112380
112380
|
return {
|
|
@@ -112395,7 +112395,7 @@ var require_pointer4 = __commonJS({
|
|
|
112395
112395
|
target(astNode, node, pointer) {
|
|
112396
112396
|
if (astNode.type === cds_odata_annotation_converter_1.TARGET_TYPE) {
|
|
112397
112397
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112398
|
-
const index = parseInt(indexSegment, 10);
|
|
112398
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112399
112399
|
const nextGenericNode = node.terms[index];
|
|
112400
112400
|
if (segment === "terms") {
|
|
112401
112401
|
if (nextGenericNode?.range) {
|
|
@@ -112450,8 +112450,8 @@ var require_pointer4 = __commonJS({
|
|
|
112450
112450
|
this.currentFlattenedSegmentIndexInPath = termSegmentLength - 1;
|
|
112451
112451
|
}
|
|
112452
112452
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112453
|
-
const index = parseInt(indexSegment, 10);
|
|
112454
|
-
if (!isNaN(index) && segment === "content" && astNode.value) {
|
|
112453
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112454
|
+
if (!Number.isNaN(index) && segment === "content" && astNode.value) {
|
|
112455
112455
|
const annotationFileNode = node.content[index];
|
|
112456
112456
|
if (annotationFileNode) {
|
|
112457
112457
|
if (this.flattenedSegments.length > 0) {
|
|
@@ -112490,8 +112490,8 @@ var require_pointer4 = __commonJS({
|
|
|
112490
112490
|
value(astNode, node, pointer) {
|
|
112491
112491
|
if (astNode.type === cds_annotation_parser_1.COLLECTION_TYPE && node.type === odata_annotation_core_types_1.ELEMENT_TYPE && node.name === "Collection") {
|
|
112492
112492
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112493
|
-
const index = parseInt(indexSegment, 10);
|
|
112494
|
-
if (!isNaN(index)) {
|
|
112493
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112494
|
+
if (!Number.isNaN(index)) {
|
|
112495
112495
|
const nextAstNode = astNode.items[index];
|
|
112496
112496
|
if (segment === "content" && nextAstNode) {
|
|
112497
112497
|
const result = this.value(nextAstNode, node.content[index], segments);
|
|
@@ -112511,8 +112511,8 @@ var require_pointer4 = __commonJS({
|
|
|
112511
112511
|
}
|
|
112512
112512
|
if (astNode.type === cds_annotation_parser_1.RECORD_TYPE && node.type === odata_annotation_core_types_1.ELEMENT_TYPE && node.name === "Record") {
|
|
112513
112513
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112514
|
-
const index = parseInt(indexSegment, 10);
|
|
112515
|
-
if (!isNaN(index)) {
|
|
112514
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112515
|
+
if (!Number.isNaN(index)) {
|
|
112516
112516
|
const nextGenericNode = node.content[index];
|
|
112517
112517
|
if (segment === "content" && nextGenericNode.type === odata_annotation_core_types_1.ELEMENT_TYPE && nextGenericNode.range) {
|
|
112518
112518
|
const propertyIndex = findNodeIndexByRange(astNode.properties, nextGenericNode.range);
|
|
@@ -112611,8 +112611,8 @@ var require_pointer4 = __commonJS({
|
|
|
112611
112611
|
};
|
|
112612
112612
|
}
|
|
112613
112613
|
} else if (segment === "content") {
|
|
112614
|
-
const index = parseInt(indexSegment, 10);
|
|
112615
|
-
if (!isNaN(index) && segment === "content" && astNode.value) {
|
|
112614
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112615
|
+
if (!Number.isNaN(index) && segment === "content" && astNode.value) {
|
|
112616
112616
|
if (this.flattenedSegments.length > 1) {
|
|
112617
112617
|
const result = this.flattenedProperty(astNode, node.content[index], segments);
|
|
112618
112618
|
if (result) {
|
|
@@ -112639,8 +112639,8 @@ var require_pointer4 = __commonJS({
|
|
|
112639
112639
|
}
|
|
112640
112640
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112641
112641
|
if (segment === "content") {
|
|
112642
|
-
const index = parseInt(indexSegment, 10);
|
|
112643
|
-
if (!isNaN(index) && segment === "content" && astNode.value) {
|
|
112642
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112643
|
+
if (!Number.isNaN(index) && segment === "content" && astNode.value) {
|
|
112644
112644
|
this.flattenedSegments.shift();
|
|
112645
112645
|
this.currentFlattenedSegmentIndexInPath++;
|
|
112646
112646
|
const result = this.flattenedSegments.length > 0 ? this.recordProperty(astNode, node.content[index], segments) : this.value(astNode.value, node.content[index], segments);
|
|
@@ -112665,8 +112665,8 @@ var require_pointer4 = __commonJS({
|
|
|
112665
112665
|
}
|
|
112666
112666
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112667
112667
|
if (segment === "content") {
|
|
112668
|
-
const index = parseInt(indexSegment, 10);
|
|
112669
|
-
if (!isNaN(index) && segment === "content") {
|
|
112668
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112669
|
+
if (!Number.isNaN(index) && segment === "content") {
|
|
112670
112670
|
this.flattenedSegments.shift();
|
|
112671
112671
|
this.currentFlattenedSegmentIndexInPath++;
|
|
112672
112672
|
const propertyValue = node.content[index];
|
|
@@ -112687,7 +112687,7 @@ var require_pointer4 = __commonJS({
|
|
|
112687
112687
|
return void 0;
|
|
112688
112688
|
}
|
|
112689
112689
|
const [segment, indexSegment, ...segments] = pointer;
|
|
112690
|
-
const index = parseInt(indexSegment, 10);
|
|
112690
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112691
112691
|
if (!Number.isNaN(index) && segment === "content") {
|
|
112692
112692
|
const next = node.content[index];
|
|
112693
112693
|
if (next?.type !== odata_annotation_core_types_1.ELEMENT_TYPE) {
|
|
@@ -112715,7 +112715,7 @@ var require_pointer4 = __commonJS({
|
|
|
112715
112715
|
};
|
|
112716
112716
|
}
|
|
112717
112717
|
const [segment, indexSegment] = pointer;
|
|
112718
|
-
const index = parseInt(indexSegment, 10);
|
|
112718
|
+
const index = Number.parseInt(indexSegment, 10);
|
|
112719
112719
|
if (!Number.isNaN(index) && segment === "content") {
|
|
112720
112720
|
const next = node.content[index];
|
|
112721
112721
|
if (next?.type === odata_annotation_core_types_1.TEXT_TYPE) {
|
|
@@ -113461,8 +113461,8 @@ var require_writer2 = __commonJS({
|
|
|
113461
113461
|
"use strict";
|
|
113462
113462
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
113463
113463
|
exports2.CDSWriter = void 0;
|
|
113464
|
-
var
|
|
113465
|
-
var
|
|
113464
|
+
var node_path_1 = require("node:path");
|
|
113465
|
+
var node_url_1 = require("node:url");
|
|
113466
113466
|
var project_access_1 = require_dist6();
|
|
113467
113467
|
var odata_annotation_core_1 = require_dist10();
|
|
113468
113468
|
var ux_cds_compiler_facade_1 = require_dist14();
|
|
@@ -113726,7 +113726,7 @@ var require_writer2 = __commonJS({
|
|
|
113726
113726
|
const [astNode, parent] = reversePath;
|
|
113727
113727
|
const segments = change.pointer.split("/");
|
|
113728
113728
|
const lastIndex = segments.pop() ?? "";
|
|
113729
|
-
const index = parseInt(lastIndex, 10);
|
|
113729
|
+
const index = Number.parseInt(lastIndex, 10);
|
|
113730
113730
|
if (Number.isNaN(index) || astNode?.type !== cds_annotation_parser_1.ANNOTATION_GROUP_TYPE || parent?.type !== cds_odata_annotation_converter_1.TARGET_TYPE) {
|
|
113731
113731
|
return;
|
|
113732
113732
|
}
|
|
@@ -113750,7 +113750,7 @@ var require_writer2 = __commonJS({
|
|
|
113750
113750
|
return;
|
|
113751
113751
|
}
|
|
113752
113752
|
const targetPointer = change.pointer.split("/").slice(0, 3).join("/");
|
|
113753
|
-
const assignmentIndex = parseInt(lastIndex, 10);
|
|
113753
|
+
const assignmentIndex = Number.parseInt(lastIndex, 10);
|
|
113754
113754
|
if (Number.isNaN(assignmentIndex)) {
|
|
113755
113755
|
return;
|
|
113756
113756
|
}
|
|
@@ -114086,7 +114086,7 @@ ${closingIndent})`)
|
|
|
114086
114086
|
throw new error_1.ApiError(`${pointer} is not pointing to a collection element.`);
|
|
114087
114087
|
}
|
|
114088
114088
|
const content = getContainerContent(parent, comments, tokens);
|
|
114089
|
-
const index = parseInt(lastIndex, 10);
|
|
114089
|
+
const index = Number.parseInt(lastIndex, 10);
|
|
114090
114090
|
const { startContentIndex } = findContentIndices(content, index);
|
|
114091
114091
|
deleteBlock(edits, content, startContentIndex);
|
|
114092
114092
|
} else if (parent.type === cds_annotation_parser_1.RECORD_TYPE && (astNode.type === cds_annotation_parser_1.RECORD_PROPERTY_TYPE || astNode.type === cds_annotation_parser_1.ANNOTATION_TYPE)) {
|
|
@@ -114094,7 +114094,7 @@ ${closingIndent})`)
|
|
|
114094
114094
|
throw new error_1.ApiError(`${pointer} is not pointing to a record property.`);
|
|
114095
114095
|
}
|
|
114096
114096
|
const content = getContainerContent(parent, comments, tokens);
|
|
114097
|
-
const index = parseInt(lastIndex, 10);
|
|
114097
|
+
const index = Number.parseInt(lastIndex, 10);
|
|
114098
114098
|
const { startContentIndex } = findContentIndices(content, index, index, astNode.type);
|
|
114099
114099
|
deleteBlock(edits, content, startContentIndex);
|
|
114100
114100
|
} else if (parent.type === cds_annotation_parser_1.ANNOTATION_TYPE || parent.type === cds_annotation_parser_1.RECORD_PROPERTY_TYPE) {
|
|
@@ -114202,7 +114202,7 @@ ${closingIndent})`)
|
|
|
114202
114202
|
async function getTextEditForMissingRefs(missingReferences, fileUri, projectRoot) {
|
|
114203
114203
|
const missingReferencesTexts = [];
|
|
114204
114204
|
for (const missingRef of missingReferences) {
|
|
114205
|
-
const relativePath = (0,
|
|
114205
|
+
const relativePath = (0, node_path_1.relative)(projectRoot, (0, node_url_1.fileURLToPath)(fileUri));
|
|
114206
114206
|
const referenceUri = await (0, project_access_1.toReferenceUri)(projectRoot, relativePath, missingRef);
|
|
114207
114207
|
missingReferencesTexts.push(serializeReference({ namespace: "", referenceUri }));
|
|
114208
114208
|
}
|
|
@@ -114255,7 +114255,7 @@ ${closingIndent})`)
|
|
|
114255
114255
|
const groups = pointers.reduce((acc, pointer) => {
|
|
114256
114256
|
const segments = pointer.split("/");
|
|
114257
114257
|
const containerPath = segments.slice(0, -2).join("/");
|
|
114258
|
-
const index = parseInt(segments.slice(-1)[0], 10);
|
|
114258
|
+
const index = Number.parseInt(segments.slice(-1)[0], 10);
|
|
114259
114259
|
const list = acc.get(containerPath);
|
|
114260
114260
|
if (list) {
|
|
114261
114261
|
list.push(index);
|
|
@@ -114452,9 +114452,9 @@ var require_references2 = __commonJS({
|
|
|
114452
114452
|
exports2.isAvailable = void 0;
|
|
114453
114453
|
exports2.resolvePath = resolvePath;
|
|
114454
114454
|
exports2.getMissingRefs = getMissingRefs;
|
|
114455
|
-
var
|
|
114456
|
-
var
|
|
114457
|
-
var
|
|
114455
|
+
var node_url_1 = require("node:url");
|
|
114456
|
+
var node_path_1 = require("node:path");
|
|
114457
|
+
var node_os_1 = require("node:os");
|
|
114458
114458
|
var odata_annotation_core_types_1 = require_dist8();
|
|
114459
114459
|
var odata_annotation_core_1 = require_dist10();
|
|
114460
114460
|
var error_1 = require_error2();
|
|
@@ -114649,8 +114649,8 @@ var require_references2 = __commonJS({
|
|
|
114649
114649
|
function addAvailableNamespaces(fileUri, namespaceMap, projectRoot, documents, fileUrisDone = /* @__PURE__ */ new Set()) {
|
|
114650
114650
|
if (!fileUrisDone.has(fileUri)) {
|
|
114651
114651
|
fileUrisDone.add(fileUri);
|
|
114652
|
-
let filePath = (0,
|
|
114653
|
-
if ((0,
|
|
114652
|
+
let filePath = (0, node_url_1.pathToFileURL)((0, node_path_1.join)(projectRoot, fileUri)).toString();
|
|
114653
|
+
if ((0, node_os_1.platform)() === "win32" && !documents.has(filePath)) {
|
|
114654
114654
|
let driveLetter = filePath[8];
|
|
114655
114655
|
if (driveLetter === driveLetter.toLowerCase()) {
|
|
114656
114656
|
driveLetter = driveLetter.toUpperCase();
|
|
@@ -114665,7 +114665,7 @@ var require_references2 = __commonJS({
|
|
|
114665
114665
|
references.filter((reference) => !!reference?.uri).forEach((reference) => {
|
|
114666
114666
|
const refUri = reference?.uri;
|
|
114667
114667
|
if (refUri) {
|
|
114668
|
-
const relativeString = (0,
|
|
114668
|
+
const relativeString = (0, node_path_1.relative)(projectRoot, refUri);
|
|
114669
114669
|
namespaceMap.set(reference.name + "|" + relativeString, {
|
|
114670
114670
|
uri: refUri,
|
|
114671
114671
|
name: reference.name,
|
|
@@ -114679,7 +114679,7 @@ var require_references2 = __commonJS({
|
|
|
114679
114679
|
}
|
|
114680
114680
|
var isAvailable = (projectRoot, references, relativePath, name) => {
|
|
114681
114681
|
const matchedReferences = references.filter((reference) => {
|
|
114682
|
-
let absoluteUri = (0,
|
|
114682
|
+
let absoluteUri = (0, node_path_1.join)(projectRoot, relativePath ?? "");
|
|
114683
114683
|
if (absoluteUri && process.platform === "win32") {
|
|
114684
114684
|
absoluteUri = absoluteUri.charAt(0).toUpperCase() + absoluteUri.slice(1);
|
|
114685
114685
|
}
|
|
@@ -114727,7 +114727,7 @@ var require_references2 = __commonJS({
|
|
|
114727
114727
|
const fullyQualifiedPath = resolvePath(metadataPath, aliasInfo);
|
|
114728
114728
|
const metadataSegments = fullyQualifiedPath.split("/");
|
|
114729
114729
|
const virtualPropertyUri = virtualProperties.get(fullyQualifiedPath);
|
|
114730
|
-
if (virtualPropertyUri && !(0, exports2.isAvailable)(projectRoot, references, (0,
|
|
114730
|
+
if (virtualPropertyUri && !(0, exports2.isAvailable)(projectRoot, references, (0, node_path_1.relative)(projectRoot, (0, node_url_1.fileURLToPath)(virtualPropertyUri)), fullyQualifiedPath)) {
|
|
114731
114731
|
missingReferences.add(virtualPropertyUri);
|
|
114732
114732
|
}
|
|
114733
114733
|
const currentMdElementPath = checkSegments(fileUri, references, missingReferences, metadataSegments, metadataService, projectRoot);
|
|
@@ -114740,7 +114740,7 @@ var require_references2 = __commonJS({
|
|
|
114740
114740
|
return result;
|
|
114741
114741
|
}
|
|
114742
114742
|
function getMissingRefs(documents, fileUri, targetName, targetOrElement, aliasInfo, metadataService, projectInfo) {
|
|
114743
|
-
const relativePath = (0,
|
|
114743
|
+
const relativePath = (0, node_path_1.relative)(projectInfo.projectRoot, (0, node_url_1.fileURLToPath)(fileUri));
|
|
114744
114744
|
const { appName, apps, projectRoot } = projectInfo;
|
|
114745
114745
|
const missingReferences = /* @__PURE__ */ new Set();
|
|
114746
114746
|
let paths = [];
|
|
@@ -114785,7 +114785,7 @@ var require_references2 = __commonJS({
|
|
|
114785
114785
|
if (annotationPath) {
|
|
114786
114786
|
const references = definitionIndex.get(annotationPath);
|
|
114787
114787
|
if (references) {
|
|
114788
|
-
const relativePath = (0,
|
|
114788
|
+
const relativePath = (0, node_path_1.relative)(projectRoot, (0, node_url_1.fileURLToPath)(references[0]));
|
|
114789
114789
|
uris.push(relativePath);
|
|
114790
114790
|
}
|
|
114791
114791
|
}
|
|
@@ -114803,8 +114803,8 @@ var require_references2 = __commonJS({
|
|
|
114803
114803
|
return crossAppFolder;
|
|
114804
114804
|
}
|
|
114805
114805
|
function isSubDirectory(parent, child) {
|
|
114806
|
-
const relativePath = (0,
|
|
114807
|
-
return !!(relativePath && !relativePath.startsWith("..") && !(0,
|
|
114806
|
+
const relativePath = (0, node_path_1.relative)(parent, child);
|
|
114807
|
+
return !!(relativePath && !relativePath.startsWith("..") && !(0, node_path_1.isAbsolute)(relativePath));
|
|
114808
114808
|
}
|
|
114809
114809
|
function hasMissingUri(uris, fileUri, references, projectRoot) {
|
|
114810
114810
|
if (uris.length === 0) {
|
|
@@ -114848,8 +114848,8 @@ var require_adapter3 = __commonJS({
|
|
|
114848
114848
|
"use strict";
|
|
114849
114849
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
114850
114850
|
exports2.CDSAnnotationServiceAdapter = void 0;
|
|
114851
|
-
var
|
|
114852
|
-
var
|
|
114851
|
+
var node_url_1 = require("node:url");
|
|
114852
|
+
var node_path_1 = require("node:path");
|
|
114853
114853
|
var vscode_languageserver_textdocument_1 = require_main();
|
|
114854
114854
|
var ux_cds_compiler_facade_1 = require_dist14();
|
|
114855
114855
|
var odata_annotation_core_types_1 = require_dist8();
|
|
@@ -114929,7 +114929,7 @@ var require_adapter3 = __commonJS({
|
|
|
114929
114929
|
* @returns Sync errors
|
|
114930
114930
|
*/
|
|
114931
114931
|
async sync(fileCache) {
|
|
114932
|
-
const paths = [...this.service.serviceFiles.map((file) => (0,
|
|
114932
|
+
const paths = [...this.service.serviceFiles.map((file) => (0, node_url_1.fileURLToPath)(file.uri))];
|
|
114933
114933
|
const facade = await (0, ux_cds_compiler_facade_1.createCdsCompilerFacadeForRoot)(this.project.root, paths, fileCache);
|
|
114934
114934
|
this.setFacade(facade);
|
|
114935
114935
|
const compileErrors = facade.getCompilerErrors(this.project.root);
|
|
@@ -114958,7 +114958,7 @@ var require_adapter3 = __commonJS({
|
|
|
114958
114958
|
for (const file of this.service.serviceFiles) {
|
|
114959
114959
|
const document2 = (0, document_1.getDocument)(this.service.serviceName, this.vocabularyService, facade, fileCache, file, metadataCollector);
|
|
114960
114960
|
this.documents.set(file.uri, document2);
|
|
114961
|
-
if (sourceUris.has((0,
|
|
114961
|
+
if (sourceUris.has((0, node_path_1.relative)(this.project.root, (0, node_url_1.fileURLToPath)(file.uri)))) {
|
|
114962
114962
|
const ghostDoc = (0, document_1.getGhostFileDocument)(this.service.serviceName, this.vocabularyService, facade, fileCache, file, metadataCollector, propagationMap);
|
|
114963
114963
|
this.documents.set(ghostDoc.annotationFile.uri, ghostDoc);
|
|
114964
114964
|
}
|
|
@@ -114998,9 +114998,9 @@ var require_adapter3 = __commonJS({
|
|
|
114998
114998
|
getInitialFileContent(serviceName, uri) {
|
|
114999
114999
|
if (this.facade) {
|
|
115000
115000
|
const fileName = this.facade.getFileName(serviceName) ?? "";
|
|
115001
|
-
let path5 = (0,
|
|
115002
|
-
path5 = (0,
|
|
115003
|
-
path5 = path5.split(
|
|
115001
|
+
let path5 = (0, node_path_1.relative)((0, node_path_1.dirname)(uri), (0, node_path_1.join)(this.project.root, (0, node_path_1.dirname)(fileName))).replace(/\\/g, "/");
|
|
115002
|
+
path5 = (0, node_path_1.join)(path5, (0, node_path_1.basename)(fileName, ".cds"));
|
|
115003
|
+
path5 = path5.split(node_path_1.sep).join("/");
|
|
115004
115004
|
return `using ${serviceName} as service from '${path5}';
|
|
115005
115005
|
`;
|
|
115006
115006
|
}
|
|
@@ -115160,7 +115160,7 @@ var require_adapter3 = __commonJS({
|
|
|
115160
115160
|
}
|
|
115161
115161
|
updateFileSequence(facade) {
|
|
115162
115162
|
this._fileSequence = facade.getFileSequence().map((uri) => ({
|
|
115163
|
-
uri: (0,
|
|
115163
|
+
uri: (0, node_url_1.pathToFileURL)(uri).toString(),
|
|
115164
115164
|
isReadOnly: uri.indexOf("node_modules") !== -1
|
|
115165
115165
|
}));
|
|
115166
115166
|
this.service.serviceFiles = [...this._fileSequence];
|
|
@@ -115172,7 +115172,7 @@ var require_adapter3 = __commonJS({
|
|
|
115172
115172
|
const normalizedReferences = [...missingReferences].map((reference) => {
|
|
115173
115173
|
if (reference.startsWith("file://")) {
|
|
115174
115174
|
const path5 = (0, utils_1.pathFromUri)(reference);
|
|
115175
|
-
return (0,
|
|
115175
|
+
return (0, node_path_1.relative)(this.project.root, path5);
|
|
115176
115176
|
} else {
|
|
115177
115177
|
return reference;
|
|
115178
115178
|
}
|
|
@@ -115346,7 +115346,7 @@ var require_adapter3 = __commonJS({
|
|
|
115346
115346
|
writer.addChange((0, change_1.createInsertEmbeddedAnnotationChange)(pointer, change.element, index));
|
|
115347
115347
|
} else if (change.element.name === "Record") {
|
|
115348
115348
|
const segment = pointer.split("/");
|
|
115349
|
-
const changeIndex = parseInt(segment.pop() ?? "", 10);
|
|
115349
|
+
const changeIndex = Number.parseInt(segment.pop() ?? "", 10);
|
|
115350
115350
|
const modifiedPointer = segment.join("/");
|
|
115351
115351
|
writer.addChange((0, change_1.createInsertRecordChange)(modifiedPointer, change.element, changeIndex));
|
|
115352
115352
|
}
|
|
@@ -116401,8 +116401,8 @@ var require_fiori_service = __commonJS({
|
|
|
116401
116401
|
var error_1 = require_error2();
|
|
116402
116402
|
var utils_1 = require_utils13();
|
|
116403
116403
|
var change_converter_1 = require_change_converter();
|
|
116404
|
-
var
|
|
116405
|
-
var
|
|
116404
|
+
var node_path_1 = require("node:path");
|
|
116405
|
+
var node_url_1 = require("node:url");
|
|
116406
116406
|
var logger_1 = require_logger3();
|
|
116407
116407
|
function getOptionsWithDefaults(options2) {
|
|
116408
116408
|
return {
|
|
@@ -116701,7 +116701,7 @@ ${JSON.stringify(this.changes, void 0, 2)}`);
|
|
|
116701
116701
|
const fileCache = /* @__PURE__ */ new Map();
|
|
116702
116702
|
if (fsEditor) {
|
|
116703
116703
|
for (const [relativePath, value] of Object.entries(fsEditor.dump())) {
|
|
116704
|
-
const absolute = (0,
|
|
116704
|
+
const absolute = (0, node_url_1.pathToFileURL)((0, node_path_1.join)(process.cwd(), relativePath)).toString();
|
|
116705
116705
|
fileCache.set(absolute, value.contents);
|
|
116706
116706
|
}
|
|
116707
116707
|
}
|
|
@@ -158134,7 +158134,7 @@ var require_installedCheck = __commonJS({
|
|
|
158134
158134
|
var btp_utils_1 = require_dist18();
|
|
158135
158135
|
var commandRunner_1 = require_commandRunner();
|
|
158136
158136
|
var fast_glob_1 = __importDefault(require_out4());
|
|
158137
|
-
var
|
|
158137
|
+
var node_path_1 = require("node:path");
|
|
158138
158138
|
var read_pkg_up_1 = __importDefault(require_read_pkg_up());
|
|
158139
158139
|
var semver_1 = require_semver2();
|
|
158140
158140
|
var getPackageInfo = async (searchPath, minVersion) => {
|
|
@@ -158146,7 +158146,7 @@ var require_installedCheck = __commonJS({
|
|
|
158146
158146
|
return {
|
|
158147
158147
|
packageJsonPath: pkgInfo.path,
|
|
158148
158148
|
packageInfo: pkgInfo.packageJson,
|
|
158149
|
-
path: (0,
|
|
158149
|
+
path: (0, node_path_1.join)(searchPath, pkgInfo.packageJson.main ?? "/generators/app")
|
|
158150
158150
|
};
|
|
158151
158151
|
}
|
|
158152
158152
|
}
|
|
@@ -158181,7 +158181,7 @@ var require_installedCheck = __commonJS({
|
|
|
158181
158181
|
const appWizardInstallLocation = "ApplicationWizard.installationLocation";
|
|
158182
158182
|
const customGenInstallLoc = vscWorkspaceConfig?.get(appWizardInstallLocation);
|
|
158183
158183
|
if (customGenInstallLoc) {
|
|
158184
|
-
genSearchPaths.push((0,
|
|
158184
|
+
genSearchPaths.push((0, node_path_1.join)(customGenInstallLoc, "node_modules"));
|
|
158185
158185
|
}
|
|
158186
158186
|
}
|
|
158187
158187
|
const runner = new commandRunner_1.CommandRunner();
|
|
@@ -158192,7 +158192,7 @@ var require_installedCheck = __commonJS({
|
|
|
158192
158192
|
return void 0;
|
|
158193
158193
|
});
|
|
158194
158194
|
if (rootNodeModules) {
|
|
158195
|
-
genSearchPaths.push((0,
|
|
158195
|
+
genSearchPaths.push((0, node_path_1.join)(rootNodeModules.trim()));
|
|
158196
158196
|
}
|
|
158197
158197
|
if ((0, btp_utils_1.isAppStudio)() && process.env.NODE_PATH) {
|
|
158198
158198
|
genSearchPaths.push(...process.env.NODE_PATH.split(":").filter((path5) => path5.endsWith("node_modules")));
|
|
@@ -158223,6 +158223,88 @@ var require_httpsUtils = __commonJS({
|
|
|
158223
158223
|
}
|
|
158224
158224
|
});
|
|
158225
158225
|
|
|
158226
|
+
// ../nodejs-utils/dist/proxyCheck.js
|
|
158227
|
+
var require_proxyCheck = __commonJS({
|
|
158228
|
+
"../nodejs-utils/dist/proxyCheck.js"(exports2) {
|
|
158229
|
+
"use strict";
|
|
158230
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
158231
|
+
exports2.ProxyValidationStatus = void 0;
|
|
158232
|
+
exports2.validateProxySettings = validateProxySettings;
|
|
158233
|
+
exports2.ProxyValidationStatus = {
|
|
158234
|
+
NO_PROXY: "no-proxy",
|
|
158235
|
+
MATCH: "match",
|
|
158236
|
+
MISMATCH: "mismatch",
|
|
158237
|
+
ENV_ONLY: "env-only",
|
|
158238
|
+
PARAM_ONLY: "param-only"
|
|
158239
|
+
};
|
|
158240
|
+
var PROXY_ENV_VARS = ["HTTP_PROXY", "http_proxy", "HTTPS_PROXY", "https_proxy"];
|
|
158241
|
+
var getEnvProxy = () => {
|
|
158242
|
+
for (const envVar of PROXY_ENV_VARS) {
|
|
158243
|
+
const value = process.env[envVar];
|
|
158244
|
+
if (value && value.trim() !== "") {
|
|
158245
|
+
return value;
|
|
158246
|
+
}
|
|
158247
|
+
}
|
|
158248
|
+
return void 0;
|
|
158249
|
+
};
|
|
158250
|
+
var normalizeProxy = (value) => {
|
|
158251
|
+
let result = value?.trim().toLowerCase();
|
|
158252
|
+
while (result?.endsWith("/")) {
|
|
158253
|
+
result = result.slice(0, -1);
|
|
158254
|
+
}
|
|
158255
|
+
return result || void 0;
|
|
158256
|
+
};
|
|
158257
|
+
function validateProxySettings(proxy) {
|
|
158258
|
+
const envProxy = getEnvProxy();
|
|
158259
|
+
const normalizedEnvProxy = normalizeProxy(envProxy);
|
|
158260
|
+
const normalizedProxy = normalizeProxy(proxy);
|
|
158261
|
+
if (!(normalizedEnvProxy || normalizedProxy)) {
|
|
158262
|
+
return {
|
|
158263
|
+
isValid: true,
|
|
158264
|
+
status: exports2.ProxyValidationStatus.NO_PROXY,
|
|
158265
|
+
message: "No proxy settings configured.",
|
|
158266
|
+
providedProxy: void 0,
|
|
158267
|
+
envProxy
|
|
158268
|
+
};
|
|
158269
|
+
}
|
|
158270
|
+
if (normalizedEnvProxy && !normalizedProxy) {
|
|
158271
|
+
return {
|
|
158272
|
+
isValid: false,
|
|
158273
|
+
status: exports2.ProxyValidationStatus.ENV_ONLY,
|
|
158274
|
+
message: "Using environment proxy settings.",
|
|
158275
|
+
envProxy: normalizedEnvProxy,
|
|
158276
|
+
providedProxy: void 0
|
|
158277
|
+
};
|
|
158278
|
+
}
|
|
158279
|
+
if (!normalizedEnvProxy && normalizedProxy) {
|
|
158280
|
+
return {
|
|
158281
|
+
isValid: false,
|
|
158282
|
+
status: exports2.ProxyValidationStatus.PARAM_ONLY,
|
|
158283
|
+
message: `Using provided (${normalizedProxy}) proxy settings.`,
|
|
158284
|
+
envProxy: void 0,
|
|
158285
|
+
providedProxy: normalizedProxy
|
|
158286
|
+
};
|
|
158287
|
+
}
|
|
158288
|
+
if (normalizedEnvProxy === normalizedProxy) {
|
|
158289
|
+
return {
|
|
158290
|
+
isValid: true,
|
|
158291
|
+
status: exports2.ProxyValidationStatus.MATCH,
|
|
158292
|
+
message: `Proxy settings match.`,
|
|
158293
|
+
envProxy: normalizedEnvProxy,
|
|
158294
|
+
providedProxy: normalizedProxy
|
|
158295
|
+
};
|
|
158296
|
+
}
|
|
158297
|
+
return {
|
|
158298
|
+
isValid: false,
|
|
158299
|
+
status: exports2.ProxyValidationStatus.MISMATCH,
|
|
158300
|
+
message: `Proxy settings conflict between environment (${normalizedEnvProxy}) and parameter (${normalizedProxy}).`,
|
|
158301
|
+
envProxy: normalizedEnvProxy,
|
|
158302
|
+
providedProxy: normalizedProxy
|
|
158303
|
+
};
|
|
158304
|
+
}
|
|
158305
|
+
}
|
|
158306
|
+
});
|
|
158307
|
+
|
|
158226
158308
|
// ../nodejs-utils/dist/index.js
|
|
158227
158309
|
var require_dist19 = __commonJS({
|
|
158228
158310
|
"../nodejs-utils/dist/index.js"(exports2) {
|
|
@@ -158247,6 +158329,7 @@ var require_dist19 = __commonJS({
|
|
|
158247
158329
|
__exportStar(require_commandRunner(), exports2);
|
|
158248
158330
|
__exportStar(require_installedCheck(), exports2);
|
|
158249
158331
|
__exportStar(require_httpsUtils(), exports2);
|
|
158332
|
+
__exportStar(require_proxyCheck(), exports2);
|
|
158250
158333
|
}
|
|
158251
158334
|
});
|
|
158252
158335
|
|
|
@@ -167137,7 +167220,7 @@ function getMachineId2() {
|
|
|
167137
167220
|
_b.label = 3;
|
|
167138
167221
|
case 3:
|
|
167139
167222
|
_b.trys.push([3, 5, , 6]);
|
|
167140
|
-
return [4,
|
|
167223
|
+
return [4, import_fs.promises.readFile(path5, { encoding: "utf8" })];
|
|
167141
167224
|
case 4:
|
|
167142
167225
|
result = _b.sent();
|
|
167143
167226
|
return [2, result.trim()];
|
|
@@ -167170,10 +167253,10 @@ function getMachineId2() {
|
|
|
167170
167253
|
});
|
|
167171
167254
|
});
|
|
167172
167255
|
}
|
|
167173
|
-
var
|
|
167256
|
+
var import_fs, __awaiter2, __generator2, __values6;
|
|
167174
167257
|
var init_getMachineId_linux = __esm({
|
|
167175
167258
|
"../../node_modules/.pnpm/@opentelemetry+resources@1.21.0_@opentelemetry+api@1.7.0/node_modules/@opentelemetry/resources/build/esm/platform/node/machine-id/getMachineId-linux.js"() {
|
|
167176
|
-
|
|
167259
|
+
import_fs = require("fs");
|
|
167177
167260
|
init_esm();
|
|
167178
167261
|
__awaiter2 = function(thisArg, _arguments, P, generator) {
|
|
167179
167262
|
function adopt(value) {
|
|
@@ -167297,7 +167380,7 @@ function getMachineId3() {
|
|
|
167297
167380
|
switch (_a3.label) {
|
|
167298
167381
|
case 0:
|
|
167299
167382
|
_a3.trys.push([0, 2, , 3]);
|
|
167300
|
-
return [4,
|
|
167383
|
+
return [4, import_fs2.promises.readFile("/etc/hostid", { encoding: "utf8" })];
|
|
167301
167384
|
case 1:
|
|
167302
167385
|
result = _a3.sent();
|
|
167303
167386
|
return [2, result.trim()];
|
|
@@ -167321,10 +167404,10 @@ function getMachineId3() {
|
|
|
167321
167404
|
});
|
|
167322
167405
|
});
|
|
167323
167406
|
}
|
|
167324
|
-
var
|
|
167407
|
+
var import_fs2, __awaiter3, __generator3;
|
|
167325
167408
|
var init_getMachineId_bsd = __esm({
|
|
167326
167409
|
"../../node_modules/.pnpm/@opentelemetry+resources@1.21.0_@opentelemetry+api@1.7.0/node_modules/@opentelemetry/resources/build/esm/platform/node/machine-id/getMachineId-bsd.js"() {
|
|
167327
|
-
|
|
167410
|
+
import_fs2 = require("fs");
|
|
167328
167411
|
init_execAsync();
|
|
167329
167412
|
init_esm();
|
|
167330
167413
|
__awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
@@ -170244,17 +170327,17 @@ var init_instrumentationNodeModuleDefinition = __esm({
|
|
|
170244
170327
|
});
|
|
170245
170328
|
|
|
170246
170329
|
// ../../node_modules/.pnpm/@opentelemetry+instrumentation@0.41.2_@opentelemetry+api@1.7.0/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentationNodeModuleFile.js
|
|
170247
|
-
var
|
|
170330
|
+
var import_path, InstrumentationNodeModuleFile;
|
|
170248
170331
|
var init_instrumentationNodeModuleFile = __esm({
|
|
170249
170332
|
"../../node_modules/.pnpm/@opentelemetry+instrumentation@0.41.2_@opentelemetry+api@1.7.0/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentationNodeModuleFile.js"() {
|
|
170250
|
-
|
|
170333
|
+
import_path = require("path");
|
|
170251
170334
|
InstrumentationNodeModuleFile = /** @class */
|
|
170252
170335
|
/* @__PURE__ */ function() {
|
|
170253
170336
|
function InstrumentationNodeModuleFile2(name, supportedVersions, patch, unpatch) {
|
|
170254
170337
|
this.supportedVersions = supportedVersions;
|
|
170255
170338
|
this.patch = patch;
|
|
170256
170339
|
this.unpatch = unpatch;
|
|
170257
|
-
this.name = (0,
|
|
170340
|
+
this.name = (0, import_path.normalize)(name);
|
|
170258
170341
|
}
|
|
170259
170342
|
return InstrumentationNodeModuleFile2;
|
|
170260
170343
|
}();
|
|
@@ -181027,12 +181110,12 @@ var init_pipeline = __esm({
|
|
|
181027
181110
|
}
|
|
181028
181111
|
sendRequest(httpClient, request3) {
|
|
181029
181112
|
const policies = this.getOrderedPolicies();
|
|
181030
|
-
const
|
|
181113
|
+
const pipeline = policies.reduceRight((next, policy) => {
|
|
181031
181114
|
return (req) => {
|
|
181032
181115
|
return policy.sendRequest(req, next);
|
|
181033
181116
|
};
|
|
181034
181117
|
}, (req) => httpClient.sendRequest(req));
|
|
181035
|
-
return
|
|
181118
|
+
return pipeline(request3);
|
|
181036
181119
|
}
|
|
181037
181120
|
getOrderedPolicies() {
|
|
181038
181121
|
if (!this._orderedPolicies) {
|
|
@@ -183661,24 +183744,24 @@ var init_tracingPolicy = __esm({
|
|
|
183661
183744
|
|
|
183662
183745
|
// ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.10.1/node_modules/@azure/core-rest-pipeline/dist-esm/src/createPipelineFromOptions.js
|
|
183663
183746
|
function createPipelineFromOptions(options2) {
|
|
183664
|
-
const
|
|
183747
|
+
const pipeline = createEmptyPipeline();
|
|
183665
183748
|
if (isNode) {
|
|
183666
183749
|
if (options2.tlsOptions) {
|
|
183667
|
-
|
|
183750
|
+
pipeline.addPolicy(tlsPolicy(options2.tlsOptions));
|
|
183668
183751
|
}
|
|
183669
|
-
|
|
183670
|
-
|
|
183752
|
+
pipeline.addPolicy(proxyPolicy(options2.proxyOptions));
|
|
183753
|
+
pipeline.addPolicy(decompressResponsePolicy());
|
|
183671
183754
|
}
|
|
183672
|
-
|
|
183673
|
-
|
|
183674
|
-
|
|
183675
|
-
|
|
183676
|
-
|
|
183755
|
+
pipeline.addPolicy(formDataPolicy());
|
|
183756
|
+
pipeline.addPolicy(userAgentPolicy(options2.userAgentOptions));
|
|
183757
|
+
pipeline.addPolicy(setClientRequestIdPolicy());
|
|
183758
|
+
pipeline.addPolicy(defaultRetryPolicy(options2.retryOptions), { phase: "Retry" });
|
|
183759
|
+
pipeline.addPolicy(tracingPolicy(options2.userAgentOptions), { afterPhase: "Retry" });
|
|
183677
183760
|
if (isNode) {
|
|
183678
|
-
|
|
183761
|
+
pipeline.addPolicy(redirectPolicy(options2.redirectOptions), { afterPhase: "Retry" });
|
|
183679
183762
|
}
|
|
183680
|
-
|
|
183681
|
-
return
|
|
183763
|
+
pipeline.addPolicy(logPolicy(options2.loggingOptions), { afterPhase: "Sign" });
|
|
183764
|
+
return pipeline;
|
|
183682
183765
|
}
|
|
183683
183766
|
var init_createPipelineFromOptions = __esm({
|
|
183684
183767
|
"../../node_modules/.pnpm/@azure+core-rest-pipeline@1.10.1/node_modules/@azure/core-rest-pipeline/dist-esm/src/createPipelineFromOptions.js"() {
|
|
@@ -187641,7 +187724,7 @@ var require_package8 = __commonJS({
|
|
|
187641
187724
|
"../telemetry/package.json"(exports2, module2) {
|
|
187642
187725
|
module2.exports = {
|
|
187643
187726
|
name: "@sap-ux/telemetry",
|
|
187644
|
-
version: "0.6.
|
|
187727
|
+
version: "0.6.27",
|
|
187645
187728
|
description: "Library for sending usage telemetry data",
|
|
187646
187729
|
repository: {
|
|
187647
187730
|
type: "git",
|
|
@@ -195241,8 +195324,8 @@ var require_data_processor = __commonJS({
|
|
|
195241
195324
|
var nodejs_utils_1 = require_dist19();
|
|
195242
195325
|
var ui5_config_1 = require_dist3();
|
|
195243
195326
|
var axios_1 = __importDefault(require_axios2());
|
|
195244
|
-
var
|
|
195245
|
-
var
|
|
195327
|
+
var node_fs_1 = __importDefault(require("node:fs"));
|
|
195328
|
+
var node_path_1 = __importDefault(require("node:path"));
|
|
195246
195329
|
var yaml_1 = __importDefault(require_dist23());
|
|
195247
195330
|
var project_access_1 = require_dist6();
|
|
195248
195331
|
var config_state_1 = require_config_state2();
|
|
@@ -195309,17 +195392,17 @@ var require_data_processor = __commonJS({
|
|
|
195309
195392
|
return output;
|
|
195310
195393
|
}
|
|
195311
195394
|
async function getTemplateType(appPath) {
|
|
195312
|
-
const readmeFilePath =
|
|
195313
|
-
const appGenInfoPath =
|
|
195314
|
-
if (
|
|
195315
|
-
const appGenInfo = await
|
|
195395
|
+
const readmeFilePath = node_path_1.default.join(appPath, "README.md");
|
|
195396
|
+
const appGenInfoPath = node_path_1.default.join(appPath, ".appGenInfo.json");
|
|
195397
|
+
if (node_fs_1.default.existsSync(appGenInfoPath)) {
|
|
195398
|
+
const appGenInfo = await node_fs_1.default.promises.readFile(appGenInfoPath, "utf-8");
|
|
195316
195399
|
const appGenInfoParsed = JSON.parse(appGenInfo);
|
|
195317
195400
|
if (appGenInfoParsed?.generationParameters?.template) {
|
|
195318
195401
|
return appGenInfoParsed.generationParameters.template.trim();
|
|
195319
195402
|
}
|
|
195320
195403
|
}
|
|
195321
|
-
if (
|
|
195322
|
-
const readmeContent = await
|
|
195404
|
+
if (node_fs_1.default.existsSync(readmeFilePath)) {
|
|
195405
|
+
const readmeContent = await node_fs_1.default.promises.readFile(readmeFilePath, "utf-8");
|
|
195323
195406
|
if (readmeContent) {
|
|
195324
195407
|
let templateType = "";
|
|
195325
195408
|
const lines = readmeContent.split(/\r?\n/);
|
|
@@ -195345,15 +195428,15 @@ var require_data_processor = __commonJS({
|
|
|
195345
195428
|
}
|
|
195346
195429
|
if (!projectRoot) {
|
|
195347
195430
|
try {
|
|
195348
|
-
const appParentFolder =
|
|
195431
|
+
const appParentFolder = node_path_1.default.dirname(appPath);
|
|
195349
195432
|
projectRoot = await (0, project_access_1.findProjectRoot)(appParentFolder, false);
|
|
195350
195433
|
} catch (e) {
|
|
195351
195434
|
}
|
|
195352
195435
|
}
|
|
195353
195436
|
let isCapJavaWithoutPackageJson = false;
|
|
195354
195437
|
if (!projectRoot) {
|
|
195355
|
-
const directParentFolder =
|
|
195356
|
-
const twoLevelUpParentFolder =
|
|
195438
|
+
const directParentFolder = node_path_1.default.dirname(appPath);
|
|
195439
|
+
const twoLevelUpParentFolder = node_path_1.default.dirname(directParentFolder);
|
|
195357
195440
|
isCapJavaWithoutPackageJson = await (0, project_access_1.isCapJavaProject)(twoLevelUpParentFolder);
|
|
195358
195441
|
projectRoot = isCapJavaWithoutPackageJson ? twoLevelUpParentFolder : appPath;
|
|
195359
195442
|
}
|
|
@@ -195379,10 +195462,10 @@ var require_data_processor = __commonJS({
|
|
|
195379
195462
|
}
|
|
195380
195463
|
async function getDeployTarget(appPath) {
|
|
195381
195464
|
let deployTarget = types_1.DeployTarget.NO_DEPLOY_CONFIG;
|
|
195382
|
-
const deployConfigPath =
|
|
195465
|
+
const deployConfigPath = node_path_1.default.join(appPath, "ui5-deploy.yaml");
|
|
195383
195466
|
try {
|
|
195384
|
-
await
|
|
195385
|
-
const deployConfigContent = await
|
|
195467
|
+
await node_fs_1.default.promises.access(deployConfigPath);
|
|
195468
|
+
const deployConfigContent = await node_fs_1.default.promises.readFile(deployConfigPath, "utf-8");
|
|
195386
195469
|
const deployConfig = yaml_1.default.parse(deployConfigContent);
|
|
195387
195470
|
const customTasks = deployConfig?.builder?.customTasks;
|
|
195388
195471
|
if (customTasks) {
|
|
@@ -195401,18 +195484,18 @@ var require_data_processor = __commonJS({
|
|
|
195401
195484
|
async function getSourceTemplate(appPath) {
|
|
195402
195485
|
const webappPath = await (0, project_access_1.getWebappPath)(appPath);
|
|
195403
195486
|
const paths = {
|
|
195404
|
-
manifest:
|
|
195405
|
-
appdescr:
|
|
195406
|
-
ui5Yaml:
|
|
195487
|
+
manifest: node_path_1.default.join(webappPath, "manifest.json"),
|
|
195488
|
+
appdescr: node_path_1.default.join(webappPath, "manifest.appdescr_variant"),
|
|
195489
|
+
ui5Yaml: node_path_1.default.join(appPath, "ui5.yaml")
|
|
195407
195490
|
};
|
|
195408
195491
|
try {
|
|
195409
|
-
if (
|
|
195410
|
-
const manifestStr = await
|
|
195492
|
+
if (node_fs_1.default.existsSync(paths.manifest)) {
|
|
195493
|
+
const manifestStr = await node_fs_1.default.promises.readFile(paths.manifest, "utf-8");
|
|
195411
195494
|
const manifest = JSON.parse(manifestStr);
|
|
195412
195495
|
return populateSourceTemplate(manifest["sap.app"]?.sourceTemplate ?? {});
|
|
195413
195496
|
}
|
|
195414
|
-
if (
|
|
195415
|
-
const baseUi5ConfigContent = await
|
|
195497
|
+
if (node_fs_1.default.existsSync(paths.appdescr) && node_fs_1.default.existsSync(paths.ui5Yaml)) {
|
|
195498
|
+
const baseUi5ConfigContent = await node_fs_1.default.promises.readFile(paths.ui5Yaml, "utf-8");
|
|
195416
195499
|
const ui5Config = await ui5_config_1.UI5Config.newInstance(baseUi5ConfigContent);
|
|
195417
195500
|
const adp = ui5Config.getCustomConfiguration("adp");
|
|
195418
195501
|
return populateSourceTemplate(adp?.support ?? {});
|
|
@@ -196117,8 +196200,8 @@ var require_utils24 = __commonJS({
|
|
|
196117
196200
|
exports2.getFioriToolsDirectory = exports2.FioriToolsSettings = exports2.pick = void 0;
|
|
196118
196201
|
exports2.errorInstance = errorInstance;
|
|
196119
196202
|
exports2.errorString = errorString;
|
|
196120
|
-
var
|
|
196121
|
-
var
|
|
196203
|
+
var node_os_1 = require("node:os");
|
|
196204
|
+
var node_path_1 = __importDefault(require("node:path"));
|
|
196122
196205
|
var pick3 = (target, ...props) => {
|
|
196123
196206
|
return target && props?.length > 0 && props.reduce((o, k) => {
|
|
196124
196207
|
o[k] = target[k];
|
|
@@ -196141,7 +196224,7 @@ var require_utils24 = __commonJS({
|
|
|
196141
196224
|
FioriToolsSettings2["dir"] = ".fioritools";
|
|
196142
196225
|
})(FioriToolsSettings || (exports2.FioriToolsSettings = FioriToolsSettings = {}));
|
|
196143
196226
|
var getFioriToolsDirectory = () => {
|
|
196144
|
-
return
|
|
196227
|
+
return node_path_1.default.join((0, node_os_1.homedir)(), FioriToolsSettings.dir);
|
|
196145
196228
|
};
|
|
196146
196229
|
exports2.getFioriToolsDirectory = getFioriToolsDirectory;
|
|
196147
196230
|
__exportStar(require_app_studio2(), exports2);
|
|
@@ -196197,18 +196280,18 @@ var require_filesystem = __commonJS({
|
|
|
196197
196280
|
exports2.basedir = void 0;
|
|
196198
196281
|
exports2.getFilesystemWatcherFor = getFilesystemWatcherFor;
|
|
196199
196282
|
exports2.getFilesystemStore = getFilesystemStore;
|
|
196200
|
-
var
|
|
196201
|
-
var
|
|
196283
|
+
var node_path_1 = __importDefault(require("node:path"));
|
|
196284
|
+
var node_fs_1 = __importStar(require("node:fs"));
|
|
196202
196285
|
var pluralize_1 = require_pluralize();
|
|
196203
196286
|
var utils_1 = require_utils24();
|
|
196204
|
-
var
|
|
196287
|
+
var node_os_1 = __importDefault(require("node:os"));
|
|
196205
196288
|
var basedir = ({ baseDirectory } = {}) => {
|
|
196206
196289
|
if (!baseDirectory) {
|
|
196207
196290
|
return (0, utils_1.getFioriToolsDirectory)();
|
|
196208
|
-
} else if (
|
|
196291
|
+
} else if (node_path_1.default.isAbsolute(baseDirectory)) {
|
|
196209
196292
|
return baseDirectory;
|
|
196210
196293
|
} else {
|
|
196211
|
-
return
|
|
196294
|
+
return node_path_1.default.join(node_os_1.default.homedir(), baseDirectory);
|
|
196212
196295
|
}
|
|
196213
196296
|
};
|
|
196214
196297
|
exports2.basedir = basedir;
|
|
@@ -196336,9 +196419,9 @@ var require_filesystem = __commonJS({
|
|
|
196336
196419
|
_readAll(entityName2) {
|
|
196337
196420
|
let rawContents;
|
|
196338
196421
|
try {
|
|
196339
|
-
const configPath =
|
|
196340
|
-
if ((0,
|
|
196341
|
-
rawContents = (0,
|
|
196422
|
+
const configPath = node_path_1.default.join(this.storeDirectory, `${entityName2}.json`);
|
|
196423
|
+
if ((0, node_fs_1.existsSync)(configPath)) {
|
|
196424
|
+
rawContents = (0, node_fs_1.readFileSync)(configPath).toString().trim();
|
|
196342
196425
|
} else {
|
|
196343
196426
|
rawContents = "";
|
|
196344
196427
|
}
|
|
@@ -196362,13 +196445,13 @@ var require_filesystem = __commonJS({
|
|
|
196362
196445
|
const data = JSON.stringify({ [entityName2]: entities }, null, 2);
|
|
196363
196446
|
const filename = getEntityFileName(entityName2);
|
|
196364
196447
|
try {
|
|
196365
|
-
(0,
|
|
196448
|
+
(0, node_fs_1.writeFileSync)(node_path_1.default.join(this.storeDirectory, filename), data);
|
|
196366
196449
|
} catch (e) {
|
|
196367
196450
|
const err = (0, utils_1.errorInstance)(e);
|
|
196368
196451
|
if (err?.code === "ENOENT") {
|
|
196369
196452
|
this.logger.debug(`Base directory [${this.storeDirectory}] does not exist, trying to create it`);
|
|
196370
|
-
(0,
|
|
196371
|
-
(0,
|
|
196453
|
+
(0, node_fs_1.mkdirSync)(this.storeDirectory, { recursive: true });
|
|
196454
|
+
(0, node_fs_1.writeFileSync)(node_path_1.default.join(this.storeDirectory, filename), data);
|
|
196372
196455
|
} else {
|
|
196373
196456
|
throw e;
|
|
196374
196457
|
}
|
|
@@ -196383,9 +196466,9 @@ var require_filesystem = __commonJS({
|
|
|
196383
196466
|
return toPersistenceName(entityName2) + ".json";
|
|
196384
196467
|
}
|
|
196385
196468
|
function getFilesystemWatcherFor(entityName2, callback, options2 = {}) {
|
|
196386
|
-
const watchPath =
|
|
196387
|
-
if ((0,
|
|
196388
|
-
return
|
|
196469
|
+
const watchPath = node_path_1.default.join((0, exports2.basedir)(options2), getEntityFileName(entityName2));
|
|
196470
|
+
if ((0, node_fs_1.existsSync)(watchPath)) {
|
|
196471
|
+
return node_fs_1.default.watch(watchPath, void 0, () => {
|
|
196389
196472
|
callback(entityName2);
|
|
196390
196473
|
});
|
|
196391
196474
|
} else {
|
|
@@ -196665,20 +196748,20 @@ var require_secure_store = __commonJS({
|
|
|
196665
196748
|
var utils_1 = require_utils24();
|
|
196666
196749
|
var dummy_store_1 = require_dummy_store();
|
|
196667
196750
|
var key_store_1 = require_key_store();
|
|
196668
|
-
var
|
|
196669
|
-
var
|
|
196670
|
-
var
|
|
196751
|
+
var node_path_1 = require("node:path");
|
|
196752
|
+
var node_os_1 = require("node:os");
|
|
196753
|
+
var node_fs_1 = __importDefault(require("node:fs"));
|
|
196671
196754
|
function getZoweSdkPaths(insiders) {
|
|
196672
196755
|
const vscodeRootPath = insiders ? ".vscode-insiders" : ".vscode";
|
|
196673
|
-
const vscodeExtensionsPath = (0,
|
|
196674
|
-
if (!
|
|
196756
|
+
const vscodeExtensionsPath = (0, node_path_1.join)((0, node_os_1.homedir)(), vscodeRootPath, "extensions");
|
|
196757
|
+
if (!node_fs_1.default.existsSync(vscodeExtensionsPath)) {
|
|
196675
196758
|
return [];
|
|
196676
196759
|
}
|
|
196677
|
-
const appModelerExtensions =
|
|
196760
|
+
const appModelerExtensions = node_fs_1.default.readdirSync(vscodeExtensionsPath).filter((dir2) => dir2.startsWith("sapse.sap-ux-application-modeler-extension"));
|
|
196678
196761
|
return appModelerExtensions.map((extensionDir) => {
|
|
196679
|
-
const extensionPath = (0,
|
|
196680
|
-
const keytarPackageJsonPath = (0,
|
|
196681
|
-
return
|
|
196762
|
+
const extensionPath = (0, node_path_1.join)(vscodeExtensionsPath, extensionDir);
|
|
196763
|
+
const keytarPackageJsonPath = (0, node_path_1.join)(extensionPath, "node_modules/@zowe/secrets-for-zowe-sdk/package.json");
|
|
196764
|
+
return node_fs_1.default.existsSync(keytarPackageJsonPath) ? (0, node_path_1.dirname)(keytarPackageJsonPath) : "";
|
|
196682
196765
|
}).filter((path5) => path5 !== "");
|
|
196683
196766
|
}
|
|
196684
196767
|
function loadZoweSecretSdk(log2) {
|
|
@@ -198403,9 +198486,9 @@ var require_telemetry_settings = __commonJS({
|
|
|
198403
198486
|
var reporting_1 = require_reporting();
|
|
198404
198487
|
var store_1 = require_dist24();
|
|
198405
198488
|
var btp_utils_1 = require_dist18();
|
|
198406
|
-
var
|
|
198407
|
-
var
|
|
198408
|
-
var
|
|
198489
|
+
var node_os_1 = __importDefault(require("node:os"));
|
|
198490
|
+
var node_path_1 = __importDefault(require("node:path"));
|
|
198491
|
+
var node_fs_1 = __importDefault(require("node:fs"));
|
|
198409
198492
|
var data_processor_1 = require_data_processor();
|
|
198410
198493
|
var config_state_1 = require_config_state();
|
|
198411
198494
|
var config_state_2 = require_config_state2();
|
|
@@ -198430,8 +198513,8 @@ var require_telemetry_settings = __commonJS({
|
|
|
198430
198513
|
if (!settingsPath) {
|
|
198431
198514
|
return null;
|
|
198432
198515
|
}
|
|
198433
|
-
const homedir =
|
|
198434
|
-
return
|
|
198516
|
+
const homedir = node_os_1.default.homedir();
|
|
198517
|
+
return node_path_1.default.join(homedir, settingsPath);
|
|
198435
198518
|
};
|
|
198436
198519
|
async function readEnableTelemetry(storeService) {
|
|
198437
198520
|
let setting;
|
|
@@ -198446,7 +198529,7 @@ var require_telemetry_settings = __commonJS({
|
|
|
198446
198529
|
} else {
|
|
198447
198530
|
let content;
|
|
198448
198531
|
try {
|
|
198449
|
-
content = await
|
|
198532
|
+
content = await node_fs_1.default.promises.readFile(deprecatedSettingPath, "utf-8");
|
|
198450
198533
|
const deprecatedSetting = JSON.parse(content);
|
|
198451
198534
|
const propValues = deprecatedExtensionPropKeys.map((propKey) => deprecatedSetting[propKey] ?? true);
|
|
198452
198535
|
const deprecatedEnableTelemetrySetting = propValues.reduce((prevValue, currentValue) => prevValue && currentValue, true);
|
|
@@ -206912,7 +206995,7 @@ var StdioServerTransport = class {
|
|
|
206912
206995
|
};
|
|
206913
206996
|
|
|
206914
206997
|
// package.json
|
|
206915
|
-
var version = "0.2.
|
|
206998
|
+
var version = "0.2.2";
|
|
206916
206999
|
var package_default = {
|
|
206917
207000
|
name: "@sap-ux/fiori-mcp-server",
|
|
206918
207001
|
description: "SAP Fiori - Model Context Protocol (MCP) server",
|
|
@@ -211774,7 +211857,7 @@ var ExecuteFunctionalityOutputSchema = object({
|
|
|
211774
211857
|
|
|
211775
211858
|
// src/tools/utils.ts
|
|
211776
211859
|
var import_project_access = __toESM(require_dist6());
|
|
211777
|
-
var
|
|
211860
|
+
var import_node_path = require("node:path");
|
|
211778
211861
|
|
|
211779
211862
|
// src/utils/logger.ts
|
|
211780
211863
|
var import_logger = __toESM(require_dist7());
|
|
@@ -211814,7 +211897,7 @@ var logger = new import_logger.ToolsLogger({
|
|
|
211814
211897
|
// src/tools/utils.ts
|
|
211815
211898
|
async function resolveApplication(path5) {
|
|
211816
211899
|
try {
|
|
211817
|
-
path5 = (0,
|
|
211900
|
+
path5 = (0, import_node_path.join)(path5);
|
|
211818
211901
|
try {
|
|
211819
211902
|
const applicationAccess = await (0, import_project_access.createApplicationAccess)(path5);
|
|
211820
211903
|
return {
|
|
@@ -211844,15 +211927,15 @@ var getDefaultExtensionFolder = (directory) => {
|
|
|
211844
211927
|
let subFolder;
|
|
211845
211928
|
switch (directory) {
|
|
211846
211929
|
case import_project_access.DirName.View: {
|
|
211847
|
-
subFolder = (0,
|
|
211930
|
+
subFolder = (0, import_node_path.join)(import_project_access.DirName.Ext, import_project_access.DirName.View);
|
|
211848
211931
|
break;
|
|
211849
211932
|
}
|
|
211850
211933
|
case import_project_access.DirName.Fragment: {
|
|
211851
|
-
subFolder = (0,
|
|
211934
|
+
subFolder = (0, import_node_path.join)(import_project_access.DirName.Ext, import_project_access.DirName.Fragment);
|
|
211852
211935
|
break;
|
|
211853
211936
|
}
|
|
211854
211937
|
case import_project_access.DirName.Controller: {
|
|
211855
|
-
subFolder = (0,
|
|
211938
|
+
subFolder = (0, import_node_path.join)(import_project_access.DirName.Ext, import_project_access.DirName.Controller);
|
|
211856
211939
|
break;
|
|
211857
211940
|
}
|
|
211858
211941
|
default: {
|
|
@@ -211935,7 +212018,7 @@ var import_lancedb = require("@lancedb/lancedb");
|
|
|
211935
212018
|
|
|
211936
212019
|
// src/utils/embeddings-path.ts
|
|
211937
212020
|
var import_promises = __toESM(require("fs/promises"));
|
|
211938
|
-
var
|
|
212021
|
+
var import_node_path2 = __toESM(require("node:path"));
|
|
211939
212022
|
async function resolveEmbeddingsPath() {
|
|
211940
212023
|
try {
|
|
211941
212024
|
let embeddingsPackage;
|
|
@@ -211957,37 +212040,37 @@ async function resolveEmbeddingsPath() {
|
|
|
211957
212040
|
logger.log("\u2713 Using @sap-ux/fiori-docs-embeddings package");
|
|
211958
212041
|
return {
|
|
211959
212042
|
dataPath: packageDataPath,
|
|
211960
|
-
embeddingsPath:
|
|
211961
|
-
searchPath:
|
|
211962
|
-
docsPath:
|
|
212043
|
+
embeddingsPath: import_node_path2.default.join(packageDataPath, "embeddings"),
|
|
212044
|
+
searchPath: import_node_path2.default.join(packageDataPath, "search"),
|
|
212045
|
+
docsPath: import_node_path2.default.join(packageDataPath, "docs"),
|
|
211963
212046
|
isExternalPackage: true,
|
|
211964
212047
|
isAvailable: true
|
|
211965
212048
|
};
|
|
211966
212049
|
} catch {
|
|
211967
212050
|
logger.warn("Could not load @sap-ux/fiori-docs-embeddings package, trying local data...");
|
|
211968
212051
|
}
|
|
211969
|
-
const localDataPath =
|
|
212052
|
+
const localDataPath = import_node_path2.default.join(__dirname, "../../data");
|
|
211970
212053
|
try {
|
|
211971
212054
|
await import_promises.default.access(localDataPath);
|
|
211972
212055
|
logger.log("\u2713 Using local data directory");
|
|
211973
212056
|
return {
|
|
211974
212057
|
dataPath: localDataPath,
|
|
211975
|
-
embeddingsPath:
|
|
211976
|
-
searchPath:
|
|
211977
|
-
docsPath:
|
|
212058
|
+
embeddingsPath: import_node_path2.default.join(localDataPath, "embeddings"),
|
|
212059
|
+
searchPath: import_node_path2.default.join(localDataPath, "search"),
|
|
212060
|
+
docsPath: import_node_path2.default.join(localDataPath, "docs"),
|
|
211978
212061
|
isExternalPackage: false,
|
|
211979
212062
|
isAvailable: true
|
|
211980
212063
|
};
|
|
211981
212064
|
} catch {
|
|
211982
212065
|
logger.warn("Local data directory not available either");
|
|
211983
212066
|
}
|
|
211984
|
-
const fallbackPath =
|
|
212067
|
+
const fallbackPath = import_node_path2.default.join(__dirname, "../../data");
|
|
211985
212068
|
logger.warn("\u26A0\uFE0F No embeddings data available - running in limited mode");
|
|
211986
212069
|
return {
|
|
211987
212070
|
dataPath: fallbackPath,
|
|
211988
|
-
embeddingsPath:
|
|
211989
|
-
searchPath:
|
|
211990
|
-
docsPath:
|
|
212071
|
+
embeddingsPath: import_node_path2.default.join(fallbackPath, "embeddings"),
|
|
212072
|
+
searchPath: import_node_path2.default.join(fallbackPath, "search"),
|
|
212073
|
+
docsPath: import_node_path2.default.join(fallbackPath, "docs"),
|
|
211991
212074
|
isExternalPackage: false,
|
|
211992
212075
|
isAvailable: false
|
|
211993
212076
|
};
|
|
@@ -211995,7 +212078,7 @@ async function resolveEmbeddingsPath() {
|
|
|
211995
212078
|
|
|
211996
212079
|
// src/tools/services/vector-simple.ts
|
|
211997
212080
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
211998
|
-
var
|
|
212081
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
211999
212082
|
var SimpleVectorService = class {
|
|
212000
212083
|
connection = null;
|
|
212001
212084
|
tables = [];
|
|
@@ -212019,7 +212102,7 @@ var SimpleVectorService = class {
|
|
|
212019
212102
|
}
|
|
212020
212103
|
this.dataPath = pathInfo.embeddingsPath;
|
|
212021
212104
|
logger.log(`Using embeddings path: ${this.dataPath} (external: ${pathInfo.isExternalPackage})`);
|
|
212022
|
-
const metadataPath =
|
|
212105
|
+
const metadataPath = import_node_path3.default.join(this.dataPath, "metadata.json");
|
|
212023
212106
|
const metadataContent = await import_promises2.default.readFile(metadataPath, "utf-8");
|
|
212024
212107
|
this.metadata = JSON.parse(metadataContent);
|
|
212025
212108
|
logger.log(`\u2713 Embedding metadata loaded:`);
|
|
@@ -212028,7 +212111,7 @@ var SimpleVectorService = class {
|
|
|
212028
212111
|
logger.log(` Total vectors: ${this?.metadata?.totalVectors}`);
|
|
212029
212112
|
logger.log(` Created: ${this?.metadata?.createdAt}`);
|
|
212030
212113
|
this.connection = await (0, import_lancedb.connect)(this.dataPath);
|
|
212031
|
-
const tableIndexPath =
|
|
212114
|
+
const tableIndexPath = import_node_path3.default.join(this.dataPath, "table_index.json");
|
|
212032
212115
|
try {
|
|
212033
212116
|
const tableIndexContent = await import_promises2.default.readFile(tableIndexPath, "utf-8");
|
|
212034
212117
|
this.tableIndex = JSON.parse(tableIndexContent);
|
|
@@ -212272,7 +212355,6 @@ var SimpleVectorService = class {
|
|
|
212272
212355
|
};
|
|
212273
212356
|
|
|
212274
212357
|
// src/tools/services/text-embedding.ts
|
|
212275
|
-
var import_transformers = require("@xenova/transformers");
|
|
212276
212358
|
var TextEmbeddingService = class {
|
|
212277
212359
|
pipeline = null;
|
|
212278
212360
|
initialized = false;
|
|
@@ -212284,7 +212366,8 @@ var TextEmbeddingService = class {
|
|
|
212284
212366
|
return;
|
|
212285
212367
|
}
|
|
212286
212368
|
try {
|
|
212287
|
-
|
|
212369
|
+
const { pipeline } = await import("@xenova/transformers");
|
|
212370
|
+
this.pipeline = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2", {
|
|
212288
212371
|
quantized: false
|
|
212289
212372
|
});
|
|
212290
212373
|
this.initialized = true;
|
|
@@ -212382,7 +212465,7 @@ async function docSearch(params, resultAsString = false) {
|
|
|
212382
212465
|
|
|
212383
212466
|
// src/tools/list-fiori-apps.ts
|
|
212384
212467
|
var import_project_access2 = __toESM(require_dist6());
|
|
212385
|
-
var
|
|
212468
|
+
var import_node_path4 = require("node:path");
|
|
212386
212469
|
async function listFioriApps(params) {
|
|
212387
212470
|
const { searchPath = [] } = params;
|
|
212388
212471
|
const newFoundFioriArtifacts = await (0, import_project_access2.findFioriArtifacts)({
|
|
@@ -212395,7 +212478,7 @@ async function listFioriApps(params) {
|
|
|
212395
212478
|
applications.map(async (app) => {
|
|
212396
212479
|
const projectType = await (0, import_project_access2.getProjectType)(app.projectRoot);
|
|
212397
212480
|
return {
|
|
212398
|
-
name: app.manifest["sap.app"]?.id ?? (0,
|
|
212481
|
+
name: app.manifest["sap.app"]?.id ?? (0, import_node_path4.basename)(app.appRoot),
|
|
212399
212482
|
appPath: app.appRoot,
|
|
212400
212483
|
projectPath: app.projectRoot,
|
|
212401
212484
|
projectType,
|
|
@@ -215008,10 +215091,10 @@ var ObjectAggregation = class _ObjectAggregation {
|
|
|
215008
215091
|
return this.aggregations[name];
|
|
215009
215092
|
}
|
|
215010
215093
|
aggregation.name = name;
|
|
215011
|
-
if (order !== void 0 && !isNaN(order)) {
|
|
215094
|
+
if (order !== void 0 && !Number.isNaN(order)) {
|
|
215012
215095
|
for (const key in this.aggregations) {
|
|
215013
215096
|
const existingOrder = this.aggregations[key].order;
|
|
215014
|
-
if (existingOrder !== void 0 && !isNaN(existingOrder) && existingOrder >= order) {
|
|
215097
|
+
if (existingOrder !== void 0 && !Number.isNaN(existingOrder) && existingOrder >= order) {
|
|
215015
215098
|
this.aggregations[key].order = existingOrder + 1;
|
|
215016
215099
|
}
|
|
215017
215100
|
}
|
|
@@ -215179,7 +215262,7 @@ var ObjectAggregation = class _ObjectAggregation {
|
|
|
215179
215262
|
this.updateAnnotationData(annotations);
|
|
215180
215263
|
this.annotationCreationForms = this.getNativeNodeCreationForms(annotations);
|
|
215181
215264
|
for (const rootName in this.aggregations) {
|
|
215182
|
-
const pathPart = this.type === "Array" /* Array */ ? parseInt(rootName, 10) : rootName;
|
|
215265
|
+
const pathPart = this.type === "Array" /* Array */ ? Number.parseInt(rootName, 10) : rootName;
|
|
215183
215266
|
const names = this.aggregations[rootName].union?.originalNames || [rootName];
|
|
215184
215267
|
for (const name of names) {
|
|
215185
215268
|
this.aggregations[rootName].updatePropertiesValues(
|
|
@@ -216272,7 +216355,7 @@ var ArrayAggregation = class extends ObjectAggregation {
|
|
|
216272
216355
|
aggregation.actions = ["Delete" /* Delete */];
|
|
216273
216356
|
if (aggregation.schema && !aggregation.schema.title) {
|
|
216274
216357
|
aggregation.schema.title = instance.t("PAGE_EDITOR_OUTLINE_ARRAY_ITEM", {
|
|
216275
|
-
name: parseInt(name, 10) + 1
|
|
216358
|
+
name: Number.parseInt(name, 10) + 1
|
|
216276
216359
|
});
|
|
216277
216360
|
}
|
|
216278
216361
|
aggregation.custom = true;
|
|
@@ -216646,7 +216729,7 @@ var FilterFieldsAggregation = class extends ObjectAggregation {
|
|
|
216646
216729
|
};
|
|
216647
216730
|
|
|
216648
216731
|
// src/page-editor-api/parser/model/macros/MacrosRoot.ts
|
|
216649
|
-
var
|
|
216732
|
+
var import_node_path5 = require("node:path");
|
|
216650
216733
|
var import_project_access3 = __toESM(require_dist6());
|
|
216651
216734
|
var MacrosRootAggregation = class extends ObjectAggregation {
|
|
216652
216735
|
filePath;
|
|
@@ -216723,7 +216806,7 @@ var MacrosRootAggregation = class extends ObjectAggregation {
|
|
|
216723
216806
|
* @param filePath File path to set.
|
|
216724
216807
|
*/
|
|
216725
216808
|
setFilePath(filePath) {
|
|
216726
|
-
this.filePath = (0,
|
|
216809
|
+
this.filePath = (0, import_node_path5.join)(import_project_access3.DirName.Webapp, filePath);
|
|
216727
216810
|
}
|
|
216728
216811
|
/**
|
|
216729
216812
|
* Refreshes internal data based on annotation node data.
|
|
@@ -216745,7 +216828,7 @@ var MacrosRootAggregation = class extends ObjectAggregation {
|
|
|
216745
216828
|
};
|
|
216746
216829
|
|
|
216747
216830
|
// src/page-editor-api/parser/model/PageEditModel.ts
|
|
216748
|
-
var
|
|
216831
|
+
var import_node_path6 = require("node:path");
|
|
216749
216832
|
var import_src6 = __toESM(require_src());
|
|
216750
216833
|
|
|
216751
216834
|
// src/page-editor-api/parser/model/sections/SectionAggregation.ts
|
|
@@ -218409,7 +218492,7 @@ var PageEditModel = class {
|
|
|
218409
218492
|
}
|
|
218410
218493
|
if (this.isAggregation(currentNode)) {
|
|
218411
218494
|
params.path = params.path.concat([
|
|
218412
|
-
params.aggregation.type === "Array" /* Array */ ? parseInt(name, 10) : name
|
|
218495
|
+
params.aggregation.type === "Array" /* Array */ ? Number.parseInt(name, 10) : name
|
|
218413
218496
|
]);
|
|
218414
218497
|
const displayName = currentNode.displayName || name;
|
|
218415
218498
|
const type2 = currentNode.type === JSON_SCHEMA_TYPE_OBJECT ? "Object" /* Object */ : "Array" /* Array */;
|
|
@@ -218552,7 +218635,7 @@ var PageEditModel = class {
|
|
|
218552
218635
|
const locations = [];
|
|
218553
218636
|
if (position) {
|
|
218554
218637
|
locations.push({
|
|
218555
|
-
fileUri: (0,
|
|
218638
|
+
fileUri: (0, import_node_path6.join)(import_src6.DirName.Webapp, context2.filePath),
|
|
218556
218639
|
range: {
|
|
218557
218640
|
start: {
|
|
218558
218641
|
line: position.startLine - 1,
|
|
@@ -219092,7 +219175,7 @@ function getGenericBase(name, displayName, property, schemaPath) {
|
|
|
219092
219175
|
};
|
|
219093
219176
|
}
|
|
219094
219177
|
var isNumber = (value) => {
|
|
219095
|
-
return !isNaN(value) && !isNaN(value - 0);
|
|
219178
|
+
return !Number.isNaN(value) && !Number.isNaN(value - 0);
|
|
219096
219179
|
};
|
|
219097
219180
|
var getEnumOptions = (entries) => {
|
|
219098
219181
|
const options2 = [];
|
|
@@ -219384,13 +219467,13 @@ function searchProperty(property, propertyPath) {
|
|
|
219384
219467
|
|
|
219385
219468
|
// src/page-editor-api/sapuxFtfsFileIO.ts
|
|
219386
219469
|
var import_src8 = __toESM(require_src());
|
|
219387
|
-
var
|
|
219470
|
+
var import_node_path8 = require("node:path");
|
|
219388
219471
|
|
|
219389
219472
|
// src/page-editor-api/project.ts
|
|
219390
219473
|
var import_project_access4 = __toESM(require_dist6());
|
|
219391
|
-
var
|
|
219474
|
+
var import_node_fs = require("node:fs");
|
|
219392
219475
|
var import_promises3 = require("fs/promises");
|
|
219393
|
-
var
|
|
219476
|
+
var import_node_path7 = require("node:path");
|
|
219394
219477
|
function getMainService(appAccess) {
|
|
219395
219478
|
const appId = appAccess.getAppId();
|
|
219396
219479
|
const project = appAccess.project;
|
|
@@ -219453,8 +219536,8 @@ async function readAnnotationFiles(appAccess) {
|
|
|
219453
219536
|
}
|
|
219454
219537
|
async function getManifest(appAccess) {
|
|
219455
219538
|
const absoluteWebappPath = await (0, import_project_access4.getWebappPath)(appAccess.app.appRoot);
|
|
219456
|
-
const manifest = (0,
|
|
219457
|
-
if (!(0,
|
|
219539
|
+
const manifest = (0, import_node_path7.join)(absoluteWebappPath, import_project_access4.FileName.Manifest);
|
|
219540
|
+
if (!(0, import_node_fs.existsSync)(manifest)) {
|
|
219458
219541
|
return void 0;
|
|
219459
219542
|
}
|
|
219460
219543
|
const file = await (0, import_promises3.readFile)(manifest);
|
|
@@ -219463,7 +219546,7 @@ async function getManifest(appAccess) {
|
|
|
219463
219546
|
async function getUI5Version(appAccess) {
|
|
219464
219547
|
const manifest = await getManifest(appAccess);
|
|
219465
219548
|
let ui5Version = manifest ? (0, import_project_access4.getMinimumUI5Version)(manifest) : void 0;
|
|
219466
|
-
if (ui5Version !== void 0 && isNaN(parseFloat(ui5Version))) {
|
|
219549
|
+
if (ui5Version !== void 0 && Number.isNaN(parseFloat(ui5Version))) {
|
|
219467
219550
|
ui5Version = "latest";
|
|
219468
219551
|
}
|
|
219469
219552
|
return ui5Version ?? "latest";
|
|
@@ -219524,8 +219607,8 @@ var SapuxFtfsFileIO = class {
|
|
|
219524
219607
|
files ??= await this.getVirtualFiles();
|
|
219525
219608
|
const appJson = files.find((file) => file.dataSourceUri === import_src8.FileName.App);
|
|
219526
219609
|
const appConfig = JSON.parse(appJson?.fileContent ?? "{}");
|
|
219527
|
-
const schemaPath = (0,
|
|
219528
|
-
const schemaFile = files.find((file) => (0,
|
|
219610
|
+
const schemaPath = (0, import_node_path8.join)(".schemas", (0, import_node_path8.basename)((0, import_node_path8.join)(appConfig?.$schema ?? "")));
|
|
219611
|
+
const schemaFile = files.find((file) => (0, import_node_path8.join)(file.dataSourceUri) === schemaPath);
|
|
219529
219612
|
if (schemaFile) {
|
|
219530
219613
|
const schema = JSON.parse(schemaFile.fileContent);
|
|
219531
219614
|
if (schema.properties?.settings) {
|
|
@@ -219547,11 +219630,11 @@ var SapuxFtfsFileIO = class {
|
|
|
219547
219630
|
async readPageData(pageId) {
|
|
219548
219631
|
try {
|
|
219549
219632
|
const files = await this.getVirtualFiles();
|
|
219550
|
-
const pagePath = (0,
|
|
219551
|
-
const pageFile = files.find((file) => (0,
|
|
219633
|
+
const pagePath = (0, import_node_path8.join)(import_src8.DirName.Pages, `${pageId}.json`);
|
|
219634
|
+
const pageFile = files.find((file) => (0, import_node_path8.join)(file.dataSourceUri) === pagePath);
|
|
219552
219635
|
const pageConfig = pageFile?.fileContent ? JSON.parse(pageFile.fileContent) : void 0;
|
|
219553
|
-
const schemaPath = (0,
|
|
219554
|
-
const schema = files.find((file) => (0,
|
|
219636
|
+
const schemaPath = (0, import_node_path8.join)(".schemas", (0, import_node_path8.basename)((0, import_node_path8.join)(pageConfig?.$schema ?? "")));
|
|
219637
|
+
const schema = files.find((file) => (0, import_node_path8.join)(file.dataSourceUri) === schemaPath);
|
|
219555
219638
|
if (pageConfig && schema) {
|
|
219556
219639
|
const application = await this.readApp(files);
|
|
219557
219640
|
const page = application.config.pages?.[pageId];
|
|
@@ -219665,7 +219748,7 @@ function updateProperty(obj, paths, value, arrayElement = false) {
|
|
|
219665
219748
|
ctx[key] = arrayElement ? [value] : value;
|
|
219666
219749
|
}
|
|
219667
219750
|
} else if (Array.isArray(ctx)) {
|
|
219668
|
-
ctx.splice(typeof key === "string" ? parseInt(key, 10) : key, 1);
|
|
219751
|
+
ctx.splice(typeof key === "string" ? Number.parseInt(key, 10) : key, 1);
|
|
219669
219752
|
} else {
|
|
219670
219753
|
delete ctx[key];
|
|
219671
219754
|
}
|
|
@@ -219937,7 +220020,7 @@ function generatePageId(page, parentPage, pages, navigationProperty) {
|
|
|
219937
220020
|
|
|
219938
220021
|
// src/tools/functionalities/page/application.ts
|
|
219939
220022
|
var import_project_access6 = __toESM(require_dist6());
|
|
219940
|
-
var
|
|
220023
|
+
var import_node_path9 = require("node:path");
|
|
219941
220024
|
|
|
219942
220025
|
// src/constant.ts
|
|
219943
220026
|
var LATEST_UI5_VERSION = "1.136.7";
|
|
@@ -220232,7 +220315,7 @@ var Application = class {
|
|
|
220232
220315
|
const folder = getDefaultExtensionFolder(import_project_access6.DirName.View);
|
|
220233
220316
|
return ftfsFileIo.writeFPM({
|
|
220234
220317
|
customExtension,
|
|
220235
|
-
basePath: (0,
|
|
220318
|
+
basePath: (0, import_node_path9.join)(this.applicationAccess.project.root, this.appId),
|
|
220236
220319
|
data: { ...fpmData, folder }
|
|
220237
220320
|
});
|
|
220238
220321
|
}
|
|
@@ -220635,7 +220718,7 @@ var deletePageHandlers = {
|
|
|
220635
220718
|
|
|
220636
220719
|
// src/tools/functionalities/controller-extension/index.ts
|
|
220637
220720
|
var import_src13 = __toESM(require_src());
|
|
220638
|
-
var
|
|
220721
|
+
var import_node_path10 = require("node:path");
|
|
220639
220722
|
|
|
220640
220723
|
// src/tools/functionalities/controller-extension/schema.ts
|
|
220641
220724
|
var ControllerExtensionCreationSchema = object({
|
|
@@ -220694,7 +220777,7 @@ async function executeFunctionality3(input) {
|
|
|
220694
220777
|
};
|
|
220695
220778
|
changes = await ftfsFileIo.writeFPM({
|
|
220696
220779
|
customExtension: import_src13.CustomExtensionType.ControllerExtension,
|
|
220697
|
-
basePath: (0,
|
|
220780
|
+
basePath: (0, import_node_path10.join)(root, appId),
|
|
220698
220781
|
data: {
|
|
220699
220782
|
extension,
|
|
220700
220783
|
folder: getDefaultExtensionFolder(import_src13.DirName.Controller),
|
|
@@ -220728,10 +220811,10 @@ var createControllerExtensionHandlers = {
|
|
|
220728
220811
|
};
|
|
220729
220812
|
|
|
220730
220813
|
// src/tools/functionalities/generate-fiori-ui-app/command.ts
|
|
220731
|
-
var
|
|
220814
|
+
var import_node_fs2 = require("node:fs");
|
|
220732
220815
|
var import_util3 = require("util");
|
|
220733
220816
|
var import_child_process = require("child_process");
|
|
220734
|
-
var
|
|
220817
|
+
var import_node_path11 = require("node:path");
|
|
220735
220818
|
var import_nodejs_utils = __toESM(require_dist19());
|
|
220736
220819
|
|
|
220737
220820
|
// src/tools/functionalities/generate-fiori-ui-app/schema.ts
|
|
@@ -220818,10 +220901,10 @@ async function command(params) {
|
|
|
220818
220901
|
generatorConfig.service.servicePath = generatorConfig?.service.servicePath?.startsWith("/") ? generatorConfig?.service.servicePath : `/${generatorConfig?.service.servicePath}`;
|
|
220819
220902
|
}
|
|
220820
220903
|
const appName = generatorConfig?.project.name ?? "default";
|
|
220821
|
-
const appPath = (0,
|
|
220904
|
+
const appPath = (0, import_node_path11.join)(projectPath, "app", appName);
|
|
220822
220905
|
const targetDir = projectPath;
|
|
220823
220906
|
const configPath = `${appName}-generator-config.json`;
|
|
220824
|
-
const outputPath = (0,
|
|
220907
|
+
const outputPath = (0, import_node_path11.join)(targetDir, configPath);
|
|
220825
220908
|
const generatorName = "@sap/generator-fiori";
|
|
220826
220909
|
const generatorVersion = "1.18.5";
|
|
220827
220910
|
const packages = await (0, import_nodejs_utils.findInstalledPackages)(generatorName, { minVersion: generatorVersion });
|
|
@@ -220832,8 +220915,8 @@ async function command(params) {
|
|
|
220832
220915
|
}
|
|
220833
220916
|
try {
|
|
220834
220917
|
const content = JSON.stringify(generatorConfig, null, 4);
|
|
220835
|
-
await
|
|
220836
|
-
await
|
|
220918
|
+
await import_node_fs2.promises.mkdir((0, import_node_path11.dirname)(outputPath), { recursive: true });
|
|
220919
|
+
await import_node_fs2.promises.writeFile(outputPath, content, { encoding: "utf8" });
|
|
220837
220920
|
const command2 = `npx -y yo@4 @sap/fiori:headless ${configPath} --force --skipInstall`.trim();
|
|
220838
220921
|
const { stdout, stderr } = await exec(command2, { cwd: targetDir });
|
|
220839
220922
|
logger.info(stdout);
|
|
@@ -220852,8 +220935,8 @@ async function command(params) {
|
|
|
220852
220935
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
220853
220936
|
};
|
|
220854
220937
|
} finally {
|
|
220855
|
-
if ((0,
|
|
220856
|
-
await
|
|
220938
|
+
if ((0, import_node_fs2.existsSync)(outputPath)) {
|
|
220939
|
+
await import_node_fs2.promises.unlink(outputPath);
|
|
220857
220940
|
}
|
|
220858
220941
|
}
|
|
220859
220942
|
return {
|