Skip to content

Commit 9bf5f6e

Browse files
aadamgoughAdam Gough
andauthored
removed raw paylod for gmail and outlook (#1679)
Co-authored-by: Adam Gough <[email protected]>
1 parent 22b3dde commit 9bf5f6e

File tree

4 files changed

+63
-111
lines changed

4 files changed

+63
-111
lines changed

apps/sim/lib/webhooks/utils.ts

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -751,58 +751,54 @@ export async function formatWebhookInput(
751751
}
752752

753753
// Microsoft Teams outgoing webhook - Teams sending data to us
754-
//
755754
const messageText = body?.text || ''
756755
const messageId = body?.id || ''
757756
const timestamp = body?.timestamp || body?.localTimestamp || ''
758757
const from = body?.from || {}
759758
const conversation = body?.conversation || {}
760759

760+
// Construct the message object
761+
const messageObj = {
762+
raw: {
763+
attachments: body?.attachments || [],
764+
channelData: body?.channelData || {},
765+
conversation: body?.conversation || {},
766+
text: messageText,
767+
messageType: body?.type || 'message',
768+
channelId: body?.channelId || '',
769+
timestamp,
770+
},
771+
}
772+
773+
// Construct the from object
774+
const fromObj = {
775+
id: from.id || '',
776+
name: from.name || '',
777+
aadObjectId: from.aadObjectId || '',
778+
}
779+
780+
// Construct the conversation object
781+
const conversationObj = {
782+
id: conversation.id || '',
783+
name: conversation.name || '',
784+
isGroup: conversation.isGroup || false,
785+
tenantId: conversation.tenantId || '',
786+
aadObjectId: conversation.aadObjectId || '',
787+
conversationType: conversation.conversationType || '',
788+
}
789+
790+
// Construct the activity object
791+
const activityObj = body || {}
792+
761793
return {
762794
input: messageText, // Primary workflow input - the message text
763795

764-
// Top-level properties for backward compatibility with <blockName.text> syntax
765-
type: body?.type || 'message',
766-
id: messageId,
767-
timestamp,
768-
localTimestamp: body?.localTimestamp || '',
769-
serviceUrl: body?.serviceUrl || '',
770-
channelId: body?.channelId || '',
771-
from_id: from.id || '',
772-
from_name: from.name || '',
773-
conversation_id: conversation.id || '',
774-
text: messageText,
796+
// Top-level properties for direct access with <microsoftteams.from.name> syntax
797+
from: fromObj,
798+
message: messageObj,
799+
activity: activityObj,
800+
conversation: conversationObj,
775801

776-
microsoftteams: {
777-
message: {
778-
id: messageId,
779-
text: messageText,
780-
timestamp,
781-
type: body?.type || 'message',
782-
serviceUrl: body?.serviceUrl,
783-
channelId: body?.channelId,
784-
raw: body,
785-
},
786-
from: {
787-
id: from.id,
788-
name: from.name,
789-
aadObjectId: from.aadObjectId,
790-
},
791-
conversation: {
792-
id: conversation.id,
793-
name: conversation.name,
794-
conversationType: conversation.conversationType,
795-
tenantId: conversation.tenantId,
796-
},
797-
activity: {
798-
type: body?.type,
799-
id: body?.id,
800-
timestamp: body?.timestamp,
801-
localTimestamp: body?.localTimestamp,
802-
serviceUrl: body?.serviceUrl,
803-
channelId: body?.channelId,
804-
},
805-
},
806802
webhook: {
807803
data: {
808804
provider: 'microsoftteams',

apps/sim/triggers/gmail/poller.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ export const gmailPollingTrigger: TriggerConfig = {
5353
description: 'Download and include email attachments in the trigger payload',
5454
required: false,
5555
},
56-
includeRawEmail: {
57-
type: 'boolean',
58-
label: 'Include Raw Email Data',
59-
defaultValue: false,
60-
description: 'Include the complete raw Gmail API response in the trigger payload',
61-
required: false,
62-
},
6356
},
6457

6558
outputs: {
@@ -117,10 +110,6 @@ export const gmailPollingTrigger: TriggerConfig = {
117110
type: 'string',
118111
description: 'Event timestamp',
119112
},
120-
rawEmail: {
121-
type: 'json',
122-
description: 'Complete raw email data from Gmail API (if enabled)',
123-
},
124113
},
125114

126115
instructions: [

apps/sim/triggers/microsoftteams/webhook.ts

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,67 +22,45 @@ export const microsoftTeamsWebhookTrigger: TriggerConfig = {
2222
},
2323

2424
outputs: {
25-
// Expose the raw Teams message payload at the root for direct access
26-
id: { type: 'string', description: 'Raw message ID' },
27-
code: { type: 'string', description: 'Code (nullable)' },
25+
// Top-level valid payloads only
2826
from: {
2927
id: { type: 'string', description: 'Sender ID' },
3028
name: { type: 'string', description: 'Sender name' },
31-
role: { type: 'string', description: 'Sender role (nullable)' },
3229
aadObjectId: { type: 'string', description: 'AAD Object ID' },
3330
},
34-
name: { type: 'string', description: 'Top-level name (nullable)' },
35-
text: { type: 'string', description: 'Message HTML content' },
36-
label: { type: 'string', description: 'Label (nullable)' },
37-
speak: { type: 'string', description: 'Speak (nullable)' },
38-
value: { type: 'string', description: 'Value (nullable)' },
39-
action: { type: 'string', description: 'Action (nullable)' },
40-
locale: { type: 'string', description: 'Locale (e.g., en-US)' },
41-
summary: { type: 'string', description: 'Summary (nullable)' },
42-
callerId: { type: 'string', description: 'Caller ID' },
43-
entities: { type: 'array', description: 'Array of entities (clientInfo, ...)' },
44-
channelId: { type: 'string', description: 'Channel ID (msteams)' },
45-
inputHint: { type: 'string', description: 'Input hint (nullable)' },
46-
listenFor: { type: 'string', description: 'Listen for (nullable)' },
47-
recipient: { type: 'string', description: 'Recipient (nullable)' },
48-
relatesTo: { type: 'string', description: 'RelatesTo (nullable)' },
49-
replyToId: { type: 'string', description: 'Reply to ID (nullable)' },
50-
timestamp: { type: 'string', description: 'Timestamp' },
51-
topicName: { type: 'string', description: 'Topic name (nullable)' },
52-
valueType: { type: 'string', description: 'Value type (nullable)' },
53-
expiration: { type: 'string', description: 'Expiration (nullable)' },
54-
importance: { type: 'string', description: 'Importance (nullable)' },
55-
serviceUrl: { type: 'string', description: 'Service URL' },
56-
textFormat: { type: 'string', description: 'Text format (plain)' },
57-
attachments: { type: 'array', description: 'Array of attachments' },
58-
channelData: {
59-
team: { id: { type: 'string', description: 'Team ID' } },
60-
tenant: { id: { type: 'string', description: 'Tenant ID' } },
61-
channel: { id: { type: 'string', description: 'Channel ID' } },
62-
teamsTeamId: { type: 'string', description: 'Teams team ID' },
63-
teamsChannelId: { type: 'string', description: 'Teams channel ID' },
31+
message: {
32+
raw: {
33+
attachments: { type: 'array', description: 'Array of attachments' },
34+
channelData: {
35+
team: { id: { type: 'string', description: 'Team ID' } },
36+
tenant: { id: { type: 'string', description: 'Tenant ID' } },
37+
channel: { id: { type: 'string', description: 'Channel ID' } },
38+
teamsTeamId: { type: 'string', description: 'Teams team ID' },
39+
teamsChannelId: { type: 'string', description: 'Teams channel ID' },
40+
},
41+
conversation: {
42+
id: { type: 'string', description: 'Composite conversation ID' },
43+
name: { type: 'string', description: 'Conversation name (nullable)' },
44+
isGroup: { type: 'boolean', description: 'Is group conversation' },
45+
tenantId: { type: 'string', description: 'Tenant ID' },
46+
aadObjectId: { type: 'string', description: 'AAD Object ID (nullable)' },
47+
conversationType: { type: 'string', description: 'Conversation type (channel)' },
48+
},
49+
text: { type: 'string', description: 'Message text content' },
50+
messageType: { type: 'string', description: 'Message type' },
51+
channelId: { type: 'string', description: 'Channel ID (msteams)' },
52+
timestamp: { type: 'string', description: 'Timestamp' },
53+
},
6454
},
55+
activity: { type: 'object', description: 'Activity payload' },
6556
conversation: {
6657
id: { type: 'string', description: 'Composite conversation ID' },
6758
name: { type: 'string', description: 'Conversation name (nullable)' },
68-
role: { type: 'string', description: 'Conversation role (nullable)' },
6959
isGroup: { type: 'boolean', description: 'Is group conversation' },
7060
tenantId: { type: 'string', description: 'Tenant ID' },
7161
aadObjectId: { type: 'string', description: 'AAD Object ID (nullable)' },
7262
conversationType: { type: 'string', description: 'Conversation type (channel)' },
7363
},
74-
deliveryMode: { type: 'string', description: 'Delivery mode (nullable)' },
75-
membersAdded: { type: 'array', description: 'Members added (nullable)' },
76-
localTimezone: { type: 'string', description: 'Local timezone' },
77-
localTimestamp: { type: 'string', description: 'Local timestamp' },
78-
membersRemoved: { type: 'array', description: 'Members removed (nullable)' },
79-
reactionsAdded: { type: 'array', description: 'Reactions added (nullable)' },
80-
semanticAction: { type: 'string', description: 'Semantic action (nullable)' },
81-
textHighlights: { type: 'string', description: 'Text highlights (nullable)' },
82-
attachmentLayout: { type: 'string', description: 'Attachment layout (nullable)' },
83-
historyDisclosed: { type: 'boolean', description: 'History disclosed (nullable)' },
84-
reactionsRemoved: { type: 'array', description: 'Reactions removed (nullable)' },
85-
suggestedActions: { type: 'string', description: 'Suggested actions (nullable)' },
8664
},
8765

8866
instructions: [

apps/sim/triggers/outlook/poller.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ export const outlookPollingTrigger: TriggerConfig = {
4545
description: 'Download and include email attachments in the trigger payload',
4646
required: false,
4747
},
48-
includeRawEmail: {
49-
type: 'boolean',
50-
label: 'Include Raw Email Data',
51-
defaultValue: false,
52-
description: 'Include the complete raw Microsoft Graph API response in the trigger payload',
53-
required: false,
54-
},
5548
},
5649

5750
outputs: {
@@ -121,10 +114,6 @@ export const outlookPollingTrigger: TriggerConfig = {
121114
type: 'string',
122115
description: 'Event timestamp',
123116
},
124-
rawEmail: {
125-
type: 'json',
126-
description: 'Complete raw email data from Microsoft Graph API (if enabled)',
127-
},
128117
},
129118

130119
instructions: [

0 commit comments

Comments
 (0)