@sap-ux/axios-extension 1.26.1 → 2.0.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 +11 -11
- package/dist/abap/abap-service-provider.js +43 -47
- package/dist/abap/adt-catalog/adt-catalog-service.d.ts +2 -2
- package/dist/abap/adt-catalog/adt-catalog-service.js +7 -11
- package/dist/abap/adt-catalog/adt-schema-store.d.ts +1 -1
- package/dist/abap/adt-catalog/adt-schema-store.js +1 -5
- package/dist/abap/adt-catalog/generators/index.d.ts +2 -2
- package/dist/abap/adt-catalog/generators/index.js +2 -7
- package/dist/abap/adt-catalog/generators/odata-service-generator.d.ts +3 -3
- package/dist/abap/adt-catalog/generators/odata-service-generator.js +2 -6
- package/dist/abap/adt-catalog/generators/types.js +1 -2
- package/dist/abap/adt-catalog/generators/ui-service-generator.d.ts +3 -3
- package/dist/abap/adt-catalog/generators/ui-service-generator.js +2 -6
- package/dist/abap/adt-catalog/index.d.ts +3 -3
- package/dist/abap/adt-catalog/index.js +3 -19
- package/dist/abap/adt-catalog/services/abapcdsview-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/abapcdsview-service.js +2 -6
- package/dist/abap/adt-catalog/services/adt-service.d.ts +1 -1
- package/dist/abap/adt-catalog/services/adt-service.js +5 -9
- package/dist/abap/adt-catalog/services/ato-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/ato-service.js +5 -9
- package/dist/abap/adt-catalog/services/businessobjects-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/businessobjects-service.js +2 -6
- package/dist/abap/adt-catalog/services/filestore-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/filestore-service.js +5 -9
- package/dist/abap/adt-catalog/services/generator-service.d.ts +3 -3
- package/dist/abap/adt-catalog/services/generator-service.js +2 -6
- package/dist/abap/adt-catalog/services/index.d.ts +13 -12
- package/dist/abap/adt-catalog/services/index.js +12 -27
- package/dist/abap/adt-catalog/services/list-package-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/list-package-service.js +5 -9
- package/dist/abap/adt-catalog/services/publish-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/publish-service.js +2 -6
- package/dist/abap/adt-catalog/services/rap-generator-service.d.ts +3 -3
- package/dist/abap/adt-catalog/services/rap-generator-service.js +2 -6
- package/dist/abap/adt-catalog/services/systeminfo-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/systeminfo-service.js +2 -6
- package/dist/abap/adt-catalog/services/transportcheck-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/transportcheck-service.js +9 -46
- package/dist/abap/adt-catalog/services/transportrequest-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/transportrequest-service.js +2 -6
- package/dist/abap/adt-catalog/services/ui5-rt-version-service.d.ts +2 -2
- package/dist/abap/adt-catalog/services/ui5-rt-version-service.js +2 -6
- package/dist/abap/app-index-service.d.ts +1 -1
- package/dist/abap/app-index-service.js +3 -7
- package/dist/abap/catalog/base.d.ts +2 -2
- package/dist/abap/catalog/base.js +3 -7
- package/dist/abap/catalog/index.d.ts +3 -3
- package/dist/abap/catalog/index.js +3 -19
- package/dist/abap/catalog/v2-catalog-service.d.ts +2 -2
- package/dist/abap/catalog/v2-catalog-service.js +7 -11
- package/dist/abap/catalog/v4-catalog-service.d.ts +2 -2
- package/dist/abap/catalog/v4-catalog-service.js +11 -15
- package/dist/abap/index.d.ts +12 -8
- package/dist/abap/index.js +8 -31
- package/dist/abap/lrep-service.d.ts +2 -2
- package/dist/abap/lrep-service.js +24 -31
- package/dist/abap/message.js +10 -18
- package/dist/abap/types/adt-internal-types.js +1 -2
- package/dist/abap/types/adt-types.js +3 -6
- package/dist/abap/types/external-services.js +1 -2
- package/dist/abap/types/index.d.ts +2 -2
- package/dist/abap/types/index.js +2 -18
- package/dist/abap/ui5-abap-repository-service.d.ts +1 -1
- package/dist/abap/ui5-abap-repository-service.js +14 -18
- package/dist/abap/ui5-version-service.d.ts +1 -1
- package/dist/abap/ui5-version-service.js +2 -6
- package/dist/auth/connection.d.ts +1 -1
- package/dist/auth/connection.js +10 -18
- package/dist/auth/error.js +4 -11
- package/dist/auth/index.d.ts +8 -6
- package/dist/auth/index.js +14 -35
- package/dist/auth/redirect.js +1 -5
- package/dist/auth/reentrance-ticket/abap-virtual-host-provider.js +5 -12
- package/dist/auth/reentrance-ticket/index.d.ts +1 -1
- package/dist/auth/reentrance-ticket/index.js +7 -10
- package/dist/auth/reentrance-ticket/redirect.d.ts +1 -1
- package/dist/auth/reentrance-ticket/redirect.js +10 -16
- package/dist/auth/static.js +2 -7
- package/dist/auth/uaa.d.ts +1 -1
- package/dist/auth/uaa.js +24 -31
- package/dist/base/odata-request-error.js +2 -7
- package/dist/base/odata-service.js +4 -8
- package/dist/base/patchTls.js +6 -13
- package/dist/base/service-provider.d.ts +2 -2
- package/dist/base/service-provider.js +8 -12
- package/dist/cacerts/sap-global-root-ca.js +1 -4
- package/dist/factory.d.ts +5 -5
- package/dist/factory.js +44 -56
- package/dist/index.d.ts +9 -9
- package/dist/index.js +10 -28
- package/package.json +9 -7
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ODataVersion } from '../base/odata-service';
|
|
2
|
-
import { ServiceProvider } from '../base/service-provider';
|
|
3
|
-
import { AppIndexService } from './app-index-service';
|
|
4
|
-
import type { CatalogService } from './catalog';
|
|
5
|
-
import { LayeredRepositoryService } from './lrep-service';
|
|
6
|
-
import type { AbapCDSView, AtoSettings, BusinessObject, ExternalService, ExternalServiceReference, SystemInfo } from './types';
|
|
7
|
-
import { Ui5AbapRepositoryService } from './ui5-abap-repository-service';
|
|
8
|
-
import { ODataServiceGenerator } from './adt-catalog/generators/odata-service-generator';
|
|
9
|
-
import { UiServiceGenerator } from './adt-catalog/generators/ui-service-generator';
|
|
10
|
-
import { type AdtService } from './adt-catalog/services';
|
|
11
|
-
import { UI5VersionService } from './ui5-version-service';
|
|
1
|
+
import { ODataVersion } from '../base/odata-service.js';
|
|
2
|
+
import { ServiceProvider } from '../base/service-provider.js';
|
|
3
|
+
import { AppIndexService } from './app-index-service.js';
|
|
4
|
+
import type { CatalogService } from './catalog/index.js';
|
|
5
|
+
import { LayeredRepositoryService } from './lrep-service.js';
|
|
6
|
+
import type { AbapCDSView, AtoSettings, BusinessObject, ExternalService, ExternalServiceReference, SystemInfo } from './types/index.js';
|
|
7
|
+
import { Ui5AbapRepositoryService } from './ui5-abap-repository-service.js';
|
|
8
|
+
import { ODataServiceGenerator } from './adt-catalog/generators/odata-service-generator.js';
|
|
9
|
+
import { UiServiceGenerator } from './adt-catalog/generators/ui-service-generator.js';
|
|
10
|
+
import { type AdtService } from './adt-catalog/services/index.js';
|
|
11
|
+
import { UI5VersionService } from './ui5-version-service.js';
|
|
12
12
|
/**
|
|
13
13
|
* Extension of the service provider for ABAP services.
|
|
14
14
|
*/
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const lrep_service_1 = require("./lrep-service");
|
|
11
|
-
const types_1 = require("./types");
|
|
12
|
-
const ui5_abap_repository_service_1 = require("./ui5-abap-repository-service");
|
|
1
|
+
import { join as joinPosix } from 'node:path/posix';
|
|
2
|
+
import { ODataVersion } from '../base/odata-service.js';
|
|
3
|
+
import { ServiceProvider } from '../base/service-provider.js';
|
|
4
|
+
import { AdtCatalogService } from './adt-catalog/adt-catalog-service.js';
|
|
5
|
+
import { AppIndexService } from './app-index-service.js';
|
|
6
|
+
import { V2CatalogService, V4CatalogService } from './catalog/index.js';
|
|
7
|
+
import { LayeredRepositoryService } from './lrep-service.js';
|
|
8
|
+
import { TenantType } from './types/index.js';
|
|
9
|
+
import { Ui5AbapRepositoryService } from './ui5-abap-repository-service.js';
|
|
13
10
|
// Can't use an `import type` here. We need the classname at runtime to create object instances:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import { ODataServiceGenerator } from './adt-catalog/generators/odata-service-generator.js';
|
|
12
|
+
import { UiServiceGenerator } from './adt-catalog/generators/ui-service-generator.js';
|
|
13
|
+
import { AtoService, GeneratorService, RapGeneratorService } from './adt-catalog/services/index.js';
|
|
14
|
+
import { SystemInfoService } from './adt-catalog/services/systeminfo-service.js';
|
|
15
|
+
import { UI5VersionService } from './ui5-version-service.js';
|
|
19
16
|
/**
|
|
20
17
|
* Extension of the service provider for ABAP services.
|
|
21
18
|
*/
|
|
22
|
-
class AbapServiceProvider extends
|
|
19
|
+
export class AbapServiceProvider extends ServiceProvider {
|
|
23
20
|
atoSettings;
|
|
24
21
|
/**
|
|
25
22
|
* Maintain the public facing URL which is required for destination related flows
|
|
@@ -48,7 +45,7 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
48
45
|
return this._systemInfo;
|
|
49
46
|
}
|
|
50
47
|
try {
|
|
51
|
-
const systemInfoService = this.createService('',
|
|
48
|
+
const systemInfoService = this.createService('', SystemInfoService);
|
|
52
49
|
this._systemInfo = await systemInfoService.getSystemInfo();
|
|
53
50
|
}
|
|
54
51
|
catch (error) {
|
|
@@ -75,7 +72,7 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
75
72
|
}
|
|
76
73
|
let atoService;
|
|
77
74
|
try {
|
|
78
|
-
atoService = await this.getAdtService(
|
|
75
|
+
atoService = await this.getAdtService(AtoService);
|
|
79
76
|
if (atoService) {
|
|
80
77
|
this.atoSettings = await atoService.getAtoInfo();
|
|
81
78
|
}
|
|
@@ -113,7 +110,7 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
113
110
|
if (this.atoSettings === undefined) {
|
|
114
111
|
await this.getAtoInfo();
|
|
115
112
|
}
|
|
116
|
-
return this.atoSettings.tenantType ===
|
|
113
|
+
return this.atoSettings.tenantType === TenantType.Customer && this.atoSettings.operationsType === 'C';
|
|
117
114
|
}
|
|
118
115
|
/**
|
|
119
116
|
* Create or get an existing instance of AdtCatalogService for fetching ADT schema.
|
|
@@ -121,11 +118,11 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
121
118
|
* @returns AdtCatalogService
|
|
122
119
|
*/
|
|
123
120
|
getAdtCatalogService() {
|
|
124
|
-
if (!this.services[
|
|
125
|
-
const adtCatalogService = this.createService(
|
|
126
|
-
this.services[
|
|
121
|
+
if (!this.services[AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH]) {
|
|
122
|
+
const adtCatalogService = this.createService(AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH, AdtCatalogService);
|
|
123
|
+
this.services[AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH] = adtCatalogService;
|
|
127
124
|
}
|
|
128
|
-
return this.services[
|
|
125
|
+
return this.services[AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH];
|
|
129
126
|
}
|
|
130
127
|
/**
|
|
131
128
|
* Create or get an existing instance of the catalog service for the given OData version.
|
|
@@ -135,15 +132,15 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
135
132
|
*/
|
|
136
133
|
catalog(version) {
|
|
137
134
|
let service;
|
|
138
|
-
if (version ===
|
|
135
|
+
if (version === ODataVersion.v2) {
|
|
139
136
|
service =
|
|
140
|
-
this.services[
|
|
141
|
-
this.createService(
|
|
137
|
+
this.services[V2CatalogService.PATH] ??
|
|
138
|
+
this.createService(V2CatalogService.PATH, V2CatalogService);
|
|
142
139
|
}
|
|
143
|
-
else if (version ===
|
|
140
|
+
else if (version === ODataVersion.v4) {
|
|
144
141
|
service =
|
|
145
|
-
this.services[
|
|
146
|
-
this.createService(
|
|
142
|
+
this.services[V4CatalogService.PATH] ??
|
|
143
|
+
this.createService(V4CatalogService.PATH, V4CatalogService);
|
|
147
144
|
}
|
|
148
145
|
else {
|
|
149
146
|
throw new Error('not implemented yet');
|
|
@@ -160,9 +157,9 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
160
157
|
* @returns an instance of the UI5 ABAP repository service.
|
|
161
158
|
*/
|
|
162
159
|
getUi5AbapRepository(alias) {
|
|
163
|
-
const path = alias ??
|
|
160
|
+
const path = alias ?? Ui5AbapRepositoryService.PATH;
|
|
164
161
|
if (!this.services[path]) {
|
|
165
|
-
this.services[path] = this.createService(path,
|
|
162
|
+
this.services[path] = this.createService(path, Ui5AbapRepositoryService);
|
|
166
163
|
}
|
|
167
164
|
return this.services[path];
|
|
168
165
|
}
|
|
@@ -172,10 +169,10 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
172
169
|
* @returns an instance of the app index service.
|
|
173
170
|
*/
|
|
174
171
|
getAppIndex() {
|
|
175
|
-
if (!this.services[
|
|
176
|
-
this.services[
|
|
172
|
+
if (!this.services[AppIndexService.PATH]) {
|
|
173
|
+
this.services[AppIndexService.PATH] = this.createService(AppIndexService.PATH, AppIndexService);
|
|
177
174
|
}
|
|
178
|
-
return this.services[
|
|
175
|
+
return this.services[AppIndexService.PATH];
|
|
179
176
|
}
|
|
180
177
|
/**
|
|
181
178
|
* Create or get an existing instance of design time adaptation service.
|
|
@@ -184,9 +181,9 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
184
181
|
* @returns an instance of the design time adaptation service.
|
|
185
182
|
*/
|
|
186
183
|
getLayeredRepository(alias) {
|
|
187
|
-
const path = alias ??
|
|
184
|
+
const path = alias ?? LayeredRepositoryService.PATH;
|
|
188
185
|
if (!this.services[path]) {
|
|
189
|
-
this.services[path] = this.createService(path,
|
|
186
|
+
this.services[path] = this.createService(path, LayeredRepositoryService);
|
|
190
187
|
}
|
|
191
188
|
return this.services[path];
|
|
192
189
|
}
|
|
@@ -222,9 +219,9 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
222
219
|
* @returns The instance to the UI5 version service.
|
|
223
220
|
*/
|
|
224
221
|
getUI5VersionService() {
|
|
225
|
-
const path =
|
|
222
|
+
const path = UI5VersionService.PATH;
|
|
226
223
|
if (!this.services[path]) {
|
|
227
|
-
this.services[path] = this.createService(path,
|
|
224
|
+
this.services[path] = this.createService(path, UI5VersionService);
|
|
228
225
|
}
|
|
229
226
|
return this.services[path];
|
|
230
227
|
}
|
|
@@ -235,12 +232,12 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
235
232
|
* @returns a UI Service generator
|
|
236
233
|
*/
|
|
237
234
|
async getUiServiceGenerator(referencedObject) {
|
|
238
|
-
const generatorService = await this.getAdtService(
|
|
235
|
+
const generatorService = await this.getAdtService(GeneratorService);
|
|
239
236
|
if (!generatorService) {
|
|
240
237
|
throw new Error('Generators are not supported on this system');
|
|
241
238
|
}
|
|
242
239
|
const config = await generatorService.getUIServiceGeneratorConfig(referencedObject.uri);
|
|
243
|
-
const gen = this.createService(this.getServiceUrlFromConfig(config),
|
|
240
|
+
const gen = this.createService(this.getServiceUrlFromConfig(config), UiServiceGenerator);
|
|
244
241
|
gen.configure(config, referencedObject, this.getContentType(config));
|
|
245
242
|
return gen;
|
|
246
243
|
}
|
|
@@ -251,12 +248,12 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
251
248
|
* @returns An OData Service generator
|
|
252
249
|
*/
|
|
253
250
|
async getODataServiceGenerator(packageName) {
|
|
254
|
-
const generatorService = await this.getAdtService(
|
|
251
|
+
const generatorService = await this.getAdtService(RapGeneratorService);
|
|
255
252
|
if (!generatorService) {
|
|
256
253
|
throw new Error('RAP Generator are not support on this system');
|
|
257
254
|
}
|
|
258
255
|
const config = await generatorService.getRAPGeneratorConfig();
|
|
259
|
-
const generator = this.createService(this.getServiceUrlFromConfig(config),
|
|
256
|
+
const generator = this.createService(this.getServiceUrlFromConfig(config), ODataServiceGenerator);
|
|
260
257
|
generator.setContentType(this.getContentType(config));
|
|
261
258
|
generator.configure(config, packageName || '$TMP');
|
|
262
259
|
return generator;
|
|
@@ -271,7 +268,7 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
271
268
|
const valueListReferences = [];
|
|
272
269
|
const allPromises = references.map(async (reference) => {
|
|
273
270
|
const { serviceRootPath, value } = reference;
|
|
274
|
-
const externalServicePath = (
|
|
271
|
+
const externalServicePath = joinPosix(serviceRootPath, value).replace('/$metadata', '');
|
|
275
272
|
const externalService = this.service(externalServicePath);
|
|
276
273
|
try {
|
|
277
274
|
const data = await externalService.metadata();
|
|
@@ -327,9 +324,8 @@ class AbapServiceProvider extends service_provider_1.ServiceProvider {
|
|
|
327
324
|
* @returns a service provider instance to lock the service binding
|
|
328
325
|
*/
|
|
329
326
|
async createLockServiceBindingGenerator(path) {
|
|
330
|
-
const gen = this.createService(path,
|
|
327
|
+
const gen = this.createService(path, UiServiceGenerator);
|
|
331
328
|
return gen;
|
|
332
329
|
}
|
|
333
330
|
}
|
|
334
|
-
exports.AbapServiceProvider = AbapServiceProvider;
|
|
335
331
|
//# sourceMappingURL=abap-service-provider.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Logger } from '@sap-ux/logger';
|
|
2
|
-
import type { AdtCategory, AdtCollection } from '
|
|
2
|
+
import type { AdtCategory, AdtCollection } from '../types/index.js';
|
|
3
3
|
import { Axios } from 'axios';
|
|
4
|
-
import { AdtSchemaStore } from './adt-schema-store';
|
|
4
|
+
import { AdtSchemaStore } from './adt-schema-store.js';
|
|
5
5
|
/**
|
|
6
6
|
* Adt Catalog Service implementation fetches the
|
|
7
7
|
* Adt service specification for a given ADT service.
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const axios_1 = require("axios");
|
|
5
|
-
const adt_schema_store_1 = require("./adt-schema-store");
|
|
6
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
import { AdtSchemaStore } from './adt-schema-store.js';
|
|
3
|
+
import { XMLParser, XMLValidator } from 'fast-xml-parser';
|
|
7
4
|
/**
|
|
8
5
|
* Adt Catalog Service implementation fetches the
|
|
9
6
|
* Adt service specification for a given ADT service.
|
|
10
7
|
*/
|
|
11
|
-
class AdtCatalogService extends
|
|
8
|
+
export class AdtCatalogService extends Axios {
|
|
12
9
|
// Discovery service url provided by ADT team
|
|
13
10
|
static ADT_DISCOVERY_SERVICE_PATH = '/sap/bc/adt/discovery';
|
|
14
11
|
// Cache of fetched discovery schema
|
|
15
|
-
schemaStore = new
|
|
12
|
+
schemaStore = new AdtSchemaStore();
|
|
16
13
|
// Instantiated by calling ServiceProvider.createService()
|
|
17
14
|
log;
|
|
18
15
|
/**
|
|
@@ -78,7 +75,7 @@ class AdtCatalogService extends axios_1.Axios {
|
|
|
78
75
|
* @returns Discovery schema data object
|
|
79
76
|
*/
|
|
80
77
|
parseAdtSchemaData(xml) {
|
|
81
|
-
if (
|
|
78
|
+
if (XMLValidator.validate(xml) !== true) {
|
|
82
79
|
return null;
|
|
83
80
|
}
|
|
84
81
|
const options = {
|
|
@@ -88,7 +85,7 @@ class AdtCatalogService extends axios_1.Axios {
|
|
|
88
85
|
parseAttributeValue: true,
|
|
89
86
|
removeNSPrefix: true
|
|
90
87
|
};
|
|
91
|
-
const parser = new
|
|
88
|
+
const parser = new XMLParser(options);
|
|
92
89
|
const parsed = parser.parse(xml, true);
|
|
93
90
|
if (parsed.service) {
|
|
94
91
|
return parsed;
|
|
@@ -98,5 +95,4 @@ class AdtCatalogService extends axios_1.Axios {
|
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
|
-
exports.AdtCatalogService = AdtCatalogService;
|
|
102
98
|
//# sourceMappingURL=adt-catalog-service.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdtSchemaStore = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* This class stores the ADT schema fetched by calling ADT discovery service.
|
|
6
3
|
*/
|
|
7
|
-
class AdtSchemaStore {
|
|
4
|
+
export class AdtSchemaStore {
|
|
8
5
|
/**
|
|
9
6
|
* ADT schema is modeled as a map for fast access
|
|
10
7
|
*/
|
|
@@ -71,5 +68,4 @@ class AdtSchemaStore {
|
|
|
71
68
|
return `${adtCategory.scheme},${adtCategory.term}`;
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
|
-
exports.AdtSchemaStore = AdtSchemaStore;
|
|
75
71
|
//# sourceMappingURL=adt-schema-store.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { UiServiceGenerator } from './ui-service-generator';
|
|
2
|
-
export { ODataServiceGenerator } from './odata-service-generator';
|
|
1
|
+
export { UiServiceGenerator } from './ui-service-generator.js';
|
|
2
|
+
export { ODataServiceGenerator } from './odata-service-generator.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ODataServiceGenerator = exports.UiServiceGenerator = void 0;
|
|
4
|
-
var ui_service_generator_1 = require("./ui-service-generator");
|
|
5
|
-
Object.defineProperty(exports, "UiServiceGenerator", { enumerable: true, get: function () { return ui_service_generator_1.UiServiceGenerator; } });
|
|
6
|
-
var odata_service_generator_1 = require("./odata-service-generator");
|
|
7
|
-
Object.defineProperty(exports, "ODataServiceGenerator", { enumerable: true, get: function () { return odata_service_generator_1.ODataServiceGenerator; } });
|
|
1
|
+
export { UiServiceGenerator } from './ui-service-generator.js';
|
|
2
|
+
export { ODataServiceGenerator } from './odata-service-generator.js';
|
|
8
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GeneratorEntry } from './types';
|
|
2
|
-
import type { ODataServiceTechnicalDetails, ValidationMessage } from '../../types';
|
|
3
|
-
import { AdtService } from '../services';
|
|
1
|
+
import type { GeneratorEntry } from './types.js';
|
|
2
|
+
import type { ODataServiceTechnicalDetails, ValidationMessage } from '../../types/index.js';
|
|
3
|
+
import { AdtService } from '../services/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Extension of the Generator service to generate OData services
|
|
6
6
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ODataServiceGenerator = void 0;
|
|
4
|
-
const services_1 = require("../services");
|
|
1
|
+
import { AdtService } from '../services/index.js';
|
|
5
2
|
/**
|
|
6
3
|
* Extension of the Generator service to generate OData services
|
|
7
4
|
*/
|
|
8
|
-
class ODataServiceGenerator extends
|
|
5
|
+
export class ODataServiceGenerator extends AdtService {
|
|
9
6
|
/**
|
|
10
7
|
* package to be used for generated objects
|
|
11
8
|
*/
|
|
@@ -127,5 +124,4 @@ class ODataServiceGenerator extends services_1.AdtService {
|
|
|
127
124
|
};
|
|
128
125
|
}
|
|
129
126
|
}
|
|
130
|
-
exports.ODataServiceGenerator = ODataServiceGenerator;
|
|
131
127
|
//# sourceMappingURL=odata-service-generator.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GeneratorEntry } from './types';
|
|
2
|
-
import type { AbapCDSView, BusinessObject, ValidationResponse } from '../../types';
|
|
3
|
-
import { AdtService } from '../services';
|
|
1
|
+
import type { GeneratorEntry } from './types.js';
|
|
2
|
+
import type { AbapCDSView, BusinessObject, ValidationResponse } from '../../types/index.js';
|
|
3
|
+
import { AdtService } from '../services/index.js';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiServiceGenerator = void 0;
|
|
4
|
-
const services_1 = require("../services");
|
|
1
|
+
import { AdtService } from '../services/index.js';
|
|
5
2
|
/**
|
|
6
3
|
*
|
|
7
4
|
*/
|
|
8
|
-
class UiServiceGenerator extends
|
|
5
|
+
export class UiServiceGenerator extends AdtService {
|
|
9
6
|
referencedObject;
|
|
10
7
|
contentType;
|
|
11
8
|
/**
|
|
@@ -120,5 +117,4 @@ class UiServiceGenerator extends services_1.AdtService {
|
|
|
120
117
|
return this.parseResponse(response.data);
|
|
121
118
|
}
|
|
122
119
|
}
|
|
123
|
-
exports.UiServiceGenerator = UiServiceGenerator;
|
|
124
120
|
//# sourceMappingURL=ui-service-generator.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './adt-catalog-service';
|
|
2
|
-
export * from './services';
|
|
3
|
-
export * from './generators';
|
|
1
|
+
export * from './adt-catalog-service.js';
|
|
2
|
+
export * from './services/index.js';
|
|
3
|
+
export * from './generators/index.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./adt-catalog-service"), exports);
|
|
18
|
-
__exportStar(require("./services"), exports);
|
|
19
|
-
__exportStar(require("./generators"), exports);
|
|
1
|
+
export * from './adt-catalog-service.js';
|
|
2
|
+
export * from './services/index.js';
|
|
3
|
+
export * from './generators/index.js';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdtService } from './adt-service';
|
|
2
|
-
import type { AbapCDSView, AdtCategory } from '../../types';
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import type { AbapCDSView, AdtCategory } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* AbapCDSViewService implements ADT requests to obtain the list of abap cds views.
|
|
5
5
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbapCDSViewService = void 0;
|
|
4
|
-
const adt_service_1 = require("./adt-service");
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
5
2
|
/**
|
|
6
3
|
* AbapCDSViewService implements ADT requests to obtain the list of abap cds views.
|
|
7
4
|
*/
|
|
8
|
-
class AbapCDSViewService extends
|
|
5
|
+
export class AbapCDSViewService extends AdtService {
|
|
9
6
|
/**
|
|
10
7
|
* @see AdtService.getAdtCatagory()
|
|
11
8
|
*/
|
|
@@ -66,5 +63,4 @@ class AbapCDSViewService extends adt_service_1.AdtService {
|
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
|
-
exports.AbapCDSViewService = AbapCDSViewService;
|
|
70
66
|
//# sourceMappingURL=abapcdsview-service.js.map
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AdtService = void 0;
|
|
4
|
-
const axios_1 = require("axios");
|
|
5
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
import { XMLParser, XMLValidator } from 'fast-xml-parser';
|
|
6
3
|
/**
|
|
7
4
|
* AdtService provides abstraction of AdtService implementations. Each specific ADT service
|
|
8
5
|
* should be implemented as subclass of AdtService.
|
|
9
6
|
*/
|
|
10
|
-
class AdtService extends
|
|
7
|
+
export class AdtService extends Axios {
|
|
11
8
|
// Instantiated by calling ServiceProvider.createService()
|
|
12
9
|
log;
|
|
13
10
|
// ADT schema for the corresponding AdtService subclass
|
|
@@ -36,7 +33,7 @@ class AdtService extends axios_1.Axios {
|
|
|
36
33
|
* @returns parsed ATO settings
|
|
37
34
|
*/
|
|
38
35
|
parseResponse(xml) {
|
|
39
|
-
if (
|
|
36
|
+
if (XMLValidator.validate(xml) !== true) {
|
|
40
37
|
this.log.warn(`Invalid XML: ${xml}`);
|
|
41
38
|
return {};
|
|
42
39
|
}
|
|
@@ -47,9 +44,8 @@ class AdtService extends axios_1.Axios {
|
|
|
47
44
|
parseAttributeValue: true,
|
|
48
45
|
removeNSPrefix: true
|
|
49
46
|
};
|
|
50
|
-
const parser = new
|
|
47
|
+
const parser = new XMLParser(options);
|
|
51
48
|
return parser.parse(xml, true);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
|
-
exports.AdtService = AdtService;
|
|
55
51
|
//# sourceMappingURL=adt-service.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdtService } from './adt-service';
|
|
2
|
-
import type { AdtCategory, AtoSettings } from '
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import type { AdtCategory, AtoSettings } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* AtoService implements ADT requests for fetching ATO settings.
|
|
5
5
|
*/
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AtoService = void 0;
|
|
4
|
-
const adt_service_1 = require("./adt-service");
|
|
5
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import { XMLParser, XMLValidator } from 'fast-xml-parser';
|
|
6
3
|
/**
|
|
7
4
|
* AtoService implements ADT requests for fetching ATO settings.
|
|
8
5
|
*/
|
|
9
|
-
class AtoService extends
|
|
6
|
+
export class AtoService extends AdtService {
|
|
10
7
|
/**
|
|
11
8
|
* @see AdtService.getAdtCatagory()
|
|
12
9
|
*/
|
|
@@ -42,7 +39,7 @@ class AtoService extends adt_service_1.AdtService {
|
|
|
42
39
|
* @returns parsed ATO settings
|
|
43
40
|
*/
|
|
44
41
|
parseAtoResponse(xml) {
|
|
45
|
-
if (
|
|
42
|
+
if (XMLValidator.validate(xml) !== true) {
|
|
46
43
|
this.log.warn(`Invalid XML: ${xml}`);
|
|
47
44
|
return {};
|
|
48
45
|
}
|
|
@@ -53,10 +50,9 @@ class AtoService extends adt_service_1.AdtService {
|
|
|
53
50
|
parseAttributeValue: true,
|
|
54
51
|
removeNSPrefix: true
|
|
55
52
|
};
|
|
56
|
-
const parser = new
|
|
53
|
+
const parser = new XMLParser(options);
|
|
57
54
|
const parsed = parser.parse(xml, true);
|
|
58
55
|
return parsed.settings ? parsed.settings : {};
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
|
-
exports.AtoService = AtoService;
|
|
62
58
|
//# sourceMappingURL=ato-service.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdtService } from './adt-service';
|
|
2
|
-
import type { AdtCategory, BusinessObject } from '../../types';
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import type { AdtCategory, BusinessObject } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* BusinessObjectsService implements ADT requests to obtain the list of business objects.
|
|
5
5
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BusinessObjectsService = void 0;
|
|
4
|
-
const adt_service_1 = require("./adt-service");
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
5
2
|
/**
|
|
6
3
|
* BusinessObjectsService implements ADT requests to obtain the list of business objects.
|
|
7
4
|
*/
|
|
8
|
-
class BusinessObjectsService extends
|
|
5
|
+
export class BusinessObjectsService extends AdtService {
|
|
9
6
|
/**
|
|
10
7
|
* @see AdtService.getAdtCatagory()
|
|
11
8
|
*/
|
|
@@ -66,5 +63,4 @@ class BusinessObjectsService extends adt_service_1.AdtService {
|
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
|
-
exports.BusinessObjectsService = BusinessObjectsService;
|
|
70
66
|
//# sourceMappingURL=businessobjects-service.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdtService } from './adt-service';
|
|
2
|
-
import type { AdtCategory, ArchiveFileNodeType, ArchiveFileContentType } from '../../types';
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import type { AdtCategory, ArchiveFileNodeType, ArchiveFileContentType } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* FileStoreService implements ADT requests to obtain the content
|
|
5
5
|
* of deployed archive.
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FileStoreService = void 0;
|
|
4
|
-
const adt_service_1 = require("./adt-service");
|
|
5
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
1
|
+
import { AdtService } from './adt-service.js';
|
|
2
|
+
import { XMLParser, XMLValidator } from 'fast-xml-parser';
|
|
6
3
|
/**
|
|
7
4
|
* FileStoreService implements ADT requests to obtain the content
|
|
8
5
|
* of deployed archive.
|
|
9
6
|
*/
|
|
10
|
-
class FileStoreService extends
|
|
7
|
+
export class FileStoreService extends AdtService {
|
|
11
8
|
/**
|
|
12
9
|
* @see AdtService.getAdtCatagory()
|
|
13
10
|
*/
|
|
@@ -71,7 +68,7 @@ class FileStoreService extends adt_service_1.AdtService {
|
|
|
71
68
|
return responseData;
|
|
72
69
|
}
|
|
73
70
|
// A list of file/folder items in the response data as xml string.
|
|
74
|
-
if (
|
|
71
|
+
if (XMLValidator.validate(responseData) !== true) {
|
|
75
72
|
throw new Error('Invalid XML content');
|
|
76
73
|
}
|
|
77
74
|
const options = {
|
|
@@ -81,7 +78,7 @@ class FileStoreService extends adt_service_1.AdtService {
|
|
|
81
78
|
parseAttributeValue: true,
|
|
82
79
|
removeNSPrefix: true
|
|
83
80
|
};
|
|
84
|
-
const parser = new
|
|
81
|
+
const parser = new XMLParser(options);
|
|
85
82
|
const parsed = parser.parse(responseData, true);
|
|
86
83
|
let fileNodeArray = [];
|
|
87
84
|
if (parsed?.feed) {
|
|
@@ -102,5 +99,4 @@ class FileStoreService extends adt_service_1.AdtService {
|
|
|
102
99
|
});
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
|
-
exports.FileStoreService = FileStoreService;
|
|
106
102
|
//# sourceMappingURL=filestore-service.js.map
|