@zzp123/mcp-zentao 1.8.1 → 1.8.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.
- package/dist/api/zentaoApi.d.ts +10 -0
- package/dist/api/zentaoApi.js +14 -3
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/api/zentaoApi.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export declare class ZentaoAPI {
|
|
|
44
44
|
getProjectExecutions(projectId: number): Promise<Execution[]>;
|
|
45
45
|
createPlan(productId: number, plan: CreatePlanRequest): Promise<Plan>;
|
|
46
46
|
getProjects(page?: number, limit?: number): Promise<Project[]>;
|
|
47
|
+
/**
|
|
48
|
+
* 修改需求(使用最新的 PUT /stories/:id 接口)
|
|
49
|
+
*
|
|
50
|
+
* 注意:此方法使用"修改需求其他字段"接口(PUT),支持修改29个字段
|
|
51
|
+
* 已废弃:旧的"变更需求"接口(POST /stories/:id/change)仅支持3个字段
|
|
52
|
+
*
|
|
53
|
+
* @param storyId 需求ID
|
|
54
|
+
* @param update 需要更新的字段
|
|
55
|
+
* @returns 更新后的需求信息
|
|
56
|
+
*/
|
|
47
57
|
changeStory(storyId: number, update: ChangeStoryRequest): Promise<Story>;
|
|
48
58
|
deleteTask(taskId: number): Promise<{
|
|
49
59
|
message: string;
|
package/dist/api/zentaoApi.js
CHANGED
|
@@ -606,9 +606,19 @@ export class ZentaoAPI {
|
|
|
606
606
|
throw error;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* 修改需求(使用最新的 PUT /stories/:id 接口)
|
|
611
|
+
*
|
|
612
|
+
* 注意:此方法使用"修改需求其他字段"接口(PUT),支持修改29个字段
|
|
613
|
+
* 已废弃:旧的"变更需求"接口(POST /stories/:id/change)仅支持3个字段
|
|
614
|
+
*
|
|
615
|
+
* @param storyId 需求ID
|
|
616
|
+
* @param update 需要更新的字段
|
|
617
|
+
* @returns 更新后的需求信息
|
|
618
|
+
*/
|
|
609
619
|
async changeStory(storyId, update) {
|
|
610
620
|
try {
|
|
611
|
-
console.log(
|
|
621
|
+
console.log(`正在修改需求 ${storyId} (使用 PUT 接口)...`);
|
|
612
622
|
// 自动处理评审人问题
|
|
613
623
|
const updateData = { ...update };
|
|
614
624
|
// 如果用户没有设置评审人,也没有指定无需评审,则自动跳过评审
|
|
@@ -616,12 +626,13 @@ export class ZentaoAPI {
|
|
|
616
626
|
updateData.needNotReview = true;
|
|
617
627
|
console.log('自动设置needNotReview=true以跳过评审要求');
|
|
618
628
|
}
|
|
629
|
+
// 使用 PUT /stories/:id 接口(功能完整的"修改需求其他字段"接口)
|
|
619
630
|
const response = await this.request('PUT', `/stories/${storyId}`, undefined, updateData);
|
|
620
|
-
console.log('
|
|
631
|
+
console.log('修改需求响应:', response);
|
|
621
632
|
return response;
|
|
622
633
|
}
|
|
623
634
|
catch (error) {
|
|
624
|
-
console.error('
|
|
635
|
+
console.error('修改需求失败:', error);
|
|
625
636
|
throw error;
|
|
626
637
|
}
|
|
627
638
|
}
|
package/dist/index.js
CHANGED
|
@@ -581,7 +581,13 @@ server.tool("changeStory", {
|
|
|
581
581
|
comment: z.string().optional()
|
|
582
582
|
}),
|
|
583
583
|
z.string()
|
|
584
|
-
]).describe(
|
|
584
|
+
]).describe(`修改需求字段(使用最新 PUT 接口)
|
|
585
|
+
|
|
586
|
+
此工具使用"修改需求其他字段"接口(PUT /stories/:id),支持修改29个字段。
|
|
587
|
+
已废弃旧的"变更需求"接口(POST /stories/:id/change),该接口仅支持3个字段。
|
|
588
|
+
|
|
589
|
+
支持对象或JSON字符串格式。
|
|
590
|
+
`.trim())
|
|
585
591
|
}, async ({ storyId, update }) => {
|
|
586
592
|
if (!zentaoApi)
|
|
587
593
|
throw new Error("Please initialize Zentao API first");
|