imperial-mcp-qase 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.
@@ -0,0 +1,343 @@
1
+ // Qase API TypeScript Types
2
+
3
+ // Common response wrapper
4
+ export interface QaseResponse<T> {
5
+ status: boolean;
6
+ result: T;
7
+ }
8
+
9
+ export interface QaseListResponse<T> {
10
+ status: boolean;
11
+ result: {
12
+ total: number;
13
+ filtered: number;
14
+ count: number;
15
+ entities: T[];
16
+ };
17
+ }
18
+
19
+ export interface QaseErrorResponse {
20
+ status: boolean;
21
+ errorMessage?: string;
22
+ errorFields?: Record<string, string[]>;
23
+ }
24
+
25
+ // Project Types
26
+ export interface Project {
27
+ title: string;
28
+ code: string;
29
+ counts: ProjectCounts;
30
+ }
31
+
32
+ export interface ProjectCounts {
33
+ cases: number;
34
+ suites: number;
35
+ milestones: number;
36
+ runs: {
37
+ total: number;
38
+ active: number;
39
+ };
40
+ defects: {
41
+ total: number;
42
+ open: number;
43
+ };
44
+ }
45
+
46
+ export interface ListProjectsFilters {
47
+ limit?: number;
48
+ offset?: number;
49
+ }
50
+
51
+ // Test Case Types
52
+ export interface TestCase {
53
+ id: number;
54
+ position: number;
55
+ title: string;
56
+ description: string | null;
57
+ preconditions: string | null;
58
+ postconditions: string | null;
59
+ severity: number;
60
+ priority: number;
61
+ type: number;
62
+ layer: number;
63
+ is_flaky: number;
64
+ behavior: number;
65
+ automation: number;
66
+ status: number;
67
+ milestone_id: number | null;
68
+ suite_id: number | null;
69
+ links: TestCaseLink[];
70
+ custom_fields: CustomField[];
71
+ attachments: Attachment[];
72
+ steps_type: string | null;
73
+ steps: TestStep[];
74
+ params: Record<string, string[]>;
75
+ tags: Tag[];
76
+ member_id: number;
77
+ author_id: number;
78
+ created_at: string;
79
+ updated_at: string | null;
80
+ }
81
+
82
+ export interface TestCaseLink {
83
+ title: string | null;
84
+ url: string;
85
+ }
86
+
87
+ export interface CustomField {
88
+ id: number;
89
+ value: string | number | string[] | null;
90
+ }
91
+
92
+ export interface Attachment {
93
+ hash: string;
94
+ file: string;
95
+ mime: string;
96
+ size: number;
97
+ extension: string;
98
+ full_path: string;
99
+ }
100
+
101
+ export interface TestStep {
102
+ position: number;
103
+ action: string;
104
+ expected_result: string | null;
105
+ data: string | null;
106
+ attachments: Attachment[];
107
+ }
108
+
109
+ export interface Tag {
110
+ id: number;
111
+ title: string;
112
+ }
113
+
114
+ export interface CreateTestCaseInput {
115
+ title: string;
116
+ description?: string;
117
+ preconditions?: string;
118
+ postconditions?: string;
119
+ severity?: number;
120
+ priority?: number;
121
+ type?: number;
122
+ layer?: number;
123
+ is_flaky?: number;
124
+ behavior?: number;
125
+ automation?: number;
126
+ status?: number;
127
+ milestone_id?: number;
128
+ suite_id?: number;
129
+ steps?: CreateTestStepInput[];
130
+ tags?: string[];
131
+ }
132
+
133
+ export interface CreateTestStepInput {
134
+ action: string;
135
+ expected_result?: string;
136
+ data?: string;
137
+ position?: number;
138
+ }
139
+
140
+ export interface UpdateTestCaseInput extends Partial<CreateTestCaseInput> {}
141
+
142
+ // Defect Types
143
+ export interface Defect {
144
+ id: number;
145
+ title: string;
146
+ actual_result: string;
147
+ severity: number;
148
+ status: string;
149
+ milestone_id: number | null;
150
+ custom_fields: CustomField[];
151
+ attachments: Attachment[];
152
+ resolved_at: string | null;
153
+ member_id: number;
154
+ external_data: string | null;
155
+ tags: Tag[];
156
+ created_at: string;
157
+ updated_at: string | null;
158
+ }
159
+
160
+ export interface CreateDefectInput {
161
+ title: string;
162
+ actual_result: string;
163
+ severity?: number;
164
+ milestone_id?: number;
165
+ attachments?: string[];
166
+ tags?: string[];
167
+ }
168
+
169
+ export interface UpdateDefectInput extends Partial<CreateDefectInput> {
170
+ status?: string;
171
+ }
172
+
173
+ // Test Run Types
174
+ export interface TestRun {
175
+ id: number;
176
+ title: string;
177
+ description: string | null;
178
+ status: number;
179
+ status_text: string;
180
+ start_time: string | null;
181
+ end_time: string | null;
182
+ public: boolean;
183
+ stats: TestRunStats;
184
+ time_spent: number;
185
+ environment_id: number | null;
186
+ milestone_id: number | null;
187
+ plan_id: number | null;
188
+ tags: Tag[];
189
+ cases: number[];
190
+ custom_fields: CustomField[];
191
+ }
192
+
193
+ export interface TestRunStats {
194
+ total: number;
195
+ untested: number;
196
+ passed: number;
197
+ failed: number;
198
+ blocked: number;
199
+ skipped: number;
200
+ retest: number;
201
+ in_progress: number;
202
+ invalid: number;
203
+ }
204
+
205
+ export interface CreateTestRunInput {
206
+ title: string;
207
+ description?: string;
208
+ environment_id?: number;
209
+ milestone_id?: number;
210
+ plan_id?: number;
211
+ cases?: number[];
212
+ is_autotest?: boolean;
213
+ tags?: string[];
214
+ }
215
+
216
+ // Test Result Types
217
+ export interface TestResult {
218
+ hash: string;
219
+ comment: string | null;
220
+ stacktrace: string | null;
221
+ run_id: number;
222
+ case_id: number;
223
+ steps: TestResultStep[];
224
+ status: string;
225
+ is_api_result: boolean;
226
+ time_spent_ms: number;
227
+ end_time: string;
228
+ attachments: Attachment[];
229
+ }
230
+
231
+ export interface TestResultStep {
232
+ position: number;
233
+ status: string;
234
+ comment: string | null;
235
+ attachments: Attachment[];
236
+ }
237
+
238
+ export interface CreateTestResultInput {
239
+ case_id: number;
240
+ status: "passed" | "failed" | "blocked" | "skipped" | "invalid";
241
+ time_ms?: number;
242
+ member_id?: number;
243
+ comment?: string;
244
+ stacktrace?: string;
245
+ defect?: boolean;
246
+ steps?: CreateTestResultStepInput[];
247
+ attachments?: string[];
248
+ }
249
+
250
+ export interface CreateTestResultStepInput {
251
+ position: number;
252
+ status: "passed" | "failed" | "blocked" | "skipped";
253
+ comment?: string;
254
+ attachments?: string[];
255
+ }
256
+
257
+ // API Filter Types
258
+ export interface ListCasesFilters {
259
+ limit?: number;
260
+ offset?: number;
261
+ search?: string;
262
+ milestone_id?: number;
263
+ suite_id?: number;
264
+ severity?: number[];
265
+ priority?: number[];
266
+ type?: number[];
267
+ behavior?: number[];
268
+ automation?: number[];
269
+ status?: number[];
270
+ }
271
+
272
+ export interface ListDefectsFilters {
273
+ limit?: number;
274
+ offset?: number;
275
+ status?: string;
276
+ severity?: number[];
277
+ }
278
+
279
+ export interface ListRunsFilters {
280
+ limit?: number;
281
+ offset?: number;
282
+ status?: string;
283
+ include?: string;
284
+ }
285
+
286
+ // Enums for reference
287
+ export const CaseSeverity = {
288
+ NOT_SET: 0,
289
+ BLOCKER: 1,
290
+ CRITICAL: 2,
291
+ MAJOR: 3,
292
+ NORMAL: 4,
293
+ MINOR: 5,
294
+ TRIVIAL: 6,
295
+ } as const;
296
+
297
+ export const CasePriority = {
298
+ NOT_SET: 0,
299
+ HIGH: 1,
300
+ MEDIUM: 2,
301
+ LOW: 3,
302
+ } as const;
303
+
304
+ export const CaseType = {
305
+ OTHER: 0,
306
+ FUNCTIONAL: 1,
307
+ SMOKE: 2,
308
+ REGRESSION: 3,
309
+ SECURITY: 4,
310
+ USABILITY: 5,
311
+ PERFORMANCE: 6,
312
+ ACCEPTANCE: 7,
313
+ COMPATIBILITY: 8,
314
+ INTEGRATION: 9,
315
+ EXPLORATORY: 10,
316
+ } as const;
317
+
318
+ export const CaseAutomation = {
319
+ NOT_AUTOMATED: 0,
320
+ TO_BE_AUTOMATED: 1,
321
+ AUTOMATED: 2,
322
+ } as const;
323
+
324
+ export const DefectStatus = {
325
+ OPEN: "open",
326
+ RESOLVED: "resolved",
327
+ IN_PROGRESS: "in_progress",
328
+ INVALID: "invalid",
329
+ } as const;
330
+
331
+ export const RunStatus = {
332
+ ACTIVE: 0,
333
+ COMPLETE: 1,
334
+ ABORT: 2,
335
+ } as const;
336
+
337
+ export const ResultStatus = {
338
+ PASSED: "passed",
339
+ FAILED: "failed",
340
+ BLOCKED: "blocked",
341
+ SKIPPED: "skipped",
342
+ INVALID: "invalid",
343
+ } as const;
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "outDir": "./dist",
11
+ "rootDir": "./src",
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "sourceMap": true,
15
+ "resolveJsonModule": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "noImplicitReturns": true,
18
+ "noFallthroughCasesInSwitch": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true
21
+ },
22
+ "include": ["src/**/*"],
23
+ "exclude": ["node_modules", "dist"]
24
+ }