@periskope/types 0.6.146 → 0.6.147

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,923 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionNameMap = exports.RuleNameMap = exports.isSendMessageAction = exports.FilterConditionMap = exports.ReactionVariableNameMap = exports.TicketVariableNameMap = exports.ChatVariableNameMap = exports.SenderVariableNameMap = exports.MessageVariableNameMap = exports.FilterNameMap = exports.isFilter = void 0;
4
+ const isFilter = (filter) => {
5
+ return (typeof filter === 'object' &&
6
+ 'id' in filter &&
7
+ 'condition' in filter &&
8
+ 'variable' in filter &&
9
+ 'value' in filter);
10
+ };
11
+ exports.isFilter = isFilter;
12
+ exports.FilterNameMap = {
13
+ CONTAINS: {
14
+ name: 'contains',
15
+ input: true,
16
+ },
17
+ NCONTAINS: {
18
+ name: 'does not contain',
19
+ input: true,
20
+ },
21
+ EQ: {
22
+ name: 'equals to',
23
+ input: true,
24
+ },
25
+ NEQ: {
26
+ name: 'not equals to',
27
+ input: true,
28
+ },
29
+ LT: {
30
+ name: 'less than',
31
+ input: true,
32
+ },
33
+ LTE: {
34
+ name: 'less than or equals to',
35
+ input: true,
36
+ },
37
+ GT: {
38
+ name: 'greater than',
39
+ input: true,
40
+ },
41
+ GTE: {
42
+ name: 'greater than or equals to',
43
+ input: true,
44
+ },
45
+ KNOWN: {
46
+ name: 'is known',
47
+ input: false,
48
+ },
49
+ NKNOWN: {
50
+ name: 'is not known',
51
+ input: false,
52
+ },
53
+ IS: {
54
+ name: 'is',
55
+ input: true,
56
+ },
57
+ NIS: {
58
+ name: 'is not',
59
+ input: true,
60
+ },
61
+ };
62
+ exports.MessageVariableNameMap = {
63
+ 'message.body': {
64
+ text: 'Message Body',
65
+ type: 'string',
66
+ filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
67
+ placeholder: 'e.g. Test message',
68
+ },
69
+ 'message.sender_phone': {
70
+ text: 'Message Sender Phone',
71
+ type: 'string',
72
+ filters: ['EQ', 'NEQ'],
73
+ placeholder: 'e.g. 919876543210@c.us',
74
+ },
75
+ 'message.timestamp': {
76
+ text: 'Message Timestamp',
77
+ type: 'day-time',
78
+ filters: ['LT', 'LTE', 'GT', 'GTE', 'IS'],
79
+ },
80
+ 'message.flag_status': {
81
+ text: 'Message Flag Status',
82
+ filters: ['IS'],
83
+ type: 'boolean',
84
+ },
85
+ 'message.has_quoted_msg': {
86
+ text: 'Quoted Message',
87
+ filters: ['IS'],
88
+ type: 'boolean',
89
+ },
90
+ 'message.media': {
91
+ text: 'Message Media',
92
+ type: 'boolean',
93
+ filters: ['KNOWN', 'NKNOWN'],
94
+ },
95
+ 'message.performed_by': {
96
+ text: 'Message Performed By',
97
+ type: 'dropdown',
98
+ value: 'org.members',
99
+ filters: ['EQ', 'NEQ'],
100
+ },
101
+ 'message.chat_id': {
102
+ text: 'Chat ID',
103
+ type: 'string',
104
+ filters: ['EQ', 'NEQ'],
105
+ hidden: true,
106
+ },
107
+ 'message.message_id': {
108
+ text: 'Message ID',
109
+ type: 'string',
110
+ filters: ['EQ', 'NEQ'],
111
+ hidden: true,
112
+ },
113
+ 'message.org_phone': {
114
+ text: 'Org Phone',
115
+ type: 'string',
116
+ filters: ['EQ', 'NEQ'],
117
+ hidden: true,
118
+ },
119
+ 'message.org_id': {
120
+ text: 'Org ID',
121
+ type: 'string',
122
+ filters: ['EQ', 'NEQ'],
123
+ hidden: true,
124
+ },
125
+ 'message.message_type': {
126
+ text: 'Message Type',
127
+ type: 'dropdown',
128
+ value: [
129
+ { id: 'text', value: 'text', label: 'Text' },
130
+ { id: 'image', value: 'image', label: 'Image' },
131
+ { id: 'video', value: 'video', label: 'Video' },
132
+ { id: 'audio', value: 'audio', label: 'Audio' },
133
+ { id: 'document', value: 'document', label: 'Document' },
134
+ ],
135
+ filters: ['EQ', 'NEQ'],
136
+ },
137
+ 'message.author': {
138
+ text: 'Message Author',
139
+ type: 'string',
140
+ filters: ['EQ', 'NEQ'],
141
+ hidden: true,
142
+ },
143
+ 'message.ack': {
144
+ text: 'Message acknowledment status',
145
+ type: 'dropdown',
146
+ value: [
147
+ { id: '0', value: '0', label: '0' },
148
+ { id: '1', value: '1', label: '1' },
149
+ { id: '2', value: '2', label: '2' },
150
+ { id: '3', value: '3', label: '3' },
151
+ ],
152
+ filters: ['EQ'],
153
+ },
154
+ };
155
+ exports.SenderVariableNameMap = {
156
+ 'sender.is_business': {
157
+ text: 'Sender is business',
158
+ type: 'boolean',
159
+ filters: ['IS'],
160
+ },
161
+ 'sender.is_enterprise': {
162
+ text: 'Sender is enterprise',
163
+ type: 'boolean',
164
+ filters: ['IS'],
165
+ },
166
+ 'sender.is_internal': {
167
+ text: 'Sender is internal',
168
+ type: 'boolean',
169
+ filters: ['IS'],
170
+ },
171
+ 'sender.contact_name': {
172
+ text: 'Sender Name',
173
+ type: 'string',
174
+ filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
175
+ placeholder: 'e.g. John Doe',
176
+ },
177
+ 'sender.contact_id': {
178
+ text: 'Sender Contact Phone',
179
+ type: 'string',
180
+ filters: ['EQ', 'NEQ'],
181
+ placeholder: 'e.g. 919876543210@c.us'
182
+ },
183
+ 'sender.labels': {
184
+ text: 'Sender Labels',
185
+ type: 'dropdown',
186
+ value: 'org.labels',
187
+ filters: ['EQ', 'NEQ'],
188
+ },
189
+ 'sender.org_id': {
190
+ text: 'Org ID',
191
+ type: 'string',
192
+ filters: ['EQ', 'NEQ'],
193
+ hidden: true,
194
+ },
195
+ 'sender.is_super_admin': {
196
+ text: 'Sender is super admin',
197
+ type: 'dropdown',
198
+ filters: ['EQ', 'NEQ'],
199
+ value: [
200
+ {
201
+ id: 'true',
202
+ value: 'true',
203
+ label: 'True',
204
+ },
205
+ {
206
+ id: 'false',
207
+ value: 'false',
208
+ label: 'False',
209
+ },
210
+ ],
211
+ },
212
+ 'sender.is_admin': {
213
+ text: 'Sender is admin',
214
+ type: 'dropdown',
215
+ filters: ['EQ', 'NEQ'],
216
+ value: [
217
+ {
218
+ id: 'true',
219
+ value: 'true',
220
+ label: 'True',
221
+ },
222
+ {
223
+ id: 'false',
224
+ value: 'false',
225
+ label: 'False',
226
+ },
227
+ ],
228
+ },
229
+ };
230
+ exports.ChatVariableNameMap = {
231
+ 'chat.assigned_to': {
232
+ text: 'Chat Assignee',
233
+ type: 'dropdown',
234
+ value: 'org.members',
235
+ filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
236
+ },
237
+ 'chat.chat_name': {
238
+ text: 'Chat Name',
239
+ type: 'string',
240
+ filters: ['EQ', 'NEQ'],
241
+ placeholder: 'e.g. Support Chat',
242
+ },
243
+ 'chat.org_phone': {
244
+ text: 'Chat Org Phone',
245
+ type: 'dropdown',
246
+ value: 'org.org_phones',
247
+ filters: ['EQ', 'NEQ'],
248
+ },
249
+ 'chat.chat_type': {
250
+ text: 'Chat Type',
251
+ type: 'dropdown',
252
+ value: [
253
+ { id: 'user', value: 'user', label: 'User' },
254
+ { id: 'group', value: 'group', label: 'Group' },
255
+ ],
256
+ filters: ['EQ', 'NEQ'],
257
+ },
258
+ 'chat.members': {
259
+ text: 'Chat Members',
260
+ type: 'string',
261
+ filters: ['CONTAINS', 'NCONTAINS'],
262
+ placeholder: 'e.g. 919876543210'
263
+ },
264
+ 'chat.labels': {
265
+ text: 'Chat Labels',
266
+ type: 'dropdown',
267
+ value: 'org.labels',
268
+ filters: ['CONTAINS', 'NCONTAINS'],
269
+ },
270
+ 'chat.chat_id': {
271
+ text: 'Chat ID',
272
+ type: 'string',
273
+ filters: ['EQ', 'NEQ'],
274
+ placeholder: 'e.g. 12027747916749@c.us'
275
+ },
276
+ 'chat.chat_org_phones': {
277
+ text: 'Chat Org Phones',
278
+ type: 'dropdown',
279
+ filters: ['CONTAINS', 'NCONTAINS'],
280
+ hidden: true,
281
+ },
282
+ 'chat.org_id': {
283
+ text: 'Org ID',
284
+ type: 'string',
285
+ filters: [],
286
+ hidden: true,
287
+ },
288
+ 'chat.messages_admins_only': {
289
+ text: 'Chat Messages Admins Only',
290
+ type: 'boolean',
291
+ filters: ['EQ', 'NEQ'],
292
+ value: [
293
+ {
294
+ id: 'true',
295
+ value: 'true',
296
+ label: 'True',
297
+ },
298
+ {
299
+ id: 'false',
300
+ value: 'false',
301
+ label: 'False',
302
+ },
303
+ ],
304
+ },
305
+ 'chat.is_muted': {
306
+ text: 'Chat is muted',
307
+ type: 'boolean',
308
+ filters: ['EQ', 'NEQ'],
309
+ value: [
310
+ {
311
+ id: 'true',
312
+ value: 'true',
313
+ label: 'True',
314
+ },
315
+ {
316
+ id: 'false',
317
+ value: 'false',
318
+ label: 'False',
319
+ },
320
+ ],
321
+ },
322
+ 'chat.is_exited': {
323
+ text: 'Chat is exited',
324
+ type: 'boolean',
325
+ filters: ['EQ', 'NEQ'],
326
+ value: [
327
+ {
328
+ id: 'true',
329
+ value: 'true',
330
+ label: 'True',
331
+ },
332
+ {
333
+ id: 'false',
334
+ value: 'false',
335
+ label: 'False',
336
+ },
337
+ ],
338
+ },
339
+ // 'chat.is_archived': {
340
+ // text: 'Chat is archived',
341
+ // type: 'boolean',
342
+ // filters: ['EQ', 'NEQ'],
343
+ // value: [
344
+ // {
345
+ // id: 'true',
346
+ // value: 'true',
347
+ // label: 'True',
348
+ // },
349
+ // {
350
+ // id: 'false',
351
+ // value: 'false',
352
+ // label: 'False',
353
+ // },
354
+ // ],
355
+ // },
356
+ 'chat.info_admins_only': {
357
+ text: 'Chat Info Admins Only',
358
+ type: 'boolean',
359
+ filters: ['EQ', 'NEQ'],
360
+ value: [
361
+ {
362
+ id: 'true',
363
+ value: 'true',
364
+ label: 'True',
365
+ },
366
+ {
367
+ id: 'false',
368
+ value: 'false',
369
+ label: 'False',
370
+ },
371
+ ],
372
+ },
373
+ 'chat.has_flagged_messages': {
374
+ text: 'Chat has flagged messages',
375
+ type: 'boolean',
376
+ filters: ['EQ', 'NEQ'],
377
+ value: [
378
+ {
379
+ id: 'true',
380
+ value: 'true',
381
+ label: 'True',
382
+ },
383
+ {
384
+ id: 'false',
385
+ value: 'false',
386
+ label: 'False',
387
+ },
388
+ ],
389
+ },
390
+ 'chat.group_description': {
391
+ text: 'Group Description',
392
+ type: 'string',
393
+ filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
394
+ placeholder: 'e.g. Group description',
395
+ },
396
+ 'chat.custom_properties': {
397
+ text: 'Chat Custom Properties',
398
+ type: 'dropdown',
399
+ value: 'org.custom_properties',
400
+ filters: ['EQ', 'NEQ'],
401
+ hidden: true,
402
+ },
403
+ 'chat.created_at': {
404
+ text: 'Chat Created At',
405
+ type: 'day-time',
406
+ filters: ['LT', 'LTE', 'GT', 'GTE', 'IS'],
407
+ },
408
+ };
409
+ exports.TicketVariableNameMap = {
410
+ 'ticket.subject': {
411
+ text: 'Ticket Subject',
412
+ type: 'string',
413
+ filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
414
+ placeholder: 'e.g. Test ticket',
415
+ },
416
+ 'ticket.status': {
417
+ text: 'Ticket Status',
418
+ type: 'dropdown',
419
+ value: [
420
+ { id: 'open', value: 'open', label: 'Open' },
421
+ { id: 'closed', value: 'closed', label: 'Closed' },
422
+ { id: 'inprogress', value: 'inprogress', label: 'In progress' },
423
+ ],
424
+ filters: ['EQ', 'NEQ'],
425
+ },
426
+ 'ticket.priority': {
427
+ text: 'Ticket Priority',
428
+ type: 'dropdown',
429
+ value: [
430
+ { id: '0', value: '0', label: 'No Prioriy' },
431
+ { id: '1', value: '1', label: 'Low' },
432
+ { id: '2', value: '2', label: 'Medium' },
433
+ { id: '3', value: '3', label: 'High' },
434
+ { id: '4', value: '4', label: 'Urgent' },
435
+ ],
436
+ filters: ['EQ', 'NEQ'],
437
+ },
438
+ 'ticket.assignee': {
439
+ text: 'Ticket Assignee',
440
+ type: 'dropdown',
441
+ value: 'org.members',
442
+ filters: ['EQ', 'NEQ', "KNOWN", "NKNOWN"],
443
+ },
444
+ 'ticket.labels': {
445
+ text: 'Ticket Labels',
446
+ type: 'dropdown',
447
+ value: 'org.labels',
448
+ filters: ['EQ', 'NEQ'],
449
+ },
450
+ 'ticket.is_deleted': {
451
+ text: 'Ticket is deleted',
452
+ type: 'boolean',
453
+ filters: ['IS'],
454
+ },
455
+ 'ticket.raised_by': {
456
+ text: 'Ticket Raised By',
457
+ type: 'dropdown',
458
+ value: 'org.members',
459
+ filters: ['EQ', 'NEQ'],
460
+ },
461
+ 'ticket.due_date': {
462
+ text: 'Ticket Due Date',
463
+ type: 'string',
464
+ filters: ['KNOWN', 'NKNOWN'],
465
+ },
466
+ 'ticket.ticket_id': {
467
+ text: 'Ticket ID',
468
+ type: 'string',
469
+ filters: ['EQ', 'NEQ'],
470
+ hidden: true,
471
+ },
472
+ 'ticket.org_id': {
473
+ text: 'Org ID',
474
+ type: 'string',
475
+ filters: ['EQ', 'NEQ'],
476
+ hidden: true,
477
+ },
478
+ 'ticket.custom_properties': {
479
+ text: 'Ticket Custom Properties',
480
+ type: 'dropdown',
481
+ value: 'org.custom_properties',
482
+ filters: ['EQ', 'NEQ'],
483
+ hidden: true,
484
+ },
485
+ 'ticket.created_at': {
486
+ text: 'Ticket Created At',
487
+ type: 'day-time',
488
+ filters: ['LT', 'LTE', 'GT', 'GTE'],
489
+ },
490
+ 'ticket.chat_id': {
491
+ text: 'Chat ID',
492
+ type: 'string',
493
+ filters: ['EQ', 'NEQ'],
494
+ hidden: true,
495
+ },
496
+ };
497
+ exports.ReactionVariableNameMap = {
498
+ 'reaction.reaction': {
499
+ text: 'Reaction',
500
+ type: 'string',
501
+ filters: ['EQ', 'NEQ'],
502
+ placeholder: 'e.g. 👍',
503
+ },
504
+ 'reaction.sender_id': {
505
+ text: 'Reaction Sender Phone',
506
+ type: 'string',
507
+ filters: ['EQ', 'NEQ'],
508
+ placeholder: 'e.g. 919876543210@c.us'
509
+ },
510
+ 'reaction.message_id': {
511
+ text: 'Reaction Message ID',
512
+ type: 'string',
513
+ filters: ['EQ', 'NEQ'],
514
+ hidden: true,
515
+ },
516
+ 'reaction.chat_id': {
517
+ text: 'Chat ID',
518
+ type: 'string',
519
+ filters: ['EQ', 'NEQ'],
520
+ hidden: true,
521
+ },
522
+ 'reaction.reaction_id': {
523
+ text: 'Reaction ID',
524
+ type: 'string',
525
+ filters: ['EQ', 'NEQ'],
526
+ hidden: true,
527
+ },
528
+ };
529
+ var FilterConditionMap;
530
+ (function (FilterConditionMap) {
531
+ FilterConditionMap["CONTAINS"] = "contains";
532
+ FilterConditionMap["NCONTAINS"] = "does not contain";
533
+ FilterConditionMap["EQ"] = "=";
534
+ FilterConditionMap["NEQ"] = "<>";
535
+ FilterConditionMap["LT"] = "<";
536
+ FilterConditionMap["LTE"] = "<=";
537
+ FilterConditionMap["GT"] = ">";
538
+ FilterConditionMap["GTE"] = ">=";
539
+ FilterConditionMap["KNOWN"] = "is known";
540
+ FilterConditionMap["NKNOWN"] = "is not known";
541
+ FilterConditionMap["IS"] = "=";
542
+ FilterConditionMap["NIS"] = "<>";
543
+ })(FilterConditionMap || (exports.FilterConditionMap = FilterConditionMap = {}));
544
+ const isSendMessageAction = (action) => {
545
+ return action.type === 'send_message';
546
+ };
547
+ exports.isSendMessageAction = isSendMessageAction;
548
+ exports.RuleNameMap = {
549
+ 'message.created': {
550
+ title: 'New Message Received',
551
+ description: 'When a new message is sent or received',
552
+ base_conditions: {
553
+ org_phone: true,
554
+ },
555
+ },
556
+ 'chat.created': {
557
+ title: 'New Chat Created',
558
+ description: 'When a new chat is created',
559
+ base_conditions: {
560
+ org_phone: true,
561
+ },
562
+ },
563
+ 'ticket.created': {
564
+ title: 'New Ticket Created',
565
+ description: 'When a new ticket is created',
566
+ base_conditions: {
567
+ org_phone: false,
568
+ },
569
+ },
570
+ 'reaction.added': {
571
+ title: 'New Reaction Added',
572
+ description: 'When a reaction is added on a message',
573
+ base_conditions: {
574
+ org_phone: true,
575
+ },
576
+ },
577
+ 'message.updated': {
578
+ title: 'Message Updated',
579
+ description: 'When a message is updated',
580
+ base_conditions: {
581
+ org_phone: true,
582
+ },
583
+ },
584
+ 'ticket.updated': {
585
+ title: 'Ticket Updated',
586
+ description: 'When a ticket is updated',
587
+ base_conditions: {
588
+ org_phone: false,
589
+ },
590
+ },
591
+ 'chat.label.updated': {
592
+ title: 'Chat Label Added/Removed',
593
+ description: 'When labels on chats are updated',
594
+ base_conditions: {
595
+ org_phone: false,
596
+ },
597
+ },
598
+ 'message.flagged': {
599
+ title: 'Message Flagged',
600
+ description: 'When a message is flagged',
601
+ base_conditions: {
602
+ org_phone: true,
603
+ },
604
+ },
605
+ };
606
+ exports.ActionNameMap = {
607
+ send_message: {
608
+ title: 'Send Message',
609
+ description: 'Send a message',
610
+ inputs: {
611
+ message: {
612
+ id: 'message',
613
+ type: 'editor',
614
+ label: 'Message',
615
+ placeholder: 'Enter message',
616
+ value: null,
617
+ },
618
+ media: {
619
+ id: 'media',
620
+ type: 'file',
621
+ label: 'Media',
622
+ placeholder: 'Upload media',
623
+ value: null,
624
+ },
625
+ },
626
+ validTriggers: [
627
+ 'message.created',
628
+ 'message.updated',
629
+ 'chat.created',
630
+ 'ticket.updated',
631
+ 'ticket.created',
632
+ 'reaction.added',
633
+ 'message.flagged',
634
+ 'chat.label.updated'
635
+ ],
636
+ },
637
+ reply_to_message: {
638
+ title: 'Reply to message',
639
+ description: 'Send a message with the quoted message',
640
+ inputs: {
641
+ message: {
642
+ id: 'message',
643
+ type: 'editor',
644
+ label: 'Message',
645
+ placeholder: 'Enter message',
646
+ value: null,
647
+ },
648
+ media: {
649
+ id: 'media',
650
+ type: 'file',
651
+ label: 'Media',
652
+ placeholder: 'Upload media',
653
+ value: null,
654
+ },
655
+ },
656
+ validTriggers: [
657
+ 'message.created',
658
+ 'message.updated',
659
+ 'reaction.added',
660
+ 'message.flagged',
661
+ ],
662
+ },
663
+ notify_http: {
664
+ title: 'Notify HTTP',
665
+ description: 'Notify an HTTP endpoint',
666
+ inputs: {
667
+ url: {
668
+ id: 'url',
669
+ type: 'text',
670
+ label: 'URL',
671
+ placeholder: 'Enter URL',
672
+ value: null,
673
+ },
674
+ },
675
+ validTriggers: [
676
+ 'message.created',
677
+ 'message.updated',
678
+ 'chat.created',
679
+ 'ticket.updated',
680
+ 'ticket.created',
681
+ 'reaction.added',
682
+ 'message.flagged',
683
+ 'chat.label.updated'
684
+ ],
685
+ },
686
+ create_ticket: {
687
+ title: 'Create Ticket',
688
+ description: 'Create a ticket',
689
+ inputs: {
690
+ assignee: {
691
+ id: 'assignee',
692
+ type: 'dropdown',
693
+ value: 'org.members',
694
+ label: 'Assignee',
695
+ placeholder: 'Select assignee',
696
+ },
697
+ priority: {
698
+ id: 'priority',
699
+ type: 'dropdown',
700
+ value: [
701
+ { id: '0', value: '0', label: 'Low' },
702
+ { id: '1', value: '1', label: 'Medium' },
703
+ { id: '2', value: '2', label: 'High' },
704
+ { id: '3', value: '3', label: 'Urgent' },
705
+ { id: '4', value: '4', label: 'Immediate' },
706
+ ],
707
+ label: 'Priority',
708
+ placeholder: 'Select priority',
709
+ },
710
+ label: {
711
+ id: 'label',
712
+ type: 'dropdown',
713
+ value: 'ticket.labels',
714
+ label: 'Label',
715
+ placeholder: 'Select label',
716
+ },
717
+ },
718
+ validTriggers: [
719
+ 'message.created',
720
+ 'message.updated',
721
+ 'reaction.added',
722
+ 'message.flagged',
723
+ ],
724
+ },
725
+ flag_message: {
726
+ title: 'Update flag status',
727
+ description: 'Flag/Unflag a message',
728
+ inputs: {
729
+ flag: {
730
+ id: 'flag',
731
+ type: 'dropdown',
732
+ value: [
733
+ { id: 'flag', value: 'true', label: 'TRUE' },
734
+ { id: 'unflag', value: 'false', label: 'FALSE' },
735
+ ],
736
+ label: 'Flag status',
737
+ placeholder: 'Select flag',
738
+ },
739
+ },
740
+ validTriggers: ['message.created', 'message.updated', 'reaction.added'],
741
+ },
742
+ assign_ticket: {
743
+ title: 'Assign Ticket',
744
+ description: 'Assign a ticket',
745
+ inputs: {
746
+ email: {
747
+ id: 'email',
748
+ type: 'dropdown',
749
+ value: 'org.members',
750
+ label: 'Assignee',
751
+ placeholder: 'Select assignee',
752
+ },
753
+ },
754
+ validTriggers: ['ticket.updated', 'ticket.created'],
755
+ },
756
+ close_ticket: {
757
+ title: 'Close Ticket',
758
+ description: 'Close a ticket',
759
+ inputs: {
760
+ closing_note: {
761
+ id: 'closing_note',
762
+ type: 'textarea',
763
+ label: 'Closing Note',
764
+ placeholder: 'Enter closing note',
765
+ value: null,
766
+ },
767
+ },
768
+ validTriggers: ['ticket.updated', 'ticket.created'],
769
+ },
770
+ add_chat_label: {
771
+ title: 'Add Chat Label',
772
+ description: 'Add a label to referred chat',
773
+ inputs: {
774
+ label: {
775
+ id: 'label',
776
+ type: 'dropdown',
777
+ value: 'chat.labels',
778
+ label: 'Label',
779
+ placeholder: 'Select label',
780
+ },
781
+ },
782
+ validTriggers: [
783
+ 'message.created',
784
+ 'message.updated',
785
+ 'chat.created',
786
+ 'ticket.updated',
787
+ 'ticket.created',
788
+ 'reaction.added',
789
+ 'chat.label.updated'
790
+ ],
791
+ },
792
+ add_ticket_label: {
793
+ title: 'Add Ticket Label',
794
+ description: 'Add a label to referred ticket',
795
+ inputs: {
796
+ label: {
797
+ id: 'label',
798
+ type: 'dropdown',
799
+ value: 'ticket.labels',
800
+ label: 'Label',
801
+ placeholder: 'Select label',
802
+ },
803
+ },
804
+ validTriggers: ['ticket.updated', 'ticket.created'],
805
+ },
806
+ update_custom_property: {
807
+ description: 'Update a custom property',
808
+ title: 'Update Chat Custom Property',
809
+ validTriggers: [
810
+ 'message.created',
811
+ 'message.updated',
812
+ 'chat.created',
813
+ 'ticket.updated',
814
+ 'ticket.created',
815
+ 'reaction.added',
816
+ 'message.flagged',
817
+ ],
818
+ inputs: {
819
+ property_id: {
820
+ id: 'property_id',
821
+ type: 'dropdown',
822
+ value: 'org.custom_properties',
823
+ label: 'Property',
824
+ placeholder: 'Select property',
825
+ },
826
+ value: {
827
+ id: 'property_id',
828
+ type: 'dynamic',
829
+ label: 'Value',
830
+ placeholder: 'Enter value',
831
+ value: 'custom_property_values',
832
+ },
833
+ },
834
+ },
835
+ assign_chat: {
836
+ title: 'Assign Chat',
837
+ description: 'Assign a chat',
838
+ inputs: {
839
+ email: {
840
+ id: 'email',
841
+ type: 'dropdown',
842
+ value: 'org.members',
843
+ label: 'Assignee',
844
+ placeholder: 'Select assignee',
845
+ },
846
+ },
847
+ validTriggers: [
848
+ 'message.created',
849
+ 'message.updated',
850
+ 'chat.created',
851
+ 'ticket.updated',
852
+ 'ticket.created',
853
+ 'reaction.added',
854
+ 'chat.label.updated'
855
+ ],
856
+ },
857
+ forward_message: {
858
+ title: 'Forward Message',
859
+ description: 'Forward a message',
860
+ inputs: {
861
+ chat_id: {
862
+ id: 'chat_id',
863
+ type: 'dropdown',
864
+ value: 'org.chats',
865
+ label: 'Chat',
866
+ placeholder: 'Select chat',
867
+ },
868
+ // prefix: {
869
+ // id: 'prefix',
870
+ // type: 'editor',
871
+ // label: 'Prefix',
872
+ // placeholder: 'Enter prefix',
873
+ // value: null,
874
+ // },
875
+ },
876
+ validTriggers: [
877
+ 'message.created',
878
+ 'message.updated',
879
+ 'chat.created',
880
+ 'ticket.updated',
881
+ 'ticket.created',
882
+ 'reaction.added',
883
+ 'message.flagged',
884
+ ],
885
+ },
886
+ send_email: {
887
+ title: 'Send Email',
888
+ description: 'Send an email',
889
+ inputs: {
890
+ email: {
891
+ id: 'email',
892
+ type: 'text',
893
+ label: 'Email',
894
+ placeholder: 'Enter email',
895
+ value: null,
896
+ },
897
+ subject: {
898
+ id: 'subject',
899
+ type: 'text',
900
+ label: 'Subject',
901
+ placeholder: 'Enter subject',
902
+ value: null,
903
+ },
904
+ body: {
905
+ id: 'body',
906
+ type: 'editor',
907
+ label: 'Body',
908
+ placeholder: 'Enter body',
909
+ value: null,
910
+ },
911
+ },
912
+ validTriggers: [
913
+ 'message.created',
914
+ 'message.updated',
915
+ 'chat.created',
916
+ 'ticket.updated',
917
+ 'ticket.created',
918
+ 'reaction.added',
919
+ 'message.flagged',
920
+ 'chat.label.updated'
921
+ ],
922
+ },
923
+ };