@wazo/sdk 0.38.7 → 0.38.10
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/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +163 -2
- package/esm/__tests__/web-rtc-client.test.js +248 -27
- package/esm/api/auth.js +12 -0
- package/esm/api/calld.js +8 -0
- package/esm/api/confd.js +134 -2
- package/esm/api/ctid-ng.js +1 -0
- package/esm/api-client.js +163 -2
- package/esm/checker/Checker.js +204 -24
- package/esm/checker/checks/aor.js +163 -2
- package/esm/checker/checks/api.js +163 -2
- package/esm/checker/checks/index.js +204 -24
- package/esm/checker/checks/wazo-websocket.js +2 -0
- package/esm/checker/checks/webrtc-transport.js +202 -24
- package/esm/checker/checks/webrtc.js +202 -24
- package/esm/domain/AdHocAPIConference.js +170 -4
- package/esm/domain/Features.js +170 -4
- package/esm/domain/Meeting.js +18 -0
- package/esm/domain/MeetingAuthorization.js +70 -0
- package/esm/domain/Phone/CTIPhone.js +170 -4
- package/esm/domain/Phone/WebRTCPhone.js +2 -3
- package/esm/domain/__tests__/Meeting.test.js +87 -1
- package/esm/domain/__tests__/MeetingAuthorization.test.js +109 -0
- package/esm/index.js +300 -36
- package/esm/service/CallApi.js +170 -4
- package/esm/service/getApiClient.js +176 -5
- package/esm/simple/Auth.js +301 -37
- package/esm/simple/Configuration.js +300 -36
- package/esm/simple/Directory.js +170 -4
- package/esm/simple/Phone.js +300 -36
- package/esm/simple/Softphone.js +5 -0
- package/esm/simple/Websocket.js +3 -0
- package/esm/simple/index.js +300 -36
- package/esm/simple/room/LocalParticipant.js +300 -36
- package/esm/simple/room/Participant.js +300 -36
- package/esm/simple/room/RemoteParticipant.js +300 -36
- package/esm/simple/room/Room.js +300 -36
- package/esm/simple/room/SipRoom.js +300 -36
- package/esm/simple/room/Stream.js +300 -36
- package/esm/simple/room/__tests__/Participant.test.js +14812 -0
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +300 -36
- package/esm/simple/utils.js +300 -36
- package/esm/utils/__tests__/object.test.js +57 -0
- package/esm/utils/__tests__/string.test.js +30 -0
- package/esm/utils/object.js +24 -0
- package/esm/utils/string.js +10 -0
- package/esm/web-rtc-client.js +202 -24
- package/esm/websocket-client.js +3 -1
- package/lib/__tests__/api-client.test.js +163 -2
- package/lib/__tests__/web-rtc-client.test.js +248 -27
- package/lib/api/auth.js +12 -0
- package/lib/api/calld.js +8 -0
- package/lib/api/confd.js +134 -2
- package/lib/api/ctid-ng.js +1 -0
- package/lib/api-client.js +163 -2
- package/lib/checker/Checker.js +204 -24
- package/lib/checker/checks/aor.js +163 -2
- package/lib/checker/checks/api.js +163 -2
- package/lib/checker/checks/index.js +204 -24
- package/lib/checker/checks/wazo-websocket.js +2 -0
- package/lib/checker/checks/webrtc-transport.js +202 -24
- package/lib/checker/checks/webrtc.js +202 -24
- package/lib/domain/AdHocAPIConference.js +170 -4
- package/lib/domain/Features.js +170 -4
- package/lib/domain/Meeting.js +18 -0
- package/lib/domain/MeetingAuthorization.js +79 -0
- package/lib/domain/Phone/CTIPhone.js +170 -4
- package/lib/domain/Phone/WebRTCPhone.js +2 -3
- package/lib/domain/__tests__/Meeting.test.js +87 -1
- package/lib/domain/__tests__/MeetingAuthorization.test.js +111 -0
- package/lib/index.js +300 -36
- package/lib/service/CallApi.js +170 -4
- package/lib/service/getApiClient.js +176 -4
- package/lib/simple/Auth.js +301 -36
- package/lib/simple/Configuration.js +300 -36
- package/lib/simple/Directory.js +170 -4
- package/lib/simple/Phone.js +300 -36
- package/lib/simple/Softphone.js +5 -0
- package/lib/simple/Websocket.js +3 -0
- package/lib/simple/index.js +300 -36
- package/lib/simple/room/LocalParticipant.js +300 -36
- package/lib/simple/room/Participant.js +300 -36
- package/lib/simple/room/RemoteParticipant.js +300 -36
- package/lib/simple/room/Room.js +300 -36
- package/lib/simple/room/SipRoom.js +300 -36
- package/lib/simple/room/Stream.js +300 -36
- package/lib/simple/room/__tests__/Participant.test.js +14822 -0
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +300 -36
- package/lib/simple/utils.js +300 -36
- package/lib/utils/__tests__/object.test.js +59 -0
- package/lib/utils/__tests__/string.test.js +32 -0
- package/lib/utils/object.js +28 -0
- package/lib/utils/string.js +14 -0
- package/lib/web-rtc-client.js +202 -24
- package/lib/websocket-client.js +3 -0
- package/package.json +1 -1
- package/src/__tests__/web-rtc-client.test.js +46 -3
- package/src/api/auth.js +12 -0
- package/src/api/calld.js +8 -0
- package/src/api/confd.js +43 -2
- package/src/api-client.js +8 -0
- package/src/domain/Meeting.js +20 -0
- package/src/domain/MeetingAuthorization.js +67 -0
- package/src/domain/Phone/WebRTCPhone.js +1 -3
- package/src/domain/__tests__/Meeting.test.js +70 -1
- package/src/domain/__tests__/MeetingAuthorization.test.js +58 -0
- package/src/service/getApiClient.js +13 -2
- package/src/simple/Auth.js +35 -4
- package/src/simple/Softphone.js +5 -0
- package/src/simple/index.js +2 -1
- package/src/simple/room/Participant.js +40 -0
- package/src/simple/room/Room.js +2 -2
- package/src/simple/room/SipRoom.js +1 -1
- package/src/simple/room/__tests__/Participant.test.js +81 -0
- package/src/types/WebSocketMessage.js +7 -1
- package/src/utils/__tests__/object.test.js +35 -0
- package/src/utils/__tests__/string.test.js +23 -0
- package/src/utils/object.js +15 -0
- package/src/utils/string.js +8 -0
- package/src/web-rtc-client.js +39 -22
- package/src/websocket-client.js +2 -0
package/lib/api/confd.js
CHANGED
|
@@ -1292,6 +1292,70 @@ class ExternalApp {
|
|
|
1292
1292
|
|
|
1293
1293
|
//
|
|
1294
1294
|
|
|
1295
|
+
class MeetingAuthorization {
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
constructor({
|
|
1303
|
+
meetingUuid,
|
|
1304
|
+
uuid,
|
|
1305
|
+
userUuid,
|
|
1306
|
+
userName,
|
|
1307
|
+
} = {}) {
|
|
1308
|
+
this.meetingUuid = meetingUuid;
|
|
1309
|
+
this.uuid = uuid;
|
|
1310
|
+
this.userUuid = userUuid;
|
|
1311
|
+
this.userName = userName;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
setStatus(status ) {
|
|
1315
|
+
this.status = status;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
getStatus() {
|
|
1319
|
+
return this.status;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
static parse(plain ) {
|
|
1323
|
+
const {
|
|
1324
|
+
meeting_uuid: meetingUuid,
|
|
1325
|
+
uuid,
|
|
1326
|
+
guest_uuid: userUuid,
|
|
1327
|
+
guest_name: userName,
|
|
1328
|
+
} = plain;
|
|
1329
|
+
|
|
1330
|
+
return new MeetingAuthorization({
|
|
1331
|
+
meetingUuid,
|
|
1332
|
+
uuid,
|
|
1333
|
+
userUuid,
|
|
1334
|
+
userName,
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
static parseMany(items ) {
|
|
1339
|
+
if (!items) {
|
|
1340
|
+
return [];
|
|
1341
|
+
}
|
|
1342
|
+
return items.map(MeetingAuthorization.parse);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
//
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1295
1359
|
|
|
1296
1360
|
|
|
1297
1361
|
|
|
@@ -1302,6 +1366,7 @@ class ExternalApp {
|
|
|
1302
1366
|
|
|
1303
1367
|
|
|
1304
1368
|
|
|
1369
|
+
|
|
1305
1370
|
|
|
1306
1371
|
|
|
1307
1372
|
class Meeting {
|
|
@@ -1316,6 +1381,8 @@ class Meeting {
|
|
|
1316
1381
|
|
|
1317
1382
|
|
|
1318
1383
|
|
|
1384
|
+
|
|
1385
|
+
|
|
1319
1386
|
|
|
1320
1387
|
static parse(plain ) {
|
|
1321
1388
|
return new Meeting({
|
|
@@ -1328,6 +1395,7 @@ class Meeting {
|
|
|
1328
1395
|
extension: plain.exten,
|
|
1329
1396
|
persistent: plain.persistent,
|
|
1330
1397
|
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
1398
|
+
requireAuthorization: plain.require_authorization,
|
|
1331
1399
|
});
|
|
1332
1400
|
}
|
|
1333
1401
|
|
|
@@ -1352,6 +1420,7 @@ class Meeting {
|
|
|
1352
1420
|
extension,
|
|
1353
1421
|
persistent,
|
|
1354
1422
|
creationTime,
|
|
1423
|
+
requireAuthorization,
|
|
1355
1424
|
} = {}) {
|
|
1356
1425
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
1357
1426
|
this.uri = uri;
|
|
@@ -1362,6 +1431,7 @@ class Meeting {
|
|
|
1362
1431
|
this.extension = extension;
|
|
1363
1432
|
this.persistent = persistent;
|
|
1364
1433
|
this.creationTime = creationTime;
|
|
1434
|
+
this.requireAuthorization = requireAuthorization;
|
|
1365
1435
|
|
|
1366
1436
|
// Useful to compare instead of instanceof with minified code
|
|
1367
1437
|
this.type = 'Meeting';
|
|
@@ -1372,8 +1442,32 @@ class Meeting {
|
|
|
1372
1442
|
const [username, secret] = atob(this.guestSipAuthorization).split(':');
|
|
1373
1443
|
return { username, secret };
|
|
1374
1444
|
}
|
|
1445
|
+
|
|
1375
1446
|
}
|
|
1376
1447
|
|
|
1448
|
+
//
|
|
1449
|
+
|
|
1450
|
+
const camelToUnderscore = (key ) => {
|
|
1451
|
+
if (typeof key !== 'string') {
|
|
1452
|
+
throw new Error('Input is not a string');
|
|
1453
|
+
}
|
|
1454
|
+
return key.charAt(0).toLowerCase() + key.substring(1).replace(/([A-Z])/g, '_$1').toLowerCase();
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
//
|
|
1458
|
+
|
|
1459
|
+
const convertKeysFromCamelToUnderscore = (args ) => {
|
|
1460
|
+
if (!args || typeof args !== 'object' || Array.isArray(args)) {
|
|
1461
|
+
throw new Error('Input is not an object');
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return Object.keys(args).reduce((acc, key) => {
|
|
1465
|
+
acc[camelToUnderscore(key)] = typeof args[key] === 'object' && !Array.isArray(args[key])
|
|
1466
|
+
? convertKeysFromCamelToUnderscore(args[key]) : args[key];
|
|
1467
|
+
return acc;
|
|
1468
|
+
}, {});
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1377
1471
|
/* */
|
|
1378
1472
|
|
|
1379
1473
|
var confd = (client , baseUrl ) => ({
|
|
@@ -1442,8 +1536,18 @@ var confd = (client , baseUrl ) => ({
|
|
|
1442
1536
|
getMyMeetings: () =>
|
|
1443
1537
|
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
1444
1538
|
|
|
1445
|
-
createMyMeeting: (
|
|
1446
|
-
client
|
|
1539
|
+
createMyMeeting: (args ) =>
|
|
1540
|
+
client
|
|
1541
|
+
.post(`${baseUrl}/users/me/meetings`, convertKeysFromCamelToUnderscore(args))
|
|
1542
|
+
.then(Meeting.parse),
|
|
1543
|
+
|
|
1544
|
+
updateMyMeeting: (meetingUuid , data ) =>
|
|
1545
|
+
client.put(
|
|
1546
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}`,
|
|
1547
|
+
convertKeysFromCamelToUnderscore(data),
|
|
1548
|
+
null,
|
|
1549
|
+
ApiRequester.successResponseParser,
|
|
1550
|
+
),
|
|
1447
1551
|
|
|
1448
1552
|
deleteMyMeeting: (meetingUuid ) =>
|
|
1449
1553
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -1451,8 +1555,36 @@ var confd = (client , baseUrl ) => ({
|
|
|
1451
1555
|
getMeeting: (meetingUuid ) =>
|
|
1452
1556
|
client.get(`${baseUrl}/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
1453
1557
|
|
|
1558
|
+
meetingAuthorizations: (meetingUuid ) =>
|
|
1559
|
+
client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations`, null).then(MeetingAuthorization.parseMany),
|
|
1560
|
+
|
|
1561
|
+
meetingAuthorizationReject: (meetingUuid , authorizationUuid ) =>
|
|
1562
|
+
client.put(
|
|
1563
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations/${authorizationUuid}/reject`,
|
|
1564
|
+
{},
|
|
1565
|
+
null,
|
|
1566
|
+
ApiRequester.successResponseParser,
|
|
1567
|
+
),
|
|
1568
|
+
|
|
1569
|
+
meetingAuthorizationAccept: (meetingUuid , authorizationUuid ) =>
|
|
1570
|
+
client.put(
|
|
1571
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations/${authorizationUuid}/accept`,
|
|
1572
|
+
{},
|
|
1573
|
+
null,
|
|
1574
|
+
ApiRequester.successResponseParser,
|
|
1575
|
+
),
|
|
1576
|
+
|
|
1454
1577
|
guestGetMeeting: (meetingUuid ) =>
|
|
1455
1578
|
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
1579
|
+
|
|
1580
|
+
guestAuthorizationRequest: (userUuid , meetingUuid , username ) =>
|
|
1581
|
+
client
|
|
1582
|
+
.post(`${baseUrl}/guests/${userUuid}/meetings/${meetingUuid}/authorizations`, { guest_name: username })
|
|
1583
|
+
.then(MeetingAuthorization.parse),
|
|
1584
|
+
|
|
1585
|
+
guestAuthorizationCheck: (userUuid , meetingUuid , authorizationUuid ) =>
|
|
1586
|
+
client.get(`${baseUrl}/guests/${userUuid}/meetings/${meetingUuid}/authorizations/${authorizationUuid}`, null),
|
|
1587
|
+
|
|
1456
1588
|
});
|
|
1457
1589
|
|
|
1458
1590
|
module.exports = confd;
|
package/lib/api/ctid-ng.js
CHANGED
|
@@ -1192,6 +1192,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
1192
1192
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
1193
1193
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
1194
1194
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
1195
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
1195
1196
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
1196
1197
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
1197
1198
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
package/lib/api-client.js
CHANGED
|
@@ -2215,6 +2215,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2215
2215
|
|
|
2216
2216
|
|
|
2217
2217
|
|
|
2218
|
+
|
|
2218
2219
|
) {
|
|
2219
2220
|
const body = {
|
|
2220
2221
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2235,9 +2236,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2235
2236
|
}
|
|
2236
2237
|
|
|
2237
2238
|
if (params.tenantId) {
|
|
2239
|
+
console.warn('Use of `tenantId` is deprecated when calling logIn() method, use `domainName` instead.');
|
|
2238
2240
|
body.tenant_id = params.tenantId;
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2243
|
+
if (params.domainName) {
|
|
2244
|
+
body.domain_name = params.domainName;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2241
2247
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2242
2248
|
},
|
|
2243
2249
|
|
|
@@ -2250,6 +2256,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2250
2256
|
expiration ,
|
|
2251
2257
|
isMobile = false,
|
|
2252
2258
|
tenantId ,
|
|
2259
|
+
domainName ,
|
|
2253
2260
|
) => {
|
|
2254
2261
|
const body = {
|
|
2255
2262
|
backend: backend || DEFAULT_BACKEND_USER,
|
|
@@ -2259,9 +2266,14 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
2268
|
if (tenantId) {
|
|
2269
|
+
console.warn('Use of `tenantId` is deprecated when calling refreshToken() method, use `domainName` instead.');
|
|
2262
2270
|
body.tenant_id = tenantId;
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2273
|
+
if (domainName) {
|
|
2274
|
+
body.domain_name = domainName;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2265
2277
|
const headers = {
|
|
2266
2278
|
'Content-Type': 'application/json',
|
|
2267
2279
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -2631,6 +2643,70 @@ class ExternalApp {
|
|
|
2631
2643
|
|
|
2632
2644
|
//
|
|
2633
2645
|
|
|
2646
|
+
class MeetingAuthorization {
|
|
2647
|
+
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
|
|
2653
|
+
constructor({
|
|
2654
|
+
meetingUuid,
|
|
2655
|
+
uuid,
|
|
2656
|
+
userUuid,
|
|
2657
|
+
userName,
|
|
2658
|
+
} = {}) {
|
|
2659
|
+
this.meetingUuid = meetingUuid;
|
|
2660
|
+
this.uuid = uuid;
|
|
2661
|
+
this.userUuid = userUuid;
|
|
2662
|
+
this.userName = userName;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
setStatus(status ) {
|
|
2666
|
+
this.status = status;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
getStatus() {
|
|
2670
|
+
return this.status;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
static parse(plain ) {
|
|
2674
|
+
const {
|
|
2675
|
+
meeting_uuid: meetingUuid,
|
|
2676
|
+
uuid,
|
|
2677
|
+
guest_uuid: userUuid,
|
|
2678
|
+
guest_name: userName,
|
|
2679
|
+
} = plain;
|
|
2680
|
+
|
|
2681
|
+
return new MeetingAuthorization({
|
|
2682
|
+
meetingUuid,
|
|
2683
|
+
uuid,
|
|
2684
|
+
userUuid,
|
|
2685
|
+
userName,
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
static parseMany(items ) {
|
|
2690
|
+
if (!items) {
|
|
2691
|
+
return [];
|
|
2692
|
+
}
|
|
2693
|
+
return items.map(MeetingAuthorization.parse);
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
//
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
|
|
2703
|
+
|
|
2704
|
+
|
|
2705
|
+
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
|
|
2709
|
+
|
|
2634
2710
|
|
|
2635
2711
|
|
|
2636
2712
|
|
|
@@ -2641,6 +2717,7 @@ class ExternalApp {
|
|
|
2641
2717
|
|
|
2642
2718
|
|
|
2643
2719
|
|
|
2720
|
+
|
|
2644
2721
|
|
|
2645
2722
|
|
|
2646
2723
|
class Meeting {
|
|
@@ -2655,6 +2732,8 @@ class Meeting {
|
|
|
2655
2732
|
|
|
2656
2733
|
|
|
2657
2734
|
|
|
2735
|
+
|
|
2736
|
+
|
|
2658
2737
|
|
|
2659
2738
|
static parse(plain ) {
|
|
2660
2739
|
return new Meeting({
|
|
@@ -2667,6 +2746,7 @@ class Meeting {
|
|
|
2667
2746
|
extension: plain.exten,
|
|
2668
2747
|
persistent: plain.persistent,
|
|
2669
2748
|
creationTime: moment__default['default'](plain.creation_time).toDate(),
|
|
2749
|
+
requireAuthorization: plain.require_authorization,
|
|
2670
2750
|
});
|
|
2671
2751
|
}
|
|
2672
2752
|
|
|
@@ -2691,6 +2771,7 @@ class Meeting {
|
|
|
2691
2771
|
extension,
|
|
2692
2772
|
persistent,
|
|
2693
2773
|
creationTime,
|
|
2774
|
+
requireAuthorization,
|
|
2694
2775
|
} = {}) {
|
|
2695
2776
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2696
2777
|
this.uri = uri;
|
|
@@ -2701,6 +2782,7 @@ class Meeting {
|
|
|
2701
2782
|
this.extension = extension;
|
|
2702
2783
|
this.persistent = persistent;
|
|
2703
2784
|
this.creationTime = creationTime;
|
|
2785
|
+
this.requireAuthorization = requireAuthorization;
|
|
2704
2786
|
|
|
2705
2787
|
// Useful to compare instead of instanceof with minified code
|
|
2706
2788
|
this.type = 'Meeting';
|
|
@@ -2711,8 +2793,32 @@ class Meeting {
|
|
|
2711
2793
|
const [username, secret] = atob(this.guestSipAuthorization).split(':');
|
|
2712
2794
|
return { username, secret };
|
|
2713
2795
|
}
|
|
2796
|
+
|
|
2714
2797
|
}
|
|
2715
2798
|
|
|
2799
|
+
//
|
|
2800
|
+
|
|
2801
|
+
const camelToUnderscore = (key ) => {
|
|
2802
|
+
if (typeof key !== 'string') {
|
|
2803
|
+
throw new Error('Input is not a string');
|
|
2804
|
+
}
|
|
2805
|
+
return key.charAt(0).toLowerCase() + key.substring(1).replace(/([A-Z])/g, '_$1').toLowerCase();
|
|
2806
|
+
};
|
|
2807
|
+
|
|
2808
|
+
//
|
|
2809
|
+
|
|
2810
|
+
const convertKeysFromCamelToUnderscore = (args ) => {
|
|
2811
|
+
if (!args || typeof args !== 'object' || Array.isArray(args)) {
|
|
2812
|
+
throw new Error('Input is not an object');
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
return Object.keys(args).reduce((acc, key) => {
|
|
2816
|
+
acc[camelToUnderscore(key)] = typeof args[key] === 'object' && !Array.isArray(args[key])
|
|
2817
|
+
? convertKeysFromCamelToUnderscore(args[key]) : args[key];
|
|
2818
|
+
return acc;
|
|
2819
|
+
}, {});
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2716
2822
|
/* */
|
|
2717
2823
|
|
|
2718
2824
|
var confdMethods = (client , baseUrl ) => ({
|
|
@@ -2781,8 +2887,18 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2781
2887
|
getMyMeetings: () =>
|
|
2782
2888
|
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2783
2889
|
|
|
2784
|
-
createMyMeeting: (
|
|
2785
|
-
client
|
|
2890
|
+
createMyMeeting: (args ) =>
|
|
2891
|
+
client
|
|
2892
|
+
.post(`${baseUrl}/users/me/meetings`, convertKeysFromCamelToUnderscore(args))
|
|
2893
|
+
.then(Meeting.parse),
|
|
2894
|
+
|
|
2895
|
+
updateMyMeeting: (meetingUuid , data ) =>
|
|
2896
|
+
client.put(
|
|
2897
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}`,
|
|
2898
|
+
convertKeysFromCamelToUnderscore(data),
|
|
2899
|
+
null,
|
|
2900
|
+
ApiRequester.successResponseParser,
|
|
2901
|
+
),
|
|
2786
2902
|
|
|
2787
2903
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2788
2904
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -2790,8 +2906,36 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2790
2906
|
getMeeting: (meetingUuid ) =>
|
|
2791
2907
|
client.get(`${baseUrl}/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
2792
2908
|
|
|
2909
|
+
meetingAuthorizations: (meetingUuid ) =>
|
|
2910
|
+
client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations`, null).then(MeetingAuthorization.parseMany),
|
|
2911
|
+
|
|
2912
|
+
meetingAuthorizationReject: (meetingUuid , authorizationUuid ) =>
|
|
2913
|
+
client.put(
|
|
2914
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations/${authorizationUuid}/reject`,
|
|
2915
|
+
{},
|
|
2916
|
+
null,
|
|
2917
|
+
ApiRequester.successResponseParser,
|
|
2918
|
+
),
|
|
2919
|
+
|
|
2920
|
+
meetingAuthorizationAccept: (meetingUuid , authorizationUuid ) =>
|
|
2921
|
+
client.put(
|
|
2922
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}/authorizations/${authorizationUuid}/accept`,
|
|
2923
|
+
{},
|
|
2924
|
+
null,
|
|
2925
|
+
ApiRequester.successResponseParser,
|
|
2926
|
+
),
|
|
2927
|
+
|
|
2793
2928
|
guestGetMeeting: (meetingUuid ) =>
|
|
2794
2929
|
client.get(`${baseUrl}/guests/me/meetings/${meetingUuid}`, null).then(Meeting.parse),
|
|
2930
|
+
|
|
2931
|
+
guestAuthorizationRequest: (userUuid , meetingUuid , username ) =>
|
|
2932
|
+
client
|
|
2933
|
+
.post(`${baseUrl}/guests/${userUuid}/meetings/${meetingUuid}/authorizations`, { guest_name: username })
|
|
2934
|
+
.then(MeetingAuthorization.parse),
|
|
2935
|
+
|
|
2936
|
+
guestAuthorizationCheck: (userUuid , meetingUuid , authorizationUuid ) =>
|
|
2937
|
+
client.get(`${baseUrl}/guests/${userUuid}/meetings/${meetingUuid}/authorizations/${authorizationUuid}`, null),
|
|
2938
|
+
|
|
2795
2939
|
});
|
|
2796
2940
|
|
|
2797
2941
|
//
|
|
@@ -3556,6 +3700,7 @@ global.wazoClientId = global.wazoClientId || {};
|
|
|
3556
3700
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
3557
3701
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
3558
3702
|
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
3703
|
+
global.wazoRefreshDomainName = global.wazoRefreshDomainName || {};
|
|
3559
3704
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
3560
3705
|
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
3561
3706
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
@@ -4230,6 +4375,14 @@ var calldMethods = (client , baseUrl ) => ({
|
|
|
4230
4375
|
getMeetingParticipantsAsUser: async (meetingUuid ) =>
|
|
4231
4376
|
client.get(`${baseUrl}/users/me/meetings/${meetingUuid}/participants`),
|
|
4232
4377
|
|
|
4378
|
+
banMeetingParticipant: (meetingUuid , participantUuid ) =>
|
|
4379
|
+
client.delete(
|
|
4380
|
+
`${baseUrl}/users/me/meetings/${meetingUuid}/participants/${participantUuid}`,
|
|
4381
|
+
null,
|
|
4382
|
+
null,
|
|
4383
|
+
ApiRequester.successResponseParser,
|
|
4384
|
+
),
|
|
4385
|
+
|
|
4233
4386
|
listTrunks: () => client.get(`${baseUrl}/trunks`),
|
|
4234
4387
|
|
|
4235
4388
|
mute: (callId ) =>
|
|
@@ -4607,6 +4760,7 @@ class ApiClient {
|
|
|
4607
4760
|
|
|
4608
4761
|
|
|
4609
4762
|
|
|
4763
|
+
|
|
4610
4764
|
|
|
4611
4765
|
|
|
4612
4766
|
|
|
@@ -4648,6 +4802,7 @@ class ApiClient {
|
|
|
4648
4802
|
refreshToken: this.refreshToken,
|
|
4649
4803
|
refreshBackend: this.refreshBackend,
|
|
4650
4804
|
refreshTenantId: this.refreshTenantId,
|
|
4805
|
+
refreshDomainName: this.refreshDomainName,
|
|
4651
4806
|
refreshExpiration: this.refreshExpiration,
|
|
4652
4807
|
isMobile: this.isMobile,
|
|
4653
4808
|
});
|
|
@@ -4663,6 +4818,7 @@ class ApiClient {
|
|
|
4663
4818
|
this.refreshExpiration,
|
|
4664
4819
|
this.isMobile,
|
|
4665
4820
|
this.refreshTenantId,
|
|
4821
|
+
this.refreshDomainName,
|
|
4666
4822
|
);
|
|
4667
4823
|
|
|
4668
4824
|
logger.info('token refreshed', { token: session.token });
|
|
@@ -4716,9 +4872,14 @@ class ApiClient {
|
|
|
4716
4872
|
}
|
|
4717
4873
|
|
|
4718
4874
|
setRefreshTenantId(tenantId ) {
|
|
4875
|
+
console.warn('Use of `setRefreshTenantId` is deprecated, use `setRefreshDomainName` instead');
|
|
4719
4876
|
this.refreshTenantId = tenantId;
|
|
4720
4877
|
}
|
|
4721
4878
|
|
|
4879
|
+
setRefreshDomainName(domainName ) {
|
|
4880
|
+
this.refreshDomainName = domainName;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4722
4883
|
setIsMobile(isMobile ) {
|
|
4723
4884
|
this.isMobile = isMobile;
|
|
4724
4885
|
}
|