Constructor
new Client(givenTokenopt)
Constructs a Client object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
givenToken |
string |
<optional> |
A GitHub authentication token to connect to the GitHub API. The token needs `public_repo` access. If a token is not provided, the program will attempt to read from a named file 'auth_token.txt' on the `src` directory. If none exists the constructor will crash. |
Members
client :graphql-client
The API client, see
documentation
Type:
- graphql-client
token :string
The API token
Type:
- string
Methods
(async) getAllIssues(pageSizeopt) → {Array.<IssueInfo2>}
Get all the issues in the project
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pageSize |
number |
<optional> |
100 | The number of issues per page |
Returns:
- Type
- Array.<IssueInfo2>
getNumberOfCommitsByTime(startTimeopt, timeDeltaopt) → {Array.<CommitPeriodCount>}
Get total number of commits in Master branch in each time period
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
startTime |
Date |
<optional> |
moment().subtract(6, 'months') | The start of the sampling period |
timeDelta |
object |
<optional> |
{days: 7} | The timedelta of each period, see reference |
Returns:
The number of commits in each period
- Type
- Array.<CommitPeriodCount>
getNumberOfCommitsInMaster() → {number}
Get total number of commits in Master branch
Returns:
The number of commits
- Type
- number
getNumberOfPullRequests() → {number}
Get number of pull requests of the project
Returns:
The number of pull requests
- Type
- number
getNumberOfStargazers() → {number}
Get number of stargazers of the project
Returns:
The number of stargazers
- Type
- number
query(Q, vars)
A simple wrapper for most common tasks client available through
Client#client directly.
Parameters:
Name | Type | Description |
---|---|---|
Q |
string | The GraphQL query. |
vars |
object | The variables to be replaced in the query. |