@qase/mcp-server 1.0.0-beta.1

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 (107) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +450 -0
  3. package/build/client/index.d.ts +23 -0
  4. package/build/client/index.d.ts.map +1 -0
  5. package/build/client/index.js +55 -0
  6. package/build/client/index.js.map +1 -0
  7. package/build/index.d.ts +32 -0
  8. package/build/index.d.ts.map +1 -0
  9. package/build/index.js +125 -0
  10. package/build/index.js.map +1 -0
  11. package/build/operations/attachments.d.ts +8 -0
  12. package/build/operations/attachments.d.ts.map +1 -0
  13. package/build/operations/attachments.js +123 -0
  14. package/build/operations/attachments.js.map +1 -0
  15. package/build/operations/authors.d.ts +8 -0
  16. package/build/operations/authors.d.ts.map +1 -0
  17. package/build/operations/authors.js +68 -0
  18. package/build/operations/authors.js.map +1 -0
  19. package/build/operations/cases.d.ts +8 -0
  20. package/build/operations/cases.d.ts.map +1 -0
  21. package/build/operations/cases.js +278 -0
  22. package/build/operations/cases.js.map +1 -0
  23. package/build/operations/configurations.d.ts +8 -0
  24. package/build/operations/configurations.d.ts.map +1 -0
  25. package/build/operations/configurations.js +102 -0
  26. package/build/operations/configurations.js.map +1 -0
  27. package/build/operations/custom-fields.d.ts +8 -0
  28. package/build/operations/custom-fields.d.ts.map +1 -0
  29. package/build/operations/custom-fields.js +167 -0
  30. package/build/operations/custom-fields.js.map +1 -0
  31. package/build/operations/defects.d.ts +8 -0
  32. package/build/operations/defects.d.ts.map +1 -0
  33. package/build/operations/defects.js +219 -0
  34. package/build/operations/defects.js.map +1 -0
  35. package/build/operations/environments.d.ts +8 -0
  36. package/build/operations/environments.d.ts.map +1 -0
  37. package/build/operations/environments.js +149 -0
  38. package/build/operations/environments.js.map +1 -0
  39. package/build/operations/milestones.d.ts +8 -0
  40. package/build/operations/milestones.d.ts.map +1 -0
  41. package/build/operations/milestones.js +150 -0
  42. package/build/operations/milestones.js.map +1 -0
  43. package/build/operations/plans.d.ts +8 -0
  44. package/build/operations/plans.d.ts.map +1 -0
  45. package/build/operations/plans.js +153 -0
  46. package/build/operations/plans.js.map +1 -0
  47. package/build/operations/projects.d.ts +8 -0
  48. package/build/operations/projects.d.ts.map +1 -0
  49. package/build/operations/projects.js +186 -0
  50. package/build/operations/projects.js.map +1 -0
  51. package/build/operations/results.d.ts +8 -0
  52. package/build/operations/results.d.ts.map +1 -0
  53. package/build/operations/results.js +208 -0
  54. package/build/operations/results.js.map +1 -0
  55. package/build/operations/runs.d.ts +8 -0
  56. package/build/operations/runs.d.ts.map +1 -0
  57. package/build/operations/runs.js +211 -0
  58. package/build/operations/runs.js.map +1 -0
  59. package/build/operations/search.d.ts +8 -0
  60. package/build/operations/search.d.ts.map +1 -0
  61. package/build/operations/search.js +138 -0
  62. package/build/operations/search.js.map +1 -0
  63. package/build/operations/shared-parameters.d.ts +8 -0
  64. package/build/operations/shared-parameters.d.ts.map +1 -0
  65. package/build/operations/shared-parameters.js +139 -0
  66. package/build/operations/shared-parameters.js.map +1 -0
  67. package/build/operations/shared-steps.d.ts +8 -0
  68. package/build/operations/shared-steps.d.ts.map +1 -0
  69. package/build/operations/shared-steps.js +155 -0
  70. package/build/operations/shared-steps.js.map +1 -0
  71. package/build/operations/suites.d.ts +8 -0
  72. package/build/operations/suites.d.ts.map +1 -0
  73. package/build/operations/suites.js +164 -0
  74. package/build/operations/suites.js.map +1 -0
  75. package/build/operations/system-fields.d.ts +8 -0
  76. package/build/operations/system-fields.d.ts.map +1 -0
  77. package/build/operations/system-fields.js +40 -0
  78. package/build/operations/system-fields.js.map +1 -0
  79. package/build/operations/users.d.ts +8 -0
  80. package/build/operations/users.d.ts.map +1 -0
  81. package/build/operations/users.js +68 -0
  82. package/build/operations/users.js.map +1 -0
  83. package/build/types/index.d.ts +49 -0
  84. package/build/types/index.d.ts.map +1 -0
  85. package/build/types/index.js +13 -0
  86. package/build/types/index.js.map +1 -0
  87. package/build/utils/errors.d.ts +73 -0
  88. package/build/utils/errors.d.ts.map +1 -0
  89. package/build/utils/errors.js +136 -0
  90. package/build/utils/errors.js.map +1 -0
  91. package/build/utils/qql-helpers.d.ts +59 -0
  92. package/build/utils/qql-helpers.d.ts.map +1 -0
  93. package/build/utils/qql-helpers.js +85 -0
  94. package/build/utils/qql-helpers.js.map +1 -0
  95. package/build/utils/registry.d.ts +97 -0
  96. package/build/utils/registry.d.ts.map +1 -0
  97. package/build/utils/registry.js +132 -0
  98. package/build/utils/registry.js.map +1 -0
  99. package/build/utils/test-helpers.d.ts +32 -0
  100. package/build/utils/test-helpers.d.ts.map +1 -0
  101. package/build/utils/test-helpers.js +81 -0
  102. package/build/utils/test-helpers.js.map +1 -0
  103. package/build/utils/validation.d.ts +107 -0
  104. package/build/utils/validation.d.ts.map +1 -0
  105. package/build/utils/validation.js +104 -0
  106. package/build/utils/validation.js.map +1 -0
  107. package/package.json +84 -0
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Test Plans Operations
3
+ *
4
+ * Implements all MCP tools for managing test plans in Qase.
5
+ * Test plans define collections of test cases to be executed.
6
+ */
7
+ import { z } from 'zod';
8
+ import { getApiClient } from '../client/index.js';
9
+ import { toolRegistry } from '../utils/registry.js';
10
+ import { toResultAsync } from '../utils/errors.js';
11
+ import { ProjectCodeSchema, IdSchema } from '../utils/validation.js';
12
+ // ============================================================================
13
+ // SCHEMAS
14
+ // ============================================================================
15
+ /**
16
+ * Schema for listing test plans
17
+ */
18
+ const ListPlansSchema = z.object({
19
+ code: ProjectCodeSchema,
20
+ limit: z.number().int().positive().max(100).optional().describe('Maximum number of items'),
21
+ offset: z.number().int().nonnegative().optional().describe('Number of items to skip'),
22
+ });
23
+ /**
24
+ * Schema for getting a specific test plan
25
+ */
26
+ const GetPlanSchema = z.object({
27
+ code: ProjectCodeSchema,
28
+ id: IdSchema,
29
+ });
30
+ /**
31
+ * Schema for creating a test plan
32
+ */
33
+ const CreatePlanSchema = z.object({
34
+ code: ProjectCodeSchema,
35
+ title: z.string().min(1).max(255).describe('Test plan title'),
36
+ description: z.string().optional().describe('Test plan description'),
37
+ cases: z
38
+ .array(z.number().int().positive())
39
+ .optional()
40
+ .describe('Array of test case IDs to include in the plan'),
41
+ });
42
+ /**
43
+ * Schema for updating a test plan
44
+ */
45
+ const UpdatePlanSchema = z.object({
46
+ code: ProjectCodeSchema,
47
+ id: IdSchema,
48
+ title: z.string().min(1).max(255).optional().describe('Test plan title'),
49
+ description: z.string().optional().describe('Test plan description'),
50
+ cases: z
51
+ .array(z.number().int().positive())
52
+ .optional()
53
+ .describe('Array of test case IDs to include in the plan'),
54
+ });
55
+ /**
56
+ * Schema for deleting a test plan
57
+ */
58
+ const DeletePlanSchema = z.object({
59
+ code: ProjectCodeSchema,
60
+ id: IdSchema,
61
+ });
62
+ // ============================================================================
63
+ // HANDLERS
64
+ // ============================================================================
65
+ /**
66
+ * List all test plans in a project
67
+ */
68
+ async function listPlans(args) {
69
+ const client = getApiClient();
70
+ const { code, limit, offset } = args;
71
+ const result = await toResultAsync(client.plans.getPlans(code, limit, offset));
72
+ return result.match((response) => response.data.result, (error) => {
73
+ throw new Error(error);
74
+ });
75
+ }
76
+ /**
77
+ * Get a specific test plan
78
+ */
79
+ async function getPlan(args) {
80
+ const client = getApiClient();
81
+ const { code, id } = args;
82
+ const result = await toResultAsync(client.plans.getPlan(code, id));
83
+ return result.match((response) => response.data.result, (error) => {
84
+ throw new Error(error);
85
+ });
86
+ }
87
+ /**
88
+ * Create a new test plan
89
+ */
90
+ async function createPlan(args) {
91
+ const client = getApiClient();
92
+ const { code, ...planData } = args;
93
+ const result = await toResultAsync(client.plans.createPlan(code, planData));
94
+ return result.match((response) => response.data.result, (error) => {
95
+ throw new Error(error);
96
+ });
97
+ }
98
+ /**
99
+ * Update an existing test plan
100
+ */
101
+ async function updatePlan(args) {
102
+ const client = getApiClient();
103
+ const { code, id, ...updateData } = args;
104
+ const result = await toResultAsync(client.plans.updatePlan(code, id, updateData));
105
+ return result.match((response) => response.data.result, (error) => {
106
+ throw new Error(error);
107
+ });
108
+ }
109
+ /**
110
+ * Delete a test plan
111
+ */
112
+ async function deletePlan(args) {
113
+ const client = getApiClient();
114
+ const { code, id } = args;
115
+ const result = await toResultAsync(client.plans.deletePlan(code, id));
116
+ return result.match((_response) => ({ success: true, id }), (error) => {
117
+ throw new Error(error);
118
+ });
119
+ }
120
+ // ============================================================================
121
+ // TOOL REGISTRATION
122
+ // ============================================================================
123
+ toolRegistry.register({
124
+ name: 'list_plans',
125
+ description: 'Get all test plans in a project with optional pagination',
126
+ schema: ListPlansSchema,
127
+ handler: listPlans,
128
+ });
129
+ toolRegistry.register({
130
+ name: 'get_plan',
131
+ description: 'Get a specific test plan by project code and plan ID',
132
+ schema: GetPlanSchema,
133
+ handler: getPlan,
134
+ });
135
+ toolRegistry.register({
136
+ name: 'create_plan',
137
+ description: 'Create a new test plan with selected test cases',
138
+ schema: CreatePlanSchema,
139
+ handler: createPlan,
140
+ });
141
+ toolRegistry.register({
142
+ name: 'update_plan',
143
+ description: 'Update an existing test plan',
144
+ schema: UpdatePlanSchema,
145
+ handler: updatePlan,
146
+ });
147
+ toolRegistry.register({
148
+ name: 'delete_plan',
149
+ description: 'Delete a test plan from a project',
150
+ schema: DeletePlanSchema,
151
+ handler: deletePlan,
152
+ });
153
+ //# sourceMappingURL=plans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/operations/plans.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAErE,+EA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AAQ,CAAC;IACpB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Projects Operations
3
+ *
4
+ * Implements all MCP tools for managing Qase projects.
5
+ * Projects are top-level containers for test management.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Projects Operations
3
+ *
4
+ * Implements all MCP tools for managing Qase projects.
5
+ * Projects are top-level containers for test management.
6
+ */
7
+ import { z } from 'zod';
8
+ import { ProjectCreateAccessEnum } from 'qaseio';
9
+ import { getApiClient } from '../client/index.js';
10
+ import { toolRegistry } from '../utils/registry.js';
11
+ import { toResultAsync } from '../utils/errors.js';
12
+ import { PaginationSchema, ProjectCodeSchema } from '../utils/validation.js';
13
+ // ============================================================================
14
+ // SCHEMAS
15
+ // ============================================================================
16
+ /**
17
+ * Schema for listing projects
18
+ */
19
+ const ListProjectsSchema = PaginationSchema;
20
+ /**
21
+ * Schema for getting a specific project
22
+ */
23
+ const GetProjectSchema = z.object({
24
+ code: ProjectCodeSchema,
25
+ });
26
+ /**
27
+ * Schema for creating a project
28
+ */
29
+ const CreateProjectSchema = z.object({
30
+ title: z.string().min(1).max(255).describe('Project title'),
31
+ code: ProjectCodeSchema,
32
+ description: z.string().optional().describe('Project description'),
33
+ access: z
34
+ .enum(['none', 'group', 'all'])
35
+ .optional()
36
+ .describe('Project access level: none (private), group, or all (public)'),
37
+ group: z.string().optional().describe('Group hash for group access level'),
38
+ });
39
+ /**
40
+ * Schema for deleting a project
41
+ */
42
+ const DeleteProjectSchema = z.object({
43
+ code: ProjectCodeSchema,
44
+ });
45
+ /**
46
+ * Schema for granting project access
47
+ */
48
+ const GrantProjectAccessSchema = z.object({
49
+ code: ProjectCodeSchema,
50
+ member_id: z.number().int().positive().describe('User or group ID'),
51
+ member_type: z.enum(['user', 'group']).describe('Type of member: user or group'),
52
+ });
53
+ /**
54
+ * Schema for revoking project access
55
+ */
56
+ const RevokeProjectAccessSchema = z.object({
57
+ code: ProjectCodeSchema,
58
+ member_id: z.number().int().positive().describe('User or group ID'),
59
+ member_type: z.enum(['user', 'group']).describe('Type of member: user or group'),
60
+ });
61
+ // ============================================================================
62
+ // HANDLERS
63
+ // ============================================================================
64
+ /**
65
+ * List all projects with pagination
66
+ */
67
+ async function listProjects(args) {
68
+ const client = getApiClient();
69
+ const { limit, offset } = args;
70
+ const result = await toResultAsync(client.projects.getProjects(limit, offset));
71
+ return result.match((response) => response.data.result, (error) => {
72
+ throw new Error(error);
73
+ });
74
+ }
75
+ /**
76
+ * Get a specific project by code
77
+ */
78
+ async function getProject(args) {
79
+ const client = getApiClient();
80
+ const { code } = args;
81
+ const result = await toResultAsync(client.projects.getProject(code));
82
+ return result.match((response) => response.data.result, (error) => {
83
+ throw new Error(error);
84
+ });
85
+ }
86
+ /**
87
+ * Create a new project
88
+ */
89
+ async function createProject(args) {
90
+ const client = getApiClient();
91
+ // Map string access level to enum
92
+ let accessEnum;
93
+ if (args.access === 'none')
94
+ accessEnum = ProjectCreateAccessEnum.NONE;
95
+ else if (args.access === 'group')
96
+ accessEnum = ProjectCreateAccessEnum.GROUP;
97
+ else if (args.access === 'all')
98
+ accessEnum = ProjectCreateAccessEnum.ALL;
99
+ const result = await toResultAsync(client.projects.createProject({
100
+ title: args.title,
101
+ code: args.code,
102
+ description: args.description,
103
+ access: accessEnum,
104
+ group: args.group,
105
+ }));
106
+ return result.match((response) => response.data.result, (error) => {
107
+ throw new Error(error);
108
+ });
109
+ }
110
+ /**
111
+ * Delete a project
112
+ */
113
+ async function deleteProject(args) {
114
+ const client = getApiClient();
115
+ const { code } = args;
116
+ const result = await toResultAsync(client.projects.deleteProject(code));
117
+ return result.match((_response) => ({ success: true, code }), (error) => {
118
+ throw new Error(error);
119
+ });
120
+ }
121
+ /**
122
+ * Grant access to a project
123
+ */
124
+ async function grantProjectAccess(args) {
125
+ const client = getApiClient();
126
+ const { code, member_id, member_type } = args;
127
+ const result = await toResultAsync(client.projects.grantAccessToProject(code, {
128
+ member_id,
129
+ }));
130
+ return result.match((_response) => ({ success: true, code, member_id, member_type }), (error) => {
131
+ throw new Error(error);
132
+ });
133
+ }
134
+ /**
135
+ * Revoke access to a project
136
+ */
137
+ async function revokeProjectAccess(args) {
138
+ const client = getApiClient();
139
+ const { code, member_id, member_type } = args;
140
+ const result = await toResultAsync(client.projects.revokeAccessToProject(code, {
141
+ member_id,
142
+ }));
143
+ return result.match((_response) => ({ success: true, code, member_id, member_type }), (error) => {
144
+ throw new Error(error);
145
+ });
146
+ }
147
+ // ============================================================================
148
+ // TOOL REGISTRATION
149
+ // ============================================================================
150
+ toolRegistry.register({
151
+ name: 'list_projects',
152
+ description: 'Get all projects with optional pagination',
153
+ schema: ListProjectsSchema,
154
+ handler: listProjects,
155
+ });
156
+ toolRegistry.register({
157
+ name: 'get_project',
158
+ description: 'Get a specific project by project code',
159
+ schema: GetProjectSchema,
160
+ handler: getProject,
161
+ });
162
+ toolRegistry.register({
163
+ name: 'create_project',
164
+ description: 'Create a new project in Qase',
165
+ schema: CreateProjectSchema,
166
+ handler: createProject,
167
+ });
168
+ toolRegistry.register({
169
+ name: 'delete_project',
170
+ description: 'Delete a project by project code',
171
+ schema: DeleteProjectSchema,
172
+ handler: deleteProject,
173
+ });
174
+ toolRegistry.register({
175
+ name: 'grant_project_access',
176
+ description: 'Grant access to a project for a user or group',
177
+ schema: GrantProjectAccessSchema,
178
+ handler: grantProjectAccess,
179
+ });
180
+ toolRegistry.register({
181
+ name: 'revoke_project_access',
182
+ description: 'Revoke access to a project from a user or group',
183
+ schema: RevokeProjectAccessSchema,
184
+ handler: revokeProjectAccess,
185
+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AAW,EAAE,+CAA+C;IAC5D,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,kBAAkB;CAC5B,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,mBAAmB;CAC7B,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Test Results Operations
3
+ *
4
+ * Implements all MCP tools for managing test results in Qase.
5
+ * Test results represent individual test case execution outcomes within runs.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/operations/results.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Test Results Operations
3
+ *
4
+ * Implements all MCP tools for managing test results in Qase.
5
+ * Test results represent individual test case execution outcomes within runs.
6
+ */
7
+ import { z } from 'zod';
8
+ import { getApiClient } from '../client/index.js';
9
+ import { toolRegistry } from '../utils/registry.js';
10
+ import { toResultAsync } from '../utils/errors.js';
11
+ import { ProjectCodeSchema, IdSchema, HashSchema } from '../utils/validation.js';
12
+ // ============================================================================
13
+ // SCHEMAS
14
+ // ============================================================================
15
+ /**
16
+ * Schema for result step
17
+ */
18
+ const ResultStepSchema = z.object({
19
+ position: z.number().int().nonnegative().describe('Step position/order'),
20
+ status: z.enum(['passed', 'failed', 'blocked', 'skipped']).describe('Step execution status'),
21
+ comment: z.string().optional().describe('Comment about the step execution'),
22
+ attachments: z.array(z.string()).optional().describe('Array of attachment hashes for this step'),
23
+ });
24
+ /**
25
+ * Schema for listing test results
26
+ */
27
+ const ListResultsSchema = z.object({
28
+ code: ProjectCodeSchema,
29
+ status: z.string().optional().describe('Filter by status'),
30
+ run: z.string().optional().describe('Filter by run ID'),
31
+ case_id: z.string().optional().describe('Filter by case ID'),
32
+ member: z.string().optional().describe('Filter by member'),
33
+ api: z.boolean().optional().describe('Filter by API results'),
34
+ from_end_time: z.string().optional().describe('Filter results ending after this time'),
35
+ to_end_time: z.string().optional().describe('Filter results ending before this time'),
36
+ limit: z.number().int().positive().max(100).optional().describe('Maximum number of items'),
37
+ offset: z.number().int().nonnegative().optional().describe('Number of items to skip'),
38
+ });
39
+ /**
40
+ * Schema for getting a specific test result by hash
41
+ */
42
+ const GetResultSchema = z.object({
43
+ code: ProjectCodeSchema,
44
+ hash: HashSchema.describe('Result hash identifier'),
45
+ });
46
+ /**
47
+ * Schema for creating a test result
48
+ */
49
+ const CreateResultSchema = z.object({
50
+ code: ProjectCodeSchema,
51
+ id: IdSchema.describe('Run ID to add the result to'),
52
+ case_id: z.number().int().positive().optional().describe('Test case ID'),
53
+ status: z.enum(['passed', 'failed', 'blocked', 'skipped', 'invalid']).describe('Result status'),
54
+ time_ms: z.number().int().nonnegative().optional().describe('Execution time in milliseconds'),
55
+ defect: z.boolean().optional().describe('Mark as defect'),
56
+ attachments: z.array(z.string()).optional().describe('Array of attachment hashes'),
57
+ stacktrace: z.string().optional().describe('Stack trace for failures'),
58
+ comment: z.string().optional().describe('Comment about the result'),
59
+ steps: z.array(ResultStepSchema).optional().describe('Execution steps with results'),
60
+ custom_field: z.record(z.any()).optional().describe('Custom field values'),
61
+ });
62
+ /**
63
+ * Schema for bulk creating test results
64
+ */
65
+ const CreateResultsBulkSchema = z.object({
66
+ code: ProjectCodeSchema,
67
+ id: IdSchema.describe('Run ID to add the results to'),
68
+ results: z
69
+ .array(CreateResultSchema.omit({ code: true, id: true }))
70
+ .describe('Array of results to create'),
71
+ });
72
+ /**
73
+ * Schema for updating a test result
74
+ */
75
+ const UpdateResultSchema = z.object({
76
+ code: ProjectCodeSchema,
77
+ id: IdSchema.describe('Run ID'),
78
+ hash: HashSchema.describe('Result hash identifier'),
79
+ case_id: z.number().int().positive().optional().describe('Test case ID'),
80
+ status: z
81
+ .enum(['passed', 'failed', 'blocked', 'skipped', 'invalid'])
82
+ .optional()
83
+ .describe('Result status'),
84
+ time_ms: z.number().int().nonnegative().optional().describe('Execution time in milliseconds'),
85
+ defect: z.boolean().optional().describe('Mark as defect'),
86
+ attachments: z.array(z.string()).optional().describe('Array of attachment hashes'),
87
+ stacktrace: z.string().optional().describe('Stack trace for failures'),
88
+ comment: z.string().optional().describe('Comment about the result'),
89
+ steps: z.array(ResultStepSchema).optional().describe('Execution steps with results'),
90
+ custom_field: z.record(z.any()).optional().describe('Custom field values'),
91
+ });
92
+ /**
93
+ * Schema for deleting a test result
94
+ */
95
+ const DeleteResultSchema = z.object({
96
+ code: ProjectCodeSchema,
97
+ id: IdSchema.describe('Run ID'),
98
+ hash: HashSchema.describe('Result hash identifier'),
99
+ });
100
+ // ============================================================================
101
+ // HANDLERS
102
+ // ============================================================================
103
+ /**
104
+ * List all test results with filtering
105
+ */
106
+ async function listResults(args) {
107
+ const client = getApiClient();
108
+ const { code, ...filters } = args;
109
+ const result = await toResultAsync(client.results.getResults(code, filters.status, filters.run, filters.case_id, filters.member, filters.api, filters.from_end_time, filters.to_end_time, filters.limit, filters.offset));
110
+ return result.match((response) => response.data.result, (error) => {
111
+ throw new Error(error);
112
+ });
113
+ }
114
+ /**
115
+ * Get a specific test result by hash
116
+ */
117
+ async function getResult(args) {
118
+ const client = getApiClient();
119
+ const { code, hash } = args;
120
+ const result = await toResultAsync(client.results.getResult(code, hash));
121
+ return result.match((response) => response.data.result, (error) => {
122
+ throw new Error(error);
123
+ });
124
+ }
125
+ /**
126
+ * Create a test result in a run
127
+ */
128
+ async function createResult(args) {
129
+ const client = getApiClient();
130
+ const { code, id, ...resultData } = args;
131
+ const result = await toResultAsync(client.results.createResult(code, id, resultData));
132
+ return result.match((response) => response.data.result, (error) => {
133
+ throw new Error(error);
134
+ });
135
+ }
136
+ /**
137
+ * Create multiple test results at once
138
+ */
139
+ async function createResultsBulk(args) {
140
+ const client = getApiClient();
141
+ const { code, id, results } = args;
142
+ const result = await toResultAsync(client.results.createResultBulk(code, id, { results }));
143
+ return result.match((_response) => ({ success: true, count: results.length }), (error) => {
144
+ throw new Error(error);
145
+ });
146
+ }
147
+ /**
148
+ * Update an existing test result
149
+ */
150
+ async function updateResult(args) {
151
+ const client = getApiClient();
152
+ const { code, id, hash, ...updateData } = args;
153
+ const result = await toResultAsync(client.results.updateResult(code, id, hash, updateData));
154
+ return result.match((response) => response.data.result, (error) => {
155
+ throw new Error(error);
156
+ });
157
+ }
158
+ /**
159
+ * Delete a test result
160
+ */
161
+ async function deleteResult(args) {
162
+ const client = getApiClient();
163
+ const { code, id, hash } = args;
164
+ const result = await toResultAsync(client.results.deleteResult(code, id, hash));
165
+ return result.match((response) => response.data.result, (error) => {
166
+ throw new Error(error);
167
+ });
168
+ }
169
+ // ============================================================================
170
+ // TOOL REGISTRATION
171
+ // ============================================================================
172
+ toolRegistry.register({
173
+ name: 'list_results',
174
+ description: 'Get all test results with optional filtering by run, case, status, etc.',
175
+ schema: ListResultsSchema,
176
+ handler: listResults,
177
+ });
178
+ toolRegistry.register({
179
+ name: 'get_result',
180
+ description: 'Get a specific test result by hash',
181
+ schema: GetResultSchema,
182
+ handler: getResult,
183
+ });
184
+ toolRegistry.register({
185
+ name: 'create_result',
186
+ description: 'Create a test result for a run',
187
+ schema: CreateResultSchema,
188
+ handler: createResult,
189
+ });
190
+ toolRegistry.register({
191
+ name: 'create_results_bulk',
192
+ description: 'Create multiple test results at once for efficiency',
193
+ schema: CreateResultsBulkSchema,
194
+ handler: createResultsBulk,
195
+ });
196
+ toolRegistry.register({
197
+ name: 'update_result',
198
+ description: 'Update an existing test result',
199
+ schema: UpdateResultSchema,
200
+ handler: updateResult,
201
+ });
202
+ toolRegistry.register({
203
+ name: 'delete_result',
204
+ description: 'Delete a test result from a run',
205
+ schema: DeleteResultSchema,
206
+ handler: deleteResult,
207
+ });
208
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceR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,QAAQ,CAAC;IACpB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,yEAAyE;IACtF,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,oCAAoC;IACjD,MAAM,EAAE,eAAe;IACvB,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gCAAgC;IAC7C,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE,uBAAuB;IAC/B,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gCAAgC;IAC7C,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Test Runs Operations
3
+ *
4
+ * Implements all MCP tools for managing test runs in Qase.
5
+ * Test runs represent test execution sessions.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}