n8n-nodes-chatflow 1.1.7 → 1.1.9

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.
@@ -91,6 +91,33 @@ class ChatflowTrigger {
91
91
  }
92
92
  return true;
93
93
  },
94
+
95
+ async update() {
96
+ const webhookUrl = this.getNodeWebhookUrl('default');
97
+ const credentials = await this.getCredentials('chatflowApi');
98
+ const serverUrl = 'https://lk.chatflow.kz';
99
+ const flowId = credentials.flowId;
100
+ const token = credentials.token;
101
+
102
+ const events = this.getNodeParameter('events', {});
103
+
104
+ const body = {
105
+ token,
106
+ flow_id: flowId,
107
+ webhook_url: webhookUrl,
108
+ events: events || { incoming_message: true },
109
+ };
110
+
111
+ await this.helpers.httpRequest({
112
+ method: 'POST',
113
+ url: `${serverUrl}/api/v1/n8n/register-webhook`,
114
+ body,
115
+ headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
116
+ timeout: 10000,
117
+ });
118
+
119
+ return true;
120
+ },
94
121
  },
95
122
  };
96
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-chatflow",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "n8n community nodes for Chatflow — send WhatsApp & Telegram messages and receive triggers",
5
5
  "author": "Chatflow",
6
6
  "license": "MIT",