targetprocess-mcp-server 2.3.0 → 2.3.1

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 (37) hide show
  1. package/README.md +39 -0
  2. package/build/config.js +0 -0
  3. package/build/handlers/add_comment.js +14 -0
  4. package/build/handlers/create_bug.js +14 -0
  5. package/build/handlers/create_feature.js +14 -0
  6. package/build/handlers/create_task.js +14 -0
  7. package/build/handlers/create_user_story.js +14 -0
  8. package/build/handlers/get_bug_comments.js +45 -0
  9. package/build/handlers/get_bug_content.js +37 -0
  10. package/build/handlers/get_card_current_status.js +23 -0
  11. package/build/handlers/get_commit_message.js +42 -0
  12. package/build/handlers/get_current_releases.js +20 -0
  13. package/build/handlers/get_feature_user_stories.js +23 -0
  14. package/build/handlers/get_in_progress_tasks_and_bugs.js +35 -0
  15. package/build/handlers/get_logged_in_user.js +23 -0
  16. package/build/handlers/get_my_time_logs.js +20 -0
  17. package/build/handlers/get_projects.js +23 -0
  18. package/build/handlers/get_release_bugs.js +20 -0
  19. package/build/handlers/get_release_features.js +20 -0
  20. package/build/handlers/get_release_open_bugs.js +20 -0
  21. package/build/handlers/get_release_open_user_stories.js +20 -0
  22. package/build/handlers/get_release_user_stories.js +20 -0
  23. package/build/handlers/get_teams.js +41 -0
  24. package/build/handlers/get_user_by_id.js +14 -0
  25. package/build/handlers/get_user_story_bugs.js +23 -0
  26. package/build/handlers/get_user_story_comments.js +45 -0
  27. package/build/handlers/get_user_story_content.js +44 -0
  28. package/build/handlers/get_users.js +20 -0
  29. package/build/handlers/list_my_bugs.js +23 -0
  30. package/build/handlers/list_my_user_stories.js +23 -0
  31. package/build/handlers/log_time.js +14 -0
  32. package/build/handlers/update_bug.js +14 -0
  33. package/build/handlers/update_user_story_sub_state.js +14 -0
  34. package/build/index.js +94 -859
  35. package/build/tp.js +25 -0
  36. package/build/types.js +0 -0
  37. package/package.json +12 -7
@@ -0,0 +1,45 @@
1
+ import { JSDOM } from 'jsdom';
2
+ export async function handleGetUserStoryComments(tp, id, results) {
3
+ const response = await tp.getUserStoryComments(id, results);
4
+ if (!response) {
5
+ return {
6
+ content: [{
7
+ type: 'text',
8
+ text: `Failed to get comments for user story id: ${id}`
9
+ }],
10
+ };
11
+ }
12
+ const items = response.Items || [];
13
+ if (items.length === 0) {
14
+ return {
15
+ content: [{
16
+ type: 'text',
17
+ text: `No comments found for user story id: ${id}`,
18
+ }],
19
+ };
20
+ }
21
+ try {
22
+ const parsedItems = items.map((item) => {
23
+ const dom = new JSDOM(`<html><body><div id="content">${item.Description}</div></body></html>`);
24
+ const descriptionText = dom.window.document.getElementById('content')?.textContent;
25
+ return {
26
+ id: item.Id,
27
+ description: descriptionText,
28
+ createDate: item.CreateDate,
29
+ owner: item.Owner.FullName,
30
+ };
31
+ });
32
+ return {
33
+ content: [{ type: 'text', text: JSON.stringify(parsedItems) }],
34
+ };
35
+ }
36
+ catch (error) {
37
+ console.error('Error parsing user story comments:', error);
38
+ return {
39
+ content: [{
40
+ type: 'text',
41
+ text: `Failed to parse user story comments for user story id: ${id}`,
42
+ }],
43
+ };
44
+ }
45
+ }
@@ -0,0 +1,44 @@
1
+ import { JSDOM } from 'jsdom';
2
+ export async function handleGetUserStoryContent(tp, id) {
3
+ const userStory = await tp.getUserStory(id);
4
+ if (!userStory) {
5
+ return {
6
+ content: [{
7
+ type: 'text',
8
+ text: `Failed to get user story, id: ${id}\n JSON: ${JSON.stringify(userStory, null, 2)}`
9
+ }],
10
+ };
11
+ }
12
+ const description = userStory.Description || '';
13
+ if (!description) {
14
+ return {
15
+ content: [{
16
+ type: 'text',
17
+ text: `No description for ${id} tp card`,
18
+ }],
19
+ };
20
+ }
21
+ const result = {
22
+ name: userStory.Name,
23
+ id: userStory.Id,
24
+ description: '',
25
+ feature: userStory.Feature?.Name,
26
+ featureId: userStory.Feature?.Id,
27
+ customFields: userStory.CustomFields,
28
+ assignedTeams: userStory.ResponsibleTeam,
29
+ team: userStory.Team,
30
+ };
31
+ try {
32
+ const dom = new JSDOM(`<html><body><div id="content">${description}</div></body></html>`);
33
+ const descriptionText = dom.window.document.getElementById('content')?.textContent;
34
+ if (descriptionText) {
35
+ result.description = descriptionText;
36
+ }
37
+ }
38
+ catch (error) {
39
+ console.error('Error parsing user story description:', error);
40
+ }
41
+ return {
42
+ content: [{ type: 'text', text: JSON.stringify(result) }],
43
+ };
44
+ }
@@ -0,0 +1,20 @@
1
+ export async function handleGetUsers(tp) {
2
+ const response = await tp.getUsers();
3
+ if (!response) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to get users, JSON: ${JSON.stringify(response, null, 2)}`
8
+ }],
9
+ };
10
+ }
11
+ const items = response.Items || [];
12
+ if (items.length === 0) {
13
+ return {
14
+ content: [{ type: 'text', text: 'No users found' }],
15
+ };
16
+ }
17
+ return {
18
+ content: [{ type: 'text', text: JSON.stringify(items) }],
19
+ };
20
+ }
@@ -0,0 +1,23 @@
1
+ export async function handleListMyBugs(tp, params) {
2
+ const response = await tp.getMyBugs(params);
3
+ if (!response) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to get bugs, JSON: ${JSON.stringify(response, null, 2)}`
8
+ }],
9
+ };
10
+ }
11
+ const items = response.Items || [];
12
+ if (items.length === 0) {
13
+ return {
14
+ content: [{
15
+ type: 'text',
16
+ text: `No bugs assigned to you${params.state ? ` with state "${params.state}"` : ''}`,
17
+ }],
18
+ };
19
+ }
20
+ return {
21
+ content: [{ type: 'text', text: JSON.stringify(items) }],
22
+ };
23
+ }
@@ -0,0 +1,23 @@
1
+ export async function handleListMyUserStories(tp, params) {
2
+ const response = await tp.getMyUserStories(params);
3
+ if (!response) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to get user stories, JSON: ${JSON.stringify(response, null, 2)}`
8
+ }],
9
+ };
10
+ }
11
+ const items = response.Items || [];
12
+ if (items.length === 0) {
13
+ return {
14
+ content: [{
15
+ type: 'text',
16
+ text: `No user stories assigned to you${params.state ? ` with state "${params.state}"` : ''}`,
17
+ }],
18
+ };
19
+ }
20
+ return {
21
+ content: [{ type: 'text', text: JSON.stringify(items) }],
22
+ };
23
+ }
@@ -0,0 +1,14 @@
1
+ export async function handleLogTime(tp, params) {
2
+ const response = await tp.logTime(params);
3
+ if (!response) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to log time on ${params.entityType} id: ${params.entityId}`
8
+ }],
9
+ };
10
+ }
11
+ return {
12
+ content: [{ type: 'text', text: JSON.stringify(response) }],
13
+ };
14
+ }
@@ -0,0 +1,14 @@
1
+ export async function handleUpdateBug(tp, params) {
2
+ const bugResponse = await tp.updateBug(params);
3
+ if (!bugResponse) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to update bug "${params.title}"\n JSON: ${JSON.stringify(bugResponse, null, 2)}`
8
+ }],
9
+ };
10
+ }
11
+ return {
12
+ content: [{ type: 'text', text: JSON.stringify(bugResponse) }],
13
+ };
14
+ }
@@ -0,0 +1,14 @@
1
+ export async function handleUpdateUserStorySubState(tp, params) {
2
+ const response = await tp.updateUserStorySubState(params);
3
+ if (!response) {
4
+ return {
5
+ content: [{
6
+ type: 'text',
7
+ text: `Failed to update user story sub state id: ${params.id}\n JSON: ${JSON.stringify(response, null, 2)}`
8
+ }],
9
+ };
10
+ }
11
+ return {
12
+ content: [{ type: 'text', text: JSON.stringify(response) }],
13
+ };
14
+ }