mailgun.js 3.6.1 → 3.7.0
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/.eslintrc +8 -6
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/client.d.ts +1 -1
- package/dist/lib/events.d.ts +9 -25
- package/dist/lib/interfaces/APIErrorOptions.d.ts +2 -1
- package/dist/lib/interfaces/ApiResponse.d.ts +2 -1
- package/dist/lib/interfaces/Events.d.ts +24 -0
- package/dist/lib/interfaces/IpPools.d.ts +12 -0
- package/dist/lib/interfaces/Options.d.ts +2 -1
- package/dist/lib/interfaces/RequestOptions.d.ts +2 -1
- package/dist/lib/interfaces/StatsOptions.d.ts +2 -1
- package/dist/lib/interfaces/mailListMembers.d.ts +6 -6
- package/dist/lib/ip-pools.d.ts +11 -14
- package/dist/lib/ips.d.ts +6 -6
- package/dist/lib/messages.d.ts +1 -1
- package/dist/lib/suppressions.d.ts +1 -1
- package/dist/mailgun.node.js +2 -2
- package/dist/mailgun.node.js.LICENSE.txt +1 -1
- package/dist/mailgun.web.js +2 -2
- package/dist/mailgun.web.js.LICENSE.txt +1 -1
- package/examples/addresses.js +1 -0
- package/examples/list-domains.js +1 -0
- package/examples/send-email.js +1 -0
- package/index.ts +1 -1
- package/lib/client.ts +3 -2
- package/lib/events.ts +21 -19
- package/lib/interfaces/APIErrorOptions.ts +3 -1
- package/lib/interfaces/ApiResponse.ts +3 -1
- package/lib/interfaces/Events.ts +25 -0
- package/lib/interfaces/IFormData.ts +4 -3
- package/lib/interfaces/IpPools.ts +16 -1
- package/lib/interfaces/Ips.ts +1 -0
- package/lib/interfaces/Options.ts +5 -2
- package/lib/interfaces/RequestOptions.ts +4 -2
- package/lib/interfaces/StatsOptions.ts +4 -2
- package/lib/interfaces/Supressions.ts +1 -1
- package/lib/interfaces/lists.ts +1 -0
- package/lib/interfaces/mailListMembers.ts +18 -12
- package/lib/interfaces/routes.ts +1 -0
- package/lib/ip-pools.ts +8 -7
- package/lib/ips.ts +3 -3
- package/lib/lists.ts +1 -1
- package/lib/messages.ts +1 -1
- package/lib/parse.ts +4 -3
- package/lib/stats.ts +3 -2
- package/lib/suppressions.ts +16 -11
- package/lib/validate.ts +0 -1
- package/package.json +1 -1
- package/test/client.test.ts +7 -2
- package/test/events.test.ts +1 -1
- package/test/ips.test.ts +1 -1
- package/test/lists.test.ts +5 -6
- package/test/mailListMembers.test.ts +47 -42
- package/test/messageAttachment.test.ts +3 -3
- package/test/messages.test.ts +1 -1
- package/test/parse.test.ts +1 -1
- package/test/routes.test.ts +1 -0
- package/test/suppressions.test.ts +4 -3
package/.eslintrc
CHANGED
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"extends": [
|
|
10
10
|
"airbnb-base"
|
|
11
11
|
],
|
|
12
|
-
"plugins": [
|
|
13
|
-
"eslint-plugin-tsdoc",
|
|
14
|
-
"@typescript-eslint"
|
|
15
|
-
],
|
|
16
12
|
"parserOptions": {
|
|
17
13
|
"ecmaVersion": 12
|
|
18
14
|
},
|
|
@@ -34,7 +30,8 @@
|
|
|
34
30
|
"class-methods-use-this": 0,
|
|
35
31
|
"prefer-destructuring": 0,
|
|
36
32
|
"import/extensions": 0,
|
|
37
|
-
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }]
|
|
33
|
+
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
|
|
34
|
+
"import/no-extraneous-dependencies" :["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}]
|
|
38
35
|
},
|
|
39
36
|
"overrides": [
|
|
40
37
|
{
|
|
@@ -46,7 +43,12 @@
|
|
|
46
43
|
"parser": "@typescript-eslint/parser",
|
|
47
44
|
"rules": {
|
|
48
45
|
"import/extensions": 0
|
|
49
|
-
|
|
46
|
+
// "import/no-extraneous-dependencies" :["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}]
|
|
47
|
+
},
|
|
48
|
+
"plugins": [
|
|
49
|
+
"eslint-plugin-tsdoc",
|
|
50
|
+
"@typescript-eslint"
|
|
51
|
+
]
|
|
50
52
|
}
|
|
51
53
|
]
|
|
52
54
|
}
|
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.0](https://github.com/mailgun/mailgun-js/compare/v3.6.1...v3.7.0) (2021-10-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Fix linter errors ([126ba03](https://github.com/mailgun/mailgun-js/commits/126ba039bccfbdb257ddde7d17a58790e4cd30a3))
|
|
11
|
+
|
|
5
12
|
### [3.6.1](https://github.com/mailgun/mailgun-js/compare/v3.6.0...v3.6.1) (2021-10-18)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Options from './lib/interfaces/Options';
|
|
|
3
3
|
import IFormData from './lib/interfaces/IFormData';
|
|
4
4
|
declare class Mailgun {
|
|
5
5
|
private formData;
|
|
6
|
-
constructor(FormData: new (...args:
|
|
6
|
+
constructor(FormData: new (...args: unknown[]) => IFormData);
|
|
7
7
|
client(options: Options): Client;
|
|
8
8
|
}
|
|
9
9
|
export = Mailgun;
|
package/dist/lib/client.d.ts
CHANGED
|
@@ -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:
|
|
31
|
+
constructor(options: Options, formData: new (...args: unknown[]) => IFormData);
|
|
32
32
|
}
|
package/dist/lib/events.d.ts
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { EventsList, EventsPage, EventsResponse, PagesList } from './interfaces/Events';
|
|
2
|
+
import Request from './request';
|
|
2
3
|
export default class EventClient {
|
|
3
|
-
request:
|
|
4
|
-
constructor(request:
|
|
4
|
+
request: Request;
|
|
5
|
+
constructor(request: Request);
|
|
5
6
|
_parsePageNumber(url: string): string;
|
|
6
|
-
_parsePage(id: string, url: string):
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
_parsePageLinks(response: {
|
|
12
|
-
body: {
|
|
13
|
-
paging: any;
|
|
14
|
-
};
|
|
15
|
-
}): any;
|
|
16
|
-
_parseEventList(response: {
|
|
17
|
-
body: {
|
|
18
|
-
items: any;
|
|
19
|
-
paging: any;
|
|
20
|
-
};
|
|
21
|
-
}): {
|
|
22
|
-
items: any;
|
|
23
|
-
pages: any;
|
|
24
|
-
};
|
|
7
|
+
_parsePage(id: string, url: string): EventsPage;
|
|
8
|
+
_parsePageLinks(response: EventsResponse): PagesList;
|
|
9
|
+
_parseEventList(response: EventsResponse): EventsList;
|
|
25
10
|
get(domain: string, query: {
|
|
26
|
-
page:
|
|
27
|
-
}):
|
|
11
|
+
page: string;
|
|
12
|
+
}): Promise<EventsList>;
|
|
28
13
|
}
|
|
29
|
-
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface EventsPage {
|
|
2
|
+
id: string;
|
|
3
|
+
number: string;
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PagesList {
|
|
7
|
+
previous: string;
|
|
8
|
+
first: string;
|
|
9
|
+
last: string;
|
|
10
|
+
next: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EventsResponse {
|
|
13
|
+
body: {
|
|
14
|
+
items: [];
|
|
15
|
+
paging: PagesList;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface EventsList {
|
|
19
|
+
items: [];
|
|
20
|
+
pages: PagesList;
|
|
21
|
+
}
|
|
22
|
+
export interface PagesListAccumulator {
|
|
23
|
+
[index: string]: EventsPage;
|
|
24
|
+
}
|
|
@@ -5,3 +5,15 @@ export interface IpPool {
|
|
|
5
5
|
name: string;
|
|
6
6
|
pool_id: string;
|
|
7
7
|
}
|
|
8
|
+
export interface IpPoolListResponse {
|
|
9
|
+
body: {
|
|
10
|
+
ip_pools: IpPool;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface IpPoolUpdateData {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
add_ip: string;
|
|
18
|
+
remove_ip: string;
|
|
19
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { MailingList } from './lists';
|
|
2
|
+
export interface MailListMember {
|
|
3
|
+
address: string;
|
|
4
|
+
name: string;
|
|
5
|
+
subscribed: boolean;
|
|
6
|
+
vars: string | any;
|
|
7
|
+
}
|
|
2
8
|
export interface MailListMembersQuery {
|
|
3
9
|
subscribed?: 'yes' | 'no';
|
|
4
10
|
limit?: number;
|
|
@@ -25,12 +31,6 @@ export interface CreateUpdateMailListMembersReq {
|
|
|
25
31
|
subscribed?: 'yes' | 'no' | boolean;
|
|
26
32
|
upsert?: 'yes' | 'no';
|
|
27
33
|
}
|
|
28
|
-
export interface MailListMember {
|
|
29
|
-
address: string;
|
|
30
|
-
name: string;
|
|
31
|
-
subscribed: boolean;
|
|
32
|
-
vars: string | any;
|
|
33
|
-
}
|
|
34
34
|
export interface DeletedMember {
|
|
35
35
|
member: {
|
|
36
36
|
address: string;
|
package/dist/lib/ip-pools.d.ts
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import { IpPool } from
|
|
1
|
+
import Request from './request';
|
|
2
|
+
import { IpPool, IpPoolUpdateData } from './interfaces/IpPools';
|
|
3
3
|
export default class IpPoolsClient {
|
|
4
|
-
request:
|
|
5
|
-
constructor(request:
|
|
6
|
-
list(query: any): IpPool[]
|
|
4
|
+
request: Request;
|
|
5
|
+
constructor(request: Request);
|
|
6
|
+
list(query: any): Promise<IpPool[]>;
|
|
7
7
|
create(data: {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
ips?: string[];
|
|
11
|
-
}):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
remove_ip: string;
|
|
17
|
-
}): any;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
message: string;
|
|
13
|
+
pool_id: string;
|
|
14
|
+
}>;
|
|
15
|
+
update(poolId: string, data: IpPoolUpdateData): Promise<any>;
|
|
18
16
|
delete(poolId: string, data: {
|
|
19
17
|
id: string;
|
|
20
18
|
pool_id: string;
|
|
21
|
-
}): any
|
|
19
|
+
}): Promise<any>;
|
|
22
20
|
private parseIpPoolsResponse;
|
|
23
21
|
}
|
|
24
|
-
export {};
|
package/dist/lib/ips.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import MgRequest from './request';
|
|
2
|
+
import { IpData, IpsListResponseBody } from './interfaces/Ips';
|
|
2
3
|
export default class IpsClient {
|
|
3
|
-
request:
|
|
4
|
-
constructor(request:
|
|
5
|
-
list(query: any):
|
|
6
|
-
get(ip: string):
|
|
4
|
+
request: MgRequest;
|
|
5
|
+
constructor(request: MgRequest);
|
|
6
|
+
list(query: any): Promise<IpsListResponseBody | IpData>;
|
|
7
|
+
get(ip: string): Promise<IpsListResponseBody | IpData>;
|
|
7
8
|
private parseIpsResponse;
|
|
8
9
|
}
|
|
9
|
-
export {};
|
package/dist/lib/messages.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Request from './request';
|
|
2
2
|
import { BounceData, ComplaintData, UnsubscribeData } from './interfaces/Supressions';
|
|
3
|
-
declare type TModel = typeof Bounce | typeof Complaint | typeof Unsubscribe;
|
|
4
3
|
declare class Bounce {
|
|
5
4
|
type: string;
|
|
6
5
|
address: string;
|
|
@@ -22,6 +21,7 @@ declare class Unsubscribe {
|
|
|
22
21
|
created_at: Date;
|
|
23
22
|
constructor(data: UnsubscribeData);
|
|
24
23
|
}
|
|
24
|
+
declare type TModel = typeof Bounce | typeof Complaint | typeof Unsubscribe;
|
|
25
25
|
export default class SuppressionClient {
|
|
26
26
|
request: any;
|
|
27
27
|
models: {
|