diff --git a/lib/index.d.ts b/lib/index.d.ts index edd5fb3..fc7ed0a 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -278,7 +278,7 @@ export type GetMatchingProductReturn = Array<{ asin?: string, upc?: string, // any other identifier types that might come up? id: string, - idType: string, + idType: IdTypes, Error?: Error, }>; @@ -369,10 +369,9 @@ export type GetProductCategoriesReturn = Array<{ Self: ProductCategory, }>; -export type IdType = 'ASIN' | 'SKU'; // TODO: pretty sure there are more. export type GetFeesParams = { marketplaceId: MarketplaceId, - idType: IdType; + idType: IdTypes; idValue: string, isAmazonFulfilled: boolean, identifier: string, @@ -390,7 +389,7 @@ export type GetFeesReturn = { [key: string]: { identifier: { marketplaceId: MarketplaceId, - idType: IdType; + idType: IdTypes; sellerId: string, sellerInputIdentifier: string, isAmazonFulfilled: boolean, @@ -491,6 +490,15 @@ export type UpdateReportAcknowledgementsReturn = any; export type GetReportScheduleListParams = { ReportTypeList?: Array }; export type GetReportScheduleListReturn = any; +export type IdTypes = + | 'ASIN' + | 'GCID' + | 'SellerSKU' + | 'UPC' + | 'EAN' + | 'ISBN' + | 'JAN'; + export default class MwsAdvanced { static constants: { MWS_MARKETPLACES: MWS_MARKETPLACES, @@ -531,8 +539,8 @@ export default class MwsAdvanced { static listInventorySupply(params: ListInventorySupplyParams): Promise; listMatchingProducts(params: { marketplaceId: string, query: string }): Promise; static listMatchingProducts(params: { marketplaceId: string, query: string }): Promise; - getMatchingProductForId(params: { MarketplaceId: string, IdType: string, IdList: Array }): Promise; - static getMatchingProductForId(params: { MarketplaceId: string, IdType: string, IdList: Array }): Promise; + getMatchingProductForId(params: { MarketplaceId: string, IdType: IdTypes, IdList: Array }): Promise; + static getMatchingProductForId(params: { MarketplaceId: string, IdType: IdTypes, IdList: Array }): Promise; // TODO: We need to unify whether we use ASIN or Asin (all caps or not) in function names getLowestPricedOffersForAsin(params: GetLowestPricedOffersForAsinParams): Promise;