GitHub API reference
Exports of @anymux/github. Back to the module
Classes
GitHubFileSystem
classclass GitHubFileSystem
constructor
constructorconstructor(config: GitHubConfig): GitHubFileSystem
readFile
methodreadFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>writeFile
methodwriteFile(path: string, data: Buffer | string | Uint8Array, _options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>appendFile
methodappendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>copyFile
methodcopyFile(src: string, dest: string, _mode?: number): Promise<void>
mkdir
methodmkdir(path: string, _options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>readdir
methodreaddir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>readdir
methodreaddir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>readdir
methodreaddir(path: string, options?: any): Promise<string[] | Dirent[]>
rmdir
methodrmdir(path: string, _options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>stat
methodstat(path: string, options?: { bigint?: false; }): Promise<Stats>stat
methodstat(path: string, options: { bigint: true; }): Promise<BigIntStats>stat
methodstat(path: string, _options?: any): Promise<Stats | BigIntStats>
lstat
methodlstat(path: string, options?: { bigint?: false; }): Promise<Stats>lstat
methodlstat(path: string, options: { bigint: true; }): Promise<BigIntStats>lstat
methodlstat(path: string, options?: any): Promise<Stats | BigIntStats>
access
methodaccess(path: string, _mode?: number): Promise<void>
rename
methodrename(oldPath: string, newPath: string): Promise<void>
unlink
methodunlink(path: string): Promise<void>
exists
methodexists(path: string): Promise<boolean>
truncate
methodtruncate(_path: string, _len?: number): Promise<void>
utimes
methodutimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>
chmod
methodchmod(_path: string, _mode: string | number): Promise<void>
chown
methodchown(_path: string, _uid: number, _gid: number): Promise<void>
readlink
methodreadlink(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>symlink
methodsymlink(_target: string, _path: string, _type?: "dir" | "file" | "junction"): Promise<void>
link
methodlink(_existingPath: string, _newPath: string): Promise<void>
createReadStream
methodcreateReadStream(_path: string, _options?: any): ReadStream
createWriteStream
methodcreateWriteStream(_path: string, _options?: any): WriteStream
watch
methodwatch(_path: string, _options?: any): FSWatcher
rm
methodrm(_path: string, _options?: any): Promise<void>
open
methodopen(_path: string, _flags?: string | number, _mode?: number): Promise<IFileHandle>
opendir
methodopendir(_path: string, _options?: any): Promise<IDir>
realpath
methodrealpath(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>cp
methodcp(_src: string, _dest: string, _options?: any): Promise<void>
mkdtemp
methodmkdtemp(_prefix: string, _options?: { encoding?: BufferEncoding; }): Promise<string>statfs
methodstatfs(path: string, options?: { bigint?: false; }): Promise<StatFs>statfs
methodstatfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>statfs
methodstatfs(_path: string, _options?: any): Promise<StatFs | BigIntStatFs>
lutimes
methodlutimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>
lchown
methodlchown(_path: string, _uid: number, _gid: number): Promise<void>
lchmod
methodlchmod(_path: string, _mode: string | number): Promise<void>
isImplemented
methodisImplemented(method: string): boolean
GitHubGitRepo
classclass GitHubGitRepo
constructor
constructorconstructor(config: GitHubConfig): GitHubGitRepo
listBranches
methodlistBranches(): Promise<GitBranch[]>
getBranch
methodgetBranch(name: string): Promise<GitBranch>
createBranch
methodcreateBranch(name: string, sha: string): Promise<GitBranch>
deleteBranch
methoddeleteBranch(name: string): Promise<void>
listCommits
methodlistCommits(options?: ListCommitsOptions): Promise<GitCommit[]>
getCommit
methodgetCommit(sha: string): Promise<GitCommit>
listTags
methodlistTags(): Promise<GitTag[]>
createTag
methodcreateTag(name: string, sha: string, message?: string): Promise<GitTag>
deleteTag
methoddeleteTag(name: string): Promise<void>
diff
methoddiff(base: string, head: string): Promise<GitDiffEntry[]>
resolveRef
methodresolveRef(ref: string): Promise<string>
GitHubGitHost
classclass GitHubGitHost
constructor
constructorconstructor(config: GitHubConfig): GitHubGitHost
listPullRequests
methodlistPullRequests(options?: ListPullRequestsOptions): Promise<PullRequest[]>
getPullRequest
methodgetPullRequest(number: number): Promise<PullRequest>
createPullRequest
methodcreatePullRequest(options: CreatePullRequestOptions): Promise<PullRequest>
updatePullRequest
methodupdatePullRequest(number: number, updates: Partial<Pick<PullRequest, "title" | "body" | "state" | "labels">>): Promise<PullRequest>
mergePullRequest
methodmergePullRequest(number: number, options?: { method?: "merge" | "squash" | "rebase"; commitMessage?: string; }): Promise<void>listIssues
methodlistIssues(options?: ListIssuesOptions): Promise<Issue[]>
getIssue
methodgetIssue(number: number): Promise<Issue>
createIssue
methodcreateIssue(options: CreateIssueOptions): Promise<Issue>
updateIssue
methodupdateIssue(number: number, updates: Partial<Pick<Issue, "title" | "body" | "state" | "labels" | "assignees">>): Promise<Issue>
listReviews
methodlistReviews(pullRequestNumber: number): Promise<Review[]>
createReview
methodcreateReview(pullRequestNumber: number, review: { body: string; event: "approve" | "request_changes" | "comment"; }): Promise<Review>listReleases
methodlistReleases(): Promise<Release[]>
createRelease
methodcreateRelease(options: { tagName: string; name: string; body: string; draft?: boolean; prerelease?: boolean; }): Promise<Release>listPipelineRuns
methodlistPipelineRuns(options?: { branch?: string; status?: string; }): Promise<PipelineRun[]>getPipelineRun
methodgetPipelineRun(id: number): Promise<PipelineRun>
GitHubProvider
classclass GitHubProvider
id
propertyid: string
name
propertyname: "GitHub"
capabilities
propertycapabilities: readonly CapabilityType[]
constructor
constructorconstructor(config: GitHubConfig): GitHubProvider
getCapability
method<T>(type: CapabilityType): T | undefined
hasCapability
methodhasCapability(type: CapabilityType): boolean
Types
GitHubConfig
typetype GitHubConfig = { token?: string; owner?: string; repo?: string; branch?: string; baseUrl?: string; }Constants
GitHubConfigSchema
constconst GitHubConfigSchema: z.ZodObject<{ token: z.ZodString; owner: z.ZodString; repo: z.ZodString; branch: z.ZodDefault<z.ZodString>; baseUrl: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { token?: string; owner?: string; repo?: string; branch?: string; baseUrl?: string; }, { token?: string; owner?: string; repo?: string; branch?: string; baseUrl?: string; }>