@wazo/sdk 0.39.15 → 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/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 +16 -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/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/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 +16 -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/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/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 +51 -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
package/src/domain/SipLine.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Endpoint } from './Line';
|
|
|
3
3
|
|
|
4
4
|
const availableCodecs = ['vp8', 'vp9', 'h264'];
|
|
5
5
|
type SipLineResponse = {
|
|
6
|
-
id:
|
|
6
|
+
id: string;
|
|
7
7
|
uuid: string;
|
|
8
8
|
tenant_uuid: string;
|
|
9
9
|
username: string;
|
|
@@ -18,7 +18,7 @@ type SipLineResponse = {
|
|
|
18
18
|
line: Endpoint;
|
|
19
19
|
};
|
|
20
20
|
type SipLineArguments = {
|
|
21
|
-
id:
|
|
21
|
+
id: string;
|
|
22
22
|
uuid: string;
|
|
23
23
|
tenantUuid: string;
|
|
24
24
|
username: string;
|
|
@@ -32,7 +32,7 @@ type SipLineArguments = {
|
|
|
32
32
|
line: Endpoint;
|
|
33
33
|
};
|
|
34
34
|
export default class SipLine {
|
|
35
|
-
id:
|
|
35
|
+
id: string;
|
|
36
36
|
|
|
37
37
|
uuid: string;
|
|
38
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Agent, { AgentResponse } from '../Agent';
|
|
1
|
+
import Agent, { AgentArguments, AgentResponse } from '../Agent';
|
|
2
2
|
|
|
3
3
|
const fieldMap: Record<string, any> = {
|
|
4
4
|
context: 'context',
|
|
@@ -27,14 +27,12 @@ Object.keys(fieldMap).forEach((field: string) => {
|
|
|
27
27
|
});
|
|
28
28
|
describe('Call Center Agent domain', () => {
|
|
29
29
|
it('should keep its values', () => {
|
|
30
|
-
|
|
31
|
-
const agent = new Agent(formatted) as any;
|
|
30
|
+
const agent = new Agent(formatted as AgentArguments) as any;
|
|
32
31
|
expect(agent).toBeInstanceOf(Agent);
|
|
33
32
|
Object.keys(fieldMap).map(key => expect(agent[key]).toBe(formatted[key]));
|
|
34
33
|
});
|
|
35
34
|
it('can parse a plain call center agent to domain', () => {
|
|
36
35
|
const agent = Agent.parse(plain as AgentResponse);
|
|
37
|
-
|
|
38
|
-
expect(agent).toEqual(new Agent(formatted));
|
|
36
|
+
expect(agent).toEqual(new Agent(formatted as AgentArguments));
|
|
39
37
|
});
|
|
40
38
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import Call from '../Call';
|
|
3
2
|
|
|
4
3
|
describe('Call domain', () => {
|
|
5
4
|
it('can return the elapsed time since its creation in seconds', () => {
|
|
6
|
-
Date.now = jest.fn(() => new Date(2012, 7, 28, 13, 0, 0));
|
|
5
|
+
Date.now = jest.fn(() => new Date(2012, 7, 28, 13, 0, 0)) as any;
|
|
7
6
|
const call = new Call({
|
|
8
7
|
startingTime: new Date(2012, 7, 28, 12, 30, 0),
|
|
9
|
-
});
|
|
8
|
+
} as any);
|
|
10
9
|
const elapsedTimeInSeconds = call.getElapsedTimeInSeconds();
|
|
11
10
|
expect(elapsedTimeInSeconds).toBe(30 * 60);
|
|
12
11
|
});
|
|
@@ -14,14 +13,14 @@ describe('Call domain', () => {
|
|
|
14
13
|
const call = new Call({
|
|
15
14
|
calleeName: 'John Doe',
|
|
16
15
|
calleeNumber: '911',
|
|
17
|
-
});
|
|
16
|
+
} as any);
|
|
18
17
|
expect(call.hasNumber('911')).toBeTruthy();
|
|
19
18
|
});
|
|
20
19
|
it('does not have the number provided it is a different number', () => {
|
|
21
20
|
const call = new Call({
|
|
22
21
|
calleeName: 'John Doe',
|
|
23
22
|
calleeNumber: '911',
|
|
24
|
-
});
|
|
23
|
+
} as any);
|
|
25
24
|
expect(call.hasNumber('418-222-5555')).toBeFalsy();
|
|
26
25
|
});
|
|
27
26
|
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
1
|
import moment from 'moment';
|
|
4
2
|
import CallLog from '../CallLog';
|
|
5
3
|
import Recording from '../Recording';
|
|
@@ -34,7 +32,7 @@ describe('CallLog domain', () => {
|
|
|
34
32
|
}],
|
|
35
33
|
total: 233,
|
|
36
34
|
};
|
|
37
|
-
const logs = CallLog.parseMany(response);
|
|
35
|
+
const logs = CallLog.parseMany(response as any);
|
|
38
36
|
expect(logs).toEqual([new CallLog({
|
|
39
37
|
answer: moment('2017-08-07T13:51:18.892002+00:00').toDate(),
|
|
40
38
|
answered: true,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import CallSession from '../CallSession';
|
|
3
2
|
|
|
4
|
-
const stringify = cs => JSON.parse(JSON.stringify(cs));
|
|
3
|
+
const stringify = (cs: any) => JSON.parse(JSON.stringify(cs));
|
|
5
4
|
|
|
6
5
|
describe('CallSession domain', () => {
|
|
7
6
|
it('should update from another CallSession without data loss', () => {
|
|
@@ -12,14 +11,14 @@ describe('CallSession domain', () => {
|
|
|
12
11
|
number: '8001',
|
|
13
12
|
isCaller: true,
|
|
14
13
|
dialedExtension: null,
|
|
15
|
-
});
|
|
14
|
+
} as any);
|
|
16
15
|
const anotherCallSession = new CallSession({
|
|
17
16
|
callId: 345,
|
|
18
17
|
callerNumber: '8008',
|
|
19
18
|
number: '8008',
|
|
20
19
|
isCaller: false,
|
|
21
20
|
dialedExtension: undefined,
|
|
22
|
-
});
|
|
21
|
+
} as any);
|
|
23
22
|
callSession.updateFrom(anotherCallSession);
|
|
24
23
|
expect(callSession.callId).toBe(345);
|
|
25
24
|
expect(callSession.sipCallId).toBe(123);
|
|
@@ -34,22 +33,22 @@ describe('CallSession domain', () => {
|
|
|
34
33
|
const cs1 = new CallSession({
|
|
35
34
|
callId: 123,
|
|
36
35
|
sipCallId: 456,
|
|
37
|
-
});
|
|
36
|
+
} as any);
|
|
38
37
|
const cs2 = new CallSession({
|
|
39
38
|
callId: 123,
|
|
40
39
|
sipCallId: null,
|
|
41
|
-
});
|
|
40
|
+
} as any);
|
|
42
41
|
expect(cs1.is(cs2)).toBeTruthy();
|
|
43
42
|
expect(cs2.is(cs1)).toBeTruthy();
|
|
44
43
|
});
|
|
45
44
|
it('should set answerTime when setting answered to true', () => {
|
|
46
|
-
const cs1 = new CallSession({});
|
|
45
|
+
const cs1 = new CallSession({} as any);
|
|
47
46
|
cs1.answered = true;
|
|
48
|
-
const cs2 = new CallSession({});
|
|
47
|
+
const cs2 = new CallSession({} as any);
|
|
49
48
|
cs2.answer();
|
|
50
49
|
const cs3 = new CallSession({
|
|
51
50
|
answered: true,
|
|
52
|
-
});
|
|
51
|
+
} as any);
|
|
53
52
|
expect(cs1.answered).toEqual(true);
|
|
54
53
|
expect(cs1.answerTime).not.toBeNull();
|
|
55
54
|
expect(cs2.answered).toEqual(true);
|
|
@@ -64,11 +63,11 @@ describe('CallSession domain', () => {
|
|
|
64
63
|
expect(cs6.answered).toEqual(true);
|
|
65
64
|
});
|
|
66
65
|
it('should reset answerTime when setting answered to false', () => {
|
|
67
|
-
const cs1 = new CallSession({});
|
|
66
|
+
const cs1 = new CallSession({} as any);
|
|
68
67
|
cs1.answered = false;
|
|
69
68
|
const cs2 = new CallSession({
|
|
70
69
|
answered: false,
|
|
71
|
-
});
|
|
70
|
+
} as any);
|
|
72
71
|
expect(cs1.answered).toEqual(false);
|
|
73
72
|
expect(cs1.answerTime).toBeNull();
|
|
74
73
|
expect(cs2.answered).toEqual(false);
|
|
@@ -309,13 +309,11 @@ describe('Contact domain', () => {
|
|
|
309
309
|
const noBirthdayContact = new Contact({
|
|
310
310
|
uuid: 'uuid-12345',
|
|
311
311
|
lastActivity: 'yesterday',
|
|
312
|
-
|
|
313
|
-
birthday: null,
|
|
312
|
+
birthday: undefined,
|
|
314
313
|
});
|
|
315
314
|
const noLastActivityContact = new Contact({
|
|
316
315
|
uuid: 'uuid-12345',
|
|
317
|
-
|
|
318
|
-
lastActivity: null,
|
|
316
|
+
lastActivity: undefined,
|
|
319
317
|
birthday: 'tomorrow',
|
|
320
318
|
});
|
|
321
319
|
const result = noBirthdayContact.merge(noLastActivityContact);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import CallSession from '../CallSession';
|
|
3
2
|
import IndirectTransfer from '../IndirectTransfer';
|
|
4
3
|
|
|
@@ -9,9 +8,9 @@ describe('Indirect transfer', () => {
|
|
|
9
8
|
const destinationId = 'destination-id';
|
|
10
9
|
const indirectTransfer = IndirectTransfer.parseFromCallSession(new CallSession({
|
|
11
10
|
callId: sourceId,
|
|
12
|
-
}), new CallSession({
|
|
11
|
+
} as any), new CallSession({
|
|
13
12
|
callId: destinationId,
|
|
14
|
-
}));
|
|
13
|
+
} as any));
|
|
15
14
|
expect(indirectTransfer).toEqual({
|
|
16
15
|
sourceId,
|
|
17
16
|
destinationId,
|
|
@@ -27,7 +26,7 @@ describe('Indirect transfer', () => {
|
|
|
27
26
|
});
|
|
28
27
|
const isDestination = indirectTransfer.destinationIs(new CallSession({
|
|
29
28
|
callId: destinationId,
|
|
30
|
-
}));
|
|
29
|
+
} as any));
|
|
31
30
|
expect(isDestination).toBeTruthy();
|
|
32
31
|
});
|
|
33
32
|
it('should NOT match when destination is the different', async () => {
|
|
@@ -38,7 +37,7 @@ describe('Indirect transfer', () => {
|
|
|
38
37
|
});
|
|
39
38
|
const isDestination = indirectTransfer.destinationIs(new CallSession({
|
|
40
39
|
callId: destinationId,
|
|
41
|
-
}));
|
|
40
|
+
} as any));
|
|
42
41
|
expect(isDestination).toBeFalsy();
|
|
43
42
|
});
|
|
44
43
|
});
|
|
@@ -51,7 +50,7 @@ describe('Indirect transfer', () => {
|
|
|
51
50
|
});
|
|
52
51
|
const isSource = indirectTransfer.sourceIs(new CallSession({
|
|
53
52
|
callId: sourceId,
|
|
54
|
-
}));
|
|
53
|
+
} as any));
|
|
55
54
|
expect(isSource).toBeTruthy();
|
|
56
55
|
});
|
|
57
56
|
it('should NOT match when source is the different', async () => {
|
|
@@ -62,7 +61,7 @@ describe('Indirect transfer', () => {
|
|
|
62
61
|
});
|
|
63
62
|
const isSource = indirectTransfer.sourceIs(new CallSession({
|
|
64
63
|
callId: sourceId,
|
|
65
|
-
}));
|
|
64
|
+
} as any));
|
|
66
65
|
expect(isSource).toBeFalsy();
|
|
67
66
|
});
|
|
68
67
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import Profile from '../Profile';
|
|
3
2
|
import Line from '../Line';
|
|
4
3
|
import ForwardOption, { FORWARD_KEYS } from '../ForwardOption';
|
|
@@ -18,12 +17,12 @@ describe('Profile domain', () => {
|
|
|
18
17
|
context: 'default',
|
|
19
18
|
}],
|
|
20
19
|
endpoint_custom: null,
|
|
21
|
-
})],
|
|
20
|
+
} as any)],
|
|
22
21
|
username: 'john.doe',
|
|
23
22
|
forwards: [],
|
|
24
23
|
mobileNumber: '123',
|
|
25
24
|
};
|
|
26
|
-
const oldProfile = new Profile(attributes);
|
|
25
|
+
const oldProfile = new Profile(attributes as any);
|
|
27
26
|
const newProfile = Profile.newFrom(oldProfile);
|
|
28
27
|
expect(newProfile).toBeInstanceOf(Profile);
|
|
29
28
|
expect(newProfile.firstName).toBe(attributes.firstName);
|
|
@@ -88,7 +87,7 @@ describe('Profile domain', () => {
|
|
|
88
87
|
}],
|
|
89
88
|
online_call_record_enabled: true,
|
|
90
89
|
};
|
|
91
|
-
const profile = Profile.parse(plain);
|
|
90
|
+
const profile = Profile.parse(plain as any);
|
|
92
91
|
expect(profile).toEqual(new Profile({
|
|
93
92
|
id: 'xxx-xxx-xxx-xx',
|
|
94
93
|
firstName: 'John',
|
|
@@ -8,10 +8,9 @@ describe('Room', () => {
|
|
|
8
8
|
const number = 'some-number';
|
|
9
9
|
const room = new Room({
|
|
10
10
|
id: 'some-id',
|
|
11
|
-
// @ts-expect-error
|
|
12
11
|
connectedCallSession: new CallSession({
|
|
13
12
|
number,
|
|
14
|
-
}),
|
|
13
|
+
} as any),
|
|
15
14
|
participants: [],
|
|
16
15
|
});
|
|
17
16
|
const extension = room.getExtension();
|
|
@@ -32,14 +31,12 @@ describe('Room', () => {
|
|
|
32
31
|
});
|
|
33
32
|
describe('on connect call', () => {
|
|
34
33
|
it('should add call to room', async () => {
|
|
35
|
-
// @ts-expect-error
|
|
36
34
|
const room = new Room({
|
|
37
35
|
id: 'some-id',
|
|
38
|
-
});
|
|
39
|
-
// @ts-expect-error
|
|
36
|
+
} as any);
|
|
40
37
|
const callSession = new CallSession({
|
|
41
38
|
callId: 'some-call-id',
|
|
42
|
-
});
|
|
39
|
+
} as any);
|
|
43
40
|
const connectedRoom = room.connect(callSession);
|
|
44
41
|
expect(connectedRoom.connectedCallSession).toBe(callSession);
|
|
45
42
|
});
|
|
@@ -47,42 +44,35 @@ describe('Room', () => {
|
|
|
47
44
|
describe('on room has call', () => {
|
|
48
45
|
describe('given no connected call', () => {
|
|
49
46
|
it('should be false', async () => {
|
|
50
|
-
// @ts-expect-error
|
|
51
47
|
const room = new Room({
|
|
52
48
|
connectedCallSession: null,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const callSession = new CallSession({});
|
|
49
|
+
} as any);
|
|
50
|
+
const callSession = new CallSession({} as any);
|
|
56
51
|
const roomHasCall = room.has(callSession);
|
|
57
52
|
expect(roomHasCall).toBeFalsy();
|
|
58
53
|
});
|
|
59
54
|
});
|
|
60
55
|
describe('given a connected call', () => {
|
|
61
56
|
it('should be true if same calls', async () => {
|
|
62
|
-
// @ts-expect-error
|
|
63
57
|
const callSession = new CallSession({
|
|
64
58
|
callId: 'some-call-id',
|
|
65
|
-
});
|
|
66
|
-
// @ts-expect-error
|
|
59
|
+
} as any);
|
|
67
60
|
const room = new Room({
|
|
68
61
|
connectedCallSession: callSession,
|
|
69
|
-
});
|
|
62
|
+
} as any);
|
|
70
63
|
const roomHasCall = room.has(callSession);
|
|
71
64
|
expect(roomHasCall).toBeTruthy();
|
|
72
65
|
});
|
|
73
66
|
it('should be false if different calls', async () => {
|
|
74
|
-
// @ts-expect-error
|
|
75
67
|
const call1 = new CallSession({
|
|
76
68
|
callId: 'some-call-id',
|
|
77
|
-
});
|
|
78
|
-
// @ts-expect-error
|
|
69
|
+
} as any);
|
|
79
70
|
const call2 = new CallSession({
|
|
80
71
|
callId: 'some-other-call-id',
|
|
81
|
-
});
|
|
82
|
-
// @ts-expect-error
|
|
72
|
+
} as any);
|
|
83
73
|
const room = new Room({
|
|
84
74
|
connectedCallSession: call1,
|
|
85
|
-
});
|
|
75
|
+
} as any);
|
|
86
76
|
const roomHasCall = room.has(call2);
|
|
87
77
|
expect(roomHasCall).toBeFalsy();
|
|
88
78
|
});
|
|
@@ -93,9 +83,8 @@ describe('Room', () => {
|
|
|
93
83
|
const participants = [{}];
|
|
94
84
|
const room = new Room({
|
|
95
85
|
connectedCallSession: null,
|
|
96
|
-
// @ts-expect-error
|
|
97
86
|
participants,
|
|
98
|
-
});
|
|
87
|
+
} as any);
|
|
99
88
|
const participantUuid = 'some-uuid';
|
|
100
89
|
const participantExtension = 'some-extension';
|
|
101
90
|
const updatedRoom = room.addParticipant(participantUuid, participantExtension);
|
|
@@ -106,10 +95,9 @@ describe('Room', () => {
|
|
|
106
95
|
describe('on room has call with id', () => {
|
|
107
96
|
describe('given no connected call', () => {
|
|
108
97
|
it('should be false', async () => {
|
|
109
|
-
// @ts-expect-error
|
|
110
98
|
const room = new Room({
|
|
111
99
|
connectedCallSession: null,
|
|
112
|
-
});
|
|
100
|
+
} as any);
|
|
113
101
|
const callId = 'some-call-id';
|
|
114
102
|
const roomHasCall = room.hasCallWithId(callId);
|
|
115
103
|
expect(roomHasCall).toBeFalsy();
|
|
@@ -118,25 +106,21 @@ describe('Room', () => {
|
|
|
118
106
|
describe('given a connected call', () => {
|
|
119
107
|
it('should be true if same calls', async () => {
|
|
120
108
|
const callId = 'some-call-id';
|
|
121
|
-
// @ts-expect-error
|
|
122
109
|
const room = new Room({
|
|
123
|
-
// @ts-expect-error
|
|
124
110
|
connectedCallSession: new CallSession({
|
|
125
111
|
callId,
|
|
126
|
-
}),
|
|
127
|
-
});
|
|
112
|
+
} as any),
|
|
113
|
+
} as any);
|
|
128
114
|
const roomHasCall = room.hasCallWithId(callId);
|
|
129
115
|
expect(roomHasCall).toBeTruthy();
|
|
130
116
|
});
|
|
131
117
|
it('should be false if different calls', async () => {
|
|
132
118
|
const callId = 'some-call-id';
|
|
133
|
-
// @ts-expect-error
|
|
134
119
|
const room = new Room({
|
|
135
|
-
// @ts-expect-error
|
|
136
120
|
connectedCallSession: new CallSession({
|
|
137
121
|
callId: 'some-other-call-id',
|
|
138
|
-
}),
|
|
139
|
-
});
|
|
122
|
+
} as any),
|
|
123
|
+
} as any);
|
|
140
124
|
const roomHasCall = room.hasCallWithId(callId);
|
|
141
125
|
expect(roomHasCall).toBeFalsy();
|
|
142
126
|
});
|
|
@@ -146,55 +130,49 @@ describe('Room', () => {
|
|
|
146
130
|
it('should updated participant with corresponding UUID', async () => {
|
|
147
131
|
const uuid = 'some-uuid';
|
|
148
132
|
const room = new Room({
|
|
149
|
-
// @ts-expect-error
|
|
150
133
|
participants: [{
|
|
151
134
|
uuid,
|
|
152
135
|
talking: true,
|
|
153
136
|
}],
|
|
154
|
-
});
|
|
137
|
+
} as any);
|
|
155
138
|
expect(room.participants[0].talking).toBeTruthy();
|
|
156
139
|
const updatedRoom = room.updateParticipant(uuid, {
|
|
157
140
|
talking: false,
|
|
158
|
-
});
|
|
141
|
+
} as any);
|
|
159
142
|
expect(updatedRoom.participants[0].talking).toBeFalsy();
|
|
160
143
|
});
|
|
161
144
|
it('should add participant when not found', async () => {
|
|
162
145
|
const uuid = 'some-uuid';
|
|
163
|
-
// @ts-expect-error
|
|
164
146
|
const room = new Room({
|
|
165
147
|
participants: [],
|
|
166
|
-
});
|
|
148
|
+
} as any);
|
|
167
149
|
const updatedRoom = room.updateParticipant(uuid, {
|
|
168
150
|
talking: false,
|
|
169
|
-
}, true);
|
|
151
|
+
} as any, true);
|
|
170
152
|
expect(updatedRoom.participants[0].talking).toBeFalsy();
|
|
171
153
|
});
|
|
172
154
|
});
|
|
173
155
|
describe('on updated participant by extension', () => {
|
|
174
156
|
it('should updated participant with corresponding extension', async () => {
|
|
175
|
-
const extension = 1234;
|
|
157
|
+
const extension = '1234';
|
|
176
158
|
const room = new Room({
|
|
177
159
|
participants: [{
|
|
178
|
-
// @ts-expect-error
|
|
179
160
|
extension,
|
|
180
161
|
talking: false,
|
|
181
162
|
}],
|
|
182
|
-
});
|
|
163
|
+
} as any);
|
|
183
164
|
expect(room.participants[0].talking).toBeFalsy();
|
|
184
|
-
// @ts-expect-error
|
|
185
165
|
const updatedRoom = room.updateParticipantByExtension(extension, {
|
|
186
166
|
talking: true,
|
|
187
|
-
});
|
|
167
|
+
} as any);
|
|
188
168
|
expect(updatedRoom.participants[0].talking).toBeTruthy();
|
|
189
169
|
});
|
|
190
170
|
});
|
|
191
171
|
describe('on disconnect', () => {
|
|
192
172
|
it('should destroy connected call', async () => {
|
|
193
|
-
// @ts-expect-error
|
|
194
173
|
const room = new Room({
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
});
|
|
174
|
+
connectedCallSession: new CallSession({} as any),
|
|
175
|
+
} as any);
|
|
198
176
|
expect(room.connectedCallSession).not.toBeNull();
|
|
199
177
|
const updatedRoom = room.disconnect();
|
|
200
178
|
expect(updatedRoom.connectedCallSession).toBeNull();
|
|
@@ -204,11 +182,10 @@ describe('Room', () => {
|
|
|
204
182
|
it('should remove participant with corresponding UUID', async () => {
|
|
205
183
|
const uuid = 'some-uuid';
|
|
206
184
|
const room = new Room({
|
|
207
|
-
// @ts-expect-error
|
|
208
185
|
participants: [{
|
|
209
186
|
uuid,
|
|
210
187
|
}],
|
|
211
|
-
});
|
|
188
|
+
} as any);
|
|
212
189
|
expect(room.participants.some(participant => participant.uuid === uuid)).toBeTruthy();
|
|
213
190
|
const updatedRoom = room.removeParticipantWithUUID(uuid);
|
|
214
191
|
expect(updatedRoom.participants.some(participant => participant.uuid === uuid)).toBeFalsy();
|
|
@@ -218,11 +195,10 @@ describe('Room', () => {
|
|
|
218
195
|
it('should remove participant with corresponding UUID', async () => {
|
|
219
196
|
const extension = 'some-extension';
|
|
220
197
|
const room = new Room({
|
|
221
|
-
// @ts-expect-error
|
|
222
198
|
participants: [{
|
|
223
199
|
extension,
|
|
224
200
|
}],
|
|
225
|
-
});
|
|
201
|
+
} as any);
|
|
226
202
|
expect(room.participants.some(participant => participant.extension === extension)).toBeTruthy();
|
|
227
203
|
const updatedRoom = room.removeParticipantWithExtension(extension);
|
|
228
204
|
expect(updatedRoom.participants.some(participant => participant.extension === extension)).toBeFalsy();
|
|
@@ -27,8 +27,7 @@ describe('Session domain', () => {
|
|
|
27
27
|
xivo_user_uuid: null,
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
const session = Session.parse(plain);
|
|
30
|
+
const session = Session.parse(plain as any);
|
|
32
31
|
expect(session).toEqual(new Session({
|
|
33
32
|
token: 'b93ae6bd-08d7-4001-9e61-057e72bbc4b3',
|
|
34
33
|
refreshToken: null,
|
|
@@ -47,13 +46,13 @@ describe('Session domain', () => {
|
|
|
47
46
|
const session = new Session({
|
|
48
47
|
token: 'ref-12345',
|
|
49
48
|
uuid: '1234',
|
|
50
|
-
//
|
|
49
|
+
//
|
|
51
50
|
profile: new Profile({
|
|
52
51
|
voicemail: {
|
|
53
52
|
id: 1234,
|
|
54
53
|
name: 'inbox',
|
|
55
54
|
},
|
|
56
|
-
}),
|
|
55
|
+
} as any),
|
|
57
56
|
expiresAt: A_DATE,
|
|
58
57
|
});
|
|
59
58
|
expect(session.hasAccessToVoicemail()).toBeTruthy();
|
|
@@ -64,7 +63,7 @@ describe('Session domain', () => {
|
|
|
64
63
|
const session = new Session({
|
|
65
64
|
token: 'ref-12345',
|
|
66
65
|
uuid: '1234',
|
|
67
|
-
//
|
|
66
|
+
//
|
|
68
67
|
profile: new Profile({
|
|
69
68
|
lines: [new Line({
|
|
70
69
|
id: 9012,
|
|
@@ -81,7 +80,7 @@ describe('Session domain', () => {
|
|
|
81
80
|
context: 'internal',
|
|
82
81
|
}],
|
|
83
82
|
})],
|
|
84
|
-
}),
|
|
83
|
+
} as any),
|
|
85
84
|
expiresAt: A_DATE,
|
|
86
85
|
});
|
|
87
86
|
expect(session.allNumbers().length).toBeGreaterThan(1);
|
|
@@ -92,7 +91,7 @@ describe('Session domain', () => {
|
|
|
92
91
|
const session = new Session({
|
|
93
92
|
token: 'ref-12345',
|
|
94
93
|
uuid: '1234',
|
|
95
|
-
//
|
|
94
|
+
//
|
|
96
95
|
profile: new Profile({
|
|
97
96
|
lines: [new Line({
|
|
98
97
|
id: 9012,
|
|
@@ -102,7 +101,7 @@ describe('Session domain', () => {
|
|
|
102
101
|
context: 'default',
|
|
103
102
|
}],
|
|
104
103
|
})],
|
|
105
|
-
}),
|
|
104
|
+
} as any),
|
|
106
105
|
expiresAt: A_DATE,
|
|
107
106
|
});
|
|
108
107
|
expect(session.allNumbers().length).toEqual(1);
|
|
@@ -113,10 +112,10 @@ describe('Session domain', () => {
|
|
|
113
112
|
const session = new Session({
|
|
114
113
|
token: 'ref-12345',
|
|
115
114
|
uuid: '1234',
|
|
116
|
-
//
|
|
115
|
+
//
|
|
117
116
|
profile: new Profile({
|
|
118
117
|
voicemail: undefined,
|
|
119
|
-
}),
|
|
118
|
+
} as any),
|
|
120
119
|
expiresAt: A_DATE,
|
|
121
120
|
});
|
|
122
121
|
expect(session.hasAccessToVoicemail()).toBeFalsy();
|
|
@@ -164,7 +163,7 @@ describe('Session domain', () => {
|
|
|
164
163
|
const session = new Session({
|
|
165
164
|
token: 'ref-12345',
|
|
166
165
|
uuid: '1234',
|
|
167
|
-
//
|
|
166
|
+
//
|
|
168
167
|
profile: new Profile({
|
|
169
168
|
lines: [new Line({
|
|
170
169
|
id: 9012,
|
|
@@ -181,7 +180,7 @@ describe('Session domain', () => {
|
|
|
181
180
|
context: 'internal',
|
|
182
181
|
}],
|
|
183
182
|
})],
|
|
184
|
-
}),
|
|
183
|
+
} as any),
|
|
185
184
|
expiresAt: new Date(9999, 0, 1),
|
|
186
185
|
});
|
|
187
186
|
it('should return true given it owns the extension', () => {
|
|
@@ -226,10 +225,10 @@ describe('Session domain', () => {
|
|
|
226
225
|
describe('and NO lines', () => {
|
|
227
226
|
beforeEach(() => {
|
|
228
227
|
A_SESSION = new Session({ ...A_SESSION,
|
|
229
|
-
//
|
|
228
|
+
//
|
|
230
229
|
profile: new Profile({
|
|
231
230
|
lines: [],
|
|
232
|
-
}),
|
|
231
|
+
} as any),
|
|
233
232
|
});
|
|
234
233
|
});
|
|
235
234
|
it('should return default context', async () => {
|
|
@@ -246,13 +245,13 @@ describe('Session domain', () => {
|
|
|
246
245
|
exten: '1',
|
|
247
246
|
}],
|
|
248
247
|
id: 1,
|
|
249
|
-
//
|
|
248
|
+
//
|
|
250
249
|
exten: 1,
|
|
251
|
-
});
|
|
252
|
-
//
|
|
250
|
+
} as any);
|
|
251
|
+
//
|
|
253
252
|
const profile = new Profile({
|
|
254
253
|
lines: [line],
|
|
255
|
-
});
|
|
254
|
+
} as any);
|
|
256
255
|
A_SESSION = new Session({ ...A_SESSION,
|
|
257
256
|
profile,
|
|
258
257
|
});
|
|
@@ -272,10 +271,10 @@ describe('Session domain', () => {
|
|
|
272
271
|
});
|
|
273
272
|
describe('and NO lines', () => {
|
|
274
273
|
beforeEach(() => {
|
|
275
|
-
//
|
|
274
|
+
//
|
|
276
275
|
const profile = new Profile({
|
|
277
276
|
lines: [],
|
|
278
|
-
});
|
|
277
|
+
} as any);
|
|
279
278
|
A_SESSION = new Session({ ...A_SESSION,
|
|
280
279
|
profile,
|
|
281
280
|
});
|
|
@@ -294,13 +293,13 @@ describe('Session domain', () => {
|
|
|
294
293
|
exten: '1',
|
|
295
294
|
}],
|
|
296
295
|
id: 1,
|
|
297
|
-
//
|
|
296
|
+
//
|
|
298
297
|
exten: 1,
|
|
299
|
-
});
|
|
300
|
-
//
|
|
298
|
+
} as any);
|
|
299
|
+
//
|
|
301
300
|
const profile = new Profile({
|
|
302
301
|
lines: [line],
|
|
303
|
-
});
|
|
302
|
+
} as any);
|
|
304
303
|
A_SESSION = new Session({ ...A_SESSION,
|
|
305
304
|
profile,
|
|
306
305
|
engineVersion: '18.08',
|
|
@@ -329,13 +328,13 @@ describe('Session domain', () => {
|
|
|
329
328
|
exten: '1',
|
|
330
329
|
}],
|
|
331
330
|
id: 1,
|
|
332
|
-
//
|
|
331
|
+
//
|
|
333
332
|
exten: 1,
|
|
334
|
-
});
|
|
335
|
-
//
|
|
333
|
+
} as any);
|
|
334
|
+
//
|
|
336
335
|
const profile = new Profile({
|
|
337
336
|
lines: [line],
|
|
338
|
-
});
|
|
337
|
+
} as any);
|
|
339
338
|
A_SESSION = new Session({ ...A_SESSION,
|
|
340
339
|
profile,
|
|
341
340
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import SipLine from '../SipLine';
|
|
3
2
|
|
|
4
3
|
describe('SipLine domain', () => {
|
|
5
4
|
describe('Endpoint (20.13 and higher)', () => {
|
|
6
5
|
it('can tell if we have videoConference capabilities', () => {
|
|
7
|
-
const getSipLine = endpointSectionOptions => new SipLine({
|
|
6
|
+
const getSipLine = (endpointSectionOptions: any) => new SipLine({
|
|
8
7
|
endpointSectionOptions,
|
|
9
|
-
});
|
|
8
|
+
} as any);
|
|
10
9
|
|
|
11
10
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
12
11
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '1']]).hasVideoConference()).toBe(false);
|
|
@@ -17,9 +16,9 @@ describe('SipLine domain', () => {
|
|
|
17
16
|
});
|
|
18
17
|
describe('Old Endpoint', () => {
|
|
19
18
|
it('can tell if we have videoConference capabilities', () => {
|
|
20
|
-
const getSipLine = options => new SipLine({
|
|
19
|
+
const getSipLine = (options: any) => new SipLine({
|
|
21
20
|
options,
|
|
22
|
-
});
|
|
21
|
+
} as any);
|
|
23
22
|
|
|
24
23
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '2']]).hasVideoConference()).toBe(true);
|
|
25
24
|
expect(getSipLine([['max_audio_streams', '1'], ['max_video_streams', '1']]).hasVideoConference()).toBe(false);
|