@rbaileysr/zephyr-managed-api 1.3.6 → 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.
@@ -16,46 +16,62 @@ export class PrivateConfig extends PrivateBase {
16
16
  this.DataSets = new PrivateDataSets(apiConnection);
17
17
  }
18
18
  /**
19
- * Archive a config item (Environment or Iteration) using private API
19
+ * Archive a config item using private API
20
20
  *
21
- * Archives an Environment or Iteration by setting its `isArchived` flag to `true`.
21
+ * Archives a config item (Environment, Iteration, or Status) by setting its `isArchived` flag to `true`.
22
+ *
23
+ * Supported config types:
24
+ * - 'Environment' - Archive an environment
25
+ * - 'Iteration' - Archive an iteration
26
+ * - 'TestCaseStatus' - Archive a test case status
27
+ * - 'TestPlanStatus' - Archive a test plan status
28
+ * - 'TestCycleStatus' - Archive a test cycle status
29
+ * - 'TestExecutionStatus' - Archive a test execution status
22
30
  *
23
31
  * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
24
32
  * The endpoint may change or be removed at any time without notice.
25
33
  *
26
34
  * @param credentials - Private API credentials
27
35
  * @param request - Archive config request
28
- * @param request.type - Type of config item: 'Environment' or 'Iteration'
29
- * @param request.id - Numeric ID of the environment or iteration to archive
36
+ * @param request.type - Type of config item: 'Environment', 'Iteration', 'TestCaseStatus', 'TestPlanStatus', 'TestCycleStatus', or 'TestExecutionStatus'
37
+ * @param request.id - Numeric ID of the config item to archive
30
38
  * @param request.projectId - Jira project ID (numeric, not the project key)
31
39
  * @returns Archive response with the ID of the archived item
32
40
  * @throws {BadRequestError} If the request is invalid
33
41
  * @throws {UnauthorizedError} If authentication fails
34
42
  * @throws {ForbiddenError} If the user doesn't have permission
35
- * @throws {NotFoundError} If the environment or iteration is not found
43
+ * @throws {NotFoundError} If the config item is not found
36
44
  * @throws {ServerError} If the server returns an error
37
45
  */
38
46
  async archiveConfig(credentials, request) {
39
47
  return this.updateArchiveStatus(credentials, request, true);
40
48
  }
41
49
  /**
42
- * Unarchive a config item (Environment or Iteration) using private API
50
+ * Unarchive a config item using private API
51
+ *
52
+ * Unarchives a config item (Environment, Iteration, or Status) by setting its `isArchived` flag to `false`.
43
53
  *
44
- * Unarchives an Environment or Iteration by setting its `isArchived` flag to `false`.
54
+ * Supported config types:
55
+ * - 'Environment' - Unarchive an environment
56
+ * - 'Iteration' - Unarchive an iteration
57
+ * - 'TestCaseStatus' - Unarchive a test case status
58
+ * - 'TestPlanStatus' - Unarchive a test plan status
59
+ * - 'TestCycleStatus' - Unarchive a test cycle status
60
+ * - 'TestExecutionStatus' - Unarchive a test execution status
45
61
  *
46
62
  * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
47
63
  * The endpoint may change or be removed at any time without notice.
48
64
  *
49
65
  * @param credentials - Private API credentials
50
66
  * @param request - Archive config request (same interface as archive, but sets isArchived to false)
51
- * @param request.type - Type of config item: 'Environment' or 'Iteration'
52
- * @param request.id - Numeric ID of the environment or iteration to unarchive
67
+ * @param request.type - Type of config item: 'Environment', 'Iteration', 'TestCaseStatus', 'TestPlanStatus', 'TestCycleStatus', or 'TestExecutionStatus'
68
+ * @param request.id - Numeric ID of the config item to unarchive
53
69
  * @param request.projectId - Jira project ID (numeric, not the project key)
54
70
  * @returns Archive response with the ID of the unarchived item
55
71
  * @throws {BadRequestError} If the request is invalid
56
72
  * @throws {UnauthorizedError} If authentication fails
57
73
  * @throws {ForbiddenError} If the user doesn't have permission
58
- * @throws {NotFoundError} If the environment or iteration is not found
74
+ * @throws {NotFoundError} If the config item is not found
59
75
  * @throws {ServerError} If the server returns an error
60
76
  */
61
77
  async unarchiveConfig(credentials, request) {
@@ -67,8 +83,16 @@ export class PrivateConfig extends PrivateBase {
67
83
  async updateArchiveStatus(credentials, request, isArchived) {
68
84
  // Get Context JWT
69
85
  const contextJwt = await this.getContextJwt(credentials);
70
- // Determine endpoint based on type
71
- const endpoint = request.type.toLowerCase(); // 'environment' or 'iteration'
86
+ // Map config type to endpoint path
87
+ const endpointMap = {
88
+ Environment: 'environment',
89
+ Iteration: 'iteration',
90
+ TestCaseStatus: 'testcasestatus',
91
+ TestPlanStatus: 'testplanstatus',
92
+ TestCycleStatus: 'testrunstatus',
93
+ TestExecutionStatus: 'testresultstatus',
94
+ };
95
+ const endpoint = endpointMap[request.type];
72
96
  const url = `${this.privateApiBaseUrl}/${endpoint}/${request.id}`;
73
97
  const headers = {
74
98
  'Content-Type': 'application/json',
@@ -0,0 +1,229 @@
1
+ /*!
2
+ * Copyright Adaptavist 2025 (c) All rights reserved
3
+ */
4
+ /**
5
+ * Private API Extended Data sub-group
6
+ * Supplements public API with extended data (iterations, versions) for Test Cycles and Test Executions
7
+ *
8
+ * ⚠️ WARNING: These methods use private APIs that are not officially supported.
9
+ */
10
+ import type { PrivateApiCredentials, GetTestCycleIterationRequest, TestCycleIterationResponse, UpdateTestCycleIterationRequest, GetTestExecutionIterationRequest, TestExecutionIterationResponse, UpdateTestExecutionIterationRequest, GetTestExecutionVersionRequest, TestExecutionVersionResponse, UpdateTestExecutionVersionRequest } from '../../types';
11
+ import type { ZephyrApiConnection } from '../../index';
12
+ import { PrivateBase } from './PrivateBase';
13
+ export declare class PrivateExtendedData extends PrivateBase {
14
+ constructor(apiConnection?: ZephyrApiConnection);
15
+ /**
16
+ * Get test cycle iteration using private API
17
+ *
18
+ * Retrieves iteration data for a test cycle that is not available in the public API.
19
+ * Use this to supplement the public `getTestCycle()` response with iteration information.
20
+ *
21
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
22
+ * The endpoint may change or be removed at any time without notice.
23
+ *
24
+ * @param credentials - Private API credentials
25
+ * @param request - Get test cycle iteration request
26
+ * @param request.testCycleKey - Test cycle key (e.g., "M12-R1")
27
+ * @param request.projectId - Jira project ID (numeric, not the project key)
28
+ * @returns Test cycle iteration response with iterationId (null if not set)
29
+ * @throws {BadRequestError} If the request is invalid
30
+ * @throws {UnauthorizedError} If authentication fails
31
+ * @throws {ForbiddenError} If the user doesn't have permission
32
+ * @throws {NotFoundError} If the test cycle is not found
33
+ * @throws {ServerError} If the server returns an error
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * // Get iteration for a test cycle (supplements public getTestCycle)
38
+ * const publicData = await api.TestCycle.getTestCycle({ key: 'M12-R1' });
39
+ * const iterationData = await api.Private.IterationData.getTestCycleIteration(credentials, {
40
+ * testCycleKey: 'M12-R1',
41
+ * projectId: 10313
42
+ * });
43
+ * console.log('Iteration ID:', iterationData.iterationId);
44
+ * ```
45
+ */
46
+ getTestCycleIteration(credentials: PrivateApiCredentials, request: GetTestCycleIterationRequest): Promise<TestCycleIterationResponse>;
47
+ /**
48
+ * Update test cycle iteration using private API
49
+ *
50
+ * Sets or clears the iteration for a test cycle. Use this to supplement
51
+ * a test cycle created via the public API with iteration data.
52
+ *
53
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
54
+ * The endpoint may change or be removed at any time without notice.
55
+ *
56
+ * @param credentials - Private API credentials
57
+ * @param request - Update test cycle iteration request
58
+ * @param request.testCycleKey - Test cycle key (e.g., "M12-R1")
59
+ * @param request.projectId - Jira project ID (numeric, not the project key)
60
+ * @param request.iterationId - Iteration ID to set, or null to clear
61
+ * @throws {BadRequestError} If the request is invalid
62
+ * @throws {UnauthorizedError} If authentication fails
63
+ * @throws {ForbiddenError} If the user doesn't have permission
64
+ * @throws {NotFoundError} If the test cycle is not found
65
+ * @throws {ServerError} If the server returns an error
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * // Create test cycle with public API, then set iteration with private API
70
+ * const testCycle = await api.TestCycle.createTestCycle({
71
+ * projectKey: 'M12',
72
+ * name: 'Sprint 1 Testing'
73
+ * });
74
+ *
75
+ * // Set iteration using private API
76
+ * await api.Private.IterationData.updateTestCycleIteration(credentials, {
77
+ * testCycleKey: testCycle.key,
78
+ * projectId: 10313,
79
+ * iterationId: 10952254
80
+ * });
81
+ * ```
82
+ */
83
+ updateTestCycleIteration(credentials: PrivateApiCredentials, request: UpdateTestCycleIterationRequest): Promise<void>;
84
+ /**
85
+ * Get test execution iteration using private API
86
+ *
87
+ * Retrieves iteration data for a test execution that is not available in the public API.
88
+ * Use this to supplement the public `getTestExecution()` response with iteration information.
89
+ *
90
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
91
+ * The endpoint may change or be removed at any time without notice.
92
+ *
93
+ * @param credentials - Private API credentials
94
+ * @param request - Get test execution iteration request
95
+ * @param request.testExecutionKey - Test execution key (e.g., "M12-E1")
96
+ * @param request.projectId - Jira project ID (numeric, not the project key)
97
+ * @returns Test execution iteration response with iterationId (null if not set)
98
+ * @throws {BadRequestError} If the request is invalid
99
+ * @throws {UnauthorizedError} If authentication fails
100
+ * @throws {ForbiddenError} If the user doesn't have permission
101
+ * @throws {NotFoundError} If the test execution is not found
102
+ * @throws {ServerError} If the server returns an error
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * // Get iteration for a test execution (supplements public getTestExecution)
107
+ * const publicData = await api.TestExecution.getTestExecution({ key: 'M12-E1' });
108
+ * const iterationData = await api.Private.IterationData.getTestExecutionIteration(credentials, {
109
+ * testExecutionKey: 'M12-E1',
110
+ * projectId: 10313
111
+ * });
112
+ * console.log('Iteration ID:', iterationData.iterationId);
113
+ * ```
114
+ */
115
+ getTestExecutionIteration(credentials: PrivateApiCredentials, request: GetTestExecutionIterationRequest): Promise<TestExecutionIterationResponse>;
116
+ /**
117
+ * Update test execution iteration using private API
118
+ *
119
+ * Sets or clears the iteration for a test execution. Use this to supplement
120
+ * a test execution created via the public API with iteration data.
121
+ *
122
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
123
+ * The endpoint may change or be removed at any time without notice.
124
+ *
125
+ * @param credentials - Private API credentials
126
+ * @param request - Update test execution iteration request
127
+ * @param request.testExecutionKey - Test execution key (e.g., "M12-E1")
128
+ * @param request.projectId - Jira project ID (numeric, not the project key)
129
+ * @param request.iterationId - Iteration ID to set, or null to clear
130
+ * @throws {BadRequestError} If the request is invalid
131
+ * @throws {UnauthorizedError} If authentication fails
132
+ * @throws {ForbiddenError} If the user doesn't have permission
133
+ * @throws {NotFoundError} If the test execution is not found
134
+ * @throws {ServerError} If the server returns an error
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * // Create test execution with public API (returns void), then set iteration with private API
139
+ * await api.TestExecution.createTestExecution({
140
+ * projectKey: 'M12',
141
+ * testCaseKey: 'M12-T1',
142
+ * testCycleKey: 'M12-R1',
143
+ * statusName: 'Pass'
144
+ * });
145
+ *
146
+ * // Note: createTestExecution returns no data, so use known key or look up after creation
147
+ * // Set iteration using private API
148
+ * await api.Private.IterationData.updateTestExecutionIteration(credentials, {
149
+ * testExecutionKey: 'M12-E1', // Use known key or look up via listTestExecutions()
150
+ * projectId: 10313,
151
+ * iterationId: 10952254
152
+ * });
153
+ * ```
154
+ */
155
+ updateTestExecutionIteration(credentials: PrivateApiCredentials, request: UpdateTestExecutionIterationRequest): Promise<void>;
156
+ /**
157
+ * Get test execution version using private API
158
+ *
159
+ * Retrieves Jira version ID (release version) for a test execution that is not available in the public API.
160
+ * Use this to supplement the public `getTestExecution()` response with version information.
161
+ *
162
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
163
+ * The endpoint may change or be removed at any time without notice.
164
+ *
165
+ * @param credentials - Private API credentials
166
+ * @param request - Get test execution version request
167
+ * @param request.testExecutionKey - Test execution key (e.g., "M15-E3")
168
+ * @param request.projectId - Jira project ID (numeric, not the project key)
169
+ * @returns Test execution version response with jiraVersionId (null if not set)
170
+ * @throws {BadRequestError} If the request is invalid
171
+ * @throws {UnauthorizedError} If authentication fails
172
+ * @throws {ForbiddenError} If the user doesn't have permission
173
+ * @throws {NotFoundError} If the test execution is not found
174
+ * @throws {ServerError} If the server returns an error
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * // Get version for a test execution (supplements public getTestExecution)
179
+ * const publicData = await api.TestExecution.getTestExecution({ key: 'M15-E3' });
180
+ * const versionData = await api.Private.IterationData.getTestExecutionVersion(credentials, {
181
+ * testExecutionKey: 'M15-E3',
182
+ * projectId: 10316
183
+ * });
184
+ * console.log('Jira Version ID:', versionData.jiraVersionId);
185
+ * ```
186
+ */
187
+ getTestExecutionVersion(credentials: PrivateApiCredentials, request: GetTestExecutionVersionRequest): Promise<TestExecutionVersionResponse>;
188
+ /**
189
+ * Update test execution version using private API
190
+ *
191
+ * Sets or clears the Jira version ID (release version) for a test execution. Use this to supplement
192
+ * a test execution created via the public API with version data.
193
+ *
194
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
195
+ * The endpoint may change or be removed at any time without notice.
196
+ *
197
+ * @param credentials - Private API credentials
198
+ * @param request - Update test execution version request
199
+ * @param request.testExecutionKey - Test execution key (e.g., "M15-E3")
200
+ * @param request.projectId - Jira project ID (numeric, not the project key)
201
+ * @param request.jiraVersionId - Jira version ID to set, or null to clear
202
+ * @throws {BadRequestError} If the request is invalid
203
+ * @throws {UnauthorizedError} If authentication fails
204
+ * @throws {ForbiddenError} If the user doesn't have permission
205
+ * @throws {NotFoundError} If the test execution is not found
206
+ * @throws {ServerError} If the server returns an error
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * // Create test execution with public API (returns void), then set version with private API
211
+ * await api.TestExecution.createTestExecution({
212
+ * projectKey: 'M15',
213
+ * testCaseKey: 'M15-T3',
214
+ * testCycleKey: 'M15-R1',
215
+ * statusName: 'Pass'
216
+ * });
217
+ *
218
+ * // Note: createTestExecution returns no data, so use known key or look up after creation
219
+ * // Set version using private API
220
+ * await api.Private.IterationData.updateTestExecutionVersion(credentials, {
221
+ * testExecutionKey: 'M15-E3', // Use known key or look up via listTestExecutions()
222
+ * projectId: 10316,
223
+ * jiraVersionId: 10102
224
+ * });
225
+ * ```
226
+ */
227
+ updateTestExecutionVersion(credentials: PrivateApiCredentials, request: UpdateTestExecutionVersionRequest): Promise<void>;
228
+ }
229
+ //# sourceMappingURL=PrivateExtendedData.d.ts.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