mailgun.js 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AMD/definitions.amd.js +48 -0
- package/AMD/mailgun.amd.js +2 -0
- package/CHANGELOG.md +39 -0
- package/CJS/definitions.cjs +46 -0
- package/CJS/mailgun.node.cjs +2 -0
- package/ESM/definitions.browser.js +44 -0
- package/ESM/definitions.node.js +44 -0
- package/ESM/mailgun.browser.js +2 -0
- package/ESM/mailgun.node.js +2 -0
- package/README.md +296 -148
- package/{Classes → Types/Classes}/Domains/domain.d.ts +1 -1
- package/{Classes → Types/Classes}/Domains/domainsClient.d.ts +15 -12
- package/{Classes → Types/Classes}/Domains/domainsCredentials.d.ts +3 -3
- package/{Classes → Types/Classes}/Domains/domainsTags.d.ts +5 -5
- package/{Classes → Types/Classes}/Domains/domainsTemplates.d.ts +4 -4
- package/Types/Classes/Domains/domainsTracking.d.ts +15 -0
- package/{Classes → Types/Classes}/Events.d.ts +4 -4
- package/{Classes → Types/Classes}/IPPools.d.ts +3 -3
- package/{Classes → Types/Classes}/IPs.d.ts +3 -3
- package/{Classes → Types/Classes}/InboxPlacements/AttributesClient.d.ts +3 -3
- package/{Classes → Types/Classes}/InboxPlacements/FiltersClient.d.ts +3 -3
- package/{Classes → Types/Classes}/InboxPlacements/Results/InboxPlacementsResultsClient.d.ts +4 -4
- package/{Classes → Types/Classes}/InboxPlacements/Results/InboxPlacementsResultsSharingClient.d.ts +3 -3
- package/{Classes → Types/Classes}/InboxPlacements/SeedsLists/SeedsListsClient.d.ts +4 -4
- package/{Classes → Types/Classes}/InboxPlacements/inboxPlacements.d.ts +3 -5
- package/{Classes → Types/Classes}/InboxPlacements/providers/InboxPlacementsProviders.d.ts +3 -3
- package/{Classes → Types/Classes}/MailgunClient.d.ts +4 -4
- package/{Classes → Types/Classes}/MailingLists/mailListMembers.d.ts +4 -4
- package/{Classes → Types/Classes}/MailingLists/mailingLists.d.ts +5 -5
- package/{Classes → Types/Classes}/Messages.d.ts +3 -3
- package/{Classes → Types/Classes}/Metrics/MetricsClient.d.ts +3 -4
- package/{Classes → Types/Classes}/Routes.d.ts +3 -3
- package/{Classes → Types/Classes}/Stats/StatsClient.d.ts +3 -4
- package/{Classes → Types/Classes}/Stats/StatsContainer.d.ts +2 -2
- package/{Classes → Types/Classes}/Subaccounts.d.ts +3 -3
- package/{Classes → Types/Classes}/Suppressions/Bounce.d.ts +3 -3
- package/Types/Classes/Suppressions/Complaint.d.ts +8 -0
- package/{Classes → Types/Classes}/Suppressions/Suppression.d.ts +1 -1
- package/{Classes → Types/Classes}/Suppressions/SuppressionsClient.d.ts +5 -5
- package/{Classes → Types/Classes}/Suppressions/Unsubscribe.d.ts +3 -3
- package/Types/Classes/Suppressions/WhiteList.d.ts +9 -0
- package/{Classes → Types/Classes}/Validations/multipleValidation.d.ts +4 -4
- package/{Classes → Types/Classes}/Validations/validate.d.ts +3 -3
- package/{Classes → Types/Classes}/Webhooks.d.ts +4 -4
- package/{Classes → Types/Classes}/common/AttachmentsHandler.d.ts +2 -2
- package/{Classes → Types/Classes}/common/Error.d.ts +1 -1
- package/{Classes → Types/Classes}/common/FormDataBuilder.d.ts +2 -2
- package/{Classes → Types/Classes}/common/NavigationThruPages.d.ts +4 -4
- package/{Classes → Types/Classes}/common/Request.d.ts +1 -1
- package/Types/Interfaces/Common/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/Domains/DomainCredentials.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/Domains/DomainTags.d.ts +2 -2
- package/{Interfaces → Types/Interfaces}/Domains/DomainTemplates.d.ts +1 -1
- package/Types/Interfaces/Domains/DomainTracking.d.ts +8 -0
- package/{Interfaces → Types/Interfaces}/Domains/DomainsClient.d.ts +7 -5
- package/Types/Interfaces/Domains/index.d.ts +5 -0
- package/{Interfaces → Types/Interfaces}/EventClient/IEventClient.d.ts +1 -1
- package/Types/Interfaces/EventClient/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/IPPools/IIPPoolsClient.d.ts +1 -1
- package/Types/Interfaces/IPPools/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/IPs/IIPsClient.d.ts +1 -1
- package/Types/Interfaces/IPs/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/InboxPlacements/AttributesClient.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/InboxPlacements/FiltersClient.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/InboxPlacements/InboxPlacementsClient.d.ts +4 -4
- package/{Interfaces → Types/Interfaces}/InboxPlacements/Results/InboxPlacementsResults.d.ts +4 -4
- package/{Interfaces → Types/Interfaces}/InboxPlacements/Results/InboxPlacementsResultsSharing.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/InboxPlacements/SeedsLists/SeedsListsClient.d.ts +3 -3
- package/Types/Interfaces/InboxPlacements/index.d.ts +7 -0
- package/{Interfaces → Types/Interfaces}/InboxPlacements/providers/InboxPlacementsProviders.d.ts +1 -1
- package/Types/Interfaces/MailgunClient/IMailgunClient.d.ts +34 -0
- package/Types/Interfaces/MailgunClient/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/MailingLists/MailingListMembers.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/MailingLists/MailingListsClient.d.ts +2 -2
- package/Types/Interfaces/MailingLists/index.d.ts +2 -0
- package/{Interfaces → Types/Interfaces}/Messages/IMessagesClient.d.ts +1 -1
- package/Types/Interfaces/Messages/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/Metrics/MetricsClient.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/Routes/IRoutesClient.d.ts +1 -1
- package/Types/Interfaces/Routes/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/Stats/StatsClient.d.ts +2 -2
- package/{Interfaces → Types/Interfaces}/Stats/StatsContainer.d.ts +1 -1
- package/Types/Interfaces/Stats/index.d.ts +2 -0
- package/{Interfaces → Types/Interfaces}/Subaccounts/ISubaccountsClient.d.ts +1 -1
- package/Types/Interfaces/Subaccounts/index.d.ts +1 -0
- package/{Interfaces → Types/Interfaces}/Suppressions/ISuppressionsClient.d.ts +5 -5
- package/Types/Interfaces/Suppressions/index.d.ts +5 -0
- package/{Interfaces → Types/Interfaces}/Validations/MultipleValidation.d.ts +1 -1
- package/{Interfaces → Types/Interfaces}/Validations/Validation.d.ts +2 -2
- package/Types/Interfaces/Validations/index.d.ts +2 -0
- package/{Interfaces → Types/Interfaces}/Webhooks/IWebHooksClient.d.ts +2 -2
- package/Types/Interfaces/Webhooks/index.d.ts +1 -0
- package/Types/Interfaces/index.d.ts +16 -0
- package/Types/{Common → Types/Common}/FormData.d.ts +1 -1
- package/Types/{Common → Types/Common}/RequestOptions.d.ts +1 -1
- package/Types/Types/Common/index.d.ts +6 -0
- package/Types/{Domains → Types/Domains}/DomainTags.d.ts +2 -2
- package/Types/{Domains → Types/Domains}/DomainTemplates.d.ts +3 -3
- package/Types/{Domains → Types/Domains}/DomainTracking.d.ts +16 -0
- package/Types/Types/Domains/index.d.ts +5 -0
- package/Types/{Events → Types/Events}/Events.d.ts +1 -1
- package/Types/Types/Events/index.d.ts +1 -0
- package/Types/Types/IPPools/index.d.ts +1 -0
- package/Types/Types/IPs/index.d.ts +1 -0
- package/Types/{InboxPlacements → Types/InboxPlacements}/Results/InboxPlacementsResults.d.ts +1 -1
- package/Types/{InboxPlacements → Types/InboxPlacements}/SeedsLists/SeedsLists.d.ts +1 -1
- package/Types/Types/InboxPlacements/index.d.ts +7 -0
- package/Types/Types/MailgunClient/index.d.ts +1 -0
- package/Types/{MailingLists → Types/MailingLists}/MailingListMembers.d.ts +2 -2
- package/Types/{MailingLists → Types/MailingLists}/MailingLists.d.ts +1 -1
- package/Types/Types/MailingLists/index.d.ts +2 -0
- package/Types/Types/Messages/index.d.ts +1 -0
- package/Types/{Metrics → Types/Metrics}/Metrics.d.ts +1 -1
- package/Types/{Metrics → Types/Metrics}/MetricsAPI.d.ts +1 -1
- package/Types/Types/Metrics/index.d.ts +2 -0
- package/Types/Types/Routes/index.d.ts +1 -0
- package/Types/Types/Stats/index.d.ts +1 -0
- package/Types/Types/Subaccounts/index.d.ts +1 -0
- package/Types/{Suppressions → Types/Suppressions}/Suppressions.d.ts +3 -3
- package/Types/Types/Suppressions/index.d.ts +5 -0
- package/Types/{Validations → Types/Validations}/MultipleValidation.d.ts +2 -2
- package/Types/Types/Validations/index.d.ts +2 -0
- package/Types/Types/Webhooks/index.d.ts +1 -0
- package/Types/Types/index.d.ts +15 -0
- package/Types/definitions.d.ts +3 -0
- package/Types/index.d.ts +8 -14
- package/Types/index.js +6578 -0
- package/package.json +38 -6
- package/version.md +1 -1
- package/Classes/Domains/domains.d.ts +0 -51
- package/Classes/InboxPlacements/Results/InboxPlacementsResultsClient.ts +0 -18
- package/Classes/InboxPlacements/Results/InboxPlacementsResultsSharing.ts +0 -10
- package/Classes/InboxPlacements/SeedsLists/AttributesClient.d.ts +0 -10
- package/Classes/InboxPlacements/SeedsLists/FiltersClient.d.ts +0 -8
- package/Classes/Suppressions/Complaint.d.ts +0 -8
- package/Classes/Suppressions/WhiteList.d.ts +0 -9
- package/Interfaces/Common/index.d.ts +0 -1
- package/Interfaces/Domains/index.d.ts +0 -4
- package/Interfaces/EventClient/index.d.ts +0 -1
- package/Interfaces/IPPools/index.d.ts +0 -1
- package/Interfaces/IPs/index.d.ts +0 -1
- package/Interfaces/InboxPlacements/Results/InboxPlacementsResultsClient.d.ts +0 -8
- package/Interfaces/InboxPlacements/SeedsLists/AttributesClient.d.ts +0 -5
- package/Interfaces/InboxPlacements/SeedsLists/FiltersClient.d.ts +0 -4
- package/Interfaces/InboxPlacements/index.d.ts +0 -6
- package/Interfaces/MailgunClient/IMailgunClient.d.ts +0 -32
- package/Interfaces/MailgunClient/index.d.ts +0 -1
- package/Interfaces/MailingLists/index.d.ts +0 -2
- package/Interfaces/Messages/index.d.ts +0 -1
- package/Interfaces/Routes/index.d.ts +0 -1
- package/Interfaces/Stats/index.d.ts +0 -2
- package/Interfaces/Subaccounts/index.d.ts +0 -1
- package/Interfaces/Suppressions/index.d.ts +0 -5
- package/Interfaces/Validations/index.d.ts +0 -2
- package/Interfaces/Webhooks/index.d.ts +0 -1
- package/Interfaces/index.d.ts +0 -15
- package/Types/Common/index.d.ts +0 -5
- package/Types/Domains/index.d.ts +0 -5
- package/Types/Events/index.d.ts +0 -1
- package/Types/IPPools/index.d.ts +0 -1
- package/Types/IPs/index.d.ts +0 -1
- package/Types/InboxPlacements/InboxPlacementsClient.d.ts +0 -0
- package/Types/InboxPlacements/index.d.ts +0 -7
- package/Types/MailgunClient/index.d.ts +0 -1
- package/Types/MailingLists/index.d.ts +0 -2
- package/Types/Messages/index.d.ts +0 -1
- package/Types/Metrics/index.d.ts +0 -2
- package/Types/Routes/index.d.ts +0 -1
- package/Types/Stats/index.d.ts +0 -1
- package/Types/Subaccounts/index.d.ts +0 -1
- package/Types/Suppressions/index.d.ts +0 -5
- package/Types/Validations/index.d.ts +0 -2
- package/Types/Webhooks/index.d.ts +0 -1
- package/index.d.ts +0 -11
- package/mailgun.node.js +0 -3
- package/mailgun.node.js.LICENSE.txt +0 -17
- package/mailgun.web.js +0 -3
- package/mailgun.web.js.LICENSE.txt +0 -3
- /package/{Enums → Types/Enums}/index.d.ts +0 -0
- /package/{Interfaces → Types/Interfaces}/Common/Logger.d.ts +0 -0
- /package/{Interfaces → Types/Interfaces}/Suppressions/Bounce.d.ts +0 -0
- /package/{Interfaces → Types/Interfaces}/Suppressions/Complaint.d.ts +0 -0
- /package/{Interfaces → Types/Interfaces}/Suppressions/Unsubscribe.d.ts +0 -0
- /package/{Interfaces → Types/Interfaces}/Suppressions/WhiteList.d.ts +0 -0
- /package/Types/{Common → Types/Common}/ApiResponse.d.ts +0 -0
- /package/Types/{Common → Types/Common}/Attachments.d.ts +0 -0
- /package/Types/{Common → Types/Common}/Error.d.ts +0 -0
- /package/Types/{Common → Types/Common}/NavigationThruPages.d.ts +0 -0
- /package/Types/{Domains → Types/Domains}/DomainCredentials.d.ts +0 -0
- /package/Types/{Domains → Types/Domains}/Domains.d.ts +0 -0
- /package/Types/{IPPools → Types/IPPools}/IpPools.d.ts +0 -0
- /package/Types/{IPs → Types/IPs}/IPs.d.ts +0 -0
- /package/Types/{InboxPlacements → Types/InboxPlacements}/Attributes.d.ts +0 -0
- /package/Types/{InboxPlacements → Types/InboxPlacements}/Filters.d.ts +0 -0
- /package/Types/{InboxPlacements → Types/InboxPlacements}/InboxPlacements.d.ts +0 -0
- /package/Types/{InboxPlacements → Types/InboxPlacements}/Results/InboxPlacementsResultsSharing.d.ts +0 -0
- /package/Types/{InboxPlacements → Types/InboxPlacements}/providers/InboxPlacementsProviders.d.ts +0 -0
- /package/Types/{MailgunClient → Types/MailgunClient}/MailgunClientOptions.d.ts +0 -0
- /package/Types/{Messages → Types/Messages}/Messages.d.ts +0 -0
- /package/Types/{Routes → Types/Routes}/Routes.d.ts +0 -0
- /package/Types/{Stats → Types/Stats}/Stats.d.ts +0 -0
- /package/Types/{Subaccounts → Types/Subaccounts}/Subaccounts.d.ts +0 -0
- /package/Types/{Suppressions → Types/Suppressions}/Bounce.d.ts +0 -0
- /package/Types/{Suppressions → Types/Suppressions}/Complaint.d.ts +0 -0
- /package/Types/{Suppressions → Types/Suppressions}/Unsubscribe.d.ts +0 -0
- /package/Types/{Suppressions → Types/Suppressions}/WhiteList.d.ts +0 -0
- /package/Types/{Validations → Types/Validations}/Validation.d.ts +0 -0
- /package/Types/{Webhooks → Types/Webhooks}/Webhooks.d.ts +0 -0
package/README.md
CHANGED
|
@@ -38,31 +38,94 @@ npm install mailgun.js
|
|
|
38
38
|
|
|
39
39
|
## Setup Client
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
The next step is to import the module and instantiate a mailgun client by calling `new Mailgun(formData)` and then using `mailgun.client` setup the client with basic auth credentials `(username: 'api', key: 'key-yourkeyhere')`.
|
|
42
42
|
|
|
43
|
-
NOTE: starting from version 3.0 you need to pass FormData (we need this to keep library universal). For node.js you can use `form-data` library.
|
|
43
|
+
NOTE: starting from version 3.0 you need to pass FormData (we need this to keep library universal). For node.js you can use built-in FormData or `form-data` library.
|
|
44
44
|
|
|
45
|
-
IMPORTANT
|
|
45
|
+
**IMPORTANT**: if you are using EU infrastructure, you need to also pass `url: 'https://api.eu.mailgun.net'` together with auth credentials as stated in [Mailgun docs](https://documentation.mailgun.com/en/latest/quickstart-sending.html#send-via-api)
|
|
46
46
|
|
|
47
47
|
### Imports
|
|
48
48
|
Once the package is installed, you can import the library using `import` or `require` approach:
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
|
-
const formData = require('form-data');
|
|
51
|
+
const formData = require('form-data'); // or built-in FormData
|
|
52
52
|
const Mailgun = require('mailgun.js');
|
|
53
53
|
const mailgun = new Mailgun(formData);
|
|
54
54
|
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
|
|
55
55
|
```
|
|
56
56
|
```js
|
|
57
|
-
import FormData from 'form-data';
|
|
57
|
+
import FormData from 'form-data'; // or built-in FormData
|
|
58
58
|
import Mailgun from 'mailgun.js';
|
|
59
59
|
const mailgun = new Mailgun(FormData);
|
|
60
60
|
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
|
|
61
61
|
```
|
|
62
|
+
|
|
63
|
+
Be aware that there are four bundles available for usage. All of them are conditionally exported by package.json and separated by environment (Browser/Node.js):
|
|
64
|
+
- Node.js environment:
|
|
65
|
+
- CommonJS ([CJS](https://nodejs.org/api/modules.html#modules-commonjs-modules)), a bundle to use with the CommonJS module system in Node.js.
|
|
66
|
+
|
|
67
|
+
Usage example:
|
|
68
|
+
|
|
69
|
+
``` JS
|
|
70
|
+
// In this case, the .dist/CJS/mailgun.node.cjs file is expected to be used
|
|
71
|
+
const Mailgun = require('mailgun.js');
|
|
72
|
+
const mailgun = new Mailgun(FormData);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- ECMAScript modules ([ESM](https://nodejs.org/download/release/v18.11.0/docs/api/esm.html#modules-ecmascript-modules)) a bundle for the **Node.js** environment
|
|
76
|
+
|
|
77
|
+
Usage example:
|
|
78
|
+
``` JS
|
|
79
|
+
// In this case, the .dist/ESM/mailgun.node.js file is expected to be used
|
|
80
|
+
import Mailgun from 'mailgun.js';
|
|
81
|
+
const mailgun = new Mailgun(FormData);
|
|
82
|
+
...
|
|
83
|
+
```
|
|
84
|
+
or with dynamic imports:
|
|
85
|
+
``` JS
|
|
86
|
+
// In this case, the .dist/ESM/mailgun.node.js file is expected to be used
|
|
87
|
+
const Mailgun = await import('mailgun.js');
|
|
88
|
+
const mailgun = new Mailgun.default(FormData);
|
|
89
|
+
...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- Browser environment:
|
|
93
|
+
- Asynchronous Module Definition ([AMD](https://github.com/amdjs/amdjs-api/wiki/AMD)), a bundle to use with the `Require.js` module loader in the browser. This bundle requires the RequireJS module loader to be present in the environment.
|
|
94
|
+
|
|
95
|
+
Usage example for the case when the distribution is used directly in the browser:
|
|
96
|
+
``` HTML
|
|
97
|
+
<script src='http://requirejs.org/docs/release/2.3.6/comments/require.js'></script>
|
|
98
|
+
<script>
|
|
99
|
+
require(['./dist/AMD/mailgun.amd.js'], function(Mailgun) {
|
|
100
|
+
const mailgun = new Mailgun(FormData);
|
|
101
|
+
...
|
|
102
|
+
})
|
|
103
|
+
</script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- ECMAScript modules ([ESM](https://nodejs.org/download/release/v18.11.0/docs/api/esm.html#modules-ecmascript-modules)) a bundle for **browser** environment.
|
|
107
|
+
|
|
108
|
+
Usage example for the case the distribution is used directly in the browser:
|
|
109
|
+
``` HTML
|
|
110
|
+
<script type="module">
|
|
111
|
+
import Mailgun from './dist/ESM/mailgun.browser.js';
|
|
112
|
+
const mailgun = new Mailgun(FormData);
|
|
113
|
+
...
|
|
114
|
+
</script>
|
|
115
|
+
```
|
|
116
|
+
or with dynamic imports:
|
|
117
|
+
``` HTML
|
|
118
|
+
<script>
|
|
119
|
+
import ('./dist/ESM/mailgun.browser.js').then(Mailgun =>{
|
|
120
|
+
const mailgun = new Mailgun.default(FormData);
|
|
121
|
+
...
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
124
|
+
```
|
|
62
125
|
### Using Subaccounts
|
|
63
126
|
Primary accounts can make API calls on behalf of their subaccounts. [API documentation](https://documentation.mailgun.com/en/latest/subaccounts.html#subaccounts)
|
|
64
127
|
```js
|
|
65
|
-
import FormData from 'form-data';
|
|
128
|
+
import FormData from 'form-data'; // or built-in FormData
|
|
66
129
|
import Mailgun from 'mailgun.js';
|
|
67
130
|
const mailgun = new Mailgun(FormData);
|
|
68
131
|
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
|
|
@@ -75,7 +138,7 @@ Primary accounts can make API calls on behalf of their subaccounts. [API documen
|
|
|
75
138
|
By leveraging client configuration options, users can effortlessly establish proxy connections that align with their network requirements.
|
|
76
139
|
Ex:
|
|
77
140
|
```js
|
|
78
|
-
import FormData from 'form-data';
|
|
141
|
+
import FormData from 'form-data'; // or built-in FormData
|
|
79
142
|
import Mailgun from 'mailgun.js';
|
|
80
143
|
const mailgun = new Mailgun(FormData);
|
|
81
144
|
|
|
@@ -94,15 +157,15 @@ Ex:
|
|
|
94
157
|
});
|
|
95
158
|
```
|
|
96
159
|
### Types imports
|
|
97
|
-
|
|
160
|
+
Types defined by SDK can be imported from 'definitions' submodule:
|
|
98
161
|
```TS
|
|
99
|
-
import
|
|
162
|
+
import { MailgunClientOptions, MessagesSendResult } from 'mailgun.js/definitions';
|
|
100
163
|
```
|
|
101
164
|
|
|
102
165
|
### Interfaces and Enums imports
|
|
103
|
-
|
|
166
|
+
Interfaces and Enums defined by SDK can be imported from 'definitions' submodule:
|
|
104
167
|
```TS
|
|
105
|
-
import
|
|
168
|
+
import { Interfaces, Enums } from 'mailgun.js/definitions';
|
|
106
169
|
...
|
|
107
170
|
const mailgunClient: Interfaces.IMailgunClient = mailgun.client(clientOptions);
|
|
108
171
|
const yes = Enums.YesNo.YES;
|
|
@@ -149,8 +212,14 @@ The following service methods are available to instantiated clients. The example
|
|
|
149
212
|
- [createVersion](#createversion)
|
|
150
213
|
- [updateVersion](#updateversion)
|
|
151
214
|
- [destroyVersion](#destroyversion)
|
|
152
|
-
- [
|
|
215
|
+
- [domain tracking](#domain-tracking)
|
|
216
|
+
- [getTracking](#gettracking-1)
|
|
217
|
+
- [updateTracking](#updatetracking-1)
|
|
153
218
|
- [get](#get-2)
|
|
219
|
+
- [generate](#generate)
|
|
220
|
+
- [regenerate](#regenerate)
|
|
221
|
+
- [events](#events)
|
|
222
|
+
- [get](#get-3)
|
|
154
223
|
- [Example with Date and *Filter field*](#example-with-date-and-filter-field)
|
|
155
224
|
- [stats](#stats)
|
|
156
225
|
- [Stats Options](#stats-options)
|
|
@@ -164,7 +233,7 @@ The following service methods are available to instantiated clients. The example
|
|
|
164
233
|
- [Bounces Example](#bounces-example)
|
|
165
234
|
- [Unsubscribes Example](#unsubscribes-example)
|
|
166
235
|
- [Complaints Example](#complaints-example)
|
|
167
|
-
- [get](#get-
|
|
236
|
+
- [get](#get-4)
|
|
168
237
|
- [Bounces Example](#bounces-example-1)
|
|
169
238
|
- [Unsubscribes Example](#unsubscribes-example-1)
|
|
170
239
|
- [Complaints Example](#complaints-example-1)
|
|
@@ -180,26 +249,26 @@ The following service methods are available to instantiated clients. The example
|
|
|
180
249
|
- [Complaints Example](#complaints-example-3)
|
|
181
250
|
- [webhooks](#webhooks)
|
|
182
251
|
- [list](#list-3)
|
|
183
|
-
- [get](#get-
|
|
252
|
+
- [get](#get-5)
|
|
184
253
|
- [create](#create-4)
|
|
185
254
|
- [update](#update-2)
|
|
186
255
|
- [destroy](#destroy-3)
|
|
187
256
|
- [routes](#routes)
|
|
188
257
|
- [list](#list-4)
|
|
189
|
-
- [get](#get-
|
|
258
|
+
- [get](#get-6)
|
|
190
259
|
- [create](#create-5)
|
|
191
260
|
- [update](#update-3)
|
|
192
261
|
- [destroy](#destroy-4)
|
|
193
262
|
- [validate](#validate)
|
|
194
|
-
- [get](#get-
|
|
263
|
+
- [get](#get-7)
|
|
195
264
|
- [multiple validation](#multiple-validation)
|
|
196
265
|
- [create](#create-6)
|
|
197
266
|
- [list](#list-5)
|
|
198
|
-
- [get](#get-
|
|
267
|
+
- [get](#get-8)
|
|
199
268
|
- [destroy](#destroy-5)
|
|
200
269
|
- [mailing lists](#mailing-lists)
|
|
201
270
|
- [list](#list-6)
|
|
202
|
-
- [get](#get-
|
|
271
|
+
- [get](#get-9)
|
|
203
272
|
- [create](#create-7)
|
|
204
273
|
- [update](#update-4)
|
|
205
274
|
- [destroy](#destroy-6)
|
|
@@ -212,36 +281,36 @@ The following service methods are available to instantiated clients. The example
|
|
|
212
281
|
- [destroyMember](#destroymember)
|
|
213
282
|
- [subaccounts](#subaccounts)
|
|
214
283
|
- [list](#list-7)
|
|
215
|
-
- [get](#get-
|
|
284
|
+
- [get](#get-10)
|
|
216
285
|
- [create](#create-8)
|
|
217
286
|
- [enable](#enable)
|
|
218
287
|
- [disable](#disable)
|
|
219
288
|
- [inbox placements](#inbox-placements)
|
|
220
289
|
- [SeedsLists](#seedslists)
|
|
221
290
|
- [list](#list-8)
|
|
222
|
-
- [get](#get-
|
|
291
|
+
- [get](#get-11)
|
|
223
292
|
- [create](#create-9)
|
|
224
293
|
- [update](#update-5)
|
|
225
294
|
- [destroy](#destroy-7)
|
|
226
295
|
- [SeedsLists Attributes](#attributes)
|
|
227
296
|
- [list](#list-9)
|
|
228
|
-
- [get](#get-
|
|
297
|
+
- [get](#get-12)
|
|
229
298
|
- [SeedsLists Filters](#filters)
|
|
230
299
|
- [list](#list-10)
|
|
231
300
|
- [Providers](#providers)
|
|
232
301
|
- [list](#list-11)
|
|
233
302
|
- [Results](#results)
|
|
234
303
|
- [list](#list-12)
|
|
235
|
-
- [get](#get-
|
|
304
|
+
- [get](#get-13)
|
|
236
305
|
- [destroy](#destroy-8)
|
|
237
306
|
- [getResultByShareId](#getresultbyshareid)
|
|
238
307
|
- [Results Attributes](#attributes-1)
|
|
239
308
|
- [list](#list-13)
|
|
240
|
-
- [get](#get-
|
|
309
|
+
- [get](#get-14)
|
|
241
310
|
- [Results Filters](#filters-1)
|
|
242
311
|
- [list](#list-14)
|
|
243
312
|
- [Sharing](#sharing)
|
|
244
|
-
- [get](#get-
|
|
313
|
+
- [get](#get-15)
|
|
245
314
|
- [update](#update-6)
|
|
246
315
|
- [Run Test](#run-test)
|
|
247
316
|
- [Navigation thru lists](#navigation-thru-lists)
|
|
@@ -906,133 +975,11 @@ The following service methods are available to instantiated clients. The example
|
|
|
906
975
|
}
|
|
907
976
|
```
|
|
908
977
|
|
|
909
|
-
|
|
910
978
|
- #### getTracking
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
`mg.domains.getTracking(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking)
|
|
914
|
-
|
|
915
|
-
Example:
|
|
916
|
-
|
|
917
|
-
```JS
|
|
918
|
-
mg.domains.getTracking('foobar.example.com')
|
|
919
|
-
.then(msg => console.log(msg)) // logs response data
|
|
920
|
-
.catch(err => console.error(err)); // logs any error
|
|
921
|
-
```
|
|
922
|
-
|
|
923
|
-
Promise returns:
|
|
924
|
-
|
|
925
|
-
```JS
|
|
926
|
-
{
|
|
927
|
-
"click": {
|
|
928
|
-
"active": false
|
|
929
|
-
},
|
|
930
|
-
"open": {
|
|
931
|
-
"active": false
|
|
932
|
-
},
|
|
933
|
-
"unsubscribe": {
|
|
934
|
-
"active": false,
|
|
935
|
-
"html_footer": "\n<br>\n<p><a href=\"%unsubscribe_url%\">unsubscribe</a></p>\n",
|
|
936
|
-
"text_footer": "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n"
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
```
|
|
979
|
+
`domains.getTracking` method is deprecated, and will be removed. Please use `domains.domainTracking.getTracking` instead.
|
|
940
980
|
|
|
941
981
|
- #### updateTracking
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
`mg.domains.updateTracking(domain, trackingType, data)`
|
|
945
|
-
|
|
946
|
-
- Open Tracking Example:
|
|
947
|
-
|
|
948
|
-
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-open)
|
|
949
|
-
```js
|
|
950
|
-
mg.domains.updateTracking('foobar.example.com', 'open', {
|
|
951
|
-
active: true,
|
|
952
|
-
place_at_the_top: true,
|
|
953
|
-
})
|
|
954
|
-
.then(msg => console.log(msg)) // logs response data
|
|
955
|
-
.catch(err => console.error(err)); // logs any error
|
|
956
|
-
```
|
|
957
|
-
|
|
958
|
-
Open tracking data object properties:
|
|
959
|
-
|
|
960
|
-
| Property | Description |
|
|
961
|
-
|:----------|:-------------------------------------------|
|
|
962
|
-
| active | Boolean, enables or disables open tracking |
|
|
963
|
-
| place_at_the_top| Setting this param to true will place the open tracking pixel at the top of the HTML body when inserted into the email mime. Omit this param to keep current setting. |
|
|
964
|
-
|
|
965
|
-
Promise returns:
|
|
966
|
-
|
|
967
|
-
```JS
|
|
968
|
-
{
|
|
969
|
-
message: 'Tracking settings have been updated',
|
|
970
|
-
open: {
|
|
971
|
-
active: true,
|
|
972
|
-
place_at_the_top: true,
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
```
|
|
976
|
-
|
|
977
|
-
- Click Tracking Example:
|
|
978
|
-
|
|
979
|
-
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-click)
|
|
980
|
-
```JS
|
|
981
|
-
mg.domains.updateTracking('foobar.example.com', 'click', {active: true})
|
|
982
|
-
.then(msg => console.log(msg)) // logs response data
|
|
983
|
-
.catch(err => console.error(err)); // logs any error
|
|
984
|
-
```
|
|
985
|
-
|
|
986
|
-
Click tracking data object properties:
|
|
987
|
-
|
|
988
|
-
| Property | Description |
|
|
989
|
-
|:----------|:--------------------------------------------|
|
|
990
|
-
| active | Boolean, enables or disables click tracking |
|
|
991
|
-
|
|
992
|
-
Promise returns:
|
|
993
|
-
|
|
994
|
-
```JS
|
|
995
|
-
{
|
|
996
|
-
message: 'Tracking settings have been updated',
|
|
997
|
-
click: {
|
|
998
|
-
active: true
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
```
|
|
1002
|
-
|
|
1003
|
-
- Unsubscribe Tracking Example
|
|
1004
|
-
|
|
1005
|
-
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-unsubscribe)
|
|
1006
|
-
```js
|
|
1007
|
-
mg.domains.updateTracking('foobar.example.com', 'unsubscribe', {
|
|
1008
|
-
active: true,
|
|
1009
|
-
html_footer: "\n<br>\n<p><a href=\"%unsubscribe_url%\">unsubscribe</a></p>\n",
|
|
1010
|
-
text_footer: "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n"
|
|
1011
|
-
})
|
|
1012
|
-
.then(msg => console.log(msg)) // logs response data
|
|
1013
|
-
.catch(err => console.error(err)); // logs any error
|
|
1014
|
-
```
|
|
1015
|
-
|
|
1016
|
-
Unsubscribe Tracking data object properties:
|
|
1017
|
-
|
|
1018
|
-
| Property | Description |
|
|
1019
|
-
|:------------|:--------------------------------------------------------------|
|
|
1020
|
-
| active | Boolean, enables or disables unsubscribe tracking |
|
|
1021
|
-
| html_footer | string appended to html emails for managing unsubscribe links |
|
|
1022
|
-
| text_footer | string appended to html emails for managing unsubscribe links |
|
|
1023
|
-
|
|
1024
|
-
Promise returns:
|
|
1025
|
-
|
|
1026
|
-
```JS
|
|
1027
|
-
{
|
|
1028
|
-
message: 'Tracking settings have been updated',
|
|
1029
|
-
unsubscribe: {
|
|
1030
|
-
active: true,
|
|
1031
|
-
html_footer: '\n<br>\n<p><a href=\'%unsubscribe_url%\">unsubscribe</a></p>\n',
|
|
1032
|
-
text_footer: '\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n'
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
```
|
|
982
|
+
`domains.updateTracking` method is deprecated, and will be removed. Please use `domains.domainTracking.updateTracking` instead.
|
|
1036
983
|
|
|
1037
984
|
- #### getConnection
|
|
1038
985
|
Returns domain's delivery connection settings.
|
|
@@ -1644,6 +1591,207 @@ The following service methods are available to instantiated clients. The example
|
|
|
1644
1591
|
}
|
|
1645
1592
|
```
|
|
1646
1593
|
|
|
1594
|
+
### Domain tracking
|
|
1595
|
+
|
|
1596
|
+
- #### getTracking
|
|
1597
|
+
|
|
1598
|
+
Mailgun offers tracking for clicks, unsubscribes, and opens, with optional HTTPS protocol support on tracking URLs. To enable HTTPS, Mailgun uses Let’s Encrypt with HTTP-01 challenges through your existing tracking CNAME record to issue a TLS certificate. This setup also includes support for HTTP Strict Transport Security (HSTS) for enhanced security.
|
|
1599
|
+
|
|
1600
|
+
`mg.domains.domainTracking.getTracking(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking)
|
|
1601
|
+
|
|
1602
|
+
Example:
|
|
1603
|
+
|
|
1604
|
+
```JS
|
|
1605
|
+
mg.domains.domainTracking.getTracking('foobar.example.com')
|
|
1606
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1607
|
+
.catch(err => console.error(err)); // logs any error
|
|
1608
|
+
```
|
|
1609
|
+
|
|
1610
|
+
Promise returns:
|
|
1611
|
+
|
|
1612
|
+
```JS
|
|
1613
|
+
{
|
|
1614
|
+
"click": {
|
|
1615
|
+
"active": false
|
|
1616
|
+
},
|
|
1617
|
+
"open": {
|
|
1618
|
+
"active": false
|
|
1619
|
+
},
|
|
1620
|
+
"unsubscribe": {
|
|
1621
|
+
"active": false,
|
|
1622
|
+
"html_footer": "\n<br>\n<p><a href=\"%unsubscribe_url%\">unsubscribe</a></p>\n",
|
|
1623
|
+
"text_footer": "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n"
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
```
|
|
1627
|
+
|
|
1628
|
+
- #### updateTracking
|
|
1629
|
+
|
|
1630
|
+
A common method to turn on/off the click, open, and unsubscribe tracking at the domain level.
|
|
1631
|
+
|
|
1632
|
+
`mg.domains.domainTracking.updateTracking(domain, trackingType, data)`
|
|
1633
|
+
|
|
1634
|
+
- Open Tracking Example:
|
|
1635
|
+
|
|
1636
|
+
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-open)
|
|
1637
|
+
```js
|
|
1638
|
+
mg.domains.domainTracking.updateTracking('foobar.example.com', 'open', {
|
|
1639
|
+
active: true,
|
|
1640
|
+
place_at_the_top: true,
|
|
1641
|
+
})
|
|
1642
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1643
|
+
.catch(err => console.error(err)); // logs any error
|
|
1644
|
+
```
|
|
1645
|
+
|
|
1646
|
+
Open tracking data object properties:
|
|
1647
|
+
|
|
1648
|
+
| Property | Description |
|
|
1649
|
+
|:----------|:-------------------------------------------|
|
|
1650
|
+
| active | Boolean, enables or disables open tracking |
|
|
1651
|
+
| place_at_the_top| Setting this param to true will place the open tracking pixel at the top of the HTML body when inserted into the email mime. Omit this param to keep current setting. |
|
|
1652
|
+
|
|
1653
|
+
Promise returns:
|
|
1654
|
+
|
|
1655
|
+
```JS
|
|
1656
|
+
{
|
|
1657
|
+
message: 'Tracking settings have been updated',
|
|
1658
|
+
open: {
|
|
1659
|
+
active: true,
|
|
1660
|
+
place_at_the_top: true,
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
```
|
|
1664
|
+
|
|
1665
|
+
- Click Tracking Example:
|
|
1666
|
+
|
|
1667
|
+
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-click)
|
|
1668
|
+
```JS
|
|
1669
|
+
mg.domains.domainTracking.updateTracking('foobar.example.com', 'click', {active: true})
|
|
1670
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1671
|
+
.catch(err => console.error(err)); // logs any error
|
|
1672
|
+
```
|
|
1673
|
+
|
|
1674
|
+
Click tracking data object properties:
|
|
1675
|
+
|
|
1676
|
+
| Property | Description |
|
|
1677
|
+
|:----------|:--------------------------------------------|
|
|
1678
|
+
| active | Boolean, enables or disables click tracking |
|
|
1679
|
+
|
|
1680
|
+
Promise returns:
|
|
1681
|
+
|
|
1682
|
+
```JS
|
|
1683
|
+
{
|
|
1684
|
+
message: 'Tracking settings have been updated',
|
|
1685
|
+
click: {
|
|
1686
|
+
active: true
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
- Unsubscribe Tracking Example
|
|
1692
|
+
|
|
1693
|
+
[api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/PUT-v3-domains--name--tracking-unsubscribe)
|
|
1694
|
+
```js
|
|
1695
|
+
mg.domains.domainTracking.updateTracking('foobar.example.com', 'unsubscribe', {
|
|
1696
|
+
active: true,
|
|
1697
|
+
html_footer: "\n<br>\n<p><a href=\"%unsubscribe_url%\">unsubscribe</a></p>\n",
|
|
1698
|
+
text_footer: "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n"
|
|
1699
|
+
})
|
|
1700
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1701
|
+
.catch(err => console.error(err)); // logs any error
|
|
1702
|
+
```
|
|
1703
|
+
|
|
1704
|
+
Unsubscribe Tracking data object properties:
|
|
1705
|
+
|
|
1706
|
+
| Property | Description |
|
|
1707
|
+
|:------------|:--------------------------------------------------------------|
|
|
1708
|
+
| active | Boolean, enables or disables unsubscribe tracking |
|
|
1709
|
+
| html_footer | string appended to html emails for managing unsubscribe links |
|
|
1710
|
+
| text_footer | string appended to html emails for managing unsubscribe links |
|
|
1711
|
+
|
|
1712
|
+
Promise returns:
|
|
1713
|
+
|
|
1714
|
+
```JS
|
|
1715
|
+
{
|
|
1716
|
+
message: 'Tracking settings have been updated',
|
|
1717
|
+
unsubscribe: {
|
|
1718
|
+
active: true,
|
|
1719
|
+
html_footer: '\n<br>\n<p><a href=\'%unsubscribe_url%\">unsubscribe</a></p>\n',
|
|
1720
|
+
text_footer: '\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n'
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
```
|
|
1724
|
+
|
|
1725
|
+
- #### get
|
|
1726
|
+
Get x509 TLS certificate and status
|
|
1727
|
+
|
|
1728
|
+
`mg.domains.domainTracking.get(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).getStatusV2-fm-8)
|
|
1729
|
+
|
|
1730
|
+
Example:
|
|
1731
|
+
|
|
1732
|
+
```JS
|
|
1733
|
+
mg.domains.domainTracking.get('foobar.example.com')
|
|
1734
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1735
|
+
.catch(err => console.error(err)); // logs any error
|
|
1736
|
+
```
|
|
1737
|
+
|
|
1738
|
+
Promise returns:
|
|
1739
|
+
|
|
1740
|
+
```JS
|
|
1741
|
+
{
|
|
1742
|
+
responseStatusCode: 200,
|
|
1743
|
+
status: 'expired',
|
|
1744
|
+
error: 'x509 certificate has expired',
|
|
1745
|
+
certificate: '{CERT}';
|
|
1746
|
+
}
|
|
1747
|
+
```
|
|
1748
|
+
|
|
1749
|
+
- #### generate
|
|
1750
|
+
Initiates generation of a TLS certificate for the tracking domain in a background task. Once generation is enqueued, you may poll the status endpoint in location field to check for success
|
|
1751
|
+
|
|
1752
|
+
`mg.domains.domainTracking.generate(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).generateStatusV2-fm-8)
|
|
1753
|
+
|
|
1754
|
+
Example:
|
|
1755
|
+
|
|
1756
|
+
```JS
|
|
1757
|
+
mg.domains.domainTracking.generate('foobar.example.com')
|
|
1758
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1759
|
+
.catch(err => console.error(err)); // logs any error
|
|
1760
|
+
```
|
|
1761
|
+
|
|
1762
|
+
Promise returns:
|
|
1763
|
+
|
|
1764
|
+
```JS
|
|
1765
|
+
{
|
|
1766
|
+
message: 'Initiated x509 key pair generation',
|
|
1767
|
+
location: '/v2/x509/example.com/status',
|
|
1768
|
+
status: 202,
|
|
1769
|
+
}
|
|
1770
|
+
```
|
|
1771
|
+
|
|
1772
|
+
- #### regenerate
|
|
1773
|
+
Initiates regeneration of an expired TLS certificate for the tracking domain in a background task. Once generation is enqueued, you may poll status endpoint in location field to check for success. This will not regenerate an existing certificate that is still valid
|
|
1774
|
+
|
|
1775
|
+
`mg.domains.domainTracking.regenerate(domainAddress)` [api docs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domain-Tracking/#tag/Domain-Tracking/operation/httpapi.(*HttpAPI).generateStatusV2-fm-8)
|
|
1776
|
+
|
|
1777
|
+
Example:
|
|
1778
|
+
|
|
1779
|
+
```JS
|
|
1780
|
+
mg.domains.domainTracking.regenerate('foobar.example.com')
|
|
1781
|
+
.then(msg => console.log(msg)) // logs response data
|
|
1782
|
+
.catch(err => console.error(err)); // logs any error
|
|
1783
|
+
```
|
|
1784
|
+
|
|
1785
|
+
Promise returns:
|
|
1786
|
+
|
|
1787
|
+
```JS
|
|
1788
|
+
{
|
|
1789
|
+
message: 'Initiated x509 key pair generation',
|
|
1790
|
+
location: '/v2/x509/example.com/status',
|
|
1791
|
+
status: 202,
|
|
1792
|
+
}
|
|
1793
|
+
```
|
|
1794
|
+
|
|
1647
1795
|
### Events
|
|
1648
1796
|
|
|
1649
1797
|
- #### get
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { IDomainTemplatesClient, IDomainTagsClient, IDomainCredentials, IDomainsClient } from '../../Interfaces/Domains';
|
|
2
|
-
import { APIResponse } from '../../Types/Common/ApiResponse';
|
|
3
|
-
import Request from '../common/Request';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import DomainTagsClient from './domainsTags';
|
|
7
|
-
import { MessageResponse, DomainTrackingData, UpdatedOpenTracking, DomainsQuery, DomainInfo, ConnectionSettings, UpdatedConnectionSettings, OpenTrackingInfo, ClickTrackingInfo, UnsubscribeTrackingInfo, ReplacementForPool, DKIMAuthorityInfo, UpdatedDKIMAuthority, DKIMSelectorInfo, WebPrefixInfo, UpdatedWebPrefixResponse, TDomain, DomainUpdateInfo, DomainGetQuery, UpdatedDKIMSelectorResult } from '../../Types/Domains';
|
|
8
|
-
import { ILogger } from '../../Interfaces';
|
|
1
|
+
import { IDomainTemplatesClient, IDomainTagsClient, IDomainCredentials, IDomainsClient } from '../../Interfaces/Domains/index.js';
|
|
2
|
+
import { APIResponse } from '../../Types/Common/ApiResponse.js';
|
|
3
|
+
import Request from '../common/Request.js';
|
|
4
|
+
import { MessageResponse, DomainTrackingData, UpdatedOpenTracking, DomainsQuery, DomainInfo, ConnectionSettings, UpdatedConnectionSettings, OpenTrackingInfo, ClickTrackingInfo, UnsubscribeTrackingInfo, ReplacementForPool, DKIMAuthorityInfo, UpdatedDKIMAuthority, DKIMSelectorInfo, WebPrefixInfo, UpdatedWebPrefixResponse, TDomain, DomainUpdateInfo, DomainGetQuery, UpdatedDKIMSelectorResult } from '../../Types/Domains/index.js';
|
|
5
|
+
import { ILogger, IDomainTrackingClient } from '../../Interfaces/index.js';
|
|
9
6
|
export default class DomainsClient implements IDomainsClient {
|
|
10
7
|
request: Request;
|
|
11
8
|
domainCredentials: IDomainCredentials;
|
|
12
9
|
domainTemplates: IDomainTemplatesClient;
|
|
13
10
|
domainTags: IDomainTagsClient;
|
|
11
|
+
domainTracking: IDomainTrackingClient;
|
|
14
12
|
private logger;
|
|
15
|
-
constructor(request: Request, domainCredentialsClient:
|
|
13
|
+
constructor(request: Request, domainCredentialsClient: IDomainCredentials, domainTemplatesClient: IDomainTemplatesClient, domainTagsClient: IDomainTagsClient, domainTracking: IDomainTrackingClient, logger?: ILogger);
|
|
16
14
|
private _handleBoolValues;
|
|
17
15
|
private _parseMessage;
|
|
18
16
|
private parseDomainList;
|
|
19
17
|
private _parseDomain;
|
|
20
|
-
private _parseTrackingSettings;
|
|
21
|
-
private _parseTrackingUpdate;
|
|
22
|
-
private _isOpenTrackingInfoWitPlace;
|
|
23
18
|
list(query?: DomainsQuery): Promise<TDomain[]>;
|
|
24
19
|
get(domain: string, query?: DomainGetQuery): Promise<TDomain>;
|
|
25
20
|
create(data: DomainInfo): Promise<TDomain>;
|
|
@@ -28,7 +23,15 @@ export default class DomainsClient implements IDomainsClient {
|
|
|
28
23
|
destroy(domain: string): Promise<MessageResponse>;
|
|
29
24
|
getConnection(domain: string): Promise<ConnectionSettings>;
|
|
30
25
|
updateConnection(domain: string, data: ConnectionSettings): Promise<UpdatedConnectionSettings>;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated 'domains.getTracking' method is deprecated, and will be removed.
|
|
28
|
+
* Please use 'domains.domainTracking.getTracking' instead.
|
|
29
|
+
*/
|
|
31
30
|
getTracking(domain: string): Promise<DomainTrackingData>;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated 'domains.updateTracking' method is deprecated, and will be removed.
|
|
33
|
+
* Please use 'domains.domainTracking.updateTracking' instead.
|
|
34
|
+
*/
|
|
32
35
|
updateTracking(domain: string, type: string, data: OpenTrackingInfo | ClickTrackingInfo | UnsubscribeTrackingInfo): Promise<UpdatedOpenTracking>;
|
|
33
36
|
/**
|
|
34
37
|
* @deprecated "domains.getIps" method is deprecated, and will be removed in the future releases.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IDomainCredentials } from '../../Interfaces/Domains';
|
|
2
|
-
import { DomainCredentialsList, DomainCredentialsResult, DomainCredentialsQuery, DomainCredentials, UpdateDomainCredentialsData } from '../../Types/Domains';
|
|
3
|
-
import Request from '../common/Request';
|
|
1
|
+
import { IDomainCredentials } from '../../Interfaces/Domains/index.js';
|
|
2
|
+
import { DomainCredentialsList, DomainCredentialsResult, DomainCredentialsQuery, DomainCredentials, UpdateDomainCredentialsData } from '../../Types/Domains/index.js';
|
|
3
|
+
import Request from '../common/Request.js';
|
|
4
4
|
export default class DomainCredentialsClient implements IDomainCredentials {
|
|
5
5
|
baseRoute: string;
|
|
6
6
|
request: Request;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Request from '../common/Request';
|
|
2
|
-
import { IDomainTagStatisticResult, IDomainTagsClient } from '../../Interfaces/Domains';
|
|
3
|
-
import NavigationThruPages from '../common/NavigationThruPages';
|
|
4
|
-
import { Resolution } from '../../Enums';
|
|
5
|
-
import { DomainTagsItem, DomainTagsItemInfo, DomainTagStatisticItem, DomainTagStatAPIResponse, DomainTagsList, DomainTagsResponseData, DomainTagsQuery, DomainTagsMessageRes, DomainTagsStatisticQuery, DomainTagCountriesAggregation, DomainTagProvidersAggregation, DomainTagDevicesAggregation } from '../../Types/Domains';
|
|
1
|
+
import Request from '../common/Request.js';
|
|
2
|
+
import { IDomainTagStatisticResult, IDomainTagsClient } from '../../Interfaces/Domains/index.js';
|
|
3
|
+
import NavigationThruPages from '../common/NavigationThruPages.js';
|
|
4
|
+
import { Resolution } from '../../Enums/index.js';
|
|
5
|
+
import { DomainTagsItem, DomainTagsItemInfo, DomainTagStatisticItem, DomainTagStatAPIResponse, DomainTagsList, DomainTagsResponseData, DomainTagsQuery, DomainTagsMessageRes, DomainTagsStatisticQuery, DomainTagCountriesAggregation, DomainTagProvidersAggregation, DomainTagDevicesAggregation } from '../../Types/Domains/index.js';
|
|
6
6
|
export declare class DomainTag implements DomainTagsItem {
|
|
7
7
|
tag: string;
|
|
8
8
|
description: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Request from '../common/Request';
|
|
2
|
-
import { CreateDomainTemplateVersionResult, DomainTemplateData, DomainTemplatesQuery, DomainTemplateUpdateData, DomainTemplateUpdateVersionData, DomainTemplateVersionData, ListDomainTemplatesAPIResponse, ListDomainTemplatesResult, ListDomainTemplateVersionsResult, MutateDomainTemplateVersionResult, NotificationResult, ShortTemplateVersion, TemplateQuery, TemplateVersion, UpdateOrDeleteDomainTemplateResult } from '../../Types/Domains';
|
|
3
|
-
import NavigationThruPages from '../common/NavigationThruPages';
|
|
4
|
-
import { IDomainTemplate, IDomainTemplatesClient } from '../../Interfaces/Domains';
|
|
1
|
+
import Request from '../common/Request.js';
|
|
2
|
+
import { CreateDomainTemplateVersionResult, DomainTemplateData, DomainTemplatesQuery, DomainTemplateUpdateData, DomainTemplateUpdateVersionData, DomainTemplateVersionData, ListDomainTemplatesAPIResponse, ListDomainTemplatesResult, ListDomainTemplateVersionsResult, MutateDomainTemplateVersionResult, NotificationResult, ShortTemplateVersion, TemplateQuery, TemplateVersion, UpdateOrDeleteDomainTemplateResult } from '../../Types/Domains/index.js';
|
|
3
|
+
import NavigationThruPages from '../common/NavigationThruPages.js';
|
|
4
|
+
import { IDomainTemplate, IDomainTemplatesClient } from '../../Interfaces/Domains/index.js';
|
|
5
5
|
export declare class DomainTemplateItem implements IDomainTemplate {
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|