n8n-nodes-whaapy 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.
@@ -0,0 +1,1706 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Whaapy = void 0;
4
+ class Whaapy {
5
+ constructor() {
6
+ this.description = {
7
+ displayName: 'Whaapy',
8
+ name: 'whaapy',
9
+ icon: 'file:whaapy.svg',
10
+ group: ['transform'],
11
+ version: 1,
12
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
13
+ description: 'WhatsApp Business API with AI - Send messages, manage conversations, and automate with AI agents',
14
+ defaults: {
15
+ name: 'Whaapy',
16
+ },
17
+ inputs: ['main'],
18
+ outputs: ['main'],
19
+ credentials: [
20
+ {
21
+ name: 'whaapyApi',
22
+ required: true,
23
+ },
24
+ ],
25
+ requestDefaults: {
26
+ baseURL: '={{$credentials.baseUrl}}',
27
+ headers: {
28
+ Accept: 'application/json',
29
+ 'Content-Type': 'application/json',
30
+ },
31
+ },
32
+ properties: [
33
+ // ===========================================
34
+ // RESOURCE SELECTOR
35
+ // ===========================================
36
+ {
37
+ displayName: 'Resource',
38
+ name: 'resource',
39
+ type: 'options',
40
+ noDataExpression: true,
41
+ options: [
42
+ { name: 'Message', value: 'message' },
43
+ { name: 'Media', value: 'media' },
44
+ { name: 'Conversation', value: 'conversation' },
45
+ { name: 'Agent', value: 'agent' },
46
+ { name: 'Template', value: 'template' },
47
+ { name: 'Contact', value: 'contact' },
48
+ { name: 'Funnel', value: 'funnel' },
49
+ ],
50
+ default: 'message',
51
+ },
52
+ // ===========================================
53
+ // MESSAGE OPERATIONS
54
+ // ===========================================
55
+ {
56
+ displayName: 'Operation',
57
+ name: 'operation',
58
+ type: 'options',
59
+ noDataExpression: true,
60
+ displayOptions: {
61
+ show: { resource: ['message'] },
62
+ },
63
+ options: [
64
+ {
65
+ name: 'Send',
66
+ value: 'send',
67
+ action: 'Send a message',
68
+ description: 'Send a WhatsApp message',
69
+ routing: {
70
+ request: {
71
+ method: 'POST',
72
+ url: '/messages/v1',
73
+ },
74
+ },
75
+ },
76
+ {
77
+ name: 'Retry',
78
+ value: 'retry',
79
+ action: 'Retry a failed message',
80
+ description: 'Retry sending a failed message',
81
+ routing: {
82
+ request: {
83
+ method: 'POST',
84
+ url: '=/messages/v1/{{$parameter.messageId}}/retry',
85
+ },
86
+ },
87
+ },
88
+ ],
89
+ default: 'send',
90
+ },
91
+ // Message: Send - To field
92
+ {
93
+ displayName: 'To',
94
+ name: 'to',
95
+ type: 'string',
96
+ required: true,
97
+ default: '',
98
+ placeholder: '+5215512345678',
99
+ description: 'Phone number with country code',
100
+ displayOptions: {
101
+ show: { resource: ['message'], operation: ['send'] },
102
+ },
103
+ routing: {
104
+ send: { type: 'body', property: 'to' },
105
+ },
106
+ },
107
+ // Message: Send - Type
108
+ {
109
+ displayName: 'Message Type',
110
+ name: 'messageType',
111
+ type: 'options',
112
+ required: true,
113
+ options: [
114
+ { name: 'Text', value: 'text' },
115
+ { name: 'Image', value: 'image' },
116
+ { name: 'Video', value: 'video' },
117
+ { name: 'Audio', value: 'audio' },
118
+ { name: 'Document', value: 'document' },
119
+ { name: 'Template', value: 'template' },
120
+ { name: 'Interactive', value: 'interactive' },
121
+ { name: 'Location', value: 'location' },
122
+ { name: 'Contacts', value: 'contacts' },
123
+ { name: 'Sticker', value: 'sticker' },
124
+ { name: 'Reaction', value: 'reaction' },
125
+ ],
126
+ default: 'text',
127
+ displayOptions: {
128
+ show: { resource: ['message'], operation: ['send'] },
129
+ },
130
+ routing: {
131
+ send: { type: 'body', property: 'type' },
132
+ },
133
+ },
134
+ // Message: Send - Text content
135
+ {
136
+ displayName: 'Message Text',
137
+ name: 'textContent',
138
+ type: 'string',
139
+ typeOptions: { rows: 3 },
140
+ required: true,
141
+ default: '',
142
+ description: 'The text content of the message',
143
+ displayOptions: {
144
+ show: { resource: ['message'], operation: ['send'], messageType: ['text'] },
145
+ },
146
+ routing: {
147
+ send: { type: 'body', property: 'content' },
148
+ },
149
+ },
150
+ // Message: Send - Media URL (for image, video, audio, document, sticker)
151
+ {
152
+ displayName: 'Media URL',
153
+ name: 'mediaUrl',
154
+ type: 'string',
155
+ required: true,
156
+ default: '',
157
+ placeholder: 'https://example.com/image.jpg',
158
+ description: 'URL of the media file or Media ID from upload',
159
+ displayOptions: {
160
+ show: {
161
+ resource: ['message'],
162
+ operation: ['send'],
163
+ messageType: ['image', 'video', 'audio', 'document', 'sticker'],
164
+ },
165
+ },
166
+ routing: {
167
+ send: { type: 'body', property: '={{$parameter.messageType}}.link' },
168
+ },
169
+ },
170
+ // Message: Send - Caption (for media)
171
+ {
172
+ displayName: 'Caption',
173
+ name: 'caption',
174
+ type: 'string',
175
+ default: '',
176
+ description: 'Caption for the media',
177
+ displayOptions: {
178
+ show: {
179
+ resource: ['message'],
180
+ operation: ['send'],
181
+ messageType: ['image', 'video', 'document'],
182
+ },
183
+ },
184
+ routing: {
185
+ send: { type: 'body', property: '={{$parameter.messageType}}.caption' },
186
+ },
187
+ },
188
+ // Message: Send - Template name
189
+ {
190
+ displayName: 'Template Name',
191
+ name: 'templateName',
192
+ type: 'string',
193
+ required: true,
194
+ default: '',
195
+ description: 'Name of the WhatsApp template to use',
196
+ displayOptions: {
197
+ show: { resource: ['message'], operation: ['send'], messageType: ['template'] },
198
+ },
199
+ routing: {
200
+ send: { type: 'body', property: 'templateName' },
201
+ },
202
+ },
203
+ // Message: Send - Template parameters
204
+ {
205
+ displayName: 'Template Parameters',
206
+ name: 'templateParameters',
207
+ type: 'json',
208
+ default: '[]',
209
+ description: 'Array of template parameter values',
210
+ displayOptions: {
211
+ show: { resource: ['message'], operation: ['send'], messageType: ['template'] },
212
+ },
213
+ routing: {
214
+ send: { type: 'body', property: 'template_parameters' },
215
+ },
216
+ },
217
+ // Message: Send - Interactive content
218
+ {
219
+ displayName: 'Interactive Content',
220
+ name: 'interactiveContent',
221
+ type: 'json',
222
+ required: true,
223
+ default: '{}',
224
+ description: 'Interactive message content (buttons, lists)',
225
+ displayOptions: {
226
+ show: { resource: ['message'], operation: ['send'], messageType: ['interactive'] },
227
+ },
228
+ routing: {
229
+ send: { type: 'body', property: 'interactive' },
230
+ },
231
+ },
232
+ // Message: Send - Location
233
+ {
234
+ displayName: 'Latitude',
235
+ name: 'latitude',
236
+ type: 'number',
237
+ required: true,
238
+ default: 0,
239
+ displayOptions: {
240
+ show: { resource: ['message'], operation: ['send'], messageType: ['location'] },
241
+ },
242
+ routing: {
243
+ send: { type: 'body', property: 'location.latitude' },
244
+ },
245
+ },
246
+ {
247
+ displayName: 'Longitude',
248
+ name: 'longitude',
249
+ type: 'number',
250
+ required: true,
251
+ default: 0,
252
+ displayOptions: {
253
+ show: { resource: ['message'], operation: ['send'], messageType: ['location'] },
254
+ },
255
+ routing: {
256
+ send: { type: 'body', property: 'location.longitude' },
257
+ },
258
+ },
259
+ {
260
+ displayName: 'Location Name',
261
+ name: 'locationName',
262
+ type: 'string',
263
+ default: '',
264
+ displayOptions: {
265
+ show: { resource: ['message'], operation: ['send'], messageType: ['location'] },
266
+ },
267
+ routing: {
268
+ send: { type: 'body', property: 'location.name' },
269
+ },
270
+ },
271
+ // Message: Send - Contacts
272
+ {
273
+ displayName: 'Contacts Data',
274
+ name: 'contactsData',
275
+ type: 'json',
276
+ required: true,
277
+ default: '[]',
278
+ description: 'Array of contact objects',
279
+ displayOptions: {
280
+ show: { resource: ['message'], operation: ['send'], messageType: ['contacts'] },
281
+ },
282
+ routing: {
283
+ send: { type: 'body', property: 'contacts' },
284
+ },
285
+ },
286
+ // Message: Send - Reaction
287
+ {
288
+ displayName: 'Message ID to React',
289
+ name: 'reactionMessageId',
290
+ type: 'string',
291
+ required: true,
292
+ default: '',
293
+ displayOptions: {
294
+ show: { resource: ['message'], operation: ['send'], messageType: ['reaction'] },
295
+ },
296
+ routing: {
297
+ send: { type: 'body', property: 'reaction.message_id' },
298
+ },
299
+ },
300
+ {
301
+ displayName: 'Emoji',
302
+ name: 'reactionEmoji',
303
+ type: 'string',
304
+ required: true,
305
+ default: '👍',
306
+ displayOptions: {
307
+ show: { resource: ['message'], operation: ['send'], messageType: ['reaction'] },
308
+ },
309
+ routing: {
310
+ send: { type: 'body', property: 'reaction.emoji' },
311
+ },
312
+ },
313
+ // Message: Send - Additional Fields
314
+ {
315
+ displayName: 'Additional Fields',
316
+ name: 'additionalFields',
317
+ type: 'collection',
318
+ placeholder: 'Add Field',
319
+ default: {},
320
+ displayOptions: {
321
+ show: { resource: ['message'], operation: ['send'] },
322
+ },
323
+ options: [
324
+ {
325
+ displayName: 'Pause AI',
326
+ name: 'pauseAi',
327
+ type: 'boolean',
328
+ default: false,
329
+ description: 'Pause AI after sending this message',
330
+ routing: {
331
+ send: { type: 'body', property: 'ai.pause' },
332
+ },
333
+ },
334
+ {
335
+ displayName: 'Pause Duration (Minutes)',
336
+ name: 'pauseDuration',
337
+ type: 'number',
338
+ default: 5,
339
+ description: 'How long to pause AI (1-1440 minutes)',
340
+ routing: {
341
+ send: { type: 'body', property: 'ai.pauseDuration' },
342
+ },
343
+ },
344
+ {
345
+ displayName: 'Disable AI',
346
+ name: 'disableAi',
347
+ type: 'boolean',
348
+ default: false,
349
+ description: 'Permanently disable AI for this conversation',
350
+ routing: {
351
+ send: { type: 'body', property: 'ai.disable' },
352
+ },
353
+ },
354
+ {
355
+ displayName: 'Reply To Message ID',
356
+ name: 'replyTo',
357
+ type: 'string',
358
+ default: '',
359
+ description: 'Message ID to reply to',
360
+ routing: {
361
+ send: { type: 'body', property: 'context.message_id' },
362
+ },
363
+ },
364
+ {
365
+ displayName: 'Create Conversation',
366
+ name: 'createConversation',
367
+ type: 'boolean',
368
+ default: true,
369
+ description: 'Create a conversation if it doesn\'t exist',
370
+ routing: {
371
+ send: { type: 'body', property: 'createConversation' },
372
+ },
373
+ },
374
+ {
375
+ displayName: 'Metadata',
376
+ name: 'metadata',
377
+ type: 'json',
378
+ default: '{}',
379
+ description: 'Custom metadata to attach to the message',
380
+ routing: {
381
+ send: { type: 'body', property: 'metadata' },
382
+ },
383
+ },
384
+ ],
385
+ },
386
+ // Message: Retry - Message ID
387
+ {
388
+ displayName: 'Message ID',
389
+ name: 'messageId',
390
+ type: 'string',
391
+ required: true,
392
+ default: '',
393
+ description: 'ID of the failed message to retry',
394
+ displayOptions: {
395
+ show: { resource: ['message'], operation: ['retry'] },
396
+ },
397
+ },
398
+ // ===========================================
399
+ // MEDIA OPERATIONS
400
+ // ===========================================
401
+ {
402
+ displayName: 'Operation',
403
+ name: 'operation',
404
+ type: 'options',
405
+ noDataExpression: true,
406
+ displayOptions: {
407
+ show: { resource: ['media'] },
408
+ },
409
+ options: [
410
+ {
411
+ name: 'Upload',
412
+ value: 'upload',
413
+ action: 'Upload media',
414
+ description: 'Upload media to WhatsApp CDN',
415
+ routing: {
416
+ request: {
417
+ method: 'POST',
418
+ url: '/media/v1',
419
+ },
420
+ },
421
+ },
422
+ ],
423
+ default: 'upload',
424
+ },
425
+ // Media: Upload - Type
426
+ {
427
+ displayName: 'Media Type',
428
+ name: 'mediaType',
429
+ type: 'options',
430
+ required: true,
431
+ options: [
432
+ { name: 'Image', value: 'image' },
433
+ { name: 'Video', value: 'video' },
434
+ { name: 'Audio', value: 'audio' },
435
+ { name: 'Document', value: 'document' },
436
+ { name: 'Sticker', value: 'sticker' },
437
+ ],
438
+ default: 'image',
439
+ displayOptions: {
440
+ show: { resource: ['media'], operation: ['upload'] },
441
+ },
442
+ routing: {
443
+ send: { type: 'body', property: 'type' },
444
+ },
445
+ },
446
+ // Media: Upload - Binary property
447
+ {
448
+ displayName: 'Binary Property',
449
+ name: 'binaryPropertyName',
450
+ type: 'string',
451
+ required: true,
452
+ default: 'data',
453
+ description: 'Name of the binary property containing the file',
454
+ displayOptions: {
455
+ show: { resource: ['media'], operation: ['upload'] },
456
+ },
457
+ },
458
+ // ===========================================
459
+ // CONVERSATION OPERATIONS
460
+ // ===========================================
461
+ {
462
+ displayName: 'Operation',
463
+ name: 'operation',
464
+ type: 'options',
465
+ noDataExpression: true,
466
+ displayOptions: {
467
+ show: { resource: ['conversation'] },
468
+ },
469
+ options: [
470
+ {
471
+ name: 'List',
472
+ value: 'list',
473
+ action: 'List conversations',
474
+ description: 'Get all conversations',
475
+ routing: {
476
+ request: {
477
+ method: 'GET',
478
+ url: '/conversations/v1',
479
+ },
480
+ },
481
+ },
482
+ {
483
+ name: 'Get',
484
+ value: 'get',
485
+ action: 'Get a conversation',
486
+ description: 'Get a specific conversation',
487
+ routing: {
488
+ request: {
489
+ method: 'GET',
490
+ url: '=/conversations/v1/{{$parameter.conversationId}}',
491
+ },
492
+ },
493
+ },
494
+ {
495
+ name: 'Get by Phone',
496
+ value: 'getByPhone',
497
+ action: 'Get conversation by phone',
498
+ description: 'Find conversation by phone number',
499
+ routing: {
500
+ request: {
501
+ method: 'GET',
502
+ url: '=/conversations/v1/by-phone/{{$parameter.phoneNumber}}',
503
+ },
504
+ },
505
+ },
506
+ {
507
+ name: 'Get Messages',
508
+ value: 'getMessages',
509
+ action: 'Get conversation messages',
510
+ description: 'Get message history of a conversation',
511
+ routing: {
512
+ request: {
513
+ method: 'GET',
514
+ url: '=/conversations/v1/{{$parameter.conversationId}}/messages',
515
+ },
516
+ },
517
+ },
518
+ {
519
+ name: 'Close',
520
+ value: 'close',
521
+ action: 'Close a conversation',
522
+ description: 'Close a conversation',
523
+ routing: {
524
+ request: {
525
+ method: 'POST',
526
+ url: '=/conversations/v1/{{$parameter.conversationId}}/close',
527
+ },
528
+ },
529
+ },
530
+ {
531
+ name: 'Archive',
532
+ value: 'archive',
533
+ action: 'Archive a conversation',
534
+ description: 'Archive a conversation',
535
+ routing: {
536
+ request: {
537
+ method: 'POST',
538
+ url: '=/conversations/v1/{{$parameter.conversationId}}/archive',
539
+ },
540
+ },
541
+ },
542
+ {
543
+ name: 'Mark Read',
544
+ value: 'markRead',
545
+ action: 'Mark conversation as read',
546
+ description: 'Mark a conversation as read',
547
+ routing: {
548
+ request: {
549
+ method: 'PATCH',
550
+ url: '=/conversations/v1/{{$parameter.conversationId}}/mark-read',
551
+ },
552
+ },
553
+ },
554
+ {
555
+ name: 'Set AI',
556
+ value: 'setAi',
557
+ action: 'Enable/disable AI',
558
+ description: 'Enable or disable AI for a conversation',
559
+ routing: {
560
+ request: {
561
+ method: 'PATCH',
562
+ url: '=/conversations/v1/{{$parameter.conversationId}}/ai',
563
+ },
564
+ },
565
+ },
566
+ {
567
+ name: 'Pause AI',
568
+ value: 'pauseAi',
569
+ action: 'Pause AI temporarily',
570
+ description: 'Pause AI for a conversation',
571
+ routing: {
572
+ request: {
573
+ method: 'POST',
574
+ url: '=/conversations/v1/{{$parameter.conversationId}}/ai/pause',
575
+ },
576
+ },
577
+ },
578
+ {
579
+ name: 'AI Suggest',
580
+ value: 'aiSuggest',
581
+ action: 'Get AI suggestion',
582
+ description: 'Get an AI suggestion without sending',
583
+ routing: {
584
+ request: {
585
+ method: 'POST',
586
+ url: '=/conversations/v1/{{$parameter.conversationId}}/ai-suggest',
587
+ },
588
+ },
589
+ },
590
+ ],
591
+ default: 'list',
592
+ },
593
+ // Conversation: ID field
594
+ {
595
+ displayName: 'Conversation ID',
596
+ name: 'conversationId',
597
+ type: 'string',
598
+ required: true,
599
+ default: '',
600
+ displayOptions: {
601
+ show: {
602
+ resource: ['conversation'],
603
+ operation: ['get', 'getMessages', 'close', 'archive', 'markRead', 'setAi', 'pauseAi', 'aiSuggest'],
604
+ },
605
+ },
606
+ },
607
+ // Conversation: Phone number field
608
+ {
609
+ displayName: 'Phone Number',
610
+ name: 'phoneNumber',
611
+ type: 'string',
612
+ required: true,
613
+ default: '',
614
+ placeholder: '+5215512345678',
615
+ displayOptions: {
616
+ show: { resource: ['conversation'], operation: ['getByPhone'] },
617
+ },
618
+ },
619
+ // Conversation: Set AI - Enabled
620
+ {
621
+ displayName: 'AI Enabled',
622
+ name: 'aiEnabled',
623
+ type: 'boolean',
624
+ required: true,
625
+ default: true,
626
+ displayOptions: {
627
+ show: { resource: ['conversation'], operation: ['setAi'] },
628
+ },
629
+ routing: {
630
+ send: { type: 'body', property: 'aiEnabled' },
631
+ },
632
+ },
633
+ // Conversation: Pause AI - Duration
634
+ {
635
+ displayName: 'Pause Duration (Minutes)',
636
+ name: 'pauseDurationConv',
637
+ type: 'number',
638
+ required: true,
639
+ default: 5,
640
+ description: 'How long to pause AI (1-1440 minutes)',
641
+ displayOptions: {
642
+ show: { resource: ['conversation'], operation: ['pauseAi'] },
643
+ },
644
+ routing: {
645
+ send: { type: 'body', property: 'duration' },
646
+ },
647
+ },
648
+ // Conversation: List - Filters
649
+ {
650
+ displayName: 'Filters',
651
+ name: 'conversationFilters',
652
+ type: 'collection',
653
+ placeholder: 'Add Filter',
654
+ default: {},
655
+ displayOptions: {
656
+ show: { resource: ['conversation'], operation: ['list'] },
657
+ },
658
+ options: [
659
+ {
660
+ displayName: 'Search',
661
+ name: 'search',
662
+ type: 'string',
663
+ default: '',
664
+ description: 'Search by name or phone',
665
+ routing: {
666
+ send: { type: 'query', property: 'search' },
667
+ },
668
+ },
669
+ {
670
+ displayName: 'Status',
671
+ name: 'status',
672
+ type: 'options',
673
+ options: [
674
+ { name: 'All', value: 'all' },
675
+ { name: 'Active', value: 'active' },
676
+ { name: 'Closed', value: 'closed' },
677
+ { name: 'Archived', value: 'archived' },
678
+ ],
679
+ default: 'all',
680
+ routing: {
681
+ send: { type: 'query', property: 'status' },
682
+ },
683
+ },
684
+ {
685
+ displayName: 'Limit',
686
+ name: 'limit',
687
+ type: 'number',
688
+ default: 20,
689
+ description: 'Max results (1-100)',
690
+ routing: {
691
+ send: { type: 'query', property: 'limit' },
692
+ },
693
+ },
694
+ {
695
+ displayName: 'Offset',
696
+ name: 'offset',
697
+ type: 'number',
698
+ default: 0,
699
+ routing: {
700
+ send: { type: 'query', property: 'offset' },
701
+ },
702
+ },
703
+ ],
704
+ },
705
+ // Conversation: Get Messages - Pagination
706
+ {
707
+ displayName: 'Options',
708
+ name: 'messagesOptions',
709
+ type: 'collection',
710
+ placeholder: 'Add Option',
711
+ default: {},
712
+ displayOptions: {
713
+ show: { resource: ['conversation'], operation: ['getMessages'] },
714
+ },
715
+ options: [
716
+ {
717
+ displayName: 'Limit',
718
+ name: 'limit',
719
+ type: 'number',
720
+ default: 50,
721
+ routing: {
722
+ send: { type: 'query', property: 'limit' },
723
+ },
724
+ },
725
+ {
726
+ displayName: 'Cursor',
727
+ name: 'cursor',
728
+ type: 'string',
729
+ default: '',
730
+ description: 'Pagination cursor',
731
+ routing: {
732
+ send: { type: 'query', property: 'cursor' },
733
+ },
734
+ },
735
+ ],
736
+ },
737
+ // ===========================================
738
+ // AGENT OPERATIONS
739
+ // ===========================================
740
+ {
741
+ displayName: 'Operation',
742
+ name: 'operation',
743
+ type: 'options',
744
+ noDataExpression: true,
745
+ displayOptions: {
746
+ show: { resource: ['agent'] },
747
+ },
748
+ options: [
749
+ {
750
+ name: 'Toggle',
751
+ value: 'toggle',
752
+ action: 'Toggle AI globally',
753
+ description: 'Enable or disable AI globally',
754
+ routing: {
755
+ request: {
756
+ method: 'POST',
757
+ url: '/agent/v1/toggle',
758
+ },
759
+ },
760
+ },
761
+ {
762
+ name: 'Pause',
763
+ value: 'pause',
764
+ action: 'Pause AI globally',
765
+ description: 'Pause AI globally for X minutes',
766
+ routing: {
767
+ request: {
768
+ method: 'POST',
769
+ url: '/agent/v1/pause',
770
+ },
771
+ },
772
+ },
773
+ ],
774
+ default: 'toggle',
775
+ },
776
+ // Agent: Toggle - Enabled
777
+ {
778
+ displayName: 'Enabled',
779
+ name: 'agentEnabled',
780
+ type: 'boolean',
781
+ required: true,
782
+ default: true,
783
+ displayOptions: {
784
+ show: { resource: ['agent'], operation: ['toggle'] },
785
+ },
786
+ routing: {
787
+ send: { type: 'body', property: 'enabled' },
788
+ },
789
+ },
790
+ // Agent: Pause - Duration
791
+ {
792
+ displayName: 'Duration (Minutes)',
793
+ name: 'agentPauseDuration',
794
+ type: 'number',
795
+ required: true,
796
+ default: 30,
797
+ description: 'How long to pause AI globally',
798
+ displayOptions: {
799
+ show: { resource: ['agent'], operation: ['pause'] },
800
+ },
801
+ routing: {
802
+ send: { type: 'body', property: 'duration' },
803
+ },
804
+ },
805
+ // ===========================================
806
+ // TEMPLATE OPERATIONS
807
+ // ===========================================
808
+ {
809
+ displayName: 'Operation',
810
+ name: 'operation',
811
+ type: 'options',
812
+ noDataExpression: true,
813
+ displayOptions: {
814
+ show: { resource: ['template'] },
815
+ },
816
+ options: [
817
+ {
818
+ name: 'List',
819
+ value: 'list',
820
+ action: 'List templates',
821
+ description: 'Get all WhatsApp templates',
822
+ routing: {
823
+ request: {
824
+ method: 'GET',
825
+ url: '/templates/v1',
826
+ },
827
+ },
828
+ },
829
+ {
830
+ name: 'Get',
831
+ value: 'get',
832
+ action: 'Get a template',
833
+ description: 'Get a specific template',
834
+ routing: {
835
+ request: {
836
+ method: 'GET',
837
+ url: '=/templates/v1/{{$parameter.templateId}}',
838
+ },
839
+ },
840
+ },
841
+ {
842
+ name: 'Get Variables',
843
+ value: 'getVariables',
844
+ action: 'Get template variables',
845
+ description: 'Get available template variables',
846
+ routing: {
847
+ request: {
848
+ method: 'GET',
849
+ url: '/templates/v1/variables',
850
+ },
851
+ },
852
+ },
853
+ {
854
+ name: 'Sync',
855
+ value: 'sync',
856
+ action: 'Sync templates',
857
+ description: 'Sync templates from Meta',
858
+ routing: {
859
+ request: {
860
+ method: 'POST',
861
+ url: '/templates/v1/sync',
862
+ },
863
+ },
864
+ },
865
+ ],
866
+ default: 'list',
867
+ },
868
+ // Template: Get - ID
869
+ {
870
+ displayName: 'Template ID',
871
+ name: 'templateId',
872
+ type: 'string',
873
+ required: true,
874
+ default: '',
875
+ displayOptions: {
876
+ show: { resource: ['template'], operation: ['get'] },
877
+ },
878
+ },
879
+ // Template: List - Filters
880
+ {
881
+ displayName: 'Filters',
882
+ name: 'templateFilters',
883
+ type: 'collection',
884
+ placeholder: 'Add Filter',
885
+ default: {},
886
+ displayOptions: {
887
+ show: { resource: ['template'], operation: ['list'] },
888
+ },
889
+ options: [
890
+ {
891
+ displayName: 'Status',
892
+ name: 'status',
893
+ type: 'string',
894
+ default: '',
895
+ description: 'Filter by template status',
896
+ routing: {
897
+ send: { type: 'query', property: 'status' },
898
+ },
899
+ },
900
+ {
901
+ displayName: 'Limit',
902
+ name: 'limit',
903
+ type: 'number',
904
+ default: 20,
905
+ routing: {
906
+ send: { type: 'query', property: 'limit' },
907
+ },
908
+ },
909
+ {
910
+ displayName: 'Offset',
911
+ name: 'offset',
912
+ type: 'number',
913
+ default: 0,
914
+ routing: {
915
+ send: { type: 'query', property: 'offset' },
916
+ },
917
+ },
918
+ ],
919
+ },
920
+ // ===========================================
921
+ // CONTACT OPERATIONS
922
+ // ===========================================
923
+ {
924
+ displayName: 'Operation',
925
+ name: 'operation',
926
+ type: 'options',
927
+ noDataExpression: true,
928
+ displayOptions: {
929
+ show: { resource: ['contact'] },
930
+ },
931
+ options: [
932
+ {
933
+ name: 'List',
934
+ value: 'list',
935
+ action: 'List contacts',
936
+ description: 'Get all contacts',
937
+ routing: {
938
+ request: {
939
+ method: 'GET',
940
+ url: '/contacts/v1',
941
+ },
942
+ },
943
+ },
944
+ {
945
+ name: 'Get',
946
+ value: 'get',
947
+ action: 'Get a contact',
948
+ description: 'Get a specific contact',
949
+ routing: {
950
+ request: {
951
+ method: 'GET',
952
+ url: '=/contacts/v1/{{$parameter.contactId}}',
953
+ },
954
+ },
955
+ },
956
+ {
957
+ name: 'Create',
958
+ value: 'create',
959
+ action: 'Create a contact',
960
+ description: 'Create a new contact',
961
+ routing: {
962
+ request: {
963
+ method: 'POST',
964
+ url: '/contacts/v1',
965
+ },
966
+ },
967
+ },
968
+ {
969
+ name: 'Update',
970
+ value: 'update',
971
+ action: 'Update a contact',
972
+ description: 'Update an existing contact',
973
+ routing: {
974
+ request: {
975
+ method: 'PATCH',
976
+ url: '=/contacts/v1/{{$parameter.contactId}}',
977
+ },
978
+ },
979
+ },
980
+ {
981
+ name: 'Delete',
982
+ value: 'delete',
983
+ action: 'Delete a contact',
984
+ description: 'Delete a contact',
985
+ routing: {
986
+ request: {
987
+ method: 'DELETE',
988
+ url: '=/contacts/v1/{{$parameter.contactId}}',
989
+ },
990
+ },
991
+ },
992
+ {
993
+ name: 'Search',
994
+ value: 'search',
995
+ action: 'Search contacts',
996
+ description: 'Advanced search for contacts',
997
+ routing: {
998
+ request: {
999
+ method: 'POST',
1000
+ url: '/contacts/v1/search',
1001
+ },
1002
+ },
1003
+ },
1004
+ {
1005
+ name: 'Bulk',
1006
+ value: 'bulk',
1007
+ action: 'Bulk operations',
1008
+ description: 'Perform bulk operations on contacts',
1009
+ routing: {
1010
+ request: {
1011
+ method: 'POST',
1012
+ url: '/contacts/v1/bulk',
1013
+ },
1014
+ },
1015
+ },
1016
+ {
1017
+ name: 'Merge',
1018
+ value: 'merge',
1019
+ action: 'Merge contacts',
1020
+ description: 'Merge two contacts',
1021
+ routing: {
1022
+ request: {
1023
+ method: 'POST',
1024
+ url: '=/contacts/v1/{{$parameter.contactId}}/merge',
1025
+ },
1026
+ },
1027
+ },
1028
+ {
1029
+ name: 'Get Tags',
1030
+ value: 'getTags',
1031
+ action: 'Get all tags',
1032
+ description: 'Get all available tags',
1033
+ routing: {
1034
+ request: {
1035
+ method: 'GET',
1036
+ url: '/contacts/v1/tags',
1037
+ },
1038
+ },
1039
+ },
1040
+ {
1041
+ name: 'Get Fields',
1042
+ value: 'getFields',
1043
+ action: 'Get custom fields',
1044
+ description: 'Get available custom fields',
1045
+ routing: {
1046
+ request: {
1047
+ method: 'GET',
1048
+ url: '/contacts/v1/fields',
1049
+ },
1050
+ },
1051
+ },
1052
+ ],
1053
+ default: 'list',
1054
+ },
1055
+ // Contact: ID field
1056
+ {
1057
+ displayName: 'Contact ID',
1058
+ name: 'contactId',
1059
+ type: 'string',
1060
+ required: true,
1061
+ default: '',
1062
+ displayOptions: {
1063
+ show: {
1064
+ resource: ['contact'],
1065
+ operation: ['get', 'update', 'delete', 'merge'],
1066
+ },
1067
+ },
1068
+ },
1069
+ // Contact: Create - Fields
1070
+ {
1071
+ displayName: 'Name',
1072
+ name: 'contactName',
1073
+ type: 'string',
1074
+ required: true,
1075
+ default: '',
1076
+ displayOptions: {
1077
+ show: { resource: ['contact'], operation: ['create'] },
1078
+ },
1079
+ routing: {
1080
+ send: { type: 'body', property: 'name' },
1081
+ },
1082
+ },
1083
+ {
1084
+ displayName: 'Phone Number',
1085
+ name: 'contactPhone',
1086
+ type: 'string',
1087
+ required: true,
1088
+ default: '',
1089
+ placeholder: '+5215512345678',
1090
+ displayOptions: {
1091
+ show: { resource: ['contact'], operation: ['create'] },
1092
+ },
1093
+ routing: {
1094
+ send: { type: 'body', property: 'phoneNumber' },
1095
+ },
1096
+ },
1097
+ {
1098
+ displayName: 'Additional Fields',
1099
+ name: 'contactAdditional',
1100
+ type: 'collection',
1101
+ placeholder: 'Add Field',
1102
+ default: {},
1103
+ displayOptions: {
1104
+ show: { resource: ['contact'], operation: ['create'] },
1105
+ },
1106
+ options: [
1107
+ {
1108
+ displayName: 'Email',
1109
+ name: 'email',
1110
+ type: 'string',
1111
+ default: '',
1112
+ routing: {
1113
+ send: { type: 'body', property: 'email' },
1114
+ },
1115
+ },
1116
+ {
1117
+ displayName: 'Tags',
1118
+ name: 'tags',
1119
+ type: 'string',
1120
+ default: '',
1121
+ description: 'Comma-separated list of tags',
1122
+ routing: {
1123
+ send: { type: 'body', property: 'tags' },
1124
+ },
1125
+ },
1126
+ {
1127
+ displayName: 'Custom Fields',
1128
+ name: 'customFields',
1129
+ type: 'json',
1130
+ default: '{}',
1131
+ routing: {
1132
+ send: { type: 'body', property: 'customFields' },
1133
+ },
1134
+ },
1135
+ {
1136
+ displayName: 'Metadata',
1137
+ name: 'metadata',
1138
+ type: 'json',
1139
+ default: '{}',
1140
+ routing: {
1141
+ send: { type: 'body', property: 'metadata' },
1142
+ },
1143
+ },
1144
+ ],
1145
+ },
1146
+ // Contact: Update - Fields
1147
+ {
1148
+ displayName: 'Update Fields',
1149
+ name: 'contactUpdateFields',
1150
+ type: 'collection',
1151
+ placeholder: 'Add Field',
1152
+ default: {},
1153
+ displayOptions: {
1154
+ show: { resource: ['contact'], operation: ['update'] },
1155
+ },
1156
+ options: [
1157
+ {
1158
+ displayName: 'Name',
1159
+ name: 'name',
1160
+ type: 'string',
1161
+ default: '',
1162
+ routing: {
1163
+ send: { type: 'body', property: 'name' },
1164
+ },
1165
+ },
1166
+ {
1167
+ displayName: 'Phone Number',
1168
+ name: 'phoneNumber',
1169
+ type: 'string',
1170
+ default: '',
1171
+ routing: {
1172
+ send: { type: 'body', property: 'phoneNumber' },
1173
+ },
1174
+ },
1175
+ {
1176
+ displayName: 'Email',
1177
+ name: 'email',
1178
+ type: 'string',
1179
+ default: '',
1180
+ routing: {
1181
+ send: { type: 'body', property: 'email' },
1182
+ },
1183
+ },
1184
+ {
1185
+ displayName: 'Tags',
1186
+ name: 'tags',
1187
+ type: 'string',
1188
+ default: '',
1189
+ description: 'Comma-separated list of tags',
1190
+ routing: {
1191
+ send: { type: 'body', property: 'tags' },
1192
+ },
1193
+ },
1194
+ {
1195
+ displayName: 'Custom Fields',
1196
+ name: 'customFields',
1197
+ type: 'json',
1198
+ default: '{}',
1199
+ routing: {
1200
+ send: { type: 'body', property: 'customFields' },
1201
+ },
1202
+ },
1203
+ ],
1204
+ },
1205
+ // Contact: Search - Fields
1206
+ {
1207
+ displayName: 'Search Query',
1208
+ name: 'searchQuery',
1209
+ type: 'string',
1210
+ required: true,
1211
+ default: '',
1212
+ displayOptions: {
1213
+ show: { resource: ['contact'], operation: ['search'] },
1214
+ },
1215
+ routing: {
1216
+ send: { type: 'body', property: 'query' },
1217
+ },
1218
+ },
1219
+ {
1220
+ displayName: 'Search Options',
1221
+ name: 'searchOptions',
1222
+ type: 'collection',
1223
+ placeholder: 'Add Option',
1224
+ default: {},
1225
+ displayOptions: {
1226
+ show: { resource: ['contact'], operation: ['search'] },
1227
+ },
1228
+ options: [
1229
+ {
1230
+ displayName: 'Filters',
1231
+ name: 'filters',
1232
+ type: 'json',
1233
+ default: '{}',
1234
+ routing: {
1235
+ send: { type: 'body', property: 'filters' },
1236
+ },
1237
+ },
1238
+ {
1239
+ displayName: 'Limit',
1240
+ name: 'limit',
1241
+ type: 'number',
1242
+ default: 20,
1243
+ routing: {
1244
+ send: { type: 'body', property: 'limit' },
1245
+ },
1246
+ },
1247
+ {
1248
+ displayName: 'Cursor',
1249
+ name: 'cursor',
1250
+ type: 'string',
1251
+ default: '',
1252
+ routing: {
1253
+ send: { type: 'body', property: 'cursor' },
1254
+ },
1255
+ },
1256
+ ],
1257
+ },
1258
+ // Contact: Bulk - Fields
1259
+ {
1260
+ displayName: 'Bulk Operation',
1261
+ name: 'bulkOperation',
1262
+ type: 'options',
1263
+ required: true,
1264
+ options: [
1265
+ { name: 'Create', value: 'create' },
1266
+ { name: 'Update', value: 'update' },
1267
+ { name: 'Delete', value: 'delete' },
1268
+ { name: 'Tag', value: 'tag' },
1269
+ { name: 'Untag', value: 'untag' },
1270
+ ],
1271
+ default: 'create',
1272
+ displayOptions: {
1273
+ show: { resource: ['contact'], operation: ['bulk'] },
1274
+ },
1275
+ routing: {
1276
+ send: { type: 'body', property: 'operation' },
1277
+ },
1278
+ },
1279
+ {
1280
+ displayName: 'Contacts Data',
1281
+ name: 'bulkContacts',
1282
+ type: 'json',
1283
+ required: true,
1284
+ default: '[]',
1285
+ description: 'Array of contacts or contact IDs',
1286
+ displayOptions: {
1287
+ show: { resource: ['contact'], operation: ['bulk'] },
1288
+ },
1289
+ routing: {
1290
+ send: { type: 'body', property: 'contacts' },
1291
+ },
1292
+ },
1293
+ {
1294
+ displayName: 'Operation Data',
1295
+ name: 'bulkData',
1296
+ type: 'json',
1297
+ default: '{}',
1298
+ description: 'Additional data for the operation',
1299
+ displayOptions: {
1300
+ show: { resource: ['contact'], operation: ['bulk'] },
1301
+ },
1302
+ routing: {
1303
+ send: { type: 'body', property: 'data' },
1304
+ },
1305
+ },
1306
+ // Contact: Merge - Merge With ID
1307
+ {
1308
+ displayName: 'Merge With Contact ID',
1309
+ name: 'mergeWithId',
1310
+ type: 'string',
1311
+ required: true,
1312
+ default: '',
1313
+ description: 'ID of the contact to merge into the primary contact',
1314
+ displayOptions: {
1315
+ show: { resource: ['contact'], operation: ['merge'] },
1316
+ },
1317
+ routing: {
1318
+ send: { type: 'body', property: 'mergeWith' },
1319
+ },
1320
+ },
1321
+ // Contact: List - Filters
1322
+ {
1323
+ displayName: 'Filters',
1324
+ name: 'contactFilters',
1325
+ type: 'collection',
1326
+ placeholder: 'Add Filter',
1327
+ default: {},
1328
+ displayOptions: {
1329
+ show: { resource: ['contact'], operation: ['list'] },
1330
+ },
1331
+ options: [
1332
+ {
1333
+ displayName: 'Search',
1334
+ name: 'search',
1335
+ type: 'string',
1336
+ default: '',
1337
+ routing: {
1338
+ send: { type: 'query', property: 'search' },
1339
+ },
1340
+ },
1341
+ {
1342
+ displayName: 'Tags',
1343
+ name: 'tags',
1344
+ type: 'string',
1345
+ default: '',
1346
+ description: 'Comma-separated list of tags',
1347
+ routing: {
1348
+ send: { type: 'query', property: 'tags' },
1349
+ },
1350
+ },
1351
+ {
1352
+ displayName: 'Funnel Stage ID',
1353
+ name: 'funnelStageId',
1354
+ type: 'string',
1355
+ default: '',
1356
+ routing: {
1357
+ send: { type: 'query', property: 'funnel_stage_id' },
1358
+ },
1359
+ },
1360
+ {
1361
+ displayName: 'Source',
1362
+ name: 'source',
1363
+ type: 'string',
1364
+ default: '',
1365
+ routing: {
1366
+ send: { type: 'query', property: 'source' },
1367
+ },
1368
+ },
1369
+ {
1370
+ displayName: 'Sort By',
1371
+ name: 'sortBy',
1372
+ type: 'options',
1373
+ options: [
1374
+ { name: 'Created At', value: 'created_at' },
1375
+ { name: 'Updated At', value: 'updated_at' },
1376
+ { name: 'Name', value: 'name' },
1377
+ ],
1378
+ default: 'created_at',
1379
+ routing: {
1380
+ send: { type: 'query', property: 'sort_by' },
1381
+ },
1382
+ },
1383
+ {
1384
+ displayName: 'Sort Order',
1385
+ name: 'sortOrder',
1386
+ type: 'options',
1387
+ options: [
1388
+ { name: 'Ascending', value: 'asc' },
1389
+ { name: 'Descending', value: 'desc' },
1390
+ ],
1391
+ default: 'desc',
1392
+ routing: {
1393
+ send: { type: 'query', property: 'sort_order' },
1394
+ },
1395
+ },
1396
+ {
1397
+ displayName: 'Limit',
1398
+ name: 'limit',
1399
+ type: 'number',
1400
+ default: 20,
1401
+ routing: {
1402
+ send: { type: 'query', property: 'limit' },
1403
+ },
1404
+ },
1405
+ {
1406
+ displayName: 'Cursor',
1407
+ name: 'cursor',
1408
+ type: 'string',
1409
+ default: '',
1410
+ routing: {
1411
+ send: { type: 'query', property: 'cursor' },
1412
+ },
1413
+ },
1414
+ ],
1415
+ },
1416
+ // ===========================================
1417
+ // FUNNEL OPERATIONS
1418
+ // ===========================================
1419
+ {
1420
+ displayName: 'Operation',
1421
+ name: 'operation',
1422
+ type: 'options',
1423
+ noDataExpression: true,
1424
+ displayOptions: {
1425
+ show: { resource: ['funnel'] },
1426
+ },
1427
+ options: [
1428
+ {
1429
+ name: 'List Stages',
1430
+ value: 'listStages',
1431
+ action: 'List funnel stages',
1432
+ description: 'Get all funnel stages',
1433
+ routing: {
1434
+ request: {
1435
+ method: 'GET',
1436
+ url: '/funnel/v1/stages',
1437
+ },
1438
+ },
1439
+ },
1440
+ {
1441
+ name: 'Get Stage',
1442
+ value: 'getStage',
1443
+ action: 'Get a funnel stage',
1444
+ description: 'Get a specific funnel stage',
1445
+ routing: {
1446
+ request: {
1447
+ method: 'GET',
1448
+ url: '=/funnel/v1/stages/{{$parameter.stageId}}',
1449
+ },
1450
+ },
1451
+ },
1452
+ {
1453
+ name: 'Create Stage',
1454
+ value: 'createStage',
1455
+ action: 'Create a funnel stage',
1456
+ description: 'Create a new funnel stage',
1457
+ routing: {
1458
+ request: {
1459
+ method: 'POST',
1460
+ url: '/funnel/v1/stages',
1461
+ },
1462
+ },
1463
+ },
1464
+ {
1465
+ name: 'Update Stage',
1466
+ value: 'updateStage',
1467
+ action: 'Update a funnel stage',
1468
+ description: 'Update an existing funnel stage',
1469
+ routing: {
1470
+ request: {
1471
+ method: 'PATCH',
1472
+ url: '=/funnel/v1/stages/{{$parameter.stageId}}',
1473
+ },
1474
+ },
1475
+ },
1476
+ {
1477
+ name: 'Delete Stage',
1478
+ value: 'deleteStage',
1479
+ action: 'Delete a funnel stage',
1480
+ description: 'Delete a funnel stage',
1481
+ routing: {
1482
+ request: {
1483
+ method: 'DELETE',
1484
+ url: '=/funnel/v1/stages/{{$parameter.stageId}}',
1485
+ },
1486
+ },
1487
+ },
1488
+ {
1489
+ name: 'Reorder Stages',
1490
+ value: 'reorderStages',
1491
+ action: 'Reorder funnel stages',
1492
+ description: 'Reorder the funnel stages',
1493
+ routing: {
1494
+ request: {
1495
+ method: 'PATCH',
1496
+ url: '/funnel/v1/stages/reorder',
1497
+ },
1498
+ },
1499
+ },
1500
+ {
1501
+ name: 'Move Contact',
1502
+ value: 'moveContact',
1503
+ action: 'Move contact to stage',
1504
+ description: 'Move a contact to a funnel stage',
1505
+ routing: {
1506
+ request: {
1507
+ method: 'POST',
1508
+ url: '=/funnel/v1/contacts/{{$parameter.contactIdFunnel}}/move',
1509
+ },
1510
+ },
1511
+ },
1512
+ ],
1513
+ default: 'listStages',
1514
+ },
1515
+ // Funnel: Stage ID
1516
+ {
1517
+ displayName: 'Stage ID',
1518
+ name: 'stageId',
1519
+ type: 'string',
1520
+ required: true,
1521
+ default: '',
1522
+ displayOptions: {
1523
+ show: {
1524
+ resource: ['funnel'],
1525
+ operation: ['getStage', 'updateStage', 'deleteStage'],
1526
+ },
1527
+ },
1528
+ },
1529
+ // Funnel: Create Stage - Fields
1530
+ {
1531
+ displayName: 'Stage Name',
1532
+ name: 'stageName',
1533
+ type: 'string',
1534
+ required: true,
1535
+ default: '',
1536
+ displayOptions: {
1537
+ show: { resource: ['funnel'], operation: ['createStage'] },
1538
+ },
1539
+ routing: {
1540
+ send: { type: 'body', property: 'name' },
1541
+ },
1542
+ },
1543
+ {
1544
+ displayName: 'Stage Options',
1545
+ name: 'stageOptions',
1546
+ type: 'collection',
1547
+ placeholder: 'Add Option',
1548
+ default: {},
1549
+ displayOptions: {
1550
+ show: { resource: ['funnel'], operation: ['createStage'] },
1551
+ },
1552
+ options: [
1553
+ {
1554
+ displayName: 'Position',
1555
+ name: 'position',
1556
+ type: 'number',
1557
+ default: 0,
1558
+ routing: {
1559
+ send: { type: 'body', property: 'position' },
1560
+ },
1561
+ },
1562
+ {
1563
+ displayName: 'Color',
1564
+ name: 'color',
1565
+ type: 'string',
1566
+ default: '#3B82F6',
1567
+ description: 'Hex color code',
1568
+ routing: {
1569
+ send: { type: 'body', property: 'color' },
1570
+ },
1571
+ },
1572
+ {
1573
+ displayName: 'Description',
1574
+ name: 'description',
1575
+ type: 'string',
1576
+ default: '',
1577
+ routing: {
1578
+ send: { type: 'body', property: 'description' },
1579
+ },
1580
+ },
1581
+ ],
1582
+ },
1583
+ // Funnel: Update Stage - Fields
1584
+ {
1585
+ displayName: 'Update Fields',
1586
+ name: 'stageUpdateFields',
1587
+ type: 'collection',
1588
+ placeholder: 'Add Field',
1589
+ default: {},
1590
+ displayOptions: {
1591
+ show: { resource: ['funnel'], operation: ['updateStage'] },
1592
+ },
1593
+ options: [
1594
+ {
1595
+ displayName: 'Name',
1596
+ name: 'name',
1597
+ type: 'string',
1598
+ default: '',
1599
+ routing: {
1600
+ send: { type: 'body', property: 'name' },
1601
+ },
1602
+ },
1603
+ {
1604
+ displayName: 'Position',
1605
+ name: 'position',
1606
+ type: 'number',
1607
+ default: 0,
1608
+ routing: {
1609
+ send: { type: 'body', property: 'position' },
1610
+ },
1611
+ },
1612
+ {
1613
+ displayName: 'Color',
1614
+ name: 'color',
1615
+ type: 'string',
1616
+ default: '',
1617
+ routing: {
1618
+ send: { type: 'body', property: 'color' },
1619
+ },
1620
+ },
1621
+ {
1622
+ displayName: 'Description',
1623
+ name: 'description',
1624
+ type: 'string',
1625
+ default: '',
1626
+ routing: {
1627
+ send: { type: 'body', property: 'description' },
1628
+ },
1629
+ },
1630
+ ],
1631
+ },
1632
+ // Funnel: Reorder Stages
1633
+ {
1634
+ displayName: 'Stages Order',
1635
+ name: 'stagesOrder',
1636
+ type: 'json',
1637
+ required: true,
1638
+ default: '[]',
1639
+ description: 'Array of objects with id and position',
1640
+ displayOptions: {
1641
+ show: { resource: ['funnel'], operation: ['reorderStages'] },
1642
+ },
1643
+ routing: {
1644
+ send: { type: 'body', property: 'stages' },
1645
+ },
1646
+ },
1647
+ // Funnel: Move Contact - Fields
1648
+ {
1649
+ displayName: 'Contact ID',
1650
+ name: 'contactIdFunnel',
1651
+ type: 'string',
1652
+ required: true,
1653
+ default: '',
1654
+ displayOptions: {
1655
+ show: { resource: ['funnel'], operation: ['moveContact'] },
1656
+ },
1657
+ },
1658
+ {
1659
+ displayName: 'Target Stage ID',
1660
+ name: 'targetStageId',
1661
+ type: 'string',
1662
+ required: true,
1663
+ default: '',
1664
+ displayOptions: {
1665
+ show: { resource: ['funnel'], operation: ['moveContact'] },
1666
+ },
1667
+ routing: {
1668
+ send: { type: 'body', property: 'stageId' },
1669
+ },
1670
+ },
1671
+ // Funnel: List Stages - Filters
1672
+ {
1673
+ displayName: 'Options',
1674
+ name: 'stageListOptions',
1675
+ type: 'collection',
1676
+ placeholder: 'Add Option',
1677
+ default: {},
1678
+ displayOptions: {
1679
+ show: { resource: ['funnel'], operation: ['listStages'] },
1680
+ },
1681
+ options: [
1682
+ {
1683
+ displayName: 'Limit',
1684
+ name: 'limit',
1685
+ type: 'number',
1686
+ default: 20,
1687
+ routing: {
1688
+ send: { type: 'query', property: 'limit' },
1689
+ },
1690
+ },
1691
+ {
1692
+ displayName: 'Offset',
1693
+ name: 'offset',
1694
+ type: 'number',
1695
+ default: 0,
1696
+ routing: {
1697
+ send: { type: 'query', property: 'offset' },
1698
+ },
1699
+ },
1700
+ ],
1701
+ },
1702
+ ],
1703
+ };
1704
+ }
1705
+ }
1706
+ exports.Whaapy = Whaapy;