@taole/deploy-helper 1.0.2 → 1.0.4
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/README.md +1 -4
- package/index.mjs +2 -39
- package/lib/pipelineApi.mjs +17 -16
- package/lib/util.mjs +0 -40
- package/lib/yunxiaoFlowApi.mjs +115 -0
- package/package.json +4 -7
- package/lib/offlinePkg.mjs +0 -333
- package/lib/upload.js +0 -49
- package/modules/alibabacloud-devops-mcp-server/dist/common/errors.js +0 -69
- package/modules/alibabacloud-devops-mcp-server/dist/common/modularTemplates.js +0 -483
- package/modules/alibabacloud-devops-mcp-server/dist/common/pipelineTemplates.js +0 -19
- package/modules/alibabacloud-devops-mcp-server/dist/common/types.js +0 -1119
- package/modules/alibabacloud-devops-mcp-server/dist/common/utils.js +0 -353
- package/modules/alibabacloud-devops-mcp-server/dist/common/version.js +0 -1
- package/modules/alibabacloud-devops-mcp-server/dist/index.js +0 -1067
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/branches.js +0 -144
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/changeRequestComments.js +0 -89
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/changeRequests.js +0 -203
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/compare.js +0 -26
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/files.js +0 -233
- package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/repositories.js +0 -64
- package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/hostGroup.js +0 -48
- package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/pipeline.js +0 -514
- package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/pipelineJob.js +0 -113
- package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/serviceConnection.js +0 -23
- package/modules/alibabacloud-devops-mcp-server/dist/operations/organization/members.js +0 -94
- package/modules/alibabacloud-devops-mcp-server/dist/operations/organization/organization.js +0 -73
- package/modules/alibabacloud-devops-mcp-server/dist/operations/packages/artifacts.js +0 -64
- package/modules/alibabacloud-devops-mcp-server/dist/operations/packages/repositories.js +0 -35
- package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/project.js +0 -206
- package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/sprint.js +0 -30
- package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/workitem.js +0 -264
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { yunxiaoRequest, buildUrl, pathEscape } from "../../common/utils.js";
|
|
2
|
-
import { FileContentSchema, CreateFileResponseSchema, DeleteFileResponseSchema, FileInfoSchema } from "../../common/types.js";
|
|
3
|
-
// Common helper function to handle repositoryId and filePath encoding
|
|
4
|
-
function handlePathEncoding(repositoryId, filePath) {
|
|
5
|
-
let encodedRepoId = repositoryId;
|
|
6
|
-
let encodedFilePath = filePath;
|
|
7
|
-
// 自动处理repositoryId中未编码的斜杠
|
|
8
|
-
if (repositoryId.includes("/")) {
|
|
9
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
10
|
-
const parts = repositoryId.split("/", 2);
|
|
11
|
-
if (parts.length === 2) {
|
|
12
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
13
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
14
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
15
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
// 确保filePath已被URL编码
|
|
19
|
-
if (filePath.includes("/")) {
|
|
20
|
-
const startsWithSlash = filePath.startsWith("/");
|
|
21
|
-
if (startsWithSlash) {
|
|
22
|
-
encodedFilePath = encodedFilePath.substring(1);
|
|
23
|
-
}
|
|
24
|
-
encodedFilePath = encodeURIComponent(filePath);
|
|
25
|
-
}
|
|
26
|
-
return { encodedRepoId, encodedFilePath };
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* 查询文件内容
|
|
30
|
-
* @param organizationId
|
|
31
|
-
* @param repositoryId
|
|
32
|
-
* @param filePath
|
|
33
|
-
* @param ref
|
|
34
|
-
*/
|
|
35
|
-
export async function getFileBlobsFunc(organizationId, repositoryId, filePath, ref) {
|
|
36
|
-
// const { encodedRepoId, encodedFilePath } = handlePathEncoding(repositoryId, filePath);
|
|
37
|
-
let encodedRepoId = repositoryId;
|
|
38
|
-
let encodedFilePath = filePath;
|
|
39
|
-
// 自动处理repositoryId中未编码的斜杠
|
|
40
|
-
if (repositoryId.includes("/")) {
|
|
41
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
42
|
-
const parts = repositoryId.split("/", 2);
|
|
43
|
-
if (parts.length === 2) {
|
|
44
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
45
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
46
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
47
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// 确保filePath已被URL编码
|
|
51
|
-
if (filePath.includes("/")) {
|
|
52
|
-
encodedFilePath = encodeURIComponent(filePath);
|
|
53
|
-
}
|
|
54
|
-
const baseUrl = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/files/${encodedFilePath}`;
|
|
55
|
-
// 构建查询参数
|
|
56
|
-
const queryParams = {
|
|
57
|
-
ref: ref
|
|
58
|
-
};
|
|
59
|
-
// 使用buildUrl函数构建包含查询参数的URL
|
|
60
|
-
const url = buildUrl(baseUrl, queryParams);
|
|
61
|
-
const response = await yunxiaoRequest(url, {
|
|
62
|
-
method: "GET",
|
|
63
|
-
});
|
|
64
|
-
return FileContentSchema.parse(response);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* 创建文件
|
|
68
|
-
* @param organizationId
|
|
69
|
-
* @param repositoryId
|
|
70
|
-
* @param filePath
|
|
71
|
-
* @param content
|
|
72
|
-
* @param commitMessage
|
|
73
|
-
* @param branch
|
|
74
|
-
* @param encoding
|
|
75
|
-
*/
|
|
76
|
-
export async function createFileFunc(organizationId, repositoryId, filePath, content, commitMessage, branch, encoding) {
|
|
77
|
-
let encodedRepoId = repositoryId;
|
|
78
|
-
let encodedFilePath = filePath;
|
|
79
|
-
if (repositoryId.includes("/")) {
|
|
80
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
81
|
-
const parts = repositoryId.split("/", 2);
|
|
82
|
-
if (parts.length === 2) {
|
|
83
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
84
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
85
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
86
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// 确保filePath已被URL编码
|
|
90
|
-
if (filePath.includes("/")) {
|
|
91
|
-
encodedFilePath = pathEscape(filePath);
|
|
92
|
-
}
|
|
93
|
-
const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/files`;
|
|
94
|
-
const body = {
|
|
95
|
-
branch: branch,
|
|
96
|
-
filePath: encodedFilePath,
|
|
97
|
-
content: content,
|
|
98
|
-
commitMessage: commitMessage,
|
|
99
|
-
encoding: encoding || "text" // 默认使用text编码
|
|
100
|
-
};
|
|
101
|
-
const response = await yunxiaoRequest(url, {
|
|
102
|
-
method: "POST",
|
|
103
|
-
body: body
|
|
104
|
-
});
|
|
105
|
-
return CreateFileResponseSchema.parse(response);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 更新文件内容
|
|
109
|
-
* @param organizationId
|
|
110
|
-
* @param repositoryId
|
|
111
|
-
* @param filePath
|
|
112
|
-
* @param content
|
|
113
|
-
* @param commitMessage
|
|
114
|
-
* @param branch
|
|
115
|
-
* @param encoding
|
|
116
|
-
*/
|
|
117
|
-
export async function updateFileFunc(organizationId, repositoryId, filePath, content, commitMessage, branch, encoding) {
|
|
118
|
-
//const { encodedRepoId, encodedFilePath } = handlePathEncoding(repositoryId, filePath);
|
|
119
|
-
let encodedRepoId = repositoryId;
|
|
120
|
-
let encodedFilePath = filePath;
|
|
121
|
-
// 自动处理repositoryId中未编码的斜杠
|
|
122
|
-
if (repositoryId.includes("/")) {
|
|
123
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
124
|
-
const parts = repositoryId.split("/", 2);
|
|
125
|
-
if (parts.length === 2) {
|
|
126
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
127
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
128
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
129
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
// 确保filePath已被URL编码
|
|
133
|
-
if (filePath.includes("/")) {
|
|
134
|
-
const pathToEncode = filePath.startsWith("/") ? filePath.substring(1) : filePath;
|
|
135
|
-
encodedFilePath = encodeURIComponent(pathToEncode);
|
|
136
|
-
}
|
|
137
|
-
const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/files/${encodedFilePath}`;
|
|
138
|
-
const body = {
|
|
139
|
-
branch: branch,
|
|
140
|
-
commitMessage: commitMessage,
|
|
141
|
-
content: content,
|
|
142
|
-
encoding: encoding || "text" // 默认使用text编码
|
|
143
|
-
};
|
|
144
|
-
const response = await yunxiaoRequest(url, {
|
|
145
|
-
method: "PUT",
|
|
146
|
-
body: body
|
|
147
|
-
});
|
|
148
|
-
return CreateFileResponseSchema.parse(response);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* 删除文件
|
|
152
|
-
* @param organizationId
|
|
153
|
-
* @param repositoryId
|
|
154
|
-
* @param filePath
|
|
155
|
-
* @param commitMessage
|
|
156
|
-
* @param branch
|
|
157
|
-
*/
|
|
158
|
-
export async function deleteFileFunc(organizationId, repositoryId, filePath, commitMessage, branch) {
|
|
159
|
-
let encodedRepoId = repositoryId;
|
|
160
|
-
let encodedFilePath = filePath;
|
|
161
|
-
if (repositoryId.includes("/")) {
|
|
162
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
163
|
-
const parts = repositoryId.split("/", 2);
|
|
164
|
-
if (parts.length === 2) {
|
|
165
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
166
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
167
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
168
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// 确保filePath已被URL编码
|
|
172
|
-
if (filePath.includes("/")) {
|
|
173
|
-
encodedFilePath = encodeURIComponent(filePath);
|
|
174
|
-
}
|
|
175
|
-
const baseUrl = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/files/${encodedFilePath}`;
|
|
176
|
-
// 构建查询参数
|
|
177
|
-
const queryParams = {
|
|
178
|
-
branch: branch,
|
|
179
|
-
commitMessage: commitMessage
|
|
180
|
-
};
|
|
181
|
-
// 使用buildUrl函数构建包含查询参数的URL
|
|
182
|
-
const url = buildUrl(baseUrl, queryParams);
|
|
183
|
-
const response = await yunxiaoRequest(url, {
|
|
184
|
-
method: "DELETE",
|
|
185
|
-
});
|
|
186
|
-
return DeleteFileResponseSchema.parse(response);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* 查询文件树
|
|
190
|
-
* @param organizationId
|
|
191
|
-
* @param repositoryId
|
|
192
|
-
* @param path
|
|
193
|
-
* @param ref
|
|
194
|
-
* @param type
|
|
195
|
-
*/
|
|
196
|
-
export async function listFilesFunc(organizationId, repositoryId, path, ref, type // Possible values: DIRECT, RECURSIVE, FLATTEN
|
|
197
|
-
) {
|
|
198
|
-
// 自动处理repositoryId中未编码的斜杠
|
|
199
|
-
let encodedRepoId = repositoryId;
|
|
200
|
-
if (repositoryId.includes("/")) {
|
|
201
|
-
// 发现未编码的斜杠,自动进行URL编码
|
|
202
|
-
const parts = repositoryId.split("/", 2);
|
|
203
|
-
if (parts.length === 2) {
|
|
204
|
-
const encodedRepoName = encodeURIComponent(parts[1]);
|
|
205
|
-
// 移除编码中的+号(空格被编码为+,但我们需要%20)
|
|
206
|
-
const formattedEncodedName = encodedRepoName.replace(/\+/g, "%20");
|
|
207
|
-
encodedRepoId = `${parts[0]}%2F${formattedEncodedName}`;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
const baseUrl = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/files/tree`;
|
|
211
|
-
// 构建查询参数
|
|
212
|
-
const queryParams = {};
|
|
213
|
-
if (path) {
|
|
214
|
-
queryParams.path = path;
|
|
215
|
-
}
|
|
216
|
-
if (ref) {
|
|
217
|
-
queryParams.ref = ref;
|
|
218
|
-
}
|
|
219
|
-
if (type) {
|
|
220
|
-
queryParams.type = type;
|
|
221
|
-
}
|
|
222
|
-
// 使用buildUrl函数构建包含查询参数的URL
|
|
223
|
-
const url = buildUrl(baseUrl, queryParams);
|
|
224
|
-
const response = await yunxiaoRequest(url, {
|
|
225
|
-
method: "GET",
|
|
226
|
-
});
|
|
227
|
-
// 确保响应是数组
|
|
228
|
-
if (!Array.isArray(response)) {
|
|
229
|
-
return [];
|
|
230
|
-
}
|
|
231
|
-
// 解析每个文件信息对象
|
|
232
|
-
return response.map(fileInfo => FileInfoSchema.parse(fileInfo));
|
|
233
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 代码库(Repository)相关操作
|
|
3
|
-
*
|
|
4
|
-
* 概念说明:
|
|
5
|
-
* - 代码库(Repository)是云效平台中的代码管理单元,属于CodeUp产品
|
|
6
|
-
* - 代码库与项目(Project)是不同的概念,项目属于项目管理领域
|
|
7
|
-
* - 代码库用于存储和管理源代码,而项目用于管理工作项、迭代等
|
|
8
|
-
* - 请勿混淆这两个概念,它们是不同的资源类型
|
|
9
|
-
*/
|
|
10
|
-
import { yunxiaoRequest, buildUrl, handleRepositoryIdEncoding } from "../../common/utils.js";
|
|
11
|
-
import { RepositorySchema } from "../../common/types.js";
|
|
12
|
-
/**
|
|
13
|
-
* 查询仓库详情
|
|
14
|
-
* @param organizationId
|
|
15
|
-
* @param repositoryId
|
|
16
|
-
*/
|
|
17
|
-
export async function getRepositoryFunc(organizationId, repositoryId) {
|
|
18
|
-
const encodedRepoId = handleRepositoryIdEncoding(repositoryId);
|
|
19
|
-
const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}`;
|
|
20
|
-
const response = await yunxiaoRequest(url, {
|
|
21
|
-
method: "GET",
|
|
22
|
-
});
|
|
23
|
-
return RepositorySchema.parse(response);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 查询仓库列表
|
|
27
|
-
* @param organizationId
|
|
28
|
-
* @param page
|
|
29
|
-
* @param perPage
|
|
30
|
-
* @param orderBy
|
|
31
|
-
* @param sort
|
|
32
|
-
* @param search
|
|
33
|
-
* @param archived
|
|
34
|
-
*/
|
|
35
|
-
export async function listRepositoriesFunc(organizationId, page, perPage, orderBy, sort, search, archived) {
|
|
36
|
-
const baseUrl = `/oapi/v1/codeup/organizations/${organizationId}/repositories`;
|
|
37
|
-
const queryParams = {};
|
|
38
|
-
if (page !== undefined) {
|
|
39
|
-
queryParams.page = page;
|
|
40
|
-
}
|
|
41
|
-
if (perPage !== undefined) {
|
|
42
|
-
queryParams.perPage = perPage;
|
|
43
|
-
}
|
|
44
|
-
if (orderBy !== undefined) {
|
|
45
|
-
queryParams.orderBy = orderBy;
|
|
46
|
-
}
|
|
47
|
-
if (sort !== undefined) {
|
|
48
|
-
queryParams.sort = sort;
|
|
49
|
-
}
|
|
50
|
-
if (search !== undefined) {
|
|
51
|
-
queryParams.search = search;
|
|
52
|
-
}
|
|
53
|
-
if (archived !== undefined) {
|
|
54
|
-
queryParams.archived = String(archived); // Convert boolean to string
|
|
55
|
-
}
|
|
56
|
-
const url = buildUrl(baseUrl, queryParams);
|
|
57
|
-
const response = await yunxiaoRequest(url, {
|
|
58
|
-
method: "GET",
|
|
59
|
-
});
|
|
60
|
-
if (!Array.isArray(response)) {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
return response.map(repo => RepositorySchema.parse(repo));
|
|
64
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as utils from "../../common/utils.js";
|
|
2
|
-
import { HostGroupSchema } from "../../common/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
|
-
}
|