mailgun.js 3.7.0 → 3.7.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.7.1](https://github.com/mailgun/mailgun-js/compare/v3.7.0...v3.7.1) (2021-10-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Fix TS2345 error ([e20b8d7](https://github.com/mailgun/mailgun-js/commits/e20b8d7fd03cc94fd49a1c82b4936d5b115024a3))
11
+
5
12
  ## [3.7.0](https://github.com/mailgun/mailgun-js/compare/v3.6.1...v3.7.0) (2021-10-20)
6
13
 
7
14
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import Client from './lib/client';
2
+ import { InputFormData } from './lib/interfaces/IFormData';
2
3
  import Options from './lib/interfaces/Options';
3
- import IFormData from './lib/interfaces/IFormData';
4
4
  declare class Mailgun {
5
5
  private formData;
6
- constructor(FormData: new (...args: unknown[]) => IFormData);
6
+ constructor(FormData: InputFormData);
7
7
  client(options: Options): Client;
8
8
  }
9
9
  export = Mailgun;
@@ -12,7 +12,7 @@ import ParseClient from './parse';
12
12
  import IpsClient from './ips';
13
13
  import IpPoolsClient from './ip-pools';
14
14
  import ListsClient from './lists';
15
- import IFormData from './interfaces/IFormData';
15
+ import { InputFormData } from './interfaces/IFormData';
16
16
  export default class Client {
17
17
  private request;
18
18
  domains: DomainClient;
@@ -28,5 +28,5 @@ export default class Client {
28
28
  ips: IpsClient;
29
29
  ip_pools: IpPoolsClient;
30
30
  lists: ListsClient;
31
- constructor(options: Options, formData: new (...args: unknown[]) => IFormData);
31
+ constructor(options: Options, formData: InputFormData);
32
32
  }
@@ -1,15 +1,7 @@
1
- interface Headers {
1
+ import NodeFormData from 'form-data';
2
+ export interface IFormDataOptions {
2
3
  [key: string]: any;
3
4
  }
4
- interface AppendOptions {
5
- header?: string | Headers;
6
- knownLength?: number;
7
- filename?: string;
8
- filepath?: string;
9
- contentType?: string;
5
+ export interface InputFormData {
6
+ new (options?: HTMLFormElement | IFormDataOptions): NodeFormData | FormData;
10
7
  }
11
- export default abstract class IFormData {
12
- constructor();
13
- abstract append(key: string, value: any, options?: AppendOptions | string): void;
14
- }
15
- export {};
@@ -1,5 +1,6 @@
1
+ import NodeFormData from 'form-data';
1
2
  import RequestOptions from './interfaces/RequestOptions';
2
- import IFormData from './interfaces/IFormData';
3
+ import { InputFormData } from './interfaces/IFormData';
3
4
  import APIResponse from './interfaces/ApiResponse';
4
5
  declare class Request {
5
6
  private username;
@@ -8,7 +9,7 @@ declare class Request {
8
9
  private timeout;
9
10
  private headers;
10
11
  private formData;
11
- constructor(options: RequestOptions, formData: new () => IFormData);
12
+ constructor(options: RequestOptions, formData: InputFormData);
12
13
  request(method: string, url: string, inputOptions?: any): Promise<APIResponse>;
13
14
  query(method: string, url: string, query: any, options?: any): Promise<APIResponse>;
14
15
  command(method: string, url: string, data: any, options?: any): Promise<APIResponse>;
@@ -18,7 +19,7 @@ declare class Request {
18
19
  post(url: string, data: any, options?: any): Promise<APIResponse>;
19
20
  postWithFD(url: string, data: any): Promise<APIResponse>;
20
21
  putWithFD(url: string, data: any): Promise<APIResponse>;
21
- createFormData(data: any): IFormData;
22
+ createFormData(data: any): NodeFormData | FormData;
22
23
  put(url: string, data: any, options?: any): Promise<APIResponse>;
23
24
  patch(url: string, data: any, options?: any): Promise<APIResponse>;
24
25
  delete(url: string, data?: any, options?: any): Promise<APIResponse>;