@zzp123/mcp-zentao 1.4.3 → 1.5.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/CHANGELOG.md +17 -0
- package/README.md +4 -4
- package/dist/api/zentaoApi.d.ts +9 -2
- package/dist/api/zentaoApi.js +24 -2
- package/dist/types/zentao.d.ts +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.0] - 2025-11-05
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **模块数据简化功能** - 新增 `SimpleModule` 接口,简化模块API返回数据
|
|
12
|
+
- `getModules` 接口现在只返回核心字段:id、name、parent、grade、children
|
|
13
|
+
- 移除冗余的字段(type、path、order等),大幅减少数据传输量
|
|
14
|
+
- 保持树形结构,递归简化所有子模块数据
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- 优化 `getModules()` 方法,返回类型从 `Module[]` 改为 `SimpleModule[]`
|
|
18
|
+
- 添加 `simplifyModule()` 私有方法,用于递归转换模块数据结构
|
|
19
|
+
|
|
20
|
+
### Benefits
|
|
21
|
+
- 减少网络传输数据量,提升API响应速度
|
|
22
|
+
- 简化客户端数据处理逻辑
|
|
23
|
+
- 更清晰的数据结构,只包含必要信息
|
|
24
|
+
|
|
8
25
|
## [1.4.3] - 2025-11-05
|
|
9
26
|
|
|
10
27
|
### Fixed
|
package/README.md
CHANGED
|
@@ -15,10 +15,10 @@ npm install @zzp123/mcp-zentao -g
|
|
|
15
15
|
|
|
16
16
|
查看完整的版本更新历史,请访问 [CHANGELOG.md](./CHANGELOG.md)
|
|
17
17
|
|
|
18
|
-
**最新版本**: v1.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
18
|
+
**最新版本**: v1.5.0
|
|
19
|
+
- 模块数据简化功能 - getModules接口现在只返回核心字段
|
|
20
|
+
- 大幅减少数据传输量,提升API响应速度
|
|
21
|
+
- 新增 SimpleModule 接口,优化数据结构
|
|
22
22
|
|
|
23
23
|
**主要版本**:
|
|
24
24
|
- v1.4.1 - 修复 uploadImageFromClipboard 返回值问题
|
package/dist/api/zentaoApi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssignFeedbackRequest, Bug, BugStatus, Build, CloseFeedbackRequest, CreateBuildRequest, CreateBugRequest, CreateExecutionRequest, CreateFeedbackRequest, CreatePlanRequest, CreateProductRequest, CreateProgramRequest, CreateProjectRequest, CreateStoryRequest, CreateTaskRequest, CreateTestCaseRequest, CreateTicketRequest, CreateUserRequest, Execution, Feedback, FileUploadResponse,
|
|
1
|
+
import { AssignFeedbackRequest, Bug, BugStatus, Build, CloseFeedbackRequest, CreateBuildRequest, CreateBugRequest, CreateExecutionRequest, CreateFeedbackRequest, CreatePlanRequest, CreateProductRequest, CreateProgramRequest, CreateProjectRequest, CreateStoryRequest, CreateTaskRequest, CreateTestCaseRequest, CreateTicketRequest, CreateUserRequest, Execution, Feedback, FileUploadResponse, ModuleType, Plan, Product, Program, Project, Release, ResolveBugRequest, SimpleModule, Story, Task, TaskStatus, TaskUpdate, TestCase, Ticket, UpdateBuildRequest, UpdateBugRequest, UpdateExecutionRequest, UpdateFeedbackRequest, UpdatePlanRequest, UpdateProductRequest, UpdateProgramRequest, UpdateProjectRequest, UpdateStoryRequest, UpdateTestCaseRequest, UpdateTicketRequest, UpdateUserRequest, UploadFileRequest, UserDetail, ZentaoConfig } from '../types/zentao';
|
|
2
2
|
export declare class ZentaoAPI {
|
|
3
3
|
private config;
|
|
4
4
|
private client;
|
|
@@ -148,7 +148,14 @@ export declare class ZentaoAPI {
|
|
|
148
148
|
deleteTicket(ticketId: number): Promise<{
|
|
149
149
|
message: string;
|
|
150
150
|
}>;
|
|
151
|
-
|
|
151
|
+
/**
|
|
152
|
+
* 将完整的Module对象转换为简化的SimpleModule对象
|
|
153
|
+
*/
|
|
154
|
+
private simplifyModule;
|
|
155
|
+
/**
|
|
156
|
+
* 获取模块列表(返回简化数据)
|
|
157
|
+
*/
|
|
158
|
+
getModules(type: ModuleType, id: number): Promise<SimpleModule[]>;
|
|
152
159
|
uploadFile(uploadRequest: UploadFileRequest): Promise<FileUploadResponse>;
|
|
153
160
|
downloadFile(fileId: number): Promise<Buffer>;
|
|
154
161
|
}
|
package/dist/api/zentaoApi.js
CHANGED
|
@@ -1119,13 +1119,35 @@ export class ZentaoAPI {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
1121
|
// 模块相关API
|
|
1122
|
+
/**
|
|
1123
|
+
* 将完整的Module对象转换为简化的SimpleModule对象
|
|
1124
|
+
*/
|
|
1125
|
+
simplifyModule(module) {
|
|
1126
|
+
const simple = {
|
|
1127
|
+
id: module.id,
|
|
1128
|
+
name: module.name,
|
|
1129
|
+
parent: module.parent,
|
|
1130
|
+
grade: module.grade
|
|
1131
|
+
};
|
|
1132
|
+
// 递归处理子模块
|
|
1133
|
+
if (module.children && module.children.length > 0) {
|
|
1134
|
+
simple.children = module.children.map(child => this.simplifyModule(child));
|
|
1135
|
+
}
|
|
1136
|
+
return simple;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* 获取模块列表(返回简化数据)
|
|
1140
|
+
*/
|
|
1122
1141
|
async getModules(type, id) {
|
|
1123
1142
|
try {
|
|
1124
1143
|
console.log(`正在获取模块列表,类型: ${type}, ID: ${id}...`);
|
|
1125
1144
|
const params = { type, id };
|
|
1126
1145
|
const response = await this.request('GET', '/modules', params);
|
|
1127
|
-
console.log('
|
|
1128
|
-
|
|
1146
|
+
console.log('获取模块列表响应(原始数据):', response);
|
|
1147
|
+
// 转换为简化格式
|
|
1148
|
+
const simpleModules = response.modules.map(module => this.simplifyModule(module));
|
|
1149
|
+
console.log('获取模块列表响应(简化数据):', simpleModules);
|
|
1150
|
+
return simpleModules;
|
|
1129
1151
|
}
|
|
1130
1152
|
catch (error) {
|
|
1131
1153
|
console.error('获取模块列表失败:', error);
|
package/dist/types/zentao.d.ts
CHANGED
|
@@ -626,8 +626,19 @@ export interface Module {
|
|
|
626
626
|
owner: string;
|
|
627
627
|
collector?: string;
|
|
628
628
|
short?: string;
|
|
629
|
+
deleted?: string;
|
|
630
|
+
from?: number;
|
|
631
|
+
url?: string;
|
|
632
|
+
children?: Module[];
|
|
629
633
|
}
|
|
630
634
|
export type ModuleType = 'story' | 'task' | 'bug' | 'case' | 'feedback' | 'product';
|
|
635
|
+
export interface SimpleModule {
|
|
636
|
+
id: string;
|
|
637
|
+
name: string;
|
|
638
|
+
parent: string;
|
|
639
|
+
grade: string;
|
|
640
|
+
children?: SimpleModule[];
|
|
641
|
+
}
|
|
631
642
|
export interface FileUploadResponse {
|
|
632
643
|
id: number;
|
|
633
644
|
url: string;
|