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,3 +1,3 @@
1
1
  /*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
2
2
 
3
- /*! mailgun.js v8.2.0 */
3
+ /*! mailgun.js v8.2.2 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailgun.js",
3
- "version": "8.2.1",
3
+ "version": "9.0.0",
4
4
  "main": "./mailgun.node.js",
5
5
  "browser": "./mailgun.web.js",
6
6
  "types": "./index.d.ts",
package/version.md CHANGED
@@ -1 +1 @@
1
- 8.2.1
1
+ 9.0.0
package/client.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import Options from './interfaces/Options';
2
- import DomainClient from './domains';
3
- import EventClient from './events';
4
- import StatsClient from './stats';
5
- import SuppressionClient from './suppressions';
6
- import WebhookClient from './webhooks';
7
- import MessagesClient from './messages';
8
- import RoutesClient from './routes';
9
- import ValidateClient from './validate';
10
- import IpsClient from './ips';
11
- import IpPoolsClient from './ip-pools';
12
- import ListsClient from './lists';
13
- import { InputFormData } from './interfaces/IFormData';
14
- import { IMailgunClient } from './interfaces/IMailgunClient';
15
- export default class Client implements IMailgunClient {
16
- private request;
17
- domains: DomainClient;
18
- webhooks: WebhookClient;
19
- events: EventClient;
20
- stats: StatsClient;
21
- suppressions: SuppressionClient;
22
- messages: MessagesClient;
23
- routes: RoutesClient;
24
- validate: ValidateClient;
25
- ips: IpsClient;
26
- ip_pools: IpPoolsClient;
27
- lists: ListsClient;
28
- constructor(options: Options, formData: InputFormData);
29
- }
@@ -1,19 +0,0 @@
1
- import { ParsedPage, ParsedPagesList, QueryWithPage, ResponseWithPaging } from '../interfaces/NavigationThruPages';
2
- import { BounceData, IBounce } from '../interfaces/Suppressions/Bounce';
3
- import { ComplaintData, IComplaint } from '../interfaces/Suppressions/Complaint';
4
- import { IUnsubscribe, UnsubscribeData } from '../interfaces/Suppressions/Unsubscribe';
5
- import { IWhiteList, WhiteListData } from '../interfaces/Suppressions/WhiteList';
6
- import Request from '../request';
7
- export default abstract class NavigationThruPages<T> {
8
- request?: Request;
9
- constructor(request?: Request);
10
- protected parsePage(id: string, pageUrl: string, urlSeparator: string, iteratorName: string | undefined): ParsedPage;
11
- protected parsePageLinks(response: ResponseWithPaging, urlSeparator: string, iteratorName?: string): ParsedPagesList;
12
- private updateUrlAndQuery;
13
- protected requestListWithPages(clientUrl: string, query?: QueryWithPage, Model?: {
14
- new (data: BounceData | ComplaintData | UnsubscribeData | WhiteListData): IBounce | IComplaint | IUnsubscribe | IWhiteList;
15
- }): Promise<T>;
16
- protected abstract parseList(response: ResponseWithPaging, Model?: {
17
- new (data: BounceData | ComplaintData | UnsubscribeData | WhiteListData): IBounce | IComplaint | IUnsubscribe | IWhiteList;
18
- }): T;
19
- }
package/error.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import APIErrorOptions from './interfaces/APIErrorOptions';
2
- export default class APIError extends Error {
3
- status: number | string;
4
- stack: string;
5
- details: string;
6
- type: string;
7
- constructor({ status, statusText, message, body }: APIErrorOptions);
8
- }
@@ -1,11 +0,0 @@
1
- interface APIErrorOptions {
2
- headers: {
3
- [key: string]: any;
4
- };
5
- status: number | string;
6
- message: string;
7
- body: any;
8
- url: string;
9
- statusText: string;
10
- }
11
- export default APIErrorOptions;
@@ -1,5 +0,0 @@
1
- interface APIResponse {
2
- status: number;
3
- body: any;
4
- }
5
- export default APIResponse;
@@ -1,52 +0,0 @@
1
- export declare type DomainCredentialsQuery = {
2
- limit: number;
3
- skip: number;
4
- };
5
- export declare type DomainCredentials = {
6
- login: string;
7
- password: string;
8
- };
9
- export interface DomainCredentialsItem {
10
- created_at: string;
11
- login: string;
12
- mailbox: string;
13
- size_bytes: number | null;
14
- }
15
- export interface DomainCredentialsResponseData {
16
- status: number;
17
- body: {
18
- items: DomainCredentialsItem[];
19
- total_count: number;
20
- };
21
- }
22
- export interface DomainCredentialsList {
23
- items: DomainCredentialsItem[];
24
- totalCount: number;
25
- }
26
- export interface DomainCredentialsResult {
27
- status: number;
28
- message: string;
29
- spec?: string;
30
- }
31
- export interface CreatedUpdatedDomainCredentialsResponse {
32
- status: number;
33
- body: {
34
- message: string;
35
- };
36
- }
37
- export interface DeletedDomainCredentialsResponse {
38
- status: number;
39
- body: {
40
- message: string;
41
- spec: string;
42
- };
43
- }
44
- export declare type UpdateDomainCredentialsData = {
45
- password: string;
46
- };
47
- export interface IDomainCredentials {
48
- list(domain: string, query: DomainCredentialsQuery): Promise<DomainCredentialsList>;
49
- create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
50
- update(domain: string, credentialsLogin: string, data: UpdateDomainCredentialsData): Promise<DomainCredentialsResult>;
51
- destroy(domain: string, credentialsLogin: string): Promise<DomainCredentialsResult>;
52
- }
@@ -1,178 +0,0 @@
1
- import { DomainTemplateItem } from '../domainsTemplates';
2
- import { PagesList, ParsedPagesList } from './NavigationThruPages';
3
- export declare enum YesNo {
4
- YES = "yes",
5
- NO = "no"
6
- }
7
- export declare type DomainTemplateData = {
8
- name: string;
9
- description: string;
10
- template: string;
11
- tag?: string;
12
- engine?: string;
13
- comment?: string;
14
- };
15
- export declare type DomainTemplateVersionData = {
16
- template: string;
17
- tag: string;
18
- engine?: string;
19
- comment?: string;
20
- active?: YesNo;
21
- };
22
- export declare type DomainTemplateUpdateData = {
23
- description: string;
24
- };
25
- export declare type DomainTemplateUpdateVersionData = {
26
- template?: string;
27
- comment?: string;
28
- active?: YesNo;
29
- };
30
- export declare type DomainTemplatesQuery = {
31
- /** 'page' (optionally 'p') params from previous response's 'paging' object.
32
- * Value must be stringified as query params. Ex: '?page=first','?page=next&p=name-of-last-item'
33
- .... */
34
- page?: `?${string}`;
35
- /** Number of records to retrieve. Default value is 10. */
36
- limit?: number;
37
- };
38
- export declare type TemplateQuery = {
39
- active: YesNo;
40
- };
41
- export interface ShortTemplateVersion {
42
- tag: string;
43
- engine: string;
44
- mjml: string;
45
- createdAt: string | Date;
46
- comment: string;
47
- active: boolean;
48
- id: string;
49
- }
50
- export interface TemplateVersion extends ShortTemplateVersion {
51
- template: string;
52
- }
53
- export interface DomainTemplate {
54
- name: string;
55
- description: string;
56
- createdAt: string | Date;
57
- createdBy: string;
58
- id: string;
59
- version?: TemplateVersion;
60
- versions?: ShortTemplateVersion[];
61
- }
62
- export interface CreateDomainTemplateAPIResponse {
63
- status: number;
64
- body: {
65
- message: string;
66
- template: DomainTemplate;
67
- };
68
- }
69
- export interface ListDomainTemplatesAPIResponse {
70
- status: number;
71
- body: {
72
- items: DomainTemplate[];
73
- paging: {
74
- first: string;
75
- last: string;
76
- next: string;
77
- previous: string;
78
- };
79
- };
80
- }
81
- export interface ListDomainTemplatesResult {
82
- items: DomainTemplate[];
83
- pages: ParsedPagesList;
84
- status: number;
85
- }
86
- export interface GetDomainTemplateAPIResponse {
87
- status: number;
88
- body: {
89
- template: DomainTemplate;
90
- };
91
- }
92
- export interface UpdateOrDeleteDomainTemplateAPIResponse {
93
- status: number;
94
- body: {
95
- message: string;
96
- template: {
97
- name: string;
98
- };
99
- };
100
- }
101
- export interface UpdateOrDeleteDomainTemplateResult {
102
- status: number;
103
- message: string;
104
- templateName?: string;
105
- }
106
- export interface NotificationAPIResponse {
107
- status: number;
108
- body: {
109
- message: string;
110
- };
111
- }
112
- export interface NotificationResult {
113
- status: number;
114
- message: string;
115
- }
116
- export interface CreateDomainTemplateVersionAPIResponse {
117
- status: number;
118
- body: {
119
- message: string;
120
- template: DomainTemplate;
121
- };
122
- }
123
- export interface CreateDomainTemplateVersionResult {
124
- status: number;
125
- message: string;
126
- template: DomainTemplate;
127
- }
128
- export interface MutateDomainTemplateVersionAPIResponse {
129
- status: number;
130
- body: {
131
- message: string;
132
- template: {
133
- name: string;
134
- version: {
135
- tag: string;
136
- };
137
- };
138
- };
139
- }
140
- export interface MutateDomainTemplateVersionResult {
141
- status: number;
142
- message: string;
143
- templateName: string;
144
- templateVersion: {
145
- tag: string;
146
- };
147
- }
148
- export interface ListDomainTemplateVersionsAPIResponse {
149
- status: number;
150
- body: {
151
- template: {
152
- name: string;
153
- description: string;
154
- createdAt: string;
155
- createdBy: string;
156
- id: string;
157
- versions: ShortTemplateVersion[];
158
- };
159
- paging: PagesList;
160
- };
161
- }
162
- export interface ListDomainTemplateVersionsResult {
163
- template: DomainTemplateItem;
164
- pages: ParsedPagesList;
165
- }
166
- export interface IDomainTemplatesClient {
167
- list(domain: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplatesResult>;
168
- get(domain: string, templateName: string, query?: TemplateQuery): Promise<DomainTemplateItem>;
169
- create(domain: string, data: DomainTemplateData): Promise<DomainTemplateItem>;
170
- update(domain: string, templateName: string, data: DomainTemplateUpdateData): Promise<UpdateOrDeleteDomainTemplateResult>;
171
- destroy(domain: string, templateName: string): Promise<UpdateOrDeleteDomainTemplateResult>;
172
- destroyAll(domain: string): Promise<NotificationResult>;
173
- createVersion(domain: string, templateName: string, data: DomainTemplateVersionData): Promise<CreateDomainTemplateVersionResult>;
174
- getVersion(domain: string, templateName: string, tag: string): Promise<DomainTemplateItem>;
175
- updateVersion(domain: string, templateName: string, tag: string, data: DomainTemplateUpdateVersionData): Promise<MutateDomainTemplateVersionResult>;
176
- destroyVersion(domain: string, templateName: string, tag: string): Promise<MutateDomainTemplateVersionResult>;
177
- listVersions(domain: string, templateName: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplateVersionsResult>;
178
- }
@@ -1,7 +0,0 @@
1
- import * as NodeFormData from 'form-data';
2
- export interface IFormDataOptions {
3
- [key: string]: any;
4
- }
5
- export interface InputFormData {
6
- new (options?: HTMLFormElement | IFormDataOptions): NodeFormData | FormData;
7
- }
@@ -1,24 +0,0 @@
1
- import DomainClient from '../domains';
2
- import EventClient from '../events';
3
- import IpPoolsClient from '../ip-pools';
4
- import IpsClient from '../ips';
5
- import ListsClient from '../lists';
6
- import MessagesClient from '../messages';
7
- import RoutesClient from '../routes';
8
- import StatsClient from '../stats';
9
- import SuppressionClient from '../suppressions';
10
- import ValidateClient from '../validate';
11
- import WebhookClient from '../webhooks';
12
- export interface IMailgunClient {
13
- domains: DomainClient;
14
- webhooks: WebhookClient;
15
- events: EventClient;
16
- stats: StatsClient;
17
- suppressions: SuppressionClient;
18
- messages: MessagesClient;
19
- routes: RoutesClient;
20
- validate: ValidateClient;
21
- ips: IpsClient;
22
- ip_pools: IpPoolsClient;
23
- lists: ListsClient;
24
- }
@@ -1,69 +0,0 @@
1
- import { Bounce, Complaint, Unsubscribe, WhiteList } from '../../suppressions';
2
- import { PagesList, ParsedPagesList } from '../NavigationThruPages';
3
- import { BounceData } from './Bounce';
4
- import { ComplaintData } from './Complaint';
5
- import { UnsubscribeData } from './Unsubscribe';
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)[];
15
- pages: ParsedPagesList;
16
- status: number;
17
- }
18
- export declare type SuppressionListQuery = {
19
- limit?: number;
20
- page?: string;
21
- };
22
- export declare type SuppressionDataType = BounceData | ComplaintData | UnsubscribeData | WhiteListData;
23
- export interface SuppressionListResponse {
24
- body: {
25
- items: BounceData[] | ComplaintData[] | UnsubscribeData[] | WhiteListData[];
26
- paging: PagesList;
27
- };
28
- status: number;
29
- }
30
- export interface SuppressionResponse {
31
- body: BounceData | ComplaintData | UnsubscribeData | WhiteListData;
32
- status: number;
33
- }
34
- export interface SuppressionDestroyResponse {
35
- body: {
36
- message: string;
37
- value?: string;
38
- address?: string;
39
- };
40
- status: number;
41
- }
42
- export interface SuppressionDestroyResult {
43
- message: string;
44
- value: string;
45
- address: string;
46
- status: number;
47
- }
48
- export declare type SuppressionCreationData = {
49
- address: string;
50
- code?: number;
51
- error?: string;
52
- domain?: string;
53
- tag?: string;
54
- created_at?: string;
55
- };
56
- export interface SuppressionCreationResponse {
57
- body: {
58
- message: string;
59
- type?: string;
60
- value?: string;
61
- };
62
- status: number;
63
- }
64
- export interface SuppressionCreationResult {
65
- message: string;
66
- type: string;
67
- value: string;
68
- status: number;
69
- }
@@ -1,12 +0,0 @@
1
- export interface WhiteListData {
2
- type: string;
3
- value: string;
4
- reason: string;
5
- createdAt: string | Date;
6
- }
7
- export interface IWhiteList {
8
- type: string;
9
- value: string;
10
- reason: string;
11
- createdAt: Date;
12
- }
@@ -1,103 +0,0 @@
1
- import { Bounce, Complaint, Unsubscribe, WhiteList } from '../suppressions';
2
- export interface BounceData {
3
- address: string;
4
- code: number;
5
- error: string;
6
- created_at: string | Date;
7
- }
8
- export interface ComplaintData {
9
- address: string;
10
- created_at: string | Date;
11
- }
12
- export interface UnsubscribeData {
13
- address: string;
14
- tags: any;
15
- created_at: string | Date;
16
- }
17
- export interface WhiteListData {
18
- type: string;
19
- value: string;
20
- reason: string;
21
- createdAt: string | Date;
22
- }
23
- export interface ParsedPage {
24
- id: string;
25
- page: string | null | undefined;
26
- address: string | null | undefined;
27
- url: string;
28
- }
29
- export interface ParsedPagesList {
30
- previous: ParsedPage;
31
- first: ParsedPage;
32
- last: ParsedPage;
33
- next: ParsedPage;
34
- }
35
- export interface SuppressionList {
36
- items: (Bounce | Complaint | Unsubscribe | WhiteList)[];
37
- pages: ParsedPagesList;
38
- }
39
- export interface PagesList {
40
- previous: string;
41
- first: string;
42
- last: string;
43
- next: string;
44
- }
45
- export declare enum SuppressionModels {
46
- BOUNCES = "bounces",
47
- COMPLAINTS = "complaints",
48
- UNSUBSCRIBES = "unsubscribes",
49
- WHITELISTS = "whitelists"
50
- }
51
- export interface PagesListAccumulator {
52
- [index: string]: ParsedPage;
53
- }
54
- export declare type SuppressionListQuery = {
55
- limit?: number;
56
- };
57
- export interface SuppressionListResponse {
58
- body: {
59
- items: BounceData[] | ComplaintData[] | UnsubscribeData[] | WhiteListData[];
60
- paging: PagesList;
61
- };
62
- status: number;
63
- }
64
- export interface SuppressionResponse {
65
- body: BounceData | ComplaintData | UnsubscribeData | WhiteListData;
66
- status: number;
67
- }
68
- export interface SuppressionDestroyResponse {
69
- body: {
70
- message: string;
71
- value?: string;
72
- address?: string;
73
- };
74
- status: number;
75
- }
76
- export interface SuppressionDestroyResult {
77
- message: string;
78
- value: string;
79
- address: string;
80
- status: number;
81
- }
82
- export declare type SuppressionCreationData = {
83
- address: string;
84
- code?: number;
85
- error?: string;
86
- domain?: string;
87
- tag?: string;
88
- created_at?: string;
89
- };
90
- export interface SuppressionCreationResponse {
91
- body: {
92
- message: string;
93
- type?: string;
94
- value?: string;
95
- };
96
- status: number;
97
- }
98
- export interface SuppressionCreationResult {
99
- message: string;
100
- type: string;
101
- value: string;
102
- status: number;
103
- }
@@ -1,34 +0,0 @@
1
- export interface APIWebhook {
2
- url?: string;
3
- urls?: string[];
4
- }
5
- export interface WebhookResponseBody {
6
- message: string;
7
- webhook: APIWebhook;
8
- }
9
- export interface WebhookResponse {
10
- status: number;
11
- body: WebhookResponseBody;
12
- }
13
- export interface WebhookList {
14
- [id: string]: {
15
- urls: string[];
16
- };
17
- }
18
- export declare type WebhooksQuery = {
19
- limit?: number;
20
- skip?: number;
21
- };
22
- export interface ValidationResponse {
23
- code: number;
24
- message: string;
25
- }
26
- export declare enum WebhooksIds {
27
- CLICKED = "clicked",
28
- COMPLAINED = "complained",
29
- DELIVERED = "delivered",
30
- OPENED = "opened",
31
- PERMANENT_FAIL = "permanent_fail",
32
- TEMPORARY_FAIL = "temporary_fail",
33
- UNSUBSCRIBED = "unsubscribe"
34
- }
@@ -1,68 +0,0 @@
1
- import { MailingList } from './lists';
2
- import { PagesList, ParsedPagesList } from './NavigationThruPages';
3
- export interface MailListMember {
4
- address: string;
5
- name: string;
6
- subscribed: boolean;
7
- vars: {
8
- [key: string]: any;
9
- };
10
- }
11
- export declare type MailListMembersQuery = {
12
- subscribed?: 'yes' | 'no';
13
- limit?: number;
14
- page?: string;
15
- };
16
- export declare type MultipleMembersData = {
17
- members: Array<MailListMember>;
18
- upsert: 'yes' | 'no';
19
- };
20
- export declare type MultipleMembersReqData = {
21
- members: string;
22
- upsert: 'yes' | 'no';
23
- };
24
- export interface CreateUpdateMailListMembers {
25
- address: string;
26
- name?: string;
27
- vars?: string;
28
- subscribed?: 'yes' | 'no' | boolean;
29
- upsert?: 'yes' | 'no';
30
- }
31
- export declare type CreateUpdateMailListMembersReq = {
32
- address: string;
33
- name?: string;
34
- vars?: string;
35
- subscribed?: 'yes' | 'no' | boolean;
36
- upsert?: 'yes' | 'no';
37
- };
38
- export interface DeletedMember {
39
- member: {
40
- address: string;
41
- };
42
- message: string;
43
- }
44
- export interface NewMultipleMembersResponse {
45
- list: MailingList;
46
- message: string;
47
- 'task-id': string;
48
- }
49
- export interface MailListMembersResponse {
50
- body: {
51
- items: MailListMember[];
52
- paging: PagesList;
53
- };
54
- status: number;
55
- }
56
- export interface MailListMembersResult {
57
- items: MailListMember[];
58
- pages: ParsedPagesList;
59
- status: number;
60
- }
61
- export interface IMailListsMembers {
62
- listMembers(mailListAddress: string, query?: MailListMembersQuery): Promise<MailListMembersResult>;
63
- getMember(address: string, memberAddress: string): Promise<MailListMember>;
64
- createMember(mailListAddress: string, data: CreateUpdateMailListMembers): Promise<MailListMember>;
65
- createMembers(mailListAddress: string, data: MultipleMembersData): Promise<NewMultipleMembersResponse>;
66
- updateMember(address: string, memberAddress: string, data: CreateUpdateMailListMembers): Promise<MailListMember>;
67
- destroyMember(address: string, memberAddress: string): Promise<DeletedMember>;
68
- }
package/ips.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import MgRequest from './request';
2
- import { IpData, IpsListResponseBody } from './interfaces/Ips';
3
- export default class IpsClient {
4
- request: MgRequest;
5
- constructor(request: MgRequest);
6
- list(query: any): Promise<IpsListResponseBody>;
7
- get(ip: string): Promise<IpData>;
8
- private parseIpsResponse;
9
- }
package/lists.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import Request from './request';
2
- import { ListsQuery, CreateUpdateList, DestroyedList, MailingList, StartValidationResult, ValidationResult, CancelValidationResult, MailingListResult, MailingListApiResponse } from './interfaces/lists';
3
- import { IMailListsMembers } from './interfaces/mailListMembers';
4
- import NavigationThruPages from './common/NavigationThruPages';
5
- export default class ListsClient extends NavigationThruPages<MailingListResult> {
6
- baseRoute: string;
7
- request: Request;
8
- members: IMailListsMembers;
9
- constructor(request: Request, members: IMailListsMembers);
10
- private parseValidationResult;
11
- protected parseList(response: MailingListApiResponse): MailingListResult;
12
- list(query?: ListsQuery): Promise<MailingListResult>;
13
- get(mailListAddress: string): Promise<MailingList>;
14
- create(data: CreateUpdateList): Promise<MailingList>;
15
- update(mailListAddress: string, data: CreateUpdateList): Promise<MailingList>;
16
- destroy(mailListAddress: string): Promise<DestroyedList>;
17
- validate(mailListAddress: string): Promise<StartValidationResult>;
18
- validationResult(mailListAddress: string): Promise<ValidationResult>;
19
- cancelValidation(mailListAddress: string): Promise<CancelValidationResult>;
20
- }