|
|
|
@ -71,7 +71,8 @@ const uniqueMsgId = msg => (msg.id && msg.direction ? `${directionPrefix[msg.dir
|
|
|
|
|
*/
|
|
|
|
|
const webhookBodyBuilder = (messageData, messageType) => {
|
|
|
|
|
const defaultContent = { id: '', from: '', to: '', externalId: '', type: '', direction: '', status: '' };
|
|
|
|
|
const status = messageData.direction === 'inbound' ? '' : statusMapped?.[messageData.status] || messageData.status || '';
|
|
|
|
|
const outboundStatus = statusMapped?.[messageData.status] || messageData.status || '';
|
|
|
|
|
const status = messageData.direction === 'inbound' ? '' : outboundStatus;
|
|
|
|
|
const errors = messageData.status === 'error' ? { errorMessage: '未知错误', errorCode: '' } : {};
|
|
|
|
|
const message = {
|
|
|
|
|
id: `evt_${generateId().replace(/-/g, '')}`,
|
|
|
|
|