@taole/deploy-helper 1.0.1 → 1.0.3

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.
Files changed (29) hide show
  1. package/README.md +1 -4
  2. package/lib/offlinePkg.mjs +21 -2
  3. package/lib/pipelineApi.mjs +17 -16
  4. package/lib/yunxiaoFlowApi.mjs +115 -0
  5. package/package.json +4 -5
  6. package/modules/alibabacloud-devops-mcp-server/dist/common/errors.js +0 -69
  7. package/modules/alibabacloud-devops-mcp-server/dist/common/modularTemplates.js +0 -483
  8. package/modules/alibabacloud-devops-mcp-server/dist/common/pipelineTemplates.js +0 -19
  9. package/modules/alibabacloud-devops-mcp-server/dist/common/types.js +0 -1119
  10. package/modules/alibabacloud-devops-mcp-server/dist/common/utils.js +0 -353
  11. package/modules/alibabacloud-devops-mcp-server/dist/common/version.js +0 -1
  12. package/modules/alibabacloud-devops-mcp-server/dist/index.js +0 -1067
  13. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/branches.js +0 -144
  14. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/changeRequestComments.js +0 -89
  15. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/changeRequests.js +0 -203
  16. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/compare.js +0 -26
  17. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/files.js +0 -233
  18. package/modules/alibabacloud-devops-mcp-server/dist/operations/codeup/repositories.js +0 -64
  19. package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/hostGroup.js +0 -48
  20. package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/pipeline.js +0 -514
  21. package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/pipelineJob.js +0 -113
  22. package/modules/alibabacloud-devops-mcp-server/dist/operations/flow/serviceConnection.js +0 -23
  23. package/modules/alibabacloud-devops-mcp-server/dist/operations/organization/members.js +0 -94
  24. package/modules/alibabacloud-devops-mcp-server/dist/operations/organization/organization.js +0 -73
  25. package/modules/alibabacloud-devops-mcp-server/dist/operations/packages/artifacts.js +0 -64
  26. package/modules/alibabacloud-devops-mcp-server/dist/operations/packages/repositories.js +0 -35
  27. package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/project.js +0 -206
  28. package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/sprint.js +0 -30
  29. package/modules/alibabacloud-devops-mcp-server/dist/operations/projex/workitem.js +0 -264
@@ -1,94 +0,0 @@
1
- import { OrganizationMembersSchema, MemberInfoSchema, SearchOrganizationMembersResultSchema, } from '../../common/types.js';
2
- import { buildUrl, yunxiaoRequest } from "../../common/utils.js";
3
- /**
4
- * 查询组织成员列表
5
- * @param organizationId 组织ID
6
- * @param page 当前页,默认1
7
- * @param perPage 每页数据条数,默认100
8
- * @returns 组织成员列表
9
- */
10
- export const getOrganizationMembersFunc = async (organizationId, page = 1, perPage = 100) => {
11
- const url = `/oapi/v1/platform/organizations/${organizationId}/members`;
12
- const params = {
13
- page: page,
14
- perPage: perPage
15
- };
16
- const urlWithParams = buildUrl(url, params);
17
- const response = await yunxiaoRequest(urlWithParams, {
18
- method: "GET",
19
- });
20
- // 验证响应数据结构
21
- return OrganizationMembersSchema.parse(response);
22
- };
23
- /**
24
- * 查询组织成员详细信息
25
- * @param organizationId 组织ID
26
- * @param memberId 成员ID
27
- * @returns 组织成员详细信息
28
- */
29
- export const getOrganizationMemberInfoFunc = async (organizationId, memberId) => {
30
- const url = `/oapi/v1/platform/organizations/${organizationId}/members/${memberId}`;
31
- console.log("aaa", url);
32
- const response = await yunxiaoRequest(url, {
33
- method: "GET",
34
- });
35
- return MemberInfoSchema.parse(response);
36
- };
37
- /**
38
- * 搜索组织成员
39
- * @param organizationId 组织ID
40
- * @param includeChildren
41
- * @param page 当前页,默认1
42
- * @param perPage 每页数据条数,默认100
43
- * @param deptIds
44
- * @param nextToken
45
- * @param query
46
- * @param roleIds
47
- * @param statuses
48
- * @returns 搜索到的组织成员列表
49
- */
50
- export const searchOrganizationMembersFunc = async (organizationId, includeChildren = false, page = 1, perPage = 100, deptIds, nextToken, query, roleIds, statuses) => {
51
- const url = `/oapi/v1/platform/organizations/${organizationId}/members:search`;
52
- const payload = {
53
- page: page,
54
- perPage: perPage
55
- };
56
- if (deptIds) {
57
- payload.deptIds = deptIds;
58
- }
59
- if (nextToken) {
60
- payload.nextToken = nextToken;
61
- }
62
- if (query) {
63
- payload.query = query;
64
- }
65
- if (roleIds) {
66
- payload.roleIds = roleIds;
67
- }
68
- if (statuses) {
69
- payload.statuses = statuses;
70
- }
71
- const response = await yunxiaoRequest(url, {
72
- method: "POST",
73
- body: payload,
74
- });
75
- // 验证响应数据结构
76
- return SearchOrganizationMembersResultSchema.parse(response);
77
- };
78
- /**
79
- * 通过用户ID查询组织成员详细信息
80
- * @param organizationId 组织ID
81
- * @param userId 用户ID
82
- * @returns 组织成员详细信息
83
- */
84
- export const getOrganizationMemberByUserIdInfoFunc = async (organizationId, userId) => {
85
- const url = `/oapi/v1/platform/organizations/${organizationId}/members:readByUser`;
86
- const params = {
87
- userId: userId
88
- };
89
- const urlWithParams = buildUrl(url, params);
90
- const response = await yunxiaoRequest(urlWithParams, {
91
- method: "GET",
92
- });
93
- return MemberInfoSchema.parse(response);
94
- };
@@ -1,73 +0,0 @@
1
- import { buildUrl, yunxiaoRequest } from "../../common/utils.js";
2
- import { CurrentOrganizationInfoSchema, UserOrganizationsInfoSchema, CurrentUserSchema, OrganizationDepartmentsSchema, DepartmentInfoSchema, OrganizationRoleSchema, OrganizationRole, } from "../../common/types.js";
3
- export async function getCurrentOrganizationInfoFunc() {
4
- const url = "/oapi/v1/platform/user";
5
- const response = await yunxiaoRequest(url, {
6
- method: "GET",
7
- });
8
- const responseData = response;
9
- const mappedResponse = {
10
- lastOrganization: responseData.lastOrganization, // Organization ID
11
- userId: responseData.id, // Map API's "id" to userId
12
- userName: responseData.name // Map API's "name" to userName
13
- };
14
- return CurrentOrganizationInfoSchema.parse(mappedResponse);
15
- }
16
- export async function getUserOrganizationsFunc() {
17
- const url = "/oapi/v1/platform/organizations";
18
- const response = await yunxiaoRequest(url, {
19
- method: "GET",
20
- });
21
- if (!Array.isArray(response)) {
22
- return [];
23
- }
24
- return UserOrganizationsInfoSchema.parse(response);
25
- }
26
- export async function getOrganizationDepartmentsFunc(organizationId, parentId) {
27
- const baseUrl = `/oapi/v1/platform/organizations/${organizationId}/departments`;
28
- const params = {};
29
- if (parentId) {
30
- params.parentId = parentId;
31
- }
32
- const url = buildUrl(baseUrl, params);
33
- const response = await yunxiaoRequest(url, {
34
- method: "GET"
35
- });
36
- return OrganizationDepartmentsSchema.parse(response);
37
- }
38
- export async function getOrganizationDepartmentInfoFunc(organizationId, id) {
39
- const url = `/oapi/v1/platform/organizations/${organizationId}/departments/${id}`;
40
- const response = await yunxiaoRequest(url, {
41
- method: "GET",
42
- });
43
- return DepartmentInfoSchema.parse(response);
44
- }
45
- export async function getOrganizationDepartmentAncestorsFunc(organizationId, id) {
46
- const url = `/oapi/v1/platform/organizations/${organizationId}/departments/${id}/ancestors`;
47
- const response = await yunxiaoRequest(url, {
48
- method: "GET",
49
- });
50
- return OrganizationDepartmentsSchema.parse(response);
51
- }
52
- ;
53
- export async function listOrganizationRolesFunc(organizationId) {
54
- const url = `/oapi/v1/platform/organizations/${organizationId}/roles`;
55
- const response = await yunxiaoRequest(url, {
56
- method: "GET"
57
- });
58
- return OrganizationRole.parse(response);
59
- }
60
- export async function getOrganizationRoleFunc(organizationId, roleId) {
61
- const url = `/oapi/v1/platform/organizations/${organizationId}/roles/${roleId}`;
62
- const response = await yunxiaoRequest(url, {
63
- method: "GET"
64
- });
65
- return OrganizationRoleSchema.parse(response);
66
- }
67
- export async function getCurrentUserFunc() {
68
- const url = "/oapi/v1/platform/user";
69
- const response = await yunxiaoRequest(url, {
70
- method: "GET",
71
- });
72
- return CurrentUserSchema.parse(response);
73
- }
@@ -1,64 +0,0 @@
1
- import { yunxiaoRequest, buildUrl } from "../../common/utils.js";
2
- import { ArtifactSchema, } from "../../common/types.js";
3
- /**
4
- * 查询制品信息
5
- * @param organizationId
6
- * @param repoId
7
- * @param repoType
8
- * @param page
9
- * @param perPage
10
- * @param search
11
- * @param orderBy
12
- * @param sort
13
- * @returns 制品信息列表
14
- */
15
- export async function listArtifactsFunc(organizationId, repoId, repoType, page, perPage, search, orderBy = "latestUpdate", sort = "desc") {
16
- const baseUrl = `/oapi/v1/packages/organizations/${organizationId}/repositories/${repoId}/artifacts`;
17
- const queryParams = {
18
- repoType,
19
- };
20
- if (page !== undefined) {
21
- queryParams.page = page;
22
- }
23
- if (perPage !== undefined) {
24
- queryParams.perPage = perPage;
25
- }
26
- if (search !== undefined) {
27
- queryParams.search = search;
28
- }
29
- queryParams.orderBy = orderBy;
30
- queryParams.sort = sort;
31
- const url = buildUrl(baseUrl, queryParams);
32
- const response = await yunxiaoRequest(url, {
33
- method: "GET",
34
- });
35
- if (!Array.isArray(response)) {
36
- return [];
37
- }
38
- return response.map(artifact => ArtifactSchema.parse(artifact));
39
- }
40
- /**
41
- * 查看单个制品信息
42
- * @param organizationId
43
- * @param repoId
44
- * @param id
45
- * @param repoType
46
- * @returns 制品信息
47
- */
48
- export async function getArtifactFunc(organizationId, repoId, id, repoType) {
49
- const baseUrl = `/oapi/v1/packages/organizations/${organizationId}/repositories/${repoId}/artifacts/${id}`;
50
- const queryParams = {
51
- repoType,
52
- };
53
- const url = buildUrl(baseUrl, queryParams);
54
- try {
55
- const response = await yunxiaoRequest(url, {
56
- method: "GET",
57
- });
58
- return ArtifactSchema.parse(response);
59
- }
60
- catch (error) {
61
- console.error(`Error fetching artifact: ${error}`);
62
- return null;
63
- }
64
- }
@@ -1,35 +0,0 @@
1
- import { yunxiaoRequest, buildUrl } from "../../common/utils.js";
2
- import { PackageRepositorySchema, } from "../../common/types.js";
3
- /**
4
- * 查看制品仓库信息
5
- * @param organizationId
6
- * @param repoTypes
7
- * @param repoCategories
8
- * @param perPage
9
- * @param page
10
- * @returns 制品仓库信息列表
11
- */
12
- export async function listPackageRepositoriesFunc(organizationId, repoTypes, repoCategories, perPage, page) {
13
- const baseUrl = `/oapi/v1/packages/organizations/${organizationId}/repositories`;
14
- const queryParams = {};
15
- if (repoTypes !== undefined) {
16
- queryParams.repoTypes = repoTypes;
17
- }
18
- if (repoCategories !== undefined) {
19
- queryParams.repoCategories = repoCategories;
20
- }
21
- if (perPage !== undefined) {
22
- queryParams.perPage = perPage;
23
- }
24
- if (page !== undefined) {
25
- queryParams.page = page;
26
- }
27
- const url = buildUrl(baseUrl, queryParams);
28
- const response = await yunxiaoRequest(url, {
29
- method: "GET",
30
- });
31
- if (!Array.isArray(response)) {
32
- return [];
33
- }
34
- return response.map(repo => PackageRepositorySchema.parse(repo));
35
- }
@@ -1,206 +0,0 @@
1
- /**
2
- * 项目(Project)相关操作
3
- *
4
- * 概念说明:
5
- * - 项目(Project)是云效平台中的项目管理单元,包含工作项、迭代等管理概念
6
- * - 项目与代码库(Repository)是不同的概念,代码库属于CodeUp产品,用于代码管理
7
- * - 一个项目可以关联多个代码库,但两者是不同的资源类型
8
- */
9
- import { yunxiaoRequest } from "../../common/utils.js";
10
- import { ProjectInfoSchema } from "../../common/types.js";
11
- /**
12
- * 获取项目详情
13
- * @param organizationId
14
- * @param id
15
- */
16
- export async function getProjectFunc(organizationId, id) {
17
- const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${id}`;
18
- const response = await yunxiaoRequest(url, {
19
- method: "GET",
20
- });
21
- return ProjectInfoSchema.parse(response);
22
- }
23
- /**
24
- * 搜索项目
25
- * @param organizationId
26
- * @param name
27
- * @param status
28
- * @param createdAfter
29
- * @param createdBefore
30
- * @param creator
31
- * @param adminUserId
32
- * @param logicalStatus
33
- * @param advancedConditions
34
- * @param extraConditions
35
- * @param orderBy
36
- * @param page
37
- * @param perPage
38
- * @param sort
39
- * @param scenarioFilter
40
- * @param userId
41
- */
42
- export async function searchProjectsFunc(organizationId, name, status, createdAfter, createdBefore, creator, adminUserId, // Project administrator user ID
43
- logicalStatus, advancedConditions, extraConditions, // Should be constructed using buildExtraConditions for common filters
44
- orderBy, // Possible values: "gmtCreate", "name"
45
- page, perPage, sort, // Possible values: "desc", "asc"
46
- scenarioFilter, // Common project filter scenarios
47
- userId // User ID to use with scenarioFilter
48
- ) {
49
- const url = `/oapi/v1/projex/organizations/${organizationId}/projects:search`;
50
- const payload = {};
51
- if (scenarioFilter && userId) {
52
- extraConditions = buildExtraConditions(scenarioFilter, userId);
53
- }
54
- const conditions = buildProjectConditions({
55
- name,
56
- status,
57
- createdAfter,
58
- createdBefore,
59
- creator,
60
- adminUserId,
61
- logicalStatus,
62
- advancedConditions
63
- });
64
- if (conditions) {
65
- payload.conditions = conditions;
66
- }
67
- if (extraConditions) {
68
- payload.extraConditions = extraConditions;
69
- }
70
- if (orderBy) {
71
- payload.orderBy = orderBy;
72
- }
73
- if (page !== undefined) {
74
- payload.page = page;
75
- }
76
- if (perPage !== undefined) {
77
- payload.perPage = perPage;
78
- }
79
- if (sort) {
80
- payload.sort = sort;
81
- }
82
- const response = await yunxiaoRequest(url, {
83
- method: "POST",
84
- body: payload,
85
- });
86
- if (!Array.isArray(response)) {
87
- return [];
88
- }
89
- return response.map(project => ProjectInfoSchema.parse(project));
90
- }
91
- /**
92
- * 构建项目过滤条件(源API所需参数conditions是一个固定的JSON结构)
93
- * @param args
94
- */
95
- function buildProjectConditions(args) {
96
- if (args.advancedConditions) {
97
- return args.advancedConditions;
98
- }
99
- const filterConditions = [];
100
- if (args.name) {
101
- filterConditions.push({
102
- className: "string",
103
- fieldIdentifier: "name",
104
- format: "input",
105
- operator: "CONTAINS",
106
- toValue: null,
107
- value: [args.name],
108
- });
109
- }
110
- if (args.status) {
111
- const statusValues = args.status.split(",");
112
- const values = statusValues.map(v => v.trim());
113
- filterConditions.push({
114
- className: "status",
115
- fieldIdentifier: "status",
116
- format: "list",
117
- operator: "CONTAINS",
118
- toValue: null,
119
- value: values,
120
- });
121
- }
122
- if (args.createdAfter) {
123
- const createdBefore = args.createdBefore ? `${args.createdBefore} 23:59:59` : null;
124
- filterConditions.push({
125
- className: "date",
126
- fieldIdentifier: "gmtCreate",
127
- format: "input",
128
- operator: "BETWEEN",
129
- toValue: createdBefore,
130
- value: [`${args.createdAfter} 00:00:00`],
131
- });
132
- }
133
- if (args.creator) {
134
- const creatorValues = args.creator.split(",");
135
- const values = creatorValues.map(v => v.trim());
136
- filterConditions.push({
137
- className: "user",
138
- fieldIdentifier: "creator",
139
- format: "list",
140
- operator: "CONTAINS",
141
- toValue: null,
142
- value: values,
143
- });
144
- }
145
- if (args.adminUserId) {
146
- const adminValues = args.adminUserId.split(",");
147
- const values = adminValues.map(v => v.trim());
148
- filterConditions.push({
149
- className: "user",
150
- fieldIdentifier: "project.admin",
151
- format: "multiList",
152
- operator: "CONTAINS",
153
- toValue: null,
154
- value: values,
155
- });
156
- }
157
- if (args.logicalStatus) {
158
- filterConditions.push({
159
- className: "string",
160
- fieldIdentifier: "logicalStatus",
161
- format: "list",
162
- operator: "CONTAINS",
163
- toValue: null,
164
- value: [args.logicalStatus],
165
- });
166
- }
167
- if (filterConditions.length === 0) {
168
- return undefined;
169
- }
170
- const conditions = {
171
- conditionGroups: [filterConditions],
172
- };
173
- return JSON.stringify(conditions);
174
- }
175
- /**
176
- * 项目额外过滤条件
177
- * @param scenario The filter scenario: "manage" (projects I manage), "participate" (projects I participate in), "favorite" (projects I favorited)
178
- * @param userId The user ID to filter by
179
- * @returns JSON string for extraConditions parameter
180
- */
181
- export function buildExtraConditions(scenario, userId) {
182
- let fieldIdentifier;
183
- switch (scenario) {
184
- case "manage":
185
- fieldIdentifier = "project.admin";
186
- break;
187
- case "participate":
188
- fieldIdentifier = "users";
189
- break;
190
- case "favorite":
191
- fieldIdentifier = "collectMembers";
192
- break;
193
- default:
194
- throw new Error(`Unknown scenario: ${scenario}`);
195
- }
196
- const conditions = {
197
- conditionGroups: [[{
198
- className: "user",
199
- fieldIdentifier: fieldIdentifier,
200
- format: "multiList",
201
- operator: "CONTAINS",
202
- value: [userId]
203
- }]]
204
- };
205
- return JSON.stringify(conditions);
206
- }
@@ -1,30 +0,0 @@
1
- import { yunxiaoRequest, buildUrl } from "../../common/utils.js";
2
- import { SprintInfoSchema } from "../../common/types.js";
3
- export async function getSprintFunc(organizationId, projectId, id) {
4
- const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${projectId}/sprints/${id}`;
5
- const response = await yunxiaoRequest(url, {
6
- method: "GET",
7
- });
8
- return SprintInfoSchema.parse(response);
9
- }
10
- export async function listSprintsFunc(organizationId, id, status, page, perPage) {
11
- const baseUrl = `/oapi/v1/projex/organizations/${organizationId}/projects/${id}/sprints`;
12
- const queryParams = {};
13
- if (status !== undefined) {
14
- queryParams.status = status;
15
- }
16
- if (page !== undefined) {
17
- queryParams.page = page;
18
- }
19
- if (perPage !== undefined) {
20
- queryParams.perPage = perPage;
21
- }
22
- const url = buildUrl(baseUrl, queryParams);
23
- const response = await yunxiaoRequest(url, {
24
- method: "GET",
25
- });
26
- if (!Array.isArray(response)) {
27
- return [];
28
- }
29
- return response.map(sprint => SprintInfoSchema.parse(sprint));
30
- }