@dotdev/harmony-sdk 1.30.0 → 1.31.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.
package/dist/helpers/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export class ApiHelper {
|
|
|
28
28
|
size: +(response?.headers?.["content-length"] || 0),
|
|
29
29
|
status: response?.status,
|
|
30
30
|
},
|
|
31
|
-
}, `Received Harmony response 🔽`);
|
|
31
|
+
}, `Received Harmony response for ${endpoint} endpoint 🔽`);
|
|
32
32
|
// Throw an error if the response is not in XML format
|
|
33
33
|
if (response?.headers["content-type"] !== "text/xml" &&
|
|
34
34
|
response?.headers["content-type"] !== "text/xml;charset=utf-8" &&
|
|
@@ -93,7 +93,7 @@ export class ApiHelper {
|
|
|
93
93
|
const child = logger.child({
|
|
94
94
|
request: requestBody,
|
|
95
95
|
});
|
|
96
|
-
child.debug(`Sending API request`);
|
|
96
|
+
child.debug(`Sending API request to ${serviceName} endpoint`);
|
|
97
97
|
const response = await ApiHelper.sendSoapRequest(serviceName, axios, requestBody);
|
|
98
98
|
return response[responseMethodName][0];
|
|
99
99
|
}
|
|
@@ -102,6 +102,7 @@ export function mapStock(src) {
|
|
|
102
102
|
sellEndDate: (src?.sell_end_date ?? [])[0],
|
|
103
103
|
deliverFromDate: (src?.deliver_from_date ?? [])[0],
|
|
104
104
|
isoCountryOfOrigin: (src?.iso_country_of_origin ?? [])[0],
|
|
105
|
+
tariffCode: (src?.tariff_code ?? [])[0],
|
|
105
106
|
stockActive: (src?.stock_active ?? [])[0],
|
|
106
107
|
alternateNamekey: (src?.alternate_namekey ?? [])[0],
|
|
107
108
|
size: (src?.size ?? [])[0],
|
|
@@ -367,6 +367,7 @@ describe("StockLookup", () => {
|
|
|
367
367
|
<sell_end_date></sell_end_date>
|
|
368
368
|
<deliver_from_date></deliver_from_date>
|
|
369
369
|
<iso_country_of_origin></iso_country_of_origin>
|
|
370
|
+
<tariff_code>6204.33.00</tariff_code>
|
|
370
371
|
<size>6</size>
|
|
371
372
|
<pack></pack>
|
|
372
373
|
</Stock>
|
|
@@ -425,6 +426,7 @@ describe("StockLookup", () => {
|
|
|
425
426
|
sellEndDate: "",
|
|
426
427
|
deliverFromDate: "",
|
|
427
428
|
isoCountryOfOrigin: "",
|
|
429
|
+
tariffCode: "6204.33.00",
|
|
428
430
|
size: "6",
|
|
429
431
|
pack: "",
|
|
430
432
|
stockActive: undefined,
|
|
@@ -181,6 +181,7 @@ export interface Stock {
|
|
|
181
181
|
sellEndDate: string;
|
|
182
182
|
deliverFromDate: string;
|
|
183
183
|
isoCountryOfOrigin: string;
|
|
184
|
+
tariffCode: string;
|
|
184
185
|
size?: string;
|
|
185
186
|
pack?: string;
|
|
186
187
|
stockActive?: string;
|
|
@@ -232,6 +233,7 @@ export interface StockRaw {
|
|
|
232
233
|
sell_end_date: string[];
|
|
233
234
|
deliver_from_date: string[];
|
|
234
235
|
iso_country_of_origin: string[];
|
|
236
|
+
tariff_code: string[];
|
|
235
237
|
size: string[];
|
|
236
238
|
pack: string[];
|
|
237
239
|
stock_active: string[];
|