@rbaileysr/zephyr-managed-api 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -91
- package/dist/README.md +102 -91
- package/dist/error-strategy.d.ts.map +1 -1
- package/dist/groups/All.d.ts.map +1 -1
- package/dist/groups/Automation.d.ts.map +1 -1
- package/dist/groups/Folder.d.ts.map +1 -1
- package/dist/groups/IssueLink.d.ts.map +1 -1
- package/dist/groups/Private/PrivateAttachments.d.ts +8 -8
- package/dist/groups/Private/PrivateAttachments.d.ts.map +1 -1
- package/dist/groups/Private/PrivateAttachments.js +112 -75
- package/dist/groups/Private/PrivateBase.d.ts.map +1 -1
- package/dist/groups/Private/PrivateBase.js +1 -1
- package/dist/groups/Private/PrivateComments.d.ts.map +1 -1
- package/dist/groups/Private/PrivateComments.js +13 -13
- package/dist/groups/Private/PrivateCustomFields.d.ts.map +1 -1
- package/dist/groups/Private/PrivateCustomFields.js +5 -5
- package/dist/groups/Private/PrivateVersions.d.ts.map +1 -1
- package/dist/groups/Private/PrivateVersions.js +3 -3
- package/dist/groups/Private.d.ts +0 -184
- package/dist/groups/Private.d.ts.map +1 -1
- package/dist/groups/Private.js +0 -226
- package/dist/groups/TestCase.d.ts.map +1 -1
- package/dist/groups/TestCycle.d.ts.map +1 -1
- package/dist/groups/TestExecution.d.ts.map +1 -1
- package/dist/groups/TestPlan.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
9
|
*/
|
|
10
|
-
import type { PrivateApiCredentials, GetTestCaseAttachmentsRequest, GetTestCaseAttachmentsResponse, DownloadAttachmentRequest,
|
|
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
11
|
import { PrivateBase } from './PrivateBase';
|
|
12
12
|
import type { ZephyrApiConnection } from '../../index';
|
|
13
13
|
export declare class PrivateAttachments extends PrivateBase {
|
|
@@ -85,7 +85,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
85
85
|
* @throws {ServerError} If the server returns an error
|
|
86
86
|
* @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
createTestCaseAttachment(credentials: PrivateApiCredentials, request: CreateTestCaseAttachmentRequest): Promise<unknown>;
|
|
89
89
|
/**
|
|
90
90
|
* Get upload details for attachment upload
|
|
91
91
|
*
|
|
@@ -374,7 +374,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
374
374
|
* @param credentials - Private API credentials
|
|
375
375
|
* @param request - Get attachments request
|
|
376
376
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
377
|
-
* @param request.
|
|
377
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
378
378
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
379
379
|
* @returns Test step attachments response with array of attachment details
|
|
380
380
|
* @throws {BadRequestError} If the request is invalid
|
|
@@ -399,7 +399,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
399
399
|
* @param credentials - Private API credentials
|
|
400
400
|
* @param request - Download attachment request
|
|
401
401
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
402
|
-
* @param request.
|
|
402
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
403
403
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
404
404
|
* @param request.attachmentId - Attachment ID (UUID string)
|
|
405
405
|
* @returns Blob containing the attachment file data
|
|
@@ -425,7 +425,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
425
425
|
* @param credentials - Private API credentials
|
|
426
426
|
* @param request - Attachment creation request
|
|
427
427
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
428
|
-
* @param request.
|
|
428
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
429
429
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
430
430
|
* @param request.file - File to upload (Blob or ArrayBuffer)
|
|
431
431
|
* @param request.fileName - Name of the file
|
|
@@ -524,7 +524,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
524
524
|
* @param credentials - Private API credentials
|
|
525
525
|
* @param request - Get attachments request
|
|
526
526
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
527
|
-
* @param request.
|
|
527
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
528
528
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
529
529
|
* @returns Test execution step attachments response with array of attachment details
|
|
530
530
|
* @throws {BadRequestError} If the request is invalid
|
|
@@ -549,7 +549,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
549
549
|
* @param credentials - Private API credentials
|
|
550
550
|
* @param request - Download attachment request
|
|
551
551
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
552
|
-
* @param request.
|
|
552
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
553
553
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
554
554
|
* @param request.attachmentId - Attachment ID (UUID string)
|
|
555
555
|
* @returns Blob containing the attachment file data
|
|
@@ -575,7 +575,7 @@ export declare class PrivateAttachments extends PrivateBase {
|
|
|
575
575
|
* @param credentials - Private API credentials
|
|
576
576
|
* @param request - Attachment creation request
|
|
577
577
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
578
|
-
* @param request.
|
|
578
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
579
579
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
580
580
|
* @param request.file - File to upload (Blob or ArrayBuffer)
|
|
581
581
|
* @param request.fileName - Name of the file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateAttachments.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateAttachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"PrivateAttachments.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateAttachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAChC,6BAA6B,EAC7B,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,EAC/B,kCAAkC,EAClC,mCAAmC,EACnC,sCAAsC,EACtC,oCAAoC,EACpC,sCAAsC,EACtC,uCAA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;;;;;;;;OAuBG;IACG,+BAA+B,CACpC,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,sCAAsC,GAC7C,OAAO,CAAC,IAAI,CAAC;IA+ChB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,6BAA6B,CAClC,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,oCAAoC,GAC3C,OAAO,CAAC,OAAO,CAAC;IAqDnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,+BAA+B,CACpC,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,sCAAsC,GAC7C,OAAO,CAAC,uCAAuC,CAAC;IA+FnD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,mCAAmC,CACxC,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,0CAA0C,GACjD,OAAO,CAAC,IAAI,CAAC;IAgDhB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,iCAAiC,CACtC,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,wCAAwC,GAC/C,OAAO,CAAC,OAAO,CAAC;IAuDnB;;;;;;;;;;;;;;OAcG;YACW,qBAAqB;IAuEnC;;;;;;;;;;;;;;;;;OAiBG;YACW,8BAA8B;IAgE5C;;;;;;;;;;;;;;OAcG;YACW,0BAA0B;IAuExC;;;;;;;;;;;;;;;;;OAiBG;YACW,mCAAmC;IAgEjD;;;;;;;;;;;;;;OAcG;YACW,8BAA8B;IAuE5C;;;;;;;;;;;;;;;;;OAiBG;YACW,uCAAuC;CA+DrD"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
3
|
*/
|
|
4
4
|
import { PrivateBase } from './PrivateBase';
|
|
5
|
-
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError } from '../../utils';
|
|
5
|
+
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError, } from '../../utils';
|
|
6
6
|
export class PrivateAttachments extends PrivateBase {
|
|
7
7
|
constructor(apiConnection) {
|
|
8
8
|
super(apiConnection);
|
|
@@ -53,8 +53,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
53
53
|
const contextJwt = await this.getContextJwt(credentials);
|
|
54
54
|
const url = `${this.privateApiBaseUrl}/testcase/${testCaseId}?fields=attachments`;
|
|
55
55
|
const headers = {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
accept: 'application/json',
|
|
57
|
+
authorization: `JWT ${contextJwt}`,
|
|
58
58
|
'jira-project-id': String(request.projectId),
|
|
59
59
|
};
|
|
60
60
|
try {
|
|
@@ -77,7 +77,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
77
77
|
}
|
|
78
78
|
throw new ServerError(`Failed to get test case attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
79
79
|
}
|
|
80
|
-
return await response.json();
|
|
80
|
+
return (await response.json());
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
83
83
|
if (error instanceof BadRequestError ||
|
|
@@ -144,9 +144,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
144
144
|
return await downloadResponse.blob();
|
|
145
145
|
}
|
|
146
146
|
catch (error) {
|
|
147
|
-
if (error instanceof ForbiddenError ||
|
|
148
|
-
error instanceof NotFoundError ||
|
|
149
|
-
error instanceof ServerError) {
|
|
147
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
150
148
|
throw error;
|
|
151
149
|
}
|
|
152
150
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -178,7 +176,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
178
176
|
* @throws {ServerError} If the server returns an error
|
|
179
177
|
* @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available
|
|
180
178
|
*/
|
|
181
|
-
async
|
|
179
|
+
async createTestCaseAttachment(credentials, request) {
|
|
182
180
|
// Get test case ID from key if we have API connection
|
|
183
181
|
let testCaseId;
|
|
184
182
|
if (this.testCaseGroup) {
|
|
@@ -224,8 +222,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
224
222
|
async getUploadDetails(contextJwt) {
|
|
225
223
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/uploaddetails/attachment';
|
|
226
224
|
const headers = {
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
Authorization: `JWT ${contextJwt}`,
|
|
226
|
+
Accept: 'application/json',
|
|
229
227
|
};
|
|
230
228
|
try {
|
|
231
229
|
const response = await fetch(url, {
|
|
@@ -238,7 +236,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
238
236
|
}
|
|
239
237
|
throw new ServerError(`Failed to get upload details. Status: ${response.status}`, response.status, response.statusText);
|
|
240
238
|
}
|
|
241
|
-
return await response.json();
|
|
239
|
+
return (await response.json());
|
|
242
240
|
}
|
|
243
241
|
catch (error) {
|
|
244
242
|
if (error instanceof UnauthorizedError || error instanceof ServerError) {
|
|
@@ -338,10 +336,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
338
336
|
async saveAttachmentMetadata(contextJwt, projectId, testCaseId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
339
337
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
340
338
|
const headers = {
|
|
341
|
-
|
|
339
|
+
Authorization: `JWT ${contextJwt}`,
|
|
342
340
|
'jira-project-id': String(projectId),
|
|
343
341
|
'Content-Type': 'application/json',
|
|
344
|
-
|
|
342
|
+
Accept: 'application/json',
|
|
345
343
|
};
|
|
346
344
|
const createdOn = new Date().toISOString();
|
|
347
345
|
const payload = {
|
|
@@ -471,8 +469,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
471
469
|
const contextJwt = await this.getContextJwt(credentials);
|
|
472
470
|
const url = `${this.privateApiBaseUrl}/testrun/${testCycleId}?fields=attachments`;
|
|
473
471
|
const headers = {
|
|
474
|
-
|
|
475
|
-
|
|
472
|
+
accept: 'application/json',
|
|
473
|
+
authorization: `JWT ${contextJwt}`,
|
|
476
474
|
'jira-project-id': String(request.projectId),
|
|
477
475
|
};
|
|
478
476
|
try {
|
|
@@ -495,7 +493,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
495
493
|
}
|
|
496
494
|
throw new ServerError(`Failed to get test cycle attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
497
495
|
}
|
|
498
|
-
return await response.json();
|
|
496
|
+
return (await response.json());
|
|
499
497
|
}
|
|
500
498
|
catch (error) {
|
|
501
499
|
if (error instanceof BadRequestError ||
|
|
@@ -562,9 +560,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
562
560
|
return await downloadResponse.blob();
|
|
563
561
|
}
|
|
564
562
|
catch (error) {
|
|
565
|
-
if (error instanceof ForbiddenError ||
|
|
566
|
-
error instanceof NotFoundError ||
|
|
567
|
-
error instanceof ServerError) {
|
|
563
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
568
564
|
throw error;
|
|
569
565
|
}
|
|
570
566
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -672,8 +668,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
672
668
|
const contextJwt = await this.getContextJwt(credentials);
|
|
673
669
|
const url = `${this.privateApiBaseUrl}/testplan/${testPlanId}?fields=attachments`;
|
|
674
670
|
const headers = {
|
|
675
|
-
|
|
676
|
-
|
|
671
|
+
accept: 'application/json',
|
|
672
|
+
authorization: `JWT ${contextJwt}`,
|
|
677
673
|
'jira-project-id': String(request.projectId),
|
|
678
674
|
};
|
|
679
675
|
try {
|
|
@@ -696,7 +692,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
696
692
|
}
|
|
697
693
|
throw new ServerError(`Failed to get test plan attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
698
694
|
}
|
|
699
|
-
return await response.json();
|
|
695
|
+
return (await response.json());
|
|
700
696
|
}
|
|
701
697
|
catch (error) {
|
|
702
698
|
if (error instanceof BadRequestError ||
|
|
@@ -763,9 +759,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
763
759
|
return await downloadResponse.blob();
|
|
764
760
|
}
|
|
765
761
|
catch (error) {
|
|
766
|
-
if (error instanceof ForbiddenError ||
|
|
767
|
-
error instanceof NotFoundError ||
|
|
768
|
-
error instanceof ServerError) {
|
|
762
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
769
763
|
throw error;
|
|
770
764
|
}
|
|
771
765
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -920,10 +914,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
920
914
|
async saveTestCycleAttachmentMetadata(contextJwt, projectId, testCycleId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
921
915
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
922
916
|
const headers = {
|
|
923
|
-
|
|
917
|
+
Authorization: `JWT ${contextJwt}`,
|
|
924
918
|
'jira-project-id': String(projectId),
|
|
925
919
|
'Content-Type': 'application/json',
|
|
926
|
-
|
|
920
|
+
Accept: 'application/json',
|
|
927
921
|
};
|
|
928
922
|
const createdOn = new Date().toISOString();
|
|
929
923
|
const payload = {
|
|
@@ -1055,10 +1049,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1055
1049
|
async saveTestPlanAttachmentMetadata(contextJwt, projectId, testPlanId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
1056
1050
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
1057
1051
|
const headers = {
|
|
1058
|
-
|
|
1052
|
+
Authorization: `JWT ${contextJwt}`,
|
|
1059
1053
|
'jira-project-id': String(projectId),
|
|
1060
1054
|
'Content-Type': 'application/json',
|
|
1061
|
-
|
|
1055
|
+
Accept: 'application/json',
|
|
1062
1056
|
};
|
|
1063
1057
|
const createdOn = new Date().toISOString();
|
|
1064
1058
|
const payload = {
|
|
@@ -1109,7 +1103,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1109
1103
|
* @param credentials - Private API credentials
|
|
1110
1104
|
* @param request - Get attachments request
|
|
1111
1105
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
1112
|
-
* @param request.
|
|
1106
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
1113
1107
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1114
1108
|
* @returns Test step attachments response with array of attachment details
|
|
1115
1109
|
* @throws {BadRequestError} If the request is invalid
|
|
@@ -1146,8 +1140,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1146
1140
|
const fields = 'testScript(id,text,steps(index,reflectRef,description,text,expectedResult,testData,customFieldValues,attachments,id,stepParameters(id,testCaseParameterId,value),testCase(id,key,name,archived,majorVersion,latestVersion,projectKey,parameters(id,name,defaultValue,index))))';
|
|
1147
1141
|
const url = `${this.privateApiBaseUrl}/testcase/${request.testCaseKey}?fields=${encodeURIComponent(fields)}`;
|
|
1148
1142
|
const headers = {
|
|
1149
|
-
|
|
1150
|
-
|
|
1143
|
+
accept: 'application/json',
|
|
1144
|
+
authorization: `JWT ${contextJwt}`,
|
|
1151
1145
|
'jira-project-id': String(request.projectId),
|
|
1152
1146
|
};
|
|
1153
1147
|
try {
|
|
@@ -1170,12 +1164,13 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1170
1164
|
}
|
|
1171
1165
|
throw new ServerError(`Failed to get test step attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
1172
1166
|
}
|
|
1173
|
-
const testCaseData = await response.json();
|
|
1174
|
-
//
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
throw new NotFoundError(`Test step
|
|
1167
|
+
const testCaseData = (await response.json());
|
|
1168
|
+
// Get steps array
|
|
1169
|
+
const steps = testCaseData.testScript?.stepByStepScript?.steps || [];
|
|
1170
|
+
if (request.stepIndex < 0 || request.stepIndex >= steps.length) {
|
|
1171
|
+
throw new NotFoundError(`Test step at index ${request.stepIndex} not found in test case '${request.testCaseKey}'. Test case has ${steps.length} step(s).`);
|
|
1178
1172
|
}
|
|
1173
|
+
const step = steps[request.stepIndex];
|
|
1179
1174
|
return {
|
|
1180
1175
|
attachments: (step.attachments || []).map((att) => ({
|
|
1181
1176
|
id: att.id,
|
|
@@ -1218,7 +1213,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1218
1213
|
* @param credentials - Private API credentials
|
|
1219
1214
|
* @param request - Download attachment request
|
|
1220
1215
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
1221
|
-
* @param request.
|
|
1216
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
1222
1217
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1223
1218
|
* @param request.attachmentId - Attachment ID (UUID string)
|
|
1224
1219
|
* @returns Blob containing the attachment file data
|
|
@@ -1233,13 +1228,13 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1233
1228
|
// Step 1: Get fresh attachment details (including fresh signed URL)
|
|
1234
1229
|
const attachmentsResponse = await this.getTestStepAttachments(credentials, {
|
|
1235
1230
|
testCaseKey: request.testCaseKey,
|
|
1236
|
-
|
|
1231
|
+
stepIndex: request.stepIndex,
|
|
1237
1232
|
projectId: request.projectId,
|
|
1238
1233
|
});
|
|
1239
1234
|
// Step 2: Find the requested attachment
|
|
1240
1235
|
const attachment = attachmentsResponse.attachments.find((att) => att.id === request.attachmentId);
|
|
1241
1236
|
if (!attachment) {
|
|
1242
|
-
throw new NotFoundError(`Attachment with ID '${request.attachmentId}' not found for test step ${request.
|
|
1237
|
+
throw new NotFoundError(`Attachment with ID '${request.attachmentId}' not found for test step at index ${request.stepIndex} in test case '${request.testCaseKey}'.`);
|
|
1243
1238
|
}
|
|
1244
1239
|
// Step 3: Download the file from the signed S3 URL
|
|
1245
1240
|
try {
|
|
@@ -1259,9 +1254,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1259
1254
|
return await downloadResponse.blob();
|
|
1260
1255
|
}
|
|
1261
1256
|
catch (error) {
|
|
1262
|
-
if (error instanceof ForbiddenError ||
|
|
1263
|
-
error instanceof NotFoundError ||
|
|
1264
|
-
error instanceof ServerError) {
|
|
1257
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
1265
1258
|
throw error;
|
|
1266
1259
|
}
|
|
1267
1260
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -1281,7 +1274,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1281
1274
|
* @param credentials - Private API credentials
|
|
1282
1275
|
* @param request - Attachment creation request
|
|
1283
1276
|
* @param request.testCaseKey - Test case key (e.g., 'PROJ-T1')
|
|
1284
|
-
* @param request.
|
|
1277
|
+
* @param request.stepIndex - Zero-based index of the test step in the test case
|
|
1285
1278
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1286
1279
|
* @param request.file - File to upload (Blob or ArrayBuffer)
|
|
1287
1280
|
* @param request.fileName - Name of the file
|
|
@@ -1296,12 +1289,39 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1296
1289
|
async createTestStepAttachment(credentials, request) {
|
|
1297
1290
|
// Get Context JWT
|
|
1298
1291
|
const contextJwt = await this.getContextJwt(credentials);
|
|
1292
|
+
// Get test case steps to find step ID from index
|
|
1293
|
+
const testCase = await this.testCaseGroup.getTestCase({ testCaseKey: request.testCaseKey });
|
|
1294
|
+
const testSteps = await this.testCaseGroup.getTestCaseTestSteps(request.testCaseKey);
|
|
1295
|
+
if (request.stepIndex < 0 || request.stepIndex >= testSteps.values.length) {
|
|
1296
|
+
throw new NotFoundError(`Test step at index ${request.stepIndex} not found in test case '${request.testCaseKey}'. Test case has ${testSteps.values.length} step(s).`);
|
|
1297
|
+
}
|
|
1298
|
+
// Get the step ID from the private API (we need to fetch the test case with full step details)
|
|
1299
|
+
const fields = 'testScript(id,text,steps(index,reflectRef,description,text,expectedResult,testData,customFieldValues,attachments,id,stepParameters(id,testCaseParameterId,value),testCase(id,key,name,archived,majorVersion,latestVersion,projectKey,parameters(id,name,defaultValue,index))))';
|
|
1300
|
+
const url = `${this.privateApiBaseUrl}/testcase/${request.testCaseKey}?fields=${encodeURIComponent(fields)}`;
|
|
1301
|
+
const headers = {
|
|
1302
|
+
accept: 'application/json',
|
|
1303
|
+
authorization: `JWT ${contextJwt}`,
|
|
1304
|
+
'jira-project-id': String(request.projectId),
|
|
1305
|
+
};
|
|
1306
|
+
const response = await fetch(url, {
|
|
1307
|
+
method: 'GET',
|
|
1308
|
+
headers,
|
|
1309
|
+
});
|
|
1310
|
+
if (!response.ok) {
|
|
1311
|
+
throw new NotFoundError(`Failed to get test case steps for '${request.testCaseKey}'.`);
|
|
1312
|
+
}
|
|
1313
|
+
const testCaseData = (await response.json());
|
|
1314
|
+
const steps = testCaseData.testScript?.stepByStepScript?.steps || [];
|
|
1315
|
+
if (request.stepIndex < 0 || request.stepIndex >= steps.length) {
|
|
1316
|
+
throw new NotFoundError(`Test step at index ${request.stepIndex} not found in test case '${request.testCaseKey}'. Test case has ${steps.length} step(s).`);
|
|
1317
|
+
}
|
|
1318
|
+
const stepId = steps[request.stepIndex].id;
|
|
1299
1319
|
// Step 1: Get upload details
|
|
1300
1320
|
const uploadDetails = await this.getUploadDetails(contextJwt);
|
|
1301
1321
|
// Step 2: Upload to S3
|
|
1302
|
-
const s3Info = await this.uploadToS3ForTestStep(uploadDetails, request.projectId,
|
|
1322
|
+
const s3Info = await this.uploadToS3ForTestStep(uploadDetails, request.projectId, stepId, request.userAccountId, request.file, request.fileName);
|
|
1303
1323
|
// Step 3: Save metadata
|
|
1304
|
-
return await this.saveTestStepAttachmentMetadata(contextJwt, request.projectId,
|
|
1324
|
+
return await this.saveTestStepAttachmentMetadata(contextJwt, request.projectId, stepId, request.userAccountId, s3Info.s3Key, s3Info.fileName, s3Info.mimeType, s3Info.fileSize);
|
|
1305
1325
|
}
|
|
1306
1326
|
/**
|
|
1307
1327
|
* Get attachments for a test execution using private API
|
|
@@ -1348,8 +1368,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1348
1368
|
const contextJwt = await this.getContextJwt(credentials);
|
|
1349
1369
|
const url = `${this.privateApiBaseUrl}/testresult/${request.testExecutionKey}?fields=attachments&itemId=${request.testExecutionKey}`;
|
|
1350
1370
|
const headers = {
|
|
1351
|
-
|
|
1352
|
-
|
|
1371
|
+
accept: 'application/json',
|
|
1372
|
+
authorization: `JWT ${contextJwt}`,
|
|
1353
1373
|
'jira-project-id': String(request.projectId),
|
|
1354
1374
|
};
|
|
1355
1375
|
try {
|
|
@@ -1372,7 +1392,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1372
1392
|
}
|
|
1373
1393
|
throw new ServerError(`Failed to get test execution attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
1374
1394
|
}
|
|
1375
|
-
const executionData = await response.json();
|
|
1395
|
+
const executionData = (await response.json());
|
|
1376
1396
|
return {
|
|
1377
1397
|
attachments: (executionData.attachments || []).map((att) => ({
|
|
1378
1398
|
id: att.id,
|
|
@@ -1454,9 +1474,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1454
1474
|
return await downloadResponse.blob();
|
|
1455
1475
|
}
|
|
1456
1476
|
catch (error) {
|
|
1457
|
-
if (error instanceof ForbiddenError ||
|
|
1458
|
-
error instanceof NotFoundError ||
|
|
1459
|
-
error instanceof ServerError) {
|
|
1477
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
1460
1478
|
throw error;
|
|
1461
1479
|
}
|
|
1462
1480
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -1529,7 +1547,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1529
1547
|
* @param credentials - Private API credentials
|
|
1530
1548
|
* @param request - Get attachments request
|
|
1531
1549
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
1532
|
-
* @param request.
|
|
1550
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
1533
1551
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1534
1552
|
* @returns Test execution step attachments response with array of attachment details
|
|
1535
1553
|
* @throws {BadRequestError} If the request is invalid
|
|
@@ -1544,8 +1562,8 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1544
1562
|
const contextJwt = await this.getContextJwt(credentials);
|
|
1545
1563
|
const url = `${this.privateApiBaseUrl}/testresult/${request.testExecutionKey}?fields=testScriptResults(id,testResultStatusId,executionDate,comment,index,description,expectedResult,testData,traceLinks,attachments,sourceScriptType,parameterSetId,customFieldValues,stepAttachmentsMapping,reflectRef),attachments&itemId=${request.testExecutionKey}`;
|
|
1546
1564
|
const headers = {
|
|
1547
|
-
|
|
1548
|
-
|
|
1565
|
+
accept: 'application/json',
|
|
1566
|
+
authorization: `JWT ${contextJwt}`,
|
|
1549
1567
|
'jira-project-id': String(request.projectId),
|
|
1550
1568
|
};
|
|
1551
1569
|
try {
|
|
@@ -1568,12 +1586,13 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1568
1586
|
}
|
|
1569
1587
|
throw new ServerError(`Failed to get test execution step attachments. Status: ${response.status}`, response.status, response.statusText);
|
|
1570
1588
|
}
|
|
1571
|
-
const executionData = await response.json();
|
|
1572
|
-
//
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
throw new NotFoundError(`Test execution step
|
|
1589
|
+
const executionData = (await response.json());
|
|
1590
|
+
// Get testScriptResults array
|
|
1591
|
+
const steps = executionData.testScriptResults || [];
|
|
1592
|
+
if (request.stepIndex < 0 || request.stepIndex >= steps.length) {
|
|
1593
|
+
throw new NotFoundError(`Test execution step at index ${request.stepIndex} not found in test execution '${request.testExecutionKey}'. Test execution has ${steps.length} step(s).`);
|
|
1576
1594
|
}
|
|
1595
|
+
const step = steps[request.stepIndex];
|
|
1577
1596
|
return {
|
|
1578
1597
|
attachments: (step.attachments || []).map((att) => ({
|
|
1579
1598
|
id: att.id,
|
|
@@ -1616,7 +1635,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1616
1635
|
* @param credentials - Private API credentials
|
|
1617
1636
|
* @param request - Download attachment request
|
|
1618
1637
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
1619
|
-
* @param request.
|
|
1638
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
1620
1639
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1621
1640
|
* @param request.attachmentId - Attachment ID (UUID string)
|
|
1622
1641
|
* @returns Blob containing the attachment file data
|
|
@@ -1631,13 +1650,13 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1631
1650
|
// Step 1: Get fresh attachment details (including fresh signed URL)
|
|
1632
1651
|
const attachmentsResponse = await this.getTestExecutionStepAttachments(credentials, {
|
|
1633
1652
|
testExecutionKey: request.testExecutionKey,
|
|
1634
|
-
|
|
1653
|
+
stepIndex: request.stepIndex,
|
|
1635
1654
|
projectId: request.projectId,
|
|
1636
1655
|
});
|
|
1637
1656
|
// Step 2: Find the requested attachment
|
|
1638
1657
|
const attachment = attachmentsResponse.attachments.find((att) => att.id === request.attachmentId);
|
|
1639
1658
|
if (!attachment) {
|
|
1640
|
-
throw new NotFoundError(`Attachment with ID '${request.attachmentId}' not found for test execution step ${request.
|
|
1659
|
+
throw new NotFoundError(`Attachment with ID '${request.attachmentId}' not found for test execution step at index ${request.stepIndex} in test execution '${request.testExecutionKey}'.`);
|
|
1641
1660
|
}
|
|
1642
1661
|
// Step 3: Download the file from the signed S3 URL
|
|
1643
1662
|
try {
|
|
@@ -1657,9 +1676,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1657
1676
|
return await downloadResponse.blob();
|
|
1658
1677
|
}
|
|
1659
1678
|
catch (error) {
|
|
1660
|
-
if (error instanceof ForbiddenError ||
|
|
1661
|
-
error instanceof NotFoundError ||
|
|
1662
|
-
error instanceof ServerError) {
|
|
1679
|
+
if (error instanceof ForbiddenError || error instanceof NotFoundError || error instanceof ServerError) {
|
|
1663
1680
|
throw error;
|
|
1664
1681
|
}
|
|
1665
1682
|
throw new UnexpectedError('Unexpected error while downloading attachment', error);
|
|
@@ -1679,7 +1696,7 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1679
1696
|
* @param credentials - Private API credentials
|
|
1680
1697
|
* @param request - Attachment creation request
|
|
1681
1698
|
* @param request.testExecutionKey - Test execution key (e.g., 'PROJ-E1')
|
|
1682
|
-
* @param request.
|
|
1699
|
+
* @param request.stepIndex - Zero-based index of the test execution step
|
|
1683
1700
|
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
1684
1701
|
* @param request.file - File to upload (Blob or ArrayBuffer)
|
|
1685
1702
|
* @param request.fileName - Name of the file
|
|
@@ -1694,12 +1711,32 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1694
1711
|
async createTestExecutionStepAttachment(credentials, request) {
|
|
1695
1712
|
// Get Context JWT
|
|
1696
1713
|
const contextJwt = await this.getContextJwt(credentials);
|
|
1714
|
+
// Get test execution steps to find testScriptResultId from index
|
|
1715
|
+
const url = `${this.privateApiBaseUrl}/testresult/${request.testExecutionKey}?fields=testScriptResults(id,testResultStatusId,executionDate,comment,index,description,expectedResult,testData,traceLinks,attachments,sourceScriptType,parameterSetId,customFieldValues,stepAttachmentsMapping,reflectRef),attachments&itemId=${request.testExecutionKey}`;
|
|
1716
|
+
const headers = {
|
|
1717
|
+
accept: 'application/json',
|
|
1718
|
+
authorization: `JWT ${contextJwt}`,
|
|
1719
|
+
'jira-project-id': String(request.projectId),
|
|
1720
|
+
};
|
|
1721
|
+
const response = await fetch(url, {
|
|
1722
|
+
method: 'GET',
|
|
1723
|
+
headers,
|
|
1724
|
+
});
|
|
1725
|
+
if (!response.ok) {
|
|
1726
|
+
throw new NotFoundError(`Failed to get test execution steps for '${request.testExecutionKey}'.`);
|
|
1727
|
+
}
|
|
1728
|
+
const executionData = (await response.json());
|
|
1729
|
+
const steps = executionData.testScriptResults || [];
|
|
1730
|
+
if (request.stepIndex < 0 || request.stepIndex >= steps.length) {
|
|
1731
|
+
throw new NotFoundError(`Test execution step at index ${request.stepIndex} not found in test execution '${request.testExecutionKey}'. Test execution has ${steps.length} step(s).`);
|
|
1732
|
+
}
|
|
1733
|
+
const testScriptResultId = steps[request.stepIndex].id;
|
|
1697
1734
|
// Step 1: Get upload details
|
|
1698
1735
|
const uploadDetails = await this.getUploadDetails(contextJwt);
|
|
1699
1736
|
// Step 2: Upload to S3
|
|
1700
|
-
const s3Info = await this.uploadToS3ForTestExecutionStep(uploadDetails, request.projectId,
|
|
1737
|
+
const s3Info = await this.uploadToS3ForTestExecutionStep(uploadDetails, request.projectId, testScriptResultId, request.userAccountId, request.file, request.fileName);
|
|
1701
1738
|
// Step 3: Save metadata
|
|
1702
|
-
return await this.saveTestExecutionStepAttachmentMetadata(contextJwt, request.projectId,
|
|
1739
|
+
return await this.saveTestExecutionStepAttachmentMetadata(contextJwt, request.projectId, testScriptResultId, request.userAccountId, s3Info.s3Key, s3Info.fileName, s3Info.mimeType, s3Info.fileSize);
|
|
1703
1740
|
}
|
|
1704
1741
|
/**
|
|
1705
1742
|
* Upload file to S3 for test step
|
|
@@ -1794,10 +1831,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1794
1831
|
async saveTestStepAttachmentMetadata(contextJwt, projectId, stepId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
1795
1832
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
1796
1833
|
const headers = {
|
|
1797
|
-
|
|
1834
|
+
Authorization: `JWT ${contextJwt}`,
|
|
1798
1835
|
'jira-project-id': String(projectId),
|
|
1799
1836
|
'Content-Type': 'application/json',
|
|
1800
|
-
|
|
1837
|
+
Accept: 'application/json',
|
|
1801
1838
|
};
|
|
1802
1839
|
const createdOn = new Date().toISOString();
|
|
1803
1840
|
const payload = {
|
|
@@ -1929,10 +1966,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
1929
1966
|
async saveTestExecutionAttachmentMetadata(contextJwt, projectId, testExecutionId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
1930
1967
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
1931
1968
|
const headers = {
|
|
1932
|
-
|
|
1969
|
+
Authorization: `JWT ${contextJwt}`,
|
|
1933
1970
|
'jira-project-id': String(projectId),
|
|
1934
1971
|
'Content-Type': 'application/json',
|
|
1935
|
-
|
|
1972
|
+
Accept: 'application/json',
|
|
1936
1973
|
};
|
|
1937
1974
|
const createdOn = new Date().toISOString();
|
|
1938
1975
|
const payload = {
|
|
@@ -2064,10 +2101,10 @@ export class PrivateAttachments extends PrivateBase {
|
|
|
2064
2101
|
async saveTestExecutionStepAttachmentMetadata(contextJwt, projectId, testScriptResultId, userAccountId, s3Key, fileName, mimeType, fileSize) {
|
|
2065
2102
|
const url = 'https://app.tm4j.smartbear.com/backend/rest/tests/2.0/attachment/metadata';
|
|
2066
2103
|
const headers = {
|
|
2067
|
-
|
|
2104
|
+
Authorization: `JWT ${contextJwt}`,
|
|
2068
2105
|
'jira-project-id': String(projectId),
|
|
2069
2106
|
'Content-Type': 'application/json',
|
|
2070
|
-
|
|
2107
|
+
Accept: 'application/json',
|
|
2071
2108
|
};
|
|
2072
2109
|
const createdOn = new Date().toISOString();
|
|
2073
2110
|
const payload = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateBase.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateBase.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE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AAc,CAAC;IACnD,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;gBAE/C,aAAa,CAAC,EAAE,mBAAmB;IAS/C;;;;;;;;OAQG;cACa,aAAa,CAAC,WAAW,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;CAwElF"}
|
|
@@ -30,7 +30,7 @@ export class PrivateBase {
|
|
|
30
30
|
// Create Basic Auth header
|
|
31
31
|
const authCredentials = btoa(`${credentials.userEmail}:${credentials.apiToken}`);
|
|
32
32
|
const headers = {
|
|
33
|
-
|
|
33
|
+
Authorization: `Basic ${authCredentials}`,
|
|
34
34
|
'Content-Type': 'application/json',
|
|
35
35
|
};
|
|
36
36
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateComments.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateComments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"PrivateComments.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateComments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WA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