@periskope/types 0.6.147 → 0.6.149

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.
package/rules.types.ts CHANGED
@@ -113,7 +113,7 @@ export interface Filter {
113
113
  | 'NIS'; // Add other condition types as needed
114
114
  variable: string;
115
115
  value: string | string[];
116
- variable_type?: 'string' | 'date'; // Optional, like 'Date'
116
+ variable_type?: 'string' | 'number' | 'boolean' | 'day-time' | 'date' | 'day'; // Optional, like 'Date'
117
117
  }
118
118
 
119
119
  export const isFilter = (filter: any): filter is Filter => {
@@ -185,12 +185,20 @@ export const FilterNameMap: Record<
185
185
 
186
186
  export type VariableNameValueType = {
187
187
  text: string;
188
- type: 'string' | 'time' | 'boolean' | 'dropdown' | 'day-time' | 'number';
188
+ type:
189
+ | 'string'
190
+ | 'time'
191
+ | 'boolean'
192
+ | 'dropdown'
193
+ | 'day-time'
194
+ | 'number'
195
+ | 'date';
196
+ variable_type: 'string' | 'number' | 'boolean' | 'day-time' | 'date';
189
197
  value?:
190
198
  | string
191
199
  | {
192
200
  id: string;
193
- value: string;
201
+ value: string | number | boolean;
194
202
  label: string;
195
203
  }[]
196
204
  | null;
@@ -208,63 +216,73 @@ export const MessageVariableNameMap: Record<
208
216
  type: 'string',
209
217
  filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
210
218
  placeholder: 'e.g. Test message',
219
+ variable_type: 'string',
211
220
  },
212
221
  'message.sender_phone': {
213
222
  text: 'Message Sender Phone',
214
223
  type: 'string',
215
224
  filters: ['EQ', 'NEQ'],
216
- placeholder: 'e.g. 919876543210@c.us',
225
+ placeholder: 'e.g. 919876543210',
226
+ variable_type: 'string',
217
227
  },
218
228
  'message.timestamp': {
219
229
  text: 'Message Timestamp',
220
230
  type: 'day-time',
221
231
  filters: ['LT', 'LTE', 'GT', 'GTE', 'IS'],
232
+ variable_type: 'day-time',
222
233
  },
223
234
  'message.flag_status': {
224
235
  text: 'Message Flag Status',
225
236
  filters: ['IS'],
226
237
  type: 'boolean',
227
-
238
+ variable_type: 'boolean',
228
239
  },
229
240
  'message.has_quoted_msg': {
230
241
  text: 'Quoted Message',
231
242
  filters: ['IS'],
232
243
  type: 'boolean',
244
+ variable_type: 'boolean',
233
245
  },
234
246
  'message.media': {
235
247
  text: 'Message Media',
236
248
  type: 'boolean',
237
249
  filters: ['KNOWN', 'NKNOWN'],
250
+ variable_type: 'boolean',
238
251
  },
239
252
  'message.performed_by': {
240
253
  text: 'Message Performed By',
241
254
  type: 'dropdown',
242
255
  value: 'org.members',
243
256
  filters: ['EQ', 'NEQ'],
257
+ variable_type: 'string',
244
258
  },
245
259
  'message.chat_id': {
246
260
  text: 'Chat ID',
247
261
  type: 'string',
248
262
  filters: ['EQ', 'NEQ'],
249
263
  hidden: true,
264
+ variable_type: 'string',
250
265
  },
251
266
  'message.message_id': {
252
267
  text: 'Message ID',
253
268
  type: 'string',
254
269
  filters: ['EQ', 'NEQ'],
255
270
  hidden: true,
271
+ variable_type: 'string',
256
272
  },
257
273
  'message.org_phone': {
258
274
  text: 'Org Phone',
259
275
  type: 'string',
260
276
  filters: ['EQ', 'NEQ'],
261
277
  hidden: true,
278
+ variable_type: 'string',
262
279
  },
263
280
  'message.org_id': {
264
281
  text: 'Org ID',
265
282
  type: 'string',
266
283
  filters: ['EQ', 'NEQ'],
267
284
  hidden: true,
285
+ variable_type: 'string',
268
286
  },
269
287
  'message.message_type': {
270
288
  text: 'Message Type',
@@ -277,23 +295,26 @@ export const MessageVariableNameMap: Record<
277
295
  { id: 'document', value: 'document', label: 'Document' },
278
296
  ],
279
297
  filters: ['EQ', 'NEQ'],
298
+ variable_type: 'string',
280
299
  },
281
300
  'message.author': {
282
301
  text: 'Message Author',
283
302
  type: 'string',
284
303
  filters: ['EQ', 'NEQ'],
285
304
  hidden: true,
305
+ variable_type: 'string',
286
306
  },
287
307
  'message.ack': {
288
308
  text: 'Message acknowledment status',
289
309
  type: 'dropdown',
290
310
  value: [
291
- { id: '0', value: '0', label: '0' },
292
- { id: '1', value: '1', label: '1' },
293
- { id: '2', value: '2', label: '2' },
294
- { id: '3', value: '3', label: '3' },
311
+ { id: '0', value: 0, label: '0' },
312
+ { id: '1', value: 1, label: '1' },
313
+ { id: '2', value: 2, label: '2' },
314
+ { id: '3', value: 3, label: '3' },
295
315
  ],
296
316
  filters: ['EQ'],
317
+ variable_type: 'number',
297
318
  },
298
319
  };
299
320
 
@@ -305,40 +326,47 @@ export const SenderVariableNameMap: Record<
305
326
  text: 'Sender is business',
306
327
  type: 'boolean',
307
328
  filters: ['IS'],
329
+ variable_type: 'boolean',
308
330
  },
309
331
  'sender.is_enterprise': {
310
332
  text: 'Sender is enterprise',
311
333
  type: 'boolean',
312
334
  filters: ['IS'],
335
+ variable_type: 'boolean',
313
336
  },
314
337
  'sender.is_internal': {
315
338
  text: 'Sender is internal',
316
339
  type: 'boolean',
317
340
  filters: ['IS'],
341
+ variable_type: 'boolean',
318
342
  },
319
343
  'sender.contact_name': {
320
344
  text: 'Sender Name',
321
345
  type: 'string',
322
346
  filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
323
347
  placeholder: 'e.g. John Doe',
348
+ variable_type: 'string',
324
349
  },
325
350
  'sender.contact_id': {
326
351
  text: 'Sender Contact Phone',
327
352
  type: 'string',
328
353
  filters: ['EQ', 'NEQ'],
329
- placeholder: 'e.g. 919876543210@c.us'
354
+ placeholder: 'e.g. 919876543210',
355
+ variable_type: 'string',
330
356
  },
331
357
  'sender.labels': {
332
358
  text: 'Sender Labels',
333
359
  type: 'dropdown',
334
360
  value: 'org.labels',
335
361
  filters: ['EQ', 'NEQ'],
362
+ variable_type: 'string',
336
363
  },
337
364
  'sender.org_id': {
338
365
  text: 'Org ID',
339
366
  type: 'string',
340
367
  filters: ['EQ', 'NEQ'],
341
368
  hidden: true,
369
+ variable_type: 'string',
342
370
  },
343
371
  'sender.is_super_admin': {
344
372
  text: 'Sender is super admin',
@@ -347,15 +375,16 @@ export const SenderVariableNameMap: Record<
347
375
  value: [
348
376
  {
349
377
  id: 'true',
350
- value: 'true',
378
+ value: true,
351
379
  label: 'True',
352
380
  },
353
381
  {
354
382
  id: 'false',
355
- value: 'false',
383
+ value: false,
356
384
  label: 'False',
357
385
  },
358
386
  ],
387
+ variable_type: 'boolean',
359
388
  },
360
389
  'sender.is_admin': {
361
390
  text: 'Sender is admin',
@@ -364,15 +393,16 @@ export const SenderVariableNameMap: Record<
364
393
  value: [
365
394
  {
366
395
  id: 'true',
367
- value: 'true',
396
+ value: true,
368
397
  label: 'True',
369
398
  },
370
399
  {
371
400
  id: 'false',
372
- value: 'false',
401
+ value: false,
373
402
  label: 'False',
374
403
  },
375
404
  ],
405
+ variable_type: 'boolean',
376
406
  },
377
407
  };
378
408
 
@@ -385,18 +415,21 @@ export const ChatVariableNameMap: Record<
385
415
  type: 'dropdown',
386
416
  value: 'org.members',
387
417
  filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
418
+ variable_type: 'string',
388
419
  },
389
420
  'chat.chat_name': {
390
421
  text: 'Chat Name',
391
422
  type: 'string',
392
- filters: ['EQ', 'NEQ'],
423
+ filters: ['EQ', 'NEQ', 'CONTAINS', 'NCONTAINS'],
393
424
  placeholder: 'e.g. Support Chat',
425
+ variable_type: 'string',
394
426
  },
395
427
  'chat.org_phone': {
396
428
  text: 'Chat Org Phone',
397
429
  type: 'dropdown',
398
430
  value: 'org.org_phones',
399
431
  filters: ['EQ', 'NEQ'],
432
+ variable_type: 'string',
400
433
  },
401
434
  'chat.chat_type': {
402
435
  text: 'Chat Type',
@@ -406,36 +439,42 @@ export const ChatVariableNameMap: Record<
406
439
  { id: 'group', value: 'group', label: 'Group' },
407
440
  ],
408
441
  filters: ['EQ', 'NEQ'],
442
+ variable_type: 'string',
409
443
  },
410
444
  'chat.members': {
411
445
  text: 'Chat Members',
412
446
  type: 'string',
413
447
  filters: ['CONTAINS', 'NCONTAINS'],
414
- placeholder: 'e.g. 919876543210'
448
+ placeholder: 'e.g. 919876543210',
449
+ variable_type: 'string',
415
450
  },
416
451
  'chat.labels': {
417
452
  text: 'Chat Labels',
418
453
  type: 'dropdown',
419
454
  value: 'org.labels',
420
455
  filters: ['CONTAINS', 'NCONTAINS'],
456
+ variable_type: 'string',
421
457
  },
422
458
  'chat.chat_id': {
423
459
  text: 'Chat ID',
424
460
  type: 'string',
425
461
  filters: ['EQ', 'NEQ'],
426
- placeholder: 'e.g. 12027747916749@c.us'
462
+ placeholder: 'e.g. 12027747916749@c.us',
463
+ variable_type: 'string',
427
464
  },
428
465
  'chat.chat_org_phones': {
429
466
  text: 'Chat Org Phones',
430
467
  type: 'dropdown',
431
468
  filters: ['CONTAINS', 'NCONTAINS'],
432
469
  hidden: true,
470
+ variable_type: 'string',
433
471
  },
434
472
  'chat.org_id': {
435
473
  text: 'Org ID',
436
474
  type: 'string',
437
475
  filters: [],
438
476
  hidden: true,
477
+ variable_type: 'string',
439
478
  },
440
479
  'chat.messages_admins_only': {
441
480
  text: 'Chat Messages Admins Only',
@@ -444,15 +483,16 @@ export const ChatVariableNameMap: Record<
444
483
  value: [
445
484
  {
446
485
  id: 'true',
447
- value: 'true',
486
+ value: true,
448
487
  label: 'True',
449
488
  },
450
489
  {
451
490
  id: 'false',
452
- value: 'false',
491
+ value: false,
453
492
  label: 'False',
454
493
  },
455
494
  ],
495
+ variable_type: 'boolean',
456
496
  },
457
497
  'chat.is_muted': {
458
498
  text: 'Chat is muted',
@@ -461,15 +501,16 @@ export const ChatVariableNameMap: Record<
461
501
  value: [
462
502
  {
463
503
  id: 'true',
464
- value: 'true',
504
+ value: true,
465
505
  label: 'True',
466
506
  },
467
507
  {
468
508
  id: 'false',
469
- value: 'false',
509
+ value: false,
470
510
  label: 'False',
471
511
  },
472
512
  ],
513
+ variable_type: 'boolean',
473
514
  },
474
515
  'chat.is_exited': {
475
516
  text: 'Chat is exited',
@@ -478,33 +519,17 @@ export const ChatVariableNameMap: Record<
478
519
  value: [
479
520
  {
480
521
  id: 'true',
481
- value: 'true',
522
+ value: true,
482
523
  label: 'True',
483
524
  },
484
525
  {
485
526
  id: 'false',
486
- value: 'false',
527
+ value: false,
487
528
  label: 'False',
488
529
  },
489
530
  ],
531
+ variable_type: 'boolean',
490
532
  },
491
- // 'chat.is_archived': {
492
- // text: 'Chat is archived',
493
- // type: 'boolean',
494
- // filters: ['EQ', 'NEQ'],
495
- // value: [
496
- // {
497
- // id: 'true',
498
- // value: 'true',
499
- // label: 'True',
500
- // },
501
- // {
502
- // id: 'false',
503
- // value: 'false',
504
- // label: 'False',
505
- // },
506
- // ],
507
- // },
508
533
  'chat.info_admins_only': {
509
534
  text: 'Chat Info Admins Only',
510
535
  type: 'boolean',
@@ -512,15 +537,16 @@ export const ChatVariableNameMap: Record<
512
537
  value: [
513
538
  {
514
539
  id: 'true',
515
- value: 'true',
540
+ value: true,
516
541
  label: 'True',
517
542
  },
518
543
  {
519
544
  id: 'false',
520
- value: 'false',
545
+ value: false,
521
546
  label: 'False',
522
547
  },
523
548
  ],
549
+ variable_type: 'boolean',
524
550
  },
525
551
  'chat.has_flagged_messages': {
526
552
  text: 'Chat has flagged messages',
@@ -529,21 +555,23 @@ export const ChatVariableNameMap: Record<
529
555
  value: [
530
556
  {
531
557
  id: 'true',
532
- value: 'true',
558
+ value: true,
533
559
  label: 'True',
534
560
  },
535
561
  {
536
562
  id: 'false',
537
- value: 'false',
563
+ value: false,
538
564
  label: 'False',
539
565
  },
540
566
  ],
567
+ variable_type: 'boolean',
541
568
  },
542
569
  'chat.group_description': {
543
570
  text: 'Group Description',
544
571
  type: 'string',
545
572
  filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
546
573
  placeholder: 'e.g. Group description',
574
+ variable_type: 'string',
547
575
  },
548
576
  'chat.custom_properties': {
549
577
  text: 'Chat Custom Properties',
@@ -551,11 +579,13 @@ export const ChatVariableNameMap: Record<
551
579
  value: 'org.custom_properties',
552
580
  filters: ['EQ', 'NEQ'],
553
581
  hidden: true,
582
+ variable_type: 'string',
554
583
  },
555
584
  'chat.created_at': {
556
585
  text: 'Chat Created At',
557
586
  type: 'day-time',
558
587
  filters: ['LT', 'LTE', 'GT', 'GTE', 'IS'],
588
+ variable_type: 'day-time',
559
589
  },
560
590
  };
561
591
 
@@ -568,6 +598,7 @@ export const TicketVariableNameMap: Record<
568
598
  type: 'string',
569
599
  filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
570
600
  placeholder: 'e.g. Test ticket',
601
+ variable_type: 'string',
571
602
  },
572
603
  'ticket.status': {
573
604
  text: 'Ticket Status',
@@ -578,58 +609,80 @@ export const TicketVariableNameMap: Record<
578
609
  { id: 'inprogress', value: 'inprogress', label: 'In progress' },
579
610
  ],
580
611
  filters: ['EQ', 'NEQ'],
612
+ variable_type: 'string',
581
613
  },
582
614
  'ticket.priority': {
583
615
  text: 'Ticket Priority',
584
616
  type: 'dropdown',
585
617
  value: [
586
- { id: '0', value: '0', label: 'No Prioriy' },
587
- { id: '1', value: '1', label: 'Low' },
588
- { id: '2', value: '2', label: 'Medium' },
589
- { id: '3', value: '3', label: 'High' },
590
- { id: '4', value: '4', label: 'Urgent' },
618
+ { id: '0', value: 0, label: 'No Prioriy' },
619
+ { id: '1', value: 1, label: 'Low' },
620
+ { id: '2', value: 2, label: 'Medium' },
621
+ { id: '3', value: 3, label: 'High' },
622
+ { id: '4', value: 4, label: 'Urgent' },
591
623
  ],
592
624
  filters: ['EQ', 'NEQ'],
625
+ variable_type: 'number',
593
626
  },
594
627
  'ticket.assignee': {
595
628
  text: 'Ticket Assignee',
596
629
  type: 'dropdown',
597
630
  value: 'org.members',
598
- filters: ['EQ', 'NEQ', "KNOWN", "NKNOWN"],
631
+ filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
632
+ variable_type: 'string',
599
633
  },
600
634
  'ticket.labels': {
601
635
  text: 'Ticket Labels',
602
636
  type: 'dropdown',
603
637
  value: 'org.labels',
604
638
  filters: ['EQ', 'NEQ'],
639
+ variable_type: 'string',
605
640
  },
606
641
  'ticket.is_deleted': {
607
642
  text: 'Ticket is deleted',
608
643
  type: 'boolean',
644
+ value: [
645
+ {
646
+ id: 'true',
647
+ value: true,
648
+ label: 'True',
649
+ },
650
+ {
651
+ id: 'false',
652
+ value: false,
653
+ label: 'False',
654
+ },
655
+ ],
609
656
  filters: ['IS'],
657
+ variable_type: 'boolean',
610
658
  },
611
659
  'ticket.raised_by': {
612
660
  text: 'Ticket Raised By',
613
661
  type: 'dropdown',
614
662
  value: 'org.members',
615
663
  filters: ['EQ', 'NEQ'],
664
+ variable_type: 'string',
616
665
  },
617
666
  'ticket.due_date': {
618
667
  text: 'Ticket Due Date',
619
- type: 'string',
668
+ type: 'date',
620
669
  filters: ['KNOWN', 'NKNOWN'],
670
+ variable_type: 'date',
671
+ hidden: true,
621
672
  },
622
673
  'ticket.ticket_id': {
623
674
  text: 'Ticket ID',
624
675
  type: 'string',
625
676
  filters: ['EQ', 'NEQ'],
626
677
  hidden: true,
678
+ variable_type: 'string',
627
679
  },
628
680
  'ticket.org_id': {
629
681
  text: 'Org ID',
630
682
  type: 'string',
631
683
  filters: ['EQ', 'NEQ'],
632
684
  hidden: true,
685
+ variable_type: 'string',
633
686
  },
634
687
  'ticket.custom_properties': {
635
688
  text: 'Ticket Custom Properties',
@@ -637,17 +690,20 @@ export const TicketVariableNameMap: Record<
637
690
  value: 'org.custom_properties',
638
691
  filters: ['EQ', 'NEQ'],
639
692
  hidden: true,
693
+ variable_type: 'string',
640
694
  },
641
695
  'ticket.created_at': {
642
696
  text: 'Ticket Created At',
643
697
  type: 'day-time',
644
698
  filters: ['LT', 'LTE', 'GT', 'GTE'],
699
+ variable_type: 'day-time',
645
700
  },
646
701
  'ticket.chat_id': {
647
702
  text: 'Chat ID',
648
703
  type: 'string',
649
704
  filters: ['EQ', 'NEQ'],
650
705
  hidden: true,
706
+ variable_type: 'string',
651
707
  },
652
708
  };
653
709
 
@@ -660,30 +716,35 @@ export const ReactionVariableNameMap: Record<
660
716
  type: 'string',
661
717
  filters: ['EQ', 'NEQ'],
662
718
  placeholder: 'e.g. 👍',
719
+ variable_type: 'string',
663
720
  },
664
721
  'reaction.sender_id': {
665
722
  text: 'Reaction Sender Phone',
666
723
  type: 'string',
667
724
  filters: ['EQ', 'NEQ'],
668
- placeholder: 'e.g. 919876543210@c.us'
725
+ placeholder: 'e.g. 919876543210',
726
+ variable_type: 'string',
669
727
  },
670
728
  'reaction.message_id': {
671
729
  text: 'Reaction Message ID',
672
730
  type: 'string',
673
731
  filters: ['EQ', 'NEQ'],
674
732
  hidden: true,
733
+ variable_type: 'string',
675
734
  },
676
735
  'reaction.chat_id': {
677
736
  text: 'Chat ID',
678
737
  type: 'string',
679
738
  filters: ['EQ', 'NEQ'],
680
739
  hidden: true,
740
+ variable_type: 'string',
681
741
  },
682
742
  'reaction.reaction_id': {
683
743
  text: 'Reaction ID',
684
744
  type: 'string',
685
745
  filters: ['EQ', 'NEQ'],
686
746
  hidden: true,
747
+ variable_type: 'string',
687
748
  },
688
749
  };
689
750
 
@@ -725,6 +786,7 @@ export type SendMessageAction = {
725
786
  type: 'image' | 'video' | 'audio' | 'document';
726
787
  name: string;
727
788
  };
789
+ maintain_flag_status: 'true' | 'false';
728
790
  };
729
791
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
730
792
  };
@@ -744,7 +806,7 @@ export type CreateTicketAction = {
744
806
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
745
807
  metadata: {
746
808
  assignee?: string;
747
- priority?: 0 | 1 | 2 | 3 | 4;
809
+ priority?: '0' | '1' | '2' | '3' | '4';
748
810
  label?: string;
749
811
  };
750
812
  };
@@ -753,7 +815,9 @@ export type FlagMessageAction = {
753
815
  id: string;
754
816
  type: 'flag_message';
755
817
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
756
- metadata: {};
818
+ metadata: {
819
+ flag: 'true' | 'false';
820
+ };
757
821
  };
758
822
 
759
823
  export type AssignTicketAction = {
@@ -761,7 +825,8 @@ export type AssignTicketAction = {
761
825
  type: 'assign_ticket';
762
826
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
763
827
  metadata: {
764
- email: string;
828
+ assignee: string;
829
+ round_robin: 'true' | 'false';
765
830
  };
766
831
  };
767
832
 
@@ -797,7 +862,8 @@ export type AssignChatAction = {
797
862
  type: 'assign_chat';
798
863
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
799
864
  metadata: {
800
- email: string;
865
+ assignee: string;
866
+ round_robin: 'true' | 'false';
801
867
  };
802
868
  };
803
869
 
@@ -833,6 +899,7 @@ export type ReplyToMessageAction = {
833
899
  type: 'image' | 'video' | 'audio' | 'document';
834
900
  name: string;
835
901
  };
902
+ maintain_flag_status: boolean;
836
903
  };
837
904
  };
838
905
 
@@ -984,6 +1051,7 @@ export const ActionNameMap: Record<
984
1051
  | 'custom_property_values';
985
1052
  label: string;
986
1053
  placeholder: string;
1054
+ info?: string;
987
1055
  }
988
1056
  >;
989
1057
  validTriggers: Rule['trigger'][];
@@ -1007,6 +1075,16 @@ export const ActionNameMap: Record<
1007
1075
  placeholder: 'Upload media',
1008
1076
  value: null,
1009
1077
  },
1078
+ maintain_flag_status: {
1079
+ id: 'maintain_flag_status',
1080
+ type: 'dropdown',
1081
+ label: 'Maintain Flag Status',
1082
+ placeholder: 'Select...',
1083
+ value: [
1084
+ { id: 'true', value: 'true', label: 'True' },
1085
+ { id: 'false', value: 'false', label: 'False' },
1086
+ ],
1087
+ },
1010
1088
  },
1011
1089
  validTriggers: [
1012
1090
  'message.created',
@@ -1016,7 +1094,7 @@ export const ActionNameMap: Record<
1016
1094
  'ticket.created',
1017
1095
  'reaction.added',
1018
1096
  'message.flagged',
1019
- 'chat.label.updated'
1097
+ 'chat.label.updated',
1020
1098
  ],
1021
1099
  },
1022
1100
  reply_to_message: {
@@ -1037,6 +1115,16 @@ export const ActionNameMap: Record<
1037
1115
  placeholder: 'Upload media',
1038
1116
  value: null,
1039
1117
  },
1118
+ maintain_flag_status: {
1119
+ id: 'maintain_flag_status',
1120
+ type: 'dropdown',
1121
+ label: 'Maintain Flag Status',
1122
+ placeholder: 'Select...',
1123
+ value: [
1124
+ { id: 'true', value: 'true', label: 'True' },
1125
+ { id: 'false', value: 'false', label: 'False' },
1126
+ ],
1127
+ },
1040
1128
  },
1041
1129
  validTriggers: [
1042
1130
  'message.created',
@@ -1065,7 +1153,7 @@ export const ActionNameMap: Record<
1065
1153
  'ticket.created',
1066
1154
  'reaction.added',
1067
1155
  'message.flagged',
1068
- 'chat.label.updated'
1156
+ 'chat.label.updated',
1069
1157
  ],
1070
1158
  },
1071
1159
  create_ticket: {
@@ -1083,11 +1171,11 @@ export const ActionNameMap: Record<
1083
1171
  id: 'priority',
1084
1172
  type: 'dropdown',
1085
1173
  value: [
1086
- { id: '0', value: '0', label: 'Low' },
1087
- { id: '1', value: '1', label: 'Medium' },
1088
- { id: '2', value: '2', label: 'High' },
1089
- { id: '3', value: '3', label: 'Urgent' },
1090
- { id: '4', value: '4', label: 'Immediate' },
1174
+ { id: '0', value: '0', label: 'No Prioriy' },
1175
+ { id: '1', value: '1', label: 'Low' },
1176
+ { id: '2', value: '2', label: 'Medium' },
1177
+ { id: '3', value: '3', label: 'High' },
1178
+ { id: '4', value: '4', label: 'Urgent' },
1091
1179
  ],
1092
1180
  label: 'Priority',
1093
1181
  placeholder: 'Select priority',
@@ -1128,12 +1216,24 @@ export const ActionNameMap: Record<
1128
1216
  title: 'Assign Ticket',
1129
1217
  description: 'Assign a ticket',
1130
1218
  inputs: {
1131
- email: {
1132
- id: 'email',
1219
+ round_robin: {
1220
+ id: 'round_robin',
1133
1221
  type: 'dropdown',
1222
+ value: [
1223
+ { id: 'true', value: 'true', label: 'True' },
1224
+ { id: 'false', value: 'false', label: 'False' },
1225
+ ],
1226
+ label: 'Enable Round Robin',
1227
+ placeholder: 'Select...',
1228
+ info: 'If enabled, the ticket will be assigned to the next available agent in the list',
1229
+ },
1230
+ assignee: {
1231
+ id: 'email',
1232
+ type: 'dynamic',
1134
1233
  value: 'org.members',
1135
1234
  label: 'Assignee',
1136
1235
  placeholder: 'Select assignee',
1236
+ info: "If round robin is enabled, the ticket will be assigned to the next available agent in the list else it'll be assigned to the selected agent",
1137
1237
  },
1138
1238
  },
1139
1239
  validTriggers: ['ticket.updated', 'ticket.created'],
@@ -1171,7 +1271,7 @@ export const ActionNameMap: Record<
1171
1271
  'ticket.updated',
1172
1272
  'ticket.created',
1173
1273
  'reaction.added',
1174
- 'chat.label.updated'
1274
+ 'chat.label.updated',
1175
1275
  ],
1176
1276
  },
1177
1277
  add_ticket_label: {
@@ -1189,7 +1289,7 @@ export const ActionNameMap: Record<
1189
1289
  validTriggers: ['ticket.updated', 'ticket.created'],
1190
1290
  },
1191
1291
  update_custom_property: {
1192
- description: 'Update a custom property',
1292
+ description: 'Update a chat custom property',
1193
1293
  title: 'Update Chat Custom Property',
1194
1294
  validTriggers: [
1195
1295
  'message.created',
@@ -1221,9 +1321,20 @@ export const ActionNameMap: Record<
1221
1321
  title: 'Assign Chat',
1222
1322
  description: 'Assign a chat',
1223
1323
  inputs: {
1224
- email: {
1225
- id: 'email',
1324
+ round_robin: {
1325
+ id: 'round_robin',
1226
1326
  type: 'dropdown',
1327
+ value: [
1328
+ { id: 'true', value: 'true', label: 'True' },
1329
+ { id: 'false', value: 'false', label: 'False' },
1330
+ ],
1331
+ label: 'Enable Round Robin',
1332
+ placeholder: 'Select...',
1333
+ info: 'If enabled, the chat will be assigned to the next available agent in the list',
1334
+ },
1335
+ assignee: {
1336
+ id: 'assignee',
1337
+ type: 'dynamic',
1227
1338
  value: 'org.members',
1228
1339
  label: 'Assignee',
1229
1340
  placeholder: 'Select assignee',
@@ -1236,7 +1347,7 @@ export const ActionNameMap: Record<
1236
1347
  'ticket.updated',
1237
1348
  'ticket.created',
1238
1349
  'reaction.added',
1239
- 'chat.label.updated'
1350
+ 'chat.label.updated',
1240
1351
  ],
1241
1352
  },
1242
1353
  forward_message: {
@@ -1302,7 +1413,51 @@ export const ActionNameMap: Record<
1302
1413
  'ticket.created',
1303
1414
  'reaction.added',
1304
1415
  'message.flagged',
1305
- 'chat.label.updated'
1416
+ 'chat.label.updated',
1306
1417
  ],
1307
1418
  },
1308
1419
  };
1420
+
1421
+ export const editorVariables: Array<{
1422
+ label: string;
1423
+ value: string;
1424
+ validTriggers: Rule['trigger'][];
1425
+ }> = [
1426
+ {
1427
+ label: 'Message Body',
1428
+ value: 'message.body',
1429
+ validTriggers: [
1430
+ 'message.created',
1431
+ 'message.updated',
1432
+ 'reaction.added',
1433
+ 'message.flagged',
1434
+ ],
1435
+ },
1436
+ {
1437
+ label: 'Sender Name',
1438
+ value: 'sender.contact_name',
1439
+ validTriggers: [
1440
+ 'message.created',
1441
+ 'message.updated',
1442
+ 'reaction.added',
1443
+ 'message.flagged',
1444
+ ],
1445
+ },
1446
+ {
1447
+ label: 'Chat Name',
1448
+ value: 'chat.chat_name',
1449
+ validTriggers: [
1450
+ 'message.created',
1451
+ 'message.updated',
1452
+ 'reaction.added',
1453
+ 'message.flagged',
1454
+ 'chat.created',
1455
+ 'chat.label.updated',
1456
+ ],
1457
+ },
1458
+ {
1459
+ label: 'Ticket ID',
1460
+ value: 'ticket.ticket_id',
1461
+ validTriggers: ['ticket.updated', 'ticket.created'],
1462
+ },
1463
+ ];