@sap-ux/project-access 1.20.4 → 1.21.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.
@@ -1,10 +1,5 @@
1
- import type { CapCustomPaths, CapProjectType, CdsEnvironment, csn, Package, ServiceDefinitions } from '../types';
1
+ import type { CapCustomPaths, CapProjectType, CdsEnvironment, csn, Package, ServiceDefinitions, ServiceInfo, CdsVersionInfo } from '../types';
2
2
  import type { Logger } from '@sap-ux/logger';
3
- interface ServiceInfo {
4
- name: string;
5
- urlPath: string;
6
- runtime?: string;
7
- }
8
3
  /**
9
4
  * Returns true if the project is a CAP Node.js project.
10
5
  *
@@ -45,7 +40,7 @@ export declare function getCapCustomPaths(capProjectPath: string): Promise<CapCu
45
40
  * Return the CAP model and all services. The cds.root will be set to the provided project root path.
46
41
  *
47
42
  * @param projectRoot - CAP project root where package.json resides or object specifying project root and optional logger to log additional info
48
- * @returns {Promise<{ model: csn; services: ServiceInfo[] }>} - CAP Model and Services
43
+ * @returns {Promise<{ model: csn; services: ServiceInfo[]; cdsVersionInfo: CdsVersionInfo }>} - CAP Model and Services
49
44
  */
50
45
  export declare function getCapModelAndServices(projectRoot: string | {
51
46
  projectRoot: string;
@@ -53,6 +48,7 @@ export declare function getCapModelAndServices(projectRoot: string | {
53
48
  }): Promise<{
54
49
  model: csn;
55
50
  services: ServiceInfo[];
51
+ cdsVersionInfo: CdsVersionInfo;
56
52
  }>;
57
53
  /**
58
54
  * Returns a list of cds file paths (layers). By default return list of all, but you can also restrict it to one envRoot.
@@ -123,5 +119,4 @@ export declare const toReferenceUri: (projectRoot: string, relativeUriFrom: stri
123
119
  * Clear cache of path to global cds module.
124
120
  */
125
121
  export declare function clearGlobalCdsPathCache(): void;
126
- export {};
127
122
  //# sourceMappingURL=cap.d.ts.map
@@ -114,7 +114,7 @@ exports.getCapCustomPaths = getCapCustomPaths;
114
114
  * Return the CAP model and all services. The cds.root will be set to the provided project root path.
115
115
  *
116
116
  * @param projectRoot - CAP project root where package.json resides or object specifying project root and optional logger to log additional info
117
- * @returns {Promise<{ model: csn; services: ServiceInfo[] }>} - CAP Model and Services
117
+ * @returns {Promise<{ model: csn; services: ServiceInfo[]; cdsVersionInfo: CdsVersionInfo }>} - CAP Model and Services
118
118
  */
119
119
  function getCapModelAndServices(projectRoot) {
120
120
  var _a;
@@ -151,7 +151,12 @@ function getCapModelAndServices(projectRoot) {
151
151
  }
152
152
  return {
153
153
  model,
154
- services
154
+ services,
155
+ cdsVersionInfo: {
156
+ home: cds.home,
157
+ version: cds.version,
158
+ root: cds.root
159
+ }
155
160
  };
156
161
  });
157
162
  }
@@ -223,5 +223,18 @@ export interface LinkedModel extends CSN {
223
223
  services: Definitions & ((namespace: string) => Definitions);
224
224
  definitions: Definitions;
225
225
  }
226
+ export interface ServiceInfo {
227
+ name: string;
228
+ urlPath: string;
229
+ runtime?: string;
230
+ }
231
+ /**
232
+ * CDS version information extracted from package json that was used to compile the project when determining the service.
233
+ */
234
+ export interface CdsVersionInfo {
235
+ home: string;
236
+ version: string;
237
+ root: string;
238
+ }
226
239
  export {};
227
240
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.20.4",
3
+ "version": "1.21.0",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",