octonode
Advanced tools
Comparing version 0.6.4 to 0.6.5
@@ -153,3 +153,3 @@ // Generated by CoffeeScript 1.7.1 | ||
_url = url.format({ | ||
protocol: "https:", | ||
protocol: this.options && this.options.protocol || "https:", | ||
auth: typeof this.token === 'object' && this.token.username ? "" + this.token.username + ":" + this.token.password : '', | ||
@@ -253,2 +253,20 @@ hostname: this.options && this.options.hostname || "api.github.com", | ||
Client.prototype.patch = function(path, content, callback) { | ||
return this.request(this.requestOptions({ | ||
uri: this.buildUrl(path), | ||
method: 'PATCH', | ||
body: JSON.stringify(content), | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
}), (function(_this) { | ||
return function(err, res, body) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
return _this.errorHandle(res, body, callback); | ||
}; | ||
})(this)); | ||
}; | ||
Client.prototype.put = function(path, content, callback) { | ||
@@ -255,0 +273,0 @@ return this.request(this.requestOptions({ |
@@ -371,2 +371,18 @@ // Generated by CoffeeScript 1.7.1 | ||
Me.prototype.notifications = function(options, cb) { | ||
if (options == null) { | ||
options = {}; | ||
} | ||
return this.client.get("/notifications", options, function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s !== 200) { | ||
return cb(new Error('User info error')); | ||
} else { | ||
return cb(null, b, h); | ||
} | ||
}); | ||
}; | ||
return Me; | ||
@@ -373,0 +389,0 @@ |
@@ -116,3 +116,3 @@ // Generated by CoffeeScript 1.7.1 | ||
} | ||
if (s !== 200) { | ||
if (s !== 201) { | ||
return cb(new Error('Org createTeam error')); | ||
@@ -119,0 +119,0 @@ } else { |
@@ -172,4 +172,6 @@ // Generated by CoffeeScript 1.7.1 | ||
Repo.prototype.branches = function(cb) { | ||
return this.client.get("/repos/" + this.name + "/branches", function(err, s, b, h) { | ||
Repo.prototype.branches = function() { | ||
var cb, params, _i, _ref; | ||
params = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; | ||
return (_ref = this.client).get.apply(_ref, ["/repos/" + this.name + "/branches"].concat(__slice.call(params), [function(err, s, b, h) { | ||
if (err) { | ||
@@ -183,3 +185,3 @@ return cb(err); | ||
} | ||
}); | ||
}])); | ||
}; | ||
@@ -186,0 +188,0 @@ |
{ | ||
"name": "octonode", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"author": "Pavan Kumar Sunkara <pavan.sss1991@gmail.com> (http://pksunkara.github.com)", | ||
@@ -5,0 +5,0 @@ "description": "nodejs wrapper for github v3 api", |
@@ -15,3 +15,3 @@ # octonode [![Gitter chat](https://badges.gitter.im/pksunkara/octonode.png)](https://gitter.im/pksunkara/octonode) | ||
// Then we instanciate a client with or without a token (as show in a later section) | ||
// Then we instantiate a client with or without a token (as show in a later section) | ||
@@ -487,2 +487,4 @@ var ghme = client.me(); | ||
This query supports [pagination](#pagination). | ||
```js | ||
@@ -489,0 +491,0 @@ ghrepo.branches(callback); //array of branches |
101510
2247
1204