@rbaileysr/zephyr-managed-api 1.3.7 → 1.3.8
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 +110 -10
- package/dist/README.md +110 -10
- package/dist/groups/Private/{PrivateIterationData.d.ts → PrivateExtendedData.d.ts} +77 -5
- package/dist/groups/Private/PrivateExtendedData.d.ts.map +1 -0
- package/dist/groups/Private/{PrivateIterationData.js → PrivateExtendedData.js} +180 -1
- package/dist/groups/Private/PrivateTestCaseArchiving.d.ts +123 -0
- package/dist/groups/Private/PrivateTestCaseArchiving.d.ts.map +1 -0
- package/dist/groups/Private/PrivateTestCaseArchiving.js +265 -0
- package/dist/groups/Private.d.ts +10 -4
- package/dist/groups/Private.d.ts.map +1 -1
- package/dist/groups/Private.js +4 -2
- package/dist/package.json +1 -2
- package/dist/types.d.ts +162 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/groups/Private/PrivateIterationData.d.ts.map +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Private API Test Case Archiving sub-group
|
|
6
|
+
* Provides functionality to list, archive, and unarchive test cases
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrivateApiCredentials, GetArchivedTestCasesRequest, PrivateArchivedTestCaseSearchResponse, ArchiveTestCasesRequest, UnarchiveTestCasesRequest } from '../../types';
|
|
11
|
+
import type { ZephyrApiConnection } from '../../index';
|
|
12
|
+
import { PrivateBase } from './PrivateBase';
|
|
13
|
+
export declare class PrivateTestCaseArchiving extends PrivateBase {
|
|
14
|
+
constructor(apiConnection?: ZephyrApiConnection);
|
|
15
|
+
/**
|
|
16
|
+
* Get archived test cases using private API
|
|
17
|
+
*
|
|
18
|
+
* Retrieves a paginated list of archived test cases for a project.
|
|
19
|
+
* The archived flag is not available in the public API, so this method
|
|
20
|
+
* provides access to archived test cases.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
23
|
+
* The endpoint may change or be removed at any time without notice.
|
|
24
|
+
*
|
|
25
|
+
* @param credentials - Private API credentials
|
|
26
|
+
* @param request - Get archived test cases request
|
|
27
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
28
|
+
* @param request.maxResults - Maximum number of results to return (default: 50)
|
|
29
|
+
* @param request.startAt - Zero-indexed starting position (default: 0)
|
|
30
|
+
* @param request.query - Optional query string for filtering (e.g., "testCase.name CONTAINS 'test'")
|
|
31
|
+
* @returns Paginated list of archived test cases
|
|
32
|
+
* @throws {BadRequestError} If the request is invalid
|
|
33
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
34
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
35
|
+
* @throws {ServerError} If the server returns an error
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Get first page of archived test cases
|
|
40
|
+
* const archived = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
41
|
+
* projectId: 10316,
|
|
42
|
+
* maxResults: 50,
|
|
43
|
+
* startAt: 0
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Get archived test cases with custom query
|
|
47
|
+
* const filtered = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
48
|
+
* projectId: 10316,
|
|
49
|
+
* query: "testCase.name CONTAINS 'migration'"
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
getArchivedTestCases(credentials: PrivateApiCredentials, request: GetArchivedTestCasesRequest): Promise<PrivateArchivedTestCaseSearchResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Archive test cases using private API
|
|
56
|
+
*
|
|
57
|
+
* Archives one or more test cases. This is a bulk operation that accepts
|
|
58
|
+
* an array of test case IDs.
|
|
59
|
+
*
|
|
60
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
61
|
+
* The endpoint may change or be removed at any time without notice.
|
|
62
|
+
*
|
|
63
|
+
* @param credentials - Private API credentials
|
|
64
|
+
* @param request - Archive test cases request
|
|
65
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
66
|
+
* @param request.testCaseIds - Array of test case IDs to archive
|
|
67
|
+
* @throws {BadRequestError} If the request is invalid
|
|
68
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
69
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
70
|
+
* @throws {ServerError} If the server returns an error
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* // Archive a single test case
|
|
75
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
76
|
+
* projectId: 10316,
|
|
77
|
+
* testCaseIds: [288004503]
|
|
78
|
+
* });
|
|
79
|
+
*
|
|
80
|
+
* // Archive multiple test cases
|
|
81
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
82
|
+
* projectId: 10316,
|
|
83
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
archiveTestCases(credentials: PrivateApiCredentials, request: ArchiveTestCasesRequest): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Unarchive test cases using private API
|
|
90
|
+
*
|
|
91
|
+
* Unarchives one or more test cases. This is a bulk operation that accepts
|
|
92
|
+
* an array of test case IDs.
|
|
93
|
+
*
|
|
94
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
95
|
+
* The endpoint may change or be removed at any time without notice.
|
|
96
|
+
*
|
|
97
|
+
* @param credentials - Private API credentials
|
|
98
|
+
* @param request - Unarchive test cases request
|
|
99
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
100
|
+
* @param request.testCaseIds - Array of test case IDs to unarchive
|
|
101
|
+
* @throws {BadRequestError} If the request is invalid
|
|
102
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
103
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
104
|
+
* @throws {ServerError} If the server returns an error
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* // Unarchive a single test case
|
|
109
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
110
|
+
* projectId: 10316,
|
|
111
|
+
* testCaseIds: [288004503]
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* // Unarchive multiple test cases
|
|
115
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
116
|
+
* projectId: 10316,
|
|
117
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
unarchiveTestCases(credentials: PrivateApiCredentials, request: UnarchiveTestCasesRequest): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=PrivateTestCaseArchiving.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateTestCaseArchiving.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateTestCaseArchiving.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,qCAAqC,EACrC,uBAAuB,EACvB,yBAAyB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C,qBAAa,wBAAyB,SAAQ,WAAW;gBAC5C,aAAa,CAAC,EAAE,mBAAmB;IAI/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACG,oBAAoB,CACzB,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,2BAA2B,GAClC,OAAO,CAAC,qCAAqC,CAAC;IAyEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,gBAAgB,CACrB,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAkEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,kBAAkB,CACvB,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,yBAAyB,GAChC,OAAO,CAAC,IAAI,CAAC;CAiEhB"}
|
|
@@ -0,0 +1,265 @@
|
|
|
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 PrivateTestCaseArchiving extends PrivateBase {
|
|
7
|
+
constructor(apiConnection) {
|
|
8
|
+
super(apiConnection);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get archived test cases using private API
|
|
12
|
+
*
|
|
13
|
+
* Retrieves a paginated list of archived test cases for a project.
|
|
14
|
+
* The archived flag is not available in the public API, so this method
|
|
15
|
+
* provides access to archived test cases.
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
18
|
+
* The endpoint may change or be removed at any time without notice.
|
|
19
|
+
*
|
|
20
|
+
* @param credentials - Private API credentials
|
|
21
|
+
* @param request - Get archived test cases request
|
|
22
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
23
|
+
* @param request.maxResults - Maximum number of results to return (default: 50)
|
|
24
|
+
* @param request.startAt - Zero-indexed starting position (default: 0)
|
|
25
|
+
* @param request.query - Optional query string for filtering (e.g., "testCase.name CONTAINS 'test'")
|
|
26
|
+
* @returns Paginated list of archived test cases
|
|
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 {ServerError} If the server returns an error
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Get first page of archived test cases
|
|
35
|
+
* const archived = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
36
|
+
* projectId: 10316,
|
|
37
|
+
* maxResults: 50,
|
|
38
|
+
* startAt: 0
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Get archived test cases with custom query
|
|
42
|
+
* const filtered = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
43
|
+
* projectId: 10316,
|
|
44
|
+
* query: "testCase.name CONTAINS 'migration'"
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
async getArchivedTestCases(credentials, request) {
|
|
49
|
+
// Get Context JWT
|
|
50
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
51
|
+
// Build query string
|
|
52
|
+
const maxResults = request.maxResults ?? 50;
|
|
53
|
+
const startAt = request.startAt ?? 0;
|
|
54
|
+
const query = request.query ?? `testCase.projectId IN (${request.projectId}) ORDER BY testCase.name ASC`;
|
|
55
|
+
// Build fields list (matching the example)
|
|
56
|
+
const fields = 'id,key,projectId,name,averageTime,estimatedTime,labels,folderId,componentId,status(id,name,i18nKey,color),priority(id,name,i18nKey,color),lastTestResultStatus(name,i18nKey,color),majorVersion,createdOn,createdBy,updatedOn,updatedBy,customFieldValues,owner,folderId';
|
|
57
|
+
// Build URL
|
|
58
|
+
const params = new URLSearchParams({
|
|
59
|
+
fields,
|
|
60
|
+
query,
|
|
61
|
+
startAt: String(startAt),
|
|
62
|
+
maxResults: String(maxResults),
|
|
63
|
+
archived: 'true',
|
|
64
|
+
});
|
|
65
|
+
const url = `${this.privateApiBaseUrl}/testcase/search?${params.toString()}`;
|
|
66
|
+
const headers = {
|
|
67
|
+
accept: 'application/json',
|
|
68
|
+
authorization: `JWT ${contextJwt}`,
|
|
69
|
+
'jira-project-id': String(request.projectId),
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
const response = await fetch(url, {
|
|
73
|
+
method: 'GET',
|
|
74
|
+
headers,
|
|
75
|
+
});
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
if (response.status === 400) {
|
|
78
|
+
throw new BadRequestError(`Invalid request parameters for getting archived test cases.`);
|
|
79
|
+
}
|
|
80
|
+
if (response.status === 401) {
|
|
81
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
82
|
+
}
|
|
83
|
+
if (response.status === 403) {
|
|
84
|
+
throw new ForbiddenError('Insufficient permissions to get archived test cases.');
|
|
85
|
+
}
|
|
86
|
+
throw new ServerError(`Failed to get archived test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
87
|
+
}
|
|
88
|
+
const data = (await response.json());
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error instanceof BadRequestError ||
|
|
93
|
+
error instanceof UnauthorizedError ||
|
|
94
|
+
error instanceof ForbiddenError ||
|
|
95
|
+
error instanceof NotFoundError ||
|
|
96
|
+
error instanceof ServerError ||
|
|
97
|
+
error instanceof UnexpectedError) {
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
throw new UnexpectedError(`Unexpected error while getting archived test cases for project ${request.projectId}`, error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Archive test cases using private API
|
|
105
|
+
*
|
|
106
|
+
* Archives one or more test cases. This is a bulk operation that accepts
|
|
107
|
+
* an array of test case IDs.
|
|
108
|
+
*
|
|
109
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
110
|
+
* The endpoint may change or be removed at any time without notice.
|
|
111
|
+
*
|
|
112
|
+
* @param credentials - Private API credentials
|
|
113
|
+
* @param request - Archive test cases request
|
|
114
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
115
|
+
* @param request.testCaseIds - Array of test case IDs to archive
|
|
116
|
+
* @throws {BadRequestError} If the request is invalid
|
|
117
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
118
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
119
|
+
* @throws {ServerError} If the server returns an error
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* // Archive a single test case
|
|
124
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
125
|
+
* projectId: 10316,
|
|
126
|
+
* testCaseIds: [288004503]
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* // Archive multiple test cases
|
|
130
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
131
|
+
* projectId: 10316,
|
|
132
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
async archiveTestCases(credentials, request) {
|
|
137
|
+
// Get Context JWT
|
|
138
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
139
|
+
// Validate input
|
|
140
|
+
if (!request.testCaseIds || request.testCaseIds.length === 0) {
|
|
141
|
+
throw new BadRequestError('At least one test case ID is required for archiving.');
|
|
142
|
+
}
|
|
143
|
+
const url = `${this.privateApiBaseUrl}/testcase/bulk/archive`;
|
|
144
|
+
const headers = {
|
|
145
|
+
'Content-Type': 'application/json',
|
|
146
|
+
accept: 'application/json',
|
|
147
|
+
authorization: `JWT ${contextJwt}`,
|
|
148
|
+
'jira-project-id': String(request.projectId),
|
|
149
|
+
};
|
|
150
|
+
// Body is an array of test case IDs
|
|
151
|
+
const body = JSON.stringify(request.testCaseIds);
|
|
152
|
+
try {
|
|
153
|
+
const response = await fetch(url, {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers,
|
|
156
|
+
body,
|
|
157
|
+
});
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
if (response.status === 400) {
|
|
160
|
+
throw new BadRequestError(`Invalid request parameters for archiving test cases.`);
|
|
161
|
+
}
|
|
162
|
+
if (response.status === 401) {
|
|
163
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
164
|
+
}
|
|
165
|
+
if (response.status === 403) {
|
|
166
|
+
throw new ForbiddenError('Insufficient permissions to archive test cases.');
|
|
167
|
+
}
|
|
168
|
+
throw new ServerError(`Failed to archive test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
169
|
+
}
|
|
170
|
+
// Response is empty on success
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
if (error instanceof BadRequestError ||
|
|
174
|
+
error instanceof UnauthorizedError ||
|
|
175
|
+
error instanceof ForbiddenError ||
|
|
176
|
+
error instanceof NotFoundError ||
|
|
177
|
+
error instanceof ServerError ||
|
|
178
|
+
error instanceof UnexpectedError) {
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
throw new UnexpectedError(`Unexpected error while archiving test cases for project ${request.projectId}`, error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Unarchive test cases using private API
|
|
186
|
+
*
|
|
187
|
+
* Unarchives one or more test cases. This is a bulk operation that accepts
|
|
188
|
+
* an array of test case IDs.
|
|
189
|
+
*
|
|
190
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
191
|
+
* The endpoint may change or be removed at any time without notice.
|
|
192
|
+
*
|
|
193
|
+
* @param credentials - Private API credentials
|
|
194
|
+
* @param request - Unarchive test cases request
|
|
195
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
196
|
+
* @param request.testCaseIds - Array of test case IDs to unarchive
|
|
197
|
+
* @throws {BadRequestError} If the request is invalid
|
|
198
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
199
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
200
|
+
* @throws {ServerError} If the server returns an error
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* // Unarchive a single test case
|
|
205
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
206
|
+
* projectId: 10316,
|
|
207
|
+
* testCaseIds: [288004503]
|
|
208
|
+
* });
|
|
209
|
+
*
|
|
210
|
+
* // Unarchive multiple test cases
|
|
211
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
212
|
+
* projectId: 10316,
|
|
213
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
214
|
+
* });
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
async unarchiveTestCases(credentials, request) {
|
|
218
|
+
// Get Context JWT
|
|
219
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
220
|
+
// Validate input
|
|
221
|
+
if (!request.testCaseIds || request.testCaseIds.length === 0) {
|
|
222
|
+
throw new BadRequestError('At least one test case ID is required for unarchiving.');
|
|
223
|
+
}
|
|
224
|
+
const url = `${this.privateApiBaseUrl}/testcase/bulk/unarchive`;
|
|
225
|
+
const headers = {
|
|
226
|
+
'Content-Type': 'application/json',
|
|
227
|
+
accept: 'application/json',
|
|
228
|
+
authorization: `JWT ${contextJwt}`,
|
|
229
|
+
'jira-project-id': String(request.projectId),
|
|
230
|
+
};
|
|
231
|
+
// Body is an array of test case IDs
|
|
232
|
+
const body = JSON.stringify(request.testCaseIds);
|
|
233
|
+
try {
|
|
234
|
+
const response = await fetch(url, {
|
|
235
|
+
method: 'POST',
|
|
236
|
+
headers,
|
|
237
|
+
body,
|
|
238
|
+
});
|
|
239
|
+
if (!response.ok) {
|
|
240
|
+
if (response.status === 400) {
|
|
241
|
+
throw new BadRequestError(`Invalid request parameters for unarchiving test cases.`);
|
|
242
|
+
}
|
|
243
|
+
if (response.status === 401) {
|
|
244
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
245
|
+
}
|
|
246
|
+
if (response.status === 403) {
|
|
247
|
+
throw new ForbiddenError('Insufficient permissions to unarchive test cases.');
|
|
248
|
+
}
|
|
249
|
+
throw new ServerError(`Failed to unarchive test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
250
|
+
}
|
|
251
|
+
// Response is empty on success
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
if (error instanceof BadRequestError ||
|
|
255
|
+
error instanceof UnauthorizedError ||
|
|
256
|
+
error instanceof ForbiddenError ||
|
|
257
|
+
error instanceof NotFoundError ||
|
|
258
|
+
error instanceof ServerError ||
|
|
259
|
+
error instanceof UnexpectedError) {
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
throw new UnexpectedError(`Unexpected error while unarchiving test cases for project ${request.projectId}`, error);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
package/dist/groups/Private.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ 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 {
|
|
12
|
+
import { PrivateExtendedData } from './Private/PrivateExtendedData';
|
|
13
|
+
import { PrivateTestCaseArchiving } from './Private/PrivateTestCaseArchiving';
|
|
13
14
|
/**
|
|
14
15
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
15
16
|
*
|
|
@@ -42,10 +43,15 @@ export declare class PrivateGroup extends PrivateBase {
|
|
|
42
43
|
*/
|
|
43
44
|
readonly VersionControl: PrivateVersionControl;
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
* Supplements public API with
|
|
46
|
+
* Extended Data sub-group - Get and set extended data (iterations, versions) for Test Cycles and Test Executions
|
|
47
|
+
* Supplements public API with extended data not available in public endpoints
|
|
47
48
|
*/
|
|
48
|
-
readonly
|
|
49
|
+
readonly ExtendedData: PrivateExtendedData;
|
|
50
|
+
/**
|
|
51
|
+
* Test Case Archiving sub-group - List, archive, and unarchive test cases
|
|
52
|
+
* Provides access to archived test cases and archiving operations not available in public API
|
|
53
|
+
*/
|
|
54
|
+
readonly TestCaseArchiving: PrivateTestCaseArchiving;
|
|
49
55
|
constructor(apiConnection?: ZephyrApiConnection);
|
|
50
56
|
}
|
|
51
57
|
//# 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,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,
|
|
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,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAS9E;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC5C;;OAEG;IACH,SAAgB,cAAc,EAAE,qBAAqB,CAAC;IAEtD;;OAEG;IACH,SAAgB,QAAQ,EAAE,eAAe,CAAC;IAE1C;;OAEG;IACH,SAAgB,MAAM,EAAE,aAAa,CAAC;IAEtC;;OAEG;IACH,SAAgB,QAAQ,EAAE,eAAe,CAAC;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,kBAAkB,CAAC;IAEhD;;OAEG;IACH,SAAgB,cAAc,EAAE,qBAAqB,CAAC;IAEtD;;;OAGG;IACH,SAAgB,YAAY,EAAE,mBAAmB,CAAC;IAElD;;;OAGG;IACH,SAAgB,iBAAiB,EAAE,wBAAwB,CAAC;gBAEhD,aAAa,CAAC,EAAE,mBAAmB;CAY/C"}
|
package/dist/groups/Private.js
CHANGED
|
@@ -8,7 +8,8 @@ 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 {
|
|
11
|
+
import { PrivateExtendedData } from './Private/PrivateExtendedData';
|
|
12
|
+
import { PrivateTestCaseArchiving } from './Private/PrivateTestCaseArchiving';
|
|
12
13
|
/**
|
|
13
14
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
14
15
|
*
|
|
@@ -24,6 +25,7 @@ export class PrivateGroup extends PrivateBase {
|
|
|
24
25
|
this.Versions = new PrivateVersions(apiConnection);
|
|
25
26
|
this.Attachments = new PrivateAttachments(apiConnection);
|
|
26
27
|
this.VersionControl = new PrivateVersionControl(apiConnection);
|
|
27
|
-
this.
|
|
28
|
+
this.ExtendedData = new PrivateExtendedData(apiConnection);
|
|
29
|
+
this.TestCaseArchiving = new PrivateTestCaseArchiving(apiConnection);
|
|
28
30
|
}
|
|
29
31
|
}
|
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.8",
|
|
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",
|
|
@@ -43,4 +43,3 @@
|
|
|
43
43
|
"README.md"
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
|
-
|
package/dist/types.d.ts
CHANGED
|
@@ -2176,4 +2176,166 @@ export interface UpdateTestExecutionIterationRequest {
|
|
|
2176
2176
|
*/
|
|
2177
2177
|
iterationId: number | null;
|
|
2178
2178
|
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Get test execution version request for private API
|
|
2181
|
+
* Supplements public getTestExecution() with version data
|
|
2182
|
+
*/
|
|
2183
|
+
export interface GetTestExecutionVersionRequest {
|
|
2184
|
+
/**
|
|
2185
|
+
* Test execution key (e.g., "M12-E1")
|
|
2186
|
+
*/
|
|
2187
|
+
testExecutionKey: string;
|
|
2188
|
+
/**
|
|
2189
|
+
* Jira project ID (numeric, not the project key)
|
|
2190
|
+
*/
|
|
2191
|
+
projectId: number;
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Test execution version response from private API
|
|
2195
|
+
*/
|
|
2196
|
+
export interface TestExecutionVersionResponse {
|
|
2197
|
+
/**
|
|
2198
|
+
* Numeric ID of the test execution
|
|
2199
|
+
*/
|
|
2200
|
+
id: number;
|
|
2201
|
+
/**
|
|
2202
|
+
* Test execution key (e.g., "M12-E1")
|
|
2203
|
+
*/
|
|
2204
|
+
key: string;
|
|
2205
|
+
/**
|
|
2206
|
+
* Jira version ID (release version) if set, null if not set
|
|
2207
|
+
*/
|
|
2208
|
+
jiraVersionId: number | null;
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Update test execution version request for private API
|
|
2212
|
+
* Supplements public updateTestExecution() with version data
|
|
2213
|
+
*/
|
|
2214
|
+
export interface UpdateTestExecutionVersionRequest {
|
|
2215
|
+
/**
|
|
2216
|
+
* Test execution key (e.g., "M12-E1")
|
|
2217
|
+
*/
|
|
2218
|
+
testExecutionKey: string;
|
|
2219
|
+
/**
|
|
2220
|
+
* Jira project ID (numeric, not the project key)
|
|
2221
|
+
*/
|
|
2222
|
+
projectId: number;
|
|
2223
|
+
/**
|
|
2224
|
+
* Jira version ID to set, or null to clear the version
|
|
2225
|
+
*/
|
|
2226
|
+
jiraVersionId: number | null;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Private API archived test case status
|
|
2230
|
+
*/
|
|
2231
|
+
export interface PrivateArchivedTestCaseStatus {
|
|
2232
|
+
id: number;
|
|
2233
|
+
name: string;
|
|
2234
|
+
color: string;
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Private API archived test case priority
|
|
2238
|
+
*/
|
|
2239
|
+
export interface PrivateArchivedTestCasePriority {
|
|
2240
|
+
id: number;
|
|
2241
|
+
name: string;
|
|
2242
|
+
color: string;
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Private API archived test case last test result status
|
|
2246
|
+
*/
|
|
2247
|
+
export interface PrivateArchivedTestCaseLastTestResultStatus {
|
|
2248
|
+
name: string;
|
|
2249
|
+
color: string;
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Private API archived test case custom field value
|
|
2253
|
+
*/
|
|
2254
|
+
export interface PrivateArchivedTestCaseCustomFieldValue {
|
|
2255
|
+
customFieldId: number;
|
|
2256
|
+
stringValue?: string;
|
|
2257
|
+
intValue?: number;
|
|
2258
|
+
decimalValue?: number;
|
|
2259
|
+
booleanValue?: boolean;
|
|
2260
|
+
dateValue?: string;
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Private API archived test case (from search endpoint)
|
|
2264
|
+
*/
|
|
2265
|
+
export interface PrivateArchivedTestCase {
|
|
2266
|
+
id: number;
|
|
2267
|
+
key: string;
|
|
2268
|
+
projectId: number;
|
|
2269
|
+
name: string;
|
|
2270
|
+
majorVersion: number;
|
|
2271
|
+
owner?: string;
|
|
2272
|
+
componentId?: string;
|
|
2273
|
+
estimatedTime?: number;
|
|
2274
|
+
createdBy: string;
|
|
2275
|
+
createdOn: string;
|
|
2276
|
+
updatedOn?: string;
|
|
2277
|
+
updatedBy?: string;
|
|
2278
|
+
status?: PrivateArchivedTestCaseStatus;
|
|
2279
|
+
priority?: PrivateArchivedTestCasePriority;
|
|
2280
|
+
labels?: string[];
|
|
2281
|
+
lastTestResultStatus?: PrivateArchivedTestCaseLastTestResultStatus;
|
|
2282
|
+
customFieldValues?: PrivateArchivedTestCaseCustomFieldValue[];
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Private API archived test case search response
|
|
2286
|
+
*/
|
|
2287
|
+
export interface PrivateArchivedTestCaseSearchResponse {
|
|
2288
|
+
maxResults: number;
|
|
2289
|
+
startAt: number;
|
|
2290
|
+
total: number;
|
|
2291
|
+
results: PrivateArchivedTestCase[];
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Get archived test cases request for private API
|
|
2295
|
+
*/
|
|
2296
|
+
export interface GetArchivedTestCasesRequest {
|
|
2297
|
+
/**
|
|
2298
|
+
* Jira project ID (numeric, not the project key)
|
|
2299
|
+
*/
|
|
2300
|
+
projectId: number;
|
|
2301
|
+
/**
|
|
2302
|
+
* Maximum number of results to return (default: 50)
|
|
2303
|
+
*/
|
|
2304
|
+
maxResults?: number;
|
|
2305
|
+
/**
|
|
2306
|
+
* Zero-indexed starting position (default: 0)
|
|
2307
|
+
*/
|
|
2308
|
+
startAt?: number;
|
|
2309
|
+
/**
|
|
2310
|
+
* Optional query string for filtering (e.g., "testCase.name CONTAINS 'test'")
|
|
2311
|
+
* If not provided, defaults to ordering by name ASC
|
|
2312
|
+
*/
|
|
2313
|
+
query?: string;
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* Archive test cases request for private API
|
|
2317
|
+
*/
|
|
2318
|
+
export interface ArchiveTestCasesRequest {
|
|
2319
|
+
/**
|
|
2320
|
+
* Jira project ID (numeric, not the project key)
|
|
2321
|
+
*/
|
|
2322
|
+
projectId: number;
|
|
2323
|
+
/**
|
|
2324
|
+
* Array of test case IDs to archive
|
|
2325
|
+
*/
|
|
2326
|
+
testCaseIds: number[];
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Unarchive test cases request for private API
|
|
2330
|
+
*/
|
|
2331
|
+
export interface UnarchiveTestCasesRequest {
|
|
2332
|
+
/**
|
|
2333
|
+
* Jira project ID (numeric, not the project key)
|
|
2334
|
+
*/
|
|
2335
|
+
projectId: number;
|
|
2336
|
+
/**
|
|
2337
|
+
* Array of test case IDs to unarchive
|
|
2338
|
+
*/
|
|
2339
|
+
testCaseIds: number[];
|
|
2340
|
+
}
|
|
2179
2341
|
//# sourceMappingURL=types.d.ts.map
|