devops-mcp-server-extension 1.0.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 +218 -0
- package/README.md +527 -0
- package/README.zh-cn.md +503 -0
- package/dist/common/errors.js +77 -0
- package/dist/common/modularTemplates.js +483 -0
- package/dist/common/pipelineTemplates.js +19 -0
- package/dist/common/toolsetManager.js +123 -0
- package/dist/common/toolsets.js +23 -0
- package/dist/common/types.js +60 -0
- package/dist/common/utils.js +381 -0
- package/dist/common/version.js +1 -0
- package/dist/index.js +225 -0
- package/dist/operations/appstack/appOrchestrations.js +260 -0
- package/dist/operations/appstack/appTags.js +168 -0
- package/dist/operations/appstack/appTemplates.js +72 -0
- package/dist/operations/appstack/applications.js +171 -0
- package/dist/operations/appstack/changeOrders.js +320 -0
- package/dist/operations/appstack/changeRequests.js +288 -0
- package/dist/operations/appstack/deploymentResources.js +286 -0
- package/dist/operations/appstack/globalVars.js +221 -0
- package/dist/operations/appstack/releaseWorkflows.js +695 -0
- package/dist/operations/appstack/variableGroups.js +245 -0
- package/dist/operations/codeup/branches.js +157 -0
- package/dist/operations/codeup/changeRequestComments.js +140 -0
- package/dist/operations/codeup/changeRequests.js +230 -0
- package/dist/operations/codeup/commits.js +121 -0
- package/dist/operations/codeup/compare.js +30 -0
- package/dist/operations/codeup/files.js +249 -0
- package/dist/operations/codeup/repositories.js +71 -0
- package/dist/operations/codeup/types.js +414 -0
- package/dist/operations/flow/hostGroup.js +52 -0
- package/dist/operations/flow/pipeline.js +609 -0
- package/dist/operations/flow/pipelineJob.js +126 -0
- package/dist/operations/flow/resourceMember.js +137 -0
- package/dist/operations/flow/serviceConnection.js +27 -0
- package/dist/operations/flow/tag.js +191 -0
- package/dist/operations/flow/types.js +523 -0
- package/dist/operations/flow/vmDeployOrder.js +171 -0
- package/dist/operations/organization/members.js +106 -0
- package/dist/operations/organization/organization.js +110 -0
- package/dist/operations/organization/types.js +111 -0
- package/dist/operations/packages/artifacts.js +71 -0
- package/dist/operations/packages/repositories.js +39 -0
- package/dist/operations/packages/types.js +56 -0
- package/dist/operations/projex/effort.js +122 -0
- package/dist/operations/projex/project.js +243 -0
- package/dist/operations/projex/sprint.js +103 -0
- package/dist/operations/projex/types.js +618 -0
- package/dist/operations/projex/workitem.js +826 -0
- package/dist/operations/testhub/testcases.js +240 -0
- package/dist/operations/testhub/testplans.js +128 -0
- package/dist/tool-handlers/appstack-app-release-workflows.js +103 -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 +31 -0
- package/dist/tool-handlers/appstack-global-vars.js +37 -0
- package/dist/tool-handlers/appstack-orchestrations.js +49 -0
- package/dist/tool-handlers/appstack-release-workflows.js +37 -0
- package/dist/tool-handlers/appstack-tags.js +37 -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/base.js +25 -0
- package/dist/tool-handlers/code-management.js +150 -0
- package/dist/tool-handlers/commit.js +31 -0
- package/dist/tool-handlers/effort.js +103 -0
- package/dist/tool-handlers/index.js +119 -0
- package/dist/tool-handlers/organization.js +72 -0
- package/dist/tool-handlers/packages.js +32 -0
- package/dist/tool-handlers/pipeline.js +289 -0
- package/dist/tool-handlers/project-management.js +201 -0
- package/dist/tool-handlers/resourceMember.js +43 -0
- package/dist/tool-handlers/service-connections.js +16 -0
- package/dist/tool-handlers/tag.js +64 -0
- package/dist/tool-handlers/test-management.js +74 -0
- package/dist/tool-handlers/vmDeployOrder.js +50 -0
- package/dist/tool-registry/appstack-app-release-workflows.js +80 -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 +20 -0
- package/dist/tool-registry/appstack-global-vars.js +25 -0
- package/dist/tool-registry/appstack-orchestrations.js +35 -0
- package/dist/tool-registry/appstack-release-workflows.js +25 -0
- package/dist/tool-registry/appstack-tags.js +25 -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/base.js +19 -0
- package/dist/tool-registry/code-management.js +109 -0
- package/dist/tool-registry/commit.js +20 -0
- package/dist/tool-registry/effort.js +39 -0
- package/dist/tool-registry/index.js +7 -0
- package/dist/tool-registry/organization.js +65 -0
- package/dist/tool-registry/packages.js +21 -0
- package/dist/tool-registry/pipeline.js +190 -0
- package/dist/tool-registry/project-management.js +143 -0
- package/dist/tool-registry/resourceMember.js +29 -0
- package/dist/tool-registry/service-connections.js +10 -0
- package/dist/tool-registry/tag.js +44 -0
- package/dist/tool-registry/test-management.js +59 -0
- package/dist/tool-registry/vmDeployOrder.js +34 -0
- package/package.json +52 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 代码库(Repository)相关操作
|
|
3
|
+
*
|
|
4
|
+
* 概念说明:
|
|
5
|
+
* - 代码库(Repository)是云效平台中的代码管理单元,属于CodeUp产品
|
|
6
|
+
* - 代码库与项目(Project)是不同的概念,项目属于项目管理领域
|
|
7
|
+
* - 代码库用于存储和管理源代码,而项目用于管理工作项、迭代等
|
|
8
|
+
* - 请勿混淆这两个概念,它们是不同的资源类型
|
|
9
|
+
*/
|
|
10
|
+
import { yunxiaoRequest, buildUrl, handleRepositoryIdEncoding, isRegionEdition } from "../../common/utils.js";
|
|
11
|
+
import { resolveOrganizationId } from "../organization/organization.js";
|
|
12
|
+
import { RepositorySchema } from "./types.js";
|
|
13
|
+
/**
|
|
14
|
+
* 查询仓库详情
|
|
15
|
+
* @param organizationId
|
|
16
|
+
* @param repositoryId
|
|
17
|
+
*/
|
|
18
|
+
export async function getRepositoryFunc(organizationId, repositoryId) {
|
|
19
|
+
const finalOrgId = await resolveOrganizationId(organizationId);
|
|
20
|
+
const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
|
|
21
|
+
const url = isRegionEdition()
|
|
22
|
+
? `/oapi/v1/codeup/repositories/${encodedRepoId}`
|
|
23
|
+
: `/oapi/v1/codeup/organizations/${finalOrgId}/repositories/${encodedRepoId}`;
|
|
24
|
+
const response = await yunxiaoRequest(url, {
|
|
25
|
+
method: "GET",
|
|
26
|
+
});
|
|
27
|
+
return RepositorySchema.parse(response);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 查询仓库列表
|
|
31
|
+
* @param organizationId
|
|
32
|
+
* @param page
|
|
33
|
+
* @param perPage
|
|
34
|
+
* @param orderBy
|
|
35
|
+
* @param sort
|
|
36
|
+
* @param search
|
|
37
|
+
* @param archived
|
|
38
|
+
*/
|
|
39
|
+
export async function listRepositoriesFunc(organizationId, page, perPage, orderBy, sort, search, archived) {
|
|
40
|
+
const finalOrgId = await resolveOrganizationId(organizationId);
|
|
41
|
+
const baseUrl = isRegionEdition()
|
|
42
|
+
? `/oapi/v1/codeup/repositories`
|
|
43
|
+
: `/oapi/v1/codeup/organizations/${finalOrgId}/repositories`;
|
|
44
|
+
const queryParams = {};
|
|
45
|
+
if (page !== undefined) {
|
|
46
|
+
queryParams.page = page;
|
|
47
|
+
}
|
|
48
|
+
if (perPage !== undefined) {
|
|
49
|
+
queryParams.perPage = perPage;
|
|
50
|
+
}
|
|
51
|
+
if (orderBy !== undefined) {
|
|
52
|
+
queryParams.orderBy = orderBy;
|
|
53
|
+
}
|
|
54
|
+
if (sort !== undefined) {
|
|
55
|
+
queryParams.sort = sort;
|
|
56
|
+
}
|
|
57
|
+
if (search !== undefined) {
|
|
58
|
+
queryParams.search = search;
|
|
59
|
+
}
|
|
60
|
+
if (archived !== undefined) {
|
|
61
|
+
queryParams.archived = String(archived); // Convert boolean to string
|
|
62
|
+
}
|
|
63
|
+
const url = buildUrl(baseUrl, queryParams);
|
|
64
|
+
const response = await yunxiaoRequest(url, {
|
|
65
|
+
method: "GET",
|
|
66
|
+
});
|
|
67
|
+
if (!Array.isArray(response)) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
return response.map(repo => RepositorySchema.parse(repo));
|
|
71
|
+
}
|
|
@@ -0,0 +1,414 @@
|
|
|
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("评论时间 (ISO 8601格式)"),
|
|
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("最后编辑时间 (ISO 8601格式)"),
|
|
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("最后解决状态变更时间 (ISO 8601格式)"),
|
|
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("版本创建时间 (ISO 8601格式)"),
|
|
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("创建时间 (ISO 8601格式)"),
|
|
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("审阅时间 (ISO 8601格式)"),
|
|
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("更新时间 (ISO 8601格式)"),
|
|
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 GetRepositorySchema = z.object({
|
|
234
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
235
|
+
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)"),
|
|
236
|
+
});
|
|
237
|
+
export const ListRepositoriesSchema = z.object({
|
|
238
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
239
|
+
page: z.number().int().default(1).optional().describe("Page number, default starts from 1, generally should not exceed 150 pages"),
|
|
240
|
+
perPage: z.number().int().default(20).optional().describe("Items per page, default 20, value range [1, 100]"),
|
|
241
|
+
orderBy: z.string().default("created_at").optional().describe("Sort field, options include {created_at, name, path, last_activity_at}, default is created_at"),
|
|
242
|
+
sort: z.string().default("desc").optional().describe("Sort order, options include {asc, desc}, default is desc"),
|
|
243
|
+
search: z.string().nullable().optional().describe("Search keyword, used to fuzzy match repository paths"),
|
|
244
|
+
archived: z.boolean().default(false).optional().describe("Whether archived"),
|
|
245
|
+
});
|
|
246
|
+
// Codeup files related Schema definitions
|
|
247
|
+
export const GetFileBlobsSchema = z.object({
|
|
248
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
249
|
+
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)"),
|
|
250
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
251
|
+
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"),
|
|
252
|
+
});
|
|
253
|
+
export const CreateFileSchema = z.object({
|
|
254
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
255
|
+
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)"),
|
|
256
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
257
|
+
content: z.string().describe("File content"),
|
|
258
|
+
commitMessage: z.string().describe("Commit message, not empty, no more than 102400 characters"),
|
|
259
|
+
branch: z.string().describe("Branch name"),
|
|
260
|
+
encoding: z.string().optional().describe("Encoding rule, options {text, base64}, default is text"),
|
|
261
|
+
});
|
|
262
|
+
export const UpdateFileSchema = z.object({
|
|
263
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
264
|
+
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)"),
|
|
265
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
266
|
+
content: z.string().describe("File content"),
|
|
267
|
+
commitMessage: z.string().describe("Commit message, not empty, no more than 102400 characters"),
|
|
268
|
+
branch: z.string().describe("Branch name"),
|
|
269
|
+
encoding: z.string().default("text").optional().describe("Encoding rule, options {text, base64}, default is text"),
|
|
270
|
+
});
|
|
271
|
+
export const DeleteFileSchema = z.object({
|
|
272
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
273
|
+
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)"),
|
|
274
|
+
filePath: z.string().describe("File path, needs to be URL encoded, for example: /src/main/java/com/aliyun/test.java"),
|
|
275
|
+
commitMessage: z.string().describe("Commit message"),
|
|
276
|
+
branch: z.string().describe("Branch name"),
|
|
277
|
+
});
|
|
278
|
+
export const ListFilesSchema = z.object({
|
|
279
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
280
|
+
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)"),
|
|
281
|
+
path: z.string().optional().describe("Specific path to query, for example to query files in the src/main directory"),
|
|
282
|
+
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"),
|
|
283
|
+
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)"),
|
|
284
|
+
});
|
|
285
|
+
// Codeup compare related Schema definitions
|
|
286
|
+
export const GetCompareSchema = z.object({
|
|
287
|
+
organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"),
|
|
288
|
+
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)"),
|
|
289
|
+
from: z.string().describe("Can be CommitSHA, branch name or tag name"),
|
|
290
|
+
to: z.string().describe("Can be CommitSHA, branch name or tag name"),
|
|
291
|
+
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"),
|
|
292
|
+
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"),
|
|
293
|
+
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"),
|
|
294
|
+
});
|
|
295
|
+
// Codeup change requests related Schema definitions
|
|
296
|
+
export const GetChangeRequestSchema = z.object({
|
|
297
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
298
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
299
|
+
localId: z.string().describe("局部ID,表示代码库中第几个合并请求。示例:'1' 或 '42'"),
|
|
300
|
+
});
|
|
301
|
+
export const ListChangeRequestsSchema = z.object({
|
|
302
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
303
|
+
page: z.number().int().default(1).optional().describe("页码,从1开始。示例:1"),
|
|
304
|
+
perPage: z.number().int().default(20).optional().describe("每页大小,默认20。示例:20"),
|
|
305
|
+
projectIds: z.string().nullable().optional().describe("代码库ID或者路径列表,多个以逗号分隔。示例:'2813489,2813490' 或 '2813489,60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
306
|
+
authorIds: z.string().nullable().optional().describe("创建者用户ID列表,多个以逗号分隔。示例:'62c795xxxb468af8' 或 '62c795xxxb468af8,62c795xxxb468af9'"),
|
|
307
|
+
reviewerIds: z.string().nullable().optional().describe("评审人用户ID列表,多个以逗号分隔。示例:'62c795xxxb468af8' 或 '62c795xxxb468af8,62c795xxxb468af9'"),
|
|
308
|
+
state: z.enum(["opened", "merged", "closed"]).nullable().optional().describe("合并请求筛选状态。opened - 已开启;merged - 已合并;closed - 已关闭。默认为null,即查询全部状态。示例:'opened'"),
|
|
309
|
+
search: z.string().nullable().optional().describe("标题关键字搜索,用于在合并请求标题中搜索。示例:'mr title' 或 'bug fix'"),
|
|
310
|
+
orderBy: z.enum(["created_at", "updated_at"]).default("updated_at").optional().describe("排序字段。created_at - 按创建时间排序;updated_at - 按更新时间排序(默认)。示例:'updated_at'"),
|
|
311
|
+
sort: z.enum(["asc", "desc"]).default("desc").optional().describe("排序方式。asc - 升序;desc - 降序(默认)。示例:'desc'"),
|
|
312
|
+
createdBefore: z.string().nullable().optional().describe("起始创建时间,时间格式为ISO 8601。查询创建时间不早于此时间的合并请求。示例:'2024-04-05T15:30:45Z'"),
|
|
313
|
+
createdAfter: z.string().nullable().optional().describe("截止创建时间,时间格式为ISO 8601。查询创建时间不晚于此时间的合并请求。示例:'2024-04-05T15:30:45Z'"),
|
|
314
|
+
});
|
|
315
|
+
export const CreateChangeRequestSchema = z.object({
|
|
316
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
317
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
318
|
+
title: z.string().max(256).describe("标题,不超过256个字符。示例:'mr title' 或 '修复登录bug'"),
|
|
319
|
+
description: z.string().max(10000).nullable().optional().describe("描述,不超过10000个字符。示例:'mr description' 或 '修复了用户登录时的验证逻辑问题'"),
|
|
320
|
+
sourceBranch: z.string().describe("源分支名称,即要合并的分支。示例:'demo-branch' 或 'feature/user-login'"),
|
|
321
|
+
sourceProjectId: z.number().int().optional().describe("源库ID,如果未提供,将尝试自动获取。示例:2813489"),
|
|
322
|
+
targetBranch: z.string().describe("目标分支名称,即合并到的分支。示例:'master' 或 'main'"),
|
|
323
|
+
targetProjectId: z.number().int().optional().describe("目标库ID,如果未提供,将尝试自动获取。示例:2813489"),
|
|
324
|
+
reviewerUserIds: z.array(z.string()).nullable().optional().describe("评审人用户ID列表。示例:['62c795xxxb468af8'] 或 ['62c795xxxb468af8', '62c795xxxb468af9']"),
|
|
325
|
+
workItemIds: z.array(z.string()).nullable().optional().describe("关联工作项ID列表。示例:['workitem-123', 'workitem-456']"),
|
|
326
|
+
createFrom: z.enum(["WEB", "COMMAND_LINE"]).optional().default("WEB").describe("创建来源。WEB - 页面创建;COMMAND_LINE - 命令行创建。默认为WEB"),
|
|
327
|
+
triggerAIReviewRun: z.boolean().optional().default(false).describe("是否触发AI评审。true - 触发AI评审;false - 不触发(默认)"),
|
|
328
|
+
});
|
|
329
|
+
export const ListChangeRequestPatchSetsSchema = z.object({
|
|
330
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
331
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
332
|
+
localId: z.string().describe("局部ID,表示代码库中第几个合并请求。示例:'1' 或 '42'"),
|
|
333
|
+
});
|
|
334
|
+
// Codeup change request comments related Schema definitions
|
|
335
|
+
export const CreateChangeRequestCommentSchema = z.object({
|
|
336
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
337
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
338
|
+
localId: z.string().describe("局部ID,表示代码库中第几个合并请求。示例:'1' 或 '42'"),
|
|
339
|
+
comment_type: z.enum(["GLOBAL_COMMENT", "INLINE_COMMENT"]).default("GLOBAL_COMMENT").describe("评论类型。GLOBAL_COMMENT - 全局评论(对整个合并请求的评论);INLINE_COMMENT - 行内评论(针对特定代码行的评论)。创建行内评论时,必须提供 file_path、line_number、from_patchset_biz_id 和 to_patchset_biz_id 参数"),
|
|
340
|
+
content: z.string().min(1).max(65535).describe("评论内容,长度必须在 1 到 65535 之间。示例:'This is a comment content.' 或 '这里需要优化性能,建议使用缓存机制'"),
|
|
341
|
+
draft: z.boolean().default(false).describe("是否草稿评论。true - 草稿评论(不会立即显示给其他人);false - 正式评论(默认值)"),
|
|
342
|
+
resolved: z.boolean().default(false).describe("是否标记已解决。true - 已解决;false - 未解决(默认值)"),
|
|
343
|
+
patchset_biz_id: z.string().describe("关联版本ID,具有唯一性。对于全局评论,使用最新合并源版本ID;对于行内评论,选择 from_patchset_biz_id 或 to_patchset_biz_id 中的一个。示例:'bf117304dfe44d5d9b1132f348edf92e'"),
|
|
344
|
+
file_path: z.string().optional().describe("文件路径,仅行内评论需要。表示评论针对的文件路径。示例:'/src/main/java/com/example/MyClass.java' 或 'src/utils/helper.ts' 或 'frontend/components/Button.tsx'"),
|
|
345
|
+
line_number: z.number().int().positive().optional().describe("行号,仅行内评论需要。表示评论针对的代码行号,从1开始计数。示例:42 表示第42行,100 表示第100行"),
|
|
346
|
+
from_patchset_biz_id: z.string().optional().describe("比较的起始版本ID,行内评论类型必传。表示代码比较的起始版本(通常是目标分支版本,即合并目标对应的版本)。示例:'bf117304dfe44d5d9b1132f348edf92e'"),
|
|
347
|
+
to_patchset_biz_id: z.string().optional().describe("比较的目标版本ID,行内评论类型必传。表示代码比较的目标版本(通常是源分支版本,即合并源对应的版本)。示例:'537367017a9841738ac4269fbf6aacbe'"),
|
|
348
|
+
parent_comment_biz_id: z.string().optional().describe("父评论ID,用于回复评论。如果这是对某个评论的回复,需要传入被回复评论的 bizId。示例:'1d8171cf0cc2453197fae0e0a27d5ece'"),
|
|
349
|
+
});
|
|
350
|
+
export const ListChangeRequestCommentsSchema = z.object({
|
|
351
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
352
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
353
|
+
localId: z.string().describe("合并请求局部ID,表示代码库中第几个合并请求。示例:'1' 或 '42'"),
|
|
354
|
+
patchSetBizIds: z.array(z.string()).optional().describe("关联版本ID列表,每个评论都关联一个版本,表示该评论是在哪个版本上发布的。对于全局评论,关联的是最新合并源版本。示例:['bf117304dfe44d5d9b1132f348edf92e', '537367017a9841738ac4269fbf6aacbe']"),
|
|
355
|
+
commentType: z.enum(["GLOBAL_COMMENT", "INLINE_COMMENT"]).optional().default("GLOBAL_COMMENT").describe("评论类型。GLOBAL_COMMENT - 全局评论;INLINE_COMMENT - 行内评论"),
|
|
356
|
+
state: z.enum(["OPENED", "DRAFT"]).optional().default("OPENED").describe("评论状态。OPENED - 已发布的评论;DRAFT - 草稿评论"),
|
|
357
|
+
resolved: z.boolean().optional().default(false).describe("是否已解决。true - 只查询已解决的评论;false - 只查询未解决的评论(默认值)"),
|
|
358
|
+
filePath: z.string().optional().describe("文件路径过滤,仅用于行内评论。可以过滤特定文件的评论。示例:'/src/main/java/com/example/MyClass.java' 或 'src/utils/helper.ts'"),
|
|
359
|
+
});
|
|
360
|
+
export const UpdateChangeRequestCommentSchema = z.object({
|
|
361
|
+
organizationId: z.string().describe("组织ID,可在组织管理后台的基本信息页面获取。示例:'60d54f3daccf2bbd6659f3ad'"),
|
|
362
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径。示例:'2835387' 或 '60de7a6852743a5162b5f957%2FDemoRepo'(注意:斜杠需要URL编码为%2F)"),
|
|
363
|
+
localId: z.string().describe("合并请求局部ID,表示代码库中第几个合并请求。示例:'1' 或 '42'"),
|
|
364
|
+
commentBizId: z.string().describe("评论 bizId,具有唯一性,用于标识要更新的评论。示例:'bf117304dfe44d5d9b1132f348edf92e'"),
|
|
365
|
+
content: z.string().min(1).optional().describe("评论内容,更新后的评论内容(可选)。如果提供,将更新评论的文本内容。示例:'your new comment' 或 '更新后的评论内容:这里需要优化性能,建议使用缓存机制'"),
|
|
366
|
+
resolved: z.boolean().optional().describe("是否已解决(可选)。true - 标记为已解决;false - 标记为未解决。示例:false。如果不提供此参数,将保持原有的解决状态不变"),
|
|
367
|
+
});
|
|
368
|
+
// Codeup commit related Schema definitions
|
|
369
|
+
export const ListCommitsRequestSchema = z.object({
|
|
370
|
+
organizationId: z.string().describe("组织ID"),
|
|
371
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径"),
|
|
372
|
+
refName: z.string().describe("分支名称、标签名称或提交版本,默认为代码库默认分支"),
|
|
373
|
+
since: z.string().optional().describe("提交起始时间,格式:YYYY-MM-DDTHH:MM:SSZ"),
|
|
374
|
+
until: z.string().optional().describe("提交截止时间,格式:YYYY-MM-DDTHH:MM:SSZ"),
|
|
375
|
+
page: z.number().int().optional().describe("页码"),
|
|
376
|
+
perPage: z.number().int().optional().describe("每页大小"),
|
|
377
|
+
path: z.string().optional().describe("文件路径"),
|
|
378
|
+
search: z.string().optional().describe("搜索关键字"),
|
|
379
|
+
showSignature: z.boolean().optional().describe("是否展示签名"),
|
|
380
|
+
committerIds: z.string().optional().describe("提交人ID列表(多个ID以逗号隔开)"),
|
|
381
|
+
});
|
|
382
|
+
export const GetCommitRequestSchema = z.object({
|
|
383
|
+
organizationId: z.string().describe("组织ID"),
|
|
384
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径"),
|
|
385
|
+
sha: z.string().describe("提交ID,即Commit SHA值"),
|
|
386
|
+
});
|
|
387
|
+
export const CreateCommitCommentRequestSchema = z.object({
|
|
388
|
+
organizationId: z.string().describe("组织ID"),
|
|
389
|
+
repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径"),
|
|
390
|
+
sha: z.string().describe("提交的SHA值"),
|
|
391
|
+
content: z.string().describe("commit的评论内容"),
|
|
392
|
+
});
|
|
393
|
+
export const DevopsCommitVOSchema = z.object({
|
|
394
|
+
id: z.string().nullable().optional().describe("提交ID"),
|
|
395
|
+
shortId: z.string().nullable().optional().describe("代码组路径"),
|
|
396
|
+
title: z.string().nullable().optional().describe("标题,提交的第一行内容"),
|
|
397
|
+
message: z.string().nullable().optional().describe("提交内容"),
|
|
398
|
+
authorName: z.string().nullable().optional().describe("作者姓名"),
|
|
399
|
+
authorEmail: z.string().nullable().optional().describe("作者邮箱"),
|
|
400
|
+
authoredDate: z.string().nullable().optional().describe("作者提交时间"),
|
|
401
|
+
committerName: z.string().nullable().optional().describe("提交者姓名"),
|
|
402
|
+
committerEmail: z.string().nullable().optional().describe("提交者邮箱"),
|
|
403
|
+
committedDate: z.string().nullable().optional().describe("提交者提交时间"),
|
|
404
|
+
webUrl: z.string().nullable().optional().describe("页面访问地址"),
|
|
405
|
+
parentIds: z.array(z.string()).nullable().optional().describe("父提交ID"),
|
|
406
|
+
});
|
|
407
|
+
export const DevopsCommitStatVOSchema = z.object({
|
|
408
|
+
additions: z.number().int().nullable().optional().describe("增加行数"),
|
|
409
|
+
deletions: z.number().int().nullable().optional().describe("删除行数"),
|
|
410
|
+
total: z.number().int().nullable().optional().describe("总变动行数"),
|
|
411
|
+
});
|
|
412
|
+
export const CreateCommitCommentVOSchema = z.object({
|
|
413
|
+
content: z.string().describe("commit的评论内容"),
|
|
414
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as utils from "../../common/utils.js";
|
|
2
|
+
import { resolveOrganizationId } from "../organization/organization.js";
|
|
3
|
+
import { HostGroupSchema } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* 获取主机组列表
|
|
6
|
+
* @param organizationId 组织ID
|
|
7
|
+
* @param options 查询选项
|
|
8
|
+
* @returns 主机组列表
|
|
9
|
+
*/
|
|
10
|
+
export async function listHostGroupsFunc(organizationId, options) {
|
|
11
|
+
const finalOrgId = await resolveOrganizationId(organizationId);
|
|
12
|
+
const baseUrl = utils.isRegionEdition()
|
|
13
|
+
? `/oapi/v1/flow/hostGroups`
|
|
14
|
+
: `/oapi/v1/flow/organizations/${finalOrgId}/hostGroups`;
|
|
15
|
+
// 构建查询参数
|
|
16
|
+
const queryParams = {};
|
|
17
|
+
if (options?.ids !== undefined) {
|
|
18
|
+
queryParams.ids = options.ids;
|
|
19
|
+
}
|
|
20
|
+
if (options?.name !== undefined) {
|
|
21
|
+
queryParams.name = options.name;
|
|
22
|
+
}
|
|
23
|
+
if (options?.createStartTime !== undefined) {
|
|
24
|
+
queryParams.createStartTime = options.createStartTime;
|
|
25
|
+
}
|
|
26
|
+
if (options?.createEndTime !== undefined) {
|
|
27
|
+
queryParams.createEndTime = options.createEndTime;
|
|
28
|
+
}
|
|
29
|
+
if (options?.creatorAccountIds !== undefined) {
|
|
30
|
+
queryParams.creatorAccountIds = options.creatorAccountIds;
|
|
31
|
+
}
|
|
32
|
+
if (options?.perPage !== undefined) {
|
|
33
|
+
queryParams.perPage = options.perPage;
|
|
34
|
+
}
|
|
35
|
+
if (options?.page !== undefined) {
|
|
36
|
+
queryParams.page = options.page;
|
|
37
|
+
}
|
|
38
|
+
if (options?.pageSort !== undefined) {
|
|
39
|
+
queryParams.pageSort = options.pageSort;
|
|
40
|
+
}
|
|
41
|
+
if (options?.pageOrder !== undefined) {
|
|
42
|
+
queryParams.pageOrder = options.pageOrder;
|
|
43
|
+
}
|
|
44
|
+
const url = utils.buildUrl(baseUrl, queryParams);
|
|
45
|
+
const response = await utils.yunxiaoRequest(url, {
|
|
46
|
+
method: "GET",
|
|
47
|
+
});
|
|
48
|
+
if (!Array.isArray(response)) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return response.map(item => HostGroupSchema.parse(item));
|
|
52
|
+
}
|