@dichovsky/testrail-api-client 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 +21 -0
- package/README.md +537 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +268 -0
- package/dist/client-core.d.ts +103 -0
- package/dist/client-core.js +601 -0
- package/dist/client.d.ts +652 -0
- package/dist/client.js +1106 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +14 -0
- package/dist/errors.d.ts +20 -0
- package/dist/errors.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +762 -0
- package/dist/types.js +2 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +13 -0
- package/package.json +76 -0
- package/src/cli.ts +287 -0
- package/src/client-core.ts +761 -0
- package/src/client.ts +1338 -0
- package/src/constants.ts +15 -0
- package/src/errors.ts +28 -0
- package/src/index.ts +74 -0
- package/src/types.ts +853 -0
- package/src/utils.ts +15 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import type { Case, Suite, Section, Project, Plan, Run, Test, Result, Milestone, User, Status, Priority, AddCasePayload, UpdateCasePayload, AddSuitePayload, UpdateSuitePayload, AddPlanPayload, UpdatePlanPayload, AddPlanEntryPayload, UpdatePlanEntryPayload, PlanEntry, AddRunPayload, UpdateRunPayload, AddResultPayload, AddResultsForCasesPayload, AddSectionPayload, UpdateSectionPayload, AddMilestonePayload, UpdateMilestonePayload, AddProjectPayload, UpdateProjectPayload, GetPlansOptions, GetTestsOptions, GetResultsOptions, GetMilestonesOptions, GetRunsOptions, GetCasesOptions, ResultField, CaseField, CaseType, Template, ConfigurationGroup, Configuration, AddConfigurationGroupPayload, UpdateConfigurationGroupPayload, AddConfigurationPayload, UpdateConfigurationPayload, AddUserPayload, UpdateUserPayload, Role, Group, AddGroupPayload, UpdateGroupPayload, Attachment, SharedStep, AddSharedStepPayload, UpdateSharedStepPayload, Variable, AddVariablePayload, UpdateVariablePayload, Dataset, AddDatasetPayload, UpdateDatasetPayload, Report, ReportResult } from './types.js';
|
|
2
|
+
import { TestRailClientCore } from './client-core.js';
|
|
3
|
+
export { TestRailApiError, TestRailValidationError } from './errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* TestRail API Client
|
|
6
|
+
*
|
|
7
|
+
* Type-safe client covering Projects, Suites, Sections, Cases, Plans, Runs,
|
|
8
|
+
* Tests, Results, Milestones, Users, Statuses, and Priorities.
|
|
9
|
+
* Extends {@link TestRailClientCore} for HTTP pipeline, caching, rate limiting, and retry.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TestRailClient extends TestRailClientCore {
|
|
12
|
+
/**
|
|
13
|
+
* Get a project by ID.
|
|
14
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
15
|
+
* @throws {TestRailApiError} When the API request fails
|
|
16
|
+
*/
|
|
17
|
+
getProject(projectId: number): Promise<Project>;
|
|
18
|
+
/**
|
|
19
|
+
* Get all projects.
|
|
20
|
+
* @throws {TestRailValidationError} When limit or offset is invalid
|
|
21
|
+
* @throws {TestRailApiError} When the API request fails
|
|
22
|
+
*/
|
|
23
|
+
getProjects(limit?: number, offset?: number): Promise<Project[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Add a new project.
|
|
26
|
+
* @throws {TestRailApiError} When the API request fails
|
|
27
|
+
*/
|
|
28
|
+
addProject(payload: AddProjectPayload): Promise<Project>;
|
|
29
|
+
/**
|
|
30
|
+
* Update an existing project.
|
|
31
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
32
|
+
* @throws {TestRailApiError} When the API request fails
|
|
33
|
+
*/
|
|
34
|
+
updateProject(projectId: number, payload: UpdateProjectPayload): Promise<Project>;
|
|
35
|
+
/**
|
|
36
|
+
* Delete a project.
|
|
37
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
38
|
+
* @throws {TestRailApiError} When the API request fails
|
|
39
|
+
*/
|
|
40
|
+
deleteProject(projectId: number): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Get a suite by ID.
|
|
43
|
+
* @throws {TestRailValidationError} When suiteId is invalid
|
|
44
|
+
* @throws {TestRailApiError} When the API request fails
|
|
45
|
+
*/
|
|
46
|
+
getSuite(suiteId: number): Promise<Suite>;
|
|
47
|
+
/**
|
|
48
|
+
* Get all suites for a project.
|
|
49
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
50
|
+
* @throws {TestRailApiError} When the API request fails
|
|
51
|
+
*/
|
|
52
|
+
getSuites(projectId: number): Promise<Suite[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Add a suite to a project.
|
|
55
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
56
|
+
* @throws {TestRailApiError} When the API request fails
|
|
57
|
+
*/
|
|
58
|
+
addSuite(projectId: number, payload: AddSuitePayload): Promise<Suite>;
|
|
59
|
+
/**
|
|
60
|
+
* Update a suite.
|
|
61
|
+
* @throws {TestRailValidationError} When suiteId is invalid
|
|
62
|
+
* @throws {TestRailApiError} When the API request fails
|
|
63
|
+
*/
|
|
64
|
+
updateSuite(suiteId: number, payload: UpdateSuitePayload): Promise<Suite>;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a suite.
|
|
67
|
+
* @throws {TestRailValidationError} When suiteId is invalid
|
|
68
|
+
* @throws {TestRailApiError} When the API request fails
|
|
69
|
+
*/
|
|
70
|
+
deleteSuite(suiteId: number): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Get a section by ID.
|
|
73
|
+
* @throws {TestRailValidationError} When sectionId is invalid
|
|
74
|
+
* @throws {TestRailApiError} When the API request fails
|
|
75
|
+
*/
|
|
76
|
+
getSection(sectionId: number): Promise<Section>;
|
|
77
|
+
/**
|
|
78
|
+
* Get all sections for a project, optionally filtered by suite.
|
|
79
|
+
* @param options.suiteId - Optional suite filter
|
|
80
|
+
* @param options.limit - Optional maximum number of results to return
|
|
81
|
+
* @param options.offset - Optional number of results to skip
|
|
82
|
+
* @throws {TestRailValidationError} When projectId or suiteId is invalid
|
|
83
|
+
* @throws {TestRailApiError} When the API request fails
|
|
84
|
+
*/
|
|
85
|
+
getSections(projectId: number, options?: {
|
|
86
|
+
suiteId?: number;
|
|
87
|
+
limit?: number;
|
|
88
|
+
offset?: number;
|
|
89
|
+
}): Promise<Section[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Add a new section to a project.
|
|
92
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
93
|
+
* @throws {TestRailApiError} When the API request fails
|
|
94
|
+
*/
|
|
95
|
+
addSection(projectId: number, payload: AddSectionPayload): Promise<Section>;
|
|
96
|
+
/**
|
|
97
|
+
* Update an existing section.
|
|
98
|
+
* @throws {TestRailValidationError} When sectionId is invalid
|
|
99
|
+
* @throws {TestRailApiError} When the API request fails
|
|
100
|
+
*/
|
|
101
|
+
updateSection(sectionId: number, payload: UpdateSectionPayload): Promise<Section>;
|
|
102
|
+
/**
|
|
103
|
+
* Delete a section.
|
|
104
|
+
* @throws {TestRailValidationError} When sectionId is invalid
|
|
105
|
+
* @throws {TestRailApiError} When the API request fails
|
|
106
|
+
*/
|
|
107
|
+
deleteSection(sectionId: number): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Get a case by ID.
|
|
110
|
+
* @throws {TestRailValidationError} When caseId is invalid
|
|
111
|
+
* @throws {TestRailApiError} When the API request fails
|
|
112
|
+
*/
|
|
113
|
+
getCase(caseId: number): Promise<Case>;
|
|
114
|
+
/**
|
|
115
|
+
* Get all cases for a project with optional filters.
|
|
116
|
+
* @param options.suiteId - Return only cases in this suite
|
|
117
|
+
* @param options.sectionId - Return only cases in this section
|
|
118
|
+
* @param options.typeId - Return only cases of this type
|
|
119
|
+
* @param options.priorityId - Return only cases with this priority
|
|
120
|
+
* @param options.templateId - Return only cases using this template
|
|
121
|
+
* @param options.milestoneId - Return only cases linked to this milestone
|
|
122
|
+
* @param options.createdAfter - Return only cases created after this Unix timestamp
|
|
123
|
+
* @param options.createdBefore - Return only cases created before this Unix timestamp
|
|
124
|
+
* @param options.updatedAfter - Return only cases updated after this Unix timestamp
|
|
125
|
+
* @param options.updatedBefore - Return only cases updated before this Unix timestamp
|
|
126
|
+
* @param options.limit - Maximum number of cases to return
|
|
127
|
+
* @param options.offset - Pagination offset
|
|
128
|
+
* @throws {TestRailValidationError} When any provided ID is invalid
|
|
129
|
+
* @throws {TestRailApiError} When the API request fails
|
|
130
|
+
*/
|
|
131
|
+
getCases(projectId: number, options?: GetCasesOptions): Promise<Case[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Add a new case to a section.
|
|
134
|
+
* @throws {TestRailValidationError} When sectionId is invalid
|
|
135
|
+
* @throws {TestRailApiError} When the API request fails
|
|
136
|
+
*/
|
|
137
|
+
addCase(sectionId: number, payload: AddCasePayload): Promise<Case>;
|
|
138
|
+
/**
|
|
139
|
+
* Update an existing case.
|
|
140
|
+
* @throws {TestRailValidationError} When caseId is invalid
|
|
141
|
+
* @throws {TestRailApiError} When the API request fails
|
|
142
|
+
*/
|
|
143
|
+
updateCase(caseId: number, payload: UpdateCasePayload): Promise<Case>;
|
|
144
|
+
/**
|
|
145
|
+
* Delete a case.
|
|
146
|
+
* @throws {TestRailValidationError} When caseId is invalid
|
|
147
|
+
* @throws {TestRailApiError} When the API request fails
|
|
148
|
+
*/
|
|
149
|
+
deleteCase(caseId: number): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Get a plan by ID.
|
|
152
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
153
|
+
* @throws {TestRailApiError} When the API request fails
|
|
154
|
+
*/
|
|
155
|
+
getPlan(planId: number): Promise<Plan>;
|
|
156
|
+
/**
|
|
157
|
+
* Get all plans for a project with optional filters.
|
|
158
|
+
* @param projectId - The project ID
|
|
159
|
+
* @param options - Optional filter parameters (created_after, created_before, created_by,
|
|
160
|
+
* is_completed, milestone_id, limit, offset)
|
|
161
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
162
|
+
* @throws {TestRailApiError} When the API request fails
|
|
163
|
+
*/
|
|
164
|
+
getPlans(projectId: number, options?: GetPlansOptions): Promise<Plan[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Add a new plan to a project.
|
|
167
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
168
|
+
* @throws {TestRailApiError} When the API request fails
|
|
169
|
+
*/
|
|
170
|
+
addPlan(projectId: number, payload: AddPlanPayload): Promise<Plan>;
|
|
171
|
+
/**
|
|
172
|
+
* Update a plan.
|
|
173
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
174
|
+
* @throws {TestRailApiError} When the API request fails
|
|
175
|
+
*/
|
|
176
|
+
updatePlan(planId: number, payload: UpdatePlanPayload): Promise<Plan>;
|
|
177
|
+
/**
|
|
178
|
+
* Close a plan.
|
|
179
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
180
|
+
* @throws {TestRailApiError} When the API request fails
|
|
181
|
+
*/
|
|
182
|
+
closePlan(planId: number): Promise<Plan>;
|
|
183
|
+
/**
|
|
184
|
+
* Delete a plan.
|
|
185
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
186
|
+
* @throws {TestRailApiError} When the API request fails
|
|
187
|
+
*/
|
|
188
|
+
deletePlan(planId: number): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Add a plan entry (run) to a plan.
|
|
191
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
192
|
+
* @throws {TestRailApiError} When the API request fails
|
|
193
|
+
*/
|
|
194
|
+
addPlanEntry(planId: number, payload: AddPlanEntryPayload): Promise<PlanEntry>;
|
|
195
|
+
/**
|
|
196
|
+
* Update an existing plan entry.
|
|
197
|
+
* @throws {TestRailValidationError} When planId is invalid or entryId is not a non-empty string
|
|
198
|
+
* @throws {TestRailApiError} When the API request fails
|
|
199
|
+
*/
|
|
200
|
+
updatePlanEntry(planId: number, entryId: string, payload: UpdatePlanEntryPayload): Promise<PlanEntry>;
|
|
201
|
+
/**
|
|
202
|
+
* Delete a plan entry.
|
|
203
|
+
* @throws {TestRailValidationError} When planId is invalid or entryId is not a non-empty string
|
|
204
|
+
* @throws {TestRailApiError} When the API request fails
|
|
205
|
+
*/
|
|
206
|
+
deletePlanEntry(planId: number, entryId: string): Promise<void>;
|
|
207
|
+
/**
|
|
208
|
+
* Get a run by ID.
|
|
209
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
210
|
+
* @throws {TestRailApiError} When the API request fails
|
|
211
|
+
*/
|
|
212
|
+
getRun(runId: number): Promise<Run>;
|
|
213
|
+
/**
|
|
214
|
+
* Get all runs for a project, with optional filters.
|
|
215
|
+
* @param projectId - The project ID
|
|
216
|
+
* @param options - Optional filters: createdAfter, createdBefore, createdBy, isCompleted,
|
|
217
|
+
* milestoneId, refsFilter, suiteId, limit, offset
|
|
218
|
+
* @throws {TestRailValidationError} When projectId or pagination params are invalid
|
|
219
|
+
* @throws {TestRailApiError} When the API request fails
|
|
220
|
+
*/
|
|
221
|
+
getRuns(projectId: number, options?: GetRunsOptions): Promise<Run[]>;
|
|
222
|
+
/**
|
|
223
|
+
* Add a new run to a project.
|
|
224
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
225
|
+
* @throws {TestRailApiError} When the API request fails
|
|
226
|
+
*/
|
|
227
|
+
addRun(projectId: number, payload: AddRunPayload): Promise<Run>;
|
|
228
|
+
/**
|
|
229
|
+
* Update a run.
|
|
230
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
231
|
+
* @throws {TestRailApiError} When the API request fails
|
|
232
|
+
*/
|
|
233
|
+
updateRun(runId: number, payload: UpdateRunPayload): Promise<Run>;
|
|
234
|
+
/**
|
|
235
|
+
* Close a run.
|
|
236
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
237
|
+
* @throws {TestRailApiError} When the API request fails
|
|
238
|
+
*/
|
|
239
|
+
closeRun(runId: number): Promise<Run>;
|
|
240
|
+
/**
|
|
241
|
+
* Delete a run.
|
|
242
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
243
|
+
* @throws {TestRailApiError} When the API request fails
|
|
244
|
+
*/
|
|
245
|
+
deleteRun(runId: number): Promise<void>;
|
|
246
|
+
/**
|
|
247
|
+
* Get a test by ID.
|
|
248
|
+
* @throws {TestRailValidationError} When testId is invalid
|
|
249
|
+
* @throws {TestRailApiError} When the API request fails
|
|
250
|
+
*/
|
|
251
|
+
getTest(testId: number): Promise<Test>;
|
|
252
|
+
/**
|
|
253
|
+
* Get all tests for a run with optional filters.
|
|
254
|
+
* @param runId - The run ID
|
|
255
|
+
* @param options - Optional filter parameters (status_id, limit, offset)
|
|
256
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
257
|
+
* @throws {TestRailApiError} When the API request fails
|
|
258
|
+
*/
|
|
259
|
+
getTests(runId: number, options?: GetTestsOptions): Promise<Test[]>;
|
|
260
|
+
/**
|
|
261
|
+
* Get results for a test with optional filters.
|
|
262
|
+
* @param testId - The test ID
|
|
263
|
+
* @param options - Optional filter parameters (created_after, created_before, created_by,
|
|
264
|
+
* status_id, limit, offset)
|
|
265
|
+
* @throws {TestRailValidationError} When testId is invalid
|
|
266
|
+
* @throws {TestRailApiError} When the API request fails
|
|
267
|
+
*/
|
|
268
|
+
getResults(testId: number, options?: GetResultsOptions): Promise<Result[]>;
|
|
269
|
+
/**
|
|
270
|
+
* Get results for a specific case within a run with optional filters.
|
|
271
|
+
* @param runId - The run ID
|
|
272
|
+
* @param caseId - The case ID
|
|
273
|
+
* @param options - Optional filter parameters (created_after, created_before, created_by,
|
|
274
|
+
* status_id, limit, offset)
|
|
275
|
+
* @throws {TestRailValidationError} When runId or caseId is invalid
|
|
276
|
+
* @throws {TestRailApiError} When the API request fails
|
|
277
|
+
*/
|
|
278
|
+
getResultsForCase(runId: number, caseId: number, options?: GetResultsOptions): Promise<Result[]>;
|
|
279
|
+
/**
|
|
280
|
+
* Get all results for a run with optional filters.
|
|
281
|
+
* @param runId - The run ID
|
|
282
|
+
* @param options - Optional filter parameters (created_after, created_before, created_by,
|
|
283
|
+
* status_id, limit, offset)
|
|
284
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
285
|
+
* @throws {TestRailApiError} When the API request fails
|
|
286
|
+
*/
|
|
287
|
+
getResultsForRun(runId: number, options?: GetResultsOptions): Promise<Result[]>;
|
|
288
|
+
/**
|
|
289
|
+
* Add a result for a test.
|
|
290
|
+
* @throws {TestRailValidationError} When testId is invalid
|
|
291
|
+
* @throws {TestRailApiError} When the API request fails
|
|
292
|
+
*/
|
|
293
|
+
addResult(testId: number, payload: AddResultPayload): Promise<Result>;
|
|
294
|
+
/**
|
|
295
|
+
* Add a result for a specific case within a run.
|
|
296
|
+
* @throws {TestRailValidationError} When runId or caseId is invalid
|
|
297
|
+
* @throws {TestRailApiError} When the API request fails
|
|
298
|
+
*/
|
|
299
|
+
addResultForCase(runId: number, caseId: number, payload: AddResultPayload): Promise<Result>;
|
|
300
|
+
/**
|
|
301
|
+
* Add multiple results for cases in a run.
|
|
302
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
303
|
+
* @throws {TestRailApiError} When the API request fails
|
|
304
|
+
*/
|
|
305
|
+
addResultsForCases(runId: number, payload: AddResultsForCasesPayload): Promise<Result[]>;
|
|
306
|
+
/**
|
|
307
|
+
* Get a milestone by ID.
|
|
308
|
+
* @throws {TestRailValidationError} When milestoneId is invalid
|
|
309
|
+
* @throws {TestRailApiError} When the API request fails
|
|
310
|
+
*/
|
|
311
|
+
getMilestone(milestoneId: number): Promise<Milestone>;
|
|
312
|
+
/**
|
|
313
|
+
* Get all milestones for a project with optional filters.
|
|
314
|
+
* @param projectId - The project ID
|
|
315
|
+
* @param options - Optional filter parameters (is_completed, limit, offset)
|
|
316
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
317
|
+
* @throws {TestRailApiError} When the API request fails
|
|
318
|
+
*/
|
|
319
|
+
getMilestones(projectId: number, options?: GetMilestonesOptions): Promise<Milestone[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Add a new milestone to a project.
|
|
322
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
323
|
+
* @throws {TestRailApiError} When the API request fails
|
|
324
|
+
*/
|
|
325
|
+
addMilestone(projectId: number, payload: AddMilestonePayload): Promise<Milestone>;
|
|
326
|
+
/**
|
|
327
|
+
* Update an existing milestone.
|
|
328
|
+
* @throws {TestRailValidationError} When milestoneId is invalid
|
|
329
|
+
* @throws {TestRailApiError} When the API request fails
|
|
330
|
+
*/
|
|
331
|
+
updateMilestone(milestoneId: number, payload: UpdateMilestonePayload): Promise<Milestone>;
|
|
332
|
+
/**
|
|
333
|
+
* Delete a milestone.
|
|
334
|
+
* @throws {TestRailValidationError} When milestoneId is invalid
|
|
335
|
+
* @throws {TestRailApiError} When the API request fails
|
|
336
|
+
*/
|
|
337
|
+
deleteMilestone(milestoneId: number): Promise<void>;
|
|
338
|
+
/**
|
|
339
|
+
* Get a user by ID.
|
|
340
|
+
* @throws {TestRailValidationError} When userId is invalid
|
|
341
|
+
* @throws {TestRailApiError} When the API request fails
|
|
342
|
+
*/
|
|
343
|
+
getUser(userId: number): Promise<User>;
|
|
344
|
+
/**
|
|
345
|
+
* Get a user by email address.
|
|
346
|
+
* @throws {TestRailValidationError} When email format is invalid
|
|
347
|
+
* @throws {TestRailApiError} When the API request fails
|
|
348
|
+
*/
|
|
349
|
+
getUserByEmail(email: string): Promise<User>;
|
|
350
|
+
/**
|
|
351
|
+
* Get all users, optionally scoped to a project.
|
|
352
|
+
* @param limit - Maximum number of users to return
|
|
353
|
+
* @param offset - Number of users to skip
|
|
354
|
+
* @param projectId - When provided, returns only users with access to the specified project
|
|
355
|
+
* @throws {TestRailValidationError} When pagination or projectId is invalid
|
|
356
|
+
* @throws {TestRailApiError} When the API request fails
|
|
357
|
+
*/
|
|
358
|
+
getUsers(limit?: number, offset?: number, projectId?: number): Promise<User[]>;
|
|
359
|
+
/**
|
|
360
|
+
* Get the currently authenticated user.
|
|
361
|
+
* @throws {TestRailApiError} When the API request fails
|
|
362
|
+
*/
|
|
363
|
+
getCurrentUser(): Promise<User>;
|
|
364
|
+
/**
|
|
365
|
+
* Get all test statuses.
|
|
366
|
+
* @throws {TestRailApiError} When the API request fails
|
|
367
|
+
*/
|
|
368
|
+
getStatuses(): Promise<Status[]>;
|
|
369
|
+
/**
|
|
370
|
+
* Get all case priorities.
|
|
371
|
+
* @throws {TestRailApiError} When the API request fails
|
|
372
|
+
*/
|
|
373
|
+
getPriorities(): Promise<Priority[]>;
|
|
374
|
+
/**
|
|
375
|
+
* Get all available custom result fields.
|
|
376
|
+
* @throws {TestRailApiError} When the API request fails
|
|
377
|
+
*/
|
|
378
|
+
getResultFields(): Promise<ResultField[]>;
|
|
379
|
+
/**
|
|
380
|
+
* Get all available custom case fields.
|
|
381
|
+
* @throws {TestRailApiError} When the API request fails
|
|
382
|
+
*/
|
|
383
|
+
getCaseFields(): Promise<CaseField[]>;
|
|
384
|
+
/**
|
|
385
|
+
* Get all available case types.
|
|
386
|
+
* @throws {TestRailApiError} When the API request fails
|
|
387
|
+
*/
|
|
388
|
+
getCaseTypes(): Promise<CaseType[]>;
|
|
389
|
+
/**
|
|
390
|
+
* Get all available case templates for a project (requires TestRail 5.2+).
|
|
391
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
392
|
+
* @throws {TestRailApiError} When the API request fails
|
|
393
|
+
*/
|
|
394
|
+
getTemplates(projectId: number): Promise<Template[]>;
|
|
395
|
+
/**
|
|
396
|
+
* Get all configuration groups and their configurations for a project.
|
|
397
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
398
|
+
* @throws {TestRailApiError} When the API request fails
|
|
399
|
+
*/
|
|
400
|
+
getConfigurations(projectId: number): Promise<ConfigurationGroup[]>;
|
|
401
|
+
/**
|
|
402
|
+
* Add a new configuration group to a project.
|
|
403
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
404
|
+
* @throws {TestRailApiError} When the API request fails
|
|
405
|
+
*/
|
|
406
|
+
addConfigurationGroup(projectId: number, payload: AddConfigurationGroupPayload): Promise<ConfigurationGroup>;
|
|
407
|
+
/**
|
|
408
|
+
* Update an existing configuration group.
|
|
409
|
+
* @throws {TestRailValidationError} When configGroupId is invalid
|
|
410
|
+
* @throws {TestRailApiError} When the API request fails
|
|
411
|
+
*/
|
|
412
|
+
updateConfigurationGroup(configGroupId: number, payload: UpdateConfigurationGroupPayload): Promise<ConfigurationGroup>;
|
|
413
|
+
/**
|
|
414
|
+
* Delete an existing configuration group and all its configurations.
|
|
415
|
+
* @throws {TestRailValidationError} When configGroupId is invalid
|
|
416
|
+
* @throws {TestRailApiError} When the API request fails
|
|
417
|
+
*/
|
|
418
|
+
deleteConfigurationGroup(configGroupId: number): Promise<void>;
|
|
419
|
+
/**
|
|
420
|
+
* Add a new configuration to a configuration group.
|
|
421
|
+
* @throws {TestRailValidationError} When configGroupId is invalid
|
|
422
|
+
* @throws {TestRailApiError} When the API request fails
|
|
423
|
+
*/
|
|
424
|
+
addConfiguration(configGroupId: number, payload: AddConfigurationPayload): Promise<Configuration>;
|
|
425
|
+
/**
|
|
426
|
+
* Update an existing configuration.
|
|
427
|
+
* @throws {TestRailValidationError} When configId is invalid
|
|
428
|
+
* @throws {TestRailApiError} When the API request fails
|
|
429
|
+
*/
|
|
430
|
+
updateConfiguration(configId: number, payload: UpdateConfigurationPayload): Promise<Configuration>;
|
|
431
|
+
/**
|
|
432
|
+
* Delete an existing configuration.
|
|
433
|
+
* @throws {TestRailValidationError} When configId is invalid
|
|
434
|
+
* @throws {TestRailApiError} When the API request fails
|
|
435
|
+
*/
|
|
436
|
+
deleteConfiguration(configId: number): Promise<void>;
|
|
437
|
+
/**
|
|
438
|
+
* Create a new TestRail user (requires TestRail 7.3+).
|
|
439
|
+
* @throws {TestRailApiError} When the API request fails
|
|
440
|
+
*/
|
|
441
|
+
addUser(payload: AddUserPayload): Promise<User>;
|
|
442
|
+
/**
|
|
443
|
+
* Update an existing TestRail user (requires TestRail 7.3+).
|
|
444
|
+
* @throws {TestRailValidationError} When userId is invalid
|
|
445
|
+
* @throws {TestRailApiError} When the API request fails
|
|
446
|
+
*/
|
|
447
|
+
updateUser(userId: number, payload: UpdateUserPayload): Promise<User>;
|
|
448
|
+
/**
|
|
449
|
+
* Get all available user roles (requires TestRail 7.3+).
|
|
450
|
+
* @throws {TestRailApiError} When the API request fails
|
|
451
|
+
*/
|
|
452
|
+
getRoles(): Promise<Role[]>;
|
|
453
|
+
/**
|
|
454
|
+
* Get a single group by ID (requires TestRail 7.5+).
|
|
455
|
+
* @throws {TestRailValidationError} When groupId is invalid
|
|
456
|
+
* @throws {TestRailApiError} When the API request fails
|
|
457
|
+
*/
|
|
458
|
+
getGroup(groupId: number): Promise<Group>;
|
|
459
|
+
/**
|
|
460
|
+
* Get all groups (requires TestRail 7.5+).
|
|
461
|
+
* @throws {TestRailApiError} When the API request fails
|
|
462
|
+
*/
|
|
463
|
+
getGroups(): Promise<Group[]>;
|
|
464
|
+
/**
|
|
465
|
+
* Create a new group (requires TestRail 7.5+).
|
|
466
|
+
* @throws {TestRailApiError} When the API request fails
|
|
467
|
+
*/
|
|
468
|
+
addGroup(payload: AddGroupPayload): Promise<Group>;
|
|
469
|
+
/**
|
|
470
|
+
* Update an existing group (requires TestRail 7.5+).
|
|
471
|
+
* @throws {TestRailValidationError} When groupId is invalid
|
|
472
|
+
* @throws {TestRailApiError} When the API request fails
|
|
473
|
+
*/
|
|
474
|
+
updateGroup(groupId: number, payload: UpdateGroupPayload): Promise<Group>;
|
|
475
|
+
/**
|
|
476
|
+
* Delete a group (requires TestRail 7.5+).
|
|
477
|
+
* @throws {TestRailValidationError} When groupId is invalid
|
|
478
|
+
* @throws {TestRailApiError} When the API request fails
|
|
479
|
+
*/
|
|
480
|
+
deleteGroup(groupId: number): Promise<void>;
|
|
481
|
+
/**
|
|
482
|
+
* Get all attachments for a test case.
|
|
483
|
+
* @throws {TestRailValidationError} When caseId is invalid
|
|
484
|
+
* @throws {TestRailApiError} When the API request fails
|
|
485
|
+
*/
|
|
486
|
+
getAttachmentsForCase(caseId: number): Promise<Attachment[]>;
|
|
487
|
+
/**
|
|
488
|
+
* Get all attachments for a test run.
|
|
489
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
490
|
+
* @throws {TestRailApiError} When the API request fails
|
|
491
|
+
*/
|
|
492
|
+
getAttachmentsForRun(runId: number): Promise<Attachment[]>;
|
|
493
|
+
/**
|
|
494
|
+
* Get all attachments for a test.
|
|
495
|
+
* @throws {TestRailValidationError} When testId is invalid
|
|
496
|
+
* @throws {TestRailApiError} When the API request fails
|
|
497
|
+
*/
|
|
498
|
+
getAttachmentsForTest(testId: number): Promise<Attachment[]>;
|
|
499
|
+
/**
|
|
500
|
+
* Get all attachments for a test plan.
|
|
501
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
502
|
+
* @throws {TestRailApiError} When the API request fails
|
|
503
|
+
*/
|
|
504
|
+
getAttachmentsForPlan(planId: number): Promise<Attachment[]>;
|
|
505
|
+
/**
|
|
506
|
+
* Get all attachments for a specific plan entry.
|
|
507
|
+
* @throws {TestRailValidationError} When planId or entryId is invalid
|
|
508
|
+
* @throws {TestRailApiError} When the API request fails
|
|
509
|
+
*/
|
|
510
|
+
getAttachmentsForPlanEntry(planId: number, entryId: number): Promise<Attachment[]>;
|
|
511
|
+
/**
|
|
512
|
+
* Download the raw binary content of an attachment.
|
|
513
|
+
* @param attachmentId - The attachment ID (numeric)
|
|
514
|
+
* @throws {TestRailValidationError} When attachmentId is invalid
|
|
515
|
+
* @throws {TestRailApiError} When the API request fails
|
|
516
|
+
*/
|
|
517
|
+
getAttachment(attachmentId: number): Promise<ArrayBuffer>;
|
|
518
|
+
/**
|
|
519
|
+
* Upload a file attachment to a test case.
|
|
520
|
+
* @throws {TestRailValidationError} When caseId is invalid
|
|
521
|
+
* @throws {TestRailApiError} When the API request fails
|
|
522
|
+
*/
|
|
523
|
+
addAttachmentToCase(caseId: number, file: globalThis.Blob | Uint8Array | globalThis.File, filename: string): Promise<Attachment>;
|
|
524
|
+
/**
|
|
525
|
+
* Upload a file attachment to a test result.
|
|
526
|
+
* @throws {TestRailValidationError} When resultId is invalid
|
|
527
|
+
* @throws {TestRailApiError} When the API request fails
|
|
528
|
+
*/
|
|
529
|
+
addAttachmentToResult(resultId: number, file: globalThis.Blob | Uint8Array | globalThis.File, filename: string): Promise<Attachment>;
|
|
530
|
+
/**
|
|
531
|
+
* Upload a file attachment to a test run.
|
|
532
|
+
* @throws {TestRailValidationError} When runId is invalid
|
|
533
|
+
* @throws {TestRailApiError} When the API request fails
|
|
534
|
+
*/
|
|
535
|
+
addAttachmentToRun(runId: number, file: globalThis.Blob | Uint8Array | globalThis.File, filename: string): Promise<Attachment>;
|
|
536
|
+
/**
|
|
537
|
+
* Upload a file attachment to a test plan (requires TestRail 6.5.2+).
|
|
538
|
+
* @throws {TestRailValidationError} When planId is invalid
|
|
539
|
+
* @throws {TestRailApiError} When the API request fails
|
|
540
|
+
*/
|
|
541
|
+
addAttachmentToPlan(planId: number, file: globalThis.Blob | Uint8Array | globalThis.File, filename: string): Promise<Attachment>;
|
|
542
|
+
/**
|
|
543
|
+
* Upload a file attachment to a specific plan entry (requires TestRail 6.5.2+).
|
|
544
|
+
* @throws {TestRailValidationError} When planId or entryId is invalid
|
|
545
|
+
* @throws {TestRailApiError} When the API request fails
|
|
546
|
+
*/
|
|
547
|
+
addAttachmentToPlanEntry(planId: number, entryId: number, file: globalThis.Blob | Uint8Array | globalThis.File, filename: string): Promise<Attachment>;
|
|
548
|
+
/**
|
|
549
|
+
* Delete an attachment by ID.
|
|
550
|
+
* @throws {TestRailValidationError} When attachmentId is invalid
|
|
551
|
+
* @throws {TestRailApiError} When the API request fails
|
|
552
|
+
*/
|
|
553
|
+
deleteAttachment(attachmentId: number): Promise<void>;
|
|
554
|
+
/**
|
|
555
|
+
* Get a single shared step by ID (requires TestRail 7.0+).
|
|
556
|
+
* @throws {TestRailValidationError} When sharedStepId is invalid
|
|
557
|
+
* @throws {TestRailApiError} When the API request fails
|
|
558
|
+
*/
|
|
559
|
+
getSharedStep(sharedStepId: number): Promise<SharedStep>;
|
|
560
|
+
/**
|
|
561
|
+
* Get all shared steps for a project (requires TestRail 7.0+).
|
|
562
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
563
|
+
* @throws {TestRailApiError} When the API request fails
|
|
564
|
+
*/
|
|
565
|
+
getSharedSteps(projectId: number): Promise<SharedStep[]>;
|
|
566
|
+
/**
|
|
567
|
+
* Create a new shared step in a project (requires TestRail 7.0+).
|
|
568
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
569
|
+
* @throws {TestRailApiError} When the API request fails
|
|
570
|
+
*/
|
|
571
|
+
addSharedStep(projectId: number, payload: AddSharedStepPayload): Promise<SharedStep>;
|
|
572
|
+
/**
|
|
573
|
+
* Update an existing shared step (requires TestRail 7.0+).
|
|
574
|
+
* @throws {TestRailValidationError} When sharedStepId is invalid
|
|
575
|
+
* @throws {TestRailApiError} When the API request fails
|
|
576
|
+
*/
|
|
577
|
+
updateSharedStep(sharedStepId: number, payload: UpdateSharedStepPayload): Promise<SharedStep>;
|
|
578
|
+
/**
|
|
579
|
+
* Delete a shared step (requires TestRail 7.0+).
|
|
580
|
+
* @throws {TestRailValidationError} When sharedStepId is invalid
|
|
581
|
+
* @throws {TestRailApiError} When the API request fails
|
|
582
|
+
*/
|
|
583
|
+
deleteSharedStep(sharedStepId: number): Promise<void>;
|
|
584
|
+
/**
|
|
585
|
+
* Get all variables for a project.
|
|
586
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
587
|
+
* @throws {TestRailApiError} When the API request fails
|
|
588
|
+
*/
|
|
589
|
+
getVariables(projectId: number): Promise<Variable[]>;
|
|
590
|
+
/**
|
|
591
|
+
* Create a new variable in a project.
|
|
592
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
593
|
+
* @throws {TestRailApiError} When the API request fails
|
|
594
|
+
*/
|
|
595
|
+
addVariable(projectId: number, payload: AddVariablePayload): Promise<Variable>;
|
|
596
|
+
/**
|
|
597
|
+
* Update an existing variable.
|
|
598
|
+
* @throws {TestRailValidationError} When variableId is invalid
|
|
599
|
+
* @throws {TestRailApiError} When the API request fails
|
|
600
|
+
*/
|
|
601
|
+
updateVariable(variableId: number, payload: UpdateVariablePayload): Promise<Variable>;
|
|
602
|
+
/**
|
|
603
|
+
* Delete a variable.
|
|
604
|
+
* @throws {TestRailValidationError} When variableId is invalid
|
|
605
|
+
* @throws {TestRailApiError} When the API request fails
|
|
606
|
+
*/
|
|
607
|
+
deleteVariable(variableId: number): Promise<void>;
|
|
608
|
+
/**
|
|
609
|
+
* Get a single dataset by ID.
|
|
610
|
+
* @throws {TestRailValidationError} When datasetId is invalid
|
|
611
|
+
* @throws {TestRailApiError} When the API request fails
|
|
612
|
+
*/
|
|
613
|
+
getDataset(datasetId: number): Promise<Dataset>;
|
|
614
|
+
/**
|
|
615
|
+
* Get all datasets for a project.
|
|
616
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
617
|
+
* @throws {TestRailApiError} When the API request fails
|
|
618
|
+
*/
|
|
619
|
+
getDatasets(projectId: number): Promise<Dataset[]>;
|
|
620
|
+
/**
|
|
621
|
+
* Create a new dataset in a project.
|
|
622
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
623
|
+
* @throws {TestRailApiError} When the API request fails
|
|
624
|
+
*/
|
|
625
|
+
addDataset(projectId: number, payload: AddDatasetPayload): Promise<Dataset>;
|
|
626
|
+
/**
|
|
627
|
+
* Update an existing dataset.
|
|
628
|
+
* @throws {TestRailValidationError} When datasetId is invalid
|
|
629
|
+
* @throws {TestRailApiError} When the API request fails
|
|
630
|
+
*/
|
|
631
|
+
updateDataset(datasetId: number, payload: UpdateDatasetPayload): Promise<Dataset>;
|
|
632
|
+
/**
|
|
633
|
+
* Delete a dataset.
|
|
634
|
+
* @throws {TestRailValidationError} When datasetId is invalid
|
|
635
|
+
* @throws {TestRailApiError} When the API request fails
|
|
636
|
+
*/
|
|
637
|
+
deleteDataset(datasetId: number): Promise<void>;
|
|
638
|
+
/**
|
|
639
|
+
* Get all available report templates for a project.
|
|
640
|
+
* @throws {TestRailValidationError} When projectId is invalid
|
|
641
|
+
* @throws {TestRailApiError} When the API request fails
|
|
642
|
+
*/
|
|
643
|
+
getReports(projectId: number): Promise<Report[]>;
|
|
644
|
+
/**
|
|
645
|
+
* Execute a report template and return URLs to the generated output.
|
|
646
|
+
* @throws {TestRailValidationError} When reportTemplateId is invalid
|
|
647
|
+
* @throws {TestRailApiError} When the API request fails
|
|
648
|
+
*/
|
|
649
|
+
runReport(reportTemplateId: number): Promise<ReportResult>;
|
|
650
|
+
private serializeIdList;
|
|
651
|
+
}
|
|
652
|
+
//# sourceMappingURL=client.d.ts.map
|