Comparing version 0.1.1 to 0.2.0
var api = require('./lib/api'); | ||
var _ = require('underscore'); | ||
var createClient = exports = module.exports = function(apiUrl, apiVersion, clientId, clientSecret) { | ||
var createClient = exports = module.exports = function(apiUrl, clientId, clientSecret) { | ||
var client = _.extend({}, api); | ||
client.init(); | ||
client.set('url', apiUrl); | ||
client.set('version', apiVersion); | ||
client.set('clientId', clientId); | ||
@@ -10,0 +9,0 @@ client.set('clientSecret', clientSecret); |
@@ -19,3 +19,3 @@ var request = require('request'); | ||
api.urlFor = function(resource, id) { | ||
var url = this.settings.url + '/v' + this.settings.version + '/' + resource; | ||
var url = this.settings.url + '/' + resource; | ||
if (id) { | ||
@@ -73,2 +73,6 @@ url = url + '/' + id; | ||
api.getResult = function(resource, id, parameters) { | ||
return this.get(resource, id, parameters).get('result'); | ||
}; | ||
api.index = function(resource, parameters) { | ||
@@ -75,0 +79,0 @@ return this.getToken().then(_.bind(function(token) { |
{ | ||
"name": "tol-api", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "TraderOnline api client", | ||
"dependencies": { | ||
"q": "~0.9.7", | ||
"request": "~2.27", | ||
"underscore": "~1.5" | ||
"q": "~1.0", | ||
"request": "~2.34", | ||
"underscore": "~1.6" | ||
} | ||
} |
4724
106
+ Addedaws-sign2@0.5.0(transitive)
+ Addedq@1.0.1(transitive)
+ Addedrequest@2.34.0(transitive)
+ Addedtldts@6.1.76(transitive)
+ Addedtldts-core@6.1.76(transitive)
+ Addedtough-cookie@5.1.0(transitive)
+ Addedunderscore@1.6.0(transitive)
- Removedaws-sign@0.3.0(transitive)
- Removedcookie-jar@0.3.0(transitive)
- Removedq@0.9.7(transitive)
- Removedrequest@2.27.0(transitive)
- Removedunderscore@1.5.2(transitive)
Updatedq@~1.0
Updatedrequest@~2.34
Updatedunderscore@~1.6