octonode
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -380,3 +380,3 @@ // Generated by CoffeeScript 1.7.1 | ||
if (s !== 200) { | ||
return cb(new Error('User info error')); | ||
return cb(new Error('User notification error')); | ||
} else { | ||
@@ -388,2 +388,46 @@ return cb(null, b, h); | ||
Me.prototype.checkWatching = function(repo, cb) { | ||
return this.client.get("/repos/" + repo + "/subscription", function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s === 200) { | ||
return cb(null, b, h); | ||
} else { | ||
return cb(null, false, h); | ||
} | ||
}); | ||
}; | ||
Me.prototype.subscribe = function(repo, cb) { | ||
var options; | ||
options = { | ||
subscribed: true, | ||
ignored: false | ||
}; | ||
return this.client.put("/repos/" + repo + "/subscription", options, function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s !== 200) { | ||
return cb(new Error('User subscribe error')); | ||
} else { | ||
return cb(null, b, h); | ||
} | ||
}); | ||
}; | ||
Me.prototype.unsubscribe = function(repo, cb) { | ||
return this.client.del("/repos/" + repo + "/subscription", function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s !== 204) { | ||
return cb(new Error('User unsubscribe error')); | ||
} else { | ||
return cb(null, b, h); | ||
} | ||
}); | ||
}; | ||
return Me; | ||
@@ -390,0 +434,0 @@ |
@@ -36,3 +36,3 @@ // Generated by CoffeeScript 1.7.1 | ||
Search.prototype.users = function(keyword, start_page, cb) { | ||
Search.prototype.users = function(params, start_page, cb) { | ||
return this.client.get("/search/users", params, function(err, s, b, h) { | ||
@@ -39,0 +39,0 @@ if (err) { |
@@ -63,2 +63,17 @@ // Generated by CoffeeScript 1.7.1 | ||
User.prototype.repos = 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, ["/users/" + this.login + "/repos"].concat(__slice.call(params), [function(err, s, b, h) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
if (s !== 200) { | ||
return cb(new Error('User repos error')); | ||
} else { | ||
return cb(null, b, h); | ||
} | ||
}])); | ||
}; | ||
User.prototype.events = function() { | ||
@@ -65,0 +80,0 @@ var cb, events, params, _i, _ref; |
{ | ||
"name": "octonode", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"author": "Pavan Kumar Sunkara <pavan.sss1991@gmail.com> (http://pksunkara.github.com)", | ||
@@ -5,0 +5,0 @@ "description": "nodejs wrapper for github v3 api", |
103228
2302