From 21a71dc2f08973c2bbc407574fa3313bb5573691 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Mon, 3 Feb 2014 15:08:08 -0800 Subject: [PATCH 001/461] Eliminate generated code files and their templates. The current design of generating javascript code files containing 100s of duplicate implementations of the API handler is inefficient and unnecessary. It also creates situations where the routes.json file is out of sync with the generated code. This change drastically simplifies the code and eliminates all the duplication. With this change generate.js is only used to generate the documentation and test code. --- api/v3.0.0/apidocs.js | 2445 ++++++++++++++++++++++++++++ api/v3.0.0/authorization.js | 230 --- api/v3.0.0/events.js | 445 ------ api/v3.0.0/gists.js | 511 ------ api/v3.0.0/gitdata.js | 585 ------- api/v3.0.0/index.js | 40 - api/v3.0.0/issues.js | 1076 ------------- api/v3.0.0/markdown.js | 64 - api/v3.0.0/orgs.js | 976 ------------ api/v3.0.0/pullRequests.js | 678 -------- api/v3.0.0/repos.js | 2708 -------------------------------- api/v3.0.0/search.js | 188 --- api/v3.0.0/statuses.js | 109 -- api/v3.0.0/user.js | 803 ---------- generate.js | 83 +- index.js | 72 +- templates/after_request.js.tpl | 9 - templates/handler.js.tpl | 21 - templates/index.js.tpl | 40 - templates/section.js.tpl | 23 - 20 files changed, 2522 insertions(+), 8584 deletions(-) create mode 100644 api/v3.0.0/apidocs.js delete mode 100644 api/v3.0.0/authorization.js delete mode 100644 api/v3.0.0/events.js delete mode 100644 api/v3.0.0/gists.js delete mode 100644 api/v3.0.0/gitdata.js delete mode 100644 api/v3.0.0/index.js delete mode 100644 api/v3.0.0/issues.js delete mode 100644 api/v3.0.0/markdown.js delete mode 100644 api/v3.0.0/orgs.js delete mode 100644 api/v3.0.0/pullRequests.js delete mode 100644 api/v3.0.0/repos.js delete mode 100644 api/v3.0.0/search.js delete mode 100644 api/v3.0.0/statuses.js delete mode 100644 api/v3.0.0/user.js mode change 100755 => 100644 generate.js delete mode 100644 templates/after_request.js.tpl delete mode 100644 templates/handler.js.tpl delete mode 100644 templates/index.js.tpl delete mode 100644 templates/section.js.tpl diff --git a/api/v3.0.0/apidocs.js b/api/v3.0.0/apidocs.js new file mode 100644 index 0000000000..84fa311ff4 --- /dev/null +++ b/api/v3.0.0/apidocs.js @@ -0,0 +1,2445 @@ +/** section: github + * mixin gists + **/ +/** section: github + * gists#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ +/** section: github + * gists#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ +/** section: github + * gists#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - description (String): Optional. + * - public (Boolean): Required. + * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + **/ +/** section: github + * gists#edit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - description (String): Optional. + * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + **/ +/** section: github + * gists#public(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ +/** section: github + * gists#starred(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ +/** section: github + * gists#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * gists#star(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * gists#deleteStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * gists#checkStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * gists#fork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * gists#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * mixin gitdata + **/ +/** section: github + * gitdata#getBlob(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * gitdata#createBlob(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - content (String): Required. + * - encoding (String): Required. + **/ +/** section: github + * gitdata#getCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ +/** section: github + * gitdata#createCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - message (String): Required. String of the commit message + * - tree (String): Required. String of the SHA of the tree object this commit points to + * - parents (Array): Required. Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * - author (Json): Optional. + * - committer (Json): Optional. + **/ +/** section: github + * gitdata#getReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + **/ +/** section: github + * gitdata#getAllReferences(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * gitdata#createReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. + **/ +/** section: github + * gitdata#updateReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. + * - force (Boolean): Optional. Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + **/ +/** section: github + * gitdata#deleteReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + **/ +/** section: github + * gitdata#getTag(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ +/** section: github + * gitdata#createTag(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - tag (String): Required. String of the tag + * - message (String): Required. String of the tag message + * - object (String): Required. String of the SHA of the git object this is tagging + * - type (String): Required. String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * - tagger (Json): Required. JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + **/ +/** section: github + * gitdata#getTree(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - recursive (Boolean): Optional. + **/ +/** section: github + * gitdata#createTree(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - tree (Json): Required. Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * - base_tree (String): Optional. String of the SHA1 of the tree you want to update with new data + **/ +/** section: github + * mixin issues + **/ +/** section: github + * issues#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - filter (String): Optional. Validation rule: ` ^(all|assigned|created|mentioned|subscribed)$ `. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high + * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#repoIssues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. + * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. + * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * - mentioned (String): Optional. String User login. + * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high + * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getRepoIssue(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - body (String): Optional. + * - assignee (String): Optional. Optional string - Login for the user that this issue should be assigned to. + * - milestone (Number): Optional. Optional number - Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. + * - labels (Json): Required. Optional array of strings - Labels to associate with this issue. + **/ +/** section: github + * issues#edit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - title (String): Optional. + * - body (String): Optional. + * - assignee (String): Optional. Optional string - Login for the user that this issue should be assigned to. + * - milestone (Number): Optional. Optional number - Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. + * - labels (Json): Optional. Optional array of strings - Labels to associate with this issue. + * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. + **/ +/** section: github + * issues#repoComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sort (String): Optional. Validation rule: ` ^(created|updated)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * issues#createComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + **/ +/** section: github + * issues#editComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. + **/ +/** section: github + * issues#deleteComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * issues#getEvents(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getRepoEvents(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getEvent(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * issues#getLabels(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * issues#getLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + **/ +/** section: github + * issues#createLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required. Required string - 6 character hex code, without a leading #. + **/ +/** section: github + * issues#updateLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required. Required string - 6 character hex code, without a leading #. + **/ +/** section: github + * issues#deleteLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + **/ +/** section: github + * issues#getAllMilestones(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - sort (String): Optional. due_date, completeness, default: due_date Validation rule: ` ^(due_date|completeness)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#getMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * issues#createMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - description (String): Optional. + * - due_on (Date): Optional. Optional string - ISO 8601 time. + **/ +/** section: github + * issues#updateMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - title (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - description (String): Optional. + * - due_on (Date): Optional. Optional string - ISO 8601 time. + **/ +/** section: github + * issues#deleteMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * mixin authorization + **/ +/** section: github + * authorization#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * authorization#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * authorization#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - scopes (Array): Optional. Optional array - A list of scopes that this authorization is in. + * - note (String): Optional. Optional string - A note to remind you what the OAuth token is for. + * - note_url (String): Optional. Optional string - A URL to remind you what app the OAuth token is for. + **/ +/** section: github + * authorization#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - scopes (Array): Optional. Optional array - A list of scopes that this authorization is in. + * - add_scopes (Array): Optional. Optional array - A list of scopes to add to this authorization. + * - remove_scopes (Array): Optional. Optional array - A list of scopes to remove from this authorization. + * - note (String): Optional. Optional string - A note to remind you what the OAuth token is for. + * - note_url (String): Optional. Optional string - A URL to remind you what app the OAuth token is for. + **/ +/** section: github + * authorization#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * mixin orgs + **/ +/** section: github + * orgs#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * orgs#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * orgs#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - billing_email (String): Optional. Optional string - Billing email address. This address is not publicized. + * - company (String): Optional. + * - email (String): Optional. Optional string - Publicly visible email address. + * - location (String): Optional. + * - name (String): Optional. + **/ +/** section: github + * orgs#getMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * orgs#getMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#removeMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#getPublicMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + **/ +/** section: github + * orgs#getPublicMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#publicizeMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#concealMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#getTeams(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + **/ +/** section: github + * orgs#getTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * orgs#createTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - name (String): Required. + * - repo_names (Array): Optional. Optional array of strings + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. + **/ +/** section: github + * orgs#updateTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - name (String): Required. + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. + **/ +/** section: github + * orgs#deleteTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * orgs#getTeamMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * orgs#getTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#addTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#deleteTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ +/** section: github + * orgs#getTeamRepos(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * orgs#getTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * orgs#addTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * orgs#deleteTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * mixin statuses + **/ +/** section: github + * statuses#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ +/** section: github + * statuses#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. + * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * - description (String): Optional. Short description of the status. + **/ +/** section: github + * mixin pullRequests + **/ +/** section: github + * pullRequests#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - body (String): Optional. + * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. + **/ +/** section: github + * pullRequests#createFromIssue(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. + **/ +/** section: github + * pullRequests#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - title (String): Required. + * - body (String): Optional. + **/ +/** section: github + * pullRequests#getCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#getFiles(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#getMerged(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#merge(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - commit_message (String): Optional. Optional string - The message that will be used for the merge commit + **/ +/** section: github + * pullRequests#getComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#getComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * pullRequests#createComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - commit_id (String): Required. Required string - Sha of the commit to comment on. + * - path (String): Required. Required string - Relative path of the file to comment on. + * - position (Number): Required. Required number - Column index in the diff to comment on. + **/ +/** section: github + * pullRequests#createCommentReply(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - in_reply_to (Number): Required. + **/ +/** section: github + * pullRequests#updateComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + **/ +/** section: github + * pullRequests#deleteComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * mixin repos + **/ +/** section: github + * repos#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - type (String): Optional. Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. Validation rule: ` ^(all|owner|public|private|member)$ `. + * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. + * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. + * - auto_init (Boolean): Optional. Optional boolean - true to create an initial commit with empty README. Default is false + * - gitignore_template (String): Optional. Optional string - Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + **/ +/** section: github + * repos#createFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. + * - auto_init (Boolean): Optional. Optional boolean - true to create an initial commit with empty README. Default is false + * - gitignore_template (String): Optional. Optional string - Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * - team_id (Number): Optional. Optional number - The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. + **/ +/** section: github + * repos#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#merge(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. + * - commit_message (String): Optional. Optional string - Commit message to use for the merge commit. If omitted, a default message will be used. + **/ +/** section: github + * repos#getContributors(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - anon (Boolean): Optional. Optional flag. Set to 1 or true to include anonymous contributors in results. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getLanguages(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getTeams(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getTags(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getBranches(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getBranch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - branch (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getCollaborators(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ +/** section: github + * repos#addCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ +/** section: github + * repos#removeCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ +/** section: github + * repos#getCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Optional. Optional string - Sha or branch to start listing commits from. + * - path (String): Optional. Optional string - Only commits containing this file path will be returned. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ +/** section: github + * repos#getCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ +/** section: github + * repos#getAllCommitComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getCommitComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#createCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - body (String): Required. + * - commit_id (String): Required. Required string - Sha of the commit to comment on. + * - path (String): Optional. Optional string - Relative path of the file to comment on. + * - position (Number): Optional. Optional number - Line index in the diff to comment on. + * - line (Number): Optional. Optional number - Line number in the file to comment on. Defaults to 1. + **/ +/** section: github + * repos#getCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#updateCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. + **/ +/** section: github + * repos#compareCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. + **/ +/** section: github + * repos#deleteCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#getReadme(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. + **/ +/** section: github + * repos#getContent(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Optional. The content path. + * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. + **/ +/** section: github + * repos#createFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - content (String): Required. The new file content, Base64 encoded. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ +/** section: github + * repos#updateFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - content (String): Required. The updated file content, Base64 encoded. + * - sha (String): Required. The blob SHA of the file being replaced. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ +/** section: github + * repos#deleteFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - sha (String): Required. The blob SHA of the file being removed. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ +/** section: github + * repos#getArchiveLink(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Optional. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - archive_format (String): Required. Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. + **/ +/** section: github + * repos#getDownloads(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getDownload(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#deleteDownload(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#getForks(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sort (String): Optional. Possible values: `newest`, `oldest`, `watchers`, default: `newest`. Validation rule: ` ^(newest|oldest|watchers)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#fork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - org (String): Optional. Optional String - Organization login. The repository will be forked into this organization. + **/ +/** section: github + * repos#getKeys(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#createKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ +/** section: github + * repos#updateKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ +/** section: github + * repos#deleteKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#getStargazers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getStarred(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getStarredFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getStarring(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#star(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#unStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#getWatchers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getWatched(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getWatchedFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getWatching(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#watch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#unWatch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ +/** section: github + * repos#getHooks(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * repos#getHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#createHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - config (Json): Required. Required hash - A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - events (Array): Optional. Optional array - Determines what events the hook is triggered for. Default: `['push']`. + * - active (Boolean): Optional. Optional boolean - Determines whether the hook is actually triggered on pushes. + **/ +/** section: github + * repos#updateHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - name (String): Required. + * - config (Json): Required. Required hash - A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - events (Array): Optional. Optional array - Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * - add_events (Array): Optional. Optional array - Determines a list of events to be added to the list of events that the Hook triggers for. + * - remove_events (Array): Optional. Optional array - Determines a list of events to be removed from the list of events that the Hook triggers for. + * - active (Boolean): Optional. Optional boolean - Determines whether the hook is actually triggered on pushes. + **/ +/** section: github + * repos#testHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * repos#deleteHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ +/** section: github + * mixin user + **/ +/** section: github + * user#getFrom(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ +/** section: github + * user#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ +/** section: github + * user#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - name (String): Optional. + * - email (String): Optional. + * - blog (String): Optional. + * - company (String): Optional. + * - location (String): Optional. + * - hireable (Boolean): Optional. + * - bio (String): Optional. + **/ +/** section: github + * user#getOrgs(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#addEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ +/** section: github + * user#deleteEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ +/** section: github + * user#getFollowers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getFollowingFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getFollowing(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getFollowUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#followUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ +/** section: github + * user#unFollowUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ +/** section: github + * user#getKeys(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getKeysFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * user#getKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * user#createKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - title (String): Required. + * - key (String): Required. + **/ +/** section: github + * user#updateKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ +/** section: github + * user#deleteKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ +/** section: github + * mixin events + **/ +/** section: github + * events#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromRepoIssues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromRepoNetwork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getReceived(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getReceivedPublic(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromUserPublic(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * events#getFromUserOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * mixin search + **/ +/** section: github + * search#issues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - state (String): Required. open or closed Validation rule: ` ^(open|closed)$ `. + * - keyword (String): Required. Search term + **/ +/** section: github + * search#repos(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - keyword (String): Required. Search term + * - language (String): Optional. Filter results by language, see https://github.com/languages + * - start_page (Number): Optional. Page number to fetch Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * search#users(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - keyword (String): Required. Keyword search parameters + * - start_page (Number): Optional. Page number to fetch Validation rule: ` ^[0-9]+$ `. + **/ +/** section: github + * search#email(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - email (String): Required. Email address + **/ +/** section: github + * mixin markdown + **/ +/** section: github + * markdown#render(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - text (String): Required. The Markdown text to render + * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. + * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` + **/ diff --git a/api/v3.0.0/authorization.js b/api/v3.0.0/authorization.js deleted file mode 100644 index 5d79e6e4b9..0000000000 --- a/api/v3.0.0/authorization.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * mixin authorization - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var authorization = module.exports = { - authorization: {} -}; - -(function() { - /** section: github - * authorization#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - scopes (Array): Optional. Optional array - A list of scopes that this authorization is in. - * - note (String): Optional. Optional string - A note to remind you what the OAuth token is for. - * - note_url (String): Optional. Optional string - A URL to remind you what app the OAuth token is for. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - scopes (Array): Optional. Optional array - A list of scopes that this authorization is in. - * - add_scopes (Array): Optional. Optional array - A list of scopes to add to this authorization. - * - remove_scopes (Array): Optional. Optional array - A list of scopes to remove from this authorization. - * - note (String): Optional. Optional string - A note to remind you what the OAuth token is for. - * - note_url (String): Optional. Optional string - A URL to remind you what app the OAuth token is for. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(authorization.authorization); diff --git a/api/v3.0.0/events.js b/api/v3.0.0/events.js deleted file mode 100644 index 172c1b311f..0000000000 --- a/api/v3.0.0/events.js +++ /dev/null @@ -1,445 +0,0 @@ -/** - * mixin events - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var events = module.exports = { - events: {} -}; - -(function() { - /** section: github - * events#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepoIssues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepoIssues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepoNetwork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepoNetwork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getReceived(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getReceived = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getReceivedPublic(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getReceivedPublic = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUserPublic(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUserPublic = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUserOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUserOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(events.events); diff --git a/api/v3.0.0/gists.js b/api/v3.0.0/gists.js deleted file mode 100644 index 72da477042..0000000000 --- a/api/v3.0.0/gists.js +++ /dev/null @@ -1,511 +0,0 @@ -/** - * mixin gists - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gists = module.exports = { - gists: {} -}; - -(function() { - /** section: github - * gists#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - description (String): Optional. - * - public (Boolean): Required. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#edit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - description (String): Optional. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - **/ - this.edit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#public(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.public = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#starred(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.starred = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#star(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.star = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#deleteStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#checkStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.checkStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#fork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.fork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(gists.gists); diff --git a/api/v3.0.0/gitdata.js b/api/v3.0.0/gitdata.js deleted file mode 100644 index ce7eafd44a..0000000000 --- a/api/v3.0.0/gitdata.js +++ /dev/null @@ -1,585 +0,0 @@ -/** - * mixin gitdata - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gitdata = module.exports = { - gitdata: {} -}; - -(function() { - /** section: github - * gitdata#getBlob(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBlob = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createBlob(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - content (String): Required. - * - encoding (String): Required. - **/ - this.createBlob = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - message (String): Required. String of the commit message - * - tree (String): Required. String of the SHA of the tree object this commit points to - * - parents (Array): Required. Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.createCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - **/ - this.getReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getAllReferences(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllReferences = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. - **/ - this.createReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#updateReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. - * - force (Boolean): Optional. Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. - **/ - this.updateReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#deleteReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - **/ - this.deleteReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getTag(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getTag = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createTag(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tag (String): Required. String of the tag - * - message (String): Required. String of the tag message - * - object (String): Required. String of the SHA of the git object this is tagging - * - type (String): Required. String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. - * - tagger (Json): Required. JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged - **/ - this.createTag = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getTree(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - recursive (Boolean): Optional. - **/ - this.getTree = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createTree(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tree (Json): Required. Array of Hash objects (of path, mode, type and sha) specifying a tree structure - * - base_tree (String): Optional. String of the SHA1 of the tree you want to update with new data - **/ - this.createTree = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(gitdata.gitdata); diff --git a/api/v3.0.0/index.js b/api/v3.0.0/index.js deleted file mode 100644 index 34d00fff70..0000000000 --- a/api/v3.0.0/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * class Github - * - * A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Fs = require("fs"); -var Util = require("./../../util"); -var error = require("./../../error"); - -var GithubHandler = module.exports = function(client) { - this.client = client; - this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); -}; - -var proto = { - sendError: function(err, block, msg, callback) { - if (this.client.debug) - Util.log(err, block, msg.user, "error"); - if (typeof err == "string") - err = new error.InternalServerError(err); - if (callback) - callback(err); - } -}; - -["gists", "gitdata", "issues", "authorization", "orgs", "statuses", "pullRequests", "repos", "user", "events", "search", "markdown"].forEach(function(api) { - Util.extend(proto, require("./" + api)); -}); - -GithubHandler.prototype = proto; diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js deleted file mode 100644 index d0ed0897f8..0000000000 --- a/api/v3.0.0/issues.js +++ /dev/null @@ -1,1076 +0,0 @@ -/** - * mixin issues - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var issues = module.exports = { - issues: {} -}; - -(function() { - /** section: github - * issues#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - filter (String): Optional. Validation rule: ` ^(all|assigned|created|mentioned|subscribed)$ `. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high - * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#repoIssues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. - * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. - * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. - * - mentioned (String): Optional. String User login. - * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high - * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.repoIssues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getRepoIssue(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getRepoIssue = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - body (String): Optional. - * - assignee (String): Optional. Optional string - Login for the user that this issue should be assigned to. - * - milestone (Number): Optional. Optional number - Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. - * - labels (Json): Required. Optional array of strings - Labels to associate with this issue. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#edit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - title (String): Optional. - * - body (String): Optional. - * - assignee (String): Optional. Optional string - Login for the user that this issue should be assigned to. - * - milestone (Number): Optional. Optional number - Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. - * - labels (Json): Optional. Optional array of strings - Labels to associate with this issue. - * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. - **/ - this.edit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#repoComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sort (String): Optional. Validation rule: ` ^(created|updated)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.repoComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - **/ - this.createComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#editComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. - **/ - this.editComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getEvents(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getEvents = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getRepoEvents(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getRepoEvents = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getEvent(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getEvent = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getLabels(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.getLabels = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - **/ - this.getLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. Required string - 6 character hex code, without a leading #. - **/ - this.createLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#updateLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. Required string - 6 character hex code, without a leading #. - **/ - this.updateLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - **/ - this.deleteLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getAllMilestones(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - sort (String): Optional. due_date, completeness, default: due_date Validation rule: ` ^(due_date|completeness)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllMilestones = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - description (String): Optional. - * - due_on (Date): Optional. Optional string - ISO 8601 time. - **/ - this.createMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#updateMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - title (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - description (String): Optional. - * - due_on (Date): Optional. Optional string - ISO 8601 time. - **/ - this.updateMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.deleteMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(issues.issues); diff --git a/api/v3.0.0/markdown.js b/api/v3.0.0/markdown.js deleted file mode 100644 index e0a0dec23d..0000000000 --- a/api/v3.0.0/markdown.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * mixin markdown - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var markdown = module.exports = { - markdown: {} -}; - -(function() { - /** section: github - * markdown#render(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - text (String): Required. The Markdown text to render - * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. - * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` - **/ - this.render = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(markdown.markdown); diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js deleted file mode 100644 index 337de02616..0000000000 --- a/api/v3.0.0/orgs.js +++ /dev/null @@ -1,976 +0,0 @@ -/** - * mixin orgs - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var orgs = module.exports = { - orgs: {} -}; - -(function() { - /** section: github - * orgs#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - billing_email (String): Optional. Optional string - Billing email address. This address is not publicized. - * - company (String): Optional. - * - email (String): Optional. Optional string - Publicly visible email address. - * - location (String): Optional. - * - name (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.getMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#removeMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.removeMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getPublicMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - **/ - this.getPublicMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getPublicMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.getPublicMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#publicizeMembership(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.publicizeMembership = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#concealMembership(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.concealMembership = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeams(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - **/ - this.getTeams = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.getTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#createTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. - * - repo_names (Array): Optional. Optional array of strings - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. - **/ - this.createTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#updateTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - name (String): Required. - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. - **/ - this.updateTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeamMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.getTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#addTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.addTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.deleteTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamRepos(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeamRepos = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.getTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#addTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.addTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.deleteTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(orgs.orgs); diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js deleted file mode 100644 index 3a2692f5a6..0000000000 --- a/api/v3.0.0/pullRequests.js +++ /dev/null @@ -1,678 +0,0 @@ -/** - * mixin pullRequests - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var pullRequests = module.exports = { - pullRequests: {} -}; - -(function() { - /** section: github - * pullRequests#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - body (String): Optional. - * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createFromIssue(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. - **/ - this.createFromIssue = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - title (String): Required. - * - body (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getFiles(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFiles = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getMerged(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMerged = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#merge(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - commit_message (String): Optional. Optional string - The message that will be used for the merge commit - **/ - this.merge = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - commit_id (String): Required. Required string - Sha of the commit to comment on. - * - path (String): Required. Required string - Relative path of the file to comment on. - * - position (Number): Required. Required number - Column index in the diff to comment on. - **/ - this.createComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createCommentReply(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - in_reply_to (Number): Required. - **/ - this.createCommentReply = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#updateComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - **/ - this.updateComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#deleteComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.deleteComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(pullRequests.pullRequests); diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js deleted file mode 100644 index e434acc90e..0000000000 --- a/api/v3.0.0/repos.js +++ /dev/null @@ -1,2708 +0,0 @@ -/** - * mixin repos - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var repos = module.exports = { - repos: {} -}; - -(function() { - /** section: github - * repos#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - type (String): Optional. Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. Validation rule: ` ^(all|owner|public|private|member)$ `. - * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. - * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. - * - auto_init (Boolean): Optional. Optional boolean - true to create an initial commit with empty README. Default is false - * - gitignore_template (String): Optional. Optional string - Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. - * - auto_init (Boolean): Optional. Optional boolean - true to create an initial commit with empty README. Default is false - * - gitignore_template (String): Optional. Optional string - Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. - * - team_id (Number): Optional. Optional number - The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. - **/ - this.createFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. Optional boolean - true to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. Optional boolean - true to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. Optional boolean - true to enable downloads for this repository, false to disable them. Default is true. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#merge(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. - * - commit_message (String): Optional. Optional string - Commit message to use for the merge commit. If omitted, a default message will be used. - **/ - this.merge = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getContributors(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - anon (Boolean): Optional. Optional flag. Set to 1 or true to include anonymous contributors in results. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getContributors = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getLanguages(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getLanguages = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getTeams(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeams = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getTags(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTags = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getBranches(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBranches = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getBranch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - branch (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBranch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCollaborators(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCollaborators = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.getCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#addCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.addCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#removeCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.removeCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Optional. Optional string - Sha or branch to start listing commits from. - * - path (String): Optional. Optional string - Only commits containing this file path will be returned. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getAllCommitComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllCommitComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommitComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCommitComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - body (String): Required. - * - commit_id (String): Required. Required string - Sha of the commit to comment on. - * - path (String): Optional. Optional string - Relative path of the file to comment on. - * - position (Number): Optional. Optional number - Line index in the diff to comment on. - * - line (Number): Optional. Optional number - Line number in the file to comment on. Defaults to 1. - **/ - this.createCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. - **/ - this.updateCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#compareCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. Required string - The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. Required string - The branch (or git ref) where your changes are implemented. - **/ - this.compareCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getReadme(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. - **/ - this.getReadme = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getContent(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Optional. The content path. - * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. - **/ - this.getContent = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The new file content, Base64 encoded. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.createFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The updated file content, Base64 encoded. - * - sha (String): Required. The blob SHA of the file being replaced. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.updateFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - sha (String): Required. The blob SHA of the file being removed. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.deleteFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getArchiveLink(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Optional. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - archive_format (String): Required. Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. - **/ - this.getArchiveLink = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getDownloads(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getDownloads = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getDownload(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getDownload = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteDownload(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteDownload = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getForks(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sort (String): Optional. Possible values: `newest`, `oldest`, `watchers`, default: `newest`. Validation rule: ` ^(newest|oldest|watchers)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getForks = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#fork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - org (String): Optional. Optional String - Organization login. The repository will be forked into this organization. - **/ - this.fork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getKeys(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeys = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.createKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.updateKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStargazers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStargazers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarred(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarred = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarredFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarredFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarring(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarring = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#star(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.star = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#unStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.unStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatchers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatchers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatched(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatched = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatchedFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatchedFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatching(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatching = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#watch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.watch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#unWatch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.unWatch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getHooks(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getHooks = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - config (Json): Required. Required hash - A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. - * - events (Array): Optional. Optional array - Determines what events the hook is triggered for. Default: `['push']`. - * - active (Boolean): Optional. Optional boolean - Determines whether the hook is actually triggered on pushes. - **/ - this.createHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - name (String): Required. - * - config (Json): Required. Required hash - A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. - * - events (Array): Optional. Optional array - Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. - * - add_events (Array): Optional. Optional array - Determines a list of events to be added to the list of events that the Hook triggers for. - * - remove_events (Array): Optional. Optional array - Determines a list of events to be removed from the list of events that the Hook triggers for. - * - active (Boolean): Optional. Optional boolean - Determines whether the hook is actually triggered on pushes. - **/ - this.updateHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#testHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.testHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(repos.repos); diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js deleted file mode 100644 index 89d3f0bd44..0000000000 --- a/api/v3.0.0/search.js +++ /dev/null @@ -1,188 +0,0 @@ -/** - * mixin search - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var search = module.exports = { - search: {} -}; - -(function() { - /** section: github - * search#issues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - state (String): Required. open or closed Validation rule: ` ^(open|closed)$ `. - * - keyword (String): Required. Search term - **/ - this.issues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#repos(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - keyword (String): Required. Search term - * - language (String): Optional. Filter results by language, see https://github.com/languages - * - start_page (Number): Optional. Page number to fetch Validation rule: ` ^[0-9]+$ `. - **/ - this.repos = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#users(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - keyword (String): Required. Keyword search parameters - * - start_page (Number): Optional. Page number to fetch Validation rule: ` ^[0-9]+$ `. - **/ - this.users = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#email(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - email (String): Required. Email address - **/ - this.email = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(search.search); diff --git a/api/v3.0.0/statuses.js b/api/v3.0.0/statuses.js deleted file mode 100644 index 26a7bc946f..0000000000 --- a/api/v3.0.0/statuses.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * mixin statuses - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var statuses = module.exports = { - statuses: {} -}; - -(function() { - /** section: github - * statuses#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * statuses#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. - * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. - * - description (String): Optional. Short description of the status. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(statuses.statuses); diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js deleted file mode 100644 index 59b010865b..0000000000 --- a/api/v3.0.0/user.js +++ /dev/null @@ -1,803 +0,0 @@ -/** - * mixin user - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var user = module.exports = { - user: {} -}; - -(function() { - /** section: github - * user#getFrom(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.getFrom = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Optional. - * - email (String): Optional. - * - blog (String): Optional. - * - company (String): Optional. - * - location (String): Optional. - * - hireable (Boolean): Optional. - * - bio (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getOrgs(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getOrgs = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#addEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.addEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#deleteEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.deleteEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowingFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowingFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowing(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowing = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#followUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.followUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#unFollowUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.unFollowUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKeys(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeys = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKeysFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeysFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.getKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#createKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - title (String): Required. - * - key (String): Required. - **/ - this.createKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#updateKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.updateKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#deleteKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(user.user); diff --git a/generate.js b/generate.js old mode 100755 new mode 100644 index 40ed735fe7..fc708a06a2 --- a/generate.js +++ b/generate.js @@ -18,10 +18,6 @@ var Path = require("path"); var Optimist = require("optimist"); var Util = require("./util"); -var IndexTpl = Fs.readFileSync(__dirname + "/templates/index.js.tpl", "utf8"); -var SectionTpl = Fs.readFileSync(__dirname + "/templates/section.js.tpl", "utf8"); -var HandlerTpl = Fs.readFileSync(__dirname + "/templates/handler.js.tpl", "utf8"); -var AfterRequestTpl = Fs.readFileSync(__dirname + "/templates/after_request.js.tpl", "utf8"); var TestSectionTpl = Fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); var TestHandlerTpl = Fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); @@ -51,30 +47,27 @@ var main = module.exports = function(versions, tests, restore) { var routes = versions[version]; var defines = routes.defines; delete routes.defines; - var headers = defines["response-headers"]; - // cast header names to lowercase. - if (headers && headers.length) - headers = headers.map(function(header) { return header.toLowerCase(); }); var sections = {}; var testSections = {}; + var apidocs = ""; - function createComment(paramsStruct, section, funcName, indent) { + function createComment(paramsStruct, section, funcName) { var params = Object.keys(paramsStruct); var comment = [ - indent + "/** section: github", - indent + " * " + section + "#" + funcName + "(msg, callback) -> null", - indent + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", - indent + " * - callback (Function): function to call when the request is finished " + + "/** section: github", + " * " + section + "#" + funcName + "(msg, callback) -> null", + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", + " * - callback (Function): function to call when the request is finished " + "with an error as first argument and result data as second argument.", - indent + " *", - indent + " * ##### Params on the `msg` object:", - indent + " *" + " * ", + " * ##### Params on the `msg` object:", + " * " ]; - comment.push(indent + " * - headers (Object): Optional. Key/ value pair " + comment.push(" * - headers (Object): Optional. Key/ value pair " + "of request headers to pass along with the HTTP request. Valid headers are: " + "'" + defines["request-headers"].join("', '") + "'."); if (!params.length) - comment.push(indent + " * No other params, simply pass an empty Object literal `{}`"); + comment.push(" * No other params, simply pass an empty Object literal `{}`"); var paramName, def, line; for (var i = 0, l = params.length; i < l; ++i) { paramName = params[i]; @@ -91,17 +84,17 @@ var main = module.exports = function(versions, tests, restore) { else def = paramsStruct[paramName]; - line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + - (def.required ? "Required. " : "Optional. "); + line = " * - " + paramName + " (" + (def.type || "mixed") + "): " + + (def.required ? "Required." : "Optional."); if (def.description) - line += def.description + " "; + line += " " + def.description; if (def.validation) - line += "Validation rule: ` " + def.validation + " `."; + line += " Validation rule: ` " + def.validation + " `."; comment.push(line); } - return comment.join("\n") + "\n" + indent + " **/"; + return comment.join("\n") + "\n **/\n"; } function getParams(paramsStruct, indent) { @@ -142,30 +135,23 @@ var main = module.exports = function(versions, tests, restore) { if (block.url && block.params) { // we ended up at an API definition part! var parts = messageType.split("/"); - var section = Util.toCamelCase(parts[1].toLowerCase()); + var section = Util.toCamelCase(parts[1]); if (!block.method) { throw new Error("No HTTP method specified for " + messageType + "in section " + section); } - parts.splice(0, 2); - var funcName = Util.toCamelCase(parts.join("-")); - var comment = createComment(block.params, section, funcName, " "); - // add the handler to the sections - if (!sections[section]) + if (!sections[section]) { sections[section] = []; - - var afterRequest = ""; - if (headers && headers.length) { - afterRequest = AfterRequestTpl.replace("<%headers%>", "\"" + - headers.join("\", \"") + "\""); + apidocs += "/** section: github\n"; + apidocs += " * mixin " + section + "\n"; + apidocs += " **/\n"; } - sections[section].push(HandlerTpl - .replace("<%funcName%>", funcName) - .replace("<%comment%>", comment) - .replace("<%afterRequest%>", afterRequest) - ); + + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + apidocs += createComment(block.params, section, funcName); // add test to the testSections if (!testSections[section]) @@ -187,30 +173,15 @@ var main = module.exports = function(versions, tests, restore) { prepareApi(routes); Util.log("Writing files to version dir"); - var sectionNames = Object.keys(sections); - Util.log("Writing index.js file for version " + version); - Fs.writeFileSync(Path.join(dir, "index.js"), - IndexTpl - .replace("<%name%>", defines.constants.name) - .replace("<%description%>", defines.constants.description) - .replace("<%scripts%>", "\"" + sectionNames.join("\", \"") + "\""), - "utf8"); + Fs.writeFileSync(dir + "/apidocs.js", apidocs); Object.keys(sections).forEach(function(section) { - var def = sections[section]; - Util.log("Writing '" + section + ".js' file for version " + version); - Fs.writeFileSync(Path.join(dir, section + ".js"), SectionTpl - .replace(/<%sectionName%>/g, section) - .replace("<%sectionBody%>", def.join("\n")), - "utf8" - ); - // When we don't need to generate tests, bail out here. if (!tests) return; - def = testSections[section]; + var def = testSections[section]; // test if previous tests already contained implementations by checking // if the difference in character count between the current test file // and the newly generated one is more than twenty characters. diff --git a/index.js b/index.js index b6a4255dfc..e8b89c84ce 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ "use strict"; +var Fs = require("fs"); var error = require("./error"); var Util = require("./util"); var Url = require("url"); @@ -177,8 +178,7 @@ var Client = module.exports = function(config) { this.debug = Util.isTrue(config.debug); this.version = config.version; - var cls = require("./api/v" + this.version); - this[this.version] = new cls(this); + this[this.version] = JSON.parse(Fs.readFileSync(__dirname + "/api/v" + this.version + "/routes.json", "utf8")); var pathPrefix = ""; // Check if a prefix is passed in the config and strip any leading or trailing slashes from it. @@ -220,13 +220,15 @@ var Client = module.exports = function(config) { **/ this.setupRoutes = function() { var self = this; - var api = this[this.version]; - var routes = api.routes; + var routes = this[this.version]; var defines = routes.defines; this.constants = defines.constants; this.requestHeaders = defines["request-headers"].map(function(header) { return header.toLowerCase(); }); + this.responseHeaders = defines["response-headers"].map(function(header) { + return header.toLowerCase(); + }); delete routes.defines; function trim(s) { @@ -321,20 +323,6 @@ var Client = module.exports = function(config) { parts.splice(0, 2); var funcName = Util.toCamelCase(parts.join("-")); - if (!api[section]) { - throw new Error("Unsupported route section, not implemented in version " + - self.version + " for route '" + endPoint + "' and block: " + - JSON.stringify(block)); - } - - if (!api[section][funcName]) { - if (self.debug) - Util.log("Tried to call " + funcName); - throw new Error("Unsupported route, not implemented in version " + - self.version + " for route '" + endPoint + "' and block: " + - JSON.stringify(block)); - } - if (!self[section]) { self[section] = {}; // add a utility function 'getFooApi()', which returns the @@ -351,14 +339,13 @@ var Client = module.exports = function(config) { catch (ex) { // when the message was sent to the client, we can // reply with the error directly. - api.sendError(ex, block, msg, callback); + self.sendError(ex, block, msg, callback); if (self.debug) Util.log(ex.message, "fatal"); // on error, there's no need to continue. return; } - - api[section][funcName].call(api, msg, block, callback); + self.handler(msg, block, callback); }; } else { @@ -488,6 +475,7 @@ var Client = module.exports = function(config) { method: "GET", params: parsedUrl.query }; + var self = this; this.httpSend(parsedUrl.query, block, function(err, res) { if (err) return api.sendError(err, null, parsedUrl.query, callback); @@ -506,7 +494,7 @@ var Client = module.exports = function(config) { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "link"].forEach(function(header) { + self.responseHeaders.forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -784,4 +772,44 @@ var Client = module.exports = function(config) { } req.end(); }; + + this.sendError = function(err, block, msg, callback) { + if (this.debug) + Util.log(err, block, msg.user, "error"); + if (typeof err == "string") + err = new error.InternalServerError(err); + if (callback) + callback(err); + }; + + this.handler = function(msg, block, callback) { + var self = this; + this.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, msg, null, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) { + ret = {}; + } + ret.meta = {}; + self.responseHeaders.forEach(function(header) { + if (res.headers[header]) { + ret.meta[header] = res.headers[header]; + } + }); + + if (callback) + callback(null, ret); + }); + } }).call(Client.prototype); diff --git a/templates/after_request.js.tpl b/templates/after_request.js.tpl deleted file mode 100644 index 646272d58d..0000000000 --- a/templates/after_request.js.tpl +++ /dev/null @@ -1,9 +0,0 @@ - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - [<%headers%>].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); diff --git a/templates/handler.js.tpl b/templates/handler.js.tpl deleted file mode 100644 index 0feb4e7fff..0000000000 --- a/templates/handler.js.tpl +++ /dev/null @@ -1,21 +0,0 @@ -<%comment%> - this.<%funcName%> = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } -<%afterRequest%> - if (callback) - callback(null, ret); - }); - }; diff --git a/templates/index.js.tpl b/templates/index.js.tpl deleted file mode 100644 index b5a585ff41..0000000000 --- a/templates/index.js.tpl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * class <%name%> - * - * <%description%> - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Fs = require("fs"); -var Util = require("./../../util"); -var error = require("./../../error"); - -var GithubHandler = module.exports = function(client) { - this.client = client; - this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); -}; - -var proto = { - sendError: function(err, block, msg, callback) { - if (this.client.debug) - Util.log(err, block, msg.user, "error"); - if (typeof err == "string") - err = new error.InternalServerError(err); - if (callback) - callback(err); - } -}; - -[<%scripts%>].forEach(function(api) { - Util.extend(proto, require("./" + api)); -}); - -GithubHandler.prototype = proto; diff --git a/templates/section.js.tpl b/templates/section.js.tpl deleted file mode 100644 index 82a7c5ea58..0000000000 --- a/templates/section.js.tpl +++ /dev/null @@ -1,23 +0,0 @@ -/** - * mixin <%sectionName%> - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var <%sectionName%> = module.exports = { - <%sectionName%>: {} -}; - -(function() { -<%sectionBody%> -}).call(<%sectionName%>.<%sectionName%>); From 35b9ac983c4a4f390c2830ec3869acc42cfb9100 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Mon, 17 Feb 2014 23:47:14 -0800 Subject: [PATCH 002/461] Fix error path in page apis --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index e8b89c84ce..7a41a0e554 100644 --- a/index.js +++ b/index.js @@ -468,7 +468,6 @@ var Client = module.exports = function(config) { if (!url) return callback(new error.NotFound("No " + which + " page found")); - var api = this[this.version]; var parsedUrl = Url.parse(url, true); var block = { url: parsedUrl.pathname, @@ -478,7 +477,7 @@ var Client = module.exports = function(config) { var self = this; this.httpSend(parsedUrl.query, block, function(err, res) { if (err) - return api.sendError(err, null, parsedUrl.query, callback); + return self.sendError(err, null, parsedUrl.query, callback); var ret; try { From 8611ffaf410b031578e78ee794e904d7dfdb9e76 Mon Sep 17 00:00:00 2001 From: Geno Roupsky Date: Sun, 20 Jul 2014 15:37:52 +0300 Subject: [PATCH 003/461] :bug: fixed token authentication allow user to provide auth.type='token' and correctly encode the token for authroization header --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c8c202e59c..978cece304 100644 --- a/index.js +++ b/index.js @@ -404,13 +404,19 @@ var Client = module.exports = function(config) { * key: "clientID", * secret: "clientSecret" * }); + * + * // or token + * github.authenticate({ + * type: "token", + * token: "userToken", + * }); **/ this.authenticate = function(options) { if (!options) { this.auth = false; return; } - if (!options.type || "basic|oauth|client".indexOf(options.type) === -1) + if (!options.type || "basic|oauth|client|token".indexOf(options.type) === -1) throw new Error("Invalid authentication type, must be 'basic', 'oauth' or 'client'"); if (options.type == "basic" && (!options.username || !options.password)) throw new Error("Basic authentication requires both a username and password to be set"); @@ -418,6 +424,8 @@ var Client = module.exports = function(config) { if (!options.token && !(options.key && options.secret)) throw new Error("OAuth2 authentication requires a token or key & secret to be set"); } + if (options.type == "token" && !options.token) + throw new Error("Token authentication requires a token to be set"); this.auth = options; }; @@ -702,8 +710,7 @@ var Client = module.exports = function(config) { } break; case "token": - basic = new Buffer(this.auth.username + "/token:" + this.auth.token, "ascii").toString("base64"); - headers.authorization = "Basic " + basic; + headers.authorization = "token " + this.auth.token; break; case "basic": basic = new Buffer(this.auth.username + ":" + this.auth.password, "ascii").toString("base64"); From f2efc37678f6737b86a852ae80d5f4054b8d5301 Mon Sep 17 00:00:00 2001 From: stanleyn Date: Wed, 20 Aug 2014 10:56:18 -0700 Subject: [PATCH 004/461] Allow "per_page" and "page" params on search.users, search.issues and search.repos. --- api/v3.0.0/routes.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index bcee1fadbb..f0c665fb96 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3276,7 +3276,7 @@ "required": false, "validation": "", "invalidmsg": "", - "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repositorys default branch (usually master)." + "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." }, "name": { "type": "String", @@ -3436,7 +3436,9 @@ "invalidmsg": "comments, created, or updated", "description": "comments, created, or updated" }, - "$order": null + "$order": null, + "$page": null, + "$per_page": null } }, @@ -3452,7 +3454,9 @@ "invalidmsg": "One of stars, forks, or updated. Default: results are sorted by best match.", "description": "stars, forks, or updated" }, - "$order": null + "$order": null, + "$page": null, + "$per_page": null } }, @@ -3468,7 +3472,9 @@ "invalidmsg": "Can be followers, repositories, or joined. Default: results are sorted by best match.", "description": "followers, repositories, or joined" }, - "$order": null + "$order": null, + "$page": null, + "$per_page": null } }, From ac598f728549703570bbd074122f2f8cc8025cc6 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Wed, 27 Aug 2014 22:25:49 +0200 Subject: [PATCH 005/461] added missing docs, auto-generated. --- api/v3.0.0/releases.js | 2 +- api/v3.0.0/search.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 424b8c6948..ba6d8dcfd4 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -163,7 +163,7 @@ var releases = module.exports = { * - id (Number): Required. * - repo (String): Required. * - tag_name (String): Required. String of the tag - * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository�s default branch (usually master). + * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). * - name (String): Optional. * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js index edbf67d1ad..18ea1a34a5 100644 --- a/api/v3.0.0/search.js +++ b/api/v3.0.0/search.js @@ -30,6 +30,8 @@ var search = module.exports = { * - q (String): Required. Search Term * - sort (String): Optional. comments, created, or updated Validation rule: ` ^(comments|created|updated)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ this.issues = function(msg, block, callback) { var self = this; @@ -72,6 +74,8 @@ var search = module.exports = { * - q (String): Required. Search Term * - sort (String): Optional. stars, forks, or updated Validation rule: ` ^(stars|forks|updated)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ this.repos = function(msg, block, callback) { var self = this; @@ -114,6 +118,8 @@ var search = module.exports = { * - q (String): Required. Search Term * - sort (String): Optional. followers, repositories, or joined Validation rule: ` ^(followers|repositories|joined)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ this.users = function(msg, block, callback) { var self = this; From 5480e5c13c88a8c64b3f1bf16830ea30358c3352 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Wed, 27 Aug 2014 22:27:08 +0200 Subject: [PATCH 006/461] bump version to v0.2.2 --- package.json | 2 +- seed.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2cf492ad6f..d1b29a3f9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github", - "version" : "0.2.1", + "version" : "0.2.2", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ diff --git a/seed.yml b/seed.yml index 13ef4c04e0..bbe3b0a4ad 100644 --- a/seed.yml +++ b/seed.yml @@ -2,4 +2,4 @@ name: node-github description: NodeJS wrapper for the GitHub API tags: git github web - version: 0.2.1 + version: 0.2.2 From b31f492ed7be2e91c5761f21faad26232f982488 Mon Sep 17 00:00:00 2001 From: flower-pot Date: Wed, 27 Aug 2014 15:07:32 -0700 Subject: [PATCH 007/461] add repos one This api endpoint is undocumented in the GitHub Api, however, the support confirmed to me, that it is stable. --- api/v3.0.0/repos.js | 40 ++++++++++++++++++++++++++++++++++++++++ api/v3.0.0/routes.json | 8 ++++++++ 2 files changed, 48 insertions(+) diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 21f97c6ad9..96f05eb590 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -290,6 +290,46 @@ var repos = module.exports = { }); }; + /** section: github + * repos#one(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.one = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * repos#update(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 2d71377107..b55eafcf88 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1935,6 +1935,14 @@ } }, + "one": { + "url": "/repositories/:id", + "method": "GET", + "params": { + "$id": null + } + }, + "update": { "url": "/repos/:user/:repo", "method": "PATCH", From e933cd9e3c4269f924b80689983bb212e2f30b06 Mon Sep 17 00:00:00 2001 From: rmhartog Date: Mon, 8 Sep 2014 10:23:10 +0200 Subject: [PATCH 008/461] Updated the routes for Statuses The routes for the Statuses section have been updated to reflect the current version at https://developer.github.com/v3/repos/statuses/ --- api/v3.0.0/routes.json | 19 ++++++++++++++++- api/v3.0.0/statuses.js | 43 ++++++++++++++++++++++++++++++++++++++ api/v3.0.0/statusesTest.js | 17 ++++++++++++++- 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index b55eafcf88..a4aa9b10b5 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1544,7 +1544,17 @@ "statuses": { "get": { - "url": "/repos/:user/:repo/statuses/:sha", + "url": "/repos/:user/:repo/commits/:sha/statuses", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "get-combined": { + "url": "/repos/:user/:repo/commits/:sha/status", "method": "GET", "params": { "$user": null, @@ -1580,6 +1590,13 @@ "validation": "", "invalidmsg": "", "description": "Short description of the status." + }, + "context": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A string label to differentiate this status from the status of other systems." } } } diff --git a/api/v3.0.0/statuses.js b/api/v3.0.0/statuses.js index c924334e18..238b3d178d 100644 --- a/api/v3.0.0/statuses.js +++ b/api/v3.0.0/statuses.js @@ -61,6 +61,48 @@ var statuses = module.exports = { }); }; + /** section: github + * statuses#getCombined(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.getCombined = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * statuses#create(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. @@ -75,6 +117,7 @@ var statuses = module.exports = { * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. * - description (String): Optional. Short description of the status. + * - context (String): Optional. A string label to differentiate this status from the status of other systems. **/ this.create = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/statusesTest.js b/api/v3.0.0/statusesTest.js index b00d6f6f38..5c23b4c7f3 100644 --- a/api/v3.0.0/statusesTest.js +++ b/api/v3.0.0/statusesTest.js @@ -26,7 +26,7 @@ describe("[statuses]", function() { }); }); - it("should successfully execute GET /repos/:user/:repo/statuses/:sha (get)", function(next) { + it("should successfully execute GET /repos/:user/:repo/commits/:sha/statuses (get)", function(next) { client.statuses.get( { user: "mikedeboer", @@ -41,6 +41,21 @@ describe("[statuses]", function() { ); }); + it("should successfully execute GET /repos/:user/:repo/commits/:sha/status (get)", function(next) { + client.statuses.getCombined( + { + user: "mikedeboer", + repo: "node-github", + sha: "30d607d8fd8002427b61273f25d442c233cbf631" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute POST /repos/:user/:repo/statuses/:sha (create)", function(next) { client.statuses.create( { From cf47ee74584655a54e2691d17a07b52b32c0af41 Mon Sep 17 00:00:00 2001 From: headlessme Date: Fri, 12 Sep 2014 13:36:39 +0100 Subject: [PATCH 009/461] don't use beta API by default. --- api/v3.0.0/routes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index b55eafcf88..725b7efbb0 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -8,7 +8,7 @@ "port": 443, "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", "requestFormat": "json", - "requestMedia": "application/vnd.github.beta+json" + "requestMedia": "application/vnd.github.v3+json" }, "response-headers": [ "X-RateLimit-Limit", From 25147e375d8db324a63a82a2a6acedd29eeee830 Mon Sep 17 00:00:00 2001 From: Dan Thareja Date: Mon, 17 Nov 2014 21:15:38 -0800 Subject: [PATCH 010/461] adds statistics --- api/v3.0.0/repos.js | 205 ++++++++++++++++++++++++++++++++++++++++ api/v3.0.0/reposTest.js | 70 ++++++++++++++ api/v3.0.0/routes.json | 45 +++++++++ 3 files changed, 320 insertions(+) diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 96f05eb590..d1d8ab493a 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -2793,4 +2793,209 @@ var repos = module.exports = { }); }; + /** section: github + * repos#getStatsContributors(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsContributors = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsCommitActivity(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsCommitActivity = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsCodeFrequency(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsCodeFrequency = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsParticipation(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsParticipation = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsPunchCard(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsPunchCard = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + }).call(repos.repos); diff --git a/api/v3.0.0/reposTest.js b/api/v3.0.0/reposTest.js index 1b5c5b2f98..356fab65be 100644 --- a/api/v3.0.0/reposTest.js +++ b/api/v3.0.0/reposTest.js @@ -1053,4 +1053,74 @@ describe("[repos]", function() { } ); }); + + it("should successfully execute GET /repos/:user/:repo/stats/contributors (getStatsContributors)", function(next) { + client.repos.getStatsContributors( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/commit_activity (getStatsCommitActivity)", function(next) { + client.repos.getStatsCommitActivity( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/code_frequency (getStatsCodeFrequency)", function(next) { + client.repos.getStatsCodeFrequency( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/participation (getStatsParticipation)", function(next) { + client.repos.getStatsParticipation( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/punch_card (getStatsPunchCard)", function(next) { + client.repos.getStatsPunchCard( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); }); diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index b55eafcf88..2e4aac8d8f 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -2843,6 +2843,51 @@ "$repo": null, "$id": null } + }, + + "get-stats-contributors": { + "url": "/repos/:user/:repo/stats/contributors", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-commit-activity": { + "url": "/repos/:user/:repo/stats/commit_activity", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-code-frequency": { + "url": "/repos/:user/:repo/stats/code_frequency", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-participation": { + "url": "/repos/:user/:repo/stats/participation", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-punch-card": { + "url": "/repos/:user/:repo/stats/punch_card", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } } }, From ad1ceaf452f3200e26ec54cd6bed97eda2e29ae4 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Tue, 18 Nov 2014 11:16:41 +0100 Subject: [PATCH 011/461] Add support for globally configurable headers. Implementation idea from @greggman --- README.md | 5 ++++- index.js | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7535f3676c..f1c5902c78 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,10 @@ var github = new GitHubApi({ protocol: "https", host: "github.my-GHE-enabled-company.com", pathPrefix: "/api/v3", // for some GHEs - timeout: 5000 + timeout: 5000, + headers: { + "user-agent": "My-Cool-GitHub-App", // GitHub is happy with a unique user agent + } }); github.user.getFollowingFromUser({ // optional: diff --git a/index.js b/index.js index 978cece304..1f3ba11325 100644 --- a/index.js +++ b/index.js @@ -173,6 +173,7 @@ var Url = require("url"); * } **/ var Client = module.exports = function(config) { + config.headers = config.headers || {}; this.config = config; this.debug = Util.isTrue(config.debug); @@ -721,19 +722,21 @@ var Client = module.exports = function(config) { } } - if (!msg.headers) - msg.headers = {}; - Object.keys(msg.headers).forEach(function(header) { - var headerLC = header.toLowerCase(); - if (self.requestHeaders.indexOf(headerLC) == -1) - return; - headers[headerLC] = msg.headers[header]; - }); + function addCustomHeaders(customHeaders) { + Object.keys(customHeaders).forEach(function(header) { + var headerLC = header.toLowerCase(); + if (self.requestHeaders.indexOf(headerLC) == -1) + return; + headers[headerLC] = customHeaders[header]; + }); + } + addCustomHeaders(Util.extend(msg.headers || {}, this.config.headers)); + if (!headers["user-agent"]) headers["user-agent"] = "NodeJS HTTP Client"; - if (!headers["accept"]) - headers["accept"] = this.config.requestMedia || this.constants.requestMedia; + if (!("accept" in headers)) + headers.accept = this.config.requestMedia || this.constants.requestMedia; var options = { host: host, From 4b6636822435d9a8cff5dd25dc171f5cc35470f4 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Tue, 18 Nov 2014 11:33:42 +0100 Subject: [PATCH 012/461] Allow for empty strings in create-blob API call --- api/v3.0.0/routes.json | 1 + index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index a31ce67b61..154fee5ccd 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -529,6 +529,7 @@ "content": { "type": "String", "required": true, + "allow-empty": true, "validation": "", "invalidmsg": "", "description": "" diff --git a/index.js b/index.js index 1f3ba11325..0b8b65afa6 100644 --- a/index.js +++ b/index.js @@ -259,7 +259,7 @@ var Client = module.exports = function(config) { if (typeof value != "boolean" && !value) { // we don't need to validation for undefined parameter values // that are not required. - if (!def.required) + if (!def.required || (def["allow-empty"] && value === "")) continue; throw new error.BadRequest("Empty value for parameter '" + paramName + "': " + value); From 0be2779266f2e0b65b07f5b687bd87daa7b36beb Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Tue, 18 Nov 2014 11:48:04 +0100 Subject: [PATCH 013/461] re-generated source files --- api/v3.0.0/repos.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index d1d8ab493a..7af7e24a70 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -2824,7 +2824,7 @@ var repos = module.exports = { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -2865,7 +2865,7 @@ var repos = module.exports = { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -2906,7 +2906,7 @@ var repos = module.exports = { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -2947,7 +2947,7 @@ var repos = module.exports = { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -2988,7 +2988,7 @@ var repos = module.exports = { ret = {}; if (!ret.meta) ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); From f841677f3ad3bca82e8143b7b09c05d78cbc8657 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Tue, 18 Nov 2014 11:50:40 +0100 Subject: [PATCH 014/461] bump version to v0.2.3 --- package.json | 2 +- seed.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d1b29a3f9e..b6bf86f8bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github", - "version" : "0.2.2", + "version" : "0.2.3", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ diff --git a/seed.yml b/seed.yml index bbe3b0a4ad..e3a08f8df0 100644 --- a/seed.yml +++ b/seed.yml @@ -2,4 +2,4 @@ name: node-github description: NodeJS wrapper for the GitHub API tags: git github web - version: 0.2.2 + version: 0.2.3 From 2ab003bad104a70323a1ee62eafc9fdc10a86734 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Tue, 1 Jul 2014 11:59:40 -0700 Subject: [PATCH 015/461] Adds the upload asset release api Here's a first pass at adding this feature. Please tell me if you'd like it implemented a different way. Of course I like it as is :P but some things to consider * Content-Type Currently I set the content type automatically based on the name you pass in. This is a little magic as it assumes there's both a `filePath` and `name` field. It could be required to be set by the user as in github.releases.uploadAsset({ owner: owner, id: releaseId, headers: { "content-type": "application/zip", } ... Similarly the size could be manually set there. But, since, based on the current API there's no way for us to upload the file (we don't get the request object back, and we can't just pass the data (it's arguably too big. Could be 100s of meg, more than fits in node's memory space), it seems like we should lookup the size and stream the file as it does now? * Timeout Wasn't sure what to do about that. Timeouts don't seem appropriate for uploading giant files or at least can't easily be a global setting. Anyway, if you don't like this patch hopefully you can suggest a way you'd prefer it. --- README.md | 2 +- api/v3.0.0/releases.js | 43 +++++++++++++ api/v3.0.0/releasesTest.js | 40 ++++++++++-- api/v3.0.0/routes.json | 31 ++++++++++ index.js | 124 +++++++++++++++++++++---------------- package.json | 3 + 6 files changed, 184 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index f1c5902c78..0214241344 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ github.authorization.create({ * Search: 100% * Markdown: 100% * Rate Limit: 100% -* Releases: 90% +* Releases: 100% * Gitignore: 100% * Meta: 100% * Emojis: 100% diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index ba6d8dcfd4..4e4fbc264a 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -325,6 +325,49 @@ var releases = module.exports = { }); }; + /** section: github + * releases#uploadAsset(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - name (String): Required. the file name of the asset + **/ + this.uploadAsset = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * releases#editAsset(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/releasesTest.js b/api/v3.0.0/releasesTest.js index c8175d9b0f..9b7e44e1f1 100644 --- a/api/v3.0.0/releasesTest.js +++ b/api/v3.0.0/releasesTest.js @@ -11,6 +11,8 @@ var Assert = require("assert"); var Client = require("./../../index"); +var fs = require("fs"); +var mime = require("mime"); describe("[releases]", function() { var client; @@ -20,6 +22,8 @@ describe("[releases]", function() { var repo = "test"; var haveWriteAccess = true; // set to false if the authenticated person below does not have write access to the repo above var releaseIdWithAsset = 393621; // Some release id from the repo above that has at least 1 asset. + var filePathToUpload = __filename; + var fileSizeToUpload = fs.statSync(filePathToUpload).size; var releaseId; // release id found when listing releases. Used for get release var newReleaseId; // release id created when creating release, used for edit and delete release @@ -190,22 +194,48 @@ describe("[releases]", function() { ); }); + it("should successfully execute POST /repos/:owner/:repo/releases/:id/assets (uploadAsset)", function(next) { + var name = "somenameornot.zip"; + client.releases.uploadAsset( + { + owner: owner, + id: releaseIdWithAsset, + repo: repo, + name: name, + filePath: filePathToUpload + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.content_type, mime.lookup(name)); // matches extension of name, not filePath + Assert.equal(res.state, "uploaded"); + Assert.equal(res.size, fileSizeToUpload); + Assert.equal(res.name, name); + newAssetId = res.id; + next(); + } + ); + }); + it("should successfully execute PATCH /repos/:owner/:repo/releases/assets/:id (editAsset)", function(next) { if (!newAssetId) { next(); return; } + var newName = "somenewname.zip"; client.releases.editAsset( { owner: owner, - id: "Number", + id: newAssetId, repo: repo, - name: "String", - label: "String" + name: newName, + label: "foo" }, function(err, res) { Assert.equal(err, null); - // other assertions go here + Assert.equal(res.state, "uploaded"); + Assert.equal(res.size, fileSizeToUpload); + Assert.equal(res.name, newName); + Assert.equal(res.label, "foo"); next(); } ); @@ -219,7 +249,7 @@ describe("[releases]", function() { client.releases.deleteAsset( { owner: owner, - id: "Number", + id: newAssetId, repo: repo }, function(err, res) { diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 90f68de3e7..fb16d8642b 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3452,6 +3452,37 @@ "$repo": null } }, + "upload-asset": { + "url": "/repos/:owner/:repo/releases/:id/assets", + "method": "POST", + "host": "uploads.github.com", + "hasFileBody": true, + "timeout": 0, + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "the file name of the asset" + } + } + }, "edit-asset": { "url": "/repos/:owner/:repo/releases/assets/:id", "method": "PATCH", diff --git a/index.js b/index.js index 0b8b65afa6..12f1ff531e 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,8 @@ "use strict"; var error = require("./error"); +var fs = require("fs"); +var mime = require("mime"); var Util = require("./util"); var Url = require("url"); @@ -645,7 +647,8 @@ var Client = module.exports = function(config) { this.httpSend = function(msg, block, callback) { var self = this; var method = block.method.toLowerCase(); - var hasBody = ("head|get|delete".indexOf(method) === -1); + var hasFileBody = block.hasFileBody; + var hasBody = !hasFileBody && ("head|get|delete".indexOf(method) === -1); var format = hasBody && this.constants.requestFormat ? this.constants.requestFormat : "query"; @@ -655,9 +658,8 @@ var Client = module.exports = function(config) { var path = url; var protocol = this.config.protocol || this.constants.protocol || "http"; - var host = this.config.host || this.constants.host; + var host = block.host || this.config.host || this.constants.host; var port = this.config.port || this.constants.port || (protocol == "https" ? 443 : 80); - var proxyUrl; if (this.config.proxy !== undefined) { proxyUrl = this.config.proxy; @@ -722,6 +724,14 @@ var Client = module.exports = function(config) { } } + function callCallback(err, result) { + if (callback) { + var cb = callback; + callback = undefined; + cb(err, result); + } + } + function addCustomHeaders(customHeaders) { Object.keys(customHeaders).forEach(function(header) { var headerLC = header.toLowerCase(); @@ -752,66 +762,74 @@ var Client = module.exports = function(config) { if (this.debug) console.log("REQUEST: ", options); - var callbackCalled = false - - var req = require(protocol).request(options, function(res) { - if (self.debug) { - console.log("STATUS: " + res.statusCode); - console.log("HEADERS: " + JSON.stringify(res.headers)); - } - res.setEncoding("utf8"); - var data = ""; - res.on("data", function(chunk) { - data += chunk; - }); - res.on("error", function(err) { - if (!callbackCalled) { - callbackCalled = true; - callback(err); + function httpSendRequest() { + var req = require(protocol).request(options, function(res) { + if (self.debug) { + console.log("STATUS: " + res.statusCode); + console.log("HEADERS: " + JSON.stringify(res.headers)); } + res.setEncoding("utf8"); + var data = ""; + res.on("data", function(chunk) { + data += chunk; + }); + res.on("error", function(err) { + callCallback(err); + }); + res.on("end", function() { + if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { + callCallback(new error.HttpError(data, res.statusCode)); + } else { + res.data = data; + callCallback(null, res); + } + }); }); - res.on("end", function() { - if (callbackCalled) - return; - callbackCalled = true; - if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { - callback(new error.HttpError(data, res.statusCode)); - } else { - res.data = data; - callback(null, res); - } + var timeout = (block.timeout !== undefined) ? block.timeout : self.config.timeout; + if (timeout) { + req.setTimeout(timeout); + } + + req.on("error", function(e) { + if (self.debug) + console.log("problem with request: " + e.message); + callCallback(e.message); }); - }); - if (this.config.timeout) { - req.setTimeout(this.config.timeout); - } + req.on("timeout", function() { + if (self.debug) + console.log("problem with request: timed out"); + callCallback(new error.GatewayTimeout()); + }); - req.on("error", function(e) { - if (self.debug) - console.log("problem with request: " + e.message); - if (!callbackCalled) { - callbackCalled = true; - callback(e.message); + // write data to request body + if (hasBody && query.length) { + if (self.debug) + console.log("REQUEST BODY: " + query + "\n"); + req.write(query + "\n"); } - }); - req.on("timeout", function() { - if (self.debug) - console.log("problem with request: timed out"); - if (!callbackCalled) { - callbackCalled = true; - callback(new error.GatewayTimeout()); + if (block.hasFileBody) { + var stream = fs.createReadStream(msg.filePath); + stream.pipe(req); + } else { + req.end(); } - }); + }; - // write data to request body - if (hasBody && query.length) { - if (self.debug) - console.log("REQUEST BODY: " + query + "\n"); - req.write(query + "\n"); + if (hasFileBody) { + fs.stat(msg.filePath, function(err, stat) { + if (err) { + callCallback(err); + } else { + headers["content-length"] = stat.size; + headers["content-type"] = mime.lookup(msg.name); + httpSendRequest(); + } + }); + } else { + httpSendRequest(); } - req.end(); }; }).call(Client.prototype); diff --git a/package.json b/package.json index b6bf86f8bb..71b9d5ce4a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "engine" : { "node": ">=0.4.0" }, + "dependencies": { + "mime": "^1.2.11" + }, "devDependencies": { "oauth": "~0.9.7", "optimist": "~0.6.0", From 54b56869bf5f1bfcef4036067e3ba23d5598961b Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Thu, 4 Dec 2014 15:36:43 -0700 Subject: [PATCH 016/461] add filter support for org members --- api/v3.0.0/orgs.js | 1 + api/v3.0.0/routes.json | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index 8fe1727975..8d595532a5 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -159,6 +159,7 @@ var orgs = module.exports = { * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - filter (String): Optional. Validation rule: ` (all|2fa_disabled) `, Default: ` all `. **/ this.getMembers = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 90f68de3e7..026e750209 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1355,7 +1355,14 @@ "params": { "$org": null, "$page": null, - "$per_page": null + "$per_page": null, + "filter": { + "type": "String", + "required": false, + "validation": "^(all|2fa_disabled)$", + "invalidmsg": "all, 2fa_disabled, default: all", + "description": "" + }, } }, From 90c1b70342e50663ce7ad5deea665367aee57297 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Thu, 4 Dec 2014 15:38:59 -0700 Subject: [PATCH 017/461] fixing json syntax --- api/v3.0.0/routes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 026e750209..e83b9088d5 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1362,7 +1362,7 @@ "validation": "^(all|2fa_disabled)$", "invalidmsg": "all, 2fa_disabled, default: all", "description": "" - }, + } } }, From 6f5df579b788c7e5111f71efeb2c8509e006a3e6 Mon Sep 17 00:00:00 2001 From: Lior Bar-On Date: Mon, 8 Dec 2014 13:10:54 +0200 Subject: [PATCH 018/461] remove unnecessary comma in javaScript code example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1c5902c78..021fe95c05 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ var github = new GitHubApi({ pathPrefix: "/api/v3", // for some GHEs timeout: 5000, headers: { - "user-agent": "My-Cool-GitHub-App", // GitHub is happy with a unique user agent + "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent } }); github.user.getFollowingFromUser({ From f4ae86941edf0ed547dbd36c2758984de541a12f Mon Sep 17 00:00:00 2001 From: Guillaume Royer Date: Sat, 3 Jan 2015 08:58:12 +0100 Subject: [PATCH 019/461] Add pull request filter by head and base According to https://developer.github.com/v3/pulls/#list-pull-requests we can now filter PR by head and base. --- api/v3.0.0/pullRequests.js | 2 ++ api/v3.0.0/pullRequestsTest.js | 2 ++ api/v3.0.0/routes.json | 2 ++ 3 files changed, 6 insertions(+) diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 67175b8214..71f6e7cae7 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -30,6 +30,8 @@ var pullRequests = module.exports = { * - user (String): Required. * - repo (String): Required. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. + * - head (String): Optional. Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * - base (String): Optional. Filter pulls by base branch name. Example: gh-pages. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. diff --git a/api/v3.0.0/pullRequestsTest.js b/api/v3.0.0/pullRequestsTest.js index 6948680116..0b47fe8e89 100644 --- a/api/v3.0.0/pullRequestsTest.js +++ b/api/v3.0.0/pullRequestsTest.js @@ -31,6 +31,8 @@ describe("[pullRequests]", function() { { user: "String", repo: "String", + base: "String", + head: "String", state: "String", page: "Number", per_page: "Number" diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 90f68de3e7..c41f0808fd 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1617,6 +1617,8 @@ "invalidmsg": "open, closed, all, default: open", "description": "open, closed, or all" }, + "$head": null, + "$base": null, "$page": null, "$per_page": null, "sort": { From b2c64e1c991c7f22de012eb2b84df736b69f0f32 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Tue, 10 Feb 2015 13:29:01 -0700 Subject: [PATCH 020/461] Update issues.create -- labels are not required When creating an issue, labels are not required by GitHub API v3 --- api/v3.0.0/routes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 540d411fbf..2223da8767 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -894,7 +894,7 @@ }, "labels": { "type": "Json", - "required": true, + "required": false, "validation": "", "invalidmsg": "", "description": "Array of strings - Labels to associate with this issue." From d81d533b328be837b38f8bcc567322e763c0e34d Mon Sep 17 00:00:00 2001 From: JJ Merelo Date: Sun, 15 Feb 2015 11:38:56 +0100 Subject: [PATCH 021/461] Some modifications to documentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 88c568188e..bf385ea8c6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ or You can find the docs for the API of this client at [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) -Additionally, the [official Github documentation](http://developer.github.com/) +Additionally, the [official Github documentation](https://developer.github.com/v3/) is a very useful resource. ## Example @@ -35,8 +35,8 @@ var github = new GitHubApi({ // optional debug: true, protocol: "https", - host: "github.my-GHE-enabled-company.com", - pathPrefix: "/api/v3", // for some GHEs + host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub + pathPrefix: "/api/v3", // for some GHEs; none for GitHub timeout: 5000, headers: { "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent From 62cd4159848b548b9dcdd68c0d87571d3510cad5 Mon Sep 17 00:00:00 2001 From: Jonathon Kresner Date: Mon, 2 Mar 2015 21:16:18 -0800 Subject: [PATCH 022/461] add endpoint for addTeamMembership --- api/v3.0.0/orgs.js | 41 +++++++++++++++++++++++++++++++++++++++++ api/v3.0.0/routes.json | 9 +++++++++ 2 files changed, 50 insertions(+) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index 8d595532a5..4be787d05a 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -808,6 +808,47 @@ var orgs = module.exports = { }); }; + /** section: github + * orgs#addTeamMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.addTeamMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * orgs#getTeamRepos(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 2223da8767..a3b1c56a3c 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1509,6 +1509,15 @@ } }, + "add-team-membership": { + "url": "/teams/:id/memberships/:user", + "method": "PUT", + "params": { + "$id": null, + "$user": null + } + }, + "get-team-repos": { "url": "/teams/:id/repos", "method": "GET", From 29480fe77a185fd0ee2fb28f013c4f25ca4ee9ea Mon Sep 17 00:00:00 2001 From: Jonathon Kresner Date: Mon, 2 Mar 2015 21:43:13 -0800 Subject: [PATCH 023/461] add endpoint for editOrgMembership --- api/v3.0.0/routes.json | 15 +++++++++++++++ api/v3.0.0/user.js | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index a3b1c56a3c..100d1dec87 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3007,6 +3007,21 @@ } }, + "edit-organization-membership": { + "url": "/user/memberships/orgs/:org", + "method": "PATCH", + "params": { + "$org": null, + "state": { + "type": "String", + "required": true, + "validation": "^(open|closed|active)$", + "invalidmsg": "", + "description": "" + } + } + }, + "get-teams": { "url": "/user/teams", "method": "GET", diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 21a21ba688..ec9b3937f9 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -185,7 +185,48 @@ var user = module.exports = { callback(null, ret); }); }; + + /** section: github + * user#editOrgMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - state (String): Required + **/ + this.editOrganizationMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * user#getTeams(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. From 46130b32e406e73472d6fe716047e147e39a2ded Mon Sep 17 00:00:00 2001 From: Jonathon Kresner Date: Mon, 2 Mar 2015 21:54:11 -0800 Subject: [PATCH 024/461] Fix getting all pull requests without filters --- api/v3.0.0/routes.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 100d1dec87..276f3caa31 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1633,8 +1633,20 @@ "invalidmsg": "open, closed, all, default: open", "description": "open, closed, or all" }, - "$head": null, - "$base": null, + "head": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "base": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, "$page": null, "$per_page": null, "sort": { From 08f4ae2c0ff1d8630e28e887f54172555b256339 Mon Sep 17 00:00:00 2001 From: Niklas Hofmann Date: Fri, 13 Mar 2015 20:34:47 +0100 Subject: [PATCH 025/461] fix getNextPage when using pathPrefix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 12f1ff531e..2f164cb7d2 100644 --- a/index.js +++ b/index.js @@ -575,7 +575,7 @@ var Client = module.exports = function(config) { function getQueryAndUrl(msg, def, format, config) { var url = def.url; - if (config.pathPrefix) { + if (config.pathPrefix && url.indexOf(config.pathPrefix) !== 0) { url = config.pathPrefix + def.url; } var ret = { From 87ebd4d12c2dce3f28d74080c7bae1c99222b931 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Sun, 29 Mar 2015 07:37:07 -0230 Subject: [PATCH 026/461] Updated routes.js and user.js to include getAll for users --- api/v3.0.0/routes.json | 14 ++++++++++++++ api/v3.0.0/user.js | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 2223da8767..84f9fac44f 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -2919,6 +2919,20 @@ }, "user": { + "get-all": { + "url": "/users", + "method": "GET", + "params": { + "since":{ + "type": "Number", + "required": false, + "validation": "", + "description": "The integer ID of the last User that you’ve seen." + } + } + + }, + "get-from": { "url": "/users/:user", "method": "GET", diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 21a21ba688..c9ad7d7774 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -19,6 +19,44 @@ var user = module.exports = { }; (function() { + /** section: github + * user#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; /** section: github * user#getFrom(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. From 5ed5e1402578dab205989646e13f722499981eb1 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Sun, 29 Mar 2015 07:43:42 -0230 Subject: [PATCH 027/461] updates comment describing user#getAll --- api/v3.0.0/user.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index c9ad7d7774..00dbb3d91c 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -27,6 +27,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Number): Optional. The integer ID of the last User that you’ve seen. **/ this.getAll = function(msg, block, callback) { var self = this; From d7a17cac4d577e89e7bc79c94fe4d939aa17d92b Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sat, 18 Apr 2015 01:42:09 +0800 Subject: [PATCH 028/461] Use svg instead of png to get better image quality --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88c568188e..21eb3dba5a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Node.JS module, which provides an object oriented wrapper for the GitHub v3 AP ## Installation - Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github.png): + Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github.svg): $ npm install github From 471a6b78a2f94b0cd2d3953b0b63a9ee2508c400 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 15:44:56 +0200 Subject: [PATCH 029/461] Added code search API method. Original idea by @zamith. Fixes #228. --- api/v3.0.0/issues.js | 2 +- api/v3.0.0/orgs.js | 2 +- api/v3.0.0/pullRequests.js | 4 ++-- api/v3.0.0/routes.json | 18 ++++++++++++++++ api/v3.0.0/search.js | 44 ++++++++++++++++++++++++++++++++++++++ api/v3.0.0/searchTest.js | 18 +++++++++++++++- api/v3.0.0/user.js | 1 + 7 files changed, 84 insertions(+), 5 deletions(-) diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js index dfd44bc9b5..2b3ce9fc06 100644 --- a/api/v3.0.0/issues.js +++ b/api/v3.0.0/issues.js @@ -173,7 +173,7 @@ var issues = module.exports = { * - body (String): Optional. * - assignee (String): Optional. Login for the user that this issue should be assigned to. * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. - * - labels (Json): Required. Array of strings - Labels to associate with this issue. + * - labels (Json): Optional. Array of strings - Labels to associate with this issue. **/ this.create = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index 8d595532a5..782954ee4c 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -159,7 +159,7 @@ var orgs = module.exports = { * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - filter (String): Optional. Validation rule: ` (all|2fa_disabled) `, Default: ` all `. + * - filter (String): Optional. Validation rule: ` ^(all|2fa_disabled)$ `. **/ this.getMembers = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 71f6e7cae7..5b597e67a7 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -30,8 +30,8 @@ var pullRequests = module.exports = { * - user (String): Required. * - repo (String): Required. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. - * - head (String): Optional. Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. - * - base (String): Optional. Filter pulls by base branch name. Example: gh-pages. + * - head (String): Required. The branch (or git ref) where your changes are implemented. + * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 84f9fac44f..92b8b1975e 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3559,6 +3559,24 @@ }, "search": { + "code": { + "url": "/search/code", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^indexed$", + "invalidmsg": "indexed only", + "description": "indexed only" + }, + "$order": null, + "$page": null, + "$per_page": null + } + }, + "issues": { "url": "/search/issues", "method": "GET", diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js index 18ea1a34a5..821b468009 100644 --- a/api/v3.0.0/search.js +++ b/api/v3.0.0/search.js @@ -19,6 +19,50 @@ var search = module.exports = { }; (function() { + /** section: github + * search#code(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - q (String): Required. Search Term + * - sort (String): Optional. indexed only Validation rule: ` ^indexed$ `. + * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.code = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + /** section: github * search#issues(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/searchTest.js b/api/v3.0.0/searchTest.js index 68fefa65c9..f95bc2d141 100644 --- a/api/v3.0.0/searchTest.js +++ b/api/v3.0.0/searchTest.js @@ -26,10 +26,26 @@ describe("[search]", function() { });*/ }); + it("should successfully execute GET /search/code/:q (code)", function(next) { + client.search.code( + { + q: ['test', 'repo:mikedeboertest/1423836276146'].join('+') + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.items.length, 1); + var file = res.items[0]; + Assert.equal(file.name, "TEST.md"); + + next(); + } + ); + }); + it("should successfully execute GET /search/issues/:q (issues)", function(next) { client.search.issues( { - q: ['macaroni', 'repo:mikedeboertest/node_chat', 'state:open'].join('+') + q: ['debate', 'repo:mikedeboertest/node_chat', 'state:open'].join('+') }, function(err, res) { Assert.equal(err, null); diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 00dbb3d91c..0e59c95c24 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -58,6 +58,7 @@ var user = module.exports = { callback(null, ret); }); }; + /** section: github * user#getFrom(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. From a14fb95db5d3a81e777e5bada1228e5ce519cbba Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 15:50:19 +0200 Subject: [PATCH 030/461] Auto-generate sources to cleanup changes made in PR #231 --- api/v3.0.0/orgs.js | 6 +++--- api/v3.0.0/pullRequests.js | 4 ++-- api/v3.0.0/user.js | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index a0e7e1143f..7f8b2a88f3 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -816,8 +816,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. + * - id (String): Required. + * - user (String): Required. **/ this.addTeamMembership = function(msg, block, callback) { var self = this; @@ -848,7 +848,7 @@ var orgs = module.exports = { callback(null, ret); }); }; - + /** section: github * orgs#getTeamRepos(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 5b597e67a7..d91c7520fe 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -30,8 +30,8 @@ var pullRequests = module.exports = { * - user (String): Required. * - repo (String): Required. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Optional. + * - base (String): Optional. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 73bfb8d038..8cc2780b33 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -225,17 +225,17 @@ var user = module.exports = { callback(null, ret); }); }; - + /** section: github - * user#editOrgMembership(msg, callback) -> null + * user#editOrganizationMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - state (String): Required + * - org (String): Required. + * - state (String): Required. Validation rule: ` ^(open|closed|active)$ `. **/ this.editOrganizationMembership = function(msg, block, callback) { var self = this; @@ -266,7 +266,7 @@ var user = module.exports = { callback(null, ret); }); }; - + /** section: github * user#getTeams(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. From 9d0cccdb53686c8cc7ee58f5e26e6050abbd9285 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 16:00:51 +0200 Subject: [PATCH 031/461] Added support for deployments api. Routes coding done by @neekipatel. Fixes #198 --- api/v3.0.0/repos.js | 182 +++++++++++++++++++++++++++++++++++++++++ api/v3.0.0/routes.json | 138 +++++++++++++++++++++++++++++++ 2 files changed, 320 insertions(+) diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 7af7e24a70..311471fa80 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -2998,4 +2998,186 @@ var repos = module.exports = { }); }; + /** section: github + * repos#getDeployments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - sha (String): Optional. The short or long sha that was recorded at creation time. Default: none. + * - ref (String): Optional. The name of the ref. This can be a branch, tag, or sha. Default: none. + * - task (String): Optional. The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getDeployments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createDeployment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - ref (String): Required. The ref to deploy. This can be a branch, tag, or sha. + * - task (String): Required. The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * - auto_merge (Boolean): Optional. Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * - required_contexts (Array): Optional. Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * - payload (String): Optional. Optional JSON payload with extra information about the deployment. Default: '' + * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. + * - description (String): Optional. Optional short description. Default: '' + * - user (String): Required. + * - repo (String): Required. + **/ + this.createDeployment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getDeploymentStatuses(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getDeploymentStatuses = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createDeploymentStatus(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - state (String): Optional. The state of the status. Can be one of pending, success, error, or failure. + * - target_url (String): Optional. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: '' + * - description (String): Optional. A short description of the status. Default: '' + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.createDeploymentStatus = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + + if (callback) + callback(null, ret); + }); + }; + }).call(repos.repos); diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 7e8553ea39..c43a5bda58 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -2936,6 +2936,144 @@ "$user": null, "$repo": null } + }, + + "get-deployments": { + "url": "/repos/:user/:repo/deployments", + "method": "GET", + "params": { + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The short or long sha that was recorded at creation time. Default: none." + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the ref. This can be a branch, tag, or sha. Default: none." + }, + "task": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none." + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none." + }, + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "create-deployment": { + "url": "/repos/:user/:repo/deployments", + "method": "POST", + "params": { + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The ref to deploy. This can be a branch, tag, or sha." + }, + "task": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The named task to execute. e.g. deploy or deploy:migrations. Default: deploy" + }, + "auto_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true" + }, + "required_contexts": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts." + }, + "payload": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional JSON payload with extra information about the deployment. Default: ''" + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none." + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional short description. Default: ''" + }, + "$user": null, + "$repo": null + } + }, + + "get-deployment-statuses": { + "url": "/repos/:user/:repo/deployments/:id/statuses", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "create-deployment-status": { + "url": "/repos/:user/:repo/deployments/:id/statuses", + "method": "POST", + "params": { + "state": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The state of the status. Can be one of pending, success, error, or failure." + }, + "target_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: ''" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A short description of the status. Default: ''" + }, + "$user": null, + "$repo": null, + "$id": null + } } }, From a1115dc209719549d17c61bbdfb6f613fc2993fd Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 16:48:42 +0200 Subject: [PATCH 032/461] Add support for custom accept headers for real this time, added markdown-raw method, added support for non-JSON request results. Fixes #239. Fixes #235. --- api/v3.0.0/authorization.js | 95 ++- api/v3.0.0/events.js | 190 +++-- api/v3.0.0/gists.js | 323 +++++--- api/v3.0.0/gitdata.js | 247 +++--- api/v3.0.0/gitignore.js | 38 +- api/v3.0.0/issues.js | 475 +++++++---- api/v3.0.0/markdown.js | 64 +- api/v3.0.0/markdownTest.js | 13 + api/v3.0.0/misc.js | 57 +- api/v3.0.0/orgs.js | 456 +++++++---- api/v3.0.0/pullRequests.js | 285 ++++--- api/v3.0.0/releases.js | 190 +++-- api/v3.0.0/repos.js | 1387 ++++++++++++++++++++------------ api/v3.0.0/routes.json | 17 +- api/v3.0.0/search.js | 95 ++- api/v3.0.0/statuses.js | 57 +- api/v3.0.0/user.js | 418 ++++++---- index.js | 21 +- templates/after_request.js.tpl | 14 +- templates/handler.js.tpl | 5 +- 20 files changed, 2836 insertions(+), 1611 deletions(-) diff --git a/api/v3.0.0/authorization.js b/api/v3.0.0/authorization.js index f5a63e6836..ca61fdfe81 100644 --- a/api/v3.0.0/authorization.js +++ b/api/v3.0.0/authorization.js @@ -38,7 +38,10 @@ var authorization = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -48,12 +51,14 @@ var authorization = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -78,7 +83,10 @@ var authorization = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -88,12 +96,14 @@ var authorization = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -120,7 +130,10 @@ var authorization = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -130,12 +143,14 @@ var authorization = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -165,7 +180,10 @@ var authorization = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -175,12 +193,14 @@ var authorization = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -205,7 +225,10 @@ var authorization = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -215,12 +238,14 @@ var authorization = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/events.js b/api/v3.0.0/events.js index ef1e836613..f0dfbb1efe 100644 --- a/api/v3.0.0/events.js +++ b/api/v3.0.0/events.js @@ -38,7 +38,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -48,12 +51,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -81,7 +86,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -91,12 +99,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -124,7 +134,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -134,12 +147,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -167,7 +182,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -177,12 +195,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -209,7 +229,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -219,12 +242,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -251,7 +276,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -261,12 +289,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -293,7 +323,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -303,12 +336,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -335,7 +370,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -345,12 +383,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -377,7 +417,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -387,12 +430,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -420,7 +465,10 @@ var events = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -430,12 +478,14 @@ var events = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/gists.js b/api/v3.0.0/gists.js index 3b270e33e2..724b8c343c 100644 --- a/api/v3.0.0/gists.js +++ b/api/v3.0.0/gists.js @@ -39,7 +39,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -49,12 +52,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -82,7 +87,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -92,12 +100,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -124,7 +134,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -134,12 +147,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -166,7 +181,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -176,12 +194,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -206,7 +226,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -216,12 +239,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -246,7 +271,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -256,12 +284,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -286,7 +316,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -296,12 +329,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -326,7 +361,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -336,12 +374,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -366,7 +406,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -376,12 +419,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -406,7 +451,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -416,12 +464,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -446,7 +496,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -456,12 +509,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -486,7 +541,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -496,12 +554,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -526,7 +586,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -536,12 +599,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -567,7 +632,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -577,12 +645,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -608,7 +678,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -618,12 +691,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -650,7 +725,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -660,12 +738,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -691,7 +771,10 @@ var gists = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -701,12 +784,14 @@ var gists = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/gitdata.js b/api/v3.0.0/gitdata.js index 14d5bd0411..584cc123b1 100644 --- a/api/v3.0.0/gitdata.js +++ b/api/v3.0.0/gitdata.js @@ -41,7 +41,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -51,12 +54,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -84,7 +89,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -94,12 +102,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -126,7 +136,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -136,12 +149,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -172,7 +187,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -182,12 +200,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -214,7 +234,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -224,12 +247,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -257,7 +282,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -267,12 +295,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -300,7 +330,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -310,12 +343,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -344,7 +379,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -354,12 +392,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -386,7 +426,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -396,12 +439,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -428,7 +473,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -438,12 +486,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -474,7 +524,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -484,12 +537,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -517,7 +572,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -527,12 +585,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -560,7 +620,10 @@ var gitdata = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -570,12 +633,14 @@ var gitdata = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/gitignore.js b/api/v3.0.0/gitignore.js index b60b86b6fe..3caa4b0c35 100644 --- a/api/v3.0.0/gitignore.js +++ b/api/v3.0.0/gitignore.js @@ -37,7 +37,10 @@ var gitignore = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -47,12 +50,14 @@ var gitignore = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -77,7 +82,10 @@ var gitignore = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -87,12 +95,14 @@ var gitignore = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js index 2b3ce9fc06..e223540967 100644 --- a/api/v3.0.0/issues.js +++ b/api/v3.0.0/issues.js @@ -44,7 +44,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -54,12 +57,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -95,7 +100,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -105,12 +113,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -137,7 +147,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -147,12 +160,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -183,7 +198,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -193,12 +211,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -231,7 +251,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -241,12 +264,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -277,7 +302,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -287,12 +315,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -321,7 +351,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -331,12 +364,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -363,7 +398,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -373,12 +411,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -406,7 +446,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -416,12 +459,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -449,7 +494,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -459,12 +507,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -491,7 +541,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -501,12 +554,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -535,7 +590,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -545,12 +603,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -578,7 +638,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -588,12 +651,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -620,7 +685,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -630,12 +698,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -663,7 +733,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -673,12 +746,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -705,7 +780,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -715,12 +793,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -748,7 +828,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -758,12 +841,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -791,7 +876,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -801,12 +889,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -833,7 +923,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -843,12 +936,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -875,7 +970,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -885,12 +983,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -920,7 +1020,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -930,12 +1033,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -962,7 +1067,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -972,12 +1080,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1007,7 +1117,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1017,12 +1130,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1053,7 +1168,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1063,12 +1181,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1095,7 +1215,10 @@ var issues = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1105,12 +1228,14 @@ var issues = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/markdown.js b/api/v3.0.0/markdown.js index c5f7ba2231..c7882c9514 100644 --- a/api/v3.0.0/markdown.js +++ b/api/v3.0.0/markdown.js @@ -39,7 +39,10 @@ var markdown = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -49,12 +52,59 @@ var markdown = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * markdown#renderRaw(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - data (String): Required. Raw data to send as the body of the request + **/ + this.renderRaw = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/markdownTest.js b/api/v3.0.0/markdownTest.js index 19271af777..29846a0fd3 100644 --- a/api/v3.0.0/markdownTest.js +++ b/api/v3.0.0/markdownTest.js @@ -40,4 +40,17 @@ describe("[markdown]", function() { } ); }); + + it("should successfully execute POST /markdown/raw (render)", function(next) { + client.markdown.renderRaw( + { + data: "Hello world github/linguist#1 **cool**, and #1!" + }, + function(err, res) { + Assert.equal(err, null); + console.log(res); + next(); + } + ); + }); }); diff --git a/api/v3.0.0/misc.js b/api/v3.0.0/misc.js index b1dc00ba79..6d3723b211 100644 --- a/api/v3.0.0/misc.js +++ b/api/v3.0.0/misc.js @@ -37,7 +37,10 @@ var misc = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -47,12 +50,14 @@ var misc = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -77,7 +82,10 @@ var misc = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -87,12 +95,14 @@ var misc = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -117,7 +127,10 @@ var misc = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -127,12 +140,14 @@ var misc = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index 7f8b2a88f3..e584c4ea03 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -39,7 +39,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -49,12 +52,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -81,7 +86,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -91,12 +99,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -126,7 +136,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -136,12 +149,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -169,7 +184,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -179,12 +197,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -210,7 +230,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -220,12 +243,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -251,7 +276,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -261,12 +289,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -291,7 +321,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -301,12 +334,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -332,7 +367,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -342,12 +380,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -373,7 +413,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -383,12 +426,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -414,7 +459,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -424,12 +472,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -456,7 +506,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -466,12 +519,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -496,7 +551,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -506,12 +564,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -539,7 +599,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -549,12 +612,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -581,7 +646,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -591,12 +659,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -621,7 +691,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -631,12 +704,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -663,7 +738,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -673,12 +751,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -704,7 +784,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -714,12 +797,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -745,7 +830,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -755,12 +843,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -786,7 +876,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -796,12 +889,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -827,7 +922,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -837,12 +935,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -869,7 +969,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -879,12 +982,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -911,7 +1016,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -921,12 +1029,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -953,7 +1063,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -963,12 +1076,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -995,7 +1110,10 @@ var orgs = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1005,12 +1123,14 @@ var orgs = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index d91c7520fe..56c095f97e 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -45,7 +45,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -55,12 +58,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -87,7 +92,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -97,12 +105,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -132,7 +142,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -142,12 +155,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -176,7 +191,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -186,12 +204,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -221,7 +241,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -231,12 +254,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -265,7 +290,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -275,12 +303,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -309,7 +339,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -319,12 +352,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -353,7 +388,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -363,12 +401,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -396,7 +436,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -406,12 +449,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -440,7 +485,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -450,12 +498,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -482,7 +532,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -492,12 +545,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -528,7 +583,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -538,12 +596,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -572,7 +632,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -582,12 +645,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -615,7 +680,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -625,12 +693,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -657,7 +727,10 @@ var pullRequests = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -667,12 +740,14 @@ var pullRequests = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 4e4fbc264a..1d83380ee0 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -40,7 +40,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -50,12 +53,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -82,7 +87,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -92,12 +100,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -129,7 +139,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -139,12 +152,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -177,7 +192,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -187,12 +205,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -219,7 +239,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -229,12 +252,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -261,7 +286,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -271,12 +299,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -303,7 +333,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -313,12 +346,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -346,7 +381,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -356,12 +394,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -390,7 +430,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -400,12 +443,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -432,7 +477,10 @@ var releases = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -442,12 +490,14 @@ var releases = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 311471fa80..4229d18dfc 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -41,7 +41,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -51,12 +54,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -86,7 +91,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -96,12 +104,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -129,7 +139,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -139,12 +152,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -177,7 +192,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -187,12 +205,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -227,7 +247,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -237,12 +260,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -268,7 +293,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -278,12 +306,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -308,7 +338,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -318,12 +351,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -357,7 +392,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -367,12 +405,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -398,7 +438,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -408,12 +451,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -442,7 +487,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -452,12 +500,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -486,7 +536,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -496,12 +549,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -529,7 +584,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -539,12 +597,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -572,7 +632,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -582,12 +645,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -615,7 +680,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -625,12 +693,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -658,7 +728,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -668,12 +741,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -702,7 +777,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -712,12 +790,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -745,7 +825,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -755,12 +838,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -787,7 +872,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -797,12 +885,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -829,7 +919,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -839,12 +932,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -871,7 +966,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -881,12 +979,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -919,7 +1019,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -929,12 +1032,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -961,7 +1066,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -971,12 +1079,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1004,7 +1114,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1014,12 +1127,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1048,7 +1163,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1058,12 +1176,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1095,7 +1215,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1105,12 +1228,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1137,7 +1262,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1147,12 +1275,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1180,7 +1310,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1190,12 +1323,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1223,7 +1358,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1233,12 +1371,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1265,7 +1405,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1275,12 +1418,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1307,7 +1452,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1317,12 +1465,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1350,7 +1500,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1360,12 +1513,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1395,7 +1550,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1405,12 +1563,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1442,7 +1602,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1452,12 +1615,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1490,7 +1655,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1500,12 +1668,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1537,7 +1707,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1547,12 +1720,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1580,7 +1755,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1590,12 +1768,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1623,7 +1803,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1633,12 +1816,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1665,7 +1850,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1675,12 +1863,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1707,7 +1897,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1717,12 +1910,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1751,7 +1946,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1761,12 +1959,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1793,7 +1993,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1803,12 +2006,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1836,7 +2041,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1846,12 +2054,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1878,7 +2088,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1888,12 +2101,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1921,7 +2136,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1931,12 +2149,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -1965,7 +2185,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -1975,12 +2198,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2007,7 +2232,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2017,12 +2245,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2050,7 +2280,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2060,12 +2293,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2091,7 +2326,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2101,12 +2339,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2133,7 +2373,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2143,12 +2386,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2176,7 +2421,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2186,12 +2434,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2217,7 +2467,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2227,12 +2480,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2258,7 +2513,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2268,12 +2526,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2301,7 +2561,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2311,12 +2574,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2342,7 +2607,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2352,12 +2620,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2384,7 +2654,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2394,12 +2667,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2427,7 +2702,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2437,12 +2715,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2468,7 +2748,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2478,12 +2761,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2509,7 +2794,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2519,12 +2807,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2552,7 +2842,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2562,12 +2855,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2594,7 +2889,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2604,12 +2902,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2639,7 +2939,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2649,12 +2952,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2687,7 +2992,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2697,12 +3005,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2729,7 +3039,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2739,12 +3052,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2771,7 +3086,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2781,12 +3099,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2812,7 +3132,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2822,12 +3145,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2853,7 +3178,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2863,12 +3191,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2894,7 +3224,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2904,12 +3237,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2935,7 +3270,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2945,12 +3283,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -2976,7 +3316,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -2986,12 +3329,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -3023,7 +3368,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -3033,12 +3381,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -3071,7 +3421,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -3081,12 +3434,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -3113,7 +3468,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -3123,12 +3481,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -3158,7 +3518,10 @@ var repos = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -3168,12 +3531,14 @@ var repos = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index c43a5bda58..b7fafad7ef 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -26,7 +26,6 @@ "If-None-Match", "Cookie", "User-Agent", - "Accept", "X-GitHub-OTP" ], "params": { @@ -345,6 +344,13 @@ "invalidmsg": "", "description": "Search Term", "combined": true + }, + "data": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Raw data to send as the body of the request" } } }, @@ -3847,6 +3853,15 @@ "description": "The repository context, only taken into account when rendering as `gfm`" } } + }, + + "render-raw": { + "url": "/markdown/raw", + "method": "POST", + "requestFormat": "raw", + "params": { + "$data": null + } } }, diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js index 821b468009..260cf52867 100644 --- a/api/v3.0.0/search.js +++ b/api/v3.0.0/search.js @@ -41,7 +41,10 @@ var search = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -51,12 +54,14 @@ var search = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -85,7 +90,10 @@ var search = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -95,12 +103,14 @@ var search = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -129,7 +139,10 @@ var search = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -139,12 +152,14 @@ var search = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -173,7 +188,10 @@ var search = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -183,12 +201,14 @@ var search = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -213,7 +233,10 @@ var search = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -223,12 +246,14 @@ var search = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/statuses.js b/api/v3.0.0/statuses.js index 238b3d178d..1a376afd47 100644 --- a/api/v3.0.0/statuses.js +++ b/api/v3.0.0/statuses.js @@ -39,7 +39,10 @@ var statuses = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -49,12 +52,14 @@ var statuses = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -81,7 +86,10 @@ var statuses = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -91,12 +99,14 @@ var statuses = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -127,7 +137,10 @@ var statuses = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -137,12 +150,14 @@ var statuses = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 8cc2780b33..1614cbc464 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -37,7 +37,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -47,12 +50,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -77,7 +82,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -87,12 +95,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -117,7 +127,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -127,12 +140,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -163,7 +178,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -173,12 +191,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -204,7 +224,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -214,12 +237,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -245,7 +270,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -255,12 +283,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -286,7 +316,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -296,12 +329,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -327,7 +362,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -337,12 +375,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -367,7 +407,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -377,12 +420,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -407,7 +452,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -417,12 +465,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -449,7 +499,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -459,12 +512,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -491,7 +546,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -501,12 +559,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -532,7 +592,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -542,12 +605,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -574,7 +639,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -584,12 +652,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -614,7 +684,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -624,12 +697,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -654,7 +729,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -664,12 +742,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -695,7 +775,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -705,12 +788,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -737,7 +822,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -747,12 +835,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -777,7 +867,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -787,12 +880,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -818,7 +913,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -828,12 +926,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -860,7 +960,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -870,12 +973,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); @@ -900,7 +1005,10 @@ var user = module.exports = { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -910,12 +1018,14 @@ var user = module.exports = { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); diff --git a/index.js b/index.js index 2f164cb7d2..3f79667952 100644 --- a/index.js +++ b/index.js @@ -573,13 +573,20 @@ var Client = module.exports = function(config) { getPage.call(this, link, "first", callback); }; + function getRequestFormat(hasBody, block) { + if (hasBody) + return block.requestFormat || this.constants.requestFormat; + + return "query"; + } + function getQueryAndUrl(msg, def, format, config) { var url = def.url; if (config.pathPrefix && url.indexOf(config.pathPrefix) !== 0) { url = config.pathPrefix + def.url; } var ret = { - query: format == "json" ? {} : [] + query: format == "json" ? {} : format == "raw" ? msg.data : [] }; if (!def || !def.params) { ret.url = url; @@ -625,7 +632,7 @@ var Client = module.exports = function(config) { else { if (format == "json") ret.query[paramName] = val; - else + else if (format != "raw") ret.query.push(paramName + "=" + val); } }); @@ -649,9 +656,7 @@ var Client = module.exports = function(config) { var method = block.method.toLowerCase(); var hasFileBody = block.hasFileBody; var hasBody = !hasFileBody && ("head|get|delete".indexOf(method) === -1); - var format = hasBody && this.constants.requestFormat - ? this.constants.requestFormat - : "query"; + var format = getRequestFormat.call(this, hasBody, block); var obj = getQueryAndUrl(msg, block, format, self.config); var query = obj.query; var url = this.config.url ? this.config.url + obj.url : obj.url; @@ -692,12 +697,14 @@ var Client = module.exports = function(config) { if (hasBody) { if (format == "json") query = JSON.stringify(query); - else + else if (format != "raw") query = query.join("&"); headers["content-length"] = Buffer.byteLength(query, "utf8"); headers["content-type"] = format == "json" ? "application/json; charset=utf-8" - : "application/x-www-form-urlencoded; charset=utf-8"; + : format == "raw" + ? "text/plain; charset=utf-8" + : "application/x-www-form-urlencoded; charset=utf-8"; } if (this.auth) { var basic; diff --git a/templates/after_request.js.tpl b/templates/after_request.js.tpl index 646272d58d..0e8277ccc2 100644 --- a/templates/after_request.js.tpl +++ b/templates/after_request.js.tpl @@ -1,9 +1,11 @@ if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - [<%headers%>].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + [<%headers%>].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } diff --git a/templates/handler.js.tpl b/templates/handler.js.tpl index 0feb4e7fff..b76033e69d 100644 --- a/templates/handler.js.tpl +++ b/templates/handler.js.tpl @@ -7,7 +7,10 @@ var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) From 5046fd54500b98bf38e5f0d56c0deaa51dcaf400 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 17:03:04 +0200 Subject: [PATCH 033/461] Add creator field to repoIssues. Fixes #193 --- api/v3.0.0/issues.js | 1 + api/v3.0.0/routes.json | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js index e223540967..68d8ac0ea4 100644 --- a/api/v3.0.0/issues.js +++ b/api/v3.0.0/issues.js @@ -84,6 +84,7 @@ var issues = module.exports = { * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * - creator (String): Optional. The user that created the issue. * - mentioned (String): Optional. String User login. * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index b7fafad7ef..f82c8bfa49 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -26,6 +26,7 @@ "If-None-Match", "Cookie", "User-Agent", + "Accept", "X-GitHub-OTP" ], "params": { @@ -823,9 +824,16 @@ "type": "String", "required": false, "validation": "", - "invalidmsg": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User.", + "invalidmsg": "", "description": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User." }, + "creator": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The user that created the issue." + }, "mentioned": { "type": "String", "required": false, From bae796eba78ab1500ceeec22ca084c8572da0724 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 17:09:04 +0200 Subject: [PATCH 034/461] updated pagination code to support latest features --- index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 3f79667952..0c062efcf8 100644 --- a/index.js +++ b/index.js @@ -507,7 +507,10 @@ var Client = module.exports = function(config) { var ret; try { - ret = res.data && JSON.parse(res.data); + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); } catch (ex) { if (callback) @@ -517,12 +520,14 @@ var Client = module.exports = function(config) { if (!ret) ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "link"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "link"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } if (callback) callback(null, ret); From 29dedb3022649c27ac1dad79326270b6b2a48047 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 17:59:26 +0200 Subject: [PATCH 035/461] Bump version to 0.2.4 --- package.json | 2 +- seed.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 71b9d5ce4a..cd1cad99b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github", - "version" : "0.2.3", + "version" : "0.2.4", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ diff --git a/seed.yml b/seed.yml index e3a08f8df0..80315da0f8 100644 --- a/seed.yml +++ b/seed.yml @@ -2,4 +2,4 @@ name: node-github description: NodeJS wrapper for the GitHub API tags: git github web - version: 0.2.3 + version: 0.2.4 From a9618c706aea251277b62844c9c5e7376cb23862 Mon Sep 17 00:00:00 2001 From: mikedeboer Date: Sun, 19 Apr 2015 20:22:44 +0200 Subject: [PATCH 036/461] Auto-generate documentation URLs by parsing them from a fresh grab of the GH documentation site. --- api/v3.0.0/authorization.js | 10 + api/v3.0.0/gists.js | 22 ++ api/v3.0.0/gitignore.js | 2 + api/v3.0.0/issues.js | 10 + api/v3.0.0/markdown.js | 4 + api/v3.0.0/orgs.js | 4 + api/v3.0.0/pullRequests.js | 18 ++ api/v3.0.0/releases.js | 18 ++ api/v3.0.0/repos.js | 26 ++ api/v3.0.0/routes.json | 1 + api/v3.0.0/search.js | 8 + api/v3.0.0/user.js | 8 + generate.js | 492 ++++++++++++++++++++++++------------ package.json | 1 + 14 files changed, 466 insertions(+), 158 deletions(-) diff --git a/api/v3.0.0/authorization.js b/api/v3.0.0/authorization.js index ca61fdfe81..41ca7e0c3d 100644 --- a/api/v3.0.0/authorization.js +++ b/api/v3.0.0/authorization.js @@ -29,6 +29,8 @@ var authorization = module.exports = { * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations **/ this.getAll = function(msg, block, callback) { var self = this; @@ -74,6 +76,8 @@ var authorization = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization **/ this.get = function(msg, block, callback) { var self = this; @@ -121,6 +125,8 @@ var authorization = module.exports = { * - scopes (Array): Optional. A list of scopes that this authorization is in. * - note (String): Optional. A note to remind you what the OAuth token is for. * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. + * + * https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization **/ this.create = function(msg, block, callback) { var self = this; @@ -171,6 +177,8 @@ var authorization = module.exports = { * - remove_scopes (Array): Optional. A list of scopes to remove from this authorization. * - note (String): Optional. A note to remind you what the OAuth token is for. * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. + * + * https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization **/ this.update = function(msg, block, callback) { var self = this; @@ -216,6 +224,8 @@ var authorization = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization **/ this.delete = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/gists.js b/api/v3.0.0/gists.js index 724b8c343c..d3297ec64c 100644 --- a/api/v3.0.0/gists.js +++ b/api/v3.0.0/gists.js @@ -30,6 +30,8 @@ var gists = module.exports = { * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * + * https://developer.github.com/v3/gists/#list-gists **/ this.getAll = function(msg, block, callback) { var self = this; @@ -125,6 +127,8 @@ var gists = module.exports = { * - description (String): Optional. * - public (Boolean): Required. * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * + * https://developer.github.com/v3/gists/#create-a-gist **/ this.create = function(msg, block, callback) { var self = this; @@ -172,6 +176,8 @@ var gists = module.exports = { * - id (String): Required. * - description (String): Optional. * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * + * https://developer.github.com/v3/gists/#edit-a-gist **/ this.edit = function(msg, block, callback) { var self = this; @@ -217,6 +223,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * + * https://developer.github.com/v3/gists/#list-gists **/ this.public = function(msg, block, callback) { var self = this; @@ -262,6 +270,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * + * https://developer.github.com/v3/gists/#list-gists **/ this.starred = function(msg, block, callback) { var self = this; @@ -307,6 +317,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#get-a-single-gist **/ this.get = function(msg, block, callback) { var self = this; @@ -352,6 +364,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#star-a-gist **/ this.star = function(msg, block, callback) { var self = this; @@ -397,6 +411,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#unstar-a-gist **/ this.deleteStar = function(msg, block, callback) { var self = this; @@ -442,6 +458,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#check-if-a-gist-is-starred **/ this.checkStar = function(msg, block, callback) { var self = this; @@ -487,6 +505,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#fork-a-gist **/ this.fork = function(msg, block, callback) { var self = this; @@ -532,6 +552,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. + * + * https://developer.github.com/v3/gists/#unstar-a-gist **/ this.delete = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/gitignore.js b/api/v3.0.0/gitignore.js index 3caa4b0c35..ebc9bbc1a5 100644 --- a/api/v3.0.0/gitignore.js +++ b/api/v3.0.0/gitignore.js @@ -28,6 +28,8 @@ var gitignore = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * No other params, simply pass an empty Object literal `{}` + * + * https://developer.github.com/v3/gitignore/#listing-available-templates **/ this.templates = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js index 68d8ac0ea4..66213e30d9 100644 --- a/api/v3.0.0/issues.js +++ b/api/v3.0.0/issues.js @@ -35,6 +35,8 @@ var issues = module.exports = { * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/issues/#list-issues **/ this.getAll = function(msg, block, callback) { var self = this; @@ -92,6 +94,8 @@ var issues = module.exports = { * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/issues/#list-issues-for-a-repository **/ this.repoIssues = function(msg, block, callback) { var self = this; @@ -139,6 +143,8 @@ var issues = module.exports = { * - user (String): Required. * - repo (String): Required. * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/issues/#get-a-single-issue **/ this.getRepoIssue = function(msg, block, callback) { var self = this; @@ -190,6 +196,8 @@ var issues = module.exports = { * - assignee (String): Optional. Login for the user that this issue should be assigned to. * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. * - labels (Json): Optional. Array of strings - Labels to associate with this issue. + * + * https://developer.github.com/v3/issues/#create-an-issue **/ this.create = function(msg, block, callback) { var self = this; @@ -243,6 +251,8 @@ var issues = module.exports = { * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. * - labels (Json): Optional. Array of strings - Labels to associate with this issue. * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. + * + * https://developer.github.com/v3/issues/#edit-an-issue **/ this.edit = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/markdown.js b/api/v3.0.0/markdown.js index c7882c9514..90d7271baf 100644 --- a/api/v3.0.0/markdown.js +++ b/api/v3.0.0/markdown.js @@ -30,6 +30,8 @@ var markdown = module.exports = { * - text (String): Required. The Markdown text to render * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` + * + * https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document **/ this.render = function(msg, block, callback) { var self = this; @@ -75,6 +77,8 @@ var markdown = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - data (String): Required. Raw data to send as the body of the request + * + * https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode **/ this.renderRaw = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index e584c4ea03..de2e89f5ec 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -77,6 +77,8 @@ var orgs = module.exports = { * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/orgs/#get-an-organization **/ this.get = function(msg, block, callback) { var self = this; @@ -127,6 +129,8 @@ var orgs = module.exports = { * - email (String): Optional. Publicly visible email address. * - location (String): Optional. * - name (String): Optional. + * + * https://developer.github.com/v3/orgs/#edit-an-organization **/ this.update = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 56c095f97e..96af44685c 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -36,6 +36,8 @@ var pullRequests = module.exports = { * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * + * https://developer.github.com/v3/pulls/#list-pull-requests **/ this.getAll = function(msg, block, callback) { var self = this; @@ -83,6 +85,8 @@ var pullRequests = module.exports = { * - user (String): Required. * - repo (String): Required. * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/pulls/#get-a-single-pull-request **/ this.get = function(msg, block, callback) { var self = this; @@ -133,6 +137,8 @@ var pullRequests = module.exports = { * - body (String): Optional. * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. * - head (String): Required. The branch (or git ref) where your changes are implemented. + * + * https://developer.github.com/v3/pulls/#create-a-pull-request **/ this.create = function(msg, block, callback) { var self = this; @@ -182,6 +188,8 @@ var pullRequests = module.exports = { * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. * - head (String): Required. The branch (or git ref) where your changes are implemented. + * + * https://developer.github.com/v3/pulls/#create-a-pull-request **/ this.createFromIssue = function(msg, block, callback) { var self = this; @@ -232,6 +240,8 @@ var pullRequests = module.exports = { * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. * - title (String): Required. * - body (String): Optional. + * + * https://developer.github.com/v3/pulls/#update-a-pull-request **/ this.update = function(msg, block, callback) { var self = this; @@ -281,6 +291,8 @@ var pullRequests = module.exports = { * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request **/ this.getCommits = function(msg, block, callback) { var self = this; @@ -330,6 +342,8 @@ var pullRequests = module.exports = { * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/pulls/#list-pull-requests-files **/ this.getFiles = function(msg, block, callback) { var self = this; @@ -379,6 +393,8 @@ var pullRequests = module.exports = { * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged **/ this.getMerged = function(msg, block, callback) { var self = this; @@ -427,6 +443,8 @@ var pullRequests = module.exports = { * - repo (String): Required. * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - commit_message (String): Optional. The message that will be used for the merge commit + * + * https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button **/ this.merge = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 1d83380ee0..9e94c634f1 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -31,6 +31,8 @@ var releases = module.exports = { * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository **/ this.listReleases = function(msg, block, callback) { var self = this; @@ -78,6 +80,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#get-a-single-release **/ this.getRelease = function(msg, block, callback) { var self = this; @@ -130,6 +134,8 @@ var releases = module.exports = { * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * + * https://developer.github.com/v3/repos/releases/#create-a-release **/ this.createRelease = function(msg, block, callback) { var self = this; @@ -183,6 +189,8 @@ var releases = module.exports = { * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * + * https://developer.github.com/v3/repos/releases/#edit-a-release **/ this.editRelease = function(msg, block, callback) { var self = this; @@ -230,6 +238,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#delete-a-release **/ this.deleteRelease = function(msg, block, callback) { var self = this; @@ -277,6 +287,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#list-assets-for-a-release **/ this.listAssets = function(msg, block, callback) { var self = this; @@ -324,6 +336,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#get-a-single-release-asset **/ this.getAsset = function(msg, block, callback) { var self = this; @@ -421,6 +435,8 @@ var releases = module.exports = { * - repo (String): Required. * - name (String): Required. * - label (String): Optional. An alternate short description of the asset. Used in place of the filename. + * + * https://developer.github.com/v3/repos/releases/#edit-a-release-asset **/ this.editAsset = function(msg, block, callback) { var self = this; @@ -468,6 +484,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#delete-a-release-asset **/ this.deleteAsset = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 4229d18dfc..6efa54233a 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -32,6 +32,8 @@ var repos = module.exports = { * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-your-repositories **/ this.getAll = function(msg, block, callback) { var self = this; @@ -130,6 +132,8 @@ var repos = module.exports = { * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-organization-repositories **/ this.getFromOrg = function(msg, block, callback) { var self = this; @@ -183,6 +187,8 @@ var repos = module.exports = { * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * + * https://developer.github.com/v3/repos/#create **/ this.create = function(msg, block, callback) { var self = this; @@ -238,6 +244,8 @@ var repos = module.exports = { * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. * - team_id (Number): Optional. The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#create **/ this.createFromOrg = function(msg, block, callback) { var self = this; @@ -284,6 +292,8 @@ var repos = module.exports = { * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - user (String): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/#get **/ this.get = function(msg, block, callback) { var self = this; @@ -383,6 +393,8 @@ var repos = module.exports = { * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. * - default_branch (String): Optional. Updates the default branch for this repository. + * + * https://developer.github.com/v3/repos/#edit **/ this.update = function(msg, block, callback) { var self = this; @@ -429,6 +441,8 @@ var repos = module.exports = { * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - user (String): Required. * - repo (String): Required. + * + * https://developer.github.com/v3/repos/#delete-a-repository **/ this.delete = function(msg, block, callback) { var self = this; @@ -527,6 +541,8 @@ var repos = module.exports = { * - anon (Boolean): Optional. Set to 1 or true to include anonymous contributors in results. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-contributors **/ this.getContributors = function(msg, block, callback) { var self = this; @@ -575,6 +591,8 @@ var repos = module.exports = { * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-languages **/ this.getLanguages = function(msg, block, callback) { var self = this; @@ -623,6 +641,8 @@ var repos = module.exports = { * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-teams **/ this.getTeams = function(msg, block, callback) { var self = this; @@ -671,6 +691,8 @@ var repos = module.exports = { * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-tags **/ this.getTags = function(msg, block, callback) { var self = this; @@ -719,6 +741,8 @@ var repos = module.exports = { * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#list-branches **/ this.getBranches = function(msg, block, callback) { var self = this; @@ -768,6 +792,8 @@ var repos = module.exports = { * - branch (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/repos/#get-branch **/ this.getBranch = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index f82c8bfa49..dc9b2165fe 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -6,6 +6,7 @@ "protocol": "https", "host": "api.github.com", "port": 443, + "documentation": "https://developer.github.com/v3", "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", "requestFormat": "json", "requestMedia": "application/vnd.github.v3+json" diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js index 260cf52867..ae91ca0fa7 100644 --- a/api/v3.0.0/search.js +++ b/api/v3.0.0/search.js @@ -32,6 +32,8 @@ var search = module.exports = { * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/search/#search-code **/ this.code = function(msg, block, callback) { var self = this; @@ -81,6 +83,8 @@ var search = module.exports = { * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/search/#search-issues **/ this.issues = function(msg, block, callback) { var self = this; @@ -130,6 +134,8 @@ var search = module.exports = { * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/search/#search-repositories **/ this.repos = function(msg, block, callback) { var self = this; @@ -179,6 +185,8 @@ var search = module.exports = { * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * + * https://developer.github.com/v3/search/#search-users **/ this.users = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index 1614cbc464..d4d4f19a9f 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -28,6 +28,8 @@ var user = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Number): Optional. The integer ID of the last User that you’ve seen. + * + * https://developer.github.com/v3/users/#get-a-single-user **/ this.getAll = function(msg, block, callback) { var self = this; @@ -73,6 +75,8 @@ var user = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - user (String): Required. + * + * https://developer.github.com/v3/users/#get-a-single-user **/ this.getFrom = function(msg, block, callback) { var self = this; @@ -118,6 +122,8 @@ var user = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * No other params, simply pass an empty Object literal `{}` + * + * https://developer.github.com/v3/users/#get-a-single-user **/ this.get = function(msg, block, callback) { var self = this; @@ -169,6 +175,8 @@ var user = module.exports = { * - location (String): Optional. * - hireable (Boolean): Optional. * - bio (String): Optional. + * + * https://developer.github.com/v3/users/#update-the-authenticated-user **/ this.update = function(msg, block, callback) { var self = this; diff --git a/generate.js b/generate.js index eb1e9bad6c..a5e553dc60 100755 --- a/generate.js +++ b/generate.js @@ -14,7 +14,9 @@ var Fs = require("fs"); var Path = require("path"); +var Url = require("url"); +var Async = require("async"); var Optimist = require("optimist"); var Util = require("./util"); @@ -25,10 +27,19 @@ var AfterRequestTpl = Fs.readFileSync(__dirname + "/templates/after_request.js.t var TestSectionTpl = Fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); var TestHandlerTpl = Fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); +var DocSectionsMap = { + "authorization": "oauth_authorizations", + "gitdata": "git", + "pull-requests": "pulls", + "pullRequests": "pulls", + "releases": "repos/releases", + "user": "users" +}; + var main = module.exports = function(versions, tests, restore) { Util.log("Generating for versions", Object.keys(versions)); - Object.keys(versions).forEach(function(version) { + Async.each(Object.keys(versions), function(version, versionDone) { var dir = Path.join(__dirname, "api", version); // If we're in restore mode, move .bak file back to their original position @@ -44,10 +55,10 @@ var main = module.exports = function(versions, tests, restore) { Util.log("Restored '" + file + "' (" + version + ")"); }); + versionDone(); return; } - var routes = versions[version]; var defines = routes.defines; delete routes.defines; @@ -58,179 +69,350 @@ var main = module.exports = function(versions, tests, restore) { var sections = {}; var testSections = {}; - function createComment(paramsStruct, section, funcName, indent) { - var params = Object.keys(paramsStruct); - var comment = [ - indent + "/** section: github", - indent + " * " + section + "#" + funcName + "(msg, callback) -> null", - indent + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", - indent + " * - callback (Function): function to call when the request is finished " + - "with an error as first argument and result data as second argument.", - indent + " *", - indent + " * ##### Params on the `msg` object:", - indent + " *" - ]; - comment.push(indent + " * - headers (Object): Optional. Key/ value pair " - + "of request headers to pass along with the HTTP request. Valid headers are: " - + "'" + defines["request-headers"].join("', '") + "'."); - if (!params.length) - comment.push(indent + " * No other params, simply pass an empty Object literal `{}`"); - var paramName, def, line; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); + // First fetch and cache the documentation sections, but only if the site + // can be reached at the moment. + var addDocLink = false; + var docsUrl = defines.constants.documentation; + pingDocumentationUrl(docsUrl, function(success) { + if (success) { + Util.log("Using '" + docsUrl + "' to generate links to online documentation."); + addDocLink = true; + Async.each(Object.keys(routes), function(section, sectionDone) { + section = DocSectionsMap[section] || section; + getSectionDocument(docsUrl + "/" + section + "/", function(err) { + // Ignore errors here... + sectionDone(); + }); + }, generateFiles); + return; + } + + Util.log("Could not reach documentation site, continuing without " + + "adding links to online documentation."); + generateFiles(); + }); + + function generateFiles() { + function createComment(block, section, funcName, indent) { + var paramsStruct = block.params; + var params = Object.keys(paramsStruct); + var comment = [ + indent + "/** section: github", + indent + " * " + section + "#" + funcName + "(msg, callback) -> null", + indent + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", + indent + " * - callback (Function): function to call when the request is finished " + + "with an error as first argument and result data as second argument.", + indent + " *", + indent + " * ##### Params on the `msg` object:", + indent + " *" + ]; + comment.push(indent + " * - headers (Object): Optional. Key/ value pair " + + "of request headers to pass along with the HTTP request. Valid headers are: " + + "'" + defines["request-headers"].join("', '") + "'."); + if (!params.length) + comment.push(indent + " * No other params, simply pass an empty Object literal `{}`"); + var paramName, def, line; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); + } + else + def = defines.params[paramName]; } else - def = defines.params[paramName]; + def = paramsStruct[paramName]; + + line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + + (def.required ? "Required. " : "Optional. "); + if (def.description) + line += def.description; + if (def.validation) + line += " Validation rule: ` " + def.validation + " `."; + + comment.push(line); } - else - def = paramsStruct[paramName]; - line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + - (def.required ? "Required. " : "Optional. "); - if (def.description) - line += def.description; - if (def.validation) - line += " Validation rule: ` " + def.validation + " `."; + if (addDocLink) { + var docSection = DocSectionsMap[section] || section; + var url = searchSectionUrl(docsUrl + "/" + docSection + "/", + block.method + " " + block.url); + + if (url) { + comment.push( + indent + " *", + indent + " * " + url); + } + else { + Util.log("No documentation link found for '" + block.url + + "' on '" + docsUrl + "/" + docSection + "/'"); + } + } - comment.push(line); + return comment.join("\n") + "\n" + indent + " **/"; } - return comment.join("\n") + "\n" + indent + " **/"; - } - - function getParams(paramsStruct, indent) { - var params = Object.keys(paramsStruct); - if (!params.length) - return "{}"; - var values = []; - var paramName, def; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); + function getParams(paramsStruct, indent) { + var params = Object.keys(paramsStruct); + if (!params.length) + return "{}"; + var values = []; + var paramName, def; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); + } + else + def = defines.params[paramName]; } else - def = defines.params[paramName]; + def = paramsStruct[paramName]; + + values.push(indent + " " + paramName + ": \"" + def.type + "\""); } - else - def = paramsStruct[paramName]; + return "{\n" + values.join(",\n") + "\n" + indent + "}"; + } - values.push(indent + " " + paramName + ": \"" + def.type + "\""); + function prepareApi(struct, baseType) { + if (!baseType) + baseType = ""; + + Object.keys(struct).forEach(function(routePart) { + var block = struct[routePart]; + if (!block) + return; + var messageType = baseType + "/" + routePart; + if (block.url && block.params) { + // we ended up at an API definition part! + var parts = messageType.split("/"); + var section = Util.toCamelCase(parts[1].toLowerCase()); + if (!block.method) { + throw new Error("No HTTP method specified for " + messageType + + "in section " + section); + } + + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + var comment = createComment(block, section, funcName, " "); + + // add the handler to the sections + if (!sections[section]) + sections[section] = []; + + var afterRequest = ""; + if (headers && headers.length) { + afterRequest = AfterRequestTpl.replace("<%headers%>", "\"" + + headers.join("\", \"") + "\""); + } + sections[section].push(HandlerTpl + .replace("<%funcName%>", funcName) + .replace("<%comment%>", comment) + .replace("<%afterRequest%>", afterRequest) + ); + + // add test to the testSections + if (!testSections[section]) + testSections[section] = []; + testSections[section].push(TestHandlerTpl + .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") + .replace("<%funcName%>", section + "." + funcName) + .replace("<%params%>", getParams(block.params, " ")) + ); + } + else { + // recurse into this block next: + prepareApi(block, messageType); + } + }); } - return "{\n" + values.join(",\n") + "\n" + indent + "}"; + + Util.log("Converting routes to functions"); + prepareApi(routes); + + Util.log("Writing files to version dir"); + var sectionNames = Object.keys(sections); + + Util.log("Writing index.js file for version " + version); + Fs.writeFileSync(Path.join(dir, "index.js"), + IndexTpl + .replace("<%name%>", defines.constants.name) + .replace("<%description%>", defines.constants.description) + .replace("<%scripts%>", "\"" + sectionNames.join("\", \"") + "\""), + "utf8"); + + Object.keys(sections).forEach(function(section) { + var def = sections[section]; + Util.log("Writing '" + section + ".js' file for version " + version); + Fs.writeFileSync(Path.join(dir, section + ".js"), SectionTpl + .replace(/<%sectionName%>/g, section) + .replace("<%sectionBody%>", def.join("\n")), + "utf8" + ); + + // When we don't need to generate tests, bail out here. + if (!tests) + return; + + def = testSections[section]; + // test if previous tests already contained implementations by checking + // if the difference in character count between the current test file + // and the newly generated one is more than twenty characters. + var body = TestSectionTpl + .replace("<%version%>", version.replace("v", "")) + .replace(/<%sectionName%>/g, section) + .replace("<%testBody%>", def.join("\n\n")); + var path = Path.join(dir, section + "Test.js"); + if (Fs.existsSync(path) && Math.abs(Fs.readFileSync(path, "utf8").length - body.length) >= 20) { + Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + + "that were already implemented. \nPlease be sure te check this file " + + "and move all implemented tests back into the newly generated test!", "error"); + Fs.renameSync(path, path + ".bak"); + } + + Util.log("Writing test file for " + section + ", version " + version); + Fs.writeFileSync(path, body, "utf8"); + }); + + versionDone(); } + }, function() {}); +}; - function prepareApi(struct, baseType) { - if (!baseType) - baseType = ""; +function getRequestOptions(url, method) { + var parsedUrl = Url.parse(url); + var protocol = parsedUrl.protocol.replace(/[:\/]+/, ""); + return { + options: { + hostname: parsedUrl.hostname, + method: method || "GET", + path: parsedUrl.pathname, + port: parsedUrl.port || protocol == "https" ? 443 : 80 + }, + protocol: protocol + }; +} - Object.keys(struct).forEach(function(routePart) { - var block = struct[routePart]; - if (!block) - return; - var messageType = baseType + "/" + routePart; - if (block.url && block.params) { - // we ended up at an API definition part! - var parts = messageType.split("/"); - var section = Util.toCamelCase(parts[1].toLowerCase()); - if (!block.method) { - throw new Error("No HTTP method specified for " + messageType + - "in section " + section); - } +function pingDocumentationUrl(url, callback) { + if (!url) { + callback(false); + return; + } - parts.splice(0, 2); - var funcName = Util.toCamelCase(parts.join("-")); - var comment = createComment(block.params, section, funcName, " "); + var options = getRequestOptions(url, "HEAD"); - // add the handler to the sections - if (!sections[section]) - sections[section] = []; + function callCallback(result) { + if (!callback) + return; + var cb = callback; + callback = undefined; + cb(result); + } - var afterRequest = ""; - if (headers && headers.length) { - afterRequest = AfterRequestTpl.replace("<%headers%>", "\"" + - headers.join("\", \"") + "\""); - } - sections[section].push(HandlerTpl - .replace("<%funcName%>", funcName) - .replace("<%comment%>", comment) - .replace("<%afterRequest%>", afterRequest) - ); - - // add test to the testSections - if (!testSections[section]) - testSections[section] = []; - testSections[section].push(TestHandlerTpl - .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") - .replace("<%funcName%>", section + "." + funcName) - .replace("<%params%>", getParams(block.params, " ")) - ); - } - else { - // recurse into this block next: - prepareApi(block, messageType); - } - }); + var req = require(options.protocol).request(options.options, function(res) { + if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { + callCallback(false); + } else { + callCallback(true); } + }); + req.on("error", function(err) { + callCallback(false); + }); + req.end(); +} - Util.log("Converting routes to functions"); - prepareApi(routes); - - Util.log("Writing files to version dir"); - var sectionNames = Object.keys(sections); - - Util.log("Writing index.js file for version " + version); - Fs.writeFileSync(Path.join(dir, "index.js"), - IndexTpl - .replace("<%name%>", defines.constants.name) - .replace("<%description%>", defines.constants.description) - .replace("<%scripts%>", "\"" + sectionNames.join("\", \"") + "\""), - "utf8"); - - Object.keys(sections).forEach(function(section) { - var def = sections[section]; - Util.log("Writing '" + section + ".js' file for version " + version); - Fs.writeFileSync(Path.join(dir, section + ".js"), SectionTpl - .replace(/<%sectionName%>/g, section) - .replace("<%sectionBody%>", def.join("\n")), - "utf8" - ); - - // When we don't need to generate tests, bail out here. - if (!tests) - return; +function searchSectionUrl(url, needle) { + var doc = sectionDocCache[url]; + if (!doc) + return null; + + var idx = doc.indexOf(needle); + var userIdx = needle.indexOf(":user"); + // GH uses ':owner' to identify the :user param for clearer documentation, + // so we attempt to substitute that here to search for instead. + if (idx == -1 && userIdx != -1) { + needle = needle.substr(0, userIdx) + ":owner" + needle.substr(userIdx + 5); + idx = doc.indexOf(needle); + } - def = testSections[section]; - // test if previous tests already contained implementations by checking - // if the difference in character count between the current test file - // and the newly generated one is more than twenty characters. - var body = TestSectionTpl - .replace("<%version%>", version.replace("v", "")) - .replace(/<%sectionName%>/g, section) - .replace("<%testBody%>", def.join("\n\n")); - var path = Path.join(dir, section + "Test.js"); - if (Fs.existsSync(path) && Math.abs(Fs.readFileSync(path, "utf8").length - body.length) >= 20) { - Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + - "that were already implemented. \nPlease be sure te check this file " + - "and move all implemented tests back into the newly generated test!", "error"); - Fs.renameSync(path, path + ".bak"); - } + // We tried. + if (idx == -1) + return null; + + var subDoc = doc.substr(0, idx); + // Search for the first header with an ID attribute. + var headerIdx = -1; + for (var i = 2; i >= 1 && headerIdx == -1; --i) { + headerIdx = subDoc.lastIndexOf("]*)/); + if (!id || !id.length) + return null; + + return url + "#" + id[1]; +} + +var sectionDocCache = {}; - Util.log("Writing test file for " + section + ", version " + version); - Fs.writeFileSync(path, body, "utf8"); +function getSectionDocument(url, callback) { + // First try to fetch the section document from cache. + if (sectionDocCache[url]) { + callCallback(null, sectionDocCache[url]); + return; + } + + var options = getRequestOptions(url); + + function callCallback(err, result) { + if (callback) { + var cb = callback; + callback = undefined; + cb(err, result); + } + } + + Util.log("Fetching documentation section '" + url + "'"); + var req = require(options.protocol).request(options.options, function(res) { + res.setEncoding("utf8"); + var data = ""; + res.on("data", function(chunk) { + data += chunk; + }); + res.on("error", function(err) { + callCallback(err); + }); + res.on("end", function() { + if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { + callCallback(data, res.statusCode); + } else { + sectionDocCache[url] = data; + callCallback(null, data); + } }); }); -}; + req.on("error", function(e) { + callCallback(e.message); + }); + req.on("timeout", function() { + callCallback("Gateway timed out for '" + url + "'"); + }); + req.end(); +} if (!module.parent) { var argv = Optimist @@ -259,13 +441,7 @@ if (!module.parent) { var path = Path.join(baseDir, version, "routes.json"); if (!Fs.existsSync(path)) return; - var routes; - try { - routes = JSON.parse(Fs.readFileSync(path, "utf8")); - } - catch (ex) { - return; - } + var routes = JSON.parse(Fs.readFileSync(path, "utf8")); if (!routes.defines) return; availVersions[version] = routes; diff --git a/package.json b/package.json index cd1cad99b0..5e17b19d1d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "mime": "^1.2.11" }, "devDependencies": { + "async": "^0.9.0", "oauth": "~0.9.7", "optimist": "~0.6.0", "mocha": "~1.13.0" From 5f0eb97b71f73550d11a97f4dbd8df43fb64c186 Mon Sep 17 00:00:00 2001 From: "Tanjo, Hiroyuki" Date: Thu, 14 May 2015 18:08:04 +0900 Subject: [PATCH 037/461] Correct default option of repos#getFromUser --- api/v3.0.0/repos.js | 2 +- api/v3.0.0/routes.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 6efa54233a..37da30f06c 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -79,7 +79,7 @@ var repos = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - user (String): Required. - * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. + * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `owner`. Validation rule: ` ^(all|owner|member)$ `. * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..4fdaf1854b 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1916,8 +1916,8 @@ "type": "String", "required": false, "validation": "^(all|owner|member)$", - "invalidmsg": "Possible values: `all`, `owner`, `member`. Default: `public`.", - "description": "Possible values: `all`, `owner`, `member`. Default: `public`." + "invalidmsg": "Possible values: `all`, `owner`, `member`. Default: `owner`.", + "description": "Possible values: `all`, `owner`, `member`. Default: `owner`." }, "sort": { "type": "String", From 96d6590431b0c1c66692203d37e20884c11fb07d Mon Sep 17 00:00:00 2001 From: smikes Date: Wed, 20 May 2015 14:38:14 -0600 Subject: [PATCH 038/461] add spdx license string --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5e17b19d1d..ec46d02972 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "scripts": { "test": "node ./test/all.js" }, + "license": "MIT", "licenses": [{ "type": "The MIT License", "url": "http://www.opensource.org/licenses/mit-license.php" From 4ff6c86e25d72d44ccf09c45326a9fa1e5530fb5 Mon Sep 17 00:00:00 2001 From: gero3 Date: Tue, 9 Jun 2015 06:02:59 +0000 Subject: [PATCH 039/461] Add promise support --- index.js | 20 +++++++++++++- package.json | 75 +++++++++++++++++++++++++++++----------------------- promise.js | 48 +++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 34 deletions(-) create mode 100644 promise.js diff --git a/index.js b/index.js index 0c062efcf8..b3ee6b7f67 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ var fs = require("fs"); var mime = require("mime"); var Util = require("./util"); var Url = require("url"); +var Promise = require("./promise"); /** section: github * class Client @@ -362,8 +363,25 @@ var Client = module.exports = function(config) { // on error, there's no need to continue. return; } + if (!callback){ + var promise = new Promise(function(resolve,reject){ + var cb = function(err, obj){ + if (err){ + reject(err); + } else { + resolve(obj); + } + }; + api[section][funcName].call(api, msg, block, cb); + }); + + } else { + api[section][funcName].call(api, msg, block, callback); + } - api[section][funcName].call(api, msg, block, callback); + + + return promise; }; } else { diff --git a/package.json b/package.json index ec46d02972..f8cbd04f04 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,45 @@ { - "name" : "github", - "version" : "0.2.4", - "description" : "NodeJS wrapper for the GitHub API", - "author": "Mike de Boer ", - "contributors": [ - { "name": "Mike de Boer", "email": "info@mikedeboer.nl" }, - { "name": "Fabian Jakobs", "email": "fabian@c9.io" } - ], - "homepage": "http://github.com/mikedeboer/node-github", - "repository" : { - "type" : "git", - "url" : "http://github.com/mikedeboer/node-github.git" + "name": "github", + "version": "0.2.4", + "description": "NodeJS wrapper for the GitHub API", + "author": "Mike de Boer ", + "contributors": [ + { + "name": "Mike de Boer", + "email": "info@mikedeboer.nl" }, - "engine" : { - "node": ">=0.4.0" - }, - "dependencies": { - "mime": "^1.2.11" - }, - "devDependencies": { - "async": "^0.9.0", - "oauth": "~0.9.7", - "optimist": "~0.6.0", - "mocha": "~1.13.0" - }, - "main" : ".", - "scripts": { - "test": "node ./test/all.js" - }, - "license": "MIT", - "licenses": [{ - "type": "The MIT License", - "url": "http://www.opensource.org/licenses/mit-license.php" - }] + { + "name": "Fabian Jakobs", + "email": "fabian@c9.io" + } + ], + "homepage": "http://github.com/mikedeboer/node-github", + "repository": { + "type": "git", + "url": "http://github.com/mikedeboer/node-github.git" + }, + "engine": { + "node": ">=0.4.0" + }, + "dependencies": { + "es6-promise": "^2.2.0", + "mime": "^1.2.11" + }, + "devDependencies": { + "async": "^0.9.0", + "oauth": "~0.9.7", + "optimist": "~0.6.0", + "mocha": "~1.13.0" + }, + "main": ".", + "scripts": { + "test": "node ./test/all.js" + }, + "license": "MIT", + "licenses": [ + { + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ] } diff --git a/promise.js b/promise.js new file mode 100644 index 0000000000..75fdfd7318 --- /dev/null +++ b/promise.js @@ -0,0 +1,48 @@ +/*jslint browser: true, node: true, maxlen: 128 */ +/*global self */ + +"use strict"; + +var globalObject, hasPromiseSupport; + +function isFunction(x) { + return typeof x === "function"; +} + +// Seek the global object +if (global !== undefined) { + globalObject = global; +} else if (window !== undefined && window.document) { + globalObject = window; +} else { + globalObject = self; +} + +hasPromiseSupport = + + globalObject.hasOwnProperty("Promise") && + + // Some of these methods are missing from + // Firefox/Chrome experimental implementations + globalObject.Promise.hasOwnProperty("resolve") && + globalObject.Promise.hasOwnProperty("reject") && + globalObject.Promise.hasOwnProperty("all") && + globalObject.Promise.hasOwnProperty("race") && + + // Older version of the spec had a resolver object + // as the arg rather than a function + (function () { + /*jslint unparam: true */ + var resolve, p; + p = new globalObject.Promise(function (r) { resolve = r; }); + return isFunction(resolve); + }()); + +// Export the native Promise implementation if it looks like it matches +// the specificiation. Otherwise, return the es6-promise implementation +// by @jaffathecake. +if (hasPromiseSupport) { + module.exports = globalObject.Promise; +} else { + module.exports = require("es6-promise").Promise; +} \ No newline at end of file From 49fa0988c480161854a0f7bbdcfac01f2e84f13e Mon Sep 17 00:00:00 2001 From: James Talmage Date: Tue, 30 Jun 2015 03:52:38 -0400 Subject: [PATCH 040/461] simplify promise support this simplifies the initial implementation of Promise support by @gero3, and allows for pluggable promise implementations. If a global `Promise` function exists, it will use that. Optionally, users can supply a promise implentation via `config.Promise`. this keeps the dependency list small, and gives people the freedom to choose their favorite Promise library. --- index.js | 29 ++++++++++---------- package.json | 75 +++++++++++++++++++++++----------------------------- promise.js | 53 ++++++++----------------------------- 3 files changed, 59 insertions(+), 98 deletions(-) diff --git a/index.js b/index.js index b3ee6b7f67..af03b46259 100644 --- a/index.js +++ b/index.js @@ -179,6 +179,7 @@ var Client = module.exports = function(config) { config.headers = config.headers || {}; this.config = config; this.debug = Util.isTrue(config.debug); + this.Promise = config.Promise || config.promise || Promise; this.version = config.version; var cls = require("./api/v" + this.version); @@ -364,24 +365,24 @@ var Client = module.exports = function(config) { return; } if (!callback){ - var promise = new Promise(function(resolve,reject){ - var cb = function(err, obj){ - if (err){ - reject(err); - } else { - resolve(obj); - } - }; - api[section][funcName].call(api, msg, block, cb); - }); - + if (self.Promise) { + return new self.Promise(function(resolve,reject){ + var cb = function(err, obj){ + if (err){ + reject(err); + } else { + resolve(obj); + } + }; + api[section][funcName].call(api, msg, block, cb); + }); + } else { + throw new Error('neither a callback or global promise implementation was provided'); + } } else { api[section][funcName].call(api, msg, block, callback); } - - - return promise; }; } else { diff --git a/package.json b/package.json index f8cbd04f04..ec46d02972 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,36 @@ { - "name": "github", - "version": "0.2.4", - "description": "NodeJS wrapper for the GitHub API", - "author": "Mike de Boer ", - "contributors": [ - { - "name": "Mike de Boer", - "email": "info@mikedeboer.nl" + "name" : "github", + "version" : "0.2.4", + "description" : "NodeJS wrapper for the GitHub API", + "author": "Mike de Boer ", + "contributors": [ + { "name": "Mike de Boer", "email": "info@mikedeboer.nl" }, + { "name": "Fabian Jakobs", "email": "fabian@c9.io" } + ], + "homepage": "http://github.com/mikedeboer/node-github", + "repository" : { + "type" : "git", + "url" : "http://github.com/mikedeboer/node-github.git" }, - { - "name": "Fabian Jakobs", - "email": "fabian@c9.io" - } - ], - "homepage": "http://github.com/mikedeboer/node-github", - "repository": { - "type": "git", - "url": "http://github.com/mikedeboer/node-github.git" - }, - "engine": { - "node": ">=0.4.0" - }, - "dependencies": { - "es6-promise": "^2.2.0", - "mime": "^1.2.11" - }, - "devDependencies": { - "async": "^0.9.0", - "oauth": "~0.9.7", - "optimist": "~0.6.0", - "mocha": "~1.13.0" - }, - "main": ".", - "scripts": { - "test": "node ./test/all.js" - }, - "license": "MIT", - "licenses": [ - { - "type": "The MIT License", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ] + "engine" : { + "node": ">=0.4.0" + }, + "dependencies": { + "mime": "^1.2.11" + }, + "devDependencies": { + "async": "^0.9.0", + "oauth": "~0.9.7", + "optimist": "~0.6.0", + "mocha": "~1.13.0" + }, + "main" : ".", + "scripts": { + "test": "node ./test/all.js" + }, + "license": "MIT", + "licenses": [{ + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + }] } diff --git a/promise.js b/promise.js index 75fdfd7318..cd0dc60ad7 100644 --- a/promise.js +++ b/promise.js @@ -1,48 +1,17 @@ -/*jslint browser: true, node: true, maxlen: 128 */ -/*global self */ - "use strict"; -var globalObject, hasPromiseSupport; - -function isFunction(x) { - return typeof x === "function"; -} +var Promise = global.Promise || null; -// Seek the global object -if (global !== undefined) { - globalObject = global; -} else if (window !== undefined && window.document) { - globalObject = window; -} else { - globalObject = self; +if (isFunction(Promise)) { + new Promise(function(resolver) { + if (!isFunction(resolver)) { + Promise = null; + } + }); } -hasPromiseSupport = - - globalObject.hasOwnProperty("Promise") && +module.exports = Promise; - // Some of these methods are missing from - // Firefox/Chrome experimental implementations - globalObject.Promise.hasOwnProperty("resolve") && - globalObject.Promise.hasOwnProperty("reject") && - globalObject.Promise.hasOwnProperty("all") && - globalObject.Promise.hasOwnProperty("race") && - - // Older version of the spec had a resolver object - // as the arg rather than a function - (function () { - /*jslint unparam: true */ - var resolve, p; - p = new globalObject.Promise(function (r) { resolve = r; }); - return isFunction(resolve); - }()); - -// Export the native Promise implementation if it looks like it matches -// the specificiation. Otherwise, return the es6-promise implementation -// by @jaffathecake. -if (hasPromiseSupport) { - module.exports = globalObject.Promise; -} else { - module.exports = require("es6-promise").Promise; -} \ No newline at end of file +function isFunction(x) { + return typeof x === "function"; +} From c4874d964d7575d18db69ee4f8dfb1e041467f44 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Thu, 2 Jul 2015 18:50:57 +0200 Subject: [PATCH 041/461] Added CA config to allow SSL communication with self signed/some corporate certificates --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0c062efcf8..1c25e0605c 100644 --- a/index.js +++ b/index.js @@ -671,6 +671,7 @@ var Client = module.exports = function(config) { var host = block.host || this.config.host || this.constants.host; var port = this.config.port || this.constants.port || (protocol == "https" ? 443 : 80); var proxyUrl; + var ca = this.config.ca; if (this.config.proxy !== undefined) { proxyUrl = this.config.proxy; } else { @@ -765,7 +766,8 @@ var Client = module.exports = function(config) { port: port, path: path, method: method, - headers: headers + headers: headers, + ca: ca }; if (this.config.rejectUnauthorized !== undefined) From 96eb760b5be3316bc587f9249bfccdbc8ad8f6b4 Mon Sep 17 00:00:00 2001 From: Steve Mao Date: Wed, 8 Jul 2015 11:55:41 +1000 Subject: [PATCH 042/461] Update "Create a new authorization" link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 378fdd4386..8116a1cdf7 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ github.authenticate({ ``` ### Creating tokens for your application -[Create a new authorization](http://developer.github.com/v3/oauth/#create-a-new-authorization) for your application giving it access to the wanted scopes you need instead of relying on username / password and is the way to go if you have [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) on. +[Create a new authorization](https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization) for your application giving it access to the wanted scopes you need instead of relying on username / password and is the way to go if you have [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) on. For example: From 7fd2ec0047fedafda59a7cabb163f8a7de18103c Mon Sep 17 00:00:00 2001 From: Steve Mao Date: Wed, 8 Jul 2015 15:11:42 +1000 Subject: [PATCH 043/461] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 378fdd4386..7563be9a09 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ github.authenticate({ token: token }); -// OAuth2 Key/Secret +// OAuth2 Key/Secret (to get a token) github.authenticate({ type: "oauth", key: "clientID", From c2601f42c0ae0db5b49b15d1c8d28946be58e7f2 Mon Sep 17 00:00:00 2001 From: valmiRe Date: Wed, 5 Aug 2015 11:17:23 +0200 Subject: [PATCH 044/461] pull-request / update : title not required --- api/v3.0.0/routes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..674e6b25ee 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1738,7 +1738,7 @@ "$state": null, "title": { "type": "String", - "required": true, + "required": false, "validation": "", "invalidmsg": "", "description": "" From 00ae16e8add40d80ffac9acc06ad017de32fa107 Mon Sep 17 00:00:00 2001 From: dll Date: Fri, 21 Aug 2015 16:45:27 +0200 Subject: [PATCH 045/461] including addOrganizationMembership into the API --- api/v3.0.0/orgs.js | 134 +++++++++++++++++++++++++++-------------- api/v3.0.0/routes.json | 15 ++++- 2 files changed, 102 insertions(+), 47 deletions(-) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index de2e89f5ec..dee85dc73b 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -27,7 +27,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -74,7 +74,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * @@ -123,12 +123,12 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - billing_email (String): Optional. Billing email address. This address is not publicized. - * - company (String): Optional. + * - company (String): Optional. * - email (String): Optional. Publicly visible email address. - * - location (String): Optional. - * - name (String): Optional. + * - location (String): Optional. + * - name (String): Optional. * * https://developer.github.com/v3/orgs/#edit-an-organization **/ @@ -175,7 +175,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - filter (String): Optional. Validation rule: ` ^(all|2fa_disabled)$ `. @@ -223,8 +223,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. + * - org (String): Required. + * - user (String): Required. **/ this.getMember = function(msg, block, callback) { var self = this; @@ -269,8 +269,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. + * - org (String): Required. + * - user (String): Required. **/ this.removeMember = function(msg, block, callback) { var self = this; @@ -315,7 +315,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. **/ this.getPublicMembers = function(msg, block, callback) { var self = this; @@ -360,8 +360,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. + * - org (String): Required. + * - user (String): Required. **/ this.getPublicMember = function(msg, block, callback) { var self = this; @@ -406,8 +406,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. + * - org (String): Required. + * - user (String): Required. **/ this.publicizeMembership = function(msg, block, callback) { var self = this; @@ -452,8 +452,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. + * - org (String): Required. + * - user (String): Required. **/ this.concealMembership = function(msg, block, callback) { var self = this; @@ -498,7 +498,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -545,7 +545,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. **/ this.getTeam = function(msg, block, callback) { var self = this; @@ -590,8 +590,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. + * - org (String): Required. + * - name (String): Required. * - repo_names (Array): Optional. Array of strings * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. **/ @@ -638,8 +638,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - name (String): Required. + * - id (String): Required. + * - name (String): Required. * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. **/ this.updateTeam = function(msg, block, callback) { @@ -685,7 +685,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. **/ this.deleteTeam = function(msg, block, callback) { var self = this; @@ -730,7 +730,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -777,8 +777,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. + * - id (String): Required. + * - user (String): Required. **/ this.getTeamMember = function(msg, block, callback) { var self = this; @@ -823,8 +823,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. + * - id (String): Required. + * - user (String): Required. **/ this.addTeamMember = function(msg, block, callback) { var self = this; @@ -869,8 +869,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. + * - id (String): Required. + * - user (String): Required. **/ this.deleteTeamMember = function(msg, block, callback) { var self = this; @@ -907,6 +907,52 @@ var orgs = module.exports = { }); }; + /** section: github + * orgs#addOrganizationMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): organization to invite the user to - Required. + * - user (String): username to be invited - Required. + **/ + this.addOrganizationMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + /** section: github * orgs#addTeamMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. @@ -915,8 +961,8 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. + * - id (String): Required. + * - user (String): Required. **/ this.addTeamMembership = function(msg, block, callback) { var self = this; @@ -961,7 +1007,7 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -1008,9 +1054,9 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getTeamRepo = function(msg, block, callback) { var self = this; @@ -1055,9 +1101,9 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.addTeamRepo = function(msg, block, callback) { var self = this; @@ -1102,9 +1148,9 @@ var orgs = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.deleteTeamRepo = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..09a48e6a54 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1416,6 +1416,15 @@ } }, + "add-organization-membership": { + "url": "/orgs/:org/memberships/:user", + "method": "PUT", + "params": { + "$org": null, + "$user": null + } + }, + "publicize-membership": { "url": "/orgs/:org/public_members/:user", "method": "PUT", @@ -3101,12 +3110,12 @@ "type": "Number", "required": false, "validation": "", - "description": "The integer ID of the last User that you’ve seen." + "description": "The integer ID of the last User that you’ve seen." } } - + }, - + "get-from": { "url": "/users/:user", "method": "GET", From d11c575df67a226837e147aca13279eddc070015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Campitelli?= Date: Thu, 27 Aug 2015 23:10:21 -0300 Subject: [PATCH 046/461] New method: getLatestRelease --- api/v3.0.0/releases.js | 48 ++++++++++++++++++++++++++++++++++++++ api/v3.0.0/releasesTest.js | 13 +++++++++++ api/v3.0.0/routes.json | 14 +++++++++++ 3 files changed, 75 insertions(+) diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 9e94c634f1..5bb60a4e1e 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -118,6 +118,54 @@ var releases = module.exports = { }); }; + /** section: github + * releases#getLatestRelease(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - repo (String): Required. + * + * https://developer.github.com/v3/repos/releases/#get-the-latest-release + **/ + this.getLatestRelease = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + /** section: github * releases#createRelease(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/releasesTest.js b/api/v3.0.0/releasesTest.js index 9b7e44e1f1..b2fc2fefe7 100644 --- a/api/v3.0.0/releasesTest.js +++ b/api/v3.0.0/releasesTest.js @@ -76,6 +76,19 @@ describe("[releases]", function() { ); }); + it("should successfully execute GET /repos/:owner/:repo/releases/latest (getLatestRelease)", function(next) { + client.releases.getLatestRelease( + { + owner: owner, + repo: repo + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + }); + it("should successfully execute POST /repos/:owner/:repo/releases (createRelease)", function(next) { if (!haveWriteAccess) { next(); diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..a58240a261 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3484,6 +3484,20 @@ "$repo": null } }, + "get-latest-release": { + "url": "/repos/:owner/:repo/releases/latest", + "method": "GET", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + }, "create-release": { "url": "/repos/:owner/:repo/releases", "method": "POST", From c10adefd22eec1f8b2e7461965169742d833741a Mon Sep 17 00:00:00 2001 From: George Chung Date: Fri, 28 Aug 2015 16:02:40 +0800 Subject: [PATCH 047/461] fix client.getPage cannot keep custom headers. --- index.js | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 0c062efcf8..0b8fd3f2c9 100644 --- a/index.js +++ b/index.js @@ -489,19 +489,25 @@ var Client = module.exports = function(config) { return getPageLinks(link).first; }; - function getPage(link, which, callback) { + function getPage(link, which, headers, callback) { var url = getPageLinks(link)[which]; if (!url) return callback(new error.NotFound("No " + which + " page found")); var api = this[this.version]; var parsedUrl = Url.parse(url, true); + + var msg = Object.create(parsedUrl.query); + if (headers != null) + msg.headers = headers; + var block = { url: parsedUrl.pathname, method: "GET", params: parsedUrl.query }; - this.httpSend(parsedUrl.query, block, function(err, res) { + + this.httpSend(msg, block, function(err, res) { if (err) return api.sendError(err, null, parsedUrl.query, callback); @@ -537,45 +543,65 @@ var Client = module.exports = function(config) { /** * Client#getNextPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the next page, based on the contents of the `Link` header **/ - this.getNextPage = function(link, callback) { - getPage.call(this, link, "next", callback); + this.getNextPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + getPage.call(this, link, "next", headers, callback); }; /** * Client#getPreviousPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the previous page, based on the contents of the `Link` header **/ - this.getPreviousPage = function(link, callback) { - getPage.call(this, link, "prev", callback); + this.getPreviousPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + getPage.call(this, link, "prev", headers, callback); }; /** * Client#getLastPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the last page, based on the contents of the `Link` header **/ - this.getLastPage = function(link, callback) { - getPage.call(this, link, "last", callback); + this.getLastPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + getPage.call(this, link, "last", headers, callback); }; /** * Client#getFirstPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the first page, based on the contents of the `Link` header **/ - this.getFirstPage = function(link, callback) { - getPage.call(this, link, "first", callback); + this.getFirstPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + getPage.call(this, link, "first", headers, callback); }; function getRequestFormat(hasBody, block) { From fe38426a5ca4c13bc8beec729fba9200a2798c64 Mon Sep 17 00:00:00 2001 From: Brian LaMattina Date: Wed, 30 Sep 2015 15:41:40 -0400 Subject: [PATCH 048/461] correct documentation for pullRequests#createComment --- api/v3.0.0/pullRequests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 96af44685c..96f13f53e4 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -591,7 +591,7 @@ var pullRequests = module.exports = { * - body (String): Required. * - commit_id (String): Required. Sha of the commit to comment on. * - path (String): Required. Relative path of the file to comment on. - * - position (Number): Required. Column index in the diff to comment on. + * - position (Number): Required. Line index in the diff to comment on. **/ this.createComment = function(msg, block, callback) { var self = this; From f7618ed0463b02f4bfa81ff619d7c2459aac9508 Mon Sep 17 00:00:00 2001 From: dll Date: Fri, 2 Oct 2015 16:42:16 +0200 Subject: [PATCH 049/461] adding support for removing org membership --- api/v3.0.0/orgs.js | 46 ++++++++++++++++++++++++++++++++++++++++++ api/v3.0.0/routes.json | 9 +++++++++ 2 files changed, 55 insertions(+) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index dee85dc73b..22fa7abaf9 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -953,6 +953,52 @@ var orgs = module.exports = { }); }; + /** section: github + * orgs#removeOrganizationMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): organization to remove the user from - Required. + * - user (String): username to be removed - Required. + **/ + this.removeOrganizationMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + /** section: github * orgs#addTeamMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 09a48e6a54..98a6663b65 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1425,6 +1425,15 @@ } }, + "remove-organization-membership": { + "url": "/orgs/:org/memberships/:user", + "method": "DELETE", + "params": { + "$org": null, + "$user": null + } + }, + "publicize-membership": { "url": "/orgs/:org/public_members/:user", "method": "PUT", From 552a4a3e5c7fd629074194eb87114d0e91234fa1 Mon Sep 17 00:00:00 2001 From: James Talmage Date: Wed, 7 Oct 2015 19:36:53 -0400 Subject: [PATCH 050/461] use follow-redirects --- index.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0c062efcf8..192734d50d 100644 --- a/index.js +++ b/index.js @@ -775,7 +775,7 @@ var Client = module.exports = function(config) { console.log("REQUEST: ", options); function httpSendRequest() { - var req = require(protocol).request(options, function(res) { + var req = require('follow-redirects/' + protocol).request(options, function(res) { if (self.debug) { console.log("STATUS: " + res.statusCode); console.log("HEADERS: " + JSON.stringify(res.headers)); diff --git a/package.json b/package.json index ec46d02972..ac02544e0e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "node": ">=0.4.0" }, "dependencies": { + "follow-redirects": "0.0.7", "mime": "^1.2.11" }, "devDependencies": { From 33aa21425e28f9c75514b21f934b203e214d020d Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Thu, 3 Dec 2015 12:01:54 -0700 Subject: [PATCH 051/461] add get-team-membership --- api/v3.0.0/routes.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..08ce818e99 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1533,6 +1533,15 @@ } }, + "get-team-membership": { + "url": "/teams/:id/memberships/:user", + "method": "GET", + "params": { + "$id": null, + "$user": null + } + }, + "get-team-repos": { "url": "/teams/:id/repos", "method": "GET", From fc375df60650a16669031a59263b68f324ca9271 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Thu, 3 Dec 2015 12:21:51 -0700 Subject: [PATCH 052/461] adding generated function --- api/v3.0.0/orgs.js | 50 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index de2e89f5ec..1e525bff8a 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -77,8 +77,6 @@ var orgs = module.exports = { * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/orgs/#get-an-organization **/ this.get = function(msg, block, callback) { var self = this; @@ -129,8 +127,6 @@ var orgs = module.exports = { * - email (String): Optional. Publicly visible email address. * - location (String): Optional. * - name (String): Optional. - * - * https://developer.github.com/v3/orgs/#edit-an-organization **/ this.update = function(msg, block, callback) { var self = this; @@ -953,6 +949,52 @@ var orgs = module.exports = { }); }; + /** section: github + * orgs#getTeamMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.getTeamMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + /** section: github * orgs#getTeamRepos(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. From c5c8e84f766cf71a0fcf0ad26f0ae49e3f67b2c8 Mon Sep 17 00:00:00 2001 From: Joseph W Becher Date: Mon, 7 Dec 2015 23:51:41 -0500 Subject: [PATCH 053/461] Added provate, forks, sources to get-by-org get-from-org was lacking sources and forks as documented at https://developer.github.com/v3/repos/#list-organization-repositories I need this for my app, thank very much for the lib! --- api/v3.0.0/routes.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index dc9b2165fe..8e6998cb84 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1940,9 +1940,9 @@ "type": { "type": "String", "required": false, - "validation": "^(all|public|member)$", - "invalidmsg": "Possible values: `all`, `public`, `member`. Default: `all`.", - "description": "Possible values: `all`, `public`, `member`. Default: `all`." + "validation": "^(all|public|private|forks|sources|member)$", + "invalidmsg": "Possible values: `all`, `public`, `private`, `forks`, `member`. Default: `all`.", + "description": "Possible values: `all`, `public`, `private`, `forks`, `member`. Default: `all`." }, "$page": null, "$per_page": null From c5f1ff347bdf313d30249e73b0b009cd1ef4ccb7 Mon Sep 17 00:00:00 2001 From: Stefan Walther Date: Mon, 14 Dec 2015 12:21:48 +0100 Subject: [PATCH 054/461] Ignore Webstorm project --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7f913291a6..18ffc8d0bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.idea 0.0.1.seed node_modules .settings.xml From e7f8a0945e693bd28db426b1e42c281902ef9c54 Mon Sep 17 00:00:00 2001 From: Stefan Walther Date: Tue, 15 Dec 2015 22:04:14 +0100 Subject: [PATCH 055/461] Fix callbacks not being a function --- api/v3.0.0/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3.0.0/index.js b/api/v3.0.0/index.js index 5ce2480f28..30b301825e 100644 --- a/api/v3.0.0/index.js +++ b/api/v3.0.0/index.js @@ -28,7 +28,7 @@ var proto = { Util.log(err, block, msg.user, "error"); if (typeof err == "string") err = new error.InternalServerError(err); - if (callback) + if (callback && typeof(callback) === "function") callback(err); } }; From 96b9da36ebad9014e7207664cc5d7fd9daaf8d0d Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sat, 19 Dec 2015 23:17:06 -0500 Subject: [PATCH 056/461] update package.json to publish as github4 --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ec46d02972..3be405be43 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,17 @@ { - "name" : "github", + "name" : "github4", "version" : "0.2.4", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ { "name": "Mike de Boer", "email": "info@mikedeboer.nl" }, - { "name": "Fabian Jakobs", "email": "fabian@c9.io" } + { "name": "Fabian Jakobs", "email": "fabian@c9.io" }, + { "name": "Joe Gallo", "email": "joe@brassafrax.com" } ], - "homepage": "http://github.com/mikedeboer/node-github", + "homepage": "https://github.com/kaizensoze/node-github", "repository" : { "type" : "git", - "url" : "http://github.com/mikedeboer/node-github.git" + "url" : "https://github.com/kaizensoze/node-github.git" }, "engine" : { "node": ">=0.4.0" From f8701084365f0330c5e5fb559cf89b4ad6787bca Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 00:33:31 -0500 Subject: [PATCH 057/461] update gitignore --- .gitignore | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7f913291a6..352d0b41aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,16 @@ -.DS_Store -0.0.1.seed node_modules + +logs +*.log +npm-debug.log* + +0.0.1.seed + .settings.xml .settings + .c9revisions -/nbproject/private/ \ No newline at end of file + +/nbproject/private/ + +.DS_Store From 0d096eb1d6e0c134f24dab00faa7abe1a81401f9 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 01:08:27 -0500 Subject: [PATCH 058/461] update readme --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 378fdd4386..e9df038219 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,32 @@ -# JavaScript GitHub API for Node.JS +# Node-github -A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. +A Node.js wrapper for GitHub API. ## Installation - Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github.svg): + Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github4.svg): - $ npm install github + $ npm install github4 or Install via git clone: - $ git clone git://github.com/mikedeboer/node-github.git + $ git clone git@github.com:kaizensoze/node-github.git $ cd node-github $ npm install ## Documentation -You can find the docs for the API of this client at [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) +Client API: [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) -Additionally, the [official Github documentation](https://developer.github.com/v3/) -is a very useful resource. +GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) ## Example Print all followers of the user "mikedeboer" to the console. ```javascript -var GitHubApi = require("github"); +var GitHubApi = require("github4"); var github = new GitHubApi({ // required @@ -47,7 +46,7 @@ github.user.getFollowingFromUser({ // headers: { // "cookie": "blahblah" // }, - user: "mikedeboer" + user: "kaizensoze" }, function(err, res) { console.log(JSON.stringify(res)); }); From 961456b0ae741161eff7792c224668be346774cb Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 01:10:40 -0500 Subject: [PATCH 059/461] bump patch number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3be405be43..e854e8f624 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github4", - "version" : "0.2.4", + "version" : "0.2.5", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ From 60b3d1ea9aecf32859a8b3b631eeb06ea238ea79 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 01:28:57 -0500 Subject: [PATCH 060/461] update github page url --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9df038219..7b91621d9d 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ or ## Documentation -Client API: [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) +Client API: [https://kaizensoze.github.io/node-github/](https://kaizensoze.github.io/node-github/) GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) ## Example -Print all followers of the user "mikedeboer" to the console. +Print all followers of the user "kaizensoze" to the console. ```javascript var GitHubApi = require("github4"); From 7272238c35dbeb4c278ee4f929b62b62ed6d8065 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 02:52:19 -0500 Subject: [PATCH 061/461] remove defunct 2.0 folder --- api/v2.0.0/routes.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 api/v2.0.0/routes.json diff --git a/api/v2.0.0/routes.json b/api/v2.0.0/routes.json deleted file mode 100644 index 49d1a202ff..0000000000 --- a/api/v2.0.0/routes.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} From d6cf50fc7c1f7504b85fccc6931e2491c1369434 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 03:29:29 -0500 Subject: [PATCH 062/461] bump patch number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e854e8f624..bb8deae34e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github4", - "version" : "0.2.5", + "version" : "0.2.6", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ From f92ce31391a17a7138d0bea845bec88b656db420 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 04:37:28 -0500 Subject: [PATCH 063/461] run generate remove trailing space after Required. in doc --- api/v3.0.0/authorization.js | 16 +- api/v3.0.0/events.js | 26 +-- api/v3.0.0/gists.js | 64 ++---- api/v3.0.0/gitdata.js | 94 ++++----- api/v3.0.0/gitignore.js | 4 +- api/v3.0.0/issues.js | 154 +++++++------- api/v3.0.0/markdown.js | 8 +- api/v3.0.0/orgs.js | 96 +++++---- api/v3.0.0/pullRequests.js | 130 +++++------- api/v3.0.0/releases.js | 82 +++----- api/v3.0.0/repos.js | 394 +++++++++++++++++------------------- api/v3.0.0/search.js | 18 +- api/v3.0.0/statuses.js | 20 +- api/v3.0.0/user.js | 40 ++-- generate.js | 4 +- 15 files changed, 510 insertions(+), 640 deletions(-) diff --git a/api/v3.0.0/authorization.js b/api/v3.0.0/authorization.js index 41ca7e0c3d..a7e7eac98f 100644 --- a/api/v3.0.0/authorization.js +++ b/api/v3.0.0/authorization.js @@ -29,8 +29,6 @@ var authorization = module.exports = { * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations **/ this.getAll = function(msg, block, callback) { var self = this; @@ -75,9 +73,7 @@ var authorization = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization + * - id (String): Required. **/ this.get = function(msg, block, callback) { var self = this; @@ -125,8 +121,6 @@ var authorization = module.exports = { * - scopes (Array): Optional. A list of scopes that this authorization is in. * - note (String): Optional. A note to remind you what the OAuth token is for. * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. - * - * https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization **/ this.create = function(msg, block, callback) { var self = this; @@ -171,14 +165,12 @@ var authorization = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. * - scopes (Array): Optional. A list of scopes that this authorization is in. * - add_scopes (Array): Optional. A list of scopes to add to this authorization. * - remove_scopes (Array): Optional. A list of scopes to remove from this authorization. * - note (String): Optional. A note to remind you what the OAuth token is for. * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. - * - * https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization **/ this.update = function(msg, block, callback) { var self = this; @@ -223,9 +215,7 @@ var authorization = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization + * - id (String): Required. **/ this.delete = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/events.js b/api/v3.0.0/events.js index f0dfbb1efe..456b68aa1b 100644 --- a/api/v3.0.0/events.js +++ b/api/v3.0.0/events.js @@ -73,8 +73,8 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -121,8 +121,8 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -169,8 +169,8 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -217,7 +217,7 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -264,7 +264,7 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -311,7 +311,7 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -358,7 +358,7 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -405,7 +405,7 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -452,8 +452,8 @@ var events = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - org (String): Required. + * - user (String): Required. + * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ diff --git a/api/v3.0.0/gists.js b/api/v3.0.0/gists.js index d3297ec64c..786bc8769b 100644 --- a/api/v3.0.0/gists.js +++ b/api/v3.0.0/gists.js @@ -30,8 +30,6 @@ var gists = module.exports = { * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - * https://developer.github.com/v3/gists/#list-gists **/ this.getAll = function(msg, block, callback) { var self = this; @@ -76,7 +74,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ @@ -125,10 +123,8 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - description (String): Optional. - * - public (Boolean): Required. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - * - * https://developer.github.com/v3/gists/#create-a-gist + * - public (Boolean): Required. + * - files (Json): Required.Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' **/ this.create = function(msg, block, callback) { var self = this; @@ -173,11 +169,9 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. * - description (String): Optional. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - * - * https://developer.github.com/v3/gists/#edit-a-gist + * - files (Json): Required.Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' **/ this.edit = function(msg, block, callback) { var self = this; @@ -223,8 +217,6 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - * https://developer.github.com/v3/gists/#list-gists **/ this.public = function(msg, block, callback) { var self = this; @@ -270,8 +262,6 @@ var gists = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - * https://developer.github.com/v3/gists/#list-gists **/ this.starred = function(msg, block, callback) { var self = this; @@ -316,9 +306,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#get-a-single-gist + * - id (String): Required. **/ this.get = function(msg, block, callback) { var self = this; @@ -363,9 +351,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#star-a-gist + * - id (String): Required. **/ this.star = function(msg, block, callback) { var self = this; @@ -410,9 +396,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#unstar-a-gist + * - id (String): Required. **/ this.deleteStar = function(msg, block, callback) { var self = this; @@ -457,9 +441,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#check-if-a-gist-is-starred + * - id (String): Required. **/ this.checkStar = function(msg, block, callback) { var self = this; @@ -504,9 +486,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#fork-a-gist + * - id (String): Required. **/ this.fork = function(msg, block, callback) { var self = this; @@ -551,9 +531,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - * https://developer.github.com/v3/gists/#unstar-a-gist + * - id (String): Required. **/ this.delete = function(msg, block, callback) { var self = this; @@ -598,7 +576,7 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. + * - gist_id (String): Required.Id (SHA1 hash) of the gist. **/ this.getComments = function(msg, block, callback) { var self = this; @@ -643,8 +621,8 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. + * - gist_id (String): Required.Id (SHA1 hash) of the gist. + * - id (String): Required. **/ this.getComment = function(msg, block, callback) { var self = this; @@ -689,8 +667,8 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - body (String): Required. + * - gist_id (String): Required.Id (SHA1 hash) of the gist. + * - body (String): Required. **/ this.createComment = function(msg, block, callback) { var self = this; @@ -735,9 +713,9 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. - * - body (String): Required. + * - gist_id (String): Required.Id (SHA1 hash) of the gist. + * - id (String): Required. + * - body (String): Required. **/ this.editComment = function(msg, block, callback) { var self = this; @@ -782,8 +760,8 @@ var gists = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. + * - gist_id (String): Required.Id (SHA1 hash) of the gist. + * - id (String): Required. **/ this.deleteComment = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/gitdata.js b/api/v3.0.0/gitdata.js index 584cc123b1..d4b5491703 100644 --- a/api/v3.0.0/gitdata.js +++ b/api/v3.0.0/gitdata.js @@ -27,9 +27,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -76,10 +76,10 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - content (String): Required. - * - encoding (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - content (String): Required. + * - encoding (String): Required. **/ this.createBlob = function(msg, block, callback) { var self = this; @@ -124,9 +124,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. **/ this.getCommit = function(msg, block, callback) { var self = this; @@ -171,11 +171,11 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - message (String): Required. String of the commit message - * - tree (String): Required. String of the SHA of the tree object this commit points to - * - parents (Array): Required. Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * - user (String): Required. + * - repo (String): Required. + * - message (String): Required.String of the commit message + * - tree (String): Required.String of the SHA of the tree object this commit points to + * - parents (Array): Required.Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. * - author (Json): Optional. * - committer (Json): Optional. **/ @@ -222,9 +222,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required.String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. **/ this.getReference = function(msg, block, callback) { var self = this; @@ -269,8 +269,8 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -317,10 +317,10 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required.String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. **/ this.createReference = function(msg, block, callback) { var self = this; @@ -365,10 +365,10 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required.String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. * - force (Boolean): Optional. Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. **/ this.updateReference = function(msg, block, callback) { @@ -414,9 +414,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required.String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. **/ this.deleteReference = function(msg, block, callback) { var self = this; @@ -461,9 +461,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. **/ this.getTag = function(msg, block, callback) { var self = this; @@ -508,13 +508,13 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tag (String): Required. String of the tag - * - message (String): Required. String of the tag message - * - object (String): Required. String of the SHA of the git object this is tagging - * - type (String): Required. String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. - * - tagger (Json): Required. JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * - user (String): Required. + * - repo (String): Required. + * - tag (String): Required.String of the tag + * - message (String): Required.String of the tag message + * - object (String): Required.String of the SHA of the git object this is tagging + * - type (String): Required.String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * - tagger (Json): Required.JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged **/ this.createTag = function(msg, block, callback) { var self = this; @@ -559,9 +559,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. * - recursive (Boolean): Optional. **/ this.getTree = function(msg, block, callback) { @@ -607,9 +607,9 @@ var gitdata = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tree (Json): Required. Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * - user (String): Required. + * - repo (String): Required. + * - tree (Json): Required.Array of Hash objects (of path, mode, type and sha) specifying a tree structure * - base_tree (String): Optional. String of the SHA1 of the tree you want to update with new data **/ this.createTree = function(msg, block, callback) { diff --git a/api/v3.0.0/gitignore.js b/api/v3.0.0/gitignore.js index ebc9bbc1a5..b489251055 100644 --- a/api/v3.0.0/gitignore.js +++ b/api/v3.0.0/gitignore.js @@ -28,8 +28,6 @@ var gitignore = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * No other params, simply pass an empty Object literal `{}` - * - * https://developer.github.com/v3/gitignore/#listing-available-templates **/ this.templates = function(msg, block, callback) { var self = this; @@ -74,7 +72,7 @@ var gitignore = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required. The name of the .gitignore template to get + * - name (String): Required.The name of the .gitignore template to get **/ this.template = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js index 66213e30d9..bdc53b0dc0 100644 --- a/api/v3.0.0/issues.js +++ b/api/v3.0.0/issues.js @@ -35,8 +35,6 @@ var issues = module.exports = { * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/issues/#list-issues **/ this.getAll = function(msg, block, callback) { var self = this; @@ -81,8 +79,8 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. @@ -94,8 +92,6 @@ var issues = module.exports = { * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/issues/#list-issues-for-a-repository **/ this.repoIssues = function(msg, block, callback) { var self = this; @@ -140,11 +136,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/issues/#get-a-single-issue + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.getRepoIssue = function(msg, block, callback) { var self = this; @@ -189,15 +183,13 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. * - body (String): Optional. * - assignee (String): Optional. Login for the user that this issue should be assigned to. * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. * - labels (Json): Optional. Array of strings - Labels to associate with this issue. - * - * https://developer.github.com/v3/issues/#create-an-issue **/ this.create = function(msg, block, callback) { var self = this; @@ -242,17 +234,15 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - title (String): Optional. * - body (String): Optional. * - assignee (String): Optional. Login for the user that this issue should be assigned to. * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. * - labels (Json): Optional. Array of strings - Labels to associate with this issue. * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. - * - * https://developer.github.com/v3/issues/#edit-an-issue **/ this.edit = function(msg, block, callback) { var self = this; @@ -297,8 +287,8 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - sort (String): Optional. Validation rule: ` ^(created|updated)$ `. * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ @@ -348,9 +338,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -397,9 +387,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getComment = function(msg, block, callback) { var self = this; @@ -444,10 +434,10 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. **/ this.createComment = function(msg, block, callback) { var self = this; @@ -492,10 +482,10 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. **/ this.editComment = function(msg, block, callback) { var self = this; @@ -540,9 +530,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.deleteComment = function(msg, block, callback) { var self = this; @@ -587,9 +577,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -636,8 +626,8 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -684,9 +674,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getEvent = function(msg, block, callback) { var self = this; @@ -731,8 +721,8 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -779,9 +769,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. **/ this.getLabel = function(msg, block, callback) { var self = this; @@ -826,10 +816,10 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. 6 character hex code, without a leading #. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required.6 character hex code, without a leading #. **/ this.createLabel = function(msg, block, callback) { var self = this; @@ -874,10 +864,10 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. 6 character hex code, without a leading #. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required.6 character hex code, without a leading #. **/ this.updateLabel = function(msg, block, callback) { var self = this; @@ -922,9 +912,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. **/ this.deleteLabel = function(msg, block, callback) { var self = this; @@ -969,9 +959,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.getIssueLabels = function(msg, block, callback) { var self = this; @@ -1016,8 +1006,8 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. * - sort (String): Optional. due_date, completeness, default: due_date Validation rule: ` ^(due_date|completeness)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. @@ -1066,9 +1056,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.getMilestone = function(msg, block, callback) { var self = this; @@ -1113,9 +1103,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. * - description (String): Optional. * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ @@ -1163,10 +1153,10 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - title (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - title (String): Required. * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. * - description (String): Optional. * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ @@ -1214,9 +1204,9 @@ var issues = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.deleteMilestone = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/markdown.js b/api/v3.0.0/markdown.js index 90d7271baf..9f7590d044 100644 --- a/api/v3.0.0/markdown.js +++ b/api/v3.0.0/markdown.js @@ -27,11 +27,9 @@ var markdown = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - text (String): Required. The Markdown text to render + * - text (String): Required.The Markdown text to render * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` - * - * https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document **/ this.render = function(msg, block, callback) { var self = this; @@ -76,9 +74,7 @@ var markdown = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - data (String): Required. Raw data to send as the body of the request - * - * https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode + * - data (String): Required.Raw data to send as the body of the request **/ this.renderRaw = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js index 22fa7abaf9..0d22262114 100644 --- a/api/v3.0.0/orgs.js +++ b/api/v3.0.0/orgs.js @@ -77,8 +77,6 @@ var orgs = module.exports = { * - org (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/orgs/#get-an-organization **/ this.get = function(msg, block, callback) { var self = this; @@ -125,12 +123,10 @@ var orgs = module.exports = { * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - org (String): Required. * - billing_email (String): Optional. Billing email address. This address is not publicized. - * - company (String): Optional. + * - company (String): Optional. * - email (String): Optional. Publicly visible email address. - * - location (String): Optional. - * - name (String): Optional. - * - * https://developer.github.com/v3/orgs/#edit-an-organization + * - location (String): Optional. + * - name (String): Optional. **/ this.update = function(msg, block, callback) { var self = this; @@ -399,7 +395,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#publicizeMembership(msg, callback) -> null + * orgs#addOrganizationMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -409,7 +405,7 @@ var orgs = module.exports = { * - org (String): Required. * - user (String): Required. **/ - this.publicizeMembership = function(msg, block, callback) { + this.addOrganizationMembership = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -445,7 +441,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#concealMembership(msg, callback) -> null + * orgs#removeOrganizationMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -455,7 +451,7 @@ var orgs = module.exports = { * - org (String): Required. * - user (String): Required. **/ - this.concealMembership = function(msg, block, callback) { + this.removeOrganizationMembership = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -491,7 +487,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#getTeams(msg, callback) -> null + * orgs#publicizeMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -499,10 +495,9 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. **/ - this.getTeams = function(msg, block, callback) { + this.publicizeMembership = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -538,16 +533,17 @@ var orgs = module.exports = { }; /** section: github - * orgs#getTeam(msg, callback) -> null + * orgs#concealMembership(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - org (String): Required. + * - user (String): Required. **/ - this.getTeam = function(msg, block, callback) { + this.concealMembership = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -583,7 +579,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#createTeam(msg, callback) -> null + * orgs#getTeams(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -591,11 +587,10 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - org (String): Required. - * - name (String): Required. - * - repo_names (Array): Optional. Array of strings - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ - this.createTeam = function(msg, block, callback) { + this.getTeams = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -631,7 +626,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#updateTeam(msg, callback) -> null + * orgs#getTeam(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -639,10 +634,8 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. - * - name (String): Required. - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. **/ - this.updateTeam = function(msg, block, callback) { + this.getTeam = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -678,16 +671,19 @@ var orgs = module.exports = { }; /** section: github - * orgs#deleteTeam(msg, callback) -> null + * orgs#createTeam(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - org (String): Required. + * - name (String): Required. + * - repo_names (Array): Optional. Array of strings + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. **/ - this.deleteTeam = function(msg, block, callback) { + this.createTeam = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -723,7 +719,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#getTeamMembers(msg, callback) -> null + * orgs#updateTeam(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -731,10 +727,10 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - name (String): Required. + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. **/ - this.getTeamMembers = function(msg, block, callback) { + this.updateTeam = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -770,7 +766,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#getTeamMember(msg, callback) -> null + * orgs#deleteTeam(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -778,9 +774,8 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. - * - user (String): Required. **/ - this.getTeamMember = function(msg, block, callback) { + this.deleteTeam = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -816,7 +811,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#addTeamMember(msg, callback) -> null + * orgs#getTeamMembers(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -824,9 +819,10 @@ var orgs = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - id (String): Required. - * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ - this.addTeamMember = function(msg, block, callback) { + this.getTeamMembers = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -862,7 +858,7 @@ var orgs = module.exports = { }; /** section: github - * orgs#deleteTeamMember(msg, callback) -> null + * orgs#getTeamMember(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * @@ -872,7 +868,7 @@ var orgs = module.exports = { * - id (String): Required. * - user (String): Required. **/ - this.deleteTeamMember = function(msg, block, callback) { + this.getTeamMember = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -908,17 +904,17 @@ var orgs = module.exports = { }; /** section: github - * orgs#addOrganizationMembership(msg, callback) -> null + * orgs#addTeamMember(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): organization to invite the user to - Required. - * - user (String): username to be invited - Required. + * - id (String): Required. + * - user (String): Required. **/ - this.addOrganizationMembership = function(msg, block, callback) { + this.addTeamMember = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) @@ -954,17 +950,17 @@ var orgs = module.exports = { }; /** section: github - * orgs#removeOrganizationMembership(msg, callback) -> null + * orgs#deleteTeamMember(msg, callback) -> null * - msg (Object): Object that contains the parameters and their values to be sent to the server. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): organization to remove the user from - Required. - * - user (String): username to be removed - Required. + * - id (String): Required. + * - user (String): Required. **/ - this.removeOrganizationMembership = function(msg, block, callback) { + this.deleteTeamMember = function(msg, block, callback) { var self = this; this.client.httpSend(msg, block, function(err, res) { if (err) diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js index 96af44685c..b8afaf6375 100644 --- a/api/v3.0.0/pullRequests.js +++ b/api/v3.0.0/pullRequests.js @@ -27,8 +27,8 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. * - head (String): Optional. * - base (String): Optional. @@ -36,8 +36,6 @@ var pullRequests = module.exports = { * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - * https://developer.github.com/v3/pulls/#list-pull-requests **/ this.getAll = function(msg, block, callback) { var self = this; @@ -82,11 +80,9 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/pulls/#get-a-single-pull-request + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.get = function(msg, block, callback) { var self = this; @@ -131,14 +127,12 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. * - body (String): Optional. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - * - * https://developer.github.com/v3/pulls/#create-a-pull-request + * - base (String): Required.The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required.The branch (or git ref) where your changes are implemented. **/ this.create = function(msg, block, callback) { var self = this; @@ -183,13 +177,11 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - * - * https://developer.github.com/v3/pulls/#create-a-pull-request + * - user (String): Required. + * - repo (String): Required. + * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - base (String): Required.The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required.The branch (or git ref) where your changes are implemented. **/ this.createFromIssue = function(msg, block, callback) { var self = this; @@ -234,14 +226,12 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - title (String): Required. + * - title (String): Required. * - body (String): Optional. - * - * https://developer.github.com/v3/pulls/#update-a-pull-request **/ this.update = function(msg, block, callback) { var self = this; @@ -286,13 +276,11 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request **/ this.getCommits = function(msg, block, callback) { var self = this; @@ -337,13 +325,11 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/pulls/#list-pull-requests-files **/ this.getFiles = function(msg, block, callback) { var self = this; @@ -388,13 +374,11 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged **/ this.getMerged = function(msg, block, callback) { var self = this; @@ -439,12 +423,10 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - commit_message (String): Optional. The message that will be used for the merge commit - * - * https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button **/ this.merge = function(msg, block, callback) { var self = this; @@ -489,9 +471,9 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -538,9 +520,9 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.getComment = function(msg, block, callback) { var self = this; @@ -585,13 +567,13 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - commit_id (String): Required. Sha of the commit to comment on. - * - path (String): Required. Relative path of the file to comment on. - * - position (Number): Required. Column index in the diff to comment on. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - commit_id (String): Required.Sha of the commit to comment on. + * - path (String): Required.Relative path of the file to comment on. + * - position (Number): Required.Column index in the diff to comment on. **/ this.createComment = function(msg, block, callback) { var self = this; @@ -636,11 +618,11 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - in_reply_to (Number): Required. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - in_reply_to (Number): Required. **/ this.createCommentReply = function(msg, block, callback) { var self = this; @@ -685,10 +667,10 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. **/ this.updateComment = function(msg, block, callback) { var self = this; @@ -733,9 +715,9 @@ var pullRequests = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. **/ this.deleteComment = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 9e94c634f1..46d24ea8cb 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -27,12 +27,10 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. + * - owner (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository **/ this.listReleases = function(msg, block, callback) { var self = this; @@ -77,11 +75,9 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#get-a-single-release + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. **/ this.getRelease = function(msg, block, callback) { var self = this; @@ -126,16 +122,14 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - tag_name (String): Required. String of the tag + * - owner (String): Required. + * - repo (String): Required. + * - tag_name (String): Required.String of the tag * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). * - name (String): Optional. * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - * - * https://developer.github.com/v3/repos/releases/#create-a-release **/ this.createRelease = function(msg, block, callback) { var self = this; @@ -180,17 +174,15 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - tag_name (String): Required. String of the tag + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - tag_name (String): Required.String of the tag * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). * - name (String): Optional. * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - * - * https://developer.github.com/v3/repos/releases/#edit-a-release **/ this.editRelease = function(msg, block, callback) { var self = this; @@ -235,11 +227,9 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#delete-a-release + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. **/ this.deleteRelease = function(msg, block, callback) { var self = this; @@ -284,11 +274,9 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#list-assets-for-a-release + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. **/ this.listAssets = function(msg, block, callback) { var self = this; @@ -333,11 +321,9 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#get-a-single-release-asset + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. **/ this.getAsset = function(msg, block, callback) { var self = this; @@ -382,10 +368,10 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - name (String): Required. the file name of the asset + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - name (String): Required.the file name of the asset **/ this.uploadAsset = function(msg, block, callback) { var self = this; @@ -430,13 +416,11 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - name (String): Required. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - name (String): Required. * - label (String): Optional. An alternate short description of the asset. Used in place of the filename. - * - * https://developer.github.com/v3/repos/releases/#edit-a-release-asset **/ this.editAsset = function(msg, block, callback) { var self = this; @@ -481,11 +465,9 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#delete-a-release-asset + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. **/ this.deleteAsset = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js index 6efa54233a..4f9e619886 100644 --- a/api/v3.0.0/repos.js +++ b/api/v3.0.0/repos.js @@ -32,8 +32,6 @@ var repos = module.exports = { * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-your-repositories **/ this.getAll = function(msg, block, callback) { var self = this; @@ -78,7 +76,7 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. @@ -128,12 +126,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. + * - org (String): Required. * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-organization-repositories **/ this.getFromOrg = function(msg, block, callback) { var self = this; @@ -178,7 +174,7 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required. + * - name (String): Required. * - description (String): Optional. * - homepage (String): Optional. * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. @@ -187,8 +183,6 @@ var repos = module.exports = { * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. - * - * https://developer.github.com/v3/repos/#create **/ this.create = function(msg, block, callback) { var self = this; @@ -233,8 +227,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. + * - org (String): Required. + * - name (String): Required. * - description (String): Optional. * - homepage (String): Optional. * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. @@ -244,8 +238,6 @@ var repos = module.exports = { * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. * - team_id (Number): Optional. The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#create **/ this.createFromOrg = function(msg, block, callback) { var self = this; @@ -290,10 +282,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/#get + * - user (String): Required. + * - repo (String): Required. **/ this.get = function(msg, block, callback) { var self = this; @@ -338,7 +328,7 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. **/ this.one = function(msg, block, callback) { var self = this; @@ -383,9 +373,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. * - description (String): Optional. * - homepage (String): Optional. * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. @@ -393,8 +383,6 @@ var repos = module.exports = { * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. * - default_branch (String): Optional. Updates the default branch for this repository. - * - * https://developer.github.com/v3/repos/#edit **/ this.update = function(msg, block, callback) { var self = this; @@ -439,10 +427,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/#delete-a-repository + * - user (String): Required. + * - repo (String): Required. **/ this.delete = function(msg, block, callback) { var self = this; @@ -487,10 +473,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required.The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required.The branch (or git ref) where your changes are implemented. * - commit_message (String): Optional. Commit message to use for the merge commit. If omitted, a default message will be used. **/ this.merge = function(msg, block, callback) { @@ -536,13 +522,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - anon (Boolean): Optional. Set to 1 or true to include anonymous contributors in results. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-contributors **/ this.getContributors = function(msg, block, callback) { var self = this; @@ -587,12 +571,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-languages **/ this.getLanguages = function(msg, block, callback) { var self = this; @@ -637,12 +619,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-teams **/ this.getTeams = function(msg, block, callback) { var self = this; @@ -687,12 +667,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-tags **/ this.getTags = function(msg, block, callback) { var self = this; @@ -737,12 +715,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#list-branches **/ this.getBranches = function(msg, block, callback) { var self = this; @@ -787,13 +763,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - branch (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - branch (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/repos/#get-branch **/ this.getBranch = function(msg, block, callback) { var self = this; @@ -838,8 +812,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -886,9 +860,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. **/ this.getCollaborator = function(msg, block, callback) { var self = this; @@ -933,9 +907,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. **/ this.addCollaborator = function(msg, block, callback) { var self = this; @@ -980,9 +954,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. **/ this.removeCollaborator = function(msg, block, callback) { var self = this; @@ -1027,8 +1001,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - sha (String): Optional. Sha or branch to start listing commits from. * - path (String): Optional. Only commits containing this file path will be returned. * - author (String): Optional. GitHub login or email address by which to filter by commit author. @@ -1080,9 +1054,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. **/ this.getCommit = function(msg, block, callback) { var self = this; @@ -1127,8 +1101,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -1175,9 +1149,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -1224,11 +1198,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - body (String): Required. - * - commit_id (String): Required. Sha of the commit to comment on. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - body (String): Required. + * - commit_id (String): Required.Sha of the commit to comment on. * - path (String): Optional. Relative path of the file to comment on. * - position (Number): Optional. Line index in the diff to comment on. * - line (Number): Optional. Line number in the file to comment on. Defaults to 1. @@ -1276,9 +1250,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getCommitComment = function(msg, block, callback) { var self = this; @@ -1323,10 +1297,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. **/ this.updateCommitComment = function(msg, block, callback) { var self = this; @@ -1371,10 +1345,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required.The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required.The branch (or git ref) where your changes are implemented. **/ this.compareCommits = function(msg, block, callback) { var self = this; @@ -1419,9 +1393,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.deleteCommitComment = function(msg, block, callback) { var self = this; @@ -1466,8 +1440,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. **/ this.getReadme = function(msg, block, callback) { @@ -1513,8 +1487,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - path (String): Optional. The content path. * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. **/ @@ -1561,8 +1535,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - content (String): Optional. * - message (String): Optional. * - path (String): Optional. The content path. @@ -1611,11 +1585,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The new file content, Base64 encoded. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required.The content path. + * - message (String): Required.The commit message. + * - content (String): Required.The new file content, Base64 encoded. * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). * - author (Json): Optional. * - committer (Json): Optional. @@ -1663,12 +1637,12 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The updated file content, Base64 encoded. - * - sha (String): Required. The blob SHA of the file being replaced. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required.The content path. + * - message (String): Required.The commit message. + * - content (String): Required.The updated file content, Base64 encoded. + * - sha (String): Required.The blob SHA of the file being replaced. * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). * - author (Json): Optional. * - committer (Json): Optional. @@ -1716,11 +1690,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - sha (String): Required. The blob SHA of the file being removed. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required.The content path. + * - message (String): Required.The commit message. + * - sha (String): Required.The blob SHA of the file being removed. * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). * - author (Json): Optional. * - committer (Json): Optional. @@ -1768,10 +1742,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - ref (String): Optional. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - archive_format (String): Required. Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. + * - archive_format (String): Required.Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. **/ this.getArchiveLink = function(msg, block, callback) { var self = this; @@ -1816,8 +1790,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -1864,9 +1838,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getDownload = function(msg, block, callback) { var self = this; @@ -1911,9 +1885,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.deleteDownload = function(msg, block, callback) { var self = this; @@ -1958,8 +1932,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - sort (String): Optional. Possible values: `newest`, `oldest`, `watchers`, default: `newest`. Validation rule: ` ^(newest|oldest|watchers)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. @@ -2007,8 +1981,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - organization (String): Optional. Organization login. The repository will be forked into this organization. **/ this.fork = function(msg, block, callback) { @@ -2054,8 +2028,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2102,9 +2076,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getKey = function(msg, block, callback) { var self = this; @@ -2149,10 +2123,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - key (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - key (String): Required. **/ this.createKey = function(msg, block, callback) { var self = this; @@ -2197,11 +2171,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. **/ this.updateKey = function(msg, block, callback) { var self = this; @@ -2246,9 +2220,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.deleteKey = function(msg, block, callback) { var self = this; @@ -2293,8 +2267,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2387,7 +2361,7 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2434,8 +2408,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2482,8 +2456,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.star = function(msg, block, callback) { var self = this; @@ -2528,8 +2502,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.unStar = function(msg, block, callback) { var self = this; @@ -2574,8 +2548,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2668,7 +2642,7 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2715,8 +2689,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2763,8 +2737,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.watch = function(msg, block, callback) { var self = this; @@ -2809,8 +2783,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.unWatch = function(msg, block, callback) { var self = this; @@ -2855,8 +2829,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -2903,9 +2877,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getHook = function(msg, block, callback) { var self = this; @@ -2950,10 +2924,10 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - config (Json): Required.A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. * - events (Array): Optional. Determines what events the hook is triggered for. Default: `['push']`. * - active (Boolean): Optional. Determines whether the hook is actually triggered on pushes. **/ @@ -3000,11 +2974,11 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - name (String): Required. - * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - name (String): Required. + * - config (Json): Required.A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. * - events (Array): Optional. Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. * - add_events (Array): Optional. Determines a list of events to be added to the list of events that the Hook triggers for. * - remove_events (Array): Optional. Determines a list of events to be removed from the list of events that the Hook triggers for. @@ -3053,9 +3027,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.testHook = function(msg, block, callback) { var self = this; @@ -3100,9 +3074,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.deleteHook = function(msg, block, callback) { var self = this; @@ -3147,8 +3121,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getStatsContributors = function(msg, block, callback) { var self = this; @@ -3193,8 +3167,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getStatsCommitActivity = function(msg, block, callback) { var self = this; @@ -3239,8 +3213,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getStatsCodeFrequency = function(msg, block, callback) { var self = this; @@ -3285,8 +3259,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getStatsParticipation = function(msg, block, callback) { var self = this; @@ -3331,8 +3305,8 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.getStatsPunchCard = function(msg, block, callback) { var self = this; @@ -3381,8 +3355,8 @@ var repos = module.exports = { * - ref (String): Optional. The name of the ref. This can be a branch, tag, or sha. Default: none. * - task (String): Optional. The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -3429,15 +3403,15 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - ref (String): Required. The ref to deploy. This can be a branch, tag, or sha. - * - task (String): Required. The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * - ref (String): Required.The ref to deploy. This can be a branch, tag, or sha. + * - task (String): Required.The named task to execute. e.g. deploy or deploy:migrations. Default: deploy * - auto_merge (Boolean): Optional. Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true * - required_contexts (Array): Optional. Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. * - payload (String): Optional. Optional JSON payload with extra information about the deployment. Default: '' * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. * - description (String): Optional. Optional short description. Default: '' - * - user (String): Required. - * - repo (String): Required. + * - user (String): Required. + * - repo (String): Required. **/ this.createDeployment = function(msg, block, callback) { var self = this; @@ -3482,9 +3456,9 @@ var repos = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.getDeploymentStatuses = function(msg, block, callback) { var self = this; @@ -3532,9 +3506,9 @@ var repos = module.exports = { * - state (String): Optional. The state of the status. Can be one of pending, success, error, or failure. * - target_url (String): Optional. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: '' * - description (String): Optional. A short description of the status. Default: '' - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. **/ this.createDeploymentStatus = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js index ae91ca0fa7..2987b58ca6 100644 --- a/api/v3.0.0/search.js +++ b/api/v3.0.0/search.js @@ -27,13 +27,11 @@ var search = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term + * - q (String): Required.Search Term * - sort (String): Optional. indexed only Validation rule: ` ^indexed$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/search/#search-code **/ this.code = function(msg, block, callback) { var self = this; @@ -78,13 +76,11 @@ var search = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term + * - q (String): Required.Search Term * - sort (String): Optional. comments, created, or updated Validation rule: ` ^(comments|created|updated)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/search/#search-issues **/ this.issues = function(msg, block, callback) { var self = this; @@ -129,13 +125,11 @@ var search = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term + * - q (String): Required.Search Term * - sort (String): Optional. stars, forks, or updated Validation rule: ` ^(stars|forks|updated)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/search/#search-repositories **/ this.repos = function(msg, block, callback) { var self = this; @@ -180,13 +174,11 @@ var search = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term + * - q (String): Required.Search Term * - sort (String): Optional. followers, repositories, or joined Validation rule: ` ^(followers|repositories|joined)$ `. * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - * https://developer.github.com/v3/search/#search-users **/ this.users = function(msg, block, callback) { var self = this; @@ -231,7 +223,7 @@ var search = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - email (String): Required. Email address + * - email (String): Required.Email address **/ this.email = function(msg, block, callback) { var self = this; diff --git a/api/v3.0.0/statuses.js b/api/v3.0.0/statuses.js index 1a376afd47..5a6e6c0e23 100644 --- a/api/v3.0.0/statuses.js +++ b/api/v3.0.0/statuses.js @@ -27,9 +27,9 @@ var statuses = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. **/ this.get = function(msg, block, callback) { var self = this; @@ -74,9 +74,9 @@ var statuses = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. **/ this.getCombined = function(msg, block, callback) { var self = this; @@ -121,10 +121,10 @@ var statuses = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - state (String): Required.State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. * - description (String): Optional. Short description of the status. * - context (String): Optional. A string label to differentiate this status from the status of other systems. diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js index d4d4f19a9f..e550fc207b 100644 --- a/api/v3.0.0/user.js +++ b/api/v3.0.0/user.js @@ -28,8 +28,6 @@ var user = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * - since (Number): Optional. The integer ID of the last User that you’ve seen. - * - * https://developer.github.com/v3/users/#get-a-single-user **/ this.getAll = function(msg, block, callback) { var self = this; @@ -74,9 +72,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - * https://developer.github.com/v3/users/#get-a-single-user + * - user (String): Required. **/ this.getFrom = function(msg, block, callback) { var self = this; @@ -122,8 +118,6 @@ var user = module.exports = { * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. * No other params, simply pass an empty Object literal `{}` - * - * https://developer.github.com/v3/users/#get-a-single-user **/ this.get = function(msg, block, callback) { var self = this; @@ -175,8 +169,6 @@ var user = module.exports = { * - location (String): Optional. * - hireable (Boolean): Optional. * - bio (String): Optional. - * - * https://developer.github.com/v3/users/#update-the-authenticated-user **/ this.update = function(msg, block, callback) { var self = this; @@ -267,8 +259,8 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - state (String): Required. Validation rule: ` ^(open|closed|active)$ `. + * - org (String): Required. + * - state (String): Required. Validation rule: ` ^(open|closed|active)$ `. **/ this.editOrganizationMembership = function(msg, block, callback) { var self = this; @@ -495,7 +487,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -542,7 +534,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -635,7 +627,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -682,7 +674,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. **/ this.followUser = function(msg, block, callback) { var self = this; @@ -727,7 +719,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. **/ this.unFollowUser = function(msg, block, callback) { var self = this; @@ -818,7 +810,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. + * - user (String): Required. * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. **/ @@ -865,7 +857,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. **/ this.getKey = function(msg, block, callback) { var self = this; @@ -910,8 +902,8 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - title (String): Required. - * - key (String): Required. + * - title (String): Required. + * - key (String): Required. **/ this.createKey = function(msg, block, callback) { var self = this; @@ -956,9 +948,9 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. **/ this.updateKey = function(msg, block, callback) { var self = this; @@ -1003,7 +995,7 @@ var user = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. + * - id (String): Required. **/ this.deleteKey = function(msg, block, callback) { var self = this; diff --git a/generate.js b/generate.js index a5e553dc60..267824f438 100755 --- a/generate.js +++ b/generate.js @@ -128,7 +128,7 @@ var main = module.exports = function(versions, tests, restore) { def = paramsStruct[paramName]; line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + - (def.required ? "Required. " : "Optional. "); + (def.required ? "Required." : "Optional. "); if (def.description) line += def.description; if (def.validation) @@ -141,7 +141,7 @@ var main = module.exports = function(versions, tests, restore) { var docSection = DocSectionsMap[section] || section; var url = searchSectionUrl(docsUrl + "/" + docSection + "/", block.method + " " + block.url); - + if (url) { comment.push( indent + " *", From d579243f591fc9ed20d7d9eb1ff858266fe5f8c3 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 12:17:17 -0500 Subject: [PATCH 064/461] update readme --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7b91621d9d..afa65b179e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +### NOTE: +[mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](./wiki/Transition-from-upstream). + # Node-github A Node.js wrapper for GitHub API. @@ -12,19 +15,19 @@ or Install via git clone: - $ git clone git@github.com:kaizensoze/node-github.git + $ git clone git@github.com:kaizensoze/github4.git $ cd node-github $ npm install ## Documentation -Client API: [https://kaizensoze.github.io/node-github/](https://kaizensoze.github.io/node-github/) +Client API: [https://kaizensoze.github.io/github4/](https://kaizensoze.github.io/github4/) GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) ## Example -Print all followers of the user "kaizensoze" to the console. +Print all followers of the user "defunkt" to the console: ```javascript var GitHubApi = require("github4"); @@ -46,14 +49,14 @@ github.user.getFollowingFromUser({ // headers: { // "cookie": "blahblah" // }, - user: "kaizensoze" + user: "defunkt" }, function(err, res) { console.log(JSON.stringify(res)); }); ``` -First the _GitHubApi_ class is imported from the _node-github_ module. This class provides -access to all of GitHub's APIs (e.g. user, issues or repo APIs). The _getFollowingFromUser_ +First the `GitHubApi` class is imported from the `node-github` module. This class provides +access to all of GitHub's APIs (e.g. user, issues or repo APIs). The `getFollowingFromUser` method lists all followers of a given GitHub user. Is is part of the user API. It takes the user name as first argument and a callback as last argument. Once the follower list is returned from the server, the callback is called. @@ -71,8 +74,8 @@ course calls, which change data or read sensitive information have to be authent You need the GitHub user name and the API key for authentication. The API key can be found in the user's _Account Settings_ page. -This example shows how to authenticate and then change _location_ field of the -account settings to _Argentina_: +This example shows how to authenticate and then change `location` field of the +account settings to "Argentina": ```javascript github.authenticate({ type: "basic", From ccf60407f2067aea253e4866752aef1d6ad39da0 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 12:19:18 -0500 Subject: [PATCH 065/461] fix wiki link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afa65b179e..3c65f1eba2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ### NOTE: -[mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](./wiki/Transition-from-upstream). +[mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](https://github.com/kaizensoze/github4/wiki/Transition-from-upstream). # Node-github From 1ae02effdf8c05287b28bd8dc6af9c926a21120e Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 12:21:44 -0500 Subject: [PATCH 066/461] update note formatting on readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c65f1eba2..bca4a87dc5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -### NOTE: -[mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](https://github.com/kaizensoze/github4/wiki/Transition-from-upstream). +##### NOTE: [mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](https://github.com/kaizensoze/github4/wiki/Transition-from-upstream). # Node-github From 47d9e18990073ccabe0bed7ff9b7062e0790824f Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 12:46:59 -0500 Subject: [PATCH 067/461] more readme updates --- README.md | 122 ++++++++++++++++++++---------------------------------- 1 file changed, 45 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index bca4a87dc5..0a5896c0d0 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,35 @@ ##### NOTE: [mikedeboer/node-github](https://github.com/mikedeboer/node-github) seems to no longer be maintained so I forked it here and am working on applying PRs and issues from that repo. See progress [here](https://github.com/kaizensoze/github4/wiki/Transition-from-upstream). -# Node-github +# Github4 A Node.js wrapper for GitHub API. ## Installation - Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github4.svg): +Install via [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github4.svg) - $ npm install github4 +```bash +$ npm install github4 +``` or - Install via git clone: +Install via git clone - $ git clone git@github.com:kaizensoze/github4.git - $ cd node-github - $ npm install +```bash +$ git clone git@github.com:kaizensoze/github4.git +$ cd node-github +$ npm install +``` ## Documentation +GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) Client API: [https://kaizensoze.github.io/github4/](https://kaizensoze.github.io/github4/) -GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) - ## Example -Print all followers of the user "defunkt" to the console: +Get all followers for user "defunkt": ```javascript var GitHubApi = require("github4"); @@ -54,61 +57,43 @@ github.user.getFollowingFromUser({ }); ``` -First the `GitHubApi` class is imported from the `node-github` module. This class provides -access to all of GitHub's APIs (e.g. user, issues or repo APIs). The `getFollowingFromUser` -method lists all followers of a given GitHub user. Is is part of the user API. It -takes the user name as first argument and a callback as last argument. Once the -follower list is returned from the server, the callback is called. - -Like in Node.JS, callbacks are always the last argument. If the functions fails an -error object is passed as first argument to the callback. - ## Authentication -Most GitHub API calls don't require authentication. As a rule of thumb: If you -can see the information by visiting the site without being logged in, you don't -have to be authenticated to retrieve the same information through the API. Of -course calls, which change data or read sensitive information have to be authenticated. +Most GitHub API calls don't require authentication. As a rule of thumb: If you can see the information by visiting the site without being logged in, you don't have to be authenticated to retrieve the same information through the API. Of course calls, which change data or read sensitive information have to be authenticated. -You need the GitHub user name and the API key for authentication. The API key can -be found in the user's _Account Settings_ page. +You need the GitHub user name and the API key for authentication. The API key can be found in the user's _Account Settings_. -This example shows how to authenticate and then change `location` field of the -account settings to "Argentina": ```javascript +// basic github.authenticate({ type: "basic", - username: username, - password: password + username: USERNAME, + password: PASSWORD }); -github.user.update({ - location: "Argentina" -}, function(err) { - console.log("done!"); -}); -``` -Note that the _authenticate_ method is synchronous because it only stores the -credentials for the next request. -Other examples for the various authentication methods: -```javascript // OAuth2 github.authenticate({ type: "oauth", - token: token + token: AUTH_TOKEN }); // OAuth2 Key/Secret github.authenticate({ type: "oauth", - key: "clientID", - secret: "clientSecret" + key: CLIENT_ID, + secret: CLIENT_SECRET }) +``` -// Deprecated Gihub API token (seems not to be working with the v3 API) -github.authenticate({ - type: "token", - token: token +Note: `authenticate` is synchronous because it only stores the +credentials for the next request. + +Once authenticated you can update a user field like so: +```javascript +github.user.update({ + location: "Argentina" +}, function(err) { + console.log("done!"); }); ``` @@ -135,39 +120,22 @@ github.authorization.create({ }); ``` -## Implemented GitHub APIs - -* Gists: 100% -* Git Data: 100% -* Issues: 100% -* Orgs: 100% -* Pull Requests: 100% -* Repos: 100% -* Users: 100% -* Events: 100% -* Search: 100% -* Markdown: 100% -* Rate Limit: 100% -* Releases: 100% -* Gitignore: 100% -* Meta: 100% -* Emojis: 100% - -## Running the Tests - -The unit tests are based on the [mocha](http://visionmedia.github.com/mocha/) -module, which may be installed via npm. To run the tests make sure that the -npm dependencies are installed by running `npm install` from the project directory. - -Before running unit tests: -```shell -npm install mocha -g +## Tests + +Install mocha +```bash +$ npm install mocha -g +``` + +Run all tests +```bash +$ mocha ``` -At the moment, test classes can only be run separately. This will e.g. run the Issues Api test: -```shell -mocha api/v3.0.0/issuesTest.js + +Or run a specific test +```bash +$ mocha api/v3.0.0/issuesTest.js ``` -Note that a connection to the internet is required to run the tests. ## LICENSE From 616f989ccd95119accee4666200bc9b1a6ce1ff7 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 12:51:12 -0500 Subject: [PATCH 068/461] update package info with updated repo url bump patch number --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bb8deae34e..b611b05956 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "github4", - "version" : "0.2.6", + "version" : "0.2.7", "description" : "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ @@ -8,10 +8,10 @@ { "name": "Fabian Jakobs", "email": "fabian@c9.io" }, { "name": "Joe Gallo", "email": "joe@brassafrax.com" } ], - "homepage": "https://github.com/kaizensoze/node-github", + "homepage": "https://github.com/kaizensoze/github4", "repository" : { "type" : "git", - "url" : "https://github.com/kaizensoze/node-github.git" + "url" : "https://github.com/kaizensoze/github4.git" }, "engine" : { "node": ">=0.4.0" From 21442b5aebf17df822c95d103fa38caf9faf4ed1 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 20:10:08 -0500 Subject: [PATCH 069/461] add filePath to releases.uploadAsset doc --- api/v3.0.0/releases.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js index 490a484f0a..5ba74e142d 100644 --- a/api/v3.0.0/releases.js +++ b/api/v3.0.0/releases.js @@ -122,8 +122,8 @@ var releases = module.exports = { * ##### Params on the `msg` object: * * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. + * - owner (String): Required. + * - repo (String): Required. * * https://developer.github.com/v3/repos/releases/#get-the-latest-release **/ @@ -174,8 +174,8 @@ var releases = module.exports = { * - repo (String): Required. * - tag_name (String): Required.String of the tag * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. + * - name (String): Optional. + * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false **/ @@ -227,8 +227,8 @@ var releases = module.exports = { * - repo (String): Required. * - tag_name (String): Required.String of the tag * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. + * - name (String): Optional. + * - body (String): Optional. * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false **/ @@ -419,7 +419,8 @@ var releases = module.exports = { * - owner (String): Required. * - id (Number): Required. * - repo (String): Required. - * - name (String): Required.the file name of the asset + * - name (String): Required. The file name of the asset. + * - filePath (String): Required. The file path of the asset. **/ this.uploadAsset = function(msg, block, callback) { var self = this; From d3d2f1c9fa50dfc0529b965463d1c88dbd99fb7f Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 20:47:55 -0500 Subject: [PATCH 070/461] proxy fix --- index.js | 21 +++++--------- package.json | 78 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 47 deletions(-) diff --git a/index.js b/index.js index 1c25e0605c..118375a42e 100644 --- a/index.js +++ b/index.js @@ -665,6 +665,8 @@ var Client = module.exports = function(config) { var obj = getQueryAndUrl(msg, block, format, self.config); var query = obj.query; var url = this.config.url ? this.config.url + obj.url : obj.url; + var HttpsProxyAgent = require('https-proxy-agent'); + var agent = undefined; var path = url; var protocol = this.config.protocol || this.constants.protocol || "http"; @@ -678,20 +680,7 @@ var Client = module.exports = function(config) { proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY; } if (proxyUrl) { - path = Url.format({ - protocol: protocol, - hostname: host, - port: port, - pathname: path - }); - - if (!/^(http|https):\/\//.test(proxyUrl)) - proxyUrl = "https://" + proxyUrl; - - var parsedUrl = Url.parse(proxyUrl); - protocol = parsedUrl.protocol.replace(":", ""); - host = parsedUrl.hostname; - port = parsedUrl.port || (protocol == "https" ? 443 : 80); + agent = new HttpsProxyAgent(proxyUrl); } if (!hasBody && query.length) path += "?" + query.join("&"); @@ -770,6 +759,10 @@ var Client = module.exports = function(config) { ca: ca }; + if (agent) { + options.agent = agent; + } + if (this.config.rejectUnauthorized !== undefined) options.rejectUnauthorized = this.config.rejectUnauthorized; diff --git a/package.json b/package.json index b611b05956..d5732d9586 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,49 @@ { - "name" : "github4", - "version" : "0.2.7", - "description" : "NodeJS wrapper for the GitHub API", - "author": "Mike de Boer ", - "contributors": [ - { "name": "Mike de Boer", "email": "info@mikedeboer.nl" }, - { "name": "Fabian Jakobs", "email": "fabian@c9.io" }, - { "name": "Joe Gallo", "email": "joe@brassafrax.com" } - ], - "homepage": "https://github.com/kaizensoze/github4", - "repository" : { - "type" : "git", - "url" : "https://github.com/kaizensoze/github4.git" + "name": "github4", + "version": "0.2.7", + "description": "NodeJS wrapper for the GitHub API", + "author": "Mike de Boer ", + "contributors": [ + { + "name": "Mike de Boer", + "email": "info@mikedeboer.nl" }, - "engine" : { - "node": ">=0.4.0" + { + "name": "Fabian Jakobs", + "email": "fabian@c9.io" }, - "dependencies": { - "mime": "^1.2.11" - }, - "devDependencies": { - "async": "^0.9.0", - "oauth": "~0.9.7", - "optimist": "~0.6.0", - "mocha": "~1.13.0" - }, - "main" : ".", - "scripts": { - "test": "node ./test/all.js" - }, - "license": "MIT", - "licenses": [{ - "type": "The MIT License", - "url": "http://www.opensource.org/licenses/mit-license.php" - }] + { + "name": "Joe Gallo", + "email": "joe@brassafrax.com" + } + ], + "homepage": "https://github.com/kaizensoze/github4", + "repository": { + "type": "git", + "url": "https://github.com/kaizensoze/github4.git" + }, + "engine": { + "node": ">=0.4.0" + }, + "dependencies": { + "https-proxy-agent": "^1.0.0", + "mime": "^1.2.11" + }, + "devDependencies": { + "async": "^0.9.0", + "oauth": "~0.9.7", + "optimist": "~0.6.0", + "mocha": "~1.13.0" + }, + "main": ".", + "scripts": { + "test": "node ./test/all.js" + }, + "license": "MIT", + "licenses": [ + { + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ] } From 22ff7c56aa7d3dbb0fb11939e9a72c794fd6e219 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 21:12:01 -0500 Subject: [PATCH 071/461] bump patch number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5732d9586..53cb32bd90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github4", - "version": "0.2.7", + "version": "0.2.8", "description": "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ From 50cce006e31cdc1417f36123d38d103c1d3ec836 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 21:38:09 -0500 Subject: [PATCH 072/461] exclude .orig files from git --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 352d0b41aa..192d4ce862 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ logs *.log npm-debug.log* +*.orig + 0.0.1.seed .settings.xml From ec7367029b016f3a44bf3ef0a2dd5c89e20c3cbc Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 21:50:42 -0500 Subject: [PATCH 073/461] add 'sources' to get-from-org type options doc --- api/v3.0.0/routes.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index 8e6998cb84..753f48b3f9 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -1941,8 +1941,8 @@ "type": "String", "required": false, "validation": "^(all|public|private|forks|sources|member)$", - "invalidmsg": "Possible values: `all`, `public`, `private`, `forks`, `member`. Default: `all`.", - "description": "Possible values: `all`, `public`, `private`, `forks`, `member`. Default: `all`." + "invalidmsg": "Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`.", + "description": "Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`." }, "$page": null, "$per_page": null @@ -3101,12 +3101,12 @@ "type": "Number", "required": false, "validation": "", - "description": "The integer ID of the last User that you’ve seen." + "description": "The integer ID of the last User that you’ve seen." } } - + }, - + "get-from": { "url": "/users/:user", "method": "GET", From 2055cc71a8670447eaa290c31f7c8ea7cf99211a Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sun, 20 Dec 2015 21:56:24 -0500 Subject: [PATCH 074/461] remove whitespace --- api/v3.0.0/routes.json | 1 - 1 file changed, 1 deletion(-) diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json index cf4e4a94c9..b761b38d5b 100644 --- a/api/v3.0.0/routes.json +++ b/api/v3.0.0/routes.json @@ -3131,7 +3131,6 @@ "description": "The integer ID of the last User that you’ve seen." } } - }, "get-from": { From 534081655ac110508b48c0d9f2b1456aa68730e2 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 01:29:31 -0500 Subject: [PATCH 075/461] clean up tests --- generate.js | 27 +++++----- package.json | 5 +- {api/v3.0.0 => test}/authorizationTest.js | 2 +- test/client_test.js | 62 ----------------------- {api/v3.0.0 => test}/eventsTest.js | 2 +- {api/v3.0.0 => test}/gistsTest.js | 2 +- {api/v3.0.0 => test}/gitdataTest.js | 2 +- {api/v3.0.0 => test}/gitignoreTest.js | 2 +- {api/v3.0.0 => test}/issuesTest.js | 2 +- {api/v3.0.0 => test}/markdownTest.js | 2 +- {api/v3.0.0 => test}/miscTest.js | 2 +- test/oauth_server.js | 6 +-- {api/v3.0.0 => test}/orgsTest.js | 2 +- {api/v3.0.0 => test}/pullRequestsTest.js | 2 +- {api/v3.0.0 => test}/releasesTest.js | 2 +- {api/v3.0.0 => test}/reposTest.js | 2 +- {api/v3.0.0 => test}/searchTest.js | 2 +- {api/v3.0.0 => test}/statusesTest.js | 2 +- {api/v3.0.0 => test}/userTest.js | 2 +- 19 files changed, 35 insertions(+), 95 deletions(-) rename {api/v3.0.0 => test}/authorizationTest.js (99%) delete mode 100644 test/client_test.js rename {api/v3.0.0 => test}/eventsTest.js (99%) rename {api/v3.0.0 => test}/gistsTest.js (99%) rename {api/v3.0.0 => test}/gitdataTest.js (99%) rename {api/v3.0.0 => test}/gitignoreTest.js (97%) rename {api/v3.0.0 => test}/issuesTest.js (99%) rename {api/v3.0.0 => test}/markdownTest.js (97%) rename {api/v3.0.0 => test}/miscTest.js (98%) rename {api/v3.0.0 => test}/orgsTest.js (99%) rename {api/v3.0.0 => test}/pullRequestsTest.js (99%) rename {api/v3.0.0 => test}/releasesTest.js (99%) rename {api/v3.0.0 => test}/reposTest.js (99%) rename {api/v3.0.0 => test}/searchTest.js (98%) rename {api/v3.0.0 => test}/statusesTest.js (98%) rename {api/v3.0.0 => test}/userTest.js (99%) diff --git a/generate.js b/generate.js index eabba23f88..ef73ee4308 100644 --- a/generate.js +++ b/generate.js @@ -12,7 +12,7 @@ "use strict"; -var Fs = require("fs"); +var fs = require("fs"); var Path = require("path"); var Url = require("url"); @@ -20,8 +20,8 @@ var Async = require("async"); var Optimist = require("optimist"); var Util = require("./util"); -var TestSectionTpl = Fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); -var TestHandlerTpl = Fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); +var TestSectionTpl = fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); +var TestHandlerTpl = fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); var main = module.exports = function(versions, tests, restore) { Util.log("Generating for versions", Object.keys(versions)); @@ -33,12 +33,12 @@ var main = module.exports = function(versions, tests, restore) { // and short-circuit. if (restore) { var bakRE = /\.bak$/; - var files = Fs.readdirSync(dir).filter(function(file) { + var files = fs.readdirSync(dir).filter(function(file) { return bakRE.test(file); }).forEach(function(file) { var from = Path.join(dir, file); var to = Path.join(dir, file.replace(/\.bak$/, "")); - Fs.renameSync(from, to); + fs.renameSync(from, to); Util.log("Restored '" + file + "' (" + version + ")"); }); @@ -176,7 +176,7 @@ var main = module.exports = function(versions, tests, restore) { Util.log("Writing files to version dir"); - Fs.writeFileSync(dir + "/apidocs.js", apidocs); + fs.writeFileSync(dir + "/apidocs.js", apidocs); Object.keys(sections).forEach(function(section) { // When we don't need to generate tests, bail out here. @@ -191,16 +191,16 @@ var main = module.exports = function(versions, tests, restore) { .replace("<%version%>", version.replace("v", "")) .replace(/<%sectionName%>/g, section) .replace("<%testBody%>", def.join("\n\n")); - var path = Path.join(dir, section + "Test.js"); - if (Fs.existsSync(path) && Math.abs(Fs.readFileSync(path, "utf8").length - body.length) >= 20) { + var path = Path.join(testDir, section + "Test.js"); + if (fs.existsSync(path) && Math.abs(fs.readFileSync(path, "utf8").length - body.length) >= 20) { Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + "that were already implemented. \nPlease be sure te check this file " + "and move all implemented tests back into the newly generated test!", "error"); - Fs.renameSync(path, path + ".bak"); + fs.renameSync(path, path + ".bak"); } Util.log("Writing test file for " + section + ", version " + version); - Fs.writeFileSync(path, body, "utf8"); + fs.writeFileSync(path, body, "utf8"); }); }); }; @@ -227,12 +227,13 @@ if (!module.parent) { } var baseDir = Path.join(__dirname, "api"); + var testDir = Path.join(__dirname, "test"); var availVersions = {}; - Fs.readdirSync(baseDir).forEach(function(version) { + fs.readdirSync(baseDir).forEach(function(version) { var path = Path.join(baseDir, version, "routes.json"); - if (!Fs.existsSync(path)) + if (!fs.existsSync(path)) return; - var routes = JSON.parse(Fs.readFileSync(path, "utf8")); + var routes = JSON.parse(fs.readFileSync(path, "utf8")); if (!routes.defines) return; availVersions[version] = routes; diff --git a/package.json b/package.json index d0d1c92ee5..faf90f8b90 100644 --- a/package.json +++ b/package.json @@ -32,13 +32,14 @@ }, "devDependencies": { "async": "^0.9.0", + "mocha": "~1.13.0", "oauth": "~0.9.7", "optimist": "~0.6.0", - "mocha": "~1.13.0" + "should": "^8.0.2" }, "main": ".", "scripts": { - "test": "node ./test/all.js" + "test": "./node_modules/.bin/mocha" }, "license": "MIT", "licenses": [ diff --git a/api/v3.0.0/authorizationTest.js b/test/authorizationTest.js similarity index 99% rename from api/v3.0.0/authorizationTest.js rename to test/authorizationTest.js index 29b0b8dab2..008a5c17cc 100644 --- a/api/v3.0.0/authorizationTest.js +++ b/test/authorizationTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[authorization]", function() { var client; diff --git a/test/client_test.js b/test/client_test.js deleted file mode 100644 index 85305895ba..0000000000 --- a/test/client_test.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../index"); - -describe("[client]", function() { - var client; - var token = "e5a4a27487c26e571892846366de023349321a73"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - /*client.authenticate({ - type: "oauth", - token: token - });*/ - }); - - it("should successfully execute GET /authorizations (getAll)", function(next) { - // `aseemk` has two pages of followers right now. - client.user.getFollowers( - { - user: "aseemk" - }, - function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasNextPage(res)); - Assert.ok(!!client.hasLastPage(res)); - Assert.ok(!client.hasPreviousPage(res)); - - client.getNextPage(res, function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasPreviousPage(res)); - Assert.ok(!!client.hasFirstPage(res)); - Assert.ok(!client.hasNextPage(res)); - Assert.ok(!client.hasLastPage(res)); - - client.getPreviousPage(res.meta.link, function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasNextPage(res)); - Assert.ok(!!client.hasLastPage(res)); - Assert.ok(!client.hasPreviousPage(res)); - next(); - }); - }); - } - ); - }); -}); diff --git a/api/v3.0.0/eventsTest.js b/test/eventsTest.js similarity index 99% rename from api/v3.0.0/eventsTest.js rename to test/eventsTest.js index 0c4a7320bc..7487586444 100644 --- a/api/v3.0.0/eventsTest.js +++ b/test/eventsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[events]", function() { var client; diff --git a/api/v3.0.0/gistsTest.js b/test/gistsTest.js similarity index 99% rename from api/v3.0.0/gistsTest.js rename to test/gistsTest.js index d47d28f371..212228da87 100644 --- a/api/v3.0.0/gistsTest.js +++ b/test/gistsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[gists]", function() { var client; diff --git a/api/v3.0.0/gitdataTest.js b/test/gitdataTest.js similarity index 99% rename from api/v3.0.0/gitdataTest.js rename to test/gitdataTest.js index c9f7fbce0e..cef67d22c8 100644 --- a/api/v3.0.0/gitdataTest.js +++ b/test/gitdataTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[gitdata]", function() { var client; diff --git a/api/v3.0.0/gitignoreTest.js b/test/gitignoreTest.js similarity index 97% rename from api/v3.0.0/gitignoreTest.js rename to test/gitignoreTest.js index e533eb4c88..4f1f016ea6 100644 --- a/api/v3.0.0/gitignoreTest.js +++ b/test/gitignoreTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[gitignore]", function() { var client; diff --git a/api/v3.0.0/issuesTest.js b/test/issuesTest.js similarity index 99% rename from api/v3.0.0/issuesTest.js rename to test/issuesTest.js index c9f217bff9..9b5001b3b3 100644 --- a/api/v3.0.0/issuesTest.js +++ b/test/issuesTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[issues]", function() { var client; diff --git a/api/v3.0.0/markdownTest.js b/test/markdownTest.js similarity index 97% rename from api/v3.0.0/markdownTest.js rename to test/markdownTest.js index 29846a0fd3..0bce309e0e 100644 --- a/api/v3.0.0/markdownTest.js +++ b/test/markdownTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[markdown]", function() { var client; diff --git a/api/v3.0.0/miscTest.js b/test/miscTest.js similarity index 98% rename from api/v3.0.0/miscTest.js rename to test/miscTest.js index 6cee44f2f7..5e822c1cc4 100644 --- a/api/v3.0.0/miscTest.js +++ b/test/miscTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[misc]", function() { var client; diff --git a/test/oauth_server.js b/test/oauth_server.js index 1a2e7cf73b..37a7c44e7b 100644 --- a/test/oauth_server.js +++ b/test/oauth_server.js @@ -1,8 +1,8 @@ "use strict"; -var GitHubApi = require("./../index"); +var Client = require("./../index"); -var github = new GitHubApi({ +var github = new Client({ version: "3.0.0" }); @@ -56,4 +56,4 @@ github.authorization.getAll({}, function(err, res) { }); } -}); \ No newline at end of file +}); diff --git a/api/v3.0.0/orgsTest.js b/test/orgsTest.js similarity index 99% rename from api/v3.0.0/orgsTest.js rename to test/orgsTest.js index 44faeed898..542de03f2a 100644 --- a/api/v3.0.0/orgsTest.js +++ b/test/orgsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[orgs]", function() { var client; diff --git a/api/v3.0.0/pullRequestsTest.js b/test/pullRequestsTest.js similarity index 99% rename from api/v3.0.0/pullRequestsTest.js rename to test/pullRequestsTest.js index 0b47fe8e89..1d3bb994fa 100644 --- a/api/v3.0.0/pullRequestsTest.js +++ b/test/pullRequestsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[pullRequests]", function() { var client; diff --git a/api/v3.0.0/releasesTest.js b/test/releasesTest.js similarity index 99% rename from api/v3.0.0/releasesTest.js rename to test/releasesTest.js index b2fc2fefe7..137a270adc 100644 --- a/api/v3.0.0/releasesTest.js +++ b/test/releasesTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); var fs = require("fs"); var mime = require("mime"); diff --git a/api/v3.0.0/reposTest.js b/test/reposTest.js similarity index 99% rename from api/v3.0.0/reposTest.js rename to test/reposTest.js index 356fab65be..75c60802fa 100644 --- a/api/v3.0.0/reposTest.js +++ b/test/reposTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[repos]", function() { var client; diff --git a/api/v3.0.0/searchTest.js b/test/searchTest.js similarity index 98% rename from api/v3.0.0/searchTest.js rename to test/searchTest.js index f95bc2d141..fc997be35e 100644 --- a/api/v3.0.0/searchTest.js +++ b/test/searchTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[search]", function() { var client; diff --git a/api/v3.0.0/statusesTest.js b/test/statusesTest.js similarity index 98% rename from api/v3.0.0/statusesTest.js rename to test/statusesTest.js index 5c23b4c7f3..53561696e7 100644 --- a/api/v3.0.0/statusesTest.js +++ b/test/statusesTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[statuses]", function() { var client; diff --git a/api/v3.0.0/userTest.js b/test/userTest.js similarity index 99% rename from api/v3.0.0/userTest.js rename to test/userTest.js index c7b7a1061e..987d89d718 100644 --- a/api/v3.0.0/userTest.js +++ b/test/userTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../index"); describe("[user]", function() { var client; From 080773a5983bccbc1cc257fd46685174c04ad670 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 02:19:36 -0500 Subject: [PATCH 076/461] save progress --- README.md | 4 +--- api/{v3.0.0 => }/apidocs.js | 0 api/{v3.0.0 => }/gitignore.js | 0 api/{v3.0.0 => }/misc.js | 0 api/{v3.0.0 => }/releases.js | 0 {test => examples}/example.js | 7 +++---- {test => examples}/oauth.js | 24 +++++++++++------------- {test => examples}/oauth_server.js | 4 +--- index.js | 15 ++++----------- api/v3.0.0/routes.json => routes.json | 0 templates/test_section.js.tpl | 4 +--- test/authorizationTest.js | 4 +--- test/eventsTest.js | 4 +--- test/gistsTest.js | 4 +--- test/gitdataTest.js | 4 +--- test/gitignoreTest.js | 4 +--- test/issuesTest.js | 4 +--- test/markdownTest.js | 4 +--- test/miscTest.js | 4 +--- test/orgsTest.js | 4 +--- test/pullRequestsTest.js | 4 +--- test/releasesTest.js | 4 +--- test/reposTest.js | 4 +--- test/searchTest.js | 8 +++----- test/statusesTest.js | 4 +--- test/userTest.js | 4 +--- 26 files changed, 38 insertions(+), 84 deletions(-) rename api/{v3.0.0 => }/apidocs.js (100%) rename api/{v3.0.0 => }/gitignore.js (100%) rename api/{v3.0.0 => }/misc.js (100%) rename api/{v3.0.0 => }/releases.js (100%) rename {test => examples}/example.js (93%) rename {test => examples}/oauth.js (91%) rename {test => examples}/oauth_server.js (96%) rename api/v3.0.0/routes.json => routes.json (100%) diff --git a/README.md b/README.md index 36dc072b16..797d321156 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,6 @@ Get all followers for user "defunkt": var GitHubApi = require("github4"); var github = new GitHubApi({ - // required - version: "3.0.0", // optional debug: true, protocol: "https", @@ -134,7 +132,7 @@ $ mocha Or run a specific test ```bash -$ mocha api/v3.0.0/issuesTest.js +$ mocha test/issuesTest.js ``` ## LICENSE diff --git a/api/v3.0.0/apidocs.js b/api/apidocs.js similarity index 100% rename from api/v3.0.0/apidocs.js rename to api/apidocs.js diff --git a/api/v3.0.0/gitignore.js b/api/gitignore.js similarity index 100% rename from api/v3.0.0/gitignore.js rename to api/gitignore.js diff --git a/api/v3.0.0/misc.js b/api/misc.js similarity index 100% rename from api/v3.0.0/misc.js rename to api/misc.js diff --git a/api/v3.0.0/releases.js b/api/releases.js similarity index 100% rename from api/v3.0.0/releases.js rename to api/releases.js diff --git a/test/example.js b/examples/example.js similarity index 93% rename from test/example.js rename to examples/example.js index 4c28886244..b7510f7f2c 100644 --- a/test/example.js +++ b/examples/example.js @@ -1,8 +1,8 @@ /** section: github, internal * Example - * + * * Github API usage example. - * + * * Copyright 2012 Cloud9 IDE, Inc. * * This product includes software developed by @@ -16,8 +16,7 @@ var Client = require("./../index"); var github = new Client({ - debug: true, - version: "3.0.0" + debug: true }); github.authenticate({ diff --git a/test/oauth.js b/examples/oauth.js similarity index 91% rename from test/oauth.js rename to examples/oauth.js index 3fbeadd663..2238b8990f 100644 --- a/test/oauth.js +++ b/examples/oauth.js @@ -1,8 +1,8 @@ /** section: github, internal * OAuth - * + * * OAuth usage example. - * + * * Copyright 2012 Cloud9 IDE, Inc. * * This product includes software developed by @@ -18,9 +18,7 @@ var querystring = require("querystring"); var Client = require("../index"); var OAuth2 = require("oauth").OAuth2; -var github = new Client({ - version: "3.0.0" -}); +var github = new Client(); var clientId = "e8c434a1c92e9de7ff8d"; var secret = "1d0fcbb060e1dd86a0aa3d12265419c9bb19a333"; @@ -34,12 +32,12 @@ http.createServer(function(req, res) { var url = Url.parse(req.url); var path = url.pathname; var query = querystring.parse(url.query); - + if (path == "/" || path.match(/^\/user\/?$/)) { // redirect to github if there is no access token if (!accessToken) { res.writeHead(303, { - Location: oauth.getAuthorizeUrl({ + Location: oauth.getAuthorizeUrl({ redirect_uri: 'http://localhost:7878/github-callback', scope: "user,repo,gist" }) @@ -47,8 +45,8 @@ http.createServer(function(req, res) { res.end(); return; } - - // use github API + + // use github API github.user.get({}, function(err, user) { if (err) { res.writeHead(err.code); @@ -59,7 +57,7 @@ http.createServer(function(req, res) { res.end(JSON.stringify(user)); }); return; - } + } // URL called by github after authenticating else if (path.match(/^\/github-callback\/?$/)) { // upgrade the code to an access token @@ -70,15 +68,15 @@ http.createServer(function(req, res) { res.end(err + ""); return; } - + accessToken = access_token; - + // authenticate github API github.authenticate({ type: "oauth", token: accessToken }); - + //redirect back res.writeHead(303, { Location: "/" diff --git a/test/oauth_server.js b/examples/oauth_server.js similarity index 96% rename from test/oauth_server.js rename to examples/oauth_server.js index 37a7c44e7b..14e7bb4042 100644 --- a/test/oauth_server.js +++ b/examples/oauth_server.js @@ -2,9 +2,7 @@ var Client = require("./../index"); -var github = new Client({ - version: "3.0.0" -}); +var github = new Client(); /* !!!UNCOMMENT THE FOLLOWING TO MAKE THIS SCRIPT WORK, BUT CHANGE THE CREDENTIALS TO YOUR OWN!!! diff --git a/index.js b/index.js index 5fe83d1f58..236abaf777 100644 --- a/index.js +++ b/index.js @@ -16,14 +16,8 @@ var Url = require("url"); * * Author: Mike de Boer * - * [[Client]] can load any version of the [[github]] client API, with the - * requirement that a valid routes.json definition file is present in the - * `api/[VERSION]` directory and that the routes found in this file are - * implemented as well. - * * Upon instantiation of the [[Client]] class, the routes.json file is loaded - * from the API version specified in the configuration and, parsed and from it - * the routes for HTTP requests are extracted. For each HTTP endpoint to the + * and parsed for the API HTTP endpoints. For each HTTP endpoint to the * HTTP server, a method is generated which accepts a Javascript Object * with parameters and an optional callback to be invoked when the API request * returns from the server or when the parameters could not be validated. @@ -179,8 +173,7 @@ var Client = module.exports = function(config) { this.config = config; this.debug = Util.isTrue(config.debug); - this.version = config.version; - this[this.version] = JSON.parse(fs.readFileSync(__dirname + "/api/v" + this.version + "/routes.json", "utf8")); + this.routes = JSON.parse(fs.readFileSync(__dirname + "/routes.json", "utf8")); var pathPrefix = ""; // Check if a prefix is passed in the config and strip any leading or trailing slashes from it. @@ -196,7 +189,7 @@ var Client = module.exports = function(config) { /** * Client#setupRoutes() -> null * - * Configures the routes as defined in a routes.json file of an API version + * Configures the routes as defined in routes.json. * * [[Client#setupRoutes]] is invoked by the constructor, takes the * contents of the JSON document that contains the definitions of all the @@ -222,7 +215,7 @@ var Client = module.exports = function(config) { **/ this.setupRoutes = function() { var self = this; - var routes = this[this.version]; + var routes = this.routes; var defines = routes.defines; this.constants = defines.constants; this.requestHeaders = defines["request-headers"].map(function(header) { diff --git a/api/v3.0.0/routes.json b/routes.json similarity index 100% rename from api/v3.0.0/routes.json rename to routes.json diff --git a/templates/test_section.js.tpl b/templates/test_section.js.tpl index bde8fbfec0..6c88297a13 100644 --- a/templates/test_section.js.tpl +++ b/templates/test_section.js.tpl @@ -17,9 +17,7 @@ describe("[<%sectionName%>]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "<%version%>" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/authorizationTest.js b/test/authorizationTest.js index 008a5c17cc..5acc4b5c2b 100644 --- a/test/authorizationTest.js +++ b/test/authorizationTest.js @@ -19,9 +19,7 @@ describe("[authorization]", function() { this.timeout(10000); beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "basic", username: "mikedeboertest", diff --git a/test/eventsTest.js b/test/eventsTest.js index 7487586444..bd8728aaf5 100644 --- a/test/eventsTest.js +++ b/test/eventsTest.js @@ -17,9 +17,7 @@ describe("[events]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/gistsTest.js b/test/gistsTest.js index 212228da87..bd8ea5cb6d 100644 --- a/test/gistsTest.js +++ b/test/gistsTest.js @@ -18,9 +18,7 @@ describe("[gists]", function() { timeout(5000); beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/gitdataTest.js b/test/gitdataTest.js index cef67d22c8..da838a1d21 100644 --- a/test/gitdataTest.js +++ b/test/gitdataTest.js @@ -17,9 +17,7 @@ describe("[gitdata]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/gitignoreTest.js b/test/gitignoreTest.js index 4f1f016ea6..a6bc60c550 100644 --- a/test/gitignoreTest.js +++ b/test/gitignoreTest.js @@ -16,9 +16,7 @@ describe("[gitignore]", function() { var client; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); }); it("should successfully execute GET /gitignore/templates (templates)", function(next) { diff --git a/test/issuesTest.js b/test/issuesTest.js index 9b5001b3b3..dd859c6394 100644 --- a/test/issuesTest.js +++ b/test/issuesTest.js @@ -17,9 +17,7 @@ describe("[issues]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/markdownTest.js b/test/markdownTest.js index 0bce309e0e..200bb52c40 100644 --- a/test/markdownTest.js +++ b/test/markdownTest.js @@ -17,9 +17,7 @@ describe("[markdown]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); /*client.authenticate({ type: "oauth", token: token diff --git a/test/miscTest.js b/test/miscTest.js index 5e822c1cc4..2bb082a020 100644 --- a/test/miscTest.js +++ b/test/miscTest.js @@ -16,9 +16,7 @@ describe("[misc]", function() { var client; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); }); it("should successfully execute GET /emojis (emojis)", function(next) { diff --git a/test/orgsTest.js b/test/orgsTest.js index 542de03f2a..9564a0a1bb 100644 --- a/test/orgsTest.js +++ b/test/orgsTest.js @@ -17,9 +17,7 @@ describe("[orgs]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/pullRequestsTest.js b/test/pullRequestsTest.js index 1d3bb994fa..b042b1f46c 100644 --- a/test/pullRequestsTest.js +++ b/test/pullRequestsTest.js @@ -17,9 +17,7 @@ describe("[pullRequests]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/releasesTest.js b/test/releasesTest.js index 137a270adc..cbe4d98e38 100644 --- a/test/releasesTest.js +++ b/test/releasesTest.js @@ -31,9 +31,7 @@ describe("[releases]", function() { var newAssetId; // asset id used when creating asset. Used for edit and delete asset beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/reposTest.js b/test/reposTest.js index 75c60802fa..fe21c7bd6b 100644 --- a/test/reposTest.js +++ b/test/reposTest.js @@ -17,9 +17,7 @@ describe("[repos]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/searchTest.js b/test/searchTest.js index fc997be35e..b6b5d89d6a 100644 --- a/test/searchTest.js +++ b/test/searchTest.js @@ -17,13 +17,11 @@ describe("[search]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - /*client.authenticate({ + client = new Client(); + client.authenticate({ type: "oauth", token: token - });*/ + }); }); it("should successfully execute GET /search/code/:q (code)", function(next) { diff --git a/test/statusesTest.js b/test/statusesTest.js index 53561696e7..bc8f03af53 100644 --- a/test/statusesTest.js +++ b/test/statusesTest.js @@ -17,9 +17,7 @@ describe("[statuses]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token diff --git a/test/userTest.js b/test/userTest.js index 987d89d718..1a09af3a41 100644 --- a/test/userTest.js +++ b/test/userTest.js @@ -17,9 +17,7 @@ describe("[user]", function() { var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token From 6c0a2f908fa71768ebd57c33d712c2cd54f48e80 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 02:23:39 -0500 Subject: [PATCH 077/461] remove versions from generate --- generate.js | 347 ++++++++++++++++++++++++---------------------------- 1 file changed, 157 insertions(+), 190 deletions(-) diff --git a/generate.js b/generate.js index ef73ee4308..4ca26bed34 100644 --- a/generate.js +++ b/generate.js @@ -16,192 +16,186 @@ var fs = require("fs"); var Path = require("path"); var Url = require("url"); -var Async = require("async"); var Optimist = require("optimist"); var Util = require("./util"); var TestSectionTpl = fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); var TestHandlerTpl = fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); -var main = module.exports = function(versions, tests, restore) { - Util.log("Generating for versions", Object.keys(versions)); - - Async.each(Object.keys(versions), function(version, versionDone) { - var dir = Path.join(__dirname, "api", version); - - // If we're in restore mode, move .bak file back to their original position - // and short-circuit. - if (restore) { - var bakRE = /\.bak$/; - var files = fs.readdirSync(dir).filter(function(file) { - return bakRE.test(file); - }).forEach(function(file) { - var from = Path.join(dir, file); - var to = Path.join(dir, file.replace(/\.bak$/, "")); - fs.renameSync(from, to); - Util.log("Restored '" + file + "' (" + version + ")"); - }); - - versionDone(); - return; - } +var main = module.exports = function(routes, tests, restore) { + Util.log("Generating..."); + + var dir = Path.join(__dirname, "api"); + + // If we're in restore mode, move .bak file back to their original position + // and short-circuit. + if (restore) { + var bakRE = /\.bak$/; + var files = fs.readdirSync(dir).filter(function(file) { + return bakRE.test(file); + }).forEach(function(file) { + var from = Path.join(dir, file); + var to = Path.join(dir, file.replace(/\.bak$/, "")); + fs.renameSync(from, to); + Util.log("Restored '" + file); + }); - var routes = versions[version]; - var defines = routes.defines; - delete routes.defines; - var sections = {}; - var testSections = {}; - var apidocs = ""; + return; + } - function createComment(paramsStruct, section, funcName) { - var params = Object.keys(paramsStruct); - var comment = [ - "/** section: github", - " * " + section + "#" + funcName + "(msg, callback) -> null", - " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", - " * - callback (Function): function to call when the request is finished " + - "with an error as first argument and result data as second argument.", - " * ", - " * ##### Params on the `msg` object:", - " * " - ]; - comment.push(" * - headers (Object): Optional. Key/ value pair " - + "of request headers to pass along with the HTTP request. Valid headers are: " - + "'" + defines["request-headers"].join("', '") + "'."); - if (!params.length) - comment.push(" * No other params, simply pass an empty Object literal `{}`"); - var paramName, def, line; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); - } - else - def = defines.params[paramName]; + var defines = routes.defines; + delete routes.defines; + var sections = {}; + var testSections = {}; + var apidocs = ""; + + function createComment(paramsStruct, section, funcName) { + var params = Object.keys(paramsStruct); + var comment = [ + "/** section: github", + " * " + section + "#" + funcName + "(msg, callback) -> null", + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", + " * - callback (Function): function to call when the request is finished " + + "with an error as first argument and result data as second argument.", + " * ", + " * ##### Params on the `msg` object:", + " * " + ]; + comment.push(" * - headers (Object): Optional. Key/ value pair " + + "of request headers to pass along with the HTTP request. Valid headers are: " + + "'" + defines["request-headers"].join("', '") + "'."); + if (!params.length) + comment.push(" * No other params, simply pass an empty Object literal `{}`"); + var paramName, def, line; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); } else - def = paramsStruct[paramName]; - - line = " * - " + paramName + " (" + (def.type || "mixed") + "): " + - (def.required ? "Required." : "Optional."); - if (def.description) - line += " " + def.description; - if (def.validation) - line += " Validation rule: ` " + def.validation + " `."; - - comment.push(line); + def = defines.params[paramName]; } + else + def = paramsStruct[paramName]; + + line = " * - " + paramName + " (" + (def.type || "mixed") + "): " + + (def.required ? "Required." : "Optional."); + if (def.description) + line += " " + def.description; + if (def.validation) + line += " Validation rule: ` " + def.validation + " `."; - return comment.join("\n") + "\n **/\n"; + comment.push(line); } - function getParams(paramsStruct, indent) { - var params = Object.keys(paramsStruct); - if (!params.length) - return "{}"; - var values = []; - var paramName, def; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); - } - else - def = defines.params[paramName]; + return comment.join("\n") + "\n **/\n"; + } + + function getParams(paramsStruct, indent) { + var params = Object.keys(paramsStruct); + if (!params.length) + return "{}"; + var values = []; + var paramName, def; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); } else - def = paramsStruct[paramName]; - - values.push(indent + " " + paramName + ": \"" + def.type + "\""); + def = defines.params[paramName]; } - return "{\n" + values.join(",\n") + "\n" + indent + "}"; - } - - function prepareApi(struct, baseType) { - if (!baseType) - baseType = ""; + else + def = paramsStruct[paramName]; - Object.keys(struct).forEach(function(routePart) { - var block = struct[routePart]; - if (!block) - return; - var messageType = baseType + "/" + routePart; - if (block.url && block.params) { - // we ended up at an API definition part! - var parts = messageType.split("/"); - var section = Util.toCamelCase(parts[1]); - if (!block.method) { - throw new Error("No HTTP method specified for " + messageType + - "in section " + section); - } - - // add the handler to the sections - if (!sections[section]) { - sections[section] = []; - apidocs += "/** section: github\n"; - apidocs += " * mixin " + section + "\n"; - apidocs += " **/\n"; - } + values.push(indent + " " + paramName + ": \"" + def.type + "\""); + } + return "{\n" + values.join(",\n") + "\n" + indent + "}"; + } - parts.splice(0, 2); - var funcName = Util.toCamelCase(parts.join("-")); - apidocs += createComment(block.params, section, funcName); + function prepareApi(struct, baseType) { + if (!baseType) + baseType = ""; - // add test to the testSections - if (!testSections[section]) - testSections[section] = []; - testSections[section].push(TestHandlerTpl - .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") - .replace("<%funcName%>", section + "." + funcName) - .replace("<%params%>", getParams(block.params, " ")) - ); + Object.keys(struct).forEach(function(routePart) { + var block = struct[routePart]; + if (!block) + return; + var messageType = baseType + "/" + routePart; + if (block.url && block.params) { + // we ended up at an API definition part! + var parts = messageType.split("/"); + var section = Util.toCamelCase(parts[1]); + if (!block.method) { + throw new Error("No HTTP method specified for " + messageType + + "in section " + section); } - else { - // recurse into this block next: - prepareApi(block, messageType); + + // add the handler to the sections + if (!sections[section]) { + sections[section] = []; + apidocs += "/** section: github\n"; + apidocs += " * mixin " + section + "\n"; + apidocs += " **/\n"; } - }); - } - Util.log("Converting routes to functions"); - prepareApi(routes); + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + apidocs += createComment(block.params, section, funcName); + + // add test to the testSections + if (!testSections[section]) + testSections[section] = []; + testSections[section].push(TestHandlerTpl + .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") + .replace("<%funcName%>", section + "." + funcName) + .replace("<%params%>", getParams(block.params, " ")) + ); + } + else { + // recurse into this block next: + prepareApi(block, messageType); + } + }); + } - Util.log("Writing files to version dir"); + Util.log("Converting routes to functions"); + prepareApi(routes); - fs.writeFileSync(dir + "/apidocs.js", apidocs); + var apidocsPath = Path.join(__dirname, "doc", "apidocs.js"); + fs.writeFileSync(apidocsPath, apidocs); - Object.keys(sections).forEach(function(section) { - // When we don't need to generate tests, bail out here. - if (!tests) - return; + Object.keys(sections).forEach(function(section) { + // When we don't need to generate tests, bail out here. + if (!tests) + return; - var def = testSections[section]; - // test if previous tests already contained implementations by checking - // if the difference in character count between the current test file - // and the newly generated one is more than twenty characters. - var body = TestSectionTpl - .replace("<%version%>", version.replace("v", "")) - .replace(/<%sectionName%>/g, section) - .replace("<%testBody%>", def.join("\n\n")); - var path = Path.join(testDir, section + "Test.js"); - if (fs.existsSync(path) && Math.abs(fs.readFileSync(path, "utf8").length - body.length) >= 20) { - Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + - "that were already implemented. \nPlease be sure te check this file " + - "and move all implemented tests back into the newly generated test!", "error"); - fs.renameSync(path, path + ".bak"); - } + var def = testSections[section]; + // test if previous tests already contained implementations by checking + // if the difference in character count between the current test file + // and the newly generated one is more than twenty characters. + var body = TestSectionTpl + .replace("<%version%>", "3.0.0") + .replace(/<%sectionName%>/g, section) + .replace("<%testBody%>", def.join("\n\n")); + var path = Path.join(__dirname, "test", section + "Test.js"); + if (fs.existsSync(path) && Math.abs(fs.readFileSync(path, "utf8").length - body.length) >= 20) { + Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + + "that were already implemented. \nPlease be sure te check this file " + + "and move all implemented tests back into the newly generated test!", "error"); + fs.renameSync(path, path + ".bak"); + } - Util.log("Writing test file for " + section + ", version " + version); - fs.writeFileSync(path, body, "utf8"); - }); + Util.log("Writing test file for " + section); + fs.writeFileSync(path, body, "utf8"); }); }; @@ -212,8 +206,6 @@ if (!module.parent) { + "unit-test scaffolds.\nUsage: $0 [-r] [-v VERSION]") .alias("r", "restore") .describe("r", "Restore .bak files, generated by a previous run, to the original") - .alias("v", "version") - .describe("v", "Semantic version number of the API to generate. Example: '3.0.0'") .alias("t", "tests") .describe("t", "Also generate unit test scaffolds") .alias("h", "help") @@ -226,38 +218,13 @@ if (!module.parent) { process.exit(); } - var baseDir = Path.join(__dirname, "api"); - var testDir = Path.join(__dirname, "test"); - var availVersions = {}; - fs.readdirSync(baseDir).forEach(function(version) { - var path = Path.join(baseDir, version, "routes.json"); - if (!fs.existsSync(path)) - return; - var routes = JSON.parse(fs.readFileSync(path, "utf8")); - if (!routes.defines) - return; - availVersions[version] = routes; - }); - - if (!Object.keys(availVersions).length) { - Util.log("No versions available to generate.", "fatal"); + var routesPath = Path.join(__dirname, "routes.json"); + var routes = JSON.parse(fs.readFileSync(routesPath, "utf8")); + if (!routes.defines) { + Util.log("No routes defined.", "fatal"); process.exit(1); } - var versions = {}; - if (argv.version) { - if (argv.version.charAt(0) != "v") - argv.version = argv.v = "v" + argv.version; - if (!availVersions[argv.version]) { - Util.log("Version '" + argv.version + "' is not available", "fatal"); - process.exit(1); - } - versions[argv.version] = availVersions[argv.version]; - } - if (!Object.keys(versions).length) { - Util.log("No versions specified via the command line, generating for all available versions."); - versions = availVersions; - } Util.log("Starting up..."); - main(versions, argv.tests, argv.restore); + main(routes, argv.tests, argv.restore); } From 903a2435e9bf62ccbeecf42befd452a59d1a9669 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 02:32:35 -0500 Subject: [PATCH 078/461] remove remaining stuff in api folder move apidocs.js to doc folder --- api/gitignore.js | 112 -------- api/misc.js | 157 ------------ api/releases.js | 556 ---------------------------------------- {api => doc}/apidocs.js | 0 4 files changed, 825 deletions(-) delete mode 100644 api/gitignore.js delete mode 100644 api/misc.js delete mode 100644 api/releases.js rename {api => doc}/apidocs.js (100%) diff --git a/api/gitignore.js b/api/gitignore.js deleted file mode 100644 index b489251055..0000000000 --- a/api/gitignore.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * mixin gitignore - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gitignore = module.exports = { - gitignore: {} -}; - -(function() { - /** section: github - * gitignore#templates(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.templates = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitignore#template(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required.The name of the .gitignore template to get - **/ - this.template = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - -}).call(gitignore.gitignore); diff --git a/api/misc.js b/api/misc.js deleted file mode 100644 index 6d3723b211..0000000000 --- a/api/misc.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * mixin misc - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var misc = module.exports = { - misc: {} -}; - -(function() { - /** section: github - * misc#emojis(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.emojis = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * misc#meta(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.meta = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * misc#rateLimit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.rateLimit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - -}).call(misc.misc); diff --git a/api/releases.js b/api/releases.js deleted file mode 100644 index 5ba74e142d..0000000000 --- a/api/releases.js +++ /dev/null @@ -1,556 +0,0 @@ -/** - * mixin releases - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var releases = module.exports = { - releases: {} -}; - -(function() { - /** section: github - * releases#listReleases(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.listReleases = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#getRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.getRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#getLatestRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - * https://developer.github.com/v3/repos/releases/#get-the-latest-release - **/ - this.getLatestRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#createRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - tag_name (String): Required.String of the tag - * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. - * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false - * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - **/ - this.createRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#editRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - tag_name (String): Required.String of the tag - * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. - * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false - * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - **/ - this.editRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#deleteRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.deleteRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#listAssets(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.listAssets = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#getAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.getAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#uploadAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - name (String): Required. The file name of the asset. - * - filePath (String): Required. The file path of the asset. - **/ - this.uploadAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#editAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - name (String): Required. - * - label (String): Optional. An alternate short description of the asset. Used in place of the filename. - **/ - this.editAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#deleteAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.deleteAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data; - var contentType = res.headers["content-type"]; - if (contentType && contentType.indexOf("application/json") !== -1) - ret = JSON.parse(ret); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (typeof ret == "object") { - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - } - - if (callback) - callback(null, ret); - }); - }; - -}).call(releases.releases); diff --git a/api/apidocs.js b/doc/apidocs.js similarity index 100% rename from api/apidocs.js rename to doc/apidocs.js From ae7be4dbda2564b315ff3997d900a838786f9a8f Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 02:43:22 -0500 Subject: [PATCH 079/461] remove restore stuff --- generate.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/generate.js b/generate.js index 4ca26bed34..c6609ef3f0 100644 --- a/generate.js +++ b/generate.js @@ -22,27 +22,9 @@ var Util = require("./util"); var TestSectionTpl = fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); var TestHandlerTpl = fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); -var main = module.exports = function(routes, tests, restore) { +var main = module.exports = function(routes, tests) { Util.log("Generating..."); - var dir = Path.join(__dirname, "api"); - - // If we're in restore mode, move .bak file back to their original position - // and short-circuit. - if (restore) { - var bakRE = /\.bak$/; - var files = fs.readdirSync(dir).filter(function(file) { - return bakRE.test(file); - }).forEach(function(file) { - var from = Path.join(dir, file); - var to = Path.join(dir, file.replace(/\.bak$/, "")); - fs.renameSync(from, to); - Util.log("Restored '" + file); - }); - - return; - } - var defines = routes.defines; delete routes.defines; var sections = {}; @@ -204,13 +186,11 @@ if (!module.parent) { .wrap(80) .usage("Generate the implementation of the node-github module, including " + "unit-test scaffolds.\nUsage: $0 [-r] [-v VERSION]") - .alias("r", "restore") - .describe("r", "Restore .bak files, generated by a previous run, to the original") .alias("t", "tests") .describe("t", "Also generate unit test scaffolds") .alias("h", "help") .describe("h", "Display this usage information") - .boolean(["r", "t", "h"]) + .boolean(["t", "h"]) .argv; if (argv.help) { @@ -226,5 +206,5 @@ if (!module.parent) { } Util.log("Starting up..."); - main(routes, argv.tests, argv.restore); + main(routes, argv.tests); } From 090bb08722136ad64391aa23016f8b7692ffb22b Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 21 Dec 2015 20:20:40 -0500 Subject: [PATCH 080/461] add test auth token to example --- examples/example.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/example.js b/examples/example.js index b7510f7f2c..3f6cf85dd0 100644 --- a/examples/example.js +++ b/examples/example.js @@ -20,9 +20,8 @@ var github = new Client({ }); github.authenticate({ - type: "basic", - username: "mikedeboer", - password: "mysecretpass" + type: "oauth", + token: "ef6b58a25fc2e0145754610c3d3b6dce2251d6c1" }); github.user.get({}, function(err, res) { From 9c6050cf04bd5363789f1a6f8cec1c4d489bcc6b Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Tue, 22 Dec 2015 14:50:54 -0500 Subject: [PATCH 081/461] make oauth dependency instead of dev dependency bump patch number --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index faf90f8b90..00c192def8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github4", - "version": "0.2.8", + "version": "0.2.9", "description": "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ @@ -28,12 +28,12 @@ "dependencies": { "follow-redirects": "0.0.7", "https-proxy-agent": "^1.0.0", - "mime": "^1.2.11" + "mime": "^1.2.11", + "oauth": "^0.9.14" }, "devDependencies": { "async": "^0.9.0", "mocha": "~1.13.0", - "oauth": "~0.9.7", "optimist": "~0.6.0", "should": "^8.0.2" }, From 925a89b2475b6f02277ef73b39f8c9d999dd4264 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Tue, 22 Dec 2015 14:58:35 -0500 Subject: [PATCH 082/461] fix path for example test in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36dc072b16..7aafe490ce 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ $ mocha Or run a specific test ```bash -$ mocha api/v3.0.0/issuesTest.js +$ mocha test/issuesTest.js ``` ## LICENSE From f2b4362879dcb78b5d7c908ffa973d3051469645 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 23 Dec 2015 03:51:34 -0500 Subject: [PATCH 083/461] sendError, handler functions got excluded from merge of pr/121 --- index.js | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 5fe83d1f58..e5ef155586 100644 --- a/index.js +++ b/index.js @@ -509,7 +509,7 @@ var Client = module.exports = function(config) { if (typeof ret == "object") { if (!ret.meta) ret.meta = {}; - self.responseHeaders.forEach(function(header) { + self.responseHeaders.forEach(function(header) { if (res.headers[header]) ret.meta[header] = res.headers[header]; }); @@ -825,4 +825,44 @@ var Client = module.exports = function(config) { httpSendRequest(); } }; + + this.sendError = function(err, block, msg, callback) { + if (this.debug) + Util.log(err, block, msg, "error"); + if (typeof err == "string") + err = new error.InternalServerError(err); + if (callback) + callback(err); + }; + + this.handler = function(msg, block, callback) { + var self = this; + this.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, msg, null, callback); + + var ret; + try { + ret = res.data && JSON.parse(res.data); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) { + ret = {}; + } + ret.meta = {}; + self.responseHeaders.forEach(function(header) { + if (res.headers[header]) { + ret.meta[header] = res.headers[header]; + } + }); + + if (callback) + callback(null, ret); + }); + } }).call(Client.prototype); From 587d519dce648f5bfdc9e9ff50d3fb46418e2571 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 23 Dec 2015 03:58:53 -0500 Subject: [PATCH 084/461] simplify example --- examples/example.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/example.js b/examples/example.js index 3f6cf85dd0..2b39576a54 100644 --- a/examples/example.js +++ b/examples/example.js @@ -21,15 +21,9 @@ var github = new Client({ github.authenticate({ type: "oauth", - token: "ef6b58a25fc2e0145754610c3d3b6dce2251d6c1" + token: "" }); github.user.get({}, function(err, res) { - console.log("GOT ERR?", err); - console.log("GOT RES?", res); - - github.repos.getAll({}, function(err, res) { - console.log("GOT ERR?", err); - console.log("GOT RES?", res); - }); + console.log(err, res); }); From 9c2b7dde4b8e120eaff8adf96808df9bb4ce279d Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 23 Dec 2015 04:13:21 -0500 Subject: [PATCH 085/461] Example: client.issues.repoIssues called twice in a row with a different repo each time - after the first call the repo is 'filled in' (':repo' is expanded in the 'block' object itself) the path and therefore cannot be changed for the second (or any subsequent) call so that second call fails. - zzo merge change from pr/289 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 36b57a2652..61d06679e8 100644 --- a/index.js +++ b/index.js @@ -349,7 +349,7 @@ var Client = module.exports = function(config) { // on error, there's no need to continue. return; } - self.handler(msg, block, callback); + self.handler(msg, JSON.parse(JSON.stringify(block)), callback); }; } else { From a7f93ef8fac94e869a5470eebdd2b8f266fbf1da Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 23 Dec 2015 04:19:56 -0500 Subject: [PATCH 086/461] small change to example --- examples/oauth_server.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/oauth_server.js b/examples/oauth_server.js index 14e7bb4042..649c0ca4d0 100644 --- a/examples/oauth_server.js +++ b/examples/oauth_server.js @@ -4,14 +4,11 @@ var Client = require("./../index"); var github = new Client(); -/* -!!!UNCOMMENT THE FOLLOWING TO MAKE THIS SCRIPT WORK, BUT CHANGE THE CREDENTIALS TO YOUR OWN!!! github.authenticate({ type: "basic", - username: "mikedeboertest", - password: "test1324" + username: "", + password: "" }); -*/ github.authorization.getAll({}, function(err, res) { if (err) From cfcea41f0ccfe92a29c22b9b1e1365fdf0d025bf Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 23 Dec 2015 04:22:07 -0500 Subject: [PATCH 087/461] bump patch # --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00c192def8..c9818a9713 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github4", - "version": "0.2.9", + "version": "0.2.10", "description": "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ From febec33419ac64ee63b7fd89df1921d98820f3bc Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 06:12:45 -0500 Subject: [PATCH 088/461] clean up examples --- examples/{example.js => get_user.js} | 2 +- examples/oauth.js | 93 ---------------------------- examples/oauth_server.js | 54 ---------------- 3 files changed, 1 insertion(+), 148 deletions(-) rename examples/{example.js => get_user.js} (89%) delete mode 100644 examples/oauth.js delete mode 100644 examples/oauth_server.js diff --git a/examples/example.js b/examples/get_user.js similarity index 89% rename from examples/example.js rename to examples/get_user.js index 2b39576a54..f482af5d1d 100644 --- a/examples/example.js +++ b/examples/get_user.js @@ -21,7 +21,7 @@ var github = new Client({ github.authenticate({ type: "oauth", - token: "" + token: "TOKEN" // Replace with your oauth token }); github.user.get({}, function(err, res) { diff --git a/examples/oauth.js b/examples/oauth.js deleted file mode 100644 index 2238b8990f..0000000000 --- a/examples/oauth.js +++ /dev/null @@ -1,93 +0,0 @@ -/** section: github, internal - * OAuth - * - * OAuth usage example. - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -var http = require("http"); -var Url = require("url"); -var querystring = require("querystring"); - -var Client = require("../index"); -var OAuth2 = require("oauth").OAuth2; - -var github = new Client(); - -var clientId = "e8c434a1c92e9de7ff8d"; -var secret = "1d0fcbb060e1dd86a0aa3d12265419c9bb19a333"; -var oauth = new OAuth2(clientId, secret, "https://github.com/", "login/oauth/authorize", "login/oauth/access_token"); - -// for demo purposes use one global access token -// in production this has to be stored in a user session -var accessToken = ""; - -http.createServer(function(req, res) { - var url = Url.parse(req.url); - var path = url.pathname; - var query = querystring.parse(url.query); - - if (path == "/" || path.match(/^\/user\/?$/)) { - // redirect to github if there is no access token - if (!accessToken) { - res.writeHead(303, { - Location: oauth.getAuthorizeUrl({ - redirect_uri: 'http://localhost:7878/github-callback', - scope: "user,repo,gist" - }) - }); - res.end(); - return; - } - - // use github API - github.user.get({}, function(err, user) { - if (err) { - res.writeHead(err.code); - res.end(err + ""); - return; - } - res.writeHead(200); - res.end(JSON.stringify(user)); - }); - return; - } - // URL called by github after authenticating - else if (path.match(/^\/github-callback\/?$/)) { - // upgrade the code to an access token - oauth.getOAuthAccessToken(query.code, {}, function (err, access_token, refresh_token) { - if (err) { - console.log(err); - res.writeHead(500); - res.end(err + ""); - return; - } - - accessToken = access_token; - - // authenticate github API - github.authenticate({ - type: "oauth", - token: accessToken - }); - - //redirect back - res.writeHead(303, { - Location: "/" - }); - res.end(); - }); - return; - } - - res.writeHead(404); - res.end("404 - Not found"); -}).listen(7878); - -console.log("listening at http://localhost:7878"); diff --git a/examples/oauth_server.js b/examples/oauth_server.js deleted file mode 100644 index 649c0ca4d0..0000000000 --- a/examples/oauth_server.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -var Client = require("./../index"); - -var github = new Client(); - -github.authenticate({ - type: "basic", - username: "", - password: "" -}); - -github.authorization.getAll({}, function(err, res) { - if (err) - throw err; - - var ids = res.map(function(app) { return app.id; }); - - function next(id) { - github.authorization["delete"]({ - id: id - }, function(err, res) { - if (err) - throw err; - if (ids.length) - next(ids.shift()); - else - allRemoved(); - }); - } - - next(ids.shift()); - - function allRemoved() { - github.authorization.create({ - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to create unit tests", - note_url: "https://github.com/ajaxorg/node-github" - }, function(err, res) { - if (err) - throw err; - - // you can use the token within server-side apps. - // use it by doing: - // github.authenticate({ - // type: "oauth", - // token: e5a4a27487c26e571892846366de023349321a73 - // }); - console.log("TOKEN:", res.token); - console.log(res); - }); - } - -}); From 27882698e81b63875bacf6b580b7b173468a6de2 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 06:18:18 -0500 Subject: [PATCH 089/461] remove oauth dependency --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index c9818a9713..b5468959ec 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,7 @@ "dependencies": { "follow-redirects": "0.0.7", "https-proxy-agent": "^1.0.0", - "mime": "^1.2.11", - "oauth": "^0.9.14" + "mime": "^1.2.11" }, "devDependencies": { "async": "^0.9.0", From 715a6083b3ccd88ed2d98192c102178e355b6fb9 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 06:23:23 -0500 Subject: [PATCH 090/461] default to an empty config if none provided --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 14d21648e1..f64d1ddb55 100644 --- a/index.js +++ b/index.js @@ -169,6 +169,7 @@ var Url = require("url"); * } **/ var Client = module.exports = function(config) { + config = config || {} config.headers = config.headers || {}; this.config = config; this.debug = Util.isTrue(config.debug); From 876a7d87e358149cb7cc246d2c8c6af0d37863f2 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 06:40:02 -0500 Subject: [PATCH 091/461] update generate script Have generate script generate docs and tests by default. Add generate note to readme. Update tests. --- README.md | 6 + generate.js | 52 +--- test/authorizationTest.js | 217 +++------------- test/eventsTest.js | 121 ++++----- test/gistsTest.js | 504 ++++++-------------------------------- test/gitdataTest.js | 404 +++++++----------------------- test/gitignoreTest.js | 16 +- test/issuesTest.js | 109 ++++++--- test/markdownTest.js | 20 +- test/miscTest.js | 22 +- test/orgsTest.js | 65 ++++- test/pullRequestsTest.js | 10 +- test/releasesTest.js | 186 +++++--------- test/reposTest.js | 118 ++++++++- test/searchTest.js | 74 +++--- test/statusesTest.js | 19 +- test/userTest.js | 29 ++- 17 files changed, 650 insertions(+), 1322 deletions(-) diff --git a/README.md b/README.md index 797d321156..18e15c1c51 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,12 @@ github.authorization.create({ }); ``` +## Generate/update docs/tests + +```bash +$ node generate.js +``` + ## Tests Install mocha diff --git a/generate.js b/generate.js index c6609ef3f0..d84a01b8e4 100644 --- a/generate.js +++ b/generate.js @@ -22,7 +22,15 @@ var Util = require("./util"); var TestSectionTpl = fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); var TestHandlerTpl = fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); -var main = module.exports = function(routes, tests) { +var main = module.exports = function() { + // check routes path + var routesPath = Path.join(__dirname, "routes.json"); + var routes = JSON.parse(fs.readFileSync(routesPath, "utf8")); + if (!routes.defines) { + Util.log("No routes defined.", "fatal"); + process.exit(1); + } + Util.log("Generating..."); var defines = routes.defines; @@ -156,55 +164,17 @@ var main = module.exports = function(routes, tests) { fs.writeFileSync(apidocsPath, apidocs); Object.keys(sections).forEach(function(section) { - // When we don't need to generate tests, bail out here. - if (!tests) - return; + Util.log("Writing test file for " + section); var def = testSections[section]; - // test if previous tests already contained implementations by checking - // if the difference in character count between the current test file - // and the newly generated one is more than twenty characters. var body = TestSectionTpl .replace("<%version%>", "3.0.0") .replace(/<%sectionName%>/g, section) .replace("<%testBody%>", def.join("\n\n")); var path = Path.join(__dirname, "test", section + "Test.js"); - if (fs.existsSync(path) && Math.abs(fs.readFileSync(path, "utf8").length - body.length) >= 20) { - Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + - "that were already implemented. \nPlease be sure te check this file " + - "and move all implemented tests back into the newly generated test!", "error"); - fs.renameSync(path, path + ".bak"); - } - Util.log("Writing test file for " + section); fs.writeFileSync(path, body, "utf8"); }); }; -if (!module.parent) { - var argv = Optimist - .wrap(80) - .usage("Generate the implementation of the node-github module, including " - + "unit-test scaffolds.\nUsage: $0 [-r] [-v VERSION]") - .alias("t", "tests") - .describe("t", "Also generate unit test scaffolds") - .alias("h", "help") - .describe("h", "Display this usage information") - .boolean(["t", "h"]) - .argv; - - if (argv.help) { - Util.log(Optimist.help()); - process.exit(); - } - - var routesPath = Path.join(__dirname, "routes.json"); - var routes = JSON.parse(fs.readFileSync(routesPath, "utf8")); - if (!routes.defines) { - Util.log("No routes defined.", "fatal"); - process.exit(1); - } - - Util.log("Starting up..."); - main(routes, argv.tests); -} +main(); diff --git a/test/authorizationTest.js b/test/authorizationTest.js index 5acc4b5c2b..9db7dd0cf5 100644 --- a/test/authorizationTest.js +++ b/test/authorizationTest.js @@ -10,111 +10,43 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[authorization]", function() { var client; var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - this.timeout(10000); - beforeEach(function() { client = new Client(); client.authenticate({ - type: "basic", - username: "mikedeboertest", - password: "test1324" + type: "oauth", + token: token }); }); it("should successfully execute GET /authorizations (getAll)", function(next) { - client.authorization.create( + client.authorization.getAll( { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.authorization.getAll( - { - page: "1", - per_page: "100" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.getAll( - { - page: "1", - per_page: "100" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 0); - - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute GET /authorizations/:id (get)", function(next) { - client.authorization.create( + client.authorization.get( { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.equal(res.note, "Authorization created to unit tests auth"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); @@ -122,134 +54,45 @@ describe("[authorization]", function() { it("should successfully execute POST /authorizations (create)", function(next) { client.authorization.create( { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" + scopes: "Array", + note: "String", + note_url: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.equal(res.note, "Authorization created to unit tests auth"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute PATCH /authorizations/:id (update)", function(next) { - client.authorization.create( + client.authorization.update( { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" + id: "String", + scopes: "Array", + add_scopes: "Array", + remove_scopes: "Array", + note: "String", + note_url: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.authorization.update( - { - id: id, - remove_scopes: ["repo"], - note: "changed" - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.ok(res.scopes.indexOf("repo") === -1); - Assert.equal(res.note, "changed"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute DELETE /authorizations/:id (delete)", function(next) { - client.authorization.create( + client.authorization.delete( { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); diff --git a/test/eventsTest.js b/test/eventsTest.js index bd8728aaf5..13c2426a95 100644 --- a/test/eventsTest.js +++ b/test/eventsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[events]", function() { var client; @@ -27,19 +27,12 @@ describe("[events]", function() { it("should successfully execute GET /events (get)", function(next) { client.events.get( { - page: 1, - per_page: 30 + page: "Number", + per_page: "Number" }, function(err, res) { - // other assertions go here Assert.equal(err, null); - Assert.ok(res.length > 1); - Assert.equal(typeof res[0].type, "string"); - Assert.equal(typeof res[0].created_at, "string"); - Assert.equal(typeof res[0]["public"], "boolean"); - Assert.equal(typeof res[0].id, "string"); - Assert.ok("actor" in res[0]); - Assert.ok("repo" in res[0]); + // other assertions go here next(); } ); @@ -48,20 +41,14 @@ describe("[events]", function() { it("should successfully execute GET /repos/:user/:repo/events (getFromRepo)", function(next) { client.events.getFromRepo( { - user: "mikedeboertest", - repo: "node_chat" + user: "String", + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 5); - // this is the lastly listed event - var last = res.pop(); - Assert.equal(last.type, "ForkEvent"); - Assert.equal(last.created_at, "2012-10-05T15:03:11Z"); - Assert.equal(last.id, "1607304921"); - Assert.equal(last["public"], true); - Assert.equal(last.actor.login, "mikedeboer"); - Assert.equal(last.repo.name, "mikedeboertest/node_chat"); + // other assertions go here next(); } ); @@ -70,21 +57,14 @@ describe("[events]", function() { it("should successfully execute GET /repos/:user/:repo/issues/events (getFromRepoIssues)", function(next) { client.events.getFromRepoIssues( { - user: "mikedeboertest", - repo: "node_chat" + user: "String", + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 4); - // this is the lastly listed event - var last = res.pop(); - Assert.equal(last.event, "referenced"); - Assert.equal(last.created_at, "2012-10-05T15:05:31Z"); - Assert.equal(last.id, "26276344"); - Assert.equal(last.actor.login, "mikedeboertest"); - Assert.equal(last.issue.title, "Macaroni"); - Assert.equal(last.issue.number, 1); - Assert.equal(last.issue.state, "closed"); + // other assertions go here next(); } ); @@ -93,16 +73,14 @@ describe("[events]", function() { it("should successfully execute GET /networks/:user/:repo/events (getFromRepoNetwork)", function(next) { client.events.getFromRepoNetwork( { - user: "mikedeboertest", - repo: "node_chat" + user: "String", + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -111,15 +89,13 @@ describe("[events]", function() { it("should successfully execute GET /orgs/:org/events (getFromOrg)", function(next) { client.events.getFromOrg( { - org: "ajaxorg" + org: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -128,15 +104,13 @@ describe("[events]", function() { it("should successfully execute GET /users/:user/received_events (getReceived)", function(next) { client.events.getReceived( { - user: "mikedeboertest" + user: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 0); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -145,15 +119,13 @@ describe("[events]", function() { it("should successfully execute GET /users/:user/received_events/public (getReceivedPublic)", function(next) { client.events.getReceivedPublic( { - user: "mikedeboertest" + user: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 0); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -162,15 +134,13 @@ describe("[events]", function() { it("should successfully execute GET /users/:user/events (getFromUser)", function(next) { client.events.getFromUser( { - user: "mikedeboertest" + user: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -179,15 +149,13 @@ describe("[events]", function() { it("should successfully execute GET /users/:user/events/public (getFromUserPublic)", function(next) { client.events.getFromUserPublic( { - user: "mikedeboertest" + user: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); + // other assertions go here next(); } ); @@ -196,13 +164,14 @@ describe("[events]", function() { it("should successfully execute GET /users/:user/events/orgs/:org (getFromUserOrg)", function(next) { client.events.getFromUserOrg( { - user: "mikedeboer", - org: "ajaxorg" + user: "String", + org: "String", + page: "Number", + per_page: "Number" }, function(err, res) { - // we're not logged in as `mikedeboer` right now, so github API does not allow - // us to see the resource. - Assert.equal(err.code, 404); + Assert.equal(err, null); + // other assertions go here next(); } ); diff --git a/test/gistsTest.js b/test/gistsTest.js index bd8ea5cb6d..c569080efb 100644 --- a/test/gistsTest.js +++ b/test/gistsTest.js @@ -10,12 +10,11 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[gists]", function() { var client; var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - timeout(5000); beforeEach(function() { client = new Client(); @@ -27,17 +26,14 @@ describe("[gists]", function() { it("should successfully execute GET /gists (getAll)", function(next) { client.gists.getAll( - {}, + { + page: "Number", + per_page: "Number", + since: "Date" + }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); - + // other assertions go here next(); } ); @@ -46,17 +42,14 @@ describe("[gists]", function() { it("should successfully execute GET /users/:user/gists (getFromUser)", function(next) { client.gists.getFromUser( { - user: "mikedeboertest" + user: "String", + page: "Number", + per_page: "Number", + since: "Date" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); + // other assertions go here next(); } ); @@ -65,300 +58,107 @@ describe("[gists]", function() { it("should successfully execute POST /gists (create)", function(next) { client.gists.create( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + description: "String", + public: "Boolean", + files: "Json" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "Another bowl of pasta"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute PATCH /gists/:id (edit)", function(next) { - client.gists.create( + client.gists.edit( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String", + description: "String", + files: "Json" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.edit( - { - id: id, - description: "changed", - files: { - "ravioli.js": { - "content": "alert(\"no ketchup, please.\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "changed"); - Assert.equal(res.files["ravioli.js"].content, "alert(\"no ketchup, please.\");"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); -/* + it("should successfully execute GET /gists/public (public)", function(next) { client.gists.public( - {}, + { + since: "Date" + }, function(err, res) { Assert.equal(err, null); - console.log(res); + // other assertions go here next(); } ); }); -*/ + it("should successfully execute GET /gists/starred (starred)", function(next) { client.gists.starred( - {}, + { + since: "Date" + }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); - + // other assertions go here next(); } ); }); it("should successfully execute GET /gists/:id (get)", function(next) { - client.gists.create( + client.gists.get( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "Another bowl of pasta"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute PUT /gists/:id/star (star)", function(next) { - client.gists.create( + client.gists.star( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.checkStar( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - //TODO: NO RESULT HERE??? - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute DELETE /gists/:id/star (deleteStar)", function(next) { - client.gists.create( + client.gists.deleteStar( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.deleteStar( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute GET /gists/:id/star (checkStar)", function(next) { - client.gists.create( + client.gists.checkStar( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); @@ -366,128 +166,52 @@ describe("[gists]", function() { it("should successfully execute POST /gists/:id/fork (fork)", function(next) { client.gists.fork( { - id: "3047099" + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - Assert.equal(res.git_pull_url, "git://gist.github.com/" + id + ".git"); - Assert.equal(res.git_push_url, "git@gist.github.com:" + id + ".git"); - Assert.equal(res.description, "Why to call resume() after next()"); - Assert.equal(typeof res.files["resume_after_next.md"], "object"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute DELETE /gists/:id (delete)", function(next) { - client.gists.create( + client.gists.delete( { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); + // other assertions go here + next(); } ); }); - it("should successfully execute GET /gists/:gist_id/comments/:id (getComments)", function(next) { - client.gists.createComment( + it("should successfully execute GET /gists/:gist_id/comments (getComments)", function(next) { + client.gists.getComments( { - gist_id: "3047099", - body: "This is a test comment.", + gist_id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.getComments( - { - gist_id: "3047099" - }, - function(err, res) { - var comment = res.pop(); - Assert.equal(err, null); - Assert.equal(comment.user.login, "mikedeboertest"); - Assert.equal(comment.id, id); - Assert.equal(comment.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute GET /gists/:gist_id/comments/:id (getComment)", function(next) { - client.gists.createComment( + client.gists.getComment( { - gist_id: "3047099", - body: "This is a test comment.", + gist_id: "String", + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); @@ -495,108 +219,42 @@ describe("[gists]", function() { it("should successfully execute POST /gists/:gist_id/comments (createComment)", function(next) { client.gists.createComment( { - gist_id: "3047099", - body: "This is a test comment.", + gist_id: "String", + body: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute PATCH /gists/:gist_id/comments/:id (editComment)", function(next) { - client.gists.createComment( + client.gists.editComment( { - gist_id: "3047099", - body: "This is a test comment.", + gist_id: "String", + id: "String", + body: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists.editComment( - { - gist_id: "3047099", - id: id, - body: "This comment has been edited." - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This comment has been edited."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute DELETE /gists/:gist_id/comments/:id (deleteComment)", function(next) { - client.gists.createComment( + client.gists.deleteComment( { - gist_id: "3047099", - body: "This is a test comment.", + gist_id: "String", + id: "String" }, function(err, res) { Assert.equal(err, null); - var id = res.id; - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); + // other assertions go here + next(); } ); }); diff --git a/test/gitdataTest.js b/test/gitdataTest.js index da838a1d21..99780e4dc7 100644 --- a/test/gitdataTest.js +++ b/test/gitdataTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[gitdata]", function() { var client; @@ -25,20 +25,17 @@ describe("[gitdata]", function() { }); it("should successfully execute GET /repos/:user/:repo/git/blobs/:sha (getBlob)", function(next) { - // found an object after executing: - // git rev-list --all | xargs -l1 git diff-tree -r -c -M -C --no-commit-id | awk '{print $3}' client.gitdata.getBlob( { - user: "mikedeboertest", - repo: "node_chat", - sha: "8433b682c95edf3fd81f5ee217dc9c874db35e4b" + user: "String", + repo: "String", + sha: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.sha, "8433b682c95edf3fd81f5ee217dc9c874db35e4b"); - Assert.equal(res.size, 2654); - Assert.equal(res.encoding, "base64"); - + // other assertions go here next(); } ); @@ -47,31 +44,15 @@ describe("[gitdata]", function() { it("should successfully execute POST /repos/:user/:repo/git/blobs (createBlob)", function(next) { client.gitdata.createBlob( { - user: "mikedeboertest", - repo: "node_chat", - content: "test", - encoding: "utf-8" + user: "String", + repo: "String", + content: "String", + encoding: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(typeof res.sha, "string"); - var sha = res.sha; - - client.gitdata.getBlob( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.sha, sha); - Assert.equal(res.size, 4); - Assert.equal(res.encoding, "base64"); - - next(); - } - ); + // other assertions go here + next(); } ); }); @@ -79,49 +60,32 @@ describe("[gitdata]", function() { it("should successfully execute GET /repos/:user/:repo/git/commits/:sha (getCommit)", function(next) { client.gitdata.getCommit( { - user: "mikedeboertest", - repo: "node_chat", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + user: "String", + repo: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.author.date, "2012-10-05T08:05:31-07:00"); - Assert.equal(res.author.name, "Mike de Boer"); - Assert.equal(res.parents[0].sha, "221140b288a3c64949594c58420cb4ab289b0756"); - Assert.equal(res.parents[1].sha, "d2836429f4ff7de033c8bc0d16d22d55f2ea39c3"); + // other assertions go here next(); } ); }); it("should successfully execute POST /repos/:user/:repo/git/commits (createCommit)", function(next) { - // got valid tree reference by executing - // git cat-file -p HEAD client.gitdata.createCommit( { - user: "mikedeboertest", - repo: "node_chat", - message: "test", - tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - parents: [], - author: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - }, - committer: { - name: "test-minion", - email: "test-minion@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } + user: "String", + repo: "String", + message: "String", + tree: "String", + parents: "Array", + author: "Json", + committer: "Json" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.author.name, "test-chef"); - Assert.equal(res.author.email, "test-chef@pasta-nirvana.it"); - Assert.equal(res.committer.name, "test-minion"); - Assert.equal(res.committer.email, "test-minion@pasta-nirvana.it"); - Assert.equal(res.message, "test"); + // other assertions go here next(); } ); @@ -130,15 +94,13 @@ describe("[gitdata]", function() { it("should successfully execute GET /repos/:user/:repo/git/refs/:ref (getReference)", function(next) { client.gitdata.getReference( { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master" + user: "String", + repo: "String", + ref: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); + // other assertions go here next(); } ); @@ -147,184 +109,78 @@ describe("[gitdata]", function() { it("should successfully execute GET /repos/:user/:repo/git/refs (getAllReferences)", function(next) { client.gitdata.getAllReferences( { - user: "mikedeboertest", - repo: "node_chat" + user: "String", + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - var ref = res[0]; - Assert.equal(ref.ref, "refs/heads/master"); - Assert.equal(ref.object.type, "commit"); - Assert.equal(ref.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); + // other assertions go here next(); } ); }); -/* -DISABLED temporarily due to Internal Server Error from Github! it("should successfully execute POST /repos/:user/:repo/git/refs (createReference)", function(next) { client.gitdata.createReference( { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + user: "String", + repo: "String", + ref: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); - console.log(res); - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); + next(); } ); - });*/ + }); it("should successfully execute PATCH /repos/:user/:repo/git/refs/:ref (updateReference)", function(next) { - client.gitdata.getReference( + client.gitdata.updateReference( { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master" + user: "String", + repo: "String", + ref: "String", + sha: "String", + force: "Boolean" }, function(err, res) { Assert.equal(err, null); - var sha = res.object.sha; - - // do `force=true` because we go backward in history, which yields a warning - // that it's not a reference that can be fast-forwarded to. - client.gitdata.updateReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master", - sha: "221140b288a3c64949594c58420cb4ab289b0756", - force: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, "221140b288a3c64949594c58420cb4ab289b0756"); - - client.gitdata.updateReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master", - sha: sha, - force: false - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, sha); - - next(); - } - ); - } - ); + // other assertions go here + next(); } ); - }); -/* -DISABLED temporarily due to Internal Server Error from Github! it("should successfully execute DELETE /repos/:user/:repo/git/refs/:ref (deleteReference)", function(next) { - client.gitdata.createReference( + client.gitdata.deleteReference( { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + user: "String", + repo: "String", + ref: "String" }, function(err, res) { Assert.equal(err, null); - console.log(res); - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); + next(); } ); - });*/ + }); it("should successfully execute GET /repos/:user/:repo/git/tags/:sha (getTag)", function(next) { - client.gitdata.createTag( + client.gitdata.getTag( { - user: "mikedeboertest", - repo: "node_chat", - tag: "test-pasta", - message: "Grandma's secret sauce", - object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", - type: "commit", - tagger: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } + user: "String", + repo: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTag( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tag, "test-pasta"); - Assert.equal(res.message, "Grandma's secret sauce"); - Assert.equal(res.sha, sha); - Assert.equal(res.tagger.name, "test-chef"); - Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "tags/" + sha - }, - function(err, res) { - //Assert.equal(err, null); - // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. - // ask the guys what's up here... - Assert.equal(err.code, 422); - - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); @@ -332,54 +188,18 @@ DISABLED temporarily due to Internal Server Error from Github! it("should successfully execute POST /repos/:user/:repo/git/tags (createTag)", function(next) { client.gitdata.createTag( { - user: "mikedeboertest", - repo: "node_chat", - tag: "test-pasta", - message: "Grandma's secret sauce", - object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", - type: "commit", - tagger: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } + user: "String", + repo: "String", + tag: "String", + message: "String", + object: "String", + type: "String", + tagger: "Json" }, function(err, res) { Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTag( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tag, "test-pasta"); - Assert.equal(res.message, "Grandma's secret sauce"); - Assert.equal(res.sha, sha); - Assert.equal(res.tagger.name, "test-chef"); - Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "tags/" + sha - }, - function(err, res) { - //Assert.equal(err, null); - // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. - // ask the guys what's up here... - Assert.equal(err.code, 422); - - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); @@ -387,91 +207,31 @@ DISABLED temporarily due to Internal Server Error from Github! it("should successfully execute GET /repos/:user/:repo/git/trees/:sha (getTree)", function(next) { client.gitdata.getTree( { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: false + user: "String", + repo: "String", + sha: "String", + recursive: "Boolean" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100644"); - Assert.equal(res.tree[0].size, 1075); - - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100644"); - Assert.equal(res.tree[0].size, 1075); - - next(); - } - ); + // other assertions go here + next(); } ); }); it("should successfully execute POST /repos/:user/:repo/git/trees (createTree)", function(next) { - client.gitdata.getTree( + client.gitdata.createTree( { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: false + user: "String", + repo: "String", + tree: "Json", + base_tree: "String" }, function(err, res) { Assert.equal(err, null); - var file = res.tree[0]; - - client.gitdata.createTree( - { - base_tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - user: "mikedeboertest", - repo: "node_chat", - tree: [ - { - path: file.path, - mode: "100755", - type: file.type, - sha: file.sha - } - ] - }, - function(err, res) { - Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha, - recursive: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100755"); - Assert.equal(res.tree[0].size, 1075); - - next(); - } - ); - } - ); + // other assertions go here + next(); } ); }); diff --git a/test/gitignoreTest.js b/test/gitignoreTest.js index a6bc60c550..76b0816fb7 100644 --- a/test/gitignoreTest.js +++ b/test/gitignoreTest.js @@ -10,13 +10,18 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[gitignore]", function() { var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); }); it("should successfully execute GET /gitignore/templates (templates)", function(next) { @@ -25,9 +30,6 @@ describe("[gitignore]", function() { function(err, res) { Assert.equal(err, null); // other assertions go here - Assert.ifError(err); - Assert(Array.isArray(res)); - Assert(res.length > 10); next(); } ); @@ -36,15 +38,11 @@ describe("[gitignore]", function() { it("should successfully execute GET /gitignore/templates/:name (template)", function(next) { client.gitignore.template( { - name: "C" + name: "String" }, function(err, res) { Assert.equal(err, null); // other assertions go here - Assert.ifError(err); - Assert('name' in res); - Assert('source' in res); - Assert(typeof res.source === 'string'); next(); } ); diff --git a/test/issuesTest.js b/test/issuesTest.js index dd859c6394..4fa70a35ce 100644 --- a/test/issuesTest.js +++ b/test/issuesTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[issues]", function() { var client; @@ -27,22 +27,18 @@ describe("[issues]", function() { it("should successfully execute GET /issues (getAll)", function(next) { client.issues.getAll( { - filter: "created", - state: "open", - labels: "", - sort: "updated", - direction: "asc" + filter: "String", + state: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 1); - var issue = res[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.number, 2); - Assert.equal(issue.state, "open"); - Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(issue.assignee.login, "mikedeboertest"); - + // other assertions go here next(); } ); @@ -51,22 +47,23 @@ describe("[issues]", function() { it("should successfully execute GET /repos/:user/:repo/issues (repoIssues)", function(next) { client.issues.repoIssues( { - user: "mikedeboertest", - repo: "node_chat", - state: "open", - sort: "updated", - direction: "asc" + user: "String", + repo: "String", + milestone: "String", + state: "String", + assignee: "String", + creator: "String", + mentioned: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.length, 1); - var issue = res[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.number, 2); - Assert.equal(issue.state, "open"); - Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(issue.assignee.login, "mikedeboertest"); - + // other assertions go here next(); } ); @@ -75,23 +72,18 @@ describe("[issues]", function() { it("should successfully execute GET /repos/:user/:repo/issues/:number (getRepoIssue)", function(next) { client.issues.getRepoIssue( { - user: "mikedeboertest", - repo: "node_chat", - number: 2 + user: "String", + repo: "String", + number: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.title, "My First Issue"); - Assert.equal(res.number, 2); - Assert.equal(res.state, "open"); - Assert.equal(res.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(res.assignee.login, "mikedeboertest"); - + // other assertions go here next(); } ); }); -/* + it("should successfully execute POST /repos/:user/:repo/issues (create)", function(next) { client.issues.create( { @@ -121,7 +113,27 @@ describe("[issues]", function() { body: "String", assignee: "String", milestone: "Number", - labels: "Json" + labels: "Json", + state: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/comments (repoComments)", function(next) { + client.issues.repoComments( + { + user: "String", + repo: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); @@ -262,7 +274,9 @@ describe("[issues]", function() { client.issues.getLabels( { user: "String", - repo: "String" + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); @@ -334,6 +348,21 @@ describe("[issues]", function() { ); }); + it("should successfully execute GET /repos/:user/:repo/issues/:number/labels (getIssueLabels)", function(next) { + client.issues.getIssueLabels( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute GET /repos/:user/:repo/milestones (getAllMilestones)", function(next) { client.issues.getAllMilestones( { @@ -417,5 +446,5 @@ describe("[issues]", function() { next(); } ); - });*/ + }); }); diff --git a/test/markdownTest.js b/test/markdownTest.js index 200bb52c40..cf68ace13a 100644 --- a/test/markdownTest.js +++ b/test/markdownTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[markdown]", function() { var client; @@ -18,35 +18,35 @@ describe("[markdown]", function() { beforeEach(function() { client = new Client(); - /*client.authenticate({ + client.authenticate({ type: "oauth", token: token - });*/ + }); }); it("should successfully execute POST /markdown (render)", function(next) { client.markdown.render( { - text: "Hello world github/linguist#1 **cool**, and #1!", - mode: "gfm", - context: "github/gollem" + text: "String", + mode: "String", + context: "String" }, function(err, res) { Assert.equal(err, null); - console.log(res); + // other assertions go here next(); } ); }); - it("should successfully execute POST /markdown/raw (render)", function(next) { + it("should successfully execute POST /markdown/raw (renderRaw)", function(next) { client.markdown.renderRaw( { - data: "Hello world github/linguist#1 **cool**, and #1!" + data: "String" }, function(err, res) { Assert.equal(err, null); - console.log(res); + // other assertions go here next(); } ); diff --git a/test/miscTest.js b/test/miscTest.js index 2bb082a020..8b71b22366 100644 --- a/test/miscTest.js +++ b/test/miscTest.js @@ -10,13 +10,18 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[misc]", function() { var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; beforeEach(function() { client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); }); it("should successfully execute GET /emojis (emojis)", function(next) { @@ -25,9 +30,6 @@ describe("[misc]", function() { function(err, res) { Assert.equal(err, null); // other assertions go here - Assert.ifError(err); - // A common emoji on github - Assert('shipit' in res); next(); } ); @@ -39,8 +41,6 @@ describe("[misc]", function() { function(err, res) { Assert.equal(err, null); // other assertions go here - Assert('hooks' in res); - Assert('git' in res); next(); } ); @@ -51,15 +51,7 @@ describe("[misc]", function() { {}, function(err, res) { Assert.equal(err, null); - Assert('resources' in res); - Assert('core' in res.resources); - Assert(typeof res.resources.core.limit === 'number'); - Assert(typeof res.resources.core.remaining === 'number'); - Assert(typeof res.resources.core.reset === 'number'); - Assert('search' in res.resources); - Assert(typeof res.resources.search.limit === 'number'); - Assert(typeof res.resources.search.remaining === 'number'); - Assert(typeof res.resources.search.reset === 'number'); + // other assertions go here next(); } ); diff --git a/test/orgsTest.js b/test/orgsTest.js index 9564a0a1bb..a26421b555 100644 --- a/test/orgsTest.js +++ b/test/orgsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[orgs]", function() { var client; @@ -77,7 +77,8 @@ describe("[orgs]", function() { { org: "String", page: "Number", - per_page: "Number" + per_page: "Number", + filter: "String" }, function(err, res) { Assert.equal(err, null); @@ -142,6 +143,34 @@ describe("[orgs]", function() { ); }); + it("should successfully execute PUT /orgs/:org/memberships/:user (addOrganizationMembership)", function(next) { + client.orgs.addOrganizationMembership( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/memberships/:user (removeOrganizationMembership)", function(next) { + client.orgs.removeOrganizationMembership( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute PUT /orgs/:org/public_members/:user (publicizeMembership)", function(next) { client.orgs.publicizeMembership( { @@ -173,7 +202,9 @@ describe("[orgs]", function() { it("should successfully execute GET /orgs/:org/teams (getTeams)", function(next) { client.orgs.getTeams( { - org: "String" + org: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); @@ -297,6 +328,34 @@ describe("[orgs]", function() { ); }); + it("should successfully execute PUT /teams/:id/memberships/:user (addTeamMembership)", function(next) { + client.orgs.addTeamMembership( + { + id: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/memberships/:user (getTeamMembership)", function(next) { + client.orgs.getTeamMembership( + { + id: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute GET /teams/:id/repos (getTeamRepos)", function(next) { client.orgs.getTeamRepos( { diff --git a/test/pullRequestsTest.js b/test/pullRequestsTest.js index b042b1f46c..b0d8dd4bc3 100644 --- a/test/pullRequestsTest.js +++ b/test/pullRequestsTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[pullRequests]", function() { var client; @@ -29,11 +29,13 @@ describe("[pullRequests]", function() { { user: "String", repo: "String", - base: "String", - head: "String", state: "String", + head: "String", + base: "String", page: "Number", - per_page: "Number" + per_page: "Number", + sort: "String", + direction: "String" }, function(err, res) { Assert.equal(err, null); diff --git a/test/releasesTest.js b/test/releasesTest.js index cbe4d98e38..3a3020dccb 100644 --- a/test/releasesTest.js +++ b/test/releasesTest.js @@ -1,4 +1,4 @@ - /* +/* * Copyright 2012 Cloud9 IDE, Inc. * * This product includes software developed by @@ -10,26 +10,12 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); -var fs = require("fs"); -var mime = require("mime"); +var Client = require("./../../index"); describe("[releases]", function() { var client; var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - var owner = "greggman"; - var repo = "test"; - var haveWriteAccess = true; // set to false if the authenticated person below does not have write access to the repo above - var releaseIdWithAsset = 393621; // Some release id from the repo above that has at least 1 asset. - var filePathToUpload = __filename; - var fileSizeToUpload = fs.statSync(filePathToUpload).size; - - var releaseId; // release id found when listing releases. Used for get release - var newReleaseId; // release id created when creating release, used for edit and delete release - var assetId; // asset id found when listing assets. Used for get asset - var newAssetId; // asset id used when creating asset. Used for edit and delete asset - beforeEach(function() { client = new Client(); client.authenticate({ @@ -41,34 +27,29 @@ describe("[releases]", function() { it("should successfully execute GET /repos/:owner/:repo/releases (listReleases)", function(next) { client.releases.listReleases( { - owner: owner, - repo: repo, + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res instanceof Array); - if (res instanceof Array && res.length > 0) { - releaseId = res[0].id; - } + // other assertions go here next(); } ); }); it("should successfully execute GET /repos/:owner/:repo/releases/:id (getRelease)", function(next) { - if (!releaseId) { - next(); - return; - } client.releases.getRelease( { - owner: owner, - id: releaseId, - repo: repo + owner: "String", + id: "Number", + repo: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.id, releaseId); + // other assertions go here next(); } ); @@ -77,92 +58,68 @@ describe("[releases]", function() { it("should successfully execute GET /repos/:owner/:repo/releases/latest (getLatestRelease)", function(next) { client.releases.getLatestRelease( { - owner: owner, - repo: repo + owner: "String", + repo: "String" }, function(err, res) { Assert.equal(err, null); + // other assertions go here next(); } ); }); it("should successfully execute POST /repos/:owner/:repo/releases (createRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } client.releases.createRelease( { - owner: owner, - repo: repo, - tag_name: "node-github-tag", - target_commitish: "master", - name: "node-github-name", - body: "node-github-body", - draft: false, - prerelease: true, + owner: "String", + repo: "String", + tag_name: "String", + target_commitish: "String", + name: "String", + body: "String", + draft: "Boolean", + prerelease: "Boolean" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.tag_name, "node-github-tag"); - Assert.equal(res.target_commitish, "master"); - Assert.equal(res.name, "node-github-name"); - Assert.equal(res.body, "node-github-body"); - Assert.equal(res.assets.length, 0); - Assert.ok(res.prerelease); - Assert.ok(!res.draft); - newReleaseId = res.id; + // other assertions go here next(); } ); }); it("should successfully execute PATCH /repos/:owner/:repo/releases/:id (editRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } client.releases.editRelease( { - owner: owner, - id: newReleaseId, - repo: repo, - tag_name: "node-github-new-tag", - target_commitish: "master", - name: "node-github-new-name", - body: "node-github-new-body", - draft: true, - prerelease: true, + owner: "String", + id: "Number", + repo: "String", + tag_name: "String", + target_commitish: "String", + name: "String", + body: "String", + draft: "Boolean", + prerelease: "Boolean" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.id, newReleaseId); - Assert.equal(res.tag_name, "node-github-new-tag"); - Assert.equal(res.target_commitish, "master"); - Assert.equal(res.name, "node-github-new-name"); - Assert.equal(res.body, "node-github-new-body"); - Assert.equal(res.assets.length, 0); - Assert.ok(res.prerelease); - Assert.ok(res.draft); + // other assertions go here next(); } ); }); it("should successfully execute DELETE /repos/:owner/:repo/releases/:id (deleteRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } client.releases.deleteRelease( { - owner: owner, - repo: repo, - id: newReleaseId, + owner: "String", + id: "Number", + repo: "String" }, function(err, res) { Assert.equal(err, null); + // other assertions go here next(); } ); @@ -171,97 +128,72 @@ describe("[releases]", function() { it("should successfully execute GET /repos/:owner/:repo/releases/:id/assets (listAssets)", function(next) { client.releases.listAssets( { - owner: owner, - id: releaseIdWithAsset, - repo: repo + owner: "String", + id: "Number", + repo: "String" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res instanceof Array); - if (res instanceof Array && res.length > 0) { - assetId = res[0].id; - } + // other assertions go here next(); } ); }); it("should successfully execute GET /repos/:owner/:repo/releases/assets/:id (getAsset)", function(next) { - if (!assetId) { - next(); - return; - } client.releases.getAsset( { - owner: owner, - id: assetId, - repo: repo + owner: "String", + id: "Number", + repo: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.id, assetId); + // other assertions go here next(); } ); }); it("should successfully execute POST /repos/:owner/:repo/releases/:id/assets (uploadAsset)", function(next) { - var name = "somenameornot.zip"; client.releases.uploadAsset( { - owner: owner, - id: releaseIdWithAsset, - repo: repo, - name: name, - filePath: filePathToUpload + owner: "String", + id: "Number", + repo: "String", + name: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.content_type, mime.lookup(name)); // matches extension of name, not filePath - Assert.equal(res.state, "uploaded"); - Assert.equal(res.size, fileSizeToUpload); - Assert.equal(res.name, name); - newAssetId = res.id; + // other assertions go here next(); } ); }); it("should successfully execute PATCH /repos/:owner/:repo/releases/assets/:id (editAsset)", function(next) { - if (!newAssetId) { - next(); - return; - } - var newName = "somenewname.zip"; client.releases.editAsset( { - owner: owner, - id: newAssetId, - repo: repo, - name: newName, - label: "foo" + owner: "String", + id: "Number", + repo: "String", + name: "String", + label: "String" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.state, "uploaded"); - Assert.equal(res.size, fileSizeToUpload); - Assert.equal(res.name, newName); - Assert.equal(res.label, "foo"); + // other assertions go here next(); } ); }); it("should successfully execute DELETE /repos/:owner/:repo/releases/assets/:id (deleteAsset)", function(next) { - if (!newAssetId) { - next(); - return; - } client.releases.deleteAsset( { - owner: owner, - id: newAssetId, - repo: repo + owner: "String", + id: "Number", + repo: "String" }, function(err, res) { Assert.equal(err, null); diff --git a/test/reposTest.js b/test/reposTest.js index fe21c7bd6b..a311142b62 100644 --- a/test/reposTest.js +++ b/test/reposTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[repos]", function() { var client; @@ -133,6 +133,19 @@ describe("[repos]", function() { ); }); + it("should successfully execute GET /repositories/:id (one)", function(next) { + client.repos.one( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute PATCH /repos/:user/:repo (update)", function(next) { client.repos.update( { @@ -144,7 +157,8 @@ describe("[repos]", function() { private: "Boolean", has_issues: "Boolean", has_wiki: "Boolean", - has_downloads: "Boolean" + has_downloads: "Boolean", + default_branch: "String" }, function(err, res) { Assert.equal(err, null); @@ -267,7 +281,7 @@ describe("[repos]", function() { }); it("should successfully execute GET /repos/:user/:repo/branches/:branch (getBranch)", function(next) { - client.repos.getBranches( + client.repos.getBranch( { user: "String", repo: "String", @@ -351,9 +365,11 @@ describe("[repos]", function() { repo: "String", sha: "String", path: "String", + author: "String", page: "Number", per_page: "Number", - author: "String" + since: "Date", + until: "Date" }, function(err, res) { Assert.equal(err, null); @@ -523,15 +539,16 @@ describe("[repos]", function() { } ); }); - it("should successfully execute GET /repos/:user/:repo/contents/:path (createContent)", function(next) { - client.repos.getContent( + + it("should successfully execute PUT /repos/:user/:repo/contents/:path (createContent)", function(next) { + client.repos.createContent( { user: "String", repo: "String", + content: "String", + message: "String", path: "String", - ref: "String", - content:"String", - message:"String" + ref: "String" }, function(err, res) { Assert.equal(err, null); @@ -607,6 +624,7 @@ describe("[repos]", function() { { user: "String", repo: "String", + ref: "String", archive_format: "String" }, function(err, res) { @@ -835,8 +853,8 @@ describe("[repos]", function() { ); }); - it("should successfully execute PUT /user/starred/:user/:repo (watch)", function(next) { - client.repos.watch( + it("should successfully execute PUT /user/starred/:user/:repo (star)", function(next) { + client.repos.star( { user: "String", repo: "String" @@ -849,8 +867,8 @@ describe("[repos]", function() { ); }); - it("should successfully execute DELETE /user/starred/:user/:repo (unWatch)", function(next) { - client.repos.unWatch( + it("should successfully execute DELETE /user/starred/:user/:repo (unStar)", function(next) { + client.repos.unStar( { user: "String", repo: "String" @@ -1121,4 +1139,78 @@ describe("[repos]", function() { } ); }); + + it("should successfully execute GET /repos/:user/:repo/deployments (getDeployments)", function(next) { + client.repos.getDeployments( + { + sha: "String", + ref: "String", + task: "String", + environment: "String", + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/deployments (createDeployment)", function(next) { + client.repos.createDeployment( + { + ref: "String", + task: "String", + auto_merge: "Boolean", + required_contexts: "Array", + payload: "String", + environment: "String", + description: "String", + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/deployments/:id/statuses (getDeploymentStatuses)", function(next) { + client.repos.getDeploymentStatuses( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/deployments/:id/statuses (createDeploymentStatus)", function(next) { + client.repos.createDeploymentStatus( + { + state: "String", + target_url: "String", + description: "String", + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); }); diff --git a/test/searchTest.js b/test/searchTest.js index b6b5d89d6a..55eb743acb 100644 --- a/test/searchTest.js +++ b/test/searchTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[search]", function() { var client; @@ -24,85 +24,75 @@ describe("[search]", function() { }); }); - it("should successfully execute GET /search/code/:q (code)", function(next) { + it("should successfully execute GET /search/code (code)", function(next) { client.search.code( { - q: ['test', 'repo:mikedeboertest/1423836276146'].join('+') + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.items.length, 1); - var file = res.items[0]; - Assert.equal(file.name, "TEST.md"); - + // other assertions go here next(); } ); }); - it("should successfully execute GET /search/issues/:q (issues)", function(next) { + it("should successfully execute GET /search/issues (issues)", function(next) { client.search.issues( { - q: ['debate', 'repo:mikedeboertest/node_chat', 'state:open'].join('+') + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.items.length, 1); - var issue = res.items[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.state, "open"); - + // other assertions go here next(); } ); }); - it("should successfully execute GET /search/repositories/:q (repos)", function(next) { + it("should successfully execute GET /search/repositories (repos)", function(next) { client.search.repos( { - q: ['pasta', 'language:JavaScript'].join('+') + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.ok(res.items.length > 0); - Assert.equal(res.items[0].language, "JavaScript"); - + // other assertions go here next(); } ); }); - it("should successfully execute GET /search/users/:q (users)", function(next) { + it("should successfully execute GET /search/users (users)", function(next) { client.search.users( { - q: "mikedeboer" + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); - Assert.equal(res.items.length, 2); - var user = res.items[0]; - Assert.equal(user.login, "mikedeboer"); - - client.search.users( - { - q: "location:Jyväskylä" - }, - function(err, res) { - Assert.equal(err, null); - //XXX: this is likely to change often. I added this for - // issue #159. - Assert.equal(res.items.length, 30); - var user = res.items[0]; - Assert.equal(user.login, "bebraw"); - - next(); - } - ); + // other assertions go here + next(); } ); }); - /*it("should successfully execute GET /search/user/email/:email (email)", function(next) { + it("should successfully execute GET /legacy/user/email/:email (email)", function(next) { client.search.email( { email: "String" @@ -113,5 +103,5 @@ describe("[search]", function() { next(); } ); - });*/ + }); }); diff --git a/test/statusesTest.js b/test/statusesTest.js index bc8f03af53..6dee5d3d91 100644 --- a/test/statusesTest.js +++ b/test/statusesTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[statuses]", function() { var client; @@ -27,9 +27,9 @@ describe("[statuses]", function() { it("should successfully execute GET /repos/:user/:repo/commits/:sha/statuses (get)", function(next) { client.statuses.get( { - user: "mikedeboer", - repo: "node-github", - sha: "30d607d8fd8002427b61273f25d442c233cbf631" + user: "String", + repo: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); @@ -39,12 +39,12 @@ describe("[statuses]", function() { ); }); - it("should successfully execute GET /repos/:user/:repo/commits/:sha/status (get)", function(next) { + it("should successfully execute GET /repos/:user/:repo/commits/:sha/status (getCombined)", function(next) { client.statuses.getCombined( { - user: "mikedeboer", - repo: "node-github", - sha: "30d607d8fd8002427b61273f25d442c233cbf631" + user: "String", + repo: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); @@ -62,7 +62,8 @@ describe("[statuses]", function() { sha: "String", state: "String", target_url: "String", - description: "String" + description: "String", + context: "String" }, function(err, res) { Assert.equal(err, null); diff --git a/test/userTest.js b/test/userTest.js index 1a09af3a41..72502a8286 100644 --- a/test/userTest.js +++ b/test/userTest.js @@ -10,7 +10,7 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../index"); +var Client = require("./../../index"); describe("[user]", function() { var client; @@ -24,6 +24,19 @@ describe("[user]", function() { }); }); + it("should successfully execute GET /users (getAll)", function(next) { + client.user.getAll( + { + since: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute GET /users/:user (getFrom)", function(next) { client.user.getFrom( { @@ -81,6 +94,20 @@ describe("[user]", function() { ); }); + it("should successfully execute PATCH /user/memberships/orgs/:org (editOrganizationMembership)", function(next) { + client.user.editOrganizationMembership( + { + org: "String", + state: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute GET /user/teams (getTeams)", function(next) { client.user.getTeams( { From 7563c6a817afb8a253e6b31952aac06b2cace5fd Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 06:45:50 -0500 Subject: [PATCH 092/461] bump patch number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5468959ec..b099d7125f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github4", - "version": "0.2.10", + "version": "0.2.11", "description": "NodeJS wrapper for the GitHub API", "author": "Mike de Boer ", "contributors": [ From b23ceb133dce703d1a13674940b6406d3d67e186 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 25 Dec 2015 07:30:52 -0500 Subject: [PATCH 093/461] use test auth file for running examples/tests --- .gitignore | 2 ++ README.md | 15 ++++++++++++++- examples/get_user.js | 3 ++- templates/test_section.js.tpl | 3 ++- test/authorizationTest.js | 3 ++- test/eventsTest.js | 3 ++- test/gistsTest.js | 3 ++- test/gitdataTest.js | 3 ++- test/gitignoreTest.js | 3 ++- test/issuesTest.js | 3 ++- test/markdownTest.js | 3 ++- test/miscTest.js | 3 ++- test/orgsTest.js | 3 ++- test/pullRequestsTest.js | 3 ++- test/releasesTest.js | 3 ++- test/reposTest.js | 3 ++- test/searchTest.js | 3 ++- test/statusesTest.js | 3 ++- test/userTest.js | 3 ++- 19 files changed, 50 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 5cd6673800..93271a9aad 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ npm-debug.log* .DS_Store .idea + +test_auth.json diff --git a/README.md b/README.md index 18e15c1c51..0e3f70e292 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,17 @@ $ npm install GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) Client API: [https://kaizensoze.github.io/github4/](https://kaizensoze.github.io/github4/) +## Test auth file + +Create test auth file for running tests/examples. + +```bash +$ > test_auth.json +{ + "token": "" +} +``` + ## Example Get all followers for user "defunkt": @@ -118,7 +129,9 @@ github.authorization.create({ }); ``` -## Generate/update docs/tests +## Generate doc/tests + +Generate/update doc/tests. ```bash $ node generate.js diff --git a/examples/get_user.js b/examples/get_user.js index f482af5d1d..30e83b4fb0 100644 --- a/examples/get_user.js +++ b/examples/get_user.js @@ -14,6 +14,7 @@ "use strict"; var Client = require("./../index"); +var testAuth = require("./../test_auth.json"); var github = new Client({ debug: true @@ -21,7 +22,7 @@ var github = new Client({ github.authenticate({ type: "oauth", - token: "TOKEN" // Replace with your oauth token + token: testAuth["token"] }); github.user.get({}, function(err, res) { diff --git a/templates/test_section.js.tpl b/templates/test_section.js.tpl index 6c88297a13..aa36df92c7 100644 --- a/templates/test_section.js.tpl +++ b/templates/test_section.js.tpl @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[<%sectionName%>]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/authorizationTest.js b/test/authorizationTest.js index 9db7dd0cf5..d6b55d8019 100644 --- a/test/authorizationTest.js +++ b/test/authorizationTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[authorization]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/eventsTest.js b/test/eventsTest.js index 13c2426a95..e32ed7e804 100644 --- a/test/eventsTest.js +++ b/test/eventsTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[events]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/gistsTest.js b/test/gistsTest.js index c569080efb..8c39201be2 100644 --- a/test/gistsTest.js +++ b/test/gistsTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[gists]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/gitdataTest.js b/test/gitdataTest.js index 99780e4dc7..34efddb04f 100644 --- a/test/gitdataTest.js +++ b/test/gitdataTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[gitdata]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/gitignoreTest.js b/test/gitignoreTest.js index 76b0816fb7..67931cb8e5 100644 --- a/test/gitignoreTest.js +++ b/test/gitignoreTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[gitignore]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/issuesTest.js b/test/issuesTest.js index 4fa70a35ce..14f716b55f 100644 --- a/test/issuesTest.js +++ b/test/issuesTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[issues]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/markdownTest.js b/test/markdownTest.js index cf68ace13a..3dd7941a00 100644 --- a/test/markdownTest.js +++ b/test/markdownTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[markdown]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/miscTest.js b/test/miscTest.js index 8b71b22366..1c57cc2dfd 100644 --- a/test/miscTest.js +++ b/test/miscTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[misc]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/orgsTest.js b/test/orgsTest.js index a26421b555..7fad893147 100644 --- a/test/orgsTest.js +++ b/test/orgsTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[orgs]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/pullRequestsTest.js b/test/pullRequestsTest.js index b0d8dd4bc3..2ad919ad4e 100644 --- a/test/pullRequestsTest.js +++ b/test/pullRequestsTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[pullRequests]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/releasesTest.js b/test/releasesTest.js index 3a3020dccb..48ad7bd1cc 100644 --- a/test/releasesTest.js +++ b/test/releasesTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[releases]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/reposTest.js b/test/reposTest.js index a311142b62..de416e6989 100644 --- a/test/reposTest.js +++ b/test/reposTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[repos]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/searchTest.js b/test/searchTest.js index 55eb743acb..3e71e78eca 100644 --- a/test/searchTest.js +++ b/test/searchTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[search]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/statusesTest.js b/test/statusesTest.js index 6dee5d3d91..f20f4ca6c9 100644 --- a/test/statusesTest.js +++ b/test/statusesTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[statuses]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); diff --git a/test/userTest.js b/test/userTest.js index 72502a8286..17ba6f9bb5 100644 --- a/test/userTest.js +++ b/test/userTest.js @@ -11,10 +11,11 @@ var Assert = require("assert"); var Client = require("./../../index"); +var testAuth = require("./../test_auth.json"); describe("[user]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { client = new Client(); From a8619350e809cbdebcaddd58a2e1c19b7544c6d1 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sat, 26 Dec 2015 14:33:57 -0500 Subject: [PATCH 094/461] remove seed.yml --- seed.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 seed.yml diff --git a/seed.yml b/seed.yml deleted file mode 100644 index 80315da0f8..0000000000 --- a/seed.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - name: node-github - description: NodeJS wrapper for the GitHub API - tags: git github web - version: 0.2.4 From b6064be7f957cdab6f1a4fffdc8256ad234f6786 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Sat, 26 Dec 2015 16:13:19 -0500 Subject: [PATCH 095/461] update docs clean up generated comments --- README.md | 7 + apidoc/api_data.js | 1 + apidoc/api_data.json | 1 + apidoc/api_project.js | 1 + apidoc/api_project.json | 1 + apidoc/css/style.css | 538 ++ apidoc/img/favicon.ico | Bin 0 -> 894 bytes apidoc/img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes apidoc/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes apidoc/index.html | 658 +++ apidoc/locales/de.js | 25 + apidoc/locales/es.js | 25 + apidoc/locales/fr.js | 25 + apidoc/locales/locale.js | 45 + apidoc/locales/nl.js | 25 + apidoc/locales/pl.js | 25 + apidoc/locales/pt_br.js | 25 + apidoc/locales/ru.js | 25 + apidoc/locales/zh.js | 25 + apidoc/locales/zh_cn.js | 25 + apidoc/main.js | 705 +++ apidoc/utils/handlebars_helper.js | 327 ++ apidoc/utils/send_sample_request.js | 188 + apidoc/vendor/bootstrap-responsive.min.css | 9 + apidoc/vendor/bootstrap.min.css | 9 + apidoc/vendor/bootstrap.min.js | 6 + apidoc/vendor/diff_match_patch.min.js | 49 + apidoc/vendor/handlebars.min.js | 28 + apidoc/vendor/jquery.min.js | 4 + apidoc/vendor/lodash.min.js | 61 + apidoc/vendor/path-to-regexp/LICENSE | 21 + apidoc/vendor/path-to-regexp/index.js | 204 + apidoc/vendor/polyfill.js | 100 + apidoc/vendor/prettify.css | 101 + apidoc/vendor/prettify/lang-apollo.js | 2 + apidoc/vendor/prettify/lang-basic.js | 3 + apidoc/vendor/prettify/lang-clj.js | 18 + apidoc/vendor/prettify/lang-css.js | 2 + apidoc/vendor/prettify/lang-dart.js | 3 + apidoc/vendor/prettify/lang-erlang.js | 2 + apidoc/vendor/prettify/lang-go.js | 1 + apidoc/vendor/prettify/lang-hs.js | 2 + apidoc/vendor/prettify/lang-lisp.js | 3 + apidoc/vendor/prettify/lang-llvm.js | 1 + apidoc/vendor/prettify/lang-lua.js | 2 + apidoc/vendor/prettify/lang-matlab.js | 6 + apidoc/vendor/prettify/lang-ml.js | 2 + apidoc/vendor/prettify/lang-mumps.js | 2 + apidoc/vendor/prettify/lang-n.js | 4 + apidoc/vendor/prettify/lang-pascal.js | 3 + apidoc/vendor/prettify/lang-proto.js | 1 + apidoc/vendor/prettify/lang-r.js | 2 + apidoc/vendor/prettify/lang-rd.js | 1 + apidoc/vendor/prettify/lang-scala.js | 2 + apidoc/vendor/prettify/lang-sql.js | 2 + apidoc/vendor/prettify/lang-tcl.js | 3 + apidoc/vendor/prettify/lang-tex.js | 1 + apidoc/vendor/prettify/lang-vb.js | 2 + apidoc/vendor/prettify/lang-vhdl.js | 3 + apidoc/vendor/prettify/lang-wiki.js | 2 + apidoc/vendor/prettify/lang-xq.js | 3 + apidoc/vendor/prettify/lang-yaml.js | 2 + apidoc/vendor/prettify/prettify.css | 1 + apidoc/vendor/prettify/prettify.js | 30 + apidoc/vendor/prettify/run_prettify.js | 34 + apidoc/vendor/require.min.js | 36 + apidoc/vendor/semver.min.js | 1 + apidoc/vendor/webfontloader.js | 18 + doc/apidocs.js | 5464 +++++++++----------- generate.js | 94 +- index.js | 106 +- package.json | 5 +- test/authorizationTest.js | 44 +- test/eventsTest.js | 44 +- test/gistsTest.js | 118 +- test/gitdataTest.js | 98 +- test/gitignoreTest.js | 16 +- test/issuesTest.js | 234 +- test/orgsTest.js | 204 +- test/pullRequestsTest.js | 118 +- test/releasesTest.js | 68 +- test/reposTest.js | 620 +-- test/searchTest.js | 26 +- test/statusesTest.js | 24 +- test/userTest.js | 150 +- 85 files changed, 6901 insertions(+), 4021 deletions(-) create mode 100644 apidoc/api_data.js create mode 100644 apidoc/api_data.json create mode 100644 apidoc/api_project.js create mode 100644 apidoc/api_project.json create mode 100644 apidoc/css/style.css create mode 100644 apidoc/img/favicon.ico create mode 100644 apidoc/img/glyphicons-halflings-white.png create mode 100644 apidoc/img/glyphicons-halflings.png create mode 100644 apidoc/index.html create mode 100644 apidoc/locales/de.js create mode 100644 apidoc/locales/es.js create mode 100644 apidoc/locales/fr.js create mode 100644 apidoc/locales/locale.js create mode 100644 apidoc/locales/nl.js create mode 100644 apidoc/locales/pl.js create mode 100644 apidoc/locales/pt_br.js create mode 100644 apidoc/locales/ru.js create mode 100644 apidoc/locales/zh.js create mode 100644 apidoc/locales/zh_cn.js create mode 100644 apidoc/main.js create mode 100644 apidoc/utils/handlebars_helper.js create mode 100755 apidoc/utils/send_sample_request.js create mode 100644 apidoc/vendor/bootstrap-responsive.min.css create mode 100644 apidoc/vendor/bootstrap.min.css create mode 100644 apidoc/vendor/bootstrap.min.js create mode 100644 apidoc/vendor/diff_match_patch.min.js create mode 100644 apidoc/vendor/handlebars.min.js create mode 100644 apidoc/vendor/jquery.min.js create mode 100644 apidoc/vendor/lodash.min.js create mode 100644 apidoc/vendor/path-to-regexp/LICENSE create mode 100644 apidoc/vendor/path-to-regexp/index.js create mode 100644 apidoc/vendor/polyfill.js create mode 100644 apidoc/vendor/prettify.css create mode 100644 apidoc/vendor/prettify/lang-apollo.js create mode 100644 apidoc/vendor/prettify/lang-basic.js create mode 100644 apidoc/vendor/prettify/lang-clj.js create mode 100644 apidoc/vendor/prettify/lang-css.js create mode 100644 apidoc/vendor/prettify/lang-dart.js create mode 100644 apidoc/vendor/prettify/lang-erlang.js create mode 100644 apidoc/vendor/prettify/lang-go.js create mode 100644 apidoc/vendor/prettify/lang-hs.js create mode 100644 apidoc/vendor/prettify/lang-lisp.js create mode 100644 apidoc/vendor/prettify/lang-llvm.js create mode 100644 apidoc/vendor/prettify/lang-lua.js create mode 100644 apidoc/vendor/prettify/lang-matlab.js create mode 100644 apidoc/vendor/prettify/lang-ml.js create mode 100644 apidoc/vendor/prettify/lang-mumps.js create mode 100644 apidoc/vendor/prettify/lang-n.js create mode 100644 apidoc/vendor/prettify/lang-pascal.js create mode 100644 apidoc/vendor/prettify/lang-proto.js create mode 100644 apidoc/vendor/prettify/lang-r.js create mode 100644 apidoc/vendor/prettify/lang-rd.js create mode 100644 apidoc/vendor/prettify/lang-scala.js create mode 100644 apidoc/vendor/prettify/lang-sql.js create mode 100644 apidoc/vendor/prettify/lang-tcl.js create mode 100644 apidoc/vendor/prettify/lang-tex.js create mode 100644 apidoc/vendor/prettify/lang-vb.js create mode 100644 apidoc/vendor/prettify/lang-vhdl.js create mode 100644 apidoc/vendor/prettify/lang-wiki.js create mode 100644 apidoc/vendor/prettify/lang-xq.js create mode 100644 apidoc/vendor/prettify/lang-yaml.js create mode 100644 apidoc/vendor/prettify/prettify.css create mode 100644 apidoc/vendor/prettify/prettify.js create mode 100644 apidoc/vendor/prettify/run_prettify.js create mode 100644 apidoc/vendor/require.min.js create mode 100644 apidoc/vendor/semver.min.js create mode 100644 apidoc/vendor/webfontloader.js diff --git a/README.md b/README.md index 0e3f70e292..12a1a64632 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,13 @@ Generate/update doc/tests. $ node generate.js ``` +## Update apidoc + +```bash +$ npm install apidoc -g +$ apidoc -i doc/ -o apidoc/ +``` + ## Tests Install mocha diff --git a/apidoc/api_data.js b/apidoc/api_data.js new file mode 100644 index 0000000000..fca0c7c3ba --- /dev/null +++ b/apidoc/api_data.js @@ -0,0 +1 @@ +define({ "api": [ { "type": "post", "url": "/authorizations", "title": "create", "name": "create", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Array", "optional": true, "field": "scopes", "description": "

Optional A list of scopes that this authorization is in.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note", "description": "

Optional A note to remind you what the OAuth token is for.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note_url", "description": "

Optional A URL to remind you what app the OAuth token is for.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "delete", "url": "/authorizations/:id", "title": "delete", "name": "delete", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/authorizations/:id", "title": "get", "name": "get", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/authorizations", "title": "getAll", "name": "getAll", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "patch", "url": "/authorizations/:id", "title": "update", "name": "update", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "scopes", "description": "

Optional A list of scopes that this authorization is in.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "add_scopes", "description": "

Optional A list of scopes to add to this authorization.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "remove_scopes", "description": "

Optional A list of scopes to remove from this authorization.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note", "description": "

Optional A note to remind you what the OAuth token is for.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note_url", "description": "

Optional A URL to remind you what app the OAuth token is for.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/events", "title": "get", "name": "get", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/orgs/:org/events", "title": "getFromOrg", "name": "getFromOrg", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/repos/:user/:repo/events", "title": "getFromRepo", "name": "getFromRepo", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/repos/:user/:repo/issues/events", "title": "getFromRepoIssues", "name": "getFromRepoIssues", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/networks/:user/:repo/events", "title": "getFromRepoNetwork", "name": "getFromRepoNetwork", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events", "title": "getFromUser", "name": "getFromUser", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events/orgs/:org", "title": "getFromUserOrg", "name": "getFromUserOrg", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events/public", "title": "getFromUserPublic", "name": "getFromUserPublic", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/received_events", "title": "getReceived", "name": "getReceived", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/received_events/public", "title": "getReceivedPublic", "name": "getReceivedPublic", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/gists/:id/star", "title": "checkStar", "name": "checkStar", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists", "title": "create", "name": "create", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Boolean", "optional": false, "field": "public", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "files", "description": "

Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists/:gist_id/comments", "title": "createComment", "name": "createComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:id", "title": "delete", "name": "delete", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:gist_id/comments/:id", "title": "deleteComment", "name": "deleteComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:id/star", "title": "deleteStar", "name": "deleteStar", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "patch", "url": "/gists/:id", "title": "edit", "name": "edit", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "files", "description": "

Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "patch", "url": "/gists/:gist_id/comments/:id", "title": "editComment", "name": "editComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists/:id/fork", "title": "fork", "name": "fork", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:id", "title": "get", "name": "get", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists", "title": "getAll", "name": "getAll", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:gist_id/comments/:id", "title": "getComment", "name": "getComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:gist_id/comments", "title": "getComments", "name": "getComments", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/users/:user/gists", "title": "getFromUser", "name": "getFromUser", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/public", "title": "public", "name": "public", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "put", "url": "/gists/:id/star", "title": "star", "name": "star", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/starred", "title": "starred", "name": "starred", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/repos/:user/:repo/git/blobs", "title": "createBlob", "name": "createBlob", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "encoding", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/commits", "title": "createCommit", "name": "createCommit", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

String of the commit message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tree", "description": "

String of the SHA of the tree object this commit points to

" }, { "group": "Parameter", "type": "Array", "optional": false, "field": "parents", "description": "

Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/refs", "title": "createReference", "name": "createReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/tags", "title": "createTag", "name": "createTag", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

String of the tag message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "object", "description": "

String of the SHA of the git object this is tagging

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "type", "description": "

String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob.

" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "tagger", "description": "

JSON object that contains the following keys: name - String of the name of the author of the tag, email - String of the email of the author of the tag, date - Timestamp of when this object was tagged

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/trees", "title": "createTree", "name": "createTree", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "tree", "description": "

Array of Hash objects (of path, mode, type and sha) specifying a tree structure

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "base_tree", "description": "

Optional String of the SHA1 of the tree you want to update with new data

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "delete", "url": "/repos/:user/:repo/git/refs/:ref", "title": "deleteReference", "name": "deleteReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/refs", "title": "getAllReferences", "name": "getAllReferences", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/blobs/:sha", "title": "getBlob", "name": "getBlob", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/commits/:sha", "title": "getCommit", "name": "getCommit", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/refs/:ref", "title": "getReference", "name": "getReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/tags/:sha", "title": "getTag", "name": "getTag", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/trees/:sha", "title": "getTree", "name": "getTree", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "recursive", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "patch", "url": "/repos/:user/:repo/git/refs/:ref", "title": "updateReference", "name": "updateReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "force", "description": "

Optional Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/gitignore/templates/:name", "title": "template", "name": "template", "group": "gitignore", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The name of the .gitignore template to get

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitignore" }, { "type": "get", "url": "/gitignore/templates", "title": "templates", "name": "templates", "group": "gitignore", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitignore" }, { "type": "post", "url": "/repos/:user/:repo/issues", "title": "create", "name": "create", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional Login for the user that this issue should be assigned to.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "milestone", "description": "

Optional Milestone to associate this issue with.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "labels", "description": "

Optional Array of strings - Labels to associate with this issue.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/issues/:number/comments", "title": "createComment", "name": "createComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/labels", "title": "createLabel", "name": "createLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "color", "description": "

6 character hex code, without a leading #.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/milestones", "title": "createMilestone", "name": "createMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "due_on", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/issues/comments/:id", "title": "deleteComment", "name": "deleteComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/labels/:name", "title": "deleteLabel", "name": "deleteLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/milestones/:number", "title": "deleteMilestone", "name": "deleteMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/issues/:number", "title": "edit", "name": "edit", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "title", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional Login for the user that this issue should be assigned to.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "milestone", "description": "

Optional Milestone to associate this issue with.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "labels", "description": "

Optional Array of strings - Labels to associate with this issue.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open or closed

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/issues/comments/:id", "title": "editComment", "name": "editComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/issues", "title": "getAll", "name": "getAll", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "filter", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "labels", "description": "

Optional String list of comma separated Label names. Example: bug,ui,@high

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/milestones", "title": "getAllMilestones", "name": "getAllMilestones", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional due_date, completeness, default: due_date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/comments/:id", "title": "getComment", "name": "getComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/comments", "title": "getComments", "name": "getComments", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/events/:id", "title": "getEvent", "name": "getEvent", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/events", "title": "getEvents", "name": "getEvents", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/labels", "title": "getIssueLabels", "name": "getIssueLabels", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/labels/:name", "title": "getLabel", "name": "getLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/labels", "title": "getLabels", "name": "getLabels", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/milestones/:number", "title": "getMilestone", "name": "getMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/events", "title": "getRepoEvents", "name": "getRepoEvents", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number", "title": "getRepoIssue", "name": "getRepoIssue", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/comments", "title": "repoComments", "name": "repoComments", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues", "title": "repoIssues", "name": "repoIssues", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "milestone", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional String User login, none for Issues with no assigned User. * for Issues with any assigned User.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "creator", "description": "

Optional The user that created the issue.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "labels", "description": "

Optional String list of comma separated Label names. Example: bug,ui,@high

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mentioned", "description": "

Optional String User login.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/labels/:name", "title": "updateLabel", "name": "updateLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "color", "description": "

6 character hex code, without a leading #.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/milestones/:number", "title": "updateMilestone", "name": "updateMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "due_on", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/markdown", "title": "render", "name": "render", "group": "markdown", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

The Markdown text to render

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mode", "description": "

Optional The rendering mode, markdown to render a document as plain Markdown, just like README files are rendered. gfm to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "context", "description": "

Optional The repository context, only taken into account when rendering as gfm

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "markdown" }, { "type": "post", "url": "/markdown/raw", "title": "renderRaw", "name": "renderRaw", "group": "markdown", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "data", "description": "

Raw data to send as the body of the request

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "markdown" }, { "type": "get", "url": "/emojis", "title": "emojis", "name": "emojis", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "get", "url": "/meta", "title": "meta", "name": "meta", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "get", "url": "/rate_limit", "title": "rateLimit", "name": "rateLimit", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "put", "url": "/orgs/:org/memberships/:user", "title": "addOrganizationMembership", "name": "addOrganizationMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/members/:user", "title": "addTeamMember", "name": "addTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/memberships/:user", "title": "addTeamMembership", "name": "addTeamMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/repos/:user/:repo", "title": "addTeamRepo", "name": "addTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/public_members/:user", "title": "concealMembership", "name": "concealMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "post", "url": "/orgs/:org/teams", "title": "createTeam", "name": "createTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "repo_names", "description": "

Optional Array of strings

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "permission", "description": "

Optional pull - team members can pull, but not push or administer this repositories (Default), push - team members can pull and push, but not administer this repositores, admin - team members can pull, push and administer these repositories.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id", "title": "deleteTeam", "name": "deleteTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id/members/:user", "title": "deleteTeamMember", "name": "deleteTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id/repos/:user/:repo", "title": "deleteTeamRepo", "name": "deleteTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org", "title": "get", "name": "get", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/users/:user/orgs", "title": "getFromUser", "name": "getFromUser", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/members/:user", "title": "getMember", "name": "getMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/members", "title": "getMembers", "name": "getMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "filter", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/public_members/:user", "title": "getPublicMember", "name": "getPublicMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/public_members", "title": "getPublicMembers", "name": "getPublicMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id", "title": "getTeam", "name": "getTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/members/:user", "title": "getTeamMember", "name": "getTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/members", "title": "getTeamMembers", "name": "getTeamMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/memberships/:user", "title": "getTeamMembership", "name": "getTeamMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/repos/:user/:repo", "title": "getTeamRepo", "name": "getTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/repos", "title": "getTeamRepos", "name": "getTeamRepos", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/teams", "title": "getTeams", "name": "getTeams", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/orgs/:org/public_members/:user", "title": "publicizeMembership", "name": "publicizeMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/members/:user", "title": "removeMember", "name": "removeMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/memberships/:user", "title": "removeOrganizationMembership", "name": "removeOrganizationMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "patch", "url": "/orgs/:org", "title": "update", "name": "update", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "billing_email", "description": "

Optional Billing email address. This address is not publicized.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "company", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "email", "description": "

Optional Publicly visible email address.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "location", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "patch", "url": "/teams/:id", "title": "updateTeam", "name": "updateTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "permission", "description": "

Optional pull - team members can pull, but not push or administer this repositories (Default), push - team members can pull and push, but not administer this repositores, admin - team members can pull, push and administer these repositories.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "post", "url": "/repos/:user/:repo/pulls", "title": "create", "name": "create", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "createComment", "name": "createComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "commit_id", "description": "

Sha of the commit to comment on.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Relative path of the file to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "position", "description": "

Column index in the diff to comment on.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "createCommentReply", "name": "createCommentReply", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "in_reply_to", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls", "title": "createFromIssue", "name": "createFromIssue", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "issue", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "delete", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "deleteComment", "name": "deleteComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number", "title": "get", "name": "get", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls", "title": "getAll", "name": "getAll", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "head", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "base", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values are: created, updated, popularity, long-running, Default: created

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "getComment", "name": "getComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "getComments", "name": "getComments", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/commits", "title": "getCommits", "name": "getCommits", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/files", "title": "getFiles", "name": "getFiles", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/merge", "title": "getMerged", "name": "getMerged", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "put", "url": "/repos/:user/:repo/pulls/:number/merge", "title": "merge", "name": "merge", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "commit_message", "description": "

Optional The message that will be used for the merge commit

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "patch", "url": "/repos/:user/:repo/pulls/:number", "title": "update", "name": "update", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "title", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "patch", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "updateComment", "name": "updateComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:owner/:repo/releases", "title": "createRelease", "name": "createRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag_name", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_commitish", "description": "

Optional Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "draft", "description": "

Optional true to create a draft (unpublished) release, false to create a published one. Default: false

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "prerelease", "description": "

Optional true to identify the release as a prerelease. false to identify the release as a full release. Default: false

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "delete", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "deleteAsset", "name": "deleteAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "delete", "url": "/repos/:owner/:repo/releases/:id", "title": "deleteRelease", "name": "deleteRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "patch", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "editAsset", "name": "editAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "label", "description": "

Optional An alternate short description of the asset. Used in place of the filename.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "patch", "url": "/repos/:owner/:repo/releases/:id", "title": "editRelease", "name": "editRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag_name", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_commitish", "description": "

Optional Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "draft", "description": "

Optional true to create a draft (unpublished) release, false to create a published one. Default: false

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "prerelease", "description": "

Optional true to identify the release as a prerelease. false to identify the release as a full release. Default: false

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "getAsset", "name": "getAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/latest", "title": "getLatestRelease", "name": "getLatestRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/:id", "title": "getRelease", "name": "getRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/:id/assets", "title": "listAssets", "name": "listAssets", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases", "title": "listReleases", "name": "listReleases", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "post", "url": "/repos/:owner/:repo/releases/:id/assets", "title": "uploadAsset", "name": "uploadAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

the file name of the asset

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "put", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "addCollaborator", "name": "addCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/compare/:base...:head", "title": "compareCommits", "name": "compareCommits", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/user/repos", "title": "create", "name": "create", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_init", "description": "

Optional True to create an initial commit with empty README. Default is false

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "gitignore_template", "description": "

Optional Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/commits/:sha/comments", "title": "createCommitComment", "name": "createCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "commit_id", "description": "

Sha of the commit to comment on.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional Relative path of the file to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "position", "description": "

Optional Line index in the diff to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "line", "description": "

Optional Line number in the file to comment on. Defaults to 1.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "createContent", "name": "createContent", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "content", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "message", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional The content path.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/deployments", "title": "createDeployment", "name": "createDeployment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

The ref to deploy. This can be a branch, tag, or sha.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "task", "description": "

The named task to execute. e.g. deploy or deploy:migrations. Default: deploy

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_merge", "description": "

Optional Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "required_contexts", "description": "

Optional Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "payload", "description": "

Optional Optional JSON payload with extra information about the deployment. Default: ''

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "environment", "description": "

Optional The name of the environment that was deployed to. e.g. staging or production. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional Optional short description. Default: ''

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/deployments/:id/statuses", "title": "createDeploymentStatus", "name": "createDeploymentStatus", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional The state of the status. Can be one of pending, success, error, or failure.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_url", "description": "

Optional The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: ''

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional A short description of the status. Default: ''

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "createFile", "name": "createFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "

The new file content, Base64 encoded.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/orgs/:org/repos", "title": "createFromOrg", "name": "createFromOrg", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "team_id", "description": "

Optional The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_init", "description": "

Optional True to create an initial commit with empty README. Default is false

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "gitignore_template", "description": "

Optional Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/hooks", "title": "createHook", "name": "createHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "config", "description": "

A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as 1 for true, and 0 for false. Any JSON true/false values will be converted automatically.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "events", "description": "

Optional Determines what events the hook is triggered for. Default: ['push'].

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "active", "description": "

Optional Determines whether the hook is actually triggered on pushes.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/keys", "title": "createKey", "name": "createKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo", "title": "delete", "name": "delete", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/comments/:id", "title": "deleteCommitComment", "name": "deleteCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/downloads/:id", "title": "deleteDownload", "name": "deleteDownload", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/contents/:path", "title": "deleteFile", "name": "deleteFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "

The blob SHA of the file being removed.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/hooks/:id", "title": "deleteHook", "name": "deleteHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/keys/:id", "title": "deleteKey", "name": "deleteKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/forks", "title": "fork", "name": "fork", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "organization", "description": "

Optional Organization login. The repository will be forked into this organization.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo", "title": "get", "name": "get", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/repos", "title": "getAll", "name": "getAll", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, owner, public, private, member. Default: all.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: created, updated, pushed, full_name. Default: full_name.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/comments", "title": "getAllCommitComments", "name": "getAllCommitComments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/:archive_format/:ref", "title": "getArchiveLink", "name": "getArchiveLink", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "archive_format", "description": "

Either tarball or zipball

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/branches/:branch", "title": "getBranch", "name": "getBranch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "branch", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/branches", "title": "getBranches", "name": "getBranches", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "getCollaborator", "name": "getCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/collaborators", "title": "getCollaborators", "name": "getCollaborators", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha", "title": "getCommit", "name": "getCommit", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/comments/:id", "title": "getCommitComment", "name": "getCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/comments", "title": "getCommitComments", "name": "getCommitComments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits", "title": "getCommits", "name": "getCommits", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sha", "description": "

Optional Sha or branch to start listing commits from.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional Only commits containing this file path will be returned.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "author", "description": "

Optional GitHub login or email address by which to filter by commit author.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "until", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/contents/:path", "title": "getContent", "name": "getContent", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional The content path.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/contributors", "title": "getContributors", "name": "getContributors", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "anon", "description": "

Optional Set to 1 or true to include anonymous contributors in results.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/deployments/:id/statuses", "title": "getDeploymentStatuses", "name": "getDeploymentStatuses", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/deployments", "title": "getDeployments", "name": "getDeployments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sha", "description": "

Optional The short or long sha that was recorded at creation time. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The name of the ref. This can be a branch, tag, or sha. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "task", "description": "

Optional The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "environment", "description": "

Optional The name of the environment that was deployed to. e.g. staging or production. Default: none.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/downloads/:id", "title": "getDownload", "name": "getDownload", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/downloads", "title": "getDownloads", "name": "getDownloads", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/forks", "title": "getForks", "name": "getForks", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: newest, oldest, watchers, default: newest.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/orgs/:org/repos", "title": "getFromOrg", "name": "getFromOrg", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, public, private, forks, sources, member. Default: all.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/repos", "title": "getFromUser", "name": "getFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, owner, member. Default: owner.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: created, updated, pushed, full_name. Default: full_name.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/hooks/:id", "title": "getHook", "name": "getHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/hooks", "title": "getHooks", "name": "getHooks", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/keys/:id", "title": "getKey", "name": "getKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/keys", "title": "getKeys", "name": "getKeys", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/languages", "title": "getLanguages", "name": "getLanguages", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/readme", "title": "getReadme", "name": "getReadme", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stargazers", "title": "getStargazers", "name": "getStargazers", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/starred", "title": "getStarred", "name": "getStarred", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/starred", "title": "getStarredFromUser", "name": "getStarredFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/starred/:user/:repo", "title": "getStarring", "name": "getStarring", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/code_frequency", "title": "getStatsCodeFrequency", "name": "getStatsCodeFrequency", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/commit_activity", "title": "getStatsCommitActivity", "name": "getStatsCommitActivity", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/contributors", "title": "getStatsContributors", "name": "getStatsContributors", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/participation", "title": "getStatsParticipation", "name": "getStatsParticipation", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/punch_card", "title": "getStatsPunchCard", "name": "getStatsPunchCard", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/tags", "title": "getTags", "name": "getTags", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/teams", "title": "getTeams", "name": "getTeams", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/watched", "title": "getWatched", "name": "getWatched", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/watched", "title": "getWatchedFromUser", "name": "getWatchedFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/watchers", "title": "getWatchers", "name": "getWatchers", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/watched/:user/:repo", "title": "getWatching", "name": "getWatching", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/merges", "title": "merge", "name": "merge", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "commit_message", "description": "

Optional Commit message to use for the merge commit. If omitted, a default message will be used.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repositories/:id", "title": "one", "name": "one", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "removeCollaborator", "name": "removeCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/user/starred/:user/:repo", "title": "star", "name": "star", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/hooks/:id/test", "title": "testHook", "name": "testHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/user/starred/:user/:repo", "title": "unStar", "name": "unStar", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/user/watched/:user/:repo", "title": "unWatch", "name": "unWatch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo", "title": "update", "name": "update", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "default_branch", "description": "

Optional Updates the default branch for this repository.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo/comments/:id", "title": "updateCommitComment", "name": "updateCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "updateFile", "name": "updateFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "

The updated file content, Base64 encoded.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "

The blob SHA of the file being replaced.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo/hooks/:id", "title": "updateHook", "name": "updateHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "config", "description": "

A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as 1 for true, and 0 for false. Any JSON true/false values will be converted automatically.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "events", "description": "

Optional Determines what events the hook is triggered for. This replaces the entire array of events. Default: ['push'].

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "add_events", "description": "

Optional Determines a list of events to be added to the list of events that the Hook triggers for.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "remove_events", "description": "

Optional Determines a list of events to be removed from the list of events that the Hook triggers for.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "active", "description": "

Optional Determines whether the hook is actually triggered on pushes.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/keys/:id", "title": "updateKey", "name": "updateKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/user/watched/:user/:repo", "title": "watch", "name": "watch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/search/code", "title": "code", "name": "code", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional indexed only

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/legacy/user/email/:email", "title": "email", "name": "email", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

Email address

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/issues", "title": "issues", "name": "issues", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional comments, created, or updated

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/repositories", "title": "repos", "name": "repos", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional stars, forks, or updated

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/users", "title": "users", "name": "users", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional followers, repositories, or joined

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "post", "url": "/repos/:user/:repo/statuses/:sha", "title": "create", "name": "create", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "state", "description": "

State of the status - can be one of pending, success, error, or failure.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_url", "description": "

Optional Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional Short description of the status.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "context", "description": "

Optional A string label to differentiate this status from the status of other systems.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/statuses", "title": "get", "name": "get", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/status", "title": "getCombined", "name": "getCombined", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "post", "url": "/user/emails", "title": "addEmails", "name": "addEmails", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "post", "url": "/user/keys", "title": "createKey", "name": "createKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/emails", "title": "deleteEmails", "name": "deleteEmails", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/keys/:id", "title": "deleteKey", "name": "deleteKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user/memberships/orgs/:org", "title": "editOrganizationMembership", "name": "editOrganizationMembership", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "state", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "put", "url": "/user/following/:user", "title": "followUser", "name": "followUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user", "title": "get", "name": "get", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users", "title": "getAll", "name": "getAll", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "since", "description": "

Optional The integer ID of the last User that you’ve seen.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/emails", "title": "getEmails", "name": "getEmails", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/following/:user", "title": "getFollowUser", "name": "getFollowUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/followers", "title": "getFollowers", "name": "getFollowers", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/following", "title": "getFollowing", "name": "getFollowing", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/following", "title": "getFollowingFromUser", "name": "getFollowingFromUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user", "title": "getFrom", "name": "getFrom", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/keys/:id", "title": "getKey", "name": "getKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/keys", "title": "getKeys", "name": "getKeys", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/keys", "title": "getKeysFromUser", "name": "getKeysFromUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/orgs", "title": "getOrgs", "name": "getOrgs", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/teams", "title": "getTeams", "name": "getTeams", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/following/:user", "title": "unFollowUser", "name": "unFollowUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user", "title": "update", "name": "update", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "email", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "blog", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "company", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "location", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "hireable", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bio", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user/keys/:id", "title": "updateKey", "name": "updateKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" } ] }); diff --git a/apidoc/api_data.json b/apidoc/api_data.json new file mode 100644 index 0000000000..1747d73cb4 --- /dev/null +++ b/apidoc/api_data.json @@ -0,0 +1 @@ +[ { "type": "post", "url": "/authorizations", "title": "create", "name": "create", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Array", "optional": true, "field": "scopes", "description": "

Optional A list of scopes that this authorization is in.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note", "description": "

Optional A note to remind you what the OAuth token is for.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note_url", "description": "

Optional A URL to remind you what app the OAuth token is for.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "delete", "url": "/authorizations/:id", "title": "delete", "name": "delete", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/authorizations/:id", "title": "get", "name": "get", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/authorizations", "title": "getAll", "name": "getAll", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "patch", "url": "/authorizations/:id", "title": "update", "name": "update", "group": "authorization", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "scopes", "description": "

Optional A list of scopes that this authorization is in.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "add_scopes", "description": "

Optional A list of scopes to add to this authorization.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "remove_scopes", "description": "

Optional A list of scopes to remove from this authorization.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note", "description": "

Optional A note to remind you what the OAuth token is for.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "note_url", "description": "

Optional A URL to remind you what app the OAuth token is for.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "authorization" }, { "type": "get", "url": "/events", "title": "get", "name": "get", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/orgs/:org/events", "title": "getFromOrg", "name": "getFromOrg", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/repos/:user/:repo/events", "title": "getFromRepo", "name": "getFromRepo", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/repos/:user/:repo/issues/events", "title": "getFromRepoIssues", "name": "getFromRepoIssues", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/networks/:user/:repo/events", "title": "getFromRepoNetwork", "name": "getFromRepoNetwork", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events", "title": "getFromUser", "name": "getFromUser", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events/orgs/:org", "title": "getFromUserOrg", "name": "getFromUserOrg", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/events/public", "title": "getFromUserPublic", "name": "getFromUserPublic", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/received_events", "title": "getReceived", "name": "getReceived", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/users/:user/received_events/public", "title": "getReceivedPublic", "name": "getReceivedPublic", "group": "events", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "events" }, { "type": "get", "url": "/gists/:id/star", "title": "checkStar", "name": "checkStar", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists", "title": "create", "name": "create", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Boolean", "optional": false, "field": "public", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "files", "description": "

Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists/:gist_id/comments", "title": "createComment", "name": "createComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:id", "title": "delete", "name": "delete", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:gist_id/comments/:id", "title": "deleteComment", "name": "deleteComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "delete", "url": "/gists/:id/star", "title": "deleteStar", "name": "deleteStar", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "patch", "url": "/gists/:id", "title": "edit", "name": "edit", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "files", "description": "

Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "patch", "url": "/gists/:gist_id/comments/:id", "title": "editComment", "name": "editComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/gists/:id/fork", "title": "fork", "name": "fork", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:id", "title": "get", "name": "get", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists", "title": "getAll", "name": "getAll", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:gist_id/comments/:id", "title": "getComment", "name": "getComment", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/:gist_id/comments", "title": "getComments", "name": "getComments", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "gist_id", "description": "

Id (SHA1 hash) of the gist.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/users/:user/gists", "title": "getFromUser", "name": "getFromUser", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/public", "title": "public", "name": "public", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "put", "url": "/gists/:id/star", "title": "star", "name": "star", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "get", "url": "/gists/starred", "title": "starred", "name": "starred", "group": "gists", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gists" }, { "type": "post", "url": "/repos/:user/:repo/git/blobs", "title": "createBlob", "name": "createBlob", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "encoding", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/commits", "title": "createCommit", "name": "createCommit", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

String of the commit message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tree", "description": "

String of the SHA of the tree object this commit points to

" }, { "group": "Parameter", "type": "Array", "optional": false, "field": "parents", "description": "

Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/refs", "title": "createReference", "name": "createReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/tags", "title": "createTag", "name": "createTag", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

String of the tag message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "object", "description": "

String of the SHA of the git object this is tagging

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "type", "description": "

String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob.

" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "tagger", "description": "

JSON object that contains the following keys: name - String of the name of the author of the tag, email - String of the email of the author of the tag, date - Timestamp of when this object was tagged

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "post", "url": "/repos/:user/:repo/git/trees", "title": "createTree", "name": "createTree", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "tree", "description": "

Array of Hash objects (of path, mode, type and sha) specifying a tree structure

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "base_tree", "description": "

Optional String of the SHA1 of the tree you want to update with new data

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "delete", "url": "/repos/:user/:repo/git/refs/:ref", "title": "deleteReference", "name": "deleteReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/refs", "title": "getAllReferences", "name": "getAllReferences", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/blobs/:sha", "title": "getBlob", "name": "getBlob", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/commits/:sha", "title": "getCommit", "name": "getCommit", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/refs/:ref", "title": "getReference", "name": "getReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/tags/:sha", "title": "getTag", "name": "getTag", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/repos/:user/:repo/git/trees/:sha", "title": "getTree", "name": "getTree", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "recursive", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "patch", "url": "/repos/:user/:repo/git/refs/:ref", "title": "updateReference", "name": "updateReference", "group": "gitdata", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "force", "description": "

Optional Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitdata" }, { "type": "get", "url": "/gitignore/templates/:name", "title": "template", "name": "template", "group": "gitignore", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The name of the .gitignore template to get

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitignore" }, { "type": "get", "url": "/gitignore/templates", "title": "templates", "name": "templates", "group": "gitignore", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "gitignore" }, { "type": "post", "url": "/repos/:user/:repo/issues", "title": "create", "name": "create", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional Login for the user that this issue should be assigned to.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "milestone", "description": "

Optional Milestone to associate this issue with.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "labels", "description": "

Optional Array of strings - Labels to associate with this issue.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/issues/:number/comments", "title": "createComment", "name": "createComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/labels", "title": "createLabel", "name": "createLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "color", "description": "

6 character hex code, without a leading #.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/milestones", "title": "createMilestone", "name": "createMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "due_on", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/issues/comments/:id", "title": "deleteComment", "name": "deleteComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/labels/:name", "title": "deleteLabel", "name": "deleteLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "delete", "url": "/repos/:user/:repo/milestones/:number", "title": "deleteMilestone", "name": "deleteMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/issues/:number", "title": "edit", "name": "edit", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "title", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional Login for the user that this issue should be assigned to.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "milestone", "description": "

Optional Milestone to associate this issue with.

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "labels", "description": "

Optional Array of strings - Labels to associate with this issue.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open or closed

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/issues/comments/:id", "title": "editComment", "name": "editComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/issues", "title": "getAll", "name": "getAll", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "filter", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "labels", "description": "

Optional String list of comma separated Label names. Example: bug,ui,@high

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/milestones", "title": "getAllMilestones", "name": "getAllMilestones", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional due_date, completeness, default: due_date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/comments/:id", "title": "getComment", "name": "getComment", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/comments", "title": "getComments", "name": "getComments", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/events/:id", "title": "getEvent", "name": "getEvent", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/events", "title": "getEvents", "name": "getEvents", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number/labels", "title": "getIssueLabels", "name": "getIssueLabels", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/labels/:name", "title": "getLabel", "name": "getLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/labels", "title": "getLabels", "name": "getLabels", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/milestones/:number", "title": "getMilestone", "name": "getMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/events", "title": "getRepoEvents", "name": "getRepoEvents", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/:number", "title": "getRepoIssue", "name": "getRepoIssue", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues/comments", "title": "repoComments", "name": "repoComments", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "get", "url": "/repos/:user/:repo/issues", "title": "repoIssues", "name": "repoIssues", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "milestone", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "assignee", "description": "

Optional String User login, none for Issues with no assigned User. * for Issues with any assigned User.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "creator", "description": "

Optional The user that created the issue.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "labels", "description": "

Optional String list of comma separated Label names. Example: bug,ui,@high

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mentioned", "description": "

Optional String User login.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/repos/:user/:repo/labels/:name", "title": "updateLabel", "name": "updateLabel", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "color", "description": "

6 character hex code, without a leading #.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "patch", "url": "/repos/:user/:repo/milestones/:number", "title": "updateMilestone", "name": "updateMilestone", "group": "issues", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "due_on", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "issues" }, { "type": "post", "url": "/markdown", "title": "render", "name": "render", "group": "markdown", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

The Markdown text to render

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mode", "description": "

Optional The rendering mode, markdown to render a document as plain Markdown, just like README files are rendered. gfm to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "context", "description": "

Optional The repository context, only taken into account when rendering as gfm

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "markdown" }, { "type": "post", "url": "/markdown/raw", "title": "renderRaw", "name": "renderRaw", "group": "markdown", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "data", "description": "

Raw data to send as the body of the request

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "markdown" }, { "type": "get", "url": "/emojis", "title": "emojis", "name": "emojis", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "get", "url": "/meta", "title": "meta", "name": "meta", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "get", "url": "/rate_limit", "title": "rateLimit", "name": "rateLimit", "group": "misc", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "misc" }, { "type": "put", "url": "/orgs/:org/memberships/:user", "title": "addOrganizationMembership", "name": "addOrganizationMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/members/:user", "title": "addTeamMember", "name": "addTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/memberships/:user", "title": "addTeamMembership", "name": "addTeamMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/teams/:id/repos/:user/:repo", "title": "addTeamRepo", "name": "addTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/public_members/:user", "title": "concealMembership", "name": "concealMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "post", "url": "/orgs/:org/teams", "title": "createTeam", "name": "createTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "repo_names", "description": "

Optional Array of strings

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "permission", "description": "

Optional pull - team members can pull, but not push or administer this repositories (Default), push - team members can pull and push, but not administer this repositores, admin - team members can pull, push and administer these repositories.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id", "title": "deleteTeam", "name": "deleteTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id/members/:user", "title": "deleteTeamMember", "name": "deleteTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/teams/:id/repos/:user/:repo", "title": "deleteTeamRepo", "name": "deleteTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org", "title": "get", "name": "get", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/users/:user/orgs", "title": "getFromUser", "name": "getFromUser", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/members/:user", "title": "getMember", "name": "getMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/members", "title": "getMembers", "name": "getMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "filter", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/public_members/:user", "title": "getPublicMember", "name": "getPublicMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/public_members", "title": "getPublicMembers", "name": "getPublicMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id", "title": "getTeam", "name": "getTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/members/:user", "title": "getTeamMember", "name": "getTeamMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/members", "title": "getTeamMembers", "name": "getTeamMembers", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/memberships/:user", "title": "getTeamMembership", "name": "getTeamMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/repos/:user/:repo", "title": "getTeamRepo", "name": "getTeamRepo", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/teams/:id/repos", "title": "getTeamRepos", "name": "getTeamRepos", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "get", "url": "/orgs/:org/teams", "title": "getTeams", "name": "getTeams", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "put", "url": "/orgs/:org/public_members/:user", "title": "publicizeMembership", "name": "publicizeMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/members/:user", "title": "removeMember", "name": "removeMember", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "delete", "url": "/orgs/:org/memberships/:user", "title": "removeOrganizationMembership", "name": "removeOrganizationMembership", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "patch", "url": "/orgs/:org", "title": "update", "name": "update", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "billing_email", "description": "

Optional Billing email address. This address is not publicized.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "company", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "email", "description": "

Optional Publicly visible email address.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "location", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "patch", "url": "/teams/:id", "title": "updateTeam", "name": "updateTeam", "group": "orgs", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "permission", "description": "

Optional pull - team members can pull, but not push or administer this repositories (Default), push - team members can pull and push, but not administer this repositores, admin - team members can pull, push and administer these repositories.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "orgs" }, { "type": "post", "url": "/repos/:user/:repo/pulls", "title": "create", "name": "create", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "createComment", "name": "createComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "commit_id", "description": "

Sha of the commit to comment on.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Relative path of the file to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "position", "description": "

Column index in the diff to comment on.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "createCommentReply", "name": "createCommentReply", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "in_reply_to", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:user/:repo/pulls", "title": "createFromIssue", "name": "createFromIssue", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "issue", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "delete", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "deleteComment", "name": "deleteComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number", "title": "get", "name": "get", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls", "title": "getAll", "name": "getAll", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional open, closed, or all

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "head", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "base", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values are: created, updated, popularity, long-running, Default: created

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "getComment", "name": "getComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/comments", "title": "getComments", "name": "getComments", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/commits", "title": "getCommits", "name": "getCommits", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/files", "title": "getFiles", "name": "getFiles", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "get", "url": "/repos/:user/:repo/pulls/:number/merge", "title": "getMerged", "name": "getMerged", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "put", "url": "/repos/:user/:repo/pulls/:number/merge", "title": "merge", "name": "merge", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "commit_message", "description": "

Optional The message that will be used for the merge commit

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "patch", "url": "/repos/:user/:repo/pulls/:number", "title": "update", "name": "update", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "title", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "patch", "url": "/repos/:user/:repo/pulls/comments/:number", "title": "updateComment", "name": "updateComment", "group": "pullRequests", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "number", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "pullRequests" }, { "type": "post", "url": "/repos/:owner/:repo/releases", "title": "createRelease", "name": "createRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag_name", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_commitish", "description": "

Optional Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "draft", "description": "

Optional true to create a draft (unpublished) release, false to create a published one. Default: false

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "prerelease", "description": "

Optional true to identify the release as a prerelease. false to identify the release as a full release. Default: false

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "delete", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "deleteAsset", "name": "deleteAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "delete", "url": "/repos/:owner/:repo/releases/:id", "title": "deleteRelease", "name": "deleteRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "patch", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "editAsset", "name": "editAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "label", "description": "

Optional An alternate short description of the asset. Used in place of the filename.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "patch", "url": "/repos/:owner/:repo/releases/:id", "title": "editRelease", "name": "editRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "tag_name", "description": "

String of the tag

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_commitish", "description": "

Optional Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "body", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "draft", "description": "

Optional true to create a draft (unpublished) release, false to create a published one. Default: false

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "prerelease", "description": "

Optional true to identify the release as a prerelease. false to identify the release as a full release. Default: false

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/assets/:id", "title": "getAsset", "name": "getAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/latest", "title": "getLatestRelease", "name": "getLatestRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/:id", "title": "getRelease", "name": "getRelease", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases/:id/assets", "title": "listAssets", "name": "listAssets", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "get", "url": "/repos/:owner/:repo/releases", "title": "listReleases", "name": "listReleases", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "post", "url": "/repos/:owner/:repo/releases/:id/assets", "title": "uploadAsset", "name": "uploadAsset", "group": "releases", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "owner", "description": "" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

the file name of the asset

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "releases" }, { "type": "put", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "addCollaborator", "name": "addCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/compare/:base...:head", "title": "compareCommits", "name": "compareCommits", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/user/repos", "title": "create", "name": "create", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_init", "description": "

Optional True to create an initial commit with empty README. Default is false

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "gitignore_template", "description": "

Optional Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/commits/:sha/comments", "title": "createCommitComment", "name": "createCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "commit_id", "description": "

Sha of the commit to comment on.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional Relative path of the file to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "position", "description": "

Optional Line index in the diff to comment on.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "line", "description": "

Optional Line number in the file to comment on. Defaults to 1.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "createContent", "name": "createContent", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "content", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "message", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional The content path.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/deployments", "title": "createDeployment", "name": "createDeployment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "ref", "description": "

The ref to deploy. This can be a branch, tag, or sha.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "task", "description": "

The named task to execute. e.g. deploy or deploy:migrations. Default: deploy

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_merge", "description": "

Optional Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "required_contexts", "description": "

Optional Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "payload", "description": "

Optional Optional JSON payload with extra information about the deployment. Default: ''

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "environment", "description": "

Optional The name of the environment that was deployed to. e.g. staging or production. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional Optional short description. Default: ''

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/deployments/:id/statuses", "title": "createDeploymentStatus", "name": "createDeploymentStatus", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "state", "description": "

Optional The state of the status. Can be one of pending, success, error, or failure.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_url", "description": "

Optional The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: ''

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional A short description of the status. Default: ''

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "createFile", "name": "createFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "

The new file content, Base64 encoded.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/orgs/:org/repos", "title": "createFromOrg", "name": "createFromOrg", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "team_id", "description": "

Optional The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "auto_init", "description": "

Optional True to create an initial commit with empty README. Default is false

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "gitignore_template", "description": "

Optional Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/hooks", "title": "createHook", "name": "createHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "config", "description": "

A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as 1 for true, and 0 for false. Any JSON true/false values will be converted automatically.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "events", "description": "

Optional Determines what events the hook is triggered for. Default: ['push'].

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "active", "description": "

Optional Determines whether the hook is actually triggered on pushes.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/keys", "title": "createKey", "name": "createKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo", "title": "delete", "name": "delete", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/comments/:id", "title": "deleteCommitComment", "name": "deleteCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/downloads/:id", "title": "deleteDownload", "name": "deleteDownload", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/contents/:path", "title": "deleteFile", "name": "deleteFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "

The blob SHA of the file being removed.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/hooks/:id", "title": "deleteHook", "name": "deleteHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/keys/:id", "title": "deleteKey", "name": "deleteKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/forks", "title": "fork", "name": "fork", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "organization", "description": "

Optional Organization login. The repository will be forked into this organization.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo", "title": "get", "name": "get", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/repos", "title": "getAll", "name": "getAll", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, owner, public, private, member. Default: all.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: created, updated, pushed, full_name. Default: full_name.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/comments", "title": "getAllCommitComments", "name": "getAllCommitComments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/:archive_format/:ref", "title": "getArchiveLink", "name": "getArchiveLink", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "archive_format", "description": "

Either tarball or zipball

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/branches/:branch", "title": "getBranch", "name": "getBranch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "branch", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/branches", "title": "getBranches", "name": "getBranches", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "getCollaborator", "name": "getCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/collaborators", "title": "getCollaborators", "name": "getCollaborators", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha", "title": "getCommit", "name": "getCommit", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/comments/:id", "title": "getCommitComment", "name": "getCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/comments", "title": "getCommitComments", "name": "getCommitComments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/commits", "title": "getCommits", "name": "getCommits", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sha", "description": "

Optional Sha or branch to start listing commits from.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional Only commits containing this file path will be returned.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "author", "description": "

Optional GitHub login or email address by which to filter by commit author.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "since", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" }, { "group": "Parameter", "type": "Date", "optional": true, "field": "until", "description": "

Optional Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/contents/:path", "title": "getContent", "name": "getContent", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Optional The content path.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/contributors", "title": "getContributors", "name": "getContributors", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "anon", "description": "

Optional Set to 1 or true to include anonymous contributors in results.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/deployments/:id/statuses", "title": "getDeploymentStatuses", "name": "getDeploymentStatuses", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/deployments", "title": "getDeployments", "name": "getDeployments", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sha", "description": "

Optional The short or long sha that was recorded at creation time. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The name of the ref. This can be a branch, tag, or sha. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "task", "description": "

Optional The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "environment", "description": "

Optional The name of the environment that was deployed to. e.g. staging or production. Default: none.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/downloads/:id", "title": "getDownload", "name": "getDownload", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/downloads", "title": "getDownloads", "name": "getDownloads", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/forks", "title": "getForks", "name": "getForks", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: newest, oldest, watchers, default: newest.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/orgs/:org/repos", "title": "getFromOrg", "name": "getFromOrg", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, public, private, forks, sources, member. Default: all.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/repos", "title": "getFromUser", "name": "getFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "type", "description": "

Optional Possible values: all, owner, member. Default: owner.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional Possible values: created, updated, pushed, full_name. Default: full_name.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "direction", "description": "

Optional

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/hooks/:id", "title": "getHook", "name": "getHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/hooks", "title": "getHooks", "name": "getHooks", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/keys/:id", "title": "getKey", "name": "getKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/keys", "title": "getKeys", "name": "getKeys", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/languages", "title": "getLanguages", "name": "getLanguages", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/readme", "title": "getReadme", "name": "getReadme", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ref", "description": "

Optional The String name of the Commit/Branch/Tag. Defaults to master.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stargazers", "title": "getStargazers", "name": "getStargazers", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/starred", "title": "getStarred", "name": "getStarred", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/starred", "title": "getStarredFromUser", "name": "getStarredFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/starred/:user/:repo", "title": "getStarring", "name": "getStarring", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/code_frequency", "title": "getStatsCodeFrequency", "name": "getStatsCodeFrequency", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/commit_activity", "title": "getStatsCommitActivity", "name": "getStatsCommitActivity", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/contributors", "title": "getStatsContributors", "name": "getStatsContributors", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/participation", "title": "getStatsParticipation", "name": "getStatsParticipation", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/stats/punch_card", "title": "getStatsPunchCard", "name": "getStatsPunchCard", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/tags", "title": "getTags", "name": "getTags", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/teams", "title": "getTeams", "name": "getTeams", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/watched", "title": "getWatched", "name": "getWatched", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/users/:user/watched", "title": "getWatchedFromUser", "name": "getWatchedFromUser", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repos/:user/:repo/watchers", "title": "getWatchers", "name": "getWatchers", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/user/watched/:user/:repo", "title": "getWatching", "name": "getWatching", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/merges", "title": "merge", "name": "merge", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "base", "description": "

The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "head", "description": "

The branch (or git ref) where your changes are implemented.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "commit_message", "description": "

Optional Commit message to use for the merge commit. If omitted, a default message will be used.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/repositories/:id", "title": "one", "name": "one", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/repos/:user/:repo/collaborators/:collabuser", "title": "removeCollaborator", "name": "removeCollaborator", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "collabuser", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/user/starred/:user/:repo", "title": "star", "name": "star", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "post", "url": "/repos/:user/:repo/hooks/:id/test", "title": "testHook", "name": "testHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/user/starred/:user/:repo", "title": "unStar", "name": "unStar", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "delete", "url": "/user/watched/:user/:repo", "title": "unWatch", "name": "unWatch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo", "title": "update", "name": "update", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "homepage", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "private", "description": "

Optional True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_issues", "description": "

Optional True to enable issues for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_wiki", "description": "

Optional True to enable the wiki for this repository, false to disable it. Default is true.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "has_downloads", "description": "

Optional True to enable downloads for this repository, false to disable them. Default is true.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "default_branch", "description": "

Optional Updates the default branch for this repository.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo/comments/:id", "title": "updateCommitComment", "name": "updateCommitComment", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "body", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/contents/:path", "title": "updateFile", "name": "updateFile", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

The content path.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

The commit message.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "

The updated file content, Base64 encoded.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "

The blob SHA of the file being replaced.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "branch", "description": "

Optional The branch name. If not provided, uses the repository’s default branch (usually master).

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "author", "description": "

Optional

" }, { "group": "Parameter", "type": "Json", "optional": true, "field": "committer", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "patch", "url": "/repos/:user/:repo/hooks/:id", "title": "updateHook", "name": "updateHook", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "" }, { "group": "Parameter", "type": "Json", "optional": false, "field": "config", "description": "

A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as 1 for true, and 0 for false. Any JSON true/false values will be converted automatically.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "events", "description": "

Optional Determines what events the hook is triggered for. This replaces the entire array of events. Default: ['push'].

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "add_events", "description": "

Optional Determines a list of events to be added to the list of events that the Hook triggers for.

" }, { "group": "Parameter", "type": "Array", "optional": true, "field": "remove_events", "description": "

Optional Determines a list of events to be removed from the list of events that the Hook triggers for.

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "active", "description": "

Optional Determines whether the hook is actually triggered on pushes.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/repos/:user/:repo/keys/:id", "title": "updateKey", "name": "updateKey", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "put", "url": "/user/watched/:user/:repo", "title": "watch", "name": "watch", "group": "repos", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "repos" }, { "type": "get", "url": "/search/code", "title": "code", "name": "code", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional indexed only

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/legacy/user/email/:email", "title": "email", "name": "email", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

Email address

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/issues", "title": "issues", "name": "issues", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional comments, created, or updated

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/repositories", "title": "repos", "name": "repos", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional stars, forks, or updated

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "get", "url": "/search/users", "title": "users", "name": "users", "group": "search", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "q", "description": "

Search Term

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sort", "description": "

Optional followers, repositories, or joined

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "order", "description": "

Optional asc or desc

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "search" }, { "type": "post", "url": "/repos/:user/:repo/statuses/:sha", "title": "create", "name": "create", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "state", "description": "

State of the status - can be one of pending, success, error, or failure.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "target_url", "description": "

Optional Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "description", "description": "

Optional Short description of the status.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "context", "description": "

Optional A string label to differentiate this status from the status of other systems.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/statuses", "title": "get", "name": "get", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "get", "url": "/repos/:user/:repo/commits/:sha/status", "title": "getCombined", "name": "getCombined", "group": "statuses", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "repo", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "sha", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "statuses" }, { "type": "post", "url": "/user/emails", "title": "addEmails", "name": "addEmails", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "post", "url": "/user/keys", "title": "createKey", "name": "createKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/emails", "title": "deleteEmails", "name": "deleteEmails", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/keys/:id", "title": "deleteKey", "name": "deleteKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user/memberships/orgs/:org", "title": "editOrganizationMembership", "name": "editOrganizationMembership", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "org", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "state", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "put", "url": "/user/following/:user", "title": "followUser", "name": "followUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user", "title": "get", "name": "get", "group": "user", "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users", "title": "getAll", "name": "getAll", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "since", "description": "

Optional The integer ID of the last User that you’ve seen.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/emails", "title": "getEmails", "name": "getEmails", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/following/:user", "title": "getFollowUser", "name": "getFollowUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/followers", "title": "getFollowers", "name": "getFollowers", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/following", "title": "getFollowing", "name": "getFollowing", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/following", "title": "getFollowingFromUser", "name": "getFollowingFromUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user", "title": "getFrom", "name": "getFrom", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/keys/:id", "title": "getKey", "name": "getKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/keys", "title": "getKeys", "name": "getKeys", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/users/:user/keys", "title": "getKeysFromUser", "name": "getKeysFromUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/orgs", "title": "getOrgs", "name": "getOrgs", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "get", "url": "/user/teams", "title": "getTeams", "name": "getTeams", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "description": "

Optional Page number of the results to fetch.

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "per_page", "description": "

Optional A custom page size up to 100. Default is 30.

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "delete", "url": "/user/following/:user", "title": "unFollowUser", "name": "unFollowUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user", "title": "update", "name": "update", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "email", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "blog", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "company", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "location", "description": "

Optional

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "hireable", "description": "

Optional

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bio", "description": "

Optional

" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" }, { "type": "patch", "url": "/user/keys/:id", "title": "updateKey", "name": "updateKey", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "" }, { "group": "Parameter", "type": "String", "optional": false, "field": "key", "description": "" } ] } }, "version": "0.0.0", "filename": "doc/apidocs.js", "groupTitle": "user" } ] diff --git a/apidoc/api_project.js b/apidoc/api_project.js new file mode 100644 index 0000000000..7fa4b1a70a --- /dev/null +++ b/apidoc/api_project.js @@ -0,0 +1 @@ +define({ "title": "github4", "url": "https://kaizensoze.github.io/github4/", "name": "github4", "version": "0.2.11", "description": "NodeJS wrapper for the GitHub API", "sampleUrl": false, "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2015-12-26T21:38:37.341Z", "url": "http://apidocjs.com", "version": "0.14.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json new file mode 100644 index 0000000000..0ecd30772a --- /dev/null +++ b/apidoc/api_project.json @@ -0,0 +1 @@ +{ "title": "github4", "url": "https://kaizensoze.github.io/github4/", "name": "github4", "version": "0.2.11", "description": "NodeJS wrapper for the GitHub API", "sampleUrl": false, "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2015-12-26T21:38:37.341Z", "url": "http://apidocjs.com", "version": "0.14.0" } } diff --git a/apidoc/css/style.css b/apidoc/css/style.css new file mode 100644 index 0000000000..cdf5f0c1d7 --- /dev/null +++ b/apidoc/css/style.css @@ -0,0 +1,538 @@ +/* ------------------------------------------------------------------------------------------ + * Content + * ------------------------------------------------------------------------------------------ */ +body { + min-width: 980px; + max-width: 1280px; +} + +body, p, a, div, th, td { + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 16px; +} + +td.code { + font-size: 14px; + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 400; +} + +#content { + padding-top: 16px; + z-Index: -1; + margin-left: 270px; +} + +p { + color: #808080; +} + +h1 { + font-family: "Source Sans Pro Semibold", sans-serif; + font-weight: normal; + font-size: 44px; + line-height: 50px; + margin: 0 0 10px 0; + padding: 0; +} + +h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: normal; + font-size: 24px; + line-height: 40px; + margin: 0 0 20px 0; + padding: 0; +} + +section { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +section h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +article { + padding: 14px 0 30px 0; +} + +article h1 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 24px; + line-height: 26px; +} + +article h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 18px; + line-height: 24px; + margin: 0 0 10px 0; +} + +article h3 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 16px; + line-height: 18px; + margin: 0 0 10px 0; +} + +article h4 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 14px; + line-height: 16px; + margin: 0 0 8px 0; +} + +table { + border-collapse: collapse; + width: 100%; + margin: 0 0 20px 0; +} + +th { + background-color: #f5f5f5; + text-align: left; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + padding: 4px 8px; + border: #e0e0e0 1px solid; +} + +td { + vertical-align: top; + padding: 2px 8px; + border: #e0e0e0 1px solid; +} + +#generator .content { + color: #b0b0b0; + border-top: 1px solid #ebebeb; + padding: 10px 0; +} + +.label-optional { + float: right; +} + +.open-left { + right: 0; + left: auto; +} + +/* ------------------------------------------------------------------------------------------ + * apidoc - intro + * ------------------------------------------------------------------------------------------ */ + +#apidoc .apidoc { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +#apidoc h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +#apidoc h2 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 22px; + line-height: 26px; + padding-top: 14px; +} + +/* ------------------------------------------------------------------------------------------ + * pre / code + * ------------------------------------------------------------------------------------------ */ +pre { + background-color: #292b36; + color: #ffffff; + padding: 10px; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; +} + +code.language-text { + word-wrap: break-word; +} + +pre.language-json { + overflow: auto; +} + +pre.language-html { + margin: 40px 0 20px 0; +} + +pre.language-html:before { + content: attr(data-type); + position: absolute; + top: -30px; + left: 0; + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 15px; + display: inline-block; + padding: 2px 5px; + border-radius: 6px; + text-transform: uppercase; + background-color: #3387CC; + color: #ffffff; +} + +pre.language-html[data-type="get"]:before { + background-color: green; +} + +pre.language-html[data-type="put"]:before { + background-color: #e5c500; +} + +pre.language-html[data-type="post"]:before { + background-color: #4070ec; +} + +pre.language-html[data-type="delete"]:before { + background-color: #ed0039; +} + +pre.language-api .str { + color: #ffffff; +} + +pre.language-api .pln, +pre.language-api .pun { + color: #65B042; +} + +pre code { + display: block; + font-size: 14px; + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 400; + word-wrap: normal; + white-space: pre; +} + +/* +pre.language-json { + background: #f5f5f5; + border: #e0e0e0 1px solid; +} + +pre.language-json .pln, +pre.language-json .pun { + color: #3a3a3a; +} +*/ + +/* ------------------------------------------------------------------------------------------ + * Sidenav + * ------------------------------------------------------------------------------------------ */ +.sidenav { + width: 228px; + margin: 0; + padding: 20px; + position: fixed; + top: 0; + left: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + background-color: #f5f5f5; + z-index: 10; +} + +.sidenav > li > a { + display: block; + width: 192px; + margin: 0; + padding: 2px 11px; + border: 0; + border-left: transparent 4px solid; + border-right: transparent 4px solid; + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 14px; +} + +.sidenav > li.nav-header > a { + padding: 5px 15px; + border: 1px solid #e5e5e5; + width: 190px; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 16px; + background-color: #ffffff; +} + +.sidenav > li.nav-header.active > a { + background-color: #0088cc; +} + +.sidenav > .active > a { + position: relative; + z-index: 2; +} + +.sidenav > li > a:hover { + background-color: #ffffff; +} + +.sidenav > li.has-modifications a { + border-right: #60d060 4px solid; +} + +.sidenav > li.is-new a { + border-left: #e5e5e5 4px solid; +} + +/* ------------------------------------------------------------------------------------------ + * Compare + * ------------------------------------------------------------------------------------------ */ + +ins { + background: #60d060; + text-decoration: none; + color: #000000; +} + +del { + background: #f05050; + color: #000000; +} + +.label-ins { + background-color: #60d060; +} + +.label-del { + background-color: #f05050; + text-decoration: line-through; +} + +pre.ins { + background-color: #60d060; +} + +pre.del { + background-color: #f05050; + text-decoration: line-through; +} + +table.ins th, +table.ins td { + background-color: #60d060; +} + +table.del th, +table.del td { + background-color: #f05050; + text-decoration: line-through; +} + +tr.ins td { + background-color: #60d060; +} + +tr.del td { + background-color: #f05050; + text-decoration: line-through; +} + +/* ------------------------------------------------------------------------------------------ + * Spinner + * ------------------------------------------------------------------------------------------ */ + +#loader { + position: absolute; + width: 100%; +} + +#loader p { + padding-top: 80px; + margin-left: -4px; +} + +.spinner { + margin: 200px auto; + width: 60px; + height: 60px; + position: relative; +} + +.container1 > div, .container2 > div, .container3 > div { + width: 14px; + height: 14px; + background-color: #0088cc; + + border-radius: 100%; + position: absolute; + -webkit-animation: bouncedelay 1.2s infinite ease-in-out; + animation: bouncedelay 1.2s infinite ease-in-out; + /* Prevent first frame from flickering when animation starts */ + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.spinner .spinner-container { + position: absolute; + width: 100%; + height: 100%; +} + +.container2 { + -webkit-transform: rotateZ(45deg); + transform: rotateZ(45deg); +} + +.container3 { + -webkit-transform: rotateZ(90deg); + transform: rotateZ(90deg); +} + +.circle1 { top: 0; left: 0; } +.circle2 { top: 0; right: 0; } +.circle3 { right: 0; bottom: 0; } +.circle4 { left: 0; bottom: 0; } + +.container2 .circle1 { + -webkit-animation-delay: -1.1s; + animation-delay: -1.1s; +} + +.container3 .circle1 { + -webkit-animation-delay: -1.0s; + animation-delay: -1.0s; +} + +.container1 .circle2 { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} + +.container2 .circle2 { + -webkit-animation-delay: -0.8s; + animation-delay: -0.8s; +} + +.container3 .circle2 { + -webkit-animation-delay: -0.7s; + animation-delay: -0.7s; +} + +.container1 .circle3 { + -webkit-animation-delay: -0.6s; + animation-delay: -0.6s; +} + +.container2 .circle3 { + -webkit-animation-delay: -0.5s; + animation-delay: -0.5s; +} + +.container3 .circle3 { + -webkit-animation-delay: -0.4s; + animation-delay: -0.4s; +} + +.container1 .circle4 { + -webkit-animation-delay: -0.3s; + animation-delay: -0.3s; +} + +.container2 .circle4 { + -webkit-animation-delay: -0.2s; + animation-delay: -0.2s; +} + +.container3 .circle4 { + -webkit-animation-delay: -0.1s; + animation-delay: -0.1s; +} + +@-webkit-keyframes bouncedelay { + 0%, 80%, 100% { -webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} + +@keyframes bouncedelay { + 0%, 80%, 100% { + transform: scale(0.0); + -webkit-transform: scale(0.0); + } 40% { + transform: scale(1.0); + -webkit-transform: scale(1.0); + } +} + +/* ------------------------------------------------------------------------------------------ + * Tabs + * ------------------------------------------------------------------------------------------ */ +ul.nav-tabs { + margin: 0; +} + +/* ------------------------------------------------------------------------------------------ + * Print + * ------------------------------------------------------------------------------------------ */ + +@media print { + + #sidenav, + #version, + #versions, + section .version, + section .versions { + display: none; + } + + #content { + margin-left: 0; + } + + a { + text-decoration: none; + color: inherit; + } + + a:after { + content: " [" attr(href) "] "; + } + + p { + color: #000000 + } + + pre { + background-color: #ffffff; + color: #000000; + padding: 10px; + border: #808080 1px solid; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; + } + +} /* /@media print */ diff --git a/apidoc/img/favicon.ico b/apidoc/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c307a043933f0e860284157007820fccbe0fc96f GIT binary patch literal 894 zcmdUuF-rqM6ojAn2d)y!l(7l<0Sa4)bsGCC1jQ;~7c8z2NtY8s$`~6pMGzDegoNu- zL@-!L!~}wc5V437IkY*y&4xu5e}L}I?#-JU-p($Z$Q+O73G1S4&5JCENScWxDW=x- zP<(U8O;P?D)-rOqJxf*D5X#fMtSq@XeWi86$CGh&FK141Qt~NVWtAj}bFN-DLPvaT z*RIZLGz1Vz2nbHj-L#d^{{!N!&pBAbk2j(^U(2=VbJTML#&?*0s93%{?MEL%tQGVj{yYS9qIdd y=|=!E>V$}|g9zOiSnsP@V9MK)_i(HXtO!B3{(nl`|3Ly2=CXc=hEFxke;MD%5Rt_I literal 0 HcmV?d00001 diff --git a/apidoc/img/glyphicons-halflings-white.png b/apidoc/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae GIT binary patch literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3IKpHF)?v=b_NIm0Q>vwY7D0baZ)n z31Fa5sELUQARIVaU0nqf0XzT+fB_63aA;@<$l~wse|mcA;^G1TmX?-)e)jkGPfkuA z92@|!<>h5S_4f8QP-JRq>d&7)^Yin8l7K8gED$&_FaV?gY+wLjpoW%~7NDe=nHfMG z5DO3j{R9kv5GbssrUpO)OyvVrlx>u0UKD0i;Dpm5S5dY16(DL5l{ixz|mhJU@&-OWCTb7_%}8-fE(P~+XIRO zJU|wp1|S>|J3KrLcz^+v1f&BDpd>&MAaibR4#5A_4(MucZwG9E1h4@u0P@C8;oo+g zIVj7kfJi{oV~E(NZ*h(@^-(Q(C`Psb3KZ{N;^GB(a8NE*Vwc715!9 zr-H4Ao|T_c6+VT_JH9H+P3>iXSt!a$F`>s`jn`w9GZ_~B!{0soaiV|O_c^R2aWa%}O3jUE)WO=pa zs~_Wz08z|ieY5A%$@FcBF9^!1a}m5ks@7gjn;67N>}S~Hrm`4sM5Hh`q7&5-N{|31 z6x1{ol7BnskoViZ0GqbLa#kW`Z)VCjt1MysKg|rT zi!?s##Ck>8c zpi|>$lGlw#@yMNi&V4`6OBGJ(H&7lqLlcTQ&1zWriG_fL>BnFcr~?;E93{M-xIozQ zO=EHQ#+?<}%@wbWWv23#!V70h9MOuUVaU>3kpTvYfc|LBw?&b*89~Gc9i&8tlT#kF ztpbZoAzkdB+UTy=tx%L3Z4)I{zY(Kb)eg{InobSJmNwPZt$14aS-uc4eKuY8h$dtfyxu^a%zA)>fYI&)@ZXky?^{5>xSC?;w4r&td6vBdi%vHm4=XJH!3yL3?Ep+T5aU_>i;yr_XGq zxZfCzUU@GvnoIk+_Nd`aky>S&H!b*{A%L>?*XPAgWL(Vf(k7qUS}>Zn=U(ZfcOc{B z3*tOHH@t5Ub5D~#N7!Fxx}P2)sy{vE_l(R7$aW&CX>c|&HY+7};vUIietK%}!phrCuh+;C@1usp;XLU<8Gq8P!rEI3ieg#W$!= zQcZr{hp>8sF?k&Yl0?B84OneiQxef-4TEFrq3O~JAZR}yEJHA|Xkqd49tR&8oq{zP zY@>J^HBV*(gJvJZc_0VFN7Sx?H7#75E3#?N8Z!C+_f53YU}pyggxx1?wQi5Yb-_`I`_V*SMx5+*P^b=ec5RON-k1cIlsBLk}(HiaJyab0`CI zo0{=1_LO$~oE2%Tl_}KURuX<`+mQN_sTdM&* zkFf!Xtl^e^gTy6ON=&gTn6)$JHQq2)33R@_!#9?BLNq-Wi{U|rVX7Vny$l6#+SZ@KvQt@VYb%<9JfapI^b9j=wa+Tqb4ei;8c5 z&1>Uz@lVFv6T4Z*YU$r4G`g=91lSeA<=GRZ!*KTWKDPR}NPUW%peCUj`Ix_LDq!8| zMH-V`Pv!a~QkTL||L@cqiTz)*G-0=ytr1KqTuFPan9y4gYD5>PleK`NZB$ev@W%t= zkp)_=lBUTLZJpAtZg;pjI;7r2y|26-N7&a(hX|`1YNM9N8{>8JAuv}hp1v`3JHT-=5lbXpbMq7X~2J5Kl zh7tyU`_AusMFZ{ej9D;Uyy;SQ!4nwgSnngsYBwdS&EO3NS*o04)*juAYl;57c2Ly0(DEZ8IY?zSph-kyxu+D`tt@oU{32J#I{vmy=#0ySPK zA+i(A3yl)qmTz*$dZi#y9FS;$;h%bY+;StNx{_R56Otq+?pGe^T^{5d7Gs&?`_r`8 zD&dzOA|j8@3A&FR5U3*eQNBf<4^4W_iS_()*8b4aaUzfk2 zzIcMWSEjm;EPZPk{j{1>oXd}pXAj!NaRm8{Sjz!D=~q3WJ@vmt6ND_?HI~|wUS1j5 z9!S1MKr7%nxoJ3k`GB^7yV~*{n~O~n6($~x5Bu{7s|JyXbAyKI4+tO(zZYMslK;Zc zzeHGVl{`iP@jfSKq>R;{+djJ9n%$%EL()Uw+sykjNQdflkJZSjqV_QDWivbZS~S{K zkE@T^Jcv)Dfm93!mf$XYnCT--_A$zo9MOkPB6&diM8MwOfV?+ApNv`moV@nqn>&lv zYbN1-M|jc~sG|yLN^1R2=`+1ih3jCshg`iP&mY$GMTcY^W^T`WOCX!{-KHmZ#GiRH zYl{|+KLn5!PCLtBy~9i}`#d^gCDDx$+GQb~uc;V#K3OgbbOG0j5{BRG-si%Bo{@lB zGIt+Ain8^C`!*S0d0OSWVO+Z89}}O8aFTZ>p&k}2gGCV zh#<$gswePFxWGT$4DC^8@84_e*^KT74?7n8!$8cg=sL$OlKr&HMh@Rr5%*Wr!xoOl zo7jItnj-xYgVTX)H1=A2bD(tleEH57#V{xAeW_ezISg5OC zg=k>hOLA^urTH_e6*vSYRqCm$J{xo}-x3@HH;bsHD1Z`Pzvsn}%cvfw%Q(}h`Dgtb z0_J^niUmoCM5$*f)6}}qi(u;cPgxfyeVaaVmOsG<)5`6tzU4wyhF;k|~|x>7-2hXpVBpc5k{L4M`Wbe6Q?tr^*B z`Y*>6*&R#~%JlBIitlZ^qGe3s21~h3U|&k%%jeMM;6!~UH|+0+<5V-_zDqZQN79?n?!Aj!Nj`YMO9?j>uqI9-Tex+nJD z%e0#Yca6(zqGUR|KITa?9x-#C0!JKJHO(+fy@1!B$%ZwJwncQW7vGYv?~!^`#L~Um zOL++>4qmqW`0Chc0T23G8|vO)tK=Z2`gvS4*qpqhIJCEv9i&&$09VO8YOz|oZ+ubd zNXVdLc&p=KsSgtmIPLN69P7xYkYQ1vJ?u1g)T!6Ru`k2wkdj*wDC)VryGu2=yb0?F z>q~~e>KZ0d_#7f3UgV%9MY1}vMgF{B8yfE{HL*pMyhYF)WDZ^^3vS8F zGlOhs%g_~pS3=WQ#494@jAXwOtr^Y|TnQ5zki>qRG)(oPY*f}U_=ip_{qB0!%w7~G zWE!P4p3khyW-JJnE>eECuYfI?^d366Shq!Wm#x&jAo>=HdCllE$>DPO0N;y#4G)D2y#B@5=N=+F%Xo2n{gKcPcK2!hP*^WSXl+ut; zyLvVoY>VL{H%Kd9^i~lsb8j4>$EllrparEOJNT?Ym>vJa$(P^tOG)5aVb_5w^*&M0 zYOJ`I`}9}UoSnYg#E(&yyK(tqr^@n}qU2H2DhkK-`2He% zgXr_4kpXoQHxAO9S`wEdmqGU4j=1JdG!OixdqB4PPP6RXA}>GM zumruUUH|ZG2$bBj)Qluj&uB=dRb)?^qomw?Z$X%#D+Q*O97eHrgVB2*mR$bFBU`*} zIem?dM)i}raTFDn@5^caxE^XFXVhBePmH9fqcTi`TLaXiueH=@06sl}>F%}h9H_e9 z>^O?LxM1EjX}NVppaO@NNQr=AtHcH-BU{yBT_vejJ#J)l^cl69Z7$sk`82Zyw7Wxt z=~J?hZm{f@W}|96FUJfy65Gk8?^{^yjhOahUMCNNpt5DJw}ZKH7b!bGiFY9y6OY&T z_N)?Jj(MuLTN36ZCJ6I5Xy7uVlrb$o*Z%=-)kPo9s?<^Yqz~!Z* z_mP8(unFq65XSi!$@YtieSQ!<7IEOaA9VkKI?lA`*(nURvfKL8cX}-+~uw9|_5)uC2`ZHcaeX7L8aG6Ghleg@F9aG%X$#g6^yP5apnB>YTz&EfS{q z9UVfSyEIczebC)qlVu5cOoMzS_jrC|)rQlAzK7sfiW0`M8mVIohazPE9Jzn*qPt%6 zZL8RELY@L09B83@Be;x5V-IHnn$}{RAT#<2JA%ttlk#^(%u}CGze|1JY5MPhbfnYG zIw%$XfBmA-<_pKLpGKwbRF$#P;@_)ech#>vj25sv25VM$ouo)?BXdRcO{)*OwTw)G zv43W~T6ekBMtUD%5Bm>`^Ltv!w4~65N!Ut5twl!Agrzyq4O2Fi3pUMtCU~>9gt_=h-f% z;1&OuSu?A_sJvIvQ+dZNo3?m1%b1+s&UAx?8sUHEe_sB7zkm4R%6)<@oYB_i5>3Ip zIA+?jVdX|zL{)?TGpx+=Ta>G80}0}Ax+722$XFNJsC1gcH56{8B)*)eU#r~HrC&}` z|EWW92&;6y;3}!L5zXa385@?-D%>dSvyK;?jqU2t_R3wvBW;$!j45uQ7tyEIQva;Db}r&bR3kqNSh)Q_$MJ#Uj3Gj1F;)sO|%6z#@<+ zi{pbYsYS#u`X$Nf($OS+lhw>xgjos1OnF^$-I$u;qhJswhH~p|ab*nO>zBrtb0ndn zxV0uh!LN`&xckTP+JW}gznSpU492)u+`f{9Yr)js`NmfYH#Wdtradc0TnKNz@Su!e zu$9}G_=ku;%4xk}eXl>)KgpuT>_<`Ud(A^a++K&pm3LbN;gI}ku@YVrA%FJBZ5$;m zobR8}OLtW4-i+qPPLS-(7<>M{)rhiPoi@?&vDeVq5%fmZk=mDdRV>Pb-l7pP1y6|J z8I>sF+TypKV=_^NwBU^>4JJq<*14GLfM2*XQzYdlqqjnE)gZsPW^E@mp&ww* zW9i>XL=uwLVZ9pO*8K>t>vdL~Ek_NUL$?LQi5sc#1Q-f6-ywKcIT8Kw?C(_3pbR`e|)%9S-({if|E+hR2W!&qfQ&UiF^I!|M#xhdWsenv^wpKCBiuxXbnp85`{i|;BM?Ba`lqTA zyRm=UWJl&E{8JzYDHFu>*Z10-?#A8D|5jW9Ho0*CAs0fAy~MqbwYuOq9jjt9*nuHI zbDwKvh)5Ir$r!fS5|;?Dt>V+@F*v8=TJJF)TdnC#Mk>+tGDGCw;A~^PC`gUt*<(|i zB{{g{`uFehu`$fm4)&k7`u{xIV)yvA(%5SxX9MS80p2EKnLtCZ>tlX>*Z6nd&6-Mv$5rHD*db;&IBK3KH&M<+ArlGXDRdX1VVO4)&R$f4NxXI>GBh zSv|h>5GDAI(4E`@F?EnW zS>#c&Gw6~_XL`qQG4bK`W*>hek4LX*efn6|_MY+rXkNyAuu?NxS%L7~9tD3cn7&p( zCtfqe6sjB&Q-Vs7BP5+%;#Gk};4xtwU!KY0XXbmkUy$kR9)!~?*v)qw00!+Yg^#H> zc#8*z6zZo>+(bud?K<*!QO4ehiTCK&PD4G&n)Tr9X_3r-we z?fI+}-G~Yn93gI6F{}Dw_SC*FLZ)5(85zp4%uubtD)J)UELLkvGk4#tw&Tussa)mTD$R2&O~{ zCI3>fr-!-b@EGRI%g0L8UU%%u_<;e9439JNV;4KSxd|78v+I+8^rmMf3f40Jb}wEszROD?xBZu>Ll3;sUIoNxDK3|j3*sam2tC@@e$ z^!;+AK>efeBJB%ALsQ{uFui)oDoq()2USi?n=6C3#eetz?wPswc={I<8x=(8lE4EIsUfyGNZ{|KYn1IR|=E==f z(;!A5(-2y^2xRFCSPqzHAZn5RCN_bp22T(KEtjA(rFZ%>a4@STrHZflxKoqe9Z4@^ zM*scx_y73?Q{vt6?~WEl?2q*;@8 z3M*&@%l)SQmXkcUm)d@GT2#JdzhfSAP9|n#C;$E8X|pwD!r#X?0P>0ZisQ~TNqupW z*lUY~+ikD`vQb?@SAWX#r*Y+;=_|oacL$2CL$^(mV}aKO77pg}O+-=T1oLBT5sL2i z42Qth2+0@C`c+*D0*5!qy26sis<9a7>LN2{z%Qj49t z=L@x`4$ALHb*3COHoT?5S_c(Hs}g!V>W^=6Q0}zaubkDn)(lTax0+!+%B}9Vqw6{H zvL|BRM`O<@;eVi1DzM!tXtBrA20Ce@^Jz|>%X-t`vi-%WweXCh_LhI#bUg2*pcP~R z*RuTUzBKLXO~~uMd&o$v3@d0shHfUjC6c539PE6rF&;Ufa(Rw@K1*m7?f5)t`MjH0 z)_V(cajV5Am>f!kWcI@5rE8t6$S>5M=k=aRZROH6fA^jJp~2NlR4;Q2>L$7F#RT#9 z>4@1RhWG`Khy>P2j1Yx^BBL{S`niMaxlSWV-JBU0-T9zZ%>7mR3l$~QV$({o0;jTI ze5=cN^!Bc2bT|BcojXp~K#2cM>OTe*cM{Kg-j*CkiW)EGQot^}s;cy8_1_@JA0Whq zlrNr+R;Efa+`6N)s5rH*|E)nYZ3uqkk2C(E7@A|3YI`ozP~9Lexx#*1(r8luq+YPk z{J}c$s` zPM35Fx(YWB3Z5IYnN+L_4|jaR(5iWJi2~l&xy}aU7kW?o-V*6Av2wyZTG!E2KSW2* zGRLQkQU;Oz##ie-Z4fI)WSRxn$(ZcD;TL+;^r=a4(G~H3ZhK$lSXZj?cvyY8%d9JM zzc3#pD^W_QnWy#rx#;c&N@sqHhrnHRmj#i;s%zLm6SE(n&BWpd&f7>XnjV}OlZntI70fq%8~9<7 zMYaw`E-rp49-oC1N_uZTo)Cu%RR2QWdHpzQIcNsoDp`3xfP+`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd literal 0 HcmV?d00001 diff --git a/apidoc/img/glyphicons-halflings.png b/apidoc/img/glyphicons-halflings.png new file mode 100644 index 0000000000000000000000000000000000000000..a9969993201f9cee63cf9f49217646347297b643 GIT binary patch literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvlc$ zx660V9e3Ox@4WZ^?7jZ%QFGU-T~%||Ug4iK6bbQY@zBuF2$hxOw9wF=A)nUSxR_5@ zEX>HBryGrjyuOFFv$Y4<+|3H@gQfEqD<)+}a~mryD|1U9*I_FOG&F%+Ww{SJ-V2BR zjt<81Ek$}Yb*95D4RS0HCps|uLyovt;P05hchQb-u2bzLtmog&f2}1VlNhxXV);S9 zM2buBg~!q9PtF)&KGRgf3#z7B(hm5WlNClaCWFs!-P!4-u*u5+=+D|ZE9e`KvhTHT zJBnLwGM%!u&vlE%1ytJ=!xt~y_YkFLQb6bS!E+s8l7PiPGSt9xrmg?LV&&SL?J~cI zS(e9TF1?SGyh+M_p@o1dyWu7o7_6p;N6hO!;4~ z2B`I;y`;$ZdtBpvK5%oQ^p4eR2L)BH>B$FQeC*t)c`L71gXHPUa|vyu`Bnz)H$ZcXGve(}XvR!+*8a>BLV;+ryG1kt0=)ytl zNJxFUN{V7P?#|Cp85QTa@(*Q3%K-R(Pkv1N8YU*(d(Y}9?PQ(j;NzWoEVWRD-~H$=f>j9~PN^BM2okI(gY-&_&BCV6RP&I$FnSEM3d=0fCxbxA6~l>54-upTrw zYgX@%m>jsSGi`0cQt6b8cX~+02IghVlNblR7eI;0ps}mpWUcxty1yG56C5rh%ep(X z?)#2d?C<4t-KLc*EAn>>M8%HvC1TyBSoPNg(4id~H8JwO#I)Bf;N*y6ai6K9_bA`4 z_g9(-R;qyH&6I$`b42v|0V3Z8IXN*p*8g$gE98+JpXNY+jXxU0zsR^W$#V=KP z3AEFp@OL}WqwOfsV<)A^UTF4&HF1vQecz?LWE@p^Z2){=KEC_3Iopx_eS42>DeiDG zWMXGbYfG~W7C8s@@m<_?#Gqk;!&)_Key@^0xJxrJahv{B&{^!>TV7TEDZlP|$=ZCz zmX=ZWtt4QZKx**)lQQoW8y-XLiOQy#T`2t}p6l*S`68ojyH@UXJ-b~@tN`WpjF z%7%Yzv807gsO!v=!(2uR)16!&U5~VPrPHtGzUU?2w(b1Xchq}(5Ed^G|SD7IG+kvgyVksU) z(0R)SW1V(>&q2nM%Z!C9=;pTg!(8pPSc%H01urXmQI6Gi^dkYCYfu6b4^tW))b^U+ z$2K&iOgN_OU7n#GC2jgiXU{caO5hZt0(>k+c^(r><#m|#J^s?zA6pi;^#*rp&;aqL zRcZi0Q4HhVX3$ybclxo4FFJW*`IV`)Bj_L3rQe?5{wLJh168Ve1jZv+f1D}f0S$N= zm4i|9cEWz&C9~ZI3q*gwWH^<6sBWuphgy@S3Qy?MJiL>gwd|E<2h9-$3;gT9V~S6r z)cAcmE0KXOwDA5eJ02-75d~f?3;n7a9d_xPBJaO;Z)#@s7gk5$Qn(Fc^w@9c5W0zY z59is0?Mt^@Rolcn{4%)Ioat(kxQH6}hIykSA)zht=9F_W*D#<}N(k&&;k;&gKkWIL z0Of*sP=X(Uyu$Pw;?F@?j{}=>{aSHFcii#78FC^6JGrg-)!)MV4AKz>pXnhVgTgx8 z1&5Y=>|8RGA6++FrSy=__k_imx|z-EI@foKi>tK0Hq2LetjUotCgk2QFXaej!BWYL zJc{fv(&qA7UUJ|AXLc5z*_NW#yWzKtl(c8mEW{A>5Hj^gfZ^HC9lQNQ?RowXjmuCj4!!54Us1=hY z0{@-phvC}yls!PmA~_z>Y&n&IW9FQcj}9(OLO-t^NN$c0o}YksCUWt|DV(MJB%%Sr zdf}8!9ylU2TW!=T{?)g-ojAMKc>3pW;KiZ7f0;&g)k}K^#HBhE5ot)%oxq$*$W@b# zg4p<Ou`ME|Kd1WHK@8 zzLD+0(NHWa`B{em3Ye?@aVsEi>y#0XVZfaFuq#;X5C3{*ikRx7UY4FF{ZtNHNO?A_ z#Q?hwRv~D8fPEc%B5E-ZMI&TAmikl||EERumQCRh7p;)>fdZMxvKq;ky0}7IjhJph zW*uuu*(Y6)S;Od--8uR^R#sb$cmFCnPcj9PPCWhPN;n`i1Q#Qn>ii z{WR|0>8F`vf&#E(c2NsoH=I7Cd-FV|%(7a`i}gZw4N~QFFG2WtS^H%@c?%9UZ+kez z;PwGgg_r6V>Kn5n(nZ40P4qMyrCP3bDkJp@hp6&X3>gzC>=f@Hsen<%I~7W+x@}b> z0}Et*vx_50-q@PIV=(3&Tbm}}QRo*FP2@)A#XX-8jYspIhah`9ukPBr)$8>Tmtg&R z?JBoH17?+1@Y@r>anoKPQ}F8o9?vhcG79Cjv^V6ct709VOQwg{c0Q#rBSsSmK3Q;O zBpNihl3S0_IGVE)^`#94#j~$;7+u870yWiV$@={|GrBmuz4b)*bCOPkaN0{6$MvazOEBxFdKZDlbVvv{8_*kJ zfE6C`4&Kkz<5u%dEdStd85-5UHG5IOWbo8i9azgg#zw-(P1AA049hddAB*UdG3Vn0 zX`OgM+EM|<+KhJ<=k?z~WA5waVj?T9eBdfJGebVifBKS1u<$#vl^BvSg)xsnT5Aw_ZY#}v*LXO#htB>f}x3qDdDHoFeb zAq7;0CW;XJ`d&G*9V)@H&739DpfWYzdQt+Kx_E1K#Cg1EMtFa8eQRk_JuUdHD*2;W zR~XFnl!L2A?48O;_iqCVr1oxEXvOIiN_9CUVTZs3C~P+11}ebyTRLACiJuMIG#`xP zKlC|E(S@QvN+%pBc6vPiQS8KgQAUh75C0a2xcPQDD$}*bM&z~g8+=9ltmkT$;c;s z5_=8%i0H^fEAOQbHXf0;?DN5z-5+1 zDxj50yYkz4ox9p$HbZ|H?8ukAbLE^P$@h}L%i6QVcY>)i!w=hkv2zvrduut%!8>6b zcus3bh1w~L804EZ*s96?GB&F7c5?m?|t$-tp2rKMy>F*=4;w*jW}^;8v`st&8)c; z2Ct2{)?S(Z;@_mjAEjb8x=qAQvx=}S6l9?~H?PmP`-xu;ME*B8sm|!h@BX4>u(xg_ zIHmQzp4Tgf*J}Y=8STR5_s)GKcmgV!$JKTg@LO402{{Wrg>#D4-L%vjmtJ4r?p&$F!o-BOf7ej~ z6)BuK^^g1b#(E>$s`t3i13{6-mmSp7{;QkeG5v}GAN&lM2lQT$@(aQCcFP(%UyZbF z#$HLTqGT^@F#A29b0HqiJsRJAlh8kngU`BDI6 zJUE~&!cQ*&f95Ot$#mxU5+*^$qg_DWNdfu+1irglB7yDglzH()2!@#rpu)^3S8weW z_FE$=j^GTY*|5SH95O8o8W9FluYwB=2PwtbW|JG6kcV^dMVmX(wG+Otj;E$%gfu^K z!t~<3??8=()WQSycsBKy24>NjRtuZ>zxJIED;YXaUz$@0z4rl+TW zWxmvM$%4jYIpO>j5k1t1&}1VKM~s!eLsCVQ`TTjn3JRXZD~>GM z$-IT~(Y)flNqDkC%DfbxaV9?QuWCV&-U1yzrV@0jRhE;)ZO0=r-{s@W?HOFbRHDDV zq;eLo+wOW;nI|#mNf(J?RImB9{YSO2Y`9825Lz#u4(nk3)RGv3X8B(A$TsontJ8L! z9JP^eWxtKC?G8^xAZa1HECx*rp35s!^%;&@Jyk)NexVc)@U4$^X1Dag6`WKs|(HhZ#rzO2KEw3xh~-0<;|zcs0L>OcO#YYX{SN8m6`9pp+ zQG@q$I)T?aoe#AoR@%om_#z=c@ych!bj~lV13Qi-xg$i$hXEAB#l=t7QWENGbma4L zbBf*X*4oNYZUd_;1{Ln_ZeAwQv4z?n9$eoxJeI?lU9^!AB2Y~AwOSq67dT9ADZ)s@ zCRYS7W$Zpkdx$3T>7$I%3EI2ik~m!f7&$Djpt6kZqDWZJ-G{*_eXs*B8$1R4+I}Kf zqniwCI64r;>h2Lu{0c(#Atn)%E8&)=0S4BMhq9$`vu|Ct;^ur~gL`bD>J@l)P$q_A zO7b3HGOUG`vgH{}&&AgrFy%K^>? z>wf**coZ2vdSDcNYSm~dZ(vk6&m6bVKmVgrx-X<>{QzA!)2*L+HLTQz$e8UcB&Djq zl)-%s$ZtUN-R!4ZiG=L0#_P=BbUyH+YPmFl_ogkkQ$=s@T1v}rNnZ^eMaqJ|quc+6 z*ygceDOrldsL30w`H;rNu+IjlS+G~p&0SawXCA1+D zC%cZtjUkLNq%FadtHE?O(yQTP486A{1x<{krq#rpauNQaeyhM3*i0%tBpQHQo-u)x z{0{&KS`>}vf2_}b160XZO2$b)cyrHq7ZSeiSbRvaxnKUH{Q`-P(nL&^fcF2){vhN- zbX&WEjP7?b4A%0y6n_=m%l00uZ+}mCYO(!x?j$+O$*TqoD_Q5EoyDJ?w?^UIa491H zE}87(bR`X;@u#3Qy~9wWdWQIg1`cXrk$x9=ccR|RY1~%{fAJ@uq@J3e872x0v$hmv ze_KcL(wM|n0EOp;t{hKoohYyDmYO;!`7^Lx;0k=PWPGZpI>V5qYlzjSL_(%|mud50 z7#{p97s`U|Sn$WYF>-i{i4`kzlrV6a<}=72q2sAT7Zh{>P%*6B;Zl;~0xWymt10Mo zl5{bmR(wJefJpNGK=fSRP|mpCI-)Nf6?Pv==FcFmpSwF1%CTOucV{yqxSyx4Zws3O z8hr5Uyd%ezIO7?PnEO0T%af#KOiXD$e?V&OX-B|ZX-YsgSs%sv-6U+sLPuz{D4bq| zpd&|o5tNCmpT>(uIbRf?8c}d3IpOb3sn6>_dr*26R#ev<_~vi)wleW$PX|5)$_ z+_|=pi(0D(AB_sjQ;sQQSM&AWqzDO1@NHw;C9cPdXRKRI#@nUW)CgFxzQ1nyd!+h& zcjU!U=&u|>@}R(9D$%lu2TlV>@I2-n@fCr5PrZNVyKWR7hm zWjoy^p7v8m#$qN0K#8jT- zq`mSirDZDa1Jxm;Rg3rAPhC)LcI4@-RvKT+@9&KsR3b0_0zuM!Fg7u>oF>3bzOxZPU&$ab$Z9@ zY)f7pKh22I7ZykL{YsdjcqeN++=0a}elQM-4;Q)(`Ep3|VFHqnXOh14`!Bus& z9w%*EWK6AiAM{s$6~SEQS;A>ey$#`7)khZvamem{P?>k)5&7Sl&&NXKk}o!%vd;-! zpo2p-_h^b$DNBO>{h4JdGB=D>fvGIYN8v&XsfxU~VaefL?q} z3ekM?iOKkCzQHkBkhg=hD!@&(L}FcHKoa zbZ7)H1C|lHjwEb@tu=n^OvdHOo7o+W`0-y3KdP#bb~wM=Vr_gyoEq|#B?$&d$tals ziIs-&7isBpvS|CjC|7C&3I0SE?~`a%g~$PI%;au^cUp@ER3?mn-|vyu!$7MV6(uvt z+CcGuM(Ku2&G0tcRCo7#D$Dirfqef2qPOE5I)oCGzmR5G!o#Q~(k~)c=LpIfrhHQk zeAva6MilEifE7rgP1M7AyWmLOXK}i8?=z2;N=no)`IGm#y%aGE>-FN zyXCp0Sln{IsfOBuCdE*#@CQof%jzuU*jkR*Su3?5t}F(#g0BD0Zzu|1MDes8U7f9; z$JBg|mqTXt`muZ8=Z`3wx$uizZG_7>GI7tcfOHW`C2bKxNOR)XAwRkLOaHS4xwlH4 zDpU29#6wLXI;H?0Se`SRa&I_QmI{zo7p%uveBZ0KZKd9H6@U?YGArbfm)D*^5=&Rp z`k{35?Z5GbZnv>z@NmJ%+sx=1WanWg)8r}C_>EGR8mk(NR$pW<-l8OTU^_u3M@gwS z7}GGa1)`z5G|DZirw;FB@VhH7Dq*0qc=|9lLe{w2#`g+_nt>_%o<~9(VZe=zI*SSz4w43-_o>4E4`M@NPKTWZuQJs)?KXbWp1M zimd5F;?AP(LWcaI-^Sl{`~>tmxsQB9Y$Xi*{Zr#py_+I$vx7@NY`S?HFfS!hUiz$a z{>!&e1(16T!Om)m)&k1W#*d#GslD^4!TwiF2WjFBvi=Ms!ADT)ArEW6zfVuIXcXVk z>AHjPADW+mJzY`_Ieq(s?jbk4iD2Rb8*V3t6?I+E06(K8H!!xnDzO%GB;Z$N-{M|B zeT`jo%9)s%op*XZKDd6*)-^lWO{#RaIGFdBH+;XXjI(8RxpBc~azG1H^2v7c^bkFE zZCVPE+E*Q=FSe8Vm&6|^3ki{9~qafiMAf7i4APZg>b%&5>nT@pHH z%O*pOv(77?ZiT{W zBibx}Q12tRc7Py1NcZTp`Q4ey%T_nj@1WKg5Fz_Rjl4wlJQj)rtp8yL3r!Shy zvZvnmh!tH4T6Js-?vI0<-rzzl{mgT*S0d_7^AU_8gBg^03o-J=p(1o6kww2hx|!%T z-jqp}m^G*W?$!R#M%Ef?&2jYxmx+lXWZszpI4d$pUN`(S)|*c^CgdwY>Fa>> zgGBJhwe8y#Xd*q0=@SLEgPF>+Qe4?%E*v{a`||luZ~&dqMBrRfJ{SDMaJ!s_;cSJp zSqZHXIdc@@XteNySUZs^9SG7xK`8=NBNM)fRVOjw)D^)w%L2OPkTQ$Tel-J)GD3=YXy+F4in(ILy*A3m@3o73uv?JC}Q>f zrY&8SWmesiba0|3X-jmlMT3 z*ST|_U@O=i*sM_*48G)dgXqlwoFp5G6qSM3&%_f_*n!PiT>?cNI)fAUkA{qWnqdMi+aNK_yVQ&lx4UZknAc9FIzVk% zo6JmFH~c{_tK!gt4+o2>)zoP{sR}!!vfRjI=13!z5}ijMFQ4a4?QIg-BE4T6!#%?d&L;`j5=a`4is>U;%@Rd~ zXC~H7eGQhhYWhMPWf9znDbYIgwud(6$W3e>$W4$~d%qoJ z+JE`1g$qJ%>b|z*xCKenmpV$0pM=Gl-Y*LT8K+P)2X#;XYEFF4mRbc~jj?DM@(1e`nL=F4Syv)TKIePQUz)bZ?Bi3@G@HO$Aps1DvDGkYF50O$_welu^cL7;vPiMGho74$;4fDqKbE{U zd1h{;LfM#Fb|Z&uH~Rm_J)R~Vy4b;1?tW_A)Iz#S_=F|~pISaVkCnQ0&u%Yz%o#|! zS-TSg87LUfFSs{tTuM3$!06ZzH&MFtG)X-l7>3)V?Txuj2HyG*5u;EY2_5vU0ujA? zHXh5G%6e3y7v?AjhyX79pnRBVr}RmPmtrxoB7lkxEzChX^(vKd+sLh?SBic=Q)5nA zdz7Mw3_iA>;T^_Kl~?1|5t%GZ;ki_+i>Q~Q1EVdKZ)$Sh3LM@ea&D~{2HOG++7*wF zAC6jW4>fa~!Vp5+$Z{<)Qxb|{unMgCv2)@%3j=7)Zc%U<^i|SAF88s!A^+Xs!OASYT%7;Jx?olg_6NFP1475N z#0s<@E~FI}#LNQ{?B1;t+N$2k*`K$Hxb%#8tRQi*Z#No0J}Pl;HWb){l7{A8(pu#@ zfE-OTvEreoz1+p`9sUI%Y{e5L-oTP_^NkgpYhZjp&ykinnW;(fu1;ttpSsgYM8ABX4dHe_HxU+%M(D=~) zYM}XUJ5guZ;=_ZcOsC`_{CiU$zN3$+x&5C`vX-V3`8&RjlBs^rf00MNYZW+jCd~7N z%{jJuUUwY(M`8$`B>K&_48!Li682ZaRknMgQ3~dnlp8C?__!P2z@=Auv;T^$yrsNy zCARmaA@^Yo2sS%2$`031-+h9KMZsIHfB>s@}>Y(z988e!`%4=EDoAQ0kbk>+lCoK60Mx9P!~I zlq~wf7kcm_NFImt3ZYlE(b3O1K^QWiFb$V^a2Jlwvm(!XYx<`i@ZMS3UwFt{;x+-v zhx{m=m;4dgvkKp5{*lfSN3o^keSpp9{hlXj%=}e_7Ou{Yiw(J@NXuh*;pL6@$HsfB zh?v+r^cp@jQ4EspC#RqpwPY(}_SS$wZ{S959`C25777&sgtNh%XTCo9VHJC-G z;;wi9{-iv+ETiY;K9qvlEc04f;ZnUP>cUL_T*ms``EtGoP^B#Q>n2dSrbAg8a>*Lg zd0EJ^=tdW~7fbcLFsqryFEcy*-8!?;n%;F+8i{eZyCDaiYxghr z$8k>L|2&-!lhvuVdk!r-kpSFl`5F5d4DJr%M4-qOy3gdmQbqF1=aBtRM7)c_Ae?$b8 zQg4c8*KQ{XJmL)1c7#0Yn0#PTMEs4-IHPjkn0!=;JdhMXqzMLeh`yOylXROP- zl#z3+fwM9l3%VN(6R77ua*uI9%hO7l7{+Hcbr(peh;afUK?B4EC09J{-u{mv)+u#? zdKVBCPt`eU@IzL)OXA`Ebu`Xp?u0m%h&X41}FNfnJ*g1!1wcbbpo%F4x!-#R9ft!8{5`Ho}04?FI#Kg zL|k`tF1t_`ywdy8(wnTut>HND(qNnq%Sq=AvvZbXnLx|mJhi!*&lwG2g|edBdVgLy zjvVTKHAx(+&P;P#2Xobo7_RttUi)Nllc}}hX>|N?-u5g7VJ-NNdwYcaOG?NK=5)}` zMtOL;o|i0mSKm(UI_7BL_^6HnVOTkuPI6y@ZLR(H?c1cr-_ouSLp{5!bx^DiKd*Yb z{K78Ci&Twup zTKm)ioN|wcYy%Qnwb)IzbH>W!;Ah5Zdm_jRY`+VRJ2 zhkspZ9hbK3iQD91A$d!0*-1i#%x81|s+SPRmD}d~<1p6!A13(!vABP2kNgqEG z?AMgl^P+iRoIY(9@_I?n1829lGvAsRnHwS~|5vD2+Zi53j<5N4wNn0{q>>jF9*bI) zL$kMXM-awNOElF>{?Jr^tOz1glbwaD-M0OKOlTeW3C!1ZyxRbB>8JDof(O&R1bh%3x#>y2~<>OXO#IIedH0Q`(&&?eo-c~ z>*Ah#3~09unym~UC-UFqqI>{dmUD$Y4@evG#ORLI*{ZM)Jl=e1it!XzY($S3V zLG!Y6fCjE>x6r@5FG1n|8ompSZaJ>9)q6jqU;XxCQk9zV(?C9+i*>w z21+KYt1gXX&0`x3E)hS7I5}snbBzox9C@Xzcr|{B8Hw;SY1$}&BoYKXH^hpjW-RgJ z-Fb}tannKCv>y~^`r|(1Q9;+sZlYf3XPSX|^gR01UFtu$B*R;$sPZdIZShRr>|b@J z;#G{EdoY+O;REEjQ}X7_YzWLO+Ey3>a_KDe1CjSe| z6arqcEZ)CX!8r(si`dqbF$uu&pnf^Np{1f*TdJ`r2;@SaZ z#hb4xlaCA@Pwqj#LlUEe5L{I$k(Zj$d3(~)u(F%&xb8={N9hKxlZIO1ABsM{Mt|)2 zJ^t9Id;?%4PfR4&Ph9B9cFK~@tG3wlFW-0fXZS_L4U*EiAA%+`h%q2^6BCC;t0iO4V=s4Qug{M|iDV@s zC7|ef-dxiR7T&Mpre!%hiUhHM%3Qxi$Lzw6&(Tvlx9QA_7LhYq<(o~=Y>3ka-zrQa zhGpfFK@)#)rtfz61w35^sN1=IFw&Oc!Nah+8@qhJ0UEGr;JplaxOGI82OVqZHsqfX ze1}r{jy;G?&}Da}a7>SCDsFDuzuseeCKof|Dz2BPsP8? zY;a)Tkr2P~0^2BeO?wnzF_Ul-ekY=-w26VnU%U3f19Z-pj&2 z4J_a|o4Dci+MO)mPQIM>kdPG1xydiR9@#8m zh27D7GF{p|a{8({Q-Pr-;#jV{2zHR>lGoFtIfIpoMo?exuQyX_A;;l0AP4!)JEM$EwMInZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# literal 0 HcmV?d00001 diff --git a/apidoc/index.html b/apidoc/index.html new file mode 100644 index 0000000000..d14be0776e --- /dev/null +++ b/apidoc/index.html @@ -0,0 +1,658 @@ + + + + Loading... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+

Loading...

+
+
+ + + + diff --git a/apidoc/locales/de.js b/apidoc/locales/de.js new file mode 100644 index 0000000000..f66420d009 --- /dev/null +++ b/apidoc/locales/de.js @@ -0,0 +1,25 @@ +define({ + de: { + 'Allowed values:' : 'Erlaubte Werte:', + 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', + 'compare changes to:' : 'vergleiche Änderungen mit:', + 'compared to' : 'verglichen mit', + 'Default value:' : 'Standardwert:', + 'Description' : 'Beschreibung', + 'Field' : 'Feld', + 'General' : 'Allgemein', + 'Generated with' : 'Erstellt mit', + 'Name' : 'Name', + 'No response values.' : 'Keine Rückgabewerte.', + 'optional' : 'optional', + 'Parameter' : 'Parameter', + 'Permission:' : 'Berechtigung:', + 'Response' : 'Antwort', + 'Send' : 'Senden', + 'Send a Sample Request' : 'Eine Beispielanfrage senden', + 'show up to version:' : 'zeige bis zur Version:', + 'Size range:' : 'Größenbereich:', + 'Type' : 'Typ', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/es.js b/apidoc/locales/es.js new file mode 100644 index 0000000000..3d47e800e8 --- /dev/null +++ b/apidoc/locales/es.js @@ -0,0 +1,25 @@ +define({ + es: { + 'Allowed values:' : 'Valores permitidos:', + 'Compare all with predecessor': 'Comparar todo con versión anterior', + 'compare changes to:' : 'comparar cambios con:', + 'compared to' : 'comparado con', + 'Default value:' : 'Valor por defecto:', + 'Description' : 'Descripción', + 'Field' : 'Campo', + 'General' : 'General', + 'Generated with' : 'Generado con', + 'Name' : 'Nombre', + 'No response values.' : 'Sin valores en la respuesta.', + 'optional' : 'opcional', + 'Parameter' : 'Parámetro', + 'Permission:' : 'Permisos:', + 'Response' : 'Respuesta', + 'Send' : 'Enviar', + 'Send a Sample Request' : 'Enviar una petición de ejemplo', + 'show up to version:' : 'mostrar a versión:', + 'Size range:' : 'Tamaño de rango:', + 'Type' : 'Tipo', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/fr.js b/apidoc/locales/fr.js new file mode 100644 index 0000000000..100a642917 --- /dev/null +++ b/apidoc/locales/fr.js @@ -0,0 +1,25 @@ +define({ + fr: { + 'Allowed values:' : 'Valeurs autorisées :', + 'Compare all with predecessor': 'Tout comparer avec ...', + 'compare changes to:' : 'comparer les changements à :', + 'compared to' : 'comparer à', + 'Default value:' : 'Valeur par défaut :', + 'Description' : 'Description', + 'Field' : 'Champ', + 'General' : 'Général', + 'Generated with' : 'Généré avec', + 'Name' : 'Nom', + 'No response values.' : 'Aucune valeur de réponse.', + 'optional' : 'optionnel', + 'Parameter' : 'Paramètre', + 'Permission:' : 'Permission :', + 'Response' : 'Réponse', + 'Send' : 'Envoyer', + 'Send a Sample Request' : 'Envoyer une requête représentative', + 'show up to version:' : 'Montrer à partir de la version :', + 'Size range:' : 'Ordre de grandeur :', + 'Type' : 'Type', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/locale.js b/apidoc/locales/locale.js new file mode 100644 index 0000000000..f6e1d97149 --- /dev/null +++ b/apidoc/locales/locale.js @@ -0,0 +1,45 @@ +define([ + './locales/de.js', + './locales/es.js', + './locales/fr.js', + './locales/nl.js', + './locales/pl.js', + './locales/pt_br.js', + './locales/ru.js', + './locales/zh.js', + './locales/zh_cn.js' +], function() { + var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); + var language = langId.substr(0, 2); + var locales = {}; + + for (index in arguments) { + for (property in arguments[index]) + locales[property] = arguments[index][property]; + } + if ( ! locales['en']) + locales['en'] = {}; + + if ( ! locales[langId] && ! locales[language]) + language = 'en'; + + var locale = (locales[langId] ? locales[langId] : locales[language]); + + function __(text) { + var index = locale[text]; + if (index === undefined) + return text; + return index; + }; + + function setLanguage(language) { + locale = locales[language]; + } + + return { + __ : __, + locales : locales, + locale : locale, + setLanguage: setLanguage + }; +}); diff --git a/apidoc/locales/nl.js b/apidoc/locales/nl.js new file mode 100644 index 0000000000..bddfeeb18d --- /dev/null +++ b/apidoc/locales/nl.js @@ -0,0 +1,25 @@ +define({ + nl: { + 'Allowed values:' : 'Toegestane waarden:', + 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', + 'compare changes to:' : 'vergelijk veranderingen met:', + 'compared to' : 'vergelijk met', + 'Default value:' : 'Standaard waarde:', + 'Description' : 'Omschrijving', + 'Field' : 'Veld', + 'General' : 'Algemeen', + 'Generated with' : 'Gegenereerd met', + 'Name' : 'Naam', + 'No response values.' : 'Geen response waardes.', + 'optional' : 'optioneel', + 'Parameter' : 'Parameter', + 'Permission:' : 'Permissie:', + 'Response' : 'Antwoorden', + 'Send' : 'Sturen', + 'Send a Sample Request' : 'Stuur een sample aanvragen', + 'show up to version:' : 'toon tot en met versie:', + 'Size range:' : 'Maatbereik:', + 'Type' : 'Type', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/pl.js b/apidoc/locales/pl.js new file mode 100644 index 0000000000..db645ee16c --- /dev/null +++ b/apidoc/locales/pl.js @@ -0,0 +1,25 @@ +define({ + pl: { + 'Allowed values:' : 'Dozwolone wartości:', + 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', + 'compare changes to:' : 'porównaj zmiany do:', + 'compared to' : 'porównaj do:', + 'Default value:' : 'Wartość domyślna:', + 'Description' : 'Opis', + 'Field' : 'Pole', + 'General' : 'Generalnie', + 'Generated with' : 'Wygenerowano z', + 'Name' : 'Nazwa', + 'No response values.' : 'Brak odpowiedzi.', + 'optional' : 'opcjonalny', + 'Parameter' : 'Parametr', + 'Permission:' : 'Uprawnienia:', + 'Response' : 'Odpowiedź', + 'Send' : 'Wyślij', + 'Send a Sample Request' : 'Wyślij przykładowe żądanie', + 'show up to version:' : 'pokaż do wersji:', + 'Size range:' : 'Zakres rozmiaru:', + 'Type' : 'Typ', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/pt_br.js b/apidoc/locales/pt_br.js new file mode 100644 index 0000000000..2bd78b0d38 --- /dev/null +++ b/apidoc/locales/pt_br.js @@ -0,0 +1,25 @@ +define({ + 'pt_br': { + 'Allowed values:' : 'Valores permitidos:', + 'Compare all with predecessor': 'Compare todos com antecessores', + 'compare changes to:' : 'comparar alterações com:', + 'compared to' : 'comparado com', + 'Default value:' : 'Valor padrão:', + 'Description' : 'Descrição', + 'Field' : 'Campo', + 'General' : 'Geral', + 'Generated with' : 'Gerado com', + 'Name' : 'Nome', + 'No response values.' : 'Sem valores de resposta.', + 'optional' : 'opcional', + 'Parameter' : 'Parâmetro', + 'Permission:' : 'Permissão:', + 'Response' : 'Resposta', + 'Send' : 'Enviar', + 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', + 'show up to version:' : 'aparecer para a versão:', + 'Size range:' : 'Faixa de tamanho:', + 'Type' : 'Tipo', + 'url' : 'url' + } +}); diff --git a/apidoc/locales/ru.js b/apidoc/locales/ru.js new file mode 100644 index 0000000000..c5f3382141 --- /dev/null +++ b/apidoc/locales/ru.js @@ -0,0 +1,25 @@ +define({ + ru: { + 'Allowed values:' : 'Допустимые значения:', + 'Compare all with predecessor': 'Сравнить с предыдущей версией', + 'compare changes to:' : 'сравнить с:', + 'compared to' : 'в сравнении с', + 'Default value:' : 'По умолчанию:', + 'Description' : 'Описание', + 'Field' : 'Название', + 'General' : 'Общая информация', + 'Generated with' : 'Сгенерировано с помощью', + 'Name' : 'Название', + 'No response values.' : 'Нет значений для ответа.', + 'optional' : 'необязательный', + 'Parameter' : 'Параметр', + 'Permission:' : 'Разрешено:', + 'Response' : 'Ответ', + 'Send' : 'Отправить', + 'Send a Sample Request' : 'Отправить тестовый запрос', + 'show up to version:' : 'показать версию:', + 'Size range:' : 'Ограничения:', + 'Type' : 'Тип', + 'url' : 'URL' + } +}); diff --git a/apidoc/locales/zh.js b/apidoc/locales/zh.js new file mode 100644 index 0000000000..66522067f4 --- /dev/null +++ b/apidoc/locales/zh.js @@ -0,0 +1,25 @@ +define({ + zh: { + 'Allowed values​​:' : '允許值:', + 'Compare all with predecessor': '預先比較所有', + 'compare changes to:' : '比較變更:', + 'compared to' : '對比', + 'Default value:' : '默認值:', + 'Description' : '描述', + 'Field' : '字段', + 'General' : '概括', + 'Generated with' : '生成工具', + 'Name' : '名稱', + 'No response values​​.' : '無對應資料.', + 'optional' : '選項', + 'Parameter' : '參數', + 'Permission:' : '允許:', + 'Response' : '回應', + 'Send' : '發送', + 'Send a Sample Request' : '發送試用需求', + 'show up to version:' : '顯示到版本:', + 'Size range:' : '尺寸範圍:', + 'Type' : '類型', + 'url' : '網址' + } +}); diff --git a/apidoc/locales/zh_cn.js b/apidoc/locales/zh_cn.js new file mode 100644 index 0000000000..300a4d2dd7 --- /dev/null +++ b/apidoc/locales/zh_cn.js @@ -0,0 +1,25 @@ +define({ + 'zh-cn': { + 'Allowed values:' : '允许值:', + 'Compare all with predecessor': '与所有较早的比较', + 'compare changes to:' : '将当前版本与指定版本比较:', + 'compared to' : '相比于', + 'Default value:' : '默认值:', + 'Description' : '描述', + 'Field' : '字段', + 'General' : '概要', + 'Generated with' : '基于', + 'Name' : '名称', + 'No response values.' : '无返回值.', + 'optional' : '可选', + 'Parameter' : '参数', + 'Permission:' : '权限:', + 'Response' : '返回', + 'Send' : '发送', + 'Send a Sample Request' : '发送示例请求', + 'show up to version:' : '显示到指定版本:', + 'Size range:' : '取值范围:', + 'Type' : '类型', + 'url' : '网址' + } +}); diff --git a/apidoc/main.js b/apidoc/main.js new file mode 100644 index 0000000000..5c7fd4e7c2 --- /dev/null +++ b/apidoc/main.js @@ -0,0 +1,705 @@ +require.config({ + paths: { + bootstrap: './vendor/bootstrap.min', + diffMatchPatch: './vendor/diff_match_patch.min', + handlebars: './vendor/handlebars.min', + handlebarsExtended: './utils/handlebars_helper', + jquery: './vendor/jquery.min', + locales: './locales/locale', + lodash: './vendor/lodash.min', + pathToRegexp: './vendor/path-to-regexp/index', + prettify: './vendor/prettify/prettify', + semver: './vendor/semver.min', + utilsSampleRequest: './utils/send_sample_request', + webfontloader: './vendor/webfontloader' + }, + shim: { + bootstrap: { + deps: ['jquery'] + }, + diffMatchPatch: { + exports: 'diff_match_patch' + }, + handlebars: { + exports: 'Handlebars' + }, + handlebarsExtended: { + deps: ['jquery', 'handlebars'], + exports: 'Handlebars' + }, + prettify: { + exports: 'prettyPrint' + } + }, + urlArgs: 'v=' + (new Date()).getTime(), + waitSeconds: 15 +}); + +require([ + 'jquery', + 'lodash', + 'locales', + 'handlebarsExtended', + './api_project.js', + './api_data.js', + 'prettify', + 'utilsSampleRequest', + 'semver', + 'webfontloader', + 'bootstrap', + 'pathToRegexp' +], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) { + + // load google web fonts + loadGoogleFontCss(); + + var api = apiData.api; + + // + // Templates + // + var templateHeader = Handlebars.compile( $('#template-header').html() ); + var templateFooter = Handlebars.compile( $('#template-footer').html() ); + var templateArticle = Handlebars.compile( $('#template-article').html() ); + var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() ); + var templateGenerator = Handlebars.compile( $('#template-generator').html() ); + var templateProject = Handlebars.compile( $('#template-project').html() ); + var templateSections = Handlebars.compile( $('#template-sections').html() ); + var templateSidenav = Handlebars.compile( $('#template-sidenav').html() ); + + // + // apiProject defaults + // + if ( ! apiProject.template) + apiProject.template = {}; + + if (apiProject.template.withCompare == null) + apiProject.template.withCompare = true; + + if (apiProject.template.withGenerator == null) + apiProject.template.withGenerator = true; + + if (apiProject.template.forceLanguage) + locale.setLanguage(apiProject.template.forceLanguage); + + // Setup jQuery Ajax + $.ajaxSetup(apiProject.template.jQueryAjaxSetup); + + // + // Data transform + // + // grouped by group + var apiByGroup = _.groupBy(api, function(entry) { + return entry.group; + }); + + // grouped by group and name + var apiByGroupAndName = {}; + $.each(apiByGroup, function(index, entries) { + apiByGroupAndName[index] = _.groupBy(entries, function(entry) { + return entry.name; + }); + }); + + // + // sort api within a group by title ASC and custom order + // + var newList = []; + var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0 + $.each (apiByGroupAndName, function(index, groupEntries) { + // get titles from the first entry of group[].name[] (name has versioning) + var titles = []; + $.each (groupEntries, function(titleName, entries) { + var title = entries[0].title; + if(title !== undefined) { + title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; }); + titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting + } + }); + // sort by name ASC + titles.sort(); + + // custom order + if (apiProject.order) + titles = sortByOrder(titles, apiProject.order, '#~#'); + + // add single elements to the new list + titles.forEach(function(name) { + var values = name.split('#~#'); + var key = values[1]; + groupEntries[key].forEach(function(entry) { + newList.push(entry); + }); + }); + }); + // api overwrite with ordered list + api = newList; + + // + // Group- and Versionlists + // + var apiGroups = {}; + var apiGroupTitles = {}; + var apiVersions = {}; + apiVersions[apiProject.version] = 1; + + $.each(api, function(index, entry) { + apiGroups[entry.group] = 1; + apiGroupTitles[entry.group] = entry.groupTitle || entry.group; + apiVersions[entry.version] = 1; + }); + + // sort groups + apiGroups = Object.keys(apiGroups); + apiGroups.sort(); + + // custom order + if (apiProject.order) + apiGroups = sortByOrder(apiGroups, apiProject.order); + + // sort versions DESC + apiVersions = Object.keys(apiVersions); + apiVersions.sort(semver.compare); + apiVersions.reverse(); + + // + // create Navigationlist + // + var nav = []; + apiGroups.forEach(function(group) { + // Mainmenu entry + nav.push({ + group: group, + isHeader: true, + title: apiGroupTitles[group] + }); + + // Submenu + var oldName = ''; + api.forEach(function(entry) { + if (entry.group === group) { + if (oldName !== entry.name) { + nav.push({ + title: entry.title, + group: group, + name: entry.name, + type: entry.type, + version: entry.version + }); + } else { + nav.push({ + title: entry.title, + group: group, + hidden: true, + name: entry.name, + type: entry.type, + version: entry.version + }); + } + oldName = entry.name; + } + }); + }); + + // Mainmenu Header entry + if (apiProject.header) { + nav.unshift({ + group: '_', + isHeader: true, + title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title, + isFixed: true + }); + } + + // Mainmenu Footer entry + if (apiProject.footer && apiProject.footer.title != null) { + nav.push({ + group: '_footer', + isHeader: true, + title: apiProject.footer.title, + isFixed: true + }); + } + + // render pagetitle + var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version; + $(document).attr('title', title); + + // remove loader + $('#loader').remove(); + + // render sidenav + var fields = { + nav: nav + }; + $('#sidenav').append( templateSidenav(fields) ); + + // render Generator + $('#generator').append( templateGenerator(apiProject) ); + + // render Project + _.extend(apiProject, { versions: apiVersions}); + $('#project').append( templateProject(apiProject) ); + + // render apiDoc, header/footer documentation + if (apiProject.header) + $('#header').append( templateHeader(apiProject.header) ); + + if (apiProject.footer) + $('#footer').append( templateFooter(apiProject.footer) ); + + // + // Render Sections and Articles + // + var articleVersions = {}; + var content = ''; + apiGroups.forEach(function(groupEntry) { + var articles = []; + var oldName = ''; + var fields = {}; + var title = groupEntry; + var description = ''; + articleVersions[groupEntry] = {}; + + // render all articles of a group + api.forEach(function(entry) { + if(groupEntry === entry.group) { + if (oldName !== entry.name) { + // determine versions + api.forEach(function(versionEntry) { + if (groupEntry === versionEntry.group && entry.name === versionEntry.name) { + if ( ! articleVersions[entry.group][entry.name]) + articleVersions[entry.group][entry.name] = []; + + articleVersions[entry.group][entry.name].push(versionEntry.version); + } + }); + fields = { + article: entry, + versions: articleVersions[entry.group][entry.name] + }; + } else { + fields = { + article: entry, + hidden: true, + versions: articleVersions[entry.group][entry.name] + }; + } + + // add prefix URL for endpoint + if (apiProject.url) + fields.article.url = apiProject.url + fields.article.url; + + addArticleSettings(fields, entry); + + if (entry.groupTitle) + title = entry.groupTitle; + + // TODO: make groupDescription compareable with older versions (not important for the moment) + if (entry.groupDescription) + description = entry.groupDescription; + + articles.push({ + article: templateArticle(fields), + group: entry.group, + name: entry.name + }); + oldName = entry.name; + } + }); + + // render Section with Articles + var fields = { + group: groupEntry, + title: title, + description: description, + articles: articles + }; + content += templateSections(fields); + }); + $('#sections').append( content ); + + // Bootstrap Scrollspy + $(this).scrollspy({ target: '#scrollingNav', offset: 18 }); + + // Content-Scroll on Navigation click. + $('.sidenav').find('a').on('click', function(e) { + e.preventDefault(); + var id = $(this).attr('href'); + if ($(id).length > 0) + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400); + window.location.hash = $(this).attr('href'); + }); + + // Quickjump on Pageload to hash position. + if(window.location.hash) { + var id = window.location.hash; + if ($(id).length > 0) + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0); + } + + /** + * Check if Parameter (sub) List has a type Field. + * Example: @apiSuccess varname1 No type. + * @apiSuccess {String} varname2 With type. + * + * @param {Object} fields + */ + function _hasTypeInFields(fields) { + var result = false; + $.each(fields, function(name) { + if (_.any(fields[name], function(item) { return item.type; }) ) + result = true; + }); + return result; + } + + /** + * On Template changes, recall plugins. + */ + function initDynamic() { + // bootstrap popover + $('a[data-toggle=popover]') + .popover() + .click(function(e) { + e.preventDefault(); + }) + ; + + var version = $('#version strong').html(); + $('#sidenav li').removeClass('is-new'); + if (apiProject.template.withCompare) { + $('#sidenav li[data-version=\'' + version + '\']').each(function(){ + var group = $(this).data('group'); + var name = $(this).data('name'); + var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length; + var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this)); + if (length === 1 || index === (length - 1)) + $(this).addClass('is-new'); + }); + } + + // tabs + $('.nav-tabs-examples a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + }); + $('.nav-tabs-examples').find('a:first').tab('show'); + + // sample request switch + $('.sample-request-switch').click(function (e) { + var name = '.' + $(this).attr('name') + '-fields'; + $(name).addClass('hide'); + $(this).parent().next(name).removeClass('hide'); + }); + + // call scrollspy refresh method + $(window).scrollspy('refresh'); + + // init modules + sampleRequest.initDynamic(); + } + initDynamic(); + + // Pre- / Code-Format + prettyPrint(); + + // + // HTML-Template specific jQuery-Functions + // + // Change Main Version + $('#versions li.version a').on('click', function(e) { + e.preventDefault(); + + var selectedVersion = $(this).html(); + $('#version strong').html(selectedVersion); + + // hide all + $('article').addClass('hide'); + $('#sidenav li:not(.nav-fixed)').addClass('hide'); + + // show 1st equal or lower Version of each entry + $('article[data-version]').each(function(index) { + var group = $(this).data('group'); + var name = $(this).data('name'); + var version = $(this).data('version'); + + if (version <= selectedVersion) { + if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) { + // enable Article + $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); + // enable Navigation + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); + $('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide'); + } + } + }); + + + // show 1st equal or lower Version of each entry + $('article[data-version]').each(function(index) { + var group = $(this).data('group'); + $('section#api-' + group).removeClass('hide'); + if ($('section#api-' + group + ' article:visible').length === 0) { + $('section#api-' + group).addClass('hide'); + } else { + $('section#api-' + group).removeClass('hide'); + } + }); + + initDynamic(); + return; + }); + + // compare all article with their predecessor + $('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo); + + // change version of an article + $('article .versions li.version a').on('click', changeVersionCompareTo); + + // compare url-parameter + $.urlParam = function(name) { + var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); + return (results && results[1]) ? results[1] : null; + }; + + if ($.urlParam('compare')) { + // URL Paramter ?compare=1 is set + $('#compareAllWithPredecessor').trigger('click'); + + if (window.location.hash) { + var id = window.location.hash; + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0); + } + } + + /** + * Change version of an article to compare it to an other version. + */ + function changeVersionCompareTo(e) { + e.preventDefault(); + + var $root = $(this).parents('article'); + var selectedVersion = $(this).html(); + var $button = $root.find('.version'); + var currentVersion = $button.find('strong').html(); + $button.find('strong').html(selectedVersion); + + var group = $root.data('group'); + var name = $root.data('name'); + var version = $root.data('version'); + + var compareVersion = $root.data('compare-version'); + + if (compareVersion === selectedVersion) + return; + + if ( ! compareVersion && version == selectedVersion) + return; + + if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) { + // the version of the entry is set to the highest version (reset) + resetArticle(group, name, version); + } else { + var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']'); + + var sourceEntry = {}; + var compareEntry = {}; + $.each(apiByGroupAndName[group][name], function(index, entry) { + if (entry.version === version) + sourceEntry = entry; + if (entry.version === selectedVersion) + compareEntry = entry; + }); + + var fields = { + article: sourceEntry, + compare: compareEntry, + versions: articleVersions[group][name] + }; + + // add unique id + // TODO: replace all group-name-version in template with id. + fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; + fields.article.id = fields.article.id.replace(/\./g, '_'); + + fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version; + fields.compare.id = fields.compare.id.replace(/\./g, '_'); + + var entry = sourceEntry; + if (entry.parameter && entry.parameter.fields) + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + + if (entry.error && entry.error.fields) + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + + if (entry.success && entry.success.fields) + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + + if (entry.info && entry.info.fields) + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + + var entry = compareEntry; + if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields) + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + + if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields) + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + + if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields) + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + + if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields) + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + + var content = templateCompareArticle(fields); + $root.after(content); + var $content = $root.next(); + + // Event on.click re-assign + $content.find('.versions li.version a').on('click', changeVersionCompareTo); + + // select navigation + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications'); + + $root.remove(); + // TODO: on change main version or select the highest version re-render + } + + initDynamic(); + } + + /** + * Compare all currently selected Versions with their predecessor. + */ + function changeAllVersionCompareTo(e) { + e.preventDefault(); + $('article:visible .versions').each(function(){ + var $root = $(this).parents('article'); + var currentVersion = $root.data('version'); + var $foundElement = null; + $(this).find('li.version a').each(function() { + var selectVersion = $(this).html(); + if (selectVersion < currentVersion && ! $foundElement) + $foundElement = $(this); + }); + + if($foundElement) + $foundElement.trigger('click'); + }); + initDynamic(); + } + + /** + * Add article settings. + */ + function addArticleSettings(fields, entry) { + // add unique id + // TODO: replace all group-name-version in template with id. + fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; + fields.id = fields.id.replace(/\./g, '_'); + + if (entry.header && entry.header.fields) + fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields); + + if (entry.parameter && entry.parameter.fields) + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + + if (entry.error && entry.error.fields) + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + + if (entry.success && entry.success.fields) + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + + if (entry.info && entry.info.fields) + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + + // add template settings + fields.template = apiProject.template; + } + + /** + * Render Article. + */ + function renderArticle(group, name, version) { + var entry = {}; + $.each(apiByGroupAndName[group][name], function(index, currentEntry) { + if (currentEntry.version === version) + entry = currentEntry; + }); + var fields = { + article: entry, + versions: articleVersions[group][name] + }; + + addArticleSettings(fields, entry); + + return templateArticle(fields); + } + + /** + * Render original Article and remove the current visible Article. + */ + function resetArticle(group, name, version) { + var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible'); + var content = renderArticle(group, name, version); + + $root.after(content); + var $content = $root.next(); + + // Event on.click muss neu zugewiesen werden (sollte eigentlich mit on automatisch funktionieren... sollte) + $content.find('.versions li.version a').on('click', changeVersionCompareTo); + + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications'); + + $root.remove(); + return; + } + + /** + * Load google fonts. + */ + function loadGoogleFontCss() { + WebFont.load({ + active: function() { + // Update scrollspy + $(window).scrollspy('refresh') + }, + google: { + families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7'] + } + }); + } + + /** + * Return ordered entries by custom order and append not defined entries to the end. + * @param {String[]} elements + * @param {String[]} order + * @param {String} splitBy + * @return {String[]} Custom ordered list. + */ + function sortByOrder(elements, order, splitBy) { + var results = []; + order.forEach (function(name) { + if (splitBy) + elements.forEach (function(element) { + var parts = element.split(splitBy); + var key = parts[1]; // reference keep for sorting + if (key == name) + results.push(element); + }); + else + elements.forEach (function(key) { + if (key == name) + results.push(name); + }); + }); + // Append all other entries that ar not defined in order + elements.forEach(function(element) { + if (results.indexOf(element) === -1) + results.push(element); + }); + return results; + } + +}); diff --git a/apidoc/utils/handlebars_helper.js b/apidoc/utils/handlebars_helper.js new file mode 100644 index 0000000000..b01113b124 --- /dev/null +++ b/apidoc/utils/handlebars_helper.js @@ -0,0 +1,327 @@ +define([ + 'locales', + 'handlebars', + 'diffMatchPatch' +], function(locale, Handlebars, DiffMatchPatch) { + + /** + * start/stop timer for simple performance check. + */ + var timer; + Handlebars.registerHelper('startTimer', function(text) { + timer = new Date(); + return ''; + }); + + Handlebars.registerHelper('stopTimer', function(text) { + console.log(new Date() - timer); + return ''; + }); + + /** + * Return localized Text. + * @param string text + */ + Handlebars.registerHelper('__', function(text) { + return locale.__(text); + }); + + /** + * Console log. + * @param mixed obj + */ + Handlebars.registerHelper('cl', function(obj) { + console.log(obj); + return ''; + }); + + /** + * Replace underscore with space. + * @param string text + */ + Handlebars.registerHelper('underscoreToSpace', function(text) { + return text.replace(/(_+)/g, ' '); + }); + + /** + * + */ + Handlebars.registerHelper('assign', function(name) { + if(arguments.length > 0) { + var type = typeof(arguments[1]); + var arg = null; + if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1]; + Handlebars.registerHelper(name, function() { return arg; }); + } + return ''; + }); + + /** + * + */ + Handlebars.registerHelper('nl2br', function(text) { + return _handlebarsNewlineToBreak(text); + }); + + /** + * + */ + Handlebars.registerHelper('if_eq', function(context, options) { + var compare = context; + // Get length if context is an object + if (context instanceof Object && ! (options.hash.compare instanceof Object)) + compare = Object.keys(context).length; + + if (compare === options.hash.compare) + return options.fn(this); + + return options.inverse(this); + }); + + /** + * + */ + Handlebars.registerHelper('if_gt', function(context, options) { + var compare = context; + // Get length if context is an object + if (context instanceof Object && ! (options.hash.compare instanceof Object)) + compare = Object.keys(context).length; + + if(compare > options.hash.compare) + return options.fn(this); + + return options.inverse(this); + }); + + /** + * + */ + var templateCache = {}; + Handlebars.registerHelper('subTemplate', function(name, sourceContext) { + if ( ! templateCache[name]) + templateCache[name] = Handlebars.compile($('#template-' + name).html()); + + var template = templateCache[name]; + var templateContext = $.extend({}, this, sourceContext.hash); + return new Handlebars.SafeString( template(templateContext) ); + }); + + /** + * + */ + Handlebars.registerHelper('toLowerCase', function(value) { + return (value && typeof value === 'string') ? value.toLowerCase() : ''; + }); + + /** + * + */ + Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) { + var splits = value.split(splitChar); + return new Array(splits.length).join(fillChar) + splits[splits.length - 1]; + }); + + /** + * Convert Newline to HTML-Break (nl2br). + * + * @param {String} text + * @returns {String} + */ + function _handlebarsNewlineToBreak(text) { + return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '
' + '$2'); + } + + /** + * + */ + Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) { + var fieldName = options.hash.field; + var newSource = []; + if (source) { + source.forEach(function(entry) { + var values = entry; + values['key'] = entry[fieldName]; + newSource.push(values); + }); + } + + var newCompare = []; + if (compare) { + compare.forEach(function(entry) { + var values = entry; + values['key'] = entry[fieldName]; + newCompare.push(values); + }); + } + return _handlebarsEachCompared('key', newSource, newCompare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_keys', function(source, compare, options) { + var newSource = []; + if (source) { + var sourceFields = Object.keys(source); + sourceFields.forEach(function(name) { + var values = {}; + values['value'] = source[name]; + values['key'] = name; + newSource.push(values); + }); + } + + var newCompare = []; + if (compare) { + var compareFields = Object.keys(compare); + compareFields.forEach(function(name) { + var values = {}; + values['value'] = compare[name]; + values['key'] = name; + newCompare.push(values); + }); + } + return _handlebarsEachCompared('key', newSource, newCompare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_field', function(source, compare, options) { + return _handlebarsEachCompared('field', source, compare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_title', function(source, compare, options) { + return _handlebarsEachCompared('title', source, compare, options); + }); + + /** + * + */ + Handlebars.registerHelper('showDiff', function(source, compare, options) { + var ds = ''; + if(source === compare) { + ds = source; + } else { + if( ! source) + return compare; + + if( ! compare) + return source; + + var d = diffMatchPatch.diff_main(compare, source); + diffMatchPatch.diff_cleanupSemantic(d); + ds = diffMatchPatch.diff_prettyHtml(d); + ds = ds.replace(/¶/gm, ''); + } + if(options === 'nl2br') + ds = _handlebarsNewlineToBreak(ds); + + return ds; + }); + + /** + * + */ + function _handlebarsEachCompared(fieldname, source, compare, options) + { + var dataList = []; + var index = 0; + if(source) { + source.forEach(function(sourceEntry) { + var found = false; + if (compare) { + compare.forEach(function(compareEntry) { + if(sourceEntry[fieldname] === compareEntry[fieldname]) { + var data = { + typeSame: true, + source: sourceEntry, + compare: compareEntry, + index: index + }; + dataList.push(data); + found = true; + index++; + } + }); + } + if ( ! found) { + var data = { + typeIns: true, + source: sourceEntry, + index: index + }; + dataList.push(data); + index++; + } + }); + } + + if (compare) { + compare.forEach(function(compareEntry) { + var found = false; + if (source) { + source.forEach(function(sourceEntry) { + if(sourceEntry[fieldname] === compareEntry[fieldname]) + found = true; + }); + } + if ( ! found) { + var data = { + typeDel: true, + compare: compareEntry, + index: index + }; + dataList.push(data); + index++; + } + }); + } + + var ret = ''; + var length = dataList.length; + for (var index in dataList) { + if(index == (length - 1)) + dataList[index]['_last'] = true; + ret = ret + options.fn(dataList[index]); + } + return ret; + } + + var diffMatchPatch = new DiffMatchPatch(); + + /** + * Overwrite Colors + */ + DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) { + var html = []; + var pattern_amp = /&/g; + var pattern_lt = //g; + var pattern_para = /\n/g; + for (var x = 0; x < diffs.length; x++) { + var op = diffs[x][0]; // Operation (insert, delete, equal) + var data = diffs[x][1]; // Text of change. + var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') + .replace(pattern_gt, '>').replace(pattern_para, '¶
'); + switch (op) { + case DIFF_INSERT: + html[x] = '' + text + ''; + break; + case DIFF_DELETE: + html[x] = '' + text + ''; + break; + case DIFF_EQUAL: + html[x] = '' + text + ''; + break; + } + } + return html.join(''); + }; + + // Exports + return Handlebars; +}); diff --git a/apidoc/utils/send_sample_request.js b/apidoc/utils/send_sample_request.js new file mode 100755 index 0000000000..6063f85ae4 --- /dev/null +++ b/apidoc/utils/send_sample_request.js @@ -0,0 +1,188 @@ +define([ + 'jquery' +], function($) { + + var initDynamic = function() { + // Button send + $(".sample-request-send").off("click"); + $(".sample-request-send").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + sendSampleRequest(group, name, version, $(this).data("sample-request-type")); + }); + + // Button clear + $(".sample-request-clear").off("click"); + $(".sample-request-clear").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + clearSampleRequest(group, name, version); + }); + }; // initDynamic + + function sendSampleRequest(group, name, version, type) + { + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); + + // Optional header + var header = {}; + $root.find(".sample-request-header:checked").each(function(i, element) { + var group = $(element).data("sample-request-header-group-id"); + $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) { + var key = $(element).data("sample-request-header-name"); + var value = element.value; + if ( ! element.optional && element.defaultValue !== '') { + value = element.defaultValue; + } + header[key] = $.type(value) === "string" ? escapeHtml(value) : value; + }); + }); + + // create JSON dictionary of parameters + var param = {}; + $root.find(".sample-request-param:checked").each(function(i, element) { + var group = $(element).data("sample-request-param-group-id"); + $root.find("[data-sample-request-param-group=\"" + group + "\"]").each(function(i, element) { + var key = $(element).data("sample-request-param-name"); + var value = element.value; + if ( ! element.optional && element.defaultValue !== '') { + value = element.defaultValue; + } + param[key] = $.type(value) === "string" ? escapeHtml(value) : value; + }); + }); + + // grab user-inputted URL + var url = $root.find(".sample-request-url").val(); + + // Insert url parameter + var pattern = pathToRegexp(url, null); + var matches = pattern.exec(url); + for (var i = 1; i < matches.length; i++) { + var key = matches[i].substr(1); + if (param[key] !== undefined) { + url = url.replace(matches[i], encodeURIComponent(param[key])); + + // remove URL parameters from list + delete param[key]; + } + } // for + + // send AJAX request, catch success or error callback + var ajaxRequest = { + url : url, + dataType : "json", + contentType: "application/json", + headers : header, + type : type.toUpperCase(), + success : displaySuccess, + error : displayError + }; + + if (type === 'get') { + ajaxRequest.url = url + paramToQueryParms(param), + ajaxRequest.dataType = "text"; + ajaxRequest.contentType = "text/plain"; + } else { + if ( ! $.isEmptyObject(param)) { + ajaxRequest.data = JSON.stringify(param); + } + } + $.ajax(ajaxRequest); + + function paramToQueryParms(param) { + var p = 0; + var queryParms = ""; + for (var k in param) { + if (p === 0) { + queryParms += "?" + k + "=" + param[k]; + } else { + queryParms += "&" + k + "=" + param[k]; + } + p++; + } + return queryParms; + } + + function displaySuccess(data) { + var jsonResponse; + try { + jsonResponse = JSON.stringify(data, null, 4); + } catch (e) { + jsonResponse = data; + } + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").html(jsonResponse); + refreshScrollSpy(); + }; + + function displayError(jqXHR, textStatus, error) { + var message = "Error " + jqXHR.status + ": " + error; + var jsonResponse; + try { + jsonResponse = JSON.parse(jqXHR.responseText); + jsonResponse = JSON.stringify(jsonResponse, null, 4); + } catch (e) { + jsonResponse = jqXHR.responseText; + } + + if (jsonResponse) + message += "
" + jsonResponse; + + // flicker on previous error to make clear that there is a new response + if($root.find(".sample-request-response").is(":visible")) + $root.find(".sample-request-response").fadeTo(1, 0.1); + + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").html(message); + refreshScrollSpy(); + }; + } + + function clearSampleRequest(group, name, version) + { + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); + + // hide sample response + $root.find(".sample-request-response-json").html(""); + $root.find(".sample-request-response").hide(); + + // reset value of parameters + $root.find(".sample-request-param").each(function(i, element) { + element.value = ""; + }); + + // restore default URL + var $urlElement = $root.find(".sample-request-url"); + $urlElement.val($urlElement.prop("defaultValue")); + + refreshScrollSpy(); + } + + function refreshScrollSpy() + { + $('[data-spy="scroll"]').each(function () { + $(this).scrollspy("refresh"); + }); + } + + function escapeHtml(str) { + var div = document.createElement("div"); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; + } + + /** + * Exports. + */ + return { + initDynamic: initDynamic + }; + +}); diff --git a/apidoc/vendor/bootstrap-responsive.min.css b/apidoc/vendor/bootstrap-responsive.min.css new file mode 100644 index 0000000000..96a435be90 --- /dev/null +++ b/apidoc/vendor/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.3.2 + * + * Copyright 2013 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/apidoc/vendor/bootstrap.min.css b/apidoc/vendor/bootstrap.min.css new file mode 100644 index 0000000000..df96c86485 --- /dev/null +++ b/apidoc/vendor/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.3.2 + * + * Copyright 2013 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover,a:focus{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover,a.muted:focus{color:#808080}.text-warning{color:#c09853}a.text-warning:hover,a.text-warning:focus{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover,a.text-error:focus{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover,a.text-info:focus{color:#2d6987}.text-success{color:#468847}a.text-success:hover,a.text-success:focus{color:#356635}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;*display:inline;padding-right:5px;padding-left:5px;*zoom:1}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{display:inline-block;margin-bottom:10px;font-size:0;white-space:nowrap;vertical-align:middle}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu,.input-append .popover,.input-prepend .popover{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child,.table-bordered tbody:first-child tr:first-child>th:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child,.table-bordered tbody:first-child tr:first-child>th:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tbody:last-child tr:last-child>th:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>th:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tbody:last-child tr:last-child>th:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>th:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover>td,.table-hover tbody tr:hover>th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success>td{background-color:#dff0d8}.table tbody tr.error>td{background-color:#f2dede}.table tbody tr.warning>td{background-color:#fcf8e3}.table tbody tr.info>td{background-color:#d9edf7}.table-hover tbody tr.success:hover>td{background-color:#d0e9c6}.table-hover tbody tr.error:hover>td{background-color:#ebcccc}.table-hover tbody tr.warning:hover>td{background-color:#faf2cc}.table-hover tbody tr.info:hover>td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{width:16px;background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.btn-mini .caret,.btn-small .caret{margin-top:8px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover,.nav-list>.active>a:focus{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover,.nav-tabs>li>a:focus{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover,.nav-tabs>.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover,.nav-pills>.active>a:focus{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover,.nav-tabs.nav-stacked>li>a:focus{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret,.nav .dropdown-toggle:focus .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover,.nav>.dropdown.active>a:focus{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover,.nav>li.dropdown.open.active>a:focus{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret,.nav li.dropdown.open a:focus .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover,.tabs-stacked .open>a:focus{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover,.tabs-below>.nav-tabs>li>a:focus{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover,.tabs-below>.nav-tabs>.active>a:focus{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover,.tabs-left>.nav-tabs>li>a:focus{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover,.tabs-left>.nav-tabs .active>a:focus{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover,.tabs-right>.nav-tabs>li>a:focus{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover,.tabs-right>.nav-tabs .active>a:focus{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover,.nav>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover,.navbar .brand:focus{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover,.navbar-link:focus{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn,.navbar .input-prepend .btn-group,.navbar .input-append .btn-group{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:focus,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret,.navbar .nav li.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover,.navbar-inverse .brand:focus,.navbar-inverse .nav>li>a:focus{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover,.navbar-inverse .navbar-link:focus{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret,.navbar-inverse .nav li.dropdown>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:focus,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>li>a:focus,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover,.pagination ul>.disabled>a:focus{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-title:empty{display:none}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover,a.thumbnail:focus{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.label:focus,a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-indicators{position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li{display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255,255,255,0.25);border-radius:5px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/apidoc/vendor/bootstrap.min.js b/apidoc/vendor/bootstrap.min.js new file mode 100644 index 0000000000..848258d380 --- /dev/null +++ b/apidoc/vendor/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2013 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('