targetprocess-mcp-server 1.0.16 → 1.0.18-a

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/index.js CHANGED
@@ -755,32 +755,48 @@ server.registerTool('get_not_covered_user_stories_in_feature', {
755
755
  const userStoriesPromise = userStoriesIds.map((id) => tp.getUserStory(id));
756
756
  let userStoriesResults = [];
757
757
  try {
758
- userStoriesResults = await Promise.all(userStoriesPromise);
758
+ const results = await Promise.all(userStoriesPromise);
759
+ userStoriesResults = results.map((item) => item).flat();
759
760
  }
760
761
  catch (error) {
761
762
  console.error("Error getting user stories:", error);
762
763
  return {
763
764
  content: [{
764
765
  type: 'text',
765
- text: `Failed to get user stories for feature id: ${id}`,
766
+ text: `Failed to get user stories for feature id: ${id}. Error: ${error}`,
767
+ }],
768
+ };
769
+ }
770
+ if (userStoriesResults.length === 0) {
771
+ return {
772
+ content: [{
773
+ type: 'text',
774
+ text: `No user stories promise found for feature id: ${id}`,
766
775
  }],
767
776
  };
768
777
  }
769
778
  let userStories = [];
770
- for (const userStory of userStoriesResults) {
771
- const userStoryId = userStory.Id;
772
- const feature = userStory.Feature;
773
- const featureId = feature.Id;
774
- const featureName = feature.Name;
775
- const covered = userStory.CustomFields.find((field) => field.Name === "Test Automation")?.Value === "Done";
776
- userStories.push({
777
- id: userStoryId,
778
- name: userStory.Name,
779
- description: userStory.Description,
780
- featureId,
781
- featureName,
782
- covered,
783
- });
779
+ try {
780
+ for (const userStory of userStoriesResults) {
781
+ const covered = userStory.CustomFields.find((field) => field.Name === "Test Automation")?.Value === "Done";
782
+ userStories.push({
783
+ id: userStory.Id,
784
+ name: userStory.Name,
785
+ description: userStory.Description,
786
+ featureId: userStory.Feature.Id,
787
+ featureName: userStory.Feature.Name,
788
+ covered,
789
+ });
790
+ }
791
+ }
792
+ catch (error) {
793
+ console.error("Error getting user stories:", error);
794
+ return {
795
+ content: [{
796
+ type: 'text',
797
+ text: `Failed to get user stories array for feature id: ${id}: Error: ${error}`,
798
+ }],
799
+ };
784
800
  }
785
801
  if (userStories.length === 0) {
786
802
  return {
package/build/tp.js CHANGED
@@ -80,12 +80,8 @@ export class TpClient {
80
80
  }
81
81
  async getUserStory(userStoryId) {
82
82
  const response = await this.get({
83
- pathParam: {
84
- "userStories": userStoryId,
85
- },
86
- param: {
87
- "format": "json",
88
- },
83
+ pathParam: { "userStories": userStoryId },
84
+ param: { "format": "json" },
89
85
  });
90
86
  return response;
91
87
  }
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "1.0.16",
28
+ "version": "1.0.18a",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [