@periskope/types 0.6.152 → 0.6.154

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/supabase.types.ts CHANGED
@@ -1,2660 +1,2652 @@
1
- export type Json = { [key: string]: any } | any
2
-
3
- export type Database = {
4
- internal: {
5
- Tables: {
6
- config: {
7
- Row: {
8
- key: string
9
- updated_at: string
10
- value: string | null
11
- }
12
- Insert: {
13
- key: string
14
- updated_at?: string
15
- value?: string | null
16
- }
17
- Update: {
18
- key?: string
19
- updated_at?: string
20
- value?: string | null
21
- }
22
- Relationships: []
23
- }
24
- org_phone_logs: {
25
- Row: {
26
- connection_history: Json | null
27
- created_at: string
28
- deleted_at: string | null
29
- first_connected_at: string | null
30
- org_id: string
31
- org_phone: string | null
32
- phone_id: string
33
- }
34
- Insert: {
35
- connection_history?: Json | null
36
- created_at?: string
37
- deleted_at?: string | null
38
- first_connected_at?: string | null
39
- org_id: string
40
- org_phone?: string | null
41
- phone_id: string
42
- }
43
- Update: {
44
- connection_history?: Json | null
45
- created_at?: string
46
- deleted_at?: string | null
47
- first_connected_at?: string | null
48
- org_id?: string
49
- org_phone?: string | null
50
- phone_id?: string
51
- }
52
- Relationships: []
53
- }
54
- tbl_communication_logs: {
55
- Row: {
56
- communication_type: string | null
57
- created_at: string
58
- id: number
59
- metadata: Json | null
60
- org_id: string | null
61
- recipient: string | null
62
- success: boolean | null
63
- type: string | null
64
- }
65
- Insert: {
66
- communication_type?: string | null
67
- created_at?: string
68
- id?: number
69
- metadata?: Json | null
70
- org_id?: string | null
71
- recipient?: string | null
72
- success?: boolean | null
73
- type?: string | null
74
- }
75
- Update: {
76
- communication_type?: string | null
77
- created_at?: string
78
- id?: number
79
- metadata?: Json | null
80
- org_id?: string | null
81
- recipient?: string | null
82
- success?: boolean | null
83
- type?: string | null
84
- }
85
- Relationships: []
86
- }
87
- tbl_feature_flags: {
88
- Row: {
89
- created_at: string | null
90
- enabled: boolean | null
91
- excluded_orgs: string[] | null
92
- exclusive_to_orgs: string[] | null
93
- feature: string
94
- included_orgs: string[] | null
95
- percentage: number | null
96
- plans: string[] | null
97
- start_date: string | null
98
- }
99
- Insert: {
100
- created_at?: string | null
101
- enabled?: boolean | null
102
- excluded_orgs?: string[] | null
103
- exclusive_to_orgs?: string[] | null
104
- feature: string
105
- included_orgs?: string[] | null
106
- percentage?: number | null
107
- plans?: string[] | null
108
- start_date?: string | null
109
- }
110
- Update: {
111
- created_at?: string | null
112
- enabled?: boolean | null
113
- excluded_orgs?: string[] | null
114
- exclusive_to_orgs?: string[] | null
115
- feature?: string
116
- included_orgs?: string[] | null
117
- percentage?: number | null
118
- plans?: string[] | null
119
- start_date?: string | null
120
- }
121
- Relationships: []
122
- }
123
- tbl_trigger_logs: {
124
- Row: {
125
- created_at: string
126
- id: number
127
- request_body: Json
128
- request_id: string
129
- trace_id: string
130
- trigger_name: string
131
- }
132
- Insert: {
133
- created_at?: string
134
- id?: number
135
- request_body: Json
136
- request_id: string
137
- trace_id?: string
138
- trigger_name: string
139
- }
140
- Update: {
141
- created_at?: string
142
- id?: number
143
- request_body?: Json
144
- request_id?: string
145
- trace_id?: string
146
- trigger_name?: string
147
- }
148
- Relationships: []
149
- }
150
- }
151
- Views: {
152
- [_ in never]: never
153
- }
154
- Functions: {
155
- [_ in never]: never
156
- }
157
- Enums: {
158
- [_ in never]: never
159
- }
160
- CompositeTypes: {
161
- [_ in never]: never
162
- }
163
- }
164
- public: {
165
- Tables: {
166
- tbl_api_logs: {
167
- Row: {
168
- org_id: string
169
- path: string
170
- req: Json
171
- request_id: string
172
- res: Json | null
173
- status: number
174
- timestamp: string
175
- token_id: string
176
- }
177
- Insert: {
178
- org_id: string
179
- path: string
180
- req: Json
181
- request_id: string
182
- res?: Json | null
183
- status: number
184
- timestamp: string
185
- token_id: string
186
- }
187
- Update: {
188
- org_id?: string
189
- path?: string
190
- req?: Json
191
- request_id?: string
192
- res?: Json | null
193
- status?: number
194
- timestamp?: string
195
- token_id?: string
196
- }
197
- Relationships: []
198
- }
199
- tbl_automation_rules: {
200
- Row: {
201
- actions: Json
202
- conditions: Json
203
- created_at: string
204
- id: string
205
- is_active: boolean
206
- last_updated_at: string
207
- last_updated_by: string
208
- org_id: string
209
- rule_name: string
210
- trigger: string
211
- }
212
- Insert: {
213
- actions: Json
214
- conditions: Json
215
- created_at?: string
216
- id?: string
217
- is_active?: boolean
218
- last_updated_at?: string
219
- last_updated_by: string
220
- org_id: string
221
- rule_name: string
222
- trigger: string
223
- }
224
- Update: {
225
- actions?: Json
226
- conditions?: Json
227
- created_at?: string
228
- id?: string
229
- is_active?: boolean
230
- last_updated_at?: string
231
- last_updated_by?: string
232
- org_id?: string
233
- rule_name?: string
234
- trigger?: string
235
- }
236
- Relationships: [
237
- {
238
- foreignKeyName: "public_tbl_automation_rules_org_id_fkey"
239
- columns: ["org_id"]
240
- isOneToOne: false
241
- referencedRelation: "tbl_org"
242
- referencedColumns: ["org_id"]
243
- },
244
- {
245
- foreignKeyName: "public_tbl_automation_rules_org_id_fkey"
246
- columns: ["org_id"]
247
- isOneToOne: false
248
- referencedRelation: "view_org"
249
- referencedColumns: ["org_id"]
250
- },
251
- ]
252
- }
253
- tbl_broadcast_logs: {
254
- Row: {
255
- broadcast_id: string
256
- chat_id: string
257
- completed_at: string | null
258
- created_at: string
259
- delivered_count: number | null
260
- delivery_info: Json | null
261
- is_success: boolean | null
262
- member_count: number | null
263
- message_id: string | null
264
- org_id: string
265
- org_phone: string | null
266
- read_count: number | null
267
- remarks: string | null
268
- }
269
- Insert: {
270
- broadcast_id: string
271
- chat_id: string
272
- completed_at?: string | null
273
- created_at?: string
274
- delivered_count?: number | null
275
- delivery_info?: Json | null
276
- is_success?: boolean | null
277
- member_count?: number | null
278
- message_id?: string | null
279
- org_id: string
280
- org_phone?: string | null
281
- read_count?: number | null
282
- remarks?: string | null
283
- }
284
- Update: {
285
- broadcast_id?: string
286
- chat_id?: string
287
- completed_at?: string | null
288
- created_at?: string
289
- delivered_count?: number | null
290
- delivery_info?: Json | null
291
- is_success?: boolean | null
292
- member_count?: number | null
293
- message_id?: string | null
294
- org_id?: string
295
- org_phone?: string | null
296
- read_count?: number | null
297
- remarks?: string | null
298
- }
299
- Relationships: [
300
- {
301
- foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
302
- columns: ["broadcast_id"]
303
- isOneToOne: false
304
- referencedRelation: "tbl_broadcast_messages"
305
- referencedColumns: ["broadcast_id"]
306
- },
307
- {
308
- foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
309
- columns: ["broadcast_id"]
310
- isOneToOne: false
311
- referencedRelation: "view_broadcast_logs"
312
- referencedColumns: ["broadcast_id"]
313
- },
314
- {
315
- foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
316
- columns: ["org_id"]
317
- isOneToOne: false
318
- referencedRelation: "tbl_org"
319
- referencedColumns: ["org_id"]
320
- },
321
- {
322
- foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
323
- columns: ["org_id"]
324
- isOneToOne: false
325
- referencedRelation: "view_org"
326
- referencedColumns: ["org_id"]
327
- },
328
- ]
329
- }
330
- tbl_broadcast_messages: {
331
- Row: {
332
- broadcast_id: string
333
- broadcast_status:
334
- | Database["public"]["Enums"]["enum_broadcast_status"]
335
- | null
336
- chat_ids: string[] | null
337
- created_at: string
338
- delay: number | null
339
- message_payload: Json | null
340
- org_id: string
341
- org_phone: string | null
342
- performed_at: string | null
343
- performed_by: string | null
344
- scheduled_at: string | null
345
- variables: Json | null
346
- }
347
- Insert: {
348
- broadcast_id?: string
349
- broadcast_status?:
350
- | Database["public"]["Enums"]["enum_broadcast_status"]
351
- | null
352
- chat_ids?: string[] | null
353
- created_at?: string
354
- delay?: number | null
355
- message_payload?: Json | null
356
- org_id: string
357
- org_phone?: string | null
358
- performed_at?: string | null
359
- performed_by?: string | null
360
- scheduled_at?: string | null
361
- variables?: Json | null
362
- }
363
- Update: {
364
- broadcast_id?: string
365
- broadcast_status?:
366
- | Database["public"]["Enums"]["enum_broadcast_status"]
367
- | null
368
- chat_ids?: string[] | null
369
- created_at?: string
370
- delay?: number | null
371
- message_payload?: Json | null
372
- org_id?: string
373
- org_phone?: string | null
374
- performed_at?: string | null
375
- performed_by?: string | null
376
- scheduled_at?: string | null
377
- variables?: Json | null
378
- }
379
- Relationships: [
380
- {
381
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
382
- columns: ["org_id"]
383
- isOneToOne: false
384
- referencedRelation: "tbl_org"
385
- referencedColumns: ["org_id"]
386
- },
387
- {
388
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
389
- columns: ["org_id"]
390
- isOneToOne: false
391
- referencedRelation: "view_org"
392
- referencedColumns: ["org_id"]
393
- },
394
- ]
395
- }
396
- tbl_broadcast_templates: {
397
- Row: {
398
- created_at: string
399
- message_payload: Json | null
400
- org_id: string
401
- template_id: string
402
- template_name: string | null
403
- updated_at: string | null
404
- variable_names: Json | null
405
- }
406
- Insert: {
407
- created_at?: string
408
- message_payload?: Json | null
409
- org_id: string
410
- template_id?: string
411
- template_name?: string | null
412
- updated_at?: string | null
413
- variable_names?: Json | null
414
- }
415
- Update: {
416
- created_at?: string
417
- message_payload?: Json | null
418
- org_id?: string
419
- template_id?: string
420
- template_name?: string | null
421
- updated_at?: string | null
422
- variable_names?: Json | null
423
- }
424
- Relationships: [
425
- {
426
- foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
427
- columns: ["org_id"]
428
- isOneToOne: false
429
- referencedRelation: "tbl_org"
430
- referencedColumns: ["org_id"]
431
- },
432
- {
433
- foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
434
- columns: ["org_id"]
435
- isOneToOne: false
436
- referencedRelation: "view_org"
437
- referencedColumns: ["org_id"]
438
- },
439
- ]
440
- }
441
- tbl_chat_logs: {
442
- Row: {
443
- action: string | null
444
- chat_id: string | null
445
- is_success: boolean | null
446
- log_id: string
447
- metadata: Json | null
448
- operation_id: string
449
- org_id: string
450
- org_phone: string
451
- participant_id: string | null
452
- performed_by: string | null
453
- timestamp: string | null
454
- }
455
- Insert: {
456
- action?: string | null
457
- chat_id?: string | null
458
- is_success?: boolean | null
459
- log_id?: string
460
- metadata?: Json | null
461
- operation_id: string
462
- org_id: string
463
- org_phone: string
464
- participant_id?: string | null
465
- performed_by?: string | null
466
- timestamp?: string | null
467
- }
468
- Update: {
469
- action?: string | null
470
- chat_id?: string | null
471
- is_success?: boolean | null
472
- log_id?: string
473
- metadata?: Json | null
474
- operation_id?: string
475
- org_id?: string
476
- org_phone?: string
477
- participant_id?: string | null
478
- performed_by?: string | null
479
- timestamp?: string | null
480
- }
481
- Relationships: [
482
- {
483
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
484
- columns: ["org_id"]
485
- isOneToOne: false
486
- referencedRelation: "tbl_org"
487
- referencedColumns: ["org_id"]
488
- },
489
- {
490
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
491
- columns: ["org_id"]
492
- isOneToOne: false
493
- referencedRelation: "view_org"
494
- referencedColumns: ["org_id"]
495
- },
496
- ]
497
- }
498
- tbl_chat_messages: {
499
- Row: {
500
- ack: string | null
501
- author: string | null
502
- body: string | null
503
- broadcast: boolean | null
504
- broadcast_id: string | null
505
- chat_id: string | null
506
- delivery_info: Json | null
507
- device_type: string | null
508
- duration: string | null
509
- flag_metadata: Json | null
510
- flag_response_time: number | null
511
- flag_status: boolean | null
512
- forwarding_score: number | null
513
- from: string | null
514
- from_me: boolean | null
515
- fts: unknown | null
516
- has_media: boolean | null
517
- has_quoted_msg: boolean | null
518
- has_reaction: boolean | null
519
- id: Json | null
520
- invite_v4: Json | null
521
- is_deleted: boolean | null
522
- is_ephemeral: boolean | null
523
- is_forwarded: boolean | null
524
- is_gif: boolean | null
525
- is_starred: boolean | null
526
- is_status: boolean | null
527
- links: Json | null
528
- location: Json | null
529
- media: Json | null
530
- media_key: string | null
531
- mentioned_ids: string[] | null
532
- message_id: string
533
- message_ticket_id: string | null
534
- message_type: string | null
535
- order_id: string | null
536
- org_id: string
537
- org_phone: string
538
- performed_by: string | null
539
- poll_info: Json | null
540
- poll_results: Json | null
541
- prev_body: string | null
542
- quoted_message_id: string | null
543
- raw_data: Json | null
544
- sender_phone: string | null
545
- sent_message_id: string | null
546
- timestamp: string | null
547
- to: string | null
548
- token: string | null
549
- unique_id: string | null
550
- updated_at: string | null
551
- vcards: string[] | null
552
- }
553
- Insert: {
554
- ack?: string | null
555
- author?: string | null
556
- body?: string | null
557
- broadcast?: boolean | null
558
- broadcast_id?: string | null
559
- chat_id?: string | null
560
- delivery_info?: Json | null
561
- device_type?: string | null
562
- duration?: string | null
563
- flag_metadata?: Json | null
564
- flag_response_time?: number | null
565
- flag_status?: boolean | null
566
- forwarding_score?: number | null
567
- from?: string | null
568
- from_me?: boolean | null
569
- fts?: unknown | null
570
- has_media?: boolean | null
571
- has_quoted_msg?: boolean | null
572
- has_reaction?: boolean | null
573
- id?: Json | null
574
- invite_v4?: Json | null
575
- is_deleted?: boolean | null
576
- is_ephemeral?: boolean | null
577
- is_forwarded?: boolean | null
578
- is_gif?: boolean | null
579
- is_starred?: boolean | null
580
- is_status?: boolean | null
581
- links?: Json | null
582
- location?: Json | null
583
- media?: Json | null
584
- media_key?: string | null
585
- mentioned_ids?: string[] | null
586
- message_id: string
587
- message_ticket_id?: string | null
588
- message_type?: string | null
589
- order_id?: string | null
590
- org_id: string
591
- org_phone: string
592
- performed_by?: string | null
593
- poll_info?: Json | null
594
- poll_results?: Json | null
595
- prev_body?: string | null
596
- quoted_message_id?: string | null
597
- raw_data?: Json | null
598
- sender_phone?: string | null
599
- sent_message_id?: string | null
600
- timestamp?: string | null
601
- to?: string | null
602
- token?: string | null
603
- unique_id?: string | null
604
- updated_at?: string | null
605
- vcards?: string[] | null
606
- }
607
- Update: {
608
- ack?: string | null
609
- author?: string | null
610
- body?: string | null
611
- broadcast?: boolean | null
612
- broadcast_id?: string | null
613
- chat_id?: string | null
614
- delivery_info?: Json | null
615
- device_type?: string | null
616
- duration?: string | null
617
- flag_metadata?: Json | null
618
- flag_response_time?: number | null
619
- flag_status?: boolean | null
620
- forwarding_score?: number | null
621
- from?: string | null
622
- from_me?: boolean | null
623
- fts?: unknown | null
624
- has_media?: boolean | null
625
- has_quoted_msg?: boolean | null
626
- has_reaction?: boolean | null
627
- id?: Json | null
628
- invite_v4?: Json | null
629
- is_deleted?: boolean | null
630
- is_ephemeral?: boolean | null
631
- is_forwarded?: boolean | null
632
- is_gif?: boolean | null
633
- is_starred?: boolean | null
634
- is_status?: boolean | null
635
- links?: Json | null
636
- location?: Json | null
637
- media?: Json | null
638
- media_key?: string | null
639
- mentioned_ids?: string[] | null
640
- message_id?: string
641
- message_ticket_id?: string | null
642
- message_type?: string | null
643
- order_id?: string | null
644
- org_id?: string
645
- org_phone?: string
646
- performed_by?: string | null
647
- poll_info?: Json | null
648
- poll_results?: Json | null
649
- prev_body?: string | null
650
- quoted_message_id?: string | null
651
- raw_data?: Json | null
652
- sender_phone?: string | null
653
- sent_message_id?: string | null
654
- timestamp?: string | null
655
- to?: string | null
656
- token?: string | null
657
- unique_id?: string | null
658
- updated_at?: string | null
659
- vcards?: string[] | null
660
- }
661
- Relationships: []
662
- }
663
- tbl_chat_notifications: {
664
- Row: {
665
- author: string | null
666
- body: string | null
667
- chat_id: string | null
668
- id: Json | null
669
- notification_id: string
670
- org_id: string
671
- org_phone: string
672
- recipientids: string[] | null
673
- timestamp: string | null
674
- type: string | null
675
- unique_id: string | null
676
- }
677
- Insert: {
678
- author?: string | null
679
- body?: string | null
680
- chat_id?: string | null
681
- id?: Json | null
682
- notification_id: string
683
- org_id: string
684
- org_phone: string
685
- recipientids?: string[] | null
686
- timestamp?: string | null
687
- type?: string | null
688
- unique_id?: string | null
689
- }
690
- Update: {
691
- author?: string | null
692
- body?: string | null
693
- chat_id?: string | null
694
- id?: Json | null
695
- notification_id?: string
696
- org_id?: string
697
- org_phone?: string
698
- recipientids?: string[] | null
699
- timestamp?: string | null
700
- type?: string | null
701
- unique_id?: string | null
702
- }
703
- Relationships: []
704
- }
705
- tbl_chat_participants: {
706
- Row: {
707
- chat_id: string
708
- contact_id: string
709
- id: Json | null
710
- is_admin: boolean | null
711
- is_super_admin: boolean | null
712
- org_id: string
713
- org_phone: string
714
- }
715
- Insert: {
716
- chat_id: string
717
- contact_id: string
718
- id?: Json | null
719
- is_admin?: boolean | null
720
- is_super_admin?: boolean | null
721
- org_id: string
722
- org_phone: string
723
- }
724
- Update: {
725
- chat_id?: string
726
- contact_id?: string
727
- id?: Json | null
728
- is_admin?: boolean | null
729
- is_super_admin?: boolean | null
730
- org_id?: string
731
- org_phone?: string
732
- }
733
- Relationships: []
734
- }
735
- tbl_chat_properties: {
736
- Row: {
737
- assigned_to: string | null
738
- chat_access: Json | null
739
- chat_id: string
740
- chat_image: string | null
741
- chat_name: string | null
742
- chat_org_phones: string[]
743
- chat_type: string | null
744
- custom_properties: Json | null
745
- flag_count_map: Json | null
746
- hubspot_metadata: Json | null
747
- label_ids: Json | null
748
- latest_message_timestamp: string | null
749
- org_id: string
750
- unread_count: Json | null
751
- unread_count_map: Json | null
752
- updated_at: string | null
753
- }
754
- Insert: {
755
- assigned_to?: string | null
756
- chat_access?: Json | null
757
- chat_id: string
758
- chat_image?: string | null
759
- chat_name?: string | null
760
- chat_org_phones?: string[]
761
- chat_type?: string | null
762
- custom_properties?: Json | null
763
- flag_count_map?: Json | null
764
- hubspot_metadata?: Json | null
765
- label_ids?: Json | null
766
- latest_message_timestamp?: string | null
767
- org_id: string
768
- unread_count?: Json | null
769
- unread_count_map?: Json | null
770
- updated_at?: string | null
771
- }
772
- Update: {
773
- assigned_to?: string | null
774
- chat_access?: Json | null
775
- chat_id?: string
776
- chat_image?: string | null
777
- chat_name?: string | null
778
- chat_org_phones?: string[]
779
- chat_type?: string | null
780
- custom_properties?: Json | null
781
- flag_count_map?: Json | null
782
- hubspot_metadata?: Json | null
783
- label_ids?: Json | null
784
- latest_message_timestamp?: string | null
785
- org_id?: string
786
- unread_count?: Json | null
787
- unread_count_map?: Json | null
788
- updated_at?: string | null
789
- }
790
- Relationships: []
791
- }
792
- tbl_chat_reactions: {
793
- Row: {
794
- ack: number | null
795
- chat_id: string | null
796
- id: Json | null
797
- message_id: string
798
- msg_id: Json | null
799
- org_id: string
800
- org_phone: string
801
- orphan: number | null
802
- orphan_reason: string | null
803
- reaction: string | null
804
- reaction_id: string
805
- read: boolean | null
806
- sender_id: string
807
- timestamp: string | null
808
- unique_id: string | null
809
- }
810
- Insert: {
811
- ack?: number | null
812
- chat_id?: string | null
813
- id?: Json | null
814
- message_id: string
815
- msg_id?: Json | null
816
- org_id: string
817
- org_phone: string
818
- orphan?: number | null
819
- orphan_reason?: string | null
820
- reaction?: string | null
821
- reaction_id: string
822
- read?: boolean | null
823
- sender_id: string
824
- timestamp?: string | null
825
- unique_id?: string | null
826
- }
827
- Update: {
828
- ack?: number | null
829
- chat_id?: string | null
830
- id?: Json | null
831
- message_id?: string
832
- msg_id?: Json | null
833
- org_id?: string
834
- org_phone?: string
835
- orphan?: number | null
836
- orphan_reason?: string | null
837
- reaction?: string | null
838
- reaction_id?: string
839
- read?: boolean | null
840
- sender_id?: string
841
- timestamp?: string | null
842
- unique_id?: string | null
843
- }
844
- Relationships: []
845
- }
846
- tbl_chat_tickets: {
847
- Row: {
848
- assigned_by: string | null
849
- assignee: string | null
850
- chat_id: string
851
- close_ticket_metadata: Json | null
852
- closed_at: string | null
853
- created_at: string
854
- custom_properties: Json | null
855
- due_date: string | null
856
- freshdesk_metadata: Json | null
857
- hubspot_metadata: Json | null
858
- is_deleted: boolean
859
- label_ids: Json | null
860
- last_updated_at: string
861
- org_id: string
862
- priority: number | null
863
- quoted_message_id: string | null
864
- raised_by: string | null
865
- response_time: number | null
866
- status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
867
- subject: string
868
- ticket_id: string
869
- zohodesk_metadata: Json | null
870
- }
871
- Insert: {
872
- assigned_by?: string | null
873
- assignee?: string | null
874
- chat_id: string
875
- close_ticket_metadata?: Json | null
876
- closed_at?: string | null
877
- created_at?: string
878
- custom_properties?: Json | null
879
- due_date?: string | null
880
- freshdesk_metadata?: Json | null
881
- hubspot_metadata?: Json | null
882
- is_deleted?: boolean
883
- label_ids?: Json | null
884
- last_updated_at?: string
885
- org_id: string
886
- priority?: number | null
887
- quoted_message_id?: string | null
888
- raised_by?: string | null
889
- response_time?: number | null
890
- status?:
891
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
892
- | null
893
- subject: string
894
- ticket_id?: string
895
- zohodesk_metadata?: Json | null
896
- }
897
- Update: {
898
- assigned_by?: string | null
899
- assignee?: string | null
900
- chat_id?: string
901
- close_ticket_metadata?: Json | null
902
- closed_at?: string | null
903
- created_at?: string
904
- custom_properties?: Json | null
905
- due_date?: string | null
906
- freshdesk_metadata?: Json | null
907
- hubspot_metadata?: Json | null
908
- is_deleted?: boolean
909
- label_ids?: Json | null
910
- last_updated_at?: string
911
- org_id?: string
912
- priority?: number | null
913
- quoted_message_id?: string | null
914
- raised_by?: string | null
915
- response_time?: number | null
916
- status?:
917
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
918
- | null
919
- subject?: string
920
- ticket_id?: string
921
- zohodesk_metadata?: Json | null
922
- }
923
- Relationships: [
924
- {
925
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
926
- columns: ["org_id"]
927
- isOneToOne: false
928
- referencedRelation: "tbl_org"
929
- referencedColumns: ["org_id"]
930
- },
931
- {
932
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
933
- columns: ["org_id"]
934
- isOneToOne: false
935
- referencedRelation: "view_org"
936
- referencedColumns: ["org_id"]
937
- },
938
- ]
939
- }
940
- tbl_chats: {
941
- Row: {
942
- archived: boolean | null
943
- chat_id: string
944
- chat_image: string | null
945
- chat_name: string | null
946
- chat_type: string | null
947
- created_at: string
948
- group_metadata: Json | null
949
- id: Json | null
950
- invite_link: string | null
951
- is_exited: boolean | null
952
- is_group: boolean | null
953
- is_muted: boolean | null
954
- is_read_only: boolean | null
955
- latest_message: Json | null
956
- member_count: number | null
957
- mute_expiration: number | null
958
- name: string | null
959
- org_id: string
960
- org_phone: string
961
- pinned: boolean | null
962
- timestamp: string | null
963
- unread_count: number | null
964
- updated_at: string
965
- }
966
- Insert: {
967
- archived?: boolean | null
968
- chat_id: string
969
- chat_image?: string | null
970
- chat_name?: string | null
971
- chat_type?: string | null
972
- created_at?: string
973
- group_metadata?: Json | null
974
- id?: Json | null
975
- invite_link?: string | null
976
- is_exited?: boolean | null
977
- is_group?: boolean | null
978
- is_muted?: boolean | null
979
- is_read_only?: boolean | null
980
- latest_message?: Json | null
981
- member_count?: number | null
982
- mute_expiration?: number | null
983
- name?: string | null
984
- org_id: string
985
- org_phone: string
986
- pinned?: boolean | null
987
- timestamp?: string | null
988
- unread_count?: number | null
989
- updated_at?: string
990
- }
991
- Update: {
992
- archived?: boolean | null
993
- chat_id?: string
994
- chat_image?: string | null
995
- chat_name?: string | null
996
- chat_type?: string | null
997
- created_at?: string
998
- group_metadata?: Json | null
999
- id?: Json | null
1000
- invite_link?: string | null
1001
- is_exited?: boolean | null
1002
- is_group?: boolean | null
1003
- is_muted?: boolean | null
1004
- is_read_only?: boolean | null
1005
- latest_message?: Json | null
1006
- member_count?: number | null
1007
- mute_expiration?: number | null
1008
- name?: string | null
1009
- org_id?: string
1010
- org_phone?: string
1011
- pinned?: boolean | null
1012
- timestamp?: string | null
1013
- unread_count?: number | null
1014
- updated_at?: string
1015
- }
1016
- Relationships: []
1017
- }
1018
- tbl_contacts: {
1019
- Row: {
1020
- business_profile: Json | null
1021
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
1022
- contact_id: string
1023
- contact_image: string | null
1024
- contact_name: string | null
1025
- contact_type: string | null
1026
- id: Json | null
1027
- is_blocked: boolean | null
1028
- is_business: boolean | null
1029
- is_enterprise: boolean | null
1030
- is_group: boolean | null
1031
- is_imported: boolean | null
1032
- is_internal: boolean | null
1033
- is_me: boolean | null
1034
- is_my_contact: boolean | null
1035
- is_user: boolean | null
1036
- is_wa_contact: boolean | null
1037
- label_ids: Json
1038
- name: string | null
1039
- number: string | null
1040
- org_id: string
1041
- periskope_name: string | null
1042
- pushname: string | null
1043
- short_name: string | null
1044
- updated_at: string | null
1045
- verified_level: number | null
1046
- verified_name: string | null
1047
- }
1048
- Insert: {
1049
- business_profile?: Json | null
1050
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1051
- contact_id: string
1052
- contact_image?: string | null
1053
- contact_name?: string | null
1054
- contact_type?: string | null
1055
- id?: Json | null
1056
- is_blocked?: boolean | null
1057
- is_business?: boolean | null
1058
- is_enterprise?: boolean | null
1059
- is_group?: boolean | null
1060
- is_imported?: boolean | null
1061
- is_internal?: boolean | null
1062
- is_me?: boolean | null
1063
- is_my_contact?: boolean | null
1064
- is_user?: boolean | null
1065
- is_wa_contact?: boolean | null
1066
- label_ids?: Json
1067
- name?: string | null
1068
- number?: string | null
1069
- org_id: string
1070
- periskope_name?: string | null
1071
- pushname?: string | null
1072
- short_name?: string | null
1073
- updated_at?: string | null
1074
- verified_level?: number | null
1075
- verified_name?: string | null
1076
- }
1077
- Update: {
1078
- business_profile?: Json | null
1079
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1080
- contact_id?: string
1081
- contact_image?: string | null
1082
- contact_name?: string | null
1083
- contact_type?: string | null
1084
- id?: Json | null
1085
- is_blocked?: boolean | null
1086
- is_business?: boolean | null
1087
- is_enterprise?: boolean | null
1088
- is_group?: boolean | null
1089
- is_imported?: boolean | null
1090
- is_internal?: boolean | null
1091
- is_me?: boolean | null
1092
- is_my_contact?: boolean | null
1093
- is_user?: boolean | null
1094
- is_wa_contact?: boolean | null
1095
- label_ids?: Json
1096
- name?: string | null
1097
- number?: string | null
1098
- org_id?: string
1099
- periskope_name?: string | null
1100
- pushname?: string | null
1101
- short_name?: string | null
1102
- updated_at?: string | null
1103
- verified_level?: number | null
1104
- verified_name?: string | null
1105
- }
1106
- Relationships: [
1107
- {
1108
- foreignKeyName: "tbl_contacts_org_id_fkey"
1109
- columns: ["org_id"]
1110
- isOneToOne: false
1111
- referencedRelation: "tbl_org"
1112
- referencedColumns: ["org_id"]
1113
- },
1114
- {
1115
- foreignKeyName: "tbl_contacts_org_id_fkey"
1116
- columns: ["org_id"]
1117
- isOneToOne: false
1118
- referencedRelation: "view_org"
1119
- referencedColumns: ["org_id"]
1120
- },
1121
- ]
1122
- }
1123
- tbl_custom_properties: {
1124
- Row: {
1125
- created_at: string
1126
- created_by: string | null
1127
- org_id: string | null
1128
- property_id: string
1129
- property_name: string
1130
- property_value: Json | null
1131
- property_value_type: string | null
1132
- type: string | null
1133
- }
1134
- Insert: {
1135
- created_at?: string
1136
- created_by?: string | null
1137
- org_id?: string | null
1138
- property_id?: string
1139
- property_name: string
1140
- property_value?: Json | null
1141
- property_value_type?: string | null
1142
- type?: string | null
1143
- }
1144
- Update: {
1145
- created_at?: string
1146
- created_by?: string | null
1147
- org_id?: string | null
1148
- property_id?: string
1149
- property_name?: string
1150
- property_value?: Json | null
1151
- property_value_type?: string | null
1152
- type?: string | null
1153
- }
1154
- Relationships: [
1155
- {
1156
- foreignKeyName: "tbl_custom_properties_org_id_fkey"
1157
- columns: ["org_id"]
1158
- isOneToOne: false
1159
- referencedRelation: "tbl_org"
1160
- referencedColumns: ["org_id"]
1161
- },
1162
- {
1163
- foreignKeyName: "tbl_custom_properties_org_id_fkey"
1164
- columns: ["org_id"]
1165
- isOneToOne: false
1166
- referencedRelation: "view_org"
1167
- referencedColumns: ["org_id"]
1168
- },
1169
- ]
1170
- }
1171
- tbl_integration_hooks: {
1172
- Row: {
1173
- hook_url: string
1174
- id: string
1175
- integration_id: string | null
1176
- integration_metadata: Json
1177
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1178
- integration_type: string
1179
- is_subscribed: boolean
1180
- org_id: string
1181
- subscribed_at: string
1182
- type: Database["public"]["Enums"]["enum_integration_type"]
1183
- }
1184
- Insert: {
1185
- hook_url: string
1186
- id?: string
1187
- integration_id?: string | null
1188
- integration_metadata: Json
1189
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1190
- integration_type: string
1191
- is_subscribed: boolean
1192
- org_id: string
1193
- subscribed_at?: string
1194
- type: Database["public"]["Enums"]["enum_integration_type"]
1195
- }
1196
- Update: {
1197
- hook_url?: string
1198
- id?: string
1199
- integration_id?: string | null
1200
- integration_metadata?: Json
1201
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1202
- integration_type?: string
1203
- is_subscribed?: boolean
1204
- org_id?: string
1205
- subscribed_at?: string
1206
- type?: Database["public"]["Enums"]["enum_integration_type"]
1207
- }
1208
- Relationships: [
1209
- {
1210
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1211
- columns: ["org_id"]
1212
- isOneToOne: false
1213
- referencedRelation: "tbl_org"
1214
- referencedColumns: ["org_id"]
1215
- },
1216
- {
1217
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1218
- columns: ["org_id"]
1219
- isOneToOne: false
1220
- referencedRelation: "view_org"
1221
- referencedColumns: ["org_id"]
1222
- },
1223
- ]
1224
- }
1225
- tbl_integration_logs: {
1226
- Row: {
1227
- created_at: string
1228
- id: string
1229
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1230
- integration_type: string
1231
- metadata: Json
1232
- org_id: string
1233
- response: Json | null
1234
- success: boolean
1235
- type: Database["public"]["Enums"]["enum_integration_type"]
1236
- }
1237
- Insert: {
1238
- created_at?: string
1239
- id?: string
1240
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1241
- integration_type: string
1242
- metadata?: Json
1243
- org_id: string
1244
- response?: Json | null
1245
- success?: boolean
1246
- type: Database["public"]["Enums"]["enum_integration_type"]
1247
- }
1248
- Update: {
1249
- created_at?: string
1250
- id?: string
1251
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1252
- integration_type?: string
1253
- metadata?: Json
1254
- org_id?: string
1255
- response?: Json | null
1256
- success?: boolean
1257
- type?: Database["public"]["Enums"]["enum_integration_type"]
1258
- }
1259
- Relationships: [
1260
- {
1261
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
1262
- columns: ["org_id"]
1263
- isOneToOne: false
1264
- referencedRelation: "tbl_org"
1265
- referencedColumns: ["org_id"]
1266
- },
1267
- {
1268
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
1269
- columns: ["org_id"]
1270
- isOneToOne: false
1271
- referencedRelation: "view_org"
1272
- referencedColumns: ["org_id"]
1273
- },
1274
- ]
1275
- }
1276
- tbl_integration_tokens: {
1277
- Row: {
1278
- exp: string
1279
- iat: string
1280
- id: string
1281
- is_revealed: boolean
1282
- name: string
1283
- org_id: string
1284
- role: string
1285
- token: string
1286
- token_metadata: Json | null
1287
- type: Database["public"]["Enums"]["enum_integration_type"]
1288
- }
1289
- Insert: {
1290
- exp: string
1291
- iat: string
1292
- id?: string
1293
- is_revealed?: boolean
1294
- name: string
1295
- org_id: string
1296
- role: string
1297
- token: string
1298
- token_metadata?: Json | null
1299
- type: Database["public"]["Enums"]["enum_integration_type"]
1300
- }
1301
- Update: {
1302
- exp?: string
1303
- iat?: string
1304
- id?: string
1305
- is_revealed?: boolean
1306
- name?: string
1307
- org_id?: string
1308
- role?: string
1309
- token?: string
1310
- token_metadata?: Json | null
1311
- type?: Database["public"]["Enums"]["enum_integration_type"]
1312
- }
1313
- Relationships: [
1314
- {
1315
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1316
- columns: ["org_id"]
1317
- isOneToOne: false
1318
- referencedRelation: "tbl_org"
1319
- referencedColumns: ["org_id"]
1320
- },
1321
- {
1322
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1323
- columns: ["org_id"]
1324
- isOneToOne: false
1325
- referencedRelation: "view_org"
1326
- referencedColumns: ["org_id"]
1327
- },
1328
- ]
1329
- }
1330
- tbl_org: {
1331
- Row: {
1332
- created_at: string
1333
- org_id: string
1334
- org_image: string | null
1335
- org_metadata: Json | null
1336
- org_name: string | null
1337
- org_plan: Json | null
1338
- stripe_customer_details: Json | null
1339
- stripe_customer_id: string | null
1340
- stripe_subscription_details: Json | null
1341
- support_link: string | null
1342
- }
1343
- Insert: {
1344
- created_at?: string
1345
- org_id?: string
1346
- org_image?: string | null
1347
- org_metadata?: Json | null
1348
- org_name?: string | null
1349
- org_plan?: Json | null
1350
- stripe_customer_details?: Json | null
1351
- stripe_customer_id?: string | null
1352
- stripe_subscription_details?: Json | null
1353
- support_link?: string | null
1354
- }
1355
- Update: {
1356
- created_at?: string
1357
- org_id?: string
1358
- org_image?: string | null
1359
- org_metadata?: Json | null
1360
- org_name?: string | null
1361
- org_plan?: Json | null
1362
- stripe_customer_details?: Json | null
1363
- stripe_customer_id?: string | null
1364
- stripe_subscription_details?: Json | null
1365
- support_link?: string | null
1366
- }
1367
- Relationships: []
1368
- }
1369
- tbl_org_labels: {
1370
- Row: {
1371
- color: string
1372
- created_at: string
1373
- label_id: string
1374
- name: string
1375
- org_id: string
1376
- type: string
1377
- }
1378
- Insert: {
1379
- color?: string
1380
- created_at?: string
1381
- label_id?: string
1382
- name: string
1383
- org_id: string
1384
- type?: string
1385
- }
1386
- Update: {
1387
- color?: string
1388
- created_at?: string
1389
- label_id?: string
1390
- name?: string
1391
- org_id?: string
1392
- type?: string
1393
- }
1394
- Relationships: [
1395
- {
1396
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1397
- columns: ["org_id"]
1398
- isOneToOne: false
1399
- referencedRelation: "tbl_org"
1400
- referencedColumns: ["org_id"]
1401
- },
1402
- {
1403
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1404
- columns: ["org_id"]
1405
- isOneToOne: false
1406
- referencedRelation: "view_org"
1407
- referencedColumns: ["org_id"]
1408
- },
1409
- ]
1410
- }
1411
- tbl_org_members: {
1412
- Row: {
1413
- created_at: string | null
1414
- email: string
1415
- invited_at: string | null
1416
- invited_by: string | null
1417
- is_active: boolean
1418
- is_owner: boolean | null
1419
- label_ids: string[] | null
1420
- member_color: Database["public"]["Enums"]["enum_chat_colors"]
1421
- member_image: string | null
1422
- member_name: string | null
1423
- org_id: string
1424
- org_phones: string[] | null
1425
- preferences: Json
1426
- role: Database["public"]["Enums"]["enum_member_role"]
1427
- user_id: string | null
1428
- }
1429
- Insert: {
1430
- created_at?: string | null
1431
- email: string
1432
- invited_at?: string | null
1433
- invited_by?: string | null
1434
- is_active?: boolean
1435
- is_owner?: boolean | null
1436
- label_ids?: string[] | null
1437
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1438
- member_image?: string | null
1439
- member_name?: string | null
1440
- org_id: string
1441
- org_phones?: string[] | null
1442
- preferences?: Json
1443
- role?: Database["public"]["Enums"]["enum_member_role"]
1444
- user_id?: string | null
1445
- }
1446
- Update: {
1447
- created_at?: string | null
1448
- email?: string
1449
- invited_at?: string | null
1450
- invited_by?: string | null
1451
- is_active?: boolean
1452
- is_owner?: boolean | null
1453
- label_ids?: string[] | null
1454
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1455
- member_image?: string | null
1456
- member_name?: string | null
1457
- org_id?: string
1458
- org_phones?: string[] | null
1459
- preferences?: Json
1460
- role?: Database["public"]["Enums"]["enum_member_role"]
1461
- user_id?: string | null
1462
- }
1463
- Relationships: [
1464
- {
1465
- foreignKeyName: "tbl_org_members_fkey_auth_users"
1466
- columns: ["user_id"]
1467
- isOneToOne: false
1468
- referencedRelation: "users"
1469
- referencedColumns: ["id"]
1470
- },
1471
- {
1472
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1473
- columns: ["org_id"]
1474
- isOneToOne: false
1475
- referencedRelation: "tbl_org"
1476
- referencedColumns: ["org_id"]
1477
- },
1478
- {
1479
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1480
- columns: ["org_id"]
1481
- isOneToOne: false
1482
- referencedRelation: "view_org"
1483
- referencedColumns: ["org_id"]
1484
- },
1485
- ]
1486
- }
1487
- tbl_org_phones: {
1488
- Row: {
1489
- created_at: string
1490
- first_connected_at: string | null
1491
- is_browser_open: boolean
1492
- is_ready: boolean | null
1493
- legacy_version: boolean | null
1494
- library: string | null
1495
- org_id: string
1496
- org_phone: string | null
1497
- phone_id: string
1498
- phone_image: string | null
1499
- phone_name: string | null
1500
- phone_state: Json | null
1501
- qr_code: string | null
1502
- server_image: string | null
1503
- server_ip: string | null
1504
- soft_restart: boolean
1505
- updated_at: string | null
1506
- wa_state: string | null
1507
- wa_version: string | null
1508
- }
1509
- Insert: {
1510
- created_at?: string
1511
- first_connected_at?: string | null
1512
- is_browser_open?: boolean
1513
- is_ready?: boolean | null
1514
- legacy_version?: boolean | null
1515
- library?: string | null
1516
- org_id: string
1517
- org_phone?: string | null
1518
- phone_id?: string
1519
- phone_image?: string | null
1520
- phone_name?: string | null
1521
- phone_state?: Json | null
1522
- qr_code?: string | null
1523
- server_image?: string | null
1524
- server_ip?: string | null
1525
- soft_restart?: boolean
1526
- updated_at?: string | null
1527
- wa_state?: string | null
1528
- wa_version?: string | null
1529
- }
1530
- Update: {
1531
- created_at?: string
1532
- first_connected_at?: string | null
1533
- is_browser_open?: boolean
1534
- is_ready?: boolean | null
1535
- legacy_version?: boolean | null
1536
- library?: string | null
1537
- org_id?: string
1538
- org_phone?: string | null
1539
- phone_id?: string
1540
- phone_image?: string | null
1541
- phone_name?: string | null
1542
- phone_state?: Json | null
1543
- qr_code?: string | null
1544
- server_image?: string | null
1545
- server_ip?: string | null
1546
- soft_restart?: boolean
1547
- updated_at?: string | null
1548
- wa_state?: string | null
1549
- wa_version?: string | null
1550
- }
1551
- Relationships: [
1552
- {
1553
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1554
- columns: ["org_id"]
1555
- isOneToOne: false
1556
- referencedRelation: "tbl_org"
1557
- referencedColumns: ["org_id"]
1558
- },
1559
- {
1560
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1561
- columns: ["org_id"]
1562
- isOneToOne: false
1563
- referencedRelation: "view_org"
1564
- referencedColumns: ["org_id"]
1565
- },
1566
- {
1567
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1568
- columns: ["org_id"]
1569
- isOneToOne: false
1570
- referencedRelation: "tbl_org"
1571
- referencedColumns: ["org_id"]
1572
- },
1573
- {
1574
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1575
- columns: ["org_id"]
1576
- isOneToOne: false
1577
- referencedRelation: "view_org"
1578
- referencedColumns: ["org_id"]
1579
- },
1580
- ]
1581
- }
1582
- tbl_org_transactions: {
1583
- Row: {
1584
- amount: number
1585
- is_top_up: boolean | null
1586
- org_id: string
1587
- timestamp: string | null
1588
- transaction_id: string
1589
- transaction_metadata: Json | null
1590
- transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1591
- usage_metadata: Json | null
1592
- }
1593
- Insert: {
1594
- amount: number
1595
- is_top_up?: boolean | null
1596
- org_id: string
1597
- timestamp?: string | null
1598
- transaction_id?: string
1599
- transaction_metadata?: Json | null
1600
- transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1601
- usage_metadata?: Json | null
1602
- }
1603
- Update: {
1604
- amount?: number
1605
- is_top_up?: boolean | null
1606
- org_id?: string
1607
- timestamp?: string | null
1608
- transaction_id?: string
1609
- transaction_metadata?: Json | null
1610
- transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"]
1611
- usage_metadata?: Json | null
1612
- }
1613
- Relationships: [
1614
- {
1615
- foreignKeyName: "tbl_org_transactions_org_id_fkey"
1616
- columns: ["org_id"]
1617
- isOneToOne: false
1618
- referencedRelation: "tbl_org"
1619
- referencedColumns: ["org_id"]
1620
- },
1621
- {
1622
- foreignKeyName: "tbl_org_transactions_org_id_fkey"
1623
- columns: ["org_id"]
1624
- isOneToOne: false
1625
- referencedRelation: "view_org"
1626
- referencedColumns: ["org_id"]
1627
- },
1628
- ]
1629
- }
1630
- tbl_quick_replies: {
1631
- Row: {
1632
- command: string | null
1633
- created_at: string
1634
- message_payload: Json | null
1635
- org_id: string
1636
- reply_id: string
1637
- }
1638
- Insert: {
1639
- command?: string | null
1640
- created_at?: string
1641
- message_payload?: Json | null
1642
- org_id: string
1643
- reply_id?: string
1644
- }
1645
- Update: {
1646
- command?: string | null
1647
- created_at?: string
1648
- message_payload?: Json | null
1649
- org_id?: string
1650
- reply_id?: string
1651
- }
1652
- Relationships: [
1653
- {
1654
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1655
- columns: ["org_id"]
1656
- isOneToOne: false
1657
- referencedRelation: "tbl_org"
1658
- referencedColumns: ["org_id"]
1659
- },
1660
- {
1661
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1662
- columns: ["org_id"]
1663
- isOneToOne: false
1664
- referencedRelation: "view_org"
1665
- referencedColumns: ["org_id"]
1666
- },
1667
- ]
1668
- }
1669
- tbl_scheduled_messages: {
1670
- Row: {
1671
- chat_id: string
1672
- created_at: string
1673
- message_id: string | null
1674
- message_payload: Json | null
1675
- org_id: string
1676
- org_phone: string | null
1677
- performed_by: string | null
1678
- scheduled_at: string
1679
- sent_message_id: string
1680
- status: boolean | null
1681
- updated_at: string | null
1682
- }
1683
- Insert: {
1684
- chat_id: string
1685
- created_at?: string
1686
- message_id?: string | null
1687
- message_payload?: Json | null
1688
- org_id: string
1689
- org_phone?: string | null
1690
- performed_by?: string | null
1691
- scheduled_at: string
1692
- sent_message_id: string
1693
- status?: boolean | null
1694
- updated_at?: string | null
1695
- }
1696
- Update: {
1697
- chat_id?: string
1698
- created_at?: string
1699
- message_id?: string | null
1700
- message_payload?: Json | null
1701
- org_id?: string
1702
- org_phone?: string | null
1703
- performed_by?: string | null
1704
- scheduled_at?: string
1705
- sent_message_id?: string
1706
- status?: boolean | null
1707
- updated_at?: string | null
1708
- }
1709
- Relationships: [
1710
- {
1711
- foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1712
- columns: ["org_id"]
1713
- isOneToOne: false
1714
- referencedRelation: "tbl_org"
1715
- referencedColumns: ["org_id"]
1716
- },
1717
- {
1718
- foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1719
- columns: ["org_id"]
1720
- isOneToOne: false
1721
- referencedRelation: "view_org"
1722
- referencedColumns: ["org_id"]
1723
- },
1724
- ]
1725
- }
1726
- tbl_tools_whatsapp_links: {
1727
- Row: {
1728
- created_at: string
1729
- link_id: string
1730
- link_name: string
1731
- message: string | null
1732
- phone: string
1733
- }
1734
- Insert: {
1735
- created_at?: string
1736
- link_id?: string
1737
- link_name: string
1738
- message?: string | null
1739
- phone: string
1740
- }
1741
- Update: {
1742
- created_at?: string
1743
- link_id?: string
1744
- link_name?: string
1745
- message?: string | null
1746
- phone?: string
1747
- }
1748
- Relationships: []
1749
- }
1750
- }
1751
- Views: {
1752
- view_broadcast_logs: {
1753
- Row: {
1754
- broadcast_id: string | null
1755
- broadcast_status:
1756
- | Database["public"]["Enums"]["enum_broadcast_status"]
1757
- | null
1758
- created_at: string | null
1759
- delivered_percentage: number | null
1760
- failed_chats: number | null
1761
- message_payload: Json | null
1762
- org_id: string | null
1763
- pending_chats: number | null
1764
- performed_at: string | null
1765
- performed_by: string | null
1766
- read_percentage: number | null
1767
- scheduled_at: string | null
1768
- sent_chats: number | null
1769
- total_chats: number | null
1770
- total_delivered_count: number | null
1771
- total_member_count: number | null
1772
- total_read_count: number | null
1773
- }
1774
- Relationships: [
1775
- {
1776
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1777
- columns: ["org_id"]
1778
- isOneToOne: false
1779
- referencedRelation: "tbl_org"
1780
- referencedColumns: ["org_id"]
1781
- },
1782
- {
1783
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1784
- columns: ["org_id"]
1785
- isOneToOne: false
1786
- referencedRelation: "view_org"
1787
- referencedColumns: ["org_id"]
1788
- },
1789
- ]
1790
- }
1791
- view_chat_logs: {
1792
- Row: {
1793
- action: string | null
1794
- failed: number | null
1795
- operation_id: string | null
1796
- org_id: string | null
1797
- pending: number | null
1798
- performed_at: string | null
1799
- performed_by: string | null
1800
- success: number | null
1801
- total_chats: number | null
1802
- total_logs: number | null
1803
- total_participants: number | null
1804
- }
1805
- Relationships: [
1806
- {
1807
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
1808
- columns: ["org_id"]
1809
- isOneToOne: false
1810
- referencedRelation: "tbl_org"
1811
- referencedColumns: ["org_id"]
1812
- },
1813
- {
1814
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
1815
- columns: ["org_id"]
1816
- isOneToOne: false
1817
- referencedRelation: "view_org"
1818
- referencedColumns: ["org_id"]
1819
- },
1820
- ]
1821
- }
1822
- view_chats: {
1823
- Row: {
1824
- assigned_to: string | null
1825
- chat_access: Json | null
1826
- chat_id: string | null
1827
- chat_image: string | null
1828
- chat_name: string | null
1829
- chat_org_phones: string[] | null
1830
- chat_type: string | null
1831
- created_at: string | null
1832
- custom_properties: Json | null
1833
- flag_count_map: Json | null
1834
- group_description: string | null
1835
- hubspot_metadata: Json | null
1836
- info_admins_only: boolean | null
1837
- invite_link: string | null
1838
- is_exited: boolean | null
1839
- is_muted: boolean | null
1840
- label_ids: Json | null
1841
- latest_message: Json | null
1842
- member_add_mode: string | null
1843
- member_count: number | null
1844
- message_unread_count: number | null
1845
- messages_admins_only: boolean | null
1846
- org_id: string | null
1847
- org_phone: string | null
1848
- updated_at: string | null
1849
- }
1850
- Relationships: []
1851
- }
1852
- view_org: {
1853
- Row: {
1854
- access_scopes: Json | null
1855
- created_at: string | null
1856
- is_enterprise: boolean | null
1857
- is_free_trial: boolean | null
1858
- is_freshdesk_connected: boolean | null
1859
- is_hubspot_connected: boolean | null
1860
- is_zohodesk_connected: boolean | null
1861
- org_id: string | null
1862
- org_image: string | null
1863
- org_metadata: Json | null
1864
- org_name: string | null
1865
- org_plan: Json | null
1866
- pending_days: number | null
1867
- phone_limit: string | null
1868
- plan_id: string | null
1869
- stripe_customer_details: Json | null
1870
- stripe_customer_id: string | null
1871
- stripe_subscription_details: Json | null
1872
- subscription_status: string | null
1873
- support_link: string | null
1874
- user_limit: string | null
1875
- }
1876
- Insert: {
1877
- access_scopes?: never
1878
- created_at?: string | null
1879
- is_enterprise?: never
1880
- is_free_trial?: never
1881
- is_freshdesk_connected?: never
1882
- is_hubspot_connected?: never
1883
- is_zohodesk_connected?: never
1884
- org_id?: string | null
1885
- org_image?: string | null
1886
- org_metadata?: Json | null
1887
- org_name?: string | null
1888
- org_plan?: Json | null
1889
- pending_days?: never
1890
- phone_limit?: never
1891
- plan_id?: never
1892
- stripe_customer_details?: Json | null
1893
- stripe_customer_id?: string | null
1894
- stripe_subscription_details?: Json | null
1895
- subscription_status?: never
1896
- support_link?: string | null
1897
- user_limit?: never
1898
- }
1899
- Update: {
1900
- access_scopes?: never
1901
- created_at?: string | null
1902
- is_enterprise?: never
1903
- is_free_trial?: never
1904
- is_freshdesk_connected?: never
1905
- is_hubspot_connected?: never
1906
- is_zohodesk_connected?: never
1907
- org_id?: string | null
1908
- org_image?: string | null
1909
- org_metadata?: Json | null
1910
- org_name?: string | null
1911
- org_plan?: Json | null
1912
- pending_days?: never
1913
- phone_limit?: never
1914
- plan_id?: never
1915
- stripe_customer_details?: Json | null
1916
- stripe_customer_id?: string | null
1917
- stripe_subscription_details?: Json | null
1918
- subscription_status?: never
1919
- support_link?: string | null
1920
- user_limit?: never
1921
- }
1922
- Relationships: []
1923
- }
1924
- }
1925
- Functions: {
1926
- check_feature_flag_access: {
1927
- Args: {
1928
- org_id_input: string
1929
- feature_input: string
1930
- }
1931
- Returns: boolean
1932
- }
1933
- create_partition: {
1934
- Args: {
1935
- org_id_input: string
1936
- }
1937
- Returns: boolean
1938
- }
1939
- custom_access_token_hook: {
1940
- Args: {
1941
- event: Json
1942
- }
1943
- Returns: Json
1944
- }
1945
- drop_partition: {
1946
- Args: {
1947
- org_id_input: string
1948
- }
1949
- Returns: boolean
1950
- }
1951
- find_discrepancies: {
1952
- Args: {
1953
- p_org_id: string
1954
- }
1955
- Returns: {
1956
- a_chat_id: string
1957
- discrepancy_count: number
1958
- }[]
1959
- }
1960
- gen_id: {
1961
- Args: {
1962
- prefix: string
1963
- size?: number
1964
- alphabet?: string
1965
- }
1966
- Returns: string
1967
- }
1968
- gen_ticket_id: {
1969
- Args: {
1970
- org_id_input: string
1971
- }
1972
- Returns: string
1973
- }
1974
- generate_access_token: {
1975
- Args: {
1976
- name_input?: string
1977
- type_input?: Database["public"]["Enums"]["enum_integration_type"]
1978
- org_id_input?: string
1979
- }
1980
- Returns: Json
1981
- }
1982
- get_api_auth_details: {
1983
- Args: {
1984
- org_id_input?: string
1985
- org_phone_input?: string
1986
- token_id_input?: string
1987
- token_type_input?: Database["public"]["Enums"]["enum_integration_type"]
1988
- }
1989
- Returns: Json
1990
- }
1991
- get_chat_labels_data: {
1992
- Args: {
1993
- org_id_input: string
1994
- chat_ids_input?: string[]
1995
- }
1996
- Returns: Json[]
1997
- }
1998
- get_chat_rule_info: {
1999
- Args: {
2000
- chat_id_input: string
2001
- org_id_input: string
2002
- org_phone_input: string
2003
- }
2004
- Returns: Json
2005
- }
2006
- get_chats: {
2007
- Args: {
2008
- org_id_input: string
2009
- chat_id_input?: string[]
2010
- with_members?: boolean
2011
- last_updated_at?: string
2012
- batch_limit?: number
2013
- batch_offset?: number
2014
- }
2015
- Returns: Json
2016
- }
2017
- get_chats_info: {
2018
- Args: {
2019
- chat_id_input: string
2020
- org_id_input: string
2021
- org_phone_input?: string
2022
- }
2023
- Returns: Json
2024
- }
2025
- get_contacts: {
2026
- Args: {
2027
- org_id_input: string
2028
- contact_ids_input?: string[]
2029
- sync_phone_contacts?: boolean
2030
- search_input?: string
2031
- label_ids_input?: string[]
2032
- is_internal_input?: boolean
2033
- offset_input?: number
2034
- limit_input?: number
2035
- }
2036
- Returns: Json
2037
- }
2038
- get_export_chats_data: {
2039
- Args: {
2040
- org_id_input: string
2041
- chat_id_input?: string[]
2042
- }
2043
- Returns: Json
2044
- }
2045
- get_export_tickets_data: {
2046
- Args: {
2047
- org_id_input: string
2048
- ticket_id_input?: string[]
2049
- }
2050
- Returns: Json
2051
- }
2052
- get_feature_flags: {
2053
- Args: {
2054
- org_id_input: string
2055
- }
2056
- Returns: {
2057
- feature: string
2058
- enabled: boolean
2059
- }[]
2060
- }
2061
- get_integration_data: {
2062
- Args: {
2063
- org_id_input?: string
2064
- }
2065
- Returns: Json
2066
- }
2067
- get_message_rule_info: {
2068
- Args: {
2069
- message_id_input: string
2070
- chat_id_input: string
2071
- org_id_input: string
2072
- org_phone_input: string
2073
- sender_id_input: string
2074
- }
2075
- Returns: Json
2076
- }
2077
- get_messages_notifications_reactions: {
2078
- Args: {
2079
- org_id_input: string
2080
- chat_id_input?: string[]
2081
- limit_input?: number
2082
- offset_input?: number
2083
- }
2084
- Returns: Json
2085
- }
2086
- get_org: {
2087
- Args: {
2088
- org_id_input?: string
2089
- }
2090
- Returns: Json
2091
- }
2092
- get_org_credits: {
2093
- Args: {
2094
- org_id_input?: string
2095
- }
2096
- Returns: Json
2097
- }
2098
- get_org_phones: {
2099
- Args: {
2100
- org_id_input?: string
2101
- phone_id_input?: string
2102
- }
2103
- Returns: Json
2104
- }
2105
- get_reaction_rule_info: {
2106
- Args: {
2107
- reaction_id_input: string
2108
- message_id_input: string
2109
- chat_id_input: string
2110
- org_id_input: string
2111
- org_phone_input: string
2112
- sender_id_input: string
2113
- }
2114
- Returns: Json
2115
- }
2116
- get_team_metrics_between_dates: {
2117
- Args: {
2118
- org_id_input: string
2119
- start_date: string
2120
- end_date: string
2121
- chat_id_input?: string[]
2122
- }
2123
- Returns: Json
2124
- }
2125
- get_ticket_info: {
2126
- Args: {
2127
- ticket_id_input?: string
2128
- org_id_input?: string
2129
- chat_id_input?: string
2130
- unique_message_id_input?: string
2131
- }
2132
- Returns: Json
2133
- }
2134
- get_ticket_rule_info: {
2135
- Args: {
2136
- ticket_id_input: string
2137
- unique_message_id_input: string
2138
- chat_id_input: string
2139
- org_id_input: string
2140
- }
2141
- Returns: Json
2142
- }
2143
- get_universal_search_result: {
2144
- Args: {
2145
- search_category_input: string
2146
- search_query_input: string
2147
- org_id_input: string
2148
- }
2149
- Returns: {
2150
- category: string
2151
- result: Json
2152
- }[]
2153
- }
2154
- image_path: {
2155
- Args: {
2156
- path_input?: string
2157
- bucket_name?: string
2158
- req_base?: boolean
2159
- }
2160
- Returns: string
2161
- }
2162
- list_org_from_user: {
2163
- Args: Record<PropertyKey, never>
2164
- Returns: string[]
2165
- }
2166
- list_role_from_user: {
2167
- Args: Record<PropertyKey, never>
2168
- Returns: Database["public"]["Enums"]["enum_member_role"]
2169
- }
2170
- update_chat_properties: {
2171
- Args: {
2172
- column_name: string
2173
- org_id_input: string
2174
- chat_id_input: string[]
2175
- column_value_input?: string
2176
- key_input?: string
2177
- value_input?: Json
2178
- }
2179
- Returns: undefined
2180
- }
2181
- update_custom_properties: {
2182
- Args: {
2183
- org_id_input: string
2184
- row_properties_map: Json
2185
- replace_properties?: boolean
2186
- }
2187
- Returns: undefined
2188
- }
2189
- update_labels: {
2190
- Args: {
2191
- org_id_input: string
2192
- tbl_type: string
2193
- row_label_map: Json
2194
- replace_labels?: boolean
2195
- }
2196
- Returns: undefined
2197
- }
2198
- }
2199
- Enums: {
2200
- enum_broadcast_status: "inprogress" | "completed" | "stopped" | "expired"
2201
- enum_chat_colors:
2202
- | "#B4876E"
2203
- | "#A5B337"
2204
- | "#06CF9C"
2205
- | "#25D366"
2206
- | "#02A698"
2207
- | "#7D9EF1"
2208
- | "#007BFC"
2209
- | "#5E47DE"
2210
- | "#7F66FF"
2211
- | "#9333EA"
2212
- | "#FA6533"
2213
- | "#C4532D"
2214
- | "#DC2626"
2215
- | "#FF2E74"
2216
- | "#DB2777"
2217
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
2218
- enum_credit_transaction_type: "credit" | "debit"
2219
- enum_integration_name:
2220
- | "org.created"
2221
- | "org.updated"
2222
- | "org.member.created"
2223
- | "org.member.updated"
2224
- | "org.phone.created"
2225
- | "org.phone.connected"
2226
- | "org.phone.disconnected"
2227
- | "org.subscription.trial_will_end"
2228
- | "chat.created"
2229
- | "chat.updated"
2230
- | "chat.notification.created"
2231
- | "message.created"
2232
- | "message.updated"
2233
- | "message.deleted"
2234
- | "message.ack.updated"
2235
- | "reaction.created"
2236
- | "reaction.updated"
2237
- | "ticket.created"
2238
- | "ticket.updated"
2239
- | "ticket.deleted"
2240
- | "org.integrations.updated"
2241
- | "message.flagged"
2242
- | "message.unflagged"
2243
- enum_integration_type:
2244
- | "zapier"
2245
- | "pabbly"
2246
- | "api"
2247
- | "webhook"
2248
- | "hubspot"
2249
- | "freshdesk"
2250
- | "slack"
2251
- | "jira"
2252
- | "salesforce"
2253
- | "zohodesk"
2254
- | "gsheets"
2255
- enum_member_role: "admin" | "member"
2256
- }
2257
- CompositeTypes: {
2258
- [_ in never]: never
2259
- }
2260
- }
2261
- storage: {
2262
- Tables: {
2263
- buckets: {
2264
- Row: {
2265
- allowed_mime_types: string[] | null
2266
- avif_autodetection: boolean | null
2267
- created_at: string | null
2268
- file_size_limit: number | null
2269
- id: string
2270
- name: string
2271
- owner: string | null
2272
- owner_id: string | null
2273
- public: boolean | null
2274
- updated_at: string | null
2275
- }
2276
- Insert: {
2277
- allowed_mime_types?: string[] | null
2278
- avif_autodetection?: boolean | null
2279
- created_at?: string | null
2280
- file_size_limit?: number | null
2281
- id: string
2282
- name: string
2283
- owner?: string | null
2284
- owner_id?: string | null
2285
- public?: boolean | null
2286
- updated_at?: string | null
2287
- }
2288
- Update: {
2289
- allowed_mime_types?: string[] | null
2290
- avif_autodetection?: boolean | null
2291
- created_at?: string | null
2292
- file_size_limit?: number | null
2293
- id?: string
2294
- name?: string
2295
- owner?: string | null
2296
- owner_id?: string | null
2297
- public?: boolean | null
2298
- updated_at?: string | null
2299
- }
2300
- Relationships: []
2301
- }
2302
- migrations: {
2303
- Row: {
2304
- executed_at: string | null
2305
- hash: string
2306
- id: number
2307
- name: string
2308
- }
2309
- Insert: {
2310
- executed_at?: string | null
2311
- hash: string
2312
- id: number
2313
- name: string
2314
- }
2315
- Update: {
2316
- executed_at?: string | null
2317
- hash?: string
2318
- id?: number
2319
- name?: string
2320
- }
2321
- Relationships: []
2322
- }
2323
- objects: {
2324
- Row: {
2325
- bucket_id: string | null
2326
- created_at: string | null
2327
- id: string
2328
- last_accessed_at: string | null
2329
- metadata: Json | null
2330
- name: string | null
2331
- owner: string | null
2332
- owner_id: string | null
2333
- path_tokens: string[] | null
2334
- updated_at: string | null
2335
- user_metadata: Json | null
2336
- version: string | null
2337
- }
2338
- Insert: {
2339
- bucket_id?: string | null
2340
- created_at?: string | null
2341
- id?: string
2342
- last_accessed_at?: string | null
2343
- metadata?: Json | null
2344
- name?: string | null
2345
- owner?: string | null
2346
- owner_id?: string | null
2347
- path_tokens?: string[] | null
2348
- updated_at?: string | null
2349
- user_metadata?: Json | null
2350
- version?: string | null
2351
- }
2352
- Update: {
2353
- bucket_id?: string | null
2354
- created_at?: string | null
2355
- id?: string
2356
- last_accessed_at?: string | null
2357
- metadata?: Json | null
2358
- name?: string | null
2359
- owner?: string | null
2360
- owner_id?: string | null
2361
- path_tokens?: string[] | null
2362
- updated_at?: string | null
2363
- user_metadata?: Json | null
2364
- version?: string | null
2365
- }
2366
- Relationships: [
2367
- {
2368
- foreignKeyName: "objects_bucketId_fkey"
2369
- columns: ["bucket_id"]
2370
- isOneToOne: false
2371
- referencedRelation: "buckets"
2372
- referencedColumns: ["id"]
2373
- },
2374
- ]
2375
- }
2376
- s3_multipart_uploads: {
2377
- Row: {
2378
- bucket_id: string
2379
- created_at: string
2380
- id: string
2381
- in_progress_size: number
2382
- key: string
2383
- owner_id: string | null
2384
- upload_signature: string
2385
- user_metadata: Json | null
2386
- version: string
2387
- }
2388
- Insert: {
2389
- bucket_id: string
2390
- created_at?: string
2391
- id: string
2392
- in_progress_size?: number
2393
- key: string
2394
- owner_id?: string | null
2395
- upload_signature: string
2396
- user_metadata?: Json | null
2397
- version: string
2398
- }
2399
- Update: {
2400
- bucket_id?: string
2401
- created_at?: string
2402
- id?: string
2403
- in_progress_size?: number
2404
- key?: string
2405
- owner_id?: string | null
2406
- upload_signature?: string
2407
- user_metadata?: Json | null
2408
- version?: string
2409
- }
2410
- Relationships: [
2411
- {
2412
- foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2413
- columns: ["bucket_id"]
2414
- isOneToOne: false
2415
- referencedRelation: "buckets"
2416
- referencedColumns: ["id"]
2417
- },
2418
- ]
2419
- }
2420
- s3_multipart_uploads_parts: {
2421
- Row: {
2422
- bucket_id: string
2423
- created_at: string
2424
- etag: string
2425
- id: string
2426
- key: string
2427
- owner_id: string | null
2428
- part_number: number
2429
- size: number
2430
- upload_id: string
2431
- version: string
2432
- }
2433
- Insert: {
2434
- bucket_id: string
2435
- created_at?: string
2436
- etag: string
2437
- id?: string
2438
- key: string
2439
- owner_id?: string | null
2440
- part_number: number
2441
- size?: number
2442
- upload_id: string
2443
- version: string
2444
- }
2445
- Update: {
2446
- bucket_id?: string
2447
- created_at?: string
2448
- etag?: string
2449
- id?: string
2450
- key?: string
2451
- owner_id?: string | null
2452
- part_number?: number
2453
- size?: number
2454
- upload_id?: string
2455
- version?: string
2456
- }
2457
- Relationships: [
2458
- {
2459
- foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2460
- columns: ["bucket_id"]
2461
- isOneToOne: false
2462
- referencedRelation: "buckets"
2463
- referencedColumns: ["id"]
2464
- },
2465
- {
2466
- foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2467
- columns: ["upload_id"]
2468
- isOneToOne: false
2469
- referencedRelation: "s3_multipart_uploads"
2470
- referencedColumns: ["id"]
2471
- },
2472
- ]
2473
- }
2474
- }
2475
- Views: {
2476
- [_ in never]: never
2477
- }
2478
- Functions: {
2479
- can_insert_object: {
2480
- Args: {
2481
- bucketid: string
2482
- name: string
2483
- owner: string
2484
- metadata: Json
2485
- }
2486
- Returns: undefined
2487
- }
2488
- extension: {
2489
- Args: {
2490
- name: string
2491
- }
2492
- Returns: string
2493
- }
2494
- filename: {
2495
- Args: {
2496
- name: string
2497
- }
2498
- Returns: string
2499
- }
2500
- foldername: {
2501
- Args: {
2502
- name: string
2503
- }
2504
- Returns: string[]
2505
- }
2506
- get_size_by_bucket: {
2507
- Args: Record<PropertyKey, never>
2508
- Returns: {
2509
- size: number
2510
- bucket_id: string
2511
- }[]
2512
- }
2513
- list_multipart_uploads_with_delimiter: {
2514
- Args: {
2515
- bucket_id: string
2516
- prefix_param: string
2517
- delimiter_param: string
2518
- max_keys?: number
2519
- next_key_token?: string
2520
- next_upload_token?: string
2521
- }
2522
- Returns: {
2523
- key: string
2524
- id: string
2525
- created_at: string
2526
- }[]
2527
- }
2528
- list_objects_with_delimiter: {
2529
- Args: {
2530
- bucket_id: string
2531
- prefix_param: string
2532
- delimiter_param: string
2533
- max_keys?: number
2534
- start_after?: string
2535
- next_token?: string
2536
- }
2537
- Returns: {
2538
- name: string
2539
- id: string
2540
- metadata: Json
2541
- updated_at: string
2542
- }[]
2543
- }
2544
- operation: {
2545
- Args: Record<PropertyKey, never>
2546
- Returns: string
2547
- }
2548
- search: {
2549
- Args: {
2550
- prefix: string
2551
- bucketname: string
2552
- limits?: number
2553
- levels?: number
2554
- offsets?: number
2555
- search?: string
2556
- sortcolumn?: string
2557
- sortorder?: string
2558
- }
2559
- Returns: {
2560
- name: string
2561
- id: string
2562
- updated_at: string
2563
- created_at: string
2564
- last_accessed_at: string
2565
- metadata: Json
2566
- }[]
2567
- }
2568
- }
2569
- Enums: {
2570
- [_ in never]: never
2571
- }
2572
- CompositeTypes: {
2573
- [_ in never]: never
2574
- }
2575
- }
2576
- }
2577
-
2578
- type PublicSchema = Database[Extract<keyof Database, "public">]
2579
-
2580
- export type Tables<
2581
- PublicTableNameOrOptions extends
2582
- | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
2583
- | { schema: keyof Database },
2584
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2585
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2586
- Database[PublicTableNameOrOptions["schema"]]["Views"])
2587
- : never = never,
2588
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2589
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2590
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2591
- Row: infer R
2592
- }
2593
- ? R
2594
- : never
2595
- : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
2596
- PublicSchema["Views"])
2597
- ? (PublicSchema["Tables"] &
2598
- PublicSchema["Views"])[PublicTableNameOrOptions] extends {
2599
- Row: infer R
2600
- }
2601
- ? R
2602
- : never
2603
- : never
2604
-
2605
- export type TablesInsert<
2606
- PublicTableNameOrOptions extends
2607
- | keyof PublicSchema["Tables"]
2608
- | { schema: keyof Database },
2609
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2610
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2611
- : never = never,
2612
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2613
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2614
- Insert: infer I
2615
- }
2616
- ? I
2617
- : never
2618
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2619
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2620
- Insert: infer I
2621
- }
2622
- ? I
2623
- : never
2624
- : never
2625
-
2626
- export type TablesUpdate<
2627
- PublicTableNameOrOptions extends
2628
- | keyof PublicSchema["Tables"]
2629
- | { schema: keyof Database },
2630
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2631
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2632
- : never = never,
2633
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2634
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2635
- Update: infer U
2636
- }
2637
- ? U
2638
- : never
2639
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2640
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2641
- Update: infer U
2642
- }
2643
- ? U
2644
- : never
2645
- : never
2646
-
2647
- export type Enums<
2648
- PublicEnumNameOrOptions extends
2649
- | keyof PublicSchema["Enums"]
2650
- | { schema: keyof Database },
2651
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2652
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
2653
- : never = never,
2654
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
2655
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
2656
- : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
2657
- ? PublicSchema["Enums"][PublicEnumNameOrOptions]
2658
- : never
2659
-
1
+ export type Json = { [key: string]: any } | any
2
+
3
+ export type Database = {
4
+ internal: {
5
+ Tables: {
6
+ config: {
7
+ Row: {
8
+ key: string
9
+ updated_at: string
10
+ value: string | null
11
+ }
12
+ Insert: {
13
+ key: string
14
+ updated_at?: string
15
+ value?: string | null
16
+ }
17
+ Update: {
18
+ key?: string
19
+ updated_at?: string
20
+ value?: string | null
21
+ }
22
+ Relationships: []
23
+ }
24
+ org_phone_logs: {
25
+ Row: {
26
+ connection_history: Json | null
27
+ created_at: string
28
+ deleted_at: string | null
29
+ first_connected_at: string | null
30
+ org_id: string
31
+ org_phone: string | null
32
+ phone_id: string
33
+ }
34
+ Insert: {
35
+ connection_history?: Json | null
36
+ created_at?: string
37
+ deleted_at?: string | null
38
+ first_connected_at?: string | null
39
+ org_id: string
40
+ org_phone?: string | null
41
+ phone_id: string
42
+ }
43
+ Update: {
44
+ connection_history?: Json | null
45
+ created_at?: string
46
+ deleted_at?: string | null
47
+ first_connected_at?: string | null
48
+ org_id?: string
49
+ org_phone?: string | null
50
+ phone_id?: string
51
+ }
52
+ Relationships: []
53
+ }
54
+ tbl_communication_logs: {
55
+ Row: {
56
+ communication_type: string | null
57
+ created_at: string
58
+ id: number
59
+ metadata: Json | null
60
+ org_id: string | null
61
+ recipient: string | null
62
+ success: boolean | null
63
+ type: string | null
64
+ }
65
+ Insert: {
66
+ communication_type?: string | null
67
+ created_at?: string
68
+ id?: number
69
+ metadata?: Json | null
70
+ org_id?: string | null
71
+ recipient?: string | null
72
+ success?: boolean | null
73
+ type?: string | null
74
+ }
75
+ Update: {
76
+ communication_type?: string | null
77
+ created_at?: string
78
+ id?: number
79
+ metadata?: Json | null
80
+ org_id?: string | null
81
+ recipient?: string | null
82
+ success?: boolean | null
83
+ type?: string | null
84
+ }
85
+ Relationships: []
86
+ }
87
+ tbl_feature_flags: {
88
+ Row: {
89
+ created_at: string | null
90
+ enabled: boolean | null
91
+ excluded_orgs: string[] | null
92
+ exclusive_to_orgs: string[] | null
93
+ feature: string
94
+ included_orgs: string[] | null
95
+ percentage: number | null
96
+ plans: string[] | null
97
+ start_date: string | null
98
+ }
99
+ Insert: {
100
+ created_at?: string | null
101
+ enabled?: boolean | null
102
+ excluded_orgs?: string[] | null
103
+ exclusive_to_orgs?: string[] | null
104
+ feature: string
105
+ included_orgs?: string[] | null
106
+ percentage?: number | null
107
+ plans?: string[] | null
108
+ start_date?: string | null
109
+ }
110
+ Update: {
111
+ created_at?: string | null
112
+ enabled?: boolean | null
113
+ excluded_orgs?: string[] | null
114
+ exclusive_to_orgs?: string[] | null
115
+ feature?: string
116
+ included_orgs?: string[] | null
117
+ percentage?: number | null
118
+ plans?: string[] | null
119
+ start_date?: string | null
120
+ }
121
+ Relationships: []
122
+ }
123
+ tbl_trigger_logs: {
124
+ Row: {
125
+ created_at: string
126
+ id: number
127
+ request_body: Json
128
+ request_id: string
129
+ trace_id: string
130
+ trigger_name: string
131
+ }
132
+ Insert: {
133
+ created_at?: string
134
+ id?: number
135
+ request_body: Json
136
+ request_id: string
137
+ trace_id?: string
138
+ trigger_name: string
139
+ }
140
+ Update: {
141
+ created_at?: string
142
+ id?: number
143
+ request_body?: Json
144
+ request_id?: string
145
+ trace_id?: string
146
+ trigger_name?: string
147
+ }
148
+ Relationships: []
149
+ }
150
+ }
151
+ Views: {
152
+ [_ in never]: never
153
+ }
154
+ Functions: {
155
+ [_ in never]: never
156
+ }
157
+ Enums: {
158
+ [_ in never]: never
159
+ }
160
+ CompositeTypes: {
161
+ [_ in never]: never
162
+ }
163
+ }
164
+ public: {
165
+ Tables: {
166
+ tbl_api_logs: {
167
+ Row: {
168
+ org_id: string
169
+ path: string
170
+ req: Json
171
+ request_id: string
172
+ res: Json | null
173
+ status: number
174
+ timestamp: string
175
+ token_id: string
176
+ }
177
+ Insert: {
178
+ org_id: string
179
+ path: string
180
+ req: Json
181
+ request_id: string
182
+ res?: Json | null
183
+ status: number
184
+ timestamp: string
185
+ token_id: string
186
+ }
187
+ Update: {
188
+ org_id?: string
189
+ path?: string
190
+ req?: Json
191
+ request_id?: string
192
+ res?: Json | null
193
+ status?: number
194
+ timestamp?: string
195
+ token_id?: string
196
+ }
197
+ Relationships: []
198
+ }
199
+ tbl_automation_rules: {
200
+ Row: {
201
+ actions: Json
202
+ conditions: Json
203
+ created_at: string
204
+ id: string
205
+ is_active: boolean
206
+ last_updated_at: string
207
+ last_updated_by: string
208
+ org_id: string
209
+ rule_name: string
210
+ trigger: string
211
+ }
212
+ Insert: {
213
+ actions: Json
214
+ conditions: Json
215
+ created_at?: string
216
+ id?: string
217
+ is_active?: boolean
218
+ last_updated_at?: string
219
+ last_updated_by: string
220
+ org_id: string
221
+ rule_name: string
222
+ trigger: string
223
+ }
224
+ Update: {
225
+ actions?: Json
226
+ conditions?: Json
227
+ created_at?: string
228
+ id?: string
229
+ is_active?: boolean
230
+ last_updated_at?: string
231
+ last_updated_by?: string
232
+ org_id?: string
233
+ rule_name?: string
234
+ trigger?: string
235
+ }
236
+ Relationships: [
237
+ {
238
+ foreignKeyName: "public_tbl_automation_rules_org_id_fkey"
239
+ columns: ["org_id"]
240
+ isOneToOne: false
241
+ referencedRelation: "tbl_org"
242
+ referencedColumns: ["org_id"]
243
+ },
244
+ {
245
+ foreignKeyName: "public_tbl_automation_rules_org_id_fkey"
246
+ columns: ["org_id"]
247
+ isOneToOne: false
248
+ referencedRelation: "view_org"
249
+ referencedColumns: ["org_id"]
250
+ },
251
+ ]
252
+ }
253
+ tbl_broadcast_logs: {
254
+ Row: {
255
+ broadcast_id: string
256
+ chat_id: string
257
+ completed_at: string | null
258
+ created_at: string
259
+ delivered_count: number | null
260
+ delivery_info: Json | null
261
+ is_success: boolean | null
262
+ member_count: number | null
263
+ message_id: string | null
264
+ org_id: string
265
+ org_phone: string | null
266
+ read_count: number | null
267
+ remarks: string | null
268
+ }
269
+ Insert: {
270
+ broadcast_id: string
271
+ chat_id: string
272
+ completed_at?: string | null
273
+ created_at?: string
274
+ delivered_count?: number | null
275
+ delivery_info?: Json | null
276
+ is_success?: boolean | null
277
+ member_count?: number | null
278
+ message_id?: string | null
279
+ org_id: string
280
+ org_phone?: string | null
281
+ read_count?: number | null
282
+ remarks?: string | null
283
+ }
284
+ Update: {
285
+ broadcast_id?: string
286
+ chat_id?: string
287
+ completed_at?: string | null
288
+ created_at?: string
289
+ delivered_count?: number | null
290
+ delivery_info?: Json | null
291
+ is_success?: boolean | null
292
+ member_count?: number | null
293
+ message_id?: string | null
294
+ org_id?: string
295
+ org_phone?: string | null
296
+ read_count?: number | null
297
+ remarks?: string | null
298
+ }
299
+ Relationships: [
300
+ {
301
+ foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
302
+ columns: ["broadcast_id"]
303
+ isOneToOne: false
304
+ referencedRelation: "tbl_broadcast_messages"
305
+ referencedColumns: ["broadcast_id"]
306
+ },
307
+ {
308
+ foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
309
+ columns: ["broadcast_id"]
310
+ isOneToOne: false
311
+ referencedRelation: "view_broadcast_logs"
312
+ referencedColumns: ["broadcast_id"]
313
+ },
314
+ {
315
+ foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
316
+ columns: ["org_id"]
317
+ isOneToOne: false
318
+ referencedRelation: "tbl_org"
319
+ referencedColumns: ["org_id"]
320
+ },
321
+ {
322
+ foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
323
+ columns: ["org_id"]
324
+ isOneToOne: false
325
+ referencedRelation: "view_org"
326
+ referencedColumns: ["org_id"]
327
+ },
328
+ ]
329
+ }
330
+ tbl_broadcast_messages: {
331
+ Row: {
332
+ broadcast_id: string
333
+ broadcast_status:
334
+ | Database["public"]["Enums"]["enum_broadcast_status"]
335
+ | null
336
+ chat_ids: string[] | null
337
+ created_at: string
338
+ delay: number | null
339
+ message_payload: Json | null
340
+ org_id: string
341
+ org_phone: string | null
342
+ performed_at: string | null
343
+ performed_by: string | null
344
+ scheduled_at: string | null
345
+ variables: Json | null
346
+ }
347
+ Insert: {
348
+ broadcast_id?: string
349
+ broadcast_status?:
350
+ | Database["public"]["Enums"]["enum_broadcast_status"]
351
+ | null
352
+ chat_ids?: string[] | null
353
+ created_at?: string
354
+ delay?: number | null
355
+ message_payload?: Json | null
356
+ org_id: string
357
+ org_phone?: string | null
358
+ performed_at?: string | null
359
+ performed_by?: string | null
360
+ scheduled_at?: string | null
361
+ variables?: Json | null
362
+ }
363
+ Update: {
364
+ broadcast_id?: string
365
+ broadcast_status?:
366
+ | Database["public"]["Enums"]["enum_broadcast_status"]
367
+ | null
368
+ chat_ids?: string[] | null
369
+ created_at?: string
370
+ delay?: number | null
371
+ message_payload?: Json | null
372
+ org_id?: string
373
+ org_phone?: string | null
374
+ performed_at?: string | null
375
+ performed_by?: string | null
376
+ scheduled_at?: string | null
377
+ variables?: Json | null
378
+ }
379
+ Relationships: [
380
+ {
381
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
382
+ columns: ["org_id"]
383
+ isOneToOne: false
384
+ referencedRelation: "tbl_org"
385
+ referencedColumns: ["org_id"]
386
+ },
387
+ {
388
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
389
+ columns: ["org_id"]
390
+ isOneToOne: false
391
+ referencedRelation: "view_org"
392
+ referencedColumns: ["org_id"]
393
+ },
394
+ ]
395
+ }
396
+ tbl_broadcast_templates: {
397
+ Row: {
398
+ created_at: string
399
+ message_payload: Json | null
400
+ org_id: string
401
+ template_id: string
402
+ template_name: string | null
403
+ updated_at: string | null
404
+ variable_names: Json | null
405
+ }
406
+ Insert: {
407
+ created_at?: string
408
+ message_payload?: Json | null
409
+ org_id: string
410
+ template_id?: string
411
+ template_name?: string | null
412
+ updated_at?: string | null
413
+ variable_names?: Json | null
414
+ }
415
+ Update: {
416
+ created_at?: string
417
+ message_payload?: Json | null
418
+ org_id?: string
419
+ template_id?: string
420
+ template_name?: string | null
421
+ updated_at?: string | null
422
+ variable_names?: Json | null
423
+ }
424
+ Relationships: [
425
+ {
426
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
427
+ columns: ["org_id"]
428
+ isOneToOne: false
429
+ referencedRelation: "tbl_org"
430
+ referencedColumns: ["org_id"]
431
+ },
432
+ {
433
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
434
+ columns: ["org_id"]
435
+ isOneToOne: false
436
+ referencedRelation: "view_org"
437
+ referencedColumns: ["org_id"]
438
+ },
439
+ ]
440
+ }
441
+ tbl_chat_logs: {
442
+ Row: {
443
+ action: string | null
444
+ chat_id: string | null
445
+ is_success: boolean | null
446
+ log_id: string
447
+ metadata: Json | null
448
+ operation_id: string
449
+ org_id: string
450
+ org_phone: string
451
+ participant_id: string | null
452
+ performed_by: string | null
453
+ timestamp: string | null
454
+ }
455
+ Insert: {
456
+ action?: string | null
457
+ chat_id?: string | null
458
+ is_success?: boolean | null
459
+ log_id?: string
460
+ metadata?: Json | null
461
+ operation_id: string
462
+ org_id: string
463
+ org_phone: string
464
+ participant_id?: string | null
465
+ performed_by?: string | null
466
+ timestamp?: string | null
467
+ }
468
+ Update: {
469
+ action?: string | null
470
+ chat_id?: string | null
471
+ is_success?: boolean | null
472
+ log_id?: string
473
+ metadata?: Json | null
474
+ operation_id?: string
475
+ org_id?: string
476
+ org_phone?: string
477
+ participant_id?: string | null
478
+ performed_by?: string | null
479
+ timestamp?: string | null
480
+ }
481
+ Relationships: [
482
+ {
483
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
484
+ columns: ["org_id"]
485
+ isOneToOne: false
486
+ referencedRelation: "tbl_org"
487
+ referencedColumns: ["org_id"]
488
+ },
489
+ {
490
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
491
+ columns: ["org_id"]
492
+ isOneToOne: false
493
+ referencedRelation: "view_org"
494
+ referencedColumns: ["org_id"]
495
+ },
496
+ ]
497
+ }
498
+ tbl_chat_messages: {
499
+ Row: {
500
+ ack: string | null
501
+ author: string | null
502
+ body: string | null
503
+ broadcast: boolean | null
504
+ broadcast_id: string | null
505
+ chat_id: string | null
506
+ delivery_info: Json | null
507
+ device_type: string | null
508
+ duration: string | null
509
+ flag_metadata: Json | null
510
+ flag_response_time: number | null
511
+ flag_status: boolean | null
512
+ forwarding_score: number | null
513
+ from: string | null
514
+ from_me: boolean | null
515
+ fts: unknown | null
516
+ has_media: boolean | null
517
+ has_quoted_msg: boolean | null
518
+ has_reaction: boolean | null
519
+ id: Json | null
520
+ invite_v4: Json | null
521
+ is_deleted: boolean | null
522
+ is_ephemeral: boolean | null
523
+ is_forwarded: boolean | null
524
+ is_gif: boolean | null
525
+ is_starred: boolean | null
526
+ is_status: boolean | null
527
+ links: Json | null
528
+ location: Json | null
529
+ media: Json | null
530
+ media_key: string | null
531
+ mentioned_ids: string[] | null
532
+ message_id: string
533
+ message_ticket_id: string | null
534
+ message_type: string | null
535
+ order_id: string | null
536
+ org_id: string
537
+ org_phone: string
538
+ performed_by: string | null
539
+ poll_info: Json | null
540
+ poll_results: Json | null
541
+ prev_body: string | null
542
+ quoted_message_id: string | null
543
+ raw_data: Json | null
544
+ sender_phone: string | null
545
+ sent_message_id: string | null
546
+ timestamp: string | null
547
+ to: string | null
548
+ token: string | null
549
+ unique_id: string | null
550
+ updated_at: string | null
551
+ vcards: string[] | null
552
+ }
553
+ Insert: {
554
+ ack?: string | null
555
+ author?: string | null
556
+ body?: string | null
557
+ broadcast?: boolean | null
558
+ broadcast_id?: string | null
559
+ chat_id?: string | null
560
+ delivery_info?: Json | null
561
+ device_type?: string | null
562
+ duration?: string | null
563
+ flag_metadata?: Json | null
564
+ flag_response_time?: number | null
565
+ flag_status?: boolean | null
566
+ forwarding_score?: number | null
567
+ from?: string | null
568
+ from_me?: boolean | null
569
+ fts?: unknown | null
570
+ has_media?: boolean | null
571
+ has_quoted_msg?: boolean | null
572
+ has_reaction?: boolean | null
573
+ id?: Json | null
574
+ invite_v4?: Json | null
575
+ is_deleted?: boolean | null
576
+ is_ephemeral?: boolean | null
577
+ is_forwarded?: boolean | null
578
+ is_gif?: boolean | null
579
+ is_starred?: boolean | null
580
+ is_status?: boolean | null
581
+ links?: Json | null
582
+ location?: Json | null
583
+ media?: Json | null
584
+ media_key?: string | null
585
+ mentioned_ids?: string[] | null
586
+ message_id: string
587
+ message_ticket_id?: string | null
588
+ message_type?: string | null
589
+ order_id?: string | null
590
+ org_id: string
591
+ org_phone: string
592
+ performed_by?: string | null
593
+ poll_info?: Json | null
594
+ poll_results?: Json | null
595
+ prev_body?: string | null
596
+ quoted_message_id?: string | null
597
+ raw_data?: Json | null
598
+ sender_phone?: string | null
599
+ sent_message_id?: string | null
600
+ timestamp?: string | null
601
+ to?: string | null
602
+ token?: string | null
603
+ unique_id?: string | null
604
+ updated_at?: string | null
605
+ vcards?: string[] | null
606
+ }
607
+ Update: {
608
+ ack?: string | null
609
+ author?: string | null
610
+ body?: string | null
611
+ broadcast?: boolean | null
612
+ broadcast_id?: string | null
613
+ chat_id?: string | null
614
+ delivery_info?: Json | null
615
+ device_type?: string | null
616
+ duration?: string | null
617
+ flag_metadata?: Json | null
618
+ flag_response_time?: number | null
619
+ flag_status?: boolean | null
620
+ forwarding_score?: number | null
621
+ from?: string | null
622
+ from_me?: boolean | null
623
+ fts?: unknown | null
624
+ has_media?: boolean | null
625
+ has_quoted_msg?: boolean | null
626
+ has_reaction?: boolean | null
627
+ id?: Json | null
628
+ invite_v4?: Json | null
629
+ is_deleted?: boolean | null
630
+ is_ephemeral?: boolean | null
631
+ is_forwarded?: boolean | null
632
+ is_gif?: boolean | null
633
+ is_starred?: boolean | null
634
+ is_status?: boolean | null
635
+ links?: Json | null
636
+ location?: Json | null
637
+ media?: Json | null
638
+ media_key?: string | null
639
+ mentioned_ids?: string[] | null
640
+ message_id?: string
641
+ message_ticket_id?: string | null
642
+ message_type?: string | null
643
+ order_id?: string | null
644
+ org_id?: string
645
+ org_phone?: string
646
+ performed_by?: string | null
647
+ poll_info?: Json | null
648
+ poll_results?: Json | null
649
+ prev_body?: string | null
650
+ quoted_message_id?: string | null
651
+ raw_data?: Json | null
652
+ sender_phone?: string | null
653
+ sent_message_id?: string | null
654
+ timestamp?: string | null
655
+ to?: string | null
656
+ token?: string | null
657
+ unique_id?: string | null
658
+ updated_at?: string | null
659
+ vcards?: string[] | null
660
+ }
661
+ Relationships: []
662
+ }
663
+ tbl_chat_notifications: {
664
+ Row: {
665
+ author: string | null
666
+ body: string | null
667
+ chat_id: string | null
668
+ id: Json | null
669
+ notification_id: string
670
+ org_id: string
671
+ org_phone: string
672
+ recipientids: string[] | null
673
+ timestamp: string | null
674
+ type: string | null
675
+ unique_id: string | null
676
+ }
677
+ Insert: {
678
+ author?: string | null
679
+ body?: string | null
680
+ chat_id?: string | null
681
+ id?: Json | null
682
+ notification_id: string
683
+ org_id: string
684
+ org_phone: string
685
+ recipientids?: string[] | null
686
+ timestamp?: string | null
687
+ type?: string | null
688
+ unique_id?: string | null
689
+ }
690
+ Update: {
691
+ author?: string | null
692
+ body?: string | null
693
+ chat_id?: string | null
694
+ id?: Json | null
695
+ notification_id?: string
696
+ org_id?: string
697
+ org_phone?: string
698
+ recipientids?: string[] | null
699
+ timestamp?: string | null
700
+ type?: string | null
701
+ unique_id?: string | null
702
+ }
703
+ Relationships: []
704
+ }
705
+ tbl_chat_participants: {
706
+ Row: {
707
+ chat_id: string
708
+ contact_id: string
709
+ id: Json | null
710
+ is_admin: boolean | null
711
+ is_super_admin: boolean | null
712
+ org_id: string
713
+ org_phone: string
714
+ }
715
+ Insert: {
716
+ chat_id: string
717
+ contact_id: string
718
+ id?: Json | null
719
+ is_admin?: boolean | null
720
+ is_super_admin?: boolean | null
721
+ org_id: string
722
+ org_phone: string
723
+ }
724
+ Update: {
725
+ chat_id?: string
726
+ contact_id?: string
727
+ id?: Json | null
728
+ is_admin?: boolean | null
729
+ is_super_admin?: boolean | null
730
+ org_id?: string
731
+ org_phone?: string
732
+ }
733
+ Relationships: []
734
+ }
735
+ tbl_chat_properties: {
736
+ Row: {
737
+ assigned_to: string | null
738
+ chat_access: Json | null
739
+ chat_id: string
740
+ chat_image: string | null
741
+ chat_name: string | null
742
+ chat_org_phones: string[]
743
+ chat_type: string | null
744
+ custom_properties: Json | null
745
+ flag_count_map: Json | null
746
+ hubspot_metadata: Json | null
747
+ label_ids: Json | null
748
+ latest_message_timestamp: string | null
749
+ org_id: string
750
+ unread_count: Json | null
751
+ unread_count_map: Json | null
752
+ updated_at: string | null
753
+ }
754
+ Insert: {
755
+ assigned_to?: string | null
756
+ chat_access?: Json | null
757
+ chat_id: string
758
+ chat_image?: string | null
759
+ chat_name?: string | null
760
+ chat_org_phones?: string[]
761
+ chat_type?: string | null
762
+ custom_properties?: Json | null
763
+ flag_count_map?: Json | null
764
+ hubspot_metadata?: Json | null
765
+ label_ids?: Json | null
766
+ latest_message_timestamp?: string | null
767
+ org_id: string
768
+ unread_count?: Json | null
769
+ unread_count_map?: Json | null
770
+ updated_at?: string | null
771
+ }
772
+ Update: {
773
+ assigned_to?: string | null
774
+ chat_access?: Json | null
775
+ chat_id?: string
776
+ chat_image?: string | null
777
+ chat_name?: string | null
778
+ chat_org_phones?: string[]
779
+ chat_type?: string | null
780
+ custom_properties?: Json | null
781
+ flag_count_map?: Json | null
782
+ hubspot_metadata?: Json | null
783
+ label_ids?: Json | null
784
+ latest_message_timestamp?: string | null
785
+ org_id?: string
786
+ unread_count?: Json | null
787
+ unread_count_map?: Json | null
788
+ updated_at?: string | null
789
+ }
790
+ Relationships: []
791
+ }
792
+ tbl_chat_reactions: {
793
+ Row: {
794
+ ack: number | null
795
+ chat_id: string | null
796
+ id: Json | null
797
+ message_id: string
798
+ msg_id: Json | null
799
+ org_id: string
800
+ org_phone: string
801
+ orphan: number | null
802
+ orphan_reason: string | null
803
+ reaction: string | null
804
+ reaction_id: string
805
+ read: boolean | null
806
+ sender_id: string
807
+ timestamp: string | null
808
+ unique_id: string | null
809
+ }
810
+ Insert: {
811
+ ack?: number | null
812
+ chat_id?: string | null
813
+ id?: Json | null
814
+ message_id: string
815
+ msg_id?: Json | null
816
+ org_id: string
817
+ org_phone: string
818
+ orphan?: number | null
819
+ orphan_reason?: string | null
820
+ reaction?: string | null
821
+ reaction_id: string
822
+ read?: boolean | null
823
+ sender_id: string
824
+ timestamp?: string | null
825
+ unique_id?: string | null
826
+ }
827
+ Update: {
828
+ ack?: number | null
829
+ chat_id?: string | null
830
+ id?: Json | null
831
+ message_id?: string
832
+ msg_id?: Json | null
833
+ org_id?: string
834
+ org_phone?: string
835
+ orphan?: number | null
836
+ orphan_reason?: string | null
837
+ reaction?: string | null
838
+ reaction_id?: string
839
+ read?: boolean | null
840
+ sender_id?: string
841
+ timestamp?: string | null
842
+ unique_id?: string | null
843
+ }
844
+ Relationships: []
845
+ }
846
+ tbl_chat_tickets: {
847
+ Row: {
848
+ assigned_by: string | null
849
+ assignee: string | null
850
+ chat_id: string
851
+ close_ticket_metadata: Json | null
852
+ closed_at: string | null
853
+ created_at: string
854
+ custom_properties: Json | null
855
+ due_date: string | null
856
+ freshdesk_metadata: Json | null
857
+ hubspot_metadata: Json | null
858
+ is_deleted: boolean
859
+ label_ids: Json | null
860
+ last_updated_at: string
861
+ org_id: string
862
+ priority: number | null
863
+ quoted_message_id: string | null
864
+ raised_by: string | null
865
+ response_time: number | null
866
+ status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
867
+ subject: string
868
+ ticket_id: string
869
+ zohodesk_metadata: Json | null
870
+ }
871
+ Insert: {
872
+ assigned_by?: string | null
873
+ assignee?: string | null
874
+ chat_id: string
875
+ close_ticket_metadata?: Json | null
876
+ closed_at?: string | null
877
+ created_at?: string
878
+ custom_properties?: Json | null
879
+ due_date?: string | null
880
+ freshdesk_metadata?: Json | null
881
+ hubspot_metadata?: Json | null
882
+ is_deleted?: boolean
883
+ label_ids?: Json | null
884
+ last_updated_at?: string
885
+ org_id: string
886
+ priority?: number | null
887
+ quoted_message_id?: string | null
888
+ raised_by?: string | null
889
+ response_time?: number | null
890
+ status?:
891
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
892
+ | null
893
+ subject: string
894
+ ticket_id?: string
895
+ zohodesk_metadata?: Json | null
896
+ }
897
+ Update: {
898
+ assigned_by?: string | null
899
+ assignee?: string | null
900
+ chat_id?: string
901
+ close_ticket_metadata?: Json | null
902
+ closed_at?: string | null
903
+ created_at?: string
904
+ custom_properties?: Json | null
905
+ due_date?: string | null
906
+ freshdesk_metadata?: Json | null
907
+ hubspot_metadata?: Json | null
908
+ is_deleted?: boolean
909
+ label_ids?: Json | null
910
+ last_updated_at?: string
911
+ org_id?: string
912
+ priority?: number | null
913
+ quoted_message_id?: string | null
914
+ raised_by?: string | null
915
+ response_time?: number | null
916
+ status?:
917
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
918
+ | null
919
+ subject?: string
920
+ ticket_id?: string
921
+ zohodesk_metadata?: Json | null
922
+ }
923
+ Relationships: [
924
+ {
925
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
926
+ columns: ["org_id"]
927
+ isOneToOne: false
928
+ referencedRelation: "tbl_org"
929
+ referencedColumns: ["org_id"]
930
+ },
931
+ {
932
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
933
+ columns: ["org_id"]
934
+ isOneToOne: false
935
+ referencedRelation: "view_org"
936
+ referencedColumns: ["org_id"]
937
+ },
938
+ ]
939
+ }
940
+ tbl_chats: {
941
+ Row: {
942
+ archived: boolean | null
943
+ chat_id: string
944
+ chat_image: string | null
945
+ chat_name: string | null
946
+ chat_type: string | null
947
+ created_at: string
948
+ group_metadata: Json | null
949
+ id: Json | null
950
+ invite_link: string | null
951
+ is_exited: boolean | null
952
+ is_group: boolean | null
953
+ is_muted: boolean | null
954
+ is_read_only: boolean | null
955
+ latest_message: Json | null
956
+ member_count: number | null
957
+ mute_expiration: number | null
958
+ name: string | null
959
+ org_id: string
960
+ org_phone: string
961
+ pinned: boolean | null
962
+ timestamp: string | null
963
+ unread_count: number | null
964
+ updated_at: string
965
+ }
966
+ Insert: {
967
+ archived?: boolean | null
968
+ chat_id: string
969
+ chat_image?: string | null
970
+ chat_name?: string | null
971
+ chat_type?: string | null
972
+ created_at?: string
973
+ group_metadata?: Json | null
974
+ id?: Json | null
975
+ invite_link?: string | null
976
+ is_exited?: boolean | null
977
+ is_group?: boolean | null
978
+ is_muted?: boolean | null
979
+ is_read_only?: boolean | null
980
+ latest_message?: Json | null
981
+ member_count?: number | null
982
+ mute_expiration?: number | null
983
+ name?: string | null
984
+ org_id: string
985
+ org_phone: string
986
+ pinned?: boolean | null
987
+ timestamp?: string | null
988
+ unread_count?: number | null
989
+ updated_at?: string
990
+ }
991
+ Update: {
992
+ archived?: boolean | null
993
+ chat_id?: string
994
+ chat_image?: string | null
995
+ chat_name?: string | null
996
+ chat_type?: string | null
997
+ created_at?: string
998
+ group_metadata?: Json | null
999
+ id?: Json | null
1000
+ invite_link?: string | null
1001
+ is_exited?: boolean | null
1002
+ is_group?: boolean | null
1003
+ is_muted?: boolean | null
1004
+ is_read_only?: boolean | null
1005
+ latest_message?: Json | null
1006
+ member_count?: number | null
1007
+ mute_expiration?: number | null
1008
+ name?: string | null
1009
+ org_id?: string
1010
+ org_phone?: string
1011
+ pinned?: boolean | null
1012
+ timestamp?: string | null
1013
+ unread_count?: number | null
1014
+ updated_at?: string
1015
+ }
1016
+ Relationships: []
1017
+ }
1018
+ tbl_contacts: {
1019
+ Row: {
1020
+ business_profile: Json | null
1021
+ contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
1022
+ contact_id: string
1023
+ contact_image: string | null
1024
+ contact_name: string | null
1025
+ contact_type: string | null
1026
+ id: Json | null
1027
+ is_blocked: boolean | null
1028
+ is_business: boolean | null
1029
+ is_enterprise: boolean | null
1030
+ is_group: boolean | null
1031
+ is_imported: boolean | null
1032
+ is_internal: boolean | null
1033
+ is_me: boolean | null
1034
+ is_my_contact: boolean | null
1035
+ is_user: boolean | null
1036
+ is_wa_contact: boolean | null
1037
+ label_ids: Json
1038
+ name: string | null
1039
+ number: string | null
1040
+ org_id: string
1041
+ periskope_name: string | null
1042
+ pushname: string | null
1043
+ short_name: string | null
1044
+ updated_at: string | null
1045
+ verified_level: number | null
1046
+ verified_name: string | null
1047
+ }
1048
+ Insert: {
1049
+ business_profile?: Json | null
1050
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1051
+ contact_id: string
1052
+ contact_image?: string | null
1053
+ contact_name?: string | null
1054
+ contact_type?: string | null
1055
+ id?: Json | null
1056
+ is_blocked?: boolean | null
1057
+ is_business?: boolean | null
1058
+ is_enterprise?: boolean | null
1059
+ is_group?: boolean | null
1060
+ is_imported?: boolean | null
1061
+ is_internal?: boolean | null
1062
+ is_me?: boolean | null
1063
+ is_my_contact?: boolean | null
1064
+ is_user?: boolean | null
1065
+ is_wa_contact?: boolean | null
1066
+ label_ids?: Json
1067
+ name?: string | null
1068
+ number?: string | null
1069
+ org_id: string
1070
+ periskope_name?: string | null
1071
+ pushname?: string | null
1072
+ short_name?: string | null
1073
+ updated_at?: string | null
1074
+ verified_level?: number | null
1075
+ verified_name?: string | null
1076
+ }
1077
+ Update: {
1078
+ business_profile?: Json | null
1079
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1080
+ contact_id?: string
1081
+ contact_image?: string | null
1082
+ contact_name?: string | null
1083
+ contact_type?: string | null
1084
+ id?: Json | null
1085
+ is_blocked?: boolean | null
1086
+ is_business?: boolean | null
1087
+ is_enterprise?: boolean | null
1088
+ is_group?: boolean | null
1089
+ is_imported?: boolean | null
1090
+ is_internal?: boolean | null
1091
+ is_me?: boolean | null
1092
+ is_my_contact?: boolean | null
1093
+ is_user?: boolean | null
1094
+ is_wa_contact?: boolean | null
1095
+ label_ids?: Json
1096
+ name?: string | null
1097
+ number?: string | null
1098
+ org_id?: string
1099
+ periskope_name?: string | null
1100
+ pushname?: string | null
1101
+ short_name?: string | null
1102
+ updated_at?: string | null
1103
+ verified_level?: number | null
1104
+ verified_name?: string | null
1105
+ }
1106
+ Relationships: [
1107
+ {
1108
+ foreignKeyName: "tbl_contacts_org_id_fkey"
1109
+ columns: ["org_id"]
1110
+ isOneToOne: false
1111
+ referencedRelation: "tbl_org"
1112
+ referencedColumns: ["org_id"]
1113
+ },
1114
+ {
1115
+ foreignKeyName: "tbl_contacts_org_id_fkey"
1116
+ columns: ["org_id"]
1117
+ isOneToOne: false
1118
+ referencedRelation: "view_org"
1119
+ referencedColumns: ["org_id"]
1120
+ },
1121
+ ]
1122
+ }
1123
+ tbl_custom_properties: {
1124
+ Row: {
1125
+ created_at: string
1126
+ created_by: string | null
1127
+ org_id: string | null
1128
+ property_id: string
1129
+ property_name: string
1130
+ property_value: Json | null
1131
+ property_value_type: string | null
1132
+ type: string | null
1133
+ }
1134
+ Insert: {
1135
+ created_at?: string
1136
+ created_by?: string | null
1137
+ org_id?: string | null
1138
+ property_id?: string
1139
+ property_name: string
1140
+ property_value?: Json | null
1141
+ property_value_type?: string | null
1142
+ type?: string | null
1143
+ }
1144
+ Update: {
1145
+ created_at?: string
1146
+ created_by?: string | null
1147
+ org_id?: string | null
1148
+ property_id?: string
1149
+ property_name?: string
1150
+ property_value?: Json | null
1151
+ property_value_type?: string | null
1152
+ type?: string | null
1153
+ }
1154
+ Relationships: [
1155
+ {
1156
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
1157
+ columns: ["org_id"]
1158
+ isOneToOne: false
1159
+ referencedRelation: "tbl_org"
1160
+ referencedColumns: ["org_id"]
1161
+ },
1162
+ {
1163
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
1164
+ columns: ["org_id"]
1165
+ isOneToOne: false
1166
+ referencedRelation: "view_org"
1167
+ referencedColumns: ["org_id"]
1168
+ },
1169
+ ]
1170
+ }
1171
+ tbl_integration_hooks: {
1172
+ Row: {
1173
+ hook_url: string
1174
+ id: string
1175
+ integration_id: string | null
1176
+ integration_metadata: Json
1177
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1178
+ integration_type: string
1179
+ is_subscribed: boolean
1180
+ org_id: string
1181
+ subscribed_at: string
1182
+ type: Database["public"]["Enums"]["enum_integration_type"]
1183
+ }
1184
+ Insert: {
1185
+ hook_url: string
1186
+ id?: string
1187
+ integration_id?: string | null
1188
+ integration_metadata: Json
1189
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1190
+ integration_type: string
1191
+ is_subscribed: boolean
1192
+ org_id: string
1193
+ subscribed_at?: string
1194
+ type: Database["public"]["Enums"]["enum_integration_type"]
1195
+ }
1196
+ Update: {
1197
+ hook_url?: string
1198
+ id?: string
1199
+ integration_id?: string | null
1200
+ integration_metadata?: Json
1201
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1202
+ integration_type?: string
1203
+ is_subscribed?: boolean
1204
+ org_id?: string
1205
+ subscribed_at?: string
1206
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1207
+ }
1208
+ Relationships: [
1209
+ {
1210
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1211
+ columns: ["org_id"]
1212
+ isOneToOne: false
1213
+ referencedRelation: "tbl_org"
1214
+ referencedColumns: ["org_id"]
1215
+ },
1216
+ {
1217
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1218
+ columns: ["org_id"]
1219
+ isOneToOne: false
1220
+ referencedRelation: "view_org"
1221
+ referencedColumns: ["org_id"]
1222
+ },
1223
+ ]
1224
+ }
1225
+ tbl_integration_logs: {
1226
+ Row: {
1227
+ created_at: string
1228
+ id: string
1229
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1230
+ integration_type: string
1231
+ metadata: Json
1232
+ org_id: string
1233
+ response: Json | null
1234
+ success: boolean
1235
+ type: Database["public"]["Enums"]["enum_integration_type"]
1236
+ }
1237
+ Insert: {
1238
+ created_at?: string
1239
+ id?: string
1240
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1241
+ integration_type: string
1242
+ metadata?: Json
1243
+ org_id: string
1244
+ response?: Json | null
1245
+ success?: boolean
1246
+ type: Database["public"]["Enums"]["enum_integration_type"]
1247
+ }
1248
+ Update: {
1249
+ created_at?: string
1250
+ id?: string
1251
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1252
+ integration_type?: string
1253
+ metadata?: Json
1254
+ org_id?: string
1255
+ response?: Json | null
1256
+ success?: boolean
1257
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1258
+ }
1259
+ Relationships: [
1260
+ {
1261
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
1262
+ columns: ["org_id"]
1263
+ isOneToOne: false
1264
+ referencedRelation: "tbl_org"
1265
+ referencedColumns: ["org_id"]
1266
+ },
1267
+ {
1268
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
1269
+ columns: ["org_id"]
1270
+ isOneToOne: false
1271
+ referencedRelation: "view_org"
1272
+ referencedColumns: ["org_id"]
1273
+ },
1274
+ ]
1275
+ }
1276
+ tbl_integration_tokens: {
1277
+ Row: {
1278
+ exp: string
1279
+ iat: string
1280
+ id: string
1281
+ is_revealed: boolean
1282
+ name: string
1283
+ org_id: string
1284
+ role: string
1285
+ token: string
1286
+ token_metadata: Json | null
1287
+ type: Database["public"]["Enums"]["enum_integration_type"]
1288
+ }
1289
+ Insert: {
1290
+ exp: string
1291
+ iat: string
1292
+ id?: string
1293
+ is_revealed?: boolean
1294
+ name: string
1295
+ org_id: string
1296
+ role: string
1297
+ token: string
1298
+ token_metadata?: Json | null
1299
+ type: Database["public"]["Enums"]["enum_integration_type"]
1300
+ }
1301
+ Update: {
1302
+ exp?: string
1303
+ iat?: string
1304
+ id?: string
1305
+ is_revealed?: boolean
1306
+ name?: string
1307
+ org_id?: string
1308
+ role?: string
1309
+ token?: string
1310
+ token_metadata?: Json | null
1311
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1312
+ }
1313
+ Relationships: [
1314
+ {
1315
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1316
+ columns: ["org_id"]
1317
+ isOneToOne: false
1318
+ referencedRelation: "tbl_org"
1319
+ referencedColumns: ["org_id"]
1320
+ },
1321
+ {
1322
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1323
+ columns: ["org_id"]
1324
+ isOneToOne: false
1325
+ referencedRelation: "view_org"
1326
+ referencedColumns: ["org_id"]
1327
+ },
1328
+ ]
1329
+ }
1330
+ tbl_org: {
1331
+ Row: {
1332
+ created_at: string
1333
+ org_id: string
1334
+ org_image: string | null
1335
+ org_metadata: Json | null
1336
+ org_name: string | null
1337
+ org_plan: Json | null
1338
+ stripe_customer_details: Json | null
1339
+ stripe_customer_id: string | null
1340
+ stripe_subscription_details: Json | null
1341
+ support_link: string | null
1342
+ }
1343
+ Insert: {
1344
+ created_at?: string
1345
+ org_id?: string
1346
+ org_image?: string | null
1347
+ org_metadata?: Json | null
1348
+ org_name?: string | null
1349
+ org_plan?: Json | null
1350
+ stripe_customer_details?: Json | null
1351
+ stripe_customer_id?: string | null
1352
+ stripe_subscription_details?: Json | null
1353
+ support_link?: string | null
1354
+ }
1355
+ Update: {
1356
+ created_at?: string
1357
+ org_id?: string
1358
+ org_image?: string | null
1359
+ org_metadata?: Json | null
1360
+ org_name?: string | null
1361
+ org_plan?: Json | null
1362
+ stripe_customer_details?: Json | null
1363
+ stripe_customer_id?: string | null
1364
+ stripe_subscription_details?: Json | null
1365
+ support_link?: string | null
1366
+ }
1367
+ Relationships: []
1368
+ }
1369
+ tbl_org_labels: {
1370
+ Row: {
1371
+ color: string
1372
+ created_at: string
1373
+ label_id: string
1374
+ name: string
1375
+ org_id: string
1376
+ type: string
1377
+ }
1378
+ Insert: {
1379
+ color?: string
1380
+ created_at?: string
1381
+ label_id?: string
1382
+ name: string
1383
+ org_id: string
1384
+ type?: string
1385
+ }
1386
+ Update: {
1387
+ color?: string
1388
+ created_at?: string
1389
+ label_id?: string
1390
+ name?: string
1391
+ org_id?: string
1392
+ type?: string
1393
+ }
1394
+ Relationships: [
1395
+ {
1396
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1397
+ columns: ["org_id"]
1398
+ isOneToOne: false
1399
+ referencedRelation: "tbl_org"
1400
+ referencedColumns: ["org_id"]
1401
+ },
1402
+ {
1403
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1404
+ columns: ["org_id"]
1405
+ isOneToOne: false
1406
+ referencedRelation: "view_org"
1407
+ referencedColumns: ["org_id"]
1408
+ },
1409
+ ]
1410
+ }
1411
+ tbl_org_members: {
1412
+ Row: {
1413
+ created_at: string | null
1414
+ email: string
1415
+ invited_at: string | null
1416
+ invited_by: string | null
1417
+ is_active: boolean
1418
+ is_owner: boolean | null
1419
+ label_ids: string[] | null
1420
+ member_color: Database["public"]["Enums"]["enum_chat_colors"]
1421
+ member_image: string | null
1422
+ member_name: string | null
1423
+ org_id: string
1424
+ org_phones: string[] | null
1425
+ preferences: Json
1426
+ role: Database["public"]["Enums"]["enum_member_role"]
1427
+ user_id: string | null
1428
+ }
1429
+ Insert: {
1430
+ created_at?: string | null
1431
+ email: string
1432
+ invited_at?: string | null
1433
+ invited_by?: string | null
1434
+ is_active?: boolean
1435
+ is_owner?: boolean | null
1436
+ label_ids?: string[] | null
1437
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1438
+ member_image?: string | null
1439
+ member_name?: string | null
1440
+ org_id: string
1441
+ org_phones?: string[] | null
1442
+ preferences?: Json
1443
+ role?: Database["public"]["Enums"]["enum_member_role"]
1444
+ user_id?: string | null
1445
+ }
1446
+ Update: {
1447
+ created_at?: string | null
1448
+ email?: string
1449
+ invited_at?: string | null
1450
+ invited_by?: string | null
1451
+ is_active?: boolean
1452
+ is_owner?: boolean | null
1453
+ label_ids?: string[] | null
1454
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1455
+ member_image?: string | null
1456
+ member_name?: string | null
1457
+ org_id?: string
1458
+ org_phones?: string[] | null
1459
+ preferences?: Json
1460
+ role?: Database["public"]["Enums"]["enum_member_role"]
1461
+ user_id?: string | null
1462
+ }
1463
+ Relationships: [
1464
+ {
1465
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
1466
+ columns: ["user_id"]
1467
+ isOneToOne: false
1468
+ referencedRelation: "users"
1469
+ referencedColumns: ["id"]
1470
+ },
1471
+ {
1472
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1473
+ columns: ["org_id"]
1474
+ isOneToOne: false
1475
+ referencedRelation: "tbl_org"
1476
+ referencedColumns: ["org_id"]
1477
+ },
1478
+ {
1479
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1480
+ columns: ["org_id"]
1481
+ isOneToOne: false
1482
+ referencedRelation: "view_org"
1483
+ referencedColumns: ["org_id"]
1484
+ },
1485
+ ]
1486
+ }
1487
+ tbl_org_phones: {
1488
+ Row: {
1489
+ created_at: string
1490
+ first_connected_at: string | null
1491
+ is_browser_open: boolean
1492
+ is_ready: boolean | null
1493
+ legacy_version: boolean | null
1494
+ library: string | null
1495
+ org_id: string
1496
+ org_phone: string | null
1497
+ phone_id: string
1498
+ phone_image: string | null
1499
+ phone_name: string | null
1500
+ phone_state: Json | null
1501
+ qr_code: string | null
1502
+ server_image: string | null
1503
+ server_ip: string | null
1504
+ soft_restart: boolean
1505
+ updated_at: string | null
1506
+ wa_state: string | null
1507
+ wa_version: string | null
1508
+ }
1509
+ Insert: {
1510
+ created_at?: string
1511
+ first_connected_at?: string | null
1512
+ is_browser_open?: boolean
1513
+ is_ready?: boolean | null
1514
+ legacy_version?: boolean | null
1515
+ library?: string | null
1516
+ org_id: string
1517
+ org_phone?: string | null
1518
+ phone_id?: string
1519
+ phone_image?: string | null
1520
+ phone_name?: string | null
1521
+ phone_state?: Json | null
1522
+ qr_code?: string | null
1523
+ server_image?: string | null
1524
+ server_ip?: string | null
1525
+ soft_restart?: boolean
1526
+ updated_at?: string | null
1527
+ wa_state?: string | null
1528
+ wa_version?: string | null
1529
+ }
1530
+ Update: {
1531
+ created_at?: string
1532
+ first_connected_at?: string | null
1533
+ is_browser_open?: boolean
1534
+ is_ready?: boolean | null
1535
+ legacy_version?: boolean | null
1536
+ library?: string | null
1537
+ org_id?: string
1538
+ org_phone?: string | null
1539
+ phone_id?: string
1540
+ phone_image?: string | null
1541
+ phone_name?: string | null
1542
+ phone_state?: Json | null
1543
+ qr_code?: string | null
1544
+ server_image?: string | null
1545
+ server_ip?: string | null
1546
+ soft_restart?: boolean
1547
+ updated_at?: string | null
1548
+ wa_state?: string | null
1549
+ wa_version?: string | null
1550
+ }
1551
+ Relationships: [
1552
+ {
1553
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1554
+ columns: ["org_id"]
1555
+ isOneToOne: false
1556
+ referencedRelation: "tbl_org"
1557
+ referencedColumns: ["org_id"]
1558
+ },
1559
+ {
1560
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1561
+ columns: ["org_id"]
1562
+ isOneToOne: false
1563
+ referencedRelation: "view_org"
1564
+ referencedColumns: ["org_id"]
1565
+ },
1566
+ {
1567
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1568
+ columns: ["org_id"]
1569
+ isOneToOne: false
1570
+ referencedRelation: "tbl_org"
1571
+ referencedColumns: ["org_id"]
1572
+ },
1573
+ {
1574
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1575
+ columns: ["org_id"]
1576
+ isOneToOne: false
1577
+ referencedRelation: "view_org"
1578
+ referencedColumns: ["org_id"]
1579
+ },
1580
+ ]
1581
+ }
1582
+ tbl_org_transactions: {
1583
+ Row: {
1584
+ amount: number
1585
+ is_top_up: boolean | null
1586
+ org_id: string
1587
+ timestamp: string | null
1588
+ transaction_id: string
1589
+ transaction_metadata: Json | null
1590
+ transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1591
+ usage_metadata: Json | null
1592
+ }
1593
+ Insert: {
1594
+ amount: number
1595
+ is_top_up?: boolean | null
1596
+ org_id: string
1597
+ timestamp?: string | null
1598
+ transaction_id?: string
1599
+ transaction_metadata?: Json | null
1600
+ transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1601
+ usage_metadata?: Json | null
1602
+ }
1603
+ Update: {
1604
+ amount?: number
1605
+ is_top_up?: boolean | null
1606
+ org_id?: string
1607
+ timestamp?: string | null
1608
+ transaction_id?: string
1609
+ transaction_metadata?: Json | null
1610
+ transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"]
1611
+ usage_metadata?: Json | null
1612
+ }
1613
+ Relationships: [
1614
+ {
1615
+ foreignKeyName: "tbl_org_transactions_org_id_fkey"
1616
+ columns: ["org_id"]
1617
+ isOneToOne: false
1618
+ referencedRelation: "tbl_org"
1619
+ referencedColumns: ["org_id"]
1620
+ },
1621
+ {
1622
+ foreignKeyName: "tbl_org_transactions_org_id_fkey"
1623
+ columns: ["org_id"]
1624
+ isOneToOne: false
1625
+ referencedRelation: "view_org"
1626
+ referencedColumns: ["org_id"]
1627
+ },
1628
+ ]
1629
+ }
1630
+ tbl_quick_replies: {
1631
+ Row: {
1632
+ command: string | null
1633
+ created_at: string
1634
+ message_payload: Json | null
1635
+ org_id: string
1636
+ reply_id: string
1637
+ }
1638
+ Insert: {
1639
+ command?: string | null
1640
+ created_at?: string
1641
+ message_payload?: Json | null
1642
+ org_id: string
1643
+ reply_id?: string
1644
+ }
1645
+ Update: {
1646
+ command?: string | null
1647
+ created_at?: string
1648
+ message_payload?: Json | null
1649
+ org_id?: string
1650
+ reply_id?: string
1651
+ }
1652
+ Relationships: [
1653
+ {
1654
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1655
+ columns: ["org_id"]
1656
+ isOneToOne: false
1657
+ referencedRelation: "tbl_org"
1658
+ referencedColumns: ["org_id"]
1659
+ },
1660
+ {
1661
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1662
+ columns: ["org_id"]
1663
+ isOneToOne: false
1664
+ referencedRelation: "view_org"
1665
+ referencedColumns: ["org_id"]
1666
+ },
1667
+ ]
1668
+ }
1669
+ tbl_scheduled_messages: {
1670
+ Row: {
1671
+ chat_id: string
1672
+ created_at: string
1673
+ message_id: string | null
1674
+ message_payload: Json | null
1675
+ org_id: string
1676
+ org_phone: string | null
1677
+ performed_by: string | null
1678
+ scheduled_at: string
1679
+ sent_message_id: string
1680
+ status: boolean | null
1681
+ updated_at: string | null
1682
+ }
1683
+ Insert: {
1684
+ chat_id: string
1685
+ created_at?: string
1686
+ message_id?: string | null
1687
+ message_payload?: Json | null
1688
+ org_id: string
1689
+ org_phone?: string | null
1690
+ performed_by?: string | null
1691
+ scheduled_at: string
1692
+ sent_message_id: string
1693
+ status?: boolean | null
1694
+ updated_at?: string | null
1695
+ }
1696
+ Update: {
1697
+ chat_id?: string
1698
+ created_at?: string
1699
+ message_id?: string | null
1700
+ message_payload?: Json | null
1701
+ org_id?: string
1702
+ org_phone?: string | null
1703
+ performed_by?: string | null
1704
+ scheduled_at?: string
1705
+ sent_message_id?: string
1706
+ status?: boolean | null
1707
+ updated_at?: string | null
1708
+ }
1709
+ Relationships: [
1710
+ {
1711
+ foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1712
+ columns: ["org_id"]
1713
+ isOneToOne: false
1714
+ referencedRelation: "tbl_org"
1715
+ referencedColumns: ["org_id"]
1716
+ },
1717
+ {
1718
+ foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1719
+ columns: ["org_id"]
1720
+ isOneToOne: false
1721
+ referencedRelation: "view_org"
1722
+ referencedColumns: ["org_id"]
1723
+ },
1724
+ ]
1725
+ }
1726
+ tbl_tools_whatsapp_links: {
1727
+ Row: {
1728
+ created_at: string
1729
+ link_id: string
1730
+ link_name: string
1731
+ message: string | null
1732
+ phone: string
1733
+ }
1734
+ Insert: {
1735
+ created_at?: string
1736
+ link_id?: string
1737
+ link_name: string
1738
+ message?: string | null
1739
+ phone: string
1740
+ }
1741
+ Update: {
1742
+ created_at?: string
1743
+ link_id?: string
1744
+ link_name?: string
1745
+ message?: string | null
1746
+ phone?: string
1747
+ }
1748
+ Relationships: []
1749
+ }
1750
+ }
1751
+ Views: {
1752
+ view_broadcast_logs: {
1753
+ Row: {
1754
+ broadcast_id: string | null
1755
+ broadcast_status:
1756
+ | Database["public"]["Enums"]["enum_broadcast_status"]
1757
+ | null
1758
+ created_at: string | null
1759
+ delivered_percentage: number | null
1760
+ failed_chats: number | null
1761
+ message_payload: Json | null
1762
+ org_id: string | null
1763
+ pending_chats: number | null
1764
+ performed_at: string | null
1765
+ performed_by: string | null
1766
+ read_percentage: number | null
1767
+ scheduled_at: string | null
1768
+ sent_chats: number | null
1769
+ total_chats: number | null
1770
+ total_delivered_count: number | null
1771
+ total_member_count: number | null
1772
+ total_read_count: number | null
1773
+ }
1774
+ Relationships: [
1775
+ {
1776
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1777
+ columns: ["org_id"]
1778
+ isOneToOne: false
1779
+ referencedRelation: "tbl_org"
1780
+ referencedColumns: ["org_id"]
1781
+ },
1782
+ {
1783
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1784
+ columns: ["org_id"]
1785
+ isOneToOne: false
1786
+ referencedRelation: "view_org"
1787
+ referencedColumns: ["org_id"]
1788
+ },
1789
+ ]
1790
+ }
1791
+ view_chat_logs: {
1792
+ Row: {
1793
+ action: string | null
1794
+ failed: number | null
1795
+ operation_id: string | null
1796
+ org_id: string | null
1797
+ pending: number | null
1798
+ performed_at: string | null
1799
+ performed_by: string | null
1800
+ success: number | null
1801
+ total_chats: number | null
1802
+ total_logs: number | null
1803
+ total_participants: number | null
1804
+ }
1805
+ Relationships: [
1806
+ {
1807
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
1808
+ columns: ["org_id"]
1809
+ isOneToOne: false
1810
+ referencedRelation: "tbl_org"
1811
+ referencedColumns: ["org_id"]
1812
+ },
1813
+ {
1814
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
1815
+ columns: ["org_id"]
1816
+ isOneToOne: false
1817
+ referencedRelation: "view_org"
1818
+ referencedColumns: ["org_id"]
1819
+ },
1820
+ ]
1821
+ }
1822
+ view_chats: {
1823
+ Row: {
1824
+ assigned_to: string | null
1825
+ chat_access: Json | null
1826
+ chat_id: string | null
1827
+ chat_image: string | null
1828
+ chat_name: string | null
1829
+ chat_org_phones: string[] | null
1830
+ chat_type: string | null
1831
+ created_at: string | null
1832
+ custom_properties: Json | null
1833
+ flag_count_map: Json | null
1834
+ group_description: string | null
1835
+ hubspot_metadata: Json | null
1836
+ info_admins_only: boolean | null
1837
+ invite_link: string | null
1838
+ is_exited: boolean | null
1839
+ is_muted: boolean | null
1840
+ label_ids: Json | null
1841
+ latest_message: Json | null
1842
+ member_add_mode: string | null
1843
+ member_count: number | null
1844
+ message_unread_count: number | null
1845
+ messages_admins_only: boolean | null
1846
+ org_id: string | null
1847
+ org_phone: string | null
1848
+ updated_at: string | null
1849
+ }
1850
+ Relationships: []
1851
+ }
1852
+ view_org: {
1853
+ Row: {
1854
+ access_scopes: Json | null
1855
+ created_at: string | null
1856
+ is_enterprise: boolean | null
1857
+ is_free_trial: boolean | null
1858
+ is_freshdesk_connected: boolean | null
1859
+ is_hubspot_connected: boolean | null
1860
+ is_zohodesk_connected: boolean | null
1861
+ org_id: string | null
1862
+ org_image: string | null
1863
+ org_metadata: Json | null
1864
+ org_name: string | null
1865
+ org_plan: Json | null
1866
+ pending_days: number | null
1867
+ phone_limit: string | null
1868
+ plan_id: string | null
1869
+ stripe_customer_details: Json | null
1870
+ stripe_customer_id: string | null
1871
+ stripe_subscription_details: Json | null
1872
+ subscription_status: string | null
1873
+ support_link: string | null
1874
+ user_limit: string | null
1875
+ }
1876
+ Insert: {
1877
+ access_scopes?: never
1878
+ created_at?: string | null
1879
+ is_enterprise?: never
1880
+ is_free_trial?: never
1881
+ is_freshdesk_connected?: never
1882
+ is_hubspot_connected?: never
1883
+ is_zohodesk_connected?: never
1884
+ org_id?: string | null
1885
+ org_image?: string | null
1886
+ org_metadata?: Json | null
1887
+ org_name?: string | null
1888
+ org_plan?: Json | null
1889
+ pending_days?: never
1890
+ phone_limit?: never
1891
+ plan_id?: never
1892
+ stripe_customer_details?: Json | null
1893
+ stripe_customer_id?: string | null
1894
+ stripe_subscription_details?: Json | null
1895
+ subscription_status?: never
1896
+ support_link?: string | null
1897
+ user_limit?: never
1898
+ }
1899
+ Update: {
1900
+ access_scopes?: never
1901
+ created_at?: string | null
1902
+ is_enterprise?: never
1903
+ is_free_trial?: never
1904
+ is_freshdesk_connected?: never
1905
+ is_hubspot_connected?: never
1906
+ is_zohodesk_connected?: never
1907
+ org_id?: string | null
1908
+ org_image?: string | null
1909
+ org_metadata?: Json | null
1910
+ org_name?: string | null
1911
+ org_plan?: Json | null
1912
+ pending_days?: never
1913
+ phone_limit?: never
1914
+ plan_id?: never
1915
+ stripe_customer_details?: Json | null
1916
+ stripe_customer_id?: string | null
1917
+ stripe_subscription_details?: Json | null
1918
+ subscription_status?: never
1919
+ support_link?: string | null
1920
+ user_limit?: never
1921
+ }
1922
+ Relationships: []
1923
+ }
1924
+ }
1925
+ Functions: {
1926
+ check_feature_flag_access: {
1927
+ Args: {
1928
+ org_id_input: string
1929
+ feature_input: string
1930
+ }
1931
+ Returns: boolean
1932
+ }
1933
+ create_partition: {
1934
+ Args: {
1935
+ org_id_input: string
1936
+ }
1937
+ Returns: boolean
1938
+ }
1939
+ custom_access_token_hook: {
1940
+ Args: {
1941
+ event: Json
1942
+ }
1943
+ Returns: Json
1944
+ }
1945
+ drop_partition: {
1946
+ Args: {
1947
+ org_id_input: string
1948
+ }
1949
+ Returns: boolean
1950
+ }
1951
+ find_discrepancies: {
1952
+ Args: {
1953
+ p_org_id: string
1954
+ }
1955
+ Returns: {
1956
+ a_chat_id: string
1957
+ discrepancy_count: number
1958
+ }[]
1959
+ }
1960
+ gen_id: {
1961
+ Args: {
1962
+ prefix: string
1963
+ size?: number
1964
+ alphabet?: string
1965
+ }
1966
+ Returns: string
1967
+ }
1968
+ gen_ticket_id: {
1969
+ Args: {
1970
+ org_id_input: string
1971
+ }
1972
+ Returns: string
1973
+ }
1974
+ generate_access_token: {
1975
+ Args: {
1976
+ name_input?: string
1977
+ type_input?: Database["public"]["Enums"]["enum_integration_type"]
1978
+ org_id_input?: string
1979
+ }
1980
+ Returns: Json
1981
+ }
1982
+ get_api_auth_details: {
1983
+ Args: {
1984
+ org_id_input?: string
1985
+ org_phone_input?: string
1986
+ token_id_input?: string
1987
+ token_type_input?: Database["public"]["Enums"]["enum_integration_type"]
1988
+ }
1989
+ Returns: Json
1990
+ }
1991
+ get_chat_labels_data: {
1992
+ Args: {
1993
+ org_id_input: string
1994
+ chat_ids_input?: string[]
1995
+ }
1996
+ Returns: Json[]
1997
+ }
1998
+ get_chat_rule_info: {
1999
+ Args: {
2000
+ chat_id_input: string
2001
+ org_id_input: string
2002
+ org_phone_input: string
2003
+ }
2004
+ Returns: Json
2005
+ }
2006
+ get_chats: {
2007
+ Args: {
2008
+ org_id_input: string
2009
+ chat_id_input?: string[]
2010
+ with_members?: boolean
2011
+ last_updated_at?: string
2012
+ batch_limit?: number
2013
+ batch_offset?: number
2014
+ }
2015
+ Returns: Json
2016
+ }
2017
+ get_chats_info: {
2018
+ Args: {
2019
+ chat_id_input: string
2020
+ org_id_input: string
2021
+ org_phone_input?: string
2022
+ }
2023
+ Returns: Json
2024
+ }
2025
+ get_contacts: {
2026
+ Args: {
2027
+ org_id_input: string
2028
+ contact_ids_input?: string[]
2029
+ sync_phone_contacts?: boolean
2030
+ search_input?: string
2031
+ label_ids_input?: string[]
2032
+ is_internal_input?: boolean
2033
+ offset_input?: number
2034
+ limit_input?: number
2035
+ }
2036
+ Returns: Json
2037
+ }
2038
+ get_export_chats_data: {
2039
+ Args: {
2040
+ org_id_input: string
2041
+ chat_id_input?: string[]
2042
+ }
2043
+ Returns: Json
2044
+ }
2045
+ get_export_tickets_data: {
2046
+ Args: {
2047
+ org_id_input: string
2048
+ ticket_id_input?: string[]
2049
+ }
2050
+ Returns: Json
2051
+ }
2052
+ get_feature_flags: {
2053
+ Args: {
2054
+ org_id_input: string
2055
+ }
2056
+ Returns: {
2057
+ feature: string
2058
+ enabled: boolean
2059
+ }[]
2060
+ }
2061
+ get_integration_data: {
2062
+ Args: {
2063
+ org_id_input?: string
2064
+ }
2065
+ Returns: Json
2066
+ }
2067
+ get_message_rule_info: {
2068
+ Args: {
2069
+ message_id_input: string
2070
+ chat_id_input: string
2071
+ org_id_input: string
2072
+ org_phone_input: string
2073
+ sender_id_input: string
2074
+ }
2075
+ Returns: Json
2076
+ }
2077
+ get_messages_notifications_reactions: {
2078
+ Args: {
2079
+ org_id_input: string
2080
+ chat_id_input?: string[]
2081
+ limit_input?: number
2082
+ offset_input?: number
2083
+ }
2084
+ Returns: Json
2085
+ }
2086
+ get_org: {
2087
+ Args: {
2088
+ org_id_input?: string
2089
+ }
2090
+ Returns: Json
2091
+ }
2092
+ get_org_credits: {
2093
+ Args: {
2094
+ org_id_input?: string
2095
+ }
2096
+ Returns: Json
2097
+ }
2098
+ get_org_phones: {
2099
+ Args: {
2100
+ org_id_input?: string
2101
+ phone_id_input?: string
2102
+ }
2103
+ Returns: Json
2104
+ }
2105
+ get_reaction_rule_info: {
2106
+ Args: {
2107
+ reaction_id_input: string
2108
+ message_id_input: string
2109
+ chat_id_input: string
2110
+ org_id_input: string
2111
+ org_phone_input: string
2112
+ sender_id_input: string
2113
+ }
2114
+ Returns: Json
2115
+ }
2116
+ get_team_metrics_between_dates: {
2117
+ Args: {
2118
+ org_id_input: string
2119
+ start_date: string
2120
+ end_date: string
2121
+ chat_id_input?: string[]
2122
+ }
2123
+ Returns: Json
2124
+ }
2125
+ get_ticket_info: {
2126
+ Args: {
2127
+ ticket_id_input?: string
2128
+ org_id_input?: string
2129
+ chat_id_input?: string
2130
+ unique_message_id_input?: string
2131
+ }
2132
+ Returns: Json
2133
+ }
2134
+ get_ticket_rule_info: {
2135
+ Args: {
2136
+ ticket_id_input: string
2137
+ unique_message_id_input: string
2138
+ chat_id_input: string
2139
+ org_id_input: string
2140
+ }
2141
+ Returns: Json
2142
+ }
2143
+ get_universal_search_result: {
2144
+ Args: {
2145
+ search_category_input: string
2146
+ search_query_input: string
2147
+ org_id_input: string
2148
+ }
2149
+ Returns: {
2150
+ category: string
2151
+ result: Json
2152
+ }[]
2153
+ }
2154
+ image_path: {
2155
+ Args: {
2156
+ path_input?: string
2157
+ bucket_name?: string
2158
+ req_base?: boolean
2159
+ }
2160
+ Returns: string
2161
+ }
2162
+ list_org_from_user: {
2163
+ Args: Record<PropertyKey, never>
2164
+ Returns: string[]
2165
+ }
2166
+ list_role_from_user: {
2167
+ Args: Record<PropertyKey, never>
2168
+ Returns: Database["public"]["Enums"]["enum_member_role"]
2169
+ }
2170
+ update_chat_properties: {
2171
+ Args: {
2172
+ column_name: string
2173
+ org_id_input: string
2174
+ chat_id_input: string[]
2175
+ column_value_input?: string
2176
+ key_input?: string
2177
+ value_input?: Json
2178
+ }
2179
+ Returns: undefined
2180
+ }
2181
+ update_custom_properties: {
2182
+ Args: {
2183
+ org_id_input: string
2184
+ row_properties_map: Json
2185
+ replace_properties?: boolean
2186
+ }
2187
+ Returns: undefined
2188
+ }
2189
+ update_labels: {
2190
+ Args: {
2191
+ org_id_input: string
2192
+ tbl_type: string
2193
+ row_label_map: Json
2194
+ replace_labels?: boolean
2195
+ }
2196
+ Returns: undefined
2197
+ }
2198
+ }
2199
+ Enums: {
2200
+ enum_broadcast_status: "inprogress" | "completed" | "stopped" | "expired"
2201
+ enum_chat_colors:
2202
+ | "#B4876E"
2203
+ | "#A5B337"
2204
+ | "#06CF9C"
2205
+ | "#25D366"
2206
+ | "#02A698"
2207
+ | "#7D9EF1"
2208
+ | "#007BFC"
2209
+ | "#5E47DE"
2210
+ | "#7F66FF"
2211
+ | "#9333EA"
2212
+ | "#FA6533"
2213
+ | "#C4532D"
2214
+ | "#DC2626"
2215
+ | "#FF2E74"
2216
+ | "#DB2777"
2217
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
2218
+ enum_credit_transaction_type: "credit" | "debit"
2219
+ enum_integration_name:
2220
+ | "org.created"
2221
+ | "org.updated"
2222
+ | "org.member.created"
2223
+ | "org.member.updated"
2224
+ | "org.phone.created"
2225
+ | "org.phone.connected"
2226
+ | "org.phone.disconnected"
2227
+ | "org.subscription.trial_will_end"
2228
+ | "chat.created"
2229
+ | "chat.updated"
2230
+ | "chat.notification.created"
2231
+ | "message.created"
2232
+ | "message.updated"
2233
+ | "message.deleted"
2234
+ | "message.ack.updated"
2235
+ | "reaction.created"
2236
+ | "reaction.updated"
2237
+ | "ticket.created"
2238
+ | "ticket.updated"
2239
+ | "ticket.deleted"
2240
+ | "org.integrations.updated"
2241
+ | "message.flagged"
2242
+ | "message.unflagged"
2243
+ | "chat.label.updated"
2244
+ | "reaction.added"
2245
+ enum_integration_type:
2246
+ | "zapier"
2247
+ | "pabbly"
2248
+ | "api"
2249
+ | "webhook"
2250
+ | "hubspot"
2251
+ | "freshdesk"
2252
+ | "slack"
2253
+ | "jira"
2254
+ | "salesforce"
2255
+ | "zohodesk"
2256
+ | "gsheets"
2257
+ enum_member_role: "admin" | "member"
2258
+ }
2259
+ CompositeTypes: {
2260
+ [_ in never]: never
2261
+ }
2262
+ }
2263
+ storage: {
2264
+ Tables: {
2265
+ buckets: {
2266
+ Row: {
2267
+ allowed_mime_types: string[] | null
2268
+ avif_autodetection: boolean | null
2269
+ created_at: string | null
2270
+ file_size_limit: number | null
2271
+ id: string
2272
+ name: string
2273
+ owner: string | null
2274
+ owner_id: string | null
2275
+ public: boolean | null
2276
+ updated_at: string | null
2277
+ }
2278
+ Insert: {
2279
+ allowed_mime_types?: string[] | null
2280
+ avif_autodetection?: boolean | null
2281
+ created_at?: string | null
2282
+ file_size_limit?: number | null
2283
+ id: string
2284
+ name: string
2285
+ owner?: string | null
2286
+ owner_id?: string | null
2287
+ public?: boolean | null
2288
+ updated_at?: string | null
2289
+ }
2290
+ Update: {
2291
+ allowed_mime_types?: string[] | null
2292
+ avif_autodetection?: boolean | null
2293
+ created_at?: string | null
2294
+ file_size_limit?: number | null
2295
+ id?: string
2296
+ name?: string
2297
+ owner?: string | null
2298
+ owner_id?: string | null
2299
+ public?: boolean | null
2300
+ updated_at?: string | null
2301
+ }
2302
+ Relationships: []
2303
+ }
2304
+ migrations: {
2305
+ Row: {
2306
+ executed_at: string | null
2307
+ hash: string
2308
+ id: number
2309
+ name: string
2310
+ }
2311
+ Insert: {
2312
+ executed_at?: string | null
2313
+ hash: string
2314
+ id: number
2315
+ name: string
2316
+ }
2317
+ Update: {
2318
+ executed_at?: string | null
2319
+ hash?: string
2320
+ id?: number
2321
+ name?: string
2322
+ }
2323
+ Relationships: []
2324
+ }
2325
+ objects: {
2326
+ Row: {
2327
+ bucket_id: string | null
2328
+ created_at: string | null
2329
+ id: string
2330
+ last_accessed_at: string | null
2331
+ metadata: Json | null
2332
+ name: string | null
2333
+ owner: string | null
2334
+ owner_id: string | null
2335
+ path_tokens: string[] | null
2336
+ updated_at: string | null
2337
+ version: string | null
2338
+ }
2339
+ Insert: {
2340
+ bucket_id?: string | null
2341
+ created_at?: string | null
2342
+ id?: string
2343
+ last_accessed_at?: string | null
2344
+ metadata?: Json | null
2345
+ name?: string | null
2346
+ owner?: string | null
2347
+ owner_id?: string | null
2348
+ path_tokens?: string[] | null
2349
+ updated_at?: string | null
2350
+ version?: string | null
2351
+ }
2352
+ Update: {
2353
+ bucket_id?: string | null
2354
+ created_at?: string | null
2355
+ id?: string
2356
+ last_accessed_at?: string | null
2357
+ metadata?: Json | null
2358
+ name?: string | null
2359
+ owner?: string | null
2360
+ owner_id?: string | null
2361
+ path_tokens?: string[] | null
2362
+ updated_at?: string | null
2363
+ version?: string | null
2364
+ }
2365
+ Relationships: [
2366
+ {
2367
+ foreignKeyName: "objects_bucketId_fkey"
2368
+ columns: ["bucket_id"]
2369
+ isOneToOne: false
2370
+ referencedRelation: "buckets"
2371
+ referencedColumns: ["id"]
2372
+ },
2373
+ ]
2374
+ }
2375
+ s3_multipart_uploads: {
2376
+ Row: {
2377
+ bucket_id: string
2378
+ created_at: string
2379
+ id: string
2380
+ in_progress_size: number
2381
+ key: string
2382
+ owner_id: string | null
2383
+ upload_signature: string
2384
+ version: string
2385
+ }
2386
+ Insert: {
2387
+ bucket_id: string
2388
+ created_at?: string
2389
+ id: string
2390
+ in_progress_size?: number
2391
+ key: string
2392
+ owner_id?: string | null
2393
+ upload_signature: string
2394
+ version: string
2395
+ }
2396
+ Update: {
2397
+ bucket_id?: string
2398
+ created_at?: string
2399
+ id?: string
2400
+ in_progress_size?: number
2401
+ key?: string
2402
+ owner_id?: string | null
2403
+ upload_signature?: string
2404
+ version?: string
2405
+ }
2406
+ Relationships: [
2407
+ {
2408
+ foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2409
+ columns: ["bucket_id"]
2410
+ isOneToOne: false
2411
+ referencedRelation: "buckets"
2412
+ referencedColumns: ["id"]
2413
+ },
2414
+ ]
2415
+ }
2416
+ s3_multipart_uploads_parts: {
2417
+ Row: {
2418
+ bucket_id: string
2419
+ created_at: string
2420
+ etag: string
2421
+ id: string
2422
+ key: string
2423
+ owner_id: string | null
2424
+ part_number: number
2425
+ size: number
2426
+ upload_id: string
2427
+ version: string
2428
+ }
2429
+ Insert: {
2430
+ bucket_id: string
2431
+ created_at?: string
2432
+ etag: string
2433
+ id?: string
2434
+ key: string
2435
+ owner_id?: string | null
2436
+ part_number: number
2437
+ size?: number
2438
+ upload_id: string
2439
+ version: string
2440
+ }
2441
+ Update: {
2442
+ bucket_id?: string
2443
+ created_at?: string
2444
+ etag?: string
2445
+ id?: string
2446
+ key?: string
2447
+ owner_id?: string | null
2448
+ part_number?: number
2449
+ size?: number
2450
+ upload_id?: string
2451
+ version?: string
2452
+ }
2453
+ Relationships: [
2454
+ {
2455
+ foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2456
+ columns: ["bucket_id"]
2457
+ isOneToOne: false
2458
+ referencedRelation: "buckets"
2459
+ referencedColumns: ["id"]
2460
+ },
2461
+ {
2462
+ foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2463
+ columns: ["upload_id"]
2464
+ isOneToOne: false
2465
+ referencedRelation: "s3_multipart_uploads"
2466
+ referencedColumns: ["id"]
2467
+ },
2468
+ ]
2469
+ }
2470
+ }
2471
+ Views: {
2472
+ [_ in never]: never
2473
+ }
2474
+ Functions: {
2475
+ can_insert_object: {
2476
+ Args: {
2477
+ bucketid: string
2478
+ name: string
2479
+ owner: string
2480
+ metadata: Json
2481
+ }
2482
+ Returns: undefined
2483
+ }
2484
+ extension: {
2485
+ Args: {
2486
+ name: string
2487
+ }
2488
+ Returns: string
2489
+ }
2490
+ filename: {
2491
+ Args: {
2492
+ name: string
2493
+ }
2494
+ Returns: string
2495
+ }
2496
+ foldername: {
2497
+ Args: {
2498
+ name: string
2499
+ }
2500
+ Returns: string[]
2501
+ }
2502
+ get_size_by_bucket: {
2503
+ Args: Record<PropertyKey, never>
2504
+ Returns: {
2505
+ size: number
2506
+ bucket_id: string
2507
+ }[]
2508
+ }
2509
+ list_multipart_uploads_with_delimiter: {
2510
+ Args: {
2511
+ bucket_id: string
2512
+ prefix_param: string
2513
+ delimiter_param: string
2514
+ max_keys?: number
2515
+ next_key_token?: string
2516
+ next_upload_token?: string
2517
+ }
2518
+ Returns: {
2519
+ key: string
2520
+ id: string
2521
+ created_at: string
2522
+ }[]
2523
+ }
2524
+ list_objects_with_delimiter: {
2525
+ Args: {
2526
+ bucket_id: string
2527
+ prefix_param: string
2528
+ delimiter_param: string
2529
+ max_keys?: number
2530
+ start_after?: string
2531
+ next_token?: string
2532
+ }
2533
+ Returns: {
2534
+ name: string
2535
+ id: string
2536
+ metadata: Json
2537
+ updated_at: string
2538
+ }[]
2539
+ }
2540
+ search: {
2541
+ Args: {
2542
+ prefix: string
2543
+ bucketname: string
2544
+ limits?: number
2545
+ levels?: number
2546
+ offsets?: number
2547
+ search?: string
2548
+ sortcolumn?: string
2549
+ sortorder?: string
2550
+ }
2551
+ Returns: {
2552
+ name: string
2553
+ id: string
2554
+ updated_at: string
2555
+ created_at: string
2556
+ last_accessed_at: string
2557
+ metadata: Json
2558
+ }[]
2559
+ }
2560
+ }
2561
+ Enums: {
2562
+ [_ in never]: never
2563
+ }
2564
+ CompositeTypes: {
2565
+ [_ in never]: never
2566
+ }
2567
+ }
2568
+ }
2569
+
2570
+ type PublicSchema = Database[Extract<keyof Database, "public">]
2571
+
2572
+ export type Tables<
2573
+ PublicTableNameOrOptions extends
2574
+ | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
2575
+ | { schema: keyof Database },
2576
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2577
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2578
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
2579
+ : never = never,
2580
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2581
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2582
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2583
+ Row: infer R
2584
+ }
2585
+ ? R
2586
+ : never
2587
+ : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
2588
+ PublicSchema["Views"])
2589
+ ? (PublicSchema["Tables"] &
2590
+ PublicSchema["Views"])[PublicTableNameOrOptions] extends {
2591
+ Row: infer R
2592
+ }
2593
+ ? R
2594
+ : never
2595
+ : never
2596
+
2597
+ export type TablesInsert<
2598
+ PublicTableNameOrOptions extends
2599
+ | keyof PublicSchema["Tables"]
2600
+ | { schema: keyof Database },
2601
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2602
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2603
+ : never = never,
2604
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2605
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2606
+ Insert: infer I
2607
+ }
2608
+ ? I
2609
+ : never
2610
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2611
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2612
+ Insert: infer I
2613
+ }
2614
+ ? I
2615
+ : never
2616
+ : never
2617
+
2618
+ export type TablesUpdate<
2619
+ PublicTableNameOrOptions extends
2620
+ | keyof PublicSchema["Tables"]
2621
+ | { schema: keyof Database },
2622
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2623
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2624
+ : never = never,
2625
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2626
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2627
+ Update: infer U
2628
+ }
2629
+ ? U
2630
+ : never
2631
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2632
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2633
+ Update: infer U
2634
+ }
2635
+ ? U
2636
+ : never
2637
+ : never
2638
+
2639
+ export type Enums<
2640
+ PublicEnumNameOrOptions extends
2641
+ | keyof PublicSchema["Enums"]
2642
+ | { schema: keyof Database },
2643
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2644
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
2645
+ : never = never,
2646
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
2647
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
2648
+ : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
2649
+ ? PublicSchema["Enums"][PublicEnumNameOrOptions]
2650
+ : never
2651
+
2660
2652