@dotdev/harmony-sdk 1.10.2 → 1.10.4
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/helpers/index.js +8 -3
- package/package.json +1 -1
package/dist/helpers/index.js
CHANGED
|
@@ -9,8 +9,13 @@ export class ApiHelper {
|
|
|
9
9
|
static async sendSoapRequest(endpoint, axiosInstance, requestBody, type = "POST") {
|
|
10
10
|
const url = `${endpoint}?wsdl`;
|
|
11
11
|
let response;
|
|
12
|
+
axiosInstance.interceptors.response.use((response) => {
|
|
13
|
+
console.log(`logged by intercepter`);
|
|
14
|
+
console.log(response);
|
|
15
|
+
return response;
|
|
16
|
+
});
|
|
12
17
|
try {
|
|
13
|
-
let response;
|
|
18
|
+
// let response;
|
|
14
19
|
switch (type) {
|
|
15
20
|
case "GET":
|
|
16
21
|
response = await axiosInstance.get(url, {
|
|
@@ -26,12 +31,12 @@ export class ApiHelper {
|
|
|
26
31
|
});
|
|
27
32
|
break;
|
|
28
33
|
}
|
|
29
|
-
console.log(`Response from Harmony: `, { response });
|
|
34
|
+
console.log(`Response from Harmony (try): `, { response });
|
|
30
35
|
const result = (await parseXml(response?.data)); // fix type
|
|
31
36
|
return result["S:Envelope"]["S:Body"][0];
|
|
32
37
|
}
|
|
33
38
|
catch (error) {
|
|
34
|
-
console.error(`Response from Harmony: `, { response });
|
|
39
|
+
console.error(`Response from Harmony (catch): `, { response });
|
|
35
40
|
throw await ApiHelper.parseError(error);
|
|
36
41
|
}
|
|
37
42
|
}
|