@sap-ux/adp-tooling 0.13.39 → 0.13.41
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.
|
@@ -12,7 +12,7 @@ declare global {
|
|
|
12
12
|
export declare const enum ApiRoutes {
|
|
13
13
|
FRAGMENT = "/adp/api/fragment",
|
|
14
14
|
CONTROLLER = "/adp/api/controller",
|
|
15
|
-
CODE_EXT = "/adp/api/code_ext
|
|
15
|
+
CODE_EXT = "/adp/api/code_ext",
|
|
16
16
|
ANNOTATION = "/adp/api/annotation"
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -184,7 +184,7 @@ class AdpPreview {
|
|
|
184
184
|
router.get("/adp/api/fragment" /* ApiRoutes.FRAGMENT */, this.routesHandler.handleReadAllFragments);
|
|
185
185
|
router.get("/adp/api/controller" /* ApiRoutes.CONTROLLER */, this.routesHandler.handleReadAllControllers);
|
|
186
186
|
router.post("/adp/api/controller" /* ApiRoutes.CONTROLLER */, this.routesHandler.handleWriteControllerExt);
|
|
187
|
-
router.get("/adp/api/code_ext
|
|
187
|
+
router.get("/adp/api/code_ext" /* ApiRoutes.CODE_EXT */, this.routesHandler.handleGetControllerExtensionData);
|
|
188
188
|
router.get("/adp/api/annotation" /* ApiRoutes.ANNOTATION */, this.routesHandler.handleGetAllAnnotationFilesMappedByDataSource);
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
@@ -132,10 +132,12 @@ class RoutesHandler {
|
|
|
132
132
|
*/
|
|
133
133
|
handleReadAllControllers = async (_, res, next) => {
|
|
134
134
|
try {
|
|
135
|
-
const files = await this.readAllFilesByGlob('/**/changes/coding/*.js');
|
|
136
|
-
const fileNames = files.map((file) =>
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
const files = await this.readAllFilesByGlob('/**/changes/coding/*.{js,ts}');
|
|
136
|
+
const fileNames = files.map((file) => {
|
|
137
|
+
const fullName = file.getName();
|
|
138
|
+
const name = fullName.replace(/\.(js|ts)$/, '');
|
|
139
|
+
return { controllerName: name };
|
|
140
|
+
});
|
|
139
141
|
this.sendFilesResponse(res, {
|
|
140
142
|
controllers: fileNames,
|
|
141
143
|
message: `${fileNames.length} controllers found in the project workspace.`
|
|
@@ -155,8 +157,8 @@ class RoutesHandler {
|
|
|
155
157
|
*/
|
|
156
158
|
handleGetControllerExtensionData = async (req, res, next) => {
|
|
157
159
|
try {
|
|
158
|
-
const
|
|
159
|
-
const controllerName =
|
|
160
|
+
const query = req.query;
|
|
161
|
+
const controllerName = query.name;
|
|
160
162
|
const codeExtFiles = await this.readAllFilesByGlob('/**/changes/*_codeExt.change');
|
|
161
163
|
let controllerPathFromRoot = '';
|
|
162
164
|
let controllerExists = false;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.13.
|
|
12
|
+
"version": "0.13.41",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
33
|
"sanitize-filename": "1.6.3",
|
|
34
34
|
"uuid": "10.0.0",
|
|
35
|
-
"@sap-ux/axios-extension": "1.20.
|
|
35
|
+
"@sap-ux/axios-extension": "1.20.2",
|
|
36
36
|
"@sap-ux/btp-utils": "1.0.3",
|
|
37
37
|
"@sap-ux/inquirer-common": "0.6.41",
|
|
38
38
|
"@sap-ux/logger": "0.6.0",
|
|
39
39
|
"@sap-ux/project-access": "1.29.21",
|
|
40
40
|
"@sap-ux/project-input-validator": "0.5.4",
|
|
41
|
-
"@sap-ux/system-access": "0.5.
|
|
41
|
+
"@sap-ux/system-access": "0.5.38",
|
|
42
42
|
"@sap-ux/ui5-config": "0.27.2",
|
|
43
43
|
"@sap-ux/odata-service-writer": "0.26.17",
|
|
44
44
|
"@sap-ux/nodejs-utils": "0.1.9",
|