UNPKG

github

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