New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ae_sdk

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ae_sdk - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

6

CHANGELOG.md
# ae_sdk
## 0.3.3
### Patch Changes
- Add dropshipping API methods
## 0.3.2

@@ -4,0 +10,0 @@

490

dist/index.d.ts

@@ -0,16 +1,15 @@

type ResultType<K> = Promise<{
ok: true;
data: K;
} | {
ok: false;
message: string;
}>;
/**
* ALIEXPRESS SERVICES
*/
type AE_DROPSHIPPING_SERVICE = "ds";
type AE_AFFILIATE_SERVICE = "affiliate";
type AE_SYSTEM_SERVICE = "system";
type AE_SERVICE = AE_AFFILIATE_SERVICE | AE_DROPSHIPPING_SERVICE | AE_SYSTEM_SERVICE;
/**
* ALIEXPRESS API NAMES
*/
type AE_API_NAMES = DS_API_NAMES | AFFILIATE_API_NAMES | SYSTEM_API_NAMES;
type DS_API_NAMES = "aliexpress.ds.recommend.feed.get" | "aliexpress.ds.product.get" | "aliexpress.postproduct.redefining.findaeproductbyidfordropshipper" | "aliexpress.trade.buy.placeorder" | "aliexpress.ds.trade.order.get" | "aliexpress.logistics.buyer.freight.calculate" | "aliexpress.logistics.ds.trackinginfo.query";
type DS_API_NAMES = "aliexpress.logistics.buyer.freight.calculate" | "aliexpress.logistics.ds.trackinginfo.query" | "aliexpress.ds.add.info" | "aliexpress.ds.image.search" | "aliexpress.ds.recommend.feed.get" | "aliexpress.trade.buy.placeorder" | "aliexpress.ds.trade.order.get" | "aliexpress.ds.feedname.get" | "aliexpress.ds.category.get" | "aliexpress.ds.commissionorder.listbyindex" | "aliexpress.ds.member.orderdata.submit" | "aliexpress.ds.product.get";
type AFFILIATE_API_NAMES = "aliexpress.affiliate.link.generate" | "aliexpress.affiliate.category.get" | "aliexpress.affiliate.featuredpromo.get" | "aliexpress.affiliate.featuredpromo.products.get" | "aliexpress.affiliate.hotproduct.download" | "aliexpress.affiliate.hotproduct.query" | "aliexpress.affiliate.order.get" | "aliexpress.affiliate.order.list" | "aliexpress.affiliate.order.listbyindex" | "aliexpress.affiliate.productdetail.get" | "aliexpress.affiliate.product.query" | "aliexpress.affiliate.product.smartmatch";
type SYSTEM_API_NAMES = "/auth/token/security/create" | "/auth/token/create" | "/auth/token/security/refresh" | "/auth/token/refresh";
type AE_EXECUTE_FN_METHODS<T extends AE_SERVICE> = T extends AE_DROPSHIPPING_SERVICE ? DS_API_NAMES : T extends AE_SYSTEM_SERVICE ? SYSTEM_API_NAMES : AFFILIATE_API_NAMES;
/**

@@ -20,3 +19,3 @@ * METHODS PARAMETERS

type AE_SYSTEM_EXECUTE_FN_PARAMS<T extends SYSTEM_API_NAMES> = T extends "/auth/token/security/create" ? AES_Generate_Security_Token_Params : T extends "/auth/token/create" ? AES_Generate_Token_Params : T extends "/auth/token/security/refresh" ? AES_Refresh_Security_Token_Params : T extends "/auth/token/refresh" ? AES_Refresh_Token_Params : unknown;
type AE_DS_EXECUTE_FN_PARAMS<T extends DS_API_NAMES> = T extends "aliexpress.ds.recommend.feed.get" ? DS_ProductAPI_Recommended_Products_Params : T extends "aliexpress.ds.product.get" ? DS_ProductAPI_Product_Params : T extends "aliexpress.postproduct.redefining.findaeproductbyidfordropshipper" ? DS_ProductAPI_Product_Detail_Params : T extends "aliexpress.trade.buy.placeorder" ? DS_OrderAPI_Place_Order_Params : T extends "aliexpress.ds.trade.order.get" ? DS_OrderAPI_Get_Order_Params : T extends "aliexpress.logistics.buyer.freight.calculate" ? DS_ShippingAPI_Shipping_Info_Params : T extends "aliexpress.logistics.ds.trackinginfo.query" ? DS_ShippingAPI_Tracking_Info_Params : unknown;
type AE_DS_EXECUTE_FN_PARAMS<T extends DS_API_NAMES> = T extends "aliexpress.logistics.buyer.freight.calculate" ? DS_ShippingAPI_Shipping_Info_Params : T extends "aliexpress.logistics.ds.trackinginfo.query" ? DS_ShippingAPI_Tracking_Info_Params : T extends "aliexpress.ds.add.info" ? DS_Add_Info_Params : T extends "aliexpress.ds.image.search" ? DS_Image_Search_Params : T extends "aliexpress.ds.recommend.feed.get" ? DS_ProductAPI_Recommended_Products_Params : T extends "aliexpress.trade.buy.placeorder" ? DS_OrderAPI_Place_Order_Params : T extends "aliexpress.ds.trade.order.get" ? DS_OrderAPI_Get_Order_Params : T extends "aliexpress.ds.feedname.get" ? DS_Feedname_Params : T extends "aliexpress.ds.category.get" ? Affiliate_Categories_Params : T extends "aliexpress.ds.commissionorder.listbyindex" ? DS_Orders_ByIdx_Params : T extends "aliexpress.ds.member.orderdata.submit" ? DS_Order_Submit_Params : T extends "aliexpress.ds.product.get" ? DS_ProductAPI_Product_Params : unknown;
type AE_AFFILIATE_EXECUTE_FN_PARAMS<T extends AFFILIATE_API_NAMES> = T extends "aliexpress.affiliate.link.generate" ? Affiliate_Generate_Affiliate_Links_Params : T extends "aliexpress.affiliate.category.get" ? Affiliate_Categories_Params : T extends "aliexpress.affiliate.featuredpromo.get" ? Affiliate_Featuredpromo_Info_Params : T extends "aliexpress.affiliate.featuredpromo.products.get" ? Affiliate_Featured_Promo_Products_Params : T extends "aliexpress.affiliate.hotproduct.download" ? Affiliate_Hotproducts_Download_Params : T extends "aliexpress.affiliate.hotproduct.query" ? Affiliate_Hotproducts_Params : T extends "aliexpress.affiliate.order.get" ? Affiliate_Order_Info_Params : T extends "aliexpress.affiliate.order.list" ? Affiliate_Order_List_Params : T extends "aliexpress.affiliate.order.listbyindex" ? Affiliate_Order_List_ByIdx_Params : T extends "aliexpress.affiliate.productdetail.get" ? Affiliate_Product_Details_Params : T extends "aliexpress.affiliate.product.query" ? Affiliate_Products_Params : T extends "aliexpress.affiliate.product.smartmatch" ? Affiliate_Smart_Match_Products_Params : unknown;

@@ -28,3 +27,3 @@ type AE_EXECUTE_FN_PARAMS<T extends AE_API_NAMES> = T extends DS_API_NAMES ? AE_DS_EXECUTE_FN_PARAMS<T> : T extends AFFILIATE_API_NAMES ? AE_AFFILIATE_EXECUTE_FN_PARAMS<T> : T extends SYSTEM_API_NAMES ? AE_SYSTEM_EXECUTE_FN_PARAMS<T> : unknown;

type AE_SYSTEM_EXECUTE_FN_RESULT<T extends SYSTEM_API_NAMES> = T extends "/auth/token/security/create" ? AES_Generate_Security_Token_Result : T extends "/auth/token/create" ? AES_Generate_Token_Result : T extends "/auth/token/security/refresh" ? AES_Refresh_Security_Token_Result : T extends "/auth/token/refresh" ? AES_Refresh_Token_Result : unknown;
type AE_DS_EXECUTE_FN_RESULT<T extends DS_API_NAMES> = T extends "aliexpress.ds.recommend.feed.get" ? DS_ProductAPI_Recommended_Products_Result : T extends "aliexpress.ds.product.get" ? DS_ProductAPI_Product_Result : T extends "aliexpress.postproduct.redefining.findaeproductbyidfordropshipper" ? DS_ProductAPI_Product_Detail_Result : T extends "aliexpress.trade.buy.placeorder" ? DS_OrderAPI_Place_Order_Result : T extends "aliexpress.ds.trade.order.get" ? DS_OrderAPI_Get_Order_Result : T extends "aliexpress.logistics.buyer.freight.calculate" ? DS_ShippingAPI_Shipping_Info_Result : T extends "aliexpress.logistics.ds.trackinginfo.query" ? DS_ShippingAPI_Tracking_Info_Result : unknown;
type AE_DS_EXECUTE_FN_RESULT<T extends DS_API_NAMES> = T extends "aliexpress.logistics.buyer.freight.calculate" ? DS_ShippingAPI_Shipping_Info_Result : T extends "aliexpress.logistics.ds.trackinginfo.query" ? DS_ShippingAPI_Tracking_Info_Result : T extends "aliexpress.ds.add.info" ? DS_Add_Info_Result : T extends "aliexpress.ds.image.search" ? DS_Image_Search_Result : T extends "aliexpress.ds.recommend.feed.get" ? DS_ProductAPI_Recommended_Products_Result : T extends "aliexpress.trade.buy.placeorder" ? DS_OrderAPI_Place_Order_Result : T extends "aliexpress.ds.trade.order.get" ? DS_OrderAPI_Get_Order_Result : T extends "aliexpress.ds.feedname.get" ? DS_Feedname_Result : T extends "aliexpress.ds.category.get" ? Affiliate_Categories_Result : T extends "aliexpress.ds.commissionorder.listbyindex" ? DS_Orders_ByIdx_Result : T extends "aliexpress.ds.member.orderdata.submit" ? DS_Order_Submit_Result : T extends "aliexpress.ds.product.get" ? DS_ProductAPI_Product_Result : unknown;
type AE_AFFILIATE_EXECUTE_FN_RESULT<T extends AFFILIATE_API_NAMES> = T extends "aliexpress.affiliate.link.generate" ? Affiliate_Generate_Affiliate_Links_Result : T extends "aliexpress.affiliate.category.get" ? Affiliate_Categories_Result : T extends "aliexpress.affiliate.featuredpromo.get" ? Affiliate_Featuredpromo_Info_Result : T extends "aliexpress.affiliate.featuredpromo.products.get" ? Affiliate_Featured_Promo_Products_Result : T extends "aliexpress.affiliate.hotproduct.download" ? Affiliate_Hotproducts_Download_Result : T extends "aliexpress.affiliate.hotproduct.query" ? Affiliate_Hotproducts_Result : T extends "aliexpress.affiliate.order.get" ? Affiliate_Order_Info_Result : T extends "aliexpress.affiliate.order.list" ? Affiliate_Order_List_Result : T extends "aliexpress.affiliate.order.listbyindex" ? Affiliate_Order_List_ByIdx_Result : T extends "aliexpress.affiliate.productdetail.get" ? Affiliate_Product_Details_Result : T extends "aliexpress.affiliate.product.query" ? Affiliate_Products_Result : T extends "aliexpress.affiliate.product.smartmatch" ? Affiliate_Smart_Match_Products_Result : unknown;

@@ -55,16 +54,24 @@ type AE_EXECUTE_FN_RESULT<T extends AE_API_NAMES> = T extends DS_API_NAMES ? AE_DS_EXECUTE_FN_RESULT<T> : T extends AFFILIATE_API_NAMES ? AE_AFFILIATE_EXECUTE_FN_RESULT<T> : T extends SYSTEM_API_NAMES ? AE_SYSTEM_EXECUTE_FN_RESULT<T> : unknown;

interface AE_Base_Client {
/**
* @param {String} app_key Indicates the AppKey allocated by Open.Aliexpress to an application. An ISV can choose Open Platform Console > Application Management > Overview to check the AppKey and AppSecret of the formal environment.
* @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=732
*/
app_key: string;
/**
* @param {String} app_key Indicates the AppSecret allocated by Open.Aliexpress to an application. An ISV can choose Open Platform Console > Application Management > Overview to check the AppKey and AppSecret of the formal environment.
* @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=732
*/
app_secret: string;
/**
* @param {String} session Indicates the authorization granted by the TOP to an application after a user logs in and grants authorization successfully.
* @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=730
*/
session: string;
url?: string;
/**
* @param {String} format Indicates the response format. The default value is xml. The value can be set to xml or json.
* @default json
*/
format?: AE_Response_Format;
}
interface AE_Error_Response {
error_response: {
type: string;
code: string;
msg: string;
request_id: string;
};
}
type AE_Response_Format = "xml" | "json";

@@ -75,2 +82,15 @@ /**

*/
/**
* @param {String} account_id
* @param {String} seller_id
* @param {String} user_id
* @param {String} sp
* @param {String} access_token
* @param {String} refresh_token
* @param {Number} expires_in
* @param {Number} expire_time
* @param {Number} refresh_token_valid_time
* @param {Number} refresh_expires_in
* @param {String} locale
*/
interface AES_Base_Access_Token_Result {

@@ -145,4 +165,13 @@ account_id: string;

country?: string;
target_currency?: "USD" | "EUR";
target_language?: "EN" | "FR" | "AR";
/**
* @description target currency:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY,
*/
target_currency?: string;
/**
* @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;
/**
* @description record count of each page, 1 - 50
*/
page_size?: string;

@@ -191,5 +220,61 @@ page_no?: string;

interface DS_ProductAPI_Recommended_Products_Result {
result: DS_ProductAPI_Recommended_Products;
aliexpress_ds_recommend_feed_get_response: {
result: DS_ProductAPI_Recommended_Products;
rsp_msg?: string;
rsp_code: string;
request_id: string;
};
}
/**
* DROPSHIPPER API
* FEEDNAMES
*/
interface DS_Feedname_Params extends Affiliate_Categories_Params {
}
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: {
request_id: string;
resp_result: {
result: DS_Feedname;
resp_code: number;
resp_msg: string;
};
};
}
/**
* DROPSHIPPER API
* IMAGE SEARCH
*/
interface DS_Image_Search_Params {
/** @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;
/** @description USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW */
target_currency?: string;
/** @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";
/** @description Ship to Country */
shpt_to?: string;
/** @description image name in fileserver,max size 100 KB */
image_file_bytes: Uint8Array;
}
interface DS_Image_Search {
products: DS_ProductAPI_Recommended_Product[];
total_record_count: number;
}
interface DS_Image_Search_Result {
data: DS_Image_Search;
rsp_code: string;
rsp_msg: string;
rsp_code: string;
total_record_count: number;
}

@@ -272,29 +357,2 @@ /**

}
/**
*
* PRODUCT API
* PRODUCT DETAILS
*
*/
/**
* Product details
* @param {String} ship_to_country Country
* @param {Number} product_id Item ID
* @param {String} target_currency Target currency
* @param {String} target_language Target language
*/
interface DS_ProductAPI_Product_Detail_Params {
product_id: number;
local_country?: string;
local_language?: string;
}
interface DS_ProductAPI_Product_SKU_Properties {
sku_property_id: number;
sku_property_value: string;
sku_property_name: string;
property_value_id: number;
property_value_id_long: number;
property_value_definition_name?: string;
sku_image?: string;
}
interface DS_ProductAPI_Product_SKU_Variation {

@@ -315,2 +373,11 @@ sku_stock: boolean;

}
interface DS_ProductAPI_Product_SKU_Properties {
sku_property_id: number;
sku_property_value: string;
sku_property_name: string;
property_value_id: number;
property_value_id_long: number;
property_value_definition_name?: string;
sku_image?: string;
}
interface DS_ProductAPI_Product_Attributes {

@@ -325,65 +392,2 @@ attr_name_id: number;

}
interface DS_ProductAPI_Store_Info {
communication_rating: string;
item_as_descriped_rating: string;
shipping_speed_rating: string;
store_id: number;
store_name: string;
}
interface DS_ProductAPI_Product_Details {
aeop_ae_product_s_k_us: DS_ProductAPI_Product_SKU_Variation[];
detail: string;
is_success: boolean;
product_unit: number;
ws_offline_date: string;
ws_display: string;
category_id: number;
aeop_a_e_multimedia: {
aeop_a_e_videos: {
aeop_ae_video: [
{
poster_url: string;
media_type: string;
media_status: string;
media_id: number;
ali_member_id: number;
}
];
};
};
owner_member_id: string;
product_status_type: string;
aeop_ae_product_propertys: DS_ProductAPI_Product_Attributes[];
gross_weight: string;
delivery_time: number;
ws_valid_num: number;
gmt_modified: string;
error_message: string;
package_type: boolean;
aeop_national_quote_configuration: {
configuration_type: string;
configuration_data: string;
};
subject: string;
base_unit: number;
package_length: number;
mobile_detail: string;
package_height: number;
package_width: number;
currency_code: string;
gmt_create: string;
image_u_r_ls: string;
product_id: number;
error_code: number;
product_price: string;
item_offer_site_sale_price: string;
total_available_stock: number;
store_info: DS_ProductAPI_Store_Info;
evaluation_count: number;
avg_evaluation_rating: string;
order_count: number;
}
interface DS_ProductAPI_Product_Detail_Result {
result: DS_ProductAPI_Product_Details;
}
/**

@@ -495,2 +499,109 @@ *

/**
* DROPSHIPPER API - ORDER
* ORDER QUERY BY INDEX
*/
interface DS_Orders_ByIdx_Params {
/** End time, PST time */
end_time: string;
/** Start time, PST time */
start_time: string;
/** Order status: Payment Completed(Buyer paid successfully), Buyer Confirmed Receipt(This status only change when:Buyer confirms receipt and settlement task begins which is manually executed by our operation team), Completed Settlement(Orders have been verified and commission has been paid), Invalid(Orders will not be settled including buyer refunds, order risks, antispam/penalty appeal failed, antispam/penalty appeal overdue, order not settled being over 180 days apart from the Completed Payment Time (such as in abnormal state like dispute), etc.) */
status: string;
/** Query index start value: if not passed, You can only check the first page */
start_query_index_id?: string;
page_size?: number;
page_no?: number;
}
interface DS_Orders_ByIdx_Order_Details {
publisher_id: number;
estimated_finished_commission: string;
estimated_paid_commission: number;
order_number: number;
is_hot_product: "Y" | "N";
parent_order_number: number;
publisher_settled_currency: string;
category_id: number;
item_title: string;
item_detail_url: string;
item_main_image_url: string;
item_count: "100";
created_time: string;
finished_time: string;
item_id: number;
paid_time: string;
is_new_buyer: "Y" | "N";
ship_to_country: string;
sub_order_id: number;
effect_status: string;
incentive_commission_rate: string;
estimated_incentive_paid_commission: string;
is_affiliate_product: "Y" | "N";
paid_amount: number;
effect_detail_status: string;
estimated_incentive_finished_commission: string;
commission_rate: string;
finished_amount: string;
order_id: number;
}
interface DS_Orders_ByIdx {
current_record_count: number;
min_query_index_id: string;
max_query_index_id: string;
orders: DS_Orders_ByIdx_Order_Details[];
current_page_no: number;
}
interface DS_Orders_ByIdx_Result {
result: DS_Orders_ByIdx;
rsp_code: number;
rsp_msg: string;
}
/**
* DROPSHIPPING API
* ORDER SUBMIT
*/
interface DS_Order_Submit_Params {
/** AE product ID */
ae_product_id: string;
/** Off-site payment time, GMT time, format YYYYMMDD:HHMMSS */
paytime: string;
/** AE order id */
ae_orderid: string;
/** SKU sales amount outside the station, to 2 decimal places */
product_amount: string;
/** Order sales amount outside the station, keep 2 decimal places */
order_amount: string;
/** AE product SKU information, SKU key-value pair: "200000182:193;200007763:201336100" */
ae_sku_info: string;
/** Commodity site url */
product_url: string;
}
interface DS_Order_Submit_Result {
result: boolean;
rsp_msg: string;
rsp_code: number;
}
/**
* DROPSHIPPING API
* ADD DROPSHIPPING INFO
*/
interface DS_Add_Info_Arguments {
/** Extended Information */
extend_info?: Record<string, string | number | boolean>;
/** shop address */
store_url?: string;
/** user signature */
app_signature?: string;
}
interface DS_Add_Info_Params {
param0: string;
}
interface DS_Add_Info_Result {
aliexpress_ds_add_info_response: {
result: boolean;
result_msg: string;
result_code: number;
request_id: string;
};
}
/**
*

@@ -501,2 +612,13 @@ * SHIPPING API

*/
interface DS_ShippingAPI_Shipping_Info_Arguments {
sku_id?: string;
city_code?: string;
country_code: string;
product_id: number;
product_num: number;
province_code?: string;
send_goods_country_code: string;
price?: string;
price_currency?: string;
}
interface DS_ShippingAPI_Shipping_Info_Params {

@@ -530,7 +652,13 @@ /**

}
type DS_ShippingAPI_Shipping_Info_Response = {
success: true;
aeop_freight_calculate_result_for_buyer_d_t_o_list: DS_ShippingAPI_Shipping_Details[];
} | {
success: false;
error_desc: string;
};
interface DS_ShippingAPI_Shipping_Info_Result {
result: {
aeop_freight_calculate_result_for_buyer_d_t_o_list: DS_ShippingAPI_Shipping_Details[];
error_desc: string;
success: boolean;
aliexpress_logistics_buyer_freight_calculate_response: {
result: DS_ShippingAPI_Shipping_Info_Response;
request_id: string;
};

@@ -567,9 +695,13 @@ }

}
interface DS_ShippingAPI_Tracking_Info_Result {
details: {
details: DS_ShippingAPI_Tracking_Event[];
};
type DS_ShippingAPI_Tracking_Info_Response = {
result_success: true;
details: DS_ShippingAPI_Tracking_Event[];
official_website: string;
} | {
result_success: false;
error_desc: string;
result_success: boolean;
};
interface DS_ShippingAPI_Tracking_Info_Result {
request_id: string;
aliexpress_logistics_ds_trackinginfo_query_response: DS_ShippingAPI_Tracking_Info_Response;
}

@@ -997,14 +1129,48 @@ /**

protected sign(params: any): string;
protected call<T extends PublicParams, K>(params: T): Promise<K | undefined>;
protected execute<K extends AE_API_NAMES>(method: K, params: AE_EXECUTE_FN_PARAMS<K>): Promise<AE_EXECUTE_FN_RESULT<K> | undefined>;
protected call<T extends PublicParams, K>(params: T): ResultType<K>;
protected execute<K extends AE_API_NAMES>(method: K, params: AE_EXECUTE_FN_PARAMS<K>): Promise<{
ok: false;
message: string;
} | {
ok: true;
data: AE_EXECUTE_FN_RESULT<K>;
}>;
}
declare class AEAffiliateClient extends AEBaseClient {
declare class AESystemClient extends AEBaseClient {
constructor(init: AE_Base_Client);
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/create&methodType=GET/POST
*
*/
generateSecurityToken(args: AES_Generate_Security_Token_Params): ResultType<AES_Generate_Security_Token_Result>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/create&methodType=GET/POST
*
*/
generateToken(args: AES_Generate_Token_Params): ResultType<AES_Generate_Token_Result>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/refresh&methodType=GET/POST
*
*/
refreshSecurityToken(args: AES_Refresh_Security_Token_Params): ResultType<AES_Refresh_Security_Token_Result>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/refresh&methodType=GET/POST
*
*/
refreshToken(args: AES_Refresh_Token_Params): ResultType<AES_Refresh_Token_Result>;
}
declare class AffiliateClient extends AESystemClient {
constructor(init: AE_Base_Client);
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.link.generate&methodType=GET/POST
*
*/
generateAffiliateLinks(args: Affiliate_Generate_Affiliate_Links_Params): Promise<Affiliate_Generate_Affiliate_Links_Result | undefined>;
generateAffiliateLinks(args: Affiliate_Generate_Affiliate_Links_Params): ResultType<Affiliate_Generate_Affiliate_Links_Result>;
/**

@@ -1015,3 +1181,3 @@ *

*/
getCategories(args: Affiliate_Categories_Params): Promise<Affiliate_Categories_Result | undefined>;
getCategories(args: Affiliate_Categories_Params): ResultType<Affiliate_Categories_Result>;
/**

@@ -1022,3 +1188,3 @@ *

*/
featuredPromoInfo(args: Affiliate_Featuredpromo_Info_Params): Promise<Affiliate_Featuredpromo_Info_Result | undefined>;
featuredPromoInfo(args: Affiliate_Featuredpromo_Info_Params): ResultType<Affiliate_Featuredpromo_Info_Result>;
/**

@@ -1029,3 +1195,3 @@ *

*/
featuredPromoProducts(args: Affiliate_Featured_Promo_Products_Params): Promise<Affiliate_Featured_Promo_Products_Result | undefined>;
featuredPromoProducts(args: Affiliate_Featured_Promo_Products_Params): ResultType<Affiliate_Featured_Promo_Products_Result>;
/**

@@ -1036,3 +1202,3 @@ *

*/
getHotProductsDownload(args: Affiliate_Hotproducts_Download_Params): Promise<Affiliate_Hotproducts_Download_Result | undefined>;
getHotProductsDownload(args: Affiliate_Hotproducts_Download_Params): ResultType<Affiliate_Hotproducts_Download_Result>;
/**

@@ -1043,3 +1209,3 @@ *

*/
getHotProducts(args: Affiliate_Products_Params): Promise<Affiliate_Products_Result | undefined>;
getHotProducts(args: Affiliate_Products_Params): ResultType<Affiliate_Products_Result>;
/**

@@ -1050,73 +1216,47 @@ *

*/
orderInfo(args: Affiliate_Order_Info_Params): Promise<Affiliate_Order_Info_Result | undefined>;
orderInfo(args: Affiliate_Order_Info_Params): ResultType<Affiliate_Order_Info_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.order.list&methodType=GET/POST
*/
ordersList(args: Affiliate_Order_List_Params): Promise<Affiliate_Order_List_Result | undefined>;
ordersList(args: Affiliate_Order_List_Params): ResultType<Affiliate_Order_List_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.order.listbyindex&methodType=GET/POST
*/
ordersListByIndex(args: Affiliate_Order_List_ByIdx_Params): Promise<Affiliate_Order_List_ByIdx_Result | undefined>;
ordersListByIndex(args: Affiliate_Order_List_ByIdx_Params): ResultType<Affiliate_Order_List_ByIdx_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.productdetail.get&methodType=GET/POST
*/
productDetails(args: Affiliate_Product_Details_Params): Promise<Affiliate_Product_Details_Result | undefined>;
productDetails(args: Affiliate_Product_Details_Params): ResultType<Affiliate_Product_Details_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.product.query&methodType=GET/POST
*/
queryProducts(args: Affiliate_Products_Params): Promise<Affiliate_Products_Result | undefined>;
queryProducts(args: Affiliate_Products_Params): ResultType<Affiliate_Products_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.product.smartmatch&methodType=GET/POST
*/
smartMatchProducts(args: Affiliate_Smart_Match_Products_Params): Promise<Affiliate_Smart_Match_Products_Result | undefined>;
smartMatchProducts(args: Affiliate_Smart_Match_Products_Params): ResultType<Affiliate_Smart_Match_Products_Result>;
}
declare class AESystemClient extends AEBaseClient {
declare class DropshipperClient extends AESystemClient {
constructor(init: AE_Base_Client);
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/create&methodType=GET/POST
*
*/
generateSecurityToken(args: AES_Generate_Security_Token_Params): Promise<AES_Generate_Security_Token_Result | undefined>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/create&methodType=GET/POST
*
*/
generateToken(args: AES_Generate_Token_Params): Promise<AES_Generate_Token_Result | undefined>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/refresh&methodType=GET/POST
*
*/
refreshSecurityToken(args: AES_Refresh_Security_Token_Params): Promise<AES_Refresh_Security_Token_Result | undefined>;
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/refresh&methodType=GET/POST
*
*/
refreshToken(args: AES_Refresh_Token_Params): Promise<AES_Refresh_Token_Result | undefined>;
}
declare class AEDSClient extends AESystemClient {
constructor(init: AE_Base_Client);
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.buyer.freight.calculate&methodType=GET/POST
*/
shippingInfo(args: DS_ShippingAPI_Shipping_Info_Params): Promise<DS_ShippingAPI_Shipping_Info_Result | undefined>;
shippingInfo(args: DS_ShippingAPI_Shipping_Info_Arguments): ResultType<DS_ShippingAPI_Shipping_Info_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.ds.trackinginfo.query&methodType=GET/POST
*/
trackingInfo(args: DS_ShippingAPI_Tracking_Info_Params): Promise<DS_ShippingAPI_Tracking_Info_Result | undefined>;
trackingInfo(args: DS_ShippingAPI_Tracking_Info_Params): ResultType<DS_ShippingAPI_Tracking_Info_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.add.info&methodType=GET/POST
*/
addDropshippingInfo(args: DS_Add_Info_Arguments): ResultType<DS_Add_Info_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.image.search&methodType=GET/POST
*/
searchByImage(args: DS_Image_Search_Params): ResultType<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<DS_ProductAPI_Recommended_Products_Result | undefined>;
queryfeaturedPromoProducts(args: DS_ProductAPI_Recommended_Products_Params): ResultType<DS_ProductAPI_Recommended_Products_Result>;
/**

@@ -1128,25 +1268,29 @@ * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.trade.buy.placeorder&methodType=GET/POST

product_items: AE_Product_Item[];
}): Promise<DS_OrderAPI_Place_Order_Result | undefined>;
}): ResultType<DS_OrderAPI_Place_Order_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.trade.ds.order.get&methodType=GET/POST
*/
orderDetails(args: DS_OrderAPI_Get_Order_Params): Promise<DS_OrderAPI_Get_Order_Result | undefined>;
orderDetails(args: DS_OrderAPI_Get_Order_Params): ResultType<DS_OrderAPI_Get_Order_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.feedname.get&methodType=GET/POST
*/
queryFeaturedPromos(args: DS_Feedname_Params): ResultType<DS_Feedname_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.category.get&methodType=GET/POST
*/
getCategories(args: Affiliate_Categories_Params): ResultType<Affiliate_Categories_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.commissionorder.listbyindex&methodType=GET/POST
*/
ordersListByIndex(args: DS_Orders_ByIdx_Params): ResultType<DS_Orders_ByIdx_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.member.orderdata.submit&methodType=GET/POST
*/
submitOrderData(args: DS_Order_Submit_Params): ResultType<DS_Order_Submit_Result>;
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST
*/
productDetails(args: DS_ProductAPI_Product_Params): Promise<DS_ProductAPI_Product_Result | undefined>;
productDetails(args: DS_ProductAPI_Product_Params): ResultType<DS_ProductAPI_Product_Result>;
}
export { AEAffiliateClient, AEDSClient, AES_Access_Token_Result, AES_Base_Access_Token_Result, AES_Generate_Security_Token_Params, AES_Generate_Security_Token_Result, AES_Generate_Token_Params, AES_Generate_Token_Result, AES_Refresh_Security_Token_Params, AES_Refresh_Security_Token_Result, AES_Refresh_Token_Params, AES_Refresh_Token_Result, AE_AFFILIATE_EXECUTE_FN_PARAMS, AE_AFFILIATE_EXECUTE_FN_RESULT, AE_AFFILIATE_SERVICE, AE_API_NAMES, AE_Base_Client, AE_DROPSHIPPING_SERVICE, AE_DS_EXECUTE_FN_PARAMS, AE_DS_EXECUTE_FN_RESULT, AE_EXECUTE_FN_METHODS, AE_EXECUTE_FN_PARAMS, AE_EXECUTE_FN_RESULT, AE_Error_Response, AE_Logistics_Address, AE_Platform_Type, AE_Product_Item, AE_Response_Format, AE_SERVICE, AE_SYSTEM_EXECUTE_FN_PARAMS, AE_SYSTEM_EXECUTE_FN_RESULT, AE_SYSTEM_SERVICE, AFFILIATE_API_NAMES, Affiliate_Base_Product_Details, Affiliate_Base_Product_Params, Affiliate_Categories, Affiliate_Categories_Params, Affiliate_Categories_Result, Affiliate_Category_Details, Affiliate_Featured_Promo_Product, Affiliate_Featured_Promo_Products_Params, Affiliate_Featured_Promo_Products_Result, Affiliate_Featuredpromo_Details, Affiliate_Featuredpromo_Info, Affiliate_Featuredpromo_Info_Params, Affiliate_Featuredpromo_Info_Result, Affiliate_Generate_Affiliate_Links, Affiliate_Generate_Affiliate_Links_Params, Affiliate_Generate_Affiliate_Links_Result, Affiliate_Hotproducts, Affiliate_Hotproducts_Download, Affiliate_Hotproducts_Download_Params, Affiliate_Hotproducts_Download_Result, Affiliate_Hotproducts_Params, Affiliate_Hotproducts_Result, Affiliate_Order_Details, Affiliate_Order_Info, Affiliate_Order_Info_Params, Affiliate_Order_Info_Result, Affiliate_Order_List, Affiliate_Order_List_ByIdx, Affiliate_Order_List_ByIdx_Params, Affiliate_Order_List_ByIdx_Result, Affiliate_Order_List_Params, Affiliate_Order_List_Result, Affiliate_Product_Details, Affiliate_Product_Details_Params, Affiliate_Product_Details_Result, Affiliate_Product_Promo_Code_Info, Affiliate_Products, Affiliate_Products_Params, Affiliate_Products_Result, Affiliate_Promo_Link, Affiliate_Smart_Match_Products_Params, Affiliate_Smart_Match_Products_Result, DS_API_NAMES, DS_OrderAPI_Get_Order, DS_OrderAPI_Get_Order_Params, DS_OrderAPI_Get_Order_Result, DS_OrderAPI_Logistics_Info, DS_OrderAPI_Place_Order_Params, DS_OrderAPI_Place_Order_Result, DS_OrderAPI_Price, DS_OrderAPI_Product_Info, DS_OrderAPI_Store_Info, DS_ProductAPI_Product, DS_ProductAPI_Product_Attributes, DS_ProductAPI_Product_Base_Info, DS_ProductAPI_Product_Detail_Params, DS_ProductAPI_Product_Detail_Result, DS_ProductAPI_Product_Details, DS_ProductAPI_Product_Id_Converter, DS_ProductAPI_Product_Multimedia, DS_ProductAPI_Product_Multimedia_Videos, DS_ProductAPI_Product_Package_Info, DS_ProductAPI_Product_Params, DS_ProductAPI_Product_Result, DS_ProductAPI_Product_SKU_Properties, DS_ProductAPI_Product_SKU_Variation, DS_ProductAPI_Product_Shipping_Info, DS_ProductAPI_Product_Store_Info, DS_ProductAPI_Recommended_Product, DS_ProductAPI_Recommended_Products, DS_ProductAPI_Recommended_Products_Params, DS_ProductAPI_Recommended_Products_Result, DS_ProductAPI_Store_Info, DS_ShippingAPI_Freight_Info, DS_ShippingAPI_Shipping_Details, DS_ShippingAPI_Shipping_Info_Params, DS_ShippingAPI_Shipping_Info_Result, DS_ShippingAPI_Tracking_Event, DS_ShippingAPI_Tracking_Info_Params, DS_ShippingAPI_Tracking_Info_Result, PublicParams, SYSTEM_API_NAMES };
export { AffiliateClient, DropshipperClient };

@@ -60,4 +60,4 @@ "use strict";

__export(src_exports, {
AEAffiliateClient: () => AEAffiliateClient,
AEDSClient: () => AEDSClient
AffiliateClient: () => AffiliateClient,
DropshipperClient: () => DropshipperClient
});

@@ -99,6 +99,12 @@ module.exports = __toCommonJS(src_exports);

const res = yield fetch(basestring, { method: "POST" });
return yield res.json();
const data = yield res.json();
return res.ok ? { ok: true, data } : {
ok: false,
message: "Bad request."
};
} catch (error) {
console.error(error);
return;
return {
ok: false,
message: "Internal error."
};
}

@@ -123,4 +129,51 @@ });

// src/utils/system_client.ts
var AESystemClient = class extends AEBaseClient {
constructor(init) {
super(init);
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/create&methodType=GET/POST
*
*/
generateSecurityToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/security/create", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/create&methodType=GET/POST
*
*/
generateToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/create", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/refresh&methodType=GET/POST
*
*/
refreshSecurityToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/security/refresh", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/refresh&methodType=GET/POST
*
*/
refreshToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/refresh", args);
});
}
};
// src/utils/affiliate_client.ts
var AEAffiliateClient = class extends AEBaseClient {
var AffiliateClient = class extends AESystemClient {
constructor(init) {

@@ -244,51 +297,4 @@ super(init);

// src/utils/system_client.ts
var AESystemClient = class extends AEBaseClient {
constructor(init) {
super(init);
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/create&methodType=GET/POST
*
*/
generateSecurityToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/security/create", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/create&methodType=GET/POST
*
*/
generateToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/create", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/refresh&methodType=GET/POST
*
*/
refreshSecurityToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/security/refresh", args);
});
}
/**
*
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/refresh&methodType=GET/POST
*
*/
refreshToken(args) {
return __async(this, null, function* () {
return yield this.execute("/auth/token/refresh", args);
});
}
};
// src/utils/ds_client.ts
var AEDSClient = class extends AESystemClient {
var DropshipperClient = class extends AESystemClient {
constructor(init) {

@@ -302,6 +308,5 @@ super(init);

return __async(this, null, function* () {
return yield this.execute(
"aliexpress.logistics.buyer.freight.calculate",
args
);
return yield this.execute("aliexpress.logistics.buyer.freight.calculate", {
param_aeop_freight_calculate_for_buyer_d_t_o: JSON.stringify(args)
});
});

@@ -323,7 +328,17 @@ }

*/
// todo: add ds info
addDropshippingInfo(args) {
return __async(this, null, function* () {
return yield this.execute("aliexpress.ds.add.info", {
param0: JSON.stringify(args)
});
});
}
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.image.search&methodType=GET/POST
*/
// todo: ae dropshiper image search
searchByImage(args) {
return __async(this, null, function* () {
return yield this.execute("aliexpress.ds.image.search", args);
});
}
/**

@@ -364,15 +379,34 @@ * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST

*/
// todo: add ds feedname get
queryFeaturedPromos(args) {
return __async(this, null, function* () {
return yield this.execute("aliexpress.ds.feedname.get", args);
});
}
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.category.get&methodType=GET/POST
*/
// todo: add ds get category
getCategories(args) {
return __async(this, null, function* () {
return yield this.execute("aliexpress.ds.category.get", args);
});
}
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.commissionorder.listbyindex&methodType=GET/POST
*/
// todo: add ds order query by index
ordersListByIndex(args) {
return __async(this, null, function* () {
return yield this.execute(
"aliexpress.ds.commissionorder.listbyindex",
args
);
});
}
/**
* @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.member.orderdata.submit&methodType=GET/POST
*/
// todo: add ds order submit
submitOrderData(args) {
return __async(this, null, function* () {
return yield this.execute("aliexpress.ds.member.orderdata.submit", args);
});
}
/**

@@ -389,4 +423,4 @@ * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST

0 && (module.exports = {
AEAffiliateClient,
AEDSClient
AffiliateClient,
DropshipperClient
});
{
"name": "ae_sdk",
"version": "0.3.2",
"version": "0.3.3",
"description": "A simple SDK for Aliexpress (dropshipping and affiliate) APIs.",

@@ -5,0 +5,0 @@ "private": false,

@@ -13,6 +13,6 @@ # AE_SDK

# using npm
npm i -D ae_sdk
npm i ae_sdk
# using pnpm
pnpm add -D ae_sdk
pnpm add ae_sdk

@@ -26,13 +26,34 @@ # using yarn

```ts
// step 1: import the AE affiliate (`AEAffiliateClient`) or dropshipping (`AEDSClient`) client
import { AEAffiliateClient /* AEDSClient */ } from "ae_sdk";
// step 1: import the AE affiliate (`AffiliateClient`) or dropshipping (`DropshipperClient`) client
import { DropshipperClient /* AffiliateClient */ } from "ae_sdk";
// step 2: initilize the client
const client = new AEAffiliateClient({
const client = new DropshipperClient({
app_key: "123",
app_secret: "123456abcdef",
session: "oauth_access_token",
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
});
// step 3: you are all set !
const result = await client.productDetails({
product_id: 1005004043442825,
ship_to_country: "DZ",
target_currency: "USD",
target_language: "en",
});
console.log(result);
/* Console:
{
ok: true,
data: {
aliexpress_ds_product_get_response: {
result: {...},
rsp_code: 200,
rsp_msg: 'Call succeeds',
request_id: "..."
}
}
}
*/
```

@@ -42,5 +63,4 @@

- Update ds APIs according to [aliexpress official website](https://open.aliexpress.com/doc/api.htm#/api);
- Add better error handling and fix resp_result / error_result;
- Add in code documentation using `jsdoc`;
- Fix method result types
- Add unit tests;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc