Socket
Socket
Sign inDemoInstall

github-api

Package Overview
Dependencies
6
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.0 to 3.4.0

4

dist/components/Requestable.js

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

}
options.page = parseInt(nextUrl.match(/(page=[0-9]*)/g).shift().split('=').pop());
options.page = parseInt(nextUrl.match(/([&\?]page=[0-9]*)/g).shift().split('=').pop());
if (!(options && typeof options.page !== 'number')) {

@@ -394,3 +394,3 @@ log('getting next page: ' + nextUrl);

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVlc3RhYmxlLmpzIl0sIm5hbWVzIjpbImxvZyIsIlJlc3BvbnNlRXJyb3IiLCJtZXNzYWdlIiwicGF0aCIsInJlc3BvbnNlIiwicmVxdWVzdCIsImNvbmZpZyIsInN0YXR1cyIsIkVycm9yIiwiUmVxdWVzdGFibGUiLCJhdXRoIiwiYXBpQmFzZSIsIkFjY2VwdEhlYWRlciIsIl9fYXBpQmFzZSIsIl9fYXV0aCIsInRva2VuIiwidXNlcm5hbWUiLCJwYXNzd29yZCIsIl9fQWNjZXB0SGVhZGVyIiwiX19hdXRob3JpemF0aW9uSGVhZGVyIiwiQmFzZTY0IiwiZW5jb2RlIiwidXJsIiwiaW5kZXhPZiIsIm5ld0NhY2hlQnVzdGVyIiwiRGF0ZSIsImdldFRpbWUiLCJyZXBsYWNlIiwicmF3IiwiaGVhZGVycyIsIkFjY2VwdCIsIkF1dGhvcml6YXRpb24iLCJyZXF1ZXN0T3B0aW9ucyIsInZpc2liaWxpdHkiLCJhZmZpbGlhdGlvbiIsInR5cGUiLCJzb3J0IiwicGVyX3BhZ2UiLCJkYXRlIiwidG9JU09TdHJpbmciLCJtZXRob2QiLCJkYXRhIiwiY2IiLCJfX2dldFVSTCIsIl9fZ2V0UmVxdWVzdEhlYWRlcnMiLCJxdWVy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oc2hvdWxkVXNlRGF0YUFzUGFyYW1zKSB7XG4gICAgICAgICBxdWVyeVBhcmFtcyA9IGRhdGE7XG4gICAgICAgICBkYXRhID0gdW5kZWZpbmVkO1xuICAgICAgfVxuXG4gICAgICBjb25zdCBjb25maWcgPSB7XG4gICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgIG1ldGhvZDogbWV0aG9kLFxuICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcbiAgICAgICAgIHBhcmFtczogcXVlcnlQYXJhbXMsXG4gICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICAgcmVzcG9uc2VUeXBlOiByYXcgPyAndGV4dCcgOiAnanNvbicsXG4gICAgICB9O1xuXG4gICAgICBsb2coYCR7Y29uZmlnLm1ldGhvZH0gdG8gJHtjb25maWcudXJsfWApO1xuICAgICAgY29uc3QgcmVxdWVzdFByb21pc2UgPSBheGlvcyhjb25maWcpLmNhdGNoKGNhbGxiYWNrRXJyb3JPclRocm93KGNiLCBwYXRoKSk7XG5cbiAgICAgIGlmIChjYikge1xuICAgICAgICAgcmVxdWVzdFByb21pc2UudGhlbigocmVzcG9uc2UpID0+IHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5kYXRhICYmIE9iamVjdC5rZXlzKHJlc3BvbnNlLmRhdGEpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgIC8vIFdoZW4gZGF0YSBoYXMgcmVzdWx0c1xuICAgICAgICAgICAgICAgY2IobnVsbCwgcmVzcG9uc2UuZGF0YSwgcmVzcG9uc2UpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjb25maWcubWV0aG9kICE9PSAnR0VUJyAmJiBPYmplY3Qua2V5cyhyZXNwb25zZS5kYXRhKS5sZW5ndGggPCAxKSB7XG4gICAgICAgICAgICAgICAvLyBUcnVlIHdoZW4gc3VjY2Vzc2Z1bCBzdWJtaXQgYSByZXF1ZXN0IGFuZCByZWNlaXZlIGEgZW1wdHkgb2JqZWN0XG4gICAg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byB0aGUgcmVzdWx0IHNldGA7XG4gICAgICAgICAgICAgICB0aHJvdyBuZXcgUmVzcG9uc2VFcnJvcihtZXNzYWdlLCBwYXRoLCByZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRzLnB1c2goLi4udGhpc0dyb3VwKTtcblxuICAgICAgICAgICAgY29uc3QgbmV4dFVybCA9IGdldE5leHRQYWdlKHJlc3BvbnNlLmhlYWRlcnMubGluayk7XG4gICAgICAgICAgICBpZihuZXh0VXJsKSB7XG4gICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSB7fTtcbiAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIG9wdGlvbnMucGFnZSA9IHBhcnNlSW50KFxuICAgICAgICAgICAgICAgICBuZXh0VXJsLm1hdGNoKC8ocGFnZT1bMC05XSopL2cpXG4gICAgICAgICAgICAgICAgICAgLnNoaWZ0KClcbiAgICAgICAgICAgICAgICAgICAuc3BsaXQoJz0nKVxuICAgICAgICAgICAgICAgICAgIC5wb3AoKVxuICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgIGlmICghKG9wdGlvbnMgJiYgdHlwZW9mIG9wdGlvbnMucGFnZSAhPT0gJ251bWJlcicpKSB7XG4gICAgICAgICAgICAgICAgICBsb2coYGdldHRpbmcgbmV4dCBwYWdlOiAke25leHRVcmx9YCk7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fcmVxdWVzdEFsbFBhZ2VzKG5leHRVcmwsIG9wdGlvbnMsIGNiLCByZXN1bHRzKTtcbiAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGNiKSB7XG4gICAgICAgICAgICAgICBjYihudWxsLCByZXN1bHRzLCByZXNwb25zZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJlc3BvbnNlLmRhdGEgPSByZXN1bHR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AgaWYgKG9iamVjdC5oYXNPd25Qcm9wZXJ0eSgnY29uZmlnJykpIHtcbiAgICAgICAgIGNvbnN0IHtyZXNwb25zZToge3N0YXR1cywgc3RhdHVzVGV4dH0sIGNvbmZpZzoge21ldGhvZCwgdXJsfX0gPSBvYmplY3Q7XG4gICAgICAgICBsZXQgbWVzc2FnZSA9IChgJHtzdGF0dXN9IGVycm9yIG1ha2luZyByZXF1ZXN0ICR7bWV0aG9kfSAke3VybH06IFwiJHtzdGF0dXNUZXh0fVwiYCk7XG4gICAgICAgICBlcnJvciA9IG5ldyBSZXNwb25zZUVycm9yKG1lc3NhZ2UsIHBhdGgsIG9iamVjdCk7XG4gICAgICAgICBsb2coYCR7bWVzc2FnZX0gJHtKU09OLnN0cmluZ2lmeShvYmplY3QuZGF0YSl9YCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAgZXJyb3IgPSBvYmplY3Q7XG4gICAgICB9XG4gICAgICBpZiAoY2IpIHtcbiAgICAgICAgIGxvZygnZ29pbmcgdG8gZXJyb3IgY2FsbGJhY2snKTtcbiAgICAgICAgIGNiKGVycm9yKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgICBsb2coJ3Rocm93aW5nIGVycm9yJyk7XG4gICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgIH1cbiAgIH07XG59XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVlc3RhYmxlLmpzIl0sIm5hbWVzIjpbImxvZyIsIlJlc3BvbnNlRXJyb3IiLCJtZXNzYWdlIiwicGF0aCIsInJlc3BvbnNlIiwicmVxdWVzdCIsImNvbmZpZyIsInN0YXR1cyIsIkVycm9yIiwiUmVxdWVzdGFibGUiLCJhdXRoIiwiYXBpQmFzZSIsIkFjY2VwdEhlYWRlciIsIl9fYXBpQmFzZSIsIl9fYXV0aCIsInRva2VuIiwidXNlcm5hbWUiLCJwYXNzd29yZCIsI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YWRlciA9IChkYXRhIHx8IHt9KS5BY2NlcHRIZWFkZXI7XG4gICAgICBpZiAoQWNjZXB0SGVhZGVyKSB7XG4gICAgICAgICBkZWxldGUgZGF0YS5BY2NlcHRIZWFkZXI7XG4gICAgICB9XG4gICAgICBjb25zdCBoZWFkZXJzID0gdGhpcy5fX2dldFJlcXVlc3RIZWFkZXJzKHJhdywgQWNjZXB0SGVhZGVyKTtcblxuICAgICAgbGV0IHF1ZXJ5UGFyYW1zID0ge307XG5cbiAgICAgIGNvbnN0IHNob3VsZFVzZURhdGFBc1BhcmFtcyA9IGRhdGEgJiYgKHR5cGVvZiBkYXRhID09PSAnb2JqZWN0JykgJiYgbWV0aG9kSGFzTm9Cb2R5KG1ldGhvZCk7XG4gICAgICBpZiAoc2hvdWxkVXNlRGF0YUFzUGFyYW1zKSB7XG4gICAgICAgICBxdWVyeVBhcmFtcyA9IGRhdGE7XG4gICAgICAgICBkYXRhID0gdW5kZWZpbmVkO1xuICAgICAgfVxuXG4gICAgICBjb25zdCBjb25maWcgPSB7XG4gICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgIG1ldGhvZDogbWV0aG9kLFxuICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcbiAgICAgICAgIHBhcmFtczogcXVlcnlQYXJhbXMsXG4gICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICAgcmVzcG9uc2VUeXBlOiByYXcgPyAndGV4dCcgOiAnanNvbicsXG4gICAgICB9O1xuXG4gICAgICBsb2coYCR7Y29uZmlnLm1ldGhvZH0gdG8gJHtjb25maWcudXJsfWApO1xuICAgICAgY29uc3QgcmVxdWVzdFByb21pc2UgPSBheGlvcyhjb25maWcpLmNhdGNoKGNhbGxiYWNrRXJyb3JPclRocm93KGNiLCBwYXRoKSk7XG5cbiAgICAgIGlmIChjYikge1xuICAgICAgICAgcmVxdWVzdFByb21pc2UudGhlbigocmVzcG9uc2UpID0+IHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5kYX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VgXG4gICAgKiBAcGFyYW0ge21ldGhvZH0gW21ldGhvZD1HRVRdIC0gSFRUUCBNZXRob2QgdG8gdXNlXG4gICAgKiBAcmV0dXJuIHtQcm9taXNlfSAtIHRoZSBwcm9taXNlIGZvciB0aGUgaHR0cCByZXF1ZXN0XG4gICAgKi9cbiAgIF9yZXF1ZXN0MjA0b3I0MDQocGF0aCwgZGF0YSwgY2IsIG1ldGhvZCA9ICdHRVQnKSB7XG4gICAgICByZXR1cm4gdGhpcy5fcmVxdWVzdChtZXRob2QsIHBhdGgsIGRhdGEpXG4gICAgICAgICAudGhlbihmdW5jdGlvbiBzdWNjZXNzKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoY2IpIHtcbiAgICAgICAgICAgICAgIGNiKG51bGwsIHRydWUsIHJlc3BvbnNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgfSwgZnVuY3Rpb24gZmFpbHVyZShyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnJlc3BvbnNlLnN0YXR1cyA9PT0gNDA0KSB7XG4gICAgICAgICAgICAgICBpZiAoY2IpIHtcbiAgICAgICAgICAgICAgICAgIGNiKG51bGwsIGZhbHNlLCByZXNwb25zZSk7XG4gICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjYikge1xuICAgICAgICAgICAgICAgY2IocmVzcG9uc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgcmVzcG9uc2U7XG4gICAgICAgICB9KTtcbiAgIH1cblxuICAgLyoqXG4gICAgKiBNYWtlIGEgcmVxdWVzdCBhbmQgZmV0Y2ggYWxsIHRoZSBhdmFpbGFibGUgZGF0YS4gR2l0aHViIHdpbGwgcGFnaW5hdGUgcmVzcG9uc2VzIHNvIGZvciBxdWVyaWVzXG4gIC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ZXQgdGhpc0dyb3VwO1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmRhdGEgaW5zdGFuY2VvZiBBcnJheSkge1xuICAgICAgICAgICAgICAgdGhpc0dyb3VwID0gcmVzcG9uc2UuZGF0YTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2UuZGF0YS5pdGVtcyBpbnN0YW5jZW9mIEFycmF5KSB7XG4gICAgICAgICAgICAgICB0aGlzR3JvdXAgPSByZXNwb25zZS5kYXRhLml0ZW1zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gYGNhbm5vdCBmaWd1cmUgb3V0IGhvdyB0byBhcHBlbmQgJHtyZXNwb25zZS5kYXRhfSB0byB0aGUgcmVzdWx0IHNldGA7XG4gICAgICAgICAgICAgICB0aHJvdyBuZXcgUmVzcG9uc2VFcnJvcihtZXNzYWdlLCBwYXRoLCByZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRzLnB1c2goLi4udGhpc0dyb3VwKTtcblxuICAgICAgICAgICAgY29uc3QgbmV4dFVybCA9IGdldE5leHRQYWdlKHJlc3BvbnNlLmhlYWRlcnMubGluayk7XG4gICAgICAgICAgICBpZihuZXh0VXJsKSB7XG4gICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSB7fTtcbiAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIG9wdGlvbnMucGFnZSA9IHBhcnNlSW50KFxuICAgICAgICAgICAgICAgICBuZXh0VXJsLm1hdGNoKC8oWyZcXD9dcGFnZT1bMC05XSopL2cpXG4gICAgICAgICAgICAgICAgICAgLnNoaWZ0KClcbiAgICAgICAgICAgICAgICAgICAuc3BsaXQoJz0nKVxuICAgICAgICAgICAgICAgICAgIC5wb3AoKVxuICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgIGlmIC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93aW5nIGVycm9yJyk7XG4gICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgIH1cbiAgIH07XG59XG4iXX0=
//# sourceMappingURL=Requestable.js.map

@@ -1,3 +0,3 @@

!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(){return function(){function e(t,r,n){function u(o,i){if(!r[o]){if(!t[o]){var a="function"==typeof require&&require;if(!i&&a)return a(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return u(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)u(n[o]);return u}return e}()({1:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__id=e,o}return s(t,e),o(t,[{key:"read",value:function(e){return this._request("GET","/gists/"+this.__id,null,e)}},{key:"create",value:function(e,t){var r=this;return this._request("POST","/gists",e,t).then(function(e){return r.__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:"listCommits",value:function(e){return this._requestAllPages("/gists/"+this.__id+"/commits",null,e)}},{key:"getRevision",value:function(e,t){return this._request("GET","/gists/"+this.__id+"/"+e,null,t)}},{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,r){return this._request("PATCH","/gists/"+this.__id+"/comments/"+e,{body:t},r)}},{key:"deleteComment",value:function(e,t){return this._request("DELETE","/gists/"+this.__id+"/comments/"+e,null,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],2:[function(e,t,r){"use strict";function n(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")}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Gist"),i=n(o),a=e("./User"),l=n(a),c=e("./Issue"),f=n(c),_=e("./Search"),h=n(_),p=e("./RateLimit"),y=n(p),d=e("./Repository"),m=n(d),v=e("./Organization"),b=n(v),g=e("./Team"),k=n(g),T=e("./Markdown"),q=n(T),E=e("./Project"),O=n(E),w=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://api.github.com";u(this,e),this.__apiBase=r,this.__auth=t||{}}return s(e,[{key:"getGist",value:function(e){return new i.default(e,this.__auth,this.__apiBase)}},{key:"getUser",value:function(e){return new l.default(e,this.__auth,this.__apiBase)}},{key:"getOrganization",value:function(e){return new b.default(e,this.__auth,this.__apiBase)}},{key:"getTeam",value:function(e){return new k.default(e,this.__auth,this.__apiBase)}},{key:"getRepo",value:function(e,t){return new m.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"getIssues",value:function(e,t){return new f.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"search",value:function(e){return new h.default(e,this.__auth,this.__apiBase)}},{key:"getRateLimit",value:function(){return new y.default(this.__auth,this.__apiBase)}},{key:"getMarkdown",value:function(){return new q.default(this.__auth,this.__apiBase)}},{key:"getProject",value:function(e){return new O.default(e,this.__auth,this.__apiBase)}},{key:"_getFullName",value:function(e,t){var r=e;return t&&(r=e+"/"+t),r}}]),e}();t.exports=w},{"./Gist":1,"./Issue":3,"./Markdown":4,"./Organization":5,"./Project":6,"./RateLimit":7,"./Repository":8,"./Search":10,"./Team":11,"./User":12}],3:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__repository=e,o}return s(t,e),o(t,[{key:"createIssue",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssues",value:function(e,t){return this._requestAllPages("/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssueEvents",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/events",null,t)}},{key:"listIssueComments",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/comments",null,t)}},{key:"getIssueComment",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"createIssueComment",value:function(e,t,r){return this._request("POST","/repos/"+this.__repository+"/issues/"+e+"/comments",{body:t},r)}},{key:"editIssueComment",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/comments/"+e,{body:t},r)}},{key:"deleteIssueComment",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"editIssue",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/"+e,t,r)}},{key:"getIssue",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e,null,t)}},{key:"listMilestones",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones",e,t)}},{key:"getMilestone",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createMilestone",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/milestones",e,t)}},{key:"editMilestone",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/milestones/"+e,t,r)}},{key:"deleteMilestone",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createLabel",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/labels",e,t)}},{key:"listLabels",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/labels",e,t)}},{key:"getLabel",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/labels/"+e,null,t)}},{key:"editLabel",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/labels/"+e,t,r)}},{key:"deleteLabel",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/labels/"+e,null,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],4:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r){return n(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return s(t,e),o(t,[{key:"render",value:function(e,t){return this._request("POST","/markdown",e,t,!0)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],5:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__name=e,o}return s(t,e),o(t,[{key:"createRepo",value:function(e,t){return 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)}},{key:"isMember",value:function(e,t){return this._request204or404("/orgs/"+this.__name+"/members/"+e,null,t)}},{key:"listMembers",value:function(e,t){return this._request("GET","/orgs/"+this.__name+"/members",e,t)}},{key:"getTeams",value:function(e){return this._requestAllPages("/orgs/"+this.__name+"/teams",void 0,e)}},{key:"createTeam",value:function(e,t){return this._request("POST","/orgs/"+this.__name+"/teams",e,t)}},{key:"listProjects",value:function(e){return this._requestAllPages("/orgs/"+this.__name+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function(e,t){return e=e||{},e.AcceptHeader="inertia-preview",this._request("POST","/orgs/"+this.__name+"/projects",e,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],6:[function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=function(e){return e&&e.__esModule?e:{default:e}}(a),c=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n,"inertia-preview"));return o.__id=e,o}return o(t,e),i(t,[{key:"getProject",value:function(e){return this._request("GET","/projects/"+this.__id,null,e)}},{key:"updateProject",value:function(e,t){return this._request("PATCH","/projects/"+this.__id,e,t)}},{key:"deleteProject",value:function(e){return this._request("DELETE","/projects/"+this.__id,null,e)}},{key:"listProjectColumns",value:function(e){return this._requestAllPages("/projects/"+this.__id+"/columns",null,e)}},{key:"getProjectColumn",value:function(e,t){return this._request("GET","/projects/columns/"+e,null,t)}},{key:"createProjectColumn",value:function(e,t){return this._request("POST","/projects/"+this.__id+"/columns",e,t)}},{key:"updateProjectColumn",value:function(e,t,r){return this._request("PATCH","/projects/columns/"+e,t,r)}},{key:"deleteProjectColumn",value:function(e,t){return this._request("DELETE","/projects/columns/"+e,null,t)}},{key:"moveProjectColumn",value:function(e,t,r){return this._request("POST","/projects/columns/"+e+"/moves",{position:t},r)}},{key:"listProjectCards",value:function(e){var t=this;return this.listProjectColumns().then(function(e){var r=e.data;return Promise.all(r.map(function(e){return t._requestAllPages("/projects/columns/"+e.id+"/cards",null)}))}).then(function(t){var r=t.reduce(function(e,t){var r=t.data;return e.push.apply(e,n(r)),e},[]);return e&&e(null,r),r}).catch(function(t){if(e)return void e(t);throw t})}},{key:"listColumnCards",value:function(e,t){return this._requestAllPages("/projects/columns/"+e+"/cards",null,t)}},{key:"getProjectCard",value:function(e,t){return this._request("GET","/projects/columns/cards/"+e,null,t)}},{key:"createProjectCard",value:function(e,t,r){return this._request("POST","/projects/columns/"+e+"/cards",t,r)}},{key:"updateProjectCard",value:function(e,t,r){return this._request("PATCH","/projects/columns/cards/"+e,t,r)}},{key:"deleteProjectCard",value:function(e,t){return this._request("DELETE","/projects/columns/cards/"+e,null,t)}},{key:"moveProjectCard",value:function(e,t,r,n){return this._request("POST","/projects/columns/cards/"+e+"/moves",{position:t,column_id:r},n)}}]),t}(l.default);t.exports=c},{"./Requestable":9}],7:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r){return n(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return s(t,e),o(t,[{key:"getRateLimit",value:function(e){return this._request("GET","/rate_limit",null,e)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],8:[function(e,t,r){(function(r){"use strict";function n(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 s(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 i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=e("./Requestable"),c=n(l),f=e("utf8"),_=n(f),h=e("js-base64"),p=e("debug"),y=n(p),d=(0,y.default)("github:repository"),m=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__fullname=e,o.__currentTree={branch:null,sha:null},o}return o(t,e),a(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:"listPullRequestFiles",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e+"/files",null,t)}},{key:"compareBranches",value:function(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/compare/"+e+"..."+t,null,r)}},{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:"getBranch",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/branches/"+e,null,t)}},{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||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),e.until=this._dateToISO(e.until),this._request("GET","/repos/"+this.__fullname+"/commits",e,t)}},{key:"getSingleCommit",value:function(e,t){return e=e||"",this._request("GET","/repos/"+this.__fullname+"/commits/"+e,null,t)}},{key:"getSha",value:function(e,t,r){return e=e?"?ref="+e:"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t+e,null,r)}},{key:"listStatuses",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/statuses",null,t)}},{key:"getCombinedStatus",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/status",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 r=this._getContentObject(e);return d("sending content",r),this._request("POST","/repos/"+this.__fullname+"/git/blobs",r,t)}},{key:"_getContentObject",value:function(e){if("string"==typeof e)return d("contet is a string"),{content:_.default.encode(e),encoding:"utf-8"};if(void 0!==r&&e instanceof r)return d("We appear to be in Node"),{content:e.toString("base64"),encoding:"base64"};if("undefined"!=typeof Blob&&e instanceof Blob)return d("We appear to be in the browser"),{content:h.Base64.encode(e),encoding:"base64"};throw d("Not sure what this content is: "+(void 0===e?"undefined":i(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,r,n){var u={base_tree:e,tree:[{path:t,sha:r,mode:"100644",type:"blob"}]};return this._request("POST","/repos/"+this.__fullname+"/git/trees",u,n)}},{key:"createTree",value:function(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/git/trees",{tree:e,base_tree:t},r)}},{key:"commit",value:function(e,t,r,n,u){var s=this;"function"==typeof n&&(u=n,n={});var o={message:r,tree:t,parents:[e]};return o=Object.assign({},n,o),this._request("POST","/repos/"+this.__fullname+"/git/commits",o,u).then(function(e){return s.__currentTree.sha=e.data.sha,e})}},{key:"updateHead",value:function(e,t,r,n){return this._request("PATCH","/repos/"+this.__fullname+"/git/refs/"+e,{sha:t,force:r},n)}},{key:"updateStatus",value:function(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/statuses/"+e,t,r)}},{key:"updateRepository",value:function(e,t){return this._request("PATCH","/repos/"+this.__fullname,e,t)}},{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+"/contributors",null,e)}},{key:"getContributorStats",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,r,n){return t=t?""+encodeURI(t):"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t,{ref:e},n,r)}},{key:"getReadme",value:function(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/readme",{ref:e},r,t)}},{key:"fork",value:function(e){return this._request("POST","/repos/"+this.__fullname+"/forks",null,e)}},{key:"forkToOrg",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/forks?organization="+e,null,t)}},{key:"listForks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/forks",null,e)}},{key:"createBranch",value:function(e,t,r){var n=this;return"function"==typeof t&&(r=t,t=e,e="master"),this.getRef("heads/"+e).then(function(e){var u=e.data.object.sha;return n.createRef({sha:u,ref:"refs/heads/"+t},r)})}},{key:"createPullRequest",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"updatePullRequest",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__fullname+"/pulls/"+e,t,r)}},{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,r){return this._request("PATCH","/repos/"+this.__fullname+"/hooks/"+e,t,r)}},{key:"deleteHook",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"listKeys",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/keys",null,e)}},{key:"getKey",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"createKey",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/keys",e,t)}},{key:"deleteKey",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"deleteFile",value:function(e,t,r){var n=this;return this.getSha(e,t).then(function(u){var s={message:"Delete the file at '"+t+"'",sha:u.data.sha,branch:e};return n._request("DELETE","/repos/"+n.__fullname+"/contents/"+t,s,r)})}},{key:"move",value:function(e,t,r,n){var u=this,s=void 0;return this.getRef("heads/"+e).then(function(e){var t=e.data.object;return u.getTree(t.sha+"?recursive=true")}).then(function(e){var n=e.data,o=n.tree,i=n.sha;s=i;var a=o.map(function(e){return e.path===t&&(e.path=r),"tree"===e.type&&delete e.sha,e});return u.createTree(a)}).then(function(e){var n=e.data;return u.commit(s,n.sha,"Renamed '"+t+"' to '"+r+"'")}).then(function(t){var r=t.data;return u.updateHead("heads/"+e,r.sha,!0,n)})}},{key:"writeFile",value:function(e,t,r,n,u,s){var o=this;"function"==typeof u&&(s=u,u={});var i=t?encodeURI(t):"",a=!1!==u.encode,l={branch:e,message:n,author:u.author,committer:u.committer,content:a?h.Base64.encode(r):r};return this.getSha(e,i).then(function(e){return l.sha=e.data.sha,o._request("PUT","/repos/"+o.__fullname+"/contents/"+i,l,s)},function(){return o._request("PUT","/repos/"+o.__fullname+"/contents/"+i,l,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,r){return this._request("PATCH","/repos/"+this.__fullname+"/releases/"+e,t,r)}},{key:"listReleases",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/releases",null,e)}},{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)}},{key:"mergePullRequest",value:function(e,t,r){return this._request("PUT","/repos/"+this.__fullname+"/pulls/"+e+"/merge",t,r)}},{key:"listProjects",value:function(e){return this._requestAllPages("/repos/"+this.__fullname+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function(e,t){return e=e||{},e.AcceptHeader="inertia-preview",this._request("POST","/repos/"+this.__fullname+"/projects",e,t)}}]),t}(c.default);t.exports=m}).call(this,e("buffer").Buffer)},{"./Requestable":9,buffer:void 0,debug:void 0,"js-base64":void 0,utf8:void 0}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function s(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 i(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)}function a(e){return-1!==k.indexOf(e)}function l(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/\s*,\s*/).reduce(function(e,t){return-1!==t.search(/rel="next"/)?(t.match(/<(.*)>/)||[])[1]:e},void 0)}function c(e,t){return function(r){var n=void 0;if(r.hasOwnProperty("config")){var u=r.response,s=u.status,o=u.statusText,i=r.config,a=i.method,l=i.url,c=s+" error making request "+a+" "+l+': "'+o+'"';n=new b(c,t,r),v(c+" "+JSON.stringify(r.data))}else n=r;if(!e)throw v("throwing error"),n;v("going to error callback"),e(n)}}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=e("axios"),p=n(h),y=e("debug"),d=n(y),m=e("js-base64"),v=(0,d.default)("github:request"),b=function(e){function t(e,r,n){s(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.path=r,u.request=n.config,u.response=(n||{}).response||n,u.status=n.status,u}return i(t,e),t}(Error),g=function(){function e(t,r,n){s(this,e),this.__apiBase=r||"https://api.github.com",this.__auth={token:t.token,username:t.username,password:t.password},this.__AcceptHeader=n||"v3",t.token?this.__authorizationHeader="token "+t.token:t.username&&t.password&&(this.__authorizationHeader="Basic "+m.Base64.encode(t.username+":"+t.password))}return _(e,[{key:"__getURL",value:function(e){var t=e;-1===e.indexOf("//")&&(t=this.__apiBase+e);var r="timestamp="+(new Date).getTime();return t.replace(/(timestamp=\d+)/,r)}},{key:"__getRequestHeaders",value:function(e,t){var r={"Content-Type":"application/json;charset=UTF-8",Accept:"application/vnd.github."+(t||this.__AcceptHeader)};return e&&(r.Accept+=".raw"),r.Accept+="+json",this.__authorizationHeader&&(r.Authorization=this.__authorizationHeader),r}},{key:"_getOptionsWithDefaults",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.visibility||e.affiliation||(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,r,n,u){var s=this.__getURL(t),o=(r||{}).AcceptHeader;o&&delete r.AcceptHeader;var i=this.__getRequestHeaders(u,o),l={};r&&"object"===(void 0===r?"undefined":f(r))&&a(e)&&(l=r,r=void 0);var _={url:s,method:e,headers:i,params:l,data:r,responseType:u?"text":"json"};v(_.method+" to "+_.url);var h=(0,p.default)(_).catch(c(n,t));return n&&h.then(function(e){e.data&&Object.keys(e.data).length>0?n(null,e.data,e):"GET"!==_.method&&Object.keys(e.data).length<1?n(null,e.status<300,e):n(null,e.data,e)}),h}},{key:"_request204or404",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"GET";return this._request(n,e,t).then(function(e){return r&&r(null,!0,e),!0},function(e){if(404===e.response.status)return r&&r(null,!1,e),!1;throw r&&r(e),e})}},{key:"_requestAllPages",value:function(e,t,r,n){var s=this;return n=n||[],this._request("GET",e,t).then(function(o){var i,a=void 0;if(o.data instanceof Array)a=o.data;else{if(!(o.data.items instanceof Array)){var c="cannot figure out how to append "+o.data+" to the result set";throw new b(c,e,o)}a=o.data.items}(i=n).push.apply(i,u(a))
;var f=l(o.headers.link);return f&&(t||(t={}),t.page=parseInt(f.match(/(page=[0-9]*)/g).shift().split("=").pop()),!t||"number"==typeof t.page)?(v("getting next page: "+f),s._requestAllPages(f,t,r,n)):(r&&r(null,n,o),o.data=n,o)}).catch(c(r,e))}}]),e}();t.exports=g;var k=["GET","HEAD","DELETE"]},{axios:void 0,debug:void 0,"js-base64":void 0}],10:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:search"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__defaults=o._getOptionsWithDefaults(e),o}return o(t,e),i(t,[{key:"_search",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,u={};return Object.keys(this.__defaults).forEach(function(e){u[e]=t.__defaults[e]}),Object.keys(r).forEach(function(e){u[e]=r[e]}),_("searching "+e+" with options:",u),this._requestAllPages("/search/"+e,u,n)}},{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}(l.default);t.exports=h},{"./Requestable":9,debug:void 0}],11:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:team"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__teamId=e,o}return o(t,e),i(t,[{key:"getTeam",value:function(e){return _("Fetching Team "+this.__teamId),this._request("Get","/teams/"+this.__teamId,void 0,e)}},{key:"listRepos",value:function(e){return _("Fetching repositories for Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/repos",void 0,e)}},{key:"editTeam",value:function(e,t){return _("Editing Team "+this.__teamId),this._request("PATCH","/teams/"+this.__teamId,e,t)}},{key:"listMembers",value:function(e,t){return _("Getting members of Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/members",e,t)}},{key:"getMembership",value:function(e,t){return _("Getting membership of user "+e+" in Team "+this.__teamId),this._request("GET","/teams/"+this.__teamId+"/memberships/"+e,void 0,t)}},{key:"addMembership",value:function(e,t,r){return _("Adding user "+e+" to Team "+this.__teamId),this._request("PUT","/teams/"+this.__teamId+"/memberships/"+e,t,r)}},{key:"isManagedRepo",value:function(e,t,r){return _("Getting repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r)}},{key:"manageRepo",value:function(e,t,r,n){return _("Adding or Updating repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,r,n,"PUT")}},{key:"unmanageRepo",value:function(e,t,r){return _("Remove repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r,"DELETE")}},{key:"deleteTeam",value:function(e){return _("Deleting Team "+this.__teamId),this._request204or404("/teams/"+this.__teamId,void 0,e,"DELETE")}}]),t}(l.default);t.exports=h},{"./Requestable":9,debug:void 0}],12:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:user"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__user=e,o}return o(t,e),i(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:"listRepos",value:function(e,t){return"function"==typeof e&&(t=e,e={}),e=this._getOptionsWithDefaults(e),_("Fetching repositories with options: "+JSON.stringify(e)),this._requestAllPages(this.__getScopedUrl("repos"),e,t)}},{key:"listOrgs",value:function(e){return this._request("GET",this.__getScopedUrl("orgs"),null,e)}},{key:"listFollowers",value:function(e){return this._request("GET",this.__getScopedUrl("followers"),null,e)}},{key:"listFollowing",value:function(e){return this._request("GET",this.__getScopedUrl("following"),null,e)}},{key:"listGists",value:function(e){return this._request("GET",this.__getScopedUrl("gists"),null,e)}},{key:"listNotifications",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:"listStarredRepos",value:function(e){var t=this._getOptionsWithDefaults();return this._requestAllPages(this.__getScopedUrl("starred"),t,e)}},{key:"listStarredGists",value:function(e,t){return e=e||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),this._request("GET","/gists/starred",e,t)}},{key:"getEmails",value:function(e){return this._request("GET","/user/emails",null,e)}},{key:"follow",value:function(e,t){return this._request("PUT","/user/following/"+e,null,t)}},{key:"unfollow",value:function(e,t){return this._request("DELETE","/user/following/"+e,null,t)}},{key:"createRepo",value:function(e,t){return this._request("POST","/user/repos",e,t)}}]),t}(l.default);t.exports=h},{"./Requestable":9,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(){return function(){function e(t,r,n){function u(o,i){if(!r[o]){if(!t[o]){var a="function"==typeof require&&require;if(!i&&a)return a(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return u(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)u(n[o]);return u}return e}()({1:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__id=e,o}return s(t,e),o(t,[{key:"read",value:function(e){return this._request("GET","/gists/"+this.__id,null,e)}},{key:"create",value:function(e,t){var r=this;return this._request("POST","/gists",e,t).then(function(e){return r.__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:"listCommits",value:function(e){return this._requestAllPages("/gists/"+this.__id+"/commits",null,e)}},{key:"getRevision",value:function(e,t){return this._request("GET","/gists/"+this.__id+"/"+e,null,t)}},{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,r){return this._request("PATCH","/gists/"+this.__id+"/comments/"+e,{body:t},r)}},{key:"deleteComment",value:function(e,t){return this._request("DELETE","/gists/"+this.__id+"/comments/"+e,null,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],2:[function(e,t,r){"use strict";function n(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")}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Gist"),i=n(o),a=e("./User"),l=n(a),c=e("./Issue"),f=n(c),_=e("./Search"),h=n(_),p=e("./RateLimit"),y=n(p),d=e("./Repository"),m=n(d),v=e("./Organization"),b=n(v),g=e("./Team"),k=n(g),T=e("./Markdown"),q=n(T),E=e("./Project"),O=n(E),w=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://api.github.com";u(this,e),this.__apiBase=r,this.__auth=t||{}}return s(e,[{key:"getGist",value:function(e){return new i.default(e,this.__auth,this.__apiBase)}},{key:"getUser",value:function(e){return new l.default(e,this.__auth,this.__apiBase)}},{key:"getOrganization",value:function(e){return new b.default(e,this.__auth,this.__apiBase)}},{key:"getTeam",value:function(e){return new k.default(e,this.__auth,this.__apiBase)}},{key:"getRepo",value:function(e,t){return new m.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"getIssues",value:function(e,t){return new f.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"search",value:function(e){return new h.default(e,this.__auth,this.__apiBase)}},{key:"getRateLimit",value:function(){return new y.default(this.__auth,this.__apiBase)}},{key:"getMarkdown",value:function(){return new q.default(this.__auth,this.__apiBase)}},{key:"getProject",value:function(e){return new O.default(e,this.__auth,this.__apiBase)}},{key:"_getFullName",value:function(e,t){var r=e;return t&&(r=e+"/"+t),r}}]),e}();t.exports=w},{"./Gist":1,"./Issue":3,"./Markdown":4,"./Organization":5,"./Project":6,"./RateLimit":7,"./Repository":8,"./Search":10,"./Team":11,"./User":12}],3:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__repository=e,o}return s(t,e),o(t,[{key:"createIssue",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssues",value:function(e,t){return this._requestAllPages("/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssueEvents",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/events",null,t)}},{key:"listIssueComments",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/comments",null,t)}},{key:"getIssueComment",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"createIssueComment",value:function(e,t,r){return this._request("POST","/repos/"+this.__repository+"/issues/"+e+"/comments",{body:t},r)}},{key:"editIssueComment",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/comments/"+e,{body:t},r)}},{key:"deleteIssueComment",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"editIssue",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/"+e,t,r)}},{key:"getIssue",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e,null,t)}},{key:"listMilestones",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones",e,t)}},{key:"getMilestone",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createMilestone",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/milestones",e,t)}},{key:"editMilestone",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/milestones/"+e,t,r)}},{key:"deleteMilestone",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createLabel",value:function(e,t){return this._request("POST","/repos/"+this.__repository+"/labels",e,t)}},{key:"listLabels",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/labels",e,t)}},{key:"getLabel",value:function(e,t){return this._request("GET","/repos/"+this.__repository+"/labels/"+e,null,t)}},{key:"editLabel",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/labels/"+e,t,r)}},{key:"deleteLabel",value:function(e,t){return this._request("DELETE","/repos/"+this.__repository+"/labels/"+e,null,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],4:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r){return n(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return s(t,e),o(t,[{key:"render",value:function(e,t){return this._request("POST","/markdown",e,t,!0)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],5:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r,s){n(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,s));return o.__name=e,o}return s(t,e),o(t,[{key:"createRepo",value:function(e,t){return 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)}},{key:"isMember",value:function(e,t){return this._request204or404("/orgs/"+this.__name+"/members/"+e,null,t)}},{key:"listMembers",value:function(e,t){return this._request("GET","/orgs/"+this.__name+"/members",e,t)}},{key:"getTeams",value:function(e){return this._requestAllPages("/orgs/"+this.__name+"/teams",void 0,e)}},{key:"createTeam",value:function(e,t){return this._request("POST","/orgs/"+this.__name+"/teams",e,t)}},{key:"listProjects",value:function(e){return this._requestAllPages("/orgs/"+this.__name+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function(e,t){return e=e||{},e.AcceptHeader="inertia-preview",this._request("POST","/orgs/"+this.__name+"/projects",e,t)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],6:[function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=function(e){return e&&e.__esModule?e:{default:e}}(a),c=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n,"inertia-preview"));return o.__id=e,o}return o(t,e),i(t,[{key:"getProject",value:function(e){return this._request("GET","/projects/"+this.__id,null,e)}},{key:"updateProject",value:function(e,t){return this._request("PATCH","/projects/"+this.__id,e,t)}},{key:"deleteProject",value:function(e){return this._request("DELETE","/projects/"+this.__id,null,e)}},{key:"listProjectColumns",value:function(e){return this._requestAllPages("/projects/"+this.__id+"/columns",null,e)}},{key:"getProjectColumn",value:function(e,t){return this._request("GET","/projects/columns/"+e,null,t)}},{key:"createProjectColumn",value:function(e,t){return this._request("POST","/projects/"+this.__id+"/columns",e,t)}},{key:"updateProjectColumn",value:function(e,t,r){return this._request("PATCH","/projects/columns/"+e,t,r)}},{key:"deleteProjectColumn",value:function(e,t){return this._request("DELETE","/projects/columns/"+e,null,t)}},{key:"moveProjectColumn",value:function(e,t,r){return this._request("POST","/projects/columns/"+e+"/moves",{position:t},r)}},{key:"listProjectCards",value:function(e){var t=this;return this.listProjectColumns().then(function(e){var r=e.data;return Promise.all(r.map(function(e){return t._requestAllPages("/projects/columns/"+e.id+"/cards",null)}))}).then(function(t){var r=t.reduce(function(e,t){var r=t.data;return e.push.apply(e,n(r)),e},[]);return e&&e(null,r),r}).catch(function(t){if(e)return void e(t);throw t})}},{key:"listColumnCards",value:function(e,t){return this._requestAllPages("/projects/columns/"+e+"/cards",null,t)}},{key:"getProjectCard",value:function(e,t){return this._request("GET","/projects/columns/cards/"+e,null,t)}},{key:"createProjectCard",value:function(e,t,r){return this._request("POST","/projects/columns/"+e+"/cards",t,r)}},{key:"updateProjectCard",value:function(e,t,r){return this._request("PATCH","/projects/columns/cards/"+e,t,r)}},{key:"deleteProjectCard",value:function(e,t){return this._request("DELETE","/projects/columns/cards/"+e,null,t)}},{key:"moveProjectCard",value:function(e,t,r,n){return this._request("POST","/projects/columns/cards/"+e+"/moves",{position:t,column_id:r},n)}}]),t}(l.default);t.exports=c},{"./Requestable":9}],7:[function(e,t,r){"use strict";function n(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 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 o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./Requestable"),a=function(e){return e&&e.__esModule?e:{default:e}}(i),l=function(e){function t(e,r){return n(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return s(t,e),o(t,[{key:"getRateLimit",value:function(e){return this._request("GET","/rate_limit",null,e)}}]),t}(a.default);t.exports=l},{"./Requestable":9}],8:[function(e,t,r){(function(r){(function(){"use strict";function n(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 s(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 i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=e("./Requestable"),c=n(l),f=e("utf8"),_=n(f),h=e("js-base64"),p=e("debug"),y=n(p),d=(0,y.default)("github:repository"),m=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__fullname=e,o.__currentTree={branch:null,sha:null},o}return o(t,e),a(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:"listPullRequestFiles",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e+"/files",null,t)}},{key:"compareBranches",value:function(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/compare/"+e+"..."+t,null,r)}},{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:"getBranch",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/branches/"+e,null,t)}},{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||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),e.until=this._dateToISO(e.until),this._request("GET","/repos/"+this.__fullname+"/commits",e,t)}},{key:"listCommitsOnPR",value:function(e,t,r){return t=t||{},"function"==typeof t&&(r=t,t={}),this._request("GET","/repos/"+this.__fullname+"/pulls/"+e+"/commits",t,r)}},{key:"getSingleCommit",value:function(e,t){return e=e||"",this._request("GET","/repos/"+this.__fullname+"/commits/"+e,null,t)}},{key:"getSha",value:function(e,t,r){return e=e?"?ref="+e:"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t+e,null,r)}},{key:"listStatuses",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/statuses",null,t)}},{key:"getCombinedStatus",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/status",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 r=this._getContentObject(e);return d("sending content",r),this._request("POST","/repos/"+this.__fullname+"/git/blobs",r,t)}},{key:"_getContentObject",value:function(e){if("string"==typeof e)return d("contet is a string"),{content:_.default.encode(e),encoding:"utf-8"};if(void 0!==r&&e instanceof r)return d("We appear to be in Node"),{content:e.toString("base64"),encoding:"base64"};if("undefined"!=typeof Blob&&e instanceof Blob)return d("We appear to be in the browser"),{content:h.Base64.encode(e),encoding:"base64"};throw d("Not sure what this content is: "+(void 0===e?"undefined":i(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,r,n){var u={base_tree:e,tree:[{path:t,sha:r,mode:"100644",type:"blob"}]};return this._request("POST","/repos/"+this.__fullname+"/git/trees",u,n)}},{key:"createTree",value:function(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/git/trees",{tree:e,base_tree:t},r)}},{key:"commit",value:function(e,t,r,n,u){var s=this;"function"==typeof n&&(u=n,n={});var o={message:r,tree:t,parents:[e]};return o=Object.assign({},n,o),this._request("POST","/repos/"+this.__fullname+"/git/commits",o,u).then(function(e){return s.__currentTree.sha=e.data.sha,e})}},{key:"updateHead",value:function(e,t,r,n){return this._request("PATCH","/repos/"+this.__fullname+"/git/refs/"+e,{sha:t,force:r},n)}},{key:"updateStatus",value:function(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/statuses/"+e,t,r)}},{key:"updateRepository",value:function(e,t){return this._request("PATCH","/repos/"+this.__fullname,e,t)}},{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+"/contributors",null,e)}},{key:"getContributorStats",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,r,n){return t=t?""+encodeURI(t):"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t,{ref:e},n,r)}},{key:"getReadme",value:function(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/readme",{ref:e},r,t)}},{key:"fork",value:function(e){return this._request("POST","/repos/"+this.__fullname+"/forks",null,e)}},{key:"forkToOrg",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/forks?organization="+e,null,t)}},{key:"listForks",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/forks",null,e)}},{key:"createBranch",value:function(e,t,r){var n=this;return"function"==typeof t&&(r=t,t=e,e="master"),this.getRef("heads/"+e).then(function(e){var u=e.data.object.sha;return n.createRef({sha:u,ref:"refs/heads/"+t},r)})}},{key:"createPullRequest",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"updatePullRequest",value:function(e,t,r){return this._request("PATCH","/repos/"+this.__fullname+"/pulls/"+e,t,r)}},{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,r){return this._request("PATCH","/repos/"+this.__fullname+"/hooks/"+e,t,r)}},{key:"deleteHook",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"listKeys",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/keys",null,e)}},{key:"getKey",value:function(e,t){return this._request("GET","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"createKey",value:function(e,t){return this._request("POST","/repos/"+this.__fullname+"/keys",e,t)}},{key:"deleteKey",value:function(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"deleteFile",value:function(e,t,r){var n=this;return this.getSha(e,t).then(function(u){var s={message:"Delete the file at '"+t+"'",sha:u.data.sha,branch:e};return n._request("DELETE","/repos/"+n.__fullname+"/contents/"+t,s,r)})}},{key:"move",value:function(e,t,r,n){var u=this,s=void 0;return this.getRef("heads/"+e).then(function(e){var t=e.data.object;return u.getTree(t.sha+"?recursive=true")}).then(function(e){var n=e.data,o=n.tree,i=n.sha;s=i;var a=o.map(function(e){return e.path===t&&(e.path=r),"tree"===e.type&&delete e.sha,e});return u.createTree(a)}).then(function(e){var n=e.data;return u.commit(s,n.sha,"Renamed '"+t+"' to '"+r+"'")}).then(function(t){var r=t.data;return u.updateHead("heads/"+e,r.sha,!0,n)})}},{key:"writeFile",value:function(e,t,r,n,u,s){var o=this;"function"==typeof(u=u||{})&&(s=u,u={});var i=t?encodeURI(t):"",a=!1!==u.encode,l={branch:e,message:n,author:u.author,committer:u.committer,content:a?h.Base64.encode(r):r};return this.getSha(e,i).then(function(e){return l.sha=e.data.sha,o._request("PUT","/repos/"+o.__fullname+"/contents/"+i,l,s)},function(){return o._request("PUT","/repos/"+o.__fullname+"/contents/"+i,l,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,r){return this._request("PATCH","/repos/"+this.__fullname+"/releases/"+e,t,r)}},{key:"listReleases",value:function(e){return this._request("GET","/repos/"+this.__fullname+"/releases",null,e)}},{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)}},{key:"mergePullRequest",value:function(e,t,r){return this._request("PUT","/repos/"+this.__fullname+"/pulls/"+e+"/merge",t,r)}},{key:"listProjects",value:function(e){return this._requestAllPages("/repos/"+this.__fullname+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function(e,t){return e=e||{},e.AcceptHeader="inertia-preview",this._request("POST","/repos/"+this.__fullname+"/projects",e,t)}}]),t}(c.default);t.exports=m}).call(this)}).call(this,e("buffer").Buffer)},{"./Requestable":9,buffer:void 0,debug:void 0,"js-base64":void 0,utf8:void 0}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function s(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 i(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)}function a(e){return-1!==k.indexOf(e)}function l(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/\s*,\s*/).reduce(function(e,t){return-1!==t.search(/rel="next"/)?(t.match(/<(.*)>/)||[])[1]:e},void 0)}function c(e,t){return function(r){var n=void 0;if(r.hasOwnProperty("config")){var u=r.response,s=u.status,o=u.statusText,i=r.config,a=i.method,l=i.url,c=s+" error making request "+a+" "+l+': "'+o+'"';n=new b(c,t,r),v(c+" "+JSON.stringify(r.data))}else n=r;if(!e)throw v("throwing error"),n;v("going to error callback"),e(n)}}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=e("axios"),p=n(h),y=e("debug"),d=n(y),m=e("js-base64"),v=(0,d.default)("github:request"),b=function(e){function t(e,r,n){s(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.path=r,u.request=n.config,u.response=(n||{}).response||n,u.status=n.status,u}return i(t,e),t}(Error),g=function(){function e(t,r,n){s(this,e),this.__apiBase=r||"https://api.github.com",this.__auth={token:t.token,username:t.username,password:t.password},this.__AcceptHeader=n||"v3",t.token?this.__authorizationHeader="token "+t.token:t.username&&t.password&&(this.__authorizationHeader="Basic "+m.Base64.encode(t.username+":"+t.password))}return _(e,[{key:"__getURL",value:function(e){var t=e;-1===e.indexOf("//")&&(t=this.__apiBase+e);var r="timestamp="+(new Date).getTime();return t.replace(/(timestamp=\d+)/,r)}},{key:"__getRequestHeaders",value:function(e,t){var r={"Content-Type":"application/json;charset=UTF-8",Accept:"application/vnd.github."+(t||this.__AcceptHeader)};return e&&(r.Accept+=".raw"),r.Accept+="+json",this.__authorizationHeader&&(r.Authorization=this.__authorizationHeader),r}},{key:"_getOptionsWithDefaults",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.visibility||e.affiliation||(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,r,n,u){var s=this.__getURL(t),o=(r||{}).AcceptHeader;o&&delete r.AcceptHeader;var i=this.__getRequestHeaders(u,o),l={};r&&"object"===(void 0===r?"undefined":f(r))&&a(e)&&(l=r,r=void 0);var _={url:s,method:e,headers:i,params:l,data:r,responseType:u?"text":"json"};v(_.method+" to "+_.url);var h=(0,p.default)(_).catch(c(n,t));return n&&h.then(function(e){e.data&&Object.keys(e.data).length>0?n(null,e.data,e):"GET"!==_.method&&Object.keys(e.data).length<1?n(null,e.status<300,e):n(null,e.data,e)}),h}},{key:"_request204or404",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"GET";return this._request(n,e,t).then(function(e){return r&&r(null,!0,e),!0},function(e){if(404===e.response.status)return r&&r(null,!1,e),!1;throw r&&r(e),e})}},{key:"_requestAllPages",value:function(e,t,r,n){var s=this;return n=n||[],this._request("GET",e,t).then(function(o){var i,a=void 0
;if(o.data instanceof Array)a=o.data;else{if(!(o.data.items instanceof Array)){var c="cannot figure out how to append "+o.data+" to the result set";throw new b(c,e,o)}a=o.data.items}(i=n).push.apply(i,u(a));var f=l(o.headers.link);return f&&(t||(t={}),t.page=parseInt(f.match(/([&\?]page=[0-9]*)/g).shift().split("=").pop()),!t||"number"==typeof t.page)?(v("getting next page: "+f),s._requestAllPages(f,t,r,n)):(r&&r(null,n,o),o.data=n,o)}).catch(c(r,e))}}]),e}();t.exports=g;var k=["GET","HEAD","DELETE"]},{axios:void 0,debug:void 0,"js-base64":void 0}],10:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:search"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__defaults=o._getOptionsWithDefaults(e),o}return o(t,e),i(t,[{key:"_search",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,u={};return Object.keys(this.__defaults).forEach(function(e){u[e]=t.__defaults[e]}),Object.keys(r).forEach(function(e){u[e]=r[e]}),_("searching "+e+" with options:",u),this._requestAllPages("/search/"+e,u,n)}},{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}(l.default);t.exports=h},{"./Requestable":9,debug:void 0}],11:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:team"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__teamId=e,o}return o(t,e),i(t,[{key:"getTeam",value:function(e){return _("Fetching Team "+this.__teamId),this._request("Get","/teams/"+this.__teamId,void 0,e)}},{key:"listRepos",value:function(e){return _("Fetching repositories for Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/repos",void 0,e)}},{key:"editTeam",value:function(e,t){return _("Editing Team "+this.__teamId),this._request("PATCH","/teams/"+this.__teamId,e,t)}},{key:"listMembers",value:function(e,t){return _("Getting members of Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/members",e,t)}},{key:"getMembership",value:function(e,t){return _("Getting membership of user "+e+" in Team "+this.__teamId),this._request("GET","/teams/"+this.__teamId+"/memberships/"+e,void 0,t)}},{key:"addMembership",value:function(e,t,r){return _("Adding user "+e+" to Team "+this.__teamId),this._request("PUT","/teams/"+this.__teamId+"/memberships/"+e,t,r)}},{key:"isManagedRepo",value:function(e,t,r){return _("Getting repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r)}},{key:"manageRepo",value:function(e,t,r,n){return _("Adding or Updating repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,r,n,"PUT")}},{key:"unmanageRepo",value:function(e,t,r){return _("Remove repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r,"DELETE")}},{key:"deleteTeam",value:function(e){return _("Deleting Team "+this.__teamId),this._request204or404("/teams/"+this.__teamId,void 0,e,"DELETE")}}]),t}(l.default);t.exports=h},{"./Requestable":9,debug:void 0}],12:[function(e,t,r){"use strict";function n(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 s(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 i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./Requestable"),l=n(a),c=e("debug"),f=n(c),_=(0,f.default)("github:user"),h=function(e){function t(e,r,n){u(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return o.__user=e,o}return o(t,e),i(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:"listRepos",value:function(e,t){return"function"==typeof e&&(t=e,e={}),e=this._getOptionsWithDefaults(e),_("Fetching repositories with options: "+JSON.stringify(e)),this._requestAllPages(this.__getScopedUrl("repos"),e,t)}},{key:"listOrgs",value:function(e){return this._request("GET",this.__getScopedUrl("orgs"),null,e)}},{key:"listFollowers",value:function(e){return this._request("GET",this.__getScopedUrl("followers"),null,e)}},{key:"listFollowing",value:function(e){return this._request("GET",this.__getScopedUrl("following"),null,e)}},{key:"listGists",value:function(e){return this._request("GET",this.__getScopedUrl("gists"),null,e)}},{key:"listNotifications",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:"listStarredRepos",value:function(e){var t=this._getOptionsWithDefaults();return this._requestAllPages(this.__getScopedUrl("starred"),t,e)}},{key:"listStarredGists",value:function(e,t){return e=e||{},"function"==typeof e&&(t=e,e={}),e.since=this._dateToISO(e.since),this._request("GET","/gists/starred",e,t)}},{key:"getEmails",value:function(e){return this._request("GET","/user/emails",null,e)}},{key:"follow",value:function(e,t){return this._request("PUT","/user/following/"+e,null,t)}},{key:"unfollow",value:function(e,t){return this._request("DELETE","/user/following/"+e,null,t)}},{key:"createRepo",value:function(e,t){return this._request("POST","/user/repos",e,t)}}]),t}(l.default);t.exports=h},{"./Requestable":9,debug:void 0}]},{},[2])(2)});
//# sourceMappingURL=GitHub.min.js.map
{
"name": "github-api",
"version": "3.3.0",
"version": "3.4.0",
"license": "BSD-3-Clause-Clear",

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

"dependencies": {
"axios": "^0.19.0",
"axios": "^0.21.1",
"debug": "^2.2.0",

@@ -58,0 +58,0 @@ "js-base64": "^2.1.9",

@@ -97,1 +97,31 @@ # Maintainers wanted

[travis-ci]: https://travis-ci.org/github-tools/github
## Contributing
We welcome contributions of all types! This section will guide you through setting up your development environment.
### Setup
1. [Install Node](https://nodejs.org/en/) version 8,10 or 11. It can often help to use a Node version switcher such as [NVM](https://github.com/nvm-sh/nvm).
2. Fork this repo to your GitHub account.
3. Clone the fork to your development machine (`git clone https://github.com/{YOUR_USERNAME}/github`).
4. From the root of the cloned repo, run `npm install`.
5. Email jaredrewerts@gmail.com with the subject **GitHub API - Personal Access Token Request**
A personal access token for our test user, @github-tools-test, will be generated for you.
6. Set the environment variable `GHTOOLS_USER` to `github-tools-test`.
`export GHTOOLS_USER=github-tools-test`
7. Set the environment variable `GHTOOLS_PASSWORD` to the personal access token that was generated for you.
`export GHTOOLS_PASSWORD={YOUR_PAT}`
**NOTE** Windows users can use [this guide](http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-command-line-and-registry/) to learn about setting environment variables on Windows.
### Tests
The main way we write code for `github-api` is using test-driven development. We use Mocha to run our tests. Given that the bulk of this library is just interacting with GitHub's API, nearly all of our tests are integration tests.
To run the test suite, run `npm run test`.

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 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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc