Team

Team

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

Constructor

new Team(teamIdopt, authopt, apiBaseopt)

Create a Team.

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

Source:

Methods

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

Add a member to the Team

Parameters:
Name Type Attributes Description
username string

can be one of: all, maintainer, or member

options object

Parameters for adding a team member

Properties
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

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

deleteTeam(cbopt) → {Promise}

Delete Team

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

will receive the list of repositories

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

editTeam(options, cbopt) → {Promise}

Edit Team information

Parameters:
Name Type Attributes Description
options object

Parameters for team edit

Properties
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

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

getMembership(username, cbopt) → {Promise}

Get Team membership status for a user

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

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

getTeam(cbopt) → {Promise}

Get Team information

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

will receive the team

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

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

Get repo management status for team

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

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

listMembers(options, cbopt) → {Promise}

List the users who are members of the Team

Parameters:
Name Type Attributes Description
options object

Parameters for listing team users

Properties
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

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

listRepos(cbopt) → {Promise}

List the Team's repositories

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

will receive the list of repositories

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

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

Add or Update repo management status for team

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

Properties
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

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

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

Remove repo management status for team

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

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