eibbors / mws-js

Complete Amazon marketplace web services client for Node.js.
86 stars 102 forks source link

Implementation of the Reports API + some bugfixes #4

Closed zaro closed 11 years ago

zaro commented 11 years ago

First I want to say thank you for this great client, first I tried using the PHP one provided from Amazon but it is softly speaking pathetic. So since I really like node recently I found your client. I was thinking to give coffescript a try so I started with the unstable branch and it is amazing. Pleasure to work with compared to the Amazon provided clients. Anyway, I saw reports API is still missing in unstable, so I took the time to implement it trying to follow as much as possible the conventions in the other clients. I thinks it is good now, it seems working and by the way I had to fix some things on the way :) Also I changed some thing in the core client which are needed for some Reports functionality. For example allow other that xml content types, and proper handling of binary data.

Hope this is useful :)

Bugfixes :

Now MWSClient is using the locale constructor parameter but later overrides the values with what is specified in options and or default values. First commit fixes this.

The second is fixing inconsistent behaviour of .getNext for NextToken calls. There are two substantial problems. First one is when getNext is invoking callback directly with response object, while for example listorders will pass (orders, response) . I think it makes more sense to be able to process the data with the same callback. Second once .getNext is called the response it passes to the callback is missing .nextToken because the invoke in .getNext is missing the nextTokenCall parameter.

When using bool parameters , parameters with false value are not included in the query.

MWSEnum was previously overriding the @member with empty array.

Products client : GetMatchingProduct had marketplaceid parameter incorrectly specified, rendering the call unusable. Also added GetMatchingProductForId .