Skip to content

🚧 Pipeline for feature/esm #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Swap form-data for formdata-node (MrRefactoring#333)
The newer library better supports modules and is written in TypeScript.
The FormData interface is a drop-in replacement except for getHeaders(),
but that didn't do anything useful, so it can be dropped.

Closes MrRefactoring#327

Signed-off-by: Matyáš Kroupa <m.kroupa@quadient.com>
Co-authored-by: Matyáš Kroupa <m.kroupa@quadient.com>
Co-authored-by: Vladislav Tupikin <MrRefactoring@yandex.ru>
  • Loading branch information
3 people authored Jan 2, 2025
commit a650eb19b2792d3156e2fd7014b079d4021cb2bb
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"vitest": "^2.1.8"
},
"dependencies": {
"axios": "^1.7.9",
"form-data": "^4.0.1",
"tslib": "^2.8.1"
"axios": "^1.7.7",
"formdata-node": "^6.0.3",
"tslib": "^2.7.0"
}
}
3 changes: 1 addition & 2 deletions src/serviceDesk/serviceDesk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as FormData from 'form-data';
import { FormData } from 'formdata-node';
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
Expand Down Expand Up @@ -124,7 +124,6 @@ export class ServiceDesk {
headers: {
'X-Atlassian-Token': 'no-check',
'Content-Type': 'multipart/form-data',
...formData.getHeaders?.(),
},
data: formData,
};
Expand Down
4 changes: 1 addition & 3 deletions src/version2/issueAttachments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-expect-error Wrong form data typings
import FormData from 'form-data';
import { FormData } from 'formdata-node';
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
Expand Down Expand Up @@ -434,7 +433,6 @@ export class IssueAttachments {
headers: {
'X-Atlassian-Token': 'no-check',
'Content-Type': 'multipart/form-data',
...formData.getHeaders?.(),
},
data: formData,
maxBodyLength: Infinity,
Expand Down
4 changes: 1 addition & 3 deletions src/version3/issueAttachments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-expect-error Wrong form data typings
import FormData from 'form-data';
import { FormData } from 'formdata-node';
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
Expand Down Expand Up @@ -434,7 +433,6 @@ export class IssueAttachments {
headers: {
'X-Atlassian-Token': 'no-check',
'Content-Type': 'multipart/form-data',
...formData.getHeaders?.(),
},
data: formData,
maxBodyLength: Infinity,
Expand Down