@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
334 lines (333 loc) • 11.4 kB
TypeScript
import GitCreateBlobResponse from "./GitCreateBlobResponse";
import DifferenceSet from "../storage/DifferenceSet";
export default class GitHubManager {
private _octokit;
private _isUserStateLoaded;
private _reposResponse?;
private _userResponse?;
get repos(): {
id: number;
node_id: string;
name: string;
full_name: string;
license: import("@octokit/openapi-types").components["schemas"]["nullable-license-simple"];
forks: number;
permissions?: {
admin: boolean;
pull: boolean;
triage?: boolean;
push: boolean;
maintain?: boolean;
};
owner: import("@octokit/openapi-types").components["schemas"]["simple-user"];
private: boolean;
html_url: string;
description: string | null;
fork: boolean;
url: string;
archive_url: string;
assignees_url: string;
blobs_url: string;
branches_url: string;
collaborators_url: string;
comments_url: string;
commits_url: string;
compare_url: string;
contents_url: string;
contributors_url: string;
deployments_url: string;
downloads_url: string;
events_url: string;
forks_url: string;
git_commits_url: string;
git_refs_url: string;
git_tags_url: string;
git_url: string;
issue_comment_url: string;
issue_events_url: string;
issues_url: string;
keys_url: string;
labels_url: string;
languages_url: string;
merges_url: string;
milestones_url: string;
notifications_url: string;
pulls_url: string;
releases_url: string;
ssh_url: string;
stargazers_url: string;
statuses_url: string;
subscribers_url: string;
subscription_url: string;
tags_url: string;
teams_url: string;
trees_url: string;
clone_url: string;
mirror_url: string | null;
hooks_url: string;
svn_url: string;
homepage: string | null;
language: string | null;
forks_count: number;
stargazers_count: number;
watchers_count: number;
size: number;
default_branch: string;
open_issues_count: number;
is_template?: boolean;
topics?: string[];
has_issues: boolean;
has_projects: boolean;
has_wiki: boolean;
has_pages: boolean;
has_downloads: boolean;
has_discussions?: boolean;
archived: boolean;
disabled: boolean;
visibility?: string;
pushed_at: string | null;
created_at: string | null;
updated_at: string | null;
allow_rebase_merge?: boolean;
temp_clone_token?: string;
allow_squash_merge?: boolean;
allow_auto_merge?: boolean;
delete_branch_on_merge?: boolean;
allow_update_branch?: boolean;
use_squash_pr_title_as_default?: boolean;
squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE";
merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK";
allow_merge_commit?: boolean;
allow_forking?: boolean;
web_commit_signoff_required?: boolean;
open_issues: number;
watchers: number;
master_branch?: string;
starred_at?: string;
anonymous_access_enabled?: boolean;
code_search_index_status?: {
lexical_search_ok?: boolean;
lexical_commit_sha?: string;
};
}[];
get authenticatedUser(): {
login: string;
id: number;
user_view_type?: string;
node_id: string;
avatar_url: string;
gravatar_id: string | null;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
name: string | null;
company: string | null;
blog: string | null;
location: string | null;
email: string | null;
notification_email?: string | null;
hireable: boolean | null;
bio: string | null;
twitter_username?: string | null;
public_repos: number;
public_gists: number;
followers: number;
following: number;
created_at: string;
updated_at: string;
plan?: {
collaborators: number;
name: string;
space: number;
private_repos: number;
};
private_gists?: number;
total_private_repos?: number;
owned_private_repos?: number;
disk_usage?: number;
collaborators?: number;
};
get octokit(): import("@octokit/core").Octokit & import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods").Api & {
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
};
constructor();
ensureUserStateLoaded(): Promise<void>;
createRepo(name: string, description: string): Promise<{
id: number;
node_id: string;
name: string;
full_name: string;
owner: import("@octokit/openapi-types").components["schemas"]["simple-user"];
private: boolean;
html_url: string;
description: string | null;
fork: boolean;
url: string;
archive_url: string;
assignees_url: string;
blobs_url: string;
branches_url: string;
collaborators_url: string;
comments_url: string;
commits_url: string;
compare_url: string;
contents_url: string;
contributors_url: string;
deployments_url: string;
downloads_url: string;
events_url: string;
forks_url: string;
git_commits_url: string;
git_refs_url: string;
git_tags_url: string;
git_url: string;
issue_comment_url: string;
issue_events_url: string;
issues_url: string;
keys_url: string;
labels_url: string;
languages_url: string;
merges_url: string;
milestones_url: string;
notifications_url: string;
pulls_url: string;
releases_url: string;
ssh_url: string;
stargazers_url: string;
statuses_url: string;
subscribers_url: string;
subscription_url: string;
tags_url: string;
teams_url: string;
trees_url: string;
clone_url: string;
mirror_url: string | null;
hooks_url: string;
svn_url: string;
homepage: string | null;
language: string | null;
forks_count: number;
stargazers_count: number;
watchers_count: number;
size: number;
default_branch: string;
open_issues_count: number;
is_template?: boolean;
topics?: string[];
has_issues: boolean;
has_projects: boolean;
has_wiki: boolean;
has_pages: boolean;
has_downloads?: boolean;
has_discussions: boolean;
archived: boolean;
disabled: boolean;
visibility?: string;
pushed_at: string;
created_at: string;
updated_at: string;
permissions?: {
admin: boolean;
maintain?: boolean;
push: boolean;
triage?: boolean;
pull: boolean;
};
allow_rebase_merge?: boolean;
template_repository?: import("@octokit/openapi-types").components["schemas"]["nullable-repository"];
temp_clone_token?: string | null;
allow_squash_merge?: boolean;
allow_auto_merge?: boolean;
delete_branch_on_merge?: boolean;
allow_merge_commit?: boolean;
allow_update_branch?: boolean;
use_squash_pr_title_as_default?: boolean;
squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE";
merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK";
allow_forking?: boolean;
web_commit_signoff_required?: boolean;
subscribers_count: number;
network_count: number;
license: import("@octokit/openapi-types").components["schemas"]["nullable-license-simple"];
organization?: import("@octokit/openapi-types").components["schemas"]["nullable-simple-user"];
parent?: import("@octokit/openapi-types").components["schemas"]["repository"];
source?: import("@octokit/openapi-types").components["schemas"]["repository"];
forks: number;
master_branch?: string;
open_issues: number;
watchers: number;
anonymous_access_enabled?: boolean;
code_of_conduct?: import("@octokit/openapi-types").components["schemas"]["code-of-conduct-simple"];
security_and_analysis?: import("@octokit/openapi-types").components["schemas"]["security-and-analysis"];
custom_properties?: {
[key: string]: unknown;
};
}>;
commitToRepo(owner: string, repo: string, branch: string, folderName: string, commitMessage: string, differences: DifferenceSet): Promise<void>;
createBlobForFile(owner: string, repo: string, content: Uint8Array | string): Promise<GitCreateBlobResponse>;
getCurrentCommit(owner: string, repo: string, branch?: string): Promise<{
commitSha: string;
treeSha: string;
}>;
createNewTree(owner: string, repo: string, blobs: GitCreateBlobResponse[], paths: string[], parentTreeSha: string): Promise<{
sha: string;
url?: string;
truncated: boolean;
tree: {
path: string;
mode: string;
type: string;
sha: string;
size?: number;
url?: string;
}[];
}>;
createNewCommit(owner: string, repo: string, message: string, currentTreeSha: string, currentCommitSha: string): Promise<{
sha: string;
node_id: string;
url: string;
author: {
date: string;
email: string;
name: string;
};
committer: {
date: string;
email: string;
name: string;
};
message: string;
tree: {
sha: string;
url: string;
};
parents: {
sha: string;
url: string;
html_url: string;
}[];
verification: {
verified: boolean;
reason: string;
signature: string | null;
payload: string | null;
verified_at: string | null;
};
html_url: string;
}>;
setBranchToCommit(owner: string, repo: string, branch: string, commitSha: string): void;
}