Pygmy
The semi official nodejs module (employee maintained)
Introduction
This library provides a Nodejs interface to publicly available (beta) API for TradeGecko.
If you are unfamiliar with the TradeGecko API, you can read the documentation located at http://developer.tradegecko.com
Installation
npm i billybonks\pygmy -save
Basic Usage
var pygmy = token:yourTokencleintId:clientIdsecret:secret pygmyproductsall
Finding Records
pygmyproductsallpygmyproductspygmyproductspygmyproducts
query hash will be converted into url encoded query string
Identity Map
in development
Building Records
Create
pygmy.products.build(attribute_hash)
Each key should map to an attribute defined in api documentation, invalid keys will result in an error from the server
pygmycompanies;
Update
pygmyproducts
Delete
pygmyproducts
Errors
Errors always return in the format
{message:message,statusCode:statusCode}
nothing says it more then showing you the code that generates returns from http requests
TODO
- Basic Identity Mapping
- Relationship declerations (if needed for perf gains)
- Instrumentation
- OAuth
- Build Test suite
- Add All Routes
Contributing
- Fork it ( http://github.com/billybonks/pygmy/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Missing route?
Just add pygmy['addresses'] = routes.build(pygmy,'addresses');
where addresses is the endpoint name shown in api (they are always plural), to pygmy.js.