@unboundcx/sdk 4.13.4 → 4.13.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.5",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -185,6 +185,36 @@ export class EmailDomainsService {
|
|
|
185
185
|
* @param {string} domain - Domain name (required)
|
|
186
186
|
* @returns {Promise<Object>} Domain verification status
|
|
187
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* Verify domain DNS + SES status.
|
|
190
|
+
* Accepts a domain id (UI) or domain name.
|
|
191
|
+
* @param {string} domainOrId
|
|
192
|
+
* @returns {Promise<Object>} SES status plus DNS check results
|
|
193
|
+
*/
|
|
194
|
+
async verify(domainOrId) {
|
|
195
|
+
this.sdk.validateParams(
|
|
196
|
+
{ domainOrId },
|
|
197
|
+
{
|
|
198
|
+
domainOrId: { type: 'string', required: true },
|
|
199
|
+
},
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
let domainName = domainOrId;
|
|
203
|
+
let domainId = domainOrId;
|
|
204
|
+
if (!domainOrId.includes('.')) {
|
|
205
|
+
const domain = await this.get(domainOrId);
|
|
206
|
+
domainName = domain.domain;
|
|
207
|
+
domainId = domain.id;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const [status, dns] = await Promise.all([
|
|
211
|
+
this.checkStatus(domainName),
|
|
212
|
+
this.validateDns(domainName),
|
|
213
|
+
]);
|
|
214
|
+
|
|
215
|
+
return { id: domainId, domain: domainName, ...status, dns };
|
|
216
|
+
}
|
|
217
|
+
|
|
188
218
|
async checkStatus(domain) {
|
|
189
219
|
this.sdk.validateParams(
|
|
190
220
|
{ domain },
|