hendt / ebay-api

eBay Node API in TypeScript for Node and Browser with RESTful and Traditional APIs. This library aims to implement all available eBay apis.
https://hendt.gitbook.io/ebay-api
MIT License
148 stars 40 forks source link

Some issues/missing features in Sell Feed & Marketing APIs #120

Closed IA21 closed 1 year ago

IA21 commented 2 years ago

I've implemented a bunch of api calls from the Sell Feed and Sell Marketing APIs and have noticed some issues in the sdk. I have modified my own copy of the sdk and made the things work but I am also submitting them here for others to look into in detail and check if they're compatible with rest of the API calls or if they break functionality. I apologize for not making these proper pull requests. I only had a limited set of calls to implement and have to move on to other projects now.

There's 3 sets of changes I have made:

  1. sell/marketing/getAds() listingIds parameter type switched from number to string (as per docs)

    • ebay-api\lib\api\restful\sell\marketing\index.d.ts (number -> string)
  2. added buffered response support to sell/feed/getResultFile() (thanks to @Borduhh's pull request for giving me a hint for this. docs say it might not always return compressed data so might break other calls. worked for LMS calls such as AddFixedPriceItem and ActiveInventoryReport):

    • ebay-api\lib\api\restful\sell\feed\index.d.ts (return type Promise for getResultFile())
    • ebay-api\lib\api\restful\sell\feed\index.js (added responseType: 'arraybuffer' to getResultFile() return statement)
  3. added sell/feed/createInventoryTask call. The other inventory_task calls are also missing but turns out we can just use the regular getTask/getTasks with these as well so I did not bother implementing the other 2 calls.

    • ebay-api\lib\api\restful\sell\feed\index.d.ts:
      /**
      * @param data The CreateInventoryTaskRequest.
      */
      createInventoryTask(data: any): Promise<any>;
    • ebay-api\lib\api\restful\sell\feed\index.js:
      /**
      * @param data The CreateInventoryTaskRequest.
      */
      createInventoryTask(data) {
      return this.post(`/inventory_task`, data);
      }
dantio commented 2 years ago

@IA21 Thank you for reporting these issues. I'll work on it.