@smartbear/mcp 0.9.0 → 0.11.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/README.md +38 -11
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +0 -6
- package/dist/bugsnag/client.js +238 -380
- package/dist/bugsnag/input-schemas.js +51 -0
- package/dist/collaborator/client.js +377 -0
- package/dist/common/cache.js +63 -0
- package/dist/common/client-registry.js +128 -0
- package/dist/common/register-clients.js +31 -0
- package/dist/common/server.js +77 -28
- package/dist/common/transport-http.js +377 -0
- package/dist/common/transport-stdio.js +43 -0
- package/dist/index.js +18 -60
- package/dist/pactflow/client/tools.js +4 -4
- package/dist/pactflow/client.js +39 -19
- package/dist/qmetry/client/auto-resolve.js +22 -0
- package/dist/qmetry/client/handlers.js +18 -4
- package/dist/qmetry/client/issues.js +98 -1
- package/dist/qmetry/client/project.js +18 -1
- package/dist/qmetry/client/testcase.js +79 -1
- package/dist/qmetry/client/testsuite.js +156 -1
- package/dist/qmetry/client/tools/index.js +17 -0
- package/dist/qmetry/client/tools/issue-tools.js +545 -0
- package/dist/qmetry/client/tools/project-tools.js +348 -0
- package/dist/qmetry/client/tools/requirement-tools.js +530 -0
- package/dist/qmetry/client/tools/testcase-tools.js +526 -0
- package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
- package/dist/qmetry/client/tools/types.js +1 -0
- package/dist/qmetry/client.js +33 -11
- package/dist/qmetry/config/constants.js +14 -0
- package/dist/qmetry/config/rest-endpoints.js +10 -0
- package/dist/qmetry/types/common.js +287 -2
- package/dist/qmetry/types/issues.js +11 -1
- package/dist/qmetry/types/project.js +7 -0
- package/dist/qmetry/types/testcase.js +6 -0
- package/dist/qmetry/types/testsuite.js +19 -1
- package/dist/reflect/client.js +10 -4
- package/dist/{api-hub → swagger}/client/api.js +190 -2
- package/dist/{api-hub → swagger}/client/configuration.js +6 -1
- package/dist/swagger/client/index.js +6 -0
- package/dist/{api-hub → swagger}/client/portal-types.js +126 -0
- package/dist/swagger/client/tools.js +161 -0
- package/dist/swagger/client/user-management-types.js +24 -0
- package/dist/swagger/client.js +141 -0
- package/dist/swagger/config-utils.js +18 -0
- package/dist/zephyr/client.js +44 -6
- package/dist/zephyr/common/api-client.js +8 -0
- package/dist/zephyr/common/rest-api-schemas.js +5174 -0
- package/dist/zephyr/tool/priority/get-priorities.js +43 -0
- package/dist/zephyr/tool/project/get-project.js +39 -0
- package/dist/zephyr/tool/project/get-projects.js +7 -13
- package/dist/zephyr/tool/status/get-statuses.js +49 -0
- package/dist/zephyr/tool/test-case/get-test-case.js +39 -0
- package/dist/zephyr/tool/test-case/get-test-cases.js +64 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +39 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
- package/dist/zephyr/tool/test-execution/get-test-execution.js +39 -0
- package/package.json +2 -2
- package/dist/api-hub/client/index.js +0 -5
- package/dist/api-hub/client/tools.js +0 -104
- package/dist/api-hub/client.js +0 -98
- package/dist/qmetry/client/tools.js +0 -1673
- package/dist/zephyr/common/types.js +0 -35
- /package/dist/{api-hub → swagger}/client/registry-types.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/qmetry/client.js
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
+
import z from "zod";
|
|
1
2
|
import { autoResolveViewIdAndFolderPath, findAutoResolveConfig, } from "./client/auto-resolve.js";
|
|
2
3
|
import { QMETRY_HANDLER_MAP } from "./client/handlers.js";
|
|
3
4
|
import { getProjectInfo } from "./client/project.js";
|
|
4
|
-
import { TOOLS } from "./client/tools.js";
|
|
5
|
+
import { TOOLS } from "./client/tools/index.js";
|
|
5
6
|
import { QMETRY_DEFAULTS } from "./config/constants.js";
|
|
7
|
+
const ConfigurationSchema = z.object({
|
|
8
|
+
api_key: z.string().describe("QMetry API key for authentication"),
|
|
9
|
+
base_url: z
|
|
10
|
+
.string()
|
|
11
|
+
.url()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Optional QMetry base URL for custom or region-specific endpoints"),
|
|
14
|
+
});
|
|
6
15
|
export class QmetryClient {
|
|
7
16
|
name = "QMetry";
|
|
8
|
-
|
|
17
|
+
toolPrefix = "qmetry";
|
|
18
|
+
configPrefix = "Qmetry";
|
|
19
|
+
config = ConfigurationSchema;
|
|
9
20
|
token;
|
|
10
|
-
projectApiKey;
|
|
11
|
-
endpoint;
|
|
12
|
-
|
|
13
|
-
this.token =
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
projectApiKey = QMETRY_DEFAULTS.PROJECT_KEY;
|
|
22
|
+
endpoint = QMETRY_DEFAULTS.BASE_URL;
|
|
23
|
+
async configure(_server, config, _cache) {
|
|
24
|
+
this.token = config.api_key;
|
|
25
|
+
if (config.base_url) {
|
|
26
|
+
this.endpoint = config.base_url;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
16
29
|
}
|
|
17
30
|
getToken() {
|
|
31
|
+
if (!this.token)
|
|
32
|
+
throw new Error("Client not configured");
|
|
18
33
|
return this.token;
|
|
19
34
|
}
|
|
20
35
|
getBaseUrl() {
|
|
@@ -58,12 +73,19 @@ export class QmetryClient {
|
|
|
58
73
|
const needsFolderPathResolve = a.folderPath === undefined;
|
|
59
74
|
const needsFolderIdResolve = autoResolveConfig.folderIdField &&
|
|
60
75
|
!a[autoResolveConfig.folderIdField];
|
|
76
|
+
// Explicit condition for auto-resolving tcFolderID for Create Test Case
|
|
77
|
+
const needsTcFolderIdAutoResolve = autoResolveConfig.folderIdField === "tcFolderID" && !a.tcFolderID;
|
|
78
|
+
// Explicit condition for auto-resolving parentFolderId for Create Test Suite
|
|
79
|
+
const needsParentFolderIdAutoResolve = autoResolveConfig.folderIdField === "parentFolderId" &&
|
|
80
|
+
!a.parentFolderId;
|
|
61
81
|
if (needsViewIdResolve ||
|
|
62
82
|
needsFolderPathResolve ||
|
|
63
|
-
needsFolderIdResolve
|
|
83
|
+
needsFolderIdResolve ||
|
|
84
|
+
needsTcFolderIdAutoResolve ||
|
|
85
|
+
needsParentFolderIdAutoResolve) {
|
|
64
86
|
let projectInfo;
|
|
65
87
|
try {
|
|
66
|
-
projectInfo = (await getProjectInfo(this.
|
|
88
|
+
projectInfo = (await getProjectInfo(this.getToken(), baseUrl, projectKey));
|
|
67
89
|
}
|
|
68
90
|
catch (err) {
|
|
69
91
|
throw new Error(`Failed to auto-resolve viewId/folderPath/folderID for ${autoResolveConfig.moduleName} in project ${projectKey}. ` +
|
|
@@ -76,7 +98,7 @@ export class QmetryClient {
|
|
|
76
98
|
}
|
|
77
99
|
// Extract projectKey and baseUrl from arguments to prevent them from being sent in request body
|
|
78
100
|
const { projectKey: _, baseUrl: __, ...cleanArgs } = a;
|
|
79
|
-
const result = await handlerFn(this.
|
|
101
|
+
const result = await handlerFn(this.getToken(), baseUrl, projectKey, cleanArgs);
|
|
80
102
|
// Use custom formatter if available, otherwise return JSON
|
|
81
103
|
const formatted = tool.formatResponse
|
|
82
104
|
? tool.formatResponse(result)
|
|
@@ -3,24 +3,38 @@ export const QMETRY_DEFAULTS = {
|
|
|
3
3
|
PROJECT_KEY: "default",
|
|
4
4
|
};
|
|
5
5
|
export const QMetryToolsHandlers = {
|
|
6
|
+
FETCH_PROJECTS: "getProjects",
|
|
6
7
|
SET_PROJECT_INFO: "setProjectInfo",
|
|
7
8
|
FETCH_PROJECT_INFO: "getProjectInfo",
|
|
8
9
|
FETCH_RELEASES_CYCLES: "getReleasesCycles",
|
|
9
10
|
FETCH_BUILDS: "getBuilds",
|
|
10
11
|
FETCH_PLATFORMS: "getPlatforms",
|
|
12
|
+
CREATE_TEST_CASE: "createTestCases",
|
|
13
|
+
UPDATE_TEST_CASE: "updateTestCase",
|
|
11
14
|
FETCH_TEST_CASES: "getTestCases",
|
|
12
15
|
FETCH_TEST_CASE_DETAILS: "getTestCaseDetails",
|
|
13
16
|
FETCH_TEST_CASE_VERSION_DETAILS: "getTestCaseVersionDetails",
|
|
14
17
|
FETCH_TEST_CASE_STEPS: "getTestCaseSteps",
|
|
15
18
|
FETCH_TEST_CASE_EXECUTIONS: "getTestCaseExecutions",
|
|
19
|
+
LINK_REQUIREMENT_TO_TESTCASE: "linkRequirementToTestCase",
|
|
16
20
|
FETCH_REQUIREMENTS: "getRequirements",
|
|
17
21
|
FETCH_REQUIREMENT_DETAILS: "getRequirementDetails",
|
|
18
22
|
FETCH_TESTCASES_LINKED_TO_REQUIREMENT: "getTestCasesLinkedToRequirement",
|
|
19
23
|
FETCH_REQUIREMENTS_LINKED_TO_TESTCASE: "getRequirementsLinkedToTestCase",
|
|
24
|
+
CREATE_TEST_SUITE: "createTestSuite",
|
|
25
|
+
UPDATE_TEST_SUITE: "updateTestSuite",
|
|
26
|
+
FETCH_TEST_SUITES: "getTestSuites",
|
|
20
27
|
FETCH_TESTSUITES_FOR_TESTCASE: "getTestSuitesForTestCase",
|
|
21
28
|
FETCH_TESTCASES_BY_TESTSUITE: "getTestCasesByTestSuite",
|
|
22
29
|
FETCH_EXECUTIONS_BY_TESTSUITE: "getExecutionsByTestSuite",
|
|
23
30
|
FETCH_TESTCASE_RUNS_BY_TESTSUITE_RUN: "getTestCaseRunsByTestSuiteRun",
|
|
24
31
|
FETCH_LINKED_ISSUES_BY_TESTCASE_RUN: "getLinkedIssuesByTestCaseRun",
|
|
25
32
|
FETCH_ISSUES_LINKED_TO_TESTCASE: "getIssuesLinkedToTestCase",
|
|
33
|
+
LINK_TESTCASES_TO_TESTSUITE: "linkTestCasesToTestSuite",
|
|
34
|
+
REQUIREMENTS_LINKED_TESTCASES_TO_TESTSUITE: "reqLinkedTestCasesToTestSuite",
|
|
35
|
+
CREATE_ISSUE: "createIssue",
|
|
36
|
+
UPDATE_ISSUE: "updateIssue",
|
|
37
|
+
FETCH_ISSUES: "getIssues",
|
|
38
|
+
LINK_ISSUES_TO_TESTCASE_RUN: "linkIssuesToTestcaseRun",
|
|
39
|
+
LINK_PLATFORMS_TO_TESTSUITE: "linkPlatformsToTestSuite",
|
|
26
40
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const QMETRY_PATHS = {
|
|
2
2
|
PROJECT: {
|
|
3
|
+
GET_PROJECTS: "/rest/admin/project/list",
|
|
3
4
|
GET_INFO: "/rest/admin/project/getinfo",
|
|
4
5
|
GET_RELEASES_CYCLES: "/rest/admin/scope/tree",
|
|
5
6
|
GET_BUILD: "/rest/admin/drop/list",
|
|
@@ -12,6 +13,8 @@ export const QMETRY_PATHS = {
|
|
|
12
13
|
GET_TC_STEPS: "/rest/testcases/steps/list",
|
|
13
14
|
GET_TC_EXECUTIONS: "/rest/testcases/execution",
|
|
14
15
|
GET_TC_LINKED_TO_RQ: "/rest/testcases/list/forRQ",
|
|
16
|
+
CREATE_UPDATE_TC: "/rest/testcases",
|
|
17
|
+
LINKED_RQ_TO_TC: "/rest/testcases/link/requirements",
|
|
15
18
|
},
|
|
16
19
|
REQUIREMENT: {
|
|
17
20
|
GET_RQ_LIST: "/rest/requirements/list/viewColumns",
|
|
@@ -19,13 +22,20 @@ export const QMETRY_PATHS = {
|
|
|
19
22
|
GET_RQ_LINKED_TO_TC: "/rest/requirements/list/forTC",
|
|
20
23
|
},
|
|
21
24
|
TESTSUITE: {
|
|
25
|
+
CREATE_UPDATE_TS: "/rest/testsuites",
|
|
22
26
|
GET_TS_LIST_FOR_TC: "/rest/testsuites/list/forTC",
|
|
27
|
+
GET_TS_LIST: "/rest/testsuites/list/viewColumns",
|
|
23
28
|
GET_TESTCASES_BY_TESTSUITE: "/rest/testcases/list/forTS",
|
|
29
|
+
LINKED_TESTCASES_TO_TESTSUITE: "/rest/testsuites/dolink/TCs",
|
|
24
30
|
GET_EXECUTIONS_BY_TESTSUITE: "/rest/execution/list/platformHome",
|
|
25
31
|
GET_TESTCASE_RUNS_BY_TESTSUITE_RUN: "/rest/execution/list/viewColumns",
|
|
26
32
|
GET_LINKED_ISSUES_BY_TESTCASE_RUN: "/rest/execution/issue/list/forTCRun",
|
|
33
|
+
LINK_PLATFORMS_TO_TESTSUITE: "/rest/testsuites/link/platforms",
|
|
27
34
|
},
|
|
28
35
|
ISSUES: {
|
|
36
|
+
GET_ISSUES_LIST: "/rest/issues/list/viewColumns",
|
|
37
|
+
CREATE_UPDATE_ISSUE: "/rest/issues",
|
|
29
38
|
GET_ISSUES_LINKED_TO_TC: "/rest/issues/list/ForTC",
|
|
39
|
+
LINK_ISSUES_TO_TESTCASE_RUN: "/rest/execution/link/issue",
|
|
30
40
|
},
|
|
31
41
|
};
|
|
@@ -67,6 +67,10 @@ export const CommonFields = {
|
|
|
67
67
|
.number()
|
|
68
68
|
.describe("Test Case version number. " +
|
|
69
69
|
"This is the internal numeric identifier for the version."),
|
|
70
|
+
tcVersionID: z
|
|
71
|
+
.number()
|
|
72
|
+
.describe("Test Case version number. " +
|
|
73
|
+
"This is the internal numeric identifier for the version."),
|
|
70
74
|
versionOptional: z
|
|
71
75
|
.number()
|
|
72
76
|
.optional()
|
|
@@ -97,14 +101,21 @@ export const CommonFields = {
|
|
|
97
101
|
.string()
|
|
98
102
|
.optional()
|
|
99
103
|
.describe("Folder path for requirements - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
|
|
100
|
-
'Leave empty unless you want specific folder. System will automatically use "" (root directory). ' +
|
|
104
|
+
'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
|
|
101
105
|
'Only specify if user wants specific folder like "Automation/Regression".')
|
|
102
106
|
.default(""),
|
|
103
107
|
tcFolderPath: z
|
|
104
108
|
.string()
|
|
105
109
|
.optional()
|
|
106
110
|
.describe("Folder path for test cases - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
|
|
107
|
-
'Leave empty unless you want specific folder. System will automatically use "" (root directory). ' +
|
|
111
|
+
'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
|
|
112
|
+
'Only specify if user wants specific folder like "Automation/Regression".')
|
|
113
|
+
.default(""),
|
|
114
|
+
tsFolderPath: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Folder path for test suites - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
|
|
118
|
+
'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
|
|
108
119
|
'Only specify if user wants specific folder like "Automation/Regression".')
|
|
109
120
|
.default(""),
|
|
110
121
|
folderID: z
|
|
@@ -143,6 +154,12 @@ export const CommonFields = {
|
|
|
143
154
|
"Leave empty unless you have a specific viewId. " +
|
|
144
155
|
"System will fetch project info using the projectKey and extract latestViews.TSFS.viewId automatically. " +
|
|
145
156
|
"Manual viewId only needed if you want to override the automatic resolution."),
|
|
157
|
+
tsViewId: z
|
|
158
|
+
.number()
|
|
159
|
+
.describe("ViewId for test suites - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
|
|
160
|
+
"Leave empty unless you have a specific viewId. " +
|
|
161
|
+
"System will fetch project info using the projectKey and extract latestViews.TS.viewId automatically. " +
|
|
162
|
+
"Manual viewId only needed if you want to override the automatic resolution."),
|
|
146
163
|
tsrunID: z
|
|
147
164
|
.string()
|
|
148
165
|
.describe("Test Suite Run ID (required for fetching test case runs). " +
|
|
@@ -226,6 +243,23 @@ export const CommonFields = {
|
|
|
226
243
|
"When false, returns only active (non-archived) items. " +
|
|
227
244
|
"Applies to any entity type being fetched (test cases, requirements, releases, cycles, builds, platforms, etc.)."),
|
|
228
245
|
};
|
|
246
|
+
export const ProjectListArgsSchema = z.object({
|
|
247
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
248
|
+
baseUrl: CommonFields.baseUrl,
|
|
249
|
+
params: z.object({
|
|
250
|
+
showArchive: z
|
|
251
|
+
.boolean()
|
|
252
|
+
.optional()
|
|
253
|
+
.describe("Whether to include archived records in the results. " +
|
|
254
|
+
"When true, returns both active and archived items. " +
|
|
255
|
+
"When false, returns only active (non-archived) items. ")
|
|
256
|
+
.default(false),
|
|
257
|
+
}),
|
|
258
|
+
start: CommonFields.start,
|
|
259
|
+
page: CommonFields.page,
|
|
260
|
+
limit: CommonFields.limit,
|
|
261
|
+
filter: CommonFields.filter,
|
|
262
|
+
});
|
|
229
263
|
export const ProjectArgsSchema = z.object({
|
|
230
264
|
projectKey: CommonFields.projectKey,
|
|
231
265
|
});
|
|
@@ -254,6 +288,70 @@ export const PlatformArgsSchema = z.object({
|
|
|
254
288
|
.default('[{"property":"platformID","direction":"DESC"}]'),
|
|
255
289
|
filter: CommonFields.filter,
|
|
256
290
|
});
|
|
291
|
+
export const CreateTestCaseStepSchema = z.object({
|
|
292
|
+
orderId: z.number(),
|
|
293
|
+
description: z.string(),
|
|
294
|
+
inputData: z.string().optional(),
|
|
295
|
+
expectedOutcome: z.string().optional(),
|
|
296
|
+
UDF: z.record(z.string()).optional(),
|
|
297
|
+
});
|
|
298
|
+
export const UpdateTestCaseRemoveStepSchema = z.object({
|
|
299
|
+
tcID: z.number(),
|
|
300
|
+
projectID: z.number(),
|
|
301
|
+
tcStepID: z.number(),
|
|
302
|
+
tcVersionID: z.number(),
|
|
303
|
+
tcVersion: z.number(),
|
|
304
|
+
tcsAttCount: z.number(),
|
|
305
|
+
orderId: z.number(),
|
|
306
|
+
description: z.string(),
|
|
307
|
+
inputData: z.string().optional(),
|
|
308
|
+
expectedOutcome: z.string().optional(),
|
|
309
|
+
UDF: z.record(z.string()).optional(),
|
|
310
|
+
tcsIsShared: z.boolean(),
|
|
311
|
+
tcsIsParameterized: z.boolean(),
|
|
312
|
+
});
|
|
313
|
+
export const CreateTestCaseArgsSchema = z.object({
|
|
314
|
+
tcFolderID: z.string(),
|
|
315
|
+
steps: z.array(CreateTestCaseStepSchema).optional(),
|
|
316
|
+
name: z.string(),
|
|
317
|
+
priority: z.number().optional(),
|
|
318
|
+
component: z.array(z.number()).optional(),
|
|
319
|
+
testcaseOwner: z.number().optional(),
|
|
320
|
+
testCaseState: z.number().optional(),
|
|
321
|
+
testCaseType: z.number().optional(),
|
|
322
|
+
estimatedTime: z.number().optional(),
|
|
323
|
+
testingType: z.number().optional(),
|
|
324
|
+
description: z.string().optional(),
|
|
325
|
+
associateRelCyc: z.boolean().optional(),
|
|
326
|
+
releaseCycleMapping: z
|
|
327
|
+
.array(z.object({
|
|
328
|
+
release: z.number(),
|
|
329
|
+
cycle: z.array(z.number()),
|
|
330
|
+
version: z.number().optional(),
|
|
331
|
+
}))
|
|
332
|
+
.optional(),
|
|
333
|
+
});
|
|
334
|
+
export const UpdateTestCaseArgsSchema = z.object({
|
|
335
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
336
|
+
baseUrl: CommonFields.baseUrl,
|
|
337
|
+
tcID: CommonFields.tcID,
|
|
338
|
+
tcVersionID: CommonFields.tcVersionID,
|
|
339
|
+
withVersion: z.boolean().optional(),
|
|
340
|
+
notrunall: z.boolean().optional(),
|
|
341
|
+
isStepUpdated: z.boolean().optional(),
|
|
342
|
+
steps: z.array(CreateTestCaseStepSchema).optional(),
|
|
343
|
+
removeSteps: z.array(UpdateTestCaseRemoveStepSchema).optional(),
|
|
344
|
+
name: z.string().optional(),
|
|
345
|
+
priority: z.number().optional(),
|
|
346
|
+
component: z.array(z.number()).optional(),
|
|
347
|
+
owner: z.number().optional(),
|
|
348
|
+
testCaseState: z.number().optional(),
|
|
349
|
+
testCaseType: z.number().optional(),
|
|
350
|
+
executionMinutes: z.number().optional(),
|
|
351
|
+
testingType: z.number().optional(),
|
|
352
|
+
description: z.string().optional(),
|
|
353
|
+
updateOnlyMetadata: z.boolean().optional(),
|
|
354
|
+
});
|
|
257
355
|
export const TestCaseListArgsSchema = z.object({
|
|
258
356
|
projectKey: CommonFields.projectKeyOptional,
|
|
259
357
|
baseUrl: CommonFields.baseUrl,
|
|
@@ -362,6 +460,13 @@ export const RequirementsLinkedToTestCaseArgsSchema = z.object({
|
|
|
362
460
|
rqFolderPath: CommonFields.rqFolderPath,
|
|
363
461
|
filter: CommonFields.filter,
|
|
364
462
|
});
|
|
463
|
+
export const LinkRequirementToTestCaseArgsSchema = z.object({
|
|
464
|
+
tcID: z.string().describe("EntityKey of Testcase (e.g. 'COD-TC-29')"),
|
|
465
|
+
tcVersionId: CommonFields.tcVersionID,
|
|
466
|
+
rqVersionIds: z
|
|
467
|
+
.string()
|
|
468
|
+
.describe("Comma-separated values of versionId of the Requirement (e.g. '236124,236125')"),
|
|
469
|
+
});
|
|
365
470
|
export const TestCasesLinkedToRequirementArgsSchema = z.object({
|
|
366
471
|
projectKey: CommonFields.projectKeyOptional,
|
|
367
472
|
baseUrl: CommonFields.baseUrl,
|
|
@@ -413,6 +518,52 @@ export const TestCasesLinkedToRequirementArgsSchema = z.object({
|
|
|
413
518
|
.describe("True to get column information in response.")
|
|
414
519
|
.default(true),
|
|
415
520
|
});
|
|
521
|
+
export const CreateTestSuiteArgsSchema = z.object({
|
|
522
|
+
parentFolderId: z.string(),
|
|
523
|
+
name: z.string(),
|
|
524
|
+
isAutomatedFlag: z.boolean().optional(),
|
|
525
|
+
description: z.string().optional(),
|
|
526
|
+
testsuiteOwner: z.number().optional(),
|
|
527
|
+
testSuiteState: z.number().optional(),
|
|
528
|
+
associateRelCyc: z.boolean().optional(),
|
|
529
|
+
releaseCycleMapping: z
|
|
530
|
+
.array(z.object({
|
|
531
|
+
buildID: z.number(),
|
|
532
|
+
releaseId: z.number(),
|
|
533
|
+
}))
|
|
534
|
+
.optional(),
|
|
535
|
+
});
|
|
536
|
+
export const UpdateTestSuiteArgsSchema = z.object({
|
|
537
|
+
id: z.number().describe("Id of Test Suite to be updated (required)"),
|
|
538
|
+
TsFolderID: z
|
|
539
|
+
.number()
|
|
540
|
+
.describe("Folder ID where Test Suite resides (required)"),
|
|
541
|
+
entityKey: z
|
|
542
|
+
.string()
|
|
543
|
+
.describe("Entity Key of Test Suite to be updated (required)"),
|
|
544
|
+
name: z.string().optional().describe("Name of the Test Suite"),
|
|
545
|
+
description: z.string().optional().describe("Description of the Test Suite"),
|
|
546
|
+
testsuiteOwner: z.number().optional().describe("Owner ID of the Test Suite"),
|
|
547
|
+
testSuiteState: z.number().optional().describe("State of the Test Suite"),
|
|
548
|
+
});
|
|
549
|
+
export const TestSuiteListArgsSchema = z.object({
|
|
550
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
551
|
+
baseUrl: CommonFields.baseUrl,
|
|
552
|
+
viewId: CommonFields.tsViewId,
|
|
553
|
+
folderPath: CommonFields.tsFolderPath,
|
|
554
|
+
start: CommonFields.start,
|
|
555
|
+
page: CommonFields.page,
|
|
556
|
+
limit: CommonFields.limit,
|
|
557
|
+
scope: CommonFields.scope,
|
|
558
|
+
getSubEntities: CommonFields.getSubEntities,
|
|
559
|
+
filter: CommonFields.filter,
|
|
560
|
+
udfFilter: CommonFields.udfFilter,
|
|
561
|
+
sort: z
|
|
562
|
+
.string()
|
|
563
|
+
.optional()
|
|
564
|
+
.describe("Sort Records - refer json schema, Possible property - entityKey, name, testsuiteStatus, linkedPlatformCount, linkedTcCount, createdDate, createdByAlias, updatedDate, updatedByAlias, attachmentCount, owner, remExecutionTime, totalExecutionTime")
|
|
565
|
+
.default('[{"property":"name","direction":"ASC"}]'),
|
|
566
|
+
});
|
|
416
567
|
export const TestSuitesForTestCaseArgsSchema = z.object({
|
|
417
568
|
projectKey: CommonFields.projectKeyOptional,
|
|
418
569
|
baseUrl: CommonFields.baseUrl,
|
|
@@ -424,6 +575,30 @@ export const TestSuitesForTestCaseArgsSchema = z.object({
|
|
|
424
575
|
getColumns: CommonFields.getColumns,
|
|
425
576
|
filter: CommonFields.filter,
|
|
426
577
|
});
|
|
578
|
+
export const LinkTestCasesToTestSuiteArgsSchema = z
|
|
579
|
+
.object({
|
|
580
|
+
tsID: z.number().describe("Id of Test Suite (required)"),
|
|
581
|
+
tcvdIDs: z
|
|
582
|
+
.array(z.number())
|
|
583
|
+
.describe("Array of Test Case Version IDs (required if fromReqs is false)"),
|
|
584
|
+
fromReqs: z
|
|
585
|
+
.boolean()
|
|
586
|
+
.optional()
|
|
587
|
+
.describe("Link TestCases from Requirements (optional, default false)"),
|
|
588
|
+
})
|
|
589
|
+
.strip();
|
|
590
|
+
export const RequirementsLinkedTestCasesToTestSuiteArgsSchema = z
|
|
591
|
+
.object({
|
|
592
|
+
tsID: z.number().describe("Id of Test Suite (required)"),
|
|
593
|
+
tcvdIDs: z
|
|
594
|
+
.array(z.number())
|
|
595
|
+
.describe("Array of Test Case Version IDs (required if fromReqs is true)"),
|
|
596
|
+
fromReqs: z
|
|
597
|
+
.boolean()
|
|
598
|
+
.optional()
|
|
599
|
+
.describe("Link TestCases from Requirements (optional, default true)"),
|
|
600
|
+
})
|
|
601
|
+
.strip();
|
|
427
602
|
export const IssuesLinkedToTestCaseArgsSchema = z.object({
|
|
428
603
|
projectKey: CommonFields.projectKeyOptional,
|
|
429
604
|
baseUrl: CommonFields.baseUrl,
|
|
@@ -477,3 +652,113 @@ export const LinkedIssuesByTestCaseRunArgsSchema = z.object({
|
|
|
477
652
|
limit: CommonFields.limit,
|
|
478
653
|
filter: CommonFields.filter,
|
|
479
654
|
});
|
|
655
|
+
export const CreateIssueArgsSchema = z.object({
|
|
656
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
657
|
+
baseUrl: CommonFields.baseUrl,
|
|
658
|
+
issueType: z.number().describe("Issue type ID (e.g. Bug, Enhancement, etc.)"),
|
|
659
|
+
issuePriority: z
|
|
660
|
+
.number()
|
|
661
|
+
.describe("Issue priority ID (e.g. High, Medium, Low, etc.)"),
|
|
662
|
+
summary: z.string().describe("Summary or title of the defect/issue"),
|
|
663
|
+
description: z
|
|
664
|
+
.string()
|
|
665
|
+
.optional()
|
|
666
|
+
.describe("Detailed description of the defect/issue"),
|
|
667
|
+
sync_with: z
|
|
668
|
+
.string()
|
|
669
|
+
.optional()
|
|
670
|
+
.describe("External system to sync with (e.g. JIRA, QMetry, etc.)"),
|
|
671
|
+
issueOwner: z.number().optional().describe("Owner/user ID for the issue"),
|
|
672
|
+
component: z
|
|
673
|
+
.array(z.number())
|
|
674
|
+
.optional()
|
|
675
|
+
.describe("Component IDs associated with the issue"),
|
|
676
|
+
affectedRelease: z
|
|
677
|
+
.array(z.number())
|
|
678
|
+
.optional()
|
|
679
|
+
.describe("Release IDs affected by this issue"),
|
|
680
|
+
affectedCycles: z
|
|
681
|
+
.array(z.number())
|
|
682
|
+
.optional()
|
|
683
|
+
.describe("Cycle IDs affected by this issue"),
|
|
684
|
+
tcRunID: z
|
|
685
|
+
.number()
|
|
686
|
+
.optional()
|
|
687
|
+
.describe("Test Case Run ID to link this defect/issue to a test execution (optional)"),
|
|
688
|
+
});
|
|
689
|
+
export const UpdateIssueArgsSchema = z.object({
|
|
690
|
+
DefectId: z.number().describe("ID of the defect/issue to be updated"),
|
|
691
|
+
entityKey: z
|
|
692
|
+
.string()
|
|
693
|
+
.optional()
|
|
694
|
+
.describe("Entity Key of the defect/issue to be updated"),
|
|
695
|
+
issueType: z
|
|
696
|
+
.number()
|
|
697
|
+
.optional()
|
|
698
|
+
.describe("Issue type ID (e.g. Bug, Enhancement, etc.)"),
|
|
699
|
+
issuePriority: z
|
|
700
|
+
.number()
|
|
701
|
+
.optional()
|
|
702
|
+
.describe("Issue priority ID (e.g. High, Medium, Low, etc.)"),
|
|
703
|
+
summary: z
|
|
704
|
+
.string()
|
|
705
|
+
.optional()
|
|
706
|
+
.describe("Summary or title of the defect/issue"),
|
|
707
|
+
description: z
|
|
708
|
+
.string()
|
|
709
|
+
.optional()
|
|
710
|
+
.describe("Detailed description of the defect/issue"),
|
|
711
|
+
issueOwner: z.number().optional().describe("Owner/user ID for the issue"),
|
|
712
|
+
affectedRelease: z
|
|
713
|
+
.number()
|
|
714
|
+
.optional()
|
|
715
|
+
.describe("Release IDs affected by this issue"),
|
|
716
|
+
affectedCycles: z
|
|
717
|
+
.number()
|
|
718
|
+
.optional()
|
|
719
|
+
.describe("Cycle IDs affected by this issue"),
|
|
720
|
+
});
|
|
721
|
+
export const IssuesListArgsSchema = z.object({
|
|
722
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
723
|
+
baseUrl: CommonFields.baseUrl,
|
|
724
|
+
viewId: z
|
|
725
|
+
.number()
|
|
726
|
+
.describe("ViewId for issues - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
|
|
727
|
+
"Leave empty unless you have a specific viewId. " +
|
|
728
|
+
"System will fetch project info using the projectKey and extract latestViews.IS.viewId automatically. " +
|
|
729
|
+
"Manual viewId only needed if you want to override the automatic resolution."),
|
|
730
|
+
start: CommonFields.start,
|
|
731
|
+
page: CommonFields.page,
|
|
732
|
+
limit: CommonFields.limit,
|
|
733
|
+
filter: CommonFields.filter,
|
|
734
|
+
isJiraIntegrated: z
|
|
735
|
+
.boolean()
|
|
736
|
+
.optional()
|
|
737
|
+
.describe("Send true if current project is Integrated with Jira")
|
|
738
|
+
.default(false),
|
|
739
|
+
sort: z
|
|
740
|
+
.string()
|
|
741
|
+
.optional()
|
|
742
|
+
.describe("Sort Records - refer json schema, Possible property - entityKey, name, typeAlias, stateAlias, createdDate, createdByAlias, updatedDate, updatedByAlias, priorityAlias, createdSystem, linkedTcrCount, linkedRqCount, dfOwner, attachmentCount, environmentText")
|
|
743
|
+
.default('[{"property":"name","direction":"ASC"}]'),
|
|
744
|
+
});
|
|
745
|
+
// Export for Link Issues to Testcase Run tool
|
|
746
|
+
export const LinkIssuesToTestcaseRunArgsSchema = z.object({
|
|
747
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
748
|
+
baseUrl: CommonFields.baseUrl,
|
|
749
|
+
issueIds: z
|
|
750
|
+
.array(z.union([z.string(), z.number()]))
|
|
751
|
+
.describe("ID of issues to be linked to Testcase Run"),
|
|
752
|
+
tcrId: z.number().describe("ID of Testcase Run to link issues with"),
|
|
753
|
+
});
|
|
754
|
+
// Export for Link Platforms to Test Suite tool
|
|
755
|
+
export const LinkPlatformsToTestSuiteArgsSchema = z.object({
|
|
756
|
+
projectKey: CommonFields.projectKeyOptional,
|
|
757
|
+
baseUrl: CommonFields.baseUrl,
|
|
758
|
+
qmTsId: z
|
|
759
|
+
.number()
|
|
760
|
+
.describe("Id of Test Suite (required). To get the qmTsId - Call API 'Testsuite/Fetch Testsuite' From the response, get value of following attribute -> data[<index>].id"),
|
|
761
|
+
qmPlatformId: z
|
|
762
|
+
.string()
|
|
763
|
+
.describe("Comma-separated value of PlatformId (required). To get the qmPlatformId - Call API 'Platform/List' From the response, get value of following attribute -> data[<index>].platformID"),
|
|
764
|
+
});
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { DEFAULT_FILTER, DEFAULT_PAGINATION, } from "./common.js";
|
|
1
|
+
import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
|
|
2
2
|
export const DEFAULT_FETCH_ISSUES_LINKED_TO_TESTCASE_PAYLOAD = {
|
|
3
3
|
...DEFAULT_PAGINATION,
|
|
4
4
|
...DEFAULT_FILTER,
|
|
5
5
|
getLinked: true,
|
|
6
6
|
};
|
|
7
|
+
export const DEFAULT_CREATE_ISSUE_PAYLOAD = {};
|
|
8
|
+
export const DEFAULT_UPDATE_ISSUE_PAYLOAD = {};
|
|
9
|
+
export const DEFAULT_LINK_ISSUES_TO_TESTCASE_RUN_PAYLOAD = {};
|
|
10
|
+
export const DEFAULT_FETCH_ISSUES_PAYLOAD = {
|
|
11
|
+
...DEFAULT_PAGINATION,
|
|
12
|
+
...DEFAULT_FILTER,
|
|
13
|
+
...DEFAULT_SORT,
|
|
14
|
+
udfFilter: "[]",
|
|
15
|
+
isJiraIntegated: false,
|
|
16
|
+
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
|
|
2
|
+
export const DEFAULT_FETCH_PROJECTS_PAYLOAD = {
|
|
3
|
+
...DEFAULT_PAGINATION,
|
|
4
|
+
...DEFAULT_FILTER,
|
|
5
|
+
params: {
|
|
6
|
+
showArchive: false,
|
|
7
|
+
},
|
|
8
|
+
};
|
|
2
9
|
export const DEFAULT_FETCH_BUILD_PAYLOAD = {
|
|
3
10
|
...DEFAULT_PAGINATION,
|
|
4
11
|
...DEFAULT_FILTER,
|
|
@@ -5,6 +5,11 @@ export const DEFAULT_FETCH_TESTCASES_PAYLOAD = {
|
|
|
5
5
|
...DEFAULT_FOLDER_OPTIONS,
|
|
6
6
|
udfFilter: "[]",
|
|
7
7
|
};
|
|
8
|
+
export const DEFAULT_CREATE_TESTCASES_PAYLOAD = {
|
|
9
|
+
scope: "project",
|
|
10
|
+
steps: [],
|
|
11
|
+
};
|
|
12
|
+
export const DEFAULT_UPDATE_TESTCASES_PAYLOAD = {};
|
|
8
13
|
export const DEFAULT_FETCH_TESTCASE_DETAILS_PAYLOAD = {
|
|
9
14
|
...DEFAULT_PAGINATION,
|
|
10
15
|
...DEFAULT_FILTER,
|
|
@@ -31,3 +36,4 @@ export const DEFAULT_FETCH_TESTCASE_EXECUTIONS_PAYLOAD = {
|
|
|
31
36
|
...DEFAULT_FILTER,
|
|
32
37
|
scope: DEFAULT_FOLDER_OPTIONS.scope,
|
|
33
38
|
};
|
|
39
|
+
export const DEFAULT_LINKED_REQUIREMENT_TO_TESTCASE_PAYLOAD = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_FILTER, DEFAULT_PAGINATION, } from "./common.js";
|
|
1
|
+
import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
|
|
2
2
|
export const DEFAULT_FETCH_TESTSUITES_FOR_TESTCASE_PAYLOAD = {
|
|
3
3
|
...DEFAULT_PAGINATION,
|
|
4
4
|
...DEFAULT_FILTER,
|
|
@@ -24,3 +24,21 @@ export const DEFAULT_FETCH_LINKED_ISSUES_BY_TESTCASE_RUN_PAYLOAD = {
|
|
|
24
24
|
getColumns: true,
|
|
25
25
|
istcrFlag: true,
|
|
26
26
|
};
|
|
27
|
+
export const DEFAULT_LINKED_TESTCASE_TO_TESTSUITE_PAYLOAD = {
|
|
28
|
+
fromReqs: false,
|
|
29
|
+
};
|
|
30
|
+
export const DEFAULT_REQLINKED_TESTCASE_TO_TESTSUITE_PAYLOAD = {
|
|
31
|
+
fromReqs: true,
|
|
32
|
+
};
|
|
33
|
+
export const DEFAULT_CREATE_TESTSUITE_PAYLOAD = {
|
|
34
|
+
isAutomatedFlag: false,
|
|
35
|
+
};
|
|
36
|
+
export const DEFAULT_UPDATE_TESTSUITE_PAYLOAD = {};
|
|
37
|
+
export const DEFAULT_FETCH_TESTSUITES_PAYLOAD = {
|
|
38
|
+
...DEFAULT_PAGINATION,
|
|
39
|
+
...DEFAULT_FILTER,
|
|
40
|
+
...DEFAULT_SORT,
|
|
41
|
+
udfFilter: "[]",
|
|
42
|
+
scope: "cycle",
|
|
43
|
+
};
|
|
44
|
+
export const DEFAULT_LINKED_PLATFORMS_TO_TESTSUITE_PAYLOAD = {};
|
package/dist/reflect/client.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
|
|
3
3
|
import { ToolError, } from "../common/types.js";
|
|
4
|
+
const ConfigurationSchema = z.object({
|
|
5
|
+
api_token: z.string().describe("Reflect API authentication token"),
|
|
6
|
+
});
|
|
4
7
|
// ReflectClient class implementing the Client interface
|
|
5
8
|
export class ReflectClient {
|
|
6
|
-
headers;
|
|
9
|
+
headers = {};
|
|
7
10
|
name = "Reflect";
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
toolPrefix = "reflect";
|
|
12
|
+
configPrefix = "Reflect";
|
|
13
|
+
config = ConfigurationSchema;
|
|
14
|
+
async configure(_server, config, _cache) {
|
|
10
15
|
this.headers = {
|
|
11
|
-
"X-API-KEY": `${
|
|
16
|
+
"X-API-KEY": `${config.api_token}`,
|
|
12
17
|
"Content-Type": "application/json",
|
|
13
18
|
"User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`,
|
|
14
19
|
};
|
|
20
|
+
return true;
|
|
15
21
|
}
|
|
16
22
|
async listReflectSuites() {
|
|
17
23
|
const response = await fetch("https://api.reflect.run/v1/suites", {
|