@catchmexz/fedin-vibe-mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/dist/common/errors.js +69 -0
- package/dist/common/modularTemplates.js +483 -0
- package/dist/common/pipelineTemplates.js +19 -0
- package/dist/common/types.js +42 -0
- package/dist/common/utils.js +347 -0
- package/dist/common/version.js +1 -0
- package/dist/index.js +217 -0
- package/dist/operations/appstack/appOrchestrations.js +235 -0
- package/dist/operations/appstack/appTags.js +147 -0
- package/dist/operations/appstack/appTemplates.js +67 -0
- package/dist/operations/appstack/applications.js +154 -0
- package/dist/operations/appstack/changeOrders.js +293 -0
- package/dist/operations/appstack/changeRequests.js +263 -0
- package/dist/operations/appstack/deploymentResources.js +265 -0
- package/dist/operations/appstack/globalVars.js +200 -0
- package/dist/operations/appstack/releaseWorkflows.js +178 -0
- package/dist/operations/appstack/variableGroups.js +216 -0
- package/dist/operations/codeup/branches.js +144 -0
- package/dist/operations/codeup/changeRequestComments.js +89 -0
- package/dist/operations/codeup/changeRequests.js +203 -0
- package/dist/operations/codeup/compare.js +26 -0
- package/dist/operations/codeup/files.js +483 -0
- package/dist/operations/codeup/repositories.js +83 -0
- package/dist/operations/codeup/types.js +372 -0
- package/dist/operations/flow/hostGroup.js +48 -0
- package/dist/operations/flow/pipeline.js +530 -0
- package/dist/operations/flow/pipelineJob.js +113 -0
- package/dist/operations/flow/serviceConnection.js +23 -0
- package/dist/operations/flow/types.js +377 -0
- package/dist/operations/git/git-repository.js +334 -0
- package/dist/operations/git/index.js +210 -0
- package/dist/operations/organization/members.js +94 -0
- package/dist/operations/organization/organization.js +73 -0
- package/dist/operations/organization/types.js +111 -0
- package/dist/operations/packages/artifacts.js +64 -0
- package/dist/operations/packages/repositories.js +35 -0
- package/dist/operations/packages/types.js +56 -0
- package/dist/operations/projex/project.js +206 -0
- package/dist/operations/projex/sprint.js +90 -0
- package/dist/operations/projex/types.js +390 -0
- package/dist/operations/projex/workitem.js +452 -0
- package/dist/tool-handlers/appstack-change-orders.js +55 -0
- package/dist/tool-handlers/appstack-change-requests.js +49 -0
- package/dist/tool-handlers/appstack-deployment-resources.js +43 -0
- package/dist/tool-handlers/appstack-global-vars.js +43 -0
- package/dist/tool-handlers/appstack-orchestrations.js +49 -0
- package/dist/tool-handlers/appstack-tags.js +43 -0
- package/dist/tool-handlers/appstack-templates.js +19 -0
- package/dist/tool-handlers/appstack-variable-groups.js +55 -0
- package/dist/tool-handlers/appstack.js +37 -0
- package/dist/tool-handlers/code-management.js +174 -0
- package/dist/tool-handlers/git/branch-operations.js +1 -0
- package/dist/tool-handlers/git/clone-repository.js +36 -0
- package/dist/tool-handlers/git/create-branch.js +26 -0
- package/dist/tool-handlers/git/get-repository-status.js +33 -0
- package/dist/tool-handlers/git/pull-repository.js +27 -0
- package/dist/tool-handlers/git/push-repository.js +37 -0
- package/dist/tool-handlers/git/switch-branch.js +25 -0
- package/dist/tool-handlers/index.js +43 -0
- package/dist/tool-handlers/organization.js +90 -0
- package/dist/tool-handlers/packages.js +32 -0
- package/dist/tool-handlers/pipeline.js +272 -0
- package/dist/tool-handlers/project-management.js +152 -0
- package/dist/tool-handlers/service-connections.js +16 -0
- package/dist/tool-registry/appstack-change-orders.js +40 -0
- package/dist/tool-registry/appstack-change-requests.js +35 -0
- package/dist/tool-registry/appstack-deployment-resources.js +30 -0
- package/dist/tool-registry/appstack-global-vars.js +30 -0
- package/dist/tool-registry/appstack-orchestrations.js +35 -0
- package/dist/tool-registry/appstack-tags.js +30 -0
- package/dist/tool-registry/appstack-templates.js +10 -0
- package/dist/tool-registry/appstack-variable-groups.js +40 -0
- package/dist/tool-registry/appstack.js +25 -0
- package/dist/tool-registry/code-management.js +89 -0
- package/dist/tool-registry/git-repository.js +41 -0
- package/dist/tool-registry/index.js +6 -0
- package/dist/tool-registry/organization.js +65 -0
- package/dist/tool-registry/packages.js +21 -0
- package/dist/tool-registry/pipeline.js +157 -0
- package/dist/tool-registry/project-management.js +108 -0
- package/dist/tool-registry/service-connections.js +10 -0
- package/package.json +39 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Codeup Branch related schemas
|
|
3
|
+
export const CodeupBranchSchema = z.object({
|
|
4
|
+
name: z.string().optional().describe("Branch name"),
|
|
5
|
+
defaultBranch: z.boolean().optional().describe("Whether it is the default branch"),
|
|
6
|
+
commit: z.object({
|
|
7
|
+
authorEmail: z.string().optional().describe("Author email"),
|
|
8
|
+
authorName: z.string().optional().describe("Author name"),
|
|
9
|
+
committedDate: z.string().optional().describe("Commit date"),
|
|
10
|
+
committerEmail: z.string().optional().describe("Committer email"),
|
|
11
|
+
committerName: z.string().optional().describe("Committer name"),
|
|
12
|
+
id: z.string().optional().describe("Commit ID"),
|
|
13
|
+
message: z.string().optional().describe("Commit message"),
|
|
14
|
+
parentIds: z.array(z.string()).optional().describe("Parent commit IDs"),
|
|
15
|
+
shortId: z.string().optional().describe("Code group path"),
|
|
16
|
+
stats: z.object({
|
|
17
|
+
additions: z.number().optional().describe("Added lines"),
|
|
18
|
+
deletions: z.number().optional().describe("Deleted lines"),
|
|
19
|
+
total: z.number().optional().describe("Total lines"),
|
|
20
|
+
}).nullable().optional().describe("Commit statistics"),
|
|
21
|
+
title: z.string().optional().describe("Title, first line of the commit message"),
|
|
22
|
+
webUrl: z.string().url().optional().describe("Web access URL"),
|
|
23
|
+
}).nullable().optional().describe("Commit information"),
|
|
24
|
+
protected: z.boolean().optional().describe("Whether it is a protected branch"),
|
|
25
|
+
webUrl: z.string().url().optional().describe("Web access URL"),
|
|
26
|
+
});
|
|
27
|
+
// Codeup File related schemas
|
|
28
|
+
export const FileContentSchema = z.object({
|
|
29
|
+
fileName: z.string().optional().describe("File name"),
|
|
30
|
+
filePath: z.string().optional().describe("File path"),
|
|
31
|
+
size: z.string().optional().describe("File size"),
|
|
32
|
+
content: z.string().optional().describe("File content"),
|
|
33
|
+
encoding: z.string().optional().describe("Content encoding (base64 or text)"),
|
|
34
|
+
ref: z.string().optional().describe("Reference (branch, tag, or commit)"),
|
|
35
|
+
blobId: z.string().optional().describe("Blob ID"),
|
|
36
|
+
commitId: z.string().optional().describe("Commit ID"),
|
|
37
|
+
});
|
|
38
|
+
export const FileInfoSchema = z.object({
|
|
39
|
+
id: z.string().optional().describe("File/directory ID"),
|
|
40
|
+
name: z.string().optional().describe("File/directory name"),
|
|
41
|
+
path: z.string().optional().describe("File/directory path"),
|
|
42
|
+
type: z.string().optional().describe("Type of entry: tree (directory) or blob (file)"),
|
|
43
|
+
mode: z.string().optional().describe("File mode"),
|
|
44
|
+
size: z.number().int().optional().describe("File size (not present for directories)"),
|
|
45
|
+
});
|
|
46
|
+
export const CreateFileResponseSchema = z.object({
|
|
47
|
+
filePath: z.string().optional().describe("File path"),
|
|
48
|
+
branch: z.string().optional().describe("Branch name"),
|
|
49
|
+
newOid: z.string().optional().describe("Git Object ID"),
|
|
50
|
+
});
|
|
51
|
+
export const DeleteFileResponseSchema = z.object({
|
|
52
|
+
filePath: z.string().optional().describe("File path"),
|
|
53
|
+
branch: z.string().optional().describe("Branch name"),
|
|
54
|
+
commitId: z.string().optional().describe("Commit ID"),
|
|
55
|
+
commitMessage: z.string().optional().describe("Commit message"),
|
|
56
|
+
});
|
|
57
|
+
// Codeup Repository related schemas
|
|
58
|
+
export const RepositorySchema = z.object({
|
|
59
|
+
id: z.number().int().optional().describe("Repository ID"),
|
|
60
|
+
name: z.string().optional().describe("Repository name"),
|
|
61
|
+
webUrl: z.string().optional().describe("Web URL for accessing the repository"),
|
|
62
|
+
description: z.string().optional().describe("Repository description"),
|
|
63
|
+
path: z.string().optional().describe("Repository path"),
|
|
64
|
+
});
|
|
65
|
+
// Codeup Compare related schemas
|
|
66
|
+
export const CompareSchema = z.object({
|
|
67
|
+
base_commit_sha: z.string().optional(),
|
|
68
|
+
commits: z.array(z.unknown()).optional(),
|
|
69
|
+
commits_count: z.number().optional(),
|
|
70
|
+
diffs: z.array(z.unknown()).optional(),
|
|
71
|
+
files_count: z.number().optional(),
|
|
72
|
+
from: z.string().optional(),
|
|
73
|
+
to: z.string().optional(),
|
|
74
|
+
});
|
|
75
|
+
// Codeup Change Request related schemas
|
|
76
|
+
export const PatchSetSchema = z.object({
|
|
77
|
+
commitId: z.string().nullable().optional(),
|
|
78
|
+
createTime: z.string().nullable().optional(),
|
|
79
|
+
patchSetBizId: z.string().nullable().optional(),
|
|
80
|
+
patchSetName: z.string().optional(),
|
|
81
|
+
ref: z.string().optional(),
|
|
82
|
+
relatedMergeItemType: z.string().optional(),
|
|
83
|
+
shortId: z.string().optional(),
|
|
84
|
+
versionNo: z.number().int().optional(),
|
|
85
|
+
});
|
|
86
|
+
export const ChangeRequestCommentSchema = z.object({
|
|
87
|
+
author: z.object({
|
|
88
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
89
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
90
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
91
|
+
state: z.string().nullable().optional().describe("用户状态:active - 激活可用;blocked - 阻塞暂不可用"),
|
|
92
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
93
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
94
|
+
}).nullable().optional().describe("评论作者信息"),
|
|
95
|
+
child_comments_list: z.array(z.any()).nullable().optional().describe("子评论列表"),
|
|
96
|
+
comment_biz_id: z.string().nullable().optional().describe("评论业务ID"),
|
|
97
|
+
comment_time: z.string().nullable().optional().describe("评论时间"),
|
|
98
|
+
comment_type: z.string().nullable().optional().describe("评论类型:GLOBAL_COMMENT - 全局评论;INLINE_COMMENT - 行内评论"),
|
|
99
|
+
content: z.string().nullable().optional().describe("评论内容"),
|
|
100
|
+
expression_reply_list: z.array(z.any()).nullable().optional().describe("表情回复列表"),
|
|
101
|
+
filePath: z.string().nullable().optional().describe("文件路径,仅行内评论有"),
|
|
102
|
+
from_patchset_biz_id: z.string().nullable().optional().describe("比较的起始版本ID"),
|
|
103
|
+
is_deleted: z.boolean().nullable().optional().describe("是否已删除"),
|
|
104
|
+
last_edit_time: z.string().nullable().optional().describe("最后编辑时间"),
|
|
105
|
+
last_edit_user: z.object({
|
|
106
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
107
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
108
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
109
|
+
state: z.string().nullable().optional().describe("用户状态"),
|
|
110
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
111
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
112
|
+
}).nullable().optional().describe("最后编辑用户"),
|
|
113
|
+
last_resolved_status_change_time: z.string().nullable().optional().describe("最后解决状态变更时间"),
|
|
114
|
+
last_resolved_status_change_user: z.object({
|
|
115
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
116
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
117
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
118
|
+
state: z.string().nullable().optional().describe("用户状态"),
|
|
119
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
120
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
121
|
+
}).nullable().optional().describe("最后解决状态变更用户"),
|
|
122
|
+
line_number: z.number().int().nullable().optional().describe("所在行号"),
|
|
123
|
+
location: z.object({
|
|
124
|
+
can_located: z.boolean().nullable().optional().describe("是否可以定位"),
|
|
125
|
+
located_file_path: z.string().nullable().optional().describe("定位的文件路径"),
|
|
126
|
+
located_line_number: z.number().int().nullable().optional().describe("定位的行号"),
|
|
127
|
+
located_patch_set_biz_id: z.string().nullable().optional().describe("定位的补丁集业务ID")
|
|
128
|
+
}).nullable().optional().describe("位置信息"),
|
|
129
|
+
mr_biz_id: z.string().nullable().optional().describe("所属合并请求的业务ID"),
|
|
130
|
+
out_dated: z.boolean().nullable().optional().describe("是否过期评论"),
|
|
131
|
+
parent_comment_biz_id: z.string().nullable().optional().describe("父评论业务ID"),
|
|
132
|
+
project_id: z.number().int().nullable().optional().describe("代码库ID"),
|
|
133
|
+
related_patchset: z.object({
|
|
134
|
+
commitId: z.string().nullable().optional().describe("版本对应的提交ID"),
|
|
135
|
+
createTime: z.string().nullable().optional().describe("版本创建时间"),
|
|
136
|
+
patchSetBizId: z.string().nullable().optional().describe("版本ID,具有唯一性"),
|
|
137
|
+
patchSetName: z.string().nullable().optional().describe("版本名称"),
|
|
138
|
+
ref: z.string().nullable().optional().describe("版本对应的ref信息"),
|
|
139
|
+
relatedMergeItemType: z.string().nullable().optional().describe("关联的类型:MERGE_SOURCE - 合并源;MERGE_TARGET - 合并目标"),
|
|
140
|
+
shortId: z.string().nullable().optional().describe("提交ID对应的短ID,通常为8位"),
|
|
141
|
+
versionNo: z.number().int().nullable().optional().describe("版本号")
|
|
142
|
+
}).nullable().optional().describe("关联的补丁集信息"),
|
|
143
|
+
resolved: z.boolean().nullable().optional().describe("是否已解决"),
|
|
144
|
+
root_comment_biz_id: z.string().nullable().optional().describe("根评论业务ID"),
|
|
145
|
+
state: z.string().nullable().optional().describe("评论状态:OPENED - 已公开;DRAFT - 草稿"),
|
|
146
|
+
to_patchset_biz_id: z.string().nullable().optional().describe("比较的目标版本ID"),
|
|
147
|
+
});
|
|
148
|
+
export const ChangeRequestSchema = z.object({
|
|
149
|
+
ahead: z.number().int().nullable().optional().describe("源分支领先目标分支的commit数量"),
|
|
150
|
+
allRequirementsPass: z.boolean().nullable().optional().describe("是否所有卡点项通过"),
|
|
151
|
+
author: z.object({
|
|
152
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
153
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
154
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
155
|
+
state: z.string().nullable().optional().describe("用户状态:active - 激活可用;blocked - 阻塞暂不可用"),
|
|
156
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
157
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
158
|
+
}).nullable().optional().describe("创建者信息"),
|
|
159
|
+
behind: z.number().int().nullable().optional().describe("目标分支领先源分支的commit数量"),
|
|
160
|
+
canRevertOrCherryPick: z.boolean().nullable().optional().describe("是否能Revert或者CherryPick"),
|
|
161
|
+
conflictCheckStatus: z.string().nullable().optional().describe("冲突检测状态:CHECKING - 检测中;HAS_CONFLICT - 有冲突;NO_CONFLICT - 无冲突;FAILED - 检测失败"),
|
|
162
|
+
createFrom: z.string().nullable().optional().describe("创建来源:WEB - 页面创建;COMMAND_LINE - 命令行创建"),
|
|
163
|
+
createTime: z.string().nullable().optional().describe("创建时间"),
|
|
164
|
+
description: z.string().nullable().optional().describe("描述"),
|
|
165
|
+
detailUrl: z.string().nullable().optional().describe("合并请求详情地址"),
|
|
166
|
+
hasReverted: z.boolean().nullable().optional().describe("是否Revert过"),
|
|
167
|
+
localId: z.union([z.string(), z.number().int()]).nullable().optional().describe("局部ID,表示代码库中第几个合并请求"),
|
|
168
|
+
mergedRevision: z.string().nullable().optional().describe("合并版本(提交ID),仅已合并状态才有值"),
|
|
169
|
+
mrType: z.string().nullable().optional().describe("合并请求类型"),
|
|
170
|
+
projectId: z.number().int().nullable().optional().describe("项目ID"),
|
|
171
|
+
reviewers: z.array(z.object({
|
|
172
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
173
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
174
|
+
hasCommented: z.boolean().nullable().optional().describe("是否已评论"),
|
|
175
|
+
hasReviewed: z.boolean().nullable().optional().describe("是否已审阅"),
|
|
176
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
177
|
+
reviewOpinionStatus: z.string().nullable().optional().describe("审阅意见状态"),
|
|
178
|
+
reviewTime: z.string().nullable().optional().describe("审阅时间"),
|
|
179
|
+
state: z.string().nullable().optional().describe("用户状态"),
|
|
180
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
181
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
182
|
+
})).nullable().optional().describe("评审人列表"),
|
|
183
|
+
sourceBranch: z.string().nullable().optional().describe("源分支"),
|
|
184
|
+
sourceCommitId: z.string().nullable().optional().describe("源提交ID,当createFrom=COMMAND_LINE时有值"),
|
|
185
|
+
sourceProjectId: z.union([z.string(), z.number().int()]).nullable().optional().describe("源库ID"),
|
|
186
|
+
sourceRef: z.string().nullable().optional().describe("源提交引用,当createFrom=COMMAND_LINE时有值"),
|
|
187
|
+
status: z.string().nullable().optional().describe("合并请求状态:UNDER_DEV - 开发中;UNDER_REVIEW - 评审中;TO_BE_MERGED - 待合并;CLOSED - 已关闭;MERGED - 已合并"),
|
|
188
|
+
subscribers: z.array(z.object({
|
|
189
|
+
avatar: z.string().nullable().optional().describe("用户头像地址"),
|
|
190
|
+
email: z.string().nullable().optional().describe("用户邮箱"),
|
|
191
|
+
name: z.string().nullable().optional().describe("用户名称"),
|
|
192
|
+
state: z.string().nullable().optional().describe("用户状态"),
|
|
193
|
+
userId: z.string().nullable().optional().describe("云效用户ID"),
|
|
194
|
+
username: z.string().nullable().optional().describe("用户登录名")
|
|
195
|
+
})).nullable().optional().describe("订阅人列表"),
|
|
196
|
+
supportMergeFastForwardOnly: z.boolean().nullable().optional().describe("是否支持fast-forward-only"),
|
|
197
|
+
targetBranch: z.string().nullable().optional().describe("目标分支"),
|
|
198
|
+
targetProjectId: z.union([z.string(), z.number().int()]).nullable().optional().describe("目标库ID"),
|
|
199
|
+
targetProjectNameWithNamespace: z.string().nullable().optional().describe("目标库名称(含完整父路径)"),
|
|
200
|
+
targetProjectPathWithNamespace: z.string().nullable().optional().describe("目标库路径(含完整父路径)"),
|
|
201
|
+
title: z.string().nullable().optional().describe("标题"),
|
|
202
|
+
totalCommentCount: z.number().int().nullable().optional().describe("总评论数"),
|
|
203
|
+
unResolvedCommentCount: z.number().int().nullable().optional().describe("未解决评论数"),
|
|
204
|
+
updateTime: z.string().nullable().optional().describe("更新时间"),
|
|
205
|
+
webUrl: z.string().nullable().optional().describe("页面地址")
|
|
206
|
+
});
|
|
207
|
+
// Codeup Branch related schemas
|
|
208
|
+
export const CreateBranchSchema = z.object({
|
|
209
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
210
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
211
|
+
branch: z.string().describe("Name of the branch to be created"),
|
|
212
|
+
ref: z.string().default("master").describe("Source branch name, the new branch will be created based on this branch, default value is master"),
|
|
213
|
+
});
|
|
214
|
+
export const GetBranchSchema = z.object({
|
|
215
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
216
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
217
|
+
branchName: z.string().describe("Branch name (if it contains special characters, use URL encoding), example: master or feature%2Fdev"),
|
|
218
|
+
});
|
|
219
|
+
export const DeleteBranchSchema = z.object({
|
|
220
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
221
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
222
|
+
branchName: z.string().describe("Branch name (use URL-Encoder for encoding, example: feature%2Fdev)"),
|
|
223
|
+
});
|
|
224
|
+
export const ListBranchesSchema = z.object({
|
|
225
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
226
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
227
|
+
page: z.number().int().default(1).optional().describe("Page number"),
|
|
228
|
+
perPage: z.number().int().default(20).optional().describe("Items per page"),
|
|
229
|
+
sort: z.enum(["name_asc", "name_desc", "updated_asc", "updated_desc"]).default("name_asc").optional().describe("Sort order: name_asc - name ascending, name_desc - name descending, updated_asc - update time ascending, updated_desc - update time descending"),
|
|
230
|
+
search: z.string().nullable().optional().describe("Search query"),
|
|
231
|
+
});
|
|
232
|
+
// Codeup repositories related Schema definitions
|
|
233
|
+
export const CreateRepositorySchema = z.object({
|
|
234
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
235
|
+
name: z.string().describe("Repository name"),
|
|
236
|
+
description: z.string().describe("Repository description")
|
|
237
|
+
});
|
|
238
|
+
export const GetRepositorySchema = z.object({
|
|
239
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
240
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
241
|
+
});
|
|
242
|
+
export const ListRepositoriesSchema = z.object({
|
|
243
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
244
|
+
page: z.number().int().default(1).optional().describe("Page number, default starts from 1, generally should not exceed 150 pages"),
|
|
245
|
+
perPage: z.number().int().default(20).optional().describe("Items per page, default 20, value range [1, 100]"),
|
|
246
|
+
orderBy: z.string().default("created_at").optional().describe("Sort field, options include {created_at, name, path, last_activity_at}, default is created_at"),
|
|
247
|
+
sort: z.string().default("desc").optional().describe("Sort order, options include {asc, desc}, default is desc"),
|
|
248
|
+
search: z.string().optional().describe("Search keyword, used to fuzzy match repository paths"),
|
|
249
|
+
archived: z.boolean().default(false).optional().describe("Whether archived"),
|
|
250
|
+
});
|
|
251
|
+
// Codeup files related Schema definitions
|
|
252
|
+
export const GetFileBlobsSchema = z.object({
|
|
253
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
254
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
255
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
256
|
+
ref: z.string().describe("Reference name, usually branch name, can be branch name, tag name or commit SHA. If not provided, the default branch of the repository will be used, such as master"),
|
|
257
|
+
});
|
|
258
|
+
export const CreateFileSchema = z.object({
|
|
259
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
260
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
261
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
262
|
+
content: z.string().describe("File content"),
|
|
263
|
+
commitMessage: z.string().describe("Commit message, not empty, no more than 102400 characters"),
|
|
264
|
+
branch: z.string().describe("Branch name"),
|
|
265
|
+
encoding: z.string().optional().describe("Encoding rule, options {text, base64}, default is text"),
|
|
266
|
+
});
|
|
267
|
+
export const PushFilesSchema = z.object({
|
|
268
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
269
|
+
projectPath: z.string().describe("The project path, and it must be an absolute path."),
|
|
270
|
+
commitMessage: z.string().describe("Commit message, not empty, no more than 102400 characters")
|
|
271
|
+
});
|
|
272
|
+
export const PullFilesSchema = z.object({
|
|
273
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
274
|
+
currntProjectPath: z.string().describe("The absolute local path of the current project, and it must be an absolute path."),
|
|
275
|
+
});
|
|
276
|
+
export const UpdateFileSchema = z.object({
|
|
277
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
278
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
279
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
280
|
+
content: z.string().describe("File content"),
|
|
281
|
+
commitMessage: z.string().describe("Commit message, not empty, no more than 102400 characters"),
|
|
282
|
+
branch: z.string().describe("Branch name"),
|
|
283
|
+
encoding: z.string().default("text").optional().describe("Encoding rule, options {text, base64}, default is text"),
|
|
284
|
+
});
|
|
285
|
+
export const DeleteFileSchema = z.object({
|
|
286
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
287
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
288
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
289
|
+
commitMessage: z.string().describe("Commit message"),
|
|
290
|
+
branch: z.string().describe("Branch name"),
|
|
291
|
+
});
|
|
292
|
+
export const ListFilesSchema = z.object({
|
|
293
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
294
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
295
|
+
path: z.string().optional().describe("Specific path to query, for example to query files in the src/main directory"),
|
|
296
|
+
ref: z.string().optional().describe("Reference name, usually branch name, can be branch name, tag name or commit SHA. If not provided, the default branch of the repository will be used, such as master"),
|
|
297
|
+
type: z.string().default("RECURSIVE").optional().describe("File tree retrieval method: DIRECT - only get the current directory, default method; RECURSIVE - recursively find all files under the current path; FLATTEN - flat display (if it is a directory, recursively find until the subdirectory contains files or multiple directories)"),
|
|
298
|
+
});
|
|
299
|
+
// Codeup compare related Schema definitions
|
|
300
|
+
export const GetCompareSchema = z.object({
|
|
301
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
302
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
303
|
+
from: z.string().describe("Can be CommitSHA, branch name or tag name"),
|
|
304
|
+
to: z.string().describe("Can be CommitSHA, branch name or tag name"),
|
|
305
|
+
sourceType: z.string().nullable().optional().describe("Options: branch, tag; if it's a commit comparison, you can omit this; if it's a branch comparison, you need to provide: branch, or you can omit it but ensure there are no branch or tag name conflicts; if it's a tag comparison, you need to provide: tag; if there are branches and tags with the same name, you need to strictly provide branch or tag"),
|
|
306
|
+
targetType: z.string().nullable().optional().describe("Options: branch, tag; if it's a commit comparison, you can omit this; if it's a branch comparison, you need to provide: branch, or you can omit it but ensure there are no branch or tag name conflicts; if it's a tag comparison, you need to provide: tag; if there are branches and tags with the same name, you need to strictly provide branch or tag"),
|
|
307
|
+
straight: z.string().default("false").nullable().optional().describe("Whether to use Merge-Base: straight=false means using Merge-Base; straight=true means not using Merge-Base; default is false, meaning using Merge-Base"),
|
|
308
|
+
});
|
|
309
|
+
// Codeup change requests related Schema definitions
|
|
310
|
+
export const GetChangeRequestSchema = z.object({
|
|
311
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
312
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
313
|
+
localId: z.string().describe("Local ID, represents the nth merge request in the repository"),
|
|
314
|
+
});
|
|
315
|
+
export const ListChangeRequestsSchema = z.object({
|
|
316
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
317
|
+
page: z.number().int().default(1).optional().describe("Page number"),
|
|
318
|
+
perPage: z.number().int().default(20).optional().describe("Items per page"),
|
|
319
|
+
projectIds: z.string().nullable().optional().describe("Repository ID or a combination of organization ID and repository name list, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F), multiple separated by commas"),
|
|
320
|
+
authorIds: z.string().nullable().optional().describe("Creator user ID list, multiple separated by commas"),
|
|
321
|
+
reviewerIds: z.string().nullable().optional().describe("Reviewer user ID list, multiple separated by commas"),
|
|
322
|
+
state: z.string().nullable().optional().describe("Merge request filter status. Possible values: opened, merged, closed. Default is null, which queries all statuses"),
|
|
323
|
+
search: z.string().nullable().optional().describe("Title keyword search"),
|
|
324
|
+
orderBy: z.string().default("updated_at").optional().describe("Sort field. Possible values: created_at (creation time), updated_at (update time, default)"),
|
|
325
|
+
sort: z.string().default("desc").optional().describe("Sort order. Possible values: asc (ascending), desc (descending, default)"),
|
|
326
|
+
createdBefore: z.string().nullable().optional().describe("Start creation time, time format is ISO 8601, for example: 2019-03-15T08:00:00Z"),
|
|
327
|
+
createdAfter: z.string().nullable().optional().describe("End creation time, time format is ISO 8601, for example: 2019-03-15T08:00:00Z"),
|
|
328
|
+
});
|
|
329
|
+
export const CreateChangeRequestSchema = z.object({
|
|
330
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
331
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
332
|
+
title: z.string().describe("Title, no more than 256 characters"),
|
|
333
|
+
description: z.string().nullable().optional().describe("Description, no more than 10000 characters"),
|
|
334
|
+
sourceBranch: z.string().describe("Source branch name"),
|
|
335
|
+
sourceProjectId: z.number().optional().describe("Source repository ID (if not provided, will try to get automatically)"),
|
|
336
|
+
targetBranch: z.string().describe("Target branch name"),
|
|
337
|
+
targetProjectId: z.number().optional().describe("Target repository ID (if not provided, will try to get automatically)"),
|
|
338
|
+
reviewerUserIds: z.array(z.string()).nullable().optional().describe("Reviewer user ID list"),
|
|
339
|
+
workItemIds: z.array(z.string()).nullable().optional().describe("Associated work item ID list"),
|
|
340
|
+
createFrom: z.string().optional().default("WEB").describe("Creation source. Possible values: WEB (created from web page), COMMAND_LINE (created from command line). Default is WEB"),
|
|
341
|
+
});
|
|
342
|
+
export const ListChangeRequestPatchSetsSchema = z.object({
|
|
343
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
344
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
345
|
+
localId: z.string().describe("Local ID, represents the nth merge request in the repository"),
|
|
346
|
+
});
|
|
347
|
+
// Codeup change request comments related Schema definitions
|
|
348
|
+
export const CreateChangeRequestCommentSchema = z.object({
|
|
349
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
350
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
351
|
+
localId: z.string().describe("Local ID, represents the nth merge request in the repository"),
|
|
352
|
+
comment_type: z.string().default("GLOBAL_COMMENT").describe("Comment type. Possible values: GLOBAL_COMMENT, INLINE_COMMENT"),
|
|
353
|
+
content: z.string().describe("Comment content, length must be between 1 and 65535"),
|
|
354
|
+
draft: z.boolean().default(false).describe("Whether it is a draft comment"),
|
|
355
|
+
resolved: z.boolean().default(false).describe("Whether to mark as resolved"),
|
|
356
|
+
patchset_biz_id: z.string().describe("Associated version ID, if it's INLINE_COMMENT, choose one from from_patchset_biz_id or to_patchset_biz_id"),
|
|
357
|
+
file_path: z.string().nullable().optional().describe("File name, only for inline comments"),
|
|
358
|
+
line_number: z.number().int().nullable().optional().describe("Line number, only for inline comments"),
|
|
359
|
+
from_patchset_biz_id: z.string().nullable().optional().describe("Start version ID for comparison, required for INLINE_COMMENT type"),
|
|
360
|
+
to_patchset_biz_id: z.string().nullable().optional().describe("Target version ID for comparison, required for INLINE_COMMENT type"),
|
|
361
|
+
parent_comment_biz_id: z.string().nullable().optional().describe("Parent comment ID"),
|
|
362
|
+
});
|
|
363
|
+
export const ListChangeRequestCommentsSchema = z.object({
|
|
364
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
365
|
+
repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"),
|
|
366
|
+
localId: z.string().describe("Change request local ID"),
|
|
367
|
+
patchSetBizIds: z.array(z.string()).nullable().optional().describe("Associated version ID list, each comment is associated with a version, indicating which version the comment was posted on, for global comments, it's associated with the latest merge source version"),
|
|
368
|
+
commentType: z.string().optional().default("GLOBAL_COMMENT").describe("Comment type. Possible values: GLOBAL_COMMENT, INLINE_COMMENT"),
|
|
369
|
+
state: z.string().optional().default("OPENED").describe("Comment state. Possible values: OPENED, DRAFT"),
|
|
370
|
+
resolved: z.boolean().optional().default(false).describe("Whether marked as resolved"),
|
|
371
|
+
filePath: z.string().nullable().optional().describe("Filter by file path (for inline comments)"),
|
|
372
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as utils from "../../common/utils.js";
|
|
2
|
+
import { HostGroupSchema } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* 获取主机组列表
|
|
5
|
+
* @param organizationId 组织ID
|
|
6
|
+
* @param options 查询选项
|
|
7
|
+
* @returns 主机组列表
|
|
8
|
+
*/
|
|
9
|
+
export async function listHostGroupsFunc(organizationId, options) {
|
|
10
|
+
const baseUrl = `/oapi/v1/flow/organizations/${organizationId}/hostGroups`;
|
|
11
|
+
// 构建查询参数
|
|
12
|
+
const queryParams = {};
|
|
13
|
+
if (options?.ids !== undefined) {
|
|
14
|
+
queryParams.ids = options.ids;
|
|
15
|
+
}
|
|
16
|
+
if (options?.name !== undefined) {
|
|
17
|
+
queryParams.name = options.name;
|
|
18
|
+
}
|
|
19
|
+
if (options?.createStartTime !== undefined) {
|
|
20
|
+
queryParams.createStartTime = options.createStartTime;
|
|
21
|
+
}
|
|
22
|
+
if (options?.createEndTime !== undefined) {
|
|
23
|
+
queryParams.createEndTime = options.createEndTime;
|
|
24
|
+
}
|
|
25
|
+
if (options?.creatorAccountIds !== undefined) {
|
|
26
|
+
queryParams.creatorAccountIds = options.creatorAccountIds;
|
|
27
|
+
}
|
|
28
|
+
if (options?.perPage !== undefined) {
|
|
29
|
+
queryParams.perPage = options.perPage;
|
|
30
|
+
}
|
|
31
|
+
if (options?.page !== undefined) {
|
|
32
|
+
queryParams.page = options.page;
|
|
33
|
+
}
|
|
34
|
+
if (options?.pageSort !== undefined) {
|
|
35
|
+
queryParams.pageSort = options.pageSort;
|
|
36
|
+
}
|
|
37
|
+
if (options?.pageOrder !== undefined) {
|
|
38
|
+
queryParams.pageOrder = options.pageOrder;
|
|
39
|
+
}
|
|
40
|
+
const url = utils.buildUrl(baseUrl, queryParams);
|
|
41
|
+
const response = await utils.yunxiaoRequest(url, {
|
|
42
|
+
method: "GET",
|
|
43
|
+
});
|
|
44
|
+
if (!Array.isArray(response)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return response.map(item => HostGroupSchema.parse(item));
|
|
48
|
+
}
|