Socket
Socket
Sign inDemoInstall

github-api

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-api - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

22

CHANGELOG.md

@@ -1,4 +0,20 @@

## Change Log
# Change Log
### 1.0.0
### Features
### Fixes
## 1.1.0 - 2015/05/03
### Features
Added methods for commenting on Gists:
* `Gist.listComments`
* `Gist.getComment`
* `Gist.editComment`
* `Gist.deleteComment`
* `Gist.createComment`
### Fixes
* `Repository.deleteFile` now correctly returns a promise.
## 1.0.0 - 2015/04/27
Complete rewrite in ES2015.

@@ -11,3 +27,3 @@

#### Breaking changes
### Breaking changes
Most of the breaking changes are just methods that got renamed. The changes to `User` and `Organization` are deeper

@@ -14,0 +30,0 @@ changes that now scope a particular `User` or `Organization` to the entity they were instantiated with. You will need

@@ -144,2 +144,27 @@ (function (global, factory) {

}
}, {
key: 'listComments',
value: function listComments(cb) {
return this._requestAllPages('/gists/' + this.__id + '/comments', null, cb);
}
}, {
key: 'getComment',
value: function getComment(comment, cb) {
return this._request('GET', '/gists/' + this.__id + '/comments/' + comment, null, cb);
}
}, {
key: 'createComment',
value: function createComment(comment, cb) {
return this._request('POST', '/gists/' + this.__id + '/comments', { body: comment }, cb);
}
}, {
key: 'editComment',
value: function editComment(comment, body, cb) {
return this._request('PATCH', '/gists/' + this.__id + '/comments/' + comment, { body: body }, cb);
}
}, {
key: 'deleteComment',
value: function deleteComment(comment, cb) {
return this._request('DELETE', '/gists/' + this.__id + '/comments/' + comment, null, cb);
}
}]);

@@ -152,3 +177,3 @@

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkdpc3QuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs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1cblxubW9kdWxlLmV4cG9ydHMgPSBHaXN0O1xuIl19
//# sourceMappingURL=Gist.js.map

@@ -145,2 +145,27 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.GitHub = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

}
}, {
key: 'listComments',
value: function listComments(cb) {
return this._requestAllPages('/gists/' + this.__id + '/comments', null, cb);
}
}, {
key: 'getComment',
value: function getComment(comment, cb) {
return this._request('GET', '/gists/' + this.__id + '/comments/' + comment, null, cb);
}
}, {
key: 'createComment',
value: function createComment(comment, cb) {
return this._request('POST', '/gists/' + this.__id + '/comments', { body: comment }, cb);
}
}, {
key: 'editComment',
value: function editComment(comment, body, cb) {
return this._request('PATCH', '/gists/' + this.__id + '/comments/' + comment, { body: body }, cb);
}
}, {
key: 'deleteComment',
value: function deleteComment(comment, cb) {
return this._request('DELETE', '/gists/' + this.__id + '/comments/' + comment, null, cb);
}
}]);

@@ -1025,3 +1050,3 @@

this.getSha(branch, path).then(function (response) {
return this.getSha(branch, path).then(function (response) {
var deleteCommit = {

@@ -1028,0 +1053,0 @@ message: 'Delete the file at \'' + path + '\'',

2

dist/GitHub.min.js

@@ -1,2 +0,2 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.GitHub=e()}}(function(){var e;return function t(e,n,r){function u(s,i){if(!n[s]){if(!e[s]){var a="function"==typeof require&&require;if(!i&&a)return a(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return u(n?n:t)},f,f.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)u(r[s]);return u}({1:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Gist=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__id=e,s}return o(t,e),i(t,[{key:"read",value:function(e){return this._request("GET","/gists/"+this.__id,null,e)}},{key:"create",value:function(e,t){var n=this;return this._request("POST","/gists",e,t).then(function(e){return n.__id=e.data.id,e})}},{key:"delete",value:function(e){return this._request("DELETE","/gists/"+this.__id,null,e)}},{key:"fork",value:function(e){return this._request("POST","/gists/"+this.__id+"/forks",null,e)}},{key:"update",value:function(e,t){return this._request("PATCH","/gists/"+this.__id,e,t)}},{key:"star",value:function(e){return this._request("PUT","/gists/"+this.__id+"/star",null,e)}},{key:"unstar",value:function(e){return this._request("DELETE","/gists/"+this.__id+"/star",null,e)}},{key:"isStarred",value:function(e){return this._request204or404("/gists/"+this.__id+"/star",null,e)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],2:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Gist","./User","./Issue","./Search","./RateLimit","./Repository","./Organization"],o);else if("undefined"!=typeof r)o(n,t("./Gist"),t("./User"),t("./Issue"),t("./Search"),t("./RateLimit"),t("./Repository"),t("./Organization"));else{var s={exports:{}};o(s,u.Gist,u.User,u.Issue,u.Search,u.RateLimit,u.Repository,u.Organization),u.GitHub=s.exports}}(this,function(e,t,n,r,u,o,s,i){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=a(t),c=a(n),h=a(r),p=a(u),_=a(o),y=a(s),d=a(i),b=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?"https://api.github.com":arguments[1];l(this,e),this.__apiBase=n,this.__auth=t||{}}return b(e,[{key:"getGist",value:function(e){return new f["default"](e,this.__auth,this.__apiBase)}},{key:"getUser",value:function(e){return new c["default"](e,this.__auth,this.__apiBase)}},{key:"getOrganization",value:function(e){return new d["default"](e,this.__auth,this.__apiBase)}},{key:"getRepo",value:function(e,t){return new y["default"](this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"getIssues",value:function(e,t){return new h["default"](this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"search",value:function(e){return new p["default"](e,this.__auth,this.__apiBase)}},{key:"getRateLimit",value:function(){return new _["default"](this.__auth,this.__apiBase)}},{key:"_getFullName",value:function(e,t){var n=e;return t&&(n=e+"/"+t),n}}]),e}();e.exports=v})},{"./Gist":1,"./Issue":3,"./Organization":4,"./RateLimit":5,"./Repository":6,"./Search":8,"./User":9}],3:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Issue=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__repository=e,s}return o(t,e),i(t,[{key:"createIssue",value:function(e,t){this._request("POST","/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssues",value:function(e,t){this._requestAllPages("/repos/"+this.__repository+"/issues",e,t)}},{key:"createIssueComment",value:function(e,t,n){this._request("POST","/repos/"+this.__repository+"/issues/"+e+"/comments",{body:t},n)}},{key:"editIssue",value:function(e,t,n){this._request("PATCH","/repos/"+this.__repository+"/issues/"+e,t,n)}},{key:"getIssue",value:function(e,t){this._request("GET","/repos/"+this.__repository+"/issues/"+e,null,t)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],4:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Organization=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__name=e,s}return o(t,e),i(t,[{key:"createRepo",value:function(e,t){this._request("POST","/orgs/"+this.__name+"/repos",e,t)}},{key:"getRepos",value:function(e){var t=this._getOptionsWithDefaults({direction:"desc"});return this._requestAllPages("/orgs/"+this.__name+"/repos",t,e)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],5:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.RateLimit=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n){return r(this,t),u(this,Object.getPrototypeOf(t).call(this,e,n))}return o(t,e),i(t,[{key:"getRateLimit",value:function(e){return this._request("GET","/rate_limit",null,e)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],6:[function(t,n,r){(function(u){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","utf8","js-base64","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("utf8"),t("js-base64"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.utf8,u.jsBase64,u.debug),u.Repository=s.exports}}(this,function(e,t,n,r,o){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=s(t),c=s(n),h=s(o),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=(0,h["default"])("github:repository"),d=function(e){function t(e,n,r){i(this,t);var u=a(this,Object.getPrototypeOf(t).call(this,n,r));return u.__fullname=e,u.__currentTree={branch:null,sha:null},u}return l(t,e),_(t,[{key:"getRef",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"createRef",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/git/refs",e,t)}},{key:"deleteRef",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"deleteRepo",value:function(e){return this._request("DELETE","/repos/"+this.__fullname,null,e)}},{key:"listTags",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/tags",null,e)}},{key:"listPullRequests",value:function(e,t){return e=e||{},this._request("GET","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"getPullRequest",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e,null,t)}},{key:"compareBranches",value:function(e,t,n){return this._request("GET","/repos/"+this.__fullname+"/compare/"+e+"..."+t,null,n)}},{key:"listBranches",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/branches",null,e)}},{key:"getBlob",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/blobs/"+e,null,t,"raw")}},{key:"getCommit",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/commits/"+e,null,t)}},{key:"listCommits",value:function(e,t){return e=e||{},e.since=this._dateToISO(e.since),e.until=this._dateToISO(e.until),this._request("GET","/repos/"+this.__fullname+"/commits",e,t)}},{key:"getSha",value:function(e,t,n){return e=e?"?ref="+e:"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t+e,null,n)}},{key:"listStatuses",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/statuses",null,t)}},{key:"getTree",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/trees/"+e,null,t)}},{key:"createBlob",value:function(e,t){var n=this._getContentObject(e);return y("sending content",n),this._request("POST","/repos/"+this.__fullname+"/git/blobs",n,t)}},{key:"_getContentObject",value:function(e){if("string"==typeof e)return y("contet is a string"),{content:c["default"].encode(e),encoding:"utf-8"};if("undefined"!=typeof u&&e instanceof u)return y("We appear to be in Node"),{content:e.toString("base64"),encoding:"base64"};if("undefined"!=typeof Blob&&e instanceof Blob)return y("We appear to be in the browser"),{content:r.Base64.encode(e),encoding:"base64"};throw y("Not sure what this content is: "+("undefined"==typeof e?"undefined":p(e))+", "+JSON.stringify(e)),new Error("Unknown content passed to postBlob. Must be string or Buffer (node) or Blob (web)")}},{key:"updateTree",value:function(e,t,n,r){var u={base_tree:e,tree:[{path:t,sha:n,mode:"100644",type:"blob"}]};return this._request("POST","/repos/"+this.__fullname+"/git/trees",u,r)}},{key:"createTree",value:function(e,t,n){return this._request("POST","/repos/"+this.__fullname+"/git/trees",{tree:e,base_tree:t},n)}},{key:"commit",value:function(e,t,n,r){var u=this,o={message:n,tree:t,parents:[e]};return this._request("POST","/repos/"+this.__fullname+"/git/commits",o,r).then(function(e){return u.__currentTree.sha=e.sha,e})}},{key:"updateHead",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/git/refs/"+e,{sha:t},n)}},{key:"getDetails",value:function(e){return this._request("GET","/repos/"+this.__fullname,null,e)}},{key:"getContributors",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/stats/contributors",null,e)}},{key:"getCollaborators",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/collaborators",null,e)}},{key:"isCollaborator",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/collaborators/"+e,null,t)}},{key:"getContents",value:function(e,t,n,r){return t=t?""+encodeURI(t):"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t,{ref:e},r,n)}},{key:"fork",value:function(e){return this._request("POST","/repos/"+this.__fullname+"/forks",null,e)}},{key:"listForks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/forks",null,e)}},{key:"createBranch",value:function(e,t,n){var r=this;return"function"==typeof t&&(n=t,t=e,e="master"),this.getRef("heads/"+e).then(function(e){var u=e.data.object.sha;return r.createRef({sha:u,ref:"refs/heads/"+t},n)})}},{key:"createPullRequest",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"listHooks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/hooks",null,e)}},{key:"getHook",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"createHook",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/hooks",e,t)}},{key:"updateHook",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/hooks/"+e,t,n)}},{key:"deleteHook",value:function(e,t){return this._request("DELETE",this.__repoPath+"/hooks/"+e,null,t)}},{key:"deleteFile",value:function(e,t,n){var r=this;this.getSha(e,t).then(function(u){var o={message:"Delete the file at '"+t+"'",sha:u.data.sha,branch:e};return r._request("DELETE","/repos/"+r.__fullname+"/contents/"+t,o,n)})}},{key:"move",value:function(e,t,n,r){return this._updateTree(e,function(u,o){this.getTree(o+"?recursive=true",function(u,s){s.forEach(function(e){e.path===t&&(e.path=n),"tree"===e.type&&delete e.sha}),this.postTree(s,function(n,u){this.commit(o,u,"Deleted "+t,function(t,n){this.updateHead(e,n,r)})})})})}},{key:"_updateTree",value:function(e,t){return e===this.__currentTree.branch&&this.__currentTree.sha?t(null,this.__currentTree.sha):void this.getRef("heads/"+e,function(n,r){this.__currentTree.branch=e,this.__currentTree.sha=r,t(n,r)})}},{key:"writeFile",value:function(e,t,n,u,o,s){var i=this;"function"==typeof o&&(s=o,o={});var a=t?encodeURI(t):"",l=o.encode!==!1,f={branch:e,message:u,author:o.author,committer:o.committer,content:l?r.Base64.encode(n):n};return this.getSha(e,a).then(function(e){return f.sha=e.data.sha,i._request("PUT","/repos/"+i.__fullname+"/contents/"+a,f,s)},function(){return i._request("PUT","/repos/"+i.__fullname+"/contents/"+a,f,s)})}},{key:"isStarred",value:function(e){return this._request204or404("/user/starred/"+this.__fullname,null,e)}},{key:"star",value:function(e){return this._request("PUT","/user/starred/"+this.__fullname,null,e)}},{key:"unstar",value:function(e){return this._request("DELETE","/user/starred/"+this.__fullname,null,e)}},{key:"createRelease",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/releases",e,t)}},{key:"updateRelease",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/releases/"+e,t,n)}},{key:"getRelease",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/releases/"+e,null,t)}},{key:"deleteRelease",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/releases/"+e,null,t)}}]),t}(f["default"]);e.exports=d})}).call(this,t("buffer").Buffer)},{"./Requestable":7,buffer:void 0,debug:void 0,"js-base64":void 0,utf8:void 0}],7:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","axios","debug","js-base64","es6-promise"],o);else if("undefined"!=typeof r)o(n,t("axios"),t("debug"),t("js-base64"),t("es6-promise"));else{var s={exports:{}};o(s,u.axios,u.debug,u.jsBase64,u.Promise),u.Requestable=s.exports}}(this,function(e,t,n,r,u){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return{path:e,request:t.config,response:t,status:t.status}}function a(e){return-1!==b.indexOf(e)}function l(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=e.split(/\s*,\s*/);return t.reduce(function(e,t){return-1!==t.search(/rel="next"/)?(t.match(/<(.*)>/)||[])[1]:e},void 0)}function f(e,t){return function(n){y("error making request "+n.config.method+" "+n.config.url+" "+JSON.stringify(n.data));var r=i(t,n);if(!e)throw r;e(r)}}var c=o(t),h=o(n),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=(0,h["default"])("github:request");"undefined"==typeof Promise&&(0,u.polyfill)();var d=function(){function e(t,n){s(this,e),this.__apiBase=n||"https://api.github.com",this.__auth={token:t.token,username:t.username,password:t.password},t.token?this.__authorizationHeader="token "+t.token:t.username&&t.password&&(this.__authorizationHeader="Basic "+r.Base64.encode(t.username+":"+t.password))}return _(e,[{key:"__getURL",value:function(e){var t=e;-1===e.indexOf("//")&&(t=this.__apiBase+e);var n="timestamp="+(new Date).getTime();return t.replace(/(timestamp=\d+)/,n)}},{key:"__getRequestHeaders",value:function(e){var t={Accept:e?"application/vnd.github.v3.raw+json":"application/vnd.github.v3+json","Content-Type":"application/json;charset=UTF-8"};return this.__authorizationHeader&&(t.Authorization=this.__authorizationHeader),t}},{key:"_getOptionsWithDefaults",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return e.type=e.type||"all",e.sort=e.sort||"updated",e.per_page=e.per_page||"100",e}},{key:"_dateToISO",value:function(e){return e&&e instanceof Date&&(e=e.toISOString()),e}},{key:"_request",value:function(e,t,n,r,u){var o=this.__getURL(t),s=this.__getRequestHeaders(u),i={},l=n&&"object"===("undefined"==typeof n?"undefined":p(n))&&a(e);l&&(i=n,n=void 0);var h={url:o,method:e,headers:s,params:i,data:n,responseType:u?"text":"json"};y(h.method+" to "+h.url);var _=(0,c["default"])(h)["catch"](f(r,t));return r&&_.then(function(e){r(null,e.data||!0,e)}),_}},{key:"_request204or404",value:function(e,t,n){return this._request("GET",e,t).then(function(e){return n&&n(null,!0,e),!0},function(e){if(404===e.status)return n&&n(null,!1,e),!1;throw n&&n(e),e})}},{key:"_requestAllPages",value:function(e,t,n,r){var u=this;return r=r||[],this._request("GET",e,null).then(function(e){r.push.apply(r,e.data);var o=l(e.headers.link);return o?(y("getting next page: "+o),u._requestAllPages(o,t,n,r)):(n&&n(null,r,e),e.data=r,e)})["catch"](f(n,e))}}]),e}();e.exports=d;var b=["GET","HEAD","DELETE"]})},{axios:void 0,debug:void 0,"es6-promise":void 0,"js-base64":void 0}],8:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.debug),u.Search=s.exports}}(this,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=r(t),a=r(n),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=(0,a["default"])("github:search"),c=function(e){function t(e,n,r){u(this,t);var s=o(this,Object.getPrototypeOf(t).call(this,n,r));return s.__defaults=s._getOptionsWithDefaults(e),s}return s(t,e),l(t,[{key:"_search",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],u={};return Object.keys(this.__defaults).forEach(function(e){return u[e]=t.__defaults[e]}),Object.keys(n).forEach(function(e){return u[e]=n[e]}),f("searching "+e+" with options:",u),this._request("GET","/search/"+e,u,r)}},{key:"forRepositories",value:function(e,t){return this._search("repositories",e,t)}},{key:"forCode",value:function(e,t){return this._search("code",e,t)}},{key:"forIssues",value:function(e,t){return this._search("issues",e,t)}},{key:"forUsers",value:function(e,t){return this._search("users",e,t)}}]),t}(i["default"]);e.exports=c})},{"./Requestable":7,debug:void 0}],9:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.debug),u.User=s.exports}}(this,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=r(t),a=r(n),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=(0,a["default"])("github:user"),c=function(e){function t(e,n,r){u(this,t);var s=o(this,Object.getPrototypeOf(t).call(this,n,r));return s.__user=e,s}return s(t,e),l(t,[{key:"__getScopedUrl",value:function(e){if(this.__user)return e?"/users/"+this.__user+"/"+e:"/users/"+this.__user;switch(e){case"":return"/user";case"notifications":case"gists":return"/"+e;default:return"/user/"+e}}},{key:"getRepos",value:function(e,t){return"function"==typeof e&&(t=e,e={}),e=this._getOptionsWithDefaults(e),f("Fetching repositories with options: "+JSON.stringify(e)),this._requestAllPages(this.__getScopedUrl("repos"),e,t)}},{key:"getOrgs",value:function(e){return this._request("GET",this.__getScopedUrl("orgs"),null,e)}},{key:"getGists",value:function(e){return this._request("GET",this.__getScopedUrl("gists"),null,e)}},{key:"getNotifications",value:function(e,t){return e=e||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),e.before=this._dateToISO(e.before),this._request("GET",this.__getScopedUrl("notifications"),e,t)}},{key:"getProfile",value:function(e){return this._request("GET",this.__getScopedUrl(""),null,e)}},{key:"getStarredRepos",value:function(e){var t=this._getOptionsWithDefaults();return this._requestAllPages(this.__getScopedUrl("starred"),t,e)}},{key:"follow",value:function(e,t){return this._request("PUT","/user/following/"+this.__user,null,t)}},{key:"unfollow",value:function(e,t){return this._request("DELETE","/user/following/"+this.__user,null,t)}},{key:"createRepo",value:function(e,t){return this._request("POST","/user/repos",e,t)}}]),t}(i["default"]);e.exports=c})},{"./Requestable":7,debug:void 0}]},{},[2])(2)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.GitHub=e()}}(function(){var e;return function t(e,n,r){function u(s,i){if(!n[s]){if(!e[s]){var a="function"==typeof require&&require;if(!i&&a)return a(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return u(n?n:t)},f,f.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)u(r[s]);return u}({1:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Gist=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__id=e,s}return o(t,e),i(t,[{key:"read",value:function(e){return this._request("GET","/gists/"+this.__id,null,e)}},{key:"create",value:function(e,t){var n=this;return this._request("POST","/gists",e,t).then(function(e){return n.__id=e.data.id,e})}},{key:"delete",value:function(e){return this._request("DELETE","/gists/"+this.__id,null,e)}},{key:"fork",value:function(e){return this._request("POST","/gists/"+this.__id+"/forks",null,e)}},{key:"update",value:function(e,t){return this._request("PATCH","/gists/"+this.__id,e,t)}},{key:"star",value:function(e){return this._request("PUT","/gists/"+this.__id+"/star",null,e)}},{key:"unstar",value:function(e){return this._request("DELETE","/gists/"+this.__id+"/star",null,e)}},{key:"isStarred",value:function(e){return this._request204or404("/gists/"+this.__id+"/star",null,e)}},{key:"listComments",value:function(e){return this._requestAllPages("/gists/"+this.__id+"/comments",null,e)}},{key:"getComment",value:function(e,t){return this._request("GET","/gists/"+this.__id+"/comments/"+e,null,t)}},{key:"createComment",value:function(e,t){return this._request("POST","/gists/"+this.__id+"/comments",{body:e},t)}},{key:"editComment",value:function(e,t,n){return this._request("PATCH","/gists/"+this.__id+"/comments/"+e,{body:t},n)}},{key:"deleteComment",value:function(e,t){return this._request("DELETE","/gists/"+this.__id+"/comments/"+e,null,t)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],2:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Gist","./User","./Issue","./Search","./RateLimit","./Repository","./Organization"],o);else if("undefined"!=typeof r)o(n,t("./Gist"),t("./User"),t("./Issue"),t("./Search"),t("./RateLimit"),t("./Repository"),t("./Organization"));else{var s={exports:{}};o(s,u.Gist,u.User,u.Issue,u.Search,u.RateLimit,u.Repository,u.Organization),u.GitHub=s.exports}}(this,function(e,t,n,r,u,o,s,i){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=a(t),c=a(n),h=a(r),_=a(u),p=a(o),y=a(s),d=a(i),b=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?"https://api.github.com":arguments[1];l(this,e),this.__apiBase=n,this.__auth=t||{}}return b(e,[{key:"getGist",value:function(e){return new f["default"](e,this.__auth,this.__apiBase)}},{key:"getUser",value:function(e){return new c["default"](e,this.__auth,this.__apiBase)}},{key:"getOrganization",value:function(e){return new d["default"](e,this.__auth,this.__apiBase)}},{key:"getRepo",value:function(e,t){return new y["default"](this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"getIssues",value:function(e,t){return new h["default"](this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"search",value:function(e){return new _["default"](e,this.__auth,this.__apiBase)}},{key:"getRateLimit",value:function(){return new p["default"](this.__auth,this.__apiBase)}},{key:"_getFullName",value:function(e,t){var n=e;return t&&(n=e+"/"+t),n}}]),e}();e.exports=v})},{"./Gist":1,"./Issue":3,"./Organization":4,"./RateLimit":5,"./Repository":6,"./Search":8,"./User":9}],3:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Issue=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__repository=e,s}return o(t,e),i(t,[{key:"createIssue",value:function(e,t){this._request("POST","/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssues",value:function(e,t){this._requestAllPages("/repos/"+this.__repository+"/issues",e,t)}},{key:"createIssueComment",value:function(e,t,n){this._request("POST","/repos/"+this.__repository+"/issues/"+e+"/comments",{body:t},n)}},{key:"editIssue",value:function(e,t,n){this._request("PATCH","/repos/"+this.__repository+"/issues/"+e,t,n)}},{key:"getIssue",value:function(e,t){this._request("GET","/repos/"+this.__repository+"/issues/"+e,null,t)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],4:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.Organization=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n,o){r(this,t);var s=u(this,Object.getPrototypeOf(t).call(this,n,o));return s.__name=e,s}return o(t,e),i(t,[{key:"createRepo",value:function(e,t){this._request("POST","/orgs/"+this.__name+"/repos",e,t)}},{key:"getRepos",value:function(e){var t=this._getOptionsWithDefaults({direction:"desc"});return this._requestAllPages("/orgs/"+this.__name+"/repos",t,e)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],5:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"));else{var s={exports:{}};o(s,u.Requestable),u.RateLimit=s.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(t),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){function t(e,n){return r(this,t),u(this,Object.getPrototypeOf(t).call(this,e,n))}return o(t,e),i(t,[{key:"getRateLimit",value:function(e){return this._request("GET","/rate_limit",null,e)}}]),t}(s["default"]);e.exports=a})},{"./Requestable":7}],6:[function(t,n,r){(function(u){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","utf8","js-base64","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("utf8"),t("js-base64"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.utf8,u.jsBase64,u.debug),u.Repository=s.exports}}(this,function(e,t,n,r,o){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=s(t),c=s(n),h=s(o),_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=(0,h["default"])("github:repository"),d=function(e){function t(e,n,r){i(this,t);var u=a(this,Object.getPrototypeOf(t).call(this,n,r));return u.__fullname=e,u.__currentTree={branch:null,sha:null},u}return l(t,e),p(t,[{key:"getRef",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"createRef",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/git/refs",e,t)}},{key:"deleteRef",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"deleteRepo",value:function(e){return this._request("DELETE","/repos/"+this.__fullname,null,e)}},{key:"listTags",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/tags",null,e)}},{key:"listPullRequests",value:function(e,t){return e=e||{},this._request("GET","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"getPullRequest",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e,null,t)}},{key:"compareBranches",value:function(e,t,n){return this._request("GET","/repos/"+this.__fullname+"/compare/"+e+"..."+t,null,n)}},{key:"listBranches",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/branches",null,e)}},{key:"getBlob",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/blobs/"+e,null,t,"raw")}},{key:"getCommit",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/commits/"+e,null,t)}},{key:"listCommits",value:function(e,t){return e=e||{},e.since=this._dateToISO(e.since),e.until=this._dateToISO(e.until),this._request("GET","/repos/"+this.__fullname+"/commits",e,t)}},{key:"getSha",value:function(e,t,n){return e=e?"?ref="+e:"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t+e,null,n)}},{key:"listStatuses",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/statuses",null,t)}},{key:"getTree",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/trees/"+e,null,t)}},{key:"createBlob",value:function(e,t){var n=this._getContentObject(e);return y("sending content",n),this._request("POST","/repos/"+this.__fullname+"/git/blobs",n,t)}},{key:"_getContentObject",value:function(e){if("string"==typeof e)return y("contet is a string"),{content:c["default"].encode(e),encoding:"utf-8"};if("undefined"!=typeof u&&e instanceof u)return y("We appear to be in Node"),{content:e.toString("base64"),encoding:"base64"};if("undefined"!=typeof Blob&&e instanceof Blob)return y("We appear to be in the browser"),{content:r.Base64.encode(e),encoding:"base64"};throw y("Not sure what this content is: "+("undefined"==typeof e?"undefined":_(e))+", "+JSON.stringify(e)),new Error("Unknown content passed to postBlob. Must be string or Buffer (node) or Blob (web)")}},{key:"updateTree",value:function(e,t,n,r){var u={base_tree:e,tree:[{path:t,sha:n,mode:"100644",type:"blob"}]};return this._request("POST","/repos/"+this.__fullname+"/git/trees",u,r)}},{key:"createTree",value:function(e,t,n){return this._request("POST","/repos/"+this.__fullname+"/git/trees",{tree:e,base_tree:t},n)}},{key:"commit",value:function(e,t,n,r){var u=this,o={message:n,tree:t,parents:[e]};return this._request("POST","/repos/"+this.__fullname+"/git/commits",o,r).then(function(e){return u.__currentTree.sha=e.sha,e})}},{key:"updateHead",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/git/refs/"+e,{sha:t},n)}},{key:"getDetails",value:function(e){return this._request("GET","/repos/"+this.__fullname,null,e)}},{key:"getContributors",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/stats/contributors",null,e)}},{key:"getCollaborators",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/collaborators",null,e)}},{key:"isCollaborator",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/collaborators/"+e,null,t)}},{key:"getContents",value:function(e,t,n,r){return t=t?""+encodeURI(t):"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t,{ref:e},r,n)}},{key:"fork",value:function(e){return this._request("POST","/repos/"+this.__fullname+"/forks",null,e)}},{key:"listForks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/forks",null,e)}},{key:"createBranch",value:function(e,t,n){var r=this;return"function"==typeof t&&(n=t,t=e,e="master"),this.getRef("heads/"+e).then(function(e){var u=e.data.object.sha;return r.createRef({sha:u,ref:"refs/heads/"+t},n)})}},{key:"createPullRequest",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"listHooks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/hooks",null,e)}},{key:"getHook",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"createHook",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/hooks",e,t)}},{key:"updateHook",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/hooks/"+e,t,n)}},{key:"deleteHook",value:function(e,t){return this._request("DELETE",this.__repoPath+"/hooks/"+e,null,t)}},{key:"deleteFile",value:function(e,t,n){var r=this;return this.getSha(e,t).then(function(u){var o={message:"Delete the file at '"+t+"'",sha:u.data.sha,branch:e};return r._request("DELETE","/repos/"+r.__fullname+"/contents/"+t,o,n)})}},{key:"move",value:function(e,t,n,r){return this._updateTree(e,function(u,o){this.getTree(o+"?recursive=true",function(u,s){s.forEach(function(e){e.path===t&&(e.path=n),"tree"===e.type&&delete e.sha}),this.postTree(s,function(n,u){this.commit(o,u,"Deleted "+t,function(t,n){this.updateHead(e,n,r)})})})})}},{key:"_updateTree",value:function(e,t){return e===this.__currentTree.branch&&this.__currentTree.sha?t(null,this.__currentTree.sha):void this.getRef("heads/"+e,function(n,r){this.__currentTree.branch=e,this.__currentTree.sha=r,t(n,r)})}},{key:"writeFile",value:function(e,t,n,u,o,s){var i=this;"function"==typeof o&&(s=o,o={});var a=t?encodeURI(t):"",l=o.encode!==!1,f={branch:e,message:u,author:o.author,committer:o.committer,content:l?r.Base64.encode(n):n};return this.getSha(e,a).then(function(e){return f.sha=e.data.sha,i._request("PUT","/repos/"+i.__fullname+"/contents/"+a,f,s)},function(){return i._request("PUT","/repos/"+i.__fullname+"/contents/"+a,f,s)})}},{key:"isStarred",value:function(e){return this._request204or404("/user/starred/"+this.__fullname,null,e)}},{key:"star",value:function(e){return this._request("PUT","/user/starred/"+this.__fullname,null,e)}},{key:"unstar",value:function(e){return this._request("DELETE","/user/starred/"+this.__fullname,null,e)}},{key:"createRelease",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/releases",e,t)}},{key:"updateRelease",value:function(e,t,n){return this._request("PATCH","/repos/"+this.__fullname+"/releases/"+e,t,n)}},{key:"getRelease",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/releases/"+e,null,t)}},{key:"deleteRelease",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/releases/"+e,null,t)}}]),t}(f["default"]);e.exports=d})}).call(this,t("buffer").Buffer)},{"./Requestable":7,buffer:void 0,debug:void 0,"js-base64":void 0,utf8:void 0}],7:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","axios","debug","js-base64","es6-promise"],o);else if("undefined"!=typeof r)o(n,t("axios"),t("debug"),t("js-base64"),t("es6-promise"));else{var s={exports:{}};o(s,u.axios,u.debug,u.jsBase64,u.Promise),u.Requestable=s.exports}}(this,function(e,t,n,r,u){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return{path:e,request:t.config,response:t,status:t.status}}function a(e){return-1!==b.indexOf(e)}function l(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=e.split(/\s*,\s*/);return t.reduce(function(e,t){return-1!==t.search(/rel="next"/)?(t.match(/<(.*)>/)||[])[1]:e},void 0)}function f(e,t){return function(n){y("error making request "+n.config.method+" "+n.config.url+" "+JSON.stringify(n.data));var r=i(t,n);if(!e)throw r;e(r)}}var c=o(t),h=o(n),_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=(0,h["default"])("github:request");"undefined"==typeof Promise&&(0,u.polyfill)();var d=function(){function e(t,n){s(this,e),this.__apiBase=n||"https://api.github.com",this.__auth={token:t.token,username:t.username,password:t.password},t.token?this.__authorizationHeader="token "+t.token:t.username&&t.password&&(this.__authorizationHeader="Basic "+r.Base64.encode(t.username+":"+t.password))}return p(e,[{key:"__getURL",value:function(e){var t=e;-1===e.indexOf("//")&&(t=this.__apiBase+e);var n="timestamp="+(new Date).getTime();return t.replace(/(timestamp=\d+)/,n)}},{key:"__getRequestHeaders",value:function(e){var t={Accept:e?"application/vnd.github.v3.raw+json":"application/vnd.github.v3+json","Content-Type":"application/json;charset=UTF-8"};return this.__authorizationHeader&&(t.Authorization=this.__authorizationHeader),t}},{key:"_getOptionsWithDefaults",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return e.type=e.type||"all",e.sort=e.sort||"updated",e.per_page=e.per_page||"100",e}},{key:"_dateToISO",value:function(e){return e&&e instanceof Date&&(e=e.toISOString()),e}},{key:"_request",value:function(e,t,n,r,u){var o=this.__getURL(t),s=this.__getRequestHeaders(u),i={},l=n&&"object"===("undefined"==typeof n?"undefined":_(n))&&a(e);l&&(i=n,n=void 0);var h={url:o,method:e,headers:s,params:i,data:n,responseType:u?"text":"json"};y(h.method+" to "+h.url);var p=(0,c["default"])(h)["catch"](f(r,t));return r&&p.then(function(e){r(null,e.data||!0,e)}),p}},{key:"_request204or404",value:function(e,t,n){return this._request("GET",e,t).then(function(e){return n&&n(null,!0,e),!0},function(e){if(404===e.status)return n&&n(null,!1,e),!1;throw n&&n(e),e})}},{key:"_requestAllPages",value:function(e,t,n,r){var u=this;return r=r||[],this._request("GET",e,null).then(function(e){r.push.apply(r,e.data);var o=l(e.headers.link);return o?(y("getting next page: "+o),u._requestAllPages(o,t,n,r)):(n&&n(null,r,e),e.data=r,e)})["catch"](f(n,e))}}]),e}();e.exports=d;var b=["GET","HEAD","DELETE"]})},{axios:void 0,debug:void 0,"es6-promise":void 0,"js-base64":void 0}],8:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.debug),u.Search=s.exports}}(this,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=r(t),a=r(n),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=(0,a["default"])("github:search"),c=function(e){function t(e,n,r){u(this,t);var s=o(this,Object.getPrototypeOf(t).call(this,n,r));return s.__defaults=s._getOptionsWithDefaults(e),s}return s(t,e),l(t,[{key:"_search",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],u={};return Object.keys(this.__defaults).forEach(function(e){return u[e]=t.__defaults[e]}),Object.keys(n).forEach(function(e){return u[e]=n[e]}),f("searching "+e+" with options:",u),this._request("GET","/search/"+e,u,r)}},{key:"forRepositories",value:function(e,t){return this._search("repositories",e,t)}},{key:"forCode",value:function(e,t){return this._search("code",e,t)}},{key:"forIssues",value:function(e,t){return this._search("issues",e,t)}},{key:"forUsers",value:function(e,t){return this._search("users",e,t)}}]),t}(i["default"]);e.exports=c})},{"./Requestable":7,debug:void 0}],9:[function(t,n,r){!function(u,o){if("function"==typeof e&&e.amd)e(["module","./Requestable","debug"],o);else if("undefined"!=typeof r)o(n,t("./Requestable"),t("debug"));else{var s={exports:{}};o(s,u.Requestable,u.debug),u.User=s.exports}}(this,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=r(t),a=r(n),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=(0,a["default"])("github:user"),c=function(e){function t(e,n,r){u(this,t);var s=o(this,Object.getPrototypeOf(t).call(this,n,r));return s.__user=e,s}return s(t,e),l(t,[{key:"__getScopedUrl",value:function(e){if(this.__user)return e?"/users/"+this.__user+"/"+e:"/users/"+this.__user;switch(e){case"":return"/user";case"notifications":case"gists":return"/"+e;default:return"/user/"+e}}},{key:"getRepos",value:function(e,t){return"function"==typeof e&&(t=e,e={}),e=this._getOptionsWithDefaults(e),f("Fetching repositories with options: "+JSON.stringify(e)),this._requestAllPages(this.__getScopedUrl("repos"),e,t)}},{key:"getOrgs",value:function(e){return this._request("GET",this.__getScopedUrl("orgs"),null,e)}},{key:"getGists",value:function(e){return this._request("GET",this.__getScopedUrl("gists"),null,e)}},{key:"getNotifications",value:function(e,t){return e=e||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),e.before=this._dateToISO(e.before),this._request("GET",this.__getScopedUrl("notifications"),e,t)}},{key:"getProfile",value:function(e){return this._request("GET",this.__getScopedUrl(""),null,e)}},{key:"getStarredRepos",value:function(e){var t=this._getOptionsWithDefaults();return this._requestAllPages(this.__getScopedUrl("starred"),t,e)}},{key:"follow",value:function(e,t){return this._request("PUT","/user/following/"+this.__user,null,t)}},{key:"unfollow",value:function(e,t){return this._request("DELETE","/user/following/"+this.__user,null,t)}},{key:"createRepo",value:function(e,t){return this._request("POST","/user/repos",e,t)}}]),t}(i["default"]);e.exports=c})},{"./Requestable":7,debug:void 0}]},{},[2])(2)});
//# sourceMappingURL=GitHub.min.js.map

@@ -110,4 +110,59 @@ /**

}
/**
* List the gist's comments
* @see https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist
* @param {Requestable.callback} [cb] - will receive the array of comments
* @return {Promise} - the promise for the http request
*/
listComments(cb) {
return this._requestAllPages(`/gists/${this.__id}/comments`, null, cb);
}
/**
* Fetch one of the gist's comments
* @see https://developer.github.com/v3/gists/comments/#get-a-single-comment
* @param {number} comment - the id of the comment
* @param {Requestable.callback} [cb] - will receive the comment
* @return {Promise} - the Promise for the http request
*/
getComment(comment, cb) {
return this._request('GET', `/gists/${this.__id}/comments/${comment}`, null, cb);
}
/**
* Comment on a gist
* @see https://developer.github.com/v3/gists/comments/#create-a-comment
* @param {string} comment - the comment to add
* @param {Requestable.callback} [cb] - the function that receives the API result
* @return {Promise} - the Promise for the http request
*/
createComment(comment, cb) {
return this._request('POST', `/gists/${this.__id}/comments`, {body: comment}, cb);
}
/**
* Edit a comment on the gist
* @see https://developer.github.com/v3/gists/comments/#edit-a-comment
* @param {number} comment - the id of the comment
* @param {string} body - the new comment
* @param {Requestable.callback} [cb] - will receive the modified comment
* @return {Promise} - the promise for the http request
*/
editComment(comment, body, cb) {
return this._request('PATCH', `/gists/${this.__id}/comments/${comment}`, {body: body}, cb);
}
/**
* Delete a comment on the gist.
* @see https://developer.github.com/v3/gists/comments/#delete-a-comment
* @param {number} comment - the id of the comment
* @param {Requestable.callback} [cb] - will receive true if the request succeeds
* @return {Promise} - the Promise for the http request
*/
deleteComment(comment, cb) {
return this._request('DELETE', `/gists/${this.__id}/comments/${comment}`, null, cb);
}
}
module.exports = Gist;

@@ -492,3 +492,3 @@ 'use strict';

deleteFile(branch, path, cb) {
this.getSha(branch, path)
return this.getSha(branch, path)
.then((response) => {

@@ -495,0 +495,0 @@ const deleteCommit = {

{
"name": "github-api",
"version": "1.0.0",
"version": "1.1.0",
"license": "BSD-3-Clause-Clear",

@@ -5,0 +5,0 @@ "description": "A higher-level wrapper around the Github API.",

@@ -111,2 +111,2 @@ # Github.js

[xhr-link]: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
[docs]: http://clayreimann.me/github/
[docs]: http://michael.github.io/github/

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc