@smartbear/mcp 0.24.0 → 0.25.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 (137) hide show
  1. package/dist/bearq/client.js +12 -13
  2. package/dist/bearq/tool/tasks/chat-with-qa-lead.js +1 -0
  3. package/dist/bearq/tool/tasks/expand-application-model.js +1 -0
  4. package/dist/bearq/tool/tasks/get-task-status.js +1 -0
  5. package/dist/bearq/tool/tasks/get-task.js +1 -0
  6. package/dist/bearq/tool/tasks/refine-all-draft-tests.js +1 -0
  7. package/dist/bearq/tool/tasks/refine-test-cases.js +1 -0
  8. package/dist/bearq/tool/tasks/refine-tests-in-functional-areas.js +1 -0
  9. package/dist/bearq/tool/tasks/run-regression-tests.js +1 -0
  10. package/dist/bearq/tool/tasks/run-test-cases.js +1 -0
  11. package/dist/bearq/tool/tasks/run-tests-in-functional-areas.js +1 -0
  12. package/dist/bearq/tool/tasks/stop-task.js +1 -0
  13. package/dist/bearq/tool/tasks/wait-for-task.js +1 -0
  14. package/dist/bugsnag/client.js +24 -44
  15. package/dist/bugsnag/tool/error/get-error.js +1 -0
  16. package/dist/bugsnag/tool/error/list-project-errors.js +1 -0
  17. package/dist/bugsnag/tool/error/update-error.js +1 -0
  18. package/dist/bugsnag/tool/event/get-event-details-from-dashboard-url.js +1 -0
  19. package/dist/bugsnag/tool/event/get-event.js +1 -0
  20. package/dist/bugsnag/tool/event/list-error-events.js +1 -0
  21. package/dist/bugsnag/tool/performance/get-network-endpoint-groupings.js +1 -0
  22. package/dist/bugsnag/tool/performance/get-span-group.js +1 -0
  23. package/dist/bugsnag/tool/performance/get-trace.js +1 -0
  24. package/dist/bugsnag/tool/performance/list-span-groups.js +1 -0
  25. package/dist/bugsnag/tool/performance/list-spans.js +1 -0
  26. package/dist/bugsnag/tool/performance/list-trace-fields.js +1 -0
  27. package/dist/bugsnag/tool/performance/set-network-endpoint-groupings.js +1 -0
  28. package/dist/bugsnag/tool/project/get-current-project.js +1 -0
  29. package/dist/bugsnag/tool/project/list-project-event-filters.js +1 -0
  30. package/dist/bugsnag/tool/project/list-projects.js +1 -0
  31. package/dist/bugsnag/tool/release/get-build.js +1 -0
  32. package/dist/bugsnag/tool/release/get-release.js +1 -0
  33. package/dist/bugsnag/tool/release/list-releases.js +1 -0
  34. package/dist/collaborator/client.js +24 -19
  35. package/dist/common/client-registry.js +63 -29
  36. package/dist/common/server.js +57 -1
  37. package/dist/common/transport-http.js +90 -69
  38. package/dist/common/transport-stdio.js +29 -24
  39. package/dist/package.json.js +1 -1
  40. package/dist/pactflow/client/tools.js +102 -0
  41. package/dist/pactflow/client.js +30 -43
  42. package/dist/qmetry/client/tools/automation-tools.js +2 -0
  43. package/dist/qmetry/client/tools/issue-tools.js +6 -0
  44. package/dist/qmetry/client/tools/project-tools.js +9 -0
  45. package/dist/qmetry/client/tools/requirement-tools.js +5 -0
  46. package/dist/qmetry/client/tools/testcase-tools.js +7 -0
  47. package/dist/qmetry/client/tools/testsuite-tools.js +11 -0
  48. package/dist/qmetry/client.js +20 -18
  49. package/dist/qtm4j/client.js +42 -32
  50. package/dist/qtm4j/config/constants.js +101 -1
  51. package/dist/qtm4j/config/field-resolution.types.js +3 -1
  52. package/dist/qtm4j/http/api-client.js +20 -2
  53. package/dist/qtm4j/resolver/resolver-registry.js +7 -1
  54. package/dist/qtm4j/resolver/resolvers/requirement-id-resolver.js +28 -0
  55. package/dist/qtm4j/resolver/resolvers/test-cycle-uid-resolver.js +28 -0
  56. package/dist/qtm4j/schema/linked-items.schema.js +95 -0
  57. package/dist/qtm4j/schema/requirements.schema.js +109 -0
  58. package/dist/qtm4j/schema/test-cycle.link.schema.js +260 -0
  59. package/dist/qtm4j/tool/project/get-projects.js +2 -1
  60. package/dist/qtm4j/tool/project/set-project-context.js +2 -1
  61. package/dist/qtm4j/tool/requirement/get-linked-testcases.js +93 -0
  62. package/dist/qtm4j/tool/requirement/link-testcases.js +107 -0
  63. package/dist/qtm4j/tool/requirement/unlink-testcases.js +97 -0
  64. package/dist/qtm4j/tool/test-automation/get-automation-history.js +2 -1
  65. package/dist/qtm4j/tool/test-automation/upload-automation-result.js +2 -1
  66. package/dist/qtm4j/tool/test-case/create-test-case.js +2 -1
  67. package/dist/qtm4j/tool/test-case/get-linked-requirements.js +67 -0
  68. package/dist/qtm4j/tool/test-case/get-test-cases.js +2 -1
  69. package/dist/qtm4j/tool/test-case/get-test-steps.js +2 -1
  70. package/dist/qtm4j/tool/test-case/link-requirements.js +124 -0
  71. package/dist/qtm4j/tool/test-case/unlink-requirements.js +116 -0
  72. package/dist/qtm4j/tool/test-case/update-test-case.js +2 -1
  73. package/dist/qtm4j/tool/test-cycle/create-test-cycle.js +2 -1
  74. package/dist/qtm4j/tool/test-cycle/get-linked-requirements.js +71 -0
  75. package/dist/qtm4j/tool/test-cycle/link-requirements.js +91 -0
  76. package/dist/qtm4j/tool/test-cycle/link-testcases.js +118 -0
  77. package/dist/qtm4j/tool/test-cycle/search-linked-testcases.js +114 -0
  78. package/dist/qtm4j/tool/test-cycle/search-test-cycle.js +2 -1
  79. package/dist/qtm4j/tool/test-cycle/unlink-requirements.js +87 -0
  80. package/dist/qtm4j/tool/test-cycle/unlink-testcases.js +103 -0
  81. package/dist/qtm4j/tool/test-cycle/update-test-cycle.js +2 -1
  82. package/dist/reflect/client.js +15 -24
  83. package/dist/reflect/config/constants.js +0 -2
  84. package/dist/reflect/tool/recording/add-prompt-step.js +1 -0
  85. package/dist/reflect/tool/recording/add-segment.js +1 -0
  86. package/dist/reflect/tool/recording/connect-to-session.js +1 -0
  87. package/dist/reflect/tool/recording/delete-previous-step.js +1 -0
  88. package/dist/reflect/tool/recording/get-screenshot.js +1 -0
  89. package/dist/reflect/tool/suites/cancel-suite-execution.js +1 -0
  90. package/dist/reflect/tool/suites/execute-suite.js +1 -0
  91. package/dist/reflect/tool/suites/get-suite-execution-status.js +1 -0
  92. package/dist/reflect/tool/suites/list-suite-executions.js +1 -0
  93. package/dist/reflect/tool/suites/list-suites.js +1 -0
  94. package/dist/reflect/tool/tests/get-test-status.js +1 -0
  95. package/dist/reflect/tool/tests/list-segments.js +1 -0
  96. package/dist/reflect/tool/tests/list-tests.js +1 -0
  97. package/dist/reflect/tool/tests/run-test.js +1 -0
  98. package/dist/swagger/client/tools.js +23 -0
  99. package/dist/swagger/client.js +25 -28
  100. package/dist/zephyr/client.js +14 -21
  101. package/dist/zephyr/tool/environment/get-environments.js +1 -0
  102. package/dist/zephyr/tool/folder/create-folder.js +1 -0
  103. package/dist/zephyr/tool/issue-link/get-test-cases.js +1 -0
  104. package/dist/zephyr/tool/issue-link/get-test-cycles.js +1 -0
  105. package/dist/zephyr/tool/issue-link/get-test-executions.js +1 -0
  106. package/dist/zephyr/tool/priority/get-priorities.js +1 -0
  107. package/dist/zephyr/tool/project/get-project.js +1 -0
  108. package/dist/zephyr/tool/project/get-projects.js +1 -0
  109. package/dist/zephyr/tool/status/get-statuses.js +1 -0
  110. package/dist/zephyr/tool/test-case/create-issue-link.js +1 -0
  111. package/dist/zephyr/tool/test-case/create-test-case.js +1 -0
  112. package/dist/zephyr/tool/test-case/create-test-script.js +1 -0
  113. package/dist/zephyr/tool/test-case/create-test-steps.js +1 -0
  114. package/dist/zephyr/tool/test-case/create-web-link.js +1 -0
  115. package/dist/zephyr/tool/test-case/get-links.js +1 -0
  116. package/dist/zephyr/tool/test-case/get-test-case.js +1 -0
  117. package/dist/zephyr/tool/test-case/get-test-cases.js +1 -0
  118. package/dist/zephyr/tool/test-case/get-test-script.js +1 -0
  119. package/dist/zephyr/tool/test-case/get-test-steps.js +1 -0
  120. package/dist/zephyr/tool/test-case/update-test-case.js +1 -0
  121. package/dist/zephyr/tool/test-cycle/create-issue-link.js +1 -0
  122. package/dist/zephyr/tool/test-cycle/create-test-cycle.js +1 -0
  123. package/dist/zephyr/tool/test-cycle/create-web-link.js +1 -0
  124. package/dist/zephyr/tool/test-cycle/get-links.js +1 -0
  125. package/dist/zephyr/tool/test-cycle/get-test-cycle.js +1 -0
  126. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +1 -0
  127. package/dist/zephyr/tool/test-cycle/update-test-cycle.js +1 -0
  128. package/dist/zephyr/tool/test-execution/create-issue-link.js +1 -0
  129. package/dist/zephyr/tool/test-execution/create-test-execution.js +1 -0
  130. package/dist/zephyr/tool/test-execution/get-test-execution-links.js +1 -0
  131. package/dist/zephyr/tool/test-execution/get-test-execution.js +1 -0
  132. package/dist/zephyr/tool/test-execution/get-test-executions.js +1 -0
  133. package/dist/zephyr/tool/test-execution/get-test-steps.js +1 -0
  134. package/dist/zephyr/tool/test-execution/update-test-execution.js +1 -0
  135. package/dist/zephyr/tool/test-execution/update-test-steps.js +1 -0
  136. package/package.json +1 -1
  137. package/dist/common/request-context.js +0 -20
@@ -21,6 +21,33 @@ const ENDPOINTS = {
21
21
  SEARCH_TEST_CYCLES: `${API_CONFIG.API_VERSION}/testcycles/search`,
22
22
  /** Update test case endpoint */
23
23
  UPDATE_TEST_CASE: (id, versionNo) => `${API_CONFIG.API_VERSION}/testcases/${id}/versions/${versionNo}`,
24
+ RESOLVE_TEST_CYCLE_IDS: (projectId) => `${API_CONFIG.API_VERSION}/projects/${projectId}/mcp/testcycles/resolve-ids`,
25
+ /** Resolve requirement keys → internal Jira issue IDs for a given project */
26
+ RESOLVE_REQUIREMENT_IDS: (projectId) => `${API_CONFIG.API_VERSION}/projects/${projectId}/mcp/requirement/resolve-ids`,
27
+ /** Link requirements to test case endpoint */
28
+ LINK_REQUIREMENTS: (id, versionNo) => `${API_CONFIG.API_VERSION}/testcases/${id}/version/${versionNo}/requirements/link`,
29
+ /** Unlink requirements from test case endpoint */
30
+ UNLINK_REQUIREMENTS: (id, versionNo) => `${API_CONFIG.API_VERSION}/testcases/${id}/versions/${versionNo}/requirements/unlink`,
31
+ /** Link test cases to requirement endpoint */
32
+ LINK_TESTCASES_TO_REQUIREMENT: (requirementId) => `${API_CONFIG.API_VERSION}/requirements/${requirementId}/testcases/link`,
33
+ /** Unlink test cases from requirement endpoint */
34
+ UNLINK_TESTCASES_FROM_REQUIREMENT: (requirementId) => `${API_CONFIG.API_VERSION}/requirements/${requirementId}/testcases/unlink`,
35
+ /** Get linked requirements for a test case endpoint */
36
+ GET_LINKED_REQUIREMENTS: (id) => `${API_CONFIG.API_VERSION}/testcases/${id}/requirements`,
37
+ /** Get linked test cases for a requirement endpoint */
38
+ GET_LINKED_TESTCASES_FOR_REQUIREMENT: (requirementId) => `${API_CONFIG.API_VERSION}/requirements/${requirementId}/testcases`,
39
+ /** Link test cases to test cycle endpoint */
40
+ LINK_TESTCASES_TO_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/testcases`,
41
+ /** Unlink test cases from test cycle endpoint */
42
+ UNLINK_TESTCASES_FROM_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/testcases`,
43
+ /** Search test cases linked to a test cycle endpoint */
44
+ SEARCH_LINKED_TESTCASES_IN_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/testcases/search`,
45
+ /** Get linked requirements for a test cycle endpoint */
46
+ GET_LINKED_REQUIREMENTS_FOR_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/requirements`,
47
+ /** Link requirements to test cycle endpoint */
48
+ LINK_REQUIREMENTS_TO_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/requirements/link`,
49
+ /** Unlink requirements from test cycle endpoint */
50
+ UNLINK_REQUIREMENTS_FROM_CYCLE: (cycleId) => `${API_CONFIG.API_VERSION}/testcycles/${cycleId}/requirements/unlink`,
24
51
  /** Test steps search endpoint */
25
52
  TEST_STEPS: (id, versionNo) => `${API_CONFIG.API_VERSION}/testcases/${id}/versions/${versionNo}/teststeps/search`,
26
53
  /** Common attributes endpoint (priority, statuses) */
@@ -57,7 +84,8 @@ const CONTENT_TYPES = {
57
84
  const HTTP_METHODS = {
58
85
  GET: "GET",
59
86
  POST: "POST",
60
- PUT: "PUT"
87
+ PUT: "PUT",
88
+ DELETE: "DELETE"
61
89
  };
62
90
  const HTTP_STATUS = {
63
91
  /** No content status code */
@@ -160,8 +188,79 @@ const TOOL_NAMES = {
160
188
  UPDATE_TEST_CYCLE: {
161
189
  TITLE: "Update Test Cycle",
162
190
  SUMMARY: "Update an existing test cycle in QTM4J by its human-readable key (e.g. 'SCRUM-TR-101'). Supports auto-resolving human-readable names for status and priority. Labels and components support add/delete operations. Only the fields you provide are changed — omitted fields are left as-is. projectId is injected automatically from the active project context."
191
+ },
192
+ /** Link Requirements tool */
193
+ LINK_REQUIREMENTS: {
194
+ TITLE: "Link Requirements to Test Case",
195
+ SUMMARY: "Link one or more Jira requirements to a test case in QTM4J by requirement keys or JQL filter. Requirement keys are resolved to internal IDs automatically."
196
+ },
197
+ /** Unlink Requirements tool */
198
+ UNLINK_REQUIREMENTS: {
199
+ TITLE: "Unlink Requirements from Test Case",
200
+ SUMMARY: "Unlink one or more Jira requirements from a test case in QTM4J by requirement keys, or unlink all requirements at once with unLinkAll."
201
+ },
202
+ /** Link Test Cases to Requirement tool */
203
+ LINK_TESTCASES_TO_REQUIREMENT: {
204
+ TITLE: "Link Test Cases to Requirement",
205
+ SUMMARY: "Link test cases to a Jira requirement in QTM4J by test case keys or filter criteria. Test case keys are resolved to internal IDs automatically."
206
+ },
207
+ /** Unlink Test Cases from Requirement tool */
208
+ UNLINK_TESTCASES_FROM_REQUIREMENT: {
209
+ TITLE: "Unlink Test Cases from Requirement",
210
+ SUMMARY: "Unlink test cases from a Jira requirement in QTM4J by test case keys or filter criteria. Test case keys are resolved to internal IDs automatically."
211
+ },
212
+ /** Get Linked Requirements tool */
213
+ GET_LINKED_REQUIREMENTS: {
214
+ TITLE: "Get Linked Requirements",
215
+ SUMMARY: "Retrieve the Jira requirements linked to a specific test case in QTM4J. Test case key is resolved to internal ID automatically."
216
+ },
217
+ /** Get Linked Test Cases for Requirement tool */
218
+ GET_LINKED_TESTCASES_FOR_REQUIREMENT: {
219
+ TITLE: "Get Linked Test Cases for Requirement",
220
+ SUMMARY: "Retrieve the test cases linked to a Jira requirement in QTM4J. Requirement key is resolved to internal ID automatically."
221
+ },
222
+ /** Link Test Cases to Test Cycle tool */
223
+ LINK_TESTCASES_TO_CYCLE: {
224
+ TITLE: "Link Test Cases to Test Cycle",
225
+ SUMMARY: "Link test cases to a QTM4J test cycle by test case keys or filter criteria. Test case keys are resolved to internal IDs and latest versions automatically."
226
+ },
227
+ /** Unlink Test Cases from Test Cycle tool */
228
+ UNLINK_TESTCASES_FROM_CYCLE: {
229
+ TITLE: "Unlink Test Cases from Test Cycle",
230
+ SUMMARY: "Unlink test cases from a QTM4J test cycle by test case keys, filter criteria, or all at once with unlinkAll."
231
+ },
232
+ /** Search Linked Test Cases in Test Cycle tool */
233
+ SEARCH_LINKED_TESTCASES_IN_CYCLE: {
234
+ TITLE: "Search Linked Test Cases in Test Cycle",
235
+ SUMMARY: "Search and filter test case executions linked to a QTM4J test cycle. Supports pagination, field selection, sorting, and rich filter criteria."
236
+ },
237
+ /** Get Linked Requirements for Test Cycle tool */
238
+ GET_LINKED_REQUIREMENTS_FOR_CYCLE: {
239
+ TITLE: "Get Linked Requirements for Test Cycle",
240
+ SUMMARY: "Retrieve Jira requirements linked to a QTM4J test cycle. Test cycle key is resolved to internal UID automatically."
241
+ },
242
+ /** Link Requirements to Test Cycle tool */
243
+ LINK_REQUIREMENTS_TO_CYCLE: {
244
+ TITLE: "Link Requirements to Test Cycle",
245
+ SUMMARY: "Link one or more Jira requirements to a QTM4J test cycle by requirement keys or JQL filter. Requirement keys are resolved to internal IDs automatically."
246
+ },
247
+ /** Unlink Requirements from Test Cycle tool */
248
+ UNLINK_REQUIREMENTS_FROM_CYCLE: {
249
+ TITLE: "Unlink Requirements from Test Cycle",
250
+ SUMMARY: "Unlink one or more Jira requirements from a QTM4J test cycle by requirement keys, or unlink all requirements at once with unLinkAll."
163
251
  }
164
252
  };
253
+ const TOOLSETS = {
254
+ /** Test Automation toolset */
255
+ TEST_AUTOMATION: "Test Automation",
256
+ /** Test Cases toolset */
257
+ TEST_CASES: "Test Cases",
258
+ /** Test Cycle Management toolset */
259
+ TEST_CYCLES: "Test Cycles",
260
+ /** Projects toolset */
261
+ PROJECTS: "Projects",
262
+ REQUIREMENTS: "Requirements"
263
+ };
165
264
  const CONFIG_KEYS = {
166
265
  /** API key configuration key */
167
266
  API_KEY: "api_key",
@@ -257,5 +356,6 @@ export {
257
356
  RESPONSE_FIELDS,
258
357
  SCHEMA_DESCRIPTIONS,
259
358
  SORT_DEFAULTS,
359
+ TOOLSETS,
260
360
  TOOL_NAMES
261
361
  };
@@ -18,7 +18,9 @@ const ResolverKeys = {
18
18
  SearchableField: {
19
19
  LABEL: "label",
20
20
  COMPONENTS: "components",
21
- TEST_CASE_KEY_TO_UID: "testCaseKeyToUid"
21
+ TEST_CASE_KEY_TO_UID: "testCaseKeyToUid",
22
+ TEST_CYCLE_KEY_TO_UID: "testCycleKeyToUid",
23
+ REQUIREMENT_KEY_TO_ID: "requirementKeyToId"
22
24
  }
23
25
  };
24
26
  var InputField = /* @__PURE__ */ ((InputField2) => {
@@ -72,10 +72,11 @@ class ApiClient {
72
72
  * Perform POST request
73
73
  * @param endpoint - API endpoint path
74
74
  * @param body - Request body object
75
+ * @param params - Optional query parameters
75
76
  * @returns Parsed response data
76
77
  */
77
- async post(endpoint, body) {
78
- const response = await fetch(this.getUrl(endpoint), {
78
+ async post(endpoint, body, params) {
79
+ const response = await fetch(this.getUrl(endpoint, params), {
79
80
  method: HTTP_METHODS.POST,
80
81
  headers: {
81
82
  ...this.getHeaders(),
@@ -137,6 +138,23 @@ class ApiClient {
137
138
  });
138
139
  return await this.validateAndGetResponseBody(response);
139
140
  }
141
+ /**
142
+ * Perform DELETE request with optional body
143
+ * @param endpoint - API endpoint path
144
+ * @param body - Optional request body object
145
+ * @returns Parsed response data
146
+ */
147
+ async delete(endpoint, body) {
148
+ const response = await fetch(this.getUrl(endpoint), {
149
+ method: HTTP_METHODS.DELETE,
150
+ headers: {
151
+ ...this.getHeaders(),
152
+ [HTTP_HEADERS.CONTENT_TYPE]: CONTENT_TYPES.JSON
153
+ },
154
+ body: body !== void 0 ? JSON.stringify(body) : void 0
155
+ });
156
+ return await this.validateAndGetResponseBody(response);
157
+ }
140
158
  /**
141
159
  * Upload a file as multipart/form-data using the automation API key.
142
160
  * Content-Type is not set manually — fetch sets it with the correct multipart boundary.
@@ -1,7 +1,9 @@
1
1
  import { CommonAttributeResolver } from "./resolvers/common-attribute-resolver.js";
2
2
  import { ComponentResolver } from "./resolvers/component-resolver.js";
3
3
  import { LabelResolver } from "./resolvers/label-resolver.js";
4
+ import { RequirementIdResolver } from "./resolvers/requirement-id-resolver.js";
4
5
  import { TestCaseUidResolver } from "./resolvers/test-case-uid-resolver.js";
6
+ import { TestCycleUidResolver } from "./resolvers/test-cycle-uid-resolver.js";
5
7
  const ERROR_NO_PROJECT_CONTEXT = "No active project set. Please call set_project_context before performing this operation.";
6
8
  class ResolverRegistry {
7
9
  resolverByKey;
@@ -16,12 +18,16 @@ class ResolverRegistry {
16
18
  this.testCaseUidResolver = new TestCaseUidResolver(apiClient);
17
19
  const labelResolver = new LabelResolver(apiClient, cacheService);
18
20
  const componentResolver = new ComponentResolver(apiClient, cacheService);
21
+ const requirementIdResolver = new RequirementIdResolver(apiClient);
22
+ const testcycleUidResolver = new TestCycleUidResolver(apiClient);
19
23
  this.resolverByKey = /* @__PURE__ */ new Map();
20
24
  for (const resolver of [
21
25
  this.commonAttributes,
22
26
  labelResolver,
23
27
  componentResolver,
24
- this.testCaseUidResolver
28
+ this.testCaseUidResolver,
29
+ requirementIdResolver,
30
+ testcycleUidResolver
25
31
  ]) {
26
32
  for (const key of resolver.fieldKeys) {
27
33
  this.resolverByKey.set(key, resolver);
@@ -0,0 +1,28 @@
1
+ import { ENDPOINTS } from "../../config/constants.js";
2
+ import { ResolverKeys } from "../../config/field-resolution.types.js";
3
+ import { Resolver } from "./resolver.js";
4
+ class RequirementIdResolver extends Resolver {
5
+ fieldKeys = [
6
+ ResolverKeys.SearchableField.REQUIREMENT_KEY_TO_ID
7
+ ];
8
+ apiClient;
9
+ constructor(apiClient) {
10
+ super();
11
+ this.apiClient = apiClient;
12
+ }
13
+ async resolve(_inputField, _resolverKey, _body, _context, _warnings) {
14
+ }
15
+ async resolveAndReturn(projectId, keys) {
16
+ if (keys.length === 0) return {};
17
+ const response = await this.apiClient.get(
18
+ ENDPOINTS.RESOLVE_REQUIREMENT_IDS(projectId),
19
+ { keys: keys.join(",") }
20
+ );
21
+ return response;
22
+ }
23
+ clearCache(_projectKey) {
24
+ }
25
+ }
26
+ export {
27
+ RequirementIdResolver
28
+ };
@@ -0,0 +1,28 @@
1
+ import { ENDPOINTS } from "../../config/constants.js";
2
+ import { ResolverKeys } from "../../config/field-resolution.types.js";
3
+ import { Resolver } from "./resolver.js";
4
+ class TestCycleUidResolver extends Resolver {
5
+ fieldKeys = [
6
+ ResolverKeys.SearchableField.TEST_CYCLE_KEY_TO_UID
7
+ ];
8
+ apiClient;
9
+ constructor(apiClient) {
10
+ super();
11
+ this.apiClient = apiClient;
12
+ }
13
+ async resolve(_inputField, _resolverKey, _body, _context, _warnings) {
14
+ }
15
+ async resolveAndReturn(projectId, keys) {
16
+ if (keys.length === 0) return {};
17
+ const response = await this.apiClient.get(
18
+ ENDPOINTS.RESOLVE_TEST_CYCLE_IDS(projectId),
19
+ { keys: keys.join(",") }
20
+ );
21
+ return response;
22
+ }
23
+ clearCache(_projectKey) {
24
+ }
25
+ }
26
+ export {
27
+ TestCycleUidResolver
28
+ };
@@ -0,0 +1,95 @@
1
+ import zod__default from "zod";
2
+ import { SearchTestCaseResponse } from "./get-test-case.schema.js";
3
+ const GetLinkedRequirementsBody = zod__default.object({
4
+ key: zod__default.string().describe(
5
+ "Test case key in '{PROJECT_KEY}-TC-{number}' format (e.g., 'SCRUM-TC-145'). Required."
6
+ ),
7
+ versionNo: zod__default.number().int().optional().describe(
8
+ "Test case version number to retrieve linked requirements for. Defaults to the latest version."
9
+ ),
10
+ maxResults: zod__default.number().int().min(1).max(100).optional().describe("Maximum results per page (1-100). Default: 50."),
11
+ startAt: zod__default.number().int().min(0).optional().describe("Zero-indexed offset for pagination. Default: 0."),
12
+ sort: zod__default.string().optional().describe("Sort pattern in 'field:asc|desc' format. Default: 'key:desc'.")
13
+ });
14
+ const LinkedRequirementSchema = zod__default.object({
15
+ id: zod__default.number().int().describe("Jira issue ID."),
16
+ key: zod__default.string().describe("Jira issue key (e.g., 'SCRUM-1')."),
17
+ summary: zod__default.string().optional().describe("Requirement summary."),
18
+ status: zod__default.object({
19
+ id: zod__default.number().optional(),
20
+ name: zod__default.string().optional(),
21
+ iconUrl: zod__default.string().optional(),
22
+ color: zod__default.string().optional()
23
+ }).optional(),
24
+ priority: zod__default.object({
25
+ id: zod__default.number().optional(),
26
+ name: zod__default.string().optional(),
27
+ iconUrl: zod__default.string().optional()
28
+ }).optional(),
29
+ issueType: zod__default.object({
30
+ id: zod__default.number().optional(),
31
+ name: zod__default.string().optional(),
32
+ iconUrl: zod__default.string().optional()
33
+ }).optional(),
34
+ tcVersionNo: zod__default.number().int().optional().describe("Test case version this requirement is linked to.")
35
+ }).passthrough();
36
+ const GetLinkedRequirementsResponse = zod__default.object({
37
+ startAt: zod__default.number().int(),
38
+ maxResults: zod__default.number().int(),
39
+ total: zod__default.number().int().describe("Total linked requirements (across all pages)."),
40
+ data: zod__default.array(LinkedRequirementSchema).describe("Linked requirements on this page.")
41
+ });
42
+ const SprintFilter = zod__default.object({
43
+ boardName: zod__default.string(),
44
+ sprintName: zod__default.string()
45
+ });
46
+ const GetLinkedTestCasesFilter = zod__default.object({
47
+ key: zod__default.string().optional().describe("Test case key (e.g., 'SCRUM-TC-145')."),
48
+ summary: zod__default.string().optional(),
49
+ folderId: zod__default.number().int().optional().describe("Folder ID."),
50
+ description: zod__default.string().optional(),
51
+ assignee: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of assignees."),
52
+ reporter: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of reporters."),
53
+ createdBy: zod__default.array(zod__default.string()).optional(),
54
+ updatedBy: zod__default.array(zod__default.string()).optional(),
55
+ createdOn: zod__default.string().optional().describe("Date range 'dd/MMM/yyyy,dd/MMM/yyyy' for creation date."),
56
+ updatedOn: zod__default.string().optional().describe("Date range 'dd/MMM/yyyy,dd/MMM/yyyy' for last update date."),
57
+ labels: zod__default.array(zod__default.string()).optional().describe("Jira label names."),
58
+ components: zod__default.array(zod__default.string()).optional().describe("Jira component names."),
59
+ testCaseStatus: zod__default.string().optional().describe("Test case archive status: 'active', 'archived', or 'deleted'."),
60
+ latestExecutionResult: zod__default.array(zod__default.string()).optional().describe("Latest execution results (e.g., ['passed', 'failed'])."),
61
+ fixVersions: zod__default.array(zod__default.string()).optional().describe("Fix version names."),
62
+ sprint: zod__default.array(SprintFilter).optional(),
63
+ status: zod__default.array(zod__default.string()).optional().describe("Test case status names."),
64
+ priority: zod__default.array(zod__default.string()).optional().describe("Priority names (e.g., ['High', 'Low'])."),
65
+ estimatedTime: zod__default.string().optional(),
66
+ requirementIds: zod__default.array(zod__default.number().int()).optional().describe("Requirement IDs."),
67
+ searchText: zod__default.string().optional().describe("Free-text search."),
68
+ searchInFields: zod__default.array(zod__default.string()).optional().describe("Fields to search in (e.g., ['summary', 'description'])."),
69
+ filterId: zod__default.number().int().optional().describe("Saved filter ID."),
70
+ isAutomated: zod__default.boolean().optional(),
71
+ aiGenerated: zod__default.boolean().optional()
72
+ });
73
+ const GetLinkedTestCasesForRequirementBody = zod__default.object({
74
+ requirementKey: zod__default.string().describe(
75
+ "Jira requirement key (e.g., 'SCRUM-1'). Resolved to the internal Jira issue ID automatically."
76
+ ),
77
+ filter: GetLinkedTestCasesFilter.optional().describe(
78
+ "Optional filter to narrow down the linked test cases. projectId is auto-filled from the active project context."
79
+ ),
80
+ fields: zod__default.string().optional().describe(
81
+ "Comma-separated field names to include in each result. Allowed: summary, priority, status, estimatedTime, executed, description, assignee, reporter, labels, components, fixVersions, sprint, isAutomated, folder, updated, created, seqNo, flakyScore, passRateScore."
82
+ ),
83
+ maxResults: zod__default.number().int().min(1).max(100).optional().describe("Maximum results per page (1-100). Default: 50."),
84
+ startAt: zod__default.number().int().min(0).optional().describe("Zero-indexed offset for pagination. Default: 0."),
85
+ sort: zod__default.string().optional().describe(
86
+ "Sort in 'field:asc|desc' format. Allowed fields: key, summary, created, updated, estimatedTime, status, priority, latestVersionNo, seqNo, flakyScore, passRateScore."
87
+ )
88
+ });
89
+ export {
90
+ GetLinkedRequirementsBody,
91
+ GetLinkedRequirementsResponse,
92
+ GetLinkedTestCasesFilter,
93
+ GetLinkedTestCasesForRequirementBody,
94
+ SearchTestCaseResponse as GetLinkedTestCasesResponse
95
+ };
@@ -0,0 +1,109 @@
1
+ import zod__default from "zod";
2
+ zod__default.object({
3
+ id: zod__default.string(),
4
+ versionNo: zod__default.number().int()
5
+ });
6
+ const SprintFilter = zod__default.object({
7
+ boardName: zod__default.string(),
8
+ sprintName: zod__default.string()
9
+ });
10
+ const LinkTestCaseFilter = zod__default.object({
11
+ key: zod__default.string().optional().describe("Test case key (e.g., 'SCRUM-TC-145')."),
12
+ summary: zod__default.string().optional().describe("Test case summary to filter by."),
13
+ folderId: zod__default.number().int().optional().describe("Folder ID to filter by."),
14
+ description: zod__default.string().optional().describe("Test case description to filter by."),
15
+ assignee: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of assignees."),
16
+ reporter: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of reporters."),
17
+ createdBy: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of creators."),
18
+ updatedBy: zod__default.array(zod__default.string()).optional().describe("Jira account IDs of last updaters."),
19
+ createdOn: zod__default.string().optional().describe(
20
+ "Creation date range as comma-separated start,end in dd/MMM/yyyy format (e.g., '01/Jan/2024,31/Jan/2024')."
21
+ ),
22
+ updatedOn: zod__default.string().optional().describe(
23
+ "Update date range as comma-separated start,end in dd/MMM/yyyy format."
24
+ ),
25
+ labels: zod__default.array(zod__default.string()).optional().describe("Jira label names."),
26
+ components: zod__default.array(zod__default.string()).optional().describe("Jira component names."),
27
+ latestExecutionResult: zod__default.array(zod__default.string()).optional().describe(
28
+ "Latest execution results to filter by (e.g., ['passed', 'failed'])."
29
+ ),
30
+ fixVersions: zod__default.array(zod__default.string()).optional().describe("Jira fix version names."),
31
+ sprint: zod__default.array(SprintFilter).optional().describe(
32
+ "Sprint filters with boardName and sprintName (e.g., [{boardName:'board1', sprintName:'sprint1'}])."
33
+ ),
34
+ status: zod__default.array(zod__default.string()).optional().describe("Test case status names (e.g., ['To Do', 'In Progress'])."),
35
+ priority: zod__default.array(zod__default.string()).optional().describe("Priority names (e.g., ['High', 'Low'])."),
36
+ estimatedTime: zod__default.string().optional().describe("Estimated time filter in HH:MM:SS format."),
37
+ requirementIds: zod__default.array(zod__default.number().int()).optional().describe("Jira issue IDs of linked requirements."),
38
+ excludeRequirementId: zod__default.number().int().optional().describe("Exclude test cases already linked to this requirement ID."),
39
+ searchText: zod__default.string().optional().describe("Free-text search across test case fields."),
40
+ searchInFields: zod__default.array(zod__default.string()).optional().describe("Fields to search in (e.g., ['summary', 'description'])."),
41
+ filterId: zod__default.number().int().optional().describe("Saved filter ID."),
42
+ isAutomated: zod__default.boolean().optional().describe("Filter automated test cases."),
43
+ withChild: zod__default.boolean().optional().describe("Include test cases in child folders."),
44
+ aiGenerated: zod__default.boolean().optional().describe("Filter AI-generated test cases."),
45
+ excludeUids: zod__default.array(zod__default.string()).optional().describe("Test case UIDs to exclude from the filter result.")
46
+ });
47
+ const UnlinkTestCaseFilter = zod__default.object({
48
+ key: zod__default.string().optional().describe("Test case key."),
49
+ summary: zod__default.string().optional(),
50
+ folderId: zod__default.number().int().optional(),
51
+ description: zod__default.string().optional(),
52
+ assignee: zod__default.array(zod__default.string()).optional(),
53
+ reporter: zod__default.array(zod__default.string()).optional(),
54
+ createdBy: zod__default.array(zod__default.string()).optional(),
55
+ updatedBy: zod__default.array(zod__default.string()).optional(),
56
+ createdOn: zod__default.string().optional(),
57
+ updatedOn: zod__default.string().optional(),
58
+ labels: zod__default.array(zod__default.string()).optional(),
59
+ components: zod__default.array(zod__default.string()).optional(),
60
+ latestExecutionResult: zod__default.array(zod__default.string()).optional(),
61
+ fixVersions: zod__default.array(zod__default.string()).optional(),
62
+ sprint: zod__default.array(SprintFilter).optional(),
63
+ status: zod__default.array(zod__default.string()).optional(),
64
+ priority: zod__default.array(zod__default.string()).optional(),
65
+ estimatedTime: zod__default.string().optional(),
66
+ requirementIds: zod__default.array(zod__default.number().int()).optional(),
67
+ searchText: zod__default.string().optional(),
68
+ searchInFields: zod__default.array(zod__default.string()).optional(),
69
+ filterId: zod__default.number().int().optional(),
70
+ isAutomated: zod__default.boolean().optional(),
71
+ excludeTestCases: zod__default.array(zod__default.object({ id: zod__default.string(), versionNo: zod__default.number().int() })).optional().describe("Test cases to exclude from the filter result.")
72
+ });
73
+ const LinkTestCasesToRequirementBody = zod__default.object({
74
+ requirementKey: zod__default.string().describe(
75
+ "Jira requirement key (e.g., 'SCRUM-1'). Resolved to the internal Jira issue ID automatically."
76
+ ),
77
+ testCaseKeys: zod__default.array(zod__default.string()).optional().describe(
78
+ "Test case keys to link (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both."
79
+ ),
80
+ filter: LinkTestCaseFilter.optional().describe(
81
+ "Filter criteria to select test cases to link. Use instead of testCaseKeys when selecting by criteria. projectId is auto-filled from the active project context."
82
+ ),
83
+ sort: zod__default.string().optional().describe(
84
+ "Sort order for filter results in 'field:asc|desc' format (e.g., 'key:asc'). Allowable fields: key, summary, created, updated, estimatedTime, status, priority, latestVersionNo, flakyScore, passRateScore."
85
+ )
86
+ });
87
+ const UnlinkTestCasesFromRequirementBody = zod__default.object({
88
+ requirementKey: zod__default.string().describe(
89
+ "Jira requirement key (e.g., 'SCRUM-1'). Resolved to the internal Jira issue ID automatically."
90
+ ),
91
+ testCaseKeys: zod__default.array(zod__default.string()).optional().describe(
92
+ "Test case keys to unlink (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both."
93
+ ),
94
+ filter: UnlinkTestCaseFilter.optional().describe(
95
+ "Filter criteria to select test cases to unlink. Use instead of testCaseKeys when selecting by criteria. projectId is auto-filled from the active project context."
96
+ )
97
+ });
98
+ const RequirementTestCaseLinkResponse = zod__default.object({
99
+ requirementKey: zod__default.string(),
100
+ linked: zod__default.literal(true).optional(),
101
+ unlinked: zod__default.literal(true).optional()
102
+ });
103
+ export {
104
+ LinkTestCaseFilter,
105
+ LinkTestCasesToRequirementBody,
106
+ RequirementTestCaseLinkResponse,
107
+ UnlinkTestCaseFilter,
108
+ UnlinkTestCasesFromRequirementBody
109
+ };