agora-appbuilder-core 4.0.24 → 4.0.25-beta-2
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/package.json +1 -1
- package/template/agora-rn-uikit/.eslintrc.js +0 -5
- package/template/agora-rn-uikit/package-lock.json +6116 -23528
- package/template/agora-rn-uikit/package.json +14 -14
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +6 -6
- package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +6 -6
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +40 -79
- package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +10 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +17 -26
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +0 -1
- package/template/agora-rn-uikit/src/Controls/Icons.ts +0 -51
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -6
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +2 -5
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +2 -5
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -0
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -7
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +5 -5
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +1 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +11 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +7 -8
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +7 -8
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +8 -7
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +9 -9
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +8 -7
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +13 -14
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +7 -6
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +6 -5
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +3 -20
- package/template/agora-rn-uikit/src/Reducer/index.ts +1 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +125 -122
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +27 -46
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +77 -175
- package/template/agora-rn-uikit/src/Utils/quality.tsx +0 -8
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +12 -56
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +17 -47
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +11 -19
- package/template/agora-rn-uikit/src/index.ts +9 -16
- package/template/customization-api/typeDefinition.ts +1 -4
- package/template/customization-api/utils.ts +1 -0
- package/template/defaultConfig.js +2 -0
- package/template/global.d.ts +2 -0
- package/template/src/AppRoutes.tsx +1 -7
- package/template/src/auth/AuthProvider.tsx +70 -24
- package/template/src/auth/useIDPAuth.electron.tsx +59 -2
- package/template/src/auth/useIDPAuth.native.tsx +59 -2
- package/template/src/auth/useIDPAuth.tsx +60 -2
- package/template/src/auth/useTokenAuth.tsx +66 -4
- package/template/src/components/DeviceConfigure.tsx +74 -68
- package/template/src/components/GraphQLProvider.tsx +0 -1
- package/template/src/components/contexts/WaitingRoomContext.tsx +11 -4
- package/template/src/components/recording-bot/RecordingBotRoute.tsx +1 -1
- package/template/src/components/useUserPreference.tsx +56 -9
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +4 -1
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +185 -24
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +47 -6
- package/template/src/logger/AppBuilderLogger.tsx +94 -36
- package/template/src/logger/transports/customer-transport.ts +7 -3
- package/template/src/pages/VideoCall.tsx +3 -5
- package/template/src/subComponents/SelectDevice.tsx +14 -52
- package/template/src/subComponents/caption/useSTTAPI.tsx +39 -3
- package/template/src/subComponents/recording/useRecording.tsx +69 -20
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +30 -8
- package/template/src/utils/common.tsx +6 -1
- package/template/src/utils/useCreateRoom.ts +21 -2
- package/template/src/utils/useFindActiveSpeaker.ts +12 -5
- package/template/src/utils/useGetMeetingPhrase.ts +44 -1
- package/template/src/utils/useJoinRoom.ts +29 -2
- package/template/src/utils/useMutePSTN.ts +29 -0
- package/template/agora-rn-uikit/src/Contexts/ContentContext.tsx +0 -10
- package/template/agora-rn-uikit/src/Contexts/DispatchContext.tsx +0 -22
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeaker.ts +0 -30
- package/template/agora-rn-uikit/src/Reducer/UserSecondaryPin.ts +0 -23
- package/template/agora-rn-uikit/src/Utils/isBotUser.ts +0 -15
|
@@ -321,12 +321,44 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
321
321
|
headers: myHeaders,
|
|
322
322
|
body: selectedFile,
|
|
323
323
|
};
|
|
324
|
+
const startReqTsUpload = Date.now();
|
|
325
|
+
logger.log(
|
|
326
|
+
LogSource.NetworkRest,
|
|
327
|
+
'whiteboard_s3_upload',
|
|
328
|
+
'API whiteboard_s3_upload trying to send request to server',
|
|
329
|
+
{
|
|
330
|
+
startReqTs: startReqTsUpload,
|
|
331
|
+
uploadURL: url,
|
|
332
|
+
fileType: selectedFile?.type,
|
|
333
|
+
},
|
|
334
|
+
);
|
|
324
335
|
fetch(url, requestOptions)
|
|
325
|
-
.then(
|
|
336
|
+
.then(res => {
|
|
337
|
+
const endReqTsUpload = Date.now();
|
|
338
|
+
logger.log(
|
|
339
|
+
LogSource.NetworkRest,
|
|
340
|
+
'whiteboard_s3_upload',
|
|
341
|
+
'whiteboard_s3_upload success',
|
|
342
|
+
{
|
|
343
|
+
fileType: selectedFile?.type,
|
|
344
|
+
responseData: res,
|
|
345
|
+
startReqTs: startReqTsUpload,
|
|
346
|
+
endReqTs: endReqTsUpload,
|
|
347
|
+
latency: endReqTsUpload - startReqTsUpload,
|
|
348
|
+
},
|
|
349
|
+
);
|
|
350
|
+
const requestId = getUniqueID();
|
|
351
|
+
const startReqTs = Date.now();
|
|
352
|
+
logger.log(
|
|
353
|
+
LogSource.NetworkRest,
|
|
354
|
+
'whiteboard_fileconvert',
|
|
355
|
+
'API whiteboard_fileconvert trying to send request to server',
|
|
356
|
+
{requestId, startReqTs, fileType: selectedFile?.type},
|
|
357
|
+
);
|
|
326
358
|
const myHeaders2 = new Headers();
|
|
327
359
|
myHeaders2.append('Content-Type', 'application/json');
|
|
328
360
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
329
|
-
myHeaders2.append('X-Request-Id',
|
|
361
|
+
myHeaders2.append('X-Request-Id', requestId);
|
|
330
362
|
|
|
331
363
|
const body = JSON.stringify({
|
|
332
364
|
resource_url: url,
|
|
@@ -340,22 +372,38 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
340
372
|
body: body,
|
|
341
373
|
})
|
|
342
374
|
.then(res2 => {
|
|
343
|
-
|
|
375
|
+
const endReqTs = Date.now();
|
|
376
|
+
logger.log(
|
|
344
377
|
LogSource.NetworkRest,
|
|
345
378
|
'whiteboard_fileconvert',
|
|
346
379
|
'file convert success',
|
|
347
|
-
|
|
380
|
+
{
|
|
381
|
+
fileType: selectedFile?.type,
|
|
382
|
+
responseData: res2,
|
|
383
|
+
requestId,
|
|
384
|
+
startReqTs,
|
|
385
|
+
endReqTs,
|
|
386
|
+
latency: endReqTs - startReqTs,
|
|
387
|
+
},
|
|
348
388
|
);
|
|
349
389
|
//updating upload flag as true
|
|
350
390
|
//once we got RTM message we will proceed to insert image into whiteboard
|
|
351
391
|
setUploadRef();
|
|
352
392
|
})
|
|
353
393
|
.catch(err2 => {
|
|
394
|
+
const endReqTs = Date.now();
|
|
354
395
|
logger.error(
|
|
355
396
|
LogSource.NetworkRest,
|
|
356
397
|
'whiteboard_fileconvert',
|
|
357
398
|
'file convert failed',
|
|
358
|
-
|
|
399
|
+
{
|
|
400
|
+
fileType: selectedFile?.type,
|
|
401
|
+
error: err2,
|
|
402
|
+
requestId,
|
|
403
|
+
startReqTs,
|
|
404
|
+
endReqTs,
|
|
405
|
+
latency: endReqTs - startReqTs,
|
|
406
|
+
},
|
|
359
407
|
);
|
|
360
408
|
Toast.show({
|
|
361
409
|
type: 'error',
|
|
@@ -364,7 +412,20 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
364
412
|
});
|
|
365
413
|
});
|
|
366
414
|
})
|
|
367
|
-
.catch(
|
|
415
|
+
.catch(error => {
|
|
416
|
+
const endReqTsUpload = Date.now();
|
|
417
|
+
logger.error(
|
|
418
|
+
LogSource.NetworkRest,
|
|
419
|
+
'whiteboard_s3_upload',
|
|
420
|
+
'API whiteboard_s3_upload failed',
|
|
421
|
+
{
|
|
422
|
+
fileType: selectedFile?.type,
|
|
423
|
+
error: error,
|
|
424
|
+
startReqT: startReqTsUpload,
|
|
425
|
+
endReqTs: endReqTsUpload,
|
|
426
|
+
latency: endReqTsUpload - startReqTsUpload,
|
|
427
|
+
},
|
|
428
|
+
);
|
|
368
429
|
Toast.show({
|
|
369
430
|
type: 'error',
|
|
370
431
|
text1: whiteboardFileUploadErrorToastHeadingTT('File'),
|
|
@@ -396,12 +457,47 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
396
457
|
headers: myHeaders,
|
|
397
458
|
body: selectedFile,
|
|
398
459
|
};
|
|
460
|
+
const startReqTsS3 = Date.now();
|
|
461
|
+
logger.log(
|
|
462
|
+
LogSource.NetworkRest,
|
|
463
|
+
'whiteboard_s3_upload',
|
|
464
|
+
'Trying to upload image into s3',
|
|
465
|
+
{
|
|
466
|
+
uploadURL: url,
|
|
467
|
+
startReqTs: startReqTsS3,
|
|
468
|
+
},
|
|
469
|
+
);
|
|
399
470
|
fetch(url, requestOptions)
|
|
400
|
-
.then(
|
|
471
|
+
.then(res => {
|
|
472
|
+
const endReqTsS3 = Date.now();
|
|
473
|
+
logger.log(
|
|
474
|
+
LogSource.NetworkRest,
|
|
475
|
+
'whiteboard_s3_upload',
|
|
476
|
+
'Uploaded image into s3 - success',
|
|
477
|
+
{
|
|
478
|
+
responseData: res,
|
|
479
|
+
startReqTs: startReqTsS3,
|
|
480
|
+
endReqTs: endReqTsS3,
|
|
481
|
+
latency: endReqTsS3 - startReqTsS3,
|
|
482
|
+
},
|
|
483
|
+
);
|
|
484
|
+
|
|
485
|
+
const requestId = getUniqueID();
|
|
486
|
+
const startReqTs = Date.now();
|
|
487
|
+
logger.log(
|
|
488
|
+
LogSource.NetworkRest,
|
|
489
|
+
'whiteboard_get_s3_signed_url',
|
|
490
|
+
'Trying to get signed url for s3 uploaded image',
|
|
491
|
+
{
|
|
492
|
+
uploadURL: url,
|
|
493
|
+
startReqTs,
|
|
494
|
+
requestId,
|
|
495
|
+
},
|
|
496
|
+
);
|
|
401
497
|
const myHeaders2 = new Headers();
|
|
402
498
|
myHeaders2.append('Content-Type', 'application/json');
|
|
403
499
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
404
|
-
myHeaders2.append('X-Request-Id',
|
|
500
|
+
myHeaders2.append('X-Request-Id', requestId);
|
|
405
501
|
const body = JSON.stringify({
|
|
406
502
|
resource_url: url,
|
|
407
503
|
});
|
|
@@ -411,24 +507,56 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
411
507
|
body: body,
|
|
412
508
|
})
|
|
413
509
|
.then(async res2 => {
|
|
510
|
+
const endReqTs = Date.now();
|
|
414
511
|
const jsonData = await res2.json();
|
|
415
512
|
if (jsonData && jsonData?.url) {
|
|
513
|
+
logger.log(
|
|
514
|
+
LogSource.NetworkRest,
|
|
515
|
+
'whiteboard_get_s3_signed_url',
|
|
516
|
+
'Got the signed url for s3 uploaded image',
|
|
517
|
+
{
|
|
518
|
+
responseData: res2,
|
|
519
|
+
startReqTs,
|
|
520
|
+
endReqTs,
|
|
521
|
+
latency: endReqTs - startReqTs,
|
|
522
|
+
requestId,
|
|
523
|
+
},
|
|
524
|
+
);
|
|
416
525
|
const imageUrl = jsonData?.url?.replaceAll('\u0026', '&');
|
|
417
526
|
insertImageIntoWhiteboard(imageUrl);
|
|
527
|
+
} else {
|
|
528
|
+
logger.error(
|
|
529
|
+
LogSource.NetworkRest,
|
|
530
|
+
'whiteboard_get_s3_signed_url',
|
|
531
|
+
'API success But failed to get signed url for s3 uploaded image',
|
|
532
|
+
{
|
|
533
|
+
responseData: res2,
|
|
534
|
+
startReqTs,
|
|
535
|
+
endReqTs,
|
|
536
|
+
latency: endReqTs - startReqTs,
|
|
537
|
+
requestId,
|
|
538
|
+
},
|
|
539
|
+
);
|
|
540
|
+
Toast.show({
|
|
541
|
+
type: 'error',
|
|
542
|
+
text1: whiteboardFileUploadErrorToastHeadingTT('Image'),
|
|
543
|
+
visibilityTime: 10000,
|
|
544
|
+
});
|
|
418
545
|
}
|
|
419
|
-
logger.debug(
|
|
420
|
-
LogSource.NetworkRest,
|
|
421
|
-
'whiteboard_image',
|
|
422
|
-
'image upload success',
|
|
423
|
-
res2,
|
|
424
|
-
);
|
|
425
546
|
})
|
|
426
547
|
.catch(err2 => {
|
|
548
|
+
const endReqTs = Date.now();
|
|
427
549
|
logger.error(
|
|
428
550
|
LogSource.NetworkRest,
|
|
429
|
-
'
|
|
551
|
+
'whiteboard_get_s3_signed_url',
|
|
430
552
|
'Failed to get image URL',
|
|
431
|
-
|
|
553
|
+
{
|
|
554
|
+
error: err2,
|
|
555
|
+
startReqTs,
|
|
556
|
+
endReqTs,
|
|
557
|
+
latency: endReqTs - startReqTs,
|
|
558
|
+
requestId,
|
|
559
|
+
},
|
|
432
560
|
);
|
|
433
561
|
Toast.show({
|
|
434
562
|
type: 'error',
|
|
@@ -437,7 +565,19 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
437
565
|
});
|
|
438
566
|
});
|
|
439
567
|
})
|
|
440
|
-
.catch(
|
|
568
|
+
.catch(error => {
|
|
569
|
+
const endReqTsS3 = Date.now();
|
|
570
|
+
logger.error(
|
|
571
|
+
LogSource.NetworkRest,
|
|
572
|
+
'whiteboard_s3_upload',
|
|
573
|
+
'Failed to upload image into s3',
|
|
574
|
+
{
|
|
575
|
+
error,
|
|
576
|
+
startReqTs: startReqTsS3,
|
|
577
|
+
endReqTs: endReqTsS3,
|
|
578
|
+
latency: endReqTsS3 - startReqTsS3,
|
|
579
|
+
},
|
|
580
|
+
);
|
|
441
581
|
Toast.show({
|
|
442
582
|
type: 'error',
|
|
443
583
|
text1: whiteboardFileUploadErrorToastHeadingTT('Image'),
|
|
@@ -445,7 +585,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
445
585
|
});
|
|
446
586
|
});
|
|
447
587
|
} else {
|
|
448
|
-
logger.
|
|
588
|
+
logger.error(
|
|
449
589
|
LogSource.Internals,
|
|
450
590
|
'WHITEBOARD',
|
|
451
591
|
'image upload url is empty',
|
|
@@ -468,16 +608,30 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
468
608
|
/**
|
|
469
609
|
* Get URL to upload the file
|
|
470
610
|
*/
|
|
611
|
+
const requestId = getUniqueID();
|
|
612
|
+
const startReqTs = Date.now();
|
|
613
|
+
logger.log(
|
|
614
|
+
LogSource.NetworkRest,
|
|
615
|
+
'whiteboard_get_s3_upload_url',
|
|
616
|
+
'API whiteboard_get_s3_upload_url trying to send request to server',
|
|
617
|
+
{requestId, startReqTs},
|
|
618
|
+
);
|
|
471
619
|
fetch(`${$config.BACKEND_ENDPOINT}/v1/whiteboard/upload`, {
|
|
472
620
|
method: 'GET',
|
|
473
621
|
headers: {
|
|
474
622
|
authorization: store?.token ? `Bearer ${store?.token}` : '',
|
|
475
|
-
'X-Request-Id':
|
|
623
|
+
'X-Request-Id': requestId,
|
|
476
624
|
},
|
|
477
625
|
})
|
|
478
626
|
.then(async res => {
|
|
627
|
+
const endReqTs = Date.now();
|
|
628
|
+
logger.log(
|
|
629
|
+
LogSource.NetworkRest,
|
|
630
|
+
'whiteboard_get_s3_upload_url',
|
|
631
|
+
'API whiteboard_get_upload get url success',
|
|
632
|
+
{requestId, startReqTs, endReqTs, latency: endReqTs - startReqTs},
|
|
633
|
+
);
|
|
479
634
|
const data = await res.json();
|
|
480
|
-
|
|
481
635
|
if (supportedImageType?.indexOf(selectedFile?.type) !== -1) {
|
|
482
636
|
Toast.show({
|
|
483
637
|
type: 'info',
|
|
@@ -498,12 +652,19 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
498
652
|
fileUploadAndConvert(data, selectedFile);
|
|
499
653
|
}
|
|
500
654
|
})
|
|
501
|
-
.catch(
|
|
655
|
+
.catch(error => {
|
|
656
|
+
const endReqTs = Date.now();
|
|
502
657
|
logger.error(
|
|
503
658
|
LogSource.NetworkRest,
|
|
504
|
-
'
|
|
505
|
-
'upload api failed',
|
|
506
|
-
|
|
659
|
+
'whiteboard_get_s3_upload_url',
|
|
660
|
+
'get upload url api failed',
|
|
661
|
+
{
|
|
662
|
+
error,
|
|
663
|
+
requestId,
|
|
664
|
+
startReqTs,
|
|
665
|
+
endReqTs,
|
|
666
|
+
latency: endReqTs - startReqTs,
|
|
667
|
+
},
|
|
507
668
|
);
|
|
508
669
|
Toast.show({
|
|
509
670
|
type: 'error',
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
whiteboardWidgetZoomOutText,
|
|
50
50
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
51
51
|
import getUniqueID from '../../utils/getUniqueID';
|
|
52
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
52
53
|
|
|
53
54
|
const Seperator = () => {
|
|
54
55
|
return (
|
|
@@ -101,7 +102,24 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
|
|
|
101
102
|
return null;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
const showWhiteboardError = (
|
|
105
|
+
const showWhiteboardError = (
|
|
106
|
+
error: any,
|
|
107
|
+
startReqTs: number,
|
|
108
|
+
endReqTs: number,
|
|
109
|
+
requestId: string,
|
|
110
|
+
) => {
|
|
111
|
+
logger.error(
|
|
112
|
+
LogSource.NetworkRest,
|
|
113
|
+
'whiteboard_screenshot',
|
|
114
|
+
'API whiteboard_screenshot failed to generated screenshot URL',
|
|
115
|
+
{
|
|
116
|
+
error,
|
|
117
|
+
startReqTs,
|
|
118
|
+
endReqTs,
|
|
119
|
+
latency: endReqTs - startReqTs,
|
|
120
|
+
requestId,
|
|
121
|
+
},
|
|
122
|
+
);
|
|
105
123
|
setIsInProgress(false);
|
|
106
124
|
Toast.show({
|
|
107
125
|
leadingIconName: 'alert',
|
|
@@ -114,6 +132,8 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
|
|
|
114
132
|
};
|
|
115
133
|
|
|
116
134
|
const exportWhiteboard = () => {
|
|
135
|
+
const startReqTs = Date.now();
|
|
136
|
+
const requestId = getUniqueID();
|
|
117
137
|
try {
|
|
118
138
|
setIsInProgress(true);
|
|
119
139
|
Toast.show({
|
|
@@ -127,22 +147,41 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
|
|
|
127
147
|
const myHeaders2 = new Headers();
|
|
128
148
|
myHeaders2.append('Content-Type', 'application/json');
|
|
129
149
|
myHeaders2.append('Authorization', `Bearer ${store?.token}`);
|
|
130
|
-
myHeaders2.append('X-Request-Id',
|
|
150
|
+
myHeaders2.append('X-Request-Id', requestId);
|
|
131
151
|
const body = JSON.stringify({
|
|
132
152
|
room_uuid: room_uuid,
|
|
133
153
|
path: '/init',
|
|
134
154
|
width: 3840,
|
|
135
155
|
height: 2160,
|
|
136
156
|
});
|
|
157
|
+
logger.log(
|
|
158
|
+
LogSource.NetworkRest,
|
|
159
|
+
'whiteboard_screenshot',
|
|
160
|
+
'API whiteboard_screenshot trying to send request to server',
|
|
161
|
+
{body, requestId, startReqTs},
|
|
162
|
+
);
|
|
137
163
|
fetch(`${$config.BACKEND_ENDPOINT}/v1/whiteboard/screenshot`, {
|
|
138
164
|
method: 'POST',
|
|
139
165
|
headers: myHeaders2,
|
|
140
166
|
body: body,
|
|
141
167
|
})
|
|
142
168
|
.then(async res2 => {
|
|
169
|
+
const endReqTs = Date.now();
|
|
143
170
|
const data = await res2.json();
|
|
144
171
|
const parsedUrl = data?.url?.replaceAll('\u0026', '&');
|
|
145
172
|
if (parsedUrl) {
|
|
173
|
+
logger.log(
|
|
174
|
+
LogSource.NetworkRest,
|
|
175
|
+
'whiteboard_screenshot',
|
|
176
|
+
'API whiteboard_screenshot successfully generated screenshot URL',
|
|
177
|
+
{
|
|
178
|
+
responseData: res2,
|
|
179
|
+
start: startReqTs,
|
|
180
|
+
end: endReqTs,
|
|
181
|
+
latency: endReqTs - startReqTs,
|
|
182
|
+
requestId,
|
|
183
|
+
},
|
|
184
|
+
);
|
|
146
185
|
Toast.show({
|
|
147
186
|
leadingIconName: 'tick-fill',
|
|
148
187
|
type: 'success',
|
|
@@ -157,14 +196,16 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
|
|
|
157
196
|
});
|
|
158
197
|
setIsInProgress(false);
|
|
159
198
|
} else {
|
|
160
|
-
showWhiteboardError();
|
|
199
|
+
showWhiteboardError({}, startReqTs, endReqTs, requestId);
|
|
161
200
|
}
|
|
162
201
|
})
|
|
163
|
-
.catch(
|
|
164
|
-
|
|
202
|
+
.catch(error => {
|
|
203
|
+
const endReqTs = Date.now();
|
|
204
|
+
showWhiteboardError(error, startReqTs, endReqTs, requestId);
|
|
165
205
|
});
|
|
166
206
|
} catch (error) {
|
|
167
|
-
|
|
207
|
+
const endReqTs = Date.now();
|
|
208
|
+
showWhiteboardError(error, startReqTs, endReqTs, requestId);
|
|
168
209
|
}
|
|
169
210
|
|
|
170
211
|
/* local download file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react-native-get-random-values';
|
|
2
2
|
import {nanoid} from 'nanoid';
|
|
3
3
|
import pkg from '../../package.json';
|
|
4
|
-
import {isWeb} from '../utils/common';
|
|
4
|
+
import {isWeb, isWebInternal} from '../utils/common';
|
|
5
5
|
import {
|
|
6
6
|
ENABLE_AGORA_LOGGER_TRANSPORT,
|
|
7
7
|
ENABLE_BROWSER_CONSOLE_LOGS,
|
|
@@ -13,14 +13,20 @@ import {
|
|
|
13
13
|
} from './transports/agora-transport';
|
|
14
14
|
import configJSON from '../../config.json';
|
|
15
15
|
import {getPlatformId} from '../auth/config';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
initTransportLayerForCustomers,
|
|
18
|
+
sendLogs,
|
|
19
|
+
} from './transports/customer-transport';
|
|
17
20
|
|
|
18
|
-
const cli_version =
|
|
21
|
+
const cli_version = $config.CLI_VERSION;
|
|
22
|
+
const core_version = $config.CORE_VERSION;
|
|
19
23
|
|
|
20
24
|
export type CustomLogger = (
|
|
21
25
|
message: string,
|
|
22
|
-
data: any,
|
|
23
26
|
type: StatusType,
|
|
27
|
+
columns?: Object,
|
|
28
|
+
contextInfo?: Object,
|
|
29
|
+
data?: any,
|
|
24
30
|
) => void;
|
|
25
31
|
|
|
26
32
|
export declare const StatusTypes: {
|
|
@@ -49,6 +55,7 @@ export enum LogSource {
|
|
|
49
55
|
type LogType = {
|
|
50
56
|
[LogSource.AgoraSDK]: 'Log' | 'API' | 'Event' | 'Service';
|
|
51
57
|
[LogSource.Internals]:
|
|
58
|
+
| 'SEND_LOG_IMMEDIATELY'
|
|
52
59
|
| 'AUTH'
|
|
53
60
|
| 'CREATE_MEETING'
|
|
54
61
|
| 'SET_MEETING_DETAILS'
|
|
@@ -72,22 +79,27 @@ type LogType = {
|
|
|
72
79
|
| 'ACTIVE_SPEAKER'
|
|
73
80
|
| 'WAITING_ROOM'
|
|
74
81
|
| 'RECORDING'
|
|
75
|
-
| 'STORE'
|
|
82
|
+
| 'STORE'
|
|
83
|
+
| 'GET_MEETING_PHRASE'
|
|
84
|
+
| 'MUTE_PSTN';
|
|
76
85
|
[LogSource.NetworkRest]:
|
|
77
86
|
| 'idp_login'
|
|
78
87
|
| 'token_login'
|
|
79
88
|
| 'unauth_login'
|
|
80
89
|
| 'idp_logout'
|
|
81
90
|
| 'token_logout'
|
|
91
|
+
| 'token_refresh'
|
|
82
92
|
| 'user_details'
|
|
83
93
|
| 'createChannel'
|
|
84
94
|
| 'joinChannel'
|
|
85
95
|
| 'channel_join_request'
|
|
86
96
|
| 'channel_join_approval'
|
|
87
97
|
| 'stt'
|
|
88
|
-
| '
|
|
89
|
-
| '
|
|
98
|
+
| 'whiteboard_get_s3_signed_url'
|
|
99
|
+
| 'whiteboard_get_s3_upload_url'
|
|
100
|
+
| 'whiteboard_s3_upload'
|
|
90
101
|
| 'whiteboard_fileconvert'
|
|
102
|
+
| 'whiteboard_screenshot'
|
|
91
103
|
| 'recording_start'
|
|
92
104
|
| 'recording_stop'
|
|
93
105
|
| 'recordings_get';
|
|
@@ -125,9 +137,9 @@ export default class AppBuilderLogger implements Logger {
|
|
|
125
137
|
debug: LogFn;
|
|
126
138
|
error: LogFn;
|
|
127
139
|
private _customLogger: CustomLogger;
|
|
128
|
-
|
|
140
|
+
private _session;
|
|
129
141
|
constructor(_transportLogger?: any) {
|
|
130
|
-
|
|
142
|
+
this._session = nanoid();
|
|
131
143
|
const platform = getPlatformId();
|
|
132
144
|
const rtmPkg = isWeb()
|
|
133
145
|
? pkg.dependencies['agora-rtm-sdk']
|
|
@@ -137,12 +149,10 @@ export default class AppBuilderLogger implements Logger {
|
|
|
137
149
|
: pkg.dependencies['react-native-agora'];
|
|
138
150
|
let roomInfo = {
|
|
139
151
|
meeting_title: '',
|
|
140
|
-
phrase: '',
|
|
141
152
|
channel_id: '',
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
},
|
|
153
|
+
host_id: '',
|
|
154
|
+
attendee_id: '',
|
|
155
|
+
user_id: '',
|
|
146
156
|
};
|
|
147
157
|
const logger =
|
|
148
158
|
(status: StatusType) =>
|
|
@@ -158,41 +168,83 @@ export default class AppBuilderLogger implements Logger {
|
|
|
158
168
|
if (type === 'SET_MEETING_DETAILS') {
|
|
159
169
|
roomInfo = {...data[0]};
|
|
160
170
|
}
|
|
161
|
-
const
|
|
171
|
+
const columns = {
|
|
162
172
|
timestamp: Date.now(),
|
|
163
173
|
source,
|
|
164
|
-
version: cli_version,
|
|
165
174
|
type,
|
|
166
|
-
data,
|
|
167
175
|
platform,
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
user_id: roomInfo?.user_id,
|
|
177
|
+
session_id: this._session,
|
|
178
|
+
channel_id: roomInfo?.channel_id,
|
|
179
|
+
host_id: roomInfo?.host_id,
|
|
180
|
+
attendee_id: roomInfo?.attendee_id,
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const contextInfo = {
|
|
184
|
+
agora_sdk_version: {
|
|
185
|
+
rtm: rtmPkg,
|
|
186
|
+
rtc: rtcPkg,
|
|
187
|
+
},
|
|
188
|
+
appbuilder_version: {
|
|
189
|
+
cli: cli_version,
|
|
190
|
+
core: core_version,
|
|
191
|
+
},
|
|
192
|
+
meeting_title: roomInfo?.meeting_title,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
if (isWebInternal() && window) {
|
|
196
|
+
//@ts-ignore
|
|
197
|
+
window.APP_BUILDER = {
|
|
198
|
+
//need to store CORE version and CLI version
|
|
170
199
|
app_id: $config.APP_ID,
|
|
171
200
|
project_id: $config.PROJECT_ID,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
rtc: rtcPkg,
|
|
175
|
-
},
|
|
176
|
-
meeting_title: roomInfo?.meeting_title,
|
|
177
|
-
phrase: roomInfo?.phrase,
|
|
201
|
+
user_id: roomInfo?.user_id,
|
|
202
|
+
session_id: this._session,
|
|
178
203
|
channel_id: roomInfo?.channel_id,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
};
|
|
204
|
+
host_id: roomInfo?.host_id,
|
|
205
|
+
attendee_id: roomInfo?.attendee_id,
|
|
206
|
+
contextInfo: contextInfo,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
185
209
|
|
|
186
210
|
try {
|
|
187
211
|
if (ENABLE_CUSTOMER_LOGGER_TRANSPORT) {
|
|
188
212
|
if (this._customLogger) {
|
|
189
|
-
this._customLogger(
|
|
213
|
+
this._customLogger(
|
|
214
|
+
logMessage,
|
|
215
|
+
status,
|
|
216
|
+
columns,
|
|
217
|
+
contextInfo,
|
|
218
|
+
data,
|
|
219
|
+
);
|
|
190
220
|
} else if (_transportLogger) {
|
|
191
|
-
|
|
221
|
+
if (type === 'SEND_LOG_IMMEDIATELY') {
|
|
222
|
+
sendLogs([
|
|
223
|
+
{
|
|
224
|
+
_time: Date.now(),
|
|
225
|
+
projectId: $config.PROJECT_ID,
|
|
226
|
+
appId: $config.APP_ID,
|
|
227
|
+
service: 'app-builder-core-frontend-customer',
|
|
228
|
+
logType: status,
|
|
229
|
+
logMessage: logMessage,
|
|
230
|
+
...columns,
|
|
231
|
+
contextInfo,
|
|
232
|
+
logContent: data,
|
|
233
|
+
},
|
|
234
|
+
]);
|
|
235
|
+
} else {
|
|
236
|
+
_transportLogger(
|
|
237
|
+
logMessage,
|
|
238
|
+
status,
|
|
239
|
+
columns,
|
|
240
|
+
contextInfo,
|
|
241
|
+
data,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
192
244
|
}
|
|
193
245
|
}
|
|
194
246
|
if (ENABLE_AGORA_LOGGER_TRANSPORT && _transportLogger) {
|
|
195
|
-
_transportLogger(logMessage,
|
|
247
|
+
_transportLogger(logMessage, status, columns, contextInfo, data);
|
|
196
248
|
}
|
|
197
249
|
} catch (error) {
|
|
198
250
|
console.log(
|
|
@@ -209,7 +261,7 @@ export default class AppBuilderLogger implements Logger {
|
|
|
209
261
|
consoleHeader,
|
|
210
262
|
consoleCSS,
|
|
211
263
|
logMessage,
|
|
212
|
-
|
|
264
|
+
{...columns, contextInfo, logContent: data},
|
|
213
265
|
status,
|
|
214
266
|
);
|
|
215
267
|
}
|
|
@@ -231,14 +283,20 @@ export default class AppBuilderLogger implements Logger {
|
|
|
231
283
|
);
|
|
232
284
|
}
|
|
233
285
|
|
|
286
|
+
getSessionId = () => {
|
|
287
|
+
return this._session;
|
|
288
|
+
};
|
|
289
|
+
|
|
234
290
|
setCustomLogger = (_customLogger: CustomLogger) => {
|
|
235
291
|
this._customLogger = _customLogger;
|
|
236
292
|
_customLogger(
|
|
237
293
|
'App intitialized with config.json',
|
|
294
|
+
'debug',
|
|
295
|
+
{},
|
|
296
|
+
{},
|
|
238
297
|
{
|
|
239
298
|
config: configJSON,
|
|
240
299
|
},
|
|
241
|
-
'debug',
|
|
242
300
|
);
|
|
243
301
|
};
|
|
244
302
|
}
|
|
@@ -52,7 +52,7 @@ const fetchRetry = createRetryFetch(fetch, {
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const sendLogs = (p: any[]) => {
|
|
55
|
+
export const sendLogs = (p: any[]) => {
|
|
56
56
|
if (p && p?.length) {
|
|
57
57
|
fetchRetry(
|
|
58
58
|
'https://axiom-queue.appbuilder.workers.dev?dataset=app-builder-core-frontend-customer',
|
|
@@ -113,13 +113,17 @@ export const createAxiomLogger = () => {
|
|
|
113
113
|
export const initTransportLayerForCustomers = () => {
|
|
114
114
|
const [log, flush] = createAxiomLogger();
|
|
115
115
|
|
|
116
|
-
const printLogs = (
|
|
116
|
+
const printLogs = (logMessage, logType, columns, contextInfo, logContent) => {
|
|
117
117
|
log({
|
|
118
|
-
data: args,
|
|
119
118
|
_time: Date.now(),
|
|
120
119
|
projectId: $config.PROJECT_ID,
|
|
121
120
|
appId: $config.APP_ID,
|
|
122
121
|
service: 'app-builder-core-frontend-customer',
|
|
122
|
+
logType,
|
|
123
|
+
logMessage,
|
|
124
|
+
logContent,
|
|
125
|
+
contextInfo,
|
|
126
|
+
...columns,
|
|
123
127
|
});
|
|
124
128
|
|
|
125
129
|
isWeb() &&
|
|
@@ -220,13 +220,11 @@ const VideoCall: React.FC = () => {
|
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
logger.log(LogSource.Internals, 'SET_MEETING_DETAILS', 'Room details', {
|
|
223
|
+
user_id: data?.uid || '',
|
|
223
224
|
meeting_title: data?.meetingTitle || '',
|
|
224
|
-
phrase: phrase,
|
|
225
225
|
channel_id: data?.channel,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
attendee_id: data?.roomId?.attendee || '',
|
|
229
|
-
},
|
|
226
|
+
host_id: data?.roomId?.host || '',
|
|
227
|
+
attendee_id: data?.roomId?.attendee || '',
|
|
230
228
|
});
|
|
231
229
|
}, [isJoinDataFetched, data, phrase]);
|
|
232
230
|
|