teamcity
Advanced tools
Comparing version 0.0.1 to 0.0.2
(function() { | ||
var Build, Client, VcsRootInstance, request; | ||
var Build, BuildQueue, Change, Client, VcsRootInstance, request; | ||
@@ -8,2 +8,6 @@ request = require('request'); | ||
BuildQueue = require('./build-queue'); | ||
Change = require('./change'); | ||
VcsRootInstance = require('./vcs-root-instance'); | ||
@@ -40,5 +44,8 @@ | ||
return request(options, function(err, response, body) { | ||
var obj; | ||
obj = JSON.parse(body); | ||
return cb(err, obj); | ||
if (typeof body === 'string') { | ||
body = JSON.parse(body); | ||
} | ||
if (cb) { | ||
return cb(err, body); | ||
} | ||
}); | ||
@@ -57,2 +64,5 @@ }; | ||
}; | ||
if (typeof params === 'function') { | ||
cb = params; | ||
} | ||
return this._call(options, cb); | ||
@@ -68,3 +78,4 @@ }; | ||
headers: { | ||
'Accept': 'application/json' | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json' | ||
} | ||
@@ -92,2 +103,10 @@ }; | ||
Client.prototype.buildQueue = function() { | ||
return new BuildQueue(this); | ||
}; | ||
Client.prototype.change = function(locator) { | ||
return new Change(locator, this); | ||
}; | ||
Client.prototype.vcsRootInstance = function(id) { | ||
@@ -94,0 +113,0 @@ return new VcsRootInstance(id, this); |
{ | ||
"name": "teamcity", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "TeamCity API", | ||
@@ -5,0 +5,0 @@ "author": "Jeff Knaggs", |
7803
14
169