@sap-ux/axios-extension 0.4.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.
Files changed (83) hide show
  1. package/LICENSE +201 -0
  2. package/README.adoc +61 -0
  3. package/dist/abap/abap-service-provider.d.ts +64 -0
  4. package/dist/abap/abap-service-provider.d.ts.map +1 -0
  5. package/dist/abap/abap-service-provider.js +133 -0
  6. package/dist/abap/abap-service-provider.js.map +1 -0
  7. package/dist/abap/app-index-service.d.ts +26 -0
  8. package/dist/abap/app-index-service.d.ts.map +1 -0
  9. package/dist/abap/app-index-service.js +38 -0
  10. package/dist/abap/app-index-service.js.map +1 -0
  11. package/dist/abap/ato.d.ts +25 -0
  12. package/dist/abap/ato.d.ts.map +1 -0
  13. package/dist/abap/ato.js +35 -0
  14. package/dist/abap/ato.js.map +1 -0
  15. package/dist/abap/catalog/base.d.ts +44 -0
  16. package/dist/abap/catalog/base.d.ts.map +1 -0
  17. package/dist/abap/catalog/base.js +33 -0
  18. package/dist/abap/catalog/base.js.map +1 -0
  19. package/dist/abap/catalog/index.d.ts +4 -0
  20. package/dist/abap/catalog/index.d.ts.map +1 -0
  21. package/dist/abap/catalog/index.js +16 -0
  22. package/dist/abap/catalog/index.js.map +1 -0
  23. package/dist/abap/catalog/v2-catalog-service.d.ts +66 -0
  24. package/dist/abap/catalog/v2-catalog-service.d.ts.map +1 -0
  25. package/dist/abap/catalog/v2-catalog-service.js +175 -0
  26. package/dist/abap/catalog/v2-catalog-service.js.map +1 -0
  27. package/dist/abap/catalog/v4-catalog-service.d.ts +49 -0
  28. package/dist/abap/catalog/v4-catalog-service.d.ts.map +1 -0
  29. package/dist/abap/catalog/v4-catalog-service.js +88 -0
  30. package/dist/abap/catalog/v4-catalog-service.js.map +1 -0
  31. package/dist/abap/index.d.ts +7 -0
  32. package/dist/abap/index.d.ts.map +1 -0
  33. package/dist/abap/index.js +24 -0
  34. package/dist/abap/index.js.map +1 -0
  35. package/dist/abap/message.d.ts +69 -0
  36. package/dist/abap/message.d.ts.map +1 -0
  37. package/dist/abap/message.js +82 -0
  38. package/dist/abap/message.js.map +1 -0
  39. package/dist/abap/ui5-abap-repository-service.d.ts +109 -0
  40. package/dist/abap/ui5-abap-repository-service.d.ts.map +1 -0
  41. package/dist/abap/ui5-abap-repository-service.js +264 -0
  42. package/dist/abap/ui5-abap-repository-service.js.map +1 -0
  43. package/dist/auth/connection.d.ts +40 -0
  44. package/dist/auth/connection.d.ts.map +1 -0
  45. package/dist/auth/connection.js +194 -0
  46. package/dist/auth/connection.js.map +1 -0
  47. package/dist/auth/error.d.ts +28 -0
  48. package/dist/auth/error.d.ts.map +1 -0
  49. package/dist/auth/error.js +37 -0
  50. package/dist/auth/error.js.map +1 -0
  51. package/dist/auth/index.d.ts +19 -0
  52. package/dist/auth/index.d.ts.map +1 -0
  53. package/dist/auth/index.js +64 -0
  54. package/dist/auth/index.js.map +1 -0
  55. package/dist/auth/redirect.d.ts +20 -0
  56. package/dist/auth/redirect.d.ts.map +1 -0
  57. package/dist/auth/redirect.js +27 -0
  58. package/dist/auth/redirect.js.map +1 -0
  59. package/dist/auth/static.d.ts +2 -0
  60. package/dist/auth/static.d.ts.map +1 -0
  61. package/dist/auth/static.js +129 -0
  62. package/dist/auth/static.js.map +1 -0
  63. package/dist/auth/uaa.d.ts +107 -0
  64. package/dist/auth/uaa.d.ts.map +1 -0
  65. package/dist/auth/uaa.js +258 -0
  66. package/dist/auth/uaa.js.map +1 -0
  67. package/dist/base/odata-service.d.ts +49 -0
  68. package/dist/base/odata-service.d.ts.map +1 -0
  69. package/dist/base/odata-service.js +119 -0
  70. package/dist/base/odata-service.js.map +1 -0
  71. package/dist/base/service-provider.d.ts +50 -0
  72. package/dist/base/service-provider.d.ts.map +1 -0
  73. package/dist/base/service-provider.js +56 -0
  74. package/dist/base/service-provider.js.map +1 -0
  75. package/dist/factory.d.ts +48 -0
  76. package/dist/factory.d.ts.map +1 -0
  77. package/dist/factory.js +136 -0
  78. package/dist/factory.js.map +1 -0
  79. package/dist/index.d.ts +6 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +18 -0
  82. package/dist/index.js.map +1 -0
  83. package/package.json +51 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/abap/catalog/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,8BAAsB,cAAe,SAAQ,YAAY;IACrD,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAEtB,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAE/D;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAOjD,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CACtF"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CatalogService = void 0;
13
+ const odata_service_1 = require("../../base/odata-service");
14
+ /**
15
+ * OData version independent abstract base class of SAP's catalog service
16
+ */
17
+ class CatalogService extends odata_service_1.ODataService {
18
+ /**
19
+ * Returns list of services from the catalog service.
20
+ *
21
+ * @returns list of services
22
+ */
23
+ listServices() {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ if (!this.services) {
26
+ this.services = yield this.fetchServices();
27
+ }
28
+ return this.services;
29
+ });
30
+ }
31
+ }
32
+ exports.CatalogService = CatalogService;
33
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/abap/catalog/base.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4DAAwD;AA8BxD;;GAEG;AACH,MAAsB,cAAe,SAAQ,4BAAY;IASrD;;;;OAIG;IACG,YAAY;;YACd,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;aAC9C;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;KAAA;CAGJ;AAtBD,wCAsBC"}
@@ -0,0 +1,4 @@
1
+ export * from './base';
2
+ export * from './v2-catalog-service';
3
+ export * from './v4-catalog-service';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/abap/catalog/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./base"), exports);
14
+ __exportStar(require("./v2-catalog-service"), exports);
15
+ __exportStar(require("./v4-catalog-service"), exports);
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abap/catalog/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,uDAAqC;AACrC,uDAAqC"}
@@ -0,0 +1,66 @@
1
+ import type { ODataServiceInfo, Annotations, FilterOptions } from './base';
2
+ import { CatalogService } from './base';
3
+ /**
4
+ * Structure representing a V2 service
5
+ */
6
+ export interface ODataServiceV2Info {
7
+ ID: string;
8
+ Description: string;
9
+ Title: string;
10
+ MetadataUrl: string;
11
+ ServiceUrl: string;
12
+ TechnicalName: string;
13
+ TechnicalServiceName: string;
14
+ Version: string;
15
+ TechnicalServiceVersion: number;
16
+ }
17
+ /**
18
+ * OData V2 specific implmentation of SAP's catalog service
19
+ */
20
+ export declare class V2CatalogService extends CatalogService {
21
+ static readonly PATH = "/sap/opu/odata/IWFND/CATALOGSERVICE;v=2";
22
+ protected determineEntitySet(): Promise<void>;
23
+ /**
24
+ * Map the V2 service information to a version independent structure.
25
+ *
26
+ * @param services v2 services information
27
+ * @returns version independent information
28
+ */
29
+ protected mapServices(services: ODataServiceV2Info[]): ODataServiceInfo[];
30
+ /**
31
+ * Fetch all services from the backend.
32
+ *
33
+ * @returns version independent service information
34
+ */
35
+ protected fetchServices(): Promise<ODataServiceInfo[]>;
36
+ /**
37
+ * Find a specific service by title.
38
+ *
39
+ * @param filter filter options
40
+ * @param filter.title filter by title
41
+ * @param filter.path filter by path
42
+ * @returns service information matching the given filter
43
+ */
44
+ protected findService({ title, path }: FilterOptions): Promise<ODataServiceV2Info>;
45
+ /**
46
+ * Get service annotations for the service matching the given filter.
47
+ *
48
+ * @param filter filter options
49
+ * @param filter.id filter by id
50
+ * @param filter.title filter by title
51
+ * @param filter.path filter by path
52
+ * @returns service annotations
53
+ */
54
+ protected getServiceAnnotations({ id, title, path }: FilterOptions): Promise<ODataServiceV2Info[]>;
55
+ /**
56
+ * Get all annotations available for the service matching one of the below filter options.
57
+ *
58
+ * @param filter filter options
59
+ * @param filter.id filter by id
60
+ * @param filter.title filter by title
61
+ * @param filter.path filter by path
62
+ * @returns annotations
63
+ */
64
+ getAnnotations({ id, title, path }: FilterOptions): Promise<Annotations[]>;
65
+ }
66
+ //# sourceMappingURL=v2-catalog-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2-catalog-service.d.ts","sourceRoot":"","sources":["../../../src/abap/catalog/v2-catalog-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAQxC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAChD,gBAAuB,IAAI,6CAA6C;cAExD,kBAAkB;IAOlC;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,EAAE;IAYzE;;;;OAIG;cACa,aAAa,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAgB5D;;;;;;;OAOG;cACa,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8BxF;;;;;;;;OAQG;cACa,qBAAqB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAuBxG;;;;;;;;OAQG;IACU,cAAc,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAgC1F"}
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.V2CatalogService = void 0;
13
+ const base_1 = require("./base");
14
+ const odata_service_1 = require("../../base/odata-service");
15
+ const V2_CLASSIC_ENTITYSET = 'ServiceCollection';
16
+ const V2_RECOMMENDED_ENTITYSET = 'RecommendedServiceCollection';
17
+ const V2_S4CLOUD_FILTER = '((IsSapService%20eq%20true)and(ReleaseStatus%20eq%20%27RELEASED%27))or((IsSapService%20eq%20false))';
18
+ /**
19
+ * OData V2 specific implmentation of SAP's catalog service
20
+ */
21
+ class V2CatalogService extends base_1.CatalogService {
22
+ determineEntitySet() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const doc = yield this.document();
25
+ this.entitySet = doc.EntitySets.includes(V2_RECOMMENDED_ENTITYSET)
26
+ ? V2_RECOMMENDED_ENTITYSET
27
+ : V2_CLASSIC_ENTITYSET;
28
+ });
29
+ }
30
+ /**
31
+ * Map the V2 service information to a version independent structure.
32
+ *
33
+ * @param services v2 services information
34
+ * @returns version independent information
35
+ */
36
+ mapServices(services) {
37
+ return services.map((service) => {
38
+ return {
39
+ id: service.ID,
40
+ name: service.TechnicalServiceName,
41
+ path: new URL(service.ServiceUrl).pathname,
42
+ serviceVersion: service.TechnicalServiceVersion + '',
43
+ odataVersion: odata_service_1.ODataVersion.v2
44
+ };
45
+ });
46
+ }
47
+ /**
48
+ * Fetch all services from the backend.
49
+ *
50
+ * @returns version independent service information
51
+ */
52
+ fetchServices() {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const params = {
55
+ $format: 'json'
56
+ };
57
+ if (!this.entitySet) {
58
+ yield this.determineEntitySet();
59
+ }
60
+ if (this.entitySet === V2_CLASSIC_ENTITYSET && (yield this.isS4Cloud)) {
61
+ params['$filter'] = V2_S4CLOUD_FILTER;
62
+ }
63
+ const response = yield this.get(`/${this.entitySet}`, { params });
64
+ return this.mapServices(response.odata());
65
+ });
66
+ }
67
+ /**
68
+ * Find a specific service by title.
69
+ *
70
+ * @param filter filter options
71
+ * @param filter.title filter by title
72
+ * @param filter.path filter by path
73
+ * @returns service information matching the given filter
74
+ */
75
+ findService({ title, path }) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ if (!title) {
78
+ title = path.replace(/\/$/, '').split('/').pop().toUpperCase();
79
+ if (!title) {
80
+ throw new Error(`Cannot determine service title from path: ${path}`);
81
+ }
82
+ }
83
+ const params = {
84
+ $format: 'json',
85
+ $filter: `Title%20eq%20%27${title}%27`
86
+ };
87
+ const response = yield this.get(`/${this.entitySet}`, { params });
88
+ const services = response.odata();
89
+ if (services.length > 1) {
90
+ // #14793: Fix for user created multi namespaces for the same service
91
+ const servicesWithSameNameSpace = services.filter((service) => { var _a; return (_a = service.ServiceUrl) === null || _a === void 0 ? void 0 : _a.toUpperCase().includes((path || title).toUpperCase()); });
92
+ if (servicesWithSameNameSpace.length > 1) {
93
+ this.log.warn('Service filter was not sufficient to identify one service.');
94
+ }
95
+ else if (servicesWithSameNameSpace.length > 0) {
96
+ this.log.info(`Service filter chose service: ${servicesWithSameNameSpace[0].TechnicalServiceName}`);
97
+ return servicesWithSameNameSpace[0];
98
+ }
99
+ }
100
+ return services.length > 0 ? services[0] : undefined;
101
+ });
102
+ }
103
+ /**
104
+ * Get service annotations for the service matching the given filter.
105
+ *
106
+ * @param filter filter options
107
+ * @param filter.id filter by id
108
+ * @param filter.title filter by title
109
+ * @param filter.path filter by path
110
+ * @returns service annotations
111
+ */
112
+ getServiceAnnotations({ id, title, path }) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ if (!this.entitySet) {
115
+ yield this.determineEntitySet();
116
+ }
117
+ if (!id) {
118
+ const ServiceConfig = yield this.findService({ title, path });
119
+ if (ServiceConfig) {
120
+ id = ServiceConfig.ID;
121
+ }
122
+ }
123
+ if (id) {
124
+ const response = yield this.get(`/${this.entitySet}('${encodeURIComponent(id)}')/Annotations`, {
125
+ params: { $format: 'json' }
126
+ });
127
+ return response.odata();
128
+ }
129
+ else {
130
+ return [];
131
+ }
132
+ });
133
+ }
134
+ /**
135
+ * Get all annotations available for the service matching one of the below filter options.
136
+ *
137
+ * @param filter filter options
138
+ * @param filter.id filter by id
139
+ * @param filter.title filter by title
140
+ * @param filter.path filter by path
141
+ * @returns annotations
142
+ */
143
+ getAnnotations({ id, title, path }) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ if (!id && !title && !path) {
146
+ throw new Error('No filter parameters passed in');
147
+ }
148
+ const serviceAnnotations = yield this.getServiceAnnotations({ id, title, path });
149
+ const annotations = [];
150
+ for (const service of serviceAnnotations) {
151
+ const _path = `/Annotations(TechnicalName='${encodeURIComponent(service.TechnicalName)}',Version='${service.Version}')/$value/`;
152
+ const response = yield this.get(_path, {
153
+ headers: {
154
+ Accept: 'application/xml'
155
+ }
156
+ });
157
+ if (response.data) {
158
+ annotations.push({
159
+ TechnicalName: service.TechnicalName,
160
+ Version: service.Version,
161
+ Definitions: response.data,
162
+ Uri: this.defaults.baseURL + _path
163
+ });
164
+ }
165
+ else {
166
+ this.log.warn(`No annotations found for TechnicalName=${service.TechnicalName}, Version=${service.Version}`);
167
+ }
168
+ }
169
+ return annotations;
170
+ });
171
+ }
172
+ }
173
+ exports.V2CatalogService = V2CatalogService;
174
+ V2CatalogService.PATH = '/sap/opu/odata/IWFND/CATALOGSERVICE;v=2';
175
+ //# sourceMappingURL=v2-catalog-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2-catalog-service.js","sourceRoot":"","sources":["../../../src/abap/catalog/v2-catalog-service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iCAAwC;AACxC,4DAAwD;AAExD,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACjD,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;AAChE,MAAM,iBAAiB,GACnB,qGAAqG,CAAC;AAiB1G;;GAEG;AACH,MAAa,gBA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KAAK,GAAG,+BAA+B,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,cAClF,OAAO,CAAC,OACZ,YAAY,CAAC;gBAEb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAS,KAAK,EAAE;oBAC3C,OAAO,EAAE;wBACL,MAAM,EAAE,iBAAiB;qBAC5B;iBACJ,CAAC,CAAC;gBACH,IAAI,QAAQ,CAAC,IAAI,EAAE;oBACf,WAAW,CAAC,IAAI,CAAC;wBACb,aAAa,EAAE,OAAO,CAAC,aAAa;wBACpC,OAAO,EAAE,OAAO,CAAC,OAAO;wBACxB,WAAW,EAAE,QAAQ,CAAC,IAAI;wBAC1B,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,KAAK;qBACrC,CAAC,CAAC;iBACN;qBAAM;oBACH,IAAI,CAAC,GAAG,CAAC,IAAI,CACT,0CAA0C,OAAO,CAAC,aAAa,aAAa,OAAO,CAAC,OAAO,EAAE,CAChG,CAAC;iBACL;aACJ;YACD,OAAO,WAAW,CAAC;QACvB,CAAC;KAAA;;AA/JL,4CAgKC;AA/J0B,qBAAI,GAAG,yCAAyC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { Annotations, ODataServiceInfo } from './base';
2
+ import { CatalogService } from './base';
3
+ export interface V4Service {
4
+ RepositoryId: string;
5
+ ServiceId: string;
6
+ ServiceVersion: string;
7
+ ServiceAlias: string;
8
+ Description: string;
9
+ ServiceUrl: string;
10
+ }
11
+ /**
12
+ * v4 Service Group
13
+ */
14
+ export interface ServiceGroup {
15
+ GroupId: string;
16
+ Description: string;
17
+ DefaultSystem: {
18
+ SystemAlias: string;
19
+ Description: string;
20
+ Services: V4Service[];
21
+ };
22
+ }
23
+ /**
24
+ * OData V4 specific implmentation of SAP's catalog service
25
+ */
26
+ export declare class V4CatalogService extends CatalogService {
27
+ static readonly PATH = "/sap/opu/odata4/iwfnd/config/default/iwfnd/catalog/0002";
28
+ /**
29
+ * Map the V4 service information to a version independent structure.
30
+ *
31
+ * @param groups v4 service groups
32
+ * @param entitySet entity set used for service selection
33
+ * @returns version independent information
34
+ */
35
+ protected mapServices(groups: ServiceGroup[], entitySet: string): ODataServiceInfo[];
36
+ /**
37
+ * Fetch all services from the backend.
38
+ *
39
+ * @returns version independent service information
40
+ */
41
+ protected fetchServices(): Promise<ODataServiceInfo[]>;
42
+ /**
43
+ * For OData v4, all annotations are already included in the metadata and no additional request is required.
44
+ *
45
+ * @returns an empty array
46
+ */
47
+ getAnnotations(): Promise<Annotations[]>;
48
+ }
49
+ //# sourceMappingURL=v4-catalog-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v4-catalog-service.d.ts","sourceRoot":"","sources":["../../../src/abap/catalog/v4-catalog-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAMxC,MAAM,WAAW,SAAS;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,SAAS,EAAE,CAAC;KACzB,CAAC;CACL;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAChD,gBAAuB,IAAI,6DAA6D;IAExF;;;;;;OAMG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAqBpF;;;;OAIG;cACa,aAAa,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyB5D;;;;OAIG;IACI,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAGlD"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.V4CatalogService = void 0;
13
+ const base_1 = require("./base");
14
+ const odata_service_1 = require("../../base/odata-service");
15
+ const V4_RECOMMENDED_ENTITYSET = 'RecommendedServices';
16
+ const V4_CLASSIC_ENTITYSET = 'Services';
17
+ /**
18
+ * OData V4 specific implmentation of SAP's catalog service
19
+ */
20
+ class V4CatalogService extends base_1.CatalogService {
21
+ /**
22
+ * Map the V4 service information to a version independent structure.
23
+ *
24
+ * @param groups v4 service groups
25
+ * @param entitySet entity set used for service selection
26
+ * @returns version independent information
27
+ */
28
+ mapServices(groups, entitySet) {
29
+ const services = [];
30
+ groups
31
+ .filter((group) => { var _a, _b; return ((_b = (_a = group === null || group === void 0 ? void 0 : group.DefaultSystem) === null || _a === void 0 ? void 0 : _a[entitySet]) === null || _b === void 0 ? void 0 : _b.length) > 0; })
32
+ .forEach((group) => {
33
+ services.push(...group.DefaultSystem[entitySet].map((service) => {
34
+ return {
35
+ id: service.ServiceId,
36
+ group: group.GroupId,
37
+ path: service.ServiceUrl.split('?').shift(),
38
+ name: `${group.GroupId} > ${service.ServiceAlias || service.ServiceId}`,
39
+ serviceVersion: service.ServiceVersion,
40
+ odataVersion: odata_service_1.ODataVersion.v4
41
+ };
42
+ }));
43
+ });
44
+ return services;
45
+ }
46
+ /**
47
+ * Fetch all services from the backend.
48
+ *
49
+ * @returns version independent service information
50
+ */
51
+ fetchServices() {
52
+ const _super = Object.create(null, {
53
+ get: { get: () => super.get }
54
+ });
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ if (this.entitySet === undefined) {
57
+ const metadata = yield this.metadata();
58
+ this.entitySet = metadata.includes('Name="RecommendedServices"')
59
+ ? V4_RECOMMENDED_ENTITYSET
60
+ : V4_CLASSIC_ENTITYSET;
61
+ }
62
+ const params = {
63
+ $count: true,
64
+ $expand: `DefaultSystem($expand=${this.entitySet})`
65
+ };
66
+ let response = yield this.get('/ServiceGroups', { params });
67
+ const serviceGroups = response.odata() || [];
68
+ // paging required
69
+ while (response.data['@odata.nextLink']) {
70
+ const nextLink = new URL(response.data['@odata.nextLink']);
71
+ response = yield _super.get.call(this, '/ServiceGroups', { params: Object.assign(Object.assign({}, params), nextLink.searchParams) });
72
+ serviceGroups.push(...response.odata());
73
+ }
74
+ return this.mapServices(serviceGroups, this.entitySet);
75
+ });
76
+ }
77
+ /**
78
+ * For OData v4, all annotations are already included in the metadata and no additional request is required.
79
+ *
80
+ * @returns an empty array
81
+ */
82
+ getAnnotations() {
83
+ return Promise.resolve([]);
84
+ }
85
+ }
86
+ exports.V4CatalogService = V4CatalogService;
87
+ V4CatalogService.PATH = '/sap/opu/odata4/iwfnd/config/default/iwfnd/catalog/0002';
88
+ //# sourceMappingURL=v4-catalog-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v4-catalog-service.js","sourceRoot":"","sources":["../../../src/abap/catalog/v4-catalog-service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iCAAwC;AACxC,4DAAwD;AAExD,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AACvD,MAAM,oBAAoB,GAAG,UAAU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AAwC;gBAChD,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,yBAAyB,IAAI,CAAC,SAAS,GAAG;aACtD,CAAC;YAEF,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAiB,gBAAgB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5E,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;YAE7C,kBAAkB;YAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE;gBACrC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;gBAC3D,QAAQ,GAAG,MAAM,OAAM,GAAG,YAAC,gBAAgB,EAAE,EAAE,MAAM,kCAAO,MAAM,GAAK,QAAQ,CAAC,YAAY,CAAE,EAAE,CAAC,CAAC;gBAClG,aAAa,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;aAC3C;YACD,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;KAAA;IAED;;;;OAIG;IACI,cAAc;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;;AApEL,4CAqEC;AApE0B,qBAAI,GAAG,yDAAyD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { Ui5AbapRepositoryService, AppInfo, ApplicationConfig } from './ui5-abap-repository-service';
2
+ export { AbapServiceProvider } from './abap-service-provider';
3
+ export { AppIndex, AppIndexService } from './app-index-service';
4
+ export { AtoSettings, TenantType, OperationsType } from './ato';
5
+ export * from './message';
6
+ export * from './catalog';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAChE,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.TenantType = exports.AppIndexService = exports.AbapServiceProvider = exports.Ui5AbapRepositoryService = void 0;
14
+ var ui5_abap_repository_service_1 = require("./ui5-abap-repository-service");
15
+ Object.defineProperty(exports, "Ui5AbapRepositoryService", { enumerable: true, get: function () { return ui5_abap_repository_service_1.Ui5AbapRepositoryService; } });
16
+ var abap_service_provider_1 = require("./abap-service-provider");
17
+ Object.defineProperty(exports, "AbapServiceProvider", { enumerable: true, get: function () { return abap_service_provider_1.AbapServiceProvider; } });
18
+ var app_index_service_1 = require("./app-index-service");
19
+ Object.defineProperty(exports, "AppIndexService", { enumerable: true, get: function () { return app_index_service_1.AppIndexService; } });
20
+ var ato_1 = require("./ato");
21
+ Object.defineProperty(exports, "TenantType", { enumerable: true, get: function () { return ato_1.TenantType; } });
22
+ __exportStar(require("./message"), exports);
23
+ __exportStar(require("./catalog"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abap/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6EAAqG;AAA5F,uIAAA,wBAAwB,OAAA;AACjC,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,yDAAgE;AAA7C,oHAAA,eAAe,OAAA;AAClC,6BAAgE;AAA1C,iGAAA,UAAU,OAAA;AAChC,4CAA0B;AAC1B,4CAA0B"}
@@ -0,0 +1,69 @@
1
+ import type { Logger } from '@sap-ux/logger';
2
+ /**
3
+ * Message detail object
4
+ */
5
+ export interface MessageDetail {
6
+ code: string;
7
+ message: string;
8
+ severity: string;
9
+ }
10
+ /**
11
+ * Structure of a Gateway response message
12
+ */
13
+ export interface SuccessMessage {
14
+ code: string;
15
+ message: string;
16
+ longtext_url?: string;
17
+ details: MessageDetail[];
18
+ }
19
+ /**
20
+ * Structure of a Gateway error
21
+ */
22
+ export interface ErrorMessage {
23
+ code: string;
24
+ message: {
25
+ lang?: string;
26
+ value: string;
27
+ };
28
+ longtext_url?: string;
29
+ innererror: {
30
+ transactionid: string;
31
+ timestamp: string;
32
+ Error_Resolution: object;
33
+ errordetails: MessageDetail[];
34
+ };
35
+ }
36
+ /**
37
+ * Log a Gateway response.
38
+ *
39
+ * @param options
40
+ * @param options.msg message returned from gateway
41
+ * @param options.log logger to be used
42
+ * @param options.host optional url that should logged as clickable url
43
+ */
44
+ export declare function prettyPrintMessage({ msg, log, host }: {
45
+ msg: SuccessMessage;
46
+ log: Logger;
47
+ host?: string;
48
+ }): void;
49
+ /**
50
+ * Log a Gateway error.
51
+ *
52
+ * @param options
53
+ * @param options.error error message returned from gateway
54
+ * @param options.log logger to be used
55
+ * @param options.host optional host name to pretty print links
56
+ */
57
+ export declare function prettyPrintError({ error, log, host }: {
58
+ error: ErrorMessage;
59
+ log: Logger;
60
+ host?: string;
61
+ }): void;
62
+ /**
63
+ * Print a user friendly time string.
64
+ *
65
+ * @param ms time in ms
66
+ * @returns user friendly string
67
+ */
68
+ export declare const prettyPrintTimeInMs: (ms: number) => string;
69
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/abap/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,MAAM,CAAC;QACzB,YAAY,EAAE,aAAa,EAAE,CAAC;KACjC,CAAC;CACL;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IAAE,GAAG,EAAE,cAAc,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQhH;AAkBD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,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