@smartbear/mcp 0.29.0 → 0.31.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.
- package/dist/bearq/client.js +2 -6
- package/dist/bearq/tool/tasks/delete-test-cases.js +53 -0
- package/dist/common/server.js +5 -1
- package/dist/package.json.js +1 -1
- package/dist/pactflow/client/tools.js +408 -0
- package/dist/pactflow/client.js +4 -11
- package/dist/reflect/client.js +5 -1
- package/dist/reflect/tool/tests/create-segment.js +18 -0
- package/dist/reflect/tool/tests/create-test.js +18 -0
- package/dist/reflect/tool/tests/definition.js +190 -0
- package/dist/swagger/client/functional-testing-api.js +111 -121
- package/dist/swagger/client/functional-testing-tools.js +10 -1
- package/dist/swagger/client/functional-testing-types.js +6 -0
- package/dist/swagger/client/portal-types.js +144 -10
- package/dist/swagger/client/registry-types.js +60 -1
- package/dist/swagger/client/tool-constants.js +20 -0
- package/dist/swagger/client/tools.js +87 -29
- package/dist/swagger/client/user-management-types.js +14 -0
- package/dist/swagger/client.js +8 -2
- package/package.json +1 -1
- package/dist/bearq/tool/tasks/refine-all-draft-tests.js +0 -28
- package/dist/bearq/tool/tasks/refine-test-cases.js +0 -31
- package/dist/bearq/tool/tasks/refine-tests-in-functional-areas.js +0 -35
package/dist/bearq/client.js
CHANGED
|
@@ -5,12 +5,10 @@ import { ToolError } from "../common/tools.js";
|
|
|
5
5
|
import { DEFAULT_API_BASE_URL, AUTHORIZATION_HEADER } from "./config/constants.js";
|
|
6
6
|
import { ListEnvironments } from "./tool/environments/list-environments.js";
|
|
7
7
|
import { ChatWithQaLead } from "./tool/tasks/chat-with-qa-lead.js";
|
|
8
|
+
import { DeleteTestCases } from "./tool/tasks/delete-test-cases.js";
|
|
8
9
|
import { ExpandApplicationModel } from "./tool/tasks/expand-application-model.js";
|
|
9
10
|
import { GetTask } from "./tool/tasks/get-task.js";
|
|
10
11
|
import { GetTaskStatus } from "./tool/tasks/get-task-status.js";
|
|
11
|
-
import { RefineAllDraftTests } from "./tool/tasks/refine-all-draft-tests.js";
|
|
12
|
-
import { RefineTestCases } from "./tool/tasks/refine-test-cases.js";
|
|
13
|
-
import { RefineTestsInFunctionalAreas } from "./tool/tasks/refine-tests-in-functional-areas.js";
|
|
14
12
|
import { RunRegressionTests } from "./tool/tasks/run-regression-tests.js";
|
|
15
13
|
import { RunTestCases } from "./tool/tasks/run-test-cases.js";
|
|
16
14
|
import { RunTestsInFunctionalAreas } from "./tool/tasks/run-tests-in-functional-areas.js";
|
|
@@ -62,9 +60,7 @@ class BearQClient {
|
|
|
62
60
|
new RunRegressionTests(this),
|
|
63
61
|
new RunTestCases(this),
|
|
64
62
|
new RunTestsInFunctionalAreas(this),
|
|
65
|
-
new
|
|
66
|
-
new RefineTestsInFunctionalAreas(this),
|
|
67
|
-
new RefineAllDraftTests(this),
|
|
63
|
+
new DeleteTestCases(this),
|
|
68
64
|
new ExpandApplicationModel(this),
|
|
69
65
|
new ChatWithQaLead(this),
|
|
70
66
|
new GetTask(this),
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
testCaseIds: z.array(z.number().int().positive()).min(1).describe("IDs of BearQ test cases to delete.")
|
|
5
|
+
});
|
|
6
|
+
class DeleteTestCases extends Tool {
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Delete Test Cases",
|
|
9
|
+
toolset: "Tasks",
|
|
10
|
+
summary: "Deletes specific BearQ test cases by ID. Deletion is reversible — tests are archived and can be restored. Works on any unprotected test; protected tests are rejected.",
|
|
11
|
+
inputSchema,
|
|
12
|
+
readOnly: false,
|
|
13
|
+
destructive: true
|
|
14
|
+
};
|
|
15
|
+
handle = async (args) => {
|
|
16
|
+
const { testCaseIds } = inputSchema.parse(args);
|
|
17
|
+
const deleted = [];
|
|
18
|
+
const failed = [];
|
|
19
|
+
await Promise.all(
|
|
20
|
+
testCaseIds.map(async (testCaseId) => {
|
|
21
|
+
try {
|
|
22
|
+
const res = await fetch(
|
|
23
|
+
`${this.client.getBaseUrl()}/test-cases/${testCaseId}`,
|
|
24
|
+
{
|
|
25
|
+
method: "DELETE",
|
|
26
|
+
headers: this.client.getHeaders()
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
if (res.ok) {
|
|
30
|
+
deleted.push(testCaseId);
|
|
31
|
+
} else {
|
|
32
|
+
failed.push({
|
|
33
|
+
testCaseId,
|
|
34
|
+
error: `${res.status} ${res.statusText}`
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
39
|
+
failed.push({
|
|
40
|
+
testCaseId,
|
|
41
|
+
error: msg.length > 200 ? `${msg.slice(0, 200)}…` : msg
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: "text", text: JSON.stringify({ deleted, failed }) }]
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
DeleteTestCases
|
|
53
|
+
};
|
package/dist/common/server.js
CHANGED
|
@@ -112,7 +112,11 @@ class SmartBearMcpServer extends McpServer {
|
|
|
112
112
|
title: toolTitle,
|
|
113
113
|
description: this.getDescription(params),
|
|
114
114
|
inputSchema: params.inputSchema ? this.schemaToRawShape(params.inputSchema) : {},
|
|
115
|
-
|
|
115
|
+
// Pass ZodObject-based schemas through as-is (rather than via schemaToRawShape)
|
|
116
|
+
// so that z.looseObject()'s additionalProperties:true is preserved in the JSON
|
|
117
|
+
// schema sent to clients — extracting `.shape` would rebuild a strict object and
|
|
118
|
+
// cause "additional properties" validation errors on real API responses.
|
|
119
|
+
outputSchema: params.outputSchema instanceof ZodObject ? params.outputSchema : this.schemaToRawShape(params.outputSchema),
|
|
116
120
|
annotations: this.getAnnotations(toolTitle, params)
|
|
117
121
|
},
|
|
118
122
|
async (args, extra) => {
|
package/dist/package.json.js
CHANGED