Organization

Organization

Organization encapsulates the functionality to create repositories in organizations

Constructor

new Organization(organization, authopt, apiBaseopt)

Create a new Organization

Parameters:
Name Type Attributes Default Description
organization string

the name of the organization

auth Requestable.auth <optional>

information required to authenticate to Github

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

the base Github API URL

Source:

Methods

createProject(options, cb) → {Promise}

Create a new project

Parameters:
Name Type Description
options Object

the description of the project

cb Requestable.callback

will receive the newly created project

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

createRepo(options, cbopt) → {Promise}

Create a repository in an organization

Parameters:
Name Type Attributes Description
options Object

the repository definition

cb Requestable.callback <optional>

will receive the created repository

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

createTeam(options, cbopt) → {Promise}

Create a team

Parameters:
Name Type Attributes Description
options object

Team creation parameters

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 created team

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

getRepos(cbopt) → {Promise}

List the repositories in an organization

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

getTeams(cbopt) → {Promise}

List the Teams in the Organization

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

will receive the list of teams

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

isMember(username, cbopt) → {Promise}

Query if the user is a member or not

Parameters:
Name Type Attributes Description
username string

the user in question

cb Requestable.callback <optional>

will receive true if the user is a member

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

listMembers(options, cbopt) → {Promise}

List the users who are members of the company

Parameters:
Name Type Attributes Description
options object

filtering options

Properties
Name Type Attributes Default Description
filter string <optional>
all

can be either 2fa_disabled or all

role string <optional>
all

can be one of: all, admin, or member

cb Requestable.callback <optional>

will receive the list of users

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

listProjects(cbopt) → {Promise}

Get information about all projects

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

will receive the list of projects

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