@periskope/types 0.6.309 → 0.6.310
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/dist/rules.types.d.ts +47 -19
- package/dist/rules.types.d.ts.map +1 -1
- package/dist/rules.types.js +51 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/mod_json_type.ps1 +108 -108
- package/mod_json_type.sh +22 -22
- package/package.json +19 -19
- package/src/index.ts +4 -4
- package/src/object.types.ts +100 -100
- package/src/rules.types.ts +2304 -2210
- package/src/supabase.types.ts +3538 -3538
- package/src/types.ts +1511 -1510
- package/src/workflows.types.ts +955 -955
- package/tsconfig.json +37 -37
- package/tsconfig.tsbuildinfo +1 -1
- package/update_package.ps1 +21 -21
package/src/rules.types.ts
CHANGED
|
@@ -1,2210 +1,2304 @@
|
|
|
1
|
-
import { Merge, OverrideProperties } from 'type-fest';
|
|
2
|
-
import { Tables } from './supabase.types';
|
|
3
|
-
import {
|
|
4
|
-
ChatRuleInfoType,
|
|
5
|
-
MessageRuleInfoType,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| '
|
|
104
|
-
| '
|
|
105
|
-
| '
|
|
106
|
-
| '
|
|
107
|
-
| '
|
|
108
|
-
| '
|
|
109
|
-
| '
|
|
110
|
-
| '
|
|
111
|
-
| '
|
|
112
|
-
| '
|
|
113
|
-
| '
|
|
114
|
-
| '
|
|
115
|
-
| '
|
|
116
|
-
| '
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
| '
|
|
206
|
-
| '
|
|
207
|
-
| '
|
|
208
|
-
| '
|
|
209
|
-
| '
|
|
210
|
-
| '
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
{ id: '
|
|
342
|
-
{ id: '
|
|
343
|
-
{ id: '
|
|
344
|
-
{ id: 'audio', value: '
|
|
345
|
-
{ id: '
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
{ id: '
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
{ id: '
|
|
605
|
-
{ id: '
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
{ id: '
|
|
616
|
-
{ id: '
|
|
617
|
-
{ id: '
|
|
618
|
-
{ id: '
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
'
|
|
766
|
-
'
|
|
767
|
-
'
|
|
768
|
-
'
|
|
769
|
-
'
|
|
770
|
-
'
|
|
771
|
-
'
|
|
772
|
-
'
|
|
773
|
-
'
|
|
774
|
-
'
|
|
775
|
-
'
|
|
776
|
-
'
|
|
777
|
-
'
|
|
778
|
-
'
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
|
810
|
-
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
};
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
};
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
};
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
};
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
};
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
};
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
|
933
|
-
|
|
|
934
|
-
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
};
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
};
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
};
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
{
|
|
1133
|
-
title:
|
|
1134
|
-
description:
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
id: '
|
|
1393
|
-
type: '
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
},
|
|
1441
|
-
{
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
{
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
},
|
|
1522
|
-
{
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
value:
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
'
|
|
1750
|
-
'message.
|
|
1751
|
-
'
|
|
1752
|
-
'ticket.
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
'message.
|
|
1803
|
-
'
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
},
|
|
1835
|
-
},
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
},
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
],
|
|
2029
|
-
},
|
|
2030
|
-
{
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
validTriggers: [
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
'
|
|
2049
|
-
'
|
|
2050
|
-
'
|
|
2051
|
-
'message.
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
'
|
|
2063
|
-
'
|
|
2064
|
-
'
|
|
2065
|
-
'message.
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
},
|
|
2082
|
-
{
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
validTriggers: [
|
|
2086
|
-
'message.created',
|
|
2087
|
-
'message.updated',
|
|
2088
|
-
'reaction.added',
|
|
2089
|
-
'message.flagged',
|
|
2090
|
-
'
|
|
2091
|
-
'
|
|
2092
|
-
'ticket.
|
|
2093
|
-
'
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
'
|
|
2103
|
-
'message.
|
|
2104
|
-
'
|
|
2105
|
-
'
|
|
2106
|
-
'
|
|
2107
|
-
'
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
'
|
|
2119
|
-
'
|
|
2120
|
-
'
|
|
2121
|
-
'message.
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
'
|
|
2135
|
-
'message.
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
'
|
|
2143
|
-
'message.
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
'
|
|
2157
|
-
'
|
|
2158
|
-
'
|
|
2159
|
-
'message.
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
'chat.
|
|
2194
|
-
'
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
1
|
+
import { Merge, OverrideProperties } from 'type-fest';
|
|
2
|
+
import { Tables } from './supabase.types';
|
|
3
|
+
import {
|
|
4
|
+
ChatRuleInfoType,
|
|
5
|
+
MessageRuleInfoType,
|
|
6
|
+
OrgType,
|
|
7
|
+
ReactionRuleInfoType,
|
|
8
|
+
SenderRuleInfoType,
|
|
9
|
+
TicketRuleInfoType,
|
|
10
|
+
} from './types';
|
|
11
|
+
|
|
12
|
+
export type AppendTypes<T extends object, O extends string> = {
|
|
13
|
+
[K in keyof T & string as `${K}${O}${keyof T[K] & string}`]: T[K][keyof T[K]];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TicketVariablesType = TicketRuleInfoType['ticket'];
|
|
17
|
+
|
|
18
|
+
export type MessageVariablesType = MessageRuleInfoType['message'];
|
|
19
|
+
|
|
20
|
+
export type SenderVariablesType = SenderRuleInfoType;
|
|
21
|
+
|
|
22
|
+
export type ReactionVariablesType = ReactionRuleInfoType['reaction'];
|
|
23
|
+
|
|
24
|
+
export type ChatVariablesType = ChatRuleInfoType;
|
|
25
|
+
|
|
26
|
+
export type MessageRulesInfoType = Merge<
|
|
27
|
+
AppendTypes<
|
|
28
|
+
{
|
|
29
|
+
message: MessageVariablesType;
|
|
30
|
+
sender: SenderVariablesType;
|
|
31
|
+
chat: ChatVariablesType;
|
|
32
|
+
},
|
|
33
|
+
'.'
|
|
34
|
+
>,
|
|
35
|
+
{
|
|
36
|
+
rule: Tables<'tbl_automation_rules'>[];
|
|
37
|
+
id: 'message.message_id';
|
|
38
|
+
type: `message.${'created' | 'updated' | 'flagged' | 'deleted' | 'unflagged'}`;
|
|
39
|
+
org_id: string;
|
|
40
|
+
}
|
|
41
|
+
>;
|
|
42
|
+
|
|
43
|
+
export type TicketRulesInfoType = Merge<
|
|
44
|
+
AppendTypes<
|
|
45
|
+
{
|
|
46
|
+
ticket: TicketVariablesType;
|
|
47
|
+
message: MessageVariablesType;
|
|
48
|
+
sender: SenderVariablesType;
|
|
49
|
+
chat: ChatVariablesType;
|
|
50
|
+
},
|
|
51
|
+
'.'
|
|
52
|
+
>,
|
|
53
|
+
{
|
|
54
|
+
id: 'ticket.ticket_id';
|
|
55
|
+
type: `ticket.${'created' | 'updated' | 'closed'}`;
|
|
56
|
+
org_id: string;
|
|
57
|
+
rule: Tables<'tbl_automation_rules'>[];
|
|
58
|
+
}
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
export type ReactionRulesInfoType = Merge<
|
|
62
|
+
AppendTypes<
|
|
63
|
+
{
|
|
64
|
+
reaction: ReactionVariablesType;
|
|
65
|
+
message: MessageVariablesType;
|
|
66
|
+
sender: SenderVariablesType;
|
|
67
|
+
chat: ChatVariablesType;
|
|
68
|
+
},
|
|
69
|
+
'.'
|
|
70
|
+
>,
|
|
71
|
+
{
|
|
72
|
+
rule: Tables<'tbl_automation_rules'>[];
|
|
73
|
+
id: 'reaction.reaction_id';
|
|
74
|
+
type: `reaction.added`;
|
|
75
|
+
org_id: string;
|
|
76
|
+
}
|
|
77
|
+
>;
|
|
78
|
+
|
|
79
|
+
export type ChatRulesInfoType = Merge<
|
|
80
|
+
AppendTypes<
|
|
81
|
+
{
|
|
82
|
+
chat: ChatVariablesType;
|
|
83
|
+
},
|
|
84
|
+
'.'
|
|
85
|
+
>,
|
|
86
|
+
{
|
|
87
|
+
rule: Tables<'tbl_automation_rules'>[];
|
|
88
|
+
id: 'chat.chat_id';
|
|
89
|
+
type: 'chat.created' | 'chat.label.updated';
|
|
90
|
+
org_id: string;
|
|
91
|
+
}
|
|
92
|
+
>;
|
|
93
|
+
|
|
94
|
+
export type RuleInfoType =
|
|
95
|
+
| MessageRulesInfoType
|
|
96
|
+
| ChatRulesInfoType
|
|
97
|
+
| TicketRulesInfoType
|
|
98
|
+
| ReactionRulesInfoType;
|
|
99
|
+
|
|
100
|
+
export interface Filter {
|
|
101
|
+
id: string;
|
|
102
|
+
condition:
|
|
103
|
+
| 'CONTAINS'
|
|
104
|
+
| 'NCONTAINS'
|
|
105
|
+
| 'EQ'
|
|
106
|
+
| 'NEQ'
|
|
107
|
+
| 'LT'
|
|
108
|
+
| 'LTE'
|
|
109
|
+
| 'GT'
|
|
110
|
+
| 'GTE'
|
|
111
|
+
| 'KNOWN'
|
|
112
|
+
| 'NKNOWN'
|
|
113
|
+
| 'IS'
|
|
114
|
+
| 'NIS'
|
|
115
|
+
| 'ON'
|
|
116
|
+
| 'STARTS_WITH'
|
|
117
|
+
| 'ENDS_WITH'; // Add other condition types as needed
|
|
118
|
+
variable: string;
|
|
119
|
+
value: string | string[];
|
|
120
|
+
variable_type?: 'string' | 'number' | 'boolean' | 'day-time' | 'date' | 'day'; // Optional, like 'Date'
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const isFilter = (filter: any): filter is Filter => {
|
|
124
|
+
return (
|
|
125
|
+
typeof filter === 'object' &&
|
|
126
|
+
'id' in filter &&
|
|
127
|
+
'condition' in filter &&
|
|
128
|
+
'variable' in filter &&
|
|
129
|
+
'value' in filter
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const FilterNameMap: Record<
|
|
134
|
+
Filter['condition'],
|
|
135
|
+
{
|
|
136
|
+
name: string;
|
|
137
|
+
input: boolean;
|
|
138
|
+
}
|
|
139
|
+
> = {
|
|
140
|
+
EQ: {
|
|
141
|
+
name: 'equals to',
|
|
142
|
+
input: true,
|
|
143
|
+
},
|
|
144
|
+
NEQ: {
|
|
145
|
+
name: 'not equals to',
|
|
146
|
+
input: true,
|
|
147
|
+
},
|
|
148
|
+
CONTAINS: {
|
|
149
|
+
name: 'contains',
|
|
150
|
+
input: true,
|
|
151
|
+
},
|
|
152
|
+
NCONTAINS: {
|
|
153
|
+
name: 'does not contain',
|
|
154
|
+
input: true,
|
|
155
|
+
},
|
|
156
|
+
LT: {
|
|
157
|
+
name: 'less than',
|
|
158
|
+
input: true,
|
|
159
|
+
},
|
|
160
|
+
LTE: {
|
|
161
|
+
name: 'less than or equals to',
|
|
162
|
+
input: true,
|
|
163
|
+
},
|
|
164
|
+
GT: {
|
|
165
|
+
name: 'greater than',
|
|
166
|
+
input: true,
|
|
167
|
+
},
|
|
168
|
+
GTE: {
|
|
169
|
+
name: 'greater than or equals to',
|
|
170
|
+
input: true,
|
|
171
|
+
},
|
|
172
|
+
KNOWN: {
|
|
173
|
+
name: 'is known',
|
|
174
|
+
input: false,
|
|
175
|
+
},
|
|
176
|
+
NKNOWN: {
|
|
177
|
+
name: 'is not known',
|
|
178
|
+
input: false,
|
|
179
|
+
},
|
|
180
|
+
IS: {
|
|
181
|
+
name: 'is',
|
|
182
|
+
input: true,
|
|
183
|
+
},
|
|
184
|
+
NIS: {
|
|
185
|
+
name: 'is not',
|
|
186
|
+
input: true,
|
|
187
|
+
},
|
|
188
|
+
ON: {
|
|
189
|
+
name: 'on',
|
|
190
|
+
input: true,
|
|
191
|
+
},
|
|
192
|
+
STARTS_WITH: {
|
|
193
|
+
name: 'starts with',
|
|
194
|
+
input: true,
|
|
195
|
+
},
|
|
196
|
+
ENDS_WITH: {
|
|
197
|
+
name: 'ends with',
|
|
198
|
+
input: true,
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export type VariableNameValueType = {
|
|
203
|
+
text: string;
|
|
204
|
+
type:
|
|
205
|
+
| 'string'
|
|
206
|
+
| 'time'
|
|
207
|
+
| 'boolean'
|
|
208
|
+
| 'dropdown'
|
|
209
|
+
| 'day-time'
|
|
210
|
+
| 'number'
|
|
211
|
+
| 'date';
|
|
212
|
+
variable_type: 'string' | 'number' | 'boolean' | 'day-time' | 'date';
|
|
213
|
+
value?:
|
|
214
|
+
| string
|
|
215
|
+
| {
|
|
216
|
+
id: string;
|
|
217
|
+
value: string | number | boolean;
|
|
218
|
+
label: string;
|
|
219
|
+
}[]
|
|
220
|
+
| null;
|
|
221
|
+
filters:
|
|
222
|
+
| Partial<
|
|
223
|
+
Record<
|
|
224
|
+
Filter['condition'],
|
|
225
|
+
{
|
|
226
|
+
info?: string;
|
|
227
|
+
}
|
|
228
|
+
>
|
|
229
|
+
>
|
|
230
|
+
| Filter['condition'][];
|
|
231
|
+
hidden?: boolean;
|
|
232
|
+
placeholder?: string;
|
|
233
|
+
info?: string;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export const MessageVariableNameMap: Record<
|
|
237
|
+
keyof AppendTypes<{ message: MessageVariablesType }, '.'>,
|
|
238
|
+
VariableNameValueType
|
|
239
|
+
> = {
|
|
240
|
+
'message.body': {
|
|
241
|
+
text: 'Message Body',
|
|
242
|
+
type: 'string',
|
|
243
|
+
filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
|
|
244
|
+
placeholder: 'e.g. Test message',
|
|
245
|
+
variable_type: 'string',
|
|
246
|
+
},
|
|
247
|
+
'message.sender_phone': {
|
|
248
|
+
text: 'Message Sender Phone',
|
|
249
|
+
type: 'string',
|
|
250
|
+
filters: ['EQ', 'NEQ'],
|
|
251
|
+
placeholder: 'e.g. 919876543210',
|
|
252
|
+
variable_type: 'string',
|
|
253
|
+
},
|
|
254
|
+
'message.timestamp': {
|
|
255
|
+
text: 'Message Timestamp',
|
|
256
|
+
type: 'day-time',
|
|
257
|
+
filters: {
|
|
258
|
+
LT: {
|
|
259
|
+
info: 'When message is received before mentioned time (UTC)',
|
|
260
|
+
},
|
|
261
|
+
LTE: {
|
|
262
|
+
info: 'When message is received before mentioned time (UTC)',
|
|
263
|
+
},
|
|
264
|
+
GT: {
|
|
265
|
+
info: 'When message is received after mentioned time (UTC)',
|
|
266
|
+
},
|
|
267
|
+
GTE: {
|
|
268
|
+
info: 'When message is received on or after mentioned time (UTC)',
|
|
269
|
+
},
|
|
270
|
+
ON: {
|
|
271
|
+
info: 'When message is received on mentioned days',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
variable_type: 'day-time',
|
|
275
|
+
info: 'The timestamp when the message was received',
|
|
276
|
+
},
|
|
277
|
+
'message.flag_status': {
|
|
278
|
+
text: 'Message Flag Status',
|
|
279
|
+
filters: ['IS'],
|
|
280
|
+
type: 'boolean',
|
|
281
|
+
variable_type: 'boolean',
|
|
282
|
+
},
|
|
283
|
+
'message.has_quoted_msg': {
|
|
284
|
+
text: 'Has Quoted Message',
|
|
285
|
+
filters: ['IS'],
|
|
286
|
+
type: 'boolean',
|
|
287
|
+
variable_type: 'boolean',
|
|
288
|
+
},
|
|
289
|
+
'message.media': {
|
|
290
|
+
text: 'Has Media',
|
|
291
|
+
type: 'boolean',
|
|
292
|
+
filters: ['KNOWN', 'NKNOWN'],
|
|
293
|
+
variable_type: 'boolean',
|
|
294
|
+
},
|
|
295
|
+
'message.performed_by': {
|
|
296
|
+
text: 'Message Sent By (email)',
|
|
297
|
+
type: 'dropdown',
|
|
298
|
+
value: 'org.members',
|
|
299
|
+
filters: ['EQ', 'NEQ'],
|
|
300
|
+
variable_type: 'string',
|
|
301
|
+
},
|
|
302
|
+
'message.chat_id': {
|
|
303
|
+
text: 'Chat ID',
|
|
304
|
+
type: 'string',
|
|
305
|
+
filters: ['EQ', 'NEQ', 'STARTS_WITH', 'ENDS_WITH'],
|
|
306
|
+
hidden: true,
|
|
307
|
+
variable_type: 'string',
|
|
308
|
+
},
|
|
309
|
+
'message.message_ticket_id': {
|
|
310
|
+
text: 'Message Ticket ID',
|
|
311
|
+
type: 'string',
|
|
312
|
+
filters: ['EQ', 'NEQ'],
|
|
313
|
+
hidden: true,
|
|
314
|
+
variable_type: 'string',
|
|
315
|
+
},
|
|
316
|
+
'message.message_id': {
|
|
317
|
+
text: 'Message ID',
|
|
318
|
+
type: 'string',
|
|
319
|
+
filters: ['EQ', 'NEQ'],
|
|
320
|
+
hidden: true,
|
|
321
|
+
variable_type: 'string',
|
|
322
|
+
},
|
|
323
|
+
'message.org_phone': {
|
|
324
|
+
text: 'Org Phone',
|
|
325
|
+
type: 'string',
|
|
326
|
+
filters: ['EQ', 'NEQ'],
|
|
327
|
+
hidden: true,
|
|
328
|
+
variable_type: 'string',
|
|
329
|
+
},
|
|
330
|
+
'message.org_id': {
|
|
331
|
+
text: 'Org ID',
|
|
332
|
+
type: 'string',
|
|
333
|
+
filters: ['EQ', 'NEQ'],
|
|
334
|
+
hidden: true,
|
|
335
|
+
variable_type: 'string',
|
|
336
|
+
},
|
|
337
|
+
'message.message_type': {
|
|
338
|
+
text: 'Message Type',
|
|
339
|
+
type: 'dropdown',
|
|
340
|
+
value: [
|
|
341
|
+
{ id: 'text', value: 'chat', label: 'Text' },
|
|
342
|
+
{ id: 'image', value: 'image', label: 'Image' },
|
|
343
|
+
{ id: 'video', value: 'video', label: 'Video' },
|
|
344
|
+
{ id: 'audio', value: 'audio', label: 'Audio' },
|
|
345
|
+
{ id: 'audio', value: 'ptt', label: 'PTT (Audio voice message)' },
|
|
346
|
+
{ id: 'document', value: 'document', label: 'Document' },
|
|
347
|
+
],
|
|
348
|
+
filters: ['EQ', 'NEQ'],
|
|
349
|
+
variable_type: 'string',
|
|
350
|
+
},
|
|
351
|
+
'message.author': {
|
|
352
|
+
text: 'Message Author',
|
|
353
|
+
type: 'string',
|
|
354
|
+
filters: ['EQ', 'NEQ'],
|
|
355
|
+
hidden: true,
|
|
356
|
+
variable_type: 'string',
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export const SenderVariableNameMap: Record<
|
|
361
|
+
keyof AppendTypes<{ sender: SenderVariablesType }, '.'>,
|
|
362
|
+
VariableNameValueType
|
|
363
|
+
> = {
|
|
364
|
+
'sender.is_internal': {
|
|
365
|
+
text: 'Sender Is Internal',
|
|
366
|
+
type: 'boolean',
|
|
367
|
+
filters: ['IS'],
|
|
368
|
+
variable_type: 'boolean',
|
|
369
|
+
},
|
|
370
|
+
'sender.contact_name': {
|
|
371
|
+
text: 'Sender Name',
|
|
372
|
+
type: 'string',
|
|
373
|
+
filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
|
|
374
|
+
placeholder: 'e.g. John Doe',
|
|
375
|
+
variable_type: 'string',
|
|
376
|
+
},
|
|
377
|
+
'sender.contact_id': {
|
|
378
|
+
text: 'Sender Phone',
|
|
379
|
+
type: 'string',
|
|
380
|
+
filters: ['EQ', 'NEQ'],
|
|
381
|
+
placeholder: 'e.g. 919876543210',
|
|
382
|
+
variable_type: 'string',
|
|
383
|
+
},
|
|
384
|
+
'sender.org_id': {
|
|
385
|
+
text: 'Org ID',
|
|
386
|
+
type: 'string',
|
|
387
|
+
filters: ['EQ', 'NEQ'],
|
|
388
|
+
hidden: true,
|
|
389
|
+
variable_type: 'string',
|
|
390
|
+
},
|
|
391
|
+
'sender.labels': {
|
|
392
|
+
text: 'Sender Contact Labels',
|
|
393
|
+
type: 'dropdown',
|
|
394
|
+
value: 'org.labels',
|
|
395
|
+
filters: ['CONTAINS', 'NCONTAINS'],
|
|
396
|
+
variable_type: 'string',
|
|
397
|
+
},
|
|
398
|
+
'sender.is_admin': {
|
|
399
|
+
text: 'Sender Is Admin',
|
|
400
|
+
type: 'dropdown',
|
|
401
|
+
filters: ['EQ', 'NEQ'],
|
|
402
|
+
value: [
|
|
403
|
+
{
|
|
404
|
+
id: 'true',
|
|
405
|
+
value: 'true',
|
|
406
|
+
label: 'True',
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: 'false',
|
|
410
|
+
value: 'false',
|
|
411
|
+
label: 'False',
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
variable_type: 'boolean',
|
|
415
|
+
},
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
export const ChatVariableNameMap: Record<
|
|
419
|
+
keyof AppendTypes<{ chat: ChatVariablesType }, '.'>,
|
|
420
|
+
VariableNameValueType
|
|
421
|
+
> = {
|
|
422
|
+
'chat.assigned_to': {
|
|
423
|
+
text: 'Chat Assignee',
|
|
424
|
+
type: 'dropdown',
|
|
425
|
+
value: 'org.members',
|
|
426
|
+
filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
|
|
427
|
+
variable_type: 'string',
|
|
428
|
+
},
|
|
429
|
+
'chat.chat_name': {
|
|
430
|
+
text: 'Chat Name',
|
|
431
|
+
type: 'string',
|
|
432
|
+
filters: ['EQ', 'NEQ', 'CONTAINS', 'NCONTAINS'],
|
|
433
|
+
placeholder: 'e.g. Support Chat',
|
|
434
|
+
variable_type: 'string',
|
|
435
|
+
},
|
|
436
|
+
'chat.org_phone': {
|
|
437
|
+
text: 'Chat Org Phone',
|
|
438
|
+
type: 'dropdown',
|
|
439
|
+
value: 'org.org_phones',
|
|
440
|
+
filters: ['EQ', 'NEQ'],
|
|
441
|
+
variable_type: 'string',
|
|
442
|
+
},
|
|
443
|
+
'chat.chat_type': {
|
|
444
|
+
text: 'Chat Type',
|
|
445
|
+
type: 'dropdown',
|
|
446
|
+
value: [
|
|
447
|
+
{ id: 'user', value: 'user', label: 'User' },
|
|
448
|
+
{ id: 'group', value: 'group', label: 'Group' },
|
|
449
|
+
],
|
|
450
|
+
filters: ['EQ', 'NEQ'],
|
|
451
|
+
variable_type: 'string',
|
|
452
|
+
},
|
|
453
|
+
'chat.members': {
|
|
454
|
+
text: 'Chat Members',
|
|
455
|
+
type: 'string',
|
|
456
|
+
filters: ['CONTAINS', 'NCONTAINS'],
|
|
457
|
+
placeholder: 'e.g. 919876543210',
|
|
458
|
+
variable_type: 'string',
|
|
459
|
+
},
|
|
460
|
+
'chat.labels': {
|
|
461
|
+
text: 'Chat Labels',
|
|
462
|
+
type: 'dropdown',
|
|
463
|
+
value: 'org.labels',
|
|
464
|
+
filters: ['CONTAINS', 'NCONTAINS'],
|
|
465
|
+
variable_type: 'string',
|
|
466
|
+
},
|
|
467
|
+
'chat.chat_id': {
|
|
468
|
+
text: 'Chat ID',
|
|
469
|
+
type: 'string',
|
|
470
|
+
filters: ['EQ', 'NEQ', 'STARTS_WITH', 'ENDS_WITH'],
|
|
471
|
+
placeholder: 'e.g. 12027747916749@g.us',
|
|
472
|
+
variable_type: 'string',
|
|
473
|
+
},
|
|
474
|
+
'chat.chat_org_phones': {
|
|
475
|
+
text: 'Chat Org Phones',
|
|
476
|
+
type: 'dropdown',
|
|
477
|
+
filters: ['CONTAINS', 'NCONTAINS'],
|
|
478
|
+
hidden: true,
|
|
479
|
+
variable_type: 'string',
|
|
480
|
+
},
|
|
481
|
+
'chat.org_id': {
|
|
482
|
+
text: 'Org ID',
|
|
483
|
+
type: 'string',
|
|
484
|
+
filters: [],
|
|
485
|
+
hidden: true,
|
|
486
|
+
variable_type: 'string',
|
|
487
|
+
},
|
|
488
|
+
'chat.messages_admins_only': {
|
|
489
|
+
text: 'Messages Admins Only (Chat Settings)',
|
|
490
|
+
type: 'boolean',
|
|
491
|
+
filters: ['EQ', 'NEQ'],
|
|
492
|
+
value: [
|
|
493
|
+
{
|
|
494
|
+
id: 'true',
|
|
495
|
+
value: 'true',
|
|
496
|
+
label: 'True',
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
id: 'false',
|
|
500
|
+
value: 'false',
|
|
501
|
+
label: 'False',
|
|
502
|
+
},
|
|
503
|
+
],
|
|
504
|
+
variable_type: 'boolean',
|
|
505
|
+
},
|
|
506
|
+
'chat.info_admins_only': {
|
|
507
|
+
text: 'Info Admins Only (Chat Settings)',
|
|
508
|
+
type: 'boolean',
|
|
509
|
+
filters: ['EQ', 'NEQ'],
|
|
510
|
+
value: [
|
|
511
|
+
{
|
|
512
|
+
id: 'true',
|
|
513
|
+
value: 'true',
|
|
514
|
+
label: 'True',
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
id: 'false',
|
|
518
|
+
value: 'false',
|
|
519
|
+
label: 'False',
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
variable_type: 'boolean',
|
|
523
|
+
},
|
|
524
|
+
'chat.has_flagged_messages': {
|
|
525
|
+
text: 'Chat Has Flagged Messages',
|
|
526
|
+
type: 'boolean',
|
|
527
|
+
filters: ['EQ', 'NEQ'],
|
|
528
|
+
value: [
|
|
529
|
+
{
|
|
530
|
+
id: 'true',
|
|
531
|
+
value: 'true',
|
|
532
|
+
label: 'True',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
id: 'false',
|
|
536
|
+
value: 'false',
|
|
537
|
+
label: 'False',
|
|
538
|
+
},
|
|
539
|
+
],
|
|
540
|
+
variable_type: 'boolean',
|
|
541
|
+
},
|
|
542
|
+
'chat.group_description': {
|
|
543
|
+
text: 'Group Description',
|
|
544
|
+
type: 'string',
|
|
545
|
+
filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
|
|
546
|
+
placeholder: 'e.g. Group description',
|
|
547
|
+
variable_type: 'string',
|
|
548
|
+
},
|
|
549
|
+
'chat.custom_properties': {
|
|
550
|
+
text: 'Chat Custom Properties',
|
|
551
|
+
type: 'dropdown',
|
|
552
|
+
value: 'org.custom_properties',
|
|
553
|
+
filters: ['EQ', 'NEQ'],
|
|
554
|
+
hidden: true,
|
|
555
|
+
variable_type: 'string',
|
|
556
|
+
},
|
|
557
|
+
'chat.initiated_by': {
|
|
558
|
+
text: 'Chat Initiated By',
|
|
559
|
+
type: 'dropdown',
|
|
560
|
+
value: 'org.members',
|
|
561
|
+
filters: ['EQ', 'NEQ'],
|
|
562
|
+
variable_type: 'string',
|
|
563
|
+
hidden: true,
|
|
564
|
+
},
|
|
565
|
+
'chat.created_at': {
|
|
566
|
+
text: 'Chat Created At',
|
|
567
|
+
type: 'day-time',
|
|
568
|
+
filters: {
|
|
569
|
+
LT: {
|
|
570
|
+
info: 'When chat is created before mentioned time (UTC)',
|
|
571
|
+
},
|
|
572
|
+
LTE: {
|
|
573
|
+
info: 'When chat is created before mentioned time (UTC)',
|
|
574
|
+
},
|
|
575
|
+
GT: {
|
|
576
|
+
info: 'When chat is created after mentioned time (UTC)',
|
|
577
|
+
},
|
|
578
|
+
GTE: {
|
|
579
|
+
info: 'When chat is created on or after mentioned time (UTC)',
|
|
580
|
+
},
|
|
581
|
+
ON: {
|
|
582
|
+
info: 'When chat is created on mentioned days',
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
variable_type: 'day-time',
|
|
586
|
+
},
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
export const TicketVariableNameMap: Record<
|
|
590
|
+
keyof AppendTypes<{ ticket: TicketVariablesType }, '.'>,
|
|
591
|
+
VariableNameValueType
|
|
592
|
+
> = {
|
|
593
|
+
'ticket.subject': {
|
|
594
|
+
text: 'Ticket Subject',
|
|
595
|
+
type: 'string',
|
|
596
|
+
filters: ['CONTAINS', 'NCONTAINS', 'EQ', 'NEQ'],
|
|
597
|
+
placeholder: 'e.g. Test ticket',
|
|
598
|
+
variable_type: 'string',
|
|
599
|
+
},
|
|
600
|
+
'ticket.status': {
|
|
601
|
+
text: 'Ticket Status',
|
|
602
|
+
type: 'dropdown',
|
|
603
|
+
value: [
|
|
604
|
+
{ id: 'open', value: 'open', label: 'Open' },
|
|
605
|
+
{ id: 'closed', value: 'closed', label: 'Closed' },
|
|
606
|
+
{ id: 'inprogress', value: 'inprogress', label: 'In progress' },
|
|
607
|
+
],
|
|
608
|
+
filters: ['EQ', 'NEQ'],
|
|
609
|
+
variable_type: 'string',
|
|
610
|
+
},
|
|
611
|
+
'ticket.priority': {
|
|
612
|
+
text: 'Ticket Priority',
|
|
613
|
+
type: 'dropdown',
|
|
614
|
+
value: [
|
|
615
|
+
{ id: '0', value: '0', label: 'No Priority' },
|
|
616
|
+
{ id: '1', value: '1', label: 'Low' },
|
|
617
|
+
{ id: '2', value: '2', label: 'Medium' },
|
|
618
|
+
{ id: '3', value: '3', label: 'High' },
|
|
619
|
+
{ id: '4', value: '4', label: 'Urgent' },
|
|
620
|
+
],
|
|
621
|
+
filters: ['EQ', 'NEQ'],
|
|
622
|
+
variable_type: 'string',
|
|
623
|
+
},
|
|
624
|
+
'ticket.assignee': {
|
|
625
|
+
text: 'Ticket Assignee',
|
|
626
|
+
type: 'dropdown',
|
|
627
|
+
value: 'org.members',
|
|
628
|
+
filters: ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
|
|
629
|
+
variable_type: 'string',
|
|
630
|
+
},
|
|
631
|
+
'ticket.labels': {
|
|
632
|
+
text: 'Ticket Labels',
|
|
633
|
+
type: 'dropdown',
|
|
634
|
+
value: 'org.labels',
|
|
635
|
+
filters: ['CONTAINS', 'NCONTAINS'],
|
|
636
|
+
variable_type: 'string',
|
|
637
|
+
},
|
|
638
|
+
'ticket.is_deleted': {
|
|
639
|
+
text: 'Ticket Is Deleted',
|
|
640
|
+
type: 'boolean',
|
|
641
|
+
value: [
|
|
642
|
+
{
|
|
643
|
+
id: 'true',
|
|
644
|
+
value: 'true',
|
|
645
|
+
label: 'True',
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
id: 'false',
|
|
649
|
+
value: 'false',
|
|
650
|
+
label: 'False',
|
|
651
|
+
},
|
|
652
|
+
],
|
|
653
|
+
filters: ['IS'],
|
|
654
|
+
variable_type: 'boolean',
|
|
655
|
+
},
|
|
656
|
+
'ticket.raised_by': {
|
|
657
|
+
text: 'Ticket Raised By',
|
|
658
|
+
type: 'dropdown',
|
|
659
|
+
value: 'org.members',
|
|
660
|
+
filters: ['EQ', 'NEQ'],
|
|
661
|
+
variable_type: 'string',
|
|
662
|
+
},
|
|
663
|
+
'ticket.due_date': {
|
|
664
|
+
text: 'Ticket Due Date',
|
|
665
|
+
type: 'date',
|
|
666
|
+
filters: ['KNOWN', 'NKNOWN'],
|
|
667
|
+
variable_type: 'date',
|
|
668
|
+
hidden: true,
|
|
669
|
+
},
|
|
670
|
+
'ticket.ticket_id': {
|
|
671
|
+
text: 'Ticket ID',
|
|
672
|
+
type: 'string',
|
|
673
|
+
filters: ['EQ', 'NEQ'],
|
|
674
|
+
hidden: true,
|
|
675
|
+
variable_type: 'string',
|
|
676
|
+
},
|
|
677
|
+
'ticket.org_id': {
|
|
678
|
+
text: 'Org ID',
|
|
679
|
+
type: 'string',
|
|
680
|
+
filters: ['EQ', 'NEQ'],
|
|
681
|
+
hidden: true,
|
|
682
|
+
variable_type: 'string',
|
|
683
|
+
},
|
|
684
|
+
'ticket.custom_properties': {
|
|
685
|
+
text: 'Ticket Custom Properties',
|
|
686
|
+
type: 'dropdown',
|
|
687
|
+
value: 'org.custom_properties',
|
|
688
|
+
filters: ['EQ', 'NEQ'],
|
|
689
|
+
hidden: true,
|
|
690
|
+
variable_type: 'string',
|
|
691
|
+
},
|
|
692
|
+
'ticket.created_at': {
|
|
693
|
+
text: 'Ticket Created At',
|
|
694
|
+
type: 'day-time',
|
|
695
|
+
filters: {
|
|
696
|
+
LT: {
|
|
697
|
+
info: 'When ticket is created before mentioned time (UTC)',
|
|
698
|
+
},
|
|
699
|
+
LTE: {
|
|
700
|
+
info: 'When ticket is created before mentioned time (UTC)',
|
|
701
|
+
},
|
|
702
|
+
GT: {
|
|
703
|
+
info: 'When ticket is created after mentioned time (UTC)',
|
|
704
|
+
},
|
|
705
|
+
GTE: {
|
|
706
|
+
info: 'When ticket is created on or after mentioned time (UTC)',
|
|
707
|
+
},
|
|
708
|
+
ON: {
|
|
709
|
+
info: 'When ticket is created on mentioned days',
|
|
710
|
+
},
|
|
711
|
+
},
|
|
712
|
+
variable_type: 'day-time',
|
|
713
|
+
},
|
|
714
|
+
'ticket.chat_id': {
|
|
715
|
+
text: 'Chat ID',
|
|
716
|
+
type: 'string',
|
|
717
|
+
filters: ['EQ', 'NEQ', 'STARTS_WITH', 'ENDS_WITH'],
|
|
718
|
+
hidden: true,
|
|
719
|
+
variable_type: 'string',
|
|
720
|
+
},
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
export const ReactionVariableNameMap: Record<
|
|
724
|
+
keyof AppendTypes<{ reaction: ReactionVariablesType }, '.'>,
|
|
725
|
+
VariableNameValueType
|
|
726
|
+
> = {
|
|
727
|
+
'reaction.reaction': {
|
|
728
|
+
text: 'Reaction',
|
|
729
|
+
type: 'string',
|
|
730
|
+
filters: ['EQ', 'NEQ'],
|
|
731
|
+
placeholder: 'e.g. 👍',
|
|
732
|
+
variable_type: 'string',
|
|
733
|
+
},
|
|
734
|
+
'reaction.sender_id': {
|
|
735
|
+
text: 'Reaction Sender Phone',
|
|
736
|
+
type: 'string',
|
|
737
|
+
filters: ['EQ', 'NEQ'],
|
|
738
|
+
placeholder: 'e.g. 919876543210',
|
|
739
|
+
variable_type: 'string',
|
|
740
|
+
},
|
|
741
|
+
'reaction.message_id': {
|
|
742
|
+
text: 'Reaction Message ID',
|
|
743
|
+
type: 'string',
|
|
744
|
+
filters: ['EQ', 'NEQ'],
|
|
745
|
+
hidden: true,
|
|
746
|
+
variable_type: 'string',
|
|
747
|
+
},
|
|
748
|
+
'reaction.chat_id': {
|
|
749
|
+
text: 'Chat ID',
|
|
750
|
+
type: 'string',
|
|
751
|
+
filters: ['EQ', 'NEQ', 'STARTS_WITH', 'ENDS_WITH'],
|
|
752
|
+
hidden: true,
|
|
753
|
+
variable_type: 'string',
|
|
754
|
+
},
|
|
755
|
+
'reaction.reaction_id': {
|
|
756
|
+
text: 'Reaction ID',
|
|
757
|
+
type: 'string',
|
|
758
|
+
filters: ['EQ', 'NEQ'],
|
|
759
|
+
hidden: true,
|
|
760
|
+
variable_type: 'string',
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
export enum FilterConditionMap {
|
|
765
|
+
'CONTAINS' = 'contains',
|
|
766
|
+
'NCONTAINS' = 'does not contain',
|
|
767
|
+
'EQ' = '=',
|
|
768
|
+
'NEQ' = '<>',
|
|
769
|
+
'LT' = '<',
|
|
770
|
+
'LTE' = '<=',
|
|
771
|
+
'GT' = '>',
|
|
772
|
+
'GTE' = '>=',
|
|
773
|
+
'KNOWN' = 'is known',
|
|
774
|
+
'NKNOWN' = 'is not known',
|
|
775
|
+
'IS' = '=',
|
|
776
|
+
'NIS' = '<>',
|
|
777
|
+
'ON' = 'on',
|
|
778
|
+
'STARTS_WITH' = 'starts with',
|
|
779
|
+
'ENDS_WITH' = 'ends with',
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
interface FilterGroup {
|
|
783
|
+
filters: Filter[];
|
|
784
|
+
condition: 'allOf' | 'anyOf';
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export interface Conditions {
|
|
788
|
+
filters: FilterGroup[];
|
|
789
|
+
condition: 'allOf' | 'anyOf';
|
|
790
|
+
variables: string[];
|
|
791
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
792
|
+
org_phones: string[];
|
|
793
|
+
allow_messages_from_org_phones?: boolean;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export type SendMessageAction = {
|
|
797
|
+
id: string;
|
|
798
|
+
type: 'send_message';
|
|
799
|
+
metadata: {
|
|
800
|
+
message: string;
|
|
801
|
+
media?: {
|
|
802
|
+
url: string;
|
|
803
|
+
type: 'image' | 'video' | 'audio' | 'document';
|
|
804
|
+
name: string;
|
|
805
|
+
};
|
|
806
|
+
maintain_flag_status: 'true' | 'false';
|
|
807
|
+
debounce_messages: 'true' | 'false';
|
|
808
|
+
debounce_message_time:
|
|
809
|
+
| `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`
|
|
810
|
+
| null
|
|
811
|
+
| undefined;
|
|
812
|
+
};
|
|
813
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
export type NotifyHttpAction = {
|
|
817
|
+
id: string;
|
|
818
|
+
type: 'notify_http';
|
|
819
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
820
|
+
metadata: {
|
|
821
|
+
url: string;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
export type CreateTicketAction = {
|
|
826
|
+
id: string;
|
|
827
|
+
type: 'create_ticket';
|
|
828
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
829
|
+
metadata: {
|
|
830
|
+
priority?: '0' | '1' | '2' | '3' | '4';
|
|
831
|
+
label?: string;
|
|
832
|
+
append_to_latest_ticket?: 'true' | 'false';
|
|
833
|
+
round_robin?: 'true' | 'false';
|
|
834
|
+
assignee?: string;
|
|
835
|
+
rr_check_for?: 'shift_time' | 'user_status' | 'shift_time user_status';
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
export type FlagMessageAction = {
|
|
840
|
+
id: string;
|
|
841
|
+
type: 'flag_message';
|
|
842
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
843
|
+
metadata: {
|
|
844
|
+
flag: 'true' | 'false';
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
export type AssignTicketAction = {
|
|
849
|
+
id: string;
|
|
850
|
+
type: 'assign_ticket';
|
|
851
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
852
|
+
metadata: {
|
|
853
|
+
assignee: string;
|
|
854
|
+
round_robin: 'true' | 'false';
|
|
855
|
+
rr_check_for?: 'shift_time' | 'user_status' | 'shift_time user_status';
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
export type CloseTicketAction = {
|
|
860
|
+
id: string;
|
|
861
|
+
type: 'close_ticket';
|
|
862
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
863
|
+
metadata: {
|
|
864
|
+
closing_note: string;
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
export type AddChatLabelAction = {
|
|
869
|
+
id: string;
|
|
870
|
+
type: 'add_chat_label';
|
|
871
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
872
|
+
metadata: {
|
|
873
|
+
label: string;
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
export type AddTicketLabelAction = {
|
|
878
|
+
id: string;
|
|
879
|
+
type: 'add_ticket_label';
|
|
880
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
881
|
+
metadata: {
|
|
882
|
+
label: string;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
export type AssignChatAction = {
|
|
887
|
+
id: string;
|
|
888
|
+
type: 'assign_chat';
|
|
889
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
890
|
+
metadata: {
|
|
891
|
+
assignee: string;
|
|
892
|
+
round_robin: 'true' | 'false';
|
|
893
|
+
rr_check_for?: 'shift_time' | 'user_status' | 'shift_time user_status';
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
export type ForwardMessageAction = {
|
|
898
|
+
id: string;
|
|
899
|
+
type: 'forward_message';
|
|
900
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
901
|
+
metadata: {
|
|
902
|
+
chat_id: string;
|
|
903
|
+
prefix: string;
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
export type SendEmailAction = {
|
|
908
|
+
id: string;
|
|
909
|
+
type: 'send_email';
|
|
910
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
911
|
+
metadata: {
|
|
912
|
+
email: string;
|
|
913
|
+
subject: string;
|
|
914
|
+
body: string;
|
|
915
|
+
};
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
export type ReplyToMessageAction = {
|
|
919
|
+
id: string;
|
|
920
|
+
type: 'reply_to_message';
|
|
921
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
922
|
+
metadata: {
|
|
923
|
+
message: string;
|
|
924
|
+
media?: {
|
|
925
|
+
url: string;
|
|
926
|
+
type: 'image' | 'video' | 'audio' | 'document';
|
|
927
|
+
name: string;
|
|
928
|
+
};
|
|
929
|
+
maintain_flag_status: 'true' | 'false';
|
|
930
|
+
debounce_messages: 'true' | 'false';
|
|
931
|
+
debounce_message_time:
|
|
932
|
+
| `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`
|
|
933
|
+
| null
|
|
934
|
+
| undefined;
|
|
935
|
+
};
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
export type UpdateCustomPropertyAction = {
|
|
939
|
+
id: string;
|
|
940
|
+
type: 'update_custom_property';
|
|
941
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
942
|
+
metadata: {
|
|
943
|
+
property_id: string;
|
|
944
|
+
value: string;
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
export type DeleteMessageAction = {
|
|
949
|
+
id: string;
|
|
950
|
+
type: 'delete_message';
|
|
951
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
952
|
+
metadata: {};
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
export type SendSlackNotificationAction = {
|
|
956
|
+
id: string;
|
|
957
|
+
type: 'send_slack_notification';
|
|
958
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
959
|
+
metadata: {
|
|
960
|
+
slack_payload: string;
|
|
961
|
+
webhook_url: string;
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
export type AttachMessageToTicketAction = {
|
|
966
|
+
id: string;
|
|
967
|
+
type: 'attach_message_to_ticket';
|
|
968
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
969
|
+
metadata: {
|
|
970
|
+
status: 'open' | 'inprogress' | 'open_inprogress' | null;
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
export type CloseChatAction = {
|
|
975
|
+
id: string;
|
|
976
|
+
type: 'close_chat';
|
|
977
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
978
|
+
metadata: {};
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
export type SendMessageToChatAction = {
|
|
982
|
+
id: string;
|
|
983
|
+
type: 'send_message_to_chat';
|
|
984
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
985
|
+
metadata: {
|
|
986
|
+
chat_id: string;
|
|
987
|
+
message: string;
|
|
988
|
+
media?: {
|
|
989
|
+
url: string;
|
|
990
|
+
type: 'image' | 'video' | 'audio' | 'document';
|
|
991
|
+
name: string;
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
export type FreshdeskCreateTicketAction = {
|
|
997
|
+
id: string;
|
|
998
|
+
type: 'create_ticket_on_freshdesk';
|
|
999
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
1000
|
+
metadata: {};
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
export type HubspotCreateTicketAction = {
|
|
1004
|
+
id: string;
|
|
1005
|
+
type: 'create_ticket_on_hubspot';
|
|
1006
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
1007
|
+
metadata: {};
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
export type ZohodeskCreateTicketAction = {
|
|
1011
|
+
id: string;
|
|
1012
|
+
type: 'create_ticket_on_zohodesk';
|
|
1013
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
1014
|
+
metadata: {};
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
export type Action =
|
|
1018
|
+
| SendMessageAction
|
|
1019
|
+
| NotifyHttpAction
|
|
1020
|
+
| CreateTicketAction
|
|
1021
|
+
| FlagMessageAction
|
|
1022
|
+
| AssignTicketAction
|
|
1023
|
+
| CloseTicketAction
|
|
1024
|
+
| AddChatLabelAction
|
|
1025
|
+
| AddTicketLabelAction
|
|
1026
|
+
| AssignChatAction
|
|
1027
|
+
| ForwardMessageAction
|
|
1028
|
+
| SendEmailAction
|
|
1029
|
+
| ReplyToMessageAction
|
|
1030
|
+
| UpdateCustomPropertyAction
|
|
1031
|
+
| DeleteMessageAction
|
|
1032
|
+
| SendSlackNotificationAction
|
|
1033
|
+
| AttachMessageToTicketAction
|
|
1034
|
+
| CloseChatAction
|
|
1035
|
+
| SendMessageToChatAction
|
|
1036
|
+
| FreshdeskCreateTicketAction
|
|
1037
|
+
| HubspotCreateTicketAction
|
|
1038
|
+
| ZohodeskCreateTicketAction;
|
|
1039
|
+
|
|
1040
|
+
export const isSendMessageOrReplyToMessageAction = (
|
|
1041
|
+
action: Action
|
|
1042
|
+
): action is SendMessageAction | ReplyToMessageAction => {
|
|
1043
|
+
return ['send_message', 'reply_to_message'].includes(action.type);
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
export type Rule = OverrideProperties<
|
|
1047
|
+
Tables<'tbl_automation_rules'>,
|
|
1048
|
+
{
|
|
1049
|
+
actions: Action[];
|
|
1050
|
+
conditions: Conditions;
|
|
1051
|
+
trigger:
|
|
1052
|
+
| 'message.created'
|
|
1053
|
+
| 'message.updated'
|
|
1054
|
+
| 'chat.created'
|
|
1055
|
+
| 'ticket.updated'
|
|
1056
|
+
| 'ticket.created'
|
|
1057
|
+
| 'reaction.added'
|
|
1058
|
+
| 'chat.label.updated'
|
|
1059
|
+
| 'message.flagged'
|
|
1060
|
+
| 'message.unflagged'
|
|
1061
|
+
| 'message.deleted'
|
|
1062
|
+
| 'ticket.closed';
|
|
1063
|
+
}
|
|
1064
|
+
>;
|
|
1065
|
+
|
|
1066
|
+
export const RuleNameMap: Record<
|
|
1067
|
+
Rule['trigger'],
|
|
1068
|
+
{
|
|
1069
|
+
title: string;
|
|
1070
|
+
description: string;
|
|
1071
|
+
base_conditions: {
|
|
1072
|
+
org_phone: boolean;
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
> = {
|
|
1076
|
+
'message.created': {
|
|
1077
|
+
title: 'New Message Received',
|
|
1078
|
+
description: 'When a new message is received from an external contact',
|
|
1079
|
+
base_conditions: {
|
|
1080
|
+
org_phone: true,
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
'chat.created': {
|
|
1084
|
+
title: 'New Chat Created',
|
|
1085
|
+
description: 'When a new chat is created',
|
|
1086
|
+
base_conditions: {
|
|
1087
|
+
org_phone: true,
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1090
|
+
'ticket.created': {
|
|
1091
|
+
title: 'New Ticket Created',
|
|
1092
|
+
description: 'When a new ticket is created',
|
|
1093
|
+
base_conditions: {
|
|
1094
|
+
org_phone: false,
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
'reaction.added': {
|
|
1098
|
+
title: 'New Reaction Added',
|
|
1099
|
+
description: 'When a reaction is added on a message',
|
|
1100
|
+
base_conditions: {
|
|
1101
|
+
org_phone: true,
|
|
1102
|
+
},
|
|
1103
|
+
},
|
|
1104
|
+
'message.updated': {
|
|
1105
|
+
title: 'Message Updated',
|
|
1106
|
+
description: 'When a message is updated',
|
|
1107
|
+
base_conditions: {
|
|
1108
|
+
org_phone: true,
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
1111
|
+
'ticket.updated': {
|
|
1112
|
+
title: 'Ticket Updated',
|
|
1113
|
+
description: 'When a ticket is updated',
|
|
1114
|
+
base_conditions: {
|
|
1115
|
+
org_phone: false,
|
|
1116
|
+
},
|
|
1117
|
+
},
|
|
1118
|
+
'chat.label.updated': {
|
|
1119
|
+
title: 'Chat Label Added/Removed',
|
|
1120
|
+
description: 'When labels on chats are updated',
|
|
1121
|
+
base_conditions: {
|
|
1122
|
+
org_phone: false,
|
|
1123
|
+
},
|
|
1124
|
+
},
|
|
1125
|
+
'message.flagged': {
|
|
1126
|
+
title: 'Message Flagged',
|
|
1127
|
+
description: 'When a message is flagged',
|
|
1128
|
+
base_conditions: {
|
|
1129
|
+
org_phone: true,
|
|
1130
|
+
},
|
|
1131
|
+
},
|
|
1132
|
+
'message.unflagged': {
|
|
1133
|
+
title: 'Message Unflagged',
|
|
1134
|
+
description: 'When a message is unflagged',
|
|
1135
|
+
base_conditions: {
|
|
1136
|
+
org_phone: true,
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
'message.deleted': {
|
|
1140
|
+
title: 'Message Deleted',
|
|
1141
|
+
description: 'When a message is Deleted',
|
|
1142
|
+
base_conditions: {
|
|
1143
|
+
org_phone: true,
|
|
1144
|
+
},
|
|
1145
|
+
},
|
|
1146
|
+
'ticket.closed': {
|
|
1147
|
+
title: 'Ticket Closed',
|
|
1148
|
+
description: 'When a Ticket is Closed',
|
|
1149
|
+
base_conditions: {
|
|
1150
|
+
org_phone: false,
|
|
1151
|
+
},
|
|
1152
|
+
},
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
export type ValidateFunction<T extends any[] = any[]> = (...args: T) => boolean;
|
|
1156
|
+
|
|
1157
|
+
type ValidateArgsMap = {
|
|
1158
|
+
create_ticket_on_freshdesk: [OrgType, Rule];
|
|
1159
|
+
create_ticket_on_hubspot: [OrgType, Rule];
|
|
1160
|
+
create_ticket_on_zohodesk: [OrgType, Rule];
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1163
|
+
type ActionNameMapType = {
|
|
1164
|
+
[K in Action['type']]: {
|
|
1165
|
+
title: string;
|
|
1166
|
+
description: string;
|
|
1167
|
+
inputs: Record<
|
|
1168
|
+
string,
|
|
1169
|
+
{
|
|
1170
|
+
id: string;
|
|
1171
|
+
type:
|
|
1172
|
+
| 'text'
|
|
1173
|
+
| 'dropdown'
|
|
1174
|
+
| 'editor'
|
|
1175
|
+
| 'date'
|
|
1176
|
+
| 'file'
|
|
1177
|
+
| 'textarea'
|
|
1178
|
+
| 'dynamic'
|
|
1179
|
+
| 'json_editor';
|
|
1180
|
+
value:
|
|
1181
|
+
| 'ticket.labels'
|
|
1182
|
+
| 'org.members'
|
|
1183
|
+
| 'chat.labels'
|
|
1184
|
+
| 'org.chats'
|
|
1185
|
+
| {
|
|
1186
|
+
id: string;
|
|
1187
|
+
value: string;
|
|
1188
|
+
label: string;
|
|
1189
|
+
}[]
|
|
1190
|
+
| null
|
|
1191
|
+
| 'org.custom_properties'
|
|
1192
|
+
| 'custom_property_values'
|
|
1193
|
+
| 'debounce_messages';
|
|
1194
|
+
label: string;
|
|
1195
|
+
placeholder: string;
|
|
1196
|
+
info?: string;
|
|
1197
|
+
required: boolean;
|
|
1198
|
+
description?: string;
|
|
1199
|
+
}
|
|
1200
|
+
>;
|
|
1201
|
+
validate: K extends keyof ValidateArgsMap
|
|
1202
|
+
? ValidateFunction<ValidateArgsMap[K]>
|
|
1203
|
+
: ValidateFunction<never[]>;
|
|
1204
|
+
info?: string;
|
|
1205
|
+
validTriggers: Rule['trigger'][];
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
export const ActionNameMap: ActionNameMapType = {
|
|
1210
|
+
send_message: {
|
|
1211
|
+
title: 'Send Message',
|
|
1212
|
+
description: 'Send a message',
|
|
1213
|
+
inputs: {
|
|
1214
|
+
message: {
|
|
1215
|
+
id: 'message',
|
|
1216
|
+
type: 'editor',
|
|
1217
|
+
label: 'Message',
|
|
1218
|
+
placeholder: 'Enter message',
|
|
1219
|
+
value: null,
|
|
1220
|
+
required: true,
|
|
1221
|
+
},
|
|
1222
|
+
media: {
|
|
1223
|
+
id: 'media',
|
|
1224
|
+
type: 'file',
|
|
1225
|
+
label: 'Media',
|
|
1226
|
+
placeholder: 'Upload media',
|
|
1227
|
+
value: null,
|
|
1228
|
+
required: false,
|
|
1229
|
+
},
|
|
1230
|
+
maintain_flag_status: {
|
|
1231
|
+
id: 'maintain_flag_status',
|
|
1232
|
+
type: 'dropdown',
|
|
1233
|
+
label: 'Maintain Flag Status',
|
|
1234
|
+
placeholder: 'Select...',
|
|
1235
|
+
value: [
|
|
1236
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1237
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1238
|
+
],
|
|
1239
|
+
required: true,
|
|
1240
|
+
},
|
|
1241
|
+
debounce_messages: {
|
|
1242
|
+
id: 'debounce_messages',
|
|
1243
|
+
type: 'dropdown',
|
|
1244
|
+
label: 'Enable Cooldown Period',
|
|
1245
|
+
placeholder: 'Select...',
|
|
1246
|
+
value: [
|
|
1247
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1248
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1249
|
+
],
|
|
1250
|
+
info: 'If enabled, only one message per chat will be sent in the specified cooldown period',
|
|
1251
|
+
required: false,
|
|
1252
|
+
},
|
|
1253
|
+
debounce_message_time: {
|
|
1254
|
+
id: 'debounce_message_time',
|
|
1255
|
+
type: 'dynamic',
|
|
1256
|
+
label: 'Cooldown Period',
|
|
1257
|
+
placeholder: 'Enter time',
|
|
1258
|
+
value: 'debounce_messages',
|
|
1259
|
+
required: false,
|
|
1260
|
+
},
|
|
1261
|
+
},
|
|
1262
|
+
validTriggers: [
|
|
1263
|
+
'message.created',
|
|
1264
|
+
'message.updated',
|
|
1265
|
+
'chat.created',
|
|
1266
|
+
'ticket.updated',
|
|
1267
|
+
'ticket.created',
|
|
1268
|
+
'reaction.added',
|
|
1269
|
+
'message.flagged',
|
|
1270
|
+
'message.unflagged',
|
|
1271
|
+
'chat.label.updated',
|
|
1272
|
+
'message.deleted',
|
|
1273
|
+
'ticket.closed',
|
|
1274
|
+
],
|
|
1275
|
+
validate: () => true,
|
|
1276
|
+
},
|
|
1277
|
+
reply_to_message: {
|
|
1278
|
+
title: 'Reply to message',
|
|
1279
|
+
description: 'Send a message with the quoted message',
|
|
1280
|
+
inputs: {
|
|
1281
|
+
message: {
|
|
1282
|
+
id: 'message',
|
|
1283
|
+
type: 'editor',
|
|
1284
|
+
label: 'Message',
|
|
1285
|
+
placeholder: 'Enter message',
|
|
1286
|
+
value: null,
|
|
1287
|
+
required: true,
|
|
1288
|
+
},
|
|
1289
|
+
media: {
|
|
1290
|
+
id: 'media',
|
|
1291
|
+
type: 'file',
|
|
1292
|
+
label: 'Media',
|
|
1293
|
+
placeholder: 'Upload media',
|
|
1294
|
+
value: null,
|
|
1295
|
+
required: false,
|
|
1296
|
+
},
|
|
1297
|
+
maintain_flag_status: {
|
|
1298
|
+
id: 'maintain_flag_status',
|
|
1299
|
+
type: 'dropdown',
|
|
1300
|
+
label: 'Maintain Flag Status',
|
|
1301
|
+
placeholder: 'Select...',
|
|
1302
|
+
value: [
|
|
1303
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1304
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1305
|
+
],
|
|
1306
|
+
required: true,
|
|
1307
|
+
},
|
|
1308
|
+
debounce_messages: {
|
|
1309
|
+
id: 'debounce_messages',
|
|
1310
|
+
type: 'dropdown',
|
|
1311
|
+
label: 'Enable Cooldown Period',
|
|
1312
|
+
placeholder: 'Select...',
|
|
1313
|
+
value: [
|
|
1314
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1315
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1316
|
+
],
|
|
1317
|
+
info: 'If enabled, only one message per chat will be sent in the specified cooldown period',
|
|
1318
|
+
required: false,
|
|
1319
|
+
},
|
|
1320
|
+
debounce_message_time: {
|
|
1321
|
+
id: 'debounce_message_time',
|
|
1322
|
+
type: 'dynamic',
|
|
1323
|
+
label: 'Cooldown Period',
|
|
1324
|
+
placeholder: 'Enter time',
|
|
1325
|
+
value: 'debounce_messages',
|
|
1326
|
+
required: false,
|
|
1327
|
+
},
|
|
1328
|
+
},
|
|
1329
|
+
validTriggers: [
|
|
1330
|
+
'message.created',
|
|
1331
|
+
'message.updated',
|
|
1332
|
+
'reaction.added',
|
|
1333
|
+
'message.flagged',
|
|
1334
|
+
'ticket.created',
|
|
1335
|
+
'ticket.updated',
|
|
1336
|
+
'ticket.closed',
|
|
1337
|
+
'message.unflagged',
|
|
1338
|
+
],
|
|
1339
|
+
validate: () => true,
|
|
1340
|
+
},
|
|
1341
|
+
delete_message: {
|
|
1342
|
+
title: 'Delete Message',
|
|
1343
|
+
description: 'Delete a message',
|
|
1344
|
+
inputs: {},
|
|
1345
|
+
validTriggers: [
|
|
1346
|
+
'message.created',
|
|
1347
|
+
'message.updated',
|
|
1348
|
+
'reaction.added',
|
|
1349
|
+
'message.flagged',
|
|
1350
|
+
'ticket.created',
|
|
1351
|
+
'ticket.updated',
|
|
1352
|
+
'ticket.closed',
|
|
1353
|
+
'message.unflagged',
|
|
1354
|
+
],
|
|
1355
|
+
validate: () => true,
|
|
1356
|
+
},
|
|
1357
|
+
attach_message_to_ticket: {
|
|
1358
|
+
title: 'Attach Message To Latest Ticket',
|
|
1359
|
+
description: 'Attach message to latest ticket based on statuses',
|
|
1360
|
+
inputs: {
|
|
1361
|
+
status: {
|
|
1362
|
+
id: 'status',
|
|
1363
|
+
type: 'dropdown',
|
|
1364
|
+
value: [
|
|
1365
|
+
{
|
|
1366
|
+
id: 'open_inprogress',
|
|
1367
|
+
value: 'open_inprogress',
|
|
1368
|
+
label: 'Open/In Progress',
|
|
1369
|
+
},
|
|
1370
|
+
{ id: 'open', value: 'open', label: 'Open' },
|
|
1371
|
+
{ id: 'inprogress', value: 'inprogress', label: 'In Progress' },
|
|
1372
|
+
],
|
|
1373
|
+
label: 'Ticket Status',
|
|
1374
|
+
placeholder: 'Select...',
|
|
1375
|
+
required: true,
|
|
1376
|
+
info: 'Select the ticket status of ticket to attach the message to (only applicable for open or inprogress tickets)',
|
|
1377
|
+
},
|
|
1378
|
+
},
|
|
1379
|
+
validTriggers: [
|
|
1380
|
+
'message.created',
|
|
1381
|
+
'message.updated',
|
|
1382
|
+
'reaction.added',
|
|
1383
|
+
'message.flagged',
|
|
1384
|
+
],
|
|
1385
|
+
validate: () => true,
|
|
1386
|
+
},
|
|
1387
|
+
notify_http: {
|
|
1388
|
+
title: 'Notify HTTP',
|
|
1389
|
+
description: 'Notify an HTTP endpoint',
|
|
1390
|
+
inputs: {
|
|
1391
|
+
url: {
|
|
1392
|
+
id: 'url',
|
|
1393
|
+
type: 'text',
|
|
1394
|
+
label: 'URL',
|
|
1395
|
+
placeholder: 'Enter URL',
|
|
1396
|
+
value: null,
|
|
1397
|
+
required: true,
|
|
1398
|
+
description:
|
|
1399
|
+
'Enter the Webhook URL here. The endpoint added here should be a **POST HTTP / Endpoint** with no open auth.',
|
|
1400
|
+
},
|
|
1401
|
+
},
|
|
1402
|
+
validTriggers: [
|
|
1403
|
+
'message.created',
|
|
1404
|
+
'message.updated',
|
|
1405
|
+
'chat.created',
|
|
1406
|
+
'ticket.updated',
|
|
1407
|
+
'ticket.created',
|
|
1408
|
+
'reaction.added',
|
|
1409
|
+
'message.flagged',
|
|
1410
|
+
'chat.label.updated',
|
|
1411
|
+
'message.deleted',
|
|
1412
|
+
'ticket.closed',
|
|
1413
|
+
'message.unflagged',
|
|
1414
|
+
],
|
|
1415
|
+
validate: () => true,
|
|
1416
|
+
},
|
|
1417
|
+
create_ticket: {
|
|
1418
|
+
title: 'Create Ticket or Attach Message To Latest Ticket',
|
|
1419
|
+
description: 'Create a ticket or attach message to latest ticket',
|
|
1420
|
+
inputs: {
|
|
1421
|
+
append_to_latest_ticket: {
|
|
1422
|
+
id: 'append_to_latest_ticket',
|
|
1423
|
+
type: 'dropdown',
|
|
1424
|
+
value: [
|
|
1425
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1426
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1427
|
+
],
|
|
1428
|
+
label: 'Attach message to latest ticket (if available)',
|
|
1429
|
+
placeholder: 'Select...',
|
|
1430
|
+
info: 'If enabled, the message will be appended to the latest open ticket (if available) else a new ticket will be created',
|
|
1431
|
+
required: false,
|
|
1432
|
+
},
|
|
1433
|
+
priority: {
|
|
1434
|
+
id: 'priority',
|
|
1435
|
+
type: 'dropdown',
|
|
1436
|
+
value: [
|
|
1437
|
+
{ id: '0', value: '0', label: 'No Priority' },
|
|
1438
|
+
{ id: '1', value: '1', label: 'Low' },
|
|
1439
|
+
{ id: '2', value: '2', label: 'Medium' },
|
|
1440
|
+
{ id: '3', value: '3', label: 'High' },
|
|
1441
|
+
{ id: '4', value: '4', label: 'Urgent' },
|
|
1442
|
+
],
|
|
1443
|
+
label: 'Priority (New Ticket)',
|
|
1444
|
+
placeholder: 'Select priority',
|
|
1445
|
+
info: 'Only applicable for create ticket. If no priority is selected, the ticket will have no priority.',
|
|
1446
|
+
required: false,
|
|
1447
|
+
},
|
|
1448
|
+
label: {
|
|
1449
|
+
id: 'label',
|
|
1450
|
+
type: 'dropdown',
|
|
1451
|
+
value: 'ticket.labels',
|
|
1452
|
+
label: 'Label (New Ticket)',
|
|
1453
|
+
placeholder: 'Select label',
|
|
1454
|
+
info: 'Only applicable for create ticket. If no label is selected, the ticket will have no label.',
|
|
1455
|
+
required: false,
|
|
1456
|
+
},
|
|
1457
|
+
round_robin: {
|
|
1458
|
+
id: 'round_robin',
|
|
1459
|
+
type: 'dropdown',
|
|
1460
|
+
value: [
|
|
1461
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1462
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1463
|
+
],
|
|
1464
|
+
label: 'Enable Round Robin (New Ticket: Assignee)',
|
|
1465
|
+
placeholder: 'Select...',
|
|
1466
|
+
info: 'If enabled, the ticket will be assigned to the next available agent in the list',
|
|
1467
|
+
required: false,
|
|
1468
|
+
},
|
|
1469
|
+
rr_check_for: {
|
|
1470
|
+
id: 'rr_check_for',
|
|
1471
|
+
type: 'dropdown',
|
|
1472
|
+
value: [
|
|
1473
|
+
{
|
|
1474
|
+
id: 'shift_time',
|
|
1475
|
+
value: 'shift_time',
|
|
1476
|
+
label: 'Consider shift timings',
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
id: 'user_status',
|
|
1480
|
+
value: 'user_status',
|
|
1481
|
+
label: 'Exclude users marked as offline',
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
id: 'shift_time user_status',
|
|
1485
|
+
value: 'shift_time user_status',
|
|
1486
|
+
label: 'Consider both shift timings and user status',
|
|
1487
|
+
},
|
|
1488
|
+
],
|
|
1489
|
+
label: 'Check Assignee status for (Round Robin)',
|
|
1490
|
+
placeholder: 'Select...',
|
|
1491
|
+
info: 'Criteria for assigning the next available agent',
|
|
1492
|
+
required: false,
|
|
1493
|
+
},
|
|
1494
|
+
assignee: {
|
|
1495
|
+
id: 'assignee',
|
|
1496
|
+
type: 'dynamic',
|
|
1497
|
+
value: 'org.members',
|
|
1498
|
+
label: 'Assignee (New Ticket)',
|
|
1499
|
+
placeholder: 'Select assignee',
|
|
1500
|
+
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",
|
|
1501
|
+
required: false,
|
|
1502
|
+
},
|
|
1503
|
+
},
|
|
1504
|
+
validTriggers: [
|
|
1505
|
+
'message.created',
|
|
1506
|
+
'message.updated',
|
|
1507
|
+
'reaction.added',
|
|
1508
|
+
'message.flagged',
|
|
1509
|
+
'message.unflagged',
|
|
1510
|
+
],
|
|
1511
|
+
validate: () => true,
|
|
1512
|
+
},
|
|
1513
|
+
flag_message: {
|
|
1514
|
+
title: 'Update flag status',
|
|
1515
|
+
description: 'Flag/Unflag a message',
|
|
1516
|
+
inputs: {
|
|
1517
|
+
flag: {
|
|
1518
|
+
id: 'flag',
|
|
1519
|
+
type: 'dropdown',
|
|
1520
|
+
value: [
|
|
1521
|
+
{ id: 'flag', value: 'true', label: 'True' },
|
|
1522
|
+
{ id: 'unflag', value: 'false', label: 'False' },
|
|
1523
|
+
],
|
|
1524
|
+
label: 'Flag status',
|
|
1525
|
+
placeholder: 'Select flag',
|
|
1526
|
+
required: true,
|
|
1527
|
+
},
|
|
1528
|
+
},
|
|
1529
|
+
validTriggers: [
|
|
1530
|
+
'message.created',
|
|
1531
|
+
'message.updated',
|
|
1532
|
+
'reaction.added',
|
|
1533
|
+
'message.flagged',
|
|
1534
|
+
'message.unflagged',
|
|
1535
|
+
'ticket.created',
|
|
1536
|
+
'ticket.updated',
|
|
1537
|
+
'ticket.closed',
|
|
1538
|
+
],
|
|
1539
|
+
validate: () => true,
|
|
1540
|
+
},
|
|
1541
|
+
assign_ticket: {
|
|
1542
|
+
title: 'Assign Ticket',
|
|
1543
|
+
description: 'Assign a ticket',
|
|
1544
|
+
inputs: {
|
|
1545
|
+
round_robin: {
|
|
1546
|
+
id: 'round_robin',
|
|
1547
|
+
type: 'dropdown',
|
|
1548
|
+
value: [
|
|
1549
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1550
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1551
|
+
],
|
|
1552
|
+
label: 'Enable Round Robin',
|
|
1553
|
+
placeholder: 'Select...',
|
|
1554
|
+
info: 'If enabled, the ticket will be assigned to the next available agent in the list',
|
|
1555
|
+
required: false,
|
|
1556
|
+
},
|
|
1557
|
+
rr_check_for: {
|
|
1558
|
+
id: 'rr_check_for',
|
|
1559
|
+
type: 'dropdown',
|
|
1560
|
+
value: [
|
|
1561
|
+
{
|
|
1562
|
+
id: 'shift_time',
|
|
1563
|
+
value: 'shift_time',
|
|
1564
|
+
label: 'Consider shift timings',
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
id: 'user_status',
|
|
1568
|
+
value: 'user_status',
|
|
1569
|
+
label: 'Exclude users marked as offline',
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
id: 'shift_time user_status',
|
|
1573
|
+
value: 'shift_time user_status',
|
|
1574
|
+
label: 'Consider both shift timings and user status',
|
|
1575
|
+
},
|
|
1576
|
+
],
|
|
1577
|
+
label: 'Check Assignee status for (Round Robin)',
|
|
1578
|
+
placeholder: 'Select...',
|
|
1579
|
+
info: 'Criteria for assigning the next available agent',
|
|
1580
|
+
required: false,
|
|
1581
|
+
},
|
|
1582
|
+
assignee: {
|
|
1583
|
+
id: 'assignee',
|
|
1584
|
+
type: 'dynamic',
|
|
1585
|
+
value: 'org.members',
|
|
1586
|
+
label: 'Assignee',
|
|
1587
|
+
placeholder: 'Select assignee',
|
|
1588
|
+
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",
|
|
1589
|
+
required: true,
|
|
1590
|
+
},
|
|
1591
|
+
},
|
|
1592
|
+
validTriggers: ['ticket.updated', 'ticket.created'],
|
|
1593
|
+
validate: () => true,
|
|
1594
|
+
},
|
|
1595
|
+
close_ticket: {
|
|
1596
|
+
title: 'Close Ticket',
|
|
1597
|
+
description: 'Close a ticket',
|
|
1598
|
+
info: "This action will close the ticket. This doesn't check for mandatory ticket custom properties.",
|
|
1599
|
+
inputs: {
|
|
1600
|
+
closing_note: {
|
|
1601
|
+
id: 'closing_note',
|
|
1602
|
+
type: 'textarea',
|
|
1603
|
+
label: 'Closing Note',
|
|
1604
|
+
placeholder: 'Enter closing note',
|
|
1605
|
+
value: null,
|
|
1606
|
+
required: false,
|
|
1607
|
+
},
|
|
1608
|
+
},
|
|
1609
|
+
validTriggers: [
|
|
1610
|
+
'ticket.updated',
|
|
1611
|
+
'ticket.created',
|
|
1612
|
+
'reaction.added',
|
|
1613
|
+
'message.unflagged',
|
|
1614
|
+
'message.deleted',
|
|
1615
|
+
],
|
|
1616
|
+
validate: () => true,
|
|
1617
|
+
},
|
|
1618
|
+
add_chat_label: {
|
|
1619
|
+
title: 'Add Chat Label',
|
|
1620
|
+
description: 'Add a label to referred chat',
|
|
1621
|
+
inputs: {
|
|
1622
|
+
label: {
|
|
1623
|
+
id: 'label',
|
|
1624
|
+
type: 'dropdown',
|
|
1625
|
+
value: 'chat.labels',
|
|
1626
|
+
label: 'Label',
|
|
1627
|
+
placeholder: 'Select label',
|
|
1628
|
+
required: true,
|
|
1629
|
+
},
|
|
1630
|
+
},
|
|
1631
|
+
validTriggers: [
|
|
1632
|
+
'message.created',
|
|
1633
|
+
'message.updated',
|
|
1634
|
+
'chat.created',
|
|
1635
|
+
'ticket.updated',
|
|
1636
|
+
'ticket.created',
|
|
1637
|
+
'reaction.added',
|
|
1638
|
+
'chat.label.updated',
|
|
1639
|
+
'message.flagged',
|
|
1640
|
+
'message.deleted',
|
|
1641
|
+
'message.unflagged',
|
|
1642
|
+
'ticket.closed',
|
|
1643
|
+
],
|
|
1644
|
+
validate: () => true,
|
|
1645
|
+
},
|
|
1646
|
+
add_ticket_label: {
|
|
1647
|
+
title: 'Add Ticket Label',
|
|
1648
|
+
description: 'Add a label to referred ticket',
|
|
1649
|
+
inputs: {
|
|
1650
|
+
label: {
|
|
1651
|
+
id: 'label',
|
|
1652
|
+
type: 'dropdown',
|
|
1653
|
+
value: 'ticket.labels',
|
|
1654
|
+
label: 'Label',
|
|
1655
|
+
placeholder: 'Select label',
|
|
1656
|
+
required: true,
|
|
1657
|
+
},
|
|
1658
|
+
},
|
|
1659
|
+
validTriggers: ['ticket.updated', 'ticket.created'],
|
|
1660
|
+
validate: () => true,
|
|
1661
|
+
},
|
|
1662
|
+
update_custom_property: {
|
|
1663
|
+
description: 'Update a chat custom property',
|
|
1664
|
+
title: 'Update Chat Custom Property',
|
|
1665
|
+
validTriggers: [
|
|
1666
|
+
'message.created',
|
|
1667
|
+
'message.updated',
|
|
1668
|
+
'chat.created',
|
|
1669
|
+
'ticket.updated',
|
|
1670
|
+
'ticket.created',
|
|
1671
|
+
'reaction.added',
|
|
1672
|
+
'message.flagged',
|
|
1673
|
+
'chat.label.updated',
|
|
1674
|
+
'message.deleted',
|
|
1675
|
+
'message.unflagged',
|
|
1676
|
+
'ticket.closed',
|
|
1677
|
+
],
|
|
1678
|
+
inputs: {
|
|
1679
|
+
property_id: {
|
|
1680
|
+
id: 'property_id',
|
|
1681
|
+
type: 'dropdown',
|
|
1682
|
+
value: 'org.custom_properties',
|
|
1683
|
+
label: 'Property',
|
|
1684
|
+
placeholder: 'Select property',
|
|
1685
|
+
required: true,
|
|
1686
|
+
},
|
|
1687
|
+
value: {
|
|
1688
|
+
id: 'property_id',
|
|
1689
|
+
type: 'dynamic',
|
|
1690
|
+
label: 'Value',
|
|
1691
|
+
placeholder: 'Enter value',
|
|
1692
|
+
value: 'custom_property_values',
|
|
1693
|
+
required: true,
|
|
1694
|
+
},
|
|
1695
|
+
},
|
|
1696
|
+
validate: () => true,
|
|
1697
|
+
},
|
|
1698
|
+
assign_chat: {
|
|
1699
|
+
title: 'Assign Chat',
|
|
1700
|
+
description: 'Assign a chat',
|
|
1701
|
+
inputs: {
|
|
1702
|
+
round_robin: {
|
|
1703
|
+
id: 'round_robin',
|
|
1704
|
+
type: 'dropdown',
|
|
1705
|
+
value: [
|
|
1706
|
+
{ id: 'true', value: 'true', label: 'True' },
|
|
1707
|
+
{ id: 'false', value: 'false', label: 'False' },
|
|
1708
|
+
],
|
|
1709
|
+
label: 'Enable Round Robin',
|
|
1710
|
+
placeholder: 'Select...',
|
|
1711
|
+
info: 'If enabled, the chat will be assigned to the next available agent in the list',
|
|
1712
|
+
required: false,
|
|
1713
|
+
},
|
|
1714
|
+
rr_check_for: {
|
|
1715
|
+
id: 'rr_check_for',
|
|
1716
|
+
type: 'dropdown',
|
|
1717
|
+
value: [
|
|
1718
|
+
{
|
|
1719
|
+
id: 'shift_time',
|
|
1720
|
+
value: 'shift_time',
|
|
1721
|
+
label: 'Consider shift timings',
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
id: 'user_status',
|
|
1725
|
+
value: 'user_status',
|
|
1726
|
+
label: 'Exclude users marked as offline',
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
id: 'shift_time user_status',
|
|
1730
|
+
value: 'shift_time user_status',
|
|
1731
|
+
label: 'Consider both shift timings and user status',
|
|
1732
|
+
},
|
|
1733
|
+
],
|
|
1734
|
+
label: 'Check Assignee status for (Round Robin)',
|
|
1735
|
+
placeholder: 'Select...',
|
|
1736
|
+
info: 'Criteria for assigning the next available agent',
|
|
1737
|
+
required: false,
|
|
1738
|
+
},
|
|
1739
|
+
assignee: {
|
|
1740
|
+
id: 'assignee',
|
|
1741
|
+
type: 'dynamic',
|
|
1742
|
+
value: 'org.members',
|
|
1743
|
+
label: 'Assignee',
|
|
1744
|
+
placeholder: 'Select assignee',
|
|
1745
|
+
required: true,
|
|
1746
|
+
},
|
|
1747
|
+
},
|
|
1748
|
+
validTriggers: [
|
|
1749
|
+
'message.created',
|
|
1750
|
+
'message.updated',
|
|
1751
|
+
'chat.created',
|
|
1752
|
+
'ticket.updated',
|
|
1753
|
+
'ticket.created',
|
|
1754
|
+
'reaction.added',
|
|
1755
|
+
'chat.label.updated',
|
|
1756
|
+
'message.flagged',
|
|
1757
|
+
'message.deleted',
|
|
1758
|
+
'message.unflagged',
|
|
1759
|
+
'ticket.closed',
|
|
1760
|
+
],
|
|
1761
|
+
validate: () => true,
|
|
1762
|
+
},
|
|
1763
|
+
close_chat: {
|
|
1764
|
+
title: 'Close Chat',
|
|
1765
|
+
description: 'Close a chat conversation',
|
|
1766
|
+
inputs: {},
|
|
1767
|
+
validTriggers: [
|
|
1768
|
+
'message.created',
|
|
1769
|
+
'message.updated',
|
|
1770
|
+
'chat.created',
|
|
1771
|
+
'ticket.updated',
|
|
1772
|
+
'ticket.created',
|
|
1773
|
+
'reaction.added',
|
|
1774
|
+
'chat.label.updated',
|
|
1775
|
+
'message.flagged',
|
|
1776
|
+
'message.unflagged',
|
|
1777
|
+
'message.deleted',
|
|
1778
|
+
'ticket.closed',
|
|
1779
|
+
],
|
|
1780
|
+
validate: () => true,
|
|
1781
|
+
},
|
|
1782
|
+
forward_message: {
|
|
1783
|
+
title: 'Forward Message',
|
|
1784
|
+
description: 'Forward a message',
|
|
1785
|
+
inputs: {
|
|
1786
|
+
chat_id: {
|
|
1787
|
+
id: 'chat_id',
|
|
1788
|
+
type: 'dropdown',
|
|
1789
|
+
value: 'org.chats',
|
|
1790
|
+
label: 'Chat',
|
|
1791
|
+
placeholder: 'Select chat',
|
|
1792
|
+
required: true,
|
|
1793
|
+
},
|
|
1794
|
+
},
|
|
1795
|
+
validTriggers: [
|
|
1796
|
+
'message.created',
|
|
1797
|
+
'message.updated',
|
|
1798
|
+
'ticket.updated',
|
|
1799
|
+
'ticket.created',
|
|
1800
|
+
'reaction.added',
|
|
1801
|
+
'message.unflagged',
|
|
1802
|
+
'message.flagged',
|
|
1803
|
+
'ticket.closed',
|
|
1804
|
+
],
|
|
1805
|
+
validate: () => true,
|
|
1806
|
+
},
|
|
1807
|
+
send_email: {
|
|
1808
|
+
title: 'Send Email',
|
|
1809
|
+
description: 'Send an email',
|
|
1810
|
+
inputs: {
|
|
1811
|
+
email: {
|
|
1812
|
+
id: 'email',
|
|
1813
|
+
type: 'text',
|
|
1814
|
+
label: 'Email',
|
|
1815
|
+
placeholder: 'Enter email',
|
|
1816
|
+
value: null,
|
|
1817
|
+
required: true,
|
|
1818
|
+
},
|
|
1819
|
+
subject: {
|
|
1820
|
+
id: 'subject',
|
|
1821
|
+
type: 'editor',
|
|
1822
|
+
label: 'Subject',
|
|
1823
|
+
placeholder: 'Enter subject',
|
|
1824
|
+
value: null,
|
|
1825
|
+
required: true,
|
|
1826
|
+
},
|
|
1827
|
+
body: {
|
|
1828
|
+
id: 'body',
|
|
1829
|
+
type: 'editor',
|
|
1830
|
+
label: 'Body',
|
|
1831
|
+
placeholder: 'Enter body',
|
|
1832
|
+
value: null,
|
|
1833
|
+
required: true,
|
|
1834
|
+
},
|
|
1835
|
+
},
|
|
1836
|
+
validTriggers: [
|
|
1837
|
+
'message.created',
|
|
1838
|
+
'message.updated',
|
|
1839
|
+
'chat.created',
|
|
1840
|
+
'ticket.updated',
|
|
1841
|
+
'ticket.created',
|
|
1842
|
+
'reaction.added',
|
|
1843
|
+
'message.flagged',
|
|
1844
|
+
'message.unflagged',
|
|
1845
|
+
'chat.label.updated',
|
|
1846
|
+
'message.deleted',
|
|
1847
|
+
'ticket.closed',
|
|
1848
|
+
],
|
|
1849
|
+
validate: () => true,
|
|
1850
|
+
},
|
|
1851
|
+
send_slack_notification: {
|
|
1852
|
+
title: 'Send Slack Webhook Notification',
|
|
1853
|
+
description: 'Send a slack webhook notification to a channel',
|
|
1854
|
+
validTriggers: [
|
|
1855
|
+
'message.created',
|
|
1856
|
+
'message.updated',
|
|
1857
|
+
'chat.created',
|
|
1858
|
+
'ticket.updated',
|
|
1859
|
+
'ticket.created',
|
|
1860
|
+
'reaction.added',
|
|
1861
|
+
'message.flagged',
|
|
1862
|
+
'message.unflagged',
|
|
1863
|
+
'chat.label.updated',
|
|
1864
|
+
'message.deleted',
|
|
1865
|
+
'ticket.closed',
|
|
1866
|
+
],
|
|
1867
|
+
inputs: {
|
|
1868
|
+
webhook_url: {
|
|
1869
|
+
type: 'text',
|
|
1870
|
+
id: 'webhook_url',
|
|
1871
|
+
label: 'Webhook URL',
|
|
1872
|
+
placeholder: 'Enter webhook URL',
|
|
1873
|
+
value: null,
|
|
1874
|
+
required: true,
|
|
1875
|
+
description:
|
|
1876
|
+
'Enter the webhook URL to send the notification, to create a slack incoming webhook to start receiving notification check [here](https://api.slack.com/messaging/webhooks)',
|
|
1877
|
+
},
|
|
1878
|
+
slack_payload: {
|
|
1879
|
+
type: 'json_editor',
|
|
1880
|
+
id: 'slack_payload',
|
|
1881
|
+
label: 'Slack Notification Payload',
|
|
1882
|
+
placeholder: 'Enter payload',
|
|
1883
|
+
value: null,
|
|
1884
|
+
required: true,
|
|
1885
|
+
description:
|
|
1886
|
+
'You can send slack blocks as notifications to the provided hook URL.\n\nIn order to **build a slack notification block**, you can visit [here](https://api.slack.com/block-kit/building)',
|
|
1887
|
+
},
|
|
1888
|
+
},
|
|
1889
|
+
validate: () => true,
|
|
1890
|
+
},
|
|
1891
|
+
send_message_to_chat: {
|
|
1892
|
+
title: 'Send Message To Chat',
|
|
1893
|
+
description: 'Send a message to a specified chat',
|
|
1894
|
+
inputs: {
|
|
1895
|
+
chat_id: {
|
|
1896
|
+
id: 'chat_id',
|
|
1897
|
+
type: 'dropdown',
|
|
1898
|
+
value: 'org.chats',
|
|
1899
|
+
label: 'Chat',
|
|
1900
|
+
placeholder: 'Select chat',
|
|
1901
|
+
required: true,
|
|
1902
|
+
},
|
|
1903
|
+
message: {
|
|
1904
|
+
id: 'message',
|
|
1905
|
+
type: 'editor',
|
|
1906
|
+
label: 'Message',
|
|
1907
|
+
placeholder: 'Enter message',
|
|
1908
|
+
value: null,
|
|
1909
|
+
required: true,
|
|
1910
|
+
},
|
|
1911
|
+
media: {
|
|
1912
|
+
id: 'media',
|
|
1913
|
+
type: 'file',
|
|
1914
|
+
label: 'Media',
|
|
1915
|
+
placeholder: 'Upload media',
|
|
1916
|
+
value: null,
|
|
1917
|
+
required: false,
|
|
1918
|
+
},
|
|
1919
|
+
},
|
|
1920
|
+
validTriggers: [
|
|
1921
|
+
'message.created',
|
|
1922
|
+
'message.updated',
|
|
1923
|
+
'chat.created',
|
|
1924
|
+
'ticket.updated',
|
|
1925
|
+
'ticket.created',
|
|
1926
|
+
'reaction.added',
|
|
1927
|
+
'message.flagged',
|
|
1928
|
+
'message.unflagged',
|
|
1929
|
+
'chat.label.updated',
|
|
1930
|
+
'message.deleted',
|
|
1931
|
+
'ticket.closed',
|
|
1932
|
+
],
|
|
1933
|
+
validate: () => true,
|
|
1934
|
+
},
|
|
1935
|
+
create_ticket_on_freshdesk: {
|
|
1936
|
+
title: 'Create Ticket On Freshdesk',
|
|
1937
|
+
description: 'Create a ticket on Freshdesk',
|
|
1938
|
+
info: 'This action will create a ticket on Freshdesk. Please make sure you have a Freshdesk integration setup.',
|
|
1939
|
+
inputs: {},
|
|
1940
|
+
validTriggers: ['ticket.created'],
|
|
1941
|
+
validate: (org, rule) => {
|
|
1942
|
+
return (
|
|
1943
|
+
org.is_freshdesk_connected ||
|
|
1944
|
+
rule.actions.some((a) => a.type === 'create_ticket_on_freshdesk')
|
|
1945
|
+
);
|
|
1946
|
+
},
|
|
1947
|
+
},
|
|
1948
|
+
create_ticket_on_hubspot: {
|
|
1949
|
+
title: 'Create Ticket On Hubspot',
|
|
1950
|
+
description: 'Create a ticket on Hubspot',
|
|
1951
|
+
info: 'This action will create a ticket on Hubspot. Please make sure you have a Hubspot integration setup.',
|
|
1952
|
+
inputs: {},
|
|
1953
|
+
validTriggers: ['ticket.created'],
|
|
1954
|
+
validate: (org, rule) => {
|
|
1955
|
+
return (
|
|
1956
|
+
org.is_hubspot_connected ||
|
|
1957
|
+
rule.actions.some((a) => a.type === 'create_ticket_on_hubspot')
|
|
1958
|
+
);
|
|
1959
|
+
},
|
|
1960
|
+
},
|
|
1961
|
+
create_ticket_on_zohodesk: {
|
|
1962
|
+
title: 'Create Ticket On Zohodesk',
|
|
1963
|
+
description: 'Create a ticket on Zohodesk',
|
|
1964
|
+
info: 'This action will create a ticket on Zohodesk. Please make sure you have a Zohodesk integration setup.',
|
|
1965
|
+
inputs: {},
|
|
1966
|
+
validTriggers: ['ticket.created'],
|
|
1967
|
+
validate: (org, rule) => {
|
|
1968
|
+
return (
|
|
1969
|
+
org.is_zohodesk_connected ||
|
|
1970
|
+
rule.actions.some((a) => a.type === 'create_ticket_on_zohodesk')
|
|
1971
|
+
);
|
|
1972
|
+
},
|
|
1973
|
+
},
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1976
|
+
type editorVariablesList =
|
|
1977
|
+
| 'chat.assigned_to'
|
|
1978
|
+
| 'chat.chat_id'
|
|
1979
|
+
| 'chat.chat_name'
|
|
1980
|
+
| 'chat.chat_type'
|
|
1981
|
+
| 'chat.org_phone'
|
|
1982
|
+
| 'chat.org_id'
|
|
1983
|
+
| 'chat.group_description'
|
|
1984
|
+
| 'ticket.assignee'
|
|
1985
|
+
| 'ticket.due_date'
|
|
1986
|
+
| 'ticket.priority'
|
|
1987
|
+
| 'ticket.status'
|
|
1988
|
+
| 'ticket.subject'
|
|
1989
|
+
| 'ticket.ticket_id'
|
|
1990
|
+
| 'ticket.raised_by'
|
|
1991
|
+
| 'ticket.created_at'
|
|
1992
|
+
| 'sender.is_internal'
|
|
1993
|
+
| 'sender.is_admin'
|
|
1994
|
+
| 'sender.contact_name'
|
|
1995
|
+
| 'sender.contact_id'
|
|
1996
|
+
| 'reaction.sender_id'
|
|
1997
|
+
| 'reaction.reaction'
|
|
1998
|
+
| 'message.message_id'
|
|
1999
|
+
| 'message.timestamp'
|
|
2000
|
+
| 'message.sender_phone'
|
|
2001
|
+
| 'message.message_type'
|
|
2002
|
+
| 'message.media'
|
|
2003
|
+
| 'message.body';
|
|
2004
|
+
|
|
2005
|
+
export const editorVariables: Array<{
|
|
2006
|
+
label: string;
|
|
2007
|
+
value: editorVariablesList;
|
|
2008
|
+
validTriggers: Rule['trigger'][];
|
|
2009
|
+
}> = [
|
|
2010
|
+
{
|
|
2011
|
+
label: 'Ticket ID',
|
|
2012
|
+
value: 'ticket.ticket_id',
|
|
2013
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
value: 'ticket.assignee',
|
|
2017
|
+
label: 'Ticket Assignee',
|
|
2018
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
value: 'ticket.due_date',
|
|
2022
|
+
label: 'Ticket Due Date',
|
|
2023
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
value: 'ticket.priority',
|
|
2027
|
+
label: 'Ticket Priority',
|
|
2028
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2029
|
+
},
|
|
2030
|
+
{
|
|
2031
|
+
value: 'ticket.status',
|
|
2032
|
+
label: 'Ticket Status',
|
|
2033
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
value: 'ticket.subject',
|
|
2037
|
+
label: 'Ticket Subject',
|
|
2038
|
+
validTriggers: ['ticket.updated', 'ticket.created', 'ticket.closed'],
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
label: 'Message Body',
|
|
2042
|
+
value: 'message.body',
|
|
2043
|
+
validTriggers: [
|
|
2044
|
+
'message.created',
|
|
2045
|
+
'message.updated',
|
|
2046
|
+
'reaction.added',
|
|
2047
|
+
'message.flagged',
|
|
2048
|
+
'ticket.created',
|
|
2049
|
+
'ticket.updated',
|
|
2050
|
+
'ticket.closed',
|
|
2051
|
+
'message.deleted',
|
|
2052
|
+
],
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
value: 'message.media',
|
|
2056
|
+
label: 'Message Media',
|
|
2057
|
+
validTriggers: [
|
|
2058
|
+
'message.created',
|
|
2059
|
+
'message.updated',
|
|
2060
|
+
'reaction.added',
|
|
2061
|
+
'message.flagged',
|
|
2062
|
+
'ticket.created',
|
|
2063
|
+
'ticket.updated',
|
|
2064
|
+
'ticket.closed',
|
|
2065
|
+
'message.deleted',
|
|
2066
|
+
],
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
value: 'message.message_id',
|
|
2070
|
+
label: 'Message ID',
|
|
2071
|
+
validTriggers: [
|
|
2072
|
+
'message.created',
|
|
2073
|
+
'message.updated',
|
|
2074
|
+
'reaction.added',
|
|
2075
|
+
'message.flagged',
|
|
2076
|
+
'ticket.created',
|
|
2077
|
+
'ticket.updated',
|
|
2078
|
+
'ticket.closed',
|
|
2079
|
+
'message.deleted',
|
|
2080
|
+
],
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
value: 'message.message_type',
|
|
2084
|
+
label: 'Message Type',
|
|
2085
|
+
validTriggers: [
|
|
2086
|
+
'message.created',
|
|
2087
|
+
'message.updated',
|
|
2088
|
+
'reaction.added',
|
|
2089
|
+
'message.flagged',
|
|
2090
|
+
'ticket.created',
|
|
2091
|
+
'ticket.updated',
|
|
2092
|
+
'ticket.closed',
|
|
2093
|
+
'message.deleted',
|
|
2094
|
+
],
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
value: 'message.sender_phone',
|
|
2098
|
+
label: 'Sender Phone',
|
|
2099
|
+
validTriggers: [
|
|
2100
|
+
'message.created',
|
|
2101
|
+
'message.updated',
|
|
2102
|
+
'reaction.added',
|
|
2103
|
+
'message.flagged',
|
|
2104
|
+
'ticket.created',
|
|
2105
|
+
'ticket.updated',
|
|
2106
|
+
'ticket.closed',
|
|
2107
|
+
'message.deleted',
|
|
2108
|
+
],
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
value: 'message.timestamp',
|
|
2112
|
+
label: 'Message Timestamp',
|
|
2113
|
+
validTriggers: [
|
|
2114
|
+
'message.created',
|
|
2115
|
+
'message.updated',
|
|
2116
|
+
'reaction.added',
|
|
2117
|
+
'message.flagged',
|
|
2118
|
+
'ticket.created',
|
|
2119
|
+
'ticket.updated',
|
|
2120
|
+
'ticket.closed',
|
|
2121
|
+
'message.deleted',
|
|
2122
|
+
],
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
label: 'Sender Name',
|
|
2126
|
+
value: 'sender.contact_name',
|
|
2127
|
+
validTriggers: [
|
|
2128
|
+
'message.created',
|
|
2129
|
+
'message.updated',
|
|
2130
|
+
'reaction.added',
|
|
2131
|
+
'message.flagged',
|
|
2132
|
+
'ticket.created',
|
|
2133
|
+
'ticket.updated',
|
|
2134
|
+
'ticket.closed',
|
|
2135
|
+
'message.deleted',
|
|
2136
|
+
],
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
value: 'sender.is_admin',
|
|
2140
|
+
label: 'Sender Is Admin',
|
|
2141
|
+
validTriggers: [
|
|
2142
|
+
'message.created',
|
|
2143
|
+
'message.updated',
|
|
2144
|
+
'reaction.added',
|
|
2145
|
+
'message.flagged',
|
|
2146
|
+
'ticket.created',
|
|
2147
|
+
'ticket.updated',
|
|
2148
|
+
'ticket.closed',
|
|
2149
|
+
'message.deleted',
|
|
2150
|
+
],
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
value: 'sender.is_internal',
|
|
2154
|
+
label: 'Sender Is Internal',
|
|
2155
|
+
validTriggers: [
|
|
2156
|
+
'message.created',
|
|
2157
|
+
'message.updated',
|
|
2158
|
+
'reaction.added',
|
|
2159
|
+
'message.flagged',
|
|
2160
|
+
'ticket.created',
|
|
2161
|
+
'ticket.updated',
|
|
2162
|
+
'ticket.closed',
|
|
2163
|
+
'message.deleted',
|
|
2164
|
+
],
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
label: 'Reaction',
|
|
2168
|
+
value: 'reaction.reaction',
|
|
2169
|
+
validTriggers: ['reaction.added'],
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
value: 'reaction.sender_id',
|
|
2173
|
+
label: 'Reaction Sender Phone',
|
|
2174
|
+
validTriggers: ['reaction.added'],
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
label: 'Chat Name',
|
|
2178
|
+
value: 'chat.chat_name',
|
|
2179
|
+
validTriggers: [
|
|
2180
|
+
'message.created',
|
|
2181
|
+
'message.updated',
|
|
2182
|
+
'reaction.added',
|
|
2183
|
+
'message.flagged',
|
|
2184
|
+
'chat.created',
|
|
2185
|
+
'chat.label.updated',
|
|
2186
|
+
'ticket.created',
|
|
2187
|
+
'ticket.updated',
|
|
2188
|
+
'ticket.closed',
|
|
2189
|
+
'message.deleted',
|
|
2190
|
+
],
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
value: 'chat.assigned_to',
|
|
2194
|
+
label: 'Chat Assigned To',
|
|
2195
|
+
validTriggers: [
|
|
2196
|
+
'message.created',
|
|
2197
|
+
'message.updated',
|
|
2198
|
+
'reaction.added',
|
|
2199
|
+
'message.flagged',
|
|
2200
|
+
'chat.created',
|
|
2201
|
+
'chat.label.updated',
|
|
2202
|
+
'ticket.created',
|
|
2203
|
+
'ticket.updated',
|
|
2204
|
+
'ticket.closed',
|
|
2205
|
+
'message.deleted',
|
|
2206
|
+
],
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
value: 'chat.chat_id',
|
|
2210
|
+
label: 'Chat ID',
|
|
2211
|
+
validTriggers: [
|
|
2212
|
+
'message.created',
|
|
2213
|
+
'message.updated',
|
|
2214
|
+
'reaction.added',
|
|
2215
|
+
'message.flagged',
|
|
2216
|
+
'chat.created',
|
|
2217
|
+
'chat.label.updated',
|
|
2218
|
+
'ticket.created',
|
|
2219
|
+
'ticket.updated',
|
|
2220
|
+
'ticket.closed',
|
|
2221
|
+
'message.deleted',
|
|
2222
|
+
],
|
|
2223
|
+
},
|
|
2224
|
+
{
|
|
2225
|
+
value: 'chat.chat_type',
|
|
2226
|
+
label: 'Chat Type',
|
|
2227
|
+
validTriggers: [
|
|
2228
|
+
'message.created',
|
|
2229
|
+
'message.updated',
|
|
2230
|
+
'reaction.added',
|
|
2231
|
+
'message.flagged',
|
|
2232
|
+
'chat.created',
|
|
2233
|
+
'chat.label.updated',
|
|
2234
|
+
'ticket.created',
|
|
2235
|
+
'ticket.updated',
|
|
2236
|
+
'ticket.closed',
|
|
2237
|
+
'message.deleted',
|
|
2238
|
+
],
|
|
2239
|
+
},
|
|
2240
|
+
{
|
|
2241
|
+
value: 'chat.org_id',
|
|
2242
|
+
label: 'Chat Org ID',
|
|
2243
|
+
validTriggers: [
|
|
2244
|
+
'message.created',
|
|
2245
|
+
'message.updated',
|
|
2246
|
+
'reaction.added',
|
|
2247
|
+
'message.flagged',
|
|
2248
|
+
'chat.created',
|
|
2249
|
+
'chat.label.updated',
|
|
2250
|
+
'ticket.created',
|
|
2251
|
+
'ticket.updated',
|
|
2252
|
+
'ticket.closed',
|
|
2253
|
+
'message.deleted',
|
|
2254
|
+
],
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
value: 'chat.org_phone',
|
|
2258
|
+
label: 'Chat Org Phone',
|
|
2259
|
+
validTriggers: [
|
|
2260
|
+
'message.created',
|
|
2261
|
+
'message.updated',
|
|
2262
|
+
'reaction.added',
|
|
2263
|
+
'message.flagged',
|
|
2264
|
+
'chat.created',
|
|
2265
|
+
'chat.label.updated',
|
|
2266
|
+
'ticket.created',
|
|
2267
|
+
'ticket.updated',
|
|
2268
|
+
'ticket.closed',
|
|
2269
|
+
'message.deleted',
|
|
2270
|
+
],
|
|
2271
|
+
},
|
|
2272
|
+
];
|
|
2273
|
+
|
|
2274
|
+
export const variablesExclusionList: Record<
|
|
2275
|
+
Rule['trigger'],
|
|
2276
|
+
Array<
|
|
2277
|
+
| keyof AppendTypes<{ message: MessageVariablesType }, '.'>
|
|
2278
|
+
| keyof AppendTypes<{ sender: SenderVariablesType }, '.'>
|
|
2279
|
+
| keyof AppendTypes<{ chat: ChatVariablesType }, '.'>
|
|
2280
|
+
| keyof AppendTypes<{ ticket: TicketVariablesType }, '.'>
|
|
2281
|
+
| keyof AppendTypes<{ reaction: ReactionVariablesType }, '.'>
|
|
2282
|
+
>
|
|
2283
|
+
> = {
|
|
2284
|
+
'ticket.created': ['ticket.is_deleted'],
|
|
2285
|
+
'chat.created': [
|
|
2286
|
+
'chat.labels',
|
|
2287
|
+
'chat.has_flagged_messages',
|
|
2288
|
+
'chat.assigned_to',
|
|
2289
|
+
],
|
|
2290
|
+
'message.created': [
|
|
2291
|
+
'message.author',
|
|
2292
|
+
'message.performed_by',
|
|
2293
|
+
'message.flag_status',
|
|
2294
|
+
'sender.is_internal',
|
|
2295
|
+
],
|
|
2296
|
+
'ticket.updated': ['ticket.is_deleted'],
|
|
2297
|
+
'reaction.added': [],
|
|
2298
|
+
'message.updated': [],
|
|
2299
|
+
'message.flagged': [],
|
|
2300
|
+
'message.unflagged': [],
|
|
2301
|
+
'message.deleted': [],
|
|
2302
|
+
'ticket.closed': ['ticket.is_deleted'],
|
|
2303
|
+
'chat.label.updated': [],
|
|
2304
|
+
};
|