Comparing version 0.4.10 to 0.4.11
# ae_sdk | ||
## 0.4.11 | ||
### Patch Changes | ||
- Fix API sign method bug to support the [new AE API signing format](https://openservice.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=1386) | ||
- Ensure API returns predefined types for AE dropshipping API | ||
## 0.4.10 | ||
@@ -4,0 +11,0 @@ |
@@ -237,4 +237,4 @@ type AE_API_NAMES = DS_API_NAMES | AFFILIATE_API_NAMES | SYSTEM_API_NAMES; | ||
interface Affiliate_Base_Products_Cursor { | ||
products: Affiliate_Base_Product_Details[]; | ||
current_record_count: number; | ||
products?: Affiliate_Base_Product_Details[]; | ||
current_record_count?: number; | ||
current_page_no?: number; | ||
@@ -446,8 +446,9 @@ total_page_no?: number; | ||
} | ||
interface Affiliate_Featuredpromo_Info_Response { | ||
resp_code?: number; | ||
resp_msg?: string; | ||
result: Affiliate_Featuredpromo_Info; | ||
} | ||
interface Affiliate_Featuredpromo_Info_Result { | ||
aliexpress_affiliate_featuredpromo_get_response: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Featuredpromo_Info; | ||
}; | ||
aliexpress_affiliate_featuredpromo_get_response: Affiliate_Featuredpromo_Info_Response; | ||
} | ||
@@ -591,13 +592,2 @@ /** | ||
*/ | ||
/** | ||
* Parameters to get the recommended products information feed | ||
* @param {String} feed_name | ||
* @param {String} category_id Category ID, you can get category ID via "get category" API https://developers.aliexpress.com/en/doc.htm?docId=45801&docType=2 | ||
* @param {Number} page_no Page number | ||
* @param {String} sort sort by:priceAsc,priceDesc,volumeAsc、volumeDesc, discountAsc, discountDesc, DSRratingAsc,DSRratingDesc, | ||
* @param {Number} page_size record count of each page, 1 - 50 | ||
* @param {String} target_language target language:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN | ||
* @param {String} target_currency target currency:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW | ||
* @param {String} country screens the subject product library for the target country | ||
*/ | ||
interface DS_Recommended_Products_Params { | ||
@@ -622,43 +612,4 @@ country?: string; | ||
} | ||
interface DS_Recommended_Product { | ||
lastest_volume: number; | ||
seller_id: number; | ||
target_sale_price: string; | ||
evaluate_rate: string; | ||
target_original_price: string; | ||
shop_id: number; | ||
second_level_category_name: string; | ||
first_level_category_id: number; | ||
product_video_url: string; | ||
product_id: number; | ||
sale_price: string; | ||
target_sale_price_currency: AE_Currency; | ||
second_level_category_id: number; | ||
shop_url: string; | ||
product_detail_url: string; | ||
product_title: string; | ||
first_level_category_name: string; | ||
product_main_image_url: string; | ||
platform_product_type: AE_Platform_Type; | ||
target_original_price_currency: AE_Currency; | ||
ship_to_days: string; | ||
sale_price_currency: AE_Currency; | ||
original_price: string; | ||
original_price_currency: AE_Currency; | ||
discount: string; | ||
} | ||
interface DS_Recommended_Products { | ||
total_record_count: number; | ||
current_record_count: number; | ||
is_finished: boolean; | ||
total_page_no: number; | ||
current_page_no: number; | ||
products: DS_Recommended_Product[]; | ||
} | ||
interface DS_Recommended_Products_Result { | ||
aliexpress_ds_recommend_feed_get_response: { | ||
result: DS_Recommended_Products; | ||
rsp_msg?: string; | ||
rsp_code: string; | ||
}; | ||
aliexpress_ds_recommend_feed_get_response: Affiliate_Base_Products_Cursor_Response; | ||
} | ||
@@ -671,19 +622,4 @@ /** | ||
} | ||
interface DS_Feedname_Promo_Details { | ||
promo_name: string; | ||
promo_desc: string; | ||
product_num: number; | ||
} | ||
interface DS_Feedname { | ||
current_record_count: number; | ||
promos: DS_Feedname_Promo_Details[]; | ||
} | ||
interface DS_Feedname_Result { | ||
aliexpress_ds_feedname_get_response: { | ||
resp_result: { | ||
result: DS_Feedname; | ||
resp_code: number; | ||
resp_msg: string; | ||
}; | ||
}; | ||
aliexpress_ds_feedname_get_response: Affiliate_Featuredpromo_Info_Response; | ||
} | ||
@@ -708,12 +644,7 @@ /** | ||
} | ||
interface DS_Image_Search { | ||
products: DS_Recommended_Product[]; | ||
total_record_count: number; | ||
} | ||
interface DS_Image_Search_Result { | ||
aliexpress_ds_image_search_response: { | ||
data: DS_Image_Search; | ||
data: Affiliate_Base_Products_Cursor; | ||
rsp_code: string; | ||
rsp_msg: string; | ||
total_record_count: number; | ||
}; | ||
@@ -720,0 +651,0 @@ } |
@@ -67,8 +67,7 @@ "use strict"; | ||
var parse_affiliate_products = (input) => { | ||
var _a, _b; | ||
let data = (_a = input.resp_result) == null ? void 0 : _a.result.products; | ||
if (data && data.product) | ||
data = data.product; | ||
if ((data && ((_b = data[0]) == null ? void 0 : _b.product_small_image_urls)).string) { | ||
data = data == null ? void 0 : data.map((product) => { | ||
var _a; | ||
if (input && input.product) | ||
input = input.product; | ||
if ((input && ((_a = input[0]) == null ? void 0 : _a.product_small_image_urls)).string) { | ||
input = input == null ? void 0 : input.map((product) => { | ||
product.product_small_image_urls = product.product_small_image_urls.string; | ||
@@ -96,7 +95,9 @@ return product; | ||
sign(params) { | ||
const p = JSON.parse(JSON.stringify(params)); | ||
let basestring = ""; | ||
let sorted = Object.keys(params).sort(); | ||
for (let i = 0; i < sorted.length; i++) { | ||
basestring += sorted[i] + params[sorted[i]]; | ||
if (p.method.includes("/")) { | ||
basestring = p.method; | ||
delete p.method; | ||
} | ||
basestring += Object.keys(p).sort().map((key) => key + p[key]).join(""); | ||
return (0, import_crypto.createHmac)("sha256", this.app_secret, { encoding: "utf-8" }).update(basestring).digest("hex").toUpperCase(); | ||
@@ -293,3 +294,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_featuredpromo_products_get_response; | ||
let data = response.data.aliexpress_affiliate_featuredpromo_products_get_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -312,3 +313,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_hotproduct_download_response; | ||
let data = response.data.aliexpress_affiliate_hotproduct_download_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -331,3 +332,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_hotproduct_query_response; | ||
let data = response.data.aliexpress_affiliate_hotproduct_query_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -374,3 +375,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_productdetail_get_response; | ||
let data = response.data.aliexpress_affiliate_productdetail_get_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -391,3 +392,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_product_query_response; | ||
let data = response.data.aliexpress_affiliate_product_query_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -408,3 +409,3 @@ } | ||
if (response.ok) { | ||
let data = response.data.aliexpress_affiliate_product_smartmatch_response; | ||
let data = response.data.aliexpress_affiliate_product_smartmatch_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
@@ -473,3 +474,9 @@ } | ||
// async searchByImage(args: DS_Image_Search_Params) { | ||
// return await this.execute("aliexpress.ds.image.search", args); | ||
// let response = await this.execute("aliexpress.ds.image.search", args); | ||
// if (response.ok) { | ||
// let data = | ||
// response.data.aliexpress_ds_image_search_response.data.products; | ||
// data = parse_affiliate_products(data); | ||
// } | ||
// return response; | ||
// } | ||
@@ -481,3 +488,8 @@ /** | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.ds.recommend.feed.get", args); | ||
let response = yield this.execute("aliexpress.ds.recommend.feed.get", args); | ||
if (response.ok) { | ||
let data = response.data.aliexpress_ds_recommend_feed_get_response.resp_result.result.products; | ||
data = parse_affiliate_products(data); | ||
} | ||
return response; | ||
}); | ||
@@ -532,3 +544,10 @@ } | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.ds.feedname.get", args); | ||
let response = yield this.execute("aliexpress.ds.feedname.get", args); | ||
if (response.ok) { | ||
let data = response.data.aliexpress_ds_feedname_get_response.result.promos; | ||
if (data.promo) { | ||
data = data.promo; | ||
} | ||
} | ||
return response; | ||
}); | ||
@@ -542,4 +561,7 @@ } | ||
let response = yield this.execute("aliexpress.ds.category.get", args); | ||
if (response.ok && response.data.aliexpress_ds_category_get_response.resp_result.result.categories.category) | ||
response.data.aliexpress_ds_category_get_response.resp_result.result.categories = response.data.aliexpress_ds_category_get_response.resp_result.result.categories.category; | ||
if (response.ok) { | ||
let data = response.data.aliexpress_ds_category_get_response.resp_result.result.categories; | ||
if (data.category) | ||
data = data.category; | ||
} | ||
return response; | ||
@@ -546,0 +568,0 @@ }); |
{ | ||
"name": "ae_sdk", | ||
"version": "0.4.10", | ||
"version": "0.4.11", | ||
"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
153449
2710