ebay-promised
Advanced tools
Comparing version 1.3.0 to 1.4.0
// Generated by CoffeeScript 1.9.1 | ||
module.exports = ["authToken", "cert", "devName", 'serviceName', 'appId', "sandbox", "site", "app", "raw", "perPage"]; | ||
module.exports = ["authToken", "cert", "devName", 'serviceName', 'appId', "sandbox", "site", "app", "raw", "perPage", "callsPerEpoc", "epoc"]; |
@@ -42,3 +42,5 @@ // Generated by CoffeeScript 1.9.1 | ||
raw: false, | ||
perPage: 100 | ||
perPage: 100, | ||
callsPerEpoc: 3, | ||
epoc: 1000 | ||
} | ||
@@ -79,4 +81,15 @@ }; | ||
function Ebay() { | ||
this.wrappedRequest = limit(request).to(3).per(1000); | ||
function Ebay(options) { | ||
var i, len, ref, setting; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
ref = Object.keys(options); | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
setting = ref[i]; | ||
if (this.respondsTo(setting)) { | ||
this[setting](options[setting]); | ||
} | ||
} | ||
this.__request__ = limit(this.__request__.bind(this)).to(this.callsPerEpoc()).per(this.epoc()); | ||
this; | ||
@@ -93,2 +106,7 @@ } | ||
Ebay.prototype.reset = function() { | ||
this.__fields__ = defaults.__fields__; | ||
return this; | ||
}; | ||
Ebay.prototype.endpoint = function() { | ||
@@ -131,3 +149,3 @@ if (!endpoints[this.serviceName()]) { | ||
Ebay.prototype.__build__ = function(pageNumber) { | ||
var body, doc, xml; | ||
var body, doc; | ||
if (pageNumber == null) { | ||
@@ -146,5 +164,3 @@ pageNumber = 1; | ||
doc[(this.op()) + "Request xmlns=\"urn:ebay:apis:eBLBaseComponents\""] = _.extend.apply(_, body); | ||
debug(this.endpoint()); | ||
xml = o2x(doc); | ||
return xml; | ||
return o2x(doc); | ||
}; | ||
@@ -167,3 +183,4 @@ | ||
} | ||
req = this.wrappedRequest.post({ | ||
debug("starting request..."); | ||
req = request.post({ | ||
url: this.endpoint(), | ||
@@ -170,0 +187,0 @@ body: this.__build__(page), |
@@ -127,3 +127,2 @@ // Generated by CoffeeScript 1.9.1 | ||
parsed = {}; | ||
debug("[normalizingResponse] ..."); | ||
root = results[(this.op()) + "Response"]; | ||
@@ -130,0 +129,0 @@ keys = Lazy(Object.keys(root)); |
{ | ||
"name": "ebay-promised", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "promise wrapped Ebay requests with sensible response parsers", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
133574
19
517
1
82