@sap-ux/axios-extension 1.15.1 → 1.16.1
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/abap/abap-service-provider.d.ts +4 -4
- package/dist/abap/abap-service-provider.js +6 -6
- package/dist/abap/adt-catalog/generators/ui-service-generator.d.ts +4 -4
- package/dist/abap/adt-catalog/generators/ui-service-generator.js +9 -9
- package/dist/abap/adt-catalog/services/abapcdsview-service.d.ts +32 -0
- package/dist/abap/adt-catalog/services/abapcdsview-service.js +70 -0
- package/dist/abap/adt-catalog/services/generator-service.d.ts +3 -3
- package/dist/abap/adt-catalog/services/generator-service.js +4 -4
- package/dist/abap/adt-catalog/services/index.d.ts +2 -0
- package/dist/abap/adt-catalog/services/index.js +5 -1
- package/dist/abap/adt-catalog/services/ui5-rt-version-service.d.ts +25 -0
- package/dist/abap/adt-catalog/services/ui5-rt-version-service.js +43 -0
- package/dist/abap/app-index-service.d.ts +7 -0
- package/dist/abap/app-index-service.js +22 -2
- package/dist/abap/index.d.ts +1 -1
- package/dist/abap/index.js +2 -1
- package/dist/abap/lrep-service.d.ts +30 -0
- package/dist/abap/lrep-service.js +34 -1
- package/dist/abap/types/adt-types.d.ts +5 -0
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { Ui5AbapRepositoryService } from './ui5-abap-repository-service';
|
|
|
4
4
|
import { AppIndexService } from './app-index-service';
|
|
5
5
|
import { ODataVersion } from '../base/odata-service';
|
|
6
6
|
import { LayeredRepositoryService } from './lrep-service';
|
|
7
|
-
import type { AtoSettings, BusinessObject } from './types';
|
|
7
|
+
import type { AbapCDSView, AtoSettings, BusinessObject } from './types';
|
|
8
8
|
import { AdtService } from './adt-catalog/services';
|
|
9
9
|
import { UiServiceGenerator } from './adt-catalog/generators/ui-service-generator';
|
|
10
10
|
/**
|
|
@@ -98,12 +98,12 @@ export declare class AbapServiceProvider extends ServiceProvider {
|
|
|
98
98
|
*/
|
|
99
99
|
getAdtService<T extends AdtService>(adtServiceSubclass: typeof AdtService): Promise<T | null>;
|
|
100
100
|
/**
|
|
101
|
-
* Create a UI Service generator for the given
|
|
101
|
+
* Create a UI Service generator for the given referenced object.
|
|
102
102
|
*
|
|
103
|
-
* @param
|
|
103
|
+
* @param referencedObject - referenced object (business object or abap cds view)
|
|
104
104
|
* @returns a UI Service generator
|
|
105
105
|
*/
|
|
106
|
-
getUiServiceGenerator(
|
|
106
|
+
getUiServiceGenerator(referencedObject: BusinessObject | AbapCDSView): Promise<UiServiceGenerator>;
|
|
107
107
|
/**
|
|
108
108
|
* Get the service URL from the generator config.
|
|
109
109
|
*
|
|
@@ -195,19 +195,19 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
195
195
|
return this.services[subclassName];
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
|
-
* Create a UI Service generator for the given
|
|
198
|
+
* Create a UI Service generator for the given referenced object.
|
|
199
199
|
*
|
|
200
|
-
* @param
|
|
200
|
+
* @param referencedObject - referenced object (business object or abap cds view)
|
|
201
201
|
* @returns a UI Service generator
|
|
202
202
|
*/
|
|
203
|
-
async getUiServiceGenerator(
|
|
203
|
+
async getUiServiceGenerator(referencedObject) {
|
|
204
204
|
const generatorService = await this.getAdtService(services_1.GeneratorService);
|
|
205
205
|
if (!generatorService) {
|
|
206
|
-
throw new Error('Generators are not
|
|
206
|
+
throw new Error('Generators are not supported on this system');
|
|
207
207
|
}
|
|
208
|
-
const config = await generatorService.getUIServiceGeneratorConfig(
|
|
208
|
+
const config = await generatorService.getUIServiceGeneratorConfig(referencedObject.uri);
|
|
209
209
|
const gen = this.createService(this.getServiceUrlFromConfig(config), ui_service_generator_1.UiServiceGenerator);
|
|
210
|
-
gen.configure(config,
|
|
210
|
+
gen.configure(config, referencedObject);
|
|
211
211
|
return gen;
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { GeneratorEntry } from './types';
|
|
2
|
-
import type { BusinessObject, ValidationResponse } from '../../types';
|
|
2
|
+
import type { AbapCDSView, BusinessObject, ValidationResponse } from '../../types';
|
|
3
3
|
import { AdtService } from '../services';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export declare class UiServiceGenerator extends AdtService {
|
|
8
|
-
protected
|
|
8
|
+
protected referencedObject: BusinessObject | AbapCDSView;
|
|
9
9
|
/**
|
|
10
10
|
* Configure the UI service generator.
|
|
11
11
|
*
|
|
12
12
|
* @param _config - The generator configuration.
|
|
13
|
-
* @param
|
|
13
|
+
* @param referencedObject - The referenced object (business object or abap cds view).
|
|
14
14
|
*/
|
|
15
|
-
configure(_config: GeneratorEntry,
|
|
15
|
+
configure(_config: GeneratorEntry, referencedObject: BusinessObject | AbapCDSView): void;
|
|
16
16
|
/**
|
|
17
17
|
* Get the schema of the service binding.
|
|
18
18
|
*
|
|
@@ -6,15 +6,15 @@ const services_1 = require("../services");
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
class UiServiceGenerator extends services_1.AdtService {
|
|
9
|
-
|
|
9
|
+
referencedObject;
|
|
10
10
|
/**
|
|
11
11
|
* Configure the UI service generator.
|
|
12
12
|
*
|
|
13
13
|
* @param _config - The generator configuration.
|
|
14
|
-
* @param
|
|
14
|
+
* @param referencedObject - The referenced object (business object or abap cds view).
|
|
15
15
|
*/
|
|
16
|
-
configure(_config,
|
|
17
|
-
this.
|
|
16
|
+
configure(_config, referencedObject) {
|
|
17
|
+
this.referencedObject = referencedObject;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Get the schema of the service binding.
|
|
@@ -27,7 +27,7 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
27
27
|
Accept: 'application/vnd.sap.adt.repository.generator.schema.v1+json'
|
|
28
28
|
},
|
|
29
29
|
params: {
|
|
30
|
-
referencedObject: this.
|
|
30
|
+
referencedObject: this.referencedObject.uri
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
return JSON.parse(response.data);
|
|
@@ -44,7 +44,7 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
44
44
|
Accept: 'application/vnd.sap.adt.repository.generator.content.v1+json'
|
|
45
45
|
},
|
|
46
46
|
params: {
|
|
47
|
-
referencedObject: this.
|
|
47
|
+
referencedObject: this.referencedObject.uri,
|
|
48
48
|
package: pckg
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -69,7 +69,7 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
69
69
|
Accept: 'application/vnd.sap.adt.validationMessages.v1+xml'
|
|
70
70
|
},
|
|
71
71
|
params: {
|
|
72
|
-
referencedObject: this.
|
|
72
|
+
referencedObject: this.referencedObject.uri,
|
|
73
73
|
package: pckg,
|
|
74
74
|
checks: 'package'
|
|
75
75
|
}
|
|
@@ -89,7 +89,7 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
89
89
|
Accept: 'application/vnd.sap.adt.validationMessages.v1+xml'
|
|
90
90
|
},
|
|
91
91
|
params: {
|
|
92
|
-
referencedObject: this.
|
|
92
|
+
referencedObject: this.referencedObject.uri,
|
|
93
93
|
checks: 'package,referencedobject,authorization'
|
|
94
94
|
}
|
|
95
95
|
});
|
|
@@ -110,7 +110,7 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
110
110
|
Accept: 'application/vnd.sap.adt.repository.generator.v1+json, application/vnd.sap.as+xml;charset=UTF-8;dataname=com.sap.adt.StatusMessage'
|
|
111
111
|
},
|
|
112
112
|
params: {
|
|
113
|
-
referencedObject: this.
|
|
113
|
+
referencedObject: this.referencedObject.uri,
|
|
114
114
|
corrNr: transport
|
|
115
115
|
}
|
|
116
116
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AdtService } from './adt-service';
|
|
2
|
+
import type { AbapCDSView, AdtCategory } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AbapCDSViewService implements ADT requests to obtain the list of abap cds views.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AbapCDSViewService extends AdtService {
|
|
7
|
+
/**
|
|
8
|
+
* @see AdtService.getAdtCatagory()
|
|
9
|
+
*/
|
|
10
|
+
private static adtCategory;
|
|
11
|
+
/**
|
|
12
|
+
* Get ADT scheme ID.
|
|
13
|
+
*
|
|
14
|
+
* @returns AdtCategory
|
|
15
|
+
*/
|
|
16
|
+
static getAdtCatagory(): AdtCategory;
|
|
17
|
+
/**
|
|
18
|
+
* Get all abap cds views from ADT service.
|
|
19
|
+
*
|
|
20
|
+
* @param maxResults - The maximum number of abap cds views to be returned.
|
|
21
|
+
* @returns A list of abap cds views.
|
|
22
|
+
*/
|
|
23
|
+
getAbapCDSViews(maxResults?: number): Promise<AbapCDSView[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Parse the XML document of abap cds view entries from ADT service.
|
|
26
|
+
*
|
|
27
|
+
* @param xml xml document containing abap cds view entries.
|
|
28
|
+
* @returns A list of abap cds view names.
|
|
29
|
+
*/
|
|
30
|
+
private parseAbapCDSViewResponse;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=abapcdsview-service.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbapCDSViewService = void 0;
|
|
4
|
+
const adt_service_1 = require("./adt-service");
|
|
5
|
+
/**
|
|
6
|
+
* AbapCDSViewService implements ADT requests to obtain the list of abap cds views.
|
|
7
|
+
*/
|
|
8
|
+
class AbapCDSViewService extends adt_service_1.AdtService {
|
|
9
|
+
/**
|
|
10
|
+
* @see AdtService.getAdtCatagory()
|
|
11
|
+
*/
|
|
12
|
+
static adtCategory = {
|
|
13
|
+
scheme: 'http://www.sap.com/adt/categories/respository',
|
|
14
|
+
term: 'search'
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Get ADT scheme ID.
|
|
18
|
+
*
|
|
19
|
+
* @returns AdtCategory
|
|
20
|
+
*/
|
|
21
|
+
static getAdtCatagory() {
|
|
22
|
+
return AbapCDSViewService.adtCategory;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get all abap cds views from ADT service.
|
|
26
|
+
*
|
|
27
|
+
* @param maxResults - The maximum number of abap cds views to be returned.
|
|
28
|
+
* @returns A list of abap cds views.
|
|
29
|
+
*/
|
|
30
|
+
async getAbapCDSViews(maxResults = 10000) {
|
|
31
|
+
const config = {
|
|
32
|
+
headers: {
|
|
33
|
+
Accept: 'application/xml'
|
|
34
|
+
},
|
|
35
|
+
params: {
|
|
36
|
+
operation: 'quickSearch',
|
|
37
|
+
query: `*`,
|
|
38
|
+
maxResults: maxResults,
|
|
39
|
+
objectType: 'DDLS',
|
|
40
|
+
releaseState: 'USE_IN_CLOUD_DEVELOPMENT'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const response = await this.get('', config);
|
|
44
|
+
return this.parseAbapCDSViewResponse(response.data);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse the XML document of abap cds view entries from ADT service.
|
|
48
|
+
*
|
|
49
|
+
* @param xml xml document containing abap cds view entries.
|
|
50
|
+
* @returns A list of abap cds view names.
|
|
51
|
+
*/
|
|
52
|
+
parseAbapCDSViewResponse(xml) {
|
|
53
|
+
const parsed = this.parseResponse(xml);
|
|
54
|
+
let abapCDSViewArray = [];
|
|
55
|
+
if (parsed?.objectReferences?.objectReference) {
|
|
56
|
+
if (Array.isArray(parsed.objectReferences.objectReference)) {
|
|
57
|
+
abapCDSViewArray = parsed.objectReferences.objectReference;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
abapCDSViewArray = [parsed.objectReferences.objectReference];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return abapCDSViewArray.map((item) => {
|
|
64
|
+
const { name, uri, description } = item;
|
|
65
|
+
return { name, uri, description };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.AbapCDSViewService = AbapCDSViewService;
|
|
70
|
+
//# sourceMappingURL=abapcdsview-service.js.map
|
|
@@ -17,11 +17,11 @@ export declare class GeneratorService extends AdtService {
|
|
|
17
17
|
static getAdtCatagory(): AdtCategory;
|
|
18
18
|
private id;
|
|
19
19
|
/**
|
|
20
|
-
* Get the UI service generator for the given
|
|
20
|
+
* Get the UI service generator for the given referenced object.
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
22
|
+
* @param objectUri - The object (business object or abap cds view) uri.
|
|
23
23
|
* @returns TBD
|
|
24
24
|
*/
|
|
25
|
-
getUIServiceGeneratorConfig(
|
|
25
|
+
getUIServiceGeneratorConfig(objectUri: string): Promise<GeneratorEntry>;
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=generator-service.d.ts.map
|
|
@@ -23,18 +23,18 @@ class GeneratorService extends adt_service_1.AdtService {
|
|
|
23
23
|
}
|
|
24
24
|
id;
|
|
25
25
|
/**
|
|
26
|
-
* Get the UI service generator for the given
|
|
26
|
+
* Get the UI service generator for the given referenced object.
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param objectUri - The object (business object or abap cds view) uri.
|
|
29
29
|
* @returns TBD
|
|
30
30
|
*/
|
|
31
|
-
async getUIServiceGeneratorConfig(
|
|
31
|
+
async getUIServiceGeneratorConfig(objectUri) {
|
|
32
32
|
const response = await this.get('', {
|
|
33
33
|
headers: {
|
|
34
34
|
Accept: 'application/atom+xml;type=feed'
|
|
35
35
|
},
|
|
36
36
|
params: {
|
|
37
|
-
referencedObject:
|
|
37
|
+
referencedObject: objectUri,
|
|
38
38
|
type: 'webapi'
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -6,4 +6,6 @@ export { ListPackageService } from './list-package-service';
|
|
|
6
6
|
export { FileStoreService } from './filestore-service';
|
|
7
7
|
export { GeneratorService } from './generator-service';
|
|
8
8
|
export { BusinessObjectsService } from './businessobjects-service';
|
|
9
|
+
export { UI5RtVersionService } from './ui5-rt-version-service';
|
|
10
|
+
export { AbapCDSViewService } from './abapcdsview-service';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BusinessObjectsService = exports.GeneratorService = exports.FileStoreService = exports.ListPackageService = exports.TransportRequestService = exports.TransportChecksService = exports.AtoService = exports.AdtService = void 0;
|
|
3
|
+
exports.AbapCDSViewService = exports.UI5RtVersionService = exports.BusinessObjectsService = exports.GeneratorService = exports.FileStoreService = exports.ListPackageService = exports.TransportRequestService = exports.TransportChecksService = exports.AtoService = exports.AdtService = void 0;
|
|
4
4
|
var adt_service_1 = require("./adt-service");
|
|
5
5
|
Object.defineProperty(exports, "AdtService", { enumerable: true, get: function () { return adt_service_1.AdtService; } });
|
|
6
6
|
var ato_service_1 = require("./ato-service");
|
|
@@ -17,4 +17,8 @@ var generator_service_1 = require("./generator-service");
|
|
|
17
17
|
Object.defineProperty(exports, "GeneratorService", { enumerable: true, get: function () { return generator_service_1.GeneratorService; } });
|
|
18
18
|
var businessobjects_service_1 = require("./businessobjects-service");
|
|
19
19
|
Object.defineProperty(exports, "BusinessObjectsService", { enumerable: true, get: function () { return businessobjects_service_1.BusinessObjectsService; } });
|
|
20
|
+
var ui5_rt_version_service_1 = require("./ui5-rt-version-service");
|
|
21
|
+
Object.defineProperty(exports, "UI5RtVersionService", { enumerable: true, get: function () { return ui5_rt_version_service_1.UI5RtVersionService; } });
|
|
22
|
+
var abapcdsview_service_1 = require("./abapcdsview-service");
|
|
23
|
+
Object.defineProperty(exports, "AbapCDSViewService", { enumerable: true, get: function () { return abapcdsview_service_1.AbapCDSViewService; } });
|
|
20
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdtCategory } from '../../types';
|
|
2
|
+
import { AdtService } from './adt-service';
|
|
3
|
+
/**
|
|
4
|
+
* UI5RtVersionService implements ADT requests to get UI5 Version
|
|
5
|
+
* of ABAP system.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UI5RtVersionService extends AdtService {
|
|
8
|
+
/**
|
|
9
|
+
* @see AdtService.getAdtCatagory()
|
|
10
|
+
*/
|
|
11
|
+
private static adtCategory;
|
|
12
|
+
/**
|
|
13
|
+
* Get ADT scheme ID.
|
|
14
|
+
*
|
|
15
|
+
* @returns AdtCategory
|
|
16
|
+
*/
|
|
17
|
+
static getAdtCatagory(): AdtCategory;
|
|
18
|
+
/**
|
|
19
|
+
* Get UI5 Version of ABAP system.
|
|
20
|
+
*
|
|
21
|
+
* @returns UI5 Version on the connected ABAP System.
|
|
22
|
+
*/
|
|
23
|
+
getUI5Version(): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ui5-rt-version-service.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI5RtVersionService = void 0;
|
|
4
|
+
const adt_service_1 = require("./adt-service");
|
|
5
|
+
/**
|
|
6
|
+
* UI5RtVersionService implements ADT requests to get UI5 Version
|
|
7
|
+
* of ABAP system.
|
|
8
|
+
*/
|
|
9
|
+
class UI5RtVersionService extends adt_service_1.AdtService {
|
|
10
|
+
/**
|
|
11
|
+
* @see AdtService.getAdtCatagory()
|
|
12
|
+
*/
|
|
13
|
+
static adtCategory = {
|
|
14
|
+
scheme: 'http://www.sap.com/adt/categories/filestore',
|
|
15
|
+
term: 'ui5-rt-version'
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Get ADT scheme ID.
|
|
19
|
+
*
|
|
20
|
+
* @returns AdtCategory
|
|
21
|
+
*/
|
|
22
|
+
static getAdtCatagory() {
|
|
23
|
+
return UI5RtVersionService.adtCategory;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get UI5 Version of ABAP system.
|
|
27
|
+
*
|
|
28
|
+
* @returns UI5 Version on the connected ABAP System.
|
|
29
|
+
*/
|
|
30
|
+
async getUI5Version() {
|
|
31
|
+
try {
|
|
32
|
+
const result = await this.get('');
|
|
33
|
+
return result.data;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.log.error('Could not fetch UI5 Version.');
|
|
37
|
+
this.log.debug(error);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.UI5RtVersionService = UI5RtVersionService;
|
|
43
|
+
//# sourceMappingURL=ui5-rt-version-service.js.map
|
|
@@ -42,6 +42,13 @@ export declare abstract class AppIndexService extends Axios implements Service {
|
|
|
42
42
|
search(searchParams?: {
|
|
43
43
|
[property: string]: string;
|
|
44
44
|
}, resultFields?: string[]): Promise<AppIndex>;
|
|
45
|
+
/**
|
|
46
|
+
* Check for a given app id whether the manifest first is supported.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} appId - The id of the app.
|
|
49
|
+
* @returns {Promise<boolean>} - "true" for apps supporting manifest first which are apps with minUI5Version at least 1.30 and not scaffolding-based (i.e. dependency to sap.ca.scfld.md library), otherwise it returns "false".
|
|
50
|
+
*/
|
|
51
|
+
getIsManiFirstSupported(appId: string): Promise<boolean>;
|
|
45
52
|
/**
|
|
46
53
|
* Gets the app info for the specified id.
|
|
47
54
|
*
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppIndexService = void 0;
|
|
4
4
|
const axios_1 = require("axios");
|
|
5
|
-
const odata_request_error_1 = require("../base/odata-request-error");
|
|
6
5
|
/**
|
|
7
6
|
* A class representing the app index service allowing to search applications deployed on an ABAP system.
|
|
8
7
|
*/
|
|
@@ -24,6 +23,27 @@ class AppIndexService extends axios_1.Axios {
|
|
|
24
23
|
const response = await this.get('/', { params });
|
|
25
24
|
return JSON.parse(response.data).results;
|
|
26
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Check for a given app id whether the manifest first is supported.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} appId - The id of the app.
|
|
30
|
+
* @returns {Promise<boolean>} - "true" for apps supporting manifest first which are apps with minUI5Version at least 1.30 and not scaffolding-based (i.e. dependency to sap.ca.scfld.md library), otherwise it returns "false".
|
|
31
|
+
*/
|
|
32
|
+
async getIsManiFirstSupported(appId) {
|
|
33
|
+
try {
|
|
34
|
+
const params = {
|
|
35
|
+
'id': appId
|
|
36
|
+
};
|
|
37
|
+
const response = await this.get('/ui5_app_mani_first_supported', { params });
|
|
38
|
+
const isManiFirstSupported = JSON.parse(response.data);
|
|
39
|
+
return isManiFirstSupported;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
this.log.error(`Fail fetching ui5_app_mani_first_supported for app with id: ${appId}.`);
|
|
43
|
+
this.log.debug(error);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
27
47
|
/**
|
|
28
48
|
* Gets the app info for the specified id.
|
|
29
49
|
*
|
|
@@ -36,7 +56,7 @@ class AppIndexService extends axios_1.Axios {
|
|
|
36
56
|
return JSON.parse(response.data);
|
|
37
57
|
}
|
|
38
58
|
catch (error) {
|
|
39
|
-
if ((0,
|
|
59
|
+
if ((0, axios_1.isAxiosError)(error)) {
|
|
40
60
|
this.log.error(`Failed fetching ui5_app_info_json for app with id ${appId}.`);
|
|
41
61
|
}
|
|
42
62
|
else {
|
package/dist/abap/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AppInfo, BspConfig, DeployConfig, Ui5AbapRepositoryService, UndeployConfig } from './ui5-abap-repository-service';
|
|
2
|
-
export { LayeredRepositoryService, AdaptationConfig, MergedAppDescriptor } from './lrep-service';
|
|
2
|
+
export { LayeredRepositoryService, AdaptationConfig, MergedAppDescriptor, SystemInfo, AdaptationProjectType } from './lrep-service';
|
|
3
3
|
export { AbapServiceProvider } from './abap-service-provider';
|
|
4
4
|
export { AppIndex, AppIndexService, Ui5AppInfo } from './app-index-service';
|
|
5
5
|
export * from './message';
|
package/dist/abap/index.js
CHANGED
|
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.TenantType = exports.AppIndexService = exports.AbapServiceProvider = exports.LayeredRepositoryService = exports.Ui5AbapRepositoryService = void 0;
|
|
17
|
+
exports.TenantType = exports.AppIndexService = exports.AbapServiceProvider = exports.AdaptationProjectType = exports.LayeredRepositoryService = exports.Ui5AbapRepositoryService = void 0;
|
|
18
18
|
var ui5_abap_repository_service_1 = require("./ui5-abap-repository-service");
|
|
19
19
|
Object.defineProperty(exports, "Ui5AbapRepositoryService", { enumerable: true, get: function () { return ui5_abap_repository_service_1.Ui5AbapRepositoryService; } });
|
|
20
20
|
var lrep_service_1 = require("./lrep-service");
|
|
21
21
|
Object.defineProperty(exports, "LayeredRepositoryService", { enumerable: true, get: function () { return lrep_service_1.LayeredRepositoryService; } });
|
|
22
|
+
Object.defineProperty(exports, "AdaptationProjectType", { enumerable: true, get: function () { return lrep_service_1.AdaptationProjectType; } });
|
|
22
23
|
var abap_service_provider_1 = require("./abap-service-provider");
|
|
23
24
|
Object.defineProperty(exports, "AbapServiceProvider", { enumerable: true, get: function () { return abap_service_provider_1.AbapServiceProvider; } });
|
|
24
25
|
var app_index_service_1 = require("./app-index-service");
|
|
@@ -67,6 +67,28 @@ export interface Message {
|
|
|
67
67
|
id: string;
|
|
68
68
|
variables?: string[];
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* All available adaptation project types from system.
|
|
72
|
+
*/
|
|
73
|
+
export declare enum AdaptationProjectType {
|
|
74
|
+
ON_PREMISE = "onPremise",
|
|
75
|
+
CLOUD_READY = "cloudReady"
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Structure of the system info reponse data.
|
|
79
|
+
*/
|
|
80
|
+
export interface SystemInfo {
|
|
81
|
+
/**
|
|
82
|
+
* Supported adaptation project types from system.
|
|
83
|
+
*/
|
|
84
|
+
adaptationProjectTypes: AdaptationProjectType[];
|
|
85
|
+
activeLanguages: Language[];
|
|
86
|
+
}
|
|
87
|
+
interface Language {
|
|
88
|
+
sap: string;
|
|
89
|
+
description: string;
|
|
90
|
+
i18n: string;
|
|
91
|
+
}
|
|
70
92
|
/**
|
|
71
93
|
* Technically supported layers, however, in practice only `CUSTOMER_BASE` is used
|
|
72
94
|
*/
|
|
@@ -115,6 +137,14 @@ export declare class LayeredRepositoryService extends Axios implements Service {
|
|
|
115
137
|
* @returns the Axios response object for further processing
|
|
116
138
|
*/
|
|
117
139
|
undeploy(config: AdaptationConfig): Promise<AxiosResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* Get system info.
|
|
142
|
+
*
|
|
143
|
+
* @param language
|
|
144
|
+
* @param cloudPackage name
|
|
145
|
+
* @returns the system info object
|
|
146
|
+
*/
|
|
147
|
+
getSystemInfo(language?: string, cloudPackage?: string): Promise<SystemInfo>;
|
|
118
148
|
/**
|
|
119
149
|
* Try parsing the response and log the result. If the parsing fails and an alternative is provided, log it instead.
|
|
120
150
|
*
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LayeredRepositoryService = void 0;
|
|
3
|
+
exports.LayeredRepositoryService = exports.AdaptationProjectType = void 0;
|
|
4
4
|
const axios_1 = require("axios");
|
|
5
5
|
const logger_1 = require("@sap-ux/logger");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const odata_request_error_1 = require("../base/odata-request-error");
|
|
8
8
|
const message_1 = require("./message");
|
|
9
|
+
/**
|
|
10
|
+
* All available adaptation project types from system.
|
|
11
|
+
*/
|
|
12
|
+
var AdaptationProjectType;
|
|
13
|
+
(function (AdaptationProjectType) {
|
|
14
|
+
AdaptationProjectType["ON_PREMISE"] = "onPremise";
|
|
15
|
+
AdaptationProjectType["CLOUD_READY"] = "cloudReady";
|
|
16
|
+
})(AdaptationProjectType || (exports.AdaptationProjectType = AdaptationProjectType = {}));
|
|
9
17
|
/**
|
|
10
18
|
* Returns the namespace as string.
|
|
11
19
|
*
|
|
@@ -169,6 +177,31 @@ class LayeredRepositoryService extends axios_1.Axios {
|
|
|
169
177
|
throw error;
|
|
170
178
|
}
|
|
171
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Get system info.
|
|
182
|
+
*
|
|
183
|
+
* @param language
|
|
184
|
+
* @param cloudPackage name
|
|
185
|
+
* @returns the system info object
|
|
186
|
+
*/
|
|
187
|
+
async getSystemInfo(language = 'EN', cloudPackage) {
|
|
188
|
+
try {
|
|
189
|
+
const params = {
|
|
190
|
+
'sap-language': language
|
|
191
|
+
};
|
|
192
|
+
if (cloudPackage) {
|
|
193
|
+
params['package'] = cloudPackage;
|
|
194
|
+
}
|
|
195
|
+
const response = await this.get(`${DTA_PATH_SUFFIX}system_info`, { params });
|
|
196
|
+
this.tryLogResponse(response, 'Successful getting system info.');
|
|
197
|
+
return JSON.parse(response.data);
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
this.log.error('Getting system data failed.');
|
|
201
|
+
this.log.debug(error);
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
172
205
|
/**
|
|
173
206
|
* Try parsing the response and log the result. If the parsing fails and an alternative is provided, log it instead.
|
|
174
207
|
*
|
|
@@ -119,6 +119,11 @@ export type BusinessObject = {
|
|
|
119
119
|
uri: string;
|
|
120
120
|
description?: string;
|
|
121
121
|
};
|
|
122
|
+
export type AbapCDSView = {
|
|
123
|
+
name: string;
|
|
124
|
+
uri: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
};
|
|
122
127
|
export type PublishResponse = {
|
|
123
128
|
SEVERITY: string;
|
|
124
129
|
SHORT_TEXT: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/axios-extension",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/lodash": "4.14.202",
|
|
30
30
|
"nock": "13.4.0",
|
|
31
31
|
"supertest": "6.3.3",
|
|
32
|
-
"@sap-ux/project-access": "1.
|
|
32
|
+
"@sap-ux/project-access": "1.25.7"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|