Module: github

The GitHub adapter for issue tracking and pull requests.
Source:

Requires

Methods

(inner) apiUrl(path) → {string}

Return the GitHub API url for the specified path.
Parameters:
Name Type Description
path string the path of the API request
Source:
Returns:
the full URL for API request
Type
string

(inner) getPullReqReview(onFulfilled, onRejected, id, file)

Execute the API requests for a code review on pull request file.
Parameters:
Name Type Description
onFulfilled function query result will be passed to this callback
onRejected function errors will be passed to this callback
id number the pull request id
file mixed the file to review, either the string path of the file or the numerical index in the file list
Source:

(inner) getPullRequest(onFulfilled, onRejected, id)

Execute API requests for single pull request query.
Parameters:
Name Type Description
onFulfilled function query result will be passed to this callback
onRejected function errors will be passed to this callback
id number the pull request id to get
Source:

(inner) getPullRequests(onFulfilled, onRejected)

Execute API requests for pull request list query.
Parameters:
Name Type Description
onFulfilled function query result will be passed to this callback
onRejected function errors will be passed to this callback
Source:

(inner) getRunQuery(query, onFulfilled, onRejected) → {function}

Get query runner function for specified query and callbacks.
Parameters:
Name Type Description
query string the query to run
onFulfilled function query result will be passed to this callback
onRejected function errors will be passed to this callback
Source:
Returns:
the function which will execute the query
Type
function

(inner) marshallComments(buffer) → {array}

Marshall the result of the pull request comments API call into standard structure.
Parameters:
Name Type Description
buffer object the result of the API call
Source:
Returns:
an array of objects containing information about each comment
Type
array

(inner) marshallDiff(buffer, path) → {object}

Marshall the result of a unified diff into single diff for specified file.
Parameters:
Name Type Description
buffer object the result of the API call
path string the path of the file to extract from diff
Source:
Returns:
an object containing the file's diff
Type
object

(inner) marshallFiles(buffer) → {array}

Marshall the result of the pull request diff API call into standard structure.
Parameters:
Name Type Description
buffer object the result of the API call
Source:
Returns:
an array of filenames affected by the pull request
Type
array

(inner) marshallPullRequest(buffer) → {object}

Marshall the result of the single pull request API call into standard structure.
Parameters:
Name Type Description
buffer object the result of the API call
Source:
Returns:
an object containing information about the pull request
Type
object

(inner) marshallPullRequests(buffer) → {object}

Marshall the result of the pull requests API call into standard structure.
Parameters:
Name Type Description
buffer object the result of the API call
Source:
Returns:
an object containing information about the pull requests
Type
object

(inner) marshallReviewComments(buffer, path) → {object}

Marshall the result of a review comments API call into standard structure.
Parameters:
Name Type Description
buffer object the result of the API call
path string the path of the file for which to get review comments
Source:
Returns:
an object with diff position (line number) as properties and comment info objects as values
Type
object

(inner) marshallTimestamp(timestamp) → {number}

Marshall a timestamp back into unixtime.
Parameters:
Name Type Description
timestamp string a timestamp from API call
Source:
Returns:
the unixtime of that timestamp
Type
number

(inner) query(query, onFulfilled, onRejected) → {boolean}

Query the GitHub API.
Parameters:
Name Type Description
query string the BitBucket query string
onFulfilled function query result will be passed to this callback
onRejected function errors will be passed to this callback
Source:
Returns:
true for valid query string, false otherwise
Type
boolean