Comparing version 0.3.4 to 0.4.0
# ae_sdk | ||
## 0.4.0 | ||
### Minor Changes | ||
- Fix affiliate API return types | ||
## 0.3.4 | ||
@@ -4,0 +10,0 @@ |
@@ -69,8 +69,8 @@ type AE_API_NAMES = DS_API_NAMES | AFFILIATE_API_NAMES | SYSTEM_API_NAMES; | ||
method: T; | ||
params: DS_ShippingAPI_Shipping_Info_Params; | ||
result: DS_ShippingAPI_Shipping_Info_Result; | ||
params: DS_Shipping_Info_Params; | ||
result: DS_Shipping_Info_Result; | ||
} : T extends "aliexpress.logistics.ds.trackinginfo.query" ? { | ||
method: T; | ||
params: DS_ShippingAPI_Tracking_Info_Params; | ||
result: DS_ShippingAPI_Tracking_Info_Result; | ||
params: DS_Tracking_Info_Params; | ||
result: DS_Tracking_Info_Result; | ||
} : T extends "aliexpress.ds.add.info" ? { | ||
@@ -86,12 +86,12 @@ method: T; | ||
method: T; | ||
params: DS_ProductAPI_Recommended_Products_Params; | ||
result: DS_ProductAPI_Recommended_Products_Result; | ||
params: DS_Recommended_Products_Params; | ||
result: DS_Recommended_Products_Result; | ||
} : T extends "aliexpress.trade.buy.placeorder" ? { | ||
method: T; | ||
params: DS_OrderAPI_Place_Order_Params; | ||
result: DS_OrderAPI_Place_Order_Result; | ||
params: DS_Place_Order_Params; | ||
result: DS_Place_Order_Result; | ||
} : T extends "aliexpress.ds.trade.order.get" ? { | ||
method: T; | ||
params: DS_OrderAPI_Get_Order_Params; | ||
result: DS_OrderAPI_Get_Order_Result; | ||
params: DS_Get_Order_Params; | ||
result: DS_Get_Order_Result; | ||
} : T extends "aliexpress.ds.feedname.get" ? { | ||
@@ -115,4 +115,4 @@ method: T; | ||
method: T; | ||
params: DS_ProductAPI_Product_Params; | ||
result: DS_ProductAPI_Product_Result; | ||
params: DS_Product_Params; | ||
result: DS_Product_Result; | ||
} : T extends "aliexpress.affiliate.link.generate" ? { | ||
@@ -171,2 +171,11 @@ method: T; | ||
}; | ||
type AE_Platform_Type = "TMALL" | "ALL" | "PLAZA"; | ||
type AE_Language = "EN" | "RU" | "PT" | "ES" | "FR" | "ID" | "IT" | "TH" | "JA" | "AR" | "VI" | "TR" | "DE" | "HE" | "KO" | "NL" | "PL" | "MX" | "CL" | "IW" | "IN"; | ||
type AE_Currency = "USD" | "GBP" | "CAD" | "EUR" | "CNY" | "UAH" | "MXN" | "TRY" | "RUB" | "BRL" | "AUD" | "INR" | "JPY" | "IDR" | "SEK" | "KRW"; | ||
type AE_Locale_Site = "global" | "it_site" | "es_site" | "ru_site"; | ||
type AE_Sort_Filter = "SALE_PRICE_ASC" | "SALE_PRICE_DESC" | "LAST_VOLUME_ASC" | "LAST_VOLUME_DESC"; | ||
type AE_Sort_Promo_Filter = "commissionAsc" | "commissionDesc" | "priceAsc" | "priceDesc" | "volumeAsc" | "volumeDesc" | "discountAsc" | "discountDesc" | "ratingAsc" | "ratingDesc" | "promotionTimeAsc" | "promotionTimeDesc"; | ||
type AE_Order_Status = "PLACE_ORDER_SUCCESS" | "WAIT_BUYER_ACCEPT_GOODS" | "FUND_PROCESSING" | "FINISH"; | ||
type AE_Logistics_Status = "NO_LOGISTICS" | "WAIT_SELLER_SEND_GOODS" | "SELLER_SEND_GOODS" | "BUYER_ACCEPT_GOODS"; | ||
type YES_NO = "Y" | "N"; | ||
@@ -194,6 +203,8 @@ /** | ||
interface Affiliate_Generate_Affiliate_Links_Result { | ||
resp_result: { | ||
resp_code?: number; | ||
resp_msg?: string; | ||
result: Affiliate_Generate_Affiliate_Links; | ||
aliexpress_affiliate_link_generate_response: { | ||
resp_result: { | ||
resp_code?: number; | ||
resp_msg?: string; | ||
result: Affiliate_Generate_Affiliate_Links; | ||
}; | ||
}; | ||
@@ -217,5 +228,6 @@ } | ||
app_signature?: string; | ||
/** Respond parameter list. eg: commission_rate,sale_price */ | ||
fields?: string; | ||
target_currency?: string; | ||
target_language?: string; | ||
target_currency?: AE_Currency; | ||
target_language?: AE_Language; | ||
tracking_id?: string; | ||
@@ -225,3 +237,3 @@ } | ||
app_sale_price?: string; | ||
app_sale_price_currency?: string; | ||
app_sale_price_currency?: AE_Currency; | ||
commission_rate?: string; | ||
@@ -235,3 +247,3 @@ discount?: string; | ||
original_price?: string; | ||
original_price_currency?: string; | ||
original_price_currency?: AE_Currency; | ||
platform_product_type?: AE_Platform_Type; | ||
@@ -241,5 +253,3 @@ product_detail_url?: string; | ||
product_main_image_url?: string; | ||
product_small_image_urls?: { | ||
string: string[]; | ||
}; | ||
product_small_image_urls?: string[]; | ||
product_title?: string; | ||
@@ -251,3 +261,3 @@ product_video_url?: string; | ||
sale_price: string; | ||
sale_price_currency: string; | ||
sale_price_currency: AE_Currency; | ||
second_level_category_id: number; | ||
@@ -260,6 +270,9 @@ second_level_category_name: string; | ||
target_sale_price: string; | ||
target_original_price_currency: string; | ||
target_sale_price_currency: string; | ||
target_app_sale_price_currency: string; | ||
target_original_price_currency: AE_Currency; | ||
target_sale_price_currency: AE_Currency; | ||
target_app_sale_price_currency: AE_Currency; | ||
} | ||
interface Affiliate_Product_Details extends Affiliate_Base_Product_Details { | ||
ship_to_days?: string; | ||
} | ||
interface Affiliate_Product_Details_Params extends Affiliate_Base_Product_Params { | ||
@@ -269,16 +282,16 @@ product_ids: string; | ||
} | ||
interface Affiliate_Product_Details extends Affiliate_Base_Product_Details { | ||
ship_to_days?: string; | ||
} | ||
interface Affiliate_Product_Details { | ||
interface Affiliate_Product_Details_Records { | ||
current_record_count: number; | ||
products: Affiliate_Product_Details[]; | ||
} | ||
interface Affiliate_Product_Details_Result { | ||
interface Affiliate_Product_Details_Response { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Product_Details; | ||
result: Affiliate_Product_Details_Records; | ||
}; | ||
} | ||
interface Affiliate_Product_Details_Result { | ||
aliexpress_affiliate_productdetail_get_response: Affiliate_Product_Details_Response; | ||
} | ||
/** | ||
@@ -289,11 +302,17 @@ * AFFILIATE API | ||
interface Affiliate_Products_Params extends Affiliate_Base_Product_Params { | ||
/** List of category ID, you can get category ID via "get category" API https://developers.aliexpress.com/en/doc.htm?docId=45801&docType=2 */ | ||
category_ids?: string; | ||
keywords?: string; | ||
/** Filter products by highest price, unit cent */ | ||
max_sale_price?: string; | ||
/** Filter products by lowest price, unit cent */ | ||
min_sale_price?: string; | ||
page_no?: string; | ||
/** record count of each page, 1 - 50 */ | ||
page_size?: string; | ||
platform_product_type?: AE_Platform_Type; | ||
sort?: "SALE_PRICE_ASC" | "SALE_PRICE_DESC" | "LAST_VOLUME_ASC" | "LAST_VOLUME_DESC"; | ||
sort?: AE_Sort_Filter; | ||
/** Estimated delivery days. 3:in 3 days,5:in 5 days,7:in 7 days,10:in 10 days */ | ||
delivery_days?: string; | ||
/** The Ship to country. Filter products that can be sent to that country; Returns the price according to the country’s tax rate policy. */ | ||
ship_to_country?: string; | ||
@@ -308,9 +327,12 @@ } | ||
} | ||
interface Affiliate_Products_Result { | ||
interface Affiliate_Products_Response { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Hotproducts; | ||
result: Affiliate_Products; | ||
}; | ||
} | ||
interface Affiliate_Products_Result { | ||
aliexpress_affiliate_product_query_response: Affiliate_Products_Response; | ||
} | ||
/** | ||
@@ -322,6 +344,5 @@ * AFFILIATE API | ||
} | ||
interface Affiliate_Hotproducts extends Affiliate_Products { | ||
interface Affiliate_Hotproducts_Result { | ||
aliexpress_affiliate_hotproduct_query_response: Affiliate_Products_Response; | ||
} | ||
interface Affiliate_Hotproducts_Result extends Affiliate_Products_Result { | ||
} | ||
/** | ||
@@ -344,6 +365,8 @@ * AFFILIATE API | ||
interface Affiliate_Categories_Result { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Categories; | ||
aliexpress_affiliate_category_get_response: { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Categories; | ||
}; | ||
}; | ||
@@ -367,5 +390,7 @@ } | ||
interface Affiliate_Featuredpromo_Info_Result { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Featuredpromo_Info; | ||
aliexpress_affiliate_featuredpromo_get_response: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: Affiliate_Featuredpromo_Info; | ||
}; | ||
} | ||
@@ -383,18 +408,18 @@ /** | ||
promotion_start_time?: string; | ||
sort?: "commissionAsc" | "commissionDesc" | "priceAsc" | "priceDesc" | "volumeAsc" | "volumeDesc" | "discountAsc" | "discountDesc" | "ratingAsc" | "ratingDesc" | "promotionTimeAsc" | "promotionTimeDesc"; | ||
sort?: AE_Sort_Promo_Filter; | ||
country?: string; | ||
} | ||
interface Affiliate_Featured_Promo_Product extends Affiliate_Base_Product_Details { | ||
} | ||
interface Affiliate_Featured_Promo_Products_Result { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: { | ||
current_page_no: number; | ||
current_record_count: number; | ||
total_page_no: number; | ||
total_record_count: number; | ||
is_finished: boolean; | ||
products: Affiliate_Featured_Promo_Product[]; | ||
aliexpress_affiliate_featuredpromo_products_get_response: { | ||
resp_result: { | ||
resp_code: number; | ||
resp_msg: string; | ||
result: { | ||
current_page_no: number; | ||
current_record_count: number; | ||
total_page_no: number; | ||
total_record_count: number; | ||
is_finished: boolean; | ||
products: Affiliate_Base_Product_Details[]; | ||
}; | ||
}; | ||
@@ -418,7 +443,7 @@ }; | ||
order_number: number; | ||
is_hot_product: "Y" | "N"; | ||
is_hot_product: YES_NO; | ||
parent_order_number: number; | ||
product_main_image_url: string; | ||
order_status: string; | ||
settled_currency: string; | ||
settled_currency: AE_Currency; | ||
category_id: number; | ||
@@ -433,3 +458,3 @@ product_id: number; | ||
customer_parameters: string; | ||
is_new_buyer: "Y" | "N"; | ||
is_new_buyer: YES_NO; | ||
ship_to_country: string; | ||
@@ -441,3 +466,3 @@ sub_order_id: number; | ||
estimated_incentive_paid_commission: number; | ||
is_affiliate_product: "Y" | "N"; | ||
is_affiliate_product: YES_NO; | ||
paid_amount: number; | ||
@@ -455,6 +480,8 @@ effect_detail_status: string; | ||
interface Affiliate_Order_Info_Result { | ||
resp_result: { | ||
result: Affiliate_Order_Info; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
aliexpress_affiliate_order_get_response: { | ||
resp_result: { | ||
result: Affiliate_Order_Info; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
}; | ||
}; | ||
@@ -475,3 +502,3 @@ } | ||
fields?: string; | ||
locale_site?: string; | ||
locale_site?: AE_Locale_Site; | ||
page_no?: number; | ||
@@ -492,6 +519,8 @@ page_size?: number; | ||
interface Affiliate_Order_List_Result { | ||
resp_result: { | ||
result: Affiliate_Order_List; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
aliexpress_affiliate_order_list_response: { | ||
resp_result: { | ||
result: Affiliate_Order_List; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
}; | ||
}; | ||
@@ -527,6 +556,8 @@ } | ||
interface Affiliate_Order_List_ByIdx_Result { | ||
resp_result: { | ||
result: Affiliate_Order_List_ByIdx; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
aliexpress_affiliate_order_listbyindex_response: { | ||
resp_result: { | ||
result: Affiliate_Order_List_ByIdx; | ||
resp_code?: number; | ||
resp_msg?: string; | ||
}; | ||
}; | ||
@@ -546,9 +577,9 @@ } | ||
/** Local site:global, it_site, es_site, ru_site */ | ||
locale_site?: string; | ||
locale_site?: AE_Locale_Site; | ||
page_no?: number; | ||
page_size?: number; | ||
/** Target Currency:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW,ILS,THB,CLP,VND */ | ||
target_currency?: string; | ||
target_currency?: AE_Currency; | ||
/** Target Language:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN */ | ||
target_language?: string; | ||
target_language?: AE_Language; | ||
/** Your trackingID */ | ||
@@ -564,3 +595,3 @@ tracking_id?: string; | ||
} | ||
interface Affiliate_Hotproducts_Download_Result { | ||
interface Affiliate_Hotproducts_Download_Response { | ||
resp_result: { | ||
@@ -572,2 +603,5 @@ result: Affiliate_Hotproducts_Download; | ||
} | ||
interface Affiliate_Hotproducts_Download_Result { | ||
aliexpress_affiliate_hotproduct_download_response: Affiliate_Hotproducts_Download_Response; | ||
} | ||
/** | ||
@@ -597,5 +631,5 @@ * AFFILIATE API | ||
/** Target Currency: USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW,ILS,THB,CLP,VND */ | ||
target_currency?: string; | ||
target_currency?: AE_Currency; | ||
/** Target Languages: EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN */ | ||
target_language?: string; | ||
target_language?: AE_Language; | ||
tracking_id?: string; | ||
@@ -607,3 +641,4 @@ /** user id */ | ||
} | ||
interface Affiliate_Smart_Match_Products_Result extends Affiliate_Hotproducts_Download_Result { | ||
interface Affiliate_Smart_Match_Products_Result { | ||
aliexpress_affiliate_product_smartmatch_response: Affiliate_Hotproducts_Download_Response; | ||
} | ||
@@ -613,3 +648,3 @@ | ||
* | ||
* PRODUCT API | ||
* DROPSHIPPER API | ||
* RECOMMENDED PRODUCTS | ||
@@ -629,3 +664,3 @@ * | ||
*/ | ||
interface DS_ProductAPI_Recommended_Products_Params { | ||
interface DS_Recommended_Products_Params { | ||
country?: string; | ||
@@ -635,7 +670,7 @@ /** | ||
*/ | ||
target_currency?: string; | ||
target_currency?: AE_Currency; | ||
/** | ||
* @description target language:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN | ||
*/ | ||
target_language?: string; | ||
target_language?: AE_Language; | ||
/** | ||
@@ -646,8 +681,7 @@ * @description record count of each page, 1 - 50 | ||
page_no?: string; | ||
sort?: "priceAsc" | "priceDesc" | "volumeAsc" | "volumeDesc" | "discountAsc" | "discountDesc" | "DSRratingAsc" | "DSRratingDesc"; | ||
sort?: AE_Sort_Promo_Filter; | ||
category_id?: string; | ||
feed_name: string; | ||
} | ||
type AE_Platform_Type = "TMALL" | "ALL" | "PLAZA"; | ||
interface DS_ProductAPI_Recommended_Product { | ||
interface DS_Recommended_Product { | ||
lastest_volume: number; | ||
@@ -664,3 +698,3 @@ seller_id: number; | ||
sale_price: string; | ||
target_sale_price_currency: string; | ||
target_sale_price_currency: AE_Currency; | ||
second_level_category_id: number; | ||
@@ -673,10 +707,10 @@ shop_url: string; | ||
platform_product_type: AE_Platform_Type; | ||
target_original_price_currency: string; | ||
target_original_price_currency: AE_Currency; | ||
ship_to_days: string; | ||
sale_price_currency: string; | ||
sale_price_currency: AE_Currency; | ||
original_price: string; | ||
original_price_currency: string; | ||
original_price_currency: AE_Currency; | ||
discount: string; | ||
} | ||
interface DS_ProductAPI_Recommended_Products { | ||
interface DS_Recommended_Products { | ||
total_record_count: number; | ||
@@ -687,7 +721,7 @@ current_record_count: number; | ||
current_page_no: number; | ||
products: DS_ProductAPI_Recommended_Product[]; | ||
products: DS_Recommended_Product[]; | ||
} | ||
interface DS_ProductAPI_Recommended_Products_Result { | ||
interface DS_Recommended_Products_Result { | ||
aliexpress_ds_recommend_feed_get_response: { | ||
result: DS_ProductAPI_Recommended_Products; | ||
result: DS_Recommended_Products; | ||
rsp_msg?: string; | ||
@@ -727,9 +761,9 @@ rsp_code: string; | ||
/** @description EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IW,IN */ | ||
target_language?: string; | ||
target_language?: AE_Language; | ||
/** @description USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW */ | ||
target_currency?: string; | ||
target_currency?: AE_Currency; | ||
/** @description count of products, max 150. */ | ||
product_cnt?: number; | ||
/** @description SALE_PRICE_ASC, SALE_PRICE_DESC, LAST_VOLUME_ASC, LAST_VOLUME_DESC */ | ||
sort?: "SALE_PRICE_ASC" | "SALE_PRICE_DESC" | "LAST_VOLUME_ASC" | "LAST_VOLUME_DESC"; | ||
sort?: AE_Sort_Filter; | ||
/** @description Ship to Country */ | ||
@@ -741,3 +775,3 @@ shpt_to?: string; | ||
interface DS_Image_Search { | ||
products: DS_ProductAPI_Recommended_Product[]; | ||
products: DS_Recommended_Product[]; | ||
total_record_count: number; | ||
@@ -754,16 +788,16 @@ } | ||
/** | ||
* PRODUCT API | ||
* DROPSHIPPER API | ||
* DROPSHIPPER PRODUCT DETAILS | ||
*/ | ||
interface DS_ProductAPI_Product_Params { | ||
interface DS_Product_Params { | ||
product_id: number; | ||
ship_to_country?: string; | ||
target_currency?: string; | ||
target_language?: string; | ||
target_currency?: AE_Currency; | ||
target_language?: AE_Language; | ||
} | ||
interface DS_ProductAPI_Product_Base_Info { | ||
interface DS_Product_Base_Info { | ||
product_id: number; | ||
category_id: number; | ||
subject: string; | ||
currency_code: string; | ||
currency_code: AE_Currency; | ||
product_status_type: string; | ||
@@ -780,7 +814,7 @@ ws_display: string; | ||
} | ||
interface DS_ProductAPI_Product_Shipping_Info { | ||
interface DS_Product_Shipping_Info { | ||
delivery_time: number; | ||
ship_to_country: string; | ||
} | ||
interface DS_ProductAPI_Product_Package_Info { | ||
interface DS_Product_Package_Info { | ||
package_type: boolean; | ||
@@ -794,3 +828,3 @@ package_length: number; | ||
} | ||
interface DS_ProductAPI_Product_Store_Info { | ||
interface DS_Product_Store_Info { | ||
store_id: number; | ||
@@ -802,7 +836,7 @@ store_name: string; | ||
} | ||
interface DS_ProductAPI_Product_Id_Converter { | ||
interface DS_Product_Id_Converter { | ||
main_product_id: number; | ||
sub_product_id: string; | ||
} | ||
interface DS_ProductAPI_Product_Multimedia_Videos { | ||
interface DS_Product_Multimedia_Videos { | ||
ali_member_id: number; | ||
@@ -814,19 +848,19 @@ media_id: number; | ||
} | ||
interface DS_ProductAPI_Product_Multimedia { | ||
ae_video_dtos: DS_ProductAPI_Product_Multimedia_Videos[]; | ||
interface DS_Product_Multimedia { | ||
ae_video_dtos: DS_Product_Multimedia_Videos[]; | ||
image_urls: string; | ||
} | ||
interface DS_ProductAPI_Product { | ||
ae_item_base_info_dto: DS_ProductAPI_Product_Base_Info; | ||
ae_item_sku_info_dtos: DS_ProductAPI_Product_SKU_Variation[]; | ||
ae_multimedia_info_dto: DS_ProductAPI_Product_Multimedia; | ||
package_info_dto: DS_ProductAPI_Product_Package_Info; | ||
logistics_info_dto: DS_ProductAPI_Product_Shipping_Info; | ||
ae_item_properties: DS_ProductAPI_Product_Attributes[]; | ||
ae_store_info: DS_ProductAPI_Product_Store_Info; | ||
product_id_converter_result: DS_ProductAPI_Product_Id_Converter; | ||
interface DS_Product { | ||
ae_item_base_info_dto: DS_Product_Base_Info; | ||
ae_item_sku_info_dtos: DS_Product_SKU_Variation[]; | ||
ae_multimedia_info_dto: DS_Product_Multimedia; | ||
package_info_dto: DS_Product_Package_Info; | ||
logistics_info_dto: DS_Product_Shipping_Info; | ||
ae_item_properties: DS_Product_Attributes[]; | ||
ae_store_info: DS_Product_Store_Info; | ||
product_id_converter_result: DS_Product_Id_Converter; | ||
} | ||
interface DS_ProductAPI_Product_Result { | ||
interface DS_Product_Result { | ||
aliexpress_ds_product_get_response: { | ||
result: DS_ProductAPI_Product; | ||
result: DS_Product; | ||
rsp_msg: string; | ||
@@ -836,3 +870,3 @@ rsp_code: string; | ||
} | ||
interface DS_ProductAPI_Product_SKU_Variation { | ||
interface DS_Product_SKU_Variation { | ||
sku_stock: boolean; | ||
@@ -843,4 +877,4 @@ sku_price: string; | ||
id: string; | ||
currency_code: string; | ||
aeop_s_k_u_propertys: DS_ProductAPI_Product_SKU_Properties[]; | ||
currency_code: AE_Currency; | ||
aeop_s_k_u_propertys: DS_Product_SKU_Properties[]; | ||
barcode: string; | ||
@@ -853,3 +887,3 @@ offer_sale_price: string; | ||
} | ||
interface DS_ProductAPI_Product_SKU_Properties { | ||
interface DS_Product_SKU_Properties { | ||
sku_property_id: number; | ||
@@ -863,3 +897,3 @@ sku_property_value: string; | ||
} | ||
interface DS_ProductAPI_Product_Attributes { | ||
interface DS_Product_Attributes { | ||
attr_name_id: number; | ||
@@ -884,3 +918,3 @@ attr_name: string; | ||
*/ | ||
interface DS_OrderAPI_Place_Order_Params { | ||
interface DS_Place_Order_Params { | ||
/** | ||
@@ -929,3 +963,3 @@ * logistics_address | ||
} | ||
interface DS_OrderAPI_Place_Order_Result { | ||
interface DS_Place_Order_Result { | ||
aliexpress_trade_buy_placeorder_response: { | ||
@@ -946,20 +980,20 @@ result: { | ||
*/ | ||
interface DS_OrderAPI_Get_Order_Params { | ||
interface DS_Get_Order_Params { | ||
order_id: number; | ||
} | ||
interface DS_OrderAPI_Price { | ||
interface DS_Price { | ||
amount: string; | ||
currency_code: string; | ||
currency_code: AE_Currency; | ||
} | ||
interface DS_OrderAPI_Product_Info { | ||
interface DS_Product_Info { | ||
product_id: number; | ||
product_price: DS_OrderAPI_Price; | ||
product_price: DS_Price; | ||
product_name: string; | ||
product_count: number; | ||
} | ||
interface DS_OrderAPI_Logistics_Info { | ||
interface DS_Logistics_Info { | ||
logistics_no: string; | ||
logistics_service: string; | ||
} | ||
interface DS_OrderAPI_Store_Info { | ||
interface DS_Store_Info { | ||
store_id: number; | ||
@@ -969,14 +1003,14 @@ store_name: string; | ||
} | ||
interface DS_OrderAPI_Get_Order { | ||
interface DS_Get_Order { | ||
gmt_create: string; | ||
order_status: "PLACE_ORDER_SUCCESS" | "WAIT_BUYER_ACCEPT_GOODS" | "FUND_PROCESSING" | "FINISH"; | ||
logistics_status: "NO_LOGISTICS" | "WAIT_SELLER_SEND_GOODS" | "SELLER_SEND_GOODS" | "BUYER_ACCEPT_GOODS"; | ||
order_amount: DS_OrderAPI_Price; | ||
child_order_list: DS_OrderAPI_Product_Info[]; | ||
logistics_info_list: DS_OrderAPI_Logistics_Info[]; | ||
store_info: DS_OrderAPI_Store_Info; | ||
order_status: AE_Order_Status; | ||
logistics_status: AE_Logistics_Status; | ||
order_amount: DS_Price; | ||
child_order_list: DS_Product_Info[]; | ||
logistics_info_list: DS_Logistics_Info[]; | ||
store_info: DS_Store_Info; | ||
} | ||
interface DS_OrderAPI_Get_Order_Result { | ||
interface DS_Get_Order_Result { | ||
aliexpress_trade_ds_order_get_response: { | ||
result: DS_OrderAPI_Get_Order; | ||
result: DS_Get_Order; | ||
rsp_msg: string; | ||
@@ -1007,5 +1041,5 @@ rsp_code: string; | ||
order_number: number; | ||
is_hot_product: "Y" | "N"; | ||
is_hot_product: YES_NO; | ||
parent_order_number: number; | ||
publisher_settled_currency: string; | ||
publisher_settled_currency: AE_Currency; | ||
category_id: number; | ||
@@ -1015,3 +1049,3 @@ item_title: string; | ||
item_main_image_url: string; | ||
item_count: "100"; | ||
item_count: number; | ||
created_time: string; | ||
@@ -1021,3 +1055,3 @@ finished_time: string; | ||
paid_time: string; | ||
is_new_buyer: "Y" | "N"; | ||
is_new_buyer: YES_NO; | ||
ship_to_country: string; | ||
@@ -1028,3 +1062,3 @@ sub_order_id: number; | ||
estimated_incentive_paid_commission: string; | ||
is_affiliate_product: "Y" | "N"; | ||
is_affiliate_product: YES_NO; | ||
paid_amount: number; | ||
@@ -1106,3 +1140,3 @@ effect_detail_status: string; | ||
*/ | ||
interface DS_ShippingAPI_Shipping_Info_Arguments { | ||
interface DS_Shipping_Info_Arguments { | ||
sku_id?: string; | ||
@@ -1116,5 +1150,5 @@ city_code?: string; | ||
price?: string; | ||
price_currency?: string; | ||
price_currency?: AE_Currency; | ||
} | ||
interface DS_ShippingAPI_Shipping_Info_Params { | ||
interface DS_Shipping_Info_Params { | ||
/** | ||
@@ -1136,16 +1170,16 @@ * Get the support logistics info of a product, provide for dropshipping develeopers. | ||
} | ||
interface DS_ShippingAPI_Freight_Info { | ||
interface DS_Freight_Info { | ||
amount: number; | ||
cent: number; | ||
currency_code: string; | ||
currency_code: AE_Currency; | ||
} | ||
interface DS_ShippingAPI_Shipping_Details { | ||
interface DS_Shipping_Details { | ||
error_code: number; | ||
estimated_delivery_time: string; | ||
freight: DS_ShippingAPI_Freight_Info; | ||
freight: DS_Freight_Info; | ||
service_name: string; | ||
} | ||
type DS_ShippingAPI_Shipping_Info_Response = { | ||
type DS_Shipping_Info_Response = { | ||
success: true; | ||
aeop_freight_calculate_result_for_buyer_d_t_o_list: DS_ShippingAPI_Shipping_Details[]; | ||
aeop_freight_calculate_result_for_buyer_d_t_o_list: DS_Shipping_Details[]; | ||
} | { | ||
@@ -1155,5 +1189,5 @@ success: false; | ||
}; | ||
interface DS_ShippingAPI_Shipping_Info_Result { | ||
interface DS_Shipping_Info_Result { | ||
aliexpress_logistics_buyer_freight_calculate_response: { | ||
result: DS_ShippingAPI_Shipping_Info_Response; | ||
result: DS_Shipping_Info_Response; | ||
}; | ||
@@ -1176,3 +1210,3 @@ } | ||
*/ | ||
interface DS_ShippingAPI_Tracking_Info_Params { | ||
interface DS_Tracking_Info_Params { | ||
logistics_no: string; | ||
@@ -1184,3 +1218,3 @@ origin: string; | ||
} | ||
interface DS_ShippingAPI_Tracking_Event { | ||
interface DS_Tracking_Event { | ||
event_desc: string; | ||
@@ -1192,5 +1226,5 @@ signed_name: string; | ||
} | ||
type DS_ShippingAPI_Tracking_Info_Response = { | ||
type DS_Tracking_Info_Response = { | ||
result_success: true; | ||
details: DS_ShippingAPI_Tracking_Event[]; | ||
details: DS_Tracking_Event[]; | ||
official_website: string; | ||
@@ -1201,4 +1235,4 @@ } | { | ||
}; | ||
interface DS_ShippingAPI_Tracking_Info_Result { | ||
aliexpress_logistics_ds_trackinginfo_query_response: DS_ShippingAPI_Tracking_Info_Response; | ||
interface DS_Tracking_Info_Result { | ||
aliexpress_logistics_ds_trackinginfo_query_response: DS_Tracking_Info_Response; | ||
} | ||
@@ -1281,2 +1315,3 @@ | ||
protected execute<K extends AE_API_NAMES>(method: K, params: AliexpressMethod<K>["params"]): Result<AliexpressMethod<K>["result"]>; | ||
callAPIDirectly(method: string, params: Record<string, string | number | boolean>): Result<any>; | ||
} | ||
@@ -1495,3 +1530,3 @@ | ||
*/ | ||
shippingInfo(args: DS_ShippingAPI_Shipping_Info_Arguments): Promise<{ | ||
shippingInfo(args: DS_Shipping_Info_Arguments): Promise<{ | ||
ok: false; | ||
@@ -1502,3 +1537,3 @@ message: string; | ||
ok: true; | ||
data: DS_ShippingAPI_Shipping_Info_Result; | ||
data: DS_Shipping_Info_Result; | ||
}>; | ||
@@ -1508,3 +1543,3 @@ /** | ||
*/ | ||
trackingInfo(args: DS_ShippingAPI_Tracking_Info_Params): Promise<{ | ||
trackingInfo(args: DS_Tracking_Info_Params): Promise<{ | ||
ok: false; | ||
@@ -1515,3 +1550,3 @@ message: string; | ||
ok: true; | ||
data: DS_ShippingAPI_Tracking_Info_Result; | ||
data: DS_Tracking_Info_Result; | ||
}>; | ||
@@ -1532,14 +1567,6 @@ /** | ||
*/ | ||
searchByImage(args: DS_Image_Search_Params): Promise<{ | ||
ok: false; | ||
message: string; | ||
request_id?: string; | ||
} | { | ||
ok: true; | ||
data: DS_Image_Search_Result; | ||
}>; | ||
/** | ||
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST | ||
*/ | ||
queryfeaturedPromoProducts(args: DS_ProductAPI_Recommended_Products_Params): Promise<{ | ||
queryfeaturedPromoProducts(args: DS_Recommended_Products_Params): Promise<{ | ||
ok: false; | ||
@@ -1550,3 +1577,3 @@ message: string; | ||
ok: true; | ||
data: DS_ProductAPI_Recommended_Products_Result; | ||
data: DS_Recommended_Products_Result; | ||
}>; | ||
@@ -1565,3 +1592,3 @@ /** | ||
ok: true; | ||
data: DS_OrderAPI_Place_Order_Result; | ||
data: DS_Place_Order_Result; | ||
}>; | ||
@@ -1571,3 +1598,3 @@ /** | ||
*/ | ||
orderDetails(args: DS_OrderAPI_Get_Order_Params): Promise<{ | ||
orderDetails(args: DS_Get_Order_Params): Promise<{ | ||
ok: false; | ||
@@ -1578,3 +1605,3 @@ message: string; | ||
ok: true; | ||
data: DS_OrderAPI_Get_Order_Result; | ||
data: DS_Get_Order_Result; | ||
}>; | ||
@@ -1628,3 +1655,3 @@ /** | ||
*/ | ||
productDetails(args: DS_ProductAPI_Product_Params): Promise<{ | ||
productDetails(args: DS_Product_Params): Promise<{ | ||
ok: false; | ||
@@ -1635,3 +1662,3 @@ message: string; | ||
ok: true; | ||
data: DS_ProductAPI_Product_Result; | ||
data: DS_Product_Result; | ||
}>; | ||
@@ -1638,0 +1665,0 @@ } |
@@ -128,2 +128,16 @@ "use strict"; | ||
} | ||
callAPIDirectly(method, params) { | ||
return __async(this, null, function* () { | ||
const parameters = __spreadProps(__spreadValues({}, params), { | ||
method, | ||
session: this.session, | ||
app_key: this.app_key, | ||
simplify: true, | ||
sign_method: this.sign_method, | ||
timestamp: Date.now() | ||
}); | ||
parameters.sign = this.sign(parameters); | ||
return yield this.call(parameters); | ||
}); | ||
} | ||
}; | ||
@@ -337,7 +351,5 @@ | ||
*/ | ||
searchByImage(args) { | ||
return __async(this, null, function* () { | ||
return yield this.execute("aliexpress.ds.image.search", args); | ||
}); | ||
} | ||
// async searchByImage(args: DS_Image_Search_Params) { | ||
// return await this.execute("aliexpress.ds.image.search", args); | ||
// } | ||
/** | ||
@@ -344,0 +356,0 @@ * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST |
{ | ||
"name": "ae_sdk", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "A simple SDK for Aliexpress (dropshipping and affiliate) APIs.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -1,9 +0,24 @@ | ||
# AE_SDK | ||
# Aliexpress SDK ![npm version](https://img.shields.io/npm/v/ae_sdk?label=) | ||
![Typescript](https://img.shields.io/badge/-TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white) | ||
![CI](https://img.shields.io/github/actions/workflow/status/moh3a/ae_sdk/main.yml?logo=githubactions&logoColor=white&label=CI) | ||
![Publish](https://img.shields.io/github/actions/workflow/status/moh3a/ae_sdk/publish.yml?logo=githubactions&logoColor=white&label=Publish) | ||
[![Downloads](https://img.shields.io/npm/dw/ae_sdk?logo=npm)](https://www.npmjs.com/package/ae_sdk) | ||
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/ae_sdk?label=size&logo=npm)](https://bundlephobia.com/package/ae_sdk) | ||
[![License](https://img.shields.io/github/license/moh3a/ae_sdk)](https://github.com/moh3a/ae_sdk/blob/master/LICENSE) | ||
A simple and type-safe SDK for Aliexpress (system tools, dropshipping and affiliate) APIs. | ||
## Disclamer | ||
## Overview | ||
This library is currently under heavy development. More endpoints and documentation will be coming. | ||
Aliexpress launched a new open platform to consume their APIs. They fully migrated and upgraded their services from the old [Taobao Open Platform](https://developers.aliexpress.com) to the new [Open Platform for International Developers](https://openservice.aliexpress.com). The issue is, with this update, [they have yet to release a Node.js SDK](https://openservice.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=1371). | ||
## Features | ||
This library is an unofficial and **simple** SDK that can do the following: | ||
- Compose a request, generate an encryption (method signature) and interprete the response. | ||
- Pass the right parameters for your API call with type safe methods. | ||
- Currently supports the **system tools for authentication**, **Affiliate API** and **Dropshipping API**. | ||
## Installation | ||
@@ -24,2 +39,6 @@ | ||
To be able to use this SDK, you must first [become a developer](https://openservice.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=1362), follow the steps to register an application, to then retrive your `app_key` and `app_secret`. | ||
Lastly an access token is required to access the API, follow the steps for the authorization process [described in this link](https://openservice.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=1364). When you get your access token, make sure to pass it the client initialization as `session`. | ||
```ts | ||
@@ -32,4 +51,4 @@ // step 1: import the AE affiliate (`AffiliateClient`) or dropshipping (`DropshipperClient`) client | ||
app_key: "123", | ||
app_secret: "123456abcdef", // https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=732 | ||
session: "oauth_access_token", // https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=730 | ||
app_secret: "123456abcdef", // process.env.AE_DS_APP_SECRET | ||
session: "oauth_access_token", // process.env.AE_DS_ACCESS_TOKEN or fetch from DB | ||
}); | ||
@@ -46,3 +65,9 @@ | ||
console.log(result); | ||
/* Console: | ||
``` | ||
If the call was successfull, you will get back the following results. | ||
> Inside the `data` object is the API response. | ||
```text | ||
{ | ||
@@ -54,3 +79,3 @@ ok: true, | ||
rsp_code: 200, | ||
rsp_msg: 'Call succeeds', | ||
rsp_msg: "Call succeeds", | ||
request_id: "..." | ||
@@ -60,9 +85,29 @@ } | ||
} | ||
*/ | ||
``` | ||
## Todo | ||
Else if an error occured you will receive the following: | ||
- Add in code documentation using `jsdoc`; | ||
- Fix method result types (affiliate) | ||
- Add unit tests; | ||
> Make sure you to pass the right parameters, but if the problem persits, please contact me | ||
```text | ||
{ | ||
ok: false, | ||
message: "..." | ||
} | ||
``` | ||
### Directly call the API | ||
If you wish to call a different Aliexpress API that is not by the current version. You can do the following: | ||
```ts | ||
const result = await client.callAPIDirectly("aliexpress.api.endpoint", { | ||
[string]: string | number | boolean, | ||
}); | ||
``` | ||
## Todos | ||
- Add file parameter to pass `bytes[]` as a method argument, example: query product using an image. | ||
- Add unit tests. | ||
- Write documentation. |
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
140810
2419
109