diff --git a/CHANGELOG.md b/CHANGELOG.md index 832b50d..5833b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # ae_sdk +## 0.4.15 + +### Patch Changes + +- Fix affiliate API endpoint (get feature promo) error + ## 0.4.14 ### Patch Changes diff --git a/package.json b/package.json index eed6c16..23cc933 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ae_sdk", - "version": "0.4.14", + "version": "0.4.15", "description": "A simple SDK for Aliexpress (dropshipping and affiliate) APIs.", "private": false, "main": "./dist/index.js", diff --git a/src/types/affiliate.ts b/src/types/affiliate.ts index a4ae517..f3db07a 100644 --- a/src/types/affiliate.ts +++ b/src/types/affiliate.ts @@ -313,7 +313,7 @@ export interface Affiliate_Featuredpromo_Details { export interface Affiliate_Featuredpromo_Info { current_record_count: number; - promos: Affiliate_Featuredpromo_Details; + promos: Affiliate_Featuredpromo_Details[]; } export interface Affiliate_Featuredpromo_Info_Response { @@ -323,7 +323,9 @@ export interface Affiliate_Featuredpromo_Info_Response { } export interface Affiliate_Featuredpromo_Info_Result { - aliexpress_affiliate_featuredpromo_get_response: Affiliate_Featuredpromo_Info_Response; + aliexpress_affiliate_featuredpromo_get_response: { + resp_result: Affiliate_Featuredpromo_Info_Response; + }; } /** diff --git a/src/utils/affiliate_client.ts b/src/utils/affiliate_client.ts index 8912a0b..cdf4061 100644 --- a/src/utils/affiliate_client.ts +++ b/src/utils/affiliate_client.ts @@ -76,10 +76,10 @@ export class AffiliateClient extends AESystemClient { ); if (response.ok) { let data = - response.data.aliexpress_affiliate_featuredpromo_get_response.result - .promos; - if ((data as any).promo) { - data = (data as any).promo; + response.data.aliexpress_affiliate_featuredpromo_get_response + .resp_result.result; + if ((data.promos as any).promo) { + data.promos = (data.promos as any).promo; } } return response;