n8n-nodes-whaapy 0.3.5 → 0.3.6

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.
@@ -71,6 +71,15 @@ function buildInteractivePayload(params) {
71
71
  })),
72
72
  };
73
73
  }
74
+ else if (params.interactiveType === 'cta_url' && params.ctaButtonText && params.ctaButtonUrl) {
75
+ interactive.action = {
76
+ name: 'cta_url',
77
+ parameters: {
78
+ display_text: params.ctaButtonText.substring(0, 20),
79
+ url: params.ctaButtonUrl,
80
+ },
81
+ };
82
+ }
74
83
  return interactive;
75
84
  }
76
85
  class Whaapy {
@@ -301,7 +310,7 @@ class Whaapy {
301
310
  // ===========================================
302
311
  // INTERACTIVE MESSAGE FIELDS (Structured)
303
312
  // ===========================================
304
- // Interactive: Type selector (button or list)
313
+ // Interactive: Type selector (button, list, or cta_url)
305
314
  {
306
315
  displayName: 'Interactive Type',
307
316
  name: 'interactiveType',
@@ -310,9 +319,10 @@ class Whaapy {
310
319
  options: [
311
320
  { name: 'Buttons (Reply Buttons)', value: 'button' },
312
321
  { name: 'List (Menu)', value: 'list' },
322
+ { name: 'CTA URL (Link Button)', value: 'cta_url' },
313
323
  ],
314
324
  default: 'button',
315
- description: 'Type of interactive message. Buttons show up to 3 options, Lists show a menu with sections.',
325
+ description: 'Type of interactive message. Buttons: up to 3 reply options. List: menu with sections. CTA URL: single button that opens a URL.',
316
326
  displayOptions: {
317
327
  show: { resource: ['message'], operation: ['send'], messageType: ['interactive'] },
318
328
  },
@@ -538,6 +548,42 @@ class Whaapy {
538
548
  },
539
549
  ],
540
550
  },
551
+ // Interactive: CTA URL Button Text (if type=cta_url)
552
+ {
553
+ displayName: 'Button Text',
554
+ name: 'ctaButtonText',
555
+ type: 'string',
556
+ required: true,
557
+ default: '',
558
+ placeholder: 'Ver Sitio Web',
559
+ description: 'Text displayed on the button. Max 20 characters.',
560
+ displayOptions: {
561
+ show: {
562
+ resource: ['message'],
563
+ operation: ['send'],
564
+ messageType: ['interactive'],
565
+ interactiveType: ['cta_url'],
566
+ },
567
+ },
568
+ },
569
+ // Interactive: CTA URL Button URL (if type=cta_url)
570
+ {
571
+ displayName: 'Button URL',
572
+ name: 'ctaButtonUrl',
573
+ type: 'string',
574
+ required: true,
575
+ default: '',
576
+ placeholder: 'https://example.com/page',
577
+ description: 'URL that opens when the user taps the button.',
578
+ displayOptions: {
579
+ show: {
580
+ resource: ['message'],
581
+ operation: ['send'],
582
+ messageType: ['interactive'],
583
+ interactiveType: ['cta_url'],
584
+ },
585
+ },
586
+ },
541
587
  // Message: Send - Location
542
588
  {
543
589
  displayName: 'Latitude',
@@ -1724,6 +1770,13 @@ class Whaapy {
1724
1770
  });
1725
1771
  }
1726
1772
  }
1773
+ // CTA URL button
1774
+ let ctaButtonText = '';
1775
+ let ctaButtonUrl = '';
1776
+ if (interactiveType === 'cta_url') {
1777
+ ctaButtonText = this.getNodeParameter('ctaButtonText', i, '');
1778
+ ctaButtonUrl = this.getNodeParameter('ctaButtonUrl', i, '');
1779
+ }
1727
1780
  body.interactive = buildInteractivePayload({
1728
1781
  interactiveType,
1729
1782
  bodyText,
@@ -1734,6 +1787,8 @@ class Whaapy {
1734
1787
  buttons,
1735
1788
  listButtonText,
1736
1789
  sections,
1790
+ ctaButtonText,
1791
+ ctaButtonUrl,
1737
1792
  });
1738
1793
  }
1739
1794
  else if (messageType === 'location') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-whaapy",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "n8n community node for Whaapy - WhatsApp Business API with AI",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",