targetprocess-mcp-server 2.6.9 → 2.7.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/build/handlers/add_comment.js +2 -2
- package/build/handlers/add_test_case_step_by_id.js +2 -2
- package/build/handlers/create_bug.js +2 -2
- package/build/handlers/create_bug_based_on_card.js +2 -2
- package/build/handlers/create_epic.js +2 -2
- package/build/handlers/create_feature.js +2 -2
- package/build/handlers/create_formatted_feature.js +2 -2
- package/build/handlers/create_formatted_user_story.js +2 -2
- package/build/handlers/create_task.js +2 -2
- package/build/handlers/create_user_story.js +2 -2
- package/build/handlers/get_bug_comments.js +1 -1
- package/build/handlers/get_bug_content.js +2 -2
- package/build/handlers/get_bug_workflows.js +2 -2
- package/build/handlers/get_card_current_status.js +1 -1
- package/build/handlers/get_commit_message.js +2 -2
- package/build/handlers/get_current_releases.js +2 -2
- package/build/handlers/get_epic_content.js +2 -2
- package/build/handlers/get_epic_features.js +1 -1
- package/build/handlers/get_feature_comments.js +1 -1
- package/build/handlers/get_feature_content.js +2 -2
- package/build/handlers/get_feature_user_stories.js +1 -1
- package/build/handlers/get_logged_in_user.js +2 -2
- package/build/handlers/get_my_time_logs.js +2 -2
- package/build/handlers/get_process_workflows.js +2 -2
- package/build/handlers/get_processes.js +2 -2
- package/build/handlers/get_projects.js +2 -2
- package/build/handlers/get_relation_types.js +1 -1
- package/build/handlers/get_release_bugs.js +2 -2
- package/build/handlers/get_release_features.js +2 -2
- package/build/handlers/get_release_open_bugs.js +2 -2
- package/build/handlers/get_release_open_user_stories.js +2 -2
- package/build/handlers/get_release_user_stories.js +2 -2
- package/build/handlers/get_team_iterations.js +2 -2
- package/build/handlers/get_teams.js +4 -4
- package/build/handlers/get_test_case_by_id.js +2 -2
- package/build/handlers/get_test_plan_by_id.js +2 -2
- package/build/handlers/get_test_plan_test_cases_with_steps_by_id.js +2 -2
- package/build/handlers/get_user_by_id.js +2 -2
- package/build/handlers/get_user_story_bugs.js +1 -1
- package/build/handlers/get_user_story_comments.js +1 -1
- package/build/handlers/get_user_story_content.js +2 -2
- package/build/handlers/get_user_story_workflows.js +2 -2
- package/build/handlers/get_users.js +2 -2
- package/build/handlers/list_my_bugs.js +2 -2
- package/build/handlers/list_my_user_stories.js +2 -2
- package/build/handlers/log_time.js +1 -1
- package/build/handlers/update_bug.js +2 -2
- package/build/handlers/update_epic.js +2 -2
- package/build/handlers/update_feature.js +2 -2
- package/build/handlers/update_test_case_by_id.js +2 -2
- package/build/handlers/update_test_case_step_by_id.js +4 -4
- package/build/handlers/update_user_story_sub_state.js +2 -2
- package/build/index.js +11 -11
- package/build/tp.js +7 -6
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleAddComment(tp, id, comment) {
|
|
2
2
|
const response = await tp.addComment(id, comment);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to add comment to user story, id: ${id}\n
|
|
7
|
+
text: `Failed to add comment to user story, id: ${id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -3,11 +3,11 @@ export async function handleAddTestCaseStepById(tp, params) {
|
|
|
3
3
|
description: params.description,
|
|
4
4
|
result: params.result,
|
|
5
5
|
});
|
|
6
|
-
if (
|
|
6
|
+
if (testStepResponse instanceof Error) {
|
|
7
7
|
return {
|
|
8
8
|
content: [{
|
|
9
9
|
type: 'text',
|
|
10
|
-
text: `Failed to add test step to test case id: ${params.testCaseId}\n
|
|
10
|
+
text: `Failed to add test step to test case id: ${params.testCaseId}\n Error: ${testStepResponse.message}`
|
|
11
11
|
}],
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateBug(tp, params) {
|
|
2
2
|
const bugResponse = await tp.createBugOnly(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create bug "${params.title}"\n
|
|
7
|
+
text: `Failed to create bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateBugBasedOnCard(tp, params) {
|
|
2
2
|
const bugResponse = await tp.createBug(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create bug "${params.title}"\n
|
|
7
|
+
text: `Failed to create bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateEpic(tp, params) {
|
|
2
2
|
const response = await tp.createEpic(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create epic "${params.title}"\n
|
|
7
|
+
text: `Failed to create epic "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateFeature(tp, params) {
|
|
2
2
|
const response = await tp.createFeature(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create feature "${params.title}"\n
|
|
7
|
+
text: `Failed to create feature "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -67,11 +67,11 @@ export async function handleCreateFormattedFeature(tp, params) {
|
|
|
67
67
|
parts.push('</div>');
|
|
68
68
|
const description = parts.join('\n');
|
|
69
69
|
const featureResponse = await tp.createFeature({ title, description, epicId, releaseId, projectId, teamId });
|
|
70
|
-
if (
|
|
70
|
+
if (featureResponse instanceof Error) {
|
|
71
71
|
return {
|
|
72
72
|
content: [{
|
|
73
73
|
type: 'text',
|
|
74
|
-
text: `Failed to create formatted feature "${title}"\n
|
|
74
|
+
text: `Failed to create formatted feature "${title}"\n Error: ${featureResponse.message}`
|
|
75
75
|
}],
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -41,11 +41,11 @@ export async function handleCreateFormattedUserStory(tp, params) {
|
|
|
41
41
|
parts.push('</div>');
|
|
42
42
|
const description = parts.join('\n');
|
|
43
43
|
const userStoryResponse = await tp.createUserStory({ title, description, featureId, releaseId, projectId, teamId, tags, teamIterationId });
|
|
44
|
-
if (
|
|
44
|
+
if (userStoryResponse instanceof Error) {
|
|
45
45
|
return {
|
|
46
46
|
content: [{
|
|
47
47
|
type: 'text',
|
|
48
|
-
text: `Failed to create formatted user story "${title}"\n
|
|
48
|
+
text: `Failed to create formatted user story "${title}"\n Error: ${userStoryResponse.message}`
|
|
49
49
|
}],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateTask(tp, params) {
|
|
2
2
|
const response = await tp.createTask(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create task "${params.title}"\n
|
|
7
|
+
text: `Failed to create task "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateUserStory(tp, params) {
|
|
2
2
|
const response = await tp.createUserStory(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create user story "${params.title}"\n
|
|
7
|
+
text: `Failed to create user story "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetBugContent(tp, id) {
|
|
3
3
|
const bug = await tp.getBug(id);
|
|
4
|
-
if (
|
|
4
|
+
if (bug instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get bug, id: ${id}\n
|
|
8
|
+
text: `Failed to get bug, id: ${id}\n Error: ${bug.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetBugWorkflows(tp) {
|
|
2
2
|
const response = await tp.getBugWorkflows();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get bug entity statuses,
|
|
7
|
+
text: `Failed to get bug entity statuses, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function handleGetCommitMessage(tp, id, type) {
|
|
2
2
|
if (type === 'task') {
|
|
3
3
|
const task = await tp.getTask(id);
|
|
4
|
-
if (
|
|
4
|
+
if (task instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{ type: 'text', text: `Failed to get task with id: ${id}` }],
|
|
7
7
|
};
|
|
@@ -21,7 +21,7 @@ export async function handleGetCommitMessage(tp, id, type) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
const bug = await tp.getBugWithRelations(id);
|
|
24
|
-
if (
|
|
24
|
+
if (bug instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{ type: 'text', text: `Failed to get bug with id: ${id}` }],
|
|
27
27
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetCurrentReleases(tp) {
|
|
2
2
|
const releases = await tp.getCurrentReleases();
|
|
3
|
-
if (
|
|
3
|
+
if (releases instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get current releases,
|
|
7
|
+
text: `Failed to get current releases, Error: ${releases.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetEpicContent(tp, id) {
|
|
3
3
|
const epic = await tp.getEpic(id);
|
|
4
|
-
if (
|
|
4
|
+
if (epic instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get epic, id: ${id}\n
|
|
8
|
+
text: `Failed to get epic, id: ${id}\n Error: ${epic.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetFeatureContent(tp, id) {
|
|
3
3
|
const feature = await tp.getFeature(id);
|
|
4
|
-
if (
|
|
4
|
+
if (feature instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get feature, id: ${id}\n
|
|
8
|
+
text: `Failed to get feature, id: ${id}\n Error: ${feature.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetLoggedInUser(tp) {
|
|
2
2
|
const ctx = await tp.getContext();
|
|
3
|
-
if (
|
|
3
|
+
if (ctx instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get context,
|
|
7
|
+
text: `Failed to get context, Error: ${ctx.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetMyTimeLogs(tp, take) {
|
|
2
2
|
const response = await tp.getMyTimeLogs(take);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get time logs,
|
|
7
|
+
text: `Failed to get time logs, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProcessWorkflows(tp, processId) {
|
|
2
2
|
const response = await tp.getProcessWorkflows({ processId });
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get process workflows,
|
|
7
|
+
text: `Failed to get process workflows, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProcesses(tp) {
|
|
2
2
|
const response = await tp.getProcesses();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get processes,
|
|
7
|
+
text: `Failed to get processes, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProjects(tp) {
|
|
2
2
|
const response = await tp.getProjects();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get projects,
|
|
7
|
+
text: `Failed to get projects, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseBugs(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseBugs({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release bugs,
|
|
7
|
+
text: `Failed to get ${name} release bugs, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseFeatures(tp, name, results) {
|
|
2
2
|
const release = await tp.getReleaseFeatures({ name, results });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release features,
|
|
7
|
+
text: `Failed to get ${name} release features, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseOpenBugs(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseOpenBugs({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release bugs,
|
|
7
|
+
text: `Failed to get ${name} release bugs, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseOpenUserStories(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseOpenUserStories({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release user stories,
|
|
7
|
+
text: `Failed to get ${name} release user stories, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseUserStories(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseUserStories({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release user stories,
|
|
7
|
+
text: `Failed to get ${name} release user stories, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetTeamIterations(tp, params) {
|
|
2
2
|
const response = await tp.getTeamIterations(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get team iterations,
|
|
7
|
+
text: `Failed to get team iterations, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetTeams(tp) {
|
|
2
2
|
const response = await tp.getTeams();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get teams,
|
|
7
|
+
text: `Failed to get teams, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -21,11 +21,11 @@ export async function handleGetTeams(tp) {
|
|
|
21
21
|
export async function handleGetTeamsAndTeamAssignments(tp) {
|
|
22
22
|
const teams = await tp.getTeams();
|
|
23
23
|
const teamAssignments = await tp.getTeamAssignments();
|
|
24
|
-
if (
|
|
24
|
+
if (teams instanceof Error || teamAssignments instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{
|
|
27
27
|
type: 'text',
|
|
28
|
-
text: `Failed to get teams and team assignments,
|
|
28
|
+
text: `Failed to get teams and team assignments, Error: ${teams instanceof Error ? teams.message : teamAssignments instanceof Error ? teamAssignments.message : ''}`
|
|
29
29
|
}],
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestCaseById(tp, id) {
|
|
3
3
|
const testCase = await tp.getTestCase(id);
|
|
4
|
-
if (
|
|
4
|
+
if (testCase instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get test case id: ${id}\n
|
|
8
|
+
text: `Failed to get test case id: ${id}\n Error: ${testCase.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestPlanById(tp, id) {
|
|
3
3
|
const testPlan = await tp.getTestPlan(id);
|
|
4
|
-
if (
|
|
4
|
+
if (testPlan instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: "text",
|
|
8
|
-
text: `Failed to get test plan id: ${id}\n
|
|
8
|
+
text: `Failed to get test plan id: ${id}\n Error: ${testPlan.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestPlanTestCasesWithStepsById(tp, id) {
|
|
3
3
|
const response = await tp.getTestPlanTestCases(id);
|
|
4
|
-
if (
|
|
4
|
+
if (response instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get test cases for test plan id: ${id}\n
|
|
8
|
+
text: `Failed to get test cases for test plan id: ${id}\n Error: ${response.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUserById(tp, id) {
|
|
2
2
|
const user = await tp.getUser(id);
|
|
3
|
-
if (
|
|
3
|
+
if (user instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user, id: ${id}\n
|
|
7
|
+
text: `Failed to get user, id: ${id}\n Error: ${user.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetUserStoryContent(tp, id) {
|
|
3
3
|
const userStory = await tp.getUserStory(id);
|
|
4
|
-
if (
|
|
4
|
+
if (userStory instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get user story, id: ${id}\n
|
|
8
|
+
text: `Failed to get user story, id: ${id}\n Error: ${userStory.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUserStoryWorkflows(tp) {
|
|
2
2
|
const response = await tp.getUserStoryWorkflowsWithSubStates();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user story entity statuses,
|
|
7
|
+
text: `Failed to get user story entity statuses, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUsers(tp) {
|
|
2
2
|
const response = await tp.getUsers();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get users,
|
|
7
|
+
text: `Failed to get users, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleListMyBugs(tp, params) {
|
|
2
2
|
const response = await tp.getMyBugs(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get bugs,
|
|
7
|
+
text: `Failed to get bugs, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleListMyUserStories(tp, params) {
|
|
2
2
|
const response = await tp.getMyUserStories(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user stories,
|
|
7
|
+
text: `Failed to get user stories, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateBug(tp, params) {
|
|
2
2
|
const bugResponse = await tp.updateBug(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update bug "${params.title}"\n
|
|
7
|
+
text: `Failed to update bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateEpic(tp, params) {
|
|
2
2
|
const response = await tp.updateEpic(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update epic id: ${params.id}\n
|
|
7
|
+
text: `Failed to update epic id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateFeature(tp, params) {
|
|
2
2
|
const response = await tp.updateFeature(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update feature id: ${params.id}\n
|
|
7
|
+
text: `Failed to update feature id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -8,11 +8,11 @@ export async function handleUpdateTestCaseById(tp, params) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
const testCaseResponse = await tp.updateTestCase(params);
|
|
11
|
-
if (
|
|
11
|
+
if (testCaseResponse instanceof Error) {
|
|
12
12
|
return {
|
|
13
13
|
content: [{
|
|
14
14
|
type: 'text',
|
|
15
|
-
text: `Failed to update test case id: ${params.id}\n
|
|
15
|
+
text: `Failed to update test case id: ${params.id}\n Error: ${testCaseResponse.message}`
|
|
16
16
|
}],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -8,11 +8,11 @@ export async function handleUpdateTestCaseStepById(tp, params) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
const existingTestStep = await tp.getTestStep(params.id);
|
|
11
|
-
if (
|
|
11
|
+
if (existingTestStep instanceof Error) {
|
|
12
12
|
return {
|
|
13
13
|
content: [{
|
|
14
14
|
type: 'text',
|
|
15
|
-
text: `Failed to get test step id: ${params.id}\n
|
|
15
|
+
text: `Failed to get test step id: ${params.id}\n Error: ${existingTestStep.message}`
|
|
16
16
|
}],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -21,11 +21,11 @@ export async function handleUpdateTestCaseStepById(tp, params) {
|
|
|
21
21
|
description: params.description ?? existingTestStep.Description,
|
|
22
22
|
result: params.result ?? existingTestStep.Result,
|
|
23
23
|
});
|
|
24
|
-
if (
|
|
24
|
+
if (testStepResponse instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{
|
|
27
27
|
type: 'text',
|
|
28
|
-
text: `Failed to update test step id: ${params.id}\n
|
|
28
|
+
text: `Failed to update test step id: ${params.id}\n Error: ${testStepResponse.message}`
|
|
29
29
|
}],
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateUserStorySubState(tp, params) {
|
|
2
2
|
const response = await tp.updateUserStorySubState(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update user story sub state id: ${params.id}\n
|
|
7
|
+
text: `Failed to update user story sub state id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
package/build/index.js
CHANGED
|
@@ -280,7 +280,7 @@ server.registerTool('add_comment_with_user', {
|
|
|
280
280
|
}, async ({ id, comment, user }) => {
|
|
281
281
|
try {
|
|
282
282
|
const addCommentResponse = await tp.addCommentWithUser(id, comment, user);
|
|
283
|
-
if (
|
|
283
|
+
if (addCommentResponse instanceof Error) {
|
|
284
284
|
return {
|
|
285
285
|
content: [{
|
|
286
286
|
type: 'text',
|
|
@@ -508,7 +508,7 @@ server.registerTool('set_business_value', {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
const response = await tp.setBusinessValue({ id, entityType, priorityId });
|
|
511
|
-
if (
|
|
511
|
+
if (response instanceof Error) {
|
|
512
512
|
return { content: [{ type: 'text', text: `Failed to set business value on ${entityType} ${id}` }] };
|
|
513
513
|
}
|
|
514
514
|
return { content: [{ type: 'text', text: JSON.stringify(response) }] };
|
|
@@ -562,7 +562,7 @@ server.registerTool('update_user_story', {
|
|
|
562
562
|
},
|
|
563
563
|
}, async ({ id, title, description, projectId, teamId, entityStateId, featureId, tags, teamIterationId }) => {
|
|
564
564
|
const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId, tags, teamIterationId });
|
|
565
|
-
if (
|
|
565
|
+
if (response instanceof Error) {
|
|
566
566
|
return {
|
|
567
567
|
content: [{
|
|
568
568
|
type: 'text',
|
|
@@ -1026,7 +1026,7 @@ server.registerTool('create_test_plan', {
|
|
|
1026
1026
|
},
|
|
1027
1027
|
}, async ({ title, resourceId, resourceType, description }) => {
|
|
1028
1028
|
const testPlanResponse = await tp.createTestPlan(title, resourceId, resourceType, { description });
|
|
1029
|
-
if (
|
|
1029
|
+
if (testPlanResponse instanceof Error) {
|
|
1030
1030
|
return {
|
|
1031
1031
|
content: [{
|
|
1032
1032
|
type: 'text',
|
|
@@ -1052,7 +1052,7 @@ server.registerTool('get_not_covered_user_stories_in_feature', {
|
|
|
1052
1052
|
},
|
|
1053
1053
|
}, async ({ id }) => {
|
|
1054
1054
|
const response = await tp.getUserStoriesIdsByFeatureId(id);
|
|
1055
|
-
if (
|
|
1055
|
+
if (response instanceof Error) {
|
|
1056
1056
|
return {
|
|
1057
1057
|
content: [{
|
|
1058
1058
|
type: 'text',
|
|
@@ -1249,7 +1249,7 @@ server.registerTool('get_user_story_test_cases', {
|
|
|
1249
1249
|
},
|
|
1250
1250
|
}, async ({ resourceId }) => {
|
|
1251
1251
|
const userStoryResponse = await tp.getUserStoryTestPlan(resourceId);
|
|
1252
|
-
if (
|
|
1252
|
+
if (userStoryResponse instanceof Error) {
|
|
1253
1253
|
return {
|
|
1254
1254
|
content: [{
|
|
1255
1255
|
type: 'text',
|
|
@@ -1346,7 +1346,7 @@ server.registerTool('write_test_cases', {
|
|
|
1346
1346
|
else {
|
|
1347
1347
|
card = await tp.getUserStory(resourceId);
|
|
1348
1348
|
}
|
|
1349
|
-
if (
|
|
1349
|
+
if (card instanceof Error) {
|
|
1350
1350
|
return {
|
|
1351
1351
|
content: [{
|
|
1352
1352
|
type: 'text',
|
|
@@ -1405,7 +1405,7 @@ server.registerTool('add_test_cases_to_test_plan', {
|
|
|
1405
1405
|
const failed = [];
|
|
1406
1406
|
for (const tc of testCases) {
|
|
1407
1407
|
const testCase = await tp.createTestCase(tc.name, tc.description, String(testPlanId));
|
|
1408
|
-
if (
|
|
1408
|
+
if (testCase instanceof Error) {
|
|
1409
1409
|
failed.push(tc.name);
|
|
1410
1410
|
continue;
|
|
1411
1411
|
}
|
|
@@ -1413,11 +1413,11 @@ server.registerTool('add_test_cases_to_test_plan', {
|
|
|
1413
1413
|
let stepsFailed = 0;
|
|
1414
1414
|
for (const step of tc.steps) {
|
|
1415
1415
|
const stepResult = await tp.addTestStep(String(testCase.Id), step);
|
|
1416
|
-
if (stepResult) {
|
|
1417
|
-
|
|
1416
|
+
if (stepResult instanceof Error) {
|
|
1417
|
+
stepsFailed++;
|
|
1418
1418
|
}
|
|
1419
1419
|
else {
|
|
1420
|
-
|
|
1420
|
+
stepsAdded++;
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
created.push({ id: testCase.Id, name: testCase.Name, stepsAdded, stepsFailed });
|
package/build/tp.js
CHANGED
|
@@ -64,7 +64,7 @@ export class TpClient {
|
|
|
64
64
|
catch (error) {
|
|
65
65
|
console.error("Error making TP request:", error);
|
|
66
66
|
console.error("Request URL:", this.redact(_url));
|
|
67
|
-
return
|
|
67
|
+
return error;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
async post(params, data) {
|
|
@@ -85,7 +85,7 @@ export class TpClient {
|
|
|
85
85
|
}
|
|
86
86
|
catch (error) {
|
|
87
87
|
console.error("Error making TP request:", error);
|
|
88
|
-
return
|
|
88
|
+
return error;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
// Like post(), but on failure returns the HTTP status and raw response body
|
|
@@ -149,7 +149,7 @@ export class TpClient {
|
|
|
149
149
|
skip,
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
|
-
if (
|
|
152
|
+
if (page instanceof Error)
|
|
153
153
|
return null;
|
|
154
154
|
if (!page?.Items?.length)
|
|
155
155
|
break;
|
|
@@ -294,12 +294,13 @@ export class TpClient {
|
|
|
294
294
|
bug["Release"] = { "Id": releaseId };
|
|
295
295
|
if (projectId)
|
|
296
296
|
bug["Project"] = { "Id": projectId };
|
|
297
|
-
if (teamId)
|
|
297
|
+
if (teamId) {
|
|
298
298
|
bug["assignedTeams"] = [{
|
|
299
299
|
"team": {
|
|
300
|
-
"
|
|
300
|
+
"id": teamId || config.tp.teamId
|
|
301
301
|
}
|
|
302
302
|
}];
|
|
303
|
+
}
|
|
303
304
|
if (entityStateId)
|
|
304
305
|
bug["entityState"] = { "Id": entityStateId };
|
|
305
306
|
if (tags)
|
|
@@ -1084,7 +1085,7 @@ export class TpClient {
|
|
|
1084
1085
|
const failed = [];
|
|
1085
1086
|
await Promise.all(storyItems.map(async (story) => {
|
|
1086
1087
|
const result = await this.assignRole(String(story.id), userId, roleId);
|
|
1087
|
-
if (result) {
|
|
1088
|
+
if (result && !(result instanceof Error)) {
|
|
1088
1089
|
succeeded.push(result);
|
|
1089
1090
|
}
|
|
1090
1091
|
else {
|