@smartbear/mcp 0.9.0 → 0.11.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 (64) hide show
  1. package/README.md +38 -11
  2. package/dist/bugsnag/client/api/index.js +2 -0
  3. package/dist/bugsnag/client/filters.js +0 -6
  4. package/dist/bugsnag/client.js +238 -380
  5. package/dist/bugsnag/input-schemas.js +51 -0
  6. package/dist/collaborator/client.js +377 -0
  7. package/dist/common/cache.js +63 -0
  8. package/dist/common/client-registry.js +128 -0
  9. package/dist/common/register-clients.js +31 -0
  10. package/dist/common/server.js +77 -28
  11. package/dist/common/transport-http.js +377 -0
  12. package/dist/common/transport-stdio.js +43 -0
  13. package/dist/index.js +18 -60
  14. package/dist/pactflow/client/tools.js +4 -4
  15. package/dist/pactflow/client.js +39 -19
  16. package/dist/qmetry/client/auto-resolve.js +22 -0
  17. package/dist/qmetry/client/handlers.js +18 -4
  18. package/dist/qmetry/client/issues.js +98 -1
  19. package/dist/qmetry/client/project.js +18 -1
  20. package/dist/qmetry/client/testcase.js +79 -1
  21. package/dist/qmetry/client/testsuite.js +156 -1
  22. package/dist/qmetry/client/tools/index.js +17 -0
  23. package/dist/qmetry/client/tools/issue-tools.js +545 -0
  24. package/dist/qmetry/client/tools/project-tools.js +348 -0
  25. package/dist/qmetry/client/tools/requirement-tools.js +530 -0
  26. package/dist/qmetry/client/tools/testcase-tools.js +526 -0
  27. package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
  28. package/dist/qmetry/client/tools/types.js +1 -0
  29. package/dist/qmetry/client.js +33 -11
  30. package/dist/qmetry/config/constants.js +14 -0
  31. package/dist/qmetry/config/rest-endpoints.js +10 -0
  32. package/dist/qmetry/types/common.js +287 -2
  33. package/dist/qmetry/types/issues.js +11 -1
  34. package/dist/qmetry/types/project.js +7 -0
  35. package/dist/qmetry/types/testcase.js +6 -0
  36. package/dist/qmetry/types/testsuite.js +19 -1
  37. package/dist/reflect/client.js +10 -4
  38. package/dist/{api-hub → swagger}/client/api.js +190 -2
  39. package/dist/{api-hub → swagger}/client/configuration.js +6 -1
  40. package/dist/swagger/client/index.js +6 -0
  41. package/dist/{api-hub → swagger}/client/portal-types.js +126 -0
  42. package/dist/swagger/client/tools.js +161 -0
  43. package/dist/swagger/client/user-management-types.js +24 -0
  44. package/dist/swagger/client.js +141 -0
  45. package/dist/swagger/config-utils.js +18 -0
  46. package/dist/zephyr/client.js +44 -6
  47. package/dist/zephyr/common/api-client.js +8 -0
  48. package/dist/zephyr/common/rest-api-schemas.js +5174 -0
  49. package/dist/zephyr/tool/priority/get-priorities.js +43 -0
  50. package/dist/zephyr/tool/project/get-project.js +39 -0
  51. package/dist/zephyr/tool/project/get-projects.js +7 -13
  52. package/dist/zephyr/tool/status/get-statuses.js +49 -0
  53. package/dist/zephyr/tool/test-case/get-test-case.js +39 -0
  54. package/dist/zephyr/tool/test-case/get-test-cases.js +64 -0
  55. package/dist/zephyr/tool/test-cycle/get-test-cycle.js +39 -0
  56. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
  57. package/dist/zephyr/tool/test-execution/get-test-execution.js +39 -0
  58. package/package.json +2 -2
  59. package/dist/api-hub/client/index.js +0 -5
  60. package/dist/api-hub/client/tools.js +0 -104
  61. package/dist/api-hub/client.js +0 -98
  62. package/dist/qmetry/client/tools.js +0 -1673
  63. package/dist/zephyr/common/types.js +0 -35
  64. /package/dist/{api-hub → swagger}/client/registry-types.js +0 -0
@@ -1,7 +1,85 @@
1
1
  import { QMETRY_PATHS } from "../config/rest-endpoints.js";
2
- import { DEFAULT_FETCH_EXECUTIONS_BY_TESTSUITE_PAYLOAD, DEFAULT_FETCH_LINKED_ISSUES_BY_TESTCASE_RUN_PAYLOAD, DEFAULT_FETCH_TESTCASE_RUNS_BY_TESTSUITE_RUN_PAYLOAD, DEFAULT_FETCH_TESTCASES_BY_TESTSUITE_PAYLOAD, DEFAULT_FETCH_TESTSUITES_FOR_TESTCASE_PAYLOAD, } from "../types/testsuite.js";
2
+ import { DEFAULT_CREATE_TESTSUITE_PAYLOAD, DEFAULT_FETCH_EXECUTIONS_BY_TESTSUITE_PAYLOAD, DEFAULT_FETCH_LINKED_ISSUES_BY_TESTCASE_RUN_PAYLOAD, DEFAULT_FETCH_TESTCASE_RUNS_BY_TESTSUITE_RUN_PAYLOAD, DEFAULT_FETCH_TESTCASES_BY_TESTSUITE_PAYLOAD, DEFAULT_FETCH_TESTSUITES_FOR_TESTCASE_PAYLOAD, DEFAULT_FETCH_TESTSUITES_PAYLOAD, DEFAULT_LINKED_PLATFORMS_TO_TESTSUITE_PAYLOAD, DEFAULT_LINKED_TESTCASE_TO_TESTSUITE_PAYLOAD, DEFAULT_REQLINKED_TESTCASE_TO_TESTSUITE_PAYLOAD, DEFAULT_UPDATE_TESTSUITE_PAYLOAD, } from "../types/testsuite.js";
3
3
  import { qmetryRequest } from "./api/client-api.js";
4
4
  import { resolveDefaults } from "./utils.js";
5
+ /**
6
+ * Create test suites.
7
+ * @throws If `parentFolderId` or `name` are missing/invalid.
8
+ */
9
+ export async function createTestSuites(token, baseUrl, project, payload) {
10
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
11
+ const body = {
12
+ ...DEFAULT_CREATE_TESTSUITE_PAYLOAD,
13
+ ...payload,
14
+ };
15
+ if (typeof body.parentFolderId !== "string") {
16
+ throw new Error("[createTestSuites] Missing or invalid required parameter: 'parentFolderId'.");
17
+ }
18
+ if (typeof body.name !== "string") {
19
+ throw new Error("[createTestSuites] Missing or invalid required parameter: 'name'.");
20
+ }
21
+ return qmetryRequest({
22
+ method: "POST",
23
+ path: QMETRY_PATHS.TESTSUITE.CREATE_UPDATE_TS,
24
+ token,
25
+ project: resolvedProject,
26
+ baseUrl: resolvedBaseUrl,
27
+ body,
28
+ });
29
+ }
30
+ /**
31
+ * Update test suites.
32
+ * @throws If `id` or `entityKey` or `TsFolderID` are missing/invalid.
33
+ */
34
+ export async function updateTestSuite(token, baseUrl, project, payload) {
35
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
36
+ const body = {
37
+ ...DEFAULT_UPDATE_TESTSUITE_PAYLOAD,
38
+ ...payload,
39
+ };
40
+ if (typeof body.id !== "number") {
41
+ throw new Error("[updateTestSuite] Missing or invalid required parameter: 'id'.");
42
+ }
43
+ if (typeof body.entityKey !== "string") {
44
+ throw new Error("[updateTestSuite] Missing or invalid required parameter: 'entityKey'.");
45
+ }
46
+ if (typeof body.TsFolderID !== "number") {
47
+ throw new Error("[updateTestSuite] Missing or invalid required parameter: 'TsFolderID'.");
48
+ }
49
+ return qmetryRequest({
50
+ method: "PUT",
51
+ path: QMETRY_PATHS.TESTSUITE.CREATE_UPDATE_TS,
52
+ token,
53
+ project: resolvedProject,
54
+ baseUrl: resolvedBaseUrl,
55
+ body,
56
+ });
57
+ }
58
+ /**
59
+ * Fetches a list of test suites.
60
+ * @throws If `viewId` or `folderPath` are missing/invalid.
61
+ */
62
+ export async function fetchTestSuites(token, baseUrl, project, payload) {
63
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
64
+ const body = {
65
+ ...DEFAULT_FETCH_TESTSUITES_PAYLOAD,
66
+ ...payload,
67
+ };
68
+ if (typeof body.viewId !== "number") {
69
+ throw new Error("[fetchTestSuites] Missing or invalid required parameter: 'viewId'.");
70
+ }
71
+ if (typeof body.folderPath !== "string") {
72
+ throw new Error("[fetchTestSuites] Missing or invalid required parameter: 'folderPath'.");
73
+ }
74
+ return qmetryRequest({
75
+ method: "POST",
76
+ path: QMETRY_PATHS.TESTSUITE.GET_TS_LIST,
77
+ token,
78
+ project: resolvedProject,
79
+ baseUrl: resolvedBaseUrl,
80
+ body,
81
+ });
82
+ }
5
83
  /**
6
84
  * Fetches test suites to link with test case.
7
85
  * @throws If `tsFolderID` is missing/invalid.
@@ -115,3 +193,80 @@ export async function fetchLinkedIssuesByTestCaseRun(token, baseUrl, project, pa
115
193
  body,
116
194
  });
117
195
  }
196
+ /**
197
+ * Link test cases to a test suite.
198
+ * @throws If `tcID` or `tcVersionID` are missing/invalid.
199
+ */
200
+ export async function linkTestCasesToTestSuite(token, baseUrl, project, payload) {
201
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
202
+ const body = {
203
+ ...DEFAULT_LINKED_TESTCASE_TO_TESTSUITE_PAYLOAD,
204
+ ...payload,
205
+ };
206
+ if (typeof body.tsID !== "number") {
207
+ throw new Error("[linkTestCasesToTestSuite] Missing or invalid required parameter: 'tsID'.");
208
+ }
209
+ if (!body.tcvdIDs) {
210
+ throw new Error("[linkTestCasesToTestSuite] 'tcvdIDs' must be provided.");
211
+ }
212
+ return qmetryRequest({
213
+ method: "PUT",
214
+ path: QMETRY_PATHS.TESTSUITE.LINKED_TESTCASES_TO_TESTSUITE,
215
+ token,
216
+ project: resolvedProject,
217
+ baseUrl: resolvedBaseUrl,
218
+ body,
219
+ });
220
+ }
221
+ /**
222
+ * Requirements Linked test cases to a test suite.
223
+ * @throws If `tcID` or `rqVersionIds` are missing/invalid.
224
+ */
225
+ export async function reqLinkedTestCasesToTestSuite(token, baseUrl, project, payload) {
226
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
227
+ const body = {
228
+ ...DEFAULT_REQLINKED_TESTCASE_TO_TESTSUITE_PAYLOAD,
229
+ ...payload,
230
+ };
231
+ if (typeof body.tsID !== "number") {
232
+ throw new Error("[reqLinkedTestCasesToTestSuite] Missing or invalid required parameter: 'tsID'.");
233
+ }
234
+ if (!body.tcvdIDs) {
235
+ throw new Error("[reqLinkedTestCasesToTestSuite] 'tcvdIDs' must be provided.");
236
+ }
237
+ return qmetryRequest({
238
+ method: "PUT",
239
+ path: QMETRY_PATHS.TESTSUITE.LINKED_TESTCASES_TO_TESTSUITE,
240
+ token,
241
+ project: resolvedProject,
242
+ baseUrl: resolvedBaseUrl,
243
+ body,
244
+ });
245
+ }
246
+ /**
247
+ * Link platforms to a test suite.
248
+ * @throws If `qmTsId` or `qmPlatformId` are missing/invalid.
249
+ */
250
+ export async function linkPlatformsToTestSuite(token, baseUrl, project, payload) {
251
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
252
+ const body = {
253
+ ...DEFAULT_LINKED_PLATFORMS_TO_TESTSUITE_PAYLOAD,
254
+ ...payload,
255
+ };
256
+ if (typeof body.qmTsId !== "number") {
257
+ throw new Error("[linkPlatformsToTestSuite] Missing or invalid required parameter: 'qmTsId'.");
258
+ }
259
+ if (!body.qmPlatformId ||
260
+ typeof body.qmPlatformId !== "string" ||
261
+ body.qmPlatformId.trim().length === 0) {
262
+ throw new Error("[linkPlatformsToTestSuite] Missing or invalid required parameter: 'qmPlatformId'. It must be a non-empty comma-separated string of Platform IDs.");
263
+ }
264
+ return qmetryRequest({
265
+ method: "PUT",
266
+ path: QMETRY_PATHS.TESTSUITE.LINK_PLATFORMS_TO_TESTSUITE,
267
+ token,
268
+ project: resolvedProject,
269
+ baseUrl: resolvedBaseUrl,
270
+ body,
271
+ });
272
+ }
@@ -0,0 +1,17 @@
1
+ export { ISSUE_TOOLS } from "./issue-tools.js";
2
+ export { PROJECT_TOOLS } from "./project-tools.js";
3
+ export { REQUIREMENT_TOOLS } from "./requirement-tools.js";
4
+ export { TESTCASE_TOOLS } from "./testcase-tools.js";
5
+ export { TESTSUITE_TOOLS } from "./testsuite-tools.js";
6
+ import { ISSUE_TOOLS } from "./issue-tools.js";
7
+ import { PROJECT_TOOLS } from "./project-tools.js";
8
+ import { REQUIREMENT_TOOLS } from "./requirement-tools.js";
9
+ import { TESTCASE_TOOLS } from "./testcase-tools.js";
10
+ import { TESTSUITE_TOOLS } from "./testsuite-tools.js";
11
+ export const TOOLS = [
12
+ ...PROJECT_TOOLS,
13
+ ...TESTCASE_TOOLS,
14
+ ...REQUIREMENT_TOOLS,
15
+ ...TESTSUITE_TOOLS,
16
+ ...ISSUE_TOOLS,
17
+ ];