@unboundcx/sdk 4.13.28 → 4.13.29
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/index.js +1 -5
- package/package.json +1 -1
- package/services/webchat.js +0 -71
package/index.js
CHANGED
|
@@ -299,11 +299,7 @@ export {
|
|
|
299
299
|
export { VerificationService } from './services/verification.js';
|
|
300
300
|
export { PortalsService } from './services/portals.js';
|
|
301
301
|
export { SipEndpointsService } from './services/sipEndpoints.js';
|
|
302
|
-
export {
|
|
303
|
-
WebchatService,
|
|
304
|
-
WebchatWidgetsService,
|
|
305
|
-
WebchatWidgetKeysService,
|
|
306
|
-
} from './services/webchat.js';
|
|
302
|
+
export { WebchatService, WebchatWidgetsService } from './services/webchat.js';
|
|
307
303
|
export { WebchatVisitorService } from './services/webchat/VisitorService.js';
|
|
308
304
|
export { ExternalOAuthService } from './services/externalOAuth.js';
|
|
309
305
|
export { GoogleCalendarService } from './services/googleCalendar.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.29",
|
|
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",
|
package/services/webchat.js
CHANGED
|
@@ -5,80 +5,9 @@ import { WebchatVisitorService } from './webchat/VisitorService.js';
|
|
|
5
5
|
// /webchat/widgets/ (checkApiAuth) -- deliberately not bare /webchat/, which
|
|
6
6
|
// is the (now-implemented, P7) unauthenticated visitor surface -- see
|
|
7
7
|
// `sdk.webchat.visitor` (./webchat/VisitorService.js) (plan §5/§10 Q7).
|
|
8
|
-
export class WebchatWidgetKeysService {
|
|
9
|
-
constructor(sdk) {
|
|
10
|
-
this.sdk = sdk;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* List signing keys for a widget.
|
|
15
|
-
* @param {string} widgetId
|
|
16
|
-
* @returns {Promise<Array<Object>>}
|
|
17
|
-
*/
|
|
18
|
-
async list(widgetId) {
|
|
19
|
-
this.sdk.validateParams(
|
|
20
|
-
{ widgetId },
|
|
21
|
-
{ widgetId: { type: 'string', required: true } },
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
return internalRequest(
|
|
25
|
-
this.sdk,
|
|
26
|
-
`/webchat/widgets/${widgetId}/keys`,
|
|
27
|
-
'GET',
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Create a signing key for a widget. The token is server-generated and
|
|
33
|
-
* returned once in this response only.
|
|
34
|
-
* @param {string} widgetId
|
|
35
|
-
* @param {Object} [options]
|
|
36
|
-
* @param {string[]} [options.urls] - allowlisted origins/domains for this key
|
|
37
|
-
* @returns {Promise<Object>}
|
|
38
|
-
*/
|
|
39
|
-
async create(widgetId, options = {}) {
|
|
40
|
-
this.sdk.validateParams(
|
|
41
|
-
{ widgetId },
|
|
42
|
-
{ widgetId: { type: 'string', required: true } },
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const params = { body: { ...options } };
|
|
46
|
-
|
|
47
|
-
return internalRequest(
|
|
48
|
-
this.sdk,
|
|
49
|
-
`/webchat/widgets/${widgetId}/keys`,
|
|
50
|
-
'POST',
|
|
51
|
-
params,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Delete (soft) a widget signing key.
|
|
57
|
-
* @param {string} widgetId
|
|
58
|
-
* @param {string} keyId
|
|
59
|
-
* @returns {Promise<Object>}
|
|
60
|
-
*/
|
|
61
|
-
async delete(widgetId, keyId) {
|
|
62
|
-
this.sdk.validateParams(
|
|
63
|
-
{ widgetId, keyId },
|
|
64
|
-
{
|
|
65
|
-
widgetId: { type: 'string', required: true },
|
|
66
|
-
keyId: { type: 'string', required: true },
|
|
67
|
-
},
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return internalRequest(
|
|
71
|
-
this.sdk,
|
|
72
|
-
`/webchat/widgets/${widgetId}/keys/${keyId}`,
|
|
73
|
-
'DELETE',
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
8
|
export class WebchatWidgetsService {
|
|
79
9
|
constructor(sdk) {
|
|
80
10
|
this.sdk = sdk;
|
|
81
|
-
this.keys = new WebchatWidgetKeysService(sdk);
|
|
82
11
|
}
|
|
83
12
|
|
|
84
13
|
/**
|