github
Version:
NodeJS wrapper for the GitHub API
2,534 lines (2,522 loc) • 89.5 kB
Flow
declare module "github" {
declare type Header =
| "Authorization"
| "If-Modified-Since"
| "If-None-Match"
| "Cookie"
| "User-Agent"
| "Accept"
| "X-GitHub-OTP"
| string;
declare type Options = {
debug?: boolean;
protocol?: string;
host?: string;
pathPrefix?: string;
headers?: {[header: Header]: any};
Promise?: typeof Promise;
followRedirects?: boolean;
timeout?: number;
};
declare type AuthBasic = {
type: "basic";
username: string;
password: string;
};
declare type AuthOAuthToken = {
type: "oauth";
token: string;
};
declare type AuthOAuthSecret = {
type: "oauth";
key: string;
secret: string;
};
declare type AuthUserToken = {
type: "token";
token: string;
};
declare type AuthJWT = {
type: "integration";
token: string;
};
declare type Auth =
| AuthBasic
| AuthOAuthToken
| AuthOAuthSecret
| AuthUserToken
| AuthJWT;
declare type Link =
| { link: string; }
| { meta: { link: string; }; }
| string
| any;
declare type Callback = (error: ?Error, result: ?any) => any;
declare type Files = { files: string; };
declare type Owner = { owner: string; };
declare type Username = { username: string; };
declare type Org = { org: string; };
declare type Repo = { repo: string; };
declare type Branch = { branch: string; };
declare type Sha = { sha: string; };
declare type Description = { description?: string; };
declare type Id = { id: string; };
declare type GistId = { gist_id: string; };
declare type InstallationId = { installation_id: string; };
declare type RepositoryId = { repository_id: string; };
declare type CommitId = { commit_id: string; };
declare type ClientId = { client_id?: string; };
declare type ColumnId = { column_id: string; };
declare type ProjectId = { project_id: string; };
declare type RepoId = { repo_id: string; };
declare type InvitationId = { invitation_id: string; };
declare type Ref = { ref: string; };
declare type Number = { number: number; };
declare type IssueNumber = { issue_number: number; };
declare type Name = { name: string; };
declare type Direction = { direction?: "asc"|"desc"; };
declare type Since = { since?: Date; };
declare type Until = { until?: Date; };
declare type State = { state?: "open"|"closed"|"all"; };
declare type Color = { color: string; };
declare type Base = { base: string; };
declare type Head = { head: string; };
declare type Path = { path: string; };
declare type Position = { position: number; };
declare type Body = { body: string[]; };
declare type Homepage = { homepage?: string; };
declare type Private = { private?: boolean; };
declare type HasIssues = { has_issues?: boolean; };
declare type HasWiki = { has_wiki?: boolean; };
declare type HasDownloads = { has_downloads?: boolean; };
declare type DefaultBranch = { default_branch?: string; };
declare type Title = { title: string; };
declare type Key = { key: string; };
declare type Page = { page?: number; };
declare type PerPage = { per_page?: number; };
declare type Scopes = { scopes?: string[]; };
declare type Note = { note?: string; };
declare type NoteUrl = { note_url?: string; };
declare type AutoInit = { auto_init?: boolean; };
declare type GitignoreTemplate = { gitignore_template?: string; };
declare type LicenseTemplate = { license_template?: string; };
declare type Order = { order?: "asc"|"desc"; };
declare type Q = { q: string; };
declare type Data = { data: string; };
declare type Privacy = { privacy?: "secret"|"closed"; };
declare type Fingerprint = { fingerprint?: string; };
declare type AccessToken = { access_token: string; };
declare type AuthorizationGetGrantsParams =
& Page
& PerPage
;
declare type AuthorizationGetGrantParams =
& Id
& Page
& PerPage
;
declare type AuthorizationDeleteGrantParams =
& Id
;
declare type AuthorizationGetAllParams =
& Page
& PerPage
;
declare type AuthorizationGetParams =
& Id
;
declare type AuthorizationCreateParams =
& Scopes
& Note
& NoteUrl
& ClientId
& Fingerprint
& {
client_secret?: string;
};
declare type AuthorizationGetOrCreateAuthorizationForAppParams =
& ClientId
& Scopes
& Note
& NoteUrl
& Fingerprint
& {
client_secret: string;
};
declare type AuthorizationGetOrCreateAuthorizationForAppAndFingerprintParams =
& ClientId
& Fingerprint
& Scopes
& Note
& NoteUrl
& {
client_secret: string;
};
declare type AuthorizationUpdateParams =
& Id
& Scopes
& Note
& NoteUrl
& Fingerprint
& {
add_scopes?: string[];
remove_scopes?: string[];
};
declare type AuthorizationDeleteParams =
& Id
;
declare type AuthorizationCheckParams =
& ClientId
& AccessToken
;
declare type AuthorizationResetParams =
& ClientId
& AccessToken
;
declare type AuthorizationRevokeParams =
& ClientId
& AccessToken
;
declare type ActivityGetEventsParams =
& Page
& PerPage
;
declare type ActivityGetEventsForRepoParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityGetEventsForRepoIssuesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityGetEventsForRepoNetworkParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityGetEventsForOrgParams =
& Org
& Page
& PerPage
;
declare type ActivityGetEventsReceivedParams =
& Username
& Page
& PerPage
;
declare type ActivityGetEventsReceivedPublicParams =
& Username
& Page
& PerPage
;
declare type ActivityGetEventsForUserParams =
& Username
& Page
& PerPage
;
declare type ActivityGetEventsForUserPublicParams =
& Username
& Page
& PerPage
;
declare type ActivityGetEventsForUserOrgParams =
& Username
& Org
& Page
& PerPage
;
declare type ActivityGetNotificationsParams =
& Since
& {
all?: boolean;
participating?: boolean;
before?: string;
};
declare type ActivityGetNotificationsForUserParams =
& Owner
& Repo
& Since
& {
all?: boolean;
participating?: boolean;
before?: string;
};
declare type ActivityMarkNotificationsAsReadParams =
& {
last_read_at?: string;
};
declare type ActivityMarkNotificationsAsReadForRepoParams =
& Owner
& Repo
& {
last_read_at?: string;
};
declare type ActivityGetNotificationThreadParams =
& Id
;
declare type ActivityMarkNotificationThreadAsReadParams =
& Id
;
declare type ActivityCheckNotificationThreadSubscriptionParams =
& Id
;
declare type ActivitySetNotificationThreadSubscriptionParams =
& Id
& {
subscribed?: boolean;
ignored?: boolean;
};
declare type ActivityDeleteNotificationThreadSubscriptionParams =
& Id
;
declare type ActivityGetStargazersForRepoParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityGetStarredReposForUserParams =
& Username
& Direction
& Page
& PerPage
& {
sort?: "created"|"updated";
};
declare type ActivityGetStarredReposParams =
& Direction
& Page
& PerPage
& {
sort?: "created"|"updated";
};
declare type ActivityCheckStarringRepoParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityStarRepoParams =
& Owner
& Repo
;
declare type ActivityUnstarRepoParams =
& Owner
& Repo
;
declare type ActivityGetWatchersForRepoParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivityGetWatchedReposForUserParams =
& Username
& Page
& PerPage
;
declare type ActivityGetWatchedReposParams =
& Page
& PerPage
;
declare type ActivityGetRepoSubscriptionParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ActivitySetRepoSubscriptionParams =
& Owner
& Repo
& {
subscribed?: boolean;
ignored?: boolean;
};
declare type ActivityUnwatchRepoParams =
& Owner
& Repo
;
declare type GistsGetForUserParams =
& Username
& Since
& Page
& PerPage
;
declare type GistsGetAllParams =
& Since
& Page
& PerPage
;
declare type GistsGetPublicParams =
& Since
;
declare type GistsGetStarredParams =
& Since
;
declare type GistsGetParams =
& Id
;
declare type GistsGetRevisionParams =
& Id
& Sha
;
declare type GistsCreateParams =
& Files
& Description
& {
public: boolean;
};
declare type GistsEditParams =
& Id
& Description
& Files
& {
content?: string;
filename?: string;
};
declare type GistsGetCommitsParams =
& Id
;
declare type GistsStarParams =
& Id
;
declare type GistsUnstarParams =
& Id
;
declare type GistsCheckStarParams =
& Id
;
declare type GistsForkParams =
& Id
;
declare type GistsGetForksParams =
& Id
& Page
& PerPage
;
declare type GistsDeleteParams =
& Id
;
declare type GistsGetCommentsParams =
& GistId
;
declare type GistsGetCommentParams =
& GistId
& Id
;
declare type GistsCreateCommentParams =
& GistId
& Body
;
declare type GistsEditCommentParams =
& GistId
& Id
& Body
;
declare type GistsDeleteCommentParams =
& GistId
& Id
;
declare type GitdataGetBlobParams =
& Owner
& Repo
& Sha
& Page
& PerPage
;
declare type GitdataCreateBlobParams =
& Owner
& Repo
& {
content: string;
encoding: string;
};
declare type GitdataGetCommitParams =
& Owner
& Repo
& Sha
;
declare type GitdataCreateCommitParams =
& Owner
& Repo
& {
message: string;
tree: string;
parents: string[];
author?: string;
committer?: string;
};
declare type GitdataGetCommitSignatureVerificationParams =
& Owner
& Repo
& Sha
;
declare type GitdataGetReferenceParams =
& Owner
& Repo
& Ref
;
declare type GitdataGetReferencesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type GitdataGetTagsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type GitdataCreateReferenceParams =
& Owner
& Repo
& Sha
& {
ref: string;
};
declare type GitdataUpdateReferenceParams =
& Owner
& Repo
& Ref
& Sha
& {
force?: boolean;
};
declare type GitdataDeleteReferenceParams =
& Owner
& Repo
& Ref
;
declare type GitdataGetTagParams =
& Owner
& Repo
& Sha
;
declare type GitdataCreateTagParams =
& Owner
& Repo
& {
tag: string;
message: string;
object: string;
type: string;
tagger: string;
};
declare type GitdataGetTagSignatureVerificationParams =
& Owner
& Repo
& Sha
;
declare type GitdataGetTreeParams =
& Owner
& Repo
& Sha
& {
recursive?: boolean;
};
declare type GitdataCreateTreeParams =
& Owner
& Repo
& {
tree: string;
base_tree?: string;
};
declare type IntegrationsGetInstallationsParams =
& Page
& PerPage
;
declare type IntegrationsCreateInstallationTokenParams =
& InstallationId
& {
user_id?: string;
};
declare type IntegrationsGetUserIdentityParams =
& {
nonce?: string;
};
declare type IntegrationsGetInstallationRepositoriesParams =
& {
user_id?: string;
};
declare type IntegrationsAddRepoToInstallationParams =
& InstallationId
& RepositoryId
;
declare type IntegrationsRemoveRepoFromInstallationParams =
& InstallationId
& RepositoryId
;
declare type IssuesGetAllParams =
& Direction
& Since
& Page
& PerPage
& {
filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed";
state?: "open"|"closed"|"all";
labels?: string;
sort?: "created"|"updated"|"comments";
};
declare type IssuesGetForUserParams =
& Direction
& Since
& Page
& PerPage
& {
filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed";
state?: "open"|"closed"|"all";
labels?: string;
sort?: "created"|"updated"|"comments";
};
declare type IssuesGetForOrgParams =
& Org
& Direction
& Since
& Page
& PerPage
& {
filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed";
state?: "open"|"closed"|"all";
labels?: string;
sort?: "created"|"updated"|"comments";
};
declare type IssuesGetForRepoParams =
& Owner
& Repo
& Direction
& Since
& Page
& PerPage
& {
milestone?: string;
state?: "open"|"closed"|"all";
assignee?: string;
creator?: string;
mentioned?: string;
labels?: string;
sort?: "created"|"updated"|"comments";
};
declare type IssuesGetParams =
& Owner
& Repo
& Number
;
declare type IssuesCreateParams =
& Owner
& Repo
& {
title: string;
body?: string[];
assignee?: string;
milestone?: number;
labels?: string;
assignees?: string[];
};
declare type IssuesEditParams =
& Owner
& Repo
& Number
& {
title?: string;
body?: string[];
assignee?: string;
state?: "open"|"closed";
milestone?: number;
labels?: string;
assignees?: string[];
};
declare type IssuesLockParams =
& Owner
& Repo
& Number
;
declare type IssuesUnlockParams =
& Owner
& Repo
& Number
;
declare type IssuesGetAssigneesParams =
& Owner
& Repo
;
declare type IssuesCheckAssigneeParams =
& Owner
& Repo
& {
assignee: string;
};
declare type IssuesAddAssigneesToIssueParams =
& Owner
& Repo
& Number
& {
assignees: string[];
};
declare type IssuesRemoveAssigneesFromIssueParams =
& Owner
& Repo
& Number
& {
body: string[];
};
declare type IssuesGetCommentsParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type IssuesGetCommentsForRepoParams =
& Owner
& Repo
& Direction
& Since
& Page
& PerPage
& {
sort?: "created"|"updated";
};
declare type IssuesGetCommentParams =
& Owner
& Repo
& Id
;
declare type IssuesCreateCommentParams =
& Owner
& Repo
& Number
& {
body: string[];
};
declare type IssuesEditCommentParams =
& Owner
& Repo
& Id
& {
body: string[];
};
declare type IssuesDeleteCommentParams =
& Owner
& Repo
& Id
;
declare type IssuesGetEventsParams =
& Owner
& Repo
& IssueNumber
& Page
& PerPage
;
declare type IssuesGetEventsForRepoParams =
& Owner
& Repo
& Page
& PerPage
;
declare type IssuesGetEventParams =
& Owner
& Repo
& Id
;
declare type IssuesGetLabelsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type IssuesGetLabelParams =
& Owner
& Repo
& Name
;
declare type IssuesCreateLabelParams =
& Owner
& Repo
& Name
& Color
;
declare type IssuesUpdateLabelParams =
& Owner
& Repo
& Color
& {
oldname: string;
name: string;
};
declare type IssuesDeleteLabelParams =
& Owner
& Repo
& Name
;
declare type IssuesGetIssueLabelsParams =
& Owner
& Repo
& Number
;
declare type IssuesAddLabelsParams =
& Owner
& Repo
& Number
& {
body: string[];
};
declare type IssuesRemoveLabelParams =
& Owner
& Repo
& Number
& {
name: string;
};
declare type IssuesReplaceAllLabelsParams =
& Owner
& Repo
& Number
& {
body: string[];
};
declare type IssuesRemoveAllLabelsParams =
& Owner
& Repo
& Number
;
declare type IssuesGetMilestoneLabelsParams =
& Owner
& Repo
& Number
;
declare type IssuesGetMilestonesParams =
& Owner
& Repo
& State
& Page
& PerPage
& {
sort?: "due_on"|"completeness";
direction?: "asc"|"desc";
};
declare type IssuesGetMilestoneParams =
& Owner
& Repo
& Number
;
declare type IssuesCreateMilestoneParams =
& Owner
& Repo
& State
& Description
& {
title: string;
due_on?: Date;
};
declare type IssuesUpdateMilestoneParams =
& Owner
& Repo
& Number
& State
& Description
& {
title: string;
due_on?: Date;
};
declare type IssuesDeleteMilestoneParams =
& Owner
& Repo
& Number
;
declare type IssuesGetEventsTimelineParams =
& Owner
& Repo
& IssueNumber
& Page
& PerPage
;
declare type MigrationsStartMigrationParams =
& Org
& {
repositories: string[];
lock_repositories?: boolean;
exclude_attachments?: boolean;
};
declare type MigrationsGetMigrationsParams =
& Org
& Page
& PerPage
;
declare type MigrationsGetMigrationStatusParams =
& Org
& Id
;
declare type MigrationsGetMigrationArchiveLinkParams =
& Org
& Id
;
declare type MigrationsDeleteMigrationArchiveParams =
& Org
& Id
;
declare type MigrationsUnlockRepoLockedForMigrationParams =
& Org
& Id
& {
repo_name: string;
};
declare type MigrationsStartImportParams =
& Owner
& Repo
& {
vcs_url: string;
vcs?: "subversion"|"git"|"mercurial"|"tfvc";
vcs_username?: string;
vcs_password?: string;
tfvc_project?: string;
};
declare type MigrationsGetImportProgressParams =
& Owner
& Repo
;
declare type MigrationsUpdateImportParams =
& Owner
& Repo
;
declare type MigrationsGetImportCommitAuthorsParams =
& Owner
& Repo
& {
since?: string;
};
declare type MigrationsMapImportCommitAuthorParams =
& Owner
& Repo
& {
author_id: string;
email?: string;
name?: string;
};
declare type MigrationsSetImportLfsPreferenceParams =
& Owner
& Name
& {
use_lfs: string;
};
declare type MigrationsGetLargeImportFilesParams =
& Owner
& Name
;
declare type MigrationsCancelImportParams =
& Owner
& Repo
;
declare type MiscGetGitignoreTemplateParams =
& {
name: string;
};
declare type MiscGetLicenseParams =
& {
license: string;
};
declare type MiscGetRepoLicenseParams =
& Owner
& Repo
;
declare type MiscRenderMarkdownParams =
& {
text: string;
mode?: "markdown"|"gfm";
context?: string;
};
declare type MiscRenderMarkdownRawParams =
& Data
;
declare type OrgsGetAllParams =
& Page
& PerPage
& {
since?: string;
};
declare type OrgsGetForUserParams =
& Username
& Page
& PerPage
;
declare type OrgsGetParams =
& Org
& Page
& PerPage
;
declare type OrgsUpdateParams =
& Org
& {
billing_email?: string;
company?: string;
email?: string;
location?: string;
name?: string;
description?: string;
default_repository_permission?: "read"|"write"|"admin"|"none";
members_can_create_repositories?: boolean;
};
declare type OrgsGetMembersParams =
& Org
& Page
& PerPage
& {
filter?: "all"|"2fa_disabled";
role?: "all"|"admin"|"member";
};
declare type OrgsCheckMembershipParams =
& Org
& Username
;
declare type OrgsRemoveMemberParams =
& Org
& Username
;
declare type OrgsGetPublicMembersParams =
& Org
;
declare type OrgsCheckPublicMembershipParams =
& Org
& Username
;
declare type OrgsPublicizeMembershipParams =
& Org
& Username
;
declare type OrgsConcealMembershipParams =
& Org
& Username
;
declare type OrgsGetOrgMembershipParams =
& Org
& Username
;
declare type OrgsAddOrgMembershipParams =
& Org
& Username
& {
role: "admin"|"member";
};
declare type OrgsRemoveOrgMembershipParams =
& Org
& Username
;
declare type OrgsGetPendingOrgInvitesParams =
& Org
;
declare type OrgsGetOutsideCollaboratorsParams =
& Org
& Page
& PerPage
;
declare type OrgsRemoveOutsideCollaboratorParams =
& Org
& Username
;
declare type OrgsConvertMemberToOutsideCollaboratorParams =
& Org
& Username
;
declare type OrgsGetTeamsParams =
& Org
& Page
& PerPage
;
declare type OrgsGetTeamParams =
& Id
;
declare type OrgsCreateTeamParams =
& Org
& Name
& Privacy
& {
description?: string;
maintainers?: string[];
repo_names?: string[];
};
declare type OrgsEditTeamParams =
& Id
& Name
& Privacy
& {
description?: string;
};
declare type OrgsDeleteTeamParams =
& Id
;
declare type OrgsGetTeamMembersParams =
& Id
& Page
& PerPage
& {
role?: "member"|"maintainer"|"all";
};
declare type OrgsGetTeamMembershipParams =
& Id
& Username
;
declare type OrgsAddTeamMembershipParams =
& Id
& Username
& {
role?: "member"|"maintainer";
};
declare type OrgsRemoveTeamMembershipParams =
& Id
& Username
;
declare type OrgsGetTeamReposParams =
& Id
& Page
& PerPage
;
declare type OrgsGetPendingTeamInvitesParams =
& Id
& Page
& PerPage
;
declare type OrgsCheckTeamRepoParams =
& Id
& Owner
& Repo
;
declare type OrgsAddTeamRepoParams =
& Id
& Org
& Repo
& {
permission?: "pull"|"push"|"admin";
};
declare type OrgsDeleteTeamRepoParams =
& Id
& Owner
& Repo
;
declare type OrgsGetHooksParams =
& Org
& Page
& PerPage
;
declare type OrgsGetHookParams =
& Org
& Id
;
declare type OrgsCreateHookParams =
& Org
& {
name: string;
config: string;
events?: string[];
active?: boolean;
};
declare type OrgsEditHookParams =
& Org
& Id
& {
config: string;
events?: string[];
active?: boolean;
};
declare type OrgsPingHookParams =
& Org
& Id
;
declare type OrgsDeleteHookParams =
& Org
& Id
;
declare type ProjectsGetRepoProjectsParams =
& Owner
& Repo
;
declare type ProjectsGetOrgProjectsParams =
& Org
;
declare type ProjectsGetProjectParams =
& Id
;
declare type ProjectsCreateRepoProjectParams =
& Owner
& Repo
& Name
& Body
;
declare type ProjectsCreateOrgProjectParams =
& Org
& Name
& Body
;
declare type ProjectsUpdateProjectParams =
& Id
& Name
& Body
;
declare type ProjectsDeleteProjectParams =
& Id
;
declare type ProjectsGetProjectCardsParams =
& ColumnId
;
declare type ProjectsGetProjectCardParams =
& Id
;
declare type ProjectsCreateProjectCardParams =
& ColumnId
& {
note?: string;
content_id?: string;
content_type?: string;
};
declare type ProjectsUpdateProjectCardParams =
& Id
& {
note?: string;
};
declare type ProjectsDeleteProjectCardParams =
& Id
;
declare type ProjectsMoveProjectCardParams =
& Id
& {
position: string;
column_id?: string;
};
declare type ProjectsGetProjectColumnsParams =
& ProjectId
;
declare type ProjectsGetProjectColumnParams =
& Id
;
declare type ProjectsCreateProjectColumnParams =
& ProjectId
& Name
;
declare type ProjectsUpdateProjectColumnParams =
& Id
& Name
;
declare type ProjectsDeleteProjectColumnParams =
& Id
;
declare type ProjectsMoveProjectColumnParams =
& Id
& {
position: string;
};
declare type PullRequestsGetAllParams =
& Owner
& Repo
& Direction
& Page
& PerPage
& {
state?: "open"|"closed"|"all";
head?: string;
base?: string;
sort?: "created"|"updated"|"popularity"|"long-running";
};
declare type PullRequestsGetParams =
& Owner
& Repo
& Number
;
declare type PullRequestsCreateParams =
& Owner
& Repo
& Head
& Base
& {
title: string;
body?: string[];
};
declare type PullRequestsCreateFromIssueParams =
& Owner
& Repo
& Head
& Base
& {
issue: number;
};
declare type PullRequestsUpdateParams =
& Owner
& Repo
& Number
& State
& {
title?: string;
body?: string[];
base?: string;
};
declare type PullRequestsGetCommitsParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsGetFilesParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsCheckMergedParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsMergeParams =
& Owner
& Repo
& Number
& {
commit_title?: string;
commit_message?: string;
sha?: string;
merge_method?: "merge"|"squash"|"rebase";
};
declare type PullRequestsGetReviewsParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsGetReviewParams =
& Owner
& Repo
& Number
& Id
;
declare type PullRequestsGetReviewCommentsParams =
& Owner
& Repo
& Number
& Id
& Page
& PerPage
;
declare type PullRequestsCreateReviewParams =
& Owner
& Repo
& Number
& {
body?: string[];
event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING";
comments?: string[];
path?: string;
position?: number;
};
declare type PullRequestsSubmitReviewParams =
& Owner
& Repo
& Number
& Id
& {
body?: string[];
event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING";
};
declare type PullRequestsDismissReviewParams =
& Owner
& Repo
& Number
& Id
& Page
& PerPage
& {
message?: string;
};
declare type PullRequestsGetCommentsParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsGetCommentsForRepoParams =
& Owner
& Repo
& Direction
& Since
& Page
& PerPage
& {
sort?: "created"|"updated";
};
declare type PullRequestsGetCommentParams =
& Owner
& Repo
& Id
;
declare type PullRequestsCreateCommentParams =
& Owner
& Repo
& Number
& Body
& CommitId
& Path
& Position
;
declare type PullRequestsCreateCommentReplyParams =
& Owner
& Repo
& Number
& Body
& {
in_reply_to: number;
};
declare type PullRequestsEditCommentParams =
& Owner
& Repo
& Id
& Body
;
declare type PullRequestsDeleteCommentParams =
& Owner
& Repo
& Id
;
declare type PullRequestsGetReviewRequestsParams =
& Owner
& Repo
& Number
& Page
& PerPage
;
declare type PullRequestsCreateReviewRequestParams =
& Owner
& Repo
& Number
& {
reviewers?: string[];
};
declare type PullRequestsDeleteReviewRequestParams =
& Owner
& Repo
& Number
& {
reviewers?: string[];
};
declare type ReactionsGetForCommitCommentParams =
& Owner
& Repo
& Id
& {
content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsCreateForCommitCommentParams =
& Owner
& Repo
& Id
& {
content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsGetForIssueParams =
& Owner
& Repo
& Number
& {
content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsCreateForIssueParams =
& Owner
& Repo
& Number
& {
content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsGetForIssueCommentParams =
& Owner
& Repo
& Id
& {
content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsCreateForIssueCommentParams =
& Owner
& Repo
& Id
& {
content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsGetForPullRequestReviewCommentParams =
& Owner
& Repo
& Id
& {
content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsCreateForPullRequestReviewCommentParams =
& Owner
& Repo
& Id
& {
content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray";
};
declare type ReactionsDeleteParams =
& Id
;
declare type ReposGetAllParams =
& Direction
& Page
& PerPage
& {
visibility?: "all"|"public"|"private";
affiliation?: string;
type?: "all"|"owner"|"public"|"private"|"member";
sort?: "created"|"updated"|"pushed"|"full_name";
};
declare type ReposGetForUserParams =
& Username
& Direction
& Page
& PerPage
& {
type?: "all"|"owner"|"member";
sort?: "created"|"updated"|"pushed"|"full_name";
};
declare type ReposGetForOrgParams =
& Org
& Page
& PerPage
& {
type?: "all"|"public"|"private"|"forks"|"sources"|"member";
};
declare type ReposGetPublicParams =
& {
since?: string;
};
declare type ReposGetByIdParams =
& Id
;
declare type ReposCreateParams =
& Name
& Description
& Homepage
& Private
& HasIssues
& HasWiki
& HasDownloads
& AutoInit
& GitignoreTemplate
& LicenseTemplate
& {
team_id?: number;
allow_squash_merge?: boolean;
allow_merge_commit?: boolean;
allow_rebase_merge?: boolean;
};
declare type ReposGetParams =
& Owner
& Repo
;
declare type ReposCreateForOrgParams =
& Org
& Name
& Description
& Homepage
& Private
& HasIssues
& HasWiki
& HasDownloads
& AutoInit
& GitignoreTemplate
& LicenseTemplate
& {
team_id?: number;
allow_squash_merge?: boolean;
allow_merge_commit?: boolean;
allow_rebase_merge?: boolean;
};
declare type ReposEditParams =
& Owner
& Repo
& Name
& Description
& Homepage
& Private
& HasIssues
& HasWiki
& HasDownloads
& DefaultBranch
& {
allow_squash_merge?: boolean;
allow_merge_commit?: boolean;
allow_rebase_merge?: boolean;
};
declare type ReposGetContributorsParams =
& Owner
& Repo
& Page
& PerPage
& {
anon?: boolean;
};
declare type ReposGetLanguagesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetTeamsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetTagsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposDeleteParams =
& Owner
& Repo
;
declare type ReposGetBranchesParams =
& Owner
& Repo
& Page
& PerPage
& {
protected?: boolean;
};
declare type ReposGetBranchParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposGetBranchProtectionParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposUpdateBranchProtectionParams =
& Owner
& Repo
& Branch
& Page
& PerPage
& {
required_status_checks: string;
required_pull_request_reviews: string;
restrictions: string;
};
declare type ReposRemoveBranchProtectionParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposGetProtectedBranchRequiredStatusChecksParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposUpdateProtectedBranchRequiredStatusChecksParams =
& Owner
& Repo
& Branch
& Page
& PerPage
& {
include_admins?: boolean;
strict?: boolean;
contexts?: string[];
};
declare type ReposRemoveProtectedBranchRequiredStatusChecksParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposGetProtectedBranchRequiredStatusChecksContextsParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposReplaceProtectedBranchRequiredStatusChecksContextsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposAddProtectedBranchRequiredStatusChecksContextsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposRemoveProtectedBranchRequiredStatusChecksContextsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposGetProtectedBranchPullRequestReviewEnforcementParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposUpdateProtectedBranchPullRequestReviewEnforcementParams =
& Owner
& Repo
& Branch
& {
include_admins?: boolean;
};
declare type ReposRemoveProtectedBranchPullRequestReviewEnforcementParams =
& Owner
& Repo
& Branch
;
declare type ReposGetProtectedBranchRestrictionsParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposRemoveProtectedBranchRestrictionsParams =
& Owner
& Repo
& Branch
;
declare type ReposGetProtectedBranchTeamRestrictionsParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposReplaceProtectedBranchTeamRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposAddProtectedBranchTeamRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposRemoveProtectedBranchTeamRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposGetProtectedBranchUserRestrictionsParams =
& Owner
& Repo
& Branch
& Page
& PerPage
;
declare type ReposReplaceProtectedBranchUserRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposAddProtectedBranchUserRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposRemoveProtectedBranchUserRestrictionsParams =
& Owner
& Repo
& Branch
& {
body: string[];
};
declare type ReposGetCollaboratorsParams =
& Owner
& Repo
& Page
& PerPage
& {
affiliation?: "outside"|"all";
};
declare type ReposCheckCollaboratorParams =
& Owner
& Repo
& Username
;
declare type ReposReviewUserPermissionLevelParams =
& Owner
& Repo
& Username
;
declare type ReposAddCollaboratorParams =
& Owner
& Repo
& Username
& {
permission?: "pull"|"push"|"admin";
};
declare type ReposRemoveCollaboratorParams =
& Owner
& Repo
& Username
;
declare type ReposGetAllCommitCommentsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetCommitCommentsParams =
& Owner
& Repo
& Page
& PerPage
& {
ref: string;
};
declare type ReposCreateCommitCommentParams =
& Owner
& Repo
& Sha
& Body
& {
path?: string;
position?: number;
line?: number;
};
declare type ReposGetCommitCommentParams =
& Owner
& Repo
& Id
;
declare type ReposUpdateCommitCommentParams =
& Owner
& Repo
& Id
& Body
;
declare type ReposDeleteCommitCommentParams =
& Owner
& Repo
& Id
;
declare type ReposGetCommitsParams =
& Owner
& Repo
& Since
& Until
& Page
& PerPage
& {
sha?: string;
path?: string;
author?: string;
};
declare type ReposGetCommitParams =
& Owner
& Repo
& Sha
;
declare type ReposGetShaOfCommitRefParams =
& Owner
& Repo
& Ref
;
declare type ReposCompareCommitsParams =
& Owner
& Repo
& Base
& Head
;
declare type ReposGetReadmeParams =
& Owner
& Repo
& {
ref?: string;
};
declare type ReposGetContentParams =
& Owner
& Repo
& {
path: string;
ref?: string;
};
declare type ReposCreateFileParams =
& Owner
& Repo
& {
path: string;
message: string;
content: string;
branch?: string;
committer?: string;
};
declare type ReposUpdateFileParams =
& Owner
& Repo
& {
path: string;
message: string;
content: string;
sha: string;
branch?: string;
committer?: string;
};
declare type ReposDeleteFileParams =
& Owner
& Repo
& {
path: string;
message: string;
sha: string;
branch?: string;
committer?: string;
};
declare type ReposGetArchiveLinkParams =
& Owner
& Repo
& {
archive_format: "tarball"|"zipball";
ref?: string;
};
declare type ReposGetKeysParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetKeyParams =
& Owner
& Repo
& Id
;
declare type ReposCreateKeyParams =
& Owner
& Repo
& Title
& Key
& {
read_only?: boolean;
};
declare type ReposDeleteKeyParams =
& Owner
& Repo
& Id
;
declare type ReposGetDeploymentsParams =
& Owner
& Repo
& Page
& PerPage
& {
sha?: string;
ref?: string;
task?: string;
environment?: string;
};
declare type ReposCreateDeploymentParams =
& Owner
& Repo
& {
ref: string;
task?: string;
auto_merge?: boolean;
required_contexts?: string[];
payload?: string;
environment?: string;
description?: string;
transient_environment?: boolean;
production_environment?: boolean;
};
declare type ReposGetDeploymentStatusesParams =
& Owner
& Repo
& Id
;
declare type ReposCreateDeploymentStatusParams =
& Owner
& Repo
& Id
& {
state?: string;
target_url?: string;
log_url?: string;
description?: string;
environment_url?: string;
auto_inactive?: boolean;
};
declare type ReposGetDownloadsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetDownloadParams =
& Owner
& Repo
& Id
;
declare type ReposDeleteDownloadParams =
& Owner
& Repo
& Id
;
declare type ReposGetForksParams =
& Owner
& Repo
& Page
& PerPage
& {
sort?: "newest"|"oldest"|"stargazers";
};
declare type ReposForkParams =
& Owner
& Repo
& {
organization?: string;
};
declare type ReposGetInvitesParams =
& RepoId
;
declare type ReposDeleteInviteParams =
& RepoId
& InvitationId
;
declare type ReposUpdateInviteParams =
& RepoId
& InvitationId
& {
permission?: "read"|"write"|"admin";
};
declare type ReposMergeParams =
& Owner
& Repo
& Base
& Head
& {
commit_message?: string;
};
declare type ReposGetPagesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposRequestPageBuildParams =
& Owner
& Repo
;
declare type ReposGetPagesBuildsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetLatestPagesBuildParams =
& Owner
& Repo
;
declare type ReposGetPagesBuildParams =
& Owner
& Repo
& Id
;
declare type ReposGetReleasesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetReleaseParams =
& Owner
& Repo
& Id
;
declare type ReposGetLatestReleaseParams =
& Owner
& Repo
;
declare type ReposGetReleaseByTagParams =
& Owner
& Repo
& {
tag: string;
};
declare type ReposCreateReleaseParams =
& Owner
& Repo
& {
tag_name: string;
target_commitish?: string;
name?: string;
body?: string[];
draft?: boolean;
prerelease?: boolean;
};
declare type ReposEditReleaseParams =
& Owner
& Repo
& Id
& {
tag_name: string;
target_commitish?: string;
name?: string;
body?: string[];
draft?: boolean;
prerelease?: boolean;
};
declare type ReposDeleteReleaseParams =
& Owner
& Repo
& Id
;
declare type ReposGetAssetsParams =
& Owner
& Repo
& Id
;
declare type ReposGetAssetParams =
& Owner
& Repo
& Id
;
declare type ReposUploadAssetParams =
& Owner
& Repo
& Id
& {
filePath: string;
name: string;
label?: string;
};
declare type ReposEditAssetParams =
& Owner
& Repo
& Id
& Name
& {
label?: string;
};
declare type ReposDeleteAssetParams =
& Owner
& Repo
& Id
;
declare type ReposGetStatsContributorsParams =
& Owner
& Repo
;
declare type ReposGetStatsCommitActivityParams =
& Owner
& Repo
;
declare type ReposGetStatsCodeFrequencyParams =
& Owner
& Repo
;
declare type ReposGetStatsParticipationParams =
& Owner
& Repo
;
declare type ReposGetStatsPunchCardParams =
& Owner
& Repo
;
declare type ReposCreateStatusParams =
& Owner
& Repo
& Sha
& {
state: "pending"|"success"|"error"|"failure";
target_url?: string;
description?: string;
context?: string;
};
declare type ReposGetStatusesParams =
& Owner
& Repo
& Page
& PerPage
& {
ref: string;
};
declare type ReposGetCombinedStatusParams =
& Owner
& Repo
& Page
& PerPage
& {
ref: string;
};
declare type ReposGetReferrersParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetPathsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetViewsParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetClonesParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetHooksParams =
& Owner
& Repo
& Page
& PerPage
;
declare type ReposGetHookParams =
& Owner
& Repo
& Id
;
declare type ReposCreateHookParams =
& Owner
& Repo
& Name
& {
config: string;
events?: string[];
active?: boolean;
};
declare type ReposEditHookParams =
& Owner
& Repo
& Id
& Name
& {
config: string;
events?: string[];
add_events?: string[];
remove_events?: string[];
active?: boolean;
};
declare type ReposTestHookParams =
& Owner
& Repo
& Id
;
declare type ReposPingHookParams =
& Owner
& Repo
& Id
;
declare type ReposDeleteHookParams =
& Owner
& Repo
& Id
;
declare type SearchReposParams =
& Q
& Order
& Page
& PerPage
& {
sort?: "stars"|"forks"|"updated";
};
declare type SearchCodeParams =
& Q
& Order
& Page
& PerPage
& {
sort?: "indexed";
};
declare type SearchCommitsParams =
& Q
& Order
& Page
& PerPage
& {
sort?: "author-date"|"committer-date";
};
declare type SearchIssuesParams =
& Q
& Order
& Page
& PerPage
& {
sort?: "comments"|"created"|"updated";
};
declare type SearchUsersParams =
& Q
& Order
& Page
& PerPage
& {
sort?: "followers"|"repositories"|"joined";
};
declare type SearchEmailParams =
& {
email: string;
};
declare type UsersGetForUserParams =
& Username
;
declare type UsersGetByIdParams =
& Id
;
declare type UsersUpdateParams =
& {
name?: string;
email?: string;
blog?: string;
company?: string;
location?: string;
hireable?: boolean;
bio?: string;
};
declare type UsersGetAllParams =
& {
since?: number;
};
declare type UsersGetOrgsParams =
& Page
& PerPage
;
declare type UsersGetOrgMembershipsParams =
& {
state?: "active"|"pending";
};
declare type UsersGetOrgMembershipParams =
& Org
;
declare type UsersEditOrgMembershipParams =
& Org
& {
state: "active";
};
declare type UsersGetTeamsParams =
& Page
& PerPage
;
declare type UsersGetEmailsParams =
& Page
& PerPage
;
declare type UsersAddEmailsParams =
& {
body: string[];
};
declare type UsersDeleteEmailsParams =
& {
body: string[];
};
declare type UsersGetFollowersForUserParams =
& Username
& Page
& PerPage
;
declare type UsersGetFollowersParams =
& Page
& PerPage
;
declare type UsersGetFollowingForUserParams =
& Username
& Page
& PerPage
;
declare type UsersGetFollowingParams =
& Page
& PerPage
;
declare type UsersCheckFollowingParams =
& Username
;
declare type UsersCheckIfOneFollowersOtherParams =
& Username
& {
target_user: string;
};
declare type UsersFollowUserParams =
& Username
;
declare type UsersUnfollowUserParams =
& Username
;
declare type UsersGetKeysForUserParams =
& Username
& Page
& PerPage
;
declare type UsersGetKeysParams =
& Page
& PerPage
;
declare type UsersGetKeyParams =
& Id
;
declare type UsersCreateKeyParams =
& Title
& Key
;
declare type UsersDeleteKeyParams =
& Id
;
declare type UsersGetGpgKeysParams =
& Page
& PerPage
;
declare type UsersGetGpgKeyParams =
& Id
;
declare type UsersCreateGpgKeyParams =
& {
armored_public_key: string;
};
declare type UsersDeleteGpgKeyParams =
& Id
;
declare type UsersPromoteParams =
& Username
;
declare type UsersDemoteParams =
& Username
;
declare type UsersSuspendParams =
& Username
;
declare type UsersUnsuspendParams =
& Username
;
declare type UsersAcceptRepoInviteParams =
& InvitationId
;
declare type UsersDeclineRepoInviteParams =
& InvitationId
;
declare type EnterpriseStatsParams =
& {
type: "issues"|"hooks"|"milestones"|"orgs"|"comments"|"pages"|"users"|"gists"|"pulls"|"repos"|"all";
};
declare type EnterpriseUpdateLdapForUserParams =
& Username
& {
ldap_dn: string;
};
declare type EnterpriseSyncLdapForUserParams =
& Username
;
declare type EnterpriseUpdateLdapForTeamParams =
& {
team_id: number;
ldap_dn: string;
};
declare type EnterpriseSyncLdapForTeamParams =
& {
team_id: number;
};
declare type EnterpriseGetPreReceiveEnvironmentParams =
& Id
;
declare type EnterpriseCreatePreReceiveEnvironmentParams =
& {
name: string;
image_url: string;
};
declare type EnterpriseEditPreReceiveEnvironmentParams =
& Id
& {
name: string;
image_url: string;
};
declare type EnterpriseDeletePreReceiveEnvironmentParams =
& Id
;
declare type EnterpriseGetPreReceiveEnvironmentDownloadStatusParams =
& Id
;
declare type EnterpriseTriggerPreReceiveEnvironmentDownloadParams =
& Id
;
declare type EnterpriseGetPreReceiveHookParams =
& Id
;
declare type EnterpriseCreatePreReceiveHookParams =
& {
name: string;
script: string;
script_repository: string;
environment: string;
enforcement?: string;
allow_downstream_configuration?: boolean;
};
declare type EnterpriseEditPreReceiveHookParams =
& Id
& {
body: string[];
};
declare type EnterpriseDeletePreReceiveHookParams =
& Id
;
declare type EnterpriseQueueIndexingJobParams =
& {
target: string;
};
declare type EnterpriseCreateOrgParams =
& {
login: string;
admin: string;
profile_name?: string;
};
declare class Github {
constructor(options?: Options): Github;
authenticate(auth: Auth): void;
hasNextPage(link: Link): ?string;
hasPreviousPage(link: Link): ?string;
hasLastPage(link: Link): ?string;
hasFirstPage(link: Link): ?string;
getNextPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise<any>;
getPreviousPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise<any>;
getLastPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise<any>;
getFirstPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise<any>;
authorization: {
getGrants(params: AuthorizationGetGrantsParams, callback?: Callback): Promise<any>;
getGrant(params: AuthorizationGetGrantParams, callback?: Callback): Promise<any>;
deleteGrant(params: AuthorizationDeleteGrantParams, callback?: Callback): Promise<any>;
getAll(p