Comparing version 0.4.5 to 0.4.6
# ae_sdk | ||
## 0.4.6 | ||
### Patch Changes | ||
- Ensure API returns predefined types | ||
## 0.4.5 | ||
@@ -4,0 +10,0 @@ |
@@ -65,2 +65,17 @@ "use strict"; | ||
// src/utils/index.ts | ||
var parse_affiliate_products = (data) => { | ||
var _a; | ||
if (data.resp_result.result.products.product) | ||
data.resp_result.result.products = data.resp_result.result.products.product; | ||
if (((_a = data.resp_result.result.products[0]) == null ? void 0 : _a.product_small_image_urls).string) | ||
data.resp_result.result.products = data.resp_result.result.products.map( | ||
(product) => { | ||
product.product_small_image_urls = product.product_small_image_urls.string; | ||
return product; | ||
} | ||
); | ||
return data; | ||
}; | ||
// src/utils/client.ts | ||
@@ -222,3 +237,9 @@ var import_crypto = require("crypto"); | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.affiliate.category.get", args); | ||
let response = yield this.execute( | ||
"aliexpress.affiliate.category.get", | ||
args | ||
); | ||
if (response.ok && response.data.aliexpress_affiliate_category_get_response.resp_result.result.categories.category) | ||
response.data.aliexpress_affiliate_category_get_response.resp_result.result.categories = response.data.aliexpress_affiliate_category_get_response.resp_result.result.categories.category; | ||
return response; | ||
}); | ||
@@ -266,3 +287,12 @@ } | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.affiliate.hotproduct.query", args); | ||
let response = yield this.execute( | ||
"aliexpress.affiliate.hotproduct.query", | ||
args | ||
); | ||
if (response.ok) { | ||
response.data.aliexpress_affiliate_hotproduct_query_response = parse_affiliate_products( | ||
response.data.aliexpress_affiliate_hotproduct_query_response | ||
); | ||
} | ||
return response; | ||
}); | ||
@@ -309,3 +339,12 @@ } | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.affiliate.product.query", args); | ||
let response = yield this.execute( | ||
"aliexpress.affiliate.product.query", | ||
args | ||
); | ||
if (response.ok) { | ||
response.data.aliexpress_affiliate_product_query_response = parse_affiliate_products( | ||
response.data.aliexpress_affiliate_product_query_response | ||
); | ||
} | ||
return response; | ||
}); | ||
@@ -333,5 +372,11 @@ } | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.logistics.buyer.freight.calculate", { | ||
param_aeop_freight_calculate_for_buyer_d_t_o: JSON.stringify(args) | ||
}); | ||
let response = yield this.execute( | ||
"aliexpress.logistics.buyer.freight.calculate", | ||
{ | ||
param_aeop_freight_calculate_for_buyer_d_t_o: JSON.stringify(args) | ||
} | ||
); | ||
if (response.ok && response.data.aliexpress_logistics_buyer_freight_calculate_response.result.success && response.data.aliexpress_logistics_buyer_freight_calculate_response.result.aeop_freight_calculate_result_for_buyer_d_t_o_list.aeop_freight_calculate_result_for_buyer_dto) | ||
response.data.aliexpress_logistics_buyer_freight_calculate_response.result.aeop_freight_calculate_result_for_buyer_d_t_o_list = response.data.aliexpress_logistics_buyer_freight_calculate_response.result.aeop_freight_calculate_result_for_buyer_d_t_o_list.aeop_freight_calculate_result_for_buyer_dto; | ||
return response; | ||
}); | ||
@@ -338,0 +383,0 @@ } |
{ | ||
"name": "ae_sdk", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"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
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
150096
2569