xray-mcp 1.0.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/LICENSE +15 -0
- package/README.md +259 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +851 -0
- package/dist/xray-client.d.ts +191 -0
- package/dist/xray-client.js +759 -0
- package/package.json +53 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
export interface XrayConfig {
|
|
2
|
+
clientId: string;
|
|
3
|
+
clientSecret: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface XrayAuthResponse {
|
|
7
|
+
access_token: string;
|
|
8
|
+
expires_in: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TestCase {
|
|
11
|
+
id?: string;
|
|
12
|
+
key?: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
testType?: 'Manual' | 'Cucumber' | 'Generic';
|
|
16
|
+
projectKey: string;
|
|
17
|
+
labels?: string[];
|
|
18
|
+
components?: string[];
|
|
19
|
+
priority?: string;
|
|
20
|
+
status?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TestCaseResponse {
|
|
23
|
+
id: string;
|
|
24
|
+
key: string;
|
|
25
|
+
self: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TestExecution {
|
|
28
|
+
summary: string;
|
|
29
|
+
projectKey: string;
|
|
30
|
+
testIssueIds?: string[];
|
|
31
|
+
testEnvironments?: string[];
|
|
32
|
+
description?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TestExecutionResponse {
|
|
35
|
+
issueId: string;
|
|
36
|
+
key: string;
|
|
37
|
+
testRuns?: TestRun[];
|
|
38
|
+
}
|
|
39
|
+
export interface TestRun {
|
|
40
|
+
id: string;
|
|
41
|
+
status: {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
};
|
|
45
|
+
test: {
|
|
46
|
+
issueId: string;
|
|
47
|
+
jira: any;
|
|
48
|
+
};
|
|
49
|
+
startedOn?: string;
|
|
50
|
+
finishedOn?: string;
|
|
51
|
+
executedBy?: string;
|
|
52
|
+
}
|
|
53
|
+
export type TestRunStatus = 'TODO' | 'EXECUTING' | 'PASS' | 'FAIL' | 'ABORTED' | 'PASSED' | 'FAILED';
|
|
54
|
+
export interface TestPlan {
|
|
55
|
+
summary: string;
|
|
56
|
+
projectKey: string;
|
|
57
|
+
testIssueIds?: string[];
|
|
58
|
+
description?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface TestPlanResponse {
|
|
61
|
+
issueId: string;
|
|
62
|
+
key: string;
|
|
63
|
+
tests?: any[];
|
|
64
|
+
}
|
|
65
|
+
export interface TestSet {
|
|
66
|
+
summary: string;
|
|
67
|
+
projectKey: string;
|
|
68
|
+
testIssueIds?: string[];
|
|
69
|
+
description?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface TestSetResponse {
|
|
72
|
+
issueId: string;
|
|
73
|
+
key: string;
|
|
74
|
+
tests?: any[];
|
|
75
|
+
}
|
|
76
|
+
export declare class XrayClient {
|
|
77
|
+
private config;
|
|
78
|
+
private client;
|
|
79
|
+
private graphqlClient;
|
|
80
|
+
private accessToken;
|
|
81
|
+
private tokenExpiry;
|
|
82
|
+
constructor(config: XrayConfig);
|
|
83
|
+
/**
|
|
84
|
+
* Authenticate with Xray Cloud API and get access token
|
|
85
|
+
*/
|
|
86
|
+
private authenticate;
|
|
87
|
+
/**
|
|
88
|
+
* Make an authenticated request to the Xray API
|
|
89
|
+
*/
|
|
90
|
+
private request;
|
|
91
|
+
/**
|
|
92
|
+
* Make a GraphQL query to Xray API
|
|
93
|
+
*/
|
|
94
|
+
private graphqlRequest;
|
|
95
|
+
/**
|
|
96
|
+
* Create a new test case using GraphQL mutation
|
|
97
|
+
*/
|
|
98
|
+
createTestCase(testCase: TestCase): Promise<TestCaseResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Get a test case by key using GraphQL
|
|
101
|
+
*/
|
|
102
|
+
getTestCase(testKey: string): Promise<any>;
|
|
103
|
+
/**
|
|
104
|
+
* Update a test case
|
|
105
|
+
* Note: Xray GraphQL API has specific mutations for test definition updates
|
|
106
|
+
* (updateUnstructuredTestDefinition, updateGherkinTestDefinition, etc.)
|
|
107
|
+
* For general Jira field updates (summary, description, labels), use Jira REST API directly
|
|
108
|
+
*/
|
|
109
|
+
updateTestCase(testKey: string, updates: Partial<TestCase>): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Delete a test case using GraphQL mutation
|
|
112
|
+
* First retrieves the issueId from the test key, then deletes it
|
|
113
|
+
*/
|
|
114
|
+
deleteTestCase(testKey: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Get test cases for a project using GraphQL
|
|
117
|
+
*/
|
|
118
|
+
getTestCasesByProject(projectKey: string, maxResults?: number): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* Search test cases using JQL and GraphQL
|
|
121
|
+
*/
|
|
122
|
+
searchTestCases(jql: string, maxResults?: number): Promise<any>;
|
|
123
|
+
/**
|
|
124
|
+
* Create a new test execution using GraphQL mutation
|
|
125
|
+
*/
|
|
126
|
+
createTestExecution(testExecution: TestExecution): Promise<TestExecutionResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* Get a test execution by key using GraphQL
|
|
129
|
+
*/
|
|
130
|
+
getTestExecution(testExecutionKey: string): Promise<any>;
|
|
131
|
+
/**
|
|
132
|
+
* Get test executions for a project using GraphQL
|
|
133
|
+
*/
|
|
134
|
+
getTestExecutionsByProject(projectKey: string, maxResults?: number): Promise<any>;
|
|
135
|
+
/**
|
|
136
|
+
* Search test executions using JQL and GraphQL
|
|
137
|
+
*/
|
|
138
|
+
searchTestExecutions(jql: string, maxResults?: number): Promise<any>;
|
|
139
|
+
/**
|
|
140
|
+
* Update the status of a test run using GraphQL mutation
|
|
141
|
+
*/
|
|
142
|
+
updateTestRunStatus(testRunId: string, status: TestRunStatus): Promise<string>;
|
|
143
|
+
/**
|
|
144
|
+
* Create a new test plan using GraphQL mutation
|
|
145
|
+
*/
|
|
146
|
+
createTestPlan(testPlan: TestPlan): Promise<TestPlanResponse>;
|
|
147
|
+
/**
|
|
148
|
+
* Get a test plan by key using GraphQL
|
|
149
|
+
*/
|
|
150
|
+
getTestPlan(testPlanKey: string): Promise<any>;
|
|
151
|
+
/**
|
|
152
|
+
* Search test plans using JQL and GraphQL
|
|
153
|
+
*/
|
|
154
|
+
searchTestPlans(jql: string, maxResults?: number): Promise<any>;
|
|
155
|
+
/**
|
|
156
|
+
* Get test plans for a project using GraphQL
|
|
157
|
+
*/
|
|
158
|
+
getTestPlansByProject(projectKey: string, maxResults?: number): Promise<any>;
|
|
159
|
+
/**
|
|
160
|
+
* Add tests to a test plan using GraphQL mutation
|
|
161
|
+
*/
|
|
162
|
+
addTestsToTestPlan(testPlanIssueId: string, testIssueIds: string[]): Promise<any>;
|
|
163
|
+
/**
|
|
164
|
+
* Remove tests from a test plan using GraphQL mutation
|
|
165
|
+
*/
|
|
166
|
+
removeTestsFromTestPlan(testPlanIssueId: string, testIssueIds: string[]): Promise<any>;
|
|
167
|
+
/**
|
|
168
|
+
* Create a new test set using GraphQL mutation
|
|
169
|
+
*/
|
|
170
|
+
createTestSet(testSet: TestSet): Promise<TestSetResponse>;
|
|
171
|
+
/**
|
|
172
|
+
* Get a test set by key using GraphQL
|
|
173
|
+
*/
|
|
174
|
+
getTestSet(testSetKey: string): Promise<any>;
|
|
175
|
+
/**
|
|
176
|
+
* Search test sets using JQL and GraphQL
|
|
177
|
+
*/
|
|
178
|
+
searchTestSets(jql: string, maxResults?: number): Promise<any>;
|
|
179
|
+
/**
|
|
180
|
+
* Get test sets for a project using GraphQL
|
|
181
|
+
*/
|
|
182
|
+
getTestSetsByProject(projectKey: string, maxResults?: number): Promise<any>;
|
|
183
|
+
/**
|
|
184
|
+
* Add tests to a test set using GraphQL mutation
|
|
185
|
+
*/
|
|
186
|
+
addTestsToTestSet(testSetIssueId: string, testIssueIds: string[]): Promise<any>;
|
|
187
|
+
/**
|
|
188
|
+
* Remove tests from a test set using GraphQL mutation
|
|
189
|
+
*/
|
|
190
|
+
removeTestsFromTestSet(testSetIssueId: string, testIssueIds: string[]): Promise<any>;
|
|
191
|
+
}
|