@rbaileysr/zephyr-managed-api 1.3.6 → 1.3.7
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 +115 -3
- package/dist/README.md +115 -3
- package/dist/groups/All.d.ts +1 -1
- package/dist/groups/All.d.ts.map +1 -1
- package/dist/groups/Private/PrivateConfig.d.ts +26 -10
- package/dist/groups/Private/PrivateConfig.d.ts.map +1 -1
- package/dist/groups/Private/PrivateConfig.js +36 -12
- package/dist/groups/Private/PrivateIterationData.d.ts +157 -0
- package/dist/groups/Private/PrivateIterationData.d.ts.map +1 -0
- package/dist/groups/Private/PrivateIterationData.js +364 -0
- package/dist/groups/Private.d.ts +6 -0
- package/dist/groups/Private.d.ts.map +1 -1
- package/dist/groups/Private.js +2 -0
- package/dist/groups/TestExecution.d.ts +4 -2
- package/dist/groups/TestExecution.d.ts.map +1 -1
- package/dist/groups/TestExecution.js +6 -2
- package/dist/package.json +1 -1
- package/dist/types.d.ts +101 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
import { PrivateBase } from './PrivateBase';
|
|
5
|
+
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError, } from '../../utils';
|
|
6
|
+
export class PrivateIterationData extends PrivateBase {
|
|
7
|
+
constructor(apiConnection) {
|
|
8
|
+
super(apiConnection);
|
|
9
|
+
}
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Test Cycle Iteration Methods
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Get test cycle iteration using private API
|
|
15
|
+
*
|
|
16
|
+
* Retrieves iteration data for a test cycle that is not available in the public API.
|
|
17
|
+
* Use this to supplement the public `getTestCycle()` response with iteration information.
|
|
18
|
+
*
|
|
19
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
20
|
+
* The endpoint may change or be removed at any time without notice.
|
|
21
|
+
*
|
|
22
|
+
* @param credentials - Private API credentials
|
|
23
|
+
* @param request - Get test cycle iteration request
|
|
24
|
+
* @param request.testCycleKey - Test cycle key (e.g., "M12-R1")
|
|
25
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
26
|
+
* @returns Test cycle iteration response with iterationId (null if not set)
|
|
27
|
+
* @throws {BadRequestError} If the request is invalid
|
|
28
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
29
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
30
|
+
* @throws {NotFoundError} If the test cycle is not found
|
|
31
|
+
* @throws {ServerError} If the server returns an error
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* // Get iteration for a test cycle (supplements public getTestCycle)
|
|
36
|
+
* const publicData = await api.TestCycle.getTestCycle({ key: 'M12-R1' });
|
|
37
|
+
* const iterationData = await api.Private.IterationData.getTestCycleIteration(credentials, {
|
|
38
|
+
* testCycleKey: 'M12-R1',
|
|
39
|
+
* projectId: 10313
|
|
40
|
+
* });
|
|
41
|
+
* console.log('Iteration ID:', iterationData.iterationId);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
async getTestCycleIteration(credentials, request) {
|
|
45
|
+
// Get Context JWT
|
|
46
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
47
|
+
// Build URL with minimal fields needed
|
|
48
|
+
const fields = 'id,key,iterationId';
|
|
49
|
+
const url = `${this.privateApiBaseUrl}/testrun/${request.testCycleKey}?fields=${encodeURIComponent(fields)}`;
|
|
50
|
+
const headers = {
|
|
51
|
+
accept: 'application/json',
|
|
52
|
+
authorization: `JWT ${contextJwt}`,
|
|
53
|
+
'jira-project-id': String(request.projectId),
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch(url, {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
headers,
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
if (response.status === 400) {
|
|
62
|
+
throw new BadRequestError(`Invalid request parameters for getting test cycle iteration.`);
|
|
63
|
+
}
|
|
64
|
+
if (response.status === 401) {
|
|
65
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
66
|
+
}
|
|
67
|
+
if (response.status === 403) {
|
|
68
|
+
throw new ForbiddenError('Insufficient permissions to get test cycle iteration.');
|
|
69
|
+
}
|
|
70
|
+
if (response.status === 404) {
|
|
71
|
+
throw new NotFoundError(`Test cycle '${request.testCycleKey}' not found.`);
|
|
72
|
+
}
|
|
73
|
+
throw new ServerError(`Failed to get test cycle iteration. Status: ${response.status}`, response.status, response.statusText);
|
|
74
|
+
}
|
|
75
|
+
const data = (await response.json());
|
|
76
|
+
return {
|
|
77
|
+
id: data.id,
|
|
78
|
+
key: data.key,
|
|
79
|
+
iterationId: data.iterationId ?? null,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof BadRequestError ||
|
|
84
|
+
error instanceof UnauthorizedError ||
|
|
85
|
+
error instanceof ForbiddenError ||
|
|
86
|
+
error instanceof NotFoundError ||
|
|
87
|
+
error instanceof ServerError ||
|
|
88
|
+
error instanceof UnexpectedError) {
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
throw new UnexpectedError(`Unexpected error while getting test cycle iteration for '${request.testCycleKey}'`, error);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Update test cycle iteration using private API
|
|
96
|
+
*
|
|
97
|
+
* Sets or clears the iteration for a test cycle. Use this to supplement
|
|
98
|
+
* a test cycle created via the public API with iteration data.
|
|
99
|
+
*
|
|
100
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
101
|
+
* The endpoint may change or be removed at any time without notice.
|
|
102
|
+
*
|
|
103
|
+
* @param credentials - Private API credentials
|
|
104
|
+
* @param request - Update test cycle iteration request
|
|
105
|
+
* @param request.testCycleKey - Test cycle key (e.g., "M12-R1")
|
|
106
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
107
|
+
* @param request.iterationId - Iteration ID to set, or null to clear
|
|
108
|
+
* @throws {BadRequestError} If the request is invalid
|
|
109
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
110
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
111
|
+
* @throws {NotFoundError} If the test cycle is not found
|
|
112
|
+
* @throws {ServerError} If the server returns an error
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* // Create test cycle with public API, then set iteration with private API
|
|
117
|
+
* const testCycle = await api.TestCycle.createTestCycle({
|
|
118
|
+
* projectKey: 'M12',
|
|
119
|
+
* name: 'Sprint 1 Testing'
|
|
120
|
+
* });
|
|
121
|
+
*
|
|
122
|
+
* // Set iteration using private API
|
|
123
|
+
* await api.Private.IterationData.updateTestCycleIteration(credentials, {
|
|
124
|
+
* testCycleKey: testCycle.key,
|
|
125
|
+
* projectId: 10313,
|
|
126
|
+
* iterationId: 10952254
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
async updateTestCycleIteration(credentials, request) {
|
|
131
|
+
// Get Context JWT
|
|
132
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
133
|
+
// First, get the numeric ID for the test cycle
|
|
134
|
+
const testCycleData = await this.getTestCycleIteration(credentials, {
|
|
135
|
+
testCycleKey: request.testCycleKey,
|
|
136
|
+
projectId: request.projectId,
|
|
137
|
+
});
|
|
138
|
+
// Build URL with numeric ID
|
|
139
|
+
const url = `${this.privateApiBaseUrl}/testrun/${testCycleData.id}`;
|
|
140
|
+
const headers = {
|
|
141
|
+
'Content-Type': 'application/json',
|
|
142
|
+
accept: 'application/json',
|
|
143
|
+
authorization: `JWT ${contextJwt}`,
|
|
144
|
+
'jira-project-id': String(request.projectId),
|
|
145
|
+
};
|
|
146
|
+
const requestBody = {
|
|
147
|
+
id: testCycleData.id,
|
|
148
|
+
projectId: request.projectId,
|
|
149
|
+
iterationId: request.iterationId,
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
const response = await fetch(url, {
|
|
153
|
+
method: 'PUT',
|
|
154
|
+
headers,
|
|
155
|
+
body: JSON.stringify(requestBody),
|
|
156
|
+
});
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
if (response.status === 400) {
|
|
159
|
+
throw new BadRequestError(`Invalid request parameters for updating test cycle iteration.`);
|
|
160
|
+
}
|
|
161
|
+
if (response.status === 401) {
|
|
162
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
163
|
+
}
|
|
164
|
+
if (response.status === 403) {
|
|
165
|
+
throw new ForbiddenError('Insufficient permissions to update test cycle iteration.');
|
|
166
|
+
}
|
|
167
|
+
if (response.status === 404) {
|
|
168
|
+
throw new NotFoundError(`Test cycle '${request.testCycleKey}' not found.`);
|
|
169
|
+
}
|
|
170
|
+
throw new ServerError(`Failed to update test cycle iteration. Status: ${response.status}`, response.status, response.statusText);
|
|
171
|
+
}
|
|
172
|
+
// Response is empty on success
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
if (error instanceof BadRequestError ||
|
|
176
|
+
error instanceof UnauthorizedError ||
|
|
177
|
+
error instanceof ForbiddenError ||
|
|
178
|
+
error instanceof NotFoundError ||
|
|
179
|
+
error instanceof ServerError ||
|
|
180
|
+
error instanceof UnexpectedError) {
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
throw new UnexpectedError(`Unexpected error while updating test cycle iteration for '${request.testCycleKey}'`, error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// ============================================================================
|
|
187
|
+
// Test Execution Iteration Methods
|
|
188
|
+
// ============================================================================
|
|
189
|
+
/**
|
|
190
|
+
* Get test execution iteration using private API
|
|
191
|
+
*
|
|
192
|
+
* Retrieves iteration data for a test execution that is not available in the public API.
|
|
193
|
+
* Use this to supplement the public `getTestExecution()` response with iteration information.
|
|
194
|
+
*
|
|
195
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
196
|
+
* The endpoint may change or be removed at any time without notice.
|
|
197
|
+
*
|
|
198
|
+
* @param credentials - Private API credentials
|
|
199
|
+
* @param request - Get test execution iteration request
|
|
200
|
+
* @param request.testExecutionKey - Test execution key (e.g., "M12-E1")
|
|
201
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
202
|
+
* @returns Test execution iteration response with iterationId (null if not set)
|
|
203
|
+
* @throws {BadRequestError} If the request is invalid
|
|
204
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
205
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
206
|
+
* @throws {NotFoundError} If the test execution is not found
|
|
207
|
+
* @throws {ServerError} If the server returns an error
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* // Get iteration for a test execution (supplements public getTestExecution)
|
|
212
|
+
* const publicData = await api.TestExecution.getTestExecution({ key: 'M12-E1' });
|
|
213
|
+
* const iterationData = await api.Private.IterationData.getTestExecutionIteration(credentials, {
|
|
214
|
+
* testExecutionKey: 'M12-E1',
|
|
215
|
+
* projectId: 10313
|
|
216
|
+
* });
|
|
217
|
+
* console.log('Iteration ID:', iterationData.iterationId);
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
async getTestExecutionIteration(credentials, request) {
|
|
221
|
+
// Get Context JWT
|
|
222
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
223
|
+
// Build URL with minimal fields needed
|
|
224
|
+
const fields = 'id,key,iterationId';
|
|
225
|
+
const url = `${this.privateApiBaseUrl}/testresult/${request.testExecutionKey}?fields=${encodeURIComponent(fields)}&itemId=${request.testExecutionKey}`;
|
|
226
|
+
const headers = {
|
|
227
|
+
accept: 'application/json',
|
|
228
|
+
authorization: `JWT ${contextJwt}`,
|
|
229
|
+
'jira-project-id': String(request.projectId),
|
|
230
|
+
};
|
|
231
|
+
try {
|
|
232
|
+
const response = await fetch(url, {
|
|
233
|
+
method: 'GET',
|
|
234
|
+
headers,
|
|
235
|
+
});
|
|
236
|
+
if (!response.ok) {
|
|
237
|
+
if (response.status === 400) {
|
|
238
|
+
throw new BadRequestError(`Invalid request parameters for getting test execution iteration.`);
|
|
239
|
+
}
|
|
240
|
+
if (response.status === 401) {
|
|
241
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
242
|
+
}
|
|
243
|
+
if (response.status === 403) {
|
|
244
|
+
throw new ForbiddenError('Insufficient permissions to get test execution iteration.');
|
|
245
|
+
}
|
|
246
|
+
if (response.status === 404) {
|
|
247
|
+
throw new NotFoundError(`Test execution '${request.testExecutionKey}' not found.`);
|
|
248
|
+
}
|
|
249
|
+
throw new ServerError(`Failed to get test execution iteration. Status: ${response.status}`, response.status, response.statusText);
|
|
250
|
+
}
|
|
251
|
+
const data = (await response.json());
|
|
252
|
+
return {
|
|
253
|
+
id: data.id,
|
|
254
|
+
key: data.key,
|
|
255
|
+
iterationId: data.iterationId ?? null,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
if (error instanceof BadRequestError ||
|
|
260
|
+
error instanceof UnauthorizedError ||
|
|
261
|
+
error instanceof ForbiddenError ||
|
|
262
|
+
error instanceof NotFoundError ||
|
|
263
|
+
error instanceof ServerError ||
|
|
264
|
+
error instanceof UnexpectedError) {
|
|
265
|
+
throw error;
|
|
266
|
+
}
|
|
267
|
+
throw new UnexpectedError(`Unexpected error while getting test execution iteration for '${request.testExecutionKey}'`, error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Update test execution iteration using private API
|
|
272
|
+
*
|
|
273
|
+
* Sets or clears the iteration for a test execution. Use this to supplement
|
|
274
|
+
* a test execution created via the public API with iteration data.
|
|
275
|
+
*
|
|
276
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
277
|
+
* The endpoint may change or be removed at any time without notice.
|
|
278
|
+
*
|
|
279
|
+
* @param credentials - Private API credentials
|
|
280
|
+
* @param request - Update test execution iteration request
|
|
281
|
+
* @param request.testExecutionKey - Test execution key (e.g., "M12-E1")
|
|
282
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
283
|
+
* @param request.iterationId - Iteration ID to set, or null to clear
|
|
284
|
+
* @throws {BadRequestError} If the request is invalid
|
|
285
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
286
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
287
|
+
* @throws {NotFoundError} If the test execution is not found
|
|
288
|
+
* @throws {ServerError} If the server returns an error
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* // Create test execution with public API (returns void), then set iteration with private API
|
|
293
|
+
* await api.TestExecution.createTestExecution({
|
|
294
|
+
* projectKey: 'M12',
|
|
295
|
+
* testCaseKey: 'M12-T1',
|
|
296
|
+
* testCycleKey: 'M12-R1',
|
|
297
|
+
* statusName: 'Pass'
|
|
298
|
+
* });
|
|
299
|
+
*
|
|
300
|
+
* // Note: createTestExecution returns no data, so use known key or look up after creation
|
|
301
|
+
* // Set iteration using private API
|
|
302
|
+
* await api.Private.IterationData.updateTestExecutionIteration(credentials, {
|
|
303
|
+
* testExecutionKey: 'M12-E1', // Use known key or look up via listTestExecutions()
|
|
304
|
+
* projectId: 10313,
|
|
305
|
+
* iterationId: 10952254
|
|
306
|
+
* });
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
async updateTestExecutionIteration(credentials, request) {
|
|
310
|
+
// Get Context JWT
|
|
311
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
312
|
+
// First, get the numeric ID for the test execution
|
|
313
|
+
const testExecutionData = await this.getTestExecutionIteration(credentials, {
|
|
314
|
+
testExecutionKey: request.testExecutionKey,
|
|
315
|
+
projectId: request.projectId,
|
|
316
|
+
});
|
|
317
|
+
// Build URL with numeric ID
|
|
318
|
+
const url = `${this.privateApiBaseUrl}/testresult/${testExecutionData.id}`;
|
|
319
|
+
const headers = {
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
accept: 'application/json',
|
|
322
|
+
authorization: `JWT ${contextJwt}`,
|
|
323
|
+
'jira-project-id': String(request.projectId),
|
|
324
|
+
};
|
|
325
|
+
const requestBody = {
|
|
326
|
+
id: testExecutionData.id,
|
|
327
|
+
iterationId: request.iterationId,
|
|
328
|
+
};
|
|
329
|
+
try {
|
|
330
|
+
const response = await fetch(url, {
|
|
331
|
+
method: 'PUT',
|
|
332
|
+
headers,
|
|
333
|
+
body: JSON.stringify(requestBody),
|
|
334
|
+
});
|
|
335
|
+
if (!response.ok) {
|
|
336
|
+
if (response.status === 400) {
|
|
337
|
+
throw new BadRequestError(`Invalid request parameters for updating test execution iteration.`);
|
|
338
|
+
}
|
|
339
|
+
if (response.status === 401) {
|
|
340
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
341
|
+
}
|
|
342
|
+
if (response.status === 403) {
|
|
343
|
+
throw new ForbiddenError('Insufficient permissions to update test execution iteration.');
|
|
344
|
+
}
|
|
345
|
+
if (response.status === 404) {
|
|
346
|
+
throw new NotFoundError(`Test execution '${request.testExecutionKey}' not found.`);
|
|
347
|
+
}
|
|
348
|
+
throw new ServerError(`Failed to update test execution iteration. Status: ${response.status}`, response.status, response.statusText);
|
|
349
|
+
}
|
|
350
|
+
// Response is empty on success
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
if (error instanceof BadRequestError ||
|
|
354
|
+
error instanceof UnauthorizedError ||
|
|
355
|
+
error instanceof ForbiddenError ||
|
|
356
|
+
error instanceof NotFoundError ||
|
|
357
|
+
error instanceof ServerError ||
|
|
358
|
+
error instanceof UnexpectedError) {
|
|
359
|
+
throw error;
|
|
360
|
+
}
|
|
361
|
+
throw new UnexpectedError(`Unexpected error while updating test execution iteration for '${request.testExecutionKey}'`, error);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
package/dist/groups/Private.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { PrivateVersions } from './Private/PrivateVersions';
|
|
|
9
9
|
import { PrivateAttachments } from './Private/PrivateAttachments';
|
|
10
10
|
import { PrivateAuthentication } from './Private/PrivateAuthentication';
|
|
11
11
|
import { PrivateVersionControl } from './Private/PrivateVersionControl';
|
|
12
|
+
import { PrivateIterationData } from './Private/PrivateIterationData';
|
|
12
13
|
/**
|
|
13
14
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
14
15
|
*
|
|
@@ -40,6 +41,11 @@ export declare class PrivateGroup extends PrivateBase {
|
|
|
40
41
|
* Version Control sub-group - Get version-specific data (links, test script, test steps)
|
|
41
42
|
*/
|
|
42
43
|
readonly VersionControl: PrivateVersionControl;
|
|
44
|
+
/**
|
|
45
|
+
* Iteration Data sub-group - Get and set iteration data for Test Cycles and Test Executions
|
|
46
|
+
* Supplements public API with iteration data not available in public endpoints
|
|
47
|
+
*/
|
|
48
|
+
readonly IterationData: PrivateIterationData;
|
|
43
49
|
constructor(apiConnection?: ZephyrApiConnection);
|
|
44
50
|
}
|
|
45
51
|
//# sourceMappingURL=Private.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Private.d.ts","sourceRoot":"","sources":["../../groups/Private.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyDH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,M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@ -8,6 +8,7 @@ import { PrivateVersions } from './Private/PrivateVersions';
|
|
|
8
8
|
import { PrivateAttachments } from './Private/PrivateAttachments';
|
|
9
9
|
import { PrivateAuthentication } from './Private/PrivateAuthentication';
|
|
10
10
|
import { PrivateVersionControl } from './Private/PrivateVersionControl';
|
|
11
|
+
import { PrivateIterationData } from './Private/PrivateIterationData';
|
|
11
12
|
/**
|
|
12
13
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
13
14
|
*
|
|
@@ -23,5 +24,6 @@ export class PrivateGroup extends PrivateBase {
|
|
|
23
24
|
this.Versions = new PrivateVersions(apiConnection);
|
|
24
25
|
this.Attachments = new PrivateAttachments(apiConnection);
|
|
25
26
|
this.VersionControl = new PrivateVersionControl(apiConnection);
|
|
27
|
+
this.IterationData = new PrivateIterationData(apiConnection);
|
|
26
28
|
}
|
|
27
29
|
}
|
|
@@ -68,6 +68,8 @@ export declare class TestExecutionGroup {
|
|
|
68
68
|
* Creates a new test execution for a test case within a test cycle. Required fields include projectKey, testCaseKey, testCycleKey, and statusName.
|
|
69
69
|
* Optional fields include environmentName, actualEndDate, executionTime, executedById, assignedToId, comment, and customFields.
|
|
70
70
|
*
|
|
71
|
+
* Note: This API returns an empty response. To get the created test execution details, use listTestExecutions() or getTestExecution().
|
|
72
|
+
*
|
|
71
73
|
* @param request - Create test execution request
|
|
72
74
|
* @param request.body - Test execution data
|
|
73
75
|
* @param request.body.projectKey - Jira project key (required)
|
|
@@ -81,11 +83,11 @@ export declare class TestExecutionGroup {
|
|
|
81
83
|
* @param request.body.assignedToId - Account ID of user assigned to the test (optional)
|
|
82
84
|
* @param request.body.comment - Comment added against overall test case execution (optional)
|
|
83
85
|
* @param request.body.customFields - Custom field values (optional)
|
|
84
|
-
* @returns
|
|
86
|
+
* @returns Promise that resolves when creation is complete
|
|
85
87
|
*
|
|
86
88
|
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecution Official API Documentation}
|
|
87
89
|
*/
|
|
88
|
-
createTestExecution(request: CreateTestExecutionRequest): Promise<
|
|
90
|
+
createTestExecution(request: CreateTestExecutionRequest): Promise<void>;
|
|
89
91
|
/**
|
|
90
92
|
* Update a test execution
|
|
91
93
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestExecution.d.ts","sourceRoot":"","sources":["../../groups/TestExecution.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,8BAA8B,EAC9B,mCAAmC,EACnC,qBAAqB,EACrB,0BAA0B,EAC1B,IAAI,EACJ,eAAe,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,qBAAa,kBAAkB;IAClB,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;;;;;;;;;;;OAkBG;IACG,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMzF;;;;;;;;;;;;;;;;;OAiBG;IACG,yBAAyB,CAAC,OAAO,CAAC,EAAE,gCAAgC,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAMlH;;;;;;;;;;;OAWG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC;IAUhF
|
|
1
|
+
{"version":3,"file":"TestExecution.d.ts","sourceRoot":"","sources":["../../groups/TestExecution.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,gCAAgC,EAChC,uBAAuB,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;IAKnG;;;;;;;;;;;;;OAaG;IACG,4BAA4B,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,eAAe,CAAC;CAQ1G"}
|
|
@@ -80,6 +80,8 @@ export class TestExecutionGroup {
|
|
|
80
80
|
* Creates a new test execution for a test case within a test cycle. Required fields include projectKey, testCaseKey, testCycleKey, and statusName.
|
|
81
81
|
* Optional fields include environmentName, actualEndDate, executionTime, executedById, assignedToId, comment, and customFields.
|
|
82
82
|
*
|
|
83
|
+
* Note: This API returns an empty response. To get the created test execution details, use listTestExecutions() or getTestExecution().
|
|
84
|
+
*
|
|
83
85
|
* @param request - Create test execution request
|
|
84
86
|
* @param request.body - Test execution data
|
|
85
87
|
* @param request.body.projectKey - Jira project key (required)
|
|
@@ -93,7 +95,7 @@ export class TestExecutionGroup {
|
|
|
93
95
|
* @param request.body.assignedToId - Account ID of user assigned to the test (optional)
|
|
94
96
|
* @param request.body.comment - Comment added against overall test case execution (optional)
|
|
95
97
|
* @param request.body.customFields - Custom field values (optional)
|
|
96
|
-
* @returns
|
|
98
|
+
* @returns Promise that resolves when creation is complete
|
|
97
99
|
*
|
|
98
100
|
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecution Official API Documentation}
|
|
99
101
|
*/
|
|
@@ -103,7 +105,9 @@ export class TestExecutionGroup {
|
|
|
103
105
|
headers: { 'Content-Type': 'application/json' },
|
|
104
106
|
body: buildRequestBody(request.body),
|
|
105
107
|
});
|
|
106
|
-
|
|
108
|
+
if (!response.ok) {
|
|
109
|
+
await parseResponse(response);
|
|
110
|
+
}
|
|
107
111
|
}
|
|
108
112
|
/**
|
|
109
113
|
* Update a test execution
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbaileysr/zephyr-managed-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/dist/types.d.ts
CHANGED
|
@@ -1967,17 +1967,17 @@ export interface GetDataSetsRequest {
|
|
|
1967
1967
|
/**
|
|
1968
1968
|
* Config type for archive/unarchive operations
|
|
1969
1969
|
*/
|
|
1970
|
-
export type ConfigType = 'Environment' | 'Iteration';
|
|
1970
|
+
export type ConfigType = 'Environment' | 'Iteration' | 'TestCaseStatus' | 'TestPlanStatus' | 'TestCycleStatus' | 'TestExecutionStatus';
|
|
1971
1971
|
/**
|
|
1972
1972
|
* Archive config request for private API
|
|
1973
1973
|
*/
|
|
1974
1974
|
export interface ArchiveConfigRequest {
|
|
1975
1975
|
/**
|
|
1976
|
-
* Type of config item: 'Environment' or '
|
|
1976
|
+
* Type of config item: 'Environment', 'Iteration', 'TestCaseStatus', 'TestPlanStatus', 'TestCycleStatus', or 'TestExecutionStatus'
|
|
1977
1977
|
*/
|
|
1978
1978
|
type: ConfigType;
|
|
1979
1979
|
/**
|
|
1980
|
-
* Numeric ID of the
|
|
1980
|
+
* Numeric ID of the config item to archive/unarchive
|
|
1981
1981
|
*/
|
|
1982
1982
|
id: number;
|
|
1983
1983
|
/**
|
|
@@ -2078,4 +2078,102 @@ export interface TestExecutionStepIssueLink {
|
|
|
2078
2078
|
* Test execution step issue link list
|
|
2079
2079
|
*/
|
|
2080
2080
|
export type TestExecutionStepIssueLinkList = TestExecutionStepIssueLink[];
|
|
2081
|
+
/**
|
|
2082
|
+
* Get test cycle iteration request for private API
|
|
2083
|
+
* Supplements public getTestCycle() with iteration data
|
|
2084
|
+
*/
|
|
2085
|
+
export interface GetTestCycleIterationRequest {
|
|
2086
|
+
/**
|
|
2087
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2088
|
+
*/
|
|
2089
|
+
testCycleKey: string;
|
|
2090
|
+
/**
|
|
2091
|
+
* Jira project ID (numeric, not the project key)
|
|
2092
|
+
*/
|
|
2093
|
+
projectId: number;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Test cycle iteration response from private API
|
|
2097
|
+
*/
|
|
2098
|
+
export interface TestCycleIterationResponse {
|
|
2099
|
+
/**
|
|
2100
|
+
* Numeric ID of the test cycle
|
|
2101
|
+
*/
|
|
2102
|
+
id: number;
|
|
2103
|
+
/**
|
|
2104
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2105
|
+
*/
|
|
2106
|
+
key: string;
|
|
2107
|
+
/**
|
|
2108
|
+
* Iteration ID if set, null if not set
|
|
2109
|
+
*/
|
|
2110
|
+
iterationId: number | null;
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Update test cycle iteration request for private API
|
|
2114
|
+
* Supplements public updateTestCycle() with iteration data
|
|
2115
|
+
*/
|
|
2116
|
+
export interface UpdateTestCycleIterationRequest {
|
|
2117
|
+
/**
|
|
2118
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2119
|
+
*/
|
|
2120
|
+
testCycleKey: string;
|
|
2121
|
+
/**
|
|
2122
|
+
* Jira project ID (numeric, not the project key)
|
|
2123
|
+
*/
|
|
2124
|
+
projectId: number;
|
|
2125
|
+
/**
|
|
2126
|
+
* Iteration ID to set, or null to clear the iteration
|
|
2127
|
+
*/
|
|
2128
|
+
iterationId: number | null;
|
|
2129
|
+
}
|
|
2130
|
+
/**
|
|
2131
|
+
* Get test execution iteration request for private API
|
|
2132
|
+
* Supplements public getTestExecution() with iteration data
|
|
2133
|
+
*/
|
|
2134
|
+
export interface GetTestExecutionIterationRequest {
|
|
2135
|
+
/**
|
|
2136
|
+
* Test execution key (e.g., "M12-E1")
|
|
2137
|
+
*/
|
|
2138
|
+
testExecutionKey: string;
|
|
2139
|
+
/**
|
|
2140
|
+
* Jira project ID (numeric, not the project key)
|
|
2141
|
+
*/
|
|
2142
|
+
projectId: number;
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Test execution iteration response from private API
|
|
2146
|
+
*/
|
|
2147
|
+
export interface TestExecutionIterationResponse {
|
|
2148
|
+
/**
|
|
2149
|
+
* Numeric ID of the test execution
|
|
2150
|
+
*/
|
|
2151
|
+
id: number;
|
|
2152
|
+
/**
|
|
2153
|
+
* Test execution key (e.g., "M12-E1")
|
|
2154
|
+
*/
|
|
2155
|
+
key: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* Iteration ID if set, null if not set
|
|
2158
|
+
*/
|
|
2159
|
+
iterationId: number | null;
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Update test execution iteration request for private API
|
|
2163
|
+
* Supplements public updateTestExecution() with iteration data
|
|
2164
|
+
*/
|
|
2165
|
+
export interface UpdateTestExecutionIterationRequest {
|
|
2166
|
+
/**
|
|
2167
|
+
* Test execution key (e.g., "M12-E1")
|
|
2168
|
+
*/
|
|
2169
|
+
testExecutionKey: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Jira project ID (numeric, not the project key)
|
|
2172
|
+
*/
|
|
2173
|
+
projectId: number;
|
|
2174
|
+
/**
|
|
2175
|
+
* Iteration ID to set, or null to clear the iteration
|
|
2176
|
+
*/
|
|
2177
|
+
iterationId: number | null;
|
|
2178
|
+
}
|
|
2081
2179
|
//# sourceMappingURL=types.d.ts.map
|