@sap-ux/project-access 1.25.6 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/project/cap.js +4 -1
- package/dist/project/info.d.ts +5 -4
- package/dist/project/info.js +17 -10
- package/dist/types/cap/index.d.ts +6 -0
- package/package.json +2 -2
package/dist/project/cap.js
CHANGED
|
@@ -121,9 +121,12 @@ async function getCapModelAndServices(projectRoot) {
|
|
|
121
121
|
let services = cds.compile.to.serviceinfo(model, { root: _projectRoot }) ?? [];
|
|
122
122
|
if (services.map) {
|
|
123
123
|
services = services.map((value) => {
|
|
124
|
+
const { endpoints, urlPath } = value;
|
|
125
|
+
const odataEndpoint = endpoints?.find((endpoint) => endpoint.kind === 'odata');
|
|
126
|
+
const endpointPath = odataEndpoint?.path ?? urlPath;
|
|
124
127
|
return {
|
|
125
128
|
name: value.name,
|
|
126
|
-
urlPath: uniformUrl(
|
|
129
|
+
urlPath: uniformUrl(endpointPath),
|
|
127
130
|
runtime: value.runtime
|
|
128
131
|
};
|
|
129
132
|
});
|
package/dist/project/info.d.ts
CHANGED
|
@@ -37,15 +37,16 @@ export declare function getProjectType(projectRoot: string): Promise<ProjectType
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function getMinUI5VersionFromManifest(manifest: Manifest): string | string[] | undefined;
|
|
39
39
|
/**
|
|
40
|
-
* Returns the minUI5Version as string[].
|
|
40
|
+
* Returns the valid minUI5Version(s) as string[].
|
|
41
41
|
*
|
|
42
42
|
* @param manifest - manifest object
|
|
43
|
+
* @param noValidation - disables the semver validation
|
|
43
44
|
* @returns minUI5Version, as an array of strings
|
|
44
45
|
*/
|
|
45
|
-
export declare function getMinUI5VersionAsArray(manifest: Manifest): string[];
|
|
46
|
+
export declare function getMinUI5VersionAsArray(manifest: Manifest, noValidation?: boolean): string[];
|
|
46
47
|
/**
|
|
47
|
-
* Returns the minUI5Version in string format.
|
|
48
|
-
* If it is defined as an
|
|
48
|
+
* Returns the minUI5Version in string format (if valid).
|
|
49
|
+
* If it is defined as an array, returns the minimum valid version from it.
|
|
49
50
|
*
|
|
50
51
|
* @param manifest - manifest object
|
|
51
52
|
* @returns the minimum version as string
|
package/dist/project/info.js
CHANGED
|
@@ -210,33 +210,40 @@ function getMinUI5VersionFromManifest(manifest) {
|
|
|
210
210
|
}
|
|
211
211
|
exports.getMinUI5VersionFromManifest = getMinUI5VersionFromManifest;
|
|
212
212
|
/**
|
|
213
|
-
* Returns the minUI5Version as string[].
|
|
213
|
+
* Returns the valid minUI5Version(s) as string[].
|
|
214
214
|
*
|
|
215
215
|
* @param manifest - manifest object
|
|
216
|
+
* @param noValidation - disables the semver validation
|
|
216
217
|
* @returns minUI5Version, as an array of strings
|
|
217
218
|
*/
|
|
218
|
-
function getMinUI5VersionAsArray(manifest) {
|
|
219
|
-
|
|
219
|
+
function getMinUI5VersionAsArray(manifest, noValidation = false) {
|
|
220
|
+
const result = [];
|
|
221
|
+
const manifestVariablePattern = /^\$\{.*\}$/; // minUI5Version can also contain variable entries like ${sap.ui5.dist.version}
|
|
220
222
|
const minUI5Version = getMinUI5VersionFromManifest(manifest);
|
|
221
223
|
if (minUI5Version) {
|
|
222
|
-
|
|
224
|
+
const minUI5VersionArray = Array.isArray(minUI5Version) ? minUI5Version : [minUI5Version];
|
|
225
|
+
minUI5VersionArray.forEach((version) => {
|
|
226
|
+
if (noValidation || (0, semver_1.valid)(version) || manifestVariablePattern.test(version)) {
|
|
227
|
+
result.push(version);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
223
230
|
}
|
|
224
231
|
return result;
|
|
225
232
|
}
|
|
226
233
|
exports.getMinUI5VersionAsArray = getMinUI5VersionAsArray;
|
|
227
234
|
/**
|
|
228
|
-
* Returns the minUI5Version in string format.
|
|
229
|
-
* If it is defined as an
|
|
235
|
+
* Returns the minUI5Version in string format (if valid).
|
|
236
|
+
* If it is defined as an array, returns the minimum valid version from it.
|
|
230
237
|
*
|
|
231
238
|
* @param manifest - manifest object
|
|
232
239
|
* @returns the minimum version as string
|
|
233
240
|
*/
|
|
234
241
|
function getMinimumUI5Version(manifest) {
|
|
235
242
|
let result;
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
if (
|
|
243
|
+
const validVersionsArray = getMinUI5VersionAsArray(manifest);
|
|
244
|
+
if (validVersionsArray.length > 0) {
|
|
245
|
+
validVersionsArray.forEach((version) => {
|
|
246
|
+
if (!result || (0, semver_1.gte)(result, version)) {
|
|
240
247
|
result = version;
|
|
241
248
|
}
|
|
242
249
|
});
|
|
@@ -227,6 +227,12 @@ export interface ServiceInfo {
|
|
|
227
227
|
name: string;
|
|
228
228
|
urlPath: string;
|
|
229
229
|
runtime?: string;
|
|
230
|
+
endpoints?: [
|
|
231
|
+
{
|
|
232
|
+
kind: string;
|
|
233
|
+
path: string;
|
|
234
|
+
}
|
|
235
|
+
];
|
|
230
236
|
}
|
|
231
237
|
/**
|
|
232
238
|
* CDS version information extracted from package json that was used to compile the project when determining the service.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-access",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Library to access SAP Fiori tools projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/mem-fs": "1.1.2",
|
|
37
37
|
"@types/mem-fs-editor": "7.0.1",
|
|
38
38
|
"@types/semver": "7.5.2",
|
|
39
|
-
"@ui5/manifest": "1.
|
|
39
|
+
"@ui5/manifest": "1.66.0",
|
|
40
40
|
"vscode-uri": "3.0.7",
|
|
41
41
|
"@sap-ux/logger": "0.6.0"
|
|
42
42
|
},
|