@sap-ux/adp-tooling 0.13.18 → 0.13.19
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.
|
@@ -86,7 +86,6 @@ class AdpPreview {
|
|
|
86
86
|
this.project = project;
|
|
87
87
|
this.util = util;
|
|
88
88
|
this.logger = logger;
|
|
89
|
-
this.routesHandler = new routes_handler_1.default(project, util, logger);
|
|
90
89
|
}
|
|
91
90
|
/**
|
|
92
91
|
* Fetch all required configurations from the backend and initialize all configurations.
|
|
@@ -97,6 +96,7 @@ class AdpPreview {
|
|
|
97
96
|
async init(descriptorVariant) {
|
|
98
97
|
this.descriptorVariantId = descriptorVariant.id;
|
|
99
98
|
const provider = await (0, system_access_1.createAbapServiceProvider)(this.config.target, { ignoreCertErrors: this.config.ignoreCertErrors }, true, this.logger);
|
|
99
|
+
this.routesHandler = new routes_handler_1.default(this.project, this.util, provider, this.logger);
|
|
100
100
|
this.lrep = provider.getLayeredRepository();
|
|
101
101
|
// fetch a merged descriptor from the backend
|
|
102
102
|
await this.lrep.getCsrfToken();
|
|
@@ -2,6 +2,7 @@ import type { ToolsLogger } from '@sap-ux/logger';
|
|
|
2
2
|
import type { MiddlewareUtils } from '@ui5/server';
|
|
3
3
|
import type { ReaderCollection } from '@ui5/fs';
|
|
4
4
|
import type { NextFunction, Request, Response } from 'express';
|
|
5
|
+
import type { AbapServiceProvider } from '@sap-ux/axios-extension';
|
|
5
6
|
interface AnnotationFileDetails {
|
|
6
7
|
fileName?: string;
|
|
7
8
|
annotationPath?: string;
|
|
@@ -25,15 +26,17 @@ export interface AnnotationDataSourceResponse {
|
|
|
25
26
|
export default class RoutesHandler {
|
|
26
27
|
private readonly project;
|
|
27
28
|
private readonly util;
|
|
29
|
+
private readonly provider;
|
|
28
30
|
private readonly logger;
|
|
29
31
|
/**
|
|
30
32
|
* Constructor taking project as input.
|
|
31
33
|
*
|
|
32
34
|
* @param project Reference to the root of the project
|
|
33
35
|
* @param util middleware utilities provided by the UI5 CLI
|
|
36
|
+
* @param provider AbapServiceProvider instance
|
|
34
37
|
* @param logger Logger instance
|
|
35
38
|
*/
|
|
36
|
-
constructor(project: ReaderCollection, util: MiddlewareUtils, logger: ToolsLogger);
|
|
39
|
+
constructor(project: ReaderCollection, util: MiddlewareUtils, provider: AbapServiceProvider, logger: ToolsLogger);
|
|
37
40
|
/**
|
|
38
41
|
* Reads files from workspace by given search pattern.
|
|
39
42
|
*
|
|
@@ -35,24 +35,26 @@ const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
|
35
35
|
const project_access_1 = require("@sap-ux/project-access");
|
|
36
36
|
const manifest_service_1 = require("../base/abap/manifest-service");
|
|
37
37
|
const helper_1 = require("../base/helper");
|
|
38
|
-
const system_access_1 = require("@sap-ux/system-access");
|
|
39
38
|
/**
|
|
40
39
|
* @description Handles API Routes
|
|
41
40
|
*/
|
|
42
41
|
class RoutesHandler {
|
|
43
42
|
project;
|
|
44
43
|
util;
|
|
44
|
+
provider;
|
|
45
45
|
logger;
|
|
46
46
|
/**
|
|
47
47
|
* Constructor taking project as input.
|
|
48
48
|
*
|
|
49
49
|
* @param project Reference to the root of the project
|
|
50
50
|
* @param util middleware utilities provided by the UI5 CLI
|
|
51
|
+
* @param provider AbapServiceProvider instance
|
|
51
52
|
* @param logger Logger instance
|
|
52
53
|
*/
|
|
53
|
-
constructor(project, util, logger) {
|
|
54
|
+
constructor(project, util, provider, logger) {
|
|
54
55
|
this.project = project;
|
|
55
56
|
this.util = util;
|
|
57
|
+
this.provider = provider;
|
|
56
58
|
this.logger = logger;
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
@@ -325,9 +327,7 @@ class RoutesHandler {
|
|
|
325
327
|
const project = this.util.getProject();
|
|
326
328
|
const basePath = project.getRootPath();
|
|
327
329
|
const variant = await (0, helper_1.getVariant)(basePath);
|
|
328
|
-
|
|
329
|
-
const provider = await (0, system_access_1.createAbapServiceProvider)(target, { ignoreCertErrors }, true, this.logger);
|
|
330
|
-
return await manifest_service_1.ManifestService.initMergedManifest(provider, basePath, variant, this.logger);
|
|
330
|
+
return await manifest_service_1.ManifestService.initMergedManifest(this.provider, basePath, variant, this.logger);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
exports.default = RoutesHandler;
|
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.19",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|