@unboundcx/sdk 4.13.42 → 4.13.44
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 +1 -1
- package/services/dealRegistrations.js +12 -2
- package/services/objects.js +15 -1
- package/services/text.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.44",
|
|
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
|
-
|
|
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/objects.js
CHANGED
|
@@ -1032,14 +1032,25 @@ export class ObjectsService {
|
|
|
1032
1032
|
isBotAccessible = null,
|
|
1033
1033
|
isPublicBot = null,
|
|
1034
1034
|
description = null,
|
|
1035
|
+
feedPostChanges = null,
|
|
1036
|
+
feedPostWindowSeconds = null,
|
|
1035
1037
|
}) {
|
|
1036
1038
|
this.sdk.validateParams(
|
|
1037
|
-
{
|
|
1039
|
+
{
|
|
1040
|
+
objectName,
|
|
1041
|
+
isBotAccessible,
|
|
1042
|
+
isPublicBot,
|
|
1043
|
+
description,
|
|
1044
|
+
feedPostChanges,
|
|
1045
|
+
feedPostWindowSeconds,
|
|
1046
|
+
},
|
|
1038
1047
|
{
|
|
1039
1048
|
objectName: { type: 'string', required: true },
|
|
1040
1049
|
isBotAccessible: { type: 'boolean', required: false },
|
|
1041
1050
|
isPublicBot: { type: 'boolean', required: false },
|
|
1042
1051
|
description: { type: 'string', required: false },
|
|
1052
|
+
feedPostChanges: { type: 'boolean', required: false },
|
|
1053
|
+
feedPostWindowSeconds: { type: 'number', required: false },
|
|
1043
1054
|
},
|
|
1044
1055
|
);
|
|
1045
1056
|
|
|
@@ -1047,6 +1058,9 @@ export class ObjectsService {
|
|
|
1047
1058
|
if (isBotAccessible !== null) body.isBotAccessible = isBotAccessible;
|
|
1048
1059
|
if (isPublicBot !== null) body.isPublicBot = isPublicBot;
|
|
1049
1060
|
if (description !== null) body.description = description;
|
|
1061
|
+
if (feedPostChanges !== null) body.feedPostChanges = feedPostChanges;
|
|
1062
|
+
if (feedPostWindowSeconds !== null)
|
|
1063
|
+
body.feedPostWindowSeconds = feedPostWindowSeconds;
|
|
1050
1064
|
|
|
1051
1065
|
const params = { body };
|
|
1052
1066
|
|
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 {
|