@zzp123/mcp-zentao 1.4.1 → 1.4.2

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 (2) hide show
  1. package/README.md +78 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,32 @@
1
1
  # MCP-Zentao
2
2
 
3
+ [![npm version](https://badge.fury.io/js/%40zzp123%2Fmcp-zentao.svg)](https://www.npmjs.com/package/@zzp123/mcp-zentao)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
3
6
  禅道项目管理系统的高级API集成包,提供任务管理、Bug跟踪等功能的完整封装,专为Cursor IDE设计的MCP扩展。
4
7
 
5
- ## 安装
8
+ ## 📦 安装
6
9
 
7
10
  ```bash
8
- npm install @bigtian/mcp-zentao -g
11
+ npm install @zzp123/mcp-zentao -g
9
12
  ```
10
13
 
14
+ ## 📋 版本历史
15
+
16
+ 查看完整的版本更新历史,请访问 [CHANGELOG.md](./CHANGELOG.md)
17
+
18
+ **最新版本**: v1.4.2
19
+ - 创建完整的版本更新历史文档(CHANGELOG.md)
20
+ - 更新所有文档和示例代码
21
+ - 修正包名和API签名
22
+
23
+ **主要版本**:
24
+ - v1.4.1 - 修复 uploadImageFromClipboard 返回值问题
25
+ - v1.4.0 - 新增解决Bug接口
26
+ - v1.3.1 - 修复剪贴板图片上传核心问题
27
+ - v1.3.0 - 添加命令行脚本支持
28
+ - v1.2.0 - 添加文件上传/下载功能
29
+
11
30
  ## 使用方法
12
31
 
13
32
  ### 首次使用(配置禅道信息)
@@ -158,7 +177,7 @@ docker run -d \
158
177
  ## 基本使用
159
178
 
160
179
  ```typescript
161
- import { ZentaoAPI } from '@bigtian/mcp-zentao';
180
+ import { ZentaoAPI } from '@zzp123/mcp-zentao';
162
181
 
163
182
  // 创建API实例
164
183
  const api = new ZentaoAPI({
@@ -198,19 +217,34 @@ async function finishTask(taskId: number) {
198
217
  }
199
218
  }
200
219
 
201
- // 解决Bug
220
+ // 解决Bug (v1.4.0+)
202
221
  async function resolveBug(bugId: number) {
203
222
  try {
204
- await api.resolveBug(bugId, {
223
+ const result = await api.resolveBug(bugId, {
205
224
  resolution: 'fixed',
206
225
  resolvedBuild: 'trunk',
226
+ assignedTo: 'admin',
207
227
  comment: '问题已修复'
208
228
  });
209
- console.log('Bug已解决');
229
+ console.log('Bug已解决:', result);
210
230
  } catch (error) {
211
231
  console.error('解决Bug失败:', error);
212
232
  }
213
233
  }
234
+
235
+ // 上传剪贴板图片 (v1.3.1+)
236
+ async function uploadClipboardImage() {
237
+ try {
238
+ // 注意:需要先复制图片到系统剪贴板
239
+ const result = await api.uploadFile({
240
+ filename: 'screenshot.png',
241
+ uid: 'optional-uid'
242
+ });
243
+ console.log('图片已上传:', result);
244
+ } catch (error) {
245
+ console.error('上传失败:', error);
246
+ }
247
+ }
214
248
  ```
215
249
 
216
250
  ## API文档
@@ -243,12 +277,22 @@ constructor(config: {
243
277
  - 参数: taskId - 任务ID
244
278
  - 返回: Promise<void>
245
279
 
246
- 4. `resolveBug(bugId: number, resolution: BugResolution): Promise<void>`
280
+ 4. `resolveBug(bugId: number, resolution: ResolveBugRequest): Promise<Bug>` (v1.4.0+)
247
281
  - 解决指定ID的Bug
248
- - 参数:
282
+ - 参数:
249
283
  - bugId - Bug ID
250
284
  - resolution - Bug解决方案
251
- - 返回: Promise<void>
285
+ - 返回: Promise<Bug> - 返回更新后的Bug对象
286
+
287
+ 5. `uploadFile(request: UploadFileRequest): Promise<FileUploadResponse>` (v1.2.0+)
288
+ - 上传文件到禅道
289
+ - 参数: UploadFileRequest - 文件上传请求
290
+ - 返回: Promise<FileUploadResponse> - 包含文件ID和访问URL
291
+
292
+ 6. `downloadFile(fileId: number): Promise<Buffer>` (v1.2.0+)
293
+ - 从禅道下载文件
294
+ - 参数: fileId - 文件ID
295
+ - 返回: Promise<Buffer> - 文件的二进制数据
252
296
 
253
297
  ### 类型定义
254
298
 
@@ -258,6 +302,8 @@ interface Task {
258
302
  name: string;
259
303
  status: string;
260
304
  pri: number;
305
+ assignedTo: string;
306
+ deadline: string;
261
307
  // ... 其他任务属性
262
308
  }
263
309
 
@@ -266,14 +312,32 @@ interface Bug {
266
312
  title: string;
267
313
  status: string;
268
314
  severity: number;
315
+ resolvedBy: string;
316
+ resolution: string;
269
317
  // ... 其他Bug属性
270
318
  }
271
319
 
272
- interface BugResolution {
273
- resolution: string; // 解决方案类型
274
- resolvedBuild?: string; // 解决版本
275
- duplicateBug?: number; // 重复Bug ID
276
- comment?: string; // 备注
320
+ // v1.4.0+
321
+ type ResolutionType = 'fixed' | 'bydesign' | 'duplicate' | 'external' | 'notrepro' | 'postponed' | 'willnotfix';
322
+
323
+ interface ResolveBugRequest {
324
+ resolution: ResolutionType; // 解决方案(必填)
325
+ resolvedBuild?: string; // 解决版本(resolution='fixed'时必填)
326
+ assignedTo?: string; // 指派给
327
+ comment?: string; // 备注
328
+ duplicateBug?: number; // 重复Bug的ID(resolution='duplicate'时必填)
329
+ }
330
+
331
+ // v1.2.0+
332
+ interface UploadFileRequest {
333
+ file: Buffer; // 文件数据
334
+ filename: string; // 文件名
335
+ uid?: string; // 唯一标识符(可选)
336
+ }
337
+
338
+ interface FileUploadResponse {
339
+ id: number; // 文件ID
340
+ url: string; // 文件访问URL
277
341
  }
278
342
  ```
279
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "禅道项目管理系统的高级API集成包,提供任务管理、Bug跟踪等功能的完整封装,专为Cursor IDE设计的MCP扩展",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",