mailgun.js 5.0.1 → 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 (314) hide show
  1. package/CHANGELOG.md +30 -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 -83
  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} +32 -53
  18. package/{lib/interfaces/Events.ts → interfaces/Events.d.ts} +11 -12
  19. package/interfaces/IFormData.d.ts +7 -0
  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 -3
  41. package/messages.d.ts +9 -0
  42. package/multipleValidation.d.ts +10 -0
  43. package/package.json +9 -83
  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 -1572
  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 -17
  270. package/lib/interfaces/APIErrorOptions.ts +0 -10
  271. package/lib/interfaces/IFormData.ts +0 -9
  272. package/lib/interfaces/IpPools.ts +0 -22
  273. package/lib/interfaces/Ips.ts +0 -12
  274. package/lib/interfaces/Options.ts +0 -10
  275. package/lib/interfaces/StatsOptions.ts +0 -23
  276. package/lib/interfaces/Supressions.ts +0 -86
  277. package/lib/ip-pools.ts +0 -36
  278. package/lib/ips.ts +0 -24
  279. package/lib/lists.ts +0 -45
  280. package/lib/mailListMembers.ts +0 -83
  281. package/lib/messages.ts +0 -27
  282. package/lib/multipleValidation.ts +0 -37
  283. package/lib/request.ts +0 -271
  284. package/lib/routes.ts +0 -37
  285. package/lib/stats.ts +0 -62
  286. package/lib/suppressions.ts +0 -198
  287. package/lib/validate.ts +0 -20
  288. package/lib/webhooks.ts +0 -83
  289. package/test/client.test.ts +0 -96
  290. package/test/data/emailsValidation1.csv +0 -3
  291. package/test/domains.test.ts +0 -313
  292. package/test/domainsCredentials.test.ts +0 -97
  293. package/test/domainsTags.test.ts +0 -345
  294. package/test/domainsTemplates.test.ts +0 -392
  295. package/test/error.test.ts +0 -32
  296. package/test/events.test.ts +0 -104
  297. package/test/img/mailgun.png +0 -0
  298. package/test/ips.test.ts +0 -57
  299. package/test/lists.test.ts +0 -100
  300. package/test/mailListMembers.test.ts +0 -198
  301. package/test/messageAttachment.test.ts +0 -50
  302. package/test/messages.test.ts +0 -89
  303. package/test/multipleValidation.test.ts +0 -159
  304. package/test/request.test.ts +0 -103
  305. package/test/routes.test.ts +0 -136
  306. package/test/stats.test.ts +0 -90
  307. package/test/suppressions.test.ts +0 -219
  308. package/test/validate.test.ts +0 -43
  309. package/test/webhooks.test.ts +0 -112
  310. package/tsconfig.json +0 -22
  311. package/tsconfig.webpack.json +0 -10
  312. package/webpack/webpack.common.config.js +0 -47
  313. package/webpack/webpack.dev.config.js +0 -28
  314. package/webpack/webpack.release.config.js +0 -37
@@ -1,20 +0,0 @@
1
- /* eslint-disable no-console */
2
- const mailgun = require('../lib/index');
3
-
4
- const mg = mailgun.client({
5
- username: 'api',
6
- key: process.env.MAILGUN_API_KEY || '',
7
- public_key: process.env.MAILGUN_PUBLIC_KEY || ''
8
- });
9
-
10
- mg.validate.get('Alice <alice@example.com>')
11
- .then((data) => console.log('validate: ', data))
12
- .catch((err) => console.log(err));
13
-
14
- mg.parse.get(['Alice <alice@example.com>', 'bob@example.com', 'example.com'])
15
- .then((data) => console.log('parse: without dns/esp checks', data))
16
- .catch((err) => console.log(err));
17
-
18
- mg.parse.get('Alice <alice@example.com>, bob@example.com, example.com', true)
19
- .then((data) => console.log('parse: with dns/esp checks', data))
20
- .catch((err) => console.log(err));
@@ -1,285 +0,0 @@
1
- <!DOCTYPE html>
2
- <html ng-app="app">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
7
- <title>Mailgun.js Example</title>
8
- <link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
9
- <style media="screen">
10
- [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
11
- display: none !important;
12
- }
13
- .jumbotron,.jumbotron p:last-child,.navbar{margin-bottom:0}body{min-height:75rem}.navbar-collapse .container-fluid{padding:2rem 2.5rem;border-bottom:1px solid #55595c}.navbar-collapse .text-muted,.navbar-collapse h4{color:#818a91}.about{float:left;max-width:30rem;margin-right:3rem}.social a{font-weight:500;color:#eceeef}.social a:hover{color:#fff}.jumbotron{padding-top:6rem;padding-bottom:6rem;background-color:#fff}.jumbotron-heading{font-weight:300}.jumbotron .container{max-width:40rem}footer{padding-top:3rem;padding-bottom:3rem}footer p{margin-bottom:.25rem}
14
- .album {
15
- min-height: 50rem; /* Can be removed; just added for demo purposes */
16
- padding-top: 3rem;
17
- padding-bottom: 3rem;
18
- background-color: #f7f7f7;
19
- }
20
- .card, .card-header {
21
- background: white;
22
- }
23
- pre {
24
- background: #f1f1f1;
25
- padding: .5rem;
26
- border-radius: 3px;
27
- }
28
- .form-control-label {
29
- text-align: right;
30
- }
31
- select.form-control {
32
- height: 2.6rem;
33
- }
34
- .filedropper {
35
- border: 1px dashed #ccc;
36
- background: #fff;
37
- text-align: center;
38
- padding: 20px;
39
- font-size: smaller;
40
- width: 100%;
41
- }
42
- </style>
43
- </head>
44
- <body ng-controller="MainCtrl" ng-cloak>
45
- <section class="jumbotron text-center">
46
- <div class="container">
47
- <p class="lead">
48
- <img src="https://mailgun.github.io/media/Mailgun_Icon.png" alt="" width="100px" />
49
- </p>
50
- <h1 class="jumbotron-heading display-2">Mailgun.js</h1>
51
- <p class="lead">
52
- A javascript sdk for Mailgun built with webpack, babel & es6.
53
- </p>
54
- <hr>
55
- <p class="text-muted">
56
- For this demo to work, you'll need to install and run `http-proxy` locally. Install it with:</p>
57
- <pre>npm install -g http-proxy</pre>
58
- <p class="text-muted">then run the following command:</p>
59
- <pre>http-server -p 4001 --proxy="https://api.mailgun.net"</pre>
60
- <p class="text-muted">then load up this page from <a href="http://0.0.0.0:4001/examples/">0.0.0.0:4001/examples/</a></p>
61
- <p class="text-muted">Last but not least, enter your Mailgun private key below and click create client to fetch the domains for your account.</p>
62
-
63
- <form class="form-inline">
64
- <div class="form-group">
65
- <label class="sr-only" for="key">Password</label>
66
- <input ng-model="form.key" type="password" class="form-control" id="key" placeholder="key-xxxxxxxxxxxxxx">
67
- </div>
68
- <button type="submit" class="btn btn-danger" ng-click="setClient()">Create Client</button>
69
- </form>
70
- </div>
71
- </section>
72
-
73
- <div class="album text-muted">
74
- <div class="container">
75
- <div class="row">
76
- <div class="col-md-8 col-md-offset-2">
77
- <h1 class="display-1 text-center">Email example</h1>
78
- <hr>
79
- <form name="emailForm" novalidate="">
80
- <div class="form-group row">
81
- <label for="domains" class="col-sm-3 form-control-label">Sending Domain</label>
82
- <div class="col-sm-9">
83
- <select class="form-control" ng-change="updateDomain()" ng-model="emailForm.selectedDomain" id="domains" ng-options="item.name for item in domains"></select>
84
- </div>
85
- </div>
86
- <div class="form-group row">
87
- <label for="from" class="col-sm-3 form-control-label">From</label>
88
- <div class="col-sm-9">
89
- <input type="text" class="form-control" id="from" ng-model="emailForm.from" placeholder="you@example.com" novalidate>
90
- </div>
91
- </div>
92
- <div class="form-group row">
93
- <label for="to" class="col-sm-3 form-control-label">To</label>
94
- <div class="col-sm-9">
95
- <input type="text" class="form-control" ng-model="emailForm.to" id="to" placeholder="test@example.com" novalidate>
96
- </div>
97
- </div>
98
- <div class="form-group row">
99
- <label for="subject" class="col-sm-3 form-control-label">Subject</label>
100
- <div class="col-sm-9">
101
- <input type="text" class="form-control" ng-model="emailForm.subject" id="subject" placeholder="Mailgun Test" novalidate>
102
- </div>
103
- </div>
104
- <div class="form-group row">
105
- <label for="html" class="col-sm-3 form-control-label">HTML</label>
106
- <div class="col-sm-9">
107
- <textarea ng-model="emailForm.html" class="form-control" id="html" rows="3"></textarea>
108
- </div>
109
- </div>
110
- <div class="form-group row">
111
- <label for="text" class="col-sm-3 form-control-label">Text</label>
112
- <div class="col-sm-9">
113
- <textarea ng-model="emailForm.text" class="form-control" id="text" rows="3"></textarea>
114
- </div>
115
- </div>
116
- <div class="form-group row">
117
- <label for="inline" class="col-sm-3 form-control-label">Inline Media</label>
118
- <div class="col-sm-9">
119
- <input type="file" class="form-control-file sr-only" id="inline" file-model="emailForm.inline" multiple>
120
- <label for="inline" class="filedropper" dropper-model="emailForm.inline">
121
- Drop Inline Images Here
122
- </label>
123
- <span ng-if="emailForm.inline.length > 0"><small>Use the following in the html section:</small></span>
124
- <span ng-repeat="f in emailForm.inline"><br><small><code>&lt;img src=&quot;cid:{{f.name}}&quot; width=&quot;200px&quot;&gt;</code></small></span>
125
- </div>
126
- </div>
127
- <div class="form-group row">
128
- <label for="attachment" class="col-sm-3 form-control-label">Attachments</label>
129
- <div class="col-sm-9">
130
- <input type="file" class="form-control-file sr-only" id="attachment" file-model="emailForm.attachment" multiple>
131
- <label for="attachment" class="filedropper" dropper-model="emailForm.attachment">
132
- Drop Attachments Here
133
- </label>
134
- <span ng-repeat="f in emailForm.attachment"><br><small>{{f.name}}</small></span>
135
- </div>
136
- </div>
137
- <div class="form-group row">
138
- <div class="col-sm-push-3 col-sm-9">
139
- <button type="submit" class="btn btn-danger" ng-click="sendEmail()" ng-disabled="btnDisabled">Send Email</button>
140
- </div>
141
- </div>
142
- <hr>
143
- <p>
144
- Response:
145
- </p>
146
- <pre><code>{{ response | json }}</code></pre>
147
-
148
- </form>
149
- </div>
150
- </div>
151
- </div>
152
- </div>
153
-
154
- <footer class="text-muted">
155
- <div class="container text-center">
156
- <p><a href="https://github.com/mailgun/mailgun-js">https://github.com/mailgun/mailgun-js</a></p>
157
- </div>
158
- </footer>
159
- <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular.min.js"></script>
160
- <script src="../dist/mailgun.js" charset="utf-8"></script>
161
- <script type="text/javascript">
162
- var app = angular.module("app", []);
163
-
164
- app.directive('fileModel', ['$parse', function ($parse) {
165
- return {
166
- restrict: 'A',
167
- link: function(scope, element, attrs) {
168
- var model = $parse(attrs.fileModel);
169
- var modelSetter = model.assign;
170
-
171
- element.bind('change', function(){
172
- var files = []
173
-
174
- for (var i = 0; i < element[0].files.length; i++) {
175
- files.push(element[0].files[i]);
176
- }
177
-
178
- scope.$apply(function(){
179
- modelSetter(scope, files);
180
- });
181
- });
182
- }
183
- };
184
- }]);
185
-
186
- app.directive('dropperModel', ['$parse', function ($parse) {
187
- return {
188
- restrict: 'A',
189
- link: function(scope, element, attrs) {
190
- var model = $parse(attrs.dropperModel);
191
- var modelSetter = model.assign;
192
-
193
- function drop(e){
194
- e.stopPropagation();
195
- e.preventDefault();
196
-
197
- var files = []
198
-
199
- for (var i = 0; i < e.dataTransfer.files.length; i++) {
200
- files.push(e.dataTransfer.files[i]);
201
- }
202
-
203
- scope.$apply(function(){
204
- modelSetter(scope, files);
205
- });
206
- }
207
-
208
- function dragover(e) {
209
- e.stopPropagation();
210
- e.preventDefault();
211
- e.dataTransfer.dropEffect = 'copy';
212
- }
213
-
214
- element[0].addEventListener('dragover', dragover, false);
215
- element[0].addEventListener('drop', drop, false);
216
- }
217
- };
218
- }]);
219
-
220
- app.controller("MainCtrl", function($scope) {
221
- $scope.mg = null;
222
- $scope.domains = [];
223
- $scope.form = {
224
- key: ''
225
- };
226
-
227
- $scope.emailForm = $scope.emailForm || {};
228
- $scope.emailForm.subject = 'Hello from Mailgun!';
229
-
230
- $scope.setClient = function() {
231
- if($scope.form.key){
232
- $scope.mg = mailgun.client({url: 'http://0.0.0.0:4001', username: 'api', key: $scope.form.key});
233
- }
234
-
235
- $scope.mg.domains.list()
236
- .then(domains => {
237
- $scope.domains = domains;
238
- $scope.emailForm.selectedDomain = $scope.domains[0];
239
- $scope.updateDomain();
240
- $scope.$apply();
241
- })
242
- .catch(err => console.log(err));
243
- };
244
-
245
- $scope.updateDomain = function(){
246
- if($scope.emailForm.selectedDomain){
247
- $scope.emailForm.from = 'Excited User <mailgun@' + $scope.emailForm.selectedDomain.name + '>';
248
- }
249
- }
250
-
251
- $scope.sendEmail = function() {
252
- if(!$scope.mg && !$scope.emailForm.selectedDomain){
253
- return false;
254
- }
255
-
256
- $scope.btnDisabled = true;
257
-
258
- var data = {
259
- to: $scope.emailForm.to,
260
- from: $scope.emailForm.from,
261
- subject: $scope.emailForm.subject,
262
- html: $scope.emailForm.html,
263
- text: $scope.emailForm.text,
264
- inline: $scope.emailForm.inline,
265
- attachment: $scope.emailForm.attachment
266
- };
267
-
268
- var domain = $scope.emailForm.selectedDomain.name;
269
-
270
- $scope.mg.messages.create(domain, data)
271
- .then(response => {
272
- $scope.response = response;
273
- $scope.btnDisabled = false;
274
- $scope.$apply();
275
- })
276
- .catch(err => {
277
- $scope.btnDisabled = false;
278
- $scope.response = err;
279
- $scope.$apply();
280
- })
281
- };
282
- });
283
- </script>
284
- </body>
285
- </html>
@@ -1,8 +0,0 @@
1
- /* eslint-disable no-console */
2
- const mailgun = require('../lib/index');
3
-
4
- const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY || '' });
5
-
6
- mg.domains.list()
7
- .then((domains) => console.log(domains))
8
- .catch((err) => console.log(err));
Binary file
Binary file
@@ -1,24 +0,0 @@
1
- /* eslint-disable no-console */
2
- const fs = require('fs');
3
- const mailgun = require('../index');
4
-
5
- const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY || '', timeout: 60000 });
6
-
7
- const domain = 'sandbox-123.mailgun.com';
8
- const fromEmail = 'Excited User <mailgun@sandbox-123.mailgun.com>';
9
- const toEmails = ['you@example.com'];
10
-
11
- const mailgunLogo = fs.createReadStream(`${__dirname}/mailgun.png`);
12
- const rackspaceLogo = fs.createReadStream(`${__dirname}/rackspace.png`);
13
-
14
- mg.messages.create(domain, {
15
- from: fromEmail,
16
- to: toEmails,
17
- subject: 'Hello',
18
- html: '<img src="cid:mailgun.png" width="200px"><br><h3>Testing some Mailgun awesomness!</h3>',
19
- text: 'Testing some Mailgun awesomness!',
20
- inline: [mailgunLogo],
21
- attachment: [rackspaceLogo]
22
- })
23
- .then((msg) => console.log(msg))
24
- .catch((err) => console.log(err));
package/lib/client.ts DELETED
@@ -1,79 +0,0 @@
1
- /* eslint-disable camelcase */
2
- import Request from './request';
3
- import Options from './interfaces/Options';
4
- import RequestOptions from './interfaces/RequestOptions';
5
-
6
- import DomainClient from './domains';
7
- import EventClient from './events';
8
- import StatsClient from './stats';
9
- import SuppressionClient from './suppressions';
10
- import WebhookClient from './webhooks';
11
- import MessagesClient from './messages';
12
- import RoutesClient from './routes';
13
- import ValidateClient from './validate';
14
- import IpsClient from './ips';
15
- import IpPoolsClient from './ip-pools';
16
- import ListsClient from './lists';
17
- import MailListsMembers from './mailListMembers';
18
- import { InputFormData } from './interfaces/IFormData';
19
- import DomainCredentialsClient from './domainsCredentials';
20
- import MultipleValidationClient from './multipleValidation';
21
- import DomainTemplatesClient from './domainsTemplates';
22
- import DomainTagsClient from './domainsTags';
23
-
24
- export default class Client {
25
- private request;
26
-
27
- public domains;
28
- public webhooks;
29
- public events;
30
- public stats;
31
- public suppressions;
32
- public messages;
33
- public routes;
34
- public validate;
35
- public ips;
36
- public ip_pools;
37
- public lists;
38
-
39
- constructor(options: Options, formData: InputFormData) {
40
- const config: RequestOptions = { ...options } as RequestOptions;
41
-
42
- if (!config.url) {
43
- config.url = 'https://api.mailgun.net';
44
- }
45
-
46
- if (!config.username) {
47
- throw new Error('Parameter "username" is required');
48
- }
49
-
50
- if (!config.key) {
51
- throw new Error('Parameter "key" is required');
52
- }
53
-
54
- /** @internal */
55
- this.request = new Request(config, formData);
56
- const mailListsMembers = new MailListsMembers(this.request);
57
- const domainCredentialsClient = new DomainCredentialsClient(this.request);
58
- const domainTemplatesClient = new DomainTemplatesClient(this.request);
59
- const domainTagsClient = new DomainTagsClient(this.request);
60
- const multipleValidationClient = new MultipleValidationClient(this.request);
61
-
62
- this.domains = new DomainClient(
63
- this.request,
64
- domainCredentialsClient,
65
- domainTemplatesClient,
66
- domainTagsClient
67
- );
68
- this.webhooks = new WebhookClient(this.request);
69
- this.events = new EventClient(this.request);
70
- this.stats = new StatsClient(this.request);
71
- this.suppressions = new SuppressionClient(this.request);
72
- this.messages = new MessagesClient(this.request);
73
- this.routes = new RoutesClient(this.request);
74
- this.ips = new IpsClient(this.request);
75
- this.ip_pools = new IpPoolsClient(this.request);
76
- this.lists = new ListsClient(this.request, mailListsMembers);
77
- this.validate = new ValidateClient(this.request, multipleValidationClient);
78
- }
79
- }
package/lib/domains.ts DELETED
@@ -1,224 +0,0 @@
1
- /* eslint-disable camelcase */
2
- import urljoin from 'url-join';
3
- import {
4
- DomainResponseData,
5
- DestroyedDomainResponse,
6
- DomainsQuery,
7
- DomainInfo,
8
- DomainListResponseData,
9
- DomainShortData,
10
- DNSRecord,
11
- ConnectionSettingsResponse,
12
- ConnectionSettings,
13
- UpdatedConnectionSettings,
14
- UpdatedConnectionSettingsRes,
15
- DKIMAuthorityInfo,
16
- UpdatedDKIMAuthority,
17
- UpdatedDKIMAuthorityResponse,
18
- DKIMSelectorInfo,
19
- UpdatedDKIMSelectorResponse,
20
- WebPrefixInfo,
21
- UpdatedWebPrefixResponse,
22
- ReplacementForPool,
23
- MessageResponse,
24
- } from './interfaces/Domains';
25
-
26
- import APIResponse from './interfaces/ApiResponse';
27
- import APIError from './error';
28
- import APIErrorOptions from './interfaces/APIErrorOptions';
29
-
30
- import Request from './request';
31
- import {
32
- DomainTrackingResponse,
33
- DomainTrackingData,
34
- OpenTrackingInfo,
35
- ClickTrackingInfo,
36
- UnsubscribeTrackingInfo,
37
- UpdateDomainTrackingResponse,
38
- UpdatedOpenTracking
39
- } from './interfaces/DomainTracking';
40
- import { IDomainCredentials } from './interfaces/DomainCredentials';
41
- import { IDomainTemplatesClient } from './interfaces/DomainTemplates';
42
- import DomainCredentialsClient from './domainsCredentials';
43
- import DomainTemplatesClient from './domainsTemplates';
44
- import { IDomainTagsClient } from './interfaces/DomainTags';
45
- import DomainTagsClient from './domainsTags';
46
-
47
- export class Domain {
48
- name: string;
49
- require_tls: boolean;
50
- skip_verification: boolean;
51
- state: string;
52
- wildcard: boolean;
53
- spam_action: string;
54
- created_at: string;
55
- smtp_password: string;
56
- smtp_login: string;
57
- type: string;
58
- receiving_dns_records: DNSRecord[] | null;
59
- sending_dns_records: DNSRecord[] | null;
60
-
61
- constructor(data: DomainShortData, receiving?: DNSRecord[] | null, sending?: DNSRecord[] | null) {
62
- this.name = data.name;
63
- this.require_tls = data.require_tls;
64
- this.skip_verification = data.skip_verification;
65
- this.state = data.state;
66
- this.wildcard = data.wildcard;
67
- this.spam_action = data.spam_action;
68
- this.created_at = data.created_at;
69
- this.smtp_password = data.smtp_password;
70
- this.smtp_login = data.smtp_login;
71
- this.type = data.type;
72
-
73
- this.receiving_dns_records = receiving || null;
74
- this.sending_dns_records = sending || null;
75
- }
76
- }
77
-
78
- export default class DomainClient {
79
- request: Request;
80
- public domainCredentials: IDomainCredentials;
81
- public domainTemplates: IDomainTemplatesClient;
82
- public domainTags: IDomainTagsClient;
83
-
84
- constructor(
85
- request: Request,
86
- domainCredentialsClient: DomainCredentialsClient,
87
- domainTemplatesClient: DomainTemplatesClient,
88
- domainTagsClient: DomainTagsClient
89
- ) {
90
- this.request = request;
91
- this.domainCredentials = domainCredentialsClient;
92
- this.domainTemplates = domainTemplatesClient;
93
- this.domainTags = domainTagsClient;
94
- }
95
-
96
- private _parseMessage(response: DestroyedDomainResponse) : MessageResponse {
97
- return response.body;
98
- }
99
-
100
- private _parseDomainList(response: DomainListResponseData): Domain[] {
101
- return response.body.items.map(function (item) {
102
- return new Domain(item);
103
- });
104
- }
105
-
106
- private _parseDomain(response: DomainResponseData): Domain {
107
- return new Domain(
108
- response.body.domain,
109
- response.body.receiving_dns_records,
110
- response.body.sending_dns_records
111
- );
112
- }
113
-
114
- private _parseTrackingSettings(response: DomainTrackingResponse) : DomainTrackingData {
115
- return response.body.tracking;
116
- }
117
-
118
- private _parseTrackingUpdate(response: UpdateDomainTrackingResponse) :UpdatedOpenTracking {
119
- return response.body;
120
- }
121
-
122
- list(query?: DomainsQuery): Promise<Domain[]> {
123
- return this.request.get('/v3/domains', query)
124
- .then((res : APIResponse) => this._parseDomainList(res as DomainListResponseData));
125
- }
126
-
127
- get(domain: string) : Promise<Domain> {
128
- return this.request.get(`/v3/domains/${domain}`)
129
- .then((res : APIResponse) => this._parseDomain(res as DomainResponseData));
130
- }
131
-
132
- create(data: DomainInfo) : Promise<Domain> {
133
- const postObj = { ...data };
134
- if ('force_dkim_authority' in postObj && typeof postObj.force_dkim_authority === 'boolean') {
135
- postObj.force_dkim_authority = postObj.toString() === 'true' ? 'true' : 'false';
136
- }
137
-
138
- return this.request.postWithFD('/v3/domains', postObj)
139
- .then((res : APIResponse) => this._parseDomain(res as DomainResponseData));
140
- }
141
-
142
- destroy(domain: string): Promise<MessageResponse> {
143
- return this.request.delete(`/v3/domains/${domain}`)
144
- .then((res : APIResponse) => this._parseMessage(res as DestroyedDomainResponse));
145
- }
146
-
147
- getConnection(domain: string): Promise<ConnectionSettings> {
148
- return this.request.get(`/v3/domains/${domain}/connection`)
149
- .then((res : APIResponse) => res as ConnectionSettingsResponse)
150
- .then((res:ConnectionSettingsResponse) => res.body.connection as ConnectionSettings);
151
- }
152
-
153
- updateConnection(domain: string, data: ConnectionSettings): Promise<UpdatedConnectionSettings> {
154
- return this.request.put(`/v3/domains/${domain}/connection`, data)
155
- .then((res : APIResponse) => res as UpdatedConnectionSettingsRes)
156
- .then((res:UpdatedConnectionSettingsRes) => res.body as UpdatedConnectionSettings);
157
- }
158
-
159
- // Tracking
160
-
161
- getTracking(domain: string) : Promise<DomainTrackingData> {
162
- return this.request.get(urljoin('/v3/domains', domain, 'tracking'))
163
- .then(this._parseTrackingSettings);
164
- }
165
-
166
- updateTracking(
167
- domain: string,
168
- type: string,
169
- data: OpenTrackingInfo | ClickTrackingInfo | UnsubscribeTrackingInfo
170
- ): Promise<UpdatedOpenTracking> {
171
- if (typeof data?.active === 'boolean') {
172
- throw new APIError({ status: 400, statusText: '', body: { message: 'Property "active" must contain string value.' } } as APIErrorOptions);
173
- }
174
- return this.request.putWithFD(urljoin('/v3/domains', domain, 'tracking', type), data)
175
- .then((res : APIResponse) => this._parseTrackingUpdate(res as UpdateDomainTrackingResponse));
176
- }
177
-
178
- // IPs
179
-
180
- getIps(domain: string): Promise<string[]> {
181
- return this.request.get(urljoin('/v3/domains', domain, 'ips'))
182
- .then((response: APIResponse) => response?.body?.items);
183
- }
184
-
185
- assignIp(domain: string, ip: string): Promise<APIResponse> {
186
- return this.request.postWithFD(urljoin('/v3/domains', domain, 'ips'), { ip });
187
- }
188
-
189
- deleteIp(domain: string, ip: string): Promise<APIResponse> {
190
- return this.request.delete(urljoin('/v3/domains', domain, 'ips', ip));
191
- }
192
-
193
- linkIpPool(domain: string, pool_id: string): Promise<APIResponse> {
194
- return this.request.postWithFD(urljoin('/v3/domains', domain, 'ips'), { pool_id });
195
- }
196
-
197
- unlinkIpPoll(domain: string, replacement: ReplacementForPool): Promise<APIResponse> {
198
- let searchParams = '';
199
- if (replacement.pool_id && replacement.ip) {
200
- throw new APIError({ status: 400, statusText: '', body: { message: 'Please specify either pool_id or ip (not both)' } } as APIErrorOptions);
201
- } else if (replacement.pool_id) {
202
- searchParams = `?pool_id=${replacement.pool_id}`;
203
- } else if (replacement.ip) {
204
- searchParams = `?ip=${replacement.ip}`;
205
- }
206
- return this.request.delete(urljoin('/v3/domains', domain, 'ips', 'ip_pool', searchParams));
207
- }
208
-
209
- updateDKIMAuthority(domain: string, data: DKIMAuthorityInfo): Promise<UpdatedDKIMAuthority> {
210
- return this.request.put(`/v3/domains/${domain}/dkim_authority`, {}, { query: `self=${data.self}` })
211
- .then((res : APIResponse) => res as UpdatedDKIMAuthorityResponse)
212
- .then((res : UpdatedDKIMAuthorityResponse) => res.body as UpdatedDKIMAuthority);
213
- }
214
-
215
- updateDKIMSelector(domain: string, data: DKIMSelectorInfo): Promise<UpdatedDKIMSelectorResponse> {
216
- return this.request.put(`/v3/domains/${domain}/dkim_selector`, {}, { query: `dkim_selector=${data.dkimSelector}` })
217
- .then((res : APIResponse) => res as UpdatedDKIMSelectorResponse);
218
- }
219
-
220
- updateWebPrefix(domain: string, data: WebPrefixInfo): Promise<UpdatedWebPrefixResponse> {
221
- return this.request.put(`/v3/domains/${domain}/web_prefix`, {}, { query: `web_prefix=${data.webPrefix}` })
222
- .then((res : APIResponse) => res as UpdatedWebPrefixResponse);
223
- }
224
- }