@smartbear/mcp 0.8.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 (44) hide show
  1. package/dist/api-hub/client/api.js +51 -10
  2. package/dist/api-hub/client/registry-types.js +8 -0
  3. package/dist/api-hub/client/tools.js +7 -1
  4. package/dist/api-hub/client.js +3 -0
  5. package/dist/bugsnag/client/api/CurrentUser.js +12 -49
  6. package/dist/bugsnag/client/api/Error.js +29 -142
  7. package/dist/bugsnag/client/api/Project.js +52 -113
  8. package/dist/bugsnag/client/api/api.js +3743 -0
  9. package/dist/bugsnag/client/api/base.js +97 -34
  10. package/dist/bugsnag/client/api/configuration.js +26 -0
  11. package/dist/bugsnag/client/api/index.js +2 -0
  12. package/dist/bugsnag/client/filters.js +28 -0
  13. package/dist/bugsnag/client.js +100 -151
  14. package/dist/common/server.js +25 -3
  15. package/dist/common/types.js +6 -1
  16. package/dist/pactflow/client/prompt-utils.js +2 -1
  17. package/dist/pactflow/client/utils.js +5 -4
  18. package/dist/pactflow/client.js +10 -9
  19. package/dist/qmetry/client/api/client-api.js +21 -16
  20. package/dist/qmetry/client/api/error-handler.js +329 -0
  21. package/dist/qmetry/client/auto-resolve.js +74 -0
  22. package/dist/qmetry/client/handlers.js +19 -2
  23. package/dist/qmetry/client/issues.js +26 -0
  24. package/dist/qmetry/client/project.js +56 -0
  25. package/dist/qmetry/client/requirement.js +76 -0
  26. package/dist/qmetry/client/testcase.js +46 -8
  27. package/dist/qmetry/client/testsuite.js +117 -0
  28. package/dist/qmetry/client/tools.js +1455 -4
  29. package/dist/qmetry/client/utils.js +16 -0
  30. package/dist/qmetry/client.js +19 -16
  31. package/dist/qmetry/config/constants.js +14 -0
  32. package/dist/qmetry/config/rest-endpoints.js +20 -0
  33. package/dist/qmetry/types/common.js +313 -8
  34. package/dist/qmetry/types/issues.js +6 -0
  35. package/dist/qmetry/types/project.js +10 -0
  36. package/dist/qmetry/types/requirements.js +19 -0
  37. package/dist/qmetry/types/testcase.js +14 -0
  38. package/dist/qmetry/types/testsuite.js +26 -0
  39. package/dist/reflect/client.js +7 -6
  40. package/dist/zephyr/common/auth-service.js +1 -0
  41. package/package.json +1 -1
  42. package/dist/bugsnag/client/api/filters.js +0 -167
  43. package/dist/bugsnag/client/configuration.js +0 -10
  44. package/dist/bugsnag/client/index.js +0 -2
@@ -1,13 +1,7 @@
1
- import { QMETRY_DEFAULTS } from "../config/constants.js";
2
1
  import { QMETRY_PATHS } from "../config/rest-endpoints.js";
3
- import { DEFAULT_FETCH_TESTCASE_DETAILS_PAYLOAD, DEFAULT_FETCH_TESTCASE_STEPS_PAYLOAD, DEFAULT_FETCH_TESTCASE_VERSION_DETAILS_PAYLOAD, DEFAULT_FETCH_TESTCASES_PAYLOAD, } from "../types/testcase.js";
2
+ import { DEFAULT_FETCH_TESTCASE_DETAILS_PAYLOAD, DEFAULT_FETCH_TESTCASE_EXECUTIONS_PAYLOAD, DEFAULT_FETCH_TESTCASE_STEPS_PAYLOAD, DEFAULT_FETCH_TESTCASE_VERSION_DETAILS_PAYLOAD, DEFAULT_FETCH_TESTCASES_LINKED_TO_REQUIREMENT_PAYLOAD, DEFAULT_FETCH_TESTCASES_PAYLOAD, } from "../types/testcase.js";
4
3
  import { qmetryRequest } from "./api/client-api.js";
5
- function resolveDefaults(baseUrl, project) {
6
- return {
7
- resolvedBaseUrl: baseUrl || QMETRY_DEFAULTS.BASE_URL,
8
- resolvedProject: project || QMETRY_DEFAULTS.PROJECT_KEY,
9
- };
10
- }
4
+ import { resolveDefaults } from "./utils.js";
11
5
  /**
12
6
  * Fetches a list of test cases.
13
7
  * @throws If `viewId` or `folderPath` are missing/invalid.
@@ -102,3 +96,47 @@ export async function fetchTestCaseSteps(token, baseUrl, project, payload) {
102
96
  body,
103
97
  });
104
98
  }
99
+ /**
100
+ * Fetches test cases linked to a specific requirement.
101
+ * @throws If `rqID` is missing/invalid.
102
+ */
103
+ export async function fetchTestCasesLinkedToRequirement(token, baseUrl, project, payload) {
104
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
105
+ const body = {
106
+ ...DEFAULT_FETCH_TESTCASES_LINKED_TO_REQUIREMENT_PAYLOAD,
107
+ ...payload,
108
+ };
109
+ if (typeof body.rqID !== "number") {
110
+ throw new Error("[fetchTestCasesLinkedToRequirement] Missing or invalid required parameter: 'rqID'.");
111
+ }
112
+ return qmetryRequest({
113
+ method: "POST",
114
+ path: QMETRY_PATHS.TESTCASE.GET_TC_LINKED_TO_RQ,
115
+ token,
116
+ project: resolvedProject,
117
+ baseUrl: resolvedBaseUrl,
118
+ body,
119
+ });
120
+ }
121
+ /**
122
+ * Fetches executions for a specific test case.
123
+ * @throws If `tcid` is missing/invalid.
124
+ */
125
+ export async function fetchTestCaseExecutions(token, baseUrl, project, payload) {
126
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(baseUrl, project);
127
+ const body = {
128
+ ...DEFAULT_FETCH_TESTCASE_EXECUTIONS_PAYLOAD,
129
+ ...payload,
130
+ };
131
+ if (typeof body.tcid !== "number") {
132
+ throw new Error("[fetchTestCaseExecutions] Missing or invalid required parameter: 'tcid'.");
133
+ }
134
+ return qmetryRequest({
135
+ method: "POST",
136
+ path: QMETRY_PATHS.TESTCASE.GET_TC_EXECUTIONS,
137
+ token,
138
+ project: resolvedProject,
139
+ baseUrl: resolvedBaseUrl,
140
+ body,
141
+ });
142
+ }
@@ -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
+ }