@wazo/sdk 0.37.23 → 0.37.27
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 +95 -57
- package/dist/wazo-sdk.js +3 -3
- package/esm/__tests__/api-client.test.js +12 -7
- package/esm/__tests__/web-rtc-client.test.js +47 -20
- package/esm/api/agentd.js +1 -1
- package/esm/api/amid.js +1 -1
- package/esm/api/application.js +1 -1
- package/esm/api/auth.js +1 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/calld.js +1 -1
- package/esm/api/chatd.js +1 -1
- package/esm/api/confd.js +11 -6
- package/esm/api/ctid-ng.js +1 -1
- package/esm/api/dird.js +2 -2
- package/esm/api/webhookd.js +1 -1
- package/esm/api-client.js +12 -7
- package/esm/checker/Checker.js +47 -20
- package/esm/checker/checks/aor.js +12 -7
- package/esm/checker/checks/api.js +12 -7
- package/esm/checker/checks/index.js +47 -20
- package/esm/checker/checks/wazo-websocket.js +1 -1
- package/esm/checker/checks/webrtc-transport.js +47 -20
- package/esm/checker/checks/webrtc.js +47 -20
- package/esm/domain/AdHocAPIConference.js +12 -7
- package/esm/domain/Contact.js +1 -1
- package/esm/domain/Features.js +12 -7
- package/esm/domain/Meeting.js +12 -5
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +34 -6
- package/esm/domain/__tests__/Contact.test.js +1 -1
- package/esm/domain/__tests__/Meeting.test.js +144 -0
- package/esm/index.js +80 -25
- package/esm/lib/WazoSessionDescriptionHandler.js +9 -4
- package/esm/service/CallApi.js +12 -7
- package/esm/service/IssueReporter.js +1 -1
- package/esm/service/__tests__/IssueReporter.test.js +1 -1
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +80 -25
- package/esm/simple/Configuration.js +80 -25
- package/esm/simple/Directory.js +12 -7
- package/esm/simple/Phone.js +80 -25
- package/esm/simple/Websocket.js +1 -1
- package/esm/simple/index.js +80 -25
- package/esm/simple/room/LocalParticipant.js +80 -25
- package/esm/simple/room/Participant.js +80 -25
- package/esm/simple/room/RemoteParticipant.js +80 -25
- package/esm/simple/room/Room.js +80 -25
- package/esm/simple/room/SipRoom.js +80 -25
- package/esm/simple/room/Stream.js +80 -25
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +80 -25
- package/esm/simple/utils.js +80 -25
- package/esm/types/WebSocketMessage.js +1 -1
- package/esm/utils/__tests__/api-requester.test.js +1 -1
- package/esm/utils/api-requester.js +1 -1
- package/esm/web-rtc-client.js +47 -20
- package/esm/websocket-client.js +1 -1
- package/lib/__tests__/api-client.test.js +12 -7
- package/lib/__tests__/web-rtc-client.test.js +47 -20
- package/lib/api/agentd.js +1 -1
- package/lib/api/amid.js +1 -1
- package/lib/api/application.js +1 -1
- package/lib/api/auth.js +1 -1
- package/lib/api/call-logd.js +1 -1
- package/lib/api/calld.js +1 -1
- package/lib/api/chatd.js +1 -1
- package/lib/api/confd.js +11 -6
- package/lib/api/ctid-ng.js +1 -1
- package/lib/api/dird.js +2 -2
- package/lib/api/webhookd.js +1 -1
- package/lib/api-client.js +12 -7
- package/lib/checker/Checker.js +47 -20
- package/lib/checker/checks/aor.js +12 -7
- package/lib/checker/checks/api.js +12 -7
- package/lib/checker/checks/index.js +47 -20
- package/lib/checker/checks/wazo-websocket.js +1 -1
- package/lib/checker/checks/webrtc-transport.js +47 -20
- package/lib/checker/checks/webrtc.js +47 -20
- package/lib/domain/AdHocAPIConference.js +12 -7
- package/lib/domain/Contact.js +1 -1
- package/lib/domain/Features.js +12 -7
- package/lib/domain/Meeting.js +16 -5
- package/lib/domain/Phone/CTIPhone.js +12 -7
- package/lib/domain/Phone/WebRTCPhone.js +34 -6
- package/lib/domain/__tests__/Contact.test.js +1 -1
- package/lib/domain/__tests__/Meeting.test.js +150 -0
- package/lib/index.js +80 -25
- package/lib/lib/WazoSessionDescriptionHandler.js +9 -4
- package/lib/service/CallApi.js +12 -7
- package/lib/service/IssueReporter.js +1 -1
- package/lib/service/__tests__/IssueReporter.test.js +1 -1
- package/lib/service/getApiClient.js +12 -7
- package/lib/simple/Auth.js +80 -25
- package/lib/simple/Configuration.js +80 -25
- package/lib/simple/Directory.js +12 -7
- package/lib/simple/Phone.js +80 -25
- package/lib/simple/Websocket.js +1 -1
- package/lib/simple/index.js +80 -25
- package/lib/simple/room/LocalParticipant.js +80 -25
- package/lib/simple/room/Participant.js +80 -25
- package/lib/simple/room/RemoteParticipant.js +80 -25
- package/lib/simple/room/Room.js +80 -25
- package/lib/simple/room/SipRoom.js +80 -25
- package/lib/simple/room/Stream.js +80 -25
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +80 -25
- package/lib/simple/utils.js +80 -25
- package/lib/types/WebSocketMessage.js +2 -0
- package/lib/utils/__tests__/api-requester.test.js +1 -1
- package/lib/utils/api-requester.js +1 -1
- package/lib/web-rtc-client.js +47 -20
- package/lib/websocket-client.js +1 -1
- package/package.json +1 -1
- package/src/domain/Contact.js +1 -1
- package/src/domain/Meeting.js +12 -5
- package/src/domain/Phone/WebRTCPhone.js +33 -5
- package/src/domain/__tests__/Meeting.test.js +50 -0
- package/src/lib/WazoSessionDescriptionHandler.js +8 -3
- package/src/utils/api-requester.js +1 -1
- package/src/web-rtc-client.js +27 -10
|
@@ -444,7 +444,7 @@ const logger$1 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
444
444
|
|
|
445
445
|
// Use a function here to be able to mock it in tests
|
|
446
446
|
const realFetch = () => {
|
|
447
|
-
if (typeof document !== 'undefined') {
|
|
447
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
448
448
|
// Browser
|
|
449
449
|
return window.fetch;
|
|
450
450
|
}
|
|
@@ -1904,7 +1904,7 @@ class Contact {
|
|
|
1904
1904
|
this[key] = old[key] || this[key];
|
|
1905
1905
|
});
|
|
1906
1906
|
|
|
1907
|
-
if (old.lineState
|
|
1907
|
+
if (old.lineState) {
|
|
1908
1908
|
this.lineState = old.lineState;
|
|
1909
1909
|
}
|
|
1910
1910
|
|
|
@@ -2611,8 +2611,9 @@ class ExternalApp {
|
|
|
2611
2611
|
|
|
2612
2612
|
|
|
2613
2613
|
|
|
2614
|
-
|
|
2614
|
+
|
|
2615
2615
|
|
|
2616
|
+
|
|
2616
2617
|
|
|
2617
2618
|
|
|
2618
2619
|
class Meeting {
|
|
@@ -2623,9 +2624,10 @@ class Meeting {
|
|
|
2623
2624
|
|
|
2624
2625
|
|
|
2625
2626
|
|
|
2626
|
-
|
|
2627
|
+
|
|
2627
2628
|
|
|
2628
2629
|
|
|
2630
|
+
|
|
2629
2631
|
|
|
2630
2632
|
static parse(plain ) {
|
|
2631
2633
|
return new Meeting({
|
|
@@ -2635,8 +2637,9 @@ class Meeting {
|
|
|
2635
2637
|
ownerUuids: plain.owner_uuids,
|
|
2636
2638
|
port: plain.port,
|
|
2637
2639
|
uuid: plain.uuid,
|
|
2638
|
-
|
|
2640
|
+
extension: plain.exten,
|
|
2639
2641
|
persistent: plain.persistent,
|
|
2642
|
+
creationTime: moment(plain.creation_time).toDate(),
|
|
2640
2643
|
});
|
|
2641
2644
|
}
|
|
2642
2645
|
|
|
@@ -2658,8 +2661,9 @@ class Meeting {
|
|
|
2658
2661
|
ownerUuids,
|
|
2659
2662
|
port,
|
|
2660
2663
|
uri,
|
|
2661
|
-
|
|
2664
|
+
extension,
|
|
2662
2665
|
persistent,
|
|
2666
|
+
creationTime,
|
|
2663
2667
|
} = {}) {
|
|
2664
2668
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2665
2669
|
this.uri = uri;
|
|
@@ -2667,8 +2671,9 @@ class Meeting {
|
|
|
2667
2671
|
this.ownerUuids = ownerUuids;
|
|
2668
2672
|
this.port = port;
|
|
2669
2673
|
this.uuid = uuid;
|
|
2670
|
-
this.
|
|
2674
|
+
this.extension = extension;
|
|
2671
2675
|
this.persistent = persistent;
|
|
2676
|
+
this.creationTime = creationTime;
|
|
2672
2677
|
|
|
2673
2678
|
// Useful to compare instead of instanceof with minified code
|
|
2674
2679
|
this.type = 'Meeting';
|
|
@@ -104,7 +104,7 @@ const logger$2 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
104
104
|
|
|
105
105
|
// Use a function here to be able to mock it in tests
|
|
106
106
|
const realFetch = () => {
|
|
107
|
-
if (typeof document !== 'undefined') {
|
|
107
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
108
108
|
// Browser
|
|
109
109
|
return window.fetch;
|
|
110
110
|
}
|
|
@@ -823,11 +823,16 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
823
823
|
|
|
824
824
|
// $FlowFixMe
|
|
825
825
|
setRemoteSessionDescription(sessionDescription ) {
|
|
826
|
-
|
|
826
|
+
try {
|
|
827
|
+
const result = super.setRemoteSessionDescription(sessionDescription);
|
|
827
828
|
|
|
828
|
-
|
|
829
|
+
this.eventEmitter.emit('setDescription', sessionDescription);
|
|
829
830
|
|
|
830
|
-
|
|
831
|
+
return result;
|
|
832
|
+
} catch (error) {
|
|
833
|
+
this.logger.error('SessionDescriptionHandler.setRemoteSessionDescription error', error);
|
|
834
|
+
throw error;
|
|
835
|
+
}
|
|
831
836
|
}
|
|
832
837
|
|
|
833
838
|
// Overridden to avoid to fix ice-candidates missing in the SDP in react-native and chrome canary.
|
|
@@ -2447,7 +2452,7 @@ class Contact {
|
|
|
2447
2452
|
this[key] = old[key] || this[key];
|
|
2448
2453
|
});
|
|
2449
2454
|
|
|
2450
|
-
if (old.lineState
|
|
2455
|
+
if (old.lineState) {
|
|
2451
2456
|
this.lineState = old.lineState;
|
|
2452
2457
|
}
|
|
2453
2458
|
|
|
@@ -3154,8 +3159,9 @@ class ExternalApp {
|
|
|
3154
3159
|
|
|
3155
3160
|
|
|
3156
3161
|
|
|
3157
|
-
|
|
3162
|
+
|
|
3158
3163
|
|
|
3164
|
+
|
|
3159
3165
|
|
|
3160
3166
|
|
|
3161
3167
|
class Meeting {
|
|
@@ -3166,9 +3172,10 @@ class Meeting {
|
|
|
3166
3172
|
|
|
3167
3173
|
|
|
3168
3174
|
|
|
3169
|
-
|
|
3175
|
+
|
|
3170
3176
|
|
|
3171
3177
|
|
|
3178
|
+
|
|
3172
3179
|
|
|
3173
3180
|
static parse(plain ) {
|
|
3174
3181
|
return new Meeting({
|
|
@@ -3178,8 +3185,9 @@ class Meeting {
|
|
|
3178
3185
|
ownerUuids: plain.owner_uuids,
|
|
3179
3186
|
port: plain.port,
|
|
3180
3187
|
uuid: plain.uuid,
|
|
3181
|
-
|
|
3188
|
+
extension: plain.exten,
|
|
3182
3189
|
persistent: plain.persistent,
|
|
3190
|
+
creationTime: moment(plain.creation_time).toDate(),
|
|
3183
3191
|
});
|
|
3184
3192
|
}
|
|
3185
3193
|
|
|
@@ -3201,8 +3209,9 @@ class Meeting {
|
|
|
3201
3209
|
ownerUuids,
|
|
3202
3210
|
port,
|
|
3203
3211
|
uri,
|
|
3204
|
-
|
|
3212
|
+
extension,
|
|
3205
3213
|
persistent,
|
|
3214
|
+
creationTime,
|
|
3206
3215
|
} = {}) {
|
|
3207
3216
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
3208
3217
|
this.uri = uri;
|
|
@@ -3210,8 +3219,9 @@ class Meeting {
|
|
|
3210
3219
|
this.ownerUuids = ownerUuids;
|
|
3211
3220
|
this.port = port;
|
|
3212
3221
|
this.uuid = uuid;
|
|
3213
|
-
this.
|
|
3222
|
+
this.extension = extension;
|
|
3214
3223
|
this.persistent = persistent;
|
|
3224
|
+
this.creationTime = creationTime;
|
|
3215
3225
|
|
|
3216
3226
|
// Useful to compare instead of instanceof with minified code
|
|
3217
3227
|
this.type = 'Meeting';
|
|
@@ -5700,7 +5710,7 @@ class WebRTCClient extends Emitter {
|
|
|
5700
5710
|
}
|
|
5701
5711
|
|
|
5702
5712
|
call(number , enableVideo , audioOnly = false, conference = false) {
|
|
5703
|
-
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly });
|
|
5713
|
+
logger.info('sdk webrtc creating call', { number, enableVideo, audioOnly, conference });
|
|
5704
5714
|
const inviterOptions = {
|
|
5705
5715
|
sessionDescriptionHandlerOptionsReInvite: {
|
|
5706
5716
|
conference,
|
|
@@ -6776,6 +6786,7 @@ class WebRTCClient extends Emitter {
|
|
|
6776
6786
|
const screenSharing = constraints && 'screen' in constraints ? constraints.screen : false;
|
|
6777
6787
|
const isDesktop = constraints && 'desktop' in constraints ? constraints.desktop : false;
|
|
6778
6788
|
const withAudio = constraints && 'audio' in constraints ? constraints.audio : true;
|
|
6789
|
+
const mandatoryVideo = constraints && typeof constraints.video === 'object' ? constraints.video.mandatory : {};
|
|
6779
6790
|
|
|
6780
6791
|
logger.info('Retrieving media a configuration', { enableVideo, screenSharing, isDesktop, withAudio, constraints });
|
|
6781
6792
|
|
|
@@ -6783,7 +6794,8 @@ class WebRTCClient extends Emitter {
|
|
|
6783
6794
|
constraints: {
|
|
6784
6795
|
// Exact constraint are not supported with `getDisplayMedia` and we must have a video=false in desktop screenshare
|
|
6785
6796
|
audio: screenSharing ? !isDesktop : (withAudio ? this._getAudioConstraints() : false),
|
|
6786
|
-
video: screenSharing ? (isDesktop
|
|
6797
|
+
video: screenSharing ? (isDesktop
|
|
6798
|
+
? ({ mandatory: { chromeMediaSource: 'desktop', ...(mandatoryVideo || {}) } }) : { cursor: 'always' })
|
|
6787
6799
|
: this._getVideoConstraints(enableVideo),
|
|
6788
6800
|
screen: screenSharing,
|
|
6789
6801
|
desktop: isDesktop,
|
|
@@ -7118,12 +7130,14 @@ class WebRTCClient extends Emitter {
|
|
|
7118
7130
|
|
|
7119
7131
|
session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
|
|
7120
7132
|
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7133
|
+
if (pc) {
|
|
7134
|
+
pc.oniceconnectionstatechange = () => {
|
|
7135
|
+
logger.info('on ice connection state changed', { state: pc.iceConnectionState });
|
|
7136
|
+
if (pc.iceConnectionState === 'disconnected') {
|
|
7137
|
+
this.eventEmitter.emit(ON_DISCONNECTED);
|
|
7138
|
+
}
|
|
7139
|
+
};
|
|
7140
|
+
}
|
|
7127
7141
|
|
|
7128
7142
|
if (withEvent) {
|
|
7129
7143
|
this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
|
|
@@ -7333,13 +7347,17 @@ class WebRTCClient extends Emitter {
|
|
|
7333
7347
|
const nbStats = this.sessionNetworkStats[sessionId].length;
|
|
7334
7348
|
const lastNetworkStats = this.sessionNetworkStats[sessionId][nbStats - 1];
|
|
7335
7349
|
const lastAudioSent = lastNetworkStats ? lastNetworkStats.audioBytesSent : 0;
|
|
7350
|
+
const lastAudioContentSent = lastNetworkStats ? lastNetworkStats.audioContentSent : 0;
|
|
7336
7351
|
const lastVideoSent = lastNetworkStats ? lastNetworkStats.videoBytesSent : 0;
|
|
7337
7352
|
const lastAudioReceived = lastNetworkStats ? lastNetworkStats.audioBytesReceived : 0;
|
|
7353
|
+
const lastAudioContentReceived = lastNetworkStats ? lastNetworkStats.audioContentReceived : 0;
|
|
7338
7354
|
const lastVideoReceived = lastNetworkStats ? lastNetworkStats.videoBytesReceived : 0;
|
|
7339
7355
|
const lastTransportSent = lastNetworkStats ? lastNetworkStats.transportSent : 0;
|
|
7340
7356
|
const lastTransportReceived = lastNetworkStats ? lastNetworkStats.transportReceived : 0;
|
|
7341
|
-
let audioBytesSent = 0;
|
|
7342
|
-
let audioBytesReceived = 0;
|
|
7357
|
+
let audioBytesSent = 0; // content + header
|
|
7358
|
+
let audioBytesReceived = 0; // content + header
|
|
7359
|
+
let audioContentSent = 0; // useful to detect blank call
|
|
7360
|
+
let audioContentReceived = 0;
|
|
7343
7361
|
let videoBytesSent = 0;
|
|
7344
7362
|
let videoBytesReceived = 0;
|
|
7345
7363
|
let transportSent = 0;
|
|
@@ -7349,6 +7367,7 @@ class WebRTCClient extends Emitter {
|
|
|
7349
7367
|
stats.forEach(report => {
|
|
7350
7368
|
if (report.type === 'outbound-rtp' && report.kind === 'audio') {
|
|
7351
7369
|
audioBytesSent += Number(report.bytesSent) + Number(report.headerBytesSent);
|
|
7370
|
+
audioContentSent += Number(report.bytesSent);
|
|
7352
7371
|
}
|
|
7353
7372
|
if (report.type === 'remote-outbound-rtp' && report.kind === 'audio') {
|
|
7354
7373
|
audioBytesSent += Number(report.bytesSent);
|
|
@@ -7360,6 +7379,7 @@ class WebRTCClient extends Emitter {
|
|
|
7360
7379
|
packetsLost += Number(report.packetsLost);
|
|
7361
7380
|
networkStats.packetsReceived = Number(report.packetsReceived);
|
|
7362
7381
|
audioBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
7382
|
+
audioContentReceived += Number(report.bytesReceived);
|
|
7363
7383
|
}
|
|
7364
7384
|
if (report.type === 'inbound-rtp' && report.kind === 'video') {
|
|
7365
7385
|
videoBytesReceived += Number(report.bytesReceived) + Number(report.headerBytesReceived);
|
|
@@ -7388,10 +7408,17 @@ class WebRTCClient extends Emitter {
|
|
|
7388
7408
|
});
|
|
7389
7409
|
|
|
7390
7410
|
networkStats.packetsLost = packetsLost;
|
|
7411
|
+
|
|
7391
7412
|
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
7392
7413
|
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
7393
7414
|
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
7394
7415
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
7416
|
+
|
|
7417
|
+
networkStats.totalAudioContentSent = audioContentSent;
|
|
7418
|
+
networkStats.audioContentSent = audioContentSent - lastAudioContentSent;
|
|
7419
|
+
networkStats.totalAudioBytesReceived = audioContentReceived - lastAudioContentReceived;
|
|
7420
|
+
networkStats.audioContentReceived = audioContentReceived;
|
|
7421
|
+
|
|
7395
7422
|
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
7396
7423
|
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
7397
7424
|
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
package/esm/api/agentd.js
CHANGED
|
@@ -440,7 +440,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
440
440
|
|
|
441
441
|
// Use a function here to be able to mock it in tests
|
|
442
442
|
const realFetch = () => {
|
|
443
|
-
if (typeof document !== 'undefined') {
|
|
443
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
444
444
|
// Browser
|
|
445
445
|
return window.fetch;
|
|
446
446
|
}
|
package/esm/api/amid.js
CHANGED
|
@@ -368,7 +368,7 @@ IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
368
368
|
|
|
369
369
|
// Use a function here to be able to mock it in tests
|
|
370
370
|
const realFetch = () => {
|
|
371
|
-
if (typeof document !== 'undefined') {
|
|
371
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
372
372
|
// Browser
|
|
373
373
|
return window.fetch;
|
|
374
374
|
}
|
package/esm/api/application.js
CHANGED
|
@@ -440,7 +440,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
440
440
|
|
|
441
441
|
// Use a function here to be able to mock it in tests
|
|
442
442
|
const realFetch = () => {
|
|
443
|
-
if (typeof document !== 'undefined') {
|
|
443
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
444
444
|
// Browser
|
|
445
445
|
return window.fetch;
|
|
446
446
|
}
|
package/esm/api/auth.js
CHANGED
|
@@ -441,7 +441,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
441
441
|
|
|
442
442
|
// Use a function here to be able to mock it in tests
|
|
443
443
|
const realFetch = () => {
|
|
444
|
-
if (typeof document !== 'undefined') {
|
|
444
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
445
445
|
// Browser
|
|
446
446
|
return window.fetch;
|
|
447
447
|
}
|
package/esm/api/call-logd.js
CHANGED
|
@@ -369,7 +369,7 @@ IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
369
369
|
|
|
370
370
|
// Use a function here to be able to mock it in tests
|
|
371
371
|
const realFetch = () => {
|
|
372
|
-
if (typeof document !== 'undefined') {
|
|
372
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
373
373
|
// Browser
|
|
374
374
|
return window.fetch;
|
|
375
375
|
}
|
package/esm/api/calld.js
CHANGED
|
@@ -441,7 +441,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
441
441
|
|
|
442
442
|
// Use a function here to be able to mock it in tests
|
|
443
443
|
const realFetch = () => {
|
|
444
|
-
if (typeof document !== 'undefined') {
|
|
444
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
445
445
|
// Browser
|
|
446
446
|
return window.fetch;
|
|
447
447
|
}
|
package/esm/api/chatd.js
CHANGED
|
@@ -440,7 +440,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
440
440
|
|
|
441
441
|
// Use a function here to be able to mock it in tests
|
|
442
442
|
const realFetch = () => {
|
|
443
|
-
if (typeof document !== 'undefined') {
|
|
443
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
444
444
|
// Browser
|
|
445
445
|
return window.fetch;
|
|
446
446
|
}
|
package/esm/api/confd.js
CHANGED
|
@@ -440,7 +440,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
440
440
|
|
|
441
441
|
// Use a function here to be able to mock it in tests
|
|
442
442
|
const realFetch = () => {
|
|
443
|
-
if (typeof document !== 'undefined') {
|
|
443
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
444
444
|
// Browser
|
|
445
445
|
return window.fetch;
|
|
446
446
|
}
|
|
@@ -1282,8 +1282,9 @@ class ExternalApp {
|
|
|
1282
1282
|
|
|
1283
1283
|
|
|
1284
1284
|
|
|
1285
|
-
|
|
1285
|
+
|
|
1286
1286
|
|
|
1287
|
+
|
|
1287
1288
|
|
|
1288
1289
|
|
|
1289
1290
|
class Meeting {
|
|
@@ -1294,9 +1295,10 @@ class Meeting {
|
|
|
1294
1295
|
|
|
1295
1296
|
|
|
1296
1297
|
|
|
1297
|
-
|
|
1298
|
+
|
|
1298
1299
|
|
|
1299
1300
|
|
|
1301
|
+
|
|
1300
1302
|
|
|
1301
1303
|
static parse(plain ) {
|
|
1302
1304
|
return new Meeting({
|
|
@@ -1306,8 +1308,9 @@ class Meeting {
|
|
|
1306
1308
|
ownerUuids: plain.owner_uuids,
|
|
1307
1309
|
port: plain.port,
|
|
1308
1310
|
uuid: plain.uuid,
|
|
1309
|
-
|
|
1311
|
+
extension: plain.exten,
|
|
1310
1312
|
persistent: plain.persistent,
|
|
1313
|
+
creationTime: moment(plain.creation_time).toDate(),
|
|
1311
1314
|
});
|
|
1312
1315
|
}
|
|
1313
1316
|
|
|
@@ -1329,8 +1332,9 @@ class Meeting {
|
|
|
1329
1332
|
ownerUuids,
|
|
1330
1333
|
port,
|
|
1331
1334
|
uri,
|
|
1332
|
-
|
|
1335
|
+
extension,
|
|
1333
1336
|
persistent,
|
|
1337
|
+
creationTime,
|
|
1334
1338
|
} = {}) {
|
|
1335
1339
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
1336
1340
|
this.uri = uri;
|
|
@@ -1338,8 +1342,9 @@ class Meeting {
|
|
|
1338
1342
|
this.ownerUuids = ownerUuids;
|
|
1339
1343
|
this.port = port;
|
|
1340
1344
|
this.uuid = uuid;
|
|
1341
|
-
this.
|
|
1345
|
+
this.extension = extension;
|
|
1342
1346
|
this.persistent = persistent;
|
|
1347
|
+
this.creationTime = creationTime;
|
|
1343
1348
|
|
|
1344
1349
|
// Useful to compare instead of instanceof with minified code
|
|
1345
1350
|
this.type = 'Meeting';
|
package/esm/api/ctid-ng.js
CHANGED
|
@@ -444,7 +444,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
444
444
|
|
|
445
445
|
// Use a function here to be able to mock it in tests
|
|
446
446
|
const realFetch = () => {
|
|
447
|
-
if (typeof document !== 'undefined') {
|
|
447
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
448
448
|
// Browser
|
|
449
449
|
return window.fetch;
|
|
450
450
|
}
|
package/esm/api/dird.js
CHANGED
|
@@ -442,7 +442,7 @@ const logger = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
442
442
|
|
|
443
443
|
// Use a function here to be able to mock it in tests
|
|
444
444
|
const realFetch = () => {
|
|
445
|
-
if (typeof document !== 'undefined') {
|
|
445
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
446
446
|
// Browser
|
|
447
447
|
return window.fetch;
|
|
448
448
|
}
|
|
@@ -1388,7 +1388,7 @@ class Contact {
|
|
|
1388
1388
|
this[key] = old[key] || this[key];
|
|
1389
1389
|
});
|
|
1390
1390
|
|
|
1391
|
-
if (old.lineState
|
|
1391
|
+
if (old.lineState) {
|
|
1392
1392
|
this.lineState = old.lineState;
|
|
1393
1393
|
}
|
|
1394
1394
|
|
package/esm/api/webhookd.js
CHANGED
|
@@ -368,7 +368,7 @@ IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
368
368
|
|
|
369
369
|
// Use a function here to be able to mock it in tests
|
|
370
370
|
const realFetch = () => {
|
|
371
|
-
if (typeof document !== 'undefined') {
|
|
371
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
372
372
|
// Browser
|
|
373
373
|
return window.fetch;
|
|
374
374
|
}
|
package/esm/api-client.js
CHANGED
|
@@ -444,7 +444,7 @@ const logger$1 = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
|
444
444
|
|
|
445
445
|
// Use a function here to be able to mock it in tests
|
|
446
446
|
const realFetch = () => {
|
|
447
|
-
if (typeof document !== 'undefined') {
|
|
447
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
448
448
|
// Browser
|
|
449
449
|
return window.fetch;
|
|
450
450
|
}
|
|
@@ -1904,7 +1904,7 @@ class Contact {
|
|
|
1904
1904
|
this[key] = old[key] || this[key];
|
|
1905
1905
|
});
|
|
1906
1906
|
|
|
1907
|
-
if (old.lineState
|
|
1907
|
+
if (old.lineState) {
|
|
1908
1908
|
this.lineState = old.lineState;
|
|
1909
1909
|
}
|
|
1910
1910
|
|
|
@@ -2611,8 +2611,9 @@ class ExternalApp {
|
|
|
2611
2611
|
|
|
2612
2612
|
|
|
2613
2613
|
|
|
2614
|
-
|
|
2614
|
+
|
|
2615
2615
|
|
|
2616
|
+
|
|
2616
2617
|
|
|
2617
2618
|
|
|
2618
2619
|
class Meeting {
|
|
@@ -2623,9 +2624,10 @@ class Meeting {
|
|
|
2623
2624
|
|
|
2624
2625
|
|
|
2625
2626
|
|
|
2626
|
-
|
|
2627
|
+
|
|
2627
2628
|
|
|
2628
2629
|
|
|
2630
|
+
|
|
2629
2631
|
|
|
2630
2632
|
static parse(plain ) {
|
|
2631
2633
|
return new Meeting({
|
|
@@ -2635,8 +2637,9 @@ class Meeting {
|
|
|
2635
2637
|
ownerUuids: plain.owner_uuids,
|
|
2636
2638
|
port: plain.port,
|
|
2637
2639
|
uuid: plain.uuid,
|
|
2638
|
-
|
|
2640
|
+
extension: plain.exten,
|
|
2639
2641
|
persistent: plain.persistent,
|
|
2642
|
+
creationTime: moment(plain.creation_time).toDate(),
|
|
2640
2643
|
});
|
|
2641
2644
|
}
|
|
2642
2645
|
|
|
@@ -2658,8 +2661,9 @@ class Meeting {
|
|
|
2658
2661
|
ownerUuids,
|
|
2659
2662
|
port,
|
|
2660
2663
|
uri,
|
|
2661
|
-
|
|
2664
|
+
extension,
|
|
2662
2665
|
persistent,
|
|
2666
|
+
creationTime,
|
|
2663
2667
|
} = {}) {
|
|
2664
2668
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2665
2669
|
this.uri = uri;
|
|
@@ -2667,8 +2671,9 @@ class Meeting {
|
|
|
2667
2671
|
this.ownerUuids = ownerUuids;
|
|
2668
2672
|
this.port = port;
|
|
2669
2673
|
this.uuid = uuid;
|
|
2670
|
-
this.
|
|
2674
|
+
this.extension = extension;
|
|
2671
2675
|
this.persistent = persistent;
|
|
2676
|
+
this.creationTime = creationTime;
|
|
2672
2677
|
|
|
2673
2678
|
// Useful to compare instead of instanceof with minified code
|
|
2674
2679
|
this.type = 'Meeting';
|