n8n-nodes-sendzen 1.0.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 (44) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +359 -0
  3. package/dist/credentials/SendZenApi.credentials.d.ts +8 -0
  4. package/dist/credentials/SendZenApi.credentials.js +36 -0
  5. package/dist/credentials/SendZenApi.credentials.js.map +1 -0
  6. package/dist/nodes/SendZen/SendZen.node.d.ts +14 -0
  7. package/dist/nodes/SendZen/SendZen.node.js +610 -0
  8. package/dist/nodes/SendZen/SendZen.node.js.map +1 -0
  9. package/dist/nodes/SendZen/SendZen.node.json +20 -0
  10. package/dist/nodes/SendZen/SendZenTrigger.node.d.ts +5 -0
  11. package/dist/nodes/SendZen/SendZenTrigger.node.js +49 -0
  12. package/dist/nodes/SendZen/SendZenTrigger.node.js.map +1 -0
  13. package/dist/nodes/SendZen/sendzen.svg +1 -0
  14. package/dist/package.json +76 -0
  15. package/dist/shared/constants.d.ts +1 -0
  16. package/dist/shared/constants.js +5 -0
  17. package/dist/shared/constants.js.map +1 -0
  18. package/dist/shared/nodeProperties.d.ts +10 -0
  19. package/dist/shared/nodeProperties.js +187 -0
  20. package/dist/shared/nodeProperties.js.map +1 -0
  21. package/dist/shared/template/template.api.types.d.ts +328 -0
  22. package/dist/shared/template/template.api.types.js +3 -0
  23. package/dist/shared/template/template.api.types.js.map +1 -0
  24. package/dist/shared/template/template.builder.d.ts +17 -0
  25. package/dist/shared/template/template.builder.js +200 -0
  26. package/dist/shared/template/template.builder.js.map +1 -0
  27. package/dist/shared/type.d.ts +38 -0
  28. package/dist/shared/type.js +3 -0
  29. package/dist/shared/type.js.map +1 -0
  30. package/dist/shared/utils.d.ts +2 -0
  31. package/dist/shared/utils.js +15 -0
  32. package/dist/shared/utils.js.map +1 -0
  33. package/index.js +10 -0
  34. package/jest.config.js +22 -0
  35. package/n8n-nodes-sendzen-1.0.0.tgz +0 -0
  36. package/nodes/SendZen/SendZen.node.json +20 -0
  37. package/nodes/SendZen/sendzen.svg +1 -0
  38. package/package.json +76 -0
  39. package/shared/constants.ts +1 -0
  40. package/shared/nodeProperties.ts +197 -0
  41. package/shared/template/template.api.types.ts +435 -0
  42. package/shared/template/template.builder.ts +223 -0
  43. package/shared/type.ts +40 -0
  44. package/shared/utils.ts +16 -0
@@ -0,0 +1,610 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendZen = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const constants_1 = require("../../shared/constants");
6
+ const utils_1 = require("../../shared/utils");
7
+ const template_builder_1 = require("../../shared/template/template.builder");
8
+ const nodeProperties_1 = require("../../shared/nodeProperties");
9
+ const suffix_urls = {
10
+ WABA_ACCOUNTS: `/v1/waba`,
11
+ TEMPLATES: `/v1/{wabaId}/message_templates`,
12
+ SEND_MESSAGE: `/v1/messages`,
13
+ READ_TYPING_STATUS: `/v1/{phoneNumberId}/messages`,
14
+ };
15
+ class SendZen {
16
+ constructor() {
17
+ this.description = {
18
+ displayName: 'SendZen for WhatsApp API',
19
+ name: 'sendZen',
20
+ icon: 'file:sendzen.svg',
21
+ group: ['output'],
22
+ version: 1,
23
+ subtitle: '={{ $parameter.operation === "sendSessionMessage" ? "Send Session Message" : ' +
24
+ '$parameter.operation === "sendTemplateMessage" ? "Send Template Message" : ' +
25
+ '$parameter.operation === "markAsRead" ? "Mark as Read" : ' +
26
+ '$parameter.operation === "showTyping" ? "Show Typing Indicator" : ' +
27
+ '"SendZen" }}',
28
+ description: 'Build WhatsApp chatbots & automations: send messages, media, and notifications via the WhatsApp Cloud API.',
29
+ defaults: {
30
+ name: "SendZen",
31
+ },
32
+ inputs: ['main'],
33
+ outputs: ['main'],
34
+ credentials: [
35
+ {
36
+ name: 'sendZenApi',
37
+ required: true,
38
+ },
39
+ ],
40
+ properties: [
41
+ nodeProperties_1.OperationProperties,
42
+ nodeProperties_1.WabaAccountProperties,
43
+ nodeProperties_1.PhoneNumberIdProperties,
44
+ nodeProperties_1.MessageIdProperties,
45
+ nodeProperties_1.RecipientPhoneNumberProperties,
46
+ nodeProperties_1.TemplateProperties,
47
+ nodeProperties_1.ReplyMessageProperties,
48
+ nodeProperties_1.EnableUrlPreviewProperties,
49
+ nodeProperties_1.TemplateNameOrIdProperties,
50
+ ],
51
+ };
52
+ this.methods = {
53
+ loadOptions: {
54
+ async getTemplates() {
55
+ var _a, _b;
56
+ const returnData = [];
57
+ const selectedWabaAccount = this.getNodeParameter('wabaAccount', '0');
58
+ let wabaId;
59
+ try {
60
+ const parsed = JSON.parse(selectedWabaAccount);
61
+ wabaId = parsed.wabaId;
62
+ }
63
+ catch {
64
+ wabaId = undefined;
65
+ }
66
+ if (!wabaId) {
67
+ returnData.push({
68
+ name: 'No Waba Account selected',
69
+ value: 'notfound',
70
+ description: 'No Waba Account was selected',
71
+ });
72
+ return returnData;
73
+ }
74
+ try {
75
+ const templateOptions = {
76
+ method: 'GET',
77
+ baseURL: constants_1.BASE_DOMAIN,
78
+ url: `${suffix_urls.TEMPLATES.replace('{wabaId}', wabaId)}`,
79
+ headers: {
80
+ Accept: 'application/json',
81
+ },
82
+ };
83
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', templateOptions);
84
+ const templatesArray = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : [];
85
+ if (templatesArray.length > 0) {
86
+ returnData.push(...templatesArray.map((t) => {
87
+ return {
88
+ name: t.name,
89
+ value: JSON.stringify({
90
+ templateId: t.id,
91
+ language: t.language,
92
+ category: t.category,
93
+ components: t.components,
94
+ status: t.status,
95
+ name: t.name,
96
+ }),
97
+ description: `${t.language} - ${t.category}`,
98
+ };
99
+ }));
100
+ }
101
+ else {
102
+ returnData.push({
103
+ name: 'No templates found',
104
+ value: 'notfound',
105
+ description: 'No templates were found for this Waba Account',
106
+ });
107
+ }
108
+ }
109
+ catch (error) {
110
+ returnData.push({
111
+ name: `Error: ${error.message}`,
112
+ value: 'error',
113
+ description: 'Failed to load templates',
114
+ });
115
+ }
116
+ return returnData;
117
+ },
118
+ async getWabaAccounts() {
119
+ var _a, _b, _c, _d;
120
+ const returnData = [];
121
+ try {
122
+ const wabaAccountsOptions = {
123
+ method: 'GET',
124
+ baseURL: constants_1.BASE_DOMAIN,
125
+ url: suffix_urls.WABA_ACCOUNTS,
126
+ headers: {
127
+ Accept: 'application/json',
128
+ },
129
+ };
130
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', wabaAccountsOptions);
131
+ if (Array.isArray((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.projects)) {
132
+ for (const project of (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.projects) !== null && _c !== void 0 ? _c : []) {
133
+ for (const waba of (_d = project.wabas) !== null && _d !== void 0 ? _d : []) {
134
+ returnData.push({
135
+ name: `${waba.waba_business_name} (${waba.phone_number})`,
136
+ value: JSON.stringify({
137
+ wabaId: waba.waba_id,
138
+ phoneNumber: waba.phone_number,
139
+ phoneNumberId: waba.phone_number_id,
140
+ }),
141
+ description: `Project: ${project.project_name}`,
142
+ });
143
+ }
144
+ }
145
+ }
146
+ else {
147
+ returnData.push({
148
+ name: 'No Waba Accounts found',
149
+ value: 'notfound',
150
+ description: 'No Waba Accounts were found for this user',
151
+ });
152
+ }
153
+ }
154
+ catch (error) {
155
+ returnData.push({
156
+ name: `Error: ${error.message}`,
157
+ value: 'error',
158
+ description: 'Failed to load Waba Accounts',
159
+ });
160
+ }
161
+ return returnData;
162
+ },
163
+ },
164
+ resourceMapping: {
165
+ async getTemplateVariables() {
166
+ const returnData = { fields: [] };
167
+ const addedIds = new Set();
168
+ try {
169
+ const templateValue = this.getNodeParameter('template', '');
170
+ if (!templateValue || ['notfound', 'error'].includes(templateValue))
171
+ return returnData;
172
+ let templateData;
173
+ try {
174
+ if (typeof templateValue === 'object' && templateValue !== null) {
175
+ templateData = templateValue;
176
+ }
177
+ else if (typeof templateValue === 'string' && templateValue.trim().startsWith('{')) {
178
+ templateData = JSON.parse(templateValue);
179
+ }
180
+ else {
181
+ return returnData;
182
+ }
183
+ }
184
+ catch {
185
+ return returnData;
186
+ }
187
+ if (!(templateData === null || templateData === void 0 ? void 0 : templateData.components))
188
+ return returnData;
189
+ const processComponent = (component, prefix = '') => {
190
+ var _a, _b, _c, _d;
191
+ if (!(component === null || component === void 0 ? void 0 : component.type))
192
+ return;
193
+ if (component.type === 'BODY') {
194
+ const body = component;
195
+ if (body.text) {
196
+ const matches = body.text.match(/\{\{([^}]+)\}\}/g) || [];
197
+ for (const match of matches) {
198
+ const innerMatch = match.match(/\{\{([^}]+)\}\}/);
199
+ if (innerMatch && innerMatch[1]) {
200
+ const inner = innerMatch[1];
201
+ const fieldId = `body_param_${inner}`;
202
+ if (!addedIds.has(fieldId)) {
203
+ const isNumber = /^\d+$/.test(inner);
204
+ const example = isNumber
205
+ ? ((_d = (_c = (_b = (_a = body.example) === null || _a === void 0 ? void 0 : _a.body_text) === null || _b === void 0 ? void 0 : _b.flatMap((arr) => arr)) === null || _c === void 0 ? void 0 : _c[parseInt(inner, 10) - 1]) !== null && _d !== void 0 ? _d : '')
206
+ : '';
207
+ returnData.fields.push({
208
+ id: fieldId,
209
+ displayName: `Body Variable {{${inner}}}${example ? '. Example: ' + example : ''}`,
210
+ required: true,
211
+ display: true,
212
+ type: 'string',
213
+ defaultMatch: true,
214
+ canBeUsedToMatch: true,
215
+ });
216
+ addedIds.add(fieldId);
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ else if (component.type === 'HEADER') {
223
+ const header = component;
224
+ if (header.format === 'TEXT' && header.text) {
225
+ const matches = header.text.match(/\{\{([^}]+)\}\}/g) || [];
226
+ for (const match of matches) {
227
+ const innerMatch = match.match(/\{\{([^}]+)\}\}/);
228
+ if (innerMatch && innerMatch[1]) {
229
+ const inner = innerMatch[1];
230
+ const fieldId = `header_param_${inner}`;
231
+ if (!addedIds.has(fieldId)) {
232
+ returnData.fields.push({
233
+ id: fieldId,
234
+ displayName: `Header Variable {{${inner}}}`,
235
+ required: true,
236
+ display: true,
237
+ type: 'string',
238
+ defaultMatch: true,
239
+ canBeUsedToMatch: true,
240
+ });
241
+ addedIds.add(fieldId);
242
+ }
243
+ }
244
+ }
245
+ }
246
+ else if (header.format && ['IMAGE', 'VIDEO', 'DOCUMENT'].includes(header.format)) {
247
+ const fieldId = 'header_media_url';
248
+ if (!addedIds.has(fieldId)) {
249
+ returnData.fields.push({
250
+ id: fieldId,
251
+ displayName: `Header ${header.format} URL`,
252
+ required: true,
253
+ display: true,
254
+ type: 'string',
255
+ defaultMatch: true,
256
+ canBeUsedToMatch: true,
257
+ });
258
+ addedIds.add(fieldId);
259
+ }
260
+ }
261
+ }
262
+ else if (component.type === 'BUTTONS') {
263
+ const buttonsComp = component;
264
+ for (let i = 0; i < (buttonsComp.buttons || []).length; i++) {
265
+ const button = buttonsComp.buttons[i];
266
+ const searchableText = button.url || button.text || '';
267
+ const matches = searchableText.match(/\{\{([^}]+)\}\}/g) || [];
268
+ for (const match of matches) {
269
+ const innerMatch = match.match(/\{\{([^}]+)\}\}/);
270
+ if (innerMatch && innerMatch[1]) {
271
+ const inner = innerMatch[1];
272
+ const fieldId = `button_${i}_param_${inner}`;
273
+ if (!addedIds.has(fieldId)) {
274
+ returnData.fields.push({
275
+ id: fieldId,
276
+ displayName: `Button ${i + 1} Variable {{${inner}}}. Type: ${button.type}`,
277
+ required: true,
278
+ display: true,
279
+ type: 'string',
280
+ defaultMatch: true,
281
+ canBeUsedToMatch: true,
282
+ });
283
+ addedIds.add(fieldId);
284
+ }
285
+ }
286
+ }
287
+ if (button.type === 'FLOW') {
288
+ const tokenField = `button_${i}_flow_token`;
289
+ if (!addedIds.has(tokenField)) {
290
+ returnData.fields.push({
291
+ id: tokenField,
292
+ displayName: `Button ${i + 1} Flow Token`,
293
+ required: false,
294
+ display: true,
295
+ type: 'string',
296
+ defaultMatch: true,
297
+ canBeUsedToMatch: true,
298
+ });
299
+ addedIds.add(tokenField);
300
+ }
301
+ const dataField = `button_${i}_flow_action_data`;
302
+ if (!addedIds.has(dataField)) {
303
+ returnData.fields.push({
304
+ id: dataField,
305
+ displayName: `Button ${i + 1} Flow Action Data (JSON)`,
306
+ required: false,
307
+ display: true,
308
+ type: 'string',
309
+ defaultMatch: true,
310
+ canBeUsedToMatch: true,
311
+ });
312
+ addedIds.add(dataField);
313
+ }
314
+ }
315
+ }
316
+ }
317
+ else if (component.type === 'CAROUSEL') {
318
+ const carousel = component;
319
+ for (let i = 0; i < (carousel.cards || []).length; i++) {
320
+ const card = carousel.cards[i];
321
+ for (const cardComp of card.components || []) {
322
+ processComponent(cardComp, `card_${i + 1}_`);
323
+ }
324
+ }
325
+ }
326
+ };
327
+ for (const component of templateData.components)
328
+ processComponent(component);
329
+ }
330
+ catch (error) {
331
+ return returnData;
332
+ }
333
+ return returnData;
334
+ },
335
+ },
336
+ };
337
+ }
338
+ async execute() {
339
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
340
+ const items = this.getInputData();
341
+ const returnData = [];
342
+ for (let i = 0; i < items.length; i++) {
343
+ try {
344
+ const operation = this.getNodeParameter('operation', i);
345
+ if (operation === 'sendSessionMessage') {
346
+ const selectedWabaAccount = this.getNodeParameter('wabaAccount', i);
347
+ const parsedWabaAccount = JSON.parse(selectedWabaAccount);
348
+ let recipient = this.getNodeParameter('recipient', i);
349
+ if (!recipient.startsWith('+')) {
350
+ recipient = '+' + recipient;
351
+ }
352
+ if (!/^\+[1-9]\d{7,14}$/.test(recipient)) {
353
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid phone number format. Use E.164, e.g. +1234567890.', { itemIndex: i });
354
+ }
355
+ const replyMessage = this.getNodeParameter('replyMessage', i);
356
+ const enableUrlPreview = this.getNodeParameter('enableUrlPreview', i, false);
357
+ const credentials = await this.getCredentials('sendZenApi');
358
+ const returnFullResponse = (_a = credentials === null || credentials === void 0 ? void 0 : credentials.returnFullResponse) !== null && _a !== void 0 ? _a : false;
359
+ const requestOptions = {
360
+ method: 'POST',
361
+ baseURL: constants_1.BASE_DOMAIN,
362
+ url: suffix_urls.SEND_MESSAGE,
363
+ headers: {
364
+ Accept: 'application/json',
365
+ 'Content-Type': 'application/json',
366
+ },
367
+ body: {
368
+ from: parsedWabaAccount.phoneNumber,
369
+ to: recipient,
370
+ type: 'text',
371
+ text: {
372
+ body: replyMessage,
373
+ preview_url: enableUrlPreview,
374
+ },
375
+ },
376
+ returnFullResponse: returnFullResponse,
377
+ };
378
+ try {
379
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', requestOptions);
380
+ returnData.push({ json: response });
381
+ continue;
382
+ }
383
+ catch (error) {
384
+ if (error instanceof n8n_workflow_1.NodeApiError && error.description) {
385
+ const cleanMessage = `${error.description}`;
386
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
387
+ message: cleanMessage,
388
+ });
389
+ }
390
+ if ((0, utils_1.isSendzenAPIErroResponse)(error)) {
391
+ const cleanMessage = `${error.message}, ${error.error.details}`;
392
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
393
+ message: cleanMessage,
394
+ });
395
+ }
396
+ else {
397
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
398
+ }
399
+ }
400
+ }
401
+ else if (operation === 'sendTemplateMessage') {
402
+ const selectedWabaAccount = this.getNodeParameter('wabaAccount', i);
403
+ const parsedWabaAccount = JSON.parse(selectedWabaAccount);
404
+ const recipient = this.getNodeParameter('recipient', i);
405
+ if (!/^\+[1-9]\d{7,14}$/.test(recipient)) {
406
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid phone number format. Use E.164, e.g. +1234567890.', { itemIndex: i });
407
+ }
408
+ const template = this.getNodeParameter('template', i);
409
+ const parsedTemplate = JSON.parse(template);
410
+ const templateVariables = this.getNodeParameter('templateVariables', i);
411
+ const variables = templateVariables.value || {};
412
+ const payload = (0, template_builder_1.buildTemplatePayload)({
413
+ from: parsedWabaAccount.phoneNumber || '',
414
+ to: recipient,
415
+ template: parsedTemplate,
416
+ variables,
417
+ });
418
+ const credentials = await this.getCredentials('sendZenApi');
419
+ const returnFullResponse = (_b = credentials === null || credentials === void 0 ? void 0 : credentials.returnFullResponse) !== null && _b !== void 0 ? _b : false;
420
+ const requestOptions = {
421
+ method: 'POST',
422
+ baseURL: constants_1.BASE_DOMAIN,
423
+ url: suffix_urls.SEND_MESSAGE,
424
+ headers: {
425
+ Accept: 'application/json',
426
+ 'Content-Type': 'application/json',
427
+ },
428
+ body: payload,
429
+ returnFullResponse: returnFullResponse,
430
+ };
431
+ try {
432
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', requestOptions);
433
+ returnData.push({ json: { response } });
434
+ continue;
435
+ }
436
+ catch (error) {
437
+ if (error instanceof n8n_workflow_1.NodeApiError && error.description) {
438
+ const cleanMessage = `${error.description}`;
439
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
440
+ message: cleanMessage,
441
+ });
442
+ }
443
+ if ((0, utils_1.isSendzenAPIErroResponse)(error)) {
444
+ const cleanMessage = `${error.message}, ${error.error.details}`;
445
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
446
+ message: cleanMessage,
447
+ });
448
+ }
449
+ else {
450
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
451
+ }
452
+ }
453
+ }
454
+ else if (operation === 'markAsRead') {
455
+ const manualPhoneNumberId = this.getNodeParameter('phoneNumberId', i);
456
+ const credentials = await this.getCredentials('sendZenApi');
457
+ const returnFullResponse = (_c = credentials === null || credentials === void 0 ? void 0 : credentials.returnFullResponse) !== null && _c !== void 0 ? _c : false;
458
+ const phoneNumberId = manualPhoneNumberId ||
459
+ items[i].json.phoneNumberId ||
460
+ items[i].json.phone_number_id ||
461
+ ((_j = (_h = (_g = (_f = (_e = (_d = items[i].json.entry) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.changes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.metadata) === null || _j === void 0 ? void 0 : _j.phone_number_id);
462
+ if (!phoneNumberId) {
463
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Phone Number ID could not be resolved.', {
464
+ itemIndex: i,
465
+ });
466
+ }
467
+ const manualMessageId = this.getNodeParameter('messageId', i, '');
468
+ const messageId = (manualMessageId ||
469
+ ((_l = (_k = items[i].json.messages) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.id) ||
470
+ ((_m = items[i].json.message) === null || _m === void 0 ? void 0 : _m.id) ||
471
+ items[i].json.message_id ||
472
+ ((_u = (_t = (_s = (_r = (_q = (_p = (_o = items[i].json.entry) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.changes) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.value) === null || _s === void 0 ? void 0 : _s.messages) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.id));
473
+ if (!messageId) {
474
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Message ID could not be resolved.', {
475
+ itemIndex: i,
476
+ });
477
+ }
478
+ const requestOptions = {
479
+ method: 'POST',
480
+ baseURL: constants_1.BASE_DOMAIN,
481
+ url: suffix_urls.READ_TYPING_STATUS.replace('{phoneNumberId}', phoneNumberId),
482
+ headers: {
483
+ Accept: 'application/json',
484
+ 'Content-Type': 'application/json',
485
+ },
486
+ body: {
487
+ messaging_product: 'whatsapp',
488
+ status: 'read',
489
+ message_id: messageId,
490
+ },
491
+ returnFullResponse,
492
+ };
493
+ try {
494
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', requestOptions);
495
+ returnData.push({ json: response });
496
+ continue;
497
+ }
498
+ catch (error) {
499
+ if (error instanceof n8n_workflow_1.NodeApiError && error.description) {
500
+ const cleanMessage = `${error.description}`;
501
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
502
+ message: cleanMessage,
503
+ });
504
+ }
505
+ if ((0, utils_1.isSendzenAPIErroResponse)(error)) {
506
+ const cleanMessage = `${error.message}, ${error.error.details}`;
507
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
508
+ message: cleanMessage,
509
+ });
510
+ }
511
+ else {
512
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
513
+ }
514
+ }
515
+ }
516
+ else if (operation === 'showTyping') {
517
+ const manualPhoneNumberId = this.getNodeParameter('phoneNumberId', i);
518
+ const credentials = await this.getCredentials('sendZenApi');
519
+ const returnFullResponse = (_v = credentials === null || credentials === void 0 ? void 0 : credentials.returnFullResponse) !== null && _v !== void 0 ? _v : false;
520
+ const phoneNumberId = manualPhoneNumberId ||
521
+ items[i].json.phoneNumberId ||
522
+ items[i].json.phone_number_id ||
523
+ ((_1 = (_0 = (_z = (_y = (_x = (_w = items[i].json.entry) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.changes) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.value) === null || _0 === void 0 ? void 0 : _0.metadata) === null || _1 === void 0 ? void 0 : _1.phone_number_id);
524
+ if (!phoneNumberId) {
525
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Phone Number ID could not be resolved.', {
526
+ itemIndex: i,
527
+ });
528
+ }
529
+ const manualMessageId = this.getNodeParameter('messageId', i, '');
530
+ const messageId = (manualMessageId ||
531
+ ((_3 = (_2 = items[i].json.messages) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.id) ||
532
+ ((_4 = items[i].json.message) === null || _4 === void 0 ? void 0 : _4.id) ||
533
+ items[i].json.message_id ||
534
+ ((_11 = (_10 = (_9 = (_8 = (_7 = (_6 = (_5 = items[i].json.entry) === null || _5 === void 0 ? void 0 : _5[0]) === null || _6 === void 0 ? void 0 : _6.changes) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.value) === null || _9 === void 0 ? void 0 : _9.messages) === null || _10 === void 0 ? void 0 : _10[0]) === null || _11 === void 0 ? void 0 : _11.id));
535
+ if (!messageId) {
536
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Message ID could not be resolved.', {
537
+ itemIndex: i,
538
+ });
539
+ }
540
+ const requestOptions = {
541
+ method: 'POST',
542
+ baseURL: constants_1.BASE_DOMAIN,
543
+ url: suffix_urls.READ_TYPING_STATUS.replace('{phoneNumberId}', phoneNumberId),
544
+ headers: {
545
+ Accept: 'application/json',
546
+ 'Content-Type': 'application/json',
547
+ },
548
+ body: {
549
+ messaging_product: 'whatsapp',
550
+ status: 'read',
551
+ message_id: messageId,
552
+ typing_indicator: {
553
+ type: 'text',
554
+ },
555
+ },
556
+ returnFullResponse,
557
+ };
558
+ try {
559
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sendZenApi', requestOptions);
560
+ returnData.push({ json: response });
561
+ continue;
562
+ }
563
+ catch (error) {
564
+ if (error instanceof n8n_workflow_1.NodeApiError && error.description) {
565
+ const cleanMessage = `${error.description}`;
566
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
567
+ message: cleanMessage,
568
+ });
569
+ }
570
+ if ((0, utils_1.isSendzenAPIErroResponse)(error)) {
571
+ const cleanMessage = `${error.message}, ${error.error.details}`;
572
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
573
+ message: cleanMessage,
574
+ });
575
+ }
576
+ else {
577
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
578
+ }
579
+ }
580
+ }
581
+ else {
582
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation ${operation} is not supported`);
583
+ }
584
+ }
585
+ catch (error) {
586
+ if (this.continueOnFail()) {
587
+ returnData.push({
588
+ json: {
589
+ error: error.message,
590
+ },
591
+ pairedItem: { item: i },
592
+ });
593
+ continue;
594
+ }
595
+ if (error instanceof n8n_workflow_1.NodeApiError || error.constructor.name === 'NodeApiError') {
596
+ if (error.message.includes('Forbidden - perhaps check your credentials?') &&
597
+ error.description) {
598
+ const cleanMessage = `${error.description}`;
599
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: cleanMessage });
600
+ }
601
+ throw error;
602
+ }
603
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
604
+ }
605
+ }
606
+ return [returnData];
607
+ }
608
+ }
609
+ exports.SendZen = SendZen;
610
+ //# sourceMappingURL=SendZen.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendZen.node.js","sourceRoot":"","sources":["../../../nodes/SendZen/SendZen.node.ts"],"names":[],"mappings":";;;AAAA,+CAYsB;AAEtB,sDAAqD;AAErD,8CAA8D;AAS9D,6EAA8E;AAC9E,gEAUqC;AAErC,MAAM,WAAW,GAAG;IACnB,aAAa,EAAE,UAAU;IACzB,SAAS,EAAE,gCAAgC;IAC3C,YAAY,EAAE,cAAc;IAC5B,kBAAkB,EAAE,8BAA8B;CAClD,CAAC;AAEF,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EACP,+EAA+E;gBAC/E,6EAA6E;gBAC7E,2DAA2D;gBAC3D,oEAAoE;gBACpE,cAAc;YACf,WAAW,EAAE,4GAA4G;YACzH,QAAQ,EAAE;gBACT,IA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