@zzp123/mcp-zentao 1.7.4 → 1.8.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 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.8.0] - 2025-11-06
9
+
10
+ ### Changed
11
+ - **重构需求变更接口命名**
12
+ - 将 `updateStory` 工具重命名为 `changeStory`,更准确地反映其功能
13
+ - 将 `UpdateStoryRequest` 类型重命名为 `ChangeStoryRequest`
14
+ - 将 `updateStory` API方法重命名为 `changeStory`
15
+ - 使用功能完整的"修改需求其他字段"接口替代功能有限的"变更需求"接口
16
+
17
+ ### Added
18
+ - 向后兼容的类型别名:`UpdateStoryRequest` 作为 `ChangeStoryRequest` 的别名
19
+
20
+ ### Technical
21
+ - 统一需求变更相关的命名规范
22
+ - 保持向后兼容性,旧的类型名称仍然可用
23
+ - 所有测试通过,确保重构不影响现有功能
24
+
8
25
  ## [1.7.4] - 2025-11-06
9
26
 
10
27
  ### Fixed
@@ -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, ModulesResponse, ModuleType, Plan, Product, Program, Project, Release, ResolveBugRequest, Story, Task, TaskStatus, TaskUpdate, TestCase, Ticket, UpdateBuildRequest, UpdateBugRequest, UpdateExecutionRequest, UpdateFeedbackRequest, UpdatePlanRequest, UpdateProductRequest, UpdateProgramRequest, UpdateProjectRequest, UpdateStoryRequest, UpdateTestCaseRequest, UpdateTicketRequest, UpdateUserRequest, UploadFileRequest, UserDetail, ZentaoConfig } from '../types/zentao';
1
+ import { AssignFeedbackRequest, Bug, BugStatus, Build, CloseFeedbackRequest, CreateBuildRequest, CreateBugRequest, CreateExecutionRequest, CreateFeedbackRequest, CreatePlanRequest, CreateProductRequest, CreateProgramRequest, CreateProjectRequest, CreateStoryRequest, CreateTaskRequest, CreateTestCaseRequest, CreateTicketRequest, CreateUserRequest, Execution, Feedback, FileUploadResponse, ModulesResponse, ModuleType, Plan, Product, Program, Project, Release, ResolveBugRequest, Story, Task, TaskStatus, TaskUpdate, TestCase, Ticket, UpdateBuildRequest, UpdateBugRequest, UpdateExecutionRequest, UpdateFeedbackRequest, UpdatePlanRequest, UpdateProductRequest, UpdateProgramRequest, UpdateProjectRequest, ChangeStoryRequest, UpdateTestCaseRequest, UpdateTicketRequest, UpdateUserRequest, UploadFileRequest, UserDetail, ZentaoConfig } from '../types/zentao';
2
2
  export declare class ZentaoAPI {
3
3
  private config;
4
4
  private client;
@@ -33,7 +33,7 @@ export declare class ZentaoAPI {
33
33
  getProjectExecutions(projectId: number): Promise<Execution[]>;
34
34
  createPlan(productId: number, plan: CreatePlanRequest): Promise<Plan>;
35
35
  getProjects(page?: number, limit?: number): Promise<Project[]>;
36
- updateStory(storyId: number, update: UpdateStoryRequest): Promise<Story>;
36
+ changeStory(storyId: number, update: ChangeStoryRequest): Promise<Story>;
37
37
  deleteTask(taskId: number): Promise<{
38
38
  message: string;
39
39
  }>;
@@ -495,9 +495,9 @@ export class ZentaoAPI {
495
495
  throw error;
496
496
  }
497
497
  }
498
- async updateStory(storyId, update) {
498
+ async changeStory(storyId, update) {
499
499
  try {
500
- console.log(`正在更新需求 ${storyId}...`);
500
+ console.log(`正在变更需求 ${storyId}...`);
501
501
  // 自动处理评审人问题
502
502
  const updateData = { ...update };
503
503
  // 如果用户没有设置评审人,也没有指定无需评审,则自动跳过评审
@@ -506,11 +506,11 @@ export class ZentaoAPI {
506
506
  console.log('自动设置needNotReview=true以跳过评审要求');
507
507
  }
508
508
  const response = await this.request('PUT', `/stories/${storyId}`, undefined, updateData);
509
- console.log('更新需求响应:', response);
509
+ console.log('变更需求响应:', response);
510
510
  return response;
511
511
  }
512
512
  catch (error) {
513
- console.error('更新需求失败:', error);
513
+ console.error('变更需求失败:', error);
514
514
  throw error;
515
515
  }
516
516
  }
package/dist/index.js CHANGED
@@ -460,8 +460,8 @@ server.tool("getProjects", {
460
460
  content: [{ type: "text", text: JSON.stringify(projects, null, 2) }]
461
461
  };
462
462
  });
463
- // Add updateStory tool
464
- server.tool("updateStory", {
463
+ // Add changeStory tool
464
+ server.tool("changeStory", {
465
465
  storyId: z.number(),
466
466
  update: z.union([
467
467
  z.object({
@@ -507,7 +507,7 @@ server.tool("updateStory", {
507
507
  comment: z.string().optional()
508
508
  }),
509
509
  z.string()
510
- ]).describe("需求更新字段 - 支持对象或JSON字符串格式")
510
+ ]).describe("需求变更字段 - 支持对象或JSON字符串格式")
511
511
  }, async ({ storyId, update }) => {
512
512
  if (!zentaoApi)
513
513
  throw new Error("Please initialize Zentao API first");
@@ -524,7 +524,7 @@ server.tool("updateStory", {
524
524
  else {
525
525
  updateData = update;
526
526
  }
527
- const story = await zentaoApi.updateStory(storyId, updateData);
527
+ const story = await zentaoApi.changeStory(storyId, updateData);
528
528
  return {
529
529
  content: [{ type: "text", text: JSON.stringify(story, null, 2) }]
530
530
  };
@@ -256,7 +256,7 @@ export interface Project {
256
256
  PM: string | User;
257
257
  progress: number;
258
258
  }
259
- export interface UpdateStoryRequest {
259
+ export interface ChangeStoryRequest {
260
260
  title?: string;
261
261
  product?: number;
262
262
  parent?: number;
@@ -287,6 +287,7 @@ export interface UpdateStoryRequest {
287
287
  verify?: string;
288
288
  comment?: string;
289
289
  }
290
+ export type UpdateStoryRequest = ChangeStoryRequest;
290
291
  export interface CreateProgramRequest {
291
292
  name?: string;
292
293
  parent?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.7.4",
3
+ "version": "1.8.0",
4
4
  "description": "禅道项目管理系统的高级API集成包,提供任务管理、Bug跟踪等功能的完整封装,专为Cursor IDE设计的MCP扩展",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",