@unboundcx/sdk 4.13.3 → 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 },
|
|
@@ -215,6 +215,23 @@ export class EmailTemplatesService {
|
|
|
215
215
|
return result;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Restore a system account template (ticketAutoReply, ticketReply, …)
|
|
220
|
+
* to the platform default design. User templates cannot be reset.
|
|
221
|
+
* @param {string} id - Template ID (required)
|
|
222
|
+
*/
|
|
223
|
+
async reset(id) {
|
|
224
|
+
this.sdk.validateParams(
|
|
225
|
+
{ id },
|
|
226
|
+
{ id: { type: 'string', required: true } },
|
|
227
|
+
);
|
|
228
|
+
return internalRequest(
|
|
229
|
+
this.sdk,
|
|
230
|
+
`/messaging/email/template/${id}/reset`,
|
|
231
|
+
'POST',
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
218
235
|
/**
|
|
219
236
|
* Get email template by ID
|
|
220
237
|
* @param {string} id - Template ID (required)
|
|
@@ -241,10 +258,16 @@ export class EmailTemplatesService {
|
|
|
241
258
|
* @param {string} [filters.appearance] - `client` or `marketing`
|
|
242
259
|
* @param {boolean} [filters.allowOneOff]
|
|
243
260
|
* @param {boolean} [filters.allowCampaign]
|
|
261
|
+
* @param {string} [filters.scope] - `user` (default), `system`, or `all`
|
|
244
262
|
* @returns {Promise<Array>} List of email templates
|
|
245
263
|
*/
|
|
246
|
-
async list({ appearance, allowOneOff, allowCampaign } = {}) {
|
|
247
|
-
const query = pickDefined({
|
|
264
|
+
async list({ appearance, allowOneOff, allowCampaign, scope } = {}) {
|
|
265
|
+
const query = pickDefined({
|
|
266
|
+
appearance,
|
|
267
|
+
allowOneOff,
|
|
268
|
+
allowCampaign,
|
|
269
|
+
scope,
|
|
270
|
+
});
|
|
248
271
|
const options = Object.keys(query).length ? { query } : {};
|
|
249
272
|
const result = await internalRequest(
|
|
250
273
|
this.sdk,
|