@sap-ux/project-access 1.13.0 → 1.13.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/project/cap.js +9 -4
- package/package.json +2 -2
package/dist/project/cap.js
CHANGED
|
@@ -105,6 +105,7 @@ exports.getCapCustomPaths = getCapCustomPaths;
|
|
|
105
105
|
* @returns {*} {Promise<{ model: csn; services: ServiceInfo[] }>} - CAP Model and Services
|
|
106
106
|
*/
|
|
107
107
|
function getCapModelAndServices(projectRoot) {
|
|
108
|
+
var _a;
|
|
108
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
110
|
const cds = yield loadCdsModuleFromProject(projectRoot);
|
|
110
111
|
const capProjectPaths = yield getCapCustomPaths(projectRoot);
|
|
@@ -114,9 +115,9 @@ function getCapModelAndServices(projectRoot) {
|
|
|
114
115
|
(0, path_1.join)(projectRoot, capProjectPaths.db)
|
|
115
116
|
];
|
|
116
117
|
const model = yield cds.load(modelPaths);
|
|
117
|
-
let services = cds.compile.to
|
|
118
|
-
if (services
|
|
119
|
-
services = services
|
|
118
|
+
let services = (_a = cds.compile.to.serviceinfo(model, { root: projectRoot })) !== null && _a !== void 0 ? _a : [];
|
|
119
|
+
if (services.map) {
|
|
120
|
+
services = services.map((value) => {
|
|
120
121
|
return {
|
|
121
122
|
name: value.name,
|
|
122
123
|
urlPath: uniformUrl(value.urlPath)
|
|
@@ -132,12 +133,16 @@ function getCapModelAndServices(projectRoot) {
|
|
|
132
133
|
exports.getCapModelAndServices = getCapModelAndServices;
|
|
133
134
|
/**
|
|
134
135
|
* Remove rogue '\\' - cds windows if needed.
|
|
136
|
+
* Replaces all backslashes with forward slashes, removes double slashes, and trailing slashes.
|
|
135
137
|
*
|
|
136
138
|
* @param url - url to uniform
|
|
137
139
|
* @returns - uniform url
|
|
138
140
|
*/
|
|
139
141
|
function uniformUrl(url) {
|
|
140
|
-
return url
|
|
142
|
+
return url
|
|
143
|
+
.replace(/\\/g, '/')
|
|
144
|
+
.replace(/\/\//g, '/')
|
|
145
|
+
.replace(/(?:^\/)/g, '');
|
|
141
146
|
}
|
|
142
147
|
/**
|
|
143
148
|
* Return the EDMX string of a CAP service.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-access",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"description": "Library to access SAP Fiori tools projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/mem-fs": "1.1.2",
|
|
34
34
|
"@types/mem-fs-editor": "7.0.1",
|
|
35
35
|
"@ui5/manifest": "1.51.0",
|
|
36
|
-
"vscode-uri": "3.0.
|
|
36
|
+
"vscode-uri": "3.0.7"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc --build",
|