mailgun.js 5.0.3 → 5.0.4

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