Comparing version 0.4.16 to 0.4.17
# ae_sdk | ||
## 0.4.17 | ||
### Patch Changes | ||
- Normalize AE API's (`aliexpress.logistics.buyer.freight.get` endpoint) response for a product's freight info. | ||
```ts | ||
await client.freightInfo({ | ||
country_code: "DZ", | ||
send_goods_country_code: "CN", | ||
product_id: 123456, | ||
product_num: 1, | ||
}); | ||
``` | ||
## 0.4.16 | ||
@@ -4,0 +19,0 @@ |
@@ -1128,10 +1128,15 @@ type AE_API_NAMES = DS_API_NAMES | AFFILIATE_API_NAMES | SYSTEM_API_NAMES; | ||
} | ||
interface DS_Freight_Calculation_Response { | ||
result: { | ||
aeop_freight_calculate_result_for_buyer_dtolist: DS_Freight_Calculation[]; | ||
type DS_Freight_Calculation_Response = { | ||
aeop_freight_calculate_result_for_buyer_dtolist: DS_Freight_Calculation[]; | ||
success: true; | ||
} | { | ||
success: false; | ||
error_desc: string; | ||
}; | ||
interface DS_Freight_Calculation_Result { | ||
aliexpress_logistics_buyer_freight_get_response: { | ||
result: DS_Freight_Calculation_Response; | ||
request_id: string; | ||
}; | ||
} | ||
interface DS_Freight_Calculation_Result { | ||
aliexpress_logistics_buyer_freight_get_response: DS_Freight_Calculation_Response; | ||
} | ||
/** | ||
@@ -1439,2 +1444,3 @@ * DROPSHIPPER API | ||
/** | ||
* AE API endpoint: `aliexpress.logistics.buyer.freight.get` | ||
* @link https://openservice.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.buyer.freight.get&methodType=GET/POST | ||
@@ -1441,0 +1447,0 @@ */ |
@@ -429,2 +429,3 @@ "use strict"; | ||
/** | ||
* AE API endpoint: `aliexpress.logistics.buyer.freight.get` | ||
* @link https://openservice.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.buyer.freight.get&methodType=GET/POST | ||
@@ -434,5 +435,15 @@ */ | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.logistics.buyer.freight.get", { | ||
aeopFreightCalculateForBuyerDTO: JSON.stringify(args) | ||
}); | ||
let response = yield this.execute( | ||
"aliexpress.logistics.buyer.freight.get", | ||
{ | ||
aeopFreightCalculateForBuyerDTO: JSON.stringify(args) | ||
} | ||
); | ||
if (response.ok) { | ||
const data = response.data.aliexpress_logistics_buyer_freight_get_response; | ||
if (data.result.success && data.result.aeop_freight_calculate_result_for_buyer_dtolist.aeop_freight_calculate_result_for_buyer_d_t_o) { | ||
data.result.aeop_freight_calculate_result_for_buyer_dtolist = data.result.aeop_freight_calculate_result_for_buyer_dtolist.aeop_freight_calculate_result_for_buyer_d_t_o; | ||
} | ||
} | ||
return response; | ||
}); | ||
@@ -439,0 +450,0 @@ } |
{ | ||
"name": "ae_sdk", | ||
"version": "0.4.16", | ||
"version": "0.4.17", | ||
"description": "A simple SDK for Aliexpress (dropshipping and affiliate) APIs.", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157750
2828