@sap-ux/axios-extension 1.16.5 → 1.16.7
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/lrep-service.d.ts +10 -2
- package/dist/abap/lrep-service.js +10 -2
- package/dist/abap/message.js +5 -5
- package/dist/abap/ui5-abap-repository-service.d.ts +0 -1
- package/dist/auth/connection.js +2 -2
- package/dist/auth/index.js +5 -5
- package/dist/auth/reentrance-ticket/index.js +1 -2
- package/dist/auth/reentrance-ticket/redirect.d.ts +0 -1
- package/dist/auth/reentrance-ticket/redirect.js +1 -2
- package/dist/base/odata-request-error.js +2 -2
- package/dist/factory.js +6 -6
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { Service } from '../base/service-provider';
|
|
3
2
|
import type { AxiosResponse } from 'axios';
|
|
4
3
|
import { Axios } from 'axios';
|
|
@@ -54,6 +53,14 @@ export interface MergedAppDescriptor {
|
|
|
54
53
|
final: boolean;
|
|
55
54
|
};
|
|
56
55
|
}[];
|
|
56
|
+
components: {
|
|
57
|
+
name: string;
|
|
58
|
+
lazy?: boolean;
|
|
59
|
+
url?: {
|
|
60
|
+
url: string;
|
|
61
|
+
final: boolean;
|
|
62
|
+
};
|
|
63
|
+
}[];
|
|
57
64
|
requests?: unknown[];
|
|
58
65
|
};
|
|
59
66
|
}
|
|
@@ -109,9 +116,10 @@ export declare class LayeredRepositoryService extends Axios implements Service {
|
|
|
109
116
|
* Merge a given app descriptor variant with the stord app descriptor.
|
|
110
117
|
*
|
|
111
118
|
* @param appDescriptorVariant zip file containing an app descriptor variant
|
|
119
|
+
* @param workspacePath value for workspacePath URL parameter
|
|
112
120
|
* @returns a promise with an object containing merged app descriptors with their id as keys.
|
|
113
121
|
*/
|
|
114
|
-
mergeAppDescriptorVariant(appDescriptorVariant: Buffer): Promise<{
|
|
122
|
+
mergeAppDescriptorVariant(appDescriptorVariant: Buffer, workspacePath?: string): Promise<{
|
|
115
123
|
[key: string]: MergedAppDescriptor;
|
|
116
124
|
}>;
|
|
117
125
|
/**
|
|
@@ -62,11 +62,19 @@ class LayeredRepositoryService extends axios_1.Axios {
|
|
|
62
62
|
* Merge a given app descriptor variant with the stord app descriptor.
|
|
63
63
|
*
|
|
64
64
|
* @param appDescriptorVariant zip file containing an app descriptor variant
|
|
65
|
+
* @param workspacePath value for workspacePath URL parameter
|
|
65
66
|
* @returns a promise with an object containing merged app descriptors with their id as keys.
|
|
66
67
|
*/
|
|
67
|
-
async mergeAppDescriptorVariant(appDescriptorVariant) {
|
|
68
|
+
async mergeAppDescriptorVariant(appDescriptorVariant, workspacePath) {
|
|
69
|
+
const path = '/appdescr_variant_preview/';
|
|
70
|
+
const params = new URLSearchParams(this.defaults?.params);
|
|
71
|
+
if (workspacePath) {
|
|
72
|
+
params.append('workspacePath', workspacePath);
|
|
73
|
+
}
|
|
68
74
|
try {
|
|
69
|
-
const response = await this.put(
|
|
75
|
+
const response = await this.put(path, appDescriptorVariant, {
|
|
76
|
+
paramsSerializer: (params) => decodeURIComponent(params.toString()),
|
|
77
|
+
params,
|
|
70
78
|
headers: {
|
|
71
79
|
'Content-Type': 'application/zip'
|
|
72
80
|
}
|
package/dist/abap/message.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.prettyPrintTimeInMs = void 0;
|
|
4
|
+
exports.prettyPrintMessage = prettyPrintMessage;
|
|
5
|
+
exports.prettyPrintError = prettyPrintError;
|
|
6
|
+
exports.logError = logError;
|
|
7
|
+
exports.getErrorMessageFromString = getErrorMessageFromString;
|
|
4
8
|
const url_1 = require("url");
|
|
5
9
|
const axios_1 = require("axios");
|
|
6
10
|
/**
|
|
@@ -52,7 +56,6 @@ function prettyPrintMessage({ msg, log, host, isDest = false }) {
|
|
|
52
56
|
log.debug(msg);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
|
-
exports.prettyPrintMessage = prettyPrintMessage;
|
|
56
59
|
/**
|
|
57
60
|
* @param root0 root0
|
|
58
61
|
* @param root0.host hostname
|
|
@@ -101,7 +104,6 @@ function prettyPrintError({ error, log, host, isDest }, showAllMessages = true)
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
|
-
exports.prettyPrintError = prettyPrintError;
|
|
105
107
|
/**
|
|
106
108
|
* Print a user friendly time string.
|
|
107
109
|
*
|
|
@@ -142,7 +144,6 @@ function logError({ error, host, log, isDest }) {
|
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
|
-
exports.logError = logError;
|
|
146
147
|
/**
|
|
147
148
|
* Get ErrorMessage object from response contain an error as a string.
|
|
148
149
|
*
|
|
@@ -164,5 +165,4 @@ function getErrorMessageFromString(data) {
|
|
|
164
165
|
}
|
|
165
166
|
return error;
|
|
166
167
|
}
|
|
167
|
-
exports.getErrorMessageFromString = getErrorMessageFromString;
|
|
168
168
|
//# sourceMappingURL=message.js.map
|
package/dist/auth/connection.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.Cookies = exports.defaultTimeout = exports.CSRF = void 0;
|
|
7
|
+
exports.attachConnectionHandler = attachConnectionHandler;
|
|
7
8
|
const axios_1 = require("axios");
|
|
8
9
|
const detect_content_type_1 = __importDefault(require("detect-content-type"));
|
|
9
10
|
var CSRF;
|
|
@@ -181,5 +182,4 @@ function attachConnectionHandler(provider) {
|
|
|
181
182
|
return response;
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
|
-
exports.attachConnectionHandler = attachConnectionHandler;
|
|
185
185
|
//# sourceMappingURL=connection.js.map
|
package/dist/auth/index.js
CHANGED
|
@@ -14,7 +14,11 @@ 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.
|
|
17
|
+
exports.Uaa = void 0;
|
|
18
|
+
exports.attachBasicAuthInterceptor = attachBasicAuthInterceptor;
|
|
19
|
+
exports.attachUaaAuthInterceptor = attachUaaAuthInterceptor;
|
|
20
|
+
exports.attachReentranceTicketAuthInterceptor = attachReentranceTicketAuthInterceptor;
|
|
21
|
+
exports.getReentranceTicketAuthInterceptor = getReentranceTicketAuthInterceptor;
|
|
18
22
|
const axios_1 = require("axios");
|
|
19
23
|
const reentrance_ticket_1 = require("./reentrance-ticket");
|
|
20
24
|
const uaa_1 = require("./uaa");
|
|
@@ -31,7 +35,6 @@ function attachBasicAuthInterceptor(provider) {
|
|
|
31
35
|
return response;
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
|
-
exports.attachBasicAuthInterceptor = attachBasicAuthInterceptor;
|
|
35
38
|
/**
|
|
36
39
|
* @param provider Abap Service Provider
|
|
37
40
|
* @param service Service Information
|
|
@@ -59,7 +62,6 @@ function attachUaaAuthInterceptor(provider, service, refreshToken, refreshTokenU
|
|
|
59
62
|
return request;
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
exports.attachUaaAuthInterceptor = attachUaaAuthInterceptor;
|
|
63
65
|
/**
|
|
64
66
|
* Get the reentrace ticket from the backend and add it to the header.
|
|
65
67
|
*
|
|
@@ -73,7 +75,6 @@ function attachReentranceTicketAuthInterceptor({ provider }) {
|
|
|
73
75
|
const ejectCallback = () => provider.interceptors.request.eject(oneTimeInterceptorId);
|
|
74
76
|
oneTimeInterceptorId = provider.interceptors.request.use(getReentranceTicketAuthInterceptor({ provider, ejectCallback }));
|
|
75
77
|
}
|
|
76
|
-
exports.attachReentranceTicketAuthInterceptor = attachReentranceTicketAuthInterceptor;
|
|
77
78
|
/**
|
|
78
79
|
* Get the interceptor that fetches and uses reentrance tickets from the backend.
|
|
79
80
|
*
|
|
@@ -101,5 +102,4 @@ function getReentranceTicketAuthInterceptor({ provider, ejectCallback }) {
|
|
|
101
102
|
return request;
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
exports.getReentranceTicketAuthInterceptor = getReentranceTicketAuthInterceptor;
|
|
105
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReentranceTicket =
|
|
3
|
+
exports.getReentranceTicket = getReentranceTicket;
|
|
4
4
|
const open = require("open");
|
|
5
5
|
const connection_1 = require("../connection");
|
|
6
6
|
const abap_system_1 = require("./abap-system");
|
|
@@ -31,5 +31,4 @@ async function getReentranceTicket({ backendUrl, logger, timeout = connection_1.
|
|
|
31
31
|
open(url)?.catch((error) => logger.error(error));
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
exports.getReentranceTicket = getReentranceTicket;
|
|
35
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setupRedirectHandling =
|
|
6
|
+
exports.setupRedirectHandling = setupRedirectHandling;
|
|
7
7
|
const http_1 = __importDefault(require("http"));
|
|
8
8
|
const error_1 = require("../error");
|
|
9
9
|
const message_1 = require("../../abap/message");
|
|
@@ -56,5 +56,4 @@ function setupRedirectHandling({ resolve, reject, timeout, backend, logger }) {
|
|
|
56
56
|
redirectUrl: (port) => `http://localhost:${port}${REDIRECT_PATH}`
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
exports.setupRedirectHandling = setupRedirectHandling;
|
|
60
59
|
//# sourceMappingURL=redirect.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ODataRequestError =
|
|
3
|
+
exports.ODataRequestError = void 0;
|
|
4
|
+
exports.isAxiosError = isAxiosError;
|
|
4
5
|
/**
|
|
5
6
|
* Type guard to narrow an unknown exception to the AxiosError type if it is compatible.
|
|
6
7
|
*
|
|
@@ -10,7 +11,6 @@ exports.ODataRequestError = exports.isAxiosError = void 0;
|
|
|
10
11
|
function isAxiosError(e) {
|
|
11
12
|
return typeof e === 'object' && e !== null && 'isAxiosError' in e;
|
|
12
13
|
}
|
|
13
|
-
exports.isAxiosError = isAxiosError;
|
|
14
14
|
/**
|
|
15
15
|
* Error object that is to be thrown if an OData service responds with an error
|
|
16
16
|
*/
|
package/dist/factory.js
CHANGED
|
@@ -3,7 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.AbapCloudEnvironment = void 0;
|
|
7
|
+
exports.create = create;
|
|
8
|
+
exports.createForAbap = createForAbap;
|
|
9
|
+
exports.createForAbapOnCloud = createForAbapOnCloud;
|
|
10
|
+
exports.createForDestination = createForDestination;
|
|
11
|
+
exports.createServiceForUrl = createServiceForUrl;
|
|
7
12
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
8
13
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
9
14
|
const https_1 = require("https");
|
|
@@ -73,7 +78,6 @@ function create(config) {
|
|
|
73
78
|
return createInstance(service_provider_1.ServiceProvider, config);
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
|
-
exports.create = create;
|
|
77
81
|
/**
|
|
78
82
|
* Create an instance of an ABAP service provider.
|
|
79
83
|
*
|
|
@@ -83,7 +87,6 @@ exports.create = create;
|
|
|
83
87
|
function createForAbap(config) {
|
|
84
88
|
return createInstance(abap_1.AbapServiceProvider, config);
|
|
85
89
|
}
|
|
86
|
-
exports.createForAbap = createForAbap;
|
|
87
90
|
/** Supported ABAP environments on the cloud */
|
|
88
91
|
var AbapCloudEnvironment;
|
|
89
92
|
(function (AbapCloudEnvironment) {
|
|
@@ -129,7 +132,6 @@ function createForAbapOnCloud(options) {
|
|
|
129
132
|
}
|
|
130
133
|
return provider;
|
|
131
134
|
}
|
|
132
|
-
exports.createForAbapOnCloud = createForAbapOnCloud;
|
|
133
135
|
/**
|
|
134
136
|
* Create an instance of a service provider for the given destination.
|
|
135
137
|
*
|
|
@@ -168,7 +170,6 @@ function createForDestination(options, destination, destinationServiceInstance)
|
|
|
168
170
|
}
|
|
169
171
|
return provider;
|
|
170
172
|
}
|
|
171
|
-
exports.createForDestination = createForDestination;
|
|
172
173
|
/**
|
|
173
174
|
* Create an instance of a basic service provider and then generate an extension for a service based on the given url.
|
|
174
175
|
*
|
|
@@ -187,5 +188,4 @@ function createServiceForUrl(url, config = {}) {
|
|
|
187
188
|
const provider = createInstance(service_provider_1.ServiceProvider, config);
|
|
188
189
|
return provider.service(urlObject.pathname);
|
|
189
190
|
}
|
|
190
|
-
exports.createServiceForUrl = createServiceForUrl;
|
|
191
191
|
//# sourceMappingURL=factory.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/axios-extension",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.7",
|
|
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.28.2"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|