mailgun.js 4.2.2 → 5.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 +36 -0
- package/dist/mailgun.js.d.ts +1572 -0
- 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/dts-bundle.js +8 -0
- package/examples/addresses.js +1 -1
- package/examples/list-domains.js +1 -1
- package/lib/domains.ts +1 -1
- package/lib/events.ts +4 -4
- package/{index.ts → lib/index.ts} +3 -3
- package/lib/interfaces/Supressions.ts +61 -0
- package/lib/interfaces/Webhooks.ts +10 -0
- package/lib/stats.ts +3 -3
- package/lib/suppressions.ts +39 -18
- package/lib/webhooks.ts +7 -4
- package/package.json +11 -6
- package/tsconfig.json +2 -2
- package/webpack/webpack.common.config.js +2 -2
- package/dist/index.d.ts +0 -9
- package/dist/lib/client.d.ts +0 -28
- package/dist/lib/domains.d.ts +0 -53
- package/dist/lib/domainsCredentials.d.ts +0 -14
- package/dist/lib/domainsTags.d.ts +0 -34
- package/dist/lib/domainsTemplates.d.ts +0 -35
- package/dist/lib/error.d.ts +0 -7
- package/dist/lib/events.d.ts +0 -13
- package/dist/lib/interfaces/APIErrorOptions.d.ts +0 -11
- package/dist/lib/interfaces/ApiResponse.d.ts +0 -5
- package/dist/lib/interfaces/DomainCredentials.d.ts +0 -52
- package/dist/lib/interfaces/DomainTags.d.ts +0 -228
- package/dist/lib/interfaces/DomainTemplates.d.ts +0 -194
- package/dist/lib/interfaces/DomainTracking.d.ts +0 -48
- package/dist/lib/interfaces/Domains.d.ts +0 -121
- package/dist/lib/interfaces/Events.d.ts +0 -88
- package/dist/lib/interfaces/IFormData.d.ts +0 -7
- package/dist/lib/interfaces/IpPools.d.ts +0 -19
- package/dist/lib/interfaces/Ips.d.ts +0 -10
- package/dist/lib/interfaces/MultipleValidation.d.ts +0 -55
- package/dist/lib/interfaces/Options.d.ts +0 -8
- package/dist/lib/interfaces/RequestOptions.d.ts +0 -6
- package/dist/lib/interfaces/StatsOptions.d.ts +0 -21
- package/dist/lib/interfaces/Supressions.d.ts +0 -21
- package/dist/lib/interfaces/Validate.d.ts +0 -12
- package/dist/lib/interfaces/Webhooks.d.ts +0 -25
- package/dist/lib/interfaces/lists.d.ts +0 -25
- package/dist/lib/interfaces/mailListMembers.d.ts +0 -52
- package/dist/lib/interfaces/routes.d.ts +0 -25
- package/dist/lib/ip-pools.d.ts +0 -21
- package/dist/lib/ips.d.ts +0 -9
- package/dist/lib/lists.d.ts +0 -14
- package/dist/lib/mailListMembers.d.ts +0 -14
- package/dist/lib/messages.d.ts +0 -9
- package/dist/lib/multipleValidation.d.ts +0 -10
- package/dist/lib/parse.d.ts +0 -0
- package/dist/lib/request.d.ts +0 -31
- package/dist/lib/routes.d.ts +0 -11
- package/dist/lib/stats.d.ts +0 -20
- package/dist/lib/suppressions.d.ts +0 -67
- package/dist/lib/validate.d.ts +0 -9
- package/dist/lib/webhooks.d.ts +0 -32
|
@@ -0,0 +1,1572 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../../form-data
|
|
4
|
+
|
|
5
|
+
declare module 'mailgun.js' {
|
|
6
|
+
import Client from 'mailgun.js/client';
|
|
7
|
+
import { InputFormData } from 'mailgun.js/interfaces/IFormData';
|
|
8
|
+
import Options from 'mailgun.js/interfaces/Options';
|
|
9
|
+
class Mailgun {
|
|
10
|
+
constructor(FormData: InputFormData);
|
|
11
|
+
client(options: Options): Client;
|
|
12
|
+
}
|
|
13
|
+
export = Mailgun;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module 'mailgun.js/client' {
|
|
17
|
+
import Options from 'mailgun.js/interfaces/Options';
|
|
18
|
+
import DomainClient from 'mailgun.js/domains';
|
|
19
|
+
import EventClient from 'mailgun.js/events';
|
|
20
|
+
import StatsClient from 'mailgun.js/stats';
|
|
21
|
+
import SuppressionClient from 'mailgun.js/suppressions';
|
|
22
|
+
import WebhookClient from 'mailgun.js/webhooks';
|
|
23
|
+
import MessagesClient from 'mailgun.js/messages';
|
|
24
|
+
import RoutesClient from 'mailgun.js/routes';
|
|
25
|
+
import ValidateClient from 'mailgun.js/validate';
|
|
26
|
+
import IpsClient from 'mailgun.js/ips';
|
|
27
|
+
import IpPoolsClient from 'mailgun.js/ip-pools';
|
|
28
|
+
import ListsClient from 'mailgun.js/lists';
|
|
29
|
+
import { InputFormData } from 'mailgun.js/interfaces/IFormData';
|
|
30
|
+
export default class Client {
|
|
31
|
+
domains: DomainClient;
|
|
32
|
+
webhooks: WebhookClient;
|
|
33
|
+
events: EventClient;
|
|
34
|
+
stats: StatsClient;
|
|
35
|
+
suppressions: SuppressionClient;
|
|
36
|
+
messages: MessagesClient;
|
|
37
|
+
routes: RoutesClient;
|
|
38
|
+
validate: ValidateClient;
|
|
39
|
+
ips: IpsClient;
|
|
40
|
+
ip_pools: IpPoolsClient;
|
|
41
|
+
lists: ListsClient;
|
|
42
|
+
constructor(options: Options, formData: InputFormData);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare module 'mailgun.js/interfaces/IFormData' {
|
|
47
|
+
import NodeFormData from 'form-data';
|
|
48
|
+
export interface IFormDataOptions {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}
|
|
51
|
+
export interface InputFormData {
|
|
52
|
+
new (options?: HTMLFormElement | IFormDataOptions): NodeFormData | FormData;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare module 'mailgun.js/interfaces/Options' {
|
|
57
|
+
interface Options {
|
|
58
|
+
username: string;
|
|
59
|
+
key: string;
|
|
60
|
+
url?: string;
|
|
61
|
+
public_key?: string;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
}
|
|
64
|
+
export default Options;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare module 'mailgun.js/domains' {
|
|
68
|
+
import { DomainsQuery, DomainInfo, DomainShortData, DNSRecord, ConnectionSettings, UpdatedConnectionSettings, DKIMAuthorityInfo, UpdatedDKIMAuthority, DKIMSelectorInfo, UpdatedDKIMSelectorResponse, WebPrefixInfo, UpdatedWebPrefixResponse, ReplacementForPool, MessageResponse } from 'mailgun.js/interfaces/Domains';
|
|
69
|
+
import APIResponse from 'mailgun.js/interfaces/ApiResponse';
|
|
70
|
+
import Request from 'mailgun.js/request';
|
|
71
|
+
import { DomainTrackingData, OpenTrackingInfo, ClickTrackingInfo, UnsubscribeTrackingInfo, UpdatedOpenTracking } from 'mailgun.js/interfaces/DomainTracking';
|
|
72
|
+
import { IDomainCredentials } from 'mailgun.js/interfaces/DomainCredentials';
|
|
73
|
+
import { IDomainTemplatesClient } from 'mailgun.js/interfaces/DomainTemplates';
|
|
74
|
+
import DomainCredentialsClient from 'mailgun.js/domainsCredentials';
|
|
75
|
+
import DomainTemplatesClient from 'mailgun.js/domainsTemplates';
|
|
76
|
+
import { IDomainTagsClient } from 'mailgun.js/interfaces/DomainTags';
|
|
77
|
+
import DomainTagsClient from 'mailgun.js/domainsTags';
|
|
78
|
+
export class Domain {
|
|
79
|
+
name: string;
|
|
80
|
+
require_tls: boolean;
|
|
81
|
+
skip_verification: boolean;
|
|
82
|
+
state: string;
|
|
83
|
+
wildcard: boolean;
|
|
84
|
+
spam_action: string;
|
|
85
|
+
created_at: string;
|
|
86
|
+
smtp_password: string;
|
|
87
|
+
smtp_login: string;
|
|
88
|
+
type: string;
|
|
89
|
+
receiving_dns_records: DNSRecord[] | null;
|
|
90
|
+
sending_dns_records: DNSRecord[] | null;
|
|
91
|
+
constructor(data: DomainShortData, receiving?: DNSRecord[] | null, sending?: DNSRecord[] | null);
|
|
92
|
+
}
|
|
93
|
+
export default class DomainClient {
|
|
94
|
+
request: Request;
|
|
95
|
+
domainCredentials: IDomainCredentials;
|
|
96
|
+
domainTemplates: IDomainTemplatesClient;
|
|
97
|
+
domainTags: IDomainTagsClient;
|
|
98
|
+
constructor(request: Request, domainCredentialsClient: DomainCredentialsClient, domainTemplatesClient: DomainTemplatesClient, domainTagsClient: DomainTagsClient);
|
|
99
|
+
list(query?: DomainsQuery): Promise<Domain[]>;
|
|
100
|
+
get(domain: string): Promise<Domain>;
|
|
101
|
+
create(data: DomainInfo): Promise<Domain>;
|
|
102
|
+
destroy(domain: string): Promise<MessageResponse>;
|
|
103
|
+
getConnection(domain: string): Promise<ConnectionSettings>;
|
|
104
|
+
updateConnection(domain: string, data: ConnectionSettings): Promise<UpdatedConnectionSettings>;
|
|
105
|
+
getTracking(domain: string): Promise<DomainTrackingData>;
|
|
106
|
+
updateTracking(domain: string, type: string, data: OpenTrackingInfo | ClickTrackingInfo | UnsubscribeTrackingInfo): Promise<UpdatedOpenTracking>;
|
|
107
|
+
getIps(domain: string): Promise<string[]>;
|
|
108
|
+
assignIp(domain: string, ip: string): Promise<APIResponse>;
|
|
109
|
+
deleteIp(domain: string, ip: string): Promise<APIResponse>;
|
|
110
|
+
linkIpPool(domain: string, pool_id: string): Promise<APIResponse>;
|
|
111
|
+
unlinkIpPoll(domain: string, replacement: ReplacementForPool): Promise<APIResponse>;
|
|
112
|
+
updateDKIMAuthority(domain: string, data: DKIMAuthorityInfo): Promise<UpdatedDKIMAuthority>;
|
|
113
|
+
updateDKIMSelector(domain: string, data: DKIMSelectorInfo): Promise<UpdatedDKIMSelectorResponse>;
|
|
114
|
+
updateWebPrefix(domain: string, data: WebPrefixInfo): Promise<UpdatedWebPrefixResponse>;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare module 'mailgun.js/events' {
|
|
119
|
+
import { EventsList, EventsPage, EventsResponse, ParsedPagesList } from 'mailgun.js/interfaces/Events';
|
|
120
|
+
import Request from 'mailgun.js/request';
|
|
121
|
+
export default class EventClient {
|
|
122
|
+
request: Request;
|
|
123
|
+
constructor(request: Request);
|
|
124
|
+
_parsePageNumber(url: string): string;
|
|
125
|
+
_parsePage(id: string, url: string): EventsPage;
|
|
126
|
+
_parsePageLinks(response: EventsResponse): ParsedPagesList;
|
|
127
|
+
_parseEventList(response: EventsResponse): EventsList;
|
|
128
|
+
get(domain: string, query?: {
|
|
129
|
+
page: string;
|
|
130
|
+
}): Promise<EventsList>;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare module 'mailgun.js/stats' {
|
|
135
|
+
import Request from 'mailgun.js/request';
|
|
136
|
+
import { StatsQuery, StatsOptions, Stat } from 'mailgun.js/interfaces/StatsOptions';
|
|
137
|
+
class Stats {
|
|
138
|
+
start: Date;
|
|
139
|
+
end: Date;
|
|
140
|
+
resolution: string;
|
|
141
|
+
stats: Stat[];
|
|
142
|
+
constructor(data: StatsOptions);
|
|
143
|
+
}
|
|
144
|
+
export default class StatsClient {
|
|
145
|
+
request: Request;
|
|
146
|
+
constructor(request: Request);
|
|
147
|
+
_parseStats(response: {
|
|
148
|
+
body: StatsOptions;
|
|
149
|
+
}): Stats;
|
|
150
|
+
getDomain(domain: string, query?: StatsQuery): Promise<Stats>;
|
|
151
|
+
getAccount(query?: StatsQuery): Promise<Stats>;
|
|
152
|
+
}
|
|
153
|
+
export {};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare module 'mailgun.js/suppressions' {
|
|
157
|
+
import Request from 'mailgun.js/request';
|
|
158
|
+
import { BounceData, ComplaintData, IBounce, IComplaint, IUnsubscribe, IWhiteList, ParsedPage, ParsedPagesList, SuppressionList, SuppressionModels, UnsubscribeData, WhiteListData } from 'mailgun.js/interfaces/Supressions';
|
|
159
|
+
class Bounce implements IBounce {
|
|
160
|
+
type: string;
|
|
161
|
+
address: string;
|
|
162
|
+
code: number;
|
|
163
|
+
error: string;
|
|
164
|
+
created_at: Date;
|
|
165
|
+
constructor(data: BounceData);
|
|
166
|
+
}
|
|
167
|
+
class Complaint implements IComplaint {
|
|
168
|
+
type: string;
|
|
169
|
+
address: any;
|
|
170
|
+
created_at: Date;
|
|
171
|
+
constructor(data: ComplaintData);
|
|
172
|
+
}
|
|
173
|
+
class Unsubscribe implements IUnsubscribe {
|
|
174
|
+
type: string;
|
|
175
|
+
address: string;
|
|
176
|
+
tags: any;
|
|
177
|
+
created_at: Date;
|
|
178
|
+
constructor(data: UnsubscribeData);
|
|
179
|
+
}
|
|
180
|
+
class WhiteList implements IWhiteList {
|
|
181
|
+
type: string;
|
|
182
|
+
value: string;
|
|
183
|
+
reason: string;
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
constructor(data: WhiteListData);
|
|
186
|
+
}
|
|
187
|
+
type TModel = typeof Bounce | typeof Complaint | typeof Unsubscribe | typeof WhiteList;
|
|
188
|
+
export default class SuppressionClient {
|
|
189
|
+
request: any;
|
|
190
|
+
models: {
|
|
191
|
+
bounces: typeof Bounce;
|
|
192
|
+
complaints: typeof Complaint;
|
|
193
|
+
unsubscribes: typeof Unsubscribe;
|
|
194
|
+
whitelists: typeof WhiteList;
|
|
195
|
+
};
|
|
196
|
+
constructor(request: Request);
|
|
197
|
+
_parsePage(id: string, pageUrl: string): ParsedPage;
|
|
198
|
+
_parsePageLinks(response: {
|
|
199
|
+
body: {
|
|
200
|
+
paging: any;
|
|
201
|
+
};
|
|
202
|
+
}): ParsedPagesList;
|
|
203
|
+
_parseList(response: {
|
|
204
|
+
body: {
|
|
205
|
+
items: any;
|
|
206
|
+
paging: any;
|
|
207
|
+
};
|
|
208
|
+
}, Model: TModel): SuppressionList;
|
|
209
|
+
_parseItem(response: {
|
|
210
|
+
body: any;
|
|
211
|
+
}, Model: TModel): IBounce | IComplaint | IUnsubscribe | IWhiteList;
|
|
212
|
+
list(domain: string, type: SuppressionModels, query: any): Promise<SuppressionList>;
|
|
213
|
+
get(domain: string, type: SuppressionModels, address: string): Promise<IBounce | IComplaint | IUnsubscribe | IWhiteList>;
|
|
214
|
+
create(domain: string, type: string, data: any): any;
|
|
215
|
+
destroy(domain: string, type: string, address: string): any;
|
|
216
|
+
}
|
|
217
|
+
export {};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
declare module 'mailgun.js/webhooks' {
|
|
221
|
+
import { ValidationResponse, WebhookList, WebhookResponse, WebhooksIds, WebhooksQuery } from 'mailgun.js/interfaces/Webhooks';
|
|
222
|
+
import Request from 'mailgun.js/request';
|
|
223
|
+
class Webhook {
|
|
224
|
+
id: string;
|
|
225
|
+
url: string | undefined;
|
|
226
|
+
constructor(id: string, url: string | undefined);
|
|
227
|
+
}
|
|
228
|
+
export default class WebhookClient {
|
|
229
|
+
request: Request;
|
|
230
|
+
constructor(request: Request);
|
|
231
|
+
_parseWebhookList(response: {
|
|
232
|
+
body: {
|
|
233
|
+
webhooks: WebhookList;
|
|
234
|
+
};
|
|
235
|
+
}): WebhookList;
|
|
236
|
+
_parseWebhookWithID(id: string): (response: WebhookResponse) => Webhook;
|
|
237
|
+
_parseWebhookTest(response: {
|
|
238
|
+
body: {
|
|
239
|
+
code: number;
|
|
240
|
+
message: string;
|
|
241
|
+
};
|
|
242
|
+
}): {
|
|
243
|
+
code: number;
|
|
244
|
+
message: string;
|
|
245
|
+
};
|
|
246
|
+
list(domain: string, query: WebhooksQuery): Promise<WebhookList>;
|
|
247
|
+
get(domain: string, id: WebhooksIds): Promise<Webhook>;
|
|
248
|
+
create(domain: string, id: string, url: string, test?: boolean): Promise<Webhook | ValidationResponse>;
|
|
249
|
+
update(domain: string, id: string, url: string): Promise<Webhook>;
|
|
250
|
+
destroy(domain: string, id: string): Promise<Webhook>;
|
|
251
|
+
}
|
|
252
|
+
export {};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare module 'mailgun.js/messages' {
|
|
256
|
+
import Request from 'mailgun.js/request';
|
|
257
|
+
export default class MessagesClient {
|
|
258
|
+
request: Request;
|
|
259
|
+
constructor(request: Request);
|
|
260
|
+
_parseResponse(response: {
|
|
261
|
+
body: any;
|
|
262
|
+
}): any;
|
|
263
|
+
create(domain: string, data: any): Promise<any>;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare module 'mailgun.js/routes' {
|
|
268
|
+
import { CreateUpdateRouteData, DestroyRouteResponse, Route, RoutesListQuery, UpdateRouteResponse } from 'mailgun.js/interfaces/routes';
|
|
269
|
+
import Request from 'mailgun.js/request';
|
|
270
|
+
export default class RoutesClient {
|
|
271
|
+
request: Request;
|
|
272
|
+
constructor(request: Request);
|
|
273
|
+
list(query: RoutesListQuery): Promise<Route[]>;
|
|
274
|
+
get(id: string): Promise<Route>;
|
|
275
|
+
create(data: CreateUpdateRouteData): Promise<Route>;
|
|
276
|
+
update(id: string, data: CreateUpdateRouteData): Promise<UpdateRouteResponse>;
|
|
277
|
+
destroy(id: string): Promise<DestroyRouteResponse>;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare module 'mailgun.js/validate' {
|
|
282
|
+
import { IMultipleValidationClient } from 'mailgun.js/interfaces/MultipleValidation';
|
|
283
|
+
import { ValidationResult } from 'mailgun.js/interfaces/Validate';
|
|
284
|
+
import Request from 'mailgun.js/request';
|
|
285
|
+
export default class ValidateClient {
|
|
286
|
+
multipleValidation: IMultipleValidationClient;
|
|
287
|
+
request: Request;
|
|
288
|
+
constructor(request: Request, multipleValidationClient: IMultipleValidationClient);
|
|
289
|
+
get(address: string): Promise<ValidationResult>;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare module 'mailgun.js/ips' {
|
|
294
|
+
import MgRequest from 'mailgun.js/request';
|
|
295
|
+
import { IpData, IpsListResponseBody } from 'mailgun.js/interfaces/Ips';
|
|
296
|
+
export default class IpsClient {
|
|
297
|
+
request: MgRequest;
|
|
298
|
+
constructor(request: MgRequest);
|
|
299
|
+
list(query: any): Promise<IpsListResponseBody | IpData>;
|
|
300
|
+
get(ip: string): Promise<IpsListResponseBody | IpData>;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare module 'mailgun.js/ip-pools' {
|
|
305
|
+
import Request from 'mailgun.js/request';
|
|
306
|
+
import { IpPool, IpPoolUpdateData } from 'mailgun.js/interfaces/IpPools';
|
|
307
|
+
export default class IpPoolsClient {
|
|
308
|
+
request: Request;
|
|
309
|
+
constructor(request: Request);
|
|
310
|
+
list(query: any): Promise<IpPool[]>;
|
|
311
|
+
create(data: {
|
|
312
|
+
name: string;
|
|
313
|
+
description?: string;
|
|
314
|
+
ips?: string[];
|
|
315
|
+
}): Promise<{
|
|
316
|
+
message: string;
|
|
317
|
+
pool_id: string;
|
|
318
|
+
}>;
|
|
319
|
+
update(poolId: string, data: IpPoolUpdateData): Promise<any>;
|
|
320
|
+
delete(poolId: string, data: {
|
|
321
|
+
id: string;
|
|
322
|
+
pool_id: string;
|
|
323
|
+
}): Promise<any>;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
declare module 'mailgun.js/lists' {
|
|
328
|
+
import Request from 'mailgun.js/request';
|
|
329
|
+
import { ListsQuery, CreateUpdateList, DestroyedList, MailingList } from 'mailgun.js/interfaces/lists';
|
|
330
|
+
import { IMailListsMembers } from 'mailgun.js/interfaces/mailListMembers';
|
|
331
|
+
export default class ListsClient {
|
|
332
|
+
baseRoute: string;
|
|
333
|
+
request: Request;
|
|
334
|
+
members: IMailListsMembers;
|
|
335
|
+
constructor(request: Request, members: IMailListsMembers);
|
|
336
|
+
list(query?: ListsQuery): Promise<MailingList[]>;
|
|
337
|
+
get(mailListAddress: string): Promise<MailingList>;
|
|
338
|
+
create(data: CreateUpdateList): Promise<MailingList>;
|
|
339
|
+
update(mailListAddress: string, data: CreateUpdateList): Promise<MailingList>;
|
|
340
|
+
destroy(mailListAddress: string): Promise<DestroyedList>;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
declare module 'mailgun.js/interfaces/Domains' {
|
|
345
|
+
export interface DomainsQuery {
|
|
346
|
+
authority: string;
|
|
347
|
+
state: 'active' | 'unverified' | 'disabled';
|
|
348
|
+
limit: number;
|
|
349
|
+
skip: number;
|
|
350
|
+
}
|
|
351
|
+
export interface DomainInfo {
|
|
352
|
+
name: string;
|
|
353
|
+
smtp_password: string;
|
|
354
|
+
spam_action?: 'disabled' | 'block' | 'tag';
|
|
355
|
+
wildcard?: boolean;
|
|
356
|
+
force_dkim_authority?: boolean | 'true' | 'false';
|
|
357
|
+
dkim_key_size?: 1024 | 2048;
|
|
358
|
+
ips?: '';
|
|
359
|
+
pool_id?: '';
|
|
360
|
+
web_scheme: 'http' | 'https';
|
|
361
|
+
}
|
|
362
|
+
export interface DomainShortData {
|
|
363
|
+
name: string;
|
|
364
|
+
require_tls: boolean;
|
|
365
|
+
skip_verification: boolean;
|
|
366
|
+
state: string;
|
|
367
|
+
wildcard: boolean;
|
|
368
|
+
spam_action: string;
|
|
369
|
+
created_at: string;
|
|
370
|
+
smtp_password: string;
|
|
371
|
+
smtp_login: string;
|
|
372
|
+
type: string;
|
|
373
|
+
}
|
|
374
|
+
export interface DomainData extends DomainShortData {
|
|
375
|
+
id: string;
|
|
376
|
+
is_disabled: boolean;
|
|
377
|
+
web_prefix: string;
|
|
378
|
+
web_scheme: string;
|
|
379
|
+
}
|
|
380
|
+
export interface DomainsListItem extends DomainShortData {
|
|
381
|
+
receiving_dns_records: null;
|
|
382
|
+
sending_dns_records: null;
|
|
383
|
+
}
|
|
384
|
+
export interface DNSRecord {
|
|
385
|
+
cached: any[];
|
|
386
|
+
name: string;
|
|
387
|
+
record_type: string;
|
|
388
|
+
valid: string;
|
|
389
|
+
value: string;
|
|
390
|
+
}
|
|
391
|
+
export interface DomainResponseData {
|
|
392
|
+
status: number;
|
|
393
|
+
body: {
|
|
394
|
+
domain: DomainData;
|
|
395
|
+
message?: string;
|
|
396
|
+
receiving_dns_records: DNSRecord[];
|
|
397
|
+
sending_dns_records: DNSRecord[];
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
export interface DomainListResponseData {
|
|
401
|
+
status: number;
|
|
402
|
+
body: {
|
|
403
|
+
items: DomainsListItem[];
|
|
404
|
+
total_count: number;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
export interface MessageResponse {
|
|
408
|
+
message: string;
|
|
409
|
+
}
|
|
410
|
+
export interface DestroyedDomainResponse {
|
|
411
|
+
status: number;
|
|
412
|
+
body: MessageResponse;
|
|
413
|
+
}
|
|
414
|
+
export interface ConnectionSettings {
|
|
415
|
+
require_tls: boolean;
|
|
416
|
+
skip_verification: boolean;
|
|
417
|
+
}
|
|
418
|
+
export interface ConnectionSettingsResponse {
|
|
419
|
+
body: {
|
|
420
|
+
connection: ConnectionSettings;
|
|
421
|
+
};
|
|
422
|
+
status: number;
|
|
423
|
+
}
|
|
424
|
+
export interface UpdatedConnectionSettings {
|
|
425
|
+
message: string;
|
|
426
|
+
require_tls: boolean;
|
|
427
|
+
skip_verification: boolean;
|
|
428
|
+
}
|
|
429
|
+
export interface UpdatedConnectionSettingsRes {
|
|
430
|
+
body: UpdatedConnectionSettings;
|
|
431
|
+
status: number;
|
|
432
|
+
}
|
|
433
|
+
export interface DKIMAuthorityInfo {
|
|
434
|
+
self: boolean | 'yes' | 'no' | 'true' | 'false';
|
|
435
|
+
}
|
|
436
|
+
export interface UpdatedDKIMAuthority {
|
|
437
|
+
changed: boolean;
|
|
438
|
+
message: string;
|
|
439
|
+
sending_dns_records: DNSRecord[];
|
|
440
|
+
}
|
|
441
|
+
export interface UpdatedDKIMAuthorityResponse {
|
|
442
|
+
body: UpdatedDKIMAuthority;
|
|
443
|
+
status: 200;
|
|
444
|
+
}
|
|
445
|
+
export interface DKIMSelectorInfo {
|
|
446
|
+
dkimSelector: string;
|
|
447
|
+
}
|
|
448
|
+
export interface UpdatedDKIMSelectorResponse {
|
|
449
|
+
body: MessageResponse;
|
|
450
|
+
status: number;
|
|
451
|
+
}
|
|
452
|
+
export interface WebPrefixInfo {
|
|
453
|
+
webPrefix: string;
|
|
454
|
+
}
|
|
455
|
+
export interface UpdatedWebPrefix {
|
|
456
|
+
message: string;
|
|
457
|
+
}
|
|
458
|
+
export interface UpdatedWebPrefixResponse {
|
|
459
|
+
body: MessageResponse;
|
|
460
|
+
status: number;
|
|
461
|
+
}
|
|
462
|
+
export interface ReplacementForPool {
|
|
463
|
+
pool_id?: string;
|
|
464
|
+
ip?: string;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
declare module 'mailgun.js/interfaces/ApiResponse' {
|
|
469
|
+
interface APIResponse {
|
|
470
|
+
status: number;
|
|
471
|
+
body: any;
|
|
472
|
+
}
|
|
473
|
+
export default APIResponse;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
declare module 'mailgun.js/request' {
|
|
477
|
+
import NodeFormData from 'form-data';
|
|
478
|
+
import RequestOptions from 'mailgun.js/interfaces/RequestOptions';
|
|
479
|
+
import { InputFormData } from 'mailgun.js/interfaces/IFormData';
|
|
480
|
+
import APIResponse from 'mailgun.js/interfaces/ApiResponse';
|
|
481
|
+
class Request {
|
|
482
|
+
constructor(options: RequestOptions, formData: InputFormData);
|
|
483
|
+
request(method: string, url: string, inputOptions?: any): Promise<APIResponse>;
|
|
484
|
+
query(method: string, url: string, query: any, options?: any): Promise<APIResponse>;
|
|
485
|
+
command(method: string, url: string, data: any, options?: any): Promise<APIResponse>;
|
|
486
|
+
get(url: string, query?: any, options?: any): Promise<APIResponse>;
|
|
487
|
+
head(url: string, query: any, options: any): Promise<APIResponse>;
|
|
488
|
+
options(url: string, query: any, options: any): Promise<APIResponse>;
|
|
489
|
+
post(url: string, data: any, options?: any): Promise<APIResponse>;
|
|
490
|
+
postWithFD(url: string, data: any): Promise<APIResponse>;
|
|
491
|
+
putWithFD(url: string, data: any): Promise<APIResponse>;
|
|
492
|
+
patchWithFD(url: string, data: any): Promise<APIResponse>;
|
|
493
|
+
createFormData(data: any): NodeFormData | FormData;
|
|
494
|
+
put(url: string, data: any, options?: any): Promise<APIResponse>;
|
|
495
|
+
patch(url: string, data: any, options?: any): Promise<APIResponse>;
|
|
496
|
+
delete(url: string, data?: any, options?: any): Promise<APIResponse>;
|
|
497
|
+
}
|
|
498
|
+
export default Request;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
declare module 'mailgun.js/interfaces/DomainTracking' {
|
|
502
|
+
export interface DomainTrackingData {
|
|
503
|
+
click: {
|
|
504
|
+
active: boolean;
|
|
505
|
+
};
|
|
506
|
+
open: {
|
|
507
|
+
active: boolean;
|
|
508
|
+
};
|
|
509
|
+
unsubscribe: {
|
|
510
|
+
active: boolean;
|
|
511
|
+
html_footer: string;
|
|
512
|
+
text_footer: string;
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
export interface DomainTrackingResponse {
|
|
516
|
+
status: number;
|
|
517
|
+
body: {
|
|
518
|
+
tracking: DomainTrackingData;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
export interface UpdatedOpenTracking {
|
|
522
|
+
message: string;
|
|
523
|
+
open?: {
|
|
524
|
+
active: boolean;
|
|
525
|
+
};
|
|
526
|
+
click?: {
|
|
527
|
+
active: boolean | 'htmlonly';
|
|
528
|
+
};
|
|
529
|
+
unsubscribe?: {
|
|
530
|
+
active: boolean;
|
|
531
|
+
html_footer: string;
|
|
532
|
+
text_footer: string;
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
export interface UpdateDomainTrackingResponse {
|
|
536
|
+
status: number;
|
|
537
|
+
body: UpdatedOpenTracking;
|
|
538
|
+
}
|
|
539
|
+
export interface OpenTrackingInfo {
|
|
540
|
+
active: 'yes' | 'no' | 'true' | 'false';
|
|
541
|
+
}
|
|
542
|
+
export interface ClickTrackingInfo {
|
|
543
|
+
active: 'yes' | 'no' | 'true' | 'false' | 'htmlonly';
|
|
544
|
+
}
|
|
545
|
+
export interface UnsubscribeTrackingInfo {
|
|
546
|
+
active: 'yes' | 'no' | 'true' | 'false';
|
|
547
|
+
html_footer: string;
|
|
548
|
+
text_footer: string;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare module 'mailgun.js/interfaces/DomainCredentials' {
|
|
553
|
+
export interface DomainCredentialsQuery {
|
|
554
|
+
limit: number;
|
|
555
|
+
skip: number;
|
|
556
|
+
}
|
|
557
|
+
export interface DomainCredentials {
|
|
558
|
+
login: string;
|
|
559
|
+
password: string;
|
|
560
|
+
}
|
|
561
|
+
export interface DomainCredentialsItem {
|
|
562
|
+
created_at: string;
|
|
563
|
+
login: string;
|
|
564
|
+
mailbox: string;
|
|
565
|
+
size_bytes: number | null;
|
|
566
|
+
}
|
|
567
|
+
export interface DomainCredentialsResponseData {
|
|
568
|
+
status: number;
|
|
569
|
+
body: {
|
|
570
|
+
items: DomainCredentialsItem[];
|
|
571
|
+
total_count: number;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
export interface DomainCredentialsList {
|
|
575
|
+
items: DomainCredentialsItem[];
|
|
576
|
+
totalCount: number;
|
|
577
|
+
}
|
|
578
|
+
export interface DomainCredentialsResult {
|
|
579
|
+
status: number;
|
|
580
|
+
message: string;
|
|
581
|
+
spec?: string;
|
|
582
|
+
}
|
|
583
|
+
export interface CreatedUpdatedDomainCredentialsResponse {
|
|
584
|
+
status: number;
|
|
585
|
+
body: {
|
|
586
|
+
message: string;
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
export interface DeletedDomainCredentialsResponse {
|
|
590
|
+
status: number;
|
|
591
|
+
body: {
|
|
592
|
+
message: string;
|
|
593
|
+
spec: string;
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
export interface UpdateDomainCredentialsData {
|
|
597
|
+
password: string;
|
|
598
|
+
}
|
|
599
|
+
export interface IDomainCredentials {
|
|
600
|
+
list(domain: string, query: DomainCredentialsQuery): Promise<DomainCredentialsList>;
|
|
601
|
+
create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
|
|
602
|
+
update(domain: string, credentialsLogin: string, data: UpdateDomainCredentialsData): Promise<DomainCredentialsResult>;
|
|
603
|
+
destroy(domain: string, credentialsLogin: string): Promise<DomainCredentialsResult>;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
declare module 'mailgun.js/interfaces/DomainTemplates' {
|
|
608
|
+
import { DomainTemplateItem } from 'mailgun.js/domainsTemplates';
|
|
609
|
+
export enum YesNo {
|
|
610
|
+
YES = "yes",
|
|
611
|
+
NO = "no"
|
|
612
|
+
}
|
|
613
|
+
export enum Pages {
|
|
614
|
+
FIRST = "first",
|
|
615
|
+
LAST = "last",
|
|
616
|
+
NEXT = "next",
|
|
617
|
+
PREV = "prev"
|
|
618
|
+
}
|
|
619
|
+
export interface DomainTemplateData {
|
|
620
|
+
name: string;
|
|
621
|
+
description: string;
|
|
622
|
+
template: string;
|
|
623
|
+
tag?: string;
|
|
624
|
+
engine?: string;
|
|
625
|
+
comment?: string;
|
|
626
|
+
}
|
|
627
|
+
export interface DomainTemplateVersionData {
|
|
628
|
+
template: string;
|
|
629
|
+
tag: string;
|
|
630
|
+
engine?: string;
|
|
631
|
+
comment?: string;
|
|
632
|
+
active?: YesNo;
|
|
633
|
+
}
|
|
634
|
+
export interface DomainTemplateUpdateData {
|
|
635
|
+
description: string;
|
|
636
|
+
}
|
|
637
|
+
export interface DomainTemplateUpdateVersionData {
|
|
638
|
+
template?: string;
|
|
639
|
+
comment?: string;
|
|
640
|
+
active?: YesNo;
|
|
641
|
+
}
|
|
642
|
+
export interface DomainTemplatesQuery {
|
|
643
|
+
page: Pages;
|
|
644
|
+
limit: number;
|
|
645
|
+
p: string;
|
|
646
|
+
}
|
|
647
|
+
export interface TemplateQuery {
|
|
648
|
+
active: YesNo;
|
|
649
|
+
}
|
|
650
|
+
export interface ShortTemplateVersion {
|
|
651
|
+
tag: string;
|
|
652
|
+
engine: string;
|
|
653
|
+
mjml: string;
|
|
654
|
+
createdAt: string | Date;
|
|
655
|
+
comment: string;
|
|
656
|
+
active: boolean;
|
|
657
|
+
id: string;
|
|
658
|
+
}
|
|
659
|
+
export interface TemplateVersion extends ShortTemplateVersion {
|
|
660
|
+
template: string;
|
|
661
|
+
}
|
|
662
|
+
export interface DomainTemplate {
|
|
663
|
+
name: string;
|
|
664
|
+
description: string;
|
|
665
|
+
createdAt: string | Date;
|
|
666
|
+
createdBy: string;
|
|
667
|
+
id: string;
|
|
668
|
+
version?: TemplateVersion;
|
|
669
|
+
versions?: ShortTemplateVersion[];
|
|
670
|
+
}
|
|
671
|
+
export interface CreateDomainTemplateAPIResponse {
|
|
672
|
+
status: number;
|
|
673
|
+
body: {
|
|
674
|
+
message: string;
|
|
675
|
+
template: DomainTemplate;
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
export interface ListDomainTemplatesAPIResponse {
|
|
679
|
+
status: number;
|
|
680
|
+
body: {
|
|
681
|
+
items: DomainTemplate[];
|
|
682
|
+
paging: {
|
|
683
|
+
first: string;
|
|
684
|
+
last: string;
|
|
685
|
+
next: string;
|
|
686
|
+
previous: string;
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
export interface ListDomainTemplatesResult {
|
|
691
|
+
items: DomainTemplate[];
|
|
692
|
+
pages: {
|
|
693
|
+
first: string;
|
|
694
|
+
last: string;
|
|
695
|
+
next: string;
|
|
696
|
+
previous: string;
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
export interface GetDomainTemplateAPIResponse {
|
|
700
|
+
status: number;
|
|
701
|
+
body: {
|
|
702
|
+
template: DomainTemplate;
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
export interface UpdateOrDeleteDomainTemplateAPIResponse {
|
|
706
|
+
status: number;
|
|
707
|
+
body: {
|
|
708
|
+
message: string;
|
|
709
|
+
template: {
|
|
710
|
+
name: string;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
export interface UpdateOrDeleteDomainTemplateResult {
|
|
715
|
+
status: number;
|
|
716
|
+
message: string;
|
|
717
|
+
templateName?: string;
|
|
718
|
+
}
|
|
719
|
+
export interface NotificationAPIResponse {
|
|
720
|
+
status: number;
|
|
721
|
+
body: {
|
|
722
|
+
message: string;
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
export interface NotificationResult {
|
|
726
|
+
status: number;
|
|
727
|
+
message: string;
|
|
728
|
+
}
|
|
729
|
+
export interface CreateDomainTemplateVersionAPIResponse {
|
|
730
|
+
status: number;
|
|
731
|
+
body: {
|
|
732
|
+
message: string;
|
|
733
|
+
template: DomainTemplate;
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
export interface CreateDomainTemplateVersionResult {
|
|
737
|
+
status: number;
|
|
738
|
+
message: string;
|
|
739
|
+
template: DomainTemplate;
|
|
740
|
+
}
|
|
741
|
+
export interface MutateDomainTemplateVersionAPIResponse {
|
|
742
|
+
status: number;
|
|
743
|
+
body: {
|
|
744
|
+
message: string;
|
|
745
|
+
template: {
|
|
746
|
+
name: string;
|
|
747
|
+
version: {
|
|
748
|
+
tag: string;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
export interface MutateDomainTemplateVersionResult {
|
|
754
|
+
status: number;
|
|
755
|
+
message: string;
|
|
756
|
+
templateName: string;
|
|
757
|
+
templateVersion: {
|
|
758
|
+
tag: string;
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
export interface ListDomainTemplateVersionsAPIResponse {
|
|
762
|
+
status: number;
|
|
763
|
+
body: {
|
|
764
|
+
template: {
|
|
765
|
+
name: string;
|
|
766
|
+
description: string;
|
|
767
|
+
createdAt: string;
|
|
768
|
+
createdBy: string;
|
|
769
|
+
id: string;
|
|
770
|
+
versions: ShortTemplateVersion[];
|
|
771
|
+
};
|
|
772
|
+
paging: {
|
|
773
|
+
first: string;
|
|
774
|
+
last: string;
|
|
775
|
+
next: string;
|
|
776
|
+
previous: string;
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
export interface ListDomainTemplateVersionsResult {
|
|
781
|
+
template: DomainTemplateItem;
|
|
782
|
+
pages: {
|
|
783
|
+
first: string;
|
|
784
|
+
last: string;
|
|
785
|
+
next: string;
|
|
786
|
+
previous: string;
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
export interface IDomainTemplatesClient {
|
|
790
|
+
list(domain: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplatesResult>;
|
|
791
|
+
get(domain: string, templateName: string, query: TemplateQuery): Promise<DomainTemplateItem>;
|
|
792
|
+
create(domain: string, data: DomainTemplateData): Promise<DomainTemplateItem>;
|
|
793
|
+
update(domain: string, templateName: string, data: DomainTemplateUpdateData): Promise<UpdateOrDeleteDomainTemplateResult>;
|
|
794
|
+
destroy(domain: string, templateName: string): Promise<UpdateOrDeleteDomainTemplateResult>;
|
|
795
|
+
destroyAll(domain: string): Promise<NotificationResult>;
|
|
796
|
+
createVersion(domain: string, templateName: string, data: DomainTemplateVersionData): Promise<CreateDomainTemplateVersionResult>;
|
|
797
|
+
getVersion(domain: string, templateName: string, tag: string): Promise<DomainTemplateItem>;
|
|
798
|
+
updateVersion(domain: string, templateName: string, tag: string, data: DomainTemplateUpdateVersionData): Promise<MutateDomainTemplateVersionResult>;
|
|
799
|
+
destroyVersion(domain: string, templateName: string, tag: string): Promise<MutateDomainTemplateVersionResult>;
|
|
800
|
+
listVersions(domain: string, templateName: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplateVersionsResult>;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
declare module 'mailgun.js/domainsCredentials' {
|
|
805
|
+
import Request from 'mailgun.js/request';
|
|
806
|
+
import { DomainCredentials, DomainCredentialsList, DomainCredentialsQuery, DomainCredentialsResult, IDomainCredentials, UpdateDomainCredentialsData } from 'mailgun.js/interfaces/DomainCredentials';
|
|
807
|
+
export default class DomainCredentialsClient implements IDomainCredentials {
|
|
808
|
+
baseRoute: string;
|
|
809
|
+
request: Request;
|
|
810
|
+
constructor(request: Request);
|
|
811
|
+
list(domain: string, query?: DomainCredentialsQuery): Promise<DomainCredentialsList>;
|
|
812
|
+
create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
|
|
813
|
+
update(domain: string, credentialsLogin: string, data: UpdateDomainCredentialsData): Promise<DomainCredentialsResult>;
|
|
814
|
+
destroy(domain: string, credentialsLogin: string): Promise<DomainCredentialsResult>;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
declare module 'mailgun.js/domainsTemplates' {
|
|
819
|
+
import Request from 'mailgun.js/request';
|
|
820
|
+
import { CreateDomainTemplateVersionResult, DomainTemplate, DomainTemplateData, DomainTemplatesQuery, DomainTemplateUpdateData, DomainTemplateUpdateVersionData, DomainTemplateVersionData, IDomainTemplatesClient, ListDomainTemplatesResult, ListDomainTemplateVersionsResult, MutateDomainTemplateVersionResult, NotificationResult, ShortTemplateVersion, TemplateQuery, TemplateVersion, UpdateOrDeleteDomainTemplateResult } from 'mailgun.js/interfaces/DomainTemplates';
|
|
821
|
+
export class DomainTemplateItem implements DomainTemplate {
|
|
822
|
+
name: string;
|
|
823
|
+
description: string;
|
|
824
|
+
createdAt: Date | '';
|
|
825
|
+
createdBy: string;
|
|
826
|
+
id: string;
|
|
827
|
+
version?: TemplateVersion;
|
|
828
|
+
versions?: ShortTemplateVersion[];
|
|
829
|
+
constructor(domainTemplateFromAPI: DomainTemplate);
|
|
830
|
+
}
|
|
831
|
+
export default class DomainTemplatesClient implements IDomainTemplatesClient {
|
|
832
|
+
baseRoute: string;
|
|
833
|
+
request: Request;
|
|
834
|
+
constructor(request: Request);
|
|
835
|
+
list(domain: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplatesResult>;
|
|
836
|
+
get(domain: string, templateName: string, query?: TemplateQuery): Promise<DomainTemplateItem>;
|
|
837
|
+
create(domain: string, data: DomainTemplateData): Promise<DomainTemplateItem>;
|
|
838
|
+
update(domain: string, templateName: string, data: DomainTemplateUpdateData): Promise<UpdateOrDeleteDomainTemplateResult>;
|
|
839
|
+
destroy(domain: string, templateName: string): Promise<UpdateOrDeleteDomainTemplateResult>;
|
|
840
|
+
destroyAll(domain: string): Promise<NotificationResult>;
|
|
841
|
+
createVersion(domain: string, templateName: string, data: DomainTemplateVersionData): Promise<CreateDomainTemplateVersionResult>;
|
|
842
|
+
getVersion(domain: string, templateName: string, tag: string): Promise<DomainTemplateItem>;
|
|
843
|
+
updateVersion(domain: string, templateName: string, tag: string, data: DomainTemplateUpdateVersionData): Promise<MutateDomainTemplateVersionResult>;
|
|
844
|
+
destroyVersion(domain: string, templateName: string, tag: string): Promise<MutateDomainTemplateVersionResult>;
|
|
845
|
+
listVersions(domain: string, templateName: string, query?: DomainTemplatesQuery): Promise<ListDomainTemplateVersionsResult>;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
declare module 'mailgun.js/interfaces/DomainTags' {
|
|
850
|
+
import { DomainTagStatistic } from 'mailgun.js/domainsTags';
|
|
851
|
+
export enum Resolution {
|
|
852
|
+
HOUR = "hour",
|
|
853
|
+
DAY = "day",
|
|
854
|
+
MONTH = "month"
|
|
855
|
+
}
|
|
856
|
+
export interface DomainTagsQuery {
|
|
857
|
+
limit: number;
|
|
858
|
+
}
|
|
859
|
+
export interface DomainTagsStatisticQuery {
|
|
860
|
+
event: string;
|
|
861
|
+
start?: number;
|
|
862
|
+
end?: number;
|
|
863
|
+
resolution?: Resolution;
|
|
864
|
+
duration?: string;
|
|
865
|
+
}
|
|
866
|
+
export interface DomainTagsItemInfo {
|
|
867
|
+
tag: string;
|
|
868
|
+
description: string;
|
|
869
|
+
'first-seen': string;
|
|
870
|
+
'last-seen': string;
|
|
871
|
+
}
|
|
872
|
+
export interface DomainTagsItem {
|
|
873
|
+
tag: string;
|
|
874
|
+
description: string;
|
|
875
|
+
'first-seen': Date;
|
|
876
|
+
'last-seen': Date;
|
|
877
|
+
}
|
|
878
|
+
export interface PagesList {
|
|
879
|
+
previous: string;
|
|
880
|
+
first: string;
|
|
881
|
+
last: string;
|
|
882
|
+
next: string;
|
|
883
|
+
}
|
|
884
|
+
export interface ParsedPage {
|
|
885
|
+
id: string;
|
|
886
|
+
url: string;
|
|
887
|
+
}
|
|
888
|
+
export interface ParsedPagesList {
|
|
889
|
+
previous: ParsedPage;
|
|
890
|
+
first: ParsedPage;
|
|
891
|
+
last: ParsedPage;
|
|
892
|
+
next: ParsedPage;
|
|
893
|
+
}
|
|
894
|
+
export interface TagsPage {
|
|
895
|
+
id: string;
|
|
896
|
+
url: string;
|
|
897
|
+
}
|
|
898
|
+
export interface PagesListAccumulator {
|
|
899
|
+
[index: string]: TagsPage;
|
|
900
|
+
}
|
|
901
|
+
export interface DomainTagsResponseData {
|
|
902
|
+
status: number;
|
|
903
|
+
body: {
|
|
904
|
+
items: DomainTagsItemInfo[];
|
|
905
|
+
paging: PagesList;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
export interface DomainTagsList {
|
|
909
|
+
items: DomainTagsItem[];
|
|
910
|
+
pages: ParsedPagesList;
|
|
911
|
+
}
|
|
912
|
+
export interface DomainTagsMessageRes {
|
|
913
|
+
message: string;
|
|
914
|
+
status?: number;
|
|
915
|
+
}
|
|
916
|
+
export interface DomainTagAPIResponseStatsItem {
|
|
917
|
+
time: string;
|
|
918
|
+
accepted?: {
|
|
919
|
+
incoming: number;
|
|
920
|
+
outgoing: number;
|
|
921
|
+
total: number;
|
|
922
|
+
};
|
|
923
|
+
delivered?: {
|
|
924
|
+
smtp: number;
|
|
925
|
+
http: number;
|
|
926
|
+
optimized: number;
|
|
927
|
+
total: number;
|
|
928
|
+
};
|
|
929
|
+
opened?: {
|
|
930
|
+
total: number;
|
|
931
|
+
};
|
|
932
|
+
failed?: {
|
|
933
|
+
temporary: {
|
|
934
|
+
espblock: number;
|
|
935
|
+
total: number;
|
|
936
|
+
};
|
|
937
|
+
permanent: {
|
|
938
|
+
'suppress-bounce': number;
|
|
939
|
+
'suppress-unsubscribe': number;
|
|
940
|
+
'suppress-complaint': number;
|
|
941
|
+
bounce: number;
|
|
942
|
+
'delayed-bounce': number;
|
|
943
|
+
webhook: number;
|
|
944
|
+
optimized: number;
|
|
945
|
+
total: number;
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
clicked?: {
|
|
949
|
+
total: number;
|
|
950
|
+
};
|
|
951
|
+
unsubscribed?: {
|
|
952
|
+
total: number;
|
|
953
|
+
};
|
|
954
|
+
complained?: {
|
|
955
|
+
total: number;
|
|
956
|
+
};
|
|
957
|
+
stored?: {
|
|
958
|
+
total: number;
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
export interface DomainTagStatAPIResponse {
|
|
962
|
+
body: {
|
|
963
|
+
tag: string;
|
|
964
|
+
description: string;
|
|
965
|
+
start: string;
|
|
966
|
+
end: string;
|
|
967
|
+
resolution: Resolution;
|
|
968
|
+
stats: DomainTagAPIResponseStatsItem[];
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
export interface DomainTagStatisticItem extends Omit<DomainTagAPIResponseStatsItem, 'time'> {
|
|
972
|
+
time: Date;
|
|
973
|
+
}
|
|
974
|
+
export interface DomainTagStatisticResult {
|
|
975
|
+
tag: string;
|
|
976
|
+
description: string;
|
|
977
|
+
start: Date;
|
|
978
|
+
end: Date;
|
|
979
|
+
resolution: Resolution;
|
|
980
|
+
stats: DomainTagStatisticItem[];
|
|
981
|
+
}
|
|
982
|
+
export interface DomainTagCountriesAPIResponse {
|
|
983
|
+
body: {
|
|
984
|
+
tag: string;
|
|
985
|
+
country: {
|
|
986
|
+
[key: string]: {
|
|
987
|
+
clicked: number;
|
|
988
|
+
complained: number;
|
|
989
|
+
opened: number;
|
|
990
|
+
unique_clicked: number;
|
|
991
|
+
unique_opened: number;
|
|
992
|
+
unsubscribed: number;
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
export interface DomainTagCountriesAggregation {
|
|
998
|
+
tag: string;
|
|
999
|
+
country: {
|
|
1000
|
+
[key: string]: {
|
|
1001
|
+
clicked: number;
|
|
1002
|
+
complained: number;
|
|
1003
|
+
opened: number;
|
|
1004
|
+
unique_clicked: number;
|
|
1005
|
+
unique_opened: number;
|
|
1006
|
+
unsubscribed: number;
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
export interface DomainTagProvidersAPIResponse {
|
|
1011
|
+
body: {
|
|
1012
|
+
tag: string;
|
|
1013
|
+
provider: {
|
|
1014
|
+
[key: string]: {
|
|
1015
|
+
accepted: number;
|
|
1016
|
+
clicked: number;
|
|
1017
|
+
complained: number;
|
|
1018
|
+
delivered: number;
|
|
1019
|
+
opened: number;
|
|
1020
|
+
unique_clicked: number;
|
|
1021
|
+
unique_opened: number;
|
|
1022
|
+
unsubscribed: number;
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
status: number;
|
|
1027
|
+
}
|
|
1028
|
+
export interface DomainTagProvidersAggregation {
|
|
1029
|
+
tag: string;
|
|
1030
|
+
provider: {
|
|
1031
|
+
[key: string]: {
|
|
1032
|
+
accepted: number;
|
|
1033
|
+
clicked: number;
|
|
1034
|
+
complained: number;
|
|
1035
|
+
delivered: number;
|
|
1036
|
+
opened: number;
|
|
1037
|
+
unique_clicked: number;
|
|
1038
|
+
unique_opened: number;
|
|
1039
|
+
unsubscribed: number;
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
export interface DeviceStatistic {
|
|
1044
|
+
clicked: number;
|
|
1045
|
+
complained: number;
|
|
1046
|
+
opened: number;
|
|
1047
|
+
unique_clicked: number;
|
|
1048
|
+
unique_opened: number;
|
|
1049
|
+
unsubscribed: number;
|
|
1050
|
+
}
|
|
1051
|
+
export interface DevicesTypes {
|
|
1052
|
+
desktop: DeviceStatistic;
|
|
1053
|
+
mobile: DeviceStatistic;
|
|
1054
|
+
tablet: DeviceStatistic;
|
|
1055
|
+
unknown: DeviceStatistic;
|
|
1056
|
+
}
|
|
1057
|
+
export interface DomainTagDevicesAPIResponse {
|
|
1058
|
+
body: {
|
|
1059
|
+
tag: string;
|
|
1060
|
+
device: DevicesTypes;
|
|
1061
|
+
};
|
|
1062
|
+
status: number;
|
|
1063
|
+
}
|
|
1064
|
+
export interface DomainTagDevicesAggregation {
|
|
1065
|
+
tag: string;
|
|
1066
|
+
device: DevicesTypes;
|
|
1067
|
+
}
|
|
1068
|
+
export interface IDomainTagsClient {
|
|
1069
|
+
list(domain: string): Promise<DomainTagsList>;
|
|
1070
|
+
get(domain: string, tag: string): Promise<DomainTagsItem>;
|
|
1071
|
+
update(domain: string, tag: string, description: string): Promise<DomainTagsMessageRes>;
|
|
1072
|
+
destroy(domain: string, tag: string): Promise<DomainTagsMessageRes>;
|
|
1073
|
+
statistic(domain: string, tag: string, query: DomainTagsStatisticQuery): Promise<DomainTagStatistic>;
|
|
1074
|
+
countries(domain: string, tag: string): Promise<DomainTagCountriesAggregation>;
|
|
1075
|
+
providers(domain: string, tag: string): Promise<DomainTagProvidersAggregation>;
|
|
1076
|
+
devices(domain: string, tag: string): Promise<DomainTagDevicesAggregation>;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
declare module 'mailgun.js/domainsTags' {
|
|
1081
|
+
import Request from 'mailgun.js/request';
|
|
1082
|
+
import { DomainTagCountriesAggregation, DomainTagDevicesAggregation, DomainTagProvidersAggregation, DomainTagsItem, DomainTagsItemInfo, DomainTagsList, DomainTagsMessageRes, DomainTagsQuery, DomainTagsStatisticQuery, DomainTagStatAPIResponse, DomainTagStatisticItem, DomainTagStatisticResult, IDomainTagsClient, Resolution } from 'mailgun.js/interfaces/DomainTags';
|
|
1083
|
+
export class DomainTag implements DomainTagsItem {
|
|
1084
|
+
tag: string;
|
|
1085
|
+
description: string;
|
|
1086
|
+
'first-seen': Date;
|
|
1087
|
+
'last-seen': Date;
|
|
1088
|
+
constructor(tagInfo: DomainTagsItemInfo);
|
|
1089
|
+
}
|
|
1090
|
+
export class DomainTagStatistic implements DomainTagStatisticResult {
|
|
1091
|
+
tag: string;
|
|
1092
|
+
description: string;
|
|
1093
|
+
start: Date;
|
|
1094
|
+
end: Date;
|
|
1095
|
+
resolution: Resolution;
|
|
1096
|
+
stats: DomainTagStatisticItem[];
|
|
1097
|
+
constructor(tagStatisticInfo: DomainTagStatAPIResponse);
|
|
1098
|
+
}
|
|
1099
|
+
export default class DomainTagsClient implements IDomainTagsClient {
|
|
1100
|
+
baseRoute: string;
|
|
1101
|
+
request: Request;
|
|
1102
|
+
constructor(request: Request);
|
|
1103
|
+
list(domain: string, query?: DomainTagsQuery): Promise<DomainTagsList>;
|
|
1104
|
+
get(domain: string, tag: string): Promise<DomainTagsItem>;
|
|
1105
|
+
update(domain: string, tag: string, description: string): Promise<DomainTagsMessageRes>;
|
|
1106
|
+
destroy(domain: string, tag: string): Promise<DomainTagsMessageRes>;
|
|
1107
|
+
statistic(domain: string, tag: string, query: DomainTagsStatisticQuery): Promise<DomainTagStatistic>;
|
|
1108
|
+
countries(domain: string, tag: string): Promise<DomainTagCountriesAggregation>;
|
|
1109
|
+
providers(domain: string, tag: string): Promise<DomainTagProvidersAggregation>;
|
|
1110
|
+
devices(domain: string, tag: string): Promise<DomainTagDevicesAggregation>;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
declare module 'mailgun.js/interfaces/Events' {
|
|
1115
|
+
export interface EventsPage {
|
|
1116
|
+
id: string;
|
|
1117
|
+
number: string;
|
|
1118
|
+
url: string;
|
|
1119
|
+
}
|
|
1120
|
+
export interface PagesList {
|
|
1121
|
+
previous: string;
|
|
1122
|
+
first: string;
|
|
1123
|
+
last: string;
|
|
1124
|
+
next: string;
|
|
1125
|
+
}
|
|
1126
|
+
export interface EventsResponse {
|
|
1127
|
+
body: {
|
|
1128
|
+
items: [];
|
|
1129
|
+
paging: PagesList;
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
export interface DomainEvent {
|
|
1133
|
+
severity: string;
|
|
1134
|
+
tags: string[];
|
|
1135
|
+
storage: {
|
|
1136
|
+
url: string;
|
|
1137
|
+
key: string;
|
|
1138
|
+
};
|
|
1139
|
+
'delivery-status': {
|
|
1140
|
+
tls: boolean;
|
|
1141
|
+
'mx-host': string;
|
|
1142
|
+
code: number;
|
|
1143
|
+
description: string;
|
|
1144
|
+
'session-seconds': number;
|
|
1145
|
+
utf8: boolean;
|
|
1146
|
+
'attempt-no': number;
|
|
1147
|
+
message: string;
|
|
1148
|
+
'certificate-verified': boolean;
|
|
1149
|
+
};
|
|
1150
|
+
'recipient-domain': string;
|
|
1151
|
+
id: string;
|
|
1152
|
+
campaigns: [];
|
|
1153
|
+
reason: string;
|
|
1154
|
+
'user-variables': {
|
|
1155
|
+
[key: string]: any;
|
|
1156
|
+
};
|
|
1157
|
+
flags: {
|
|
1158
|
+
'is-routed': boolean;
|
|
1159
|
+
'is-authenticated': boolean;
|
|
1160
|
+
'is-system-test': boolean;
|
|
1161
|
+
'is-test-mode': boolean;
|
|
1162
|
+
};
|
|
1163
|
+
'log-level': string;
|
|
1164
|
+
template?: any;
|
|
1165
|
+
timestamp: number;
|
|
1166
|
+
envelope: {
|
|
1167
|
+
transport: string;
|
|
1168
|
+
sender: string;
|
|
1169
|
+
'sending-ip': string;
|
|
1170
|
+
targets: string;
|
|
1171
|
+
};
|
|
1172
|
+
message: {
|
|
1173
|
+
headers: {
|
|
1174
|
+
to: string;
|
|
1175
|
+
'message-id': string;
|
|
1176
|
+
from: string;
|
|
1177
|
+
subject: string;
|
|
1178
|
+
};
|
|
1179
|
+
attachments: [];
|
|
1180
|
+
size: 308;
|
|
1181
|
+
};
|
|
1182
|
+
recipient: string;
|
|
1183
|
+
event: string;
|
|
1184
|
+
}
|
|
1185
|
+
export interface ParsedPage {
|
|
1186
|
+
id: string;
|
|
1187
|
+
number: string;
|
|
1188
|
+
url: string;
|
|
1189
|
+
}
|
|
1190
|
+
export interface ParsedPagesList {
|
|
1191
|
+
previous: ParsedPage;
|
|
1192
|
+
first: ParsedPage;
|
|
1193
|
+
last: ParsedPage;
|
|
1194
|
+
next: ParsedPage;
|
|
1195
|
+
}
|
|
1196
|
+
export interface EventsList {
|
|
1197
|
+
items: DomainEvent[];
|
|
1198
|
+
pages: ParsedPagesList;
|
|
1199
|
+
}
|
|
1200
|
+
export interface PagesListAccumulator {
|
|
1201
|
+
[index: string]: EventsPage;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
declare module 'mailgun.js/interfaces/StatsOptions' {
|
|
1206
|
+
export interface Stat {
|
|
1207
|
+
time: string | Date;
|
|
1208
|
+
delivered: {
|
|
1209
|
+
smtp: number;
|
|
1210
|
+
http: number;
|
|
1211
|
+
total: number;
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
export interface StatsOptions {
|
|
1215
|
+
start: string | Date;
|
|
1216
|
+
end: string | Date;
|
|
1217
|
+
resolution: string;
|
|
1218
|
+
stats: Stat[];
|
|
1219
|
+
}
|
|
1220
|
+
export interface StatsQuery {
|
|
1221
|
+
event: string | string[];
|
|
1222
|
+
start: string | Date;
|
|
1223
|
+
end: string | Date;
|
|
1224
|
+
resolution: 'hour' | 'day' | 'month';
|
|
1225
|
+
duration: string;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
declare module 'mailgun.js/interfaces/Supressions' {
|
|
1230
|
+
export interface BounceData {
|
|
1231
|
+
address: string;
|
|
1232
|
+
code: number;
|
|
1233
|
+
error: string;
|
|
1234
|
+
created_at: string | Date;
|
|
1235
|
+
}
|
|
1236
|
+
export interface ComplaintData {
|
|
1237
|
+
address: string;
|
|
1238
|
+
created_at: string | Date;
|
|
1239
|
+
}
|
|
1240
|
+
export interface UnsubscribeData {
|
|
1241
|
+
address: string;
|
|
1242
|
+
tags: any;
|
|
1243
|
+
created_at: string | Date;
|
|
1244
|
+
}
|
|
1245
|
+
export interface WhiteListData {
|
|
1246
|
+
type: string;
|
|
1247
|
+
value: string;
|
|
1248
|
+
reason: string;
|
|
1249
|
+
createdAt: string | Date;
|
|
1250
|
+
}
|
|
1251
|
+
export interface IBounce {
|
|
1252
|
+
type: string;
|
|
1253
|
+
address: string;
|
|
1254
|
+
code: number;
|
|
1255
|
+
error: string;
|
|
1256
|
+
created_at: Date;
|
|
1257
|
+
}
|
|
1258
|
+
export interface IComplaint {
|
|
1259
|
+
type: string;
|
|
1260
|
+
address: any;
|
|
1261
|
+
created_at: Date;
|
|
1262
|
+
}
|
|
1263
|
+
export interface IUnsubscribe {
|
|
1264
|
+
type: string;
|
|
1265
|
+
address: string;
|
|
1266
|
+
tags: any;
|
|
1267
|
+
created_at: Date;
|
|
1268
|
+
}
|
|
1269
|
+
export interface IWhiteList {
|
|
1270
|
+
type: string;
|
|
1271
|
+
value: string;
|
|
1272
|
+
reason: string;
|
|
1273
|
+
createdAt: Date;
|
|
1274
|
+
}
|
|
1275
|
+
export interface ParsedPage {
|
|
1276
|
+
id: string;
|
|
1277
|
+
page: string | undefined;
|
|
1278
|
+
address: string | undefined;
|
|
1279
|
+
url: string;
|
|
1280
|
+
}
|
|
1281
|
+
export interface ParsedPagesList {
|
|
1282
|
+
previous: ParsedPage;
|
|
1283
|
+
first: ParsedPage;
|
|
1284
|
+
last: ParsedPage;
|
|
1285
|
+
next: ParsedPage;
|
|
1286
|
+
}
|
|
1287
|
+
export interface SuppressionList {
|
|
1288
|
+
items: IBounce[] | IComplaint[] | IUnsubscribe[] | IWhiteList[];
|
|
1289
|
+
pages: ParsedPagesList;
|
|
1290
|
+
}
|
|
1291
|
+
export interface PagesList {
|
|
1292
|
+
previous: string;
|
|
1293
|
+
first: string;
|
|
1294
|
+
last: string;
|
|
1295
|
+
next: string;
|
|
1296
|
+
}
|
|
1297
|
+
export enum SuppressionModels {
|
|
1298
|
+
BOUNCES = "bounces",
|
|
1299
|
+
COMPLAINTS = "complaints",
|
|
1300
|
+
UNSUBSCRIBES = "unsubscribes",
|
|
1301
|
+
WHITELISTS = "whitelists"
|
|
1302
|
+
}
|
|
1303
|
+
export interface PagesListAccumulator {
|
|
1304
|
+
[index: string]: ParsedPage;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
declare module 'mailgun.js/interfaces/Webhooks' {
|
|
1309
|
+
export interface APIWebhook {
|
|
1310
|
+
url?: string;
|
|
1311
|
+
urls?: string[];
|
|
1312
|
+
}
|
|
1313
|
+
export interface WebhookResponseBody {
|
|
1314
|
+
message: string;
|
|
1315
|
+
webhook: APIWebhook;
|
|
1316
|
+
}
|
|
1317
|
+
export interface WebhookResponse {
|
|
1318
|
+
status: number;
|
|
1319
|
+
body: WebhookResponseBody;
|
|
1320
|
+
}
|
|
1321
|
+
export interface WebhookList {
|
|
1322
|
+
[id: string]: {
|
|
1323
|
+
urls: string[];
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
export interface WebhooksQuery {
|
|
1327
|
+
limit?: number;
|
|
1328
|
+
skip?: number;
|
|
1329
|
+
}
|
|
1330
|
+
export interface ValidationResponse {
|
|
1331
|
+
code: number;
|
|
1332
|
+
message: string;
|
|
1333
|
+
}
|
|
1334
|
+
export enum WebhooksIds {
|
|
1335
|
+
CLICKED = "clicked",
|
|
1336
|
+
COMPLAINED = "complained",
|
|
1337
|
+
DELIVERED = "delivered",
|
|
1338
|
+
OPENED = "opened",
|
|
1339
|
+
PERMANENT_FAIL = "permanent_fail",
|
|
1340
|
+
TEMPORARY_FAIL = "temporary_fail",
|
|
1341
|
+
UNSUBSCRIBED = "unsubscribe"
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
declare module 'mailgun.js/interfaces/routes' {
|
|
1346
|
+
export interface Route {
|
|
1347
|
+
actions: string[];
|
|
1348
|
+
created_at: string;
|
|
1349
|
+
description: string;
|
|
1350
|
+
expression: string;
|
|
1351
|
+
id: string;
|
|
1352
|
+
priority: number;
|
|
1353
|
+
}
|
|
1354
|
+
export interface UpdateRouteResponse extends Route {
|
|
1355
|
+
message: string;
|
|
1356
|
+
}
|
|
1357
|
+
export interface DestroyRouteResponse {
|
|
1358
|
+
id: string;
|
|
1359
|
+
message: string;
|
|
1360
|
+
}
|
|
1361
|
+
export interface CreateUpdateRouteData {
|
|
1362
|
+
priority?: number;
|
|
1363
|
+
description?: string;
|
|
1364
|
+
expression: string;
|
|
1365
|
+
action: string[];
|
|
1366
|
+
}
|
|
1367
|
+
export interface RoutesListQuery {
|
|
1368
|
+
limit?: number;
|
|
1369
|
+
skip?: number;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
declare module 'mailgun.js/interfaces/MultipleValidation' {
|
|
1374
|
+
export interface MultipleValidationJob {
|
|
1375
|
+
created_at: number;
|
|
1376
|
+
download_url: {
|
|
1377
|
+
csv: string;
|
|
1378
|
+
json: string;
|
|
1379
|
+
};
|
|
1380
|
+
id: string;
|
|
1381
|
+
quantity: number;
|
|
1382
|
+
records_processed: number;
|
|
1383
|
+
status: string;
|
|
1384
|
+
summary: {
|
|
1385
|
+
result: {
|
|
1386
|
+
catch_all: number;
|
|
1387
|
+
deliverable: number;
|
|
1388
|
+
do_not_send: number;
|
|
1389
|
+
undeliverable: number;
|
|
1390
|
+
unknown: number;
|
|
1391
|
+
};
|
|
1392
|
+
risk: {
|
|
1393
|
+
high: number;
|
|
1394
|
+
low: number;
|
|
1395
|
+
medium: number;
|
|
1396
|
+
unknown: number;
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
export interface CreatedMultipleValidationJob {
|
|
1401
|
+
id: string;
|
|
1402
|
+
message: string;
|
|
1403
|
+
}
|
|
1404
|
+
export interface PagesList {
|
|
1405
|
+
prev: string;
|
|
1406
|
+
first: string;
|
|
1407
|
+
last: string;
|
|
1408
|
+
next: string;
|
|
1409
|
+
}
|
|
1410
|
+
export interface MultipleValidationJobsListResult {
|
|
1411
|
+
jobs: MultipleValidationJob[];
|
|
1412
|
+
paging: PagesList;
|
|
1413
|
+
total: number;
|
|
1414
|
+
}
|
|
1415
|
+
export interface MultipleValidationJobsListResponse {
|
|
1416
|
+
status: 200;
|
|
1417
|
+
body: MultipleValidationJobsListResult;
|
|
1418
|
+
}
|
|
1419
|
+
export interface CanceledMultipleValidationJob {
|
|
1420
|
+
body: string;
|
|
1421
|
+
status: number;
|
|
1422
|
+
}
|
|
1423
|
+
export interface IMultipleValidationClient {
|
|
1424
|
+
list(): Promise<MultipleValidationJobsListResult>;
|
|
1425
|
+
get(listId: string): Promise<MultipleValidationJob>;
|
|
1426
|
+
create(listId: string, file: any): Promise<CreatedMultipleValidationJob>;
|
|
1427
|
+
destroy(listId: string): Promise<CanceledMultipleValidationJob>;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
declare module 'mailgun.js/interfaces/Validate' {
|
|
1432
|
+
export interface ValidationResult {
|
|
1433
|
+
address: string;
|
|
1434
|
+
is_disposable_address: boolean;
|
|
1435
|
+
is_role_address: boolean;
|
|
1436
|
+
reason: string[];
|
|
1437
|
+
result: string;
|
|
1438
|
+
risk: string;
|
|
1439
|
+
}
|
|
1440
|
+
export interface ValidationResponse {
|
|
1441
|
+
status: number;
|
|
1442
|
+
body: ValidationResult;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
declare module 'mailgun.js/interfaces/Ips' {
|
|
1447
|
+
export interface IpsListResponseBody {
|
|
1448
|
+
assignable_to_pools: boolean;
|
|
1449
|
+
items: string[];
|
|
1450
|
+
total_count: number;
|
|
1451
|
+
}
|
|
1452
|
+
export interface IpData {
|
|
1453
|
+
ip: string;
|
|
1454
|
+
dedicated: boolean;
|
|
1455
|
+
rdns: string;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
declare module 'mailgun.js/interfaces/IpPools' {
|
|
1460
|
+
export interface IpPool {
|
|
1461
|
+
description: string;
|
|
1462
|
+
ips: string[];
|
|
1463
|
+
is_linked: boolean;
|
|
1464
|
+
name: string;
|
|
1465
|
+
pool_id: string;
|
|
1466
|
+
}
|
|
1467
|
+
export interface IpPoolListResponse {
|
|
1468
|
+
body: {
|
|
1469
|
+
ip_pools: IpPool;
|
|
1470
|
+
message: string;
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
export interface IpPoolUpdateData {
|
|
1474
|
+
name: string;
|
|
1475
|
+
description: string;
|
|
1476
|
+
add_ip: string;
|
|
1477
|
+
remove_ip: string;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
declare module 'mailgun.js/interfaces/lists' {
|
|
1482
|
+
export interface ListsQuery {
|
|
1483
|
+
address?: string;
|
|
1484
|
+
limit?: number;
|
|
1485
|
+
skip?: number;
|
|
1486
|
+
}
|
|
1487
|
+
export interface CreateUpdateList {
|
|
1488
|
+
address: string;
|
|
1489
|
+
name?: string;
|
|
1490
|
+
description?: string;
|
|
1491
|
+
access_level?: 'readonly' | 'members' | 'everyone';
|
|
1492
|
+
reply_preference?: 'list' | 'sender';
|
|
1493
|
+
}
|
|
1494
|
+
export interface DestroyedList {
|
|
1495
|
+
address: string;
|
|
1496
|
+
message: string;
|
|
1497
|
+
}
|
|
1498
|
+
export interface MailingList {
|
|
1499
|
+
access_level: string;
|
|
1500
|
+
address: string;
|
|
1501
|
+
created_at: string;
|
|
1502
|
+
description: string;
|
|
1503
|
+
members_count: number;
|
|
1504
|
+
name: string;
|
|
1505
|
+
reply_preference: null | string;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
declare module 'mailgun.js/interfaces/mailListMembers' {
|
|
1510
|
+
import { MailingList } from 'mailgun.js/interfaces/lists';
|
|
1511
|
+
export interface MailListMember {
|
|
1512
|
+
address: string;
|
|
1513
|
+
name: string;
|
|
1514
|
+
subscribed: boolean;
|
|
1515
|
+
vars: string | any;
|
|
1516
|
+
}
|
|
1517
|
+
export interface MailListMembersQuery {
|
|
1518
|
+
subscribed?: 'yes' | 'no';
|
|
1519
|
+
limit?: number;
|
|
1520
|
+
}
|
|
1521
|
+
export interface MultipleMembersData {
|
|
1522
|
+
members: Array<MailListMember>;
|
|
1523
|
+
upsert: 'yes' | 'no';
|
|
1524
|
+
}
|
|
1525
|
+
export interface MultipleMembersReqData {
|
|
1526
|
+
members: string;
|
|
1527
|
+
upsert: 'yes' | 'no';
|
|
1528
|
+
}
|
|
1529
|
+
export interface CreateUpdateMailListMembers {
|
|
1530
|
+
address: string;
|
|
1531
|
+
name?: string;
|
|
1532
|
+
vars?: string;
|
|
1533
|
+
subscribed?: 'yes' | 'no' | boolean;
|
|
1534
|
+
upsert?: 'yes' | 'no';
|
|
1535
|
+
}
|
|
1536
|
+
export interface CreateUpdateMailListMembersReq {
|
|
1537
|
+
address: string;
|
|
1538
|
+
name?: string;
|
|
1539
|
+
vars?: string;
|
|
1540
|
+
subscribed?: 'yes' | 'no' | boolean;
|
|
1541
|
+
upsert?: 'yes' | 'no';
|
|
1542
|
+
}
|
|
1543
|
+
export interface DeletedMember {
|
|
1544
|
+
member: {
|
|
1545
|
+
address: string;
|
|
1546
|
+
};
|
|
1547
|
+
message: string;
|
|
1548
|
+
}
|
|
1549
|
+
export interface NewMultipleMembersResponse {
|
|
1550
|
+
list: MailingList;
|
|
1551
|
+
message: string;
|
|
1552
|
+
'task-id': string;
|
|
1553
|
+
}
|
|
1554
|
+
export interface IMailListsMembers {
|
|
1555
|
+
listMembers(mailListAddress: string, query?: MailListMembersQuery): Promise<MailListMember[]>;
|
|
1556
|
+
getMember(address: string, memberAddress: string): Promise<MailListMember>;
|
|
1557
|
+
createMember(mailListAddress: string, data: CreateUpdateMailListMembers): Promise<MailListMember>;
|
|
1558
|
+
createMembers(mailListAddress: string, data: MultipleMembersData): Promise<NewMultipleMembersResponse>;
|
|
1559
|
+
updateMember(address: string, memberAddress: string, data: CreateUpdateMailListMembers): Promise<MailListMember>;
|
|
1560
|
+
destroyMember(address: string, memberAddress: string): Promise<DeletedMember>;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
declare module 'mailgun.js/interfaces/RequestOptions' {
|
|
1565
|
+
import Options from 'mailgun.js/interfaces/Options';
|
|
1566
|
+
interface RequestOptions extends Options {
|
|
1567
|
+
headers: any;
|
|
1568
|
+
timeout: number;
|
|
1569
|
+
}
|
|
1570
|
+
export default RequestOptions;
|
|
1571
|
+
}
|
|
1572
|
+
|