@smartbear/mcp 0.8.0 → 0.10.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.
Files changed (66) hide show
  1. package/README.md +29 -4
  2. package/dist/api-hub/client/api.js +239 -10
  3. package/dist/api-hub/client/configuration.js +5 -0
  4. package/dist/api-hub/client/index.js +1 -0
  5. package/dist/api-hub/client/portal-types.js +126 -0
  6. package/dist/api-hub/client/registry-types.js +8 -0
  7. package/dist/api-hub/client/tools.js +78 -15
  8. package/dist/api-hub/client/user-management-types.js +24 -0
  9. package/dist/api-hub/client.js +34 -0
  10. package/dist/bugsnag/client/api/CurrentUser.js +12 -49
  11. package/dist/bugsnag/client/api/Error.js +29 -142
  12. package/dist/bugsnag/client/api/Project.js +52 -113
  13. package/dist/bugsnag/client/api/api.js +3743 -0
  14. package/dist/bugsnag/client/api/base.js +97 -34
  15. package/dist/bugsnag/client/api/configuration.js +26 -0
  16. package/dist/bugsnag/client/api/index.js +2 -0
  17. package/dist/bugsnag/client/filters.js +28 -0
  18. package/dist/bugsnag/client.js +104 -155
  19. package/dist/collaborator/client.js +364 -0
  20. package/dist/common/server.js +73 -23
  21. package/dist/common/types.js +6 -1
  22. package/dist/index.js +9 -1
  23. package/dist/pactflow/client/prompt-utils.js +2 -1
  24. package/dist/pactflow/client/tools.js +4 -4
  25. package/dist/pactflow/client/utils.js +5 -4
  26. package/dist/pactflow/client.js +10 -9
  27. package/dist/qmetry/client/api/client-api.js +21 -16
  28. package/dist/qmetry/client/api/error-handler.js +329 -0
  29. package/dist/qmetry/client/auto-resolve.js +96 -0
  30. package/dist/qmetry/client/handlers.js +33 -2
  31. package/dist/qmetry/client/issues.js +123 -0
  32. package/dist/qmetry/client/project.js +73 -0
  33. package/dist/qmetry/client/requirement.js +76 -0
  34. package/dist/qmetry/client/testcase.js +122 -6
  35. package/dist/qmetry/client/testsuite.js +272 -0
  36. package/dist/qmetry/client/tools/index.js +17 -0
  37. package/dist/qmetry/client/tools/issue-tools.js +545 -0
  38. package/dist/qmetry/client/tools/project-tools.js +348 -0
  39. package/dist/qmetry/client/tools/requirement-tools.js +530 -0
  40. package/dist/qmetry/client/tools/testcase-tools.js +526 -0
  41. package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
  42. package/dist/qmetry/client/tools/types.js +1 -0
  43. package/dist/qmetry/client/utils.js +16 -0
  44. package/dist/qmetry/client.js +27 -17
  45. package/dist/qmetry/config/constants.js +28 -0
  46. package/dist/qmetry/config/rest-endpoints.js +30 -0
  47. package/dist/qmetry/types/common.js +599 -9
  48. package/dist/qmetry/types/issues.js +16 -0
  49. package/dist/qmetry/types/project.js +17 -0
  50. package/dist/qmetry/types/requirements.js +19 -0
  51. package/dist/qmetry/types/testcase.js +20 -0
  52. package/dist/qmetry/types/testsuite.js +44 -0
  53. package/dist/reflect/client.js +7 -6
  54. package/dist/zephyr/client.js +7 -1
  55. package/dist/zephyr/common/api-client.js +8 -0
  56. package/dist/zephyr/common/auth-service.js +1 -0
  57. package/dist/zephyr/common/rest-api-schemas.js +5173 -0
  58. package/dist/zephyr/tool/project/get-project.js +39 -0
  59. package/dist/zephyr/tool/project/get-projects.js +7 -13
  60. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
  61. package/package.json +1 -1
  62. package/dist/bugsnag/client/api/filters.js +0 -167
  63. package/dist/bugsnag/client/configuration.js +0 -10
  64. package/dist/bugsnag/client/index.js +0 -2
  65. package/dist/qmetry/client/tools.js +0 -222
  66. package/dist/zephyr/common/types.js +0 -35
@@ -0,0 +1,17 @@
1
+ import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
2
+ export const DEFAULT_FETCH_PROJECTS_PAYLOAD = {
3
+ ...DEFAULT_PAGINATION,
4
+ ...DEFAULT_FILTER,
5
+ params: {
6
+ showArchive: false,
7
+ },
8
+ };
9
+ export const DEFAULT_FETCH_BUILD_PAYLOAD = {
10
+ ...DEFAULT_PAGINATION,
11
+ ...DEFAULT_FILTER,
12
+ };
13
+ export const DEFAULT_FETCH_PLATFORMS_PAYLOAD = {
14
+ ...DEFAULT_PAGINATION,
15
+ ...DEFAULT_FILTER,
16
+ ...DEFAULT_SORT,
17
+ };
@@ -0,0 +1,19 @@
1
+ import { DEFAULT_FILTER, DEFAULT_FOLDER_OPTIONS, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
2
+ export const DEFAULT_FETCH_REQUIREMENTS_PAYLOAD = {
3
+ ...DEFAULT_PAGINATION,
4
+ ...DEFAULT_FILTER,
5
+ ...DEFAULT_FOLDER_OPTIONS,
6
+ ...DEFAULT_SORT,
7
+ udfFilter: "[]",
8
+ isJiraFilter: false,
9
+ filterType: "QMETRY",
10
+ };
11
+ export const DEFAULT_FETCH_REQUIREMENT_DETAILS_PAYLOAD = {
12
+ // No defaults needed for this simple payload
13
+ };
14
+ export const DEFAULT_FETCH_REQUIREMENTS_LINKED_TO_TESTCASE_PAYLOAD = {
15
+ ...DEFAULT_PAGINATION,
16
+ ...DEFAULT_FILTER,
17
+ getLinked: true,
18
+ rqFolderPath: "",
19
+ };
@@ -5,6 +5,11 @@ export const DEFAULT_FETCH_TESTCASES_PAYLOAD = {
5
5
  ...DEFAULT_FOLDER_OPTIONS,
6
6
  udfFilter: "[]",
7
7
  };
8
+ export const DEFAULT_CREATE_TESTCASES_PAYLOAD = {
9
+ scope: "project",
10
+ steps: [],
11
+ };
12
+ export const DEFAULT_UPDATE_TESTCASES_PAYLOAD = {};
8
13
  export const DEFAULT_FETCH_TESTCASE_DETAILS_PAYLOAD = {
9
14
  ...DEFAULT_PAGINATION,
10
15
  ...DEFAULT_FILTER,
@@ -17,3 +22,18 @@ export const DEFAULT_FETCH_TESTCASE_STEPS_PAYLOAD = {
17
22
  ...DEFAULT_PAGINATION,
18
23
  version: 1,
19
24
  };
25
+ export const DEFAULT_FETCH_TESTCASES_LINKED_TO_REQUIREMENT_PAYLOAD = {
26
+ ...DEFAULT_PAGINATION,
27
+ ...DEFAULT_FILTER,
28
+ getLinked: true,
29
+ showEntityWithReleaseCycle: false,
30
+ tcFolderPath: "",
31
+ getSubEntities: true,
32
+ getColumns: true,
33
+ };
34
+ export const DEFAULT_FETCH_TESTCASE_EXECUTIONS_PAYLOAD = {
35
+ ...DEFAULT_PAGINATION,
36
+ ...DEFAULT_FILTER,
37
+ scope: DEFAULT_FOLDER_OPTIONS.scope,
38
+ };
39
+ export const DEFAULT_LINKED_REQUIREMENT_TO_TESTCASE_PAYLOAD = {};
@@ -0,0 +1,44 @@
1
+ import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
2
+ export const DEFAULT_FETCH_TESTSUITES_FOR_TESTCASE_PAYLOAD = {
3
+ ...DEFAULT_PAGINATION,
4
+ ...DEFAULT_FILTER,
5
+ getColumns: true,
6
+ };
7
+ export const DEFAULT_FETCH_TESTCASES_BY_TESTSUITE_PAYLOAD = {
8
+ ...DEFAULT_PAGINATION,
9
+ ...DEFAULT_FILTER,
10
+ getLinked: true,
11
+ };
12
+ export const DEFAULT_FETCH_EXECUTIONS_BY_TESTSUITE_PAYLOAD = {
13
+ ...DEFAULT_PAGINATION,
14
+ ...DEFAULT_FILTER,
15
+ gridName: "TESTEXECUTIONLIST",
16
+ };
17
+ export const DEFAULT_FETCH_TESTCASE_RUNS_BY_TESTSUITE_RUN_PAYLOAD = {
18
+ ...DEFAULT_PAGINATION,
19
+ };
20
+ export const DEFAULT_FETCH_LINKED_ISSUES_BY_TESTCASE_RUN_PAYLOAD = {
21
+ ...DEFAULT_PAGINATION,
22
+ ...DEFAULT_FILTER,
23
+ getLinked: true,
24
+ getColumns: true,
25
+ istcrFlag: true,
26
+ };
27
+ export const DEFAULT_LINKED_TESTCASE_TO_TESTSUITE_PAYLOAD = {
28
+ fromReqs: false,
29
+ };
30
+ export const DEFAULT_REQLINKED_TESTCASE_TO_TESTSUITE_PAYLOAD = {
31
+ fromReqs: true,
32
+ };
33
+ export const DEFAULT_CREATE_TESTSUITE_PAYLOAD = {
34
+ isAutomatedFlag: false,
35
+ };
36
+ export const DEFAULT_UPDATE_TESTSUITE_PAYLOAD = {};
37
+ export const DEFAULT_FETCH_TESTSUITES_PAYLOAD = {
38
+ ...DEFAULT_PAGINATION,
39
+ ...DEFAULT_FILTER,
40
+ ...DEFAULT_SORT,
41
+ udfFilter: "[]",
42
+ scope: "cycle",
43
+ };
44
+ export const DEFAULT_LINKED_PLATFORMS_TO_TESTSUITE_PAYLOAD = {};
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
3
+ import { ToolError, } from "../common/types.js";
3
4
  // ReflectClient class implementing the Client interface
4
5
  export class ReflectClient {
5
6
  headers;
@@ -92,7 +93,7 @@ export class ReflectClient {
92
93
  ],
93
94
  }, async (args, _extra) => {
94
95
  if (!args.suiteId)
95
- throw new Error("suiteId argument is required");
96
+ throw new ToolError("suiteId argument is required");
96
97
  const response = await this.listSuiteExecutions(args.suiteId);
97
98
  return {
98
99
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -117,7 +118,7 @@ export class ReflectClient {
117
118
  ],
118
119
  }, async (args, _extra) => {
119
120
  if (!args.suiteId || !args.executionId)
120
- throw new Error("Both suiteId and executionId arguments are required");
121
+ throw new ToolError("Both suiteId and executionId arguments are required");
121
122
  const response = await this.getSuiteExecutionStatus(args.suiteId, args.executionId);
122
123
  return {
123
124
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -136,7 +137,7 @@ export class ReflectClient {
136
137
  ],
137
138
  }, async (args, _extra) => {
138
139
  if (!args.suiteId)
139
- throw new Error("suiteId argument is required");
140
+ throw new ToolError("suiteId argument is required");
140
141
  const response = await this.executeSuite(args.suiteId);
141
142
  return {
142
143
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -161,7 +162,7 @@ export class ReflectClient {
161
162
  ],
162
163
  }, async (args, _extra) => {
163
164
  if (!args.suiteId || !args.executionId)
164
- throw new Error("Both suiteId and executionId arguments are required");
165
+ throw new ToolError("Both suiteId and executionId arguments are required");
165
166
  const response = await this.cancelSuiteExecution(args.suiteId, args.executionId);
166
167
  return {
167
168
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -190,7 +191,7 @@ export class ReflectClient {
190
191
  ],
191
192
  }, async (args, _extra) => {
192
193
  if (!args.testId)
193
- throw new Error("testId argument is required");
194
+ throw new ToolError("testId argument is required");
194
195
  const response = await this.runReflectTest(args.testId);
195
196
  return {
196
197
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -215,7 +216,7 @@ export class ReflectClient {
215
216
  ],
216
217
  }, async (args, _extra) => {
217
218
  if (!args.testId || !args.executionId)
218
- throw new Error("Both testId and executionId arguments are required");
219
+ throw new ToolError("Both testId and executionId arguments are required");
219
220
  const response = await this.getReflectTestStatus(args.testId, args.executionId);
220
221
  return {
221
222
  content: [{ type: "text", text: JSON.stringify(response) }],
@@ -1,5 +1,7 @@
1
1
  import { ApiClient } from "./common/api-client.js";
2
+ import { GetProject } from "./tool/project/get-project.js";
2
3
  import { GetProjects } from "./tool/project/get-projects.js";
4
+ import { GetTestCycles } from "./tool/test-cycle/get-test-cycles.js";
3
5
  export class ZephyrClient {
4
6
  apiClient;
5
7
  name = "Zephyr";
@@ -8,7 +10,11 @@ export class ZephyrClient {
8
10
  this.apiClient = new ApiClient(bearerToken, baseUrl);
9
11
  }
10
12
  registerTools(register, _getInput) {
11
- const tools = [new GetProjects(this.apiClient)];
13
+ const tools = [
14
+ new GetProjects(this.apiClient),
15
+ new GetProject(this.apiClient),
16
+ new GetTestCycles(this.apiClient),
17
+ ];
12
18
  tools.forEach((tool) => {
13
19
  register(tool.specification, tool.handle);
14
20
  });
@@ -1,3 +1,4 @@
1
+ import { ToolError } from "../../common/types.js";
1
2
  import { AuthService } from "./auth-service.js";
2
3
  export class ApiClient {
3
4
  baseUrl;
@@ -22,6 +23,13 @@ export class ApiClient {
22
23
  method: "GET",
23
24
  headers: this.defaultHeaders,
24
25
  });
26
+ return await this.validateAndGetResponseBody(response);
27
+ }
28
+ async validateAndGetResponseBody(response) {
29
+ if (!response.ok) {
30
+ const errorText = await response.text();
31
+ throw new ToolError(`Request failed with status ${response.status}: ${errorText}`);
32
+ }
25
33
  return response.json();
26
34
  }
27
35
  }
@@ -9,6 +9,7 @@ export class AuthService {
9
9
  Authorization: `Bearer ${this.bearerToken}`,
10
10
  "Content-Type": "application/json",
11
11
  "User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`,
12
+ "zscale-source": "smartbear-mcp",
12
13
  };
13
14
  }
14
15
  }