targetprocess-mcp-server 2.2.13 → 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 +153 -763
  35. package/build/tp.js +84 -0
  36. package/build/types.js +0 -0
  37. package/package.json +12 -7
package/build/tp.js CHANGED
@@ -64,6 +64,8 @@ export class TpClient {
64
64
  async post(params, data) {
65
65
  params.param["access_token"] = this.token;
66
66
  let _url = this.params(params);
67
+ console.error(JSON.stringify({ "TP_POST_URL": _url }));
68
+ console.error(JSON.stringify({ "TP_POST_BODY": data }));
67
69
  try {
68
70
  const response = await fetch(_url, {
69
71
  method: "POST",
@@ -130,6 +132,23 @@ export class TpClient {
130
132
  param: { "format": "json" },
131
133
  }, bug);
132
134
  }
135
+ async updateUserStorySubState({ id, teamId, teamAssignmentId, entityStateId }) {
136
+ const userStory = { "id": id };
137
+ if (entityStateId)
138
+ userStory["assignedTeams"] = [{
139
+ "id": teamAssignmentId,
140
+ "team": {
141
+ "id": teamId
142
+ },
143
+ "entityState": {
144
+ "id": entityStateId
145
+ }
146
+ }];
147
+ return this.post({
148
+ pathParam: ["UserStories", id],
149
+ param: { "format": "json" },
150
+ }, userStory);
151
+ }
133
152
  async updateUserStory({ id, title, description, projectId, teamId, entityStateId }) {
134
153
  const userStory = { "Id": id };
135
154
  if (title)
@@ -573,6 +592,12 @@ export class TpClient {
573
592
  param: { "format": "json" },
574
593
  });
575
594
  }
595
+ async getTeamAssignments() {
596
+ return this.get({
597
+ pathParam: ["TeamAssignments"],
598
+ param: { "format": "json" },
599
+ });
600
+ }
576
601
  async getTeams() {
577
602
  return this.get({
578
603
  pathParam: ["Teams"],
@@ -684,6 +709,65 @@ export class TpClient {
684
709
  param: { "format": "json" },
685
710
  }, task);
686
711
  }
712
+ async logTime({ entityId, entityType, hours, description, date, }) {
713
+ const timestamp = date ? new Date(date).getTime() : Date.now();
714
+ const body = {
715
+ Spent: hours,
716
+ Date: `/Date(${timestamp})/`,
717
+ User: { Id: config.tp.ownerId },
718
+ Assignable: { Id: entityId, ResourceType: entityType },
719
+ };
720
+ if (description)
721
+ body["Description"] = description;
722
+ return this.post({
723
+ pathParam: ["Times"],
724
+ param: { "format": "json" },
725
+ }, body);
726
+ }
727
+ async getMyTimeLogs(take = 25) {
728
+ return this.get({
729
+ pathParam: ["Times"],
730
+ param: {
731
+ "format": "json",
732
+ "where": `User.Id eq ${config.tp.ownerId}`,
733
+ "include": "[Id,Spent,Date,Description,Assignable[Id,Name,ResourceType]]",
734
+ "orderByDesc": "Date",
735
+ "take": take,
736
+ },
737
+ });
738
+ }
739
+ async getMyUserStories({ state, take = 25, skip = 0 }) {
740
+ const whereParts = [`AssignedUser.Id eq ${config.tp.ownerId}`];
741
+ if (state)
742
+ whereParts.push(`EntityState.Name contains '${state}'`);
743
+ return this.get({
744
+ pathParam: ["UserStories"],
745
+ param: {
746
+ "format": "json",
747
+ "where": whereParts.join(' and '),
748
+ "include": "[Id,Name,EntityState[Name],Effort,Project[Name],Feature[Id,Name],CreateDate,ModifyDate]",
749
+ "orderByDesc": "ModifyDate",
750
+ "take": take,
751
+ "skip": skip,
752
+ },
753
+ });
754
+ }
755
+ async getMyBugs({ state, take = 25, skip = 0 }) {
756
+ const whereParts = [`AssignedUser.Id eq ${config.tp.ownerId}`];
757
+ if (state)
758
+ whereParts.push(`EntityState.Name contains '${state}'`);
759
+ return this.get({
760
+ pathParam: ["Bugs"],
761
+ param: {
762
+ "format": "json",
763
+ "where": whereParts.join(' and '),
764
+ "include": "[Id,Name,EntityState[Name],Severity[Name],Priority[Name],Project[Name],UserStory[Id,Name],CreateDate,ModifyDate]",
765
+ "orderByDesc": "ModifyDate",
766
+ "take": take,
767
+ "skip": skip,
768
+ },
769
+ });
770
+ }
687
771
  async addAttachedFile(generalId, source) {
688
772
  let blob;
689
773
  let fileName;
package/build/types.js CHANGED
File without changes
package/package.json CHANGED
@@ -5,7 +5,9 @@
5
5
  "scripts": {
6
6
  "prebuild": "rimraf build dist",
7
7
  "build": "tsc",
8
- "postbuild": "shx chmod +x build/**/*.js"
8
+ "postbuild": "node chmod.js",
9
+ "test": "vitest run",
10
+ "test:watch": "vitest"
9
11
  },
10
12
  "files": [
11
13
  "build"
@@ -25,7 +27,7 @@
25
27
  "engines": {
26
28
  "node": ">=20.x"
27
29
  },
28
- "version": "2.2.13",
30
+ "version": "2.3.1",
29
31
  "description": "MCP server for Tartget Process",
30
32
  "main": "build/index.js",
31
33
  "keywords": [
@@ -39,18 +41,21 @@
39
41
  "license": "ISC",
40
42
  "dependencies": {
41
43
  "@modelcontextprotocol/sdk": "^1.26.0",
42
- "zod": "^3.25.76",
44
+ "@types/jsdom": "^27.0.0",
43
45
  "@types/node": "^25.2.2",
44
46
  "dotenv": "^17.2.4",
45
- "@types/jsdom": "^27.0.0",
46
- "typescript": "^5.9.3",
47
47
  "jsdom": "^28.0.0",
48
48
  "rimraf": "^6.1.2",
49
49
  "shx": "^0.4.0",
50
- "tsup": "^8.5.0"
50
+ "tsup": "^8.5.0",
51
+ "typescript": "^5.9.3",
52
+ "zod": "^3.25.76"
51
53
  },
52
54
  "bugs": {
53
55
  "url": "https://github.com/SerhiiMaksymiv/targetprocess-mcp-server/issues"
54
56
  },
55
- "homepage": "https://github.com/SerhiiMaksymiv/targetprocess-mcp-server#readme"
57
+ "homepage": "https://github.com/SerhiiMaksymiv/targetprocess-mcp-server#readme",
58
+ "devDependencies": {
59
+ "vitest": "^4.1.8"
60
+ }
56
61
  }