agora-appbuilder-core 4.0.24 → 4.0.25-beta-1
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
CHANGED
|
@@ -13,7 +13,10 @@ 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
21
|
const cli_version = 'test';
|
|
19
22
|
|
|
@@ -49,6 +52,7 @@ export enum LogSource {
|
|
|
49
52
|
type LogType = {
|
|
50
53
|
[LogSource.AgoraSDK]: 'Log' | 'API' | 'Event' | 'Service';
|
|
51
54
|
[LogSource.Internals]:
|
|
55
|
+
| 'SEND_LOG_IMMEDIATELY'
|
|
52
56
|
| 'AUTH'
|
|
53
57
|
| 'CREATE_MEETING'
|
|
54
58
|
| 'SET_MEETING_DETAILS'
|
|
@@ -188,7 +192,19 @@ export default class AppBuilderLogger implements Logger {
|
|
|
188
192
|
if (this._customLogger) {
|
|
189
193
|
this._customLogger(logMessage, context, status);
|
|
190
194
|
} else if (_transportLogger) {
|
|
191
|
-
|
|
195
|
+
if (type === 'SEND_LOG_IMMEDIATELY') {
|
|
196
|
+
sendLogs([
|
|
197
|
+
{
|
|
198
|
+
data: [logMessage, context, status],
|
|
199
|
+
_time: Date.now(),
|
|
200
|
+
projectId: $config.PROJECT_ID,
|
|
201
|
+
appId: $config.APP_ID,
|
|
202
|
+
service: 'app-builder-core-frontend-customer',
|
|
203
|
+
},
|
|
204
|
+
]);
|
|
205
|
+
} else {
|
|
206
|
+
_transportLogger(logMessage, context, status);
|
|
207
|
+
}
|
|
192
208
|
}
|
|
193
209
|
}
|
|
194
210
|
if (ENABLE_AGORA_LOGGER_TRANSPORT && _transportLogger) {
|
|
@@ -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',
|
|
@@ -356,7 +356,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
356
356
|
*/
|
|
357
357
|
logger.log(
|
|
358
358
|
LogSource.Internals,
|
|
359
|
-
'
|
|
359
|
+
'SEND_LOG_IMMEDIATELY',
|
|
360
360
|
'_stopRecording API called',
|
|
361
361
|
{calledBy: calledBy},
|
|
362
362
|
);
|
|
@@ -383,10 +383,10 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
383
383
|
setInProgress(false);
|
|
384
384
|
if (res.status === 200 || res.status === 202) {
|
|
385
385
|
logger.log(
|
|
386
|
-
LogSource.
|
|
387
|
-
'
|
|
386
|
+
LogSource.Internals,
|
|
387
|
+
'SEND_LOG_IMMEDIATELY',
|
|
388
388
|
'_stopRecording successfull',
|
|
389
|
-
res,
|
|
389
|
+
{res},
|
|
390
390
|
);
|
|
391
391
|
/**
|
|
392
392
|
* 1. Once the backend sucessfuly stops recording, send message
|
|
@@ -413,11 +413,11 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
413
413
|
}
|
|
414
414
|
})
|
|
415
415
|
.catch(err => {
|
|
416
|
-
logger.
|
|
417
|
-
LogSource.
|
|
418
|
-
'
|
|
416
|
+
logger.log(
|
|
417
|
+
LogSource.Internals,
|
|
418
|
+
'SEND_LOG_IMMEDIATELY',
|
|
419
419
|
'_stopRecording Error',
|
|
420
|
-
err,
|
|
420
|
+
{err},
|
|
421
421
|
);
|
|
422
422
|
setInProgress(false);
|
|
423
423
|
log('stop recording', err);
|
|
@@ -636,7 +636,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
636
636
|
case RecordingActions.REQUEST_TO_STOP_RECORDING:
|
|
637
637
|
logger.log(
|
|
638
638
|
LogSource.Internals,
|
|
639
|
-
'
|
|
639
|
+
'SEND_LOG_IMMEDIATELY',
|
|
640
640
|
'recording_state -> REQUEST_TO_STOP_RECORDING',
|
|
641
641
|
);
|
|
642
642
|
_stopRecording('bot');
|