n8n-nodes-msteams-botframework 1.2.11 → 1.2.12

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.
@@ -37,8 +37,7 @@ class MsTeamsBotFrameworkTrigger {
37
37
  {
38
38
  name: 'default',
39
39
  httpMethod: 'POST',
40
- responseMode: '={{$parameter["respondWhen"]}}',
41
- responseData: '={{$parameter["responseData"]}}',
40
+ responseMode: 'onReceived',
42
41
  path: 'webhook',
43
42
  },
44
43
  ],
@@ -78,64 +77,6 @@ class MsTeamsBotFrameworkTrigger {
78
77
  required: true,
79
78
  description: 'The events to listen to',
80
79
  },
81
- {
82
- displayName: 'Respond',
83
- name: 'respondWhen',
84
- type: 'options',
85
- options: [
86
- {
87
- name: 'Immediately',
88
- value: 'immediately',
89
- description: 'Respond immediately (useful for keeping connection alive)',
90
- },
91
- {
92
- name: 'When Last Node Finishes',
93
- value: 'lastNode',
94
- description: 'Wait for workflow to complete before responding',
95
- },
96
- {
97
- name: 'Using Respond to Webhook Node',
98
- value: 'responseNode',
99
- description: 'Use a Respond to Webhook node to control the response',
100
- },
101
- ],
102
- default: 'immediately',
103
- description: 'When to respond to the webhook call',
104
- },
105
- {
106
- displayName: 'Response Data',
107
- name: 'responseData',
108
- type: 'options',
109
- displayOptions: {
110
- show: {
111
- respondWhen: ['lastNode'],
112
- },
113
- },
114
- options: [
115
- {
116
- name: 'All Entries',
117
- value: 'allEntries',
118
- description: 'Return all entries from the workflow',
119
- },
120
- {
121
- name: 'First Entry JSON',
122
- value: 'firstEntryJson',
123
- description: 'Return only the JSON of the first entry',
124
- },
125
- {
126
- name: 'First Entry Binary',
127
- value: 'firstEntryBinary',
128
- description: 'Return only the binary data of the first entry',
129
- },
130
- {
131
- name: 'No Response Body',
132
- value: 'noData',
133
- description: 'Return success status without response body',
134
- },
135
- ],
136
- default: 'allEntries',
137
- description: 'What data should be returned',
138
- },
139
80
  {
140
81
  displayName: 'Options',
141
82
  name: 'options',
@@ -157,13 +98,6 @@ class MsTeamsBotFrameworkTrigger {
157
98
  default: false,
158
99
  description: 'Whether to include the raw Bot Framework activity in output',
159
100
  },
160
- {
161
- displayName: 'Auto Reply',
162
- name: 'autoReply',
163
- type: 'boolean',
164
- default: false,
165
- description: 'Whether to automatically send a typing indicator',
166
- },
167
101
  ],
168
102
  },
169
103
  ],
@@ -184,15 +118,20 @@ class MsTeamsBotFrameworkTrigger {
184
118
  }
185
119
  async webhook() {
186
120
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
187
- const req = this.getRequestObject();
121
+ const bodyData = this.getBodyData();
188
122
  const events = this.getNodeParameter('events', []);
189
123
  const options = this.getNodeParameter('options', {});
190
- // Get the activity directly from request body
191
- const activity = req.body;
124
+ // Get the activity from body
125
+ const activity = bodyData;
126
+ // Validate activity object
127
+ if (!activity || !activity.type) {
128
+ return {
129
+ webhookResponse: { status: 'ok', message: 'Invalid activity' },
130
+ };
131
+ }
192
132
  // Check for duplicate activity
193
- const activityKey = `${activity.id}_${activity.timestamp}`;
133
+ const activityKey = `${activity.id || 'unknown'}_${activity.timestamp || Date.now()}`;
194
134
  if (processedActivities.has(activityKey)) {
195
- // Already processed this activity, return 200 OK but don't trigger workflow
196
135
  return {
197
136
  webhookResponse: { status: 'ok' },
198
137
  };
@@ -214,7 +153,7 @@ class MsTeamsBotFrameworkTrigger {
214
153
  // Extract useful data from activity
215
154
  const activityData = {
216
155
  type: activity.type,
217
- text: activity.text,
156
+ text: activity.text || '',
218
157
  timestamp: activity.timestamp,
219
158
  id: activity.id,
220
159
  conversation: {
@@ -241,29 +180,29 @@ class MsTeamsBotFrameworkTrigger {
241
180
  switch (activity.type) {
242
181
  case 'message':
243
182
  activityData.message = {
244
- text: activity.text,
183
+ text: activity.text || '',
245
184
  textFormat: activity.textFormat,
246
- attachments: activity.attachments,
247
- mentions: (_m = activity.entities) === null || _m === void 0 ? void 0 : _m.filter((e) => e.type === 'mention'),
185
+ attachments: activity.attachments || [],
186
+ mentions: ((_m = activity.entities) === null || _m === void 0 ? void 0 : _m.filter((e) => e.type === 'mention')) || [],
248
187
  };
249
188
  break;
250
189
  case 'conversationUpdate':
251
190
  activityData.conversationUpdate = {
252
- membersAdded: activity.membersAdded,
253
- membersRemoved: activity.membersRemoved,
191
+ membersAdded: activity.membersAdded || [],
192
+ membersRemoved: activity.membersRemoved || [],
254
193
  };
255
194
  break;
256
195
  case 'messageReaction':
257
196
  activityData.messageReaction = {
258
- reactionsAdded: activity.reactionsAdded,
259
- reactionsRemoved: activity.reactionsRemoved,
197
+ reactionsAdded: activity.reactionsAdded || [],
198
+ reactionsRemoved: activity.reactionsRemoved || [],
260
199
  replyToId: activity.replyToId,
261
200
  };
262
201
  break;
263
202
  case 'messageUpdate':
264
203
  activityData.messageUpdate = {
265
- text: activity.text,
266
- updatedText: activity.text,
204
+ text: activity.text || '',
205
+ updatedText: activity.text || '',
267
206
  };
268
207
  break;
269
208
  case 'messageDelete':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-msteams-botframework",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "description": "n8n node for MS Teams Azure Bot Framework",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/weonVN/n8n-nodes-msteams-botframework.git"
21
+ "url": "git+https://github.com/weonVN/n8n-nodes-msteams-botframework.git"
22
22
  },
23
23
  "main": "index.js",
24
24
  "scripts": {