Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
tighten up IdTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericblade committed Jul 8, 2020
1 parent 2f53668 commit 4abba99
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}>;

Expand Down Expand Up @@ -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,
Expand All @@ -390,7 +389,7 @@ export type GetFeesReturn = {
[key: string]: {
identifier: {
marketplaceId: MarketplaceId,
idType: IdType;
idType: IdTypes;
sellerId: string,
sellerInputIdentifier: string,
isAmazonFulfilled: boolean,
Expand Down Expand Up @@ -491,6 +490,15 @@ export type UpdateReportAcknowledgementsReturn = any;
export type GetReportScheduleListParams = { ReportTypeList?: Array<string> };
export type GetReportScheduleListReturn = any;

export type IdTypes =
| 'ASIN'
| 'GCID'
| 'SellerSKU'
| 'UPC'
| 'EAN'
| 'ISBN'
| 'JAN';

export default class MwsAdvanced {
static constants: {
MWS_MARKETPLACES: MWS_MARKETPLACES,
Expand Down Expand Up @@ -531,8 +539,8 @@ export default class MwsAdvanced {
static listInventorySupply(params: ListInventorySupplyParams): Promise<ListInventorySupplyReturn>;
listMatchingProducts(params: { marketplaceId: string, query: string }): Promise<ListMatchingProductsReturn>;
static listMatchingProducts(params: { marketplaceId: string, query: string }): Promise<ListMatchingProductsReturn>;
getMatchingProductForId(params: { MarketplaceId: string, IdType: string, IdList: Array<string> }): Promise<GetMatchingProductReturn>;
static getMatchingProductForId(params: { MarketplaceId: string, IdType: string, IdList: Array<string> }): Promise<GetMatchingProductReturn>;
getMatchingProductForId(params: { MarketplaceId: string, IdType: IdTypes, IdList: Array<string> }): Promise<GetMatchingProductReturn>;
static getMatchingProductForId(params: { MarketplaceId: string, IdType: IdTypes, IdList: Array<string> }): Promise<GetMatchingProductReturn>;

// TODO: We need to unify whether we use ASIN or Asin (all caps or not) in function names
getLowestPricedOffersForAsin(params: GetLowestPricedOffersForAsinParams): Promise<GetLowestPricedOffersReturn>;
Expand Down

0 comments on commit 4abba99

Please sign in to comment.