@unboundcx/sdk 4.13.172 → 4.13.173

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.172",
3
+ "version": "4.13.173",
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",
@@ -280,4 +280,56 @@ export class EmailDomainsService {
280
280
  );
281
281
  return result;
282
282
  }
283
+
284
+ /**
285
+ * Update account settings for a verified domain.
286
+ * Pass catchAllMailboxId null or '' to clear the catch-all.
287
+ * @param {Object} params
288
+ * @param {string} params.domain - Domain name (required)
289
+ * @param {string} [params.portalId]
290
+ * @param {string|null} [params.catchAllMailboxId]
291
+ */
292
+ async updateSettings({ domain, portalId, catchAllMailboxId } = {}) {
293
+ this.sdk.validateParams(
294
+ { domain, portalId, catchAllMailboxId },
295
+ {
296
+ domain: { type: 'string', required: true },
297
+ portalId: { type: 'string', required: false },
298
+ catchAllMailboxId: { type: 'string', required: false },
299
+ },
300
+ );
301
+
302
+ const body = {};
303
+ if (portalId) body.portalId = portalId;
304
+ if (catchAllMailboxId !== undefined) {
305
+ body.catchAllMailboxId = catchAllMailboxId || null;
306
+ }
307
+
308
+ return internalRequest(
309
+ this.sdk,
310
+ `/messaging/email/validate/domain?domain=${encodeURIComponent(domain)}`,
311
+ 'PUT',
312
+ { body },
313
+ );
314
+ }
315
+
316
+ /**
317
+ * Re-save the account sending link for a verified domain.
318
+ * @param {string} domainId
319
+ * @returns {Promise<{id: string, domain: string, sendingStatus: string}>}
320
+ */
321
+ async enableSending(domainId) {
322
+ this.sdk.validateParams(
323
+ { domainId },
324
+ {
325
+ domainId: { type: 'string', required: true },
326
+ },
327
+ );
328
+
329
+ return internalRequest(
330
+ this.sdk,
331
+ `/messaging/email/validate/domain/${encodeURIComponent(domainId)}/sending`,
332
+ 'POST',
333
+ );
334
+ }
283
335
  }
@@ -1,20 +1,20 @@
1
- import { internalRequest } from "../base.js";
1
+ import { internalRequest } from '../base.js';
2
2
 
3
3
  // Local helper, same as reporting.js / reportingSurveys.js (no shared util
4
4
  // module between these files today).
5
5
  function queryString(params = {}) {
6
6
  const parts = [];
7
7
  for (const [key, value] of Object.entries(params)) {
8
- if (value === undefined || value === null || value === "") continue;
9
- const v = Array.isArray(value) ? value.join(",") : value;
8
+ if (value === undefined || value === null || value === '') continue;
9
+ const v = Array.isArray(value) ? value.join(',') : value;
10
10
  parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
11
11
  }
12
- return parts.length ? `?${parts.join("&")}` : "";
12
+ return parts.length ? `?${parts.join('&')}` : '';
13
13
  }
14
14
 
15
15
  const RANGE_RULES = {
16
- from: { type: "string", required: true },
17
- to: { type: "string", required: true },
16
+ from: { type: 'string', required: true },
17
+ to: { type: 'string', required: true },
18
18
  };
19
19
 
20
20
  // marketing-reports-plan.md §5/§6 -- Marketing reports family
@@ -36,7 +36,7 @@ export class ReportingMarketingService {
36
36
  return internalRequest(
37
37
  this.sdk,
38
38
  `/reporting/marketing/${path}${queryString(params)}`,
39
- "GET",
39
+ 'GET',
40
40
  );
41
41
  }
42
42
 
@@ -48,7 +48,7 @@ export class ReportingMarketingService {
48
48
  * await sdk.reporting.marketing.website({ from, to, timeZone, country: 'US' });
49
49
  */
50
50
  async website(params = {}) {
51
- return this._get("website", params);
51
+ return this._get('website', params);
52
52
  }
53
53
 
54
54
  /**
@@ -56,7 +56,7 @@ export class ReportingMarketingService {
56
56
  * @returns {Promise<Object>} { countries: [{ code, sessions, visitors, formFills }], cities: [...] }
57
57
  */
58
58
  async websiteGeo(params = {}) {
59
- return this._get("website/geo", params);
59
+ return this._get('website/geo', params);
60
60
  }
61
61
 
62
62
  /**
@@ -65,7 +65,7 @@ export class ReportingMarketingService {
65
65
  * @returns {Promise<Object>} { rows, nextCursor }
66
66
  */
67
67
  async websiteSessions(params = {}) {
68
- return this._get("website/sessions", params);
68
+ return this._get('website/sessions', params);
69
69
  }
70
70
 
71
71
  /**
@@ -75,7 +75,7 @@ export class ReportingMarketingService {
75
75
  * @returns {Promise<Object>} { visitorKey, person, company, sessions, truncated }
76
76
  */
77
77
  async visitorDetail(params = {}) {
78
- return this._get("website/visitors", params);
78
+ return this._get('website/visitors', params);
79
79
  }
80
80
 
81
81
  /**
@@ -85,12 +85,12 @@ export class ReportingMarketingService {
85
85
  async sessionEvents(sessionId) {
86
86
  this.sdk.validateParams(
87
87
  { sessionId },
88
- { sessionId: { type: "string", required: true } },
88
+ { sessionId: { type: 'string', required: true } },
89
89
  );
90
90
  return internalRequest(
91
91
  this.sdk,
92
92
  `/reporting/marketing/website/sessions/${encodeURIComponent(sessionId)}/events`,
93
- "GET",
93
+ 'GET',
94
94
  );
95
95
  }
96
96
 
@@ -99,7 +99,7 @@ export class ReportingMarketingService {
99
99
  * @param {Object} params - range + { formId }
100
100
  */
101
101
  async forms(params = {}) {
102
- return this._get("forms", params);
102
+ return this._get('forms', params);
103
103
  }
104
104
 
105
105
  /**
@@ -108,7 +108,7 @@ export class ReportingMarketingService {
108
108
  * @returns {Promise<Object>} { rows, nextCursor }
109
109
  */
110
110
  async formSubmissions(params = {}) {
111
- return this._get("forms/submissions", params);
111
+ return this._get('forms/submissions', params);
112
112
  }
113
113
 
114
114
  /**
@@ -117,14 +117,14 @@ export class ReportingMarketingService {
117
117
  * @returns {Promise<Object>} { model, dimension, kpis, rows }
118
118
  */
119
119
  async attribution(params = {}) {
120
- return this._get("attribution", params);
120
+ return this._get('attribution', params);
121
121
  }
122
122
 
123
123
  /**
124
124
  * Lead scoring summary (histogram, rules, trend, top people).
125
125
  */
126
126
  async scoring(params = {}) {
127
- return this._get("scoring", params);
127
+ return this._get('scoring', params);
128
128
  }
129
129
 
130
130
  /**
@@ -132,6 +132,6 @@ export class ReportingMarketingService {
132
132
  * @param {Object} params - range + { journeyId }
133
133
  */
134
134
  async engagement(params = {}) {
135
- return this._get("engagement", params);
135
+ return this._get('engagement', params);
136
136
  }
137
137
  }