Team

Team

A Team allows scoping of API requests to a particular Github Organization Team.

Constructor

new Team(teamIdopt, authopt, apiBaseopt)

Create a Team.

Source:
Parameters:
Name Type Attributes Default Description
teamId string <optional>

the id for the team

auth Requestable.auth <optional>

information required to authenticate to Github

apiBase string <optional>
https://api.github.com

the base Github API URL

Methods

addMembership(username, options, cbopt) → {Promise}

Add a member to the Team

Source:
See:
Parameters:
Name Type Attributes Description
username string

can be one of: all, maintainer, or member

options object

Parameters for adding a team member

Name Type Attributes Default Description
role string <optional>
member

The role that this user should have in the team. Can be one of: member, or maintainer

cb Requestable.callback <optional>

will receive the membership status of added user

Returns:
Type:
Promise
  • the promise for the http request

deleteTeam(cbopt) → {Promise}

Delete Team

Source:
See:
Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the list of repositories

Returns:
Type:
Promise
  • the promise for the http request

editTeam(options, cbopt) → {Promise}

Edit Team information

Source:
See:
Parameters:
Name Type Attributes Description
options object

Parameters for team edit

Name Type Attributes Default Description
name string

The name of the team

description string <optional>

Team description

repo_names string <optional>

Repos to add the team to

privacy string <optional>
secret

The level of privacy the team should have. Can be either one of: secret, or closed

cb Requestable.callback <optional>

will receive the updated team

Returns:
Type:
Promise
  • the promise for the http request

getMembership(username, cbopt) → {Promise}

Get Team membership status for a user

Source:
See:
Parameters:
Name Type Attributes Description
username string

can be one of: all, maintainer, or member

cb Requestable.callback <optional>

will receive the membership status of a user

Returns:
Type:
Promise
  • the promise for the http request

getTeam(cbopt) → {Promise}

Get Team information

Source:
See:
Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the team

Returns:
Type:
Promise
  • the promise for the http request

isManagedRepo(owner, repo, cbopt) → {Promise}

Get repo management status for team

Source:
See:
Parameters:
Name Type Attributes Description
owner string

Organization name

repo string

Repo name

cb Requestable.callback <optional>

will receive the membership status of added user

Returns:
Type:
Promise
  • the promise for the http request

listMembers(options, cbopt) → {Promise}

List the users who are members of the Team

Source:
See:
Parameters:
Name Type Attributes Description
options object

Parameters for listing team users

Name Type Attributes Default Description
role string <optional>
all

can be one of: all, maintainer, or member

cb Requestable.callback <optional>

will receive the list of users

Returns:
Type:
Promise
  • the promise for the http request

listRepos(cbopt) → {Promise}

List the Team's repositories

Source:
See:
Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the list of repositories

Returns:
Type:
Promise
  • the promise for the http request

manageRepo(owner, repo, options, cbopt) → {Promise}

Add or Update repo management status for team

Source:
See:
Parameters:
Name Type Attributes Description
owner string

Organization name

repo string

Repo name

options object

Parameters for adding or updating repo management for the team

Name Type Attributes Description
permission string <optional>

The permission to grant the team on this repository. Can be one of: pull, push, or admin

cb Requestable.callback <optional>

will receive the membership status of added user

Returns:
Type:
Promise
  • the promise for the http request

unmanageRepo(owner, repo, cbopt) → {Promise}

Remove repo management status for team

Source:
See:
Parameters:
Name Type Attributes Description
owner string

Organization name

repo string

Repo name

cb Requestable.callback <optional>

will receive the membership status of added user

Returns:
Type:
Promise
  • the promise for the http request