@saraivadev/n8n-nodes-uazapi 0.1.0

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.
Files changed (56) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +130 -0
  3. package/dist/credentials/UazapiApi.credentials.d.ts +10 -0
  4. package/dist/credentials/UazapiApi.credentials.js +56 -0
  5. package/dist/credentials/UazapiApi.credentials.js.map +1 -0
  6. package/dist/icons/uazapi.svg +4 -0
  7. package/dist/nodes/Uazapi/Uazapi.node.d.ts +4 -0
  8. package/dist/nodes/Uazapi/Uazapi.node.js +85 -0
  9. package/dist/nodes/Uazapi/Uazapi.node.js.map +1 -0
  10. package/dist/nodes/Uazapi/Uazapi.node.json +18 -0
  11. package/dist/nodes/Uazapi/descriptions/AdminDescription.d.ts +2 -0
  12. package/dist/nodes/Uazapi/descriptions/AdminDescription.js +206 -0
  13. package/dist/nodes/Uazapi/descriptions/AdminDescription.js.map +1 -0
  14. package/dist/nodes/Uazapi/descriptions/BusinessDescription.d.ts +2 -0
  15. package/dist/nodes/Uazapi/descriptions/BusinessDescription.js +274 -0
  16. package/dist/nodes/Uazapi/descriptions/BusinessDescription.js.map +1 -0
  17. package/dist/nodes/Uazapi/descriptions/ChatDescription.d.ts +2 -0
  18. package/dist/nodes/Uazapi/descriptions/ChatDescription.js +776 -0
  19. package/dist/nodes/Uazapi/descriptions/ChatDescription.js.map +1 -0
  20. package/dist/nodes/Uazapi/descriptions/ChatbotDescription.d.ts +2 -0
  21. package/dist/nodes/Uazapi/descriptions/ChatbotDescription.js +546 -0
  22. package/dist/nodes/Uazapi/descriptions/ChatbotDescription.js.map +1 -0
  23. package/dist/nodes/Uazapi/descriptions/ContactDescription.d.ts +2 -0
  24. package/dist/nodes/Uazapi/descriptions/ContactDescription.js +198 -0
  25. package/dist/nodes/Uazapi/descriptions/ContactDescription.js.map +1 -0
  26. package/dist/nodes/Uazapi/descriptions/CrmDescription.d.ts +2 -0
  27. package/dist/nodes/Uazapi/descriptions/CrmDescription.js +499 -0
  28. package/dist/nodes/Uazapi/descriptions/CrmDescription.js.map +1 -0
  29. package/dist/nodes/Uazapi/descriptions/GroupDescription.d.ts +2 -0
  30. package/dist/nodes/Uazapi/descriptions/GroupDescription.js +705 -0
  31. package/dist/nodes/Uazapi/descriptions/GroupDescription.js.map +1 -0
  32. package/dist/nodes/Uazapi/descriptions/InstanceDescription.d.ts +2 -0
  33. package/dist/nodes/Uazapi/descriptions/InstanceDescription.js +396 -0
  34. package/dist/nodes/Uazapi/descriptions/InstanceDescription.js.map +1 -0
  35. package/dist/nodes/Uazapi/descriptions/LabelDescription.d.ts +2 -0
  36. package/dist/nodes/Uazapi/descriptions/LabelDescription.js +120 -0
  37. package/dist/nodes/Uazapi/descriptions/LabelDescription.js.map +1 -0
  38. package/dist/nodes/Uazapi/descriptions/MessageDescription.d.ts +2 -0
  39. package/dist/nodes/Uazapi/descriptions/MessageDescription.js +1034 -0
  40. package/dist/nodes/Uazapi/descriptions/MessageDescription.js.map +1 -0
  41. package/dist/nodes/Uazapi/descriptions/ProfileDescription.d.ts +2 -0
  42. package/dist/nodes/Uazapi/descriptions/ProfileDescription.js +84 -0
  43. package/dist/nodes/Uazapi/descriptions/ProfileDescription.js.map +1 -0
  44. package/dist/nodes/Uazapi/descriptions/SenderDescription.d.ts +2 -0
  45. package/dist/nodes/Uazapi/descriptions/SenderDescription.js +627 -0
  46. package/dist/nodes/Uazapi/descriptions/SenderDescription.js.map +1 -0
  47. package/dist/nodes/Uazapi/descriptions/shared.d.ts +5 -0
  48. package/dist/nodes/Uazapi/descriptions/shared.js +95 -0
  49. package/dist/nodes/Uazapi/descriptions/shared.js.map +1 -0
  50. package/dist/nodes/UazapiTrigger/UazapiTrigger.node.d.ts +13 -0
  51. package/dist/nodes/UazapiTrigger/UazapiTrigger.node.js +362 -0
  52. package/dist/nodes/UazapiTrigger/UazapiTrigger.node.js.map +1 -0
  53. package/dist/nodes/UazapiTrigger/UazapiTrigger.node.json +18 -0
  54. package/dist/package.json +50 -0
  55. package/dist/tsconfig.tsbuildinfo +1 -0
  56. package/package.json +49 -0
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adminHeader = exports.sendAdditionalFields = void 0;
4
+ exports.sendAdditionalFields = {
5
+ displayName: 'Additional Fields',
6
+ name: 'additionalFields',
7
+ type: 'collection',
8
+ placeholder: 'Add Field',
9
+ default: {},
10
+ options: [
11
+ {
12
+ displayName: 'Async',
13
+ name: 'async',
14
+ type: 'boolean',
15
+ default: false,
16
+ description: 'Whether to process the request asynchronously',
17
+ routing: { send: { type: 'body', property: 'async' } },
18
+ },
19
+ {
20
+ displayName: 'Delay (Ms)',
21
+ name: 'delay',
22
+ type: 'number',
23
+ default: 0,
24
+ description: 'Delay in milliseconds before sending',
25
+ routing: { send: { type: 'body', property: 'delay' } },
26
+ },
27
+ {
28
+ displayName: 'Forward',
29
+ name: 'forward',
30
+ type: 'boolean',
31
+ default: false,
32
+ description: 'Whether to flag the message as forwarded',
33
+ routing: { send: { type: 'body', property: 'forward' } },
34
+ },
35
+ {
36
+ displayName: 'Mentions (Comma-Separated)',
37
+ name: 'mentions',
38
+ type: 'string',
39
+ typeOptions: { multipleValues: true },
40
+ default: [],
41
+ description: 'Phone numbers (E.164) to mention in the message',
42
+ routing: {
43
+ send: {
44
+ type: 'body',
45
+ property: 'mentions',
46
+ value: '={{ Array.isArray($value) ? $value.join(",") : $value }}',
47
+ },
48
+ },
49
+ },
50
+ {
51
+ displayName: 'Read Chat',
52
+ name: 'readchat',
53
+ type: 'boolean',
54
+ default: false,
55
+ description: 'Whether to mark the chat as read after sending',
56
+ routing: { send: { type: 'body', property: 'readchat' } },
57
+ },
58
+ {
59
+ displayName: 'Read Messages',
60
+ name: 'readmessages',
61
+ type: 'boolean',
62
+ default: false,
63
+ description: 'Whether to mark previous messages as read',
64
+ routing: { send: { type: 'body', property: 'readmessages' } },
65
+ },
66
+ {
67
+ displayName: 'Reply To Message ID',
68
+ name: 'replyid',
69
+ type: 'string',
70
+ default: '',
71
+ description: 'ID of the message to reply to',
72
+ routing: { send: { type: 'body', property: 'replyid' } },
73
+ },
74
+ {
75
+ displayName: 'Track ID',
76
+ name: 'track_id',
77
+ type: 'string',
78
+ default: '',
79
+ description: 'Custom tracking ID stored with the message',
80
+ routing: { send: { type: 'body', property: 'track_id' } },
81
+ },
82
+ {
83
+ displayName: 'Track Source',
84
+ name: 'track_source',
85
+ type: 'string',
86
+ default: '',
87
+ description: 'Custom tracking source stored with the message',
88
+ routing: { send: { type: 'body', property: 'track_source' } },
89
+ },
90
+ ],
91
+ };
92
+ exports.adminHeader = {
93
+ admintoken: '={{$credentials.adminToken}}',
94
+ };
95
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../nodes/Uazapi/descriptions/shared.ts"],"names":[],"mappings":";;;AAMa,QAAA,oBAAoB,GAAoB;IACpD,WAAW,EAAE,mBAAmB;IAChC,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,WAAW;IACxB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE;QACR;YACC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,+CAA+C;YAC5D,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;SACtD;QACD;YACC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,sCAAsC;YACnD,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;SACt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ACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,4CAA4C;YACzD,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE;SACzD;QACD;YACC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE;SAC7D;KACD;CACD,CAAC;AAMW,QAAA,WAAW,GAAG;IAC1B,UAAU,EAAE,8BAA8B;CAC1C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type IHookFunctions, type INodeType, type INodeTypeDescription, type ITriggerFunctions, type ITriggerResponse, type IWebhookFunctions, type IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class UazapiTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhookMethods: {
5
+ default: {
6
+ checkExists(this: IHookFunctions): Promise<boolean>;
7
+ create(this: IHookFunctions): Promise<boolean>;
8
+ delete(this: IHookFunctions): Promise<boolean>;
9
+ };
10
+ };
11
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
12
+ trigger(this: ITriggerFunctions): Promise<ITriggerResponse>;
13
+ }
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.UazapiTrigger = void 0;
37
+ const n8n_workflow_1 = require("n8n-workflow");
38
+ const EVENT_OPTIONS = [
39
+ { name: 'Blocks', value: 'blocks' },
40
+ { name: 'Call', value: 'call' },
41
+ { name: 'Chat Labels', value: 'chat_labels' },
42
+ { name: 'Chats', value: 'chats' },
43
+ { name: 'Connection', value: 'connection' },
44
+ { name: 'Contacts', value: 'contacts' },
45
+ { name: 'Groups', value: 'groups' },
46
+ { name: 'History', value: 'history' },
47
+ { name: 'Labels', value: 'labels' },
48
+ { name: 'Leads', value: 'leads' },
49
+ { name: 'Messages', value: 'messages' },
50
+ { name: 'Messages Update', value: 'messages_update' },
51
+ { name: 'Presence', value: 'presence' },
52
+ { name: 'Sender', value: 'sender' },
53
+ ];
54
+ const EXCLUDE_MESSAGE_OPTIONS = [
55
+ { name: 'Sent By API', value: 'wasSentByApi' },
56
+ { name: 'From Me', value: 'fromMe' },
57
+ { name: 'Is Group', value: 'isGroup' },
58
+ { name: 'Is Not Group', value: 'isNotGroup' },
59
+ { name: 'Has Media', value: 'hasMedia' },
60
+ { name: 'No Text', value: 'noText' },
61
+ ];
62
+ class UazapiTrigger {
63
+ constructor() {
64
+ this.description = {
65
+ displayName: 'Uazapi Trigger',
66
+ name: 'uazapiTrigger',
67
+ icon: 'file:../../icons/uazapi.svg',
68
+ group: ['trigger'],
69
+ version: 1,
70
+ subtitle: '={{$parameter["mode"]}}',
71
+ description: 'Listen to uazapi events via webhook or SSE',
72
+ defaults: {
73
+ name: 'Uazapi Trigger',
74
+ },
75
+ inputs: [],
76
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
77
+ credentials: [
78
+ {
79
+ name: 'uazapiApi',
80
+ required: true,
81
+ },
82
+ ],
83
+ webhooks: [
84
+ {
85
+ name: 'default',
86
+ httpMethod: 'POST',
87
+ responseMode: 'onReceived',
88
+ path: 'uazapi',
89
+ },
90
+ ],
91
+ properties: [
92
+ {
93
+ displayName: 'Mode',
94
+ name: 'mode',
95
+ type: 'options',
96
+ options: [
97
+ {
98
+ name: 'SSE (Server-Sent Events)',
99
+ value: 'sse',
100
+ description: 'Maintain a long-lived SSE connection to the uazapi instance',
101
+ },
102
+ {
103
+ name: 'Webhook',
104
+ value: 'webhook',
105
+ description: 'Receive events through an HTTP webhook registered on the uazapi instance',
106
+ },
107
+ ],
108
+ default: 'webhook',
109
+ description: 'How to receive events from uazapi',
110
+ },
111
+ {
112
+ displayName: 'Events',
113
+ name: 'events',
114
+ type: 'multiOptions',
115
+ options: EVENT_OPTIONS,
116
+ default: ['messages'],
117
+ required: true,
118
+ description: 'Event types to subscribe to',
119
+ },
120
+ {
121
+ displayName: 'Exclude Messages',
122
+ name: 'excludeMessages',
123
+ type: 'multiOptions',
124
+ options: EXCLUDE_MESSAGE_OPTIONS,
125
+ default: ['wasSentByApi'],
126
+ description: 'Filters applied to message events. Keep "Sent By API" enabled to avoid feedback loops when this workflow also sends messages.',
127
+ displayOptions: {
128
+ show: { events: ['messages'] },
129
+ },
130
+ },
131
+ {
132
+ displayName: 'Add URL Events',
133
+ name: 'addUrlEvents',
134
+ type: 'boolean',
135
+ default: true,
136
+ description: 'Whether to append the selected events as a query string to the webhook URL',
137
+ displayOptions: { show: { mode: ['webhook'] } },
138
+ },
139
+ {
140
+ displayName: 'Add URL Types Messages',
141
+ name: 'addUrlTypesMessages',
142
+ type: 'boolean',
143
+ default: false,
144
+ description: 'Whether to append message type filters to the webhook URL',
145
+ displayOptions: { show: { mode: ['webhook'] } },
146
+ },
147
+ {
148
+ displayName: 'Reconnect Delay (Ms)',
149
+ name: 'reconnectDelay',
150
+ type: 'number',
151
+ default: 5000,
152
+ description: 'Initial reconnect delay for SSE mode (exponential backoff up to 60s)',
153
+ displayOptions: { show: { mode: ['sse'] } },
154
+ },
155
+ ],
156
+ usableAsTool: true,
157
+ };
158
+ this.webhookMethods = {
159
+ default: {
160
+ async checkExists() {
161
+ var _a;
162
+ const mode = this.getNodeParameter('mode');
163
+ if (mode !== 'webhook')
164
+ return true;
165
+ const webhookUrl = this.getNodeWebhookUrl('default');
166
+ const credentials = await this.getCredentials('uazapiApi');
167
+ const baseUrl = credentials.baseUrl.replace(/\/$/, '');
168
+ try {
169
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'uazapiApi', {
170
+ method: 'GET',
171
+ url: `${baseUrl}/webhook`,
172
+ json: true,
173
+ }));
174
+ const url = (_a = response === null || response === void 0 ? void 0 : response.url) !== null && _a !== void 0 ? _a : '';
175
+ return url === webhookUrl;
176
+ }
177
+ catch {
178
+ return false;
179
+ }
180
+ },
181
+ async create() {
182
+ var _a;
183
+ const mode = this.getNodeParameter('mode');
184
+ if (mode !== 'webhook')
185
+ return true;
186
+ const webhookUrl = this.getNodeWebhookUrl('default');
187
+ const events = this.getNodeParameter('events');
188
+ const excludeMessages = (_a = this.getNodeParameter('excludeMessages', [])) !== null && _a !== void 0 ? _a : [];
189
+ const addUrlEvents = this.getNodeParameter('addUrlEvents', true);
190
+ const addUrlTypesMessages = this.getNodeParameter('addUrlTypesMessages', false);
191
+ const credentials = await this.getCredentials('uazapiApi');
192
+ const baseUrl = credentials.baseUrl.replace(/\/$/, '');
193
+ await this.helpers.httpRequestWithAuthentication.call(this, 'uazapiApi', {
194
+ method: 'POST',
195
+ url: `${baseUrl}/webhook`,
196
+ body: {
197
+ action: 'add',
198
+ url: webhookUrl,
199
+ events,
200
+ excludeMessages,
201
+ addUrlEvents,
202
+ addUrlTypesMessages,
203
+ enabled: true,
204
+ },
205
+ json: true,
206
+ });
207
+ return true;
208
+ },
209
+ async delete() {
210
+ const mode = this.getNodeParameter('mode');
211
+ if (mode !== 'webhook')
212
+ return true;
213
+ const webhookUrl = this.getNodeWebhookUrl('default');
214
+ const credentials = await this.getCredentials('uazapiApi');
215
+ const baseUrl = credentials.baseUrl.replace(/\/$/, '');
216
+ try {
217
+ await this.helpers.httpRequestWithAuthentication.call(this, 'uazapiApi', {
218
+ method: 'POST',
219
+ url: `${baseUrl}/webhook`,
220
+ body: {
221
+ action: 'delete',
222
+ url: webhookUrl,
223
+ },
224
+ json: true,
225
+ });
226
+ }
227
+ catch {
228
+ }
229
+ return true;
230
+ },
231
+ },
232
+ };
233
+ }
234
+ async webhook() {
235
+ const body = this.getBodyData();
236
+ const headers = this.getHeaderData();
237
+ return {
238
+ workflowData: [
239
+ this.helpers.returnJsonArray([
240
+ {
241
+ body,
242
+ headers,
243
+ receivedAt: new Date().toISOString(),
244
+ },
245
+ ]),
246
+ ],
247
+ };
248
+ }
249
+ async trigger() {
250
+ const mode = this.getNodeParameter('mode');
251
+ if (mode !== 'sse') {
252
+ return {
253
+ closeFunction: async () => { },
254
+ };
255
+ }
256
+ const events = this.getNodeParameter('events');
257
+ const initialDelay = this.getNodeParameter('reconnectDelay', 5000) || 5000;
258
+ const credentials = await this.getCredentials('uazapiApi');
259
+ const baseUrl = credentials.baseUrl.replace(/\/$/, '');
260
+ const token = credentials.token;
261
+ let stopped = false;
262
+ let currentDelay = initialDelay;
263
+ let timer;
264
+ let activeRequest;
265
+ const buffer = [];
266
+ const flushEvent = () => {
267
+ if (buffer.length === 0)
268
+ return;
269
+ const chunk = buffer.join('\n');
270
+ buffer.length = 0;
271
+ const dataLines = chunk
272
+ .split('\n')
273
+ .filter((line) => line.startsWith('data:'))
274
+ .map((line) => line.slice(5).trim());
275
+ if (dataLines.length === 0)
276
+ return;
277
+ const raw = dataLines.join('\n');
278
+ let parsed;
279
+ try {
280
+ parsed = JSON.parse(raw);
281
+ }
282
+ catch {
283
+ parsed = { raw };
284
+ }
285
+ this.emit([this.helpers.returnJsonArray([parsed])]);
286
+ };
287
+ const connect = async () => {
288
+ var _a, _b;
289
+ if (stopped)
290
+ return;
291
+ const url = new URL(`${baseUrl}/sse`);
292
+ url.searchParams.set('token', token);
293
+ if (events.length > 0)
294
+ url.searchParams.set('events', events.join(','));
295
+ try {
296
+ const http = await Promise.resolve().then(() => __importStar(require('http')));
297
+ const https = await Promise.resolve().then(() => __importStar(require('https')));
298
+ const lib = url.protocol === 'https:' ? https : http;
299
+ await new Promise((resolve, reject) => {
300
+ const req = lib.request(url, {
301
+ method: 'GET',
302
+ headers: {
303
+ Accept: 'text/event-stream',
304
+ 'Cache-Control': 'no-cache',
305
+ token,
306
+ },
307
+ }, (res) => {
308
+ if (!res.statusCode || res.statusCode >= 400) {
309
+ res.resume();
310
+ reject(new Error(`SSE connection failed with status ${res.statusCode}`));
311
+ return;
312
+ }
313
+ currentDelay = initialDelay;
314
+ res.setEncoding('utf8');
315
+ res.on('data', (chunk) => {
316
+ for (const line of chunk.split(/\r?\n/)) {
317
+ if (line === '') {
318
+ flushEvent();
319
+ }
320
+ else {
321
+ buffer.push(line);
322
+ }
323
+ }
324
+ });
325
+ res.on('end', () => resolve());
326
+ res.on('error', (err) => reject(err));
327
+ });
328
+ req.on('error', (err) => reject(err));
329
+ activeRequest = req;
330
+ req.end();
331
+ });
332
+ }
333
+ catch (error) {
334
+ if (stopped)
335
+ return;
336
+ (_b = (_a = this.logger) === null || _a === void 0 ? void 0 : _a.warn) === null || _b === void 0 ? void 0 : _b.call(_a, `uazapi SSE disconnected: ${error.message}. Retrying in ${currentDelay}ms.`);
337
+ }
338
+ if (stopped)
339
+ return;
340
+ timer = setTimeout(() => {
341
+ void connect();
342
+ }, currentDelay);
343
+ currentDelay = Math.min(currentDelay * 2, 60000);
344
+ };
345
+ void connect();
346
+ const closeFunction = async () => {
347
+ stopped = true;
348
+ if (timer)
349
+ clearTimeout(timer);
350
+ if (activeRequest) {
351
+ try {
352
+ activeRequest.destroy();
353
+ }
354
+ catch {
355
+ }
356
+ }
357
+ };
358
+ return { closeFunction };
359
+ }
360
+ }
361
+ exports.UazapiTrigger = UazapiTrigger;
362
+ //# sourceMappingURL=UazapiTrigger.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UazapiTrigger.node.js","sourceRoot":"","sources":["../../../nodes/UazapiTrigger/UazapiTrigger.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAUsB;AAEtB,MAAM,aAAa,GAAG;IACrB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAC/B,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7C,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IACjC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI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,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBACvB,KAAK,OAAO,EAAE,CAAC;YAChB,CAAC,EAAE,YAAY,CAAC,CAAC;YACjB,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,EAAE,KAAM,CAAC,CAAC;QACnD,CAAC,CAAC;QAEF,KAAK,OAAO,EAAE,CAAC;QAEf,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;YAChC,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,aAAa,EAAE,CAAC;gBACnB,IAAI,CAAC;oBACJ,aAAa,CAAC,OAAO,EAAE,CAAC;gBACzB,CAAC;gBAAC,MAAM,CAAC;gBAET,CAAC;YACF,CAAC;QACF,CAAC,CAAC;QAEF,OAAO,EAAE,aAAa,EAAE,CAAC;IAC1B,CAAC;CACD;AA9TD,sCA8TC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-base.uazapiTrigger",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Communication"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://docs.uazapi.com/"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://docs.uazapi.com/"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "n8n-nodes-uazapi",
3
+ "version": "0.1.0",
4
+ "description": "n8n community nodes for uazapiGO V2 (WhatsApp) — actions + trigger (webhook & SSE).",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/saraivaai/n8n-nodes-uazapi",
7
+ "keywords": [
8
+ "n8n-community-node-package",
9
+ "n8n",
10
+ "uazapi",
11
+ "whatsapp",
12
+ "whatsapp-api",
13
+ "messaging"
14
+ ],
15
+ "author": {
16
+ "name": "Saraiva.ai",
17
+ "email": "fellipesaraivabarbosa@gmail.com"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/saraivaai/n8n-nodes-uazapi.git"
22
+ },
23
+ "scripts": {
24
+ "build": "n8n-node build",
25
+ "build:watch": "tsc --watch",
26
+ "dev": "n8n-node dev",
27
+ "lint": "n8n-node lint",
28
+ "lint:fix": "n8n-node lint --fix",
29
+ "release": "n8n-node release",
30
+ "prepublishOnly": "n8n-node prerelease"
31
+ },
32
+ "files": ["dist"],
33
+ "n8n": {
34
+ "n8nNodesApiVersion": 1,
35
+ "strict": false,
36
+ "credentials": ["dist/credentials/UazapiApi.credentials.js"],
37
+ "nodes": [
38
+ "dist/nodes/Uazapi/Uazapi.node.js",
39
+ "dist/nodes/UazapiTrigger/UazapiTrigger.node.js"
40
+ ]
41
+ },
42
+ "devDependencies": {
43
+ "@n8n/node-cli": "*",
44
+ "eslint": "9.39.4",
45
+ "prettier": "3.8.3",
46
+ "release-it": "20.0.1",
47
+ "typescript": "5.9.3"
48
+ },
49
+ "peerDependencies": { "n8n-workflow": "*" }
50
+ }