@unboundcx/sdk 4.13.42 → 4.13.43

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.42",
3
+ "version": "4.13.43",
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",
@@ -18,11 +18,21 @@ export class DealRegistrationsService {
18
18
  * company/people/opportunity records (reusing matched records where
19
19
  * possible) and stamps the registration approved.
20
20
  * @param {string} id - dealRegistrations record id
21
+ * @param {Object} [options]
22
+ * @param {string} [options.notes] - shared with the partner (approval email + portal)
23
+ * @param {boolean} [options.force] - override a detected conflict; required
24
+ * when conflictStatus === 'conflict', otherwise the API answers 200
25
+ * with converted:false and leaves the registration pending.
21
26
  * @returns {Promise<Object>} { registration, converted }
22
27
  */
23
- async approve(id) {
28
+ async approve(id, { notes, force } = {}) {
24
29
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
25
- return internalRequest(this.sdk, `/deal-registrations/${id}/approve`, 'POST');
30
+ const body = {};
31
+ if (notes !== undefined) body.notes = notes;
32
+ if (force !== undefined) body.force = force;
33
+ return internalRequest(this.sdk, `/deal-registrations/${id}/approve`, 'POST', {
34
+ body,
35
+ });
26
36
  }
27
37
 
28
38
  /**
package/services/text.js CHANGED
@@ -147,6 +147,42 @@ export class TextConversationsService {
147
147
  body: { to, userId, groupId, visibility, workflowId, workflowVersionId },
148
148
  });
149
149
  }
150
+
151
+ /**
152
+ * "SMS from an active call": check whether the current user may open the
153
+ * UC Chat text channel for a call's (our number, other party) pair.
154
+ * Never throws for an unavailable result -- check `available`/`reason`.
155
+ * @param {string} cdrId - cdr_acct id for the call (required)
156
+ * @returns {Promise<Object>} { available, reason, phoneNumberId, ourNumber, counterparty, conversationId, channelId, isMember }
157
+ */
158
+ async callThread(cdrId) {
159
+ this.sdk.validateParams(
160
+ { cdrId },
161
+ { cdrId: { type: 'string', required: true } },
162
+ );
163
+
164
+ return internalRequest(this.sdk, '/text/call-thread', 'GET', {
165
+ query: { cdrId },
166
+ });
167
+ }
168
+
169
+ /**
170
+ * Open (or join) the UC Chat text channel for a call's (our number,
171
+ * other party) pair, minting the conversation/channel if none is open
172
+ * yet. 403s if callThread(cdrId) would report `available: false`.
173
+ * @param {string} cdrId - cdr_acct id for the call (required)
174
+ * @returns {Promise<Object>} { channel, conversationId }
175
+ */
176
+ async openCallThread(cdrId) {
177
+ this.sdk.validateParams(
178
+ { cdrId },
179
+ { cdrId: { type: 'string', required: true } },
180
+ );
181
+
182
+ return internalRequest(this.sdk, '/text/call-thread', 'POST', {
183
+ body: { cdrId },
184
+ });
185
+ }
150
186
  }
151
187
 
152
188
  export class TextService {