mailgun.js 8.2.2 → 9.0.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 +66 -0
- package/Classes/Domains/domain.d.ts +16 -0
- package/{domains.d.ts → Classes/Domains/domains.d.ts} +5 -8
- package/Classes/Domains/domainsClient.d.ts +36 -0
- package/{domainsCredentials.d.ts → Classes/Domains/domainsCredentials.d.ts} +3 -2
- package/{domainsTags.d.ts → Classes/Domains/domainsTags.d.ts} +6 -4
- package/{domainsTemplates.d.ts → Classes/Domains/domainsTemplates.d.ts} +9 -8
- package/{events.d.ts → Classes/Events.d.ts} +4 -3
- package/{ip-pools.d.ts → Classes/IPPools.d.ts} +4 -3
- package/Classes/IPs.d.ts +10 -0
- package/Classes/MailgunClient.d.ts +18 -0
- package/{mailListMembers.d.ts → Classes/MailingLists/mailListMembers.d.ts} +4 -3
- package/Classes/MailingLists/mailingLists.d.ts +21 -0
- package/{messages.d.ts → Classes/Messages.d.ts} +4 -3
- package/{routes.d.ts → Classes/Routes.d.ts} +4 -3
- package/Classes/Stats/StatsClient.d.ts +14 -0
- package/Classes/Stats/StatsContainer.d.ts +9 -0
- package/Classes/Suppressions/Bounce.d.ts +10 -0
- package/Classes/Suppressions/Complaint.d.ts +8 -0
- package/Classes/Suppressions/Suppression.d.ts +5 -0
- package/Classes/Suppressions/SuppressionsClient.d.ts +23 -0
- package/Classes/Suppressions/Unsubscribe.d.ts +9 -0
- package/Classes/Suppressions/WhiteList.d.ts +9 -0
- package/{multipleValidation.d.ts → Classes/Validations/multipleValidation.d.ts} +4 -3
- package/Classes/Validations/validate.d.ts +9 -0
- package/Classes/Webhooks.d.ts +21 -0
- package/Classes/common/Error.d.ts +8 -0
- package/{formDataBuilder.d.ts → Classes/common/FormDataBuilder.d.ts} +1 -1
- package/Classes/common/NavigationThruPages.d.ts +17 -0
- package/{request.d.ts → Classes/common/Request.d.ts} +2 -4
- package/Enums/index.d.ts +24 -0
- package/Interfaces/Common/Logger.d.ts +3 -0
- package/Interfaces/Common/index.d.ts +1 -0
- package/Interfaces/Domains/DomainCredentials.d.ts +7 -0
- package/Interfaces/Domains/DomainTags.d.ts +20 -0
- package/Interfaces/Domains/DomainTemplates.d.ts +23 -0
- package/Interfaces/Domains/DomainsClient.d.ts +27 -0
- package/Interfaces/Domains/index.d.ts +4 -0
- package/Interfaces/EventClient/IEventClient.d.ts +4 -0
- package/Interfaces/EventClient/index.d.ts +1 -0
- package/Interfaces/IPPools/IIPPoolsClient.d.ts +7 -0
- package/Interfaces/IPPools/index.d.ts +1 -0
- package/Interfaces/IPs/IIPsClient.d.ts +5 -0
- package/Interfaces/IPs/index.d.ts +1 -0
- package/Interfaces/MailgunClient/IMailgunClient.d.ts +24 -0
- package/Interfaces/MailgunClient/index.d.ts +1 -0
- package/Interfaces/MailingLists/MailingListMembers.d.ts +9 -0
- package/Interfaces/MailingLists/MailingListsClient.d.ts +13 -0
- package/Interfaces/MailingLists/index.d.ts +2 -0
- package/Interfaces/Messages/IMessagesClient.d.ts +4 -0
- package/Interfaces/Messages/index.d.ts +1 -0
- package/Interfaces/Routes/IRoutesClient.d.ts +8 -0
- package/Interfaces/Routes/index.d.ts +1 -0
- package/Interfaces/Stats/StatsClient.d.ts +6 -0
- package/Interfaces/Stats/StatsContainer.d.ts +7 -0
- package/Interfaces/Stats/index.d.ts +2 -0
- package/{interfaces → Interfaces}/Suppressions/Bounce.d.ts +0 -6
- package/{interfaces → Interfaces}/Suppressions/Complaint.d.ts +0 -4
- package/Interfaces/Suppressions/ISuppressionsClient.d.ts +11 -0
- package/{interfaces → Interfaces}/Suppressions/Unsubscribe.d.ts +0 -5
- package/Interfaces/Suppressions/WhiteList.d.ts +6 -0
- package/Interfaces/Suppressions/index.d.ts +5 -0
- package/Interfaces/Validations/MultipleValidation.d.ts +7 -0
- package/Interfaces/Validations/Validation.d.ts +6 -0
- package/Interfaces/Validations/index.d.ts +2 -0
- package/Interfaces/Webhooks/IWebHooksClient.d.ts +9 -0
- package/Interfaces/Webhooks/index.d.ts +1 -0
- package/Interfaces/index.d.ts +13 -0
- package/README.md +42 -13
- package/Types/Common/ApiResponse.d.ts +4 -0
- package/Types/Common/Error.d.ts +19 -0
- package/Types/Common/FormData.d.ts +7 -0
- package/{interfaces → Types/Common}/NavigationThruPages.d.ts +14 -14
- package/{interfaces → Types/Common}/RequestOptions.d.ts +7 -7
- package/Types/Common/index.d.ts +5 -0
- package/Types/Domains/DomainCredentials.d.ts +46 -0
- package/{interfaces → Types/Domains}/DomainTags.d.ts +34 -57
- package/Types/Domains/DomainTemplates.d.ts +153 -0
- package/{interfaces → Types/Domains}/DomainTracking.d.ts +8 -8
- package/{interfaces → Types/Domains}/Domains.d.ts +50 -36
- package/Types/Domains/index.d.ts +5 -0
- package/{interfaces → Types/Events}/Events.d.ts +15 -15
- package/Types/Events/index.d.ts +1 -0
- package/{interfaces → Types/IPPools}/IpPools.d.ts +6 -6
- package/Types/IPPools/index.d.ts +1 -0
- package/{interfaces/Ips.d.ts → Types/IPs/IPs.d.ts} +7 -4
- package/Types/IPs/index.d.ts +1 -0
- package/{interfaces/Options.d.ts → Types/MailgunClient/MailgunClientOptions.d.ts} +2 -3
- package/Types/MailgunClient/index.d.ts +1 -0
- package/Types/MailingLists/MailingListMembers.d.ts +60 -0
- package/{interfaces/lists.d.ts → Types/MailingLists/MailingLists.d.ts} +22 -22
- package/Types/MailingLists/index.d.ts +2 -0
- package/{interfaces → Types/Messages}/Messages.d.ts +5 -5
- package/Types/Messages/index.d.ts +1 -0
- package/{interfaces/routes.d.ts → Types/Routes/Routes.d.ts} +6 -6
- package/Types/Routes/index.d.ts +1 -0
- package/{interfaces/StatsOptions.d.ts → Types/Stats/Stats.d.ts} +6 -6
- package/Types/Stats/index.d.ts +1 -0
- package/Types/Suppressions/Bounce.d.ts +6 -0
- package/Types/Suppressions/Complaint.d.ts +4 -0
- package/{interfaces → Types}/Suppressions/Suppressions.d.ts +19 -28
- package/Types/Suppressions/Unsubscribe.d.ts +5 -0
- package/Types/Suppressions/WhiteList.d.ts +6 -0
- package/Types/Suppressions/index.d.ts +5 -0
- package/{interfaces → Types/Validations}/MultipleValidation.d.ts +20 -26
- package/{interfaces/Validate.d.ts → Types/Validations/Validation.d.ts} +4 -4
- package/Types/Validations/index.d.ts +2 -0
- package/Types/Webhooks/Webhooks.d.ts +29 -0
- package/Types/Webhooks/index.d.ts +1 -0
- package/Types/index.d.ts +13 -0
- package/index.d.ts +7 -4
- package/mailgun.node.js +2 -2
- package/mailgun.node.js.LICENSE.txt +1 -1
- package/mailgun.web.js +2 -2
- package/mailgun.web.js.LICENSE.txt +1 -1
- package/package.json +1 -1
- package/version.md +1 -1
- package/client.d.ts +0 -29
- package/common/NavigationThruPages.d.ts +0 -19
- package/error.d.ts +0 -8
- package/interfaces/APIErrorOptions.d.ts +0 -11
- package/interfaces/ApiResponse.d.ts +0 -5
- package/interfaces/DomainCredentials.d.ts +0 -52
- package/interfaces/DomainTemplates.d.ts +0 -178
- package/interfaces/IFormData.d.ts +0 -7
- package/interfaces/IMailgunClient.d.ts +0 -24
- package/interfaces/Suppressions/WhiteList.d.ts +0 -12
- package/interfaces/Supressions.d.ts +0 -103
- package/interfaces/Webhooks.d.ts +0 -34
- package/interfaces/mailListMembers.d.ts +0 -68
- package/ips.d.ts +0 -9
- package/lists.d.ts +0 -20
- package/stats.d.ts +0 -20
- package/suppressions.d.ts +0 -53
- package/validate.d.ts +0 -9
- package/webhooks.d.ts +0 -32
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PagesList, ParsedPagesList } from '../Common';
|
|
2
|
+
import { MailingList } from './MailingLists';
|
|
3
|
+
export type MailListMember = {
|
|
4
|
+
address: string;
|
|
5
|
+
name: string;
|
|
6
|
+
subscribed: boolean;
|
|
7
|
+
vars: {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type MailListMembersQuery = {
|
|
12
|
+
subscribed?: 'yes' | 'no';
|
|
13
|
+
limit?: number;
|
|
14
|
+
page?: string;
|
|
15
|
+
};
|
|
16
|
+
export type MultipleMembersData = {
|
|
17
|
+
members: Array<MailListMember>;
|
|
18
|
+
upsert: 'yes' | 'no';
|
|
19
|
+
};
|
|
20
|
+
export type MultipleMembersReqData = {
|
|
21
|
+
members: string;
|
|
22
|
+
upsert: 'yes' | 'no';
|
|
23
|
+
};
|
|
24
|
+
export type CreateUpdateMailListMembers = {
|
|
25
|
+
address: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
vars?: string;
|
|
28
|
+
subscribed?: 'yes' | 'no' | boolean;
|
|
29
|
+
upsert?: 'yes' | 'no';
|
|
30
|
+
};
|
|
31
|
+
export type CreateUpdateMailListMembersReq = {
|
|
32
|
+
address: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
vars?: string;
|
|
35
|
+
subscribed?: 'yes' | 'no' | boolean;
|
|
36
|
+
upsert?: 'yes' | 'no';
|
|
37
|
+
};
|
|
38
|
+
export type DeletedMember = {
|
|
39
|
+
member: {
|
|
40
|
+
address: string;
|
|
41
|
+
};
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
export type NewMultipleMembersResponse = {
|
|
45
|
+
list: MailingList;
|
|
46
|
+
message: string;
|
|
47
|
+
'task-id': string;
|
|
48
|
+
};
|
|
49
|
+
export type MailListMembersResponse = {
|
|
50
|
+
body: {
|
|
51
|
+
items: MailListMember[];
|
|
52
|
+
paging: PagesList;
|
|
53
|
+
};
|
|
54
|
+
status: number;
|
|
55
|
+
};
|
|
56
|
+
export type MailListMembersResult = {
|
|
57
|
+
items: MailListMember[];
|
|
58
|
+
pages: ParsedPagesList;
|
|
59
|
+
status: number;
|
|
60
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PagesList, ParsedPagesList } from '
|
|
1
|
+
import { PagesList, ParsedPagesList } from '../Common';
|
|
2
2
|
export type ListsQuery = {
|
|
3
3
|
address?: string;
|
|
4
4
|
limit?: number;
|
|
@@ -11,16 +11,16 @@ export type CreateUpdateList = {
|
|
|
11
11
|
access_level?: 'readonly' | 'members' | 'everyone';
|
|
12
12
|
reply_preference?: 'list' | 'sender';
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DestroyedList = {
|
|
15
15
|
address: string;
|
|
16
16
|
message: string;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
};
|
|
18
|
+
export type StartValidationResult = {
|
|
19
19
|
status: number;
|
|
20
20
|
id: string;
|
|
21
21
|
message: string;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type MailingListValidationResponse = {
|
|
24
24
|
status: string;
|
|
25
25
|
download_url: {
|
|
26
26
|
csv: string;
|
|
@@ -44,22 +44,22 @@ export interface ValidationResponse {
|
|
|
44
44
|
unknown: number;
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
}
|
|
48
|
-
export
|
|
47
|
+
};
|
|
48
|
+
export type MailingListValidationApiResponse = MailingListValidationResponse & {
|
|
49
49
|
created_at: number;
|
|
50
|
-
}
|
|
51
|
-
export
|
|
50
|
+
};
|
|
51
|
+
export type MailingListValidationResultData = MailingListValidationResponse & {
|
|
52
52
|
created_at: Date;
|
|
53
|
-
}
|
|
54
|
-
export
|
|
53
|
+
};
|
|
54
|
+
export type MailingListValidationResult = {
|
|
55
55
|
status: number;
|
|
56
|
-
validationResult:
|
|
57
|
-
}
|
|
58
|
-
export
|
|
56
|
+
validationResult: MailingListValidationResultData;
|
|
57
|
+
};
|
|
58
|
+
export type MailingListCancelValidationResult = {
|
|
59
59
|
status: number;
|
|
60
60
|
message: string;
|
|
61
|
-
}
|
|
62
|
-
export
|
|
61
|
+
};
|
|
62
|
+
export type MailingList = {
|
|
63
63
|
access_level: string;
|
|
64
64
|
address: string;
|
|
65
65
|
created_at: string;
|
|
@@ -67,16 +67,16 @@ export interface MailingList {
|
|
|
67
67
|
members_count: number;
|
|
68
68
|
name: string;
|
|
69
69
|
reply_preference: null | string;
|
|
70
|
-
}
|
|
71
|
-
export
|
|
70
|
+
};
|
|
71
|
+
export type MailingListResult = {
|
|
72
72
|
items: MailingList[];
|
|
73
73
|
status: number;
|
|
74
74
|
pages: ParsedPagesList;
|
|
75
|
-
}
|
|
76
|
-
export
|
|
75
|
+
};
|
|
76
|
+
export type MailingListApiResponse = {
|
|
77
77
|
body: {
|
|
78
78
|
items: MailingList[];
|
|
79
79
|
paging: PagesList;
|
|
80
80
|
};
|
|
81
81
|
status: number;
|
|
82
|
-
}
|
|
82
|
+
};
|
|
@@ -163,18 +163,18 @@ export type MailgunMessageData = MailgunMessageContent & {
|
|
|
163
163
|
* `v:` prefix followed by an arbitrary name allows to attach a custom JSON data to the message. See [Attaching Data to Messages](https://documentation.mailgun.com/en/latest/user_manual.html#manual-customdata) for more information.
|
|
164
164
|
*/
|
|
165
165
|
'v:my-var'?: string;
|
|
166
|
-
[key: string]:
|
|
166
|
+
[key: string]: unknown;
|
|
167
167
|
};
|
|
168
|
-
export
|
|
168
|
+
export type MessagesSendAPIResponse = {
|
|
169
169
|
status: number;
|
|
170
170
|
body: {
|
|
171
171
|
id: string;
|
|
172
172
|
message: string;
|
|
173
173
|
};
|
|
174
|
-
}
|
|
175
|
-
export
|
|
174
|
+
};
|
|
175
|
+
export type MessagesSendResult = {
|
|
176
176
|
id?: string;
|
|
177
177
|
message?: string;
|
|
178
178
|
status: number;
|
|
179
179
|
details?: string;
|
|
180
|
-
}
|
|
180
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Messages';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Route = {
|
|
2
2
|
actions: string[];
|
|
3
3
|
created_at: string;
|
|
4
4
|
description: string;
|
|
5
5
|
expression: string;
|
|
6
6
|
id: string;
|
|
7
7
|
priority: number;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type UpdateRouteResponse = Route & {
|
|
10
10
|
message: string;
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
};
|
|
12
|
+
export type DestroyRouteResponse = {
|
|
13
13
|
id: string;
|
|
14
14
|
message: string;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
export type CreateUpdateRouteData = {
|
|
17
17
|
priority?: number;
|
|
18
18
|
description?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Routes';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Stat = {
|
|
2
2
|
time: string | Date;
|
|
3
3
|
delivered: {
|
|
4
4
|
smtp: number;
|
|
5
5
|
http: number;
|
|
6
6
|
total: number;
|
|
7
7
|
};
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type StatsOptions = {
|
|
10
10
|
start: string | Date;
|
|
11
11
|
end: string | Date;
|
|
12
12
|
resolution: string;
|
|
13
13
|
stats: Stat[];
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
export type StatsEvent = 'accepted' | 'delivered' | 'opened' | 'clicked' | 'unsubscribed' | 'stored' | 'complained' | 'failed';
|
|
16
|
-
export
|
|
16
|
+
export type StatsQuery = {
|
|
17
17
|
event: StatsEvent | StatsEvent[];
|
|
18
18
|
start?: string | Date;
|
|
19
19
|
end?: string | Date;
|
|
20
20
|
resolution?: 'hour' | 'day' | 'month';
|
|
21
21
|
duration?: string;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Stats';
|
|
@@ -1,50 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { WhiteListData } from './WhiteList';
|
|
7
|
-
export declare enum SuppressionModels {
|
|
8
|
-
BOUNCES = "bounces",
|
|
9
|
-
COMPLAINTS = "complaints",
|
|
10
|
-
UNSUBSCRIBES = "unsubscribes",
|
|
11
|
-
WHITELISTS = "whitelists"
|
|
12
|
-
}
|
|
13
|
-
export interface SuppressionList {
|
|
14
|
-
items: (Bounce | Complaint | Unsubscribe | WhiteList)[];
|
|
1
|
+
import { BounceData, ComplaintData, UnsubscribeData, WhiteListData } from '.';
|
|
2
|
+
import { IBounce, IComplaint, IUnsubscribe, IWhiteList } from '../../Interfaces';
|
|
3
|
+
import { PagesList, ParsedPagesList } from '../Common';
|
|
4
|
+
export type SuppressionList = {
|
|
5
|
+
items: (IBounce | IComplaint | IUnsubscribe | IWhiteList)[];
|
|
15
6
|
pages: ParsedPagesList;
|
|
16
7
|
status: number;
|
|
17
|
-
}
|
|
8
|
+
};
|
|
18
9
|
export type SuppressionListQuery = {
|
|
19
10
|
limit?: number;
|
|
20
11
|
page?: string;
|
|
21
12
|
};
|
|
22
13
|
export type SuppressionDataType = BounceData | ComplaintData | UnsubscribeData | WhiteListData;
|
|
23
|
-
export
|
|
14
|
+
export type SuppressionListResponse = {
|
|
24
15
|
body: {
|
|
25
16
|
items: BounceData[] | ComplaintData[] | UnsubscribeData[] | WhiteListData[];
|
|
26
17
|
paging: PagesList;
|
|
27
18
|
};
|
|
28
19
|
status: number;
|
|
29
|
-
}
|
|
30
|
-
export
|
|
31
|
-
body:
|
|
20
|
+
};
|
|
21
|
+
export type SuppressionResponse = {
|
|
22
|
+
body: SuppressionDataType;
|
|
32
23
|
status: number;
|
|
33
|
-
}
|
|
34
|
-
export
|
|
24
|
+
};
|
|
25
|
+
export type SuppressionDestroyResponse = {
|
|
35
26
|
body: {
|
|
36
27
|
message: string;
|
|
37
28
|
value?: string;
|
|
38
29
|
address?: string;
|
|
39
30
|
};
|
|
40
31
|
status: number;
|
|
41
|
-
}
|
|
42
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export type SuppressionDestroyResult = {
|
|
43
34
|
message: string;
|
|
44
35
|
value: string;
|
|
45
36
|
address: string;
|
|
46
37
|
status: number;
|
|
47
|
-
}
|
|
38
|
+
};
|
|
48
39
|
export type SuppressionCreationData = {
|
|
49
40
|
address: string;
|
|
50
41
|
code?: number;
|
|
@@ -53,17 +44,17 @@ export type SuppressionCreationData = {
|
|
|
53
44
|
tag?: string;
|
|
54
45
|
created_at?: string;
|
|
55
46
|
};
|
|
56
|
-
export
|
|
47
|
+
export type SuppressionCreationResponse = {
|
|
57
48
|
body: {
|
|
58
49
|
message: string;
|
|
59
50
|
type?: string;
|
|
60
51
|
value?: string;
|
|
61
52
|
};
|
|
62
53
|
status: number;
|
|
63
|
-
}
|
|
64
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type SuppressionCreationResult = {
|
|
65
56
|
message: string;
|
|
66
57
|
type: string;
|
|
67
58
|
value: string;
|
|
68
59
|
status: number;
|
|
69
|
-
}
|
|
60
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PagesList, ParsedPagesList } from '
|
|
2
|
-
export
|
|
1
|
+
import { PagesList, ParsedPagesList } from '../Common';
|
|
2
|
+
export type MultipleValidationJobData = {
|
|
3
3
|
created_at: number;
|
|
4
4
|
id: string;
|
|
5
5
|
quantity: number;
|
|
@@ -24,8 +24,8 @@ export interface MultipleValidationJobData {
|
|
|
24
24
|
unknown: number;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
}
|
|
28
|
-
export
|
|
27
|
+
};
|
|
28
|
+
export type MultipleValidationJobResult = {
|
|
29
29
|
createdAt: Date;
|
|
30
30
|
id: string;
|
|
31
31
|
quantity: number;
|
|
@@ -51,44 +51,38 @@ export interface MultipleValidationJobResult {
|
|
|
51
51
|
unknown: number;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
}
|
|
55
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type CreatedMultipleValidationJob = {
|
|
56
56
|
id: string;
|
|
57
57
|
message: string;
|
|
58
|
-
}
|
|
59
|
-
export
|
|
58
|
+
};
|
|
59
|
+
export type MultipleValidationCreationData = {
|
|
60
60
|
file: Record<string, unknown>;
|
|
61
61
|
[key: string]: unknown | undefined;
|
|
62
|
-
}
|
|
63
|
-
export
|
|
62
|
+
};
|
|
63
|
+
export type MultipleValidationCreationDataUpdated = {
|
|
64
64
|
multipleValidationFile: Record<string, unknown>;
|
|
65
65
|
[key: string]: unknown | undefined;
|
|
66
|
-
}
|
|
67
|
-
export
|
|
66
|
+
};
|
|
67
|
+
export type MultipleValidationJobsListResult = {
|
|
68
68
|
jobs: MultipleValidationJobResult[];
|
|
69
69
|
pages: ParsedPagesList;
|
|
70
70
|
total: number;
|
|
71
71
|
status: number;
|
|
72
|
-
}
|
|
73
|
-
export
|
|
72
|
+
};
|
|
73
|
+
export type MultipleValidationJobsListQuery = {
|
|
74
74
|
limit: number;
|
|
75
|
-
page
|
|
76
|
-
}
|
|
77
|
-
export
|
|
75
|
+
page?: string;
|
|
76
|
+
};
|
|
77
|
+
export type MultipleValidationJobsListResponse = {
|
|
78
78
|
status: number;
|
|
79
79
|
body: {
|
|
80
80
|
paging: PagesList;
|
|
81
81
|
jobs: MultipleValidationJobData[];
|
|
82
82
|
total: number;
|
|
83
83
|
};
|
|
84
|
-
}
|
|
85
|
-
export
|
|
84
|
+
};
|
|
85
|
+
export type CanceledMultipleValidationJob = {
|
|
86
86
|
message: string;
|
|
87
87
|
status: number;
|
|
88
|
-
}
|
|
89
|
-
export interface IMultipleValidationClient {
|
|
90
|
-
list(): Promise<MultipleValidationJobsListResult>;
|
|
91
|
-
get(listId: string): Promise<MultipleValidationJobResult>;
|
|
92
|
-
create(listId: string, file: any): Promise<CreatedMultipleValidationJob>;
|
|
93
|
-
destroy(listId: string): Promise<CanceledMultipleValidationJob>;
|
|
94
|
-
}
|
|
88
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export type ValidationQuery = {
|
|
2
2
|
address: string;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type ValidationResult = {
|
|
5
5
|
address: string;
|
|
6
6
|
is_disposable_address: boolean;
|
|
7
7
|
is_role_address: boolean;
|
|
8
8
|
reason: string[];
|
|
9
9
|
result: string;
|
|
10
10
|
risk: string;
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
};
|
|
12
|
+
export type ValidationResponse = {
|
|
13
13
|
status: number;
|
|
14
14
|
body: ValidationResult;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type APIWebhook = {
|
|
2
|
+
url?: string;
|
|
3
|
+
urls?: string[];
|
|
4
|
+
};
|
|
5
|
+
export type WebhookResponseBody = {
|
|
6
|
+
message: string;
|
|
7
|
+
webhook: APIWebhook;
|
|
8
|
+
};
|
|
9
|
+
export type WebhookResponse = {
|
|
10
|
+
status: number;
|
|
11
|
+
body: WebhookResponseBody;
|
|
12
|
+
};
|
|
13
|
+
export type WebhookList = {
|
|
14
|
+
[id: string]: {
|
|
15
|
+
urls: string[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type WebhooksQuery = {
|
|
19
|
+
limit?: number;
|
|
20
|
+
skip?: number;
|
|
21
|
+
};
|
|
22
|
+
export type WebhookValidationResponse = {
|
|
23
|
+
code: number;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
export type WebhookResult = {
|
|
27
|
+
id: string;
|
|
28
|
+
url: string | undefined;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Webhooks';
|
package/Types/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './Common';
|
|
2
|
+
export * from './Domains';
|
|
3
|
+
export * from './Events';
|
|
4
|
+
export * from './IPPools';
|
|
5
|
+
export * from './IPs';
|
|
6
|
+
export * from './MailgunClient';
|
|
7
|
+
export * from './MailingLists';
|
|
8
|
+
export * from './Messages';
|
|
9
|
+
export * from './Routes';
|
|
10
|
+
export * from './Stats';
|
|
11
|
+
export * from './Suppressions';
|
|
12
|
+
export * from './Validations';
|
|
13
|
+
export * from './Webhooks';
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { InputFormData } from './
|
|
3
|
-
import
|
|
1
|
+
import { IMailgunClient } from './Interfaces';
|
|
2
|
+
import { InputFormData } from './Types/Common';
|
|
3
|
+
import { MailgunClientOptions } from './Types/MailgunClient';
|
|
4
|
+
export * as Enums from './Enums';
|
|
5
|
+
export * from './Types';
|
|
6
|
+
export * as Interfaces from './Interfaces';
|
|
4
7
|
export default class Mailgun {
|
|
5
8
|
static get default(): typeof Mailgun;
|
|
6
9
|
private formData;
|
|
7
10
|
constructor(FormData: InputFormData);
|
|
8
|
-
client(options:
|
|
11
|
+
client(options: MailgunClientOptions): IMailgunClient;
|
|
9
12
|
}
|