@@ -423,10 +423,12 @@ async function formatTeamsGraphNotification(
423423 hasCredential : ! ! credentialId ,
424424 } )
425425 return {
426- from : null ,
427- message : { raw : notification } ,
428- activity : body ,
429- conversation : { id : chatId } ,
426+ message_id : resolvedMessageId ,
427+ chat_id : resolvedChatId ,
428+ from_name : '' ,
429+ text : '' ,
430+ created_at : '' ,
431+ attachments : [ ] ,
430432 }
431433 }
432434
@@ -435,31 +437,12 @@ async function formatTeamsGraphNotification(
435437 const createdAt = message . createdDateTime || ''
436438
437439 return {
438- from : {
439- id : from . id || '' ,
440- name : from . displayName || '' ,
441- aadObjectId : from . aadObjectId || '' ,
442- } ,
443- message : {
444- raw : {
445- attachments : rawAttachments ,
446- channelData : { } ,
447- conversation : { id : chatId } ,
448- text : messageText ,
449- messageType : 'message' ,
450- channelId : '' ,
451- timestamp : createdAt ,
452- } ,
453- } ,
454- activity : body ,
455- conversation : {
456- id : chatId ,
457- name : '' ,
458- isGroup : false ,
459- tenantId : '' ,
460- aadObjectId : '' ,
461- conversationType : '' ,
462- } ,
440+ message_id : resolvedMessageId ,
441+ chat_id : resolvedChatId ,
442+ from_name : from . displayName || '' ,
443+ text : messageText ,
444+ created_at : createdAt ,
445+ attachments : rawAttachments ,
463446 }
464447}
465448
@@ -602,6 +585,7 @@ export async function formatWebhookInput(
602585 sender : rawMessage . from
603586 ? {
604587 id : rawMessage . from . id ,
588+ username : rawMessage . from . username ,
605589 firstName : rawMessage . from . first_name ,
606590 lastName : rawMessage . from . last_name ,
607591 languageCode : rawMessage . from . language_code ,
@@ -818,7 +802,7 @@ export async function formatWebhookInput(
818802 if ( foundWebhook . provider === 'webflow' ) {
819803 return {
820804 siteId : body ?. siteId || '' ,
821- workspaceId : body ?. workspaceId || '' ,
805+ formId : body ?. formId || '' ,
822806 name : body ?. name || '' ,
823807 id : body ?. id || '' ,
824808 submittedAt : body ?. submittedAt || '' ,
@@ -977,16 +961,6 @@ export async function formatWebhookInput(
977961 }
978962 }
979963
980- if ( foundWebhook . provider === 'lemlist' ) {
981- // Lemlist webhook - expose raw payload as `data` for user to destructure
982- // Common fields include: _id, type, createdAt, leadId, campaignId, leadEmail,
983- // leadFirstName, leadLastName, sequenceStep, messageId, text, etc.
984- return {
985- data : body ,
986- }
987- }
988-
989- // Generic format for other providers - pass through the body directly
990964 return body
991965}
992966
0 commit comments