@rbaileysr/zephyr-managed-api 1.2.0 → 1.2.1

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 CHANGED
@@ -943,16 +943,35 @@ For issues, questions, or contributions, please refer to the project repository
943
943
 
944
944
  ## Changelog
945
945
 
946
+ ### 1.2.1
947
+
948
+ - **Fixed**: UUID generation for attachment uploads - replaced `crypto.randomUUID()` with custom implementation compatible with ScriptRunner Connect runtime
949
+ - **Improved**: UUID generation now uses `crypto.getRandomValues()` which is available in ScriptRunner Connect's web standards runtime
950
+
951
+ ### 1.2.0
952
+
953
+ - **Added**: Private API group with support for unofficial Zephyr endpoints
954
+ - `getContextJwt()` - Retrieve Jira Context JWT token for private API authentication
955
+ - `createCustomField()` - Create custom fields for test cases, test plans, test runs, and test steps
956
+ - `createTestCaseVersion()` - Create new test case versions (accepts testCaseKey and looks up ID automatically)
957
+ - `createTestCaseComment()` - Create comments on test cases
958
+ - `getTestCaseAttachments()` - Get all attachment details for a test case with signed S3 URLs
959
+ - `downloadAttachment()` - Download attachment files into memory with automatic fresh URL retrieval
960
+ - `createAttachment()` - Upload file attachments to test cases (complete S3 upload flow)
961
+ - **Added**: Type definitions for private API requests and responses
962
+ - **Changed**: `createTestCaseVersion()` now uses interface structure and automatically looks up test case ID from key
963
+ - **Warning**: Private API methods are not officially supported and may change without notice
964
+
946
965
  ### 1.1.0
947
966
 
948
967
  - **Added**: Private API group with support for unofficial Zephyr endpoints
949
968
  - `getContextJwt()` - Retrieve Jira Context JWT token for private API authentication
950
969
  - `createCustomField()` - Create custom fields for test cases, test plans, test runs, and test steps
951
- - `createTestCaseVersion()` - Create new test case versions (now accepts testCaseKey and looks up ID automatically)
970
+ - `createTestCaseVersion()` - Create new test case versions (accepts testCaseKey and looks up ID automatically)
952
971
  - `createTestCaseComment()` - Create comments on test cases
953
- - `getTestCaseAttachments()` - Get all attachment details for a test case
972
+ - `getTestCaseAttachments()` - Get all attachment details for a test case with signed S3 URLs
954
973
  - `downloadAttachment()` - Download attachment files into memory with automatic fresh URL retrieval
955
- - `createAttachment()` - Upload file attachments to test cases
974
+ - `createAttachment()` - Upload file attachments to test cases (complete S3 upload flow)
956
975
  - **Added**: Type definitions for private API requests and responses
957
976
  - **Changed**: `createTestCaseVersion()` now uses interface structure and automatically looks up test case ID from key
958
977
  - **Warning**: Private API methods are not officially supported and may change without notice
package/dist/README.md CHANGED
@@ -943,16 +943,35 @@ For issues, questions, or contributions, please refer to the project repository
943
943
 
944
944
  ## Changelog
945
945
 
946
+ ### 1.2.1
947
+
948
+ - **Fixed**: UUID generation for attachment uploads - replaced `crypto.randomUUID()` with custom implementation compatible with ScriptRunner Connect runtime
949
+ - **Improved**: UUID generation now uses `crypto.getRandomValues()` which is available in ScriptRunner Connect's web standards runtime
950
+
951
+ ### 1.2.0
952
+
953
+ - **Added**: Private API group with support for unofficial Zephyr endpoints
954
+ - `getContextJwt()` - Retrieve Jira Context JWT token for private API authentication
955
+ - `createCustomField()` - Create custom fields for test cases, test plans, test runs, and test steps
956
+ - `createTestCaseVersion()` - Create new test case versions (accepts testCaseKey and looks up ID automatically)
957
+ - `createTestCaseComment()` - Create comments on test cases
958
+ - `getTestCaseAttachments()` - Get all attachment details for a test case with signed S3 URLs
959
+ - `downloadAttachment()` - Download attachment files into memory with automatic fresh URL retrieval
960
+ - `createAttachment()` - Upload file attachments to test cases (complete S3 upload flow)
961
+ - **Added**: Type definitions for private API requests and responses
962
+ - **Changed**: `createTestCaseVersion()` now uses interface structure and automatically looks up test case ID from key
963
+ - **Warning**: Private API methods are not officially supported and may change without notice
964
+
946
965
  ### 1.1.0
947
966
 
948
967
  - **Added**: Private API group with support for unofficial Zephyr endpoints
949
968
  - `getContextJwt()` - Retrieve Jira Context JWT token for private API authentication
950
969
  - `createCustomField()` - Create custom fields for test cases, test plans, test runs, and test steps
951
- - `createTestCaseVersion()` - Create new test case versions (now accepts testCaseKey and looks up ID automatically)
970
+ - `createTestCaseVersion()` - Create new test case versions (accepts testCaseKey and looks up ID automatically)
952
971
  - `createTestCaseComment()` - Create comments on test cases
953
- - `getTestCaseAttachments()` - Get all attachment details for a test case
972
+ - `getTestCaseAttachments()` - Get all attachment details for a test case with signed S3 URLs
954
973
  - `downloadAttachment()` - Download attachment files into memory with automatic fresh URL retrieval
955
- - `createAttachment()` - Upload file attachments to test cases
974
+ - `createAttachment()` - Upload file attachments to test cases (complete S3 upload flow)
956
975
  - **Added**: Type definitions for private API requests and responses
957
976
  - **Changed**: `createTestCaseVersion()` now uses interface structure and automatically looks up test case ID from key
958
977
  - **Warning**: Private API methods are not officially supported and may change without notice
@@ -219,6 +219,12 @@ export declare class PrivateGroup {
219
219
  * @throws {UnexpectedError} If test case ID cannot be looked up from key and Zephyr Connector is not available, or if download fails
220
220
  */
221
221
  downloadAttachment(userEmail: string, apiToken: string, jiraInstanceUrl: string, request: DownloadAttachmentRequest): Promise<Blob>;
222
+ /**
223
+ * Generate a UUID v4 (compatible with ScriptRunner Connect runtime)
224
+ *
225
+ * Uses crypto.getRandomValues() which is available in web standards
226
+ */
227
+ private generateUUID;
222
228
  /**
223
229
  * Get MIME type from file name
224
230
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Private.d.ts","sourceRoot":"","sources":["../../groups/Private.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACX,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAG7B,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAE9B,yBAAyB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAWpD;;;;;GAKG;AACH,qBAAa,YAAY;IACxB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2D;IAE7F;;OAEG;IACH,OAAO,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AAC;CAqDnB"}
@@ -307,7 +307,7 @@ export class PrivateGroup {
307
307
  const policy = upload.policy;
308
308
  const signature = upload.signature;
309
309
  // Generate UUID for file
310
- const fileUuid = crypto.randomUUID();
310
+ const fileUuid = this.generateUUID();
311
311
  const s3Key = `${keyPrefix}/project/${projectId}/testcase/${testCaseId}/${fileUuid}`;
312
312
  // Determine MIME type
313
313
  const mimeType = this.getMimeType(fileName);
@@ -662,6 +662,31 @@ export class PrivateGroup {
662
662
  throw new UnexpectedError('Unexpected error while downloading attachment', error);
663
663
  }
664
664
  }
665
+ /**
666
+ * Generate a UUID v4 (compatible with ScriptRunner Connect runtime)
667
+ *
668
+ * Uses crypto.getRandomValues() which is available in web standards
669
+ */
670
+ generateUUID() {
671
+ // Use crypto.getRandomValues() which is available in ScriptRunner Connect
672
+ const bytes = new Uint8Array(16);
673
+ crypto.getRandomValues(bytes);
674
+ // Set version (4) and variant bits
675
+ bytes[6] = (bytes[6] & 0x0f) | 0x40; // Version 4
676
+ bytes[8] = (bytes[8] & 0x3f) | 0x80; // Variant 10
677
+ // Convert to UUID string format
678
+ const hex = [];
679
+ for (let i = 0; i < bytes.length; i++) {
680
+ hex.push(bytes[i].toString(16).padStart(2, '0'));
681
+ }
682
+ return [
683
+ hex.slice(0, 4).join(''),
684
+ hex.slice(4, 6).join(''),
685
+ hex.slice(6, 8).join(''),
686
+ hex.slice(8, 10).join(''),
687
+ hex.slice(10, 16).join(''),
688
+ ].join('-');
689
+ }
665
690
  /**
666
691
  * Get MIME type from file name
667
692
  */
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbaileysr/zephyr-managed-api",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbaileysr/zephyr-managed-api",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",