mailgun.js
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [4.1.1](https://github.com/mailgun/mailgun.js/compare/v4.1.0...v4.1.1) (2021-12-13) | ||
### Bug Fixes | ||
* Ip_pools create and update methods fix ([#215](https://github.com/mailgun/mailgun.js/issues/215)) ([eb1830d](https://github.com/mailgun/mailgun.js/commits/eb1830de472737c0b3dc6a4cb8856f73b52d20c2)) | ||
## [4.1.0](https://github.com/mailgun/mailgun.js/compare/v4.0.1...v4.1.0) (2021-11-30) | ||
@@ -7,0 +14,0 @@ |
@@ -22,2 +22,3 @@ import NodeFormData from 'form-data'; | ||
putWithFD(url: string, data: any): Promise<APIResponse>; | ||
patchWithFD(url: string, data: any): Promise<APIResponse>; | ||
createFormData(data: any): NodeFormData | FormData; | ||
@@ -24,0 +25,0 @@ private addMimeDataToFD; |
@@ -5,2 +5,2 @@ /*! MIT License © Sindre Sorhus */ | ||
/*! mailgun.js v4.0.1 */ | ||
/*! mailgun.js v4.1.0 */ |
@@ -7,2 +7,2 @@ /*! MIT License © Sindre Sorhus */ | ||
/*! mailgun.js v4.0.1 */ | ||
/*! mailgun.js v4.1.0 */ |
@@ -19,3 +19,3 @@ /* eslint-disable camelcase */ | ||
create(data: { name: string, description?: string, ips?: string[] }) { | ||
return this.request.post('/v1/ip_pools', data) | ||
return this.request.postWithFD('/v1/ip_pools', data) | ||
.then((response: { body: { message: string, pool_id: string } }) => response?.body); | ||
@@ -25,3 +25,3 @@ } | ||
update(poolId: string, data: IpPoolUpdateData) : Promise<any> { | ||
return this.request.patch(`/v1/ip_pools/${poolId}`, data) | ||
return this.request.patchWithFD(`/v1/ip_pools/${poolId}`, data) | ||
.then((response: { body: any }) => response?.body); | ||
@@ -28,0 +28,0 @@ } |
@@ -168,2 +168,13 @@ import NodeFormData from 'form-data'; | ||
patchWithFD(url: string, data: any): Promise<APIResponse> { | ||
if (!data) { | ||
throw new Error('Please provide data object'); | ||
} | ||
const params: any = { | ||
headers: { 'Content-Type': null } | ||
}; | ||
const formData = this.createFormData(data); | ||
return this.command('patch', url, formData, params); | ||
} | ||
createFormData(data: any): NodeFormData | FormData { | ||
@@ -170,0 +181,0 @@ const formData: NodeFormData | FormData = Object.keys(data) |
{ | ||
"name": "mailgun.js", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"main": "dist/mailgun.node.js", | ||
@@ -5,0 +5,0 @@ "browser": "dist/mailgun.web.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2295339
5560