@smartbear/mcp 0.7.0 → 0.9.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 (52) hide show
  1. package/README.md +19 -2
  2. package/dist/api-hub/client/api.js +198 -23
  3. package/dist/api-hub/client/registry-types.js +22 -0
  4. package/dist/api-hub/client/tools.js +19 -1
  5. package/dist/api-hub/client.js +9 -0
  6. package/dist/bugsnag/client/api/CurrentUser.js +13 -50
  7. package/dist/bugsnag/client/api/Error.js +30 -155
  8. package/dist/bugsnag/client/api/Project.js +56 -124
  9. package/dist/bugsnag/client/api/api.js +3743 -0
  10. package/dist/bugsnag/client/api/base.js +107 -32
  11. package/dist/bugsnag/client/api/configuration.js +26 -0
  12. package/dist/bugsnag/client/api/index.js +2 -0
  13. package/dist/bugsnag/client/filters.js +28 -0
  14. package/dist/bugsnag/client.js +157 -325
  15. package/dist/common/server.js +29 -4
  16. package/dist/common/types.js +6 -1
  17. package/dist/index.js +8 -1
  18. package/dist/pactflow/client/prompt-utils.js +2 -1
  19. package/dist/pactflow/client/tools.js +9 -9
  20. package/dist/pactflow/client/utils.js +5 -4
  21. package/dist/pactflow/client.js +16 -14
  22. package/dist/qmetry/client/api/client-api.js +21 -16
  23. package/dist/qmetry/client/api/error-handler.js +329 -0
  24. package/dist/qmetry/client/auto-resolve.js +74 -0
  25. package/dist/qmetry/client/handlers.js +19 -2
  26. package/dist/qmetry/client/issues.js +26 -0
  27. package/dist/qmetry/client/project.js +56 -0
  28. package/dist/qmetry/client/requirement.js +76 -0
  29. package/dist/qmetry/client/testcase.js +46 -8
  30. package/dist/qmetry/client/testsuite.js +117 -0
  31. package/dist/qmetry/client/tools.js +1455 -4
  32. package/dist/qmetry/client/utils.js +16 -0
  33. package/dist/qmetry/client.js +19 -16
  34. package/dist/qmetry/config/constants.js +14 -0
  35. package/dist/qmetry/config/rest-endpoints.js +20 -0
  36. package/dist/qmetry/types/common.js +313 -8
  37. package/dist/qmetry/types/issues.js +6 -0
  38. package/dist/qmetry/types/project.js +10 -0
  39. package/dist/qmetry/types/requirements.js +19 -0
  40. package/dist/qmetry/types/testcase.js +14 -0
  41. package/dist/qmetry/types/testsuite.js +26 -0
  42. package/dist/reflect/client.js +7 -6
  43. package/dist/zephyr/client.js +16 -0
  44. package/dist/zephyr/common/api-client.js +27 -0
  45. package/dist/zephyr/common/auth-service.js +15 -0
  46. package/dist/zephyr/common/types.js +35 -0
  47. package/dist/zephyr/tool/project/get-projects.js +54 -0
  48. package/dist/zephyr/tool/zephyr-tool.js +1 -0
  49. package/package.json +3 -2
  50. package/dist/bugsnag/client/api/filters.js +0 -167
  51. package/dist/bugsnag/client/configuration.js +0 -10
  52. package/dist/bugsnag/client/index.js +0 -2
@@ -0,0 +1,117 @@
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";
3
+ import { qmetryRequest } from "./api/client-api.js";
4
+ import { resolveDefaults } from "./utils.js";
5
+ /**
6
+ * Fetches test suites to link with test case.
7
+ * @throws If `tsFolderID` is missing/invalid.
8
+ */
9
+ export async function fetchTestSuitesForTestCase(token, baseUrl, project, payload) {
10
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
11
+ const body = {
12
+ ...DEFAULT_FETCH_TESTSUITES_FOR_TESTCASE_PAYLOAD,
13
+ ...payload,
14
+ };
15
+ if (typeof body.tsFolderID !== "number") {
16
+ throw new Error("[fetchTestSuitesForTestCase] Missing or invalid required parameter: 'tsFolderID'.");
17
+ }
18
+ return qmetryRequest({
19
+ method: "POST",
20
+ path: QMETRY_PATHS.TESTSUITE.GET_TS_LIST_FOR_TC,
21
+ token,
22
+ project: resolvedProject,
23
+ baseUrl: resolvedBaseUrl,
24
+ body,
25
+ });
26
+ }
27
+ /**
28
+ * Fetches test cases linked to a given test suite.
29
+ * @throws If `tsID` is missing/invalid.
30
+ */
31
+ export async function fetchTestCasesByTestSuite(token, baseUrl, project, payload) {
32
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
33
+ const body = {
34
+ ...DEFAULT_FETCH_TESTCASES_BY_TESTSUITE_PAYLOAD,
35
+ ...payload,
36
+ };
37
+ if (typeof body.tsID !== "number") {
38
+ throw new Error("[fetchTestCasesByTestSuite] Missing or invalid required parameter: 'tsID'.");
39
+ }
40
+ return qmetryRequest({
41
+ method: "POST",
42
+ path: QMETRY_PATHS.TESTSUITE.GET_TESTCASES_BY_TESTSUITE,
43
+ token,
44
+ project: resolvedProject,
45
+ baseUrl: resolvedBaseUrl,
46
+ body,
47
+ });
48
+ }
49
+ /**
50
+ * Fetches executions for a given test suite.
51
+ * @throws If `tsID` is missing/invalid.
52
+ */
53
+ export async function fetchExecutionsByTestSuite(token, baseUrl, project, payload) {
54
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
55
+ const body = {
56
+ ...DEFAULT_FETCH_EXECUTIONS_BY_TESTSUITE_PAYLOAD,
57
+ ...payload,
58
+ };
59
+ if (typeof body.tsID !== "number") {
60
+ throw new Error("[fetchExecutionsByTestSuite] Missing or invalid required parameter: 'tsID'.");
61
+ }
62
+ return qmetryRequest({
63
+ method: "POST",
64
+ path: QMETRY_PATHS.TESTSUITE.GET_EXECUTIONS_BY_TESTSUITE,
65
+ token,
66
+ project: resolvedProject,
67
+ baseUrl: resolvedBaseUrl,
68
+ body,
69
+ });
70
+ }
71
+ /**
72
+ * Fetches test case runs for a given test suite run ID.
73
+ * @throws If `tsrunID` or `viewId` is missing/invalid.
74
+ */
75
+ export async function fetchTestCaseRunsByTestSuiteRun(token, baseUrl, project, payload) {
76
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
77
+ const body = {
78
+ ...DEFAULT_FETCH_TESTCASE_RUNS_BY_TESTSUITE_RUN_PAYLOAD,
79
+ ...payload,
80
+ };
81
+ if (typeof body.tsrunID !== "string" || !body.tsrunID) {
82
+ throw new Error("[fetchTestCaseRunsByTestSuiteRun] Missing or invalid required parameter: 'tsrunID'.");
83
+ }
84
+ if (typeof body.viewId !== "number") {
85
+ throw new Error("[fetchTestCaseRunsByTestSuiteRun] Missing or invalid required parameter: 'viewId'.");
86
+ }
87
+ return qmetryRequest({
88
+ method: "POST",
89
+ path: QMETRY_PATHS.TESTSUITE.GET_TESTCASE_RUNS_BY_TESTSUITE_RUN,
90
+ token,
91
+ project: resolvedProject,
92
+ baseUrl: resolvedBaseUrl,
93
+ body,
94
+ });
95
+ }
96
+ /**
97
+ * Fetches linked issues for a specific test case run.
98
+ * @throws If `entityId` is missing/invalid.
99
+ */
100
+ export async function fetchLinkedIssuesByTestCaseRun(token, baseUrl, project, payload) {
101
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
102
+ const body = {
103
+ ...DEFAULT_FETCH_LINKED_ISSUES_BY_TESTCASE_RUN_PAYLOAD,
104
+ ...payload,
105
+ };
106
+ if (typeof body.entityId !== "number") {
107
+ throw new Error("[fetchLinkedIssuesByTestCaseRun] Missing or invalid required parameter: 'entityId'.");
108
+ }
109
+ return qmetryRequest({
110
+ method: "POST",
111
+ path: QMETRY_PATHS.TESTSUITE.GET_LINKED_ISSUES_BY_TESTCASE_RUN,
112
+ token,
113
+ project: resolvedProject,
114
+ baseUrl: resolvedBaseUrl,
115
+ body,
116
+ });
117
+ }