@rbaileysr/zephyr-managed-api 1.2.1 → 1.2.9

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.
Files changed (38) hide show
  1. package/README.md +204 -879
  2. package/dist/README.md +204 -879
  3. package/dist/error-strategy.d.ts.map +1 -1
  4. package/dist/groups/All.d.ts.map +1 -1
  5. package/dist/groups/Automation.d.ts.map +1 -1
  6. package/dist/groups/Folder.d.ts.map +1 -1
  7. package/dist/groups/IssueLink.d.ts.map +1 -1
  8. package/dist/groups/Private/PrivateAttachments.d.ts +697 -0
  9. package/dist/groups/Private/PrivateAttachments.d.ts.map +1 -0
  10. package/dist/groups/Private/PrivateAttachments.js +2146 -0
  11. package/dist/groups/Private/PrivateAuthentication.d.ts +29 -0
  12. package/dist/groups/Private/PrivateAuthentication.d.ts.map +1 -0
  13. package/dist/groups/Private/PrivateAuthentication.js +24 -0
  14. package/dist/groups/Private/PrivateBase.d.ts +32 -0
  15. package/dist/groups/Private/PrivateBase.d.ts.map +1 -0
  16. package/dist/groups/Private/PrivateBase.js +77 -0
  17. package/dist/groups/Private/PrivateComments.d.ts +149 -0
  18. package/dist/groups/Private/PrivateComments.d.ts.map +1 -0
  19. package/dist/groups/Private/PrivateComments.js +493 -0
  20. package/dist/groups/Private/PrivateCustomFields.d.ts +54 -0
  21. package/dist/groups/Private/PrivateCustomFields.d.ts.map +1 -0
  22. package/dist/groups/Private/PrivateCustomFields.js +150 -0
  23. package/dist/groups/Private/PrivateVersions.d.ts +38 -0
  24. package/dist/groups/Private/PrivateVersions.d.ts.map +1 -0
  25. package/dist/groups/Private/PrivateVersions.js +99 -0
  26. package/dist/groups/Private.d.ts +18 -240
  27. package/dist/groups/Private.d.ts.map +1 -1
  28. package/dist/groups/Private.js +13 -756
  29. package/dist/groups/TestCase.d.ts.map +1 -1
  30. package/dist/groups/TestCycle.d.ts.map +1 -1
  31. package/dist/groups/TestExecution.d.ts.map +1 -1
  32. package/dist/groups/TestPlan.d.ts.map +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/package.json +1 -1
  35. package/dist/types.d.ts +340 -4
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/utils.d.ts.map +1 -1
  38. package/package.json +1 -1
@@ -0,0 +1,697 @@
1
+ /*!
2
+ * Copyright Adaptavist 2025 (c) All rights reserved
3
+ */
4
+ /**
5
+ * Private API Attachments sub-group
6
+ * Handles attachment operations for test cases, test cycles, and test plans
7
+ *
8
+ * ⚠️ WARNING: These methods use private APIs that are not officially supported.
9
+ */
10
+ import type { PrivateApiCredentials, GetTestCaseAttachmentsRequest, GetTestCaseAttachmentsResponse, DownloadAttachmentRequest, CreateTestCaseAttachmentRequest, GetTestCycleAttachmentsRequest, GetTestCycleAttachmentsResponse, DownloadTestCycleAttachmentRequest, CreateTestCycleAttachmentRequest, GetTestPlanAttachmentsRequest, GetTestPlanAttachmentsResponse, DownloadTestPlanAttachmentRequest, CreateTestPlanAttachmentRequest, GetTestStepAttachmentsRequest, GetTestStepAttachmentsResponse, DownloadTestStepAttachmentRequest, CreateTestStepAttachmentRequest, GetTestExecutionAttachmentsRequest, GetTestExecutionAttachmentsResponse, DownloadTestExecutionAttachmentRequest, CreateTestExecutionAttachmentRequest, GetTestExecutionStepAttachmentsRequest, GetTestExecutionStepAttachmentsResponse, DownloadTestExecutionStepAttachmentRequest, CreateTestExecutionStepAttachmentRequest } from '../../types';
11
+ import { PrivateBase } from './PrivateBase';
12
+ import type { ZephyrApiConnection } from '../../index';
13
+ export declare class PrivateAttachments extends PrivateBase {
14
+ constructor(apiConnection?: ZephyrApiConnection);
15
+ /**
16
+ * Get attachments for a test case using private API
17
+ *
18
+ * Retrieves all attachment details for a test case, including signed S3 URLs
19
+ * for downloading the attachments.
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 attachments request
26
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
27
+ * @param request.projectId - Jira project ID (numeric, not the project key)
28
+ * @returns Test case attachments response with array of attachment details
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 case is not found
33
+ * @throws {ServerError} If the server returns an error
34
+ * @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available
35
+ */
36
+ getTestCaseAttachments(credentials: PrivateApiCredentials, request: GetTestCaseAttachmentsRequest): Promise<GetTestCaseAttachmentsResponse>;
37
+ /**
38
+ * Download an attachment from a test case using private API
39
+ *
40
+ * Downloads an attachment file into memory. This method:
41
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
42
+ * 2. Downloads the file from the signed URL
43
+ * 3. Returns the file as a Blob
44
+ *
45
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
46
+ * The endpoints may change or be removed at any time without notice.
47
+ *
48
+ * @param credentials - Private API credentials
49
+ * @param request - Download attachment request
50
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
51
+ * @param request.projectId - Jira project ID (numeric, not the project key)
52
+ * @param request.attachmentId - Attachment ID (UUID string, e.g., 'c3f14125-638f-47f9-9211-12a9777c09e7')
53
+ * @returns Blob containing the attachment file data
54
+ * @throws {BadRequestError} If the request is invalid
55
+ * @throws {UnauthorizedError} If authentication fails
56
+ * @throws {ForbiddenError} If the user doesn't have permission
57
+ * @throws {NotFoundError} If the test case or attachment is not found
58
+ * @throws {ServerError} If the server returns an error
59
+ * @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available, or if download fails
60
+ */
61
+ downloadAttachment(credentials: PrivateApiCredentials, request: DownloadAttachmentRequest): Promise<Blob>;
62
+ /**
63
+ * Create an attachment for a test case using private API
64
+ *
65
+ * Uploads a file attachment to a test case. This involves:
66
+ * 1. Getting upload details (S3 credentials)
67
+ * 2. Uploading the file to S3
68
+ * 3. Saving attachment metadata
69
+ *
70
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
71
+ * The endpoints may change or be removed at any time without notice.
72
+ *
73
+ * @param credentials - Private API credentials
74
+ * @param request - Attachment creation request
75
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
76
+ * @param request.projectId - Jira project ID (numeric, not the project key)
77
+ * @param request.file - File to upload (Blob or ArrayBuffer)
78
+ * @param request.fileName - Name of the file
79
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
80
+ * @returns Attachment metadata response
81
+ * @throws {BadRequestError} If the request is invalid
82
+ * @throws {UnauthorizedError} If authentication fails
83
+ * @throws {ForbiddenError} If the user doesn't have permission
84
+ * @throws {NotFoundError} If the test case is not found
85
+ * @throws {ServerError} If the server returns an error
86
+ * @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available
87
+ */
88
+ createTestCaseAttachment(credentials: PrivateApiCredentials, request: CreateTestCaseAttachmentRequest): Promise<unknown>;
89
+ /**
90
+ * Get upload details for attachment upload
91
+ *
92
+ * Retrieves S3 upload credentials and configuration needed to upload an attachment.
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 contextJwt - Jira Context JWT token
98
+ * @returns Upload details including S3 bucket URL, credentials, and policy
99
+ * @throws {UnauthorizedError} If authentication fails
100
+ * @throws {ServerError} If the server returns an error
101
+ */
102
+ private getUploadDetails;
103
+ /**
104
+ * Upload file to S3
105
+ *
106
+ * Uploads a file to S3 using the credentials from upload details.
107
+ *
108
+ * @param upload - Upload details from getUploadDetails
109
+ * @param projectId - Jira project ID
110
+ * @param testCaseId - Numeric test case ID
111
+ * @param userAccountId - Atlassian account ID
112
+ * @param file - File to upload (Blob or ArrayBuffer)
113
+ * @param fileName - Name of the file
114
+ * @returns S3 upload information
115
+ * @throws {UnexpectedError} If upload fails
116
+ */
117
+ private uploadToS3;
118
+ /**
119
+ * Save attachment metadata
120
+ *
121
+ * Saves metadata for an uploaded attachment.
122
+ *
123
+ * @param contextJwt - Jira Context JWT token
124
+ * @param projectId - Jira project ID
125
+ * @param testCaseId - Numeric test case ID
126
+ * @param userAccountId - Atlassian account ID
127
+ * @param s3Key - S3 key from upload
128
+ * @param fileName - File name
129
+ * @param mimeType - MIME type
130
+ * @param fileSize - File size in bytes
131
+ * @returns Attachment metadata response
132
+ * @throws {BadRequestError} If the request is invalid
133
+ * @throws {UnauthorizedError} If authentication fails
134
+ * @throws {ServerError} If the server returns an error
135
+ */
136
+ private saveAttachmentMetadata;
137
+ /**
138
+ * Generate a UUID v4 (compatible with ScriptRunner Connect runtime)
139
+ *
140
+ * Uses crypto.getRandomValues() which is available in web standards
141
+ */
142
+ private generateUUID;
143
+ /**
144
+ * Get MIME type from file name
145
+ */
146
+ private getMimeType;
147
+ /**
148
+ * Get attachments for a test cycle using private API
149
+ *
150
+ * Retrieves all attachment details for a test cycle, including signed S3 URLs
151
+ * for downloading the attachments.
152
+ *
153
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
154
+ * The endpoint may change or be removed at any time without notice.
155
+ *
156
+ * @param credentials - Private API credentials
157
+ * @param request - Get attachments request
158
+ * @param request.testCycleKey - Test cycle key (e.g., 'PROJ-R1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
159
+ * @param request.projectId - Jira project ID (numeric, not the project key)
160
+ * @returns Test cycle attachments response with array of attachment details
161
+ * @throws {BadRequestError} If the request is invalid
162
+ * @throws {UnauthorizedError} If authentication fails
163
+ * @throws {ForbiddenError} If the user doesn't have permission
164
+ * @throws {NotFoundError} If the test cycle is not found
165
+ * @throws {ServerError} If the server returns an error
166
+ * @throws {UnexpectedError} If test cycle ID cannot be looked up from key and Zephyr Connector is not available
167
+ */
168
+ getTestCycleAttachments(credentials: PrivateApiCredentials, request: GetTestCycleAttachmentsRequest): Promise<GetTestCycleAttachmentsResponse>;
169
+ /**
170
+ * Download an attachment from a test cycle using private API
171
+ *
172
+ * Downloads an attachment file into memory. This method:
173
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
174
+ * 2. Downloads the file from the signed URL
175
+ * 3. Returns the file as a Blob
176
+ *
177
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
178
+ * The endpoints may change or be removed at any time without notice.
179
+ *
180
+ * @param credentials - Private API credentials
181
+ * @param request - Download attachment request
182
+ * @param request.testCycleKey - Test cycle key (e.g., 'PROJ-R1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
183
+ * @param request.projectId - Jira project ID (numeric, not the project key)
184
+ * @param request.attachmentId - Attachment ID (UUID string, e.g., '13fbe8bc-a87b-4db1-bf01-8b4451db79fb')
185
+ * @returns Blob containing the attachment file data
186
+ * @throws {BadRequestError} If the request is invalid
187
+ * @throws {UnauthorizedError} If authentication fails
188
+ * @throws {ForbiddenError} If the user doesn't have permission
189
+ * @throws {NotFoundError} If the test cycle or attachment is not found
190
+ * @throws {ServerError} If the server returns an error
191
+ * @throws {UnexpectedError} If test cycle ID cannot be looked up from key and Zephyr Connector is not available, or if download fails
192
+ */
193
+ downloadTestCycleAttachment(credentials: PrivateApiCredentials, request: DownloadTestCycleAttachmentRequest): Promise<Blob>;
194
+ /**
195
+ * Create an attachment for a test cycle using private API
196
+ *
197
+ * Uploads a file attachment to a test cycle. This involves:
198
+ * 1. Getting upload details (S3 credentials)
199
+ * 2. Uploading the file to S3
200
+ * 3. Saving attachment metadata
201
+ *
202
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
203
+ * The endpoints may change or be removed at any time without notice.
204
+ *
205
+ * @param credentials - Private API credentials
206
+ * @param request - Attachment creation request
207
+ * @param request.testCycleKey - Test cycle key (e.g., 'PROJ-R1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
208
+ * @param request.projectId - Jira project ID (numeric, not the project key)
209
+ * @param request.file - File to upload (Blob or ArrayBuffer)
210
+ * @param request.fileName - Name of the file
211
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
212
+ * @returns Attachment metadata response
213
+ * @throws {BadRequestError} If the request is invalid
214
+ * @throws {UnauthorizedError} If authentication fails
215
+ * @throws {ForbiddenError} If the user doesn't have permission
216
+ * @throws {NotFoundError} If the test cycle is not found
217
+ * @throws {ServerError} If the server returns an error
218
+ * @throws {UnexpectedError} If test cycle ID cannot be looked up from key and Zephyr Connector is not available
219
+ */
220
+ createTestCycleAttachment(credentials: PrivateApiCredentials, request: CreateTestCycleAttachmentRequest): Promise<unknown>;
221
+ /**
222
+ * Get attachments for a test plan using private API
223
+ *
224
+ * Retrieves all attachment details for a test plan, including signed S3 URLs
225
+ * for downloading the attachments.
226
+ *
227
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
228
+ * The endpoint may change or be removed at any time without notice.
229
+ *
230
+ * @param credentials - Private API credentials
231
+ * @param request - Get attachments request
232
+ * @param request.testPlanKey - Test plan key (e.g., 'PROJ-P1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
233
+ * @param request.projectId - Jira project ID (numeric, not the project key)
234
+ * @returns Test plan attachments response with array of attachment details
235
+ * @throws {BadRequestError} If the request is invalid
236
+ * @throws {UnauthorizedError} If authentication fails
237
+ * @throws {ForbiddenError} If the user doesn't have permission
238
+ * @throws {NotFoundError} If the test plan is not found
239
+ * @throws {ServerError} If the server returns an error
240
+ * @throws {UnexpectedError} If test plan ID cannot be looked up from key and Zephyr Connector is not available
241
+ */
242
+ getTestPlanAttachments(credentials: PrivateApiCredentials, request: GetTestPlanAttachmentsRequest): Promise<GetTestPlanAttachmentsResponse>;
243
+ /**
244
+ * Download an attachment from a test plan using private API
245
+ *
246
+ * Downloads an attachment file into memory. This method:
247
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
248
+ * 2. Downloads the file from the signed URL
249
+ * 3. Returns the file as a Blob
250
+ *
251
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
252
+ * The endpoints may change or be removed at any time without notice.
253
+ *
254
+ * @param credentials - Private API credentials
255
+ * @param request - Download attachment request
256
+ * @param request.testPlanKey - Test plan key (e.g., 'PROJ-P1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
257
+ * @param request.projectId - Jira project ID (numeric, not the project key)
258
+ * @param request.attachmentId - Attachment ID (UUID string)
259
+ * @returns Blob containing the attachment file data
260
+ * @throws {BadRequestError} If the request is invalid
261
+ * @throws {UnauthorizedError} If authentication fails
262
+ * @throws {ForbiddenError} If the user doesn't have permission
263
+ * @throws {NotFoundError} If the test plan or attachment is not found
264
+ * @throws {ServerError} If the server returns an error
265
+ * @throws {UnexpectedError} If test plan ID cannot be looked up from key and Zephyr Connector is not available, or if download fails
266
+ */
267
+ downloadTestPlanAttachment(credentials: PrivateApiCredentials, request: DownloadTestPlanAttachmentRequest): Promise<Blob>;
268
+ /**
269
+ * Create an attachment for a test plan using private API
270
+ *
271
+ * Uploads a file attachment to a test plan. This involves:
272
+ * 1. Getting upload details (S3 credentials)
273
+ * 2. Uploading the file to S3
274
+ * 3. Saving attachment metadata
275
+ *
276
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
277
+ * The endpoints may change or be removed at any time without notice.
278
+ *
279
+ * @param credentials - Private API credentials
280
+ * @param request - Attachment creation request
281
+ * @param request.testPlanKey - Test plan key (e.g., 'PROJ-P1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
282
+ * @param request.projectId - Jira project ID (numeric, not the project key)
283
+ * @param request.file - File to upload (Blob or ArrayBuffer)
284
+ * @param request.fileName - Name of the file
285
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
286
+ * @returns Attachment metadata response
287
+ * @throws {BadRequestError} If the request is invalid
288
+ * @throws {UnauthorizedError} If authentication fails
289
+ * @throws {ForbiddenError} If the user doesn't have permission
290
+ * @throws {NotFoundError} If the test plan is not found
291
+ * @throws {ServerError} If the server returns an error
292
+ * @throws {UnexpectedError} If test plan ID cannot be looked up from key and Zephyr Connector is not available
293
+ */
294
+ createTestPlanAttachment(credentials: PrivateApiCredentials, request: CreateTestPlanAttachmentRequest): Promise<unknown>;
295
+ /**
296
+ * Upload file to S3 for test cycle
297
+ *
298
+ * Uploads a file to S3 using the credentials from upload details.
299
+ * Uses "testrun" in the S3 key path.
300
+ *
301
+ * @param upload - Upload details from getUploadDetails
302
+ * @param projectId - Jira project ID
303
+ * @param testCycleId - Numeric test cycle ID
304
+ * @param userAccountId - Atlassian account ID
305
+ * @param file - File to upload (Blob or ArrayBuffer)
306
+ * @param fileName - Name of the file
307
+ * @returns S3 upload information
308
+ * @throws {UnexpectedError} If upload fails
309
+ */
310
+ private uploadToS3ForTestCycle;
311
+ /**
312
+ * Save test cycle attachment metadata
313
+ *
314
+ * Saves metadata for an uploaded test cycle attachment.
315
+ *
316
+ * @param contextJwt - Jira Context JWT token
317
+ * @param projectId - Jira project ID
318
+ * @param testCycleId - Numeric test cycle ID
319
+ * @param userAccountId - Atlassian account ID
320
+ * @param s3Key - S3 key from upload
321
+ * @param fileName - File name
322
+ * @param mimeType - MIME type
323
+ * @param fileSize - File size in bytes
324
+ * @returns Attachment metadata response
325
+ * @throws {BadRequestError} If the request is invalid
326
+ * @throws {UnauthorizedError} If authentication fails
327
+ * @throws {ServerError} If the server returns an error
328
+ */
329
+ private saveTestCycleAttachmentMetadata;
330
+ /**
331
+ * Upload file to S3 for test plan
332
+ *
333
+ * Uploads a file to S3 using the credentials from upload details.
334
+ * Uses "testplan" in the S3 key path.
335
+ *
336
+ * @param upload - Upload details from getUploadDetails
337
+ * @param projectId - Jira project ID
338
+ * @param testPlanId - Numeric test plan ID
339
+ * @param userAccountId - Atlassian account ID
340
+ * @param file - File to upload (Blob or ArrayBuffer)
341
+ * @param fileName - Name of the file
342
+ * @returns S3 upload information
343
+ * @throws {UnexpectedError} If upload fails
344
+ */
345
+ private uploadToS3ForTestPlan;
346
+ /**
347
+ * Save test plan attachment metadata
348
+ *
349
+ * Saves metadata for an uploaded test plan attachment.
350
+ *
351
+ * @param contextJwt - Jira Context JWT token
352
+ * @param projectId - Jira project ID
353
+ * @param testPlanId - Numeric test plan ID
354
+ * @param userAccountId - Atlassian account ID
355
+ * @param s3Key - S3 key from upload
356
+ * @param fileName - File name
357
+ * @param mimeType - MIME type
358
+ * @param fileSize - File size in bytes
359
+ * @returns Attachment metadata response
360
+ * @throws {BadRequestError} If the request is invalid
361
+ * @throws {UnauthorizedError} If authentication fails
362
+ * @throws {ServerError} If the server returns an error
363
+ */
364
+ private saveTestPlanAttachmentMetadata;
365
+ /**
366
+ * Get attachments for a test step using private API
367
+ *
368
+ * Retrieves all attachment details for a specific test step within a test case.
369
+ * Attachments are retrieved by getting the test case with fields including testScript.steps.attachments.
370
+ *
371
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
372
+ * The endpoint may change or be removed at any time without notice.
373
+ *
374
+ * @param credentials - Private API credentials
375
+ * @param request - Get attachments request
376
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
377
+ * @param request.stepIndex - Zero-based index of the test step in the test case
378
+ * @param request.projectId - Jira project ID (numeric, not the project key)
379
+ * @returns Test step attachments response with array of attachment details
380
+ * @throws {BadRequestError} If the request is invalid
381
+ * @throws {UnauthorizedError} If authentication fails
382
+ * @throws {ForbiddenError} If the user doesn't have permission
383
+ * @throws {NotFoundError} If the test case or step is not found
384
+ * @throws {ServerError} If the server returns an error
385
+ * @throws {UnexpectedError} If the test case cannot be retrieved
386
+ */
387
+ getTestStepAttachments(credentials: PrivateApiCredentials, request: GetTestStepAttachmentsRequest): Promise<GetTestStepAttachmentsResponse>;
388
+ /**
389
+ * Download an attachment from a test step using private API
390
+ *
391
+ * Downloads an attachment file into memory. This method:
392
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
393
+ * 2. Downloads the file from the signed URL
394
+ * 3. Returns the file as a Blob
395
+ *
396
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
397
+ * The endpoints may change or be removed at any time without notice.
398
+ *
399
+ * @param credentials - Private API credentials
400
+ * @param request - Download attachment request
401
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
402
+ * @param request.stepIndex - Zero-based index of the test step in the test case
403
+ * @param request.projectId - Jira project ID (numeric, not the project key)
404
+ * @param request.attachmentId - Attachment ID (UUID string)
405
+ * @returns Blob containing the attachment file data
406
+ * @throws {BadRequestError} If the request is invalid
407
+ * @throws {UnauthorizedError} If authentication fails
408
+ * @throws {ForbiddenError} If the user doesn't have permission
409
+ * @throws {NotFoundError} If the test case, step, or attachment is not found
410
+ * @throws {ServerError} If the server returns an error
411
+ * @throws {UnexpectedError} If download fails
412
+ */
413
+ downloadTestStepAttachment(credentials: PrivateApiCredentials, request: DownloadTestStepAttachmentRequest): Promise<Blob>;
414
+ /**
415
+ * Create an attachment for a test step using private API
416
+ *
417
+ * Uploads a file attachment to a test step. This involves:
418
+ * 1. Getting upload details (S3 credentials)
419
+ * 2. Uploading the file to S3
420
+ * 3. Saving attachment metadata
421
+ *
422
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
423
+ * The endpoints may change or be removed at any time without notice.
424
+ *
425
+ * @param credentials - Private API credentials
426
+ * @param request - Attachment creation request
427
+ * @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
428
+ * @param request.stepIndex - Zero-based index of the test step in the test case
429
+ * @param request.projectId - Jira project ID (numeric, not the project key)
430
+ * @param request.file - File to upload (Blob or ArrayBuffer)
431
+ * @param request.fileName - Name of the file
432
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
433
+ * @returns Attachment metadata response
434
+ * @throws {BadRequestError} If the request is invalid
435
+ * @throws {UnauthorizedError} If authentication fails
436
+ * @throws {ForbiddenError} If the user doesn't have permission
437
+ * @throws {NotFoundError} If the test case or step is not found
438
+ * @throws {ServerError} If the server returns an error
439
+ */
440
+ createTestStepAttachment(credentials: PrivateApiCredentials, request: CreateTestStepAttachmentRequest): Promise<unknown>;
441
+ /**
442
+ * Get attachments for a test execution using private API
443
+ *
444
+ * Retrieves all attachment details for a test execution, including signed S3 URLs
445
+ * for downloading the attachments.
446
+ *
447
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
448
+ * The endpoint may change or be removed at any time without notice.
449
+ *
450
+ * @param credentials - Private API credentials
451
+ * @param request - Get attachments request
452
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
453
+ * @param request.projectId - Jira project ID (numeric, not the project key)
454
+ * @returns Test execution attachments response with array of attachment details
455
+ * @throws {BadRequestError} If the request is invalid
456
+ * @throws {UnauthorizedError} If authentication fails
457
+ * @throws {ForbiddenError} If the user doesn't have permission
458
+ * @throws {NotFoundError} If the test execution is not found
459
+ * @throws {ServerError} If the server returns an error
460
+ * @throws {UnexpectedError} If test execution ID cannot be looked up from key and Zephyr Connector is not available
461
+ */
462
+ getTestExecutionAttachments(credentials: PrivateApiCredentials, request: GetTestExecutionAttachmentsRequest): Promise<GetTestExecutionAttachmentsResponse>;
463
+ /**
464
+ * Download an attachment from a test execution using private API
465
+ *
466
+ * Downloads an attachment file into memory. This method:
467
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
468
+ * 2. Downloads the file from the signed URL
469
+ * 3. Returns the file as a Blob
470
+ *
471
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
472
+ * The endpoints may change or be removed at any time without notice.
473
+ *
474
+ * @param credentials - Private API credentials
475
+ * @param request - Download attachment request
476
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
477
+ * @param request.projectId - Jira project ID (numeric, not the project key)
478
+ * @param request.attachmentId - Attachment ID (UUID string)
479
+ * @returns Blob containing the attachment file data
480
+ * @throws {BadRequestError} If the request is invalid
481
+ * @throws {UnauthorizedError} If authentication fails
482
+ * @throws {ForbiddenError} If the user doesn't have permission
483
+ * @throws {NotFoundError} If the test execution or attachment is not found
484
+ * @throws {ServerError} If the server returns an error
485
+ * @throws {UnexpectedError} If test execution ID cannot be looked up from key and Zephyr Connector is not available, or if download fails
486
+ */
487
+ downloadTestExecutionAttachment(credentials: PrivateApiCredentials, request: DownloadTestExecutionAttachmentRequest): Promise<Blob>;
488
+ /**
489
+ * Create an attachment for a test execution using private API
490
+ *
491
+ * Uploads a file attachment to a test execution. This involves:
492
+ * 1. Getting upload details (S3 credentials)
493
+ * 2. Uploading the file to S3
494
+ * 3. Saving attachment metadata
495
+ *
496
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
497
+ * The endpoints may change or be removed at any time without notice.
498
+ *
499
+ * @param credentials - Private API credentials
500
+ * @param request - Attachment creation request
501
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1'). The numeric ID will be looked up automatically if Zephyr Connector is available.
502
+ * @param request.projectId - Jira project ID (numeric, not the project key)
503
+ * @param request.file - File to upload (Blob or ArrayBuffer)
504
+ * @param request.fileName - Name of the file
505
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
506
+ * @returns Attachment metadata response
507
+ * @throws {BadRequestError} If the request is invalid
508
+ * @throws {UnauthorizedError} If authentication fails
509
+ * @throws {ForbiddenError} If the user doesn't have permission
510
+ * @throws {NotFoundError} If the test execution is not found
511
+ * @throws {ServerError} If the server returns an error
512
+ * @throws {UnexpectedError} If test execution ID cannot be looked up from key and Zephyr Connector is not available
513
+ */
514
+ createTestExecutionAttachment(credentials: PrivateApiCredentials, request: CreateTestExecutionAttachmentRequest): Promise<unknown>;
515
+ /**
516
+ * Get attachments for a test execution step using private API
517
+ *
518
+ * Retrieves all attachment details for a specific test execution step (testScriptResult).
519
+ * Attachments are retrieved by getting the test execution with fields including testScriptResults.attachments.
520
+ *
521
+ * ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
522
+ * The endpoint may change or be removed at any time without notice.
523
+ *
524
+ * @param credentials - Private API credentials
525
+ * @param request - Get attachments request
526
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
527
+ * @param request.stepIndex - Zero-based index of the test execution step
528
+ * @param request.projectId - Jira project ID (numeric, not the project key)
529
+ * @returns Test execution step attachments response with array of attachment details
530
+ * @throws {BadRequestError} If the request is invalid
531
+ * @throws {UnauthorizedError} If authentication fails
532
+ * @throws {ForbiddenError} If the user doesn't have permission
533
+ * @throws {NotFoundError} If the test execution or step is not found
534
+ * @throws {ServerError} If the server returns an error
535
+ * @throws {UnexpectedError} If the test execution cannot be retrieved
536
+ */
537
+ getTestExecutionStepAttachments(credentials: PrivateApiCredentials, request: GetTestExecutionStepAttachmentsRequest): Promise<GetTestExecutionStepAttachmentsResponse>;
538
+ /**
539
+ * Download an attachment from a test execution step using private API
540
+ *
541
+ * Downloads an attachment file into memory. This method:
542
+ * 1. Gets fresh attachment details (including a fresh signed S3 URL)
543
+ * 2. Downloads the file from the signed URL
544
+ * 3. Returns the file as a Blob
545
+ *
546
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
547
+ * The endpoints may change or be removed at any time without notice.
548
+ *
549
+ * @param credentials - Private API credentials
550
+ * @param request - Download attachment request
551
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
552
+ * @param request.stepIndex - Zero-based index of the test execution step
553
+ * @param request.projectId - Jira project ID (numeric, not the project key)
554
+ * @param request.attachmentId - Attachment ID (UUID string)
555
+ * @returns Blob containing the attachment file data
556
+ * @throws {BadRequestError} If the request is invalid
557
+ * @throws {UnauthorizedError} If authentication fails
558
+ * @throws {ForbiddenError} If the user doesn't have permission
559
+ * @throws {NotFoundError} If the test execution, step, or attachment is not found
560
+ * @throws {ServerError} If the server returns an error
561
+ * @throws {UnexpectedError} If download fails
562
+ */
563
+ downloadTestExecutionStepAttachment(credentials: PrivateApiCredentials, request: DownloadTestExecutionStepAttachmentRequest): Promise<Blob>;
564
+ /**
565
+ * Create an attachment for a test execution step using private API
566
+ *
567
+ * Uploads a file attachment to a test execution step. This involves:
568
+ * 1. Getting upload details (S3 credentials)
569
+ * 2. Uploading the file to S3
570
+ * 3. Saving attachment metadata
571
+ *
572
+ * ⚠️ WARNING: This uses private Zephyr API endpoints that are not officially supported.
573
+ * The endpoints may change or be removed at any time without notice.
574
+ *
575
+ * @param credentials - Private API credentials
576
+ * @param request - Attachment creation request
577
+ * @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
578
+ * @param request.stepIndex - Zero-based index of the test execution step
579
+ * @param request.projectId - Jira project ID (numeric, not the project key)
580
+ * @param request.file - File to upload (Blob or ArrayBuffer)
581
+ * @param request.fileName - Name of the file
582
+ * @param request.userAccountId - Atlassian account ID (e.g., '5d6fdc98dc6e480dbc021aae')
583
+ * @returns Attachment metadata response
584
+ * @throws {BadRequestError} If the request is invalid
585
+ * @throws {UnauthorizedError} If authentication fails
586
+ * @throws {ForbiddenError} If the user doesn't have permission
587
+ * @throws {NotFoundError} If the test execution or step is not found
588
+ * @throws {ServerError} If the server returns an error
589
+ */
590
+ createTestExecutionStepAttachment(credentials: PrivateApiCredentials, request: CreateTestExecutionStepAttachmentRequest): Promise<unknown>;
591
+ /**
592
+ * Upload file to S3 for test step
593
+ *
594
+ * Uploads a file to S3 using the credentials from upload details.
595
+ * Uses "step" in the S3 key path.
596
+ *
597
+ * @param upload - Upload details from getUploadDetails
598
+ * @param projectId - Jira project ID
599
+ * @param stepId - Numeric test step ID
600
+ * @param userAccountId - Atlassian account ID
601
+ * @param file - File to upload (Blob or ArrayBuffer)
602
+ * @param fileName - Name of the file
603
+ * @returns S3 upload information
604
+ * @throws {UnexpectedError} If upload fails
605
+ */
606
+ private uploadToS3ForTestStep;
607
+ /**
608
+ * Save test step attachment metadata
609
+ *
610
+ * Saves metadata for an uploaded test step attachment.
611
+ *
612
+ * @param contextJwt - Jira Context JWT token
613
+ * @param projectId - Jira project ID
614
+ * @param stepId - Numeric test step ID
615
+ * @param userAccountId - Atlassian account ID
616
+ * @param s3Key - S3 key from upload
617
+ * @param fileName - File name
618
+ * @param mimeType - MIME type
619
+ * @param fileSize - File size in bytes
620
+ * @returns Attachment metadata response
621
+ * @throws {BadRequestError} If the request is invalid
622
+ * @throws {UnauthorizedError} If authentication fails
623
+ * @throws {ServerError} If the server returns an error
624
+ */
625
+ private saveTestStepAttachmentMetadata;
626
+ /**
627
+ * Upload file to S3 for test execution
628
+ *
629
+ * Uploads a file to S3 using the credentials from upload details.
630
+ * Uses "testresult" in the S3 key path.
631
+ *
632
+ * @param upload - Upload details from getUploadDetails
633
+ * @param projectId - Jira project ID
634
+ * @param testExecutionId - Numeric test execution ID
635
+ * @param userAccountId - Atlassian account ID
636
+ * @param file - File to upload (Blob or ArrayBuffer)
637
+ * @param fileName - Name of the file
638
+ * @returns S3 upload information
639
+ * @throws {UnexpectedError} If upload fails
640
+ */
641
+ private uploadToS3ForTestExecution;
642
+ /**
643
+ * Save test execution attachment metadata
644
+ *
645
+ * Saves metadata for an uploaded test execution attachment.
646
+ *
647
+ * @param contextJwt - Jira Context JWT token
648
+ * @param projectId - Jira project ID
649
+ * @param testExecutionId - Numeric test execution ID
650
+ * @param userAccountId - Atlassian account ID
651
+ * @param s3Key - S3 key from upload
652
+ * @param fileName - File name
653
+ * @param mimeType - MIME type
654
+ * @param fileSize - File size in bytes
655
+ * @returns Attachment metadata response
656
+ * @throws {BadRequestError} If the request is invalid
657
+ * @throws {UnauthorizedError} If authentication fails
658
+ * @throws {ServerError} If the server returns an error
659
+ */
660
+ private saveTestExecutionAttachmentMetadata;
661
+ /**
662
+ * Upload file to S3 for test execution step
663
+ *
664
+ * Uploads a file to S3 using the credentials from upload details.
665
+ * Uses "testscriptresult" in the S3 key path.
666
+ *
667
+ * @param upload - Upload details from getUploadDetails
668
+ * @param projectId - Jira project ID
669
+ * @param testScriptResultId - Numeric test script result ID
670
+ * @param userAccountId - Atlassian account ID
671
+ * @param file - File to upload (Blob or ArrayBuffer)
672
+ * @param fileName - Name of the file
673
+ * @returns S3 upload information
674
+ * @throws {UnexpectedError} If upload fails
675
+ */
676
+ private uploadToS3ForTestExecutionStep;
677
+ /**
678
+ * Save test execution step attachment metadata
679
+ *
680
+ * Saves metadata for an uploaded test execution step attachment.
681
+ *
682
+ * @param contextJwt - Jira Context JWT token
683
+ * @param projectId - Jira project ID
684
+ * @param testScriptResultId - Numeric test script result ID
685
+ * @param userAccountId - Atlassian account ID
686
+ * @param s3Key - S3 key from upload
687
+ * @param fileName - File name
688
+ * @param mimeType - MIME type
689
+ * @param fileSize - File size in bytes
690
+ * @returns Attachment metadata response
691
+ * @throws {BadRequestError} If the request is invalid
692
+ * @throws {UnauthorizedError} If authentication fails
693
+ * @throws {ServerError} If the server returns an error
694
+ */
695
+ private saveTestExecutionStepAttachmentMetadata;
696
+ }
697
+ //# sourceMappingURL=PrivateAttachments.d.ts.map