@hicho-lge/gerrit-mcp
Version:
Gerrit Code Review system을 위한 Model Context Protocol (MCP) 서버 - 23개 도구로 변경사항, 프로젝트, 계정 관리 기능 제공
491 lines (490 loc) • 11 kB
TypeScript
export interface GerritConfig {
baseUrl: string;
username?: string;
password?: string;
accessToken?: string;
}
export interface ChangeInfo {
id: string;
project: string;
branch: string;
topic?: string;
assignee?: AccountInfo;
hashtags?: string[];
changeId: string;
subject: string;
status: ChangeStatus;
created: string;
updated: string;
submitted?: string;
submitter?: AccountInfo;
starred?: boolean;
stars?: string[];
reviewed?: boolean;
submitType?: SubmitType;
mergeable?: boolean;
submittable?: boolean;
insertions?: number;
deletions?: number;
totalCommentCount?: number;
unresolvedCommentCount?: number;
_number: number;
owner: AccountInfo;
actions?: {
[key: string]: ActionInfo;
};
labels?: {
[key: string]: LabelInfo;
};
permittedLabels?: {
[key: string]: string[];
};
removableLabels?: {
[key: string]: string[];
};
removableReviewers?: AccountInfo[];
reviewers?: {
[key: string]: AccountInfo[];
};
pendingReviewers?: AccountInfo[];
revisions?: {
[key: string]: RevisionInfo;
};
messages?: ChangeMessageInfo[];
currentRevision?: string;
moreChanges?: boolean;
}
export interface ProjectInfo {
id: string;
name: string;
parent?: string;
description?: string;
state?: ProjectState;
branches?: {
[key: string]: string;
};
webLinks?: WebLinkInfo[];
labels?: {
[key: string]: LabelTypeInfo;
};
}
export interface AccountInfo {
_accountId?: number;
name?: string;
displayName?: string;
email?: string;
secondaryEmails?: string[];
username?: string;
avatars?: AvatarInfo[];
moreAccounts?: boolean;
status?: string;
inactive?: boolean;
}
export interface GroupInfo {
id: string;
name?: string;
url?: string;
options?: GroupOptionsInfo;
description?: string;
groupId?: number;
owner?: string;
ownerId?: string;
createdOn?: string;
members?: AccountInfo[];
includes?: GroupInfo[];
}
export interface ActionInfo {
method?: string;
label?: string;
title?: string;
enabled?: boolean;
}
export interface LabelInfo {
optional?: boolean;
approved?: AccountInfo;
rejected?: AccountInfo;
recommended?: AccountInfo;
disliked?: AccountInfo;
blocking?: boolean;
value?: number;
defaultValue?: number;
values?: {
[key: string]: string;
};
all?: ApprovalInfo[];
}
export interface ApprovalInfo {
tag?: string;
value?: number;
permittedVotingRange?: VotingRangeInfo;
date?: string;
postSubmit?: boolean;
}
export interface VotingRangeInfo {
min: number;
max: number;
}
export interface RevisionInfo {
kind?: string;
_number: number;
created: string;
uploader: AccountInfo;
ref: string;
fetch?: {
[key: string]: FetchInfo;
};
commit?: CommitInfo;
files?: {
[key: string]: FileInfo;
};
actions?: {
[key: string]: ActionInfo;
};
reviewed?: boolean;
commitWithFooters?: string;
pushCertificate?: PushCertificateInfo;
description?: string;
}
export interface CommitInfo {
commit?: string;
parents: ParentCommitInfo[];
author: GitPersonInfo;
committer: GitPersonInfo;
subject: string;
message: string;
webLinks?: WebLinkInfo[];
}
export interface ParentCommitInfo {
commit: string;
subject?: string;
}
export interface GitPersonInfo {
name: string;
email: string;
date: string;
tz: number;
}
export interface FileInfo {
status?: string;
binary?: boolean;
oldPath?: string;
linesInserted?: number;
linesDeleted?: number;
sizeDelta?: number;
size?: number;
}
export interface FetchInfo {
url: string;
ref: string;
commands?: {
[key: string]: string;
};
}
export interface ChangeMessageInfo {
id: string;
author?: AccountInfo;
realAuthor?: AccountInfo;
date: string;
message: string;
tag?: string;
_revisionNumber?: number;
}
export interface WebLinkInfo {
name: string;
url: string;
imageUrl?: string;
}
export interface LabelTypeInfo {
values: {
[key: string]: string;
};
defaultValue: number;
branches?: string[];
canOverride?: boolean;
copyAnyScore?: boolean;
copyMinScore?: boolean;
copyMaxScore?: boolean;
copyAllScoresIfNoChange?: boolean;
copyAllScoresIfNoCodeChange?: boolean;
copyAllScoresOnTrivialRebase?: boolean;
copyAllScoresOnMergeFirstParentUpdate?: boolean;
copyValues?: number[];
allowPostSubmit?: boolean;
ignoreSelfApproval?: boolean;
}
export interface AvatarInfo {
url: string;
height?: number;
width?: number;
}
export interface GroupOptionsInfo {
visibleToAll?: boolean;
}
export interface PushCertificateInfo {
certificate: string;
key: GpgKeyInfo;
}
export interface GpgKeyInfo {
id?: string;
fingerprint?: string;
userIds?: string[];
key?: string;
status?: string;
problems?: string[];
}
export declare enum ChangeStatus {
NEW = "NEW",
DRAFT = "DRAFT",
MERGED = "MERGED",
ABANDONED = "ABANDONED"
}
export declare enum SubmitType {
MERGE_IF_NECESSARY = "MERGE_IF_NECESSARY",
FAST_FORWARD_ONLY = "FAST_FORWARD_ONLY",
REBASE_IF_NECESSARY = "REBASE_IF_NECESSARY",
REBASE_ALWAYS = "REBASE_ALWAYS",
MERGE_ALWAYS = "MERGE_ALWAYS",
CHERRY_PICK = "CHERRY_PICK"
}
export declare enum ProjectState {
ACTIVE = "ACTIVE",
READ_ONLY = "READ_ONLY",
HIDDEN = "HIDDEN"
}
export interface QueryOptions {
q: string;
o?: string[];
n?: number;
S?: number;
}
export interface ReviewInput {
message?: string;
tag?: string;
labels?: {
[key: string]: number;
};
comments?: {
[key: string]: CommentInput[];
};
robotComments?: {
[key: string]: RobotCommentInput[];
};
drafts?: DraftsAction;
notify?: NotifyHandling;
notifyDetails?: {
[key: string]: NotifyInfo;
};
omitDuplicateComments?: boolean;
onBehalfOf?: string;
reviewers?: ReviewerInput[];
ready?: boolean;
workInProgress?: boolean;
addToAttentionSet?: AttentionSetInput[];
removeFromAttentionSet?: AttentionSetInput[];
ignoreAutomaticAttentionSetRules?: boolean;
responseFormatOptions?: string[];
}
export interface CommentInput {
id?: string;
path?: string;
side?: CommentSide;
parent?: number;
line?: number;
range?: CommentRange;
inReplyTo?: string;
message?: string;
tag?: string;
unresolved?: boolean;
}
export interface RobotCommentInput extends CommentInput {
robotId: string;
robotRunId: string;
url?: string;
properties?: {
[key: string]: string;
};
fixSuggestions?: FixSuggestionInfo[];
}
export interface CommentRange {
startLine: number;
startCharacter: number;
endLine: number;
endCharacter: number;
}
export interface FixSuggestionInfo {
fixId: string;
description: string;
replacements: FixReplacementInfo[];
}
export interface FixReplacementInfo {
path: string;
range: CommentRange;
replacement: string;
}
export interface ReviewerInput {
reviewer: string;
state?: ReviewerState;
confirmed?: boolean;
notify?: NotifyHandling;
notifyDetails?: {
[key: string]: NotifyInfo;
};
}
export interface AttentionSetInput {
user: string;
reason: string;
notify?: NotifyHandling;
notifyDetails?: {
[key: string]: NotifyInfo;
};
}
export interface NotifyInfo {
accounts?: string[];
}
export declare enum CommentSide {
REVISION = "REVISION",
PARENT = "PARENT"
}
export declare enum DraftsAction {
KEEP = "KEEP",
PUBLISH = "PUBLISH",
PUBLISH_ALL_REVISIONS = "PUBLISH_ALL_REVISIONS"
}
export declare enum NotifyHandling {
NONE = "NONE",
OWNER = "OWNER",
OWNER_REVIEWERS = "OWNER_REVIEWERS",
ALL = "ALL"
}
export declare enum ReviewerState {
REVIEWER = "REVIEWER",
CC = "CC",
REMOVED = "REMOVED"
}
export interface BranchInfo {
ref: string;
revision: string;
canDelete?: boolean;
webLinks?: WebLinkInfo[];
}
export interface TagInfo {
ref: string;
revision: string;
object?: string;
message?: string;
tagger?: GitPersonInfo;
created?: string;
canDelete?: boolean;
webLinks?: WebLinkInfo[];
}
export interface CommitInfo {
commit?: string;
parents: ParentCommitInfo[];
author: GitPersonInfo;
committer: GitPersonInfo;
subject: string;
message: string;
webLinks?: WebLinkInfo[];
}
export interface CommentInfo {
patchSet?: number;
id: string;
path?: string;
side?: CommentSide;
parent?: number;
line?: number;
range?: CommentRange;
inReplyTo?: string;
message?: string;
updated: string;
author?: AccountInfo;
tag?: string;
unresolved?: boolean;
changeMessageId?: string;
commitId?: string;
}
export interface DraftInput {
id?: string;
path?: string;
side?: CommentSide;
parent?: number;
line?: number;
range?: CommentRange;
inReplyTo?: string;
message?: string;
tag?: string;
unresolved?: boolean;
}
export interface IncludedInInfo {
branches?: string[];
tags?: string[];
external?: {
[key: string]: string[];
};
}
export interface AccessSectionInfo {
permissions: {
[key: string]: PermissionInfo;
};
}
export interface PermissionInfo {
label?: string;
exclusive?: boolean;
rules: {
[key: string]: PermissionRuleInfo;
};
}
export interface PermissionRuleInfo {
action: PermissionAction;
force?: boolean;
min?: number;
max?: number;
}
export interface ProjectAccessInfo {
revision: string;
inheritsFrom?: ProjectInfo;
local: {
[key: string]: AccessSectionInfo;
};
isOwner?: boolean;
ownerOf?: string[];
canUpload?: boolean;
canAdd?: boolean;
canAddTags?: boolean;
configVisible?: boolean;
}
export declare enum PermissionAction {
ALLOW = "ALLOW",
DENY = "DENY",
BLOCK = "BLOCK",
INTERACTIVE = "INTERACTIVE",
BATCH = "BATCH"
}
export interface CloneInfo {
project: string;
cloneUrls: {
http?: string;
ssh?: string;
anonymous?: string;
};
description?: string;
branches?: string[];
defaultBranch?: string;
}
export interface ChangeFetchInfo {
changeId: string;
project: string;
branch: string;
ref: string;
commitId: string;
patchSetNumber: number;
cloneUrls: {
http?: string;
ssh?: string;
anonymous?: string;
};
fetchCommands: {
http?: string;
ssh?: string;
};
}