@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
class MeetingAuthorization {
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
constructor({
|
|
13
|
+
meetingUuid,
|
|
14
|
+
uuid,
|
|
15
|
+
userUuid,
|
|
16
|
+
userName,
|
|
17
|
+
} = {}) {
|
|
18
|
+
this.meetingUuid = meetingUuid;
|
|
19
|
+
this.uuid = uuid;
|
|
20
|
+
this.userUuid = userUuid;
|
|
21
|
+
this.userName = userName;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
setStatus(status ) {
|
|
25
|
+
this.status = status;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getStatus() {
|
|
29
|
+
return this.status;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static parse(plain ) {
|
|
33
|
+
const {
|
|
34
|
+
meeting_uuid: meetingUuid,
|
|
35
|
+
uuid,
|
|
36
|
+
guest_uuid: userUuid,
|
|
37
|
+
guest_name: userName,
|
|
38
|
+
} = plain;
|
|
39
|
+
|
|
40
|
+
return new MeetingAuthorization({
|
|
41
|
+
meetingUuid,
|
|
42
|
+
uuid,
|
|
43
|
+
userUuid,
|
|
44
|
+
userName,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static parseMany(items ) {
|
|
49
|
+
if (!items) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
return items.map(MeetingAuthorization.parse);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
describe('MeetingAuthorization', () => {
|
|
57
|
+
describe('parse', () => {
|
|
58
|
+
it('should parse a raw input', () => {
|
|
59
|
+
const rawAuthorization = {
|
|
60
|
+
created_at: 'today',
|
|
61
|
+
meeting_uuid: 'meeting_uuid',
|
|
62
|
+
uuid: 'uuid',
|
|
63
|
+
guest_uuid: 'guest_uuid',
|
|
64
|
+
guest_name: 'guest_name',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const authorization = {
|
|
68
|
+
meetingUuid: rawAuthorization.meeting_uuid,
|
|
69
|
+
uuid: rawAuthorization.uuid,
|
|
70
|
+
userUuid: rawAuthorization.guest_uuid,
|
|
71
|
+
userName: rawAuthorization.guest_name,
|
|
72
|
+
status: undefined,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const response = MeetingAuthorization.parse(rawAuthorization);
|
|
76
|
+
expect(response).toEqual(authorization);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('parseMany', () => {
|
|
81
|
+
it('should parse multiple raw inputs', () => {
|
|
82
|
+
const rawAuthorizations = [
|
|
83
|
+
{
|
|
84
|
+
created_at: 'today1',
|
|
85
|
+
meeting_uuid: 'meeting_uuid1',
|
|
86
|
+
uuid: 'uuid1',
|
|
87
|
+
guest_uuid: 'guest_uuid1',
|
|
88
|
+
guest_name: 'guest_name1',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
created_at: 'today2',
|
|
92
|
+
meeting_uuid: 'meeting_uuid2',
|
|
93
|
+
uuid: 'uuid2',
|
|
94
|
+
guest_uuid: 'guest_uuid2',
|
|
95
|
+
guest_name: 'guest_name2',
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const authorizations = rawAuthorizations.map(rawAuthorization => ({
|
|
100
|
+
meetingUuid: rawAuthorization.meeting_uuid,
|
|
101
|
+
uuid: rawAuthorization.uuid,
|
|
102
|
+
userUuid: rawAuthorization.guest_uuid,
|
|
103
|
+
userName: rawAuthorization.guest_name,
|
|
104
|
+
status: undefined,
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const response = MeetingAuthorization.parseMany(rawAuthorizations);
|
|
108
|
+
expect(response).toEqual(authorizations);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|