From 200e84cf2df45f225d416e8ddc39918b81ddad66 Mon Sep 17 00:00:00 2001 From: Tyson Cleary Date: Mon, 19 Dec 2016 11:36:02 -0600 Subject: [PATCH] Don't decode CSV results Fixes #53 --- lib/client.js | 13 +++---------- package.json | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/client.js b/lib/client.js index 567787d..3b7dfef 100644 --- a/lib/client.js +++ b/lib/client.js @@ -8,7 +8,6 @@ const request = require('request'); const tls = require('tls'); const parser = require('xml2json'); const Type = require('./types'); -const iconv = require('iconv-lite'); Promise.promisifyAll(request); @@ -22,10 +21,6 @@ function getMetadata(data) { return data[_.keys(data)[0]].ResponseMetadata; } -function hasNext(result) { - -} - class AmazonMwsClient { /** * Constructor for the main MWS client interface used to make api calls and @@ -47,7 +42,8 @@ class AmazonMwsClient { max_backoff: 10000, max_attempts: Infinity, attempt: -1, - contentType: 'application/x-www-form-urlencoded' + contentType: 'application/x-www-form-urlencoded', + parseCSVResult: (data) => Promise.resolve(data) } }); @@ -135,10 +131,7 @@ class AmazonMwsClient { const body = response.body; if (body.slice(0, 5) !== ' ({ result, metadata: null })); } const data = JSON.parse(parser.toJson(body)); diff --git a/package.json b/package.json index 08b1c61..490449e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ }, "dependencies": { "bluebird": "^3.4.4", - "iconv-lite": "^0.4.13", "lodash": "^4.17.0", "request": "^2.79.0", "xml": "^1.0.1",