@unboundcx/sdk 2.8.4 → 2.8.6
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 +57 -0
- package/package.json +1 -1
- package/services/video.js +32 -2
package/index.js
CHANGED
|
@@ -153,6 +153,63 @@ class UnboundSDK extends BaseSDK {
|
|
|
153
153
|
'buildMasterAuth is only available with the internal SDK extension. Please use: sdk.use(InternalExtension)',
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Check SDK configuration and API connectivity
|
|
159
|
+
* Calls the /health endpoint to verify SDK setup
|
|
160
|
+
*
|
|
161
|
+
* @returns {Promise<Object>} Health check result with:
|
|
162
|
+
* - healthy: boolean - If API is reachable
|
|
163
|
+
* - hasAuthorization: boolean - If auth credentials were received by API
|
|
164
|
+
* - authType: string|null - Type of auth detected by API ('bearer', 'cookie', or 'bearer+cookie')
|
|
165
|
+
* - namespace: string - Current namespace
|
|
166
|
+
* - environment: string - 'node' or 'browser'
|
|
167
|
+
* - transport: string - Transport method used ('HTTP', 'WebSocket', etc.)
|
|
168
|
+
*/
|
|
169
|
+
async status() {
|
|
170
|
+
try {
|
|
171
|
+
const response = await this._fetch('/health', 'GET', {
|
|
172
|
+
returnRawResponse: true,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Parse response
|
|
176
|
+
let healthData;
|
|
177
|
+
try {
|
|
178
|
+
if (typeof response.json === 'function') {
|
|
179
|
+
healthData = await response.json();
|
|
180
|
+
} else if (response.body) {
|
|
181
|
+
healthData = typeof response.body === 'string'
|
|
182
|
+
? JSON.parse(response.body)
|
|
183
|
+
: response.body;
|
|
184
|
+
} else {
|
|
185
|
+
healthData = {};
|
|
186
|
+
}
|
|
187
|
+
} catch (e) {
|
|
188
|
+
healthData = {};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
healthy: response.ok || response.status === 200,
|
|
193
|
+
hasAuthorization: healthData.hasAuthorization || false,
|
|
194
|
+
authType: healthData.authType || null,
|
|
195
|
+
namespace: this.namespace,
|
|
196
|
+
environment: this.environment,
|
|
197
|
+
transport: healthData.transport || 'unknown',
|
|
198
|
+
timestamp: healthData.timestamp,
|
|
199
|
+
statusCode: response.status,
|
|
200
|
+
};
|
|
201
|
+
} catch (error) {
|
|
202
|
+
return {
|
|
203
|
+
healthy: false,
|
|
204
|
+
hasAuthorization: false,
|
|
205
|
+
authType: null,
|
|
206
|
+
namespace: this.namespace,
|
|
207
|
+
environment: this.environment,
|
|
208
|
+
error: error.message,
|
|
209
|
+
statusCode: error.status || null,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
156
213
|
}
|
|
157
214
|
|
|
158
215
|
// Export both the class and a factory function for convenience
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.6",
|
|
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/video.js
CHANGED
|
@@ -14,15 +14,27 @@ export class VideoService {
|
|
|
14
14
|
return result;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
async joinRoom(
|
|
17
|
+
async joinRoom(
|
|
18
|
+
room,
|
|
19
|
+
password,
|
|
20
|
+
email,
|
|
21
|
+
name,
|
|
22
|
+
firstName,
|
|
23
|
+
lastName,
|
|
24
|
+
tokenType = 'cookie',
|
|
25
|
+
token,
|
|
26
|
+
) {
|
|
18
27
|
this.sdk.validateParams(
|
|
19
|
-
{ room, password, email, name, tokenType },
|
|
28
|
+
{ room, password, email, name, firstName, lastName, tokenType, token },
|
|
20
29
|
{
|
|
21
30
|
room: { type: 'string', required: true },
|
|
22
31
|
password: { type: 'string', required: false },
|
|
23
32
|
email: { type: 'string', required: false },
|
|
24
33
|
name: { type: 'string', required: false },
|
|
34
|
+
firstName: { type: 'string', required: false },
|
|
35
|
+
lastName: { type: 'string', required: false },
|
|
25
36
|
tokenType: { type: 'string', required: true },
|
|
37
|
+
token: { type: 'string', required: false },
|
|
26
38
|
},
|
|
27
39
|
);
|
|
28
40
|
|
|
@@ -32,7 +44,10 @@ export class VideoService {
|
|
|
32
44
|
password,
|
|
33
45
|
email,
|
|
34
46
|
name,
|
|
47
|
+
firstName,
|
|
48
|
+
lastName,
|
|
35
49
|
tokenType,
|
|
50
|
+
token,
|
|
36
51
|
},
|
|
37
52
|
};
|
|
38
53
|
const result = await this.sdk._fetch(
|
|
@@ -94,6 +109,7 @@ export class VideoService {
|
|
|
94
109
|
);
|
|
95
110
|
return result;
|
|
96
111
|
}
|
|
112
|
+
|
|
97
113
|
async updateParticipant(roomId, participantId, update) {
|
|
98
114
|
this.sdk.validateParams(
|
|
99
115
|
{ roomId, participantId, update },
|
|
@@ -362,6 +378,20 @@ export class VideoService {
|
|
|
362
378
|
return result;
|
|
363
379
|
}
|
|
364
380
|
|
|
381
|
+
async describe(roomId) {
|
|
382
|
+
this.sdk.validateParams(
|
|
383
|
+
{ roomId },
|
|
384
|
+
{
|
|
385
|
+
roomId: { type: 'string', required: true },
|
|
386
|
+
},
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
const params = {};
|
|
390
|
+
|
|
391
|
+
const result = await this.sdk._fetch(`/video/${roomId}`, 'GET', params);
|
|
392
|
+
return result;
|
|
393
|
+
}
|
|
394
|
+
|
|
365
395
|
async listMeetings(options = {}) {
|
|
366
396
|
// Validate optional parameters
|
|
367
397
|
const validationSchema = {};
|