@dotdev/harmony-sdk 1.13.0 → 1.15.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.
@@ -9,20 +9,27 @@ export class ApiHelper {
9
9
  static async sendSoapRequest(endpoint, axiosInstance, requestBody, type = "POST") {
10
10
  const url = `${endpoint}?wsdl`;
11
11
  let response;
12
+ let defaultConfig = {
13
+ headers: {
14
+ 'Accept-Encoding': 'gzip, deflate, br' //Override default Accept-Encoding
15
+ }
16
+ };
12
17
  try {
13
18
  let response;
14
19
  switch (type) {
15
20
  case "GET":
16
21
  response = await axiosInstance.get(url, {
22
+ ...defaultConfig,
17
23
  params: {},
18
24
  });
19
25
  break;
20
26
  case "POST":
21
27
  default:
22
28
  response = await axiosInstance.post(url, requestBody, {
23
- // headers: {
24
- // 'SOAPAction': request.action
25
- // }
29
+ ...defaultConfig
30
+ // headers: {
31
+ // 'SOAPAction': request.action
32
+ // }
26
33
  });
27
34
  break;
28
35
  }
@@ -3,7 +3,7 @@ export function mapProcessSaleOrderQueryParams(params) {
3
3
  // XML body in JSON format, to be converted to XML string
4
4
  const body = {
5
5
  ...mapProcessSaleOrderBaseQueryParams(params),
6
- debtor: mapProcessSaleOrderQueryDebtor((params?.debtor ?? [])[0]),
6
+ debtor: (params?.debtor ?? []).map(mapProcessSaleOrderQueryDebtor),
7
7
  };
8
8
  return Utils.toXml(Utils.deleteEmptyProps(body));
9
9
  }
@@ -12,7 +12,7 @@ export function mapProcessInvoiceQueryParams(params) {
12
12
  const body = {
13
13
  ...mapProcessSaleOrderBaseQueryParams(params),
14
14
  invoice: mapPosInvoiceQuery(params),
15
- debtor: mapProcessSaleOrderQueryDebtor((params?.debtor ?? [])[0]),
15
+ debtor: (params?.debtor ?? []).map(mapProcessSaleOrderQueryDebtor),
16
16
  };
17
17
  return Utils.toXml(Utils.deleteEmptyProps(body));
18
18
  }
@@ -60,7 +60,7 @@ export class PointOfSaleModule {
60
60
  if (method === "ProcessSalesOrder" || method === "ProcessInvoice") {
61
61
  body = {
62
62
  ...body,
63
- debtor: mapProcessSaleOrderQueryDebtor((params?.debtor ?? [])[0]),
63
+ debtor: (params?.debtor ?? []).map(mapProcessSaleOrderQueryDebtor),
64
64
  };
65
65
  }
66
66
  const soapBodyJson = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotdev/harmony-sdk",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "Harmony API SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",