@wazo/sdk 0.39.14 → 0.40.0
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/README.md +2 -2
- package/dist/wazo-sdk.js +12 -12
- package/esm/__tests__/api-client.test.js +0 -10
- package/esm/__tests__/web-rtc-client.test.js +2 -15
- package/esm/api/amid.js +12 -4
- package/esm/api/chatd.js +0 -1
- package/esm/api/dird.js +7 -10
- package/esm/checker/checks/ice-ipv4.js +2 -3
- package/esm/checker/checks/symmetric-nat.js +7 -4
- package/esm/domain/AdHocAPIConference.js +1 -1
- package/esm/domain/CallLog.js +1 -1
- package/esm/domain/Contact.js +2 -1
- package/esm/domain/MeetingAuthorization.js +6 -0
- package/esm/domain/Phone/CTIPhone.js +2 -0
- package/esm/domain/Phone/WebRTCPhone.js +23 -18
- package/esm/domain/Session.js +2 -2
- package/esm/domain/__tests__/Agent.test.js +0 -2
- package/esm/domain/__tests__/Call.test.js +0 -1
- package/esm/domain/__tests__/CallLog.test.js +0 -1
- package/esm/domain/__tests__/CallSession.test.js +1 -2
- package/esm/domain/__tests__/Contact.test.js +2 -4
- package/esm/domain/__tests__/IndirectTransfer.test.js +0 -1
- package/esm/domain/__tests__/Profile.test.js +0 -1
- package/esm/domain/__tests__/Room.test.js +1 -25
- package/esm/domain/__tests__/Session.test.js +13 -14
- package/esm/domain/__tests__/SipLine.test.js +2 -3
- package/esm/index.js +42 -88
- package/esm/lib/WazoSessionDescriptionHandler.js +9 -15
- package/esm/service/IssueReporter.js +1 -3
- package/esm/service/__tests__/IssueReporter.test.js +0 -1
- package/esm/simple/Phone.js +1 -1
- package/esm/simple/Websocket.js +2 -2
- package/esm/simple/index.js +5 -4
- package/esm/simple/room/Room.js +15 -15
- package/esm/simple/room/SipRoom.js +1 -1
- package/esm/simple/room/Stream.js +1 -2
- package/esm/simple/room/__tests__/Participant.test.js +0 -2
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +1 -2
- package/esm/types/api/amid.d.ts.map +1 -1
- package/esm/types/api/auth.d.ts +2 -2
- package/esm/types/api/auth.d.ts.map +1 -1
- package/esm/types/api/call-logd.d.ts +3 -3
- package/esm/types/api/call-logd.d.ts.map +1 -1
- package/esm/types/api/chatd.d.ts +9 -22
- package/esm/types/api/chatd.d.ts.map +1 -1
- package/esm/types/api/dird.d.ts +21 -14
- package/esm/types/api/dird.d.ts.map +1 -1
- package/esm/types/checker/checks/ice-ipv4.d.ts.map +1 -1
- package/esm/types/checker/checks/index.d.ts +1 -1
- package/esm/types/checker/checks/symmetric-nat.d.ts.map +1 -1
- package/esm/types/checker/checks/webrtc-transport.d.ts +2 -2
- package/esm/types/checker/checks/webrtc-transport.d.ts.map +1 -1
- package/esm/types/domain/Agent.d.ts +1 -1
- package/esm/types/domain/Agent.d.ts.map +1 -1
- package/esm/types/domain/CallLog.d.ts +14 -26
- package/esm/types/domain/CallLog.d.ts.map +1 -1
- package/esm/types/domain/CallSession.d.ts +3 -4
- package/esm/types/domain/CallSession.d.ts.map +1 -1
- package/esm/types/domain/Contact.d.ts +8 -0
- package/esm/types/domain/Contact.d.ts.map +1 -1
- package/esm/types/domain/MeetingAuthorization.d.ts +6 -0
- package/esm/types/domain/MeetingAuthorization.d.ts.map +1 -1
- package/esm/types/domain/Phone/CTIPhone.d.ts +2 -0
- package/esm/types/domain/Phone/CTIPhone.d.ts.map +1 -1
- package/esm/types/domain/Phone/Phone.d.ts +12 -2
- package/esm/types/domain/Phone/Phone.d.ts.map +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts +24 -20
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/esm/types/domain/Room.d.ts +10 -12
- package/esm/types/domain/Room.d.ts.map +1 -1
- package/esm/types/domain/Session.d.ts +1 -1
- package/esm/types/domain/Session.d.ts.map +1 -1
- package/esm/types/domain/SipLine.d.ts +3 -3
- package/esm/types/domain/SipLine.d.ts.map +1 -1
- package/esm/types/domain/types.d.ts +64 -10
- package/esm/types/domain/types.d.ts.map +1 -1
- package/esm/types/index.d.ts +51 -314
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts +5 -4
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/esm/types/service/CallApi.d.ts +3 -3
- package/esm/types/service/CallApi.d.ts.map +1 -1
- package/esm/types/service/IssueReporter.d.ts.map +1 -1
- package/esm/types/simple/Auth.d.ts +0 -40
- package/esm/types/simple/Auth.d.ts.map +1 -1
- package/esm/types/simple/Phone.d.ts +0 -113
- package/esm/types/simple/Phone.d.ts.map +1 -1
- package/esm/types/simple/Websocket.d.ts +0 -16
- package/esm/types/simple/Websocket.d.ts.map +1 -1
- package/esm/types/simple/index.d.ts +8 -8
- package/esm/types/simple/index.d.ts.map +1 -1
- package/esm/types/simple/room/Participant.d.ts +4 -3
- package/esm/types/simple/room/Participant.d.ts.map +1 -1
- package/esm/types/simple/room/Room.d.ts +29 -18
- package/esm/types/simple/room/Room.d.ts.map +1 -1
- package/esm/types/simple/room/SipRoom.d.ts +1 -1
- package/esm/types/simple/room/SipRoom.d.ts.map +1 -1
- package/esm/types/simple/room/Stream.d.ts +1 -1
- package/esm/types/simple/room/Stream.d.ts.map +1 -1
- package/esm/types/utils/PhoneNumberUtil.d.ts +1 -1
- package/esm/types/utils/PhoneNumberUtil.d.ts.map +1 -1
- package/esm/types/utils/api-requester.d.ts +1 -1
- package/esm/types/utils/api-requester.d.ts.map +1 -1
- package/esm/types/utils/sdp.d.ts +20 -5
- package/esm/types/utils/sdp.d.ts.map +1 -1
- package/esm/types/web-rtc-client.d.ts +51 -49
- package/esm/types/web-rtc-client.d.ts.map +1 -1
- package/esm/types/websocket-client.d.ts.map +1 -1
- package/esm/utils/__tests__/PhoneNumberUtil.test.js +0 -6
- package/esm/utils/__tests__/api-requester.test.js +0 -2
- package/esm/utils/__tests__/sdp.test.js +4 -18
- package/esm/utils/api-requester.js +1 -2
- package/esm/utils/sdp.js +8 -3
- package/esm/web-rtc-client.js +99 -136
- package/esm/websocket-client.js +1 -2
- package/index.js +1 -0
- package/lib/__tests__/api-client.test.js +0 -10
- package/lib/__tests__/web-rtc-client.test.js +2 -15
- package/lib/api/amid.js +12 -4
- package/lib/api/chatd.js +0 -1
- package/lib/api/dird.js +19 -22
- package/lib/checker/checks/ice-ipv4.js +2 -3
- package/lib/checker/checks/symmetric-nat.js +7 -4
- package/lib/domain/AdHocAPIConference.js +1 -1
- package/lib/domain/CallLog.js +1 -1
- package/lib/domain/Contact.js +2 -1
- package/lib/domain/MeetingAuthorization.js +6 -0
- package/lib/domain/Phone/CTIPhone.js +2 -0
- package/lib/domain/Phone/WebRTCPhone.js +23 -18
- package/lib/domain/Session.js +2 -2
- package/lib/domain/__tests__/Agent.test.js +0 -2
- package/lib/domain/__tests__/Call.test.js +0 -1
- package/lib/domain/__tests__/CallLog.test.js +0 -1
- package/lib/domain/__tests__/CallSession.test.js +1 -2
- package/lib/domain/__tests__/Contact.test.js +2 -4
- package/lib/domain/__tests__/IndirectTransfer.test.js +0 -1
- package/lib/domain/__tests__/Profile.test.js +0 -1
- package/lib/domain/__tests__/Room.test.js +1 -25
- package/lib/domain/__tests__/Session.test.js +13 -14
- package/lib/domain/__tests__/SipLine.test.js +2 -3
- package/lib/index.js +93 -99
- package/lib/lib/WazoSessionDescriptionHandler.js +9 -15
- package/lib/service/IssueReporter.js +1 -3
- package/lib/service/__tests__/IssueReporter.test.js +0 -1
- package/lib/simple/Phone.js +1 -1
- package/lib/simple/Websocket.js +2 -2
- package/lib/simple/index.js +2 -1
- package/lib/simple/room/Room.js +17 -15
- package/lib/simple/room/SipRoom.js +1 -1
- package/lib/simple/room/Stream.js +1 -2
- package/lib/simple/room/__tests__/Participant.test.js +0 -2
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +1 -2
- package/lib/types/api/amid.d.ts.map +1 -1
- package/lib/types/api/auth.d.ts +2 -2
- package/lib/types/api/auth.d.ts.map +1 -1
- package/lib/types/api/call-logd.d.ts +3 -3
- package/lib/types/api/call-logd.d.ts.map +1 -1
- package/lib/types/api/chatd.d.ts +9 -22
- package/lib/types/api/chatd.d.ts.map +1 -1
- package/lib/types/api/dird.d.ts +21 -14
- package/lib/types/api/dird.d.ts.map +1 -1
- package/lib/types/checker/checks/ice-ipv4.d.ts.map +1 -1
- package/lib/types/checker/checks/index.d.ts +1 -1
- package/lib/types/checker/checks/symmetric-nat.d.ts.map +1 -1
- package/lib/types/checker/checks/webrtc-transport.d.ts +2 -2
- package/lib/types/checker/checks/webrtc-transport.d.ts.map +1 -1
- package/lib/types/domain/Agent.d.ts +1 -1
- package/lib/types/domain/Agent.d.ts.map +1 -1
- package/lib/types/domain/CallLog.d.ts +14 -26
- package/lib/types/domain/CallLog.d.ts.map +1 -1
- package/lib/types/domain/CallSession.d.ts +3 -4
- package/lib/types/domain/CallSession.d.ts.map +1 -1
- package/lib/types/domain/Contact.d.ts +8 -0
- package/lib/types/domain/Contact.d.ts.map +1 -1
- package/lib/types/domain/MeetingAuthorization.d.ts +6 -0
- package/lib/types/domain/MeetingAuthorization.d.ts.map +1 -1
- package/lib/types/domain/Phone/CTIPhone.d.ts +2 -0
- package/lib/types/domain/Phone/CTIPhone.d.ts.map +1 -1
- package/lib/types/domain/Phone/Phone.d.ts +12 -2
- package/lib/types/domain/Phone/Phone.d.ts.map +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +24 -20
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/lib/types/domain/Room.d.ts +10 -12
- package/lib/types/domain/Room.d.ts.map +1 -1
- package/lib/types/domain/Session.d.ts +1 -1
- package/lib/types/domain/Session.d.ts.map +1 -1
- package/lib/types/domain/SipLine.d.ts +3 -3
- package/lib/types/domain/SipLine.d.ts.map +1 -1
- package/lib/types/domain/types.d.ts +64 -10
- package/lib/types/domain/types.d.ts.map +1 -1
- package/lib/types/index.d.ts +51 -314
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts +5 -4
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/lib/types/service/CallApi.d.ts +3 -3
- package/lib/types/service/CallApi.d.ts.map +1 -1
- package/lib/types/service/IssueReporter.d.ts.map +1 -1
- package/lib/types/simple/Auth.d.ts +0 -40
- package/lib/types/simple/Auth.d.ts.map +1 -1
- package/lib/types/simple/Phone.d.ts +0 -113
- package/lib/types/simple/Phone.d.ts.map +1 -1
- package/lib/types/simple/Websocket.d.ts +0 -16
- package/lib/types/simple/Websocket.d.ts.map +1 -1
- package/lib/types/simple/index.d.ts +8 -8
- package/lib/types/simple/index.d.ts.map +1 -1
- package/lib/types/simple/room/Participant.d.ts +4 -3
- package/lib/types/simple/room/Participant.d.ts.map +1 -1
- package/lib/types/simple/room/Room.d.ts +29 -18
- package/lib/types/simple/room/Room.d.ts.map +1 -1
- package/lib/types/simple/room/SipRoom.d.ts +1 -1
- package/lib/types/simple/room/SipRoom.d.ts.map +1 -1
- package/lib/types/simple/room/Stream.d.ts +1 -1
- package/lib/types/simple/room/Stream.d.ts.map +1 -1
- package/lib/types/utils/PhoneNumberUtil.d.ts +1 -1
- package/lib/types/utils/PhoneNumberUtil.d.ts.map +1 -1
- package/lib/types/utils/api-requester.d.ts +1 -1
- package/lib/types/utils/api-requester.d.ts.map +1 -1
- package/lib/types/utils/sdp.d.ts +20 -5
- package/lib/types/utils/sdp.d.ts.map +1 -1
- package/lib/types/web-rtc-client.d.ts +51 -49
- package/lib/types/web-rtc-client.d.ts.map +1 -1
- package/lib/types/websocket-client.d.ts.map +1 -1
- package/lib/utils/__tests__/PhoneNumberUtil.test.js +0 -6
- package/lib/utils/__tests__/api-requester.test.js +0 -2
- package/lib/utils/__tests__/sdp.test.js +6 -18
- package/lib/utils/api-requester.js +2 -3
- package/lib/utils/sdp.js +9 -3
- package/lib/web-rtc-client.js +105 -140
- package/lib/websocket-client.js +1 -2
- package/package.json +5 -18
- package/src/__tests__/api-client.test.ts +10 -19
- package/src/__tests__/web-rtc-client.test.ts +13 -25
- package/src/api/amid.ts +13 -4
- package/src/api/auth.ts +2 -5
- package/src/api/call-logd.ts +3 -3
- package/src/api/chatd.ts +10 -24
- package/src/api/dird.ts +33 -39
- package/src/checker/checks/ice-ipv4.ts +4 -5
- package/src/checker/checks/symmetric-nat.ts +11 -7
- package/src/checker/checks/webrtc-transport.ts +2 -2
- package/src/domain/AdHocAPIConference.ts +1 -1
- package/src/domain/Agent.ts +1 -1
- package/src/domain/CallLog.ts +19 -27
- package/src/domain/CallSession.ts +3 -4
- package/src/domain/Contact.ts +3 -1
- package/src/domain/MeetingAuthorization.ts +13 -0
- package/src/domain/Phone/CTIPhone.ts +4 -0
- package/src/domain/Phone/Phone.ts +11 -2
- package/src/domain/Phone/WebRTCPhone.ts +60 -52
- package/src/domain/Room.ts +12 -14
- package/src/domain/Session.ts +3 -3
- package/src/domain/SipLine.ts +3 -3
- package/src/domain/__tests__/Agent.test.ts +3 -5
- package/src/domain/__tests__/Call.test.ts +4 -5
- package/src/domain/__tests__/CallLog.test.ts +1 -3
- package/src/domain/__tests__/CallSession.test.ts +10 -11
- package/src/domain/__tests__/Contact.test.ts +2 -4
- package/src/domain/__tests__/IndirectTransfer.test.ts +6 -7
- package/src/domain/__tests__/Profile.test.ts +3 -4
- package/src/domain/__tests__/Room.test.ts +27 -51
- package/src/domain/__tests__/Session.test.ts +27 -28
- package/src/domain/__tests__/SipLine.test.ts +4 -5
- package/src/domain/types.ts +64 -11
- package/src/index.ts +51 -111
- package/src/lib/WazoSessionDescriptionHandler.ts +24 -30
- package/src/service/CallApi.ts +3 -3
- package/src/service/IssueReporter.ts +3 -5
- package/src/service/__tests__/IssueReporter.test.ts +1 -2
- package/src/simple/Auth.ts +1 -41
- package/src/simple/Phone.ts +9 -116
- package/src/simple/Websocket.ts +4 -20
- package/src/simple/index.ts +8 -7
- package/src/simple/room/Participant.ts +4 -3
- package/src/simple/room/Room.ts +44 -36
- package/src/simple/room/SipRoom.ts +4 -4
- package/src/simple/room/Stream.ts +2 -3
- package/src/simple/room/__tests__/Participant.test.ts +2 -4
- package/src/simple/room/__tests__/RemoteParticipant.test.ts +4 -3
- package/src/types/wazo.d.ts +1 -0
- package/src/utils/PhoneNumberUtil.ts +1 -1
- package/src/utils/__tests__/PhoneNumberUtil.test.ts +0 -6
- package/src/utils/__tests__/api-requester.test.ts +3 -4
- package/src/utils/__tests__/sdp.test.ts +16 -30
- package/src/utils/api-requester.ts +1 -4
- package/src/utils/sdp.ts +38 -17
- package/src/web-rtc-client.ts +196 -234
- package/src/websocket-client.ts +2 -3
- package/lib/.DS_Store +0 -0
|
@@ -21,7 +21,6 @@ describe('Room', () => {
|
|
|
21
21
|
const number = 'some-number';
|
|
22
22
|
const room = new Room_1.default({
|
|
23
23
|
id: 'some-id',
|
|
24
|
-
// @ts-expect-error
|
|
25
24
|
connectedCallSession: new CallSession_1.default({
|
|
26
25
|
number,
|
|
27
26
|
}),
|
|
@@ -45,11 +44,9 @@ describe('Room', () => {
|
|
|
45
44
|
});
|
|
46
45
|
describe('on connect call', () => {
|
|
47
46
|
it('should add call to room', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
// @ts-expect-error
|
|
49
47
|
const room = new Room_1.default({
|
|
50
48
|
id: 'some-id',
|
|
51
49
|
});
|
|
52
|
-
// @ts-expect-error
|
|
53
50
|
const callSession = new CallSession_1.default({
|
|
54
51
|
callId: 'some-call-id',
|
|
55
52
|
});
|
|
@@ -60,11 +57,9 @@ describe('Room', () => {
|
|
|
60
57
|
describe('on room has call', () => {
|
|
61
58
|
describe('given no connected call', () => {
|
|
62
59
|
it('should be false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
// @ts-expect-error
|
|
64
60
|
const room = new Room_1.default({
|
|
65
61
|
connectedCallSession: null,
|
|
66
62
|
});
|
|
67
|
-
// @ts-expect-error
|
|
68
63
|
const callSession = new CallSession_1.default({});
|
|
69
64
|
const roomHasCall = room.has(callSession);
|
|
70
65
|
expect(roomHasCall).toBeFalsy();
|
|
@@ -72,11 +67,9 @@ describe('Room', () => {
|
|
|
72
67
|
});
|
|
73
68
|
describe('given a connected call', () => {
|
|
74
69
|
it('should be true if same calls', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
// @ts-expect-error
|
|
76
70
|
const callSession = new CallSession_1.default({
|
|
77
71
|
callId: 'some-call-id',
|
|
78
72
|
});
|
|
79
|
-
// @ts-expect-error
|
|
80
73
|
const room = new Room_1.default({
|
|
81
74
|
connectedCallSession: callSession,
|
|
82
75
|
});
|
|
@@ -84,15 +77,12 @@ describe('Room', () => {
|
|
|
84
77
|
expect(roomHasCall).toBeTruthy();
|
|
85
78
|
}));
|
|
86
79
|
it('should be false if different calls', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
-
// @ts-expect-error
|
|
88
80
|
const call1 = new CallSession_1.default({
|
|
89
81
|
callId: 'some-call-id',
|
|
90
82
|
});
|
|
91
|
-
// @ts-expect-error
|
|
92
83
|
const call2 = new CallSession_1.default({
|
|
93
84
|
callId: 'some-other-call-id',
|
|
94
85
|
});
|
|
95
|
-
// @ts-expect-error
|
|
96
86
|
const room = new Room_1.default({
|
|
97
87
|
connectedCallSession: call1,
|
|
98
88
|
});
|
|
@@ -106,7 +96,6 @@ describe('Room', () => {
|
|
|
106
96
|
const participants = [{}];
|
|
107
97
|
const room = new Room_1.default({
|
|
108
98
|
connectedCallSession: null,
|
|
109
|
-
// @ts-expect-error
|
|
110
99
|
participants,
|
|
111
100
|
});
|
|
112
101
|
const participantUuid = 'some-uuid';
|
|
@@ -119,7 +108,6 @@ describe('Room', () => {
|
|
|
119
108
|
describe('on room has call with id', () => {
|
|
120
109
|
describe('given no connected call', () => {
|
|
121
110
|
it('should be false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
-
// @ts-expect-error
|
|
123
111
|
const room = new Room_1.default({
|
|
124
112
|
connectedCallSession: null,
|
|
125
113
|
});
|
|
@@ -131,9 +119,7 @@ describe('Room', () => {
|
|
|
131
119
|
describe('given a connected call', () => {
|
|
132
120
|
it('should be true if same calls', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
133
121
|
const callId = 'some-call-id';
|
|
134
|
-
// @ts-expect-error
|
|
135
122
|
const room = new Room_1.default({
|
|
136
|
-
// @ts-expect-error
|
|
137
123
|
connectedCallSession: new CallSession_1.default({
|
|
138
124
|
callId,
|
|
139
125
|
}),
|
|
@@ -143,9 +129,7 @@ describe('Room', () => {
|
|
|
143
129
|
}));
|
|
144
130
|
it('should be false if different calls', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
131
|
const callId = 'some-call-id';
|
|
146
|
-
// @ts-expect-error
|
|
147
132
|
const room = new Room_1.default({
|
|
148
|
-
// @ts-expect-error
|
|
149
133
|
connectedCallSession: new CallSession_1.default({
|
|
150
134
|
callId: 'some-other-call-id',
|
|
151
135
|
}),
|
|
@@ -159,7 +143,6 @@ describe('Room', () => {
|
|
|
159
143
|
it('should updated participant with corresponding UUID', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
144
|
const uuid = 'some-uuid';
|
|
161
145
|
const room = new Room_1.default({
|
|
162
|
-
// @ts-expect-error
|
|
163
146
|
participants: [{
|
|
164
147
|
uuid,
|
|
165
148
|
talking: true,
|
|
@@ -173,7 +156,6 @@ describe('Room', () => {
|
|
|
173
156
|
}));
|
|
174
157
|
it('should add participant when not found', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
175
158
|
const uuid = 'some-uuid';
|
|
176
|
-
// @ts-expect-error
|
|
177
159
|
const room = new Room_1.default({
|
|
178
160
|
participants: [],
|
|
179
161
|
});
|
|
@@ -185,16 +167,14 @@ describe('Room', () => {
|
|
|
185
167
|
});
|
|
186
168
|
describe('on updated participant by extension', () => {
|
|
187
169
|
it('should updated participant with corresponding extension', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
-
const extension = 1234;
|
|
170
|
+
const extension = '1234';
|
|
189
171
|
const room = new Room_1.default({
|
|
190
172
|
participants: [{
|
|
191
|
-
// @ts-expect-error
|
|
192
173
|
extension,
|
|
193
174
|
talking: false,
|
|
194
175
|
}],
|
|
195
176
|
});
|
|
196
177
|
expect(room.participants[0].talking).toBeFalsy();
|
|
197
|
-
// @ts-expect-error
|
|
198
178
|
const updatedRoom = room.updateParticipantByExtension(extension, {
|
|
199
179
|
talking: true,
|
|
200
180
|
});
|
|
@@ -203,9 +183,7 @@ describe('Room', () => {
|
|
|
203
183
|
});
|
|
204
184
|
describe('on disconnect', () => {
|
|
205
185
|
it('should destroy connected call', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
206
|
-
// @ts-expect-error
|
|
207
186
|
const room = new Room_1.default({
|
|
208
|
-
// @ts-expect-error
|
|
209
187
|
connectedCallSession: new CallSession_1.default({}),
|
|
210
188
|
});
|
|
211
189
|
expect(room.connectedCallSession).not.toBeNull();
|
|
@@ -217,7 +195,6 @@ describe('Room', () => {
|
|
|
217
195
|
it('should remove participant with corresponding UUID', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
218
196
|
const uuid = 'some-uuid';
|
|
219
197
|
const room = new Room_1.default({
|
|
220
|
-
// @ts-expect-error
|
|
221
198
|
participants: [{
|
|
222
199
|
uuid,
|
|
223
200
|
}],
|
|
@@ -231,7 +208,6 @@ describe('Room', () => {
|
|
|
231
208
|
it('should remove participant with corresponding UUID', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
232
209
|
const extension = 'some-extension';
|
|
233
210
|
const room = new Room_1.default({
|
|
234
|
-
// @ts-expect-error
|
|
235
211
|
participants: [{
|
|
236
212
|
extension,
|
|
237
213
|
}],
|
|
@@ -39,7 +39,6 @@ describe('Session domain', () => {
|
|
|
39
39
|
xivo_user_uuid: null,
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
// @ts-ignore
|
|
43
42
|
const session = Session_1.default.parse(plain);
|
|
44
43
|
expect(session).toEqual(new Session_1.default({
|
|
45
44
|
token: 'b93ae6bd-08d7-4001-9e61-057e72bbc4b3',
|
|
@@ -59,7 +58,7 @@ describe('Session domain', () => {
|
|
|
59
58
|
const session = new Session_1.default({
|
|
60
59
|
token: 'ref-12345',
|
|
61
60
|
uuid: '1234',
|
|
62
|
-
//
|
|
61
|
+
//
|
|
63
62
|
profile: new Profile_1.default({
|
|
64
63
|
voicemail: {
|
|
65
64
|
id: 1234,
|
|
@@ -76,7 +75,7 @@ describe('Session domain', () => {
|
|
|
76
75
|
const session = new Session_1.default({
|
|
77
76
|
token: 'ref-12345',
|
|
78
77
|
uuid: '1234',
|
|
79
|
-
//
|
|
78
|
+
//
|
|
80
79
|
profile: new Profile_1.default({
|
|
81
80
|
lines: [new Line_1.default({
|
|
82
81
|
id: 9012,
|
|
@@ -104,7 +103,7 @@ describe('Session domain', () => {
|
|
|
104
103
|
const session = new Session_1.default({
|
|
105
104
|
token: 'ref-12345',
|
|
106
105
|
uuid: '1234',
|
|
107
|
-
//
|
|
106
|
+
//
|
|
108
107
|
profile: new Profile_1.default({
|
|
109
108
|
lines: [new Line_1.default({
|
|
110
109
|
id: 9012,
|
|
@@ -125,7 +124,7 @@ describe('Session domain', () => {
|
|
|
125
124
|
const session = new Session_1.default({
|
|
126
125
|
token: 'ref-12345',
|
|
127
126
|
uuid: '1234',
|
|
128
|
-
//
|
|
127
|
+
//
|
|
129
128
|
profile: new Profile_1.default({
|
|
130
129
|
voicemail: undefined,
|
|
131
130
|
}),
|
|
@@ -176,7 +175,7 @@ describe('Session domain', () => {
|
|
|
176
175
|
const session = new Session_1.default({
|
|
177
176
|
token: 'ref-12345',
|
|
178
177
|
uuid: '1234',
|
|
179
|
-
//
|
|
178
|
+
//
|
|
180
179
|
profile: new Profile_1.default({
|
|
181
180
|
lines: [new Line_1.default({
|
|
182
181
|
id: 9012,
|
|
@@ -234,7 +233,7 @@ describe('Session domain', () => {
|
|
|
234
233
|
describe('and NO lines', () => {
|
|
235
234
|
beforeEach(() => {
|
|
236
235
|
A_SESSION = new Session_1.default(Object.assign(Object.assign({}, A_SESSION), {
|
|
237
|
-
//
|
|
236
|
+
//
|
|
238
237
|
profile: new Profile_1.default({
|
|
239
238
|
lines: [],
|
|
240
239
|
}) }));
|
|
@@ -253,10 +252,10 @@ describe('Session domain', () => {
|
|
|
253
252
|
exten: '1',
|
|
254
253
|
}],
|
|
255
254
|
id: 1,
|
|
256
|
-
//
|
|
255
|
+
//
|
|
257
256
|
exten: 1,
|
|
258
257
|
});
|
|
259
|
-
//
|
|
258
|
+
//
|
|
260
259
|
const profile = new Profile_1.default({
|
|
261
260
|
lines: [line],
|
|
262
261
|
});
|
|
@@ -275,7 +274,7 @@ describe('Session domain', () => {
|
|
|
275
274
|
});
|
|
276
275
|
describe('and NO lines', () => {
|
|
277
276
|
beforeEach(() => {
|
|
278
|
-
//
|
|
277
|
+
//
|
|
279
278
|
const profile = new Profile_1.default({
|
|
280
279
|
lines: [],
|
|
281
280
|
});
|
|
@@ -295,10 +294,10 @@ describe('Session domain', () => {
|
|
|
295
294
|
exten: '1',
|
|
296
295
|
}],
|
|
297
296
|
id: 1,
|
|
298
|
-
//
|
|
297
|
+
//
|
|
299
298
|
exten: 1,
|
|
300
299
|
});
|
|
301
|
-
//
|
|
300
|
+
//
|
|
302
301
|
const profile = new Profile_1.default({
|
|
303
302
|
lines: [line],
|
|
304
303
|
});
|
|
@@ -327,10 +326,10 @@ describe('Session domain', () => {
|
|
|
327
326
|
exten: '1',
|
|
328
327
|
}],
|
|
329
328
|
id: 1,
|
|
330
|
-
//
|
|
329
|
+
//
|
|
331
330
|
exten: 1,
|
|
332
331
|
});
|
|
333
|
-
//
|
|
332
|
+
//
|
|
334
333
|
const profile = new Profile_1.default({
|
|
335
334
|
lines: [line],
|
|
336
335
|
});
|
|
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// @ts-nocheck
|
|
7
6
|
const SipLine_1 = __importDefault(require("../SipLine"));
|
|
8
7
|
describe('SipLine domain', () => {
|
|
9
8
|
describe('Endpoint (20.13 and higher)', () => {
|
|
10
9
|
it('can tell if we have videoConference capabilities', () => {
|
|
11
|
-
const getSipLine = endpointSectionOptions => new SipLine_1.default({
|
|
10
|
+
const getSipLine = (endpointSectionOptions) => new SipLine_1.default({
|
|
12
11
|
endpointSectionOptions,
|
|
13
12
|
});
|
|
14
13
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
@@ -20,7 +19,7 @@ describe('SipLine domain', () => {
|
|
|
20
19
|
});
|
|
21
20
|
describe('Old Endpoint', () => {
|
|
22
21
|
it('can tell if we have videoConference capabilities', () => {
|
|
23
|
-
const getSipLine = options => new SipLine_1.default({
|
|
22
|
+
const getSipLine = (options) => new SipLine_1.default({
|
|
24
23
|
options,
|
|
25
24
|
});
|
|
26
25
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
package/lib/index.js
CHANGED
|
@@ -10,108 +10,102 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
15
|
};
|
|
25
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
18
|
};
|
|
28
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
const web_rtc_client_1 = __importDefault(require("./web-rtc-client"));
|
|
31
|
-
const websocket_client_1 = __importStar(require("./websocket-client"));
|
|
32
|
-
const Emitter_1 = __importDefault(require("./utils/Emitter"));
|
|
33
|
-
const IssueReporter_1 = __importDefault(require("./service/IssueReporter"));
|
|
34
|
-
// Domain
|
|
35
|
-
const BadResponse_1 = __importDefault(require("./domain/BadResponse"));
|
|
36
|
-
const ServerError_1 = __importDefault(require("./domain/ServerError"));
|
|
37
|
-
const SFUNotAvailableError_1 = __importDefault(require("./domain/SFUNotAvailableError"));
|
|
38
|
-
const Call_1 = __importDefault(require("./domain/Call"));
|
|
39
|
-
const CallLog_1 = __importDefault(require("./domain/CallLog"));
|
|
40
|
-
const Recording_1 = __importDefault(require("./domain/Recording"));
|
|
41
|
-
const ChatMessage_1 = __importDefault(require("./domain/ChatMessage"));
|
|
42
|
-
const ChatRoom_1 = __importDefault(require("./domain/ChatRoom"));
|
|
43
|
-
const Contact_1 = __importDefault(require("./domain/Contact"));
|
|
44
|
-
const Country_1 = __importDefault(require("./domain/Country"));
|
|
45
|
-
const Features_1 = __importDefault(require("./domain/Features"));
|
|
46
|
-
const ForwardOption_1 = __importStar(require("./domain/ForwardOption"));
|
|
47
|
-
const Line_1 = __importDefault(require("./domain/Line"));
|
|
48
|
-
const NotificationOptions_1 = __importDefault(require("./domain/NotificationOptions"));
|
|
49
|
-
const Profile_1 = __importStar(require("./domain/Profile"));
|
|
50
|
-
const Session_1 = __importDefault(require("./domain/Session"));
|
|
51
|
-
const Voicemail_1 = __importDefault(require("./domain/Voicemail"));
|
|
52
|
-
const Relocation_1 = __importDefault(require("./domain/Relocation"));
|
|
53
|
-
const Room_1 = __importDefault(require("./domain/Room"));
|
|
54
|
-
const CallSession_1 = __importDefault(require("./domain/CallSession"));
|
|
55
|
-
const IndirectTransfer_1 = __importDefault(require("./domain/IndirectTransfer"));
|
|
56
|
-
const SwitchboardCall_1 = __importDefault(require("./domain/SwitchboardCall"));
|
|
57
|
-
const WebRTCPhone_1 = __importDefault(require("./domain/Phone/WebRTCPhone"));
|
|
58
|
-
const CTIPhone_1 = __importDefault(require("./domain/Phone/CTIPhone"));
|
|
59
|
-
const Meeting_1 = __importDefault(require("./domain/Meeting"));
|
|
60
|
-
const DebugDevice_1 = __importDefault(require("./domain/Device/DebugDevice"));
|
|
61
|
-
const Checker_1 = __importDefault(require("./checker/Checker"));
|
|
62
|
-
const PhoneNumberUtil_1 = require("./utils/PhoneNumberUtil");
|
|
63
|
-
const api_requester_1 = __importDefault(require("./utils/api-requester"));
|
|
20
|
+
exports.WazoApiClient = exports.WebRTCClient = exports.SOCKET_EVENTS = exports.WebSocketClient = exports.AdHocAPIConference = exports.CallApi = exports.setIsMobile = exports.setOnRefreshTokenError = exports.setOnRefreshToken = exports.setCurrentServer = exports.setApiToken = exports.getApiClient = exports.SipLine = exports.MeetingAuthorization = exports.MeetingStatus = exports.ApiRequester = exports.Checker = exports.DebugDevice = exports.Meeting = exports.CTIPhone = exports.WebRTCPhone = exports.SwitchboardCall = exports.IndirectTransfer = exports.CallSession = exports.Room = exports.Relocation = exports.Voicemail = exports.Session = exports.LINE_STATE = exports.PROFILE_STATE = exports.Profile = exports.NotificationOptions = exports.Line = exports.FORWARD_KEYS = exports.ForwardOption = exports.Features = exports.COUNTRIES = exports.Contact = exports.ChatRoom = exports.ChatMessage = exports.Recording = exports.CallLog = exports.Call = exports.SFUNotAvailableError = exports.ServerError = exports.BadResponse = exports.IssueReporter = exports.Emitter = void 0;
|
|
64
21
|
const index_1 = __importDefault(require("./simple/index"));
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
22
|
+
var Emitter_1 = require("./utils/Emitter");
|
|
23
|
+
Object.defineProperty(exports, "Emitter", { enumerable: true, get: function () { return __importDefault(Emitter_1).default; } });
|
|
24
|
+
var IssueReporter_1 = require("./service/IssueReporter");
|
|
25
|
+
Object.defineProperty(exports, "IssueReporter", { enumerable: true, get: function () { return __importDefault(IssueReporter_1).default; } });
|
|
26
|
+
var BadResponse_1 = require("./domain/BadResponse");
|
|
27
|
+
Object.defineProperty(exports, "BadResponse", { enumerable: true, get: function () { return __importDefault(BadResponse_1).default; } });
|
|
28
|
+
var ServerError_1 = require("./domain/ServerError");
|
|
29
|
+
Object.defineProperty(exports, "ServerError", { enumerable: true, get: function () { return __importDefault(ServerError_1).default; } });
|
|
30
|
+
var SFUNotAvailableError_1 = require("./domain/SFUNotAvailableError");
|
|
31
|
+
Object.defineProperty(exports, "SFUNotAvailableError", { enumerable: true, get: function () { return __importDefault(SFUNotAvailableError_1).default; } });
|
|
32
|
+
var Call_1 = require("./domain/Call");
|
|
33
|
+
Object.defineProperty(exports, "Call", { enumerable: true, get: function () { return __importDefault(Call_1).default; } });
|
|
34
|
+
var CallLog_1 = require("./domain/CallLog");
|
|
35
|
+
Object.defineProperty(exports, "CallLog", { enumerable: true, get: function () { return __importDefault(CallLog_1).default; } });
|
|
36
|
+
var Recording_1 = require("./domain/Recording");
|
|
37
|
+
Object.defineProperty(exports, "Recording", { enumerable: true, get: function () { return __importDefault(Recording_1).default; } });
|
|
38
|
+
var ChatMessage_1 = require("./domain/ChatMessage");
|
|
39
|
+
Object.defineProperty(exports, "ChatMessage", { enumerable: true, get: function () { return __importDefault(ChatMessage_1).default; } });
|
|
40
|
+
var ChatRoom_1 = require("./domain/ChatRoom");
|
|
41
|
+
Object.defineProperty(exports, "ChatRoom", { enumerable: true, get: function () { return __importDefault(ChatRoom_1).default; } });
|
|
42
|
+
var Contact_1 = require("./domain/Contact");
|
|
43
|
+
Object.defineProperty(exports, "Contact", { enumerable: true, get: function () { return __importDefault(Contact_1).default; } });
|
|
44
|
+
var Country_1 = require("./domain/Country");
|
|
45
|
+
Object.defineProperty(exports, "COUNTRIES", { enumerable: true, get: function () { return __importDefault(Country_1).default; } });
|
|
46
|
+
var Features_1 = require("./domain/Features");
|
|
47
|
+
Object.defineProperty(exports, "Features", { enumerable: true, get: function () { return __importDefault(Features_1).default; } });
|
|
48
|
+
var ForwardOption_1 = require("./domain/ForwardOption");
|
|
49
|
+
Object.defineProperty(exports, "ForwardOption", { enumerable: true, get: function () { return __importDefault(ForwardOption_1).default; } });
|
|
50
|
+
Object.defineProperty(exports, "FORWARD_KEYS", { enumerable: true, get: function () { return ForwardOption_1.FORWARD_KEYS; } });
|
|
51
|
+
var Line_1 = require("./domain/Line");
|
|
52
|
+
Object.defineProperty(exports, "Line", { enumerable: true, get: function () { return __importDefault(Line_1).default; } });
|
|
53
|
+
var NotificationOptions_1 = require("./domain/NotificationOptions");
|
|
54
|
+
Object.defineProperty(exports, "NotificationOptions", { enumerable: true, get: function () { return __importDefault(NotificationOptions_1).default; } });
|
|
55
|
+
var Profile_1 = require("./domain/Profile");
|
|
56
|
+
Object.defineProperty(exports, "Profile", { enumerable: true, get: function () { return __importDefault(Profile_1).default; } });
|
|
57
|
+
Object.defineProperty(exports, "PROFILE_STATE", { enumerable: true, get: function () { return Profile_1.STATE; } });
|
|
58
|
+
Object.defineProperty(exports, "LINE_STATE", { enumerable: true, get: function () { return Profile_1.LINE_STATE; } });
|
|
59
|
+
var Session_1 = require("./domain/Session");
|
|
60
|
+
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return __importDefault(Session_1).default; } });
|
|
61
|
+
var Voicemail_1 = require("./domain/Voicemail");
|
|
62
|
+
Object.defineProperty(exports, "Voicemail", { enumerable: true, get: function () { return __importDefault(Voicemail_1).default; } });
|
|
63
|
+
var Relocation_1 = require("./domain/Relocation");
|
|
64
|
+
Object.defineProperty(exports, "Relocation", { enumerable: true, get: function () { return __importDefault(Relocation_1).default; } });
|
|
65
|
+
var Room_1 = require("./domain/Room");
|
|
66
|
+
Object.defineProperty(exports, "Room", { enumerable: true, get: function () { return __importDefault(Room_1).default; } });
|
|
67
|
+
var CallSession_1 = require("./domain/CallSession");
|
|
68
|
+
Object.defineProperty(exports, "CallSession", { enumerable: true, get: function () { return __importDefault(CallSession_1).default; } });
|
|
69
|
+
var IndirectTransfer_1 = require("./domain/IndirectTransfer");
|
|
70
|
+
Object.defineProperty(exports, "IndirectTransfer", { enumerable: true, get: function () { return __importDefault(IndirectTransfer_1).default; } });
|
|
71
|
+
var SwitchboardCall_1 = require("./domain/SwitchboardCall");
|
|
72
|
+
Object.defineProperty(exports, "SwitchboardCall", { enumerable: true, get: function () { return __importDefault(SwitchboardCall_1).default; } });
|
|
73
|
+
var WebRTCPhone_1 = require("./domain/Phone/WebRTCPhone");
|
|
74
|
+
Object.defineProperty(exports, "WebRTCPhone", { enumerable: true, get: function () { return __importDefault(WebRTCPhone_1).default; } });
|
|
75
|
+
var CTIPhone_1 = require("./domain/Phone/CTIPhone");
|
|
76
|
+
Object.defineProperty(exports, "CTIPhone", { enumerable: true, get: function () { return __importDefault(CTIPhone_1).default; } });
|
|
77
|
+
var Meeting_1 = require("./domain/Meeting");
|
|
78
|
+
Object.defineProperty(exports, "Meeting", { enumerable: true, get: function () { return __importDefault(Meeting_1).default; } });
|
|
79
|
+
var DebugDevice_1 = require("./domain/Device/DebugDevice");
|
|
80
|
+
Object.defineProperty(exports, "DebugDevice", { enumerable: true, get: function () { return __importDefault(DebugDevice_1).default; } });
|
|
81
|
+
var Checker_1 = require("./checker/Checker");
|
|
82
|
+
Object.defineProperty(exports, "Checker", { enumerable: true, get: function () { return __importDefault(Checker_1).default; } });
|
|
83
|
+
__exportStar(require("./utils/PhoneNumberUtil"), exports);
|
|
84
|
+
var api_requester_1 = require("./utils/api-requester");
|
|
85
|
+
Object.defineProperty(exports, "ApiRequester", { enumerable: true, get: function () { return __importDefault(api_requester_1).default; } });
|
|
86
|
+
var MeetingStatus_1 = require("./domain/MeetingStatus");
|
|
87
|
+
Object.defineProperty(exports, "MeetingStatus", { enumerable: true, get: function () { return __importDefault(MeetingStatus_1).default; } });
|
|
88
|
+
var MeetingAuthorization_1 = require("./domain/MeetingAuthorization");
|
|
89
|
+
Object.defineProperty(exports, "MeetingAuthorization", { enumerable: true, get: function () { return __importDefault(MeetingAuthorization_1).default; } });
|
|
90
|
+
var SipLine_1 = require("./domain/SipLine");
|
|
91
|
+
Object.defineProperty(exports, "SipLine", { enumerable: true, get: function () { return __importDefault(SipLine_1).default; } });
|
|
92
|
+
var getApiClient_1 = require("./service/getApiClient");
|
|
93
|
+
Object.defineProperty(exports, "getApiClient", { enumerable: true, get: function () { return __importDefault(getApiClient_1).default; } });
|
|
94
|
+
Object.defineProperty(exports, "setApiToken", { enumerable: true, get: function () { return getApiClient_1.setApiToken; } });
|
|
95
|
+
Object.defineProperty(exports, "setCurrentServer", { enumerable: true, get: function () { return getApiClient_1.setCurrentServer; } });
|
|
96
|
+
Object.defineProperty(exports, "setOnRefreshToken", { enumerable: true, get: function () { return getApiClient_1.setOnRefreshToken; } });
|
|
97
|
+
Object.defineProperty(exports, "setOnRefreshTokenError", { enumerable: true, get: function () { return getApiClient_1.setOnRefreshTokenError; } });
|
|
98
|
+
Object.defineProperty(exports, "setIsMobile", { enumerable: true, get: function () { return getApiClient_1.setIsMobile; } });
|
|
99
|
+
var CallApi_1 = require("./service/CallApi");
|
|
100
|
+
Object.defineProperty(exports, "CallApi", { enumerable: true, get: function () { return __importDefault(CallApi_1).default; } });
|
|
101
|
+
var AdHocAPIConference_1 = require("./domain/AdHocAPIConference");
|
|
102
|
+
Object.defineProperty(exports, "AdHocAPIConference", { enumerable: true, get: function () { return __importDefault(AdHocAPIConference_1).default; } });
|
|
103
|
+
var websocket_client_1 = require("./websocket-client");
|
|
104
|
+
Object.defineProperty(exports, "WebSocketClient", { enumerable: true, get: function () { return __importDefault(websocket_client_1).default; } });
|
|
105
|
+
Object.defineProperty(exports, "SOCKET_EVENTS", { enumerable: true, get: function () { return websocket_client_1.SOCKET_EVENTS; } });
|
|
106
|
+
var web_rtc_client_1 = require("./web-rtc-client");
|
|
107
|
+
Object.defineProperty(exports, "WebRTCClient", { enumerable: true, get: function () { return __importDefault(web_rtc_client_1).default; } });
|
|
108
|
+
var api_client_1 = require("./api-client");
|
|
109
|
+
Object.defineProperty(exports, "WazoApiClient", { enumerable: true, get: function () { return __importDefault(api_client_1).default; } });
|
|
110
|
+
__exportStar(require("./domain/types"), exports);
|
|
111
|
+
exports.default = index_1.default;
|
|
@@ -59,7 +59,7 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
59
59
|
return Promise.reject(new Error('Peer connection closed.'));
|
|
60
60
|
}
|
|
61
61
|
// Callback on data channel creation
|
|
62
|
-
// @ts-ignore
|
|
62
|
+
// @ts-ignore: private
|
|
63
63
|
this.onDataChannel = options.onDataChannel;
|
|
64
64
|
// ICE will restart upon applying an offer created with the iceRestart option
|
|
65
65
|
const iceRestart = options.offerOptions ? options.offerOptions.iceRestart : false;
|
|
@@ -68,7 +68,7 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
68
68
|
// We should wait for ice when iceRestart (reinvite) or for the first invite
|
|
69
69
|
// We shouldn't wait for ice when holding or resuming the call
|
|
70
70
|
// We shouldn't wait for ice when receiving a reinvite (eg: pendingReinviteAck = true)
|
|
71
|
-
// @ts-ignore
|
|
71
|
+
// @ts-ignore: private
|
|
72
72
|
const shouldWaitForIce = !this.session.pendingReinviteAck && (iceRestart || 'constraints' in options);
|
|
73
73
|
// ICE gathering timeout may be set on a per call basis, otherwise the configured default is used
|
|
74
74
|
const iceTimeout = options.iceGatheringTimeout === undefined ? (_a = this.sessionDescriptionHandlerConfiguration) === null || _a === void 0 ? void 0 : _a.iceGatheringTimeout : options.iceGatheringTimeout;
|
|
@@ -87,7 +87,7 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
87
87
|
done: true,
|
|
88
88
|
});
|
|
89
89
|
if (event.candidate) {
|
|
90
|
-
// @ts-ignore
|
|
90
|
+
// @ts-ignore: we're possibly inject null candidates
|
|
91
91
|
this.gatheredCandidates.push((0, sdp_1.parseCandidate)(event.candidate.candidate));
|
|
92
92
|
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
93
93
|
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
@@ -130,7 +130,6 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
130
130
|
return {
|
|
131
131
|
type: description.type,
|
|
132
132
|
// Fix sdp only when no candidates
|
|
133
|
-
// @ts-ignore
|
|
134
133
|
sdp: (0, sdp_1.fixSdp)(sdp, this.gatheredCandidates, options && options.constraints ? options.constraints.video : false),
|
|
135
134
|
};
|
|
136
135
|
})
|
|
@@ -177,16 +176,13 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
177
176
|
return;
|
|
178
177
|
}
|
|
179
178
|
// Closing senders via getLocalStreams, `getLocalStreams` is deprecated, we have to check if it exists.
|
|
180
|
-
// @ts-ignore
|
|
181
179
|
if ((_a = this.peerConnection) === null || _a === void 0 ? void 0 : _a.getLocalStreams) {
|
|
182
|
-
// @ts-ignore
|
|
183
180
|
(_b = this.peerConnection) === null || _b === void 0 ? void 0 : _b.getLocalStreams().forEach(stream => {
|
|
184
181
|
stream.getTracks()
|
|
185
182
|
.filter((track) => track.enabled)
|
|
186
183
|
.forEach((track) => track.stop());
|
|
187
184
|
});
|
|
188
185
|
// Closing receivers via getRemoteStreams
|
|
189
|
-
// @ts-ignore
|
|
190
186
|
(_c = this.peerConnection) === null || _c === void 0 ? void 0 : _c.getRemoteStreams().forEach(stream => {
|
|
191
187
|
stream.getTracks()
|
|
192
188
|
.filter((track) => track.enabled)
|
|
@@ -298,7 +294,6 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
298
294
|
})();
|
|
299
295
|
// set the transceiver direction to the answer direction
|
|
300
296
|
this._peerConnection.getTransceivers().forEach(transceiver => {
|
|
301
|
-
// @ts-ignore
|
|
302
297
|
if (transceiver.stopped) {
|
|
303
298
|
return;
|
|
304
299
|
}
|
|
@@ -358,11 +353,11 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
358
353
|
if (oldTrack) {
|
|
359
354
|
oldTrack.stop();
|
|
360
355
|
localStream.removeTrack(oldTrack);
|
|
361
|
-
// @ts-ignore
|
|
356
|
+
// @ts-ignore: private
|
|
362
357
|
session_description_handler_1.SessionDescriptionHandler.dispatchRemoveTrackEvent(localStream, oldTrack);
|
|
363
358
|
}
|
|
364
359
|
localStream.addTrack(newTrack);
|
|
365
|
-
// @ts-ignore
|
|
360
|
+
// @ts-ignore: private
|
|
366
361
|
session_description_handler_1.SessionDescriptionHandler.dispatchAddTrackEvent(localStream, newTrack);
|
|
367
362
|
}).catch((error) => {
|
|
368
363
|
this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ${kind} track`);
|
|
@@ -389,7 +384,7 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
389
384
|
throw error;
|
|
390
385
|
}
|
|
391
386
|
localStream.addTrack(newTrack);
|
|
392
|
-
// @ts-ignore
|
|
387
|
+
// @ts-ignore: private
|
|
393
388
|
session_description_handler_1.SessionDescriptionHandler.dispatchAddTrackEvent(localStream, newTrack);
|
|
394
389
|
}));
|
|
395
390
|
}
|
|
@@ -414,10 +409,10 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
414
409
|
}
|
|
415
410
|
let constraints = options.constraints ? Object.assign({}, options.constraints) : {};
|
|
416
411
|
// if we already have a local media stream...
|
|
417
|
-
// @ts-ignore
|
|
412
|
+
// @ts-ignore: private
|
|
418
413
|
if (this.localMediaStreamConstraints) {
|
|
419
414
|
// if constraints have not changed, do not get a new media stream
|
|
420
|
-
// @ts-ignore
|
|
415
|
+
// @ts-ignore: private
|
|
421
416
|
if (JSON.stringify(this.localMediaStreamConstraints.audio) === JSON.stringify(constraints.audio) && JSON.stringify(this.localMediaStreamConstraints.video) === JSON.stringify(constraints.video)) {
|
|
422
417
|
return Promise.resolve();
|
|
423
418
|
}
|
|
@@ -428,9 +423,8 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
428
423
|
audio: true,
|
|
429
424
|
};
|
|
430
425
|
}
|
|
431
|
-
// @ts-ignore
|
|
426
|
+
// @ts-ignore: private
|
|
432
427
|
this.localMediaStreamConstraints = constraints;
|
|
433
|
-
// @ts-ignore
|
|
434
428
|
return this.mediaStreamFactory(constraints, this).then(mediaStream => {
|
|
435
429
|
this.setLocalMediaStream(mediaStream);
|
|
436
430
|
return mediaStream;
|
|
@@ -119,7 +119,6 @@ class IssueReporter {
|
|
|
119
119
|
errorMessage: lastArg.message,
|
|
120
120
|
errorStack: lastArg.stack,
|
|
121
121
|
errorType: lastArg.constructor.name,
|
|
122
|
-
// @ts-ignore
|
|
123
122
|
skipSendToRemote: lastArg.skipSendToRemote,
|
|
124
123
|
};
|
|
125
124
|
}
|
|
@@ -194,7 +193,7 @@ class IssueReporter {
|
|
|
194
193
|
this.oldConsoleMethods = {};
|
|
195
194
|
CONSOLE_METHODS.forEach((methodName) => {
|
|
196
195
|
if (this.oldConsoleMethods) {
|
|
197
|
-
// @ts-ignore
|
|
196
|
+
// @ts-ignore: keys
|
|
198
197
|
// eslint-disable-next-line
|
|
199
198
|
this.oldConsoleMethods[methodName] = console[methodName];
|
|
200
199
|
}
|
|
@@ -283,7 +282,6 @@ class IssueReporter {
|
|
|
283
282
|
},
|
|
284
283
|
body,
|
|
285
284
|
}).catch((e) => {
|
|
286
|
-
// @ts-ignore
|
|
287
285
|
e.skipSendToRemote = true;
|
|
288
286
|
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
289
287
|
// wait at least 1 second, at most 50 seconds
|
package/lib/simple/Phone.js
CHANGED
|
@@ -53,7 +53,7 @@ class Phone extends Emitter_1.default {
|
|
|
53
53
|
super();
|
|
54
54
|
// Sugar syntax for `Wazo.Phone.EVENT_NAME`
|
|
55
55
|
Object.keys(PHONE_EVENTS).forEach((key) => {
|
|
56
|
-
// @ts-ignore
|
|
56
|
+
// @ts-ignore: keys
|
|
57
57
|
this[key] = PHONE_EVENTS[key];
|
|
58
58
|
});
|
|
59
59
|
this.SessionState = session_state_1.SessionState;
|