mailgun.js 8.2.1 → 9.0.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/Classes/Domains/domain.d.ts +16 -0
  3. package/{domains.d.ts → Classes/Domains/domains.d.ts} +5 -8
  4. package/Classes/Domains/domainsClient.d.ts +36 -0
  5. package/{domainsCredentials.d.ts → Classes/Domains/domainsCredentials.d.ts} +3 -2
  6. package/{domainsTags.d.ts → Classes/Domains/domainsTags.d.ts} +6 -4
  7. package/{domainsTemplates.d.ts → Classes/Domains/domainsTemplates.d.ts} +9 -8
  8. package/{events.d.ts → Classes/Events.d.ts} +4 -3
  9. package/{ip-pools.d.ts → Classes/IPPools.d.ts} +4 -3
  10. package/Classes/IPs.d.ts +10 -0
  11. package/Classes/MailgunClient.d.ts +18 -0
  12. package/{mailListMembers.d.ts → Classes/MailingLists/mailListMembers.d.ts} +4 -3
  13. package/Classes/MailingLists/mailingLists.d.ts +21 -0
  14. package/{messages.d.ts → Classes/Messages.d.ts} +4 -3
  15. package/{routes.d.ts → Classes/Routes.d.ts} +4 -3
  16. package/Classes/Stats/StatsClient.d.ts +14 -0
  17. package/Classes/Stats/StatsContainer.d.ts +9 -0
  18. package/Classes/Suppressions/Bounce.d.ts +10 -0
  19. package/Classes/Suppressions/Complaint.d.ts +8 -0
  20. package/Classes/Suppressions/Suppression.d.ts +5 -0
  21. package/Classes/Suppressions/SuppressionsClient.d.ts +23 -0
  22. package/Classes/Suppressions/Unsubscribe.d.ts +9 -0
  23. package/Classes/Suppressions/WhiteList.d.ts +9 -0
  24. package/{multipleValidation.d.ts → Classes/Validations/multipleValidation.d.ts} +4 -3
  25. package/Classes/Validations/validate.d.ts +9 -0
  26. package/Classes/Webhooks.d.ts +21 -0
  27. package/Classes/common/Error.d.ts +8 -0
  28. package/{formDataBuilder.d.ts → Classes/common/FormDataBuilder.d.ts} +1 -1
  29. package/Classes/common/NavigationThruPages.d.ts +17 -0
  30. package/{request.d.ts → Classes/common/Request.d.ts} +2 -4
  31. package/Enums/index.d.ts +24 -0
  32. package/Interfaces/Common/Logger.d.ts +3 -0
  33. package/Interfaces/Common/index.d.ts +1 -0
  34. package/Interfaces/Domains/DomainCredentials.d.ts +7 -0
  35. package/Interfaces/Domains/DomainTags.d.ts +20 -0
  36. package/Interfaces/Domains/DomainTemplates.d.ts +23 -0
  37. package/Interfaces/Domains/DomainsClient.d.ts +21 -0
  38. package/Interfaces/Domains/index.d.ts +4 -0
  39. package/Interfaces/EventClient/IEventClient.d.ts +4 -0
  40. package/Interfaces/EventClient/index.d.ts +1 -0
  41. package/Interfaces/IPPools/IIPPoolsClient.d.ts +7 -0
  42. package/Interfaces/IPPools/index.d.ts +1 -0
  43. package/Interfaces/IPs/IIPsClient.d.ts +5 -0
  44. package/Interfaces/IPs/index.d.ts +1 -0
  45. package/Interfaces/MailgunClient/IMailgunClient.d.ts +24 -0
  46. package/Interfaces/MailgunClient/index.d.ts +1 -0
  47. package/Interfaces/MailingLists/MailingListMembers.d.ts +9 -0
  48. package/Interfaces/MailingLists/MailingListsClient.d.ts +11 -0
  49. package/Interfaces/MailingLists/index.d.ts +2 -0
  50. package/Interfaces/Messages/IMessagesClient.d.ts +4 -0
  51. package/Interfaces/Messages/index.d.ts +1 -0
  52. package/Interfaces/Routes/IRoutesClient.d.ts +8 -0
  53. package/Interfaces/Routes/index.d.ts +1 -0
  54. package/Interfaces/Stats/StatsClient.d.ts +6 -0
  55. package/Interfaces/Stats/StatsContainer.d.ts +7 -0
  56. package/Interfaces/Stats/index.d.ts +2 -0
  57. package/{interfaces → Interfaces}/Suppressions/Bounce.d.ts +0 -6
  58. package/{interfaces → Interfaces}/Suppressions/Complaint.d.ts +0 -4
  59. package/Interfaces/Suppressions/ISuppressionsClient.d.ts +11 -0
  60. package/{interfaces → Interfaces}/Suppressions/Unsubscribe.d.ts +0 -5
  61. package/Interfaces/Suppressions/WhiteList.d.ts +6 -0
  62. package/Interfaces/Suppressions/index.d.ts +5 -0
  63. package/Interfaces/Validations/MultipleValidation.d.ts +7 -0
  64. package/Interfaces/Validations/Validation.d.ts +4 -0
  65. package/Interfaces/Validations/index.d.ts +2 -0
  66. package/Interfaces/Webhooks/IWebHooksClient.d.ts +9 -0
  67. package/Interfaces/Webhooks/index.d.ts +1 -0
  68. package/Interfaces/index.d.ts +13 -0
  69. package/README.md +42 -13
  70. package/Types/Common/ApiResponse.d.ts +4 -0
  71. package/Types/Common/Error.d.ts +19 -0
  72. package/Types/Common/FormData.d.ts +7 -0
  73. package/{interfaces → Types/Common}/NavigationThruPages.d.ts +14 -14
  74. package/{interfaces → Types/Common}/RequestOptions.d.ts +7 -7
  75. package/Types/Common/index.d.ts +5 -0
  76. package/Types/Domains/DomainCredentials.d.ts +46 -0
  77. package/{interfaces → Types/Domains}/DomainTags.d.ts +36 -59
  78. package/Types/Domains/DomainTemplates.d.ts +153 -0
  79. package/{interfaces → Types/Domains}/DomainTracking.d.ts +11 -11
  80. package/{interfaces → Types/Domains}/Domains.d.ts +53 -39
  81. package/Types/Domains/index.d.ts +5 -0
  82. package/{interfaces → Types/Events}/Events.d.ts +15 -15
  83. package/Types/Events/index.d.ts +1 -0
  84. package/{interfaces → Types/IPPools}/IpPools.d.ts +13 -13
  85. package/Types/IPPools/index.d.ts +1 -0
  86. package/{interfaces/Ips.d.ts → Types/IPs/IPs.d.ts} +7 -4
  87. package/Types/IPs/index.d.ts +1 -0
  88. package/{interfaces/Options.d.ts → Types/MailgunClient/MailgunClientOptions.d.ts} +2 -3
  89. package/Types/MailgunClient/index.d.ts +1 -0
  90. package/Types/MailingLists/MailingListMembers.d.ts +60 -0
  91. package/{interfaces/lists.d.ts → Types/MailingLists/MailingLists.d.ts} +24 -24
  92. package/Types/MailingLists/index.d.ts +2 -0
  93. package/{interfaces → Types/Messages}/Messages.d.ts +8 -8
  94. package/Types/Messages/index.d.ts +1 -0
  95. package/{interfaces/routes.d.ts → Types/Routes/Routes.d.ts} +8 -8
  96. package/Types/Routes/index.d.ts +1 -0
  97. package/{interfaces/StatsOptions.d.ts → Types/Stats/Stats.d.ts} +7 -7
  98. package/Types/Stats/index.d.ts +1 -0
  99. package/Types/Suppressions/Bounce.d.ts +6 -0
  100. package/Types/Suppressions/Complaint.d.ts +4 -0
  101. package/Types/Suppressions/Suppressions.d.ts +60 -0
  102. package/Types/Suppressions/Unsubscribe.d.ts +5 -0
  103. package/Types/Suppressions/WhiteList.d.ts +6 -0
  104. package/Types/Suppressions/index.d.ts +5 -0
  105. package/{interfaces → Types/Validations}/MultipleValidation.d.ts +19 -25
  106. package/{interfaces/Validate.d.ts → Types/Validations/Validation.d.ts} +5 -5
  107. package/Types/Validations/index.d.ts +2 -0
  108. package/Types/Webhooks/Webhooks.d.ts +29 -0
  109. package/Types/Webhooks/index.d.ts +1 -0
  110. package/Types/index.d.ts +13 -0
  111. package/index.d.ts +7 -4
  112. package/mailgun.node.js +2 -2
  113. package/mailgun.node.js.LICENSE.txt +1 -1
  114. package/mailgun.web.js +2 -2
  115. package/mailgun.web.js.LICENSE.txt +1 -1
  116. package/package.json +1 -1
  117. package/version.md +1 -1
  118. package/client.d.ts +0 -29
  119. package/common/NavigationThruPages.d.ts +0 -19
  120. package/error.d.ts +0 -8
  121. package/interfaces/APIErrorOptions.d.ts +0 -11
  122. package/interfaces/ApiResponse.d.ts +0 -5
  123. package/interfaces/DomainCredentials.d.ts +0 -52
  124. package/interfaces/DomainTemplates.d.ts +0 -178
  125. package/interfaces/IFormData.d.ts +0 -7
  126. package/interfaces/IMailgunClient.d.ts +0 -24
  127. package/interfaces/Suppressions/Suppressions.d.ts +0 -69
  128. package/interfaces/Suppressions/WhiteList.d.ts +0 -12
  129. package/interfaces/Supressions.d.ts +0 -103
  130. package/interfaces/Webhooks.d.ts +0 -34
  131. package/interfaces/mailListMembers.d.ts +0 -68
  132. package/ips.d.ts +0 -9
  133. package/lists.d.ts +0 -20
  134. package/stats.d.ts +0 -20
  135. package/suppressions.d.ts +0 -53
  136. package/validate.d.ts +0 -9
  137. package/webhooks.d.ts +0 -32
@@ -1,10 +1,13 @@
1
- export interface IpsListResponseBody {
1
+ export type IpsListResponseBody = {
2
2
  assignable_to_pools: boolean;
3
3
  items: string[];
4
4
  total_count: number;
5
- }
6
- export interface IpData {
5
+ };
6
+ export type IpData = {
7
7
  ip: string;
8
8
  dedicated: boolean;
9
9
  rdns: string;
10
- }
10
+ };
11
+ export type IPsListQuery = {
12
+ dedicated: boolean | string;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './IPs';
@@ -1,8 +1,7 @@
1
- interface Options {
1
+ export type MailgunClientOptions = {
2
2
  username: string;
3
3
  key: string;
4
4
  url?: string;
5
5
  public_key?: string;
6
6
  timeout?: number;
7
- }
8
- export default Options;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './MailgunClientOptions';
@@ -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,26 +1,26 @@
1
- import { PagesList, ParsedPagesList } from './NavigationThruPages';
2
- export declare type ListsQuery = {
1
+ import { PagesList, ParsedPagesList } from '../Common';
2
+ export type ListsQuery = {
3
3
  address?: string;
4
4
  limit?: number;
5
5
  page?: string;
6
6
  };
7
- export declare type CreateUpdateList = {
7
+ export type CreateUpdateList = {
8
8
  address: string;
9
9
  name?: string;
10
10
  description?: string;
11
11
  access_level?: 'readonly' | 'members' | 'everyone';
12
12
  reply_preference?: 'list' | 'sender';
13
13
  };
14
- export interface DestroyedList {
14
+ export type DestroyedList = {
15
15
  address: string;
16
16
  message: string;
17
- }
18
- export interface StartValidationResult {
17
+ };
18
+ export type StartValidationResult = {
19
19
  status: number;
20
20
  id: string;
21
21
  message: string;
22
- }
23
- export interface ValidationResponse {
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 interface ValidationApiResponse extends ValidationResponse {
47
+ };
48
+ export type MailingListValidationApiResponse = MailingListValidationResponse & {
49
49
  created_at: number;
50
- }
51
- export interface ValidationResultData extends ValidationResponse {
50
+ };
51
+ export type MailingListValidationResultData = MailingListValidationResponse & {
52
52
  created_at: Date;
53
- }
54
- export interface ValidationResult {
53
+ };
54
+ export type MailingListValidationResult = {
55
55
  status: number;
56
- validationResult: ValidationResultData;
57
- }
58
- export interface CancelValidationResult {
56
+ validationResult: MailingListValidationResultData;
57
+ };
58
+ export type MailingListCancelValidationResult = {
59
59
  status: number;
60
60
  message: string;
61
- }
62
- export interface MailingList {
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 interface MailingListResult {
70
+ };
71
+ export type MailingListResult = {
72
72
  items: MailingList[];
73
73
  status: number;
74
74
  pages: ParsedPagesList;
75
- }
76
- export interface MailingListApiResponse {
75
+ };
76
+ export type MailingListApiResponse = {
77
77
  body: {
78
78
  items: MailingList[];
79
79
  paging: PagesList;
80
80
  };
81
81
  status: number;
82
- }
82
+ };
@@ -0,0 +1,2 @@
1
+ export * from './MailingListMembers';
2
+ export * from './MailingLists';
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * @see {@link https://stackoverflow.com/a/49725198}
6
6
  */
7
- export declare type AtLeastOneKeyPresent<Object_, Keys extends keyof Object_ = keyof Object_> = Pick<Object_, Exclude<keyof Object_, Keys>> & {
7
+ export type AtLeastOneKeyPresent<Object_, Keys extends keyof Object_ = keyof Object_> = Pick<Object_, Exclude<keyof Object_, Keys>> & {
8
8
  [K in Keys]-?: Required<Pick<Object_, K>> & Partial<Pick<Object_, Exclude<Keys, K>>>;
9
9
  }[Keys];
10
- export declare type MailgunMessageContent = AtLeastOneKeyPresent<{
10
+ export type MailgunMessageContent = AtLeastOneKeyPresent<{
11
11
  /**
12
12
  * Body of the message. (text version)
13
13
  */
@@ -25,7 +25,7 @@ export declare type MailgunMessageContent = AtLeastOneKeyPresent<{
25
25
  */
26
26
  template?: string;
27
27
  }>;
28
- export declare type MailgunMessageData = MailgunMessageContent & {
28
+ export type MailgunMessageData = MailgunMessageContent & {
29
29
  /**
30
30
  * Email address for `From` header
31
31
  */
@@ -163,18 +163,18 @@ export declare 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]: any;
166
+ [key: string]: unknown;
167
167
  };
168
- export interface MessagesSendAPIResponse {
168
+ export type MessagesSendAPIResponse = {
169
169
  status: number;
170
170
  body: {
171
171
  id: string;
172
172
  message: string;
173
173
  };
174
- }
175
- export interface MessagesSendResult {
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,25 +1,25 @@
1
- export interface Route {
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 interface UpdateRouteResponse extends Route {
8
+ };
9
+ export type UpdateRouteResponse = Route & {
10
10
  message: string;
11
- }
12
- export interface DestroyRouteResponse {
11
+ };
12
+ export type DestroyRouteResponse = {
13
13
  id: string;
14
14
  message: string;
15
- }
16
- export declare type CreateUpdateRouteData = {
15
+ };
16
+ export type CreateUpdateRouteData = {
17
17
  priority?: number;
18
18
  description?: string;
19
19
  expression: string;
20
20
  action: string[];
21
21
  };
22
- export declare type RoutesListQuery = {
22
+ export type RoutesListQuery = {
23
23
  limit?: number;
24
24
  skip?: number;
25
25
  };
@@ -0,0 +1 @@
1
+ export * from './Routes';
@@ -1,22 +1,22 @@
1
- export interface Stat {
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 interface StatsOptions {
8
+ };
9
+ export type StatsOptions = {
10
10
  start: string | Date;
11
11
  end: string | Date;
12
12
  resolution: string;
13
13
  stats: Stat[];
14
- }
15
- export declare type StatsEvent = 'accepted' | 'delivered' | 'opened' | 'clicked' | 'unsubscribed' | 'stored' | 'complained' | 'failed';
16
- export interface StatsQuery {
14
+ };
15
+ export type StatsEvent = 'accepted' | 'delivered' | 'opened' | 'clicked' | 'unsubscribed' | 'stored' | 'complained' | 'failed';
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';
@@ -0,0 +1,6 @@
1
+ export type BounceData = {
2
+ address: string;
3
+ code: number;
4
+ error: string;
5
+ created_at: string | Date;
6
+ };
@@ -0,0 +1,4 @@
1
+ export type ComplaintData = {
2
+ address: string;
3
+ created_at: string | Date;
4
+ };
@@ -0,0 +1,60 @@
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)[];
6
+ pages: ParsedPagesList;
7
+ status: number;
8
+ };
9
+ export type SuppressionListQuery = {
10
+ limit?: number;
11
+ page?: string;
12
+ };
13
+ export type SuppressionDataType = BounceData | ComplaintData | UnsubscribeData | WhiteListData;
14
+ export type SuppressionListResponse = {
15
+ body: {
16
+ items: BounceData[] | ComplaintData[] | UnsubscribeData[] | WhiteListData[];
17
+ paging: PagesList;
18
+ };
19
+ status: number;
20
+ };
21
+ export type SuppressionResponse = {
22
+ body: SuppressionDataType;
23
+ status: number;
24
+ };
25
+ export type SuppressionDestroyResponse = {
26
+ body: {
27
+ message: string;
28
+ value?: string;
29
+ address?: string;
30
+ };
31
+ status: number;
32
+ };
33
+ export type SuppressionDestroyResult = {
34
+ message: string;
35
+ value: string;
36
+ address: string;
37
+ status: number;
38
+ };
39
+ export type SuppressionCreationData = {
40
+ address: string;
41
+ code?: number;
42
+ error?: string;
43
+ domain?: string;
44
+ tag?: string;
45
+ created_at?: string;
46
+ };
47
+ export type SuppressionCreationResponse = {
48
+ body: {
49
+ message: string;
50
+ type?: string;
51
+ value?: string;
52
+ };
53
+ status: number;
54
+ };
55
+ export type SuppressionCreationResult = {
56
+ message: string;
57
+ type: string;
58
+ value: string;
59
+ status: number;
60
+ };
@@ -0,0 +1,5 @@
1
+ export type UnsubscribeData = {
2
+ address: string;
3
+ tags: any;
4
+ created_at: string | Date;
5
+ };
@@ -0,0 +1,6 @@
1
+ export type WhiteListData = {
2
+ type: string;
3
+ value: string;
4
+ reason: string;
5
+ createdAt: string | Date;
6
+ };
@@ -0,0 +1,5 @@
1
+ export * from './Bounce';
2
+ export * from './Complaint';
3
+ export * from './Suppressions';
4
+ export * from './Unsubscribe';
5
+ export * from './WhiteList';
@@ -1,5 +1,5 @@
1
- import { PagesList, ParsedPagesList } from './NavigationThruPages';
2
- export interface MultipleValidationJobData {
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 interface MultipleValidationJobResult {
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 interface CreatedMultipleValidationJob {
54
+ };
55
+ export type CreatedMultipleValidationJob = {
56
56
  id: string;
57
57
  message: string;
58
- }
59
- export interface MultipleValidationCreationData {
58
+ };
59
+ export type MultipleValidationCreationData = {
60
60
  file: Record<string, unknown>;
61
61
  [key: string]: unknown | undefined;
62
- }
63
- export interface MultipleValidationCreationDataUpdated {
62
+ };
63
+ export type MultipleValidationCreationDataUpdated = {
64
64
  multipleValidationFile: Record<string, unknown>;
65
65
  [key: string]: unknown | undefined;
66
- }
67
- export interface MultipleValidationJobsListResult {
66
+ };
67
+ export type MultipleValidationJobsListResult = {
68
68
  jobs: MultipleValidationJobResult[];
69
69
  pages: ParsedPagesList;
70
70
  total: number;
71
71
  status: number;
72
- }
73
- export interface MultipleValidationJobsListQuery {
72
+ };
73
+ export type MultipleValidationJobsListQuery = {
74
74
  limit: number;
75
75
  page: string;
76
- }
77
- export interface MultipleValidationJobsListResponse {
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 interface CanceledMultipleValidationJob {
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
- export declare type ValidationQuery = {
1
+ export type ValidationQuery = {
2
2
  address: string;
3
3
  };
4
- export interface ValidationResult {
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 interface ValidationResponse {
11
+ };
12
+ export type ValidationResponse = {
13
13
  status: number;
14
14
  body: ValidationResult;
15
- }
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from './MultipleValidation';
2
+ export * from './Validation';
@@ -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';
@@ -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 Client from './client';
2
- import { InputFormData } from './interfaces/IFormData';
3
- import Options from './interfaces/Options';
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: Options): Client;
11
+ client(options: MailgunClientOptions): IMailgunClient;
9
12
  }