|
1 | 1 | # Jira.js changelog
|
2 | 2 |
|
| 3 | +### 4.0.4 |
| 4 | + |
| 5 | +- **#320:** Resolved a tree-shaking issue where importing a single client would still include all clients in the output bundle when using bundlers. Now, only the required client code is included. Thanks to [Nao Yonashiro](https://github.com/orisano) for [reporting the issue](https://github.com/MrRefactoring/jira.js/issues/320) and proposing a fix. |
| 6 | +- **#327:** Replaced the `form-data` library with `formdata-node` to enable compatibility with `ESM` projects when adding attachments via the `issueAttachment.addAttachment` method. Thanks to [Paweł Król](https://github.com/xpawk) for [reporting the issue](https://github.com/MrRefactoring/jira.js/issues/327) and [Matyáš Kroupa](https://github.com/krouma) for implementing the fix. |
| 7 | +- **Improvement:** The type of the `projectIdOrKey` property was updated from `string` to `number | string` for project update operations. This enhancement improves type safety and flexibility when handling project identifiers. |
| 8 | +- **Enhancement:** Added a `mimeType` property to the `version2.issueAttachments.addAttachment`, `version3.issueAttachments.addAttachment`, and `serviceDesk.serviceDesk.attachTemporaryFile` methods. This allows specifying the file type. If `mimeType` is not provided, a default type is inferred from the filename. |
| 9 | + |
| 10 | + #### Examples: |
| 11 | + |
| 12 | + **👎 Before:** |
| 13 | + |
| 14 | + ```typescript |
| 15 | + const client = new Version2Client() || new Version3Client() || new ServiceDeskClient(); |
| 16 | + |
| 17 | + const attachment = await client.issueAttachments.addAttachment({ |
| 18 | + issueIdOrKey: issue.key, |
| 19 | + attachment: { |
| 20 | + filename: 'issueAttachments.test.ts', |
| 21 | + file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'), |
| 22 | + }, |
| 23 | + }); |
| 24 | + |
| 25 | + console.log(attachment[0].mimeType); // Will be 'video/mp2t' |
| 26 | + ``` |
| 27 | + |
| 28 | + **👍 Now:** |
| 29 | + |
| 30 | + ```typescript |
| 31 | + const client = new Version2Client() || new Version3Client() || new ServiceDeskClient(); |
| 32 | + |
| 33 | + const attachment = await client.issueAttachments.addAttachment({ |
| 34 | + issueIdOrKey: issue.key, |
| 35 | + attachment: { |
| 36 | + filename: 'issueAttachments.test.ts', |
| 37 | + file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'), |
| 38 | + mimeType: 'application/typescript', |
| 39 | + }, |
| 40 | + }); |
| 41 | + |
| 42 | + console.log(attachment[0].mimeType); // Will be 'application/typescript' |
| 43 | + ``` |
| 44 | + |
3 | 45 | ### 4.0.3
|
4 | 46 |
|
5 | 47 | - **Bug Fix:** Fixed an issue with the `Users.createUser` method by adding the required `products` property. Thanks to [Appelberg-s](https://github.com/Appelberg-s) for the [fix](https://github.com/MrRefactoring/jira.js/commit/362918093c20036049db334743e2a0f5f41cbcd4#diff-6960050bc2a3d9ffad9eb5e307145969dc4a38eb5434eebf39da545fd18e01b7R12).
|
|
0 commit comments