AnyMux

GitHub API reference

Exports of @anymux/github. Back to the module

Classes

GitHubFileSystem

class
class GitHubFileSystem

constructor

constructor
constructor(config: GitHubConfig): GitHubFileSystem

readFile

method
readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

writeFile

method
writeFile(path: string, data: Buffer | string | Uint8Array, _options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

appendFile

method
appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

copyFile

method
copyFile(src: string, dest: string, _mode?: number): Promise<void>

mkdir

method
mkdir(path: string, _options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>

readdir

method
readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>

readdir

method
readdir(path: string, options?: any): Promise<string[] | Dirent[]>

rmdir

method
rmdir(path: string, _options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

stat

method
stat(path: string, options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(path: string, options: { bigint: true; }): Promise<BigIntStats>

stat

method
stat(path: string, _options?: any): Promise<Stats | BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: false; }): Promise<Stats>

lstat

method
lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>

lstat

method
lstat(path: string, options?: any): Promise<Stats | BigIntStats>

access

method
access(path: string, _mode?: number): Promise<void>

rename

method
rename(oldPath: string, newPath: string): Promise<void>

unlink

method
unlink(path: string): Promise<void>

exists

method
exists(path: string): Promise<boolean>

truncate

method
truncate(_path: string, _len?: number): Promise<void>

utimes

method
utimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>

chmod

method
chmod(_path: string, _mode: string | number): Promise<void>

chown

method
chown(_path: string, _uid: number, _gid: number): Promise<void>

readlink

method
readlink(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

symlink

method
symlink(_target: string, _path: string, _type?: "dir" | "file" | "junction"): Promise<void>

link

method
link(_existingPath: string, _newPath: string): Promise<void>

createReadStream

method
createReadStream(_path: string, _options?: any): ReadStream

createWriteStream

method
createWriteStream(_path: string, _options?: any): WriteStream

watch

method
watch(_path: string, _options?: any): FSWatcher

rm

method
rm(_path: string, _options?: any): Promise<void>

open

method
open(_path: string, _flags?: string | number, _mode?: number): Promise<IFileHandle>

opendir

method
opendir(_path: string, _options?: any): Promise<IDir>

realpath

method
realpath(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

cp

method
cp(_src: string, _dest: string, _options?: any): Promise<void>

mkdtemp

method
mkdtemp(_prefix: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

statfs

method
statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>

statfs

method
statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>

statfs

method
statfs(_path: string, _options?: any): Promise<StatFs | BigIntStatFs>

lutimes

method
lutimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>

lchown

method
lchown(_path: string, _uid: number, _gid: number): Promise<void>

lchmod

method
lchmod(_path: string, _mode: string | number): Promise<void>

isImplemented

method
isImplemented(method: string): boolean

GitHubGitRepo

class
class GitHubGitRepo

constructor

constructor
constructor(config: GitHubConfig): GitHubGitRepo

listBranches

method
listBranches(): Promise<GitBranch[]>

getBranch

method
getBranch(name: string): Promise<GitBranch>

createBranch

method
createBranch(name: string, sha: string): Promise<GitBranch>

deleteBranch

method
deleteBranch(name: string): Promise<void>

listCommits

method
listCommits(options?: ListCommitsOptions): Promise<GitCommit[]>

getCommit

method
getCommit(sha: string): Promise<GitCommit>

listTags

method
listTags(): Promise<GitTag[]>

createTag

method
createTag(name: string, sha: string, message?: string): Promise<GitTag>

deleteTag

method
deleteTag(name: string): Promise<void>

diff

method
diff(base: string, head: string): Promise<GitDiffEntry[]>

resolveRef

method
resolveRef(ref: string): Promise<string>

GitHubGitHost

class
class GitHubGitHost

constructor

constructor
constructor(config: GitHubConfig): GitHubGitHost

listPullRequests

method
listPullRequests(options?: ListPullRequestsOptions): Promise<PullRequest[]>

getPullRequest

method
getPullRequest(number: number): Promise<PullRequest>

createPullRequest

method
createPullRequest(options: CreatePullRequestOptions): Promise<PullRequest>

updatePullRequest

method
updatePullRequest(number: number, updates: Partial<Pick<PullRequest, "title" | "body" | "state" | "labels">>): Promise<PullRequest>

mergePullRequest

method
mergePullRequest(number: number, options?: { method?: "merge" | "squash" | "rebase"; commitMessage?: string; }): Promise<void>

listIssues

method
listIssues(options?: ListIssuesOptions): Promise<Issue[]>

getIssue

method
getIssue(number: number): Promise<Issue>

createIssue

method
createIssue(options: CreateIssueOptions): Promise<Issue>

updateIssue

method
updateIssue(number: number, updates: Partial<Pick<Issue, "title" | "body" | "state" | "labels" | "assignees">>): Promise<Issue>

listReviews

method
listReviews(pullRequestNumber: number): Promise<Review[]>

createReview

method
createReview(pullRequestNumber: number, review: { body: string; event: "approve" | "request_changes" | "comment"; }): Promise<Review>

listReleases

method
listReleases(): Promise<Release[]>

createRelease

method
createRelease(options: { tagName: string; name: string; body: string; draft?: boolean; prerelease?: boolean; }): Promise<Release>

listPipelineRuns

method
listPipelineRuns(options?: { branch?: string; status?: string; }): Promise<PipelineRun[]>

getPipelineRun

method
getPipelineRun(id: number): Promise<PipelineRun>

GitHubProvider

class
class GitHubProvider

id

property
id: string

name

property
name: "GitHub"

capabilities

property
capabilities: readonly CapabilityType[]

constructor

constructor
constructor(config: GitHubConfig): GitHubProvider

getCapability

method
<T>(type: CapabilityType): T | undefined

hasCapability

method
hasCapability(type: CapabilityType): boolean

Types

GitHubConfig

type
type GitHubConfig = { token?: string; owner?: string; repo?: string; branch?: string; baseUrl?: string; }

Constants

GitHubConfigSchema

const
const 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; }>