qebayapi

0.2.1 • Public • Published

qebayapi

Promise oriented ebay api interface. Trading API.

eBay Trading API support xml and soap. This implementation use xml interface. It is almost asynchronous via Kriskoval's Q implemenation of promise.

Just one call now.

var ebayapi = require("qebayapi");

var options = {appName: '...','appCert':'...','devName':'...','callname':'GetItem','requestJSON':{'ItemID':'341341341'}, parseMode: 'json' };

ebayapi.TradingApi(options)
.then(function(response) {
  console.log(response.response.Ack);
  console.log('response': response.response);
});

It use q-io, so it is almost asynchronous, something could be improved in this field for request xml creation phase.

Code improvements

Separate concerns:

  1. request creation in its own class, then use strategy pattern: what is rMode (request mode)? 'json', 'xmlNode', 'xmlString' and ... how to extend it? function or {preparse:function(opts), create:function(opts), createHeaders: function(opts) }
  2. parse response: parseMode == 'json' or ... function(opts)

Rationale:

  • testing: make ebayXml2JsonParse testable
  • improving api. i.e. callname based options

Readme

Keywords

Package Sidebar

Install

npm i qebayapi

Weekly Downloads

2

Version

0.2.1

License

MIT

Last publish

Collaborators

  • danielecr