Module providing GitHub API calls.
- src/index
- ~authenticate(gitHubOAuthToken) ⇒
Promise
- ~getDetailsForAuthenticatedUser() ⇒
Promise
- ~getDetailsForUser(username) ⇒
Promise
- ~getReposForAuthenticatedUser(affiliation, page, per_page) ⇒
Promise
- ~getReposForUser(username, page, per_page) ⇒
Promise
- ~getDetailsForOrg(org) ⇒
Promise
- ~getMembershipForUser(org, username) ⇒
Promise
- ~getPermissionsForUser() ⇒
Promise
- ~getTemplates(owner, repo, ref, path) ⇒
Promise
- ~getDoc(owner, repo, ref, path) ⇒
Promise
- ~createRepo(repo, description, isPrivate) ⇒
Promise
- ~renameRepo(repo, description, isPrivate) ⇒
Promise
- ~createOrgRepo(org, repo, description, isPrivate) ⇒
Promise
- ~saveDoc(owner, repo, path, content, branch, message, [sha]) ⇒
Promise
- ~saveAsPullRequest(owner, repo, path, content, branch, message, title, [sha]) ⇒
Promise
- ~createFork(owner, repo, [organization]) ⇒
Promise
- ~searchCode(query, page, per_page) ⇒
Promise
- ~searchRepos(query, page, per_page) ⇒
Promise
- ~getRepoContents(owner, repo) ⇒
Promise
- ~getRepoContentsByDrillDown(owner, repo) ⇒
Promise
- ~authenticate(gitHubOAuthToken) ⇒
Authenticate the user for making calls to GitHub, using their OAuth token. See https://developer.github.com/v3/#authentication
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
gitHubOAuthToken | String |
The OAuth token from GitHub |
Get the details associated with the currently authenticated user. See https://developer.github.com/v3/users/#get-the-authenticated-user
Kind: inner method of src/index
Get the details for a specific user. See https://developer.github.com/v3/users/#get-a-single-user
Kind: inner method of src/index
Param | Type |
---|---|
username | String |
Get the repos the user has explicit permission to access. See https://developer.github.com/v3/repos/#list-your-repositories
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
affiliation | String |
User's relation to the repo |
page | Integer |
The page number |
per_page | Integer |
Repos per page |
Get the repos for a specific user. See https://developer.github.com/v3/repos/#list-user-repositories
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
username | String |
The username |
page | Integer |
The page number |
per_page | Integer |
Repos per page |
Get the repos for a specific org. See https://developer.github.com/v3/repos/#list-organization-repositories
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
org | String |
The org name |
Get organization membership for a user See https://docs.github.com/en/rest/reference/orgs#set-organization-membership-for-a-user
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
org | String |
The org name |
username | String |
The user name |
Get the permissions for a specific user and repo. See https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
req.owner | String |
The repo owner |
req.repo | String |
The repo |
req.username | String |
The username |
Get the CWRC Writer templates. Default location is https://github.com/cwrc/CWRC-Writer-Templates/tree/master/templates
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
ref | String |
The branch/tag |
path | String |
The path |
Get a document from GitHub. See https://developer.github.com/v3/repos/contents/#get-contents See https://octokit.github.io/rest.js/#octokit-routes-repos-get-contents
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
ref | String |
The branch/tag |
path | String |
The path |
Create a new repo for the authenticated user. See https://developer.github.com/v3/repos/#create
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
repo | String |
The repo |
description | String |
The repo description |
isPrivate | String | Boolean |
Is the repo private |
Create a new repo for the authenticated user. See https://developer.github.com/v3/repos/#create
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
repo | String |
The repo |
description | String |
The repo description |
isPrivate | String | Boolean |
Is the repo private |
Create a new repo for a specific org. See https://developer.github.com/v3/repos/#create
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
org | String |
The org |
repo | String |
The repo |
description | String |
The description |
isPrivate | String | Boolean |
Is the repo private |
Save (i.e. create or update) a document. See https://developer.github.com/v3/repos/contents/#create-or-update-a-file
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
path | String |
The path |
content | String |
The content |
branch | String |
The branch |
message | String |
The commit message |
[sha] | String |
The SHA |
Save (i.e. create) a document as a pull request. See https://developer.github.com/v3/pulls/#create-a-pull-request
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
path | String |
The path |
content | String |
The content |
branch | String |
The branch |
message | String |
The commit message |
title | String |
The title of the pull request |
[sha] | String |
The SHA |
Create a fork for the authenticated user. See https://octokit.github.io/rest.js/v18#repos-create-fork
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
[organization] | String |
The organization |
Search for files based on a specific query. See https://developer.github.com/v3/search/#search-code
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
query | String |
The query |
page | String |
The page number |
per_page | String |
Results per page |
Search for repos based on a specific query. See https://developer.github.com/v3/search/#search-repositories
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
query | String |
The query |
page | String |
The page number |
per_page | String |
Results per page |
Gets the contents (i.e. file structure) of a repo using the GitHub recursive tree method. See https://developer.github.com/v3/git/trees/#get-a-tree-recursively
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |
Gets the contents (i.e. file structure) of a repo by manually recursing. Intended to be used if the github recursive option didn't work because the repository is too big.
Kind: inner method of src/index
Param | Type | Description |
---|---|---|
owner | String |
The owner |
repo | String |
The repo |