@periskope/types 0.6.155 → 0.6.156

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,2665 +1,2655 @@
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
- closed_at: number | null
745
- custom_properties: Json | null
746
- flag_count_map: Json | null
747
- hubspot_metadata: Json | null
748
- label_ids: Json | null
749
- latest_message_timestamp: string | null
750
- org_id: string
751
- unread_count: Json | null
752
- unread_count_map: Json | null
753
- updated_at: string | null
754
- }
755
- Insert: {
756
- assigned_to?: string | null
757
- chat_access?: Json | null
758
- chat_id: string
759
- chat_image?: string | null
760
- chat_name?: string | null
761
- chat_org_phones?: string[]
762
- chat_type?: string | null
763
- closed_at?: number | null
764
- custom_properties?: Json | null
765
- flag_count_map?: Json | null
766
- hubspot_metadata?: Json | null
767
- label_ids?: Json | null
768
- latest_message_timestamp?: string | null
769
- org_id: string
770
- unread_count?: Json | null
771
- unread_count_map?: Json | null
772
- updated_at?: string | null
773
- }
774
- Update: {
775
- assigned_to?: string | null
776
- chat_access?: Json | null
777
- chat_id?: string
778
- chat_image?: string | null
779
- chat_name?: string | null
780
- chat_org_phones?: string[]
781
- chat_type?: string | null
782
- closed_at?: number | null
783
- custom_properties?: Json | null
784
- flag_count_map?: Json | null
785
- hubspot_metadata?: Json | null
786
- label_ids?: Json | null
787
- latest_message_timestamp?: string | null
788
- org_id?: string
789
- unread_count?: Json | null
790
- unread_count_map?: Json | null
791
- updated_at?: string | null
792
- }
793
- Relationships: []
794
- }
795
- tbl_chat_reactions: {
796
- Row: {
797
- ack: number | null
798
- chat_id: string | null
799
- id: Json | null
800
- message_id: string
801
- msg_id: Json | null
802
- org_id: string
803
- org_phone: string
804
- orphan: number | null
805
- orphan_reason: string | null
806
- reaction: string | null
807
- reaction_id: string
808
- read: boolean | null
809
- sender_id: string
810
- timestamp: string | null
811
- unique_id: string | null
812
- }
813
- Insert: {
814
- ack?: number | null
815
- chat_id?: string | null
816
- id?: Json | null
817
- message_id: string
818
- msg_id?: Json | null
819
- org_id: string
820
- org_phone: string
821
- orphan?: number | null
822
- orphan_reason?: string | null
823
- reaction?: string | null
824
- reaction_id: string
825
- read?: boolean | null
826
- sender_id: string
827
- timestamp?: string | null
828
- unique_id?: string | null
829
- }
830
- Update: {
831
- ack?: number | null
832
- chat_id?: string | null
833
- id?: Json | null
834
- message_id?: string
835
- msg_id?: Json | null
836
- org_id?: string
837
- org_phone?: string
838
- orphan?: number | null
839
- orphan_reason?: string | null
840
- reaction?: string | null
841
- reaction_id?: string
842
- read?: boolean | null
843
- sender_id?: string
844
- timestamp?: string | null
845
- unique_id?: string | null
846
- }
847
- Relationships: []
848
- }
849
- tbl_chat_tickets: {
850
- Row: {
851
- assigned_by: string | null
852
- assignee: string | null
853
- chat_id: string
854
- close_ticket_metadata: Json | null
855
- closed_at: string | null
856
- created_at: string
857
- custom_properties: Json | null
858
- due_date: string | null
859
- freshdesk_metadata: Json | null
860
- hubspot_metadata: Json | null
861
- is_deleted: boolean
862
- label_ids: Json | null
863
- last_updated_at: string
864
- org_id: string
865
- priority: number | null
866
- quoted_message_id: string | null
867
- raised_by: string | null
868
- response_time: number | null
869
- status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
870
- subject: string
871
- ticket_id: string
872
- zohodesk_metadata: Json | null
873
- }
874
- Insert: {
875
- assigned_by?: string | null
876
- assignee?: string | null
877
- chat_id: string
878
- close_ticket_metadata?: Json | null
879
- closed_at?: string | null
880
- created_at?: string
881
- custom_properties?: Json | null
882
- due_date?: string | null
883
- freshdesk_metadata?: Json | null
884
- hubspot_metadata?: Json | null
885
- is_deleted?: boolean
886
- label_ids?: Json | null
887
- last_updated_at?: string
888
- org_id: string
889
- priority?: number | null
890
- quoted_message_id?: string | null
891
- raised_by?: string | null
892
- response_time?: number | null
893
- status?:
894
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
895
- | null
896
- subject: string
897
- ticket_id?: string
898
- zohodesk_metadata?: Json | null
899
- }
900
- Update: {
901
- assigned_by?: string | null
902
- assignee?: string | null
903
- chat_id?: string
904
- close_ticket_metadata?: Json | null
905
- closed_at?: string | null
906
- created_at?: string
907
- custom_properties?: Json | null
908
- due_date?: string | null
909
- freshdesk_metadata?: Json | null
910
- hubspot_metadata?: Json | null
911
- is_deleted?: boolean
912
- label_ids?: Json | null
913
- last_updated_at?: string
914
- org_id?: string
915
- priority?: number | null
916
- quoted_message_id?: string | null
917
- raised_by?: string | null
918
- response_time?: number | null
919
- status?:
920
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
921
- | null
922
- subject?: string
923
- ticket_id?: string
924
- zohodesk_metadata?: Json | null
925
- }
926
- Relationships: [
927
- {
928
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
929
- columns: ["org_id"]
930
- isOneToOne: false
931
- referencedRelation: "tbl_org"
932
- referencedColumns: ["org_id"]
933
- },
934
- {
935
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
936
- columns: ["org_id"]
937
- isOneToOne: false
938
- referencedRelation: "view_org"
939
- referencedColumns: ["org_id"]
940
- },
941
- ]
942
- }
943
- tbl_chats: {
944
- Row: {
945
- archived: boolean | null
946
- chat_id: string
947
- chat_image: string | null
948
- chat_name: string | null
949
- chat_type: string | null
950
- created_at: string
951
- group_metadata: Json | null
952
- id: Json | null
953
- invite_link: string | null
954
- is_exited: boolean | null
955
- is_group: boolean | null
956
- is_muted: boolean | null
957
- is_read_only: boolean | null
958
- latest_message: Json | null
959
- member_count: number | null
960
- mute_expiration: number | null
961
- name: string | null
962
- org_id: string
963
- org_phone: string
964
- pinned: boolean | null
965
- timestamp: string | null
966
- unread_count: number | null
967
- updated_at: string
968
- }
969
- Insert: {
970
- archived?: boolean | null
971
- chat_id: string
972
- chat_image?: string | null
973
- chat_name?: string | null
974
- chat_type?: string | null
975
- created_at?: string
976
- group_metadata?: Json | null
977
- id?: Json | null
978
- invite_link?: string | null
979
- is_exited?: boolean | null
980
- is_group?: boolean | null
981
- is_muted?: boolean | null
982
- is_read_only?: boolean | null
983
- latest_message?: Json | null
984
- member_count?: number | null
985
- mute_expiration?: number | null
986
- name?: string | null
987
- org_id: string
988
- org_phone: string
989
- pinned?: boolean | null
990
- timestamp?: string | null
991
- unread_count?: number | null
992
- updated_at?: string
993
- }
994
- Update: {
995
- archived?: boolean | null
996
- chat_id?: string
997
- chat_image?: string | null
998
- chat_name?: string | null
999
- chat_type?: string | null
1000
- created_at?: string
1001
- group_metadata?: Json | null
1002
- id?: Json | null
1003
- invite_link?: string | null
1004
- is_exited?: boolean | null
1005
- is_group?: boolean | null
1006
- is_muted?: boolean | null
1007
- is_read_only?: boolean | null
1008
- latest_message?: Json | null
1009
- member_count?: number | null
1010
- mute_expiration?: number | null
1011
- name?: string | null
1012
- org_id?: string
1013
- org_phone?: string
1014
- pinned?: boolean | null
1015
- timestamp?: string | null
1016
- unread_count?: number | null
1017
- updated_at?: string
1018
- }
1019
- Relationships: []
1020
- }
1021
- tbl_contacts: {
1022
- Row: {
1023
- business_profile: Json | null
1024
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
1025
- contact_id: string
1026
- contact_image: string | null
1027
- contact_name: string | null
1028
- contact_type: string | null
1029
- id: Json | null
1030
- is_blocked: boolean | null
1031
- is_business: boolean | null
1032
- is_enterprise: boolean | null
1033
- is_group: boolean | null
1034
- is_imported: boolean | null
1035
- is_internal: boolean | null
1036
- is_me: boolean | null
1037
- is_my_contact: boolean | null
1038
- is_user: boolean | null
1039
- is_wa_contact: boolean | null
1040
- label_ids: Json
1041
- name: string | null
1042
- number: string | null
1043
- org_id: string
1044
- periskope_name: string | null
1045
- pushname: string | null
1046
- short_name: string | null
1047
- updated_at: string | null
1048
- verified_level: number | null
1049
- verified_name: string | null
1050
- }
1051
- Insert: {
1052
- business_profile?: Json | null
1053
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1054
- contact_id: string
1055
- contact_image?: string | null
1056
- contact_name?: string | null
1057
- contact_type?: string | null
1058
- id?: Json | null
1059
- is_blocked?: boolean | null
1060
- is_business?: boolean | null
1061
- is_enterprise?: boolean | null
1062
- is_group?: boolean | null
1063
- is_imported?: boolean | null
1064
- is_internal?: boolean | null
1065
- is_me?: boolean | null
1066
- is_my_contact?: boolean | null
1067
- is_user?: boolean | null
1068
- is_wa_contact?: boolean | null
1069
- label_ids?: Json
1070
- name?: string | null
1071
- number?: string | null
1072
- org_id: string
1073
- periskope_name?: string | null
1074
- pushname?: string | null
1075
- short_name?: string | null
1076
- updated_at?: string | null
1077
- verified_level?: number | null
1078
- verified_name?: string | null
1079
- }
1080
- Update: {
1081
- business_profile?: Json | null
1082
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1083
- contact_id?: string
1084
- contact_image?: string | null
1085
- contact_name?: string | null
1086
- contact_type?: string | null
1087
- id?: Json | null
1088
- is_blocked?: boolean | null
1089
- is_business?: boolean | null
1090
- is_enterprise?: boolean | null
1091
- is_group?: boolean | null
1092
- is_imported?: boolean | null
1093
- is_internal?: boolean | null
1094
- is_me?: boolean | null
1095
- is_my_contact?: boolean | null
1096
- is_user?: boolean | null
1097
- is_wa_contact?: boolean | null
1098
- label_ids?: Json
1099
- name?: string | null
1100
- number?: string | null
1101
- org_id?: string
1102
- periskope_name?: string | null
1103
- pushname?: string | null
1104
- short_name?: string | null
1105
- updated_at?: string | null
1106
- verified_level?: number | null
1107
- verified_name?: string | null
1108
- }
1109
- Relationships: [
1110
- {
1111
- foreignKeyName: "tbl_contacts_org_id_fkey"
1112
- columns: ["org_id"]
1113
- isOneToOne: false
1114
- referencedRelation: "tbl_org"
1115
- referencedColumns: ["org_id"]
1116
- },
1117
- {
1118
- foreignKeyName: "tbl_contacts_org_id_fkey"
1119
- columns: ["org_id"]
1120
- isOneToOne: false
1121
- referencedRelation: "view_org"
1122
- referencedColumns: ["org_id"]
1123
- },
1124
- ]
1125
- }
1126
- tbl_custom_properties: {
1127
- Row: {
1128
- created_at: string
1129
- created_by: string | null
1130
- org_id: string | null
1131
- property_id: string
1132
- property_name: string
1133
- property_value: Json | null
1134
- property_value_type: string | null
1135
- type: string | null
1136
- }
1137
- Insert: {
1138
- created_at?: string
1139
- created_by?: string | null
1140
- org_id?: string | null
1141
- property_id?: string
1142
- property_name: string
1143
- property_value?: Json | null
1144
- property_value_type?: string | null
1145
- type?: string | null
1146
- }
1147
- Update: {
1148
- created_at?: string
1149
- created_by?: string | null
1150
- org_id?: string | null
1151
- property_id?: string
1152
- property_name?: string
1153
- property_value?: Json | null
1154
- property_value_type?: string | null
1155
- type?: string | null
1156
- }
1157
- Relationships: [
1158
- {
1159
- foreignKeyName: "tbl_custom_properties_org_id_fkey"
1160
- columns: ["org_id"]
1161
- isOneToOne: false
1162
- referencedRelation: "tbl_org"
1163
- referencedColumns: ["org_id"]
1164
- },
1165
- {
1166
- foreignKeyName: "tbl_custom_properties_org_id_fkey"
1167
- columns: ["org_id"]
1168
- isOneToOne: false
1169
- referencedRelation: "view_org"
1170
- referencedColumns: ["org_id"]
1171
- },
1172
- ]
1173
- }
1174
- tbl_integration_hooks: {
1175
- Row: {
1176
- hook_url: string
1177
- id: string
1178
- integration_id: string | null
1179
- integration_metadata: Json
1180
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1181
- integration_type: string
1182
- is_subscribed: boolean
1183
- org_id: string
1184
- subscribed_at: string
1185
- type: Database["public"]["Enums"]["enum_integration_type"]
1186
- }
1187
- Insert: {
1188
- hook_url: string
1189
- id?: string
1190
- integration_id?: string | null
1191
- integration_metadata: Json
1192
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1193
- integration_type: string
1194
- is_subscribed: boolean
1195
- org_id: string
1196
- subscribed_at?: string
1197
- type: Database["public"]["Enums"]["enum_integration_type"]
1198
- }
1199
- Update: {
1200
- hook_url?: string
1201
- id?: string
1202
- integration_id?: string | null
1203
- integration_metadata?: Json
1204
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1205
- integration_type?: string
1206
- is_subscribed?: boolean
1207
- org_id?: string
1208
- subscribed_at?: string
1209
- type?: Database["public"]["Enums"]["enum_integration_type"]
1210
- }
1211
- Relationships: [
1212
- {
1213
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1214
- columns: ["org_id"]
1215
- isOneToOne: false
1216
- referencedRelation: "tbl_org"
1217
- referencedColumns: ["org_id"]
1218
- },
1219
- {
1220
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1221
- columns: ["org_id"]
1222
- isOneToOne: false
1223
- referencedRelation: "view_org"
1224
- referencedColumns: ["org_id"]
1225
- },
1226
- ]
1227
- }
1228
- tbl_integration_logs: {
1229
- Row: {
1230
- created_at: string
1231
- id: string
1232
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1233
- integration_type: string
1234
- metadata: Json
1235
- org_id: string
1236
- response: Json | null
1237
- success: boolean
1238
- type: Database["public"]["Enums"]["enum_integration_type"]
1239
- }
1240
- Insert: {
1241
- created_at?: string
1242
- id?: string
1243
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
1244
- integration_type: string
1245
- metadata?: Json
1246
- org_id: string
1247
- response?: Json | null
1248
- success?: boolean
1249
- type: Database["public"]["Enums"]["enum_integration_type"]
1250
- }
1251
- Update: {
1252
- created_at?: string
1253
- id?: string
1254
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1255
- integration_type?: string
1256
- metadata?: Json
1257
- org_id?: string
1258
- response?: Json | null
1259
- success?: boolean
1260
- type?: Database["public"]["Enums"]["enum_integration_type"]
1261
- }
1262
- Relationships: [
1263
- {
1264
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
1265
- columns: ["org_id"]
1266
- isOneToOne: false
1267
- referencedRelation: "tbl_org"
1268
- referencedColumns: ["org_id"]
1269
- },
1270
- {
1271
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
1272
- columns: ["org_id"]
1273
- isOneToOne: false
1274
- referencedRelation: "view_org"
1275
- referencedColumns: ["org_id"]
1276
- },
1277
- ]
1278
- }
1279
- tbl_integration_tokens: {
1280
- Row: {
1281
- exp: string
1282
- iat: string
1283
- id: string
1284
- is_revealed: boolean
1285
- name: string
1286
- org_id: string
1287
- role: string
1288
- token: string
1289
- token_metadata: Json | null
1290
- type: Database["public"]["Enums"]["enum_integration_type"]
1291
- }
1292
- Insert: {
1293
- exp: string
1294
- iat: string
1295
- id?: string
1296
- is_revealed?: boolean
1297
- name: string
1298
- org_id: string
1299
- role: string
1300
- token: string
1301
- token_metadata?: Json | null
1302
- type: Database["public"]["Enums"]["enum_integration_type"]
1303
- }
1304
- Update: {
1305
- exp?: string
1306
- iat?: string
1307
- id?: string
1308
- is_revealed?: boolean
1309
- name?: string
1310
- org_id?: string
1311
- role?: string
1312
- token?: string
1313
- token_metadata?: Json | null
1314
- type?: Database["public"]["Enums"]["enum_integration_type"]
1315
- }
1316
- Relationships: [
1317
- {
1318
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1319
- columns: ["org_id"]
1320
- isOneToOne: false
1321
- referencedRelation: "tbl_org"
1322
- referencedColumns: ["org_id"]
1323
- },
1324
- {
1325
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1326
- columns: ["org_id"]
1327
- isOneToOne: false
1328
- referencedRelation: "view_org"
1329
- referencedColumns: ["org_id"]
1330
- },
1331
- ]
1332
- }
1333
- tbl_org: {
1334
- Row: {
1335
- created_at: string
1336
- org_id: string
1337
- org_image: string | null
1338
- org_metadata: Json | null
1339
- org_name: string | null
1340
- org_plan: Json | null
1341
- stripe_customer_details: Json | null
1342
- stripe_customer_id: string | null
1343
- stripe_subscription_details: Json | null
1344
- support_link: string | null
1345
- }
1346
- Insert: {
1347
- created_at?: string
1348
- org_id?: string
1349
- org_image?: string | null
1350
- org_metadata?: Json | null
1351
- org_name?: string | null
1352
- org_plan?: Json | null
1353
- stripe_customer_details?: Json | null
1354
- stripe_customer_id?: string | null
1355
- stripe_subscription_details?: Json | null
1356
- support_link?: string | null
1357
- }
1358
- Update: {
1359
- created_at?: string
1360
- org_id?: string
1361
- org_image?: string | null
1362
- org_metadata?: Json | null
1363
- org_name?: string | null
1364
- org_plan?: Json | null
1365
- stripe_customer_details?: Json | null
1366
- stripe_customer_id?: string | null
1367
- stripe_subscription_details?: Json | null
1368
- support_link?: string | null
1369
- }
1370
- Relationships: []
1371
- }
1372
- tbl_org_labels: {
1373
- Row: {
1374
- color: string
1375
- created_at: string
1376
- label_id: string
1377
- name: string
1378
- org_id: string
1379
- type: string
1380
- }
1381
- Insert: {
1382
- color?: string
1383
- created_at?: string
1384
- label_id?: string
1385
- name: string
1386
- org_id: string
1387
- type?: string
1388
- }
1389
- Update: {
1390
- color?: string
1391
- created_at?: string
1392
- label_id?: string
1393
- name?: string
1394
- org_id?: string
1395
- type?: string
1396
- }
1397
- Relationships: [
1398
- {
1399
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1400
- columns: ["org_id"]
1401
- isOneToOne: false
1402
- referencedRelation: "tbl_org"
1403
- referencedColumns: ["org_id"]
1404
- },
1405
- {
1406
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1407
- columns: ["org_id"]
1408
- isOneToOne: false
1409
- referencedRelation: "view_org"
1410
- referencedColumns: ["org_id"]
1411
- },
1412
- ]
1413
- }
1414
- tbl_org_members: {
1415
- Row: {
1416
- created_at: string | null
1417
- email: string
1418
- invited_at: string | null
1419
- invited_by: string | null
1420
- is_active: boolean
1421
- is_owner: boolean | null
1422
- label_ids: string[] | null
1423
- member_color: Database["public"]["Enums"]["enum_chat_colors"]
1424
- member_image: string | null
1425
- member_name: string | null
1426
- org_id: string
1427
- org_phones: string[] | null
1428
- preferences: Json
1429
- role: Database["public"]["Enums"]["enum_member_role"]
1430
- user_id: string | null
1431
- }
1432
- Insert: {
1433
- created_at?: string | null
1434
- email: string
1435
- invited_at?: string | null
1436
- invited_by?: string | null
1437
- is_active?: boolean
1438
- is_owner?: boolean | null
1439
- label_ids?: string[] | null
1440
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1441
- member_image?: string | null
1442
- member_name?: string | null
1443
- org_id: string
1444
- org_phones?: string[] | null
1445
- preferences?: Json
1446
- role?: Database["public"]["Enums"]["enum_member_role"]
1447
- user_id?: string | null
1448
- }
1449
- Update: {
1450
- created_at?: string | null
1451
- email?: string
1452
- invited_at?: string | null
1453
- invited_by?: string | null
1454
- is_active?: boolean
1455
- is_owner?: boolean | null
1456
- label_ids?: string[] | null
1457
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1458
- member_image?: string | null
1459
- member_name?: string | null
1460
- org_id?: string
1461
- org_phones?: string[] | null
1462
- preferences?: Json
1463
- role?: Database["public"]["Enums"]["enum_member_role"]
1464
- user_id?: string | null
1465
- }
1466
- Relationships: [
1467
- {
1468
- foreignKeyName: "tbl_org_members_fkey_auth_users"
1469
- columns: ["user_id"]
1470
- isOneToOne: false
1471
- referencedRelation: "users"
1472
- referencedColumns: ["id"]
1473
- },
1474
- {
1475
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1476
- columns: ["org_id"]
1477
- isOneToOne: false
1478
- referencedRelation: "tbl_org"
1479
- referencedColumns: ["org_id"]
1480
- },
1481
- {
1482
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1483
- columns: ["org_id"]
1484
- isOneToOne: false
1485
- referencedRelation: "view_org"
1486
- referencedColumns: ["org_id"]
1487
- },
1488
- ]
1489
- }
1490
- tbl_org_phones: {
1491
- Row: {
1492
- created_at: string
1493
- first_connected_at: string | null
1494
- is_browser_open: boolean
1495
- is_ready: boolean | null
1496
- legacy_version: boolean | null
1497
- library: string | null
1498
- org_id: string
1499
- org_phone: string | null
1500
- phone_id: string
1501
- phone_image: string | null
1502
- phone_name: string | null
1503
- phone_state: Json | null
1504
- qr_code: string | null
1505
- server_image: string | null
1506
- server_ip: string | null
1507
- soft_restart: boolean
1508
- updated_at: string | null
1509
- wa_state: string | null
1510
- wa_version: string | null
1511
- }
1512
- Insert: {
1513
- created_at?: string
1514
- first_connected_at?: string | null
1515
- is_browser_open?: boolean
1516
- is_ready?: boolean | null
1517
- legacy_version?: boolean | null
1518
- library?: string | null
1519
- org_id: string
1520
- org_phone?: string | null
1521
- phone_id?: string
1522
- phone_image?: string | null
1523
- phone_name?: string | null
1524
- phone_state?: Json | null
1525
- qr_code?: string | null
1526
- server_image?: string | null
1527
- server_ip?: string | null
1528
- soft_restart?: boolean
1529
- updated_at?: string | null
1530
- wa_state?: string | null
1531
- wa_version?: string | null
1532
- }
1533
- Update: {
1534
- created_at?: string
1535
- first_connected_at?: string | null
1536
- is_browser_open?: boolean
1537
- is_ready?: boolean | null
1538
- legacy_version?: boolean | null
1539
- library?: string | null
1540
- org_id?: string
1541
- org_phone?: string | null
1542
- phone_id?: string
1543
- phone_image?: string | null
1544
- phone_name?: string | null
1545
- phone_state?: Json | null
1546
- qr_code?: string | null
1547
- server_image?: string | null
1548
- server_ip?: string | null
1549
- soft_restart?: boolean
1550
- updated_at?: string | null
1551
- wa_state?: string | null
1552
- wa_version?: string | null
1553
- }
1554
- Relationships: [
1555
- {
1556
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1557
- columns: ["org_id"]
1558
- isOneToOne: false
1559
- referencedRelation: "tbl_org"
1560
- referencedColumns: ["org_id"]
1561
- },
1562
- {
1563
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1564
- columns: ["org_id"]
1565
- isOneToOne: false
1566
- referencedRelation: "view_org"
1567
- referencedColumns: ["org_id"]
1568
- },
1569
- {
1570
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1571
- columns: ["org_id"]
1572
- isOneToOne: false
1573
- referencedRelation: "tbl_org"
1574
- referencedColumns: ["org_id"]
1575
- },
1576
- {
1577
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1578
- columns: ["org_id"]
1579
- isOneToOne: false
1580
- referencedRelation: "view_org"
1581
- referencedColumns: ["org_id"]
1582
- },
1583
- ]
1584
- }
1585
- tbl_org_transactions: {
1586
- Row: {
1587
- amount: number
1588
- is_top_up: boolean | null
1589
- org_id: string
1590
- timestamp: string | null
1591
- transaction_id: string
1592
- transaction_metadata: Json | null
1593
- transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1594
- usage_metadata: Json | null
1595
- }
1596
- Insert: {
1597
- amount: number
1598
- is_top_up?: boolean | null
1599
- org_id: string
1600
- timestamp?: string | null
1601
- transaction_id?: string
1602
- transaction_metadata?: Json | null
1603
- transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1604
- usage_metadata?: Json | null
1605
- }
1606
- Update: {
1607
- amount?: number
1608
- is_top_up?: boolean | null
1609
- org_id?: string
1610
- timestamp?: string | null
1611
- transaction_id?: string
1612
- transaction_metadata?: Json | null
1613
- transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"]
1614
- usage_metadata?: Json | null
1615
- }
1616
- Relationships: [
1617
- {
1618
- foreignKeyName: "tbl_org_transactions_org_id_fkey"
1619
- columns: ["org_id"]
1620
- isOneToOne: false
1621
- referencedRelation: "tbl_org"
1622
- referencedColumns: ["org_id"]
1623
- },
1624
- {
1625
- foreignKeyName: "tbl_org_transactions_org_id_fkey"
1626
- columns: ["org_id"]
1627
- isOneToOne: false
1628
- referencedRelation: "view_org"
1629
- referencedColumns: ["org_id"]
1630
- },
1631
- ]
1632
- }
1633
- tbl_quick_replies: {
1634
- Row: {
1635
- command: string | null
1636
- created_at: string
1637
- message_payload: Json | null
1638
- org_id: string
1639
- reply_id: string
1640
- }
1641
- Insert: {
1642
- command?: string | null
1643
- created_at?: string
1644
- message_payload?: Json | null
1645
- org_id: string
1646
- reply_id?: string
1647
- }
1648
- Update: {
1649
- command?: string | null
1650
- created_at?: string
1651
- message_payload?: Json | null
1652
- org_id?: string
1653
- reply_id?: string
1654
- }
1655
- Relationships: [
1656
- {
1657
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1658
- columns: ["org_id"]
1659
- isOneToOne: false
1660
- referencedRelation: "tbl_org"
1661
- referencedColumns: ["org_id"]
1662
- },
1663
- {
1664
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1665
- columns: ["org_id"]
1666
- isOneToOne: false
1667
- referencedRelation: "view_org"
1668
- referencedColumns: ["org_id"]
1669
- },
1670
- ]
1671
- }
1672
- tbl_scheduled_messages: {
1673
- Row: {
1674
- chat_id: string
1675
- created_at: string
1676
- message_id: string | null
1677
- message_payload: Json | null
1678
- org_id: string
1679
- org_phone: string | null
1680
- performed_by: string | null
1681
- scheduled_at: string
1682
- sent_message_id: string
1683
- status: boolean | null
1684
- updated_at: string | null
1685
- }
1686
- Insert: {
1687
- chat_id: string
1688
- created_at?: string
1689
- message_id?: string | null
1690
- message_payload?: Json | null
1691
- org_id: string
1692
- org_phone?: string | null
1693
- performed_by?: string | null
1694
- scheduled_at: string
1695
- sent_message_id: string
1696
- status?: boolean | null
1697
- updated_at?: string | null
1698
- }
1699
- Update: {
1700
- chat_id?: string
1701
- created_at?: string
1702
- message_id?: string | null
1703
- message_payload?: Json | null
1704
- org_id?: string
1705
- org_phone?: string | null
1706
- performed_by?: string | null
1707
- scheduled_at?: string
1708
- sent_message_id?: string
1709
- status?: boolean | null
1710
- updated_at?: string | null
1711
- }
1712
- Relationships: [
1713
- {
1714
- foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1715
- columns: ["org_id"]
1716
- isOneToOne: false
1717
- referencedRelation: "tbl_org"
1718
- referencedColumns: ["org_id"]
1719
- },
1720
- {
1721
- foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1722
- columns: ["org_id"]
1723
- isOneToOne: false
1724
- referencedRelation: "view_org"
1725
- referencedColumns: ["org_id"]
1726
- },
1727
- ]
1728
- }
1729
- tbl_tools_whatsapp_links: {
1730
- Row: {
1731
- created_at: string
1732
- link_id: string
1733
- link_name: string
1734
- message: string | null
1735
- phone: string
1736
- }
1737
- Insert: {
1738
- created_at?: string
1739
- link_id?: string
1740
- link_name: string
1741
- message?: string | null
1742
- phone: string
1743
- }
1744
- Update: {
1745
- created_at?: string
1746
- link_id?: string
1747
- link_name?: string
1748
- message?: string | null
1749
- phone?: string
1750
- }
1751
- Relationships: []
1752
- }
1753
- }
1754
- Views: {
1755
- view_broadcast_logs: {
1756
- Row: {
1757
- broadcast_id: string | null
1758
- broadcast_status:
1759
- | Database["public"]["Enums"]["enum_broadcast_status"]
1760
- | null
1761
- created_at: string | null
1762
- delivered_percentage: number | null
1763
- failed_chats: number | null
1764
- message_payload: Json | null
1765
- org_id: string | null
1766
- pending_chats: number | null
1767
- performed_at: string | null
1768
- performed_by: string | null
1769
- read_percentage: number | null
1770
- scheduled_at: string | null
1771
- sent_chats: number | null
1772
- total_chats: number | null
1773
- total_delivered_count: number | null
1774
- total_member_count: number | null
1775
- total_read_count: number | null
1776
- }
1777
- Relationships: [
1778
- {
1779
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1780
- columns: ["org_id"]
1781
- isOneToOne: false
1782
- referencedRelation: "tbl_org"
1783
- referencedColumns: ["org_id"]
1784
- },
1785
- {
1786
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1787
- columns: ["org_id"]
1788
- isOneToOne: false
1789
- referencedRelation: "view_org"
1790
- referencedColumns: ["org_id"]
1791
- },
1792
- ]
1793
- }
1794
- view_chat_logs: {
1795
- Row: {
1796
- action: string | null
1797
- failed: number | null
1798
- operation_id: string | null
1799
- org_id: string | null
1800
- pending: number | null
1801
- performed_at: string | null
1802
- performed_by: string | null
1803
- success: number | null
1804
- total_chats: number | null
1805
- total_logs: number | null
1806
- total_participants: number | null
1807
- }
1808
- Relationships: [
1809
- {
1810
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
1811
- columns: ["org_id"]
1812
- isOneToOne: false
1813
- referencedRelation: "tbl_org"
1814
- referencedColumns: ["org_id"]
1815
- },
1816
- {
1817
- foreignKeyName: "tbl_chat_logs_org_id_fkey"
1818
- columns: ["org_id"]
1819
- isOneToOne: false
1820
- referencedRelation: "view_org"
1821
- referencedColumns: ["org_id"]
1822
- },
1823
- ]
1824
- }
1825
- view_chats: {
1826
- Row: {
1827
- assigned_to: string | null
1828
- chat_access: Json | null
1829
- chat_id: string | null
1830
- chat_image: string | null
1831
- chat_name: string | null
1832
- chat_org_phones: string[] | null
1833
- chat_type: string | null
1834
- created_at: string | null
1835
- custom_properties: Json | null
1836
- flag_count_map: Json | null
1837
- group_description: string | null
1838
- hubspot_metadata: Json | null
1839
- info_admins_only: boolean | null
1840
- invite_link: string | null
1841
- is_exited: boolean | null
1842
- is_muted: boolean | null
1843
- label_ids: Json | null
1844
- latest_message: Json | null
1845
- member_add_mode: string | null
1846
- member_count: number | null
1847
- message_unread_count: number | null
1848
- messages_admins_only: boolean | null
1849
- org_id: string | null
1850
- org_phone: string | null
1851
- updated_at: string | null
1852
- }
1853
- Relationships: []
1854
- }
1855
- view_org: {
1856
- Row: {
1857
- access_scopes: Json | null
1858
- created_at: string | null
1859
- is_enterprise: boolean | null
1860
- is_free_trial: boolean | null
1861
- is_freshdesk_connected: boolean | null
1862
- is_hubspot_connected: boolean | null
1863
- is_zohodesk_connected: boolean | null
1864
- org_id: string | null
1865
- org_image: string | null
1866
- org_metadata: Json | null
1867
- org_name: string | null
1868
- org_plan: Json | null
1869
- pending_days: number | null
1870
- phone_limit: string | null
1871
- plan_id: string | null
1872
- stripe_customer_details: Json | null
1873
- stripe_customer_id: string | null
1874
- stripe_subscription_details: Json | null
1875
- subscription_status: string | null
1876
- support_link: string | null
1877
- user_limit: string | null
1878
- }
1879
- Insert: {
1880
- access_scopes?: never
1881
- created_at?: string | null
1882
- is_enterprise?: never
1883
- is_free_trial?: never
1884
- is_freshdesk_connected?: never
1885
- is_hubspot_connected?: never
1886
- is_zohodesk_connected?: never
1887
- org_id?: string | null
1888
- org_image?: string | null
1889
- org_metadata?: Json | null
1890
- org_name?: string | null
1891
- org_plan?: Json | null
1892
- pending_days?: never
1893
- phone_limit?: never
1894
- plan_id?: never
1895
- stripe_customer_details?: Json | null
1896
- stripe_customer_id?: string | null
1897
- stripe_subscription_details?: Json | null
1898
- subscription_status?: never
1899
- support_link?: string | null
1900
- user_limit?: never
1901
- }
1902
- Update: {
1903
- access_scopes?: never
1904
- created_at?: string | null
1905
- is_enterprise?: never
1906
- is_free_trial?: never
1907
- is_freshdesk_connected?: never
1908
- is_hubspot_connected?: never
1909
- is_zohodesk_connected?: never
1910
- org_id?: string | null
1911
- org_image?: string | null
1912
- org_metadata?: Json | null
1913
- org_name?: string | null
1914
- org_plan?: Json | null
1915
- pending_days?: never
1916
- phone_limit?: never
1917
- plan_id?: never
1918
- stripe_customer_details?: Json | null
1919
- stripe_customer_id?: string | null
1920
- stripe_subscription_details?: Json | null
1921
- subscription_status?: never
1922
- support_link?: string | null
1923
- user_limit?: never
1924
- }
1925
- Relationships: []
1926
- }
1927
- }
1928
- Functions: {
1929
- check_feature_flag_access: {
1930
- Args: {
1931
- org_id_input: string
1932
- feature_input: string
1933
- }
1934
- Returns: boolean
1935
- }
1936
- create_partition: {
1937
- Args: {
1938
- org_id_input: string
1939
- }
1940
- Returns: boolean
1941
- }
1942
- custom_access_token_hook: {
1943
- Args: {
1944
- event: Json
1945
- }
1946
- Returns: Json
1947
- }
1948
- drop_partition: {
1949
- Args: {
1950
- org_id_input: string
1951
- }
1952
- Returns: boolean
1953
- }
1954
- find_discrepancies: {
1955
- Args: {
1956
- p_org_id: string
1957
- }
1958
- Returns: {
1959
- a_chat_id: string
1960
- discrepancy_count: number
1961
- }[]
1962
- }
1963
- gen_id: {
1964
- Args: {
1965
- prefix: string
1966
- size?: number
1967
- alphabet?: string
1968
- }
1969
- Returns: string
1970
- }
1971
- gen_ticket_id: {
1972
- Args: {
1973
- org_id_input: string
1974
- }
1975
- Returns: string
1976
- }
1977
- generate_access_token: {
1978
- Args: {
1979
- name_input?: string
1980
- type_input?: Database["public"]["Enums"]["enum_integration_type"]
1981
- org_id_input?: string
1982
- }
1983
- Returns: Json
1984
- }
1985
- get_api_auth_details: {
1986
- Args: {
1987
- org_id_input?: string
1988
- org_phone_input?: string
1989
- token_id_input?: string
1990
- token_type_input?: Database["public"]["Enums"]["enum_integration_type"]
1991
- }
1992
- Returns: Json
1993
- }
1994
- get_chat_labels_data: {
1995
- Args: {
1996
- org_id_input: string
1997
- chat_ids_input?: string[]
1998
- }
1999
- Returns: Json[]
2000
- }
2001
- get_chat_rule_info: {
2002
- Args: {
2003
- chat_id_input: string
2004
- org_id_input: string
2005
- org_phone_input: string
2006
- }
2007
- Returns: Json
2008
- }
2009
- get_chats: {
2010
- Args: {
2011
- org_id_input: string
2012
- chat_id_input?: string[]
2013
- with_members?: boolean
2014
- last_updated_at?: string
2015
- batch_limit?: number
2016
- batch_offset?: number
2017
- }
2018
- Returns: Json
2019
- }
2020
- get_chats_info: {
2021
- Args: {
2022
- chat_id_input: string
2023
- org_id_input: string
2024
- org_phone_input?: string
2025
- }
2026
- Returns: Json
2027
- }
2028
- get_contacts: {
2029
- Args: {
2030
- org_id_input: string
2031
- contact_ids_input?: string[]
2032
- sync_phone_contacts?: boolean
2033
- search_input?: string
2034
- label_ids_input?: string[]
2035
- is_internal_input?: boolean
2036
- offset_input?: number
2037
- limit_input?: number
2038
- }
2039
- Returns: Json
2040
- }
2041
- get_export_chats_data: {
2042
- Args: {
2043
- org_id_input: string
2044
- chat_id_input?: string[]
2045
- }
2046
- Returns: Json
2047
- }
2048
- get_export_tickets_data: {
2049
- Args: {
2050
- org_id_input: string
2051
- ticket_id_input?: string[]
2052
- }
2053
- Returns: Json
2054
- }
2055
- get_feature_flags: {
2056
- Args: {
2057
- org_id_input: string
2058
- }
2059
- Returns: {
2060
- feature: string
2061
- enabled: boolean
2062
- }[]
2063
- }
2064
- get_integration_data: {
2065
- Args: {
2066
- org_id_input?: string
2067
- }
2068
- Returns: Json
2069
- }
2070
- get_message_rule_info: {
2071
- Args: {
2072
- message_id_input: string
2073
- chat_id_input: string
2074
- org_id_input: string
2075
- org_phone_input: string
2076
- sender_id_input: string
2077
- }
2078
- Returns: Json
2079
- }
2080
- get_messages_notifications_reactions: {
2081
- Args: {
2082
- org_id_input: string
2083
- chat_id_input?: string[]
2084
- limit_input?: number
2085
- offset_input?: number
2086
- }
2087
- Returns: Json
2088
- }
2089
- get_org: {
2090
- Args: {
2091
- org_id_input?: string
2092
- }
2093
- Returns: Json
2094
- }
2095
- get_org_credits: {
2096
- Args: {
2097
- org_id_input?: string
2098
- }
2099
- Returns: Json
2100
- }
2101
- get_org_phones: {
2102
- Args: {
2103
- org_id_input?: string
2104
- phone_id_input?: string
2105
- }
2106
- Returns: Json
2107
- }
2108
- get_reaction_rule_info: {
2109
- Args: {
2110
- reaction_id_input: string
2111
- message_id_input: string
2112
- chat_id_input: string
2113
- org_id_input: string
2114
- org_phone_input: string
2115
- sender_id_input: string
2116
- }
2117
- Returns: Json
2118
- }
2119
- get_team_metrics_between_dates: {
2120
- Args: {
2121
- org_id_input: string
2122
- start_date: string
2123
- end_date: string
2124
- chat_id_input?: string[]
2125
- }
2126
- Returns: Json
2127
- }
2128
- get_ticket_info: {
2129
- Args: {
2130
- ticket_id_input?: string
2131
- org_id_input?: string
2132
- chat_id_input?: string
2133
- unique_message_id_input?: string
2134
- }
2135
- Returns: Json
2136
- }
2137
- get_ticket_rule_info: {
2138
- Args: {
2139
- ticket_id_input: string
2140
- unique_message_id_input: string
2141
- chat_id_input: string
2142
- org_id_input: string
2143
- }
2144
- Returns: Json
2145
- }
2146
- get_universal_search_result: {
2147
- Args: {
2148
- search_category_input: string
2149
- search_query_input: string
2150
- org_id_input: string
2151
- }
2152
- Returns: {
2153
- category: string
2154
- result: Json
2155
- }[]
2156
- }
2157
- image_path: {
2158
- Args: {
2159
- path_input?: string
2160
- bucket_name?: string
2161
- req_base?: boolean
2162
- }
2163
- Returns: string
2164
- }
2165
- list_org_from_user: {
2166
- Args: Record<PropertyKey, never>
2167
- Returns: string[]
2168
- }
2169
- list_role_from_user: {
2170
- Args: Record<PropertyKey, never>
2171
- Returns: Database["public"]["Enums"]["enum_member_role"]
2172
- }
2173
- update_chat_properties: {
2174
- Args: {
2175
- column_name: string
2176
- org_id_input: string
2177
- chat_id_input: string[]
2178
- column_value_input?: unknown
2179
- key_input?: string
2180
- value_input?: Json
2181
- }
2182
- Returns: undefined
2183
- }
2184
- update_custom_properties: {
2185
- Args: {
2186
- org_id_input: string
2187
- row_properties_map: Json
2188
- replace_properties?: boolean
2189
- }
2190
- Returns: undefined
2191
- }
2192
- update_labels: {
2193
- Args: {
2194
- org_id_input: string
2195
- tbl_type: string
2196
- row_label_map: Json
2197
- replace_labels?: boolean
2198
- }
2199
- Returns: undefined
2200
- }
2201
- }
2202
- Enums: {
2203
- enum_broadcast_status: "inprogress" | "completed" | "stopped" | "expired"
2204
- enum_chat_colors:
2205
- | "#B4876E"
2206
- | "#A5B337"
2207
- | "#06CF9C"
2208
- | "#25D366"
2209
- | "#02A698"
2210
- | "#7D9EF1"
2211
- | "#007BFC"
2212
- | "#5E47DE"
2213
- | "#7F66FF"
2214
- | "#9333EA"
2215
- | "#FA6533"
2216
- | "#C4532D"
2217
- | "#DC2626"
2218
- | "#FF2E74"
2219
- | "#DB2777"
2220
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
2221
- enum_credit_transaction_type: "credit" | "debit"
2222
- enum_integration_name:
2223
- | "org.created"
2224
- | "org.updated"
2225
- | "org.member.created"
2226
- | "org.member.updated"
2227
- | "org.phone.created"
2228
- | "org.phone.connected"
2229
- | "org.phone.disconnected"
2230
- | "org.subscription.trial_will_end"
2231
- | "chat.created"
2232
- | "chat.updated"
2233
- | "chat.notification.created"
2234
- | "message.created"
2235
- | "message.updated"
2236
- | "message.deleted"
2237
- | "message.ack.updated"
2238
- | "reaction.created"
2239
- | "reaction.updated"
2240
- | "ticket.created"
2241
- | "ticket.updated"
2242
- | "ticket.deleted"
2243
- | "org.integrations.updated"
2244
- | "message.flagged"
2245
- | "message.unflagged"
2246
- | "chat.label.updated"
2247
- | "reaction.added"
2248
- enum_integration_type:
2249
- | "zapier"
2250
- | "pabbly"
2251
- | "api"
2252
- | "webhook"
2253
- | "hubspot"
2254
- | "freshdesk"
2255
- | "slack"
2256
- | "jira"
2257
- | "salesforce"
2258
- | "zohodesk"
2259
- | "gsheets"
2260
- enum_member_role: "admin" | "member"
2261
- }
2262
- CompositeTypes: {
2263
- [_ in never]: never
2264
- }
2265
- }
2266
- storage: {
2267
- Tables: {
2268
- buckets: {
2269
- Row: {
2270
- allowed_mime_types: string[] | null
2271
- avif_autodetection: boolean | null
2272
- created_at: string | null
2273
- file_size_limit: number | null
2274
- id: string
2275
- name: string
2276
- owner: string | null
2277
- owner_id: string | null
2278
- public: boolean | null
2279
- updated_at: string | null
2280
- }
2281
- Insert: {
2282
- allowed_mime_types?: string[] | null
2283
- avif_autodetection?: boolean | null
2284
- created_at?: string | null
2285
- file_size_limit?: number | null
2286
- id: string
2287
- name: string
2288
- owner?: string | null
2289
- owner_id?: string | null
2290
- public?: boolean | null
2291
- updated_at?: string | null
2292
- }
2293
- Update: {
2294
- allowed_mime_types?: string[] | null
2295
- avif_autodetection?: boolean | null
2296
- created_at?: string | null
2297
- file_size_limit?: number | null
2298
- id?: string
2299
- name?: string
2300
- owner?: string | null
2301
- owner_id?: string | null
2302
- public?: boolean | null
2303
- updated_at?: string | null
2304
- }
2305
- Relationships: []
2306
- }
2307
- migrations: {
2308
- Row: {
2309
- executed_at: string | null
2310
- hash: string
2311
- id: number
2312
- name: string
2313
- }
2314
- Insert: {
2315
- executed_at?: string | null
2316
- hash: string
2317
- id: number
2318
- name: string
2319
- }
2320
- Update: {
2321
- executed_at?: string | null
2322
- hash?: string
2323
- id?: number
2324
- name?: string
2325
- }
2326
- Relationships: []
2327
- }
2328
- objects: {
2329
- Row: {
2330
- bucket_id: string | null
2331
- created_at: string | null
2332
- id: string
2333
- last_accessed_at: string | null
2334
- metadata: Json | null
2335
- name: string | null
2336
- owner: string | null
2337
- owner_id: string | null
2338
- path_tokens: string[] | null
2339
- updated_at: string | null
2340
- user_metadata: Json | null
2341
- version: string | null
2342
- }
2343
- Insert: {
2344
- bucket_id?: string | null
2345
- created_at?: string | null
2346
- id?: string
2347
- last_accessed_at?: string | null
2348
- metadata?: Json | null
2349
- name?: string | null
2350
- owner?: string | null
2351
- owner_id?: string | null
2352
- path_tokens?: string[] | null
2353
- updated_at?: string | null
2354
- user_metadata?: Json | null
2355
- version?: string | null
2356
- }
2357
- Update: {
2358
- bucket_id?: string | null
2359
- created_at?: string | null
2360
- id?: string
2361
- last_accessed_at?: string | null
2362
- metadata?: Json | null
2363
- name?: string | null
2364
- owner?: string | null
2365
- owner_id?: string | null
2366
- path_tokens?: string[] | null
2367
- updated_at?: string | null
2368
- user_metadata?: Json | null
2369
- version?: string | null
2370
- }
2371
- Relationships: [
2372
- {
2373
- foreignKeyName: "objects_bucketId_fkey"
2374
- columns: ["bucket_id"]
2375
- isOneToOne: false
2376
- referencedRelation: "buckets"
2377
- referencedColumns: ["id"]
2378
- },
2379
- ]
2380
- }
2381
- s3_multipart_uploads: {
2382
- Row: {
2383
- bucket_id: string
2384
- created_at: string
2385
- id: string
2386
- in_progress_size: number
2387
- key: string
2388
- owner_id: string | null
2389
- upload_signature: string
2390
- user_metadata: Json | null
2391
- version: string
2392
- }
2393
- Insert: {
2394
- bucket_id: string
2395
- created_at?: string
2396
- id: string
2397
- in_progress_size?: number
2398
- key: string
2399
- owner_id?: string | null
2400
- upload_signature: string
2401
- user_metadata?: Json | null
2402
- version: string
2403
- }
2404
- Update: {
2405
- bucket_id?: string
2406
- created_at?: string
2407
- id?: string
2408
- in_progress_size?: number
2409
- key?: string
2410
- owner_id?: string | null
2411
- upload_signature?: string
2412
- user_metadata?: Json | null
2413
- version?: string
2414
- }
2415
- Relationships: [
2416
- {
2417
- foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2418
- columns: ["bucket_id"]
2419
- isOneToOne: false
2420
- referencedRelation: "buckets"
2421
- referencedColumns: ["id"]
2422
- },
2423
- ]
2424
- }
2425
- s3_multipart_uploads_parts: {
2426
- Row: {
2427
- bucket_id: string
2428
- created_at: string
2429
- etag: string
2430
- id: string
2431
- key: string
2432
- owner_id: string | null
2433
- part_number: number
2434
- size: number
2435
- upload_id: string
2436
- version: string
2437
- }
2438
- Insert: {
2439
- bucket_id: string
2440
- created_at?: string
2441
- etag: string
2442
- id?: string
2443
- key: string
2444
- owner_id?: string | null
2445
- part_number: number
2446
- size?: number
2447
- upload_id: string
2448
- version: string
2449
- }
2450
- Update: {
2451
- bucket_id?: string
2452
- created_at?: string
2453
- etag?: string
2454
- id?: string
2455
- key?: string
2456
- owner_id?: string | null
2457
- part_number?: number
2458
- size?: number
2459
- upload_id?: string
2460
- version?: string
2461
- }
2462
- Relationships: [
2463
- {
2464
- foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2465
- columns: ["bucket_id"]
2466
- isOneToOne: false
2467
- referencedRelation: "buckets"
2468
- referencedColumns: ["id"]
2469
- },
2470
- {
2471
- foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2472
- columns: ["upload_id"]
2473
- isOneToOne: false
2474
- referencedRelation: "s3_multipart_uploads"
2475
- referencedColumns: ["id"]
2476
- },
2477
- ]
2478
- }
2479
- }
2480
- Views: {
2481
- [_ in never]: never
2482
- }
2483
- Functions: {
2484
- can_insert_object: {
2485
- Args: {
2486
- bucketid: string
2487
- name: string
2488
- owner: string
2489
- metadata: Json
2490
- }
2491
- Returns: undefined
2492
- }
2493
- extension: {
2494
- Args: {
2495
- name: string
2496
- }
2497
- Returns: string
2498
- }
2499
- filename: {
2500
- Args: {
2501
- name: string
2502
- }
2503
- Returns: string
2504
- }
2505
- foldername: {
2506
- Args: {
2507
- name: string
2508
- }
2509
- Returns: string[]
2510
- }
2511
- get_size_by_bucket: {
2512
- Args: Record<PropertyKey, never>
2513
- Returns: {
2514
- size: number
2515
- bucket_id: string
2516
- }[]
2517
- }
2518
- list_multipart_uploads_with_delimiter: {
2519
- Args: {
2520
- bucket_id: string
2521
- prefix_param: string
2522
- delimiter_param: string
2523
- max_keys?: number
2524
- next_key_token?: string
2525
- next_upload_token?: string
2526
- }
2527
- Returns: {
2528
- key: string
2529
- id: string
2530
- created_at: string
2531
- }[]
2532
- }
2533
- list_objects_with_delimiter: {
2534
- Args: {
2535
- bucket_id: string
2536
- prefix_param: string
2537
- delimiter_param: string
2538
- max_keys?: number
2539
- start_after?: string
2540
- next_token?: string
2541
- }
2542
- Returns: {
2543
- name: string
2544
- id: string
2545
- metadata: Json
2546
- updated_at: string
2547
- }[]
2548
- }
2549
- operation: {
2550
- Args: Record<PropertyKey, never>
2551
- Returns: string
2552
- }
2553
- search: {
2554
- Args: {
2555
- prefix: string
2556
- bucketname: string
2557
- limits?: number
2558
- levels?: number
2559
- offsets?: number
2560
- search?: string
2561
- sortcolumn?: string
2562
- sortorder?: string
2563
- }
2564
- Returns: {
2565
- name: string
2566
- id: string
2567
- updated_at: string
2568
- created_at: string
2569
- last_accessed_at: string
2570
- metadata: Json
2571
- }[]
2572
- }
2573
- }
2574
- Enums: {
2575
- [_ in never]: never
2576
- }
2577
- CompositeTypes: {
2578
- [_ in never]: never
2579
- }
2580
- }
2581
- }
2582
-
2583
- type PublicSchema = Database[Extract<keyof Database, "public">]
2584
-
2585
- export type Tables<
2586
- PublicTableNameOrOptions extends
2587
- | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
2588
- | { schema: keyof Database },
2589
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2590
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2591
- Database[PublicTableNameOrOptions["schema"]]["Views"])
2592
- : never = never,
2593
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2594
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2595
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2596
- Row: infer R
2597
- }
2598
- ? R
2599
- : never
2600
- : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
2601
- PublicSchema["Views"])
2602
- ? (PublicSchema["Tables"] &
2603
- PublicSchema["Views"])[PublicTableNameOrOptions] extends {
2604
- Row: infer R
2605
- }
2606
- ? R
2607
- : never
2608
- : never
2609
-
2610
- export type TablesInsert<
2611
- PublicTableNameOrOptions extends
2612
- | keyof PublicSchema["Tables"]
2613
- | { schema: keyof Database },
2614
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2615
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2616
- : never = never,
2617
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2618
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2619
- Insert: infer I
2620
- }
2621
- ? I
2622
- : never
2623
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2624
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2625
- Insert: infer I
2626
- }
2627
- ? I
2628
- : never
2629
- : never
2630
-
2631
- export type TablesUpdate<
2632
- PublicTableNameOrOptions extends
2633
- | keyof PublicSchema["Tables"]
2634
- | { schema: keyof Database },
2635
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2636
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2637
- : never = never,
2638
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2639
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2640
- Update: infer U
2641
- }
2642
- ? U
2643
- : never
2644
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2645
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2646
- Update: infer U
2647
- }
2648
- ? U
2649
- : never
2650
- : never
2651
-
2652
- export type Enums<
2653
- PublicEnumNameOrOptions extends
2654
- | keyof PublicSchema["Enums"]
2655
- | { schema: keyof Database },
2656
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2657
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
2658
- : never = never,
2659
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
2660
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
2661
- : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
2662
- ? PublicSchema["Enums"][PublicEnumNameOrOptions]
2663
- : never
2664
-
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
+ closed_at: number | null
745
+ custom_properties: Json | null
746
+ flag_count_map: Json | null
747
+ hubspot_metadata: Json | null
748
+ label_ids: Json | null
749
+ latest_message_timestamp: string | null
750
+ org_id: string
751
+ unread_count: Json | null
752
+ unread_count_map: Json | null
753
+ updated_at: string | null
754
+ }
755
+ Insert: {
756
+ assigned_to?: string | null
757
+ chat_access?: Json | null
758
+ chat_id: string
759
+ chat_image?: string | null
760
+ chat_name?: string | null
761
+ chat_org_phones?: string[]
762
+ chat_type?: string | null
763
+ closed_at?: number | null
764
+ custom_properties?: Json | null
765
+ flag_count_map?: Json | null
766
+ hubspot_metadata?: Json | null
767
+ label_ids?: Json | null
768
+ latest_message_timestamp?: string | null
769
+ org_id: string
770
+ unread_count?: Json | null
771
+ unread_count_map?: Json | null
772
+ updated_at?: string | null
773
+ }
774
+ Update: {
775
+ assigned_to?: string | null
776
+ chat_access?: Json | null
777
+ chat_id?: string
778
+ chat_image?: string | null
779
+ chat_name?: string | null
780
+ chat_org_phones?: string[]
781
+ chat_type?: string | null
782
+ closed_at?: number | null
783
+ custom_properties?: Json | null
784
+ flag_count_map?: Json | null
785
+ hubspot_metadata?: Json | null
786
+ label_ids?: Json | null
787
+ latest_message_timestamp?: string | null
788
+ org_id?: string
789
+ unread_count?: Json | null
790
+ unread_count_map?: Json | null
791
+ updated_at?: string | null
792
+ }
793
+ Relationships: []
794
+ }
795
+ tbl_chat_reactions: {
796
+ Row: {
797
+ ack: number | null
798
+ chat_id: string | null
799
+ id: Json | null
800
+ message_id: string
801
+ msg_id: Json | null
802
+ org_id: string
803
+ org_phone: string
804
+ orphan: number | null
805
+ orphan_reason: string | null
806
+ reaction: string | null
807
+ reaction_id: string
808
+ read: boolean | null
809
+ sender_id: string
810
+ timestamp: string | null
811
+ unique_id: string | null
812
+ }
813
+ Insert: {
814
+ ack?: number | null
815
+ chat_id?: string | null
816
+ id?: Json | null
817
+ message_id: string
818
+ msg_id?: Json | null
819
+ org_id: string
820
+ org_phone: string
821
+ orphan?: number | null
822
+ orphan_reason?: string | null
823
+ reaction?: string | null
824
+ reaction_id: string
825
+ read?: boolean | null
826
+ sender_id: string
827
+ timestamp?: string | null
828
+ unique_id?: string | null
829
+ }
830
+ Update: {
831
+ ack?: number | null
832
+ chat_id?: string | null
833
+ id?: Json | null
834
+ message_id?: string
835
+ msg_id?: Json | null
836
+ org_id?: string
837
+ org_phone?: string
838
+ orphan?: number | null
839
+ orphan_reason?: string | null
840
+ reaction?: string | null
841
+ reaction_id?: string
842
+ read?: boolean | null
843
+ sender_id?: string
844
+ timestamp?: string | null
845
+ unique_id?: string | null
846
+ }
847
+ Relationships: []
848
+ }
849
+ tbl_chat_tickets: {
850
+ Row: {
851
+ assigned_by: string | null
852
+ assignee: string | null
853
+ chat_id: string
854
+ close_ticket_metadata: Json | null
855
+ closed_at: string | null
856
+ created_at: string
857
+ custom_properties: Json | null
858
+ due_date: string | null
859
+ freshdesk_metadata: Json | null
860
+ hubspot_metadata: Json | null
861
+ is_deleted: boolean
862
+ label_ids: Json | null
863
+ last_updated_at: string
864
+ org_id: string
865
+ priority: number | null
866
+ quoted_message_id: string | null
867
+ raised_by: string | null
868
+ response_time: number | null
869
+ status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
870
+ subject: string
871
+ ticket_id: string
872
+ zohodesk_metadata: Json | null
873
+ }
874
+ Insert: {
875
+ assigned_by?: string | null
876
+ assignee?: string | null
877
+ chat_id: string
878
+ close_ticket_metadata?: Json | null
879
+ closed_at?: string | null
880
+ created_at?: string
881
+ custom_properties?: Json | null
882
+ due_date?: string | null
883
+ freshdesk_metadata?: Json | null
884
+ hubspot_metadata?: Json | null
885
+ is_deleted?: boolean
886
+ label_ids?: Json | null
887
+ last_updated_at?: string
888
+ org_id: string
889
+ priority?: number | null
890
+ quoted_message_id?: string | null
891
+ raised_by?: string | null
892
+ response_time?: number | null
893
+ status?:
894
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
895
+ | null
896
+ subject: string
897
+ ticket_id?: string
898
+ zohodesk_metadata?: Json | null
899
+ }
900
+ Update: {
901
+ assigned_by?: string | null
902
+ assignee?: string | null
903
+ chat_id?: string
904
+ close_ticket_metadata?: Json | null
905
+ closed_at?: string | null
906
+ created_at?: string
907
+ custom_properties?: Json | null
908
+ due_date?: string | null
909
+ freshdesk_metadata?: Json | null
910
+ hubspot_metadata?: Json | null
911
+ is_deleted?: boolean
912
+ label_ids?: Json | null
913
+ last_updated_at?: string
914
+ org_id?: string
915
+ priority?: number | null
916
+ quoted_message_id?: string | null
917
+ raised_by?: string | null
918
+ response_time?: number | null
919
+ status?:
920
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
921
+ | null
922
+ subject?: string
923
+ ticket_id?: string
924
+ zohodesk_metadata?: Json | null
925
+ }
926
+ Relationships: [
927
+ {
928
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
929
+ columns: ["org_id"]
930
+ isOneToOne: false
931
+ referencedRelation: "tbl_org"
932
+ referencedColumns: ["org_id"]
933
+ },
934
+ {
935
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
936
+ columns: ["org_id"]
937
+ isOneToOne: false
938
+ referencedRelation: "view_org"
939
+ referencedColumns: ["org_id"]
940
+ },
941
+ ]
942
+ }
943
+ tbl_chats: {
944
+ Row: {
945
+ archived: boolean | null
946
+ chat_id: string
947
+ chat_image: string | null
948
+ chat_name: string | null
949
+ chat_type: string | null
950
+ created_at: string
951
+ group_metadata: Json | null
952
+ id: Json | null
953
+ invite_link: string | null
954
+ is_exited: boolean | null
955
+ is_group: boolean | null
956
+ is_muted: boolean | null
957
+ is_read_only: boolean | null
958
+ latest_message: Json | null
959
+ member_count: number | null
960
+ mute_expiration: number | null
961
+ name: string | null
962
+ org_id: string
963
+ org_phone: string
964
+ pinned: boolean | null
965
+ timestamp: string | null
966
+ unread_count: number | null
967
+ updated_at: string
968
+ }
969
+ Insert: {
970
+ archived?: boolean | null
971
+ chat_id: string
972
+ chat_image?: string | null
973
+ chat_name?: string | null
974
+ chat_type?: string | null
975
+ created_at?: string
976
+ group_metadata?: Json | null
977
+ id?: Json | null
978
+ invite_link?: string | null
979
+ is_exited?: boolean | null
980
+ is_group?: boolean | null
981
+ is_muted?: boolean | null
982
+ is_read_only?: boolean | null
983
+ latest_message?: Json | null
984
+ member_count?: number | null
985
+ mute_expiration?: number | null
986
+ name?: string | null
987
+ org_id: string
988
+ org_phone: string
989
+ pinned?: boolean | null
990
+ timestamp?: string | null
991
+ unread_count?: number | null
992
+ updated_at?: string
993
+ }
994
+ Update: {
995
+ archived?: boolean | null
996
+ chat_id?: string
997
+ chat_image?: string | null
998
+ chat_name?: string | null
999
+ chat_type?: string | null
1000
+ created_at?: string
1001
+ group_metadata?: Json | null
1002
+ id?: Json | null
1003
+ invite_link?: string | null
1004
+ is_exited?: boolean | null
1005
+ is_group?: boolean | null
1006
+ is_muted?: boolean | null
1007
+ is_read_only?: boolean | null
1008
+ latest_message?: Json | null
1009
+ member_count?: number | null
1010
+ mute_expiration?: number | null
1011
+ name?: string | null
1012
+ org_id?: string
1013
+ org_phone?: string
1014
+ pinned?: boolean | null
1015
+ timestamp?: string | null
1016
+ unread_count?: number | null
1017
+ updated_at?: string
1018
+ }
1019
+ Relationships: []
1020
+ }
1021
+ tbl_contacts: {
1022
+ Row: {
1023
+ business_profile: Json | null
1024
+ contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
1025
+ contact_id: string
1026
+ contact_image: string | null
1027
+ contact_name: string | null
1028
+ contact_type: string | null
1029
+ id: Json | null
1030
+ is_blocked: boolean | null
1031
+ is_business: boolean | null
1032
+ is_enterprise: boolean | null
1033
+ is_group: boolean | null
1034
+ is_imported: boolean | null
1035
+ is_internal: boolean | null
1036
+ is_me: boolean | null
1037
+ is_my_contact: boolean | null
1038
+ is_user: boolean | null
1039
+ is_wa_contact: boolean | null
1040
+ label_ids: Json
1041
+ name: string | null
1042
+ number: string | null
1043
+ org_id: string
1044
+ periskope_name: string | null
1045
+ pushname: string | null
1046
+ short_name: string | null
1047
+ updated_at: string | null
1048
+ verified_level: number | null
1049
+ verified_name: string | null
1050
+ }
1051
+ Insert: {
1052
+ business_profile?: Json | null
1053
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1054
+ contact_id: string
1055
+ contact_image?: string | null
1056
+ contact_name?: string | null
1057
+ contact_type?: string | null
1058
+ id?: Json | null
1059
+ is_blocked?: boolean | null
1060
+ is_business?: boolean | null
1061
+ is_enterprise?: boolean | null
1062
+ is_group?: boolean | null
1063
+ is_imported?: boolean | null
1064
+ is_internal?: boolean | null
1065
+ is_me?: boolean | null
1066
+ is_my_contact?: boolean | null
1067
+ is_user?: boolean | null
1068
+ is_wa_contact?: boolean | null
1069
+ label_ids?: Json
1070
+ name?: string | null
1071
+ number?: string | null
1072
+ org_id: string
1073
+ periskope_name?: string | null
1074
+ pushname?: string | null
1075
+ short_name?: string | null
1076
+ updated_at?: string | null
1077
+ verified_level?: number | null
1078
+ verified_name?: string | null
1079
+ }
1080
+ Update: {
1081
+ business_profile?: Json | null
1082
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
1083
+ contact_id?: string
1084
+ contact_image?: string | null
1085
+ contact_name?: string | null
1086
+ contact_type?: string | null
1087
+ id?: Json | null
1088
+ is_blocked?: boolean | null
1089
+ is_business?: boolean | null
1090
+ is_enterprise?: boolean | null
1091
+ is_group?: boolean | null
1092
+ is_imported?: boolean | null
1093
+ is_internal?: boolean | null
1094
+ is_me?: boolean | null
1095
+ is_my_contact?: boolean | null
1096
+ is_user?: boolean | null
1097
+ is_wa_contact?: boolean | null
1098
+ label_ids?: Json
1099
+ name?: string | null
1100
+ number?: string | null
1101
+ org_id?: string
1102
+ periskope_name?: string | null
1103
+ pushname?: string | null
1104
+ short_name?: string | null
1105
+ updated_at?: string | null
1106
+ verified_level?: number | null
1107
+ verified_name?: string | null
1108
+ }
1109
+ Relationships: [
1110
+ {
1111
+ foreignKeyName: "tbl_contacts_org_id_fkey"
1112
+ columns: ["org_id"]
1113
+ isOneToOne: false
1114
+ referencedRelation: "tbl_org"
1115
+ referencedColumns: ["org_id"]
1116
+ },
1117
+ {
1118
+ foreignKeyName: "tbl_contacts_org_id_fkey"
1119
+ columns: ["org_id"]
1120
+ isOneToOne: false
1121
+ referencedRelation: "view_org"
1122
+ referencedColumns: ["org_id"]
1123
+ },
1124
+ ]
1125
+ }
1126
+ tbl_custom_properties: {
1127
+ Row: {
1128
+ created_at: string
1129
+ created_by: string | null
1130
+ org_id: string | null
1131
+ property_id: string
1132
+ property_name: string
1133
+ property_value: Json | null
1134
+ property_value_type: string | null
1135
+ type: string | null
1136
+ }
1137
+ Insert: {
1138
+ created_at?: string
1139
+ created_by?: string | null
1140
+ org_id?: string | null
1141
+ property_id?: string
1142
+ property_name: string
1143
+ property_value?: Json | null
1144
+ property_value_type?: string | null
1145
+ type?: string | null
1146
+ }
1147
+ Update: {
1148
+ created_at?: string
1149
+ created_by?: string | null
1150
+ org_id?: string | null
1151
+ property_id?: string
1152
+ property_name?: string
1153
+ property_value?: Json | null
1154
+ property_value_type?: string | null
1155
+ type?: string | null
1156
+ }
1157
+ Relationships: [
1158
+ {
1159
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
1160
+ columns: ["org_id"]
1161
+ isOneToOne: false
1162
+ referencedRelation: "tbl_org"
1163
+ referencedColumns: ["org_id"]
1164
+ },
1165
+ {
1166
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
1167
+ columns: ["org_id"]
1168
+ isOneToOne: false
1169
+ referencedRelation: "view_org"
1170
+ referencedColumns: ["org_id"]
1171
+ },
1172
+ ]
1173
+ }
1174
+ tbl_integration_hooks: {
1175
+ Row: {
1176
+ hook_url: string
1177
+ id: string
1178
+ integration_id: string | null
1179
+ integration_metadata: Json
1180
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1181
+ integration_type: string
1182
+ is_subscribed: boolean
1183
+ org_id: string
1184
+ subscribed_at: string
1185
+ type: Database["public"]["Enums"]["enum_integration_type"]
1186
+ }
1187
+ Insert: {
1188
+ hook_url: string
1189
+ id?: string
1190
+ integration_id?: string | null
1191
+ integration_metadata: Json
1192
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1193
+ integration_type: string
1194
+ is_subscribed: boolean
1195
+ org_id: string
1196
+ subscribed_at?: string
1197
+ type: Database["public"]["Enums"]["enum_integration_type"]
1198
+ }
1199
+ Update: {
1200
+ hook_url?: string
1201
+ id?: string
1202
+ integration_id?: string | null
1203
+ integration_metadata?: Json
1204
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1205
+ integration_type?: string
1206
+ is_subscribed?: boolean
1207
+ org_id?: string
1208
+ subscribed_at?: string
1209
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1210
+ }
1211
+ Relationships: [
1212
+ {
1213
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1214
+ columns: ["org_id"]
1215
+ isOneToOne: false
1216
+ referencedRelation: "tbl_org"
1217
+ referencedColumns: ["org_id"]
1218
+ },
1219
+ {
1220
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
1221
+ columns: ["org_id"]
1222
+ isOneToOne: false
1223
+ referencedRelation: "view_org"
1224
+ referencedColumns: ["org_id"]
1225
+ },
1226
+ ]
1227
+ }
1228
+ tbl_integration_logs: {
1229
+ Row: {
1230
+ created_at: string
1231
+ id: string
1232
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1233
+ integration_type: string
1234
+ metadata: Json
1235
+ org_id: string
1236
+ response: Json | null
1237
+ success: boolean
1238
+ type: Database["public"]["Enums"]["enum_integration_type"]
1239
+ }
1240
+ Insert: {
1241
+ created_at?: string
1242
+ id?: string
1243
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
1244
+ integration_type: string
1245
+ metadata?: Json
1246
+ org_id: string
1247
+ response?: Json | null
1248
+ success?: boolean
1249
+ type: Database["public"]["Enums"]["enum_integration_type"]
1250
+ }
1251
+ Update: {
1252
+ created_at?: string
1253
+ id?: string
1254
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
1255
+ integration_type?: string
1256
+ metadata?: Json
1257
+ org_id?: string
1258
+ response?: Json | null
1259
+ success?: boolean
1260
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1261
+ }
1262
+ Relationships: [
1263
+ {
1264
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
1265
+ columns: ["org_id"]
1266
+ isOneToOne: false
1267
+ referencedRelation: "tbl_org"
1268
+ referencedColumns: ["org_id"]
1269
+ },
1270
+ {
1271
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
1272
+ columns: ["org_id"]
1273
+ isOneToOne: false
1274
+ referencedRelation: "view_org"
1275
+ referencedColumns: ["org_id"]
1276
+ },
1277
+ ]
1278
+ }
1279
+ tbl_integration_tokens: {
1280
+ Row: {
1281
+ exp: string
1282
+ iat: string
1283
+ id: string
1284
+ is_revealed: boolean
1285
+ name: string
1286
+ org_id: string
1287
+ role: string
1288
+ token: string
1289
+ token_metadata: Json | null
1290
+ type: Database["public"]["Enums"]["enum_integration_type"]
1291
+ }
1292
+ Insert: {
1293
+ exp: string
1294
+ iat: string
1295
+ id?: string
1296
+ is_revealed?: boolean
1297
+ name: string
1298
+ org_id: string
1299
+ role: string
1300
+ token: string
1301
+ token_metadata?: Json | null
1302
+ type: Database["public"]["Enums"]["enum_integration_type"]
1303
+ }
1304
+ Update: {
1305
+ exp?: string
1306
+ iat?: string
1307
+ id?: string
1308
+ is_revealed?: boolean
1309
+ name?: string
1310
+ org_id?: string
1311
+ role?: string
1312
+ token?: string
1313
+ token_metadata?: Json | null
1314
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1315
+ }
1316
+ Relationships: [
1317
+ {
1318
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1319
+ columns: ["org_id"]
1320
+ isOneToOne: false
1321
+ referencedRelation: "tbl_org"
1322
+ referencedColumns: ["org_id"]
1323
+ },
1324
+ {
1325
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1326
+ columns: ["org_id"]
1327
+ isOneToOne: false
1328
+ referencedRelation: "view_org"
1329
+ referencedColumns: ["org_id"]
1330
+ },
1331
+ ]
1332
+ }
1333
+ tbl_org: {
1334
+ Row: {
1335
+ created_at: string
1336
+ org_id: string
1337
+ org_image: string | null
1338
+ org_metadata: Json | null
1339
+ org_name: string | null
1340
+ org_plan: Json | null
1341
+ stripe_customer_details: Json | null
1342
+ stripe_customer_id: string | null
1343
+ stripe_subscription_details: Json | null
1344
+ support_link: string | null
1345
+ }
1346
+ Insert: {
1347
+ created_at?: string
1348
+ org_id?: string
1349
+ org_image?: string | null
1350
+ org_metadata?: Json | null
1351
+ org_name?: string | null
1352
+ org_plan?: Json | null
1353
+ stripe_customer_details?: Json | null
1354
+ stripe_customer_id?: string | null
1355
+ stripe_subscription_details?: Json | null
1356
+ support_link?: string | null
1357
+ }
1358
+ Update: {
1359
+ created_at?: string
1360
+ org_id?: string
1361
+ org_image?: string | null
1362
+ org_metadata?: Json | null
1363
+ org_name?: string | null
1364
+ org_plan?: Json | null
1365
+ stripe_customer_details?: Json | null
1366
+ stripe_customer_id?: string | null
1367
+ stripe_subscription_details?: Json | null
1368
+ support_link?: string | null
1369
+ }
1370
+ Relationships: []
1371
+ }
1372
+ tbl_org_labels: {
1373
+ Row: {
1374
+ color: string
1375
+ created_at: string
1376
+ label_id: string
1377
+ name: string
1378
+ org_id: string
1379
+ type: string
1380
+ }
1381
+ Insert: {
1382
+ color?: string
1383
+ created_at?: string
1384
+ label_id?: string
1385
+ name: string
1386
+ org_id: string
1387
+ type?: string
1388
+ }
1389
+ Update: {
1390
+ color?: string
1391
+ created_at?: string
1392
+ label_id?: string
1393
+ name?: string
1394
+ org_id?: string
1395
+ type?: string
1396
+ }
1397
+ Relationships: [
1398
+ {
1399
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1400
+ columns: ["org_id"]
1401
+ isOneToOne: false
1402
+ referencedRelation: "tbl_org"
1403
+ referencedColumns: ["org_id"]
1404
+ },
1405
+ {
1406
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1407
+ columns: ["org_id"]
1408
+ isOneToOne: false
1409
+ referencedRelation: "view_org"
1410
+ referencedColumns: ["org_id"]
1411
+ },
1412
+ ]
1413
+ }
1414
+ tbl_org_members: {
1415
+ Row: {
1416
+ created_at: string | null
1417
+ email: string
1418
+ invited_at: string | null
1419
+ invited_by: string | null
1420
+ is_active: boolean
1421
+ is_owner: boolean | null
1422
+ label_ids: string[] | null
1423
+ member_color: Database["public"]["Enums"]["enum_chat_colors"]
1424
+ member_image: string | null
1425
+ member_name: string | null
1426
+ org_id: string
1427
+ org_phones: string[] | null
1428
+ preferences: Json
1429
+ role: Database["public"]["Enums"]["enum_member_role"]
1430
+ user_id: string | null
1431
+ }
1432
+ Insert: {
1433
+ created_at?: string | null
1434
+ email: string
1435
+ invited_at?: string | null
1436
+ invited_by?: string | null
1437
+ is_active?: boolean
1438
+ is_owner?: boolean | null
1439
+ label_ids?: string[] | null
1440
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1441
+ member_image?: string | null
1442
+ member_name?: string | null
1443
+ org_id: string
1444
+ org_phones?: string[] | null
1445
+ preferences?: Json
1446
+ role?: Database["public"]["Enums"]["enum_member_role"]
1447
+ user_id?: string | null
1448
+ }
1449
+ Update: {
1450
+ created_at?: string | null
1451
+ email?: string
1452
+ invited_at?: string | null
1453
+ invited_by?: string | null
1454
+ is_active?: boolean
1455
+ is_owner?: boolean | null
1456
+ label_ids?: string[] | null
1457
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1458
+ member_image?: string | null
1459
+ member_name?: string | null
1460
+ org_id?: string
1461
+ org_phones?: string[] | null
1462
+ preferences?: Json
1463
+ role?: Database["public"]["Enums"]["enum_member_role"]
1464
+ user_id?: string | null
1465
+ }
1466
+ Relationships: [
1467
+ {
1468
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
1469
+ columns: ["user_id"]
1470
+ isOneToOne: false
1471
+ referencedRelation: "users"
1472
+ referencedColumns: ["id"]
1473
+ },
1474
+ {
1475
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1476
+ columns: ["org_id"]
1477
+ isOneToOne: false
1478
+ referencedRelation: "tbl_org"
1479
+ referencedColumns: ["org_id"]
1480
+ },
1481
+ {
1482
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1483
+ columns: ["org_id"]
1484
+ isOneToOne: false
1485
+ referencedRelation: "view_org"
1486
+ referencedColumns: ["org_id"]
1487
+ },
1488
+ ]
1489
+ }
1490
+ tbl_org_phones: {
1491
+ Row: {
1492
+ created_at: string
1493
+ first_connected_at: string | null
1494
+ is_browser_open: boolean
1495
+ is_ready: boolean | null
1496
+ legacy_version: boolean | null
1497
+ library: string | null
1498
+ org_id: string
1499
+ org_phone: string | null
1500
+ phone_id: string
1501
+ phone_image: string | null
1502
+ phone_name: string | null
1503
+ phone_state: Json | null
1504
+ qr_code: string | null
1505
+ server_image: string | null
1506
+ server_ip: string | null
1507
+ soft_restart: boolean
1508
+ updated_at: string | null
1509
+ wa_state: string | null
1510
+ wa_version: string | null
1511
+ }
1512
+ Insert: {
1513
+ created_at?: string
1514
+ first_connected_at?: string | null
1515
+ is_browser_open?: boolean
1516
+ is_ready?: boolean | null
1517
+ legacy_version?: boolean | null
1518
+ library?: string | null
1519
+ org_id: string
1520
+ org_phone?: string | null
1521
+ phone_id?: string
1522
+ phone_image?: string | null
1523
+ phone_name?: string | null
1524
+ phone_state?: Json | null
1525
+ qr_code?: string | null
1526
+ server_image?: string | null
1527
+ server_ip?: string | null
1528
+ soft_restart?: boolean
1529
+ updated_at?: string | null
1530
+ wa_state?: string | null
1531
+ wa_version?: string | null
1532
+ }
1533
+ Update: {
1534
+ created_at?: string
1535
+ first_connected_at?: string | null
1536
+ is_browser_open?: boolean
1537
+ is_ready?: boolean | null
1538
+ legacy_version?: boolean | null
1539
+ library?: string | null
1540
+ org_id?: string
1541
+ org_phone?: string | null
1542
+ phone_id?: string
1543
+ phone_image?: string | null
1544
+ phone_name?: string | null
1545
+ phone_state?: Json | null
1546
+ qr_code?: string | null
1547
+ server_image?: string | null
1548
+ server_ip?: string | null
1549
+ soft_restart?: boolean
1550
+ updated_at?: string | null
1551
+ wa_state?: string | null
1552
+ wa_version?: string | null
1553
+ }
1554
+ Relationships: [
1555
+ {
1556
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1557
+ columns: ["org_id"]
1558
+ isOneToOne: false
1559
+ referencedRelation: "tbl_org"
1560
+ referencedColumns: ["org_id"]
1561
+ },
1562
+ {
1563
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1564
+ columns: ["org_id"]
1565
+ isOneToOne: false
1566
+ referencedRelation: "view_org"
1567
+ referencedColumns: ["org_id"]
1568
+ },
1569
+ {
1570
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1571
+ columns: ["org_id"]
1572
+ isOneToOne: false
1573
+ referencedRelation: "tbl_org"
1574
+ referencedColumns: ["org_id"]
1575
+ },
1576
+ {
1577
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1578
+ columns: ["org_id"]
1579
+ isOneToOne: false
1580
+ referencedRelation: "view_org"
1581
+ referencedColumns: ["org_id"]
1582
+ },
1583
+ ]
1584
+ }
1585
+ tbl_org_transactions: {
1586
+ Row: {
1587
+ amount: number
1588
+ is_top_up: boolean | null
1589
+ org_id: string
1590
+ timestamp: string | null
1591
+ transaction_id: string
1592
+ transaction_metadata: Json | null
1593
+ transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1594
+ usage_metadata: Json | null
1595
+ }
1596
+ Insert: {
1597
+ amount: number
1598
+ is_top_up?: boolean | null
1599
+ org_id: string
1600
+ timestamp?: string | null
1601
+ transaction_id?: string
1602
+ transaction_metadata?: Json | null
1603
+ transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"]
1604
+ usage_metadata?: Json | null
1605
+ }
1606
+ Update: {
1607
+ amount?: number
1608
+ is_top_up?: boolean | null
1609
+ org_id?: string
1610
+ timestamp?: string | null
1611
+ transaction_id?: string
1612
+ transaction_metadata?: Json | null
1613
+ transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"]
1614
+ usage_metadata?: Json | null
1615
+ }
1616
+ Relationships: [
1617
+ {
1618
+ foreignKeyName: "tbl_org_transactions_org_id_fkey"
1619
+ columns: ["org_id"]
1620
+ isOneToOne: false
1621
+ referencedRelation: "tbl_org"
1622
+ referencedColumns: ["org_id"]
1623
+ },
1624
+ {
1625
+ foreignKeyName: "tbl_org_transactions_org_id_fkey"
1626
+ columns: ["org_id"]
1627
+ isOneToOne: false
1628
+ referencedRelation: "view_org"
1629
+ referencedColumns: ["org_id"]
1630
+ },
1631
+ ]
1632
+ }
1633
+ tbl_quick_replies: {
1634
+ Row: {
1635
+ command: string | null
1636
+ created_at: string
1637
+ message_payload: Json | null
1638
+ org_id: string
1639
+ reply_id: string
1640
+ }
1641
+ Insert: {
1642
+ command?: string | null
1643
+ created_at?: string
1644
+ message_payload?: Json | null
1645
+ org_id: string
1646
+ reply_id?: string
1647
+ }
1648
+ Update: {
1649
+ command?: string | null
1650
+ created_at?: string
1651
+ message_payload?: Json | null
1652
+ org_id?: string
1653
+ reply_id?: string
1654
+ }
1655
+ Relationships: [
1656
+ {
1657
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1658
+ columns: ["org_id"]
1659
+ isOneToOne: false
1660
+ referencedRelation: "tbl_org"
1661
+ referencedColumns: ["org_id"]
1662
+ },
1663
+ {
1664
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1665
+ columns: ["org_id"]
1666
+ isOneToOne: false
1667
+ referencedRelation: "view_org"
1668
+ referencedColumns: ["org_id"]
1669
+ },
1670
+ ]
1671
+ }
1672
+ tbl_scheduled_messages: {
1673
+ Row: {
1674
+ chat_id: string
1675
+ created_at: string
1676
+ message_id: string | null
1677
+ message_payload: Json | null
1678
+ org_id: string
1679
+ org_phone: string | null
1680
+ performed_by: string | null
1681
+ scheduled_at: string
1682
+ sent_message_id: string
1683
+ status: boolean | null
1684
+ updated_at: string | null
1685
+ }
1686
+ Insert: {
1687
+ chat_id: string
1688
+ created_at?: string
1689
+ message_id?: string | null
1690
+ message_payload?: Json | null
1691
+ org_id: string
1692
+ org_phone?: string | null
1693
+ performed_by?: string | null
1694
+ scheduled_at: string
1695
+ sent_message_id: string
1696
+ status?: boolean | null
1697
+ updated_at?: string | null
1698
+ }
1699
+ Update: {
1700
+ chat_id?: string
1701
+ created_at?: string
1702
+ message_id?: string | null
1703
+ message_payload?: Json | null
1704
+ org_id?: string
1705
+ org_phone?: string | null
1706
+ performed_by?: string | null
1707
+ scheduled_at?: string
1708
+ sent_message_id?: string
1709
+ status?: boolean | null
1710
+ updated_at?: string | null
1711
+ }
1712
+ Relationships: [
1713
+ {
1714
+ foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1715
+ columns: ["org_id"]
1716
+ isOneToOne: false
1717
+ referencedRelation: "tbl_org"
1718
+ referencedColumns: ["org_id"]
1719
+ },
1720
+ {
1721
+ foreignKeyName: "tbl_scheduled_messages_org_id_fkey"
1722
+ columns: ["org_id"]
1723
+ isOneToOne: false
1724
+ referencedRelation: "view_org"
1725
+ referencedColumns: ["org_id"]
1726
+ },
1727
+ ]
1728
+ }
1729
+ tbl_tools_whatsapp_links: {
1730
+ Row: {
1731
+ created_at: string
1732
+ link_id: string
1733
+ link_name: string
1734
+ message: string | null
1735
+ phone: string
1736
+ }
1737
+ Insert: {
1738
+ created_at?: string
1739
+ link_id?: string
1740
+ link_name: string
1741
+ message?: string | null
1742
+ phone: string
1743
+ }
1744
+ Update: {
1745
+ created_at?: string
1746
+ link_id?: string
1747
+ link_name?: string
1748
+ message?: string | null
1749
+ phone?: string
1750
+ }
1751
+ Relationships: []
1752
+ }
1753
+ }
1754
+ Views: {
1755
+ view_broadcast_logs: {
1756
+ Row: {
1757
+ broadcast_id: string | null
1758
+ broadcast_status:
1759
+ | Database["public"]["Enums"]["enum_broadcast_status"]
1760
+ | null
1761
+ created_at: string | null
1762
+ delivered_percentage: number | null
1763
+ failed_chats: number | null
1764
+ message_payload: Json | null
1765
+ org_id: string | null
1766
+ pending_chats: number | null
1767
+ performed_at: string | null
1768
+ performed_by: string | null
1769
+ read_percentage: number | null
1770
+ scheduled_at: string | null
1771
+ sent_chats: number | null
1772
+ total_chats: number | null
1773
+ total_delivered_count: number | null
1774
+ total_member_count: number | null
1775
+ total_read_count: number | null
1776
+ }
1777
+ Relationships: [
1778
+ {
1779
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1780
+ columns: ["org_id"]
1781
+ isOneToOne: false
1782
+ referencedRelation: "tbl_org"
1783
+ referencedColumns: ["org_id"]
1784
+ },
1785
+ {
1786
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1787
+ columns: ["org_id"]
1788
+ isOneToOne: false
1789
+ referencedRelation: "view_org"
1790
+ referencedColumns: ["org_id"]
1791
+ },
1792
+ ]
1793
+ }
1794
+ view_chat_logs: {
1795
+ Row: {
1796
+ action: string | null
1797
+ failed: number | null
1798
+ operation_id: string | null
1799
+ org_id: string | null
1800
+ pending: number | null
1801
+ performed_at: string | null
1802
+ performed_by: string | null
1803
+ success: number | null
1804
+ total_chats: number | null
1805
+ total_logs: number | null
1806
+ total_participants: number | null
1807
+ }
1808
+ Relationships: [
1809
+ {
1810
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
1811
+ columns: ["org_id"]
1812
+ isOneToOne: false
1813
+ referencedRelation: "tbl_org"
1814
+ referencedColumns: ["org_id"]
1815
+ },
1816
+ {
1817
+ foreignKeyName: "tbl_chat_logs_org_id_fkey"
1818
+ columns: ["org_id"]
1819
+ isOneToOne: false
1820
+ referencedRelation: "view_org"
1821
+ referencedColumns: ["org_id"]
1822
+ },
1823
+ ]
1824
+ }
1825
+ view_chats: {
1826
+ Row: {
1827
+ assigned_to: string | null
1828
+ chat_access: Json | null
1829
+ chat_id: string | null
1830
+ chat_image: string | null
1831
+ chat_name: string | null
1832
+ chat_org_phones: string[] | null
1833
+ chat_type: string | null
1834
+ created_at: string | null
1835
+ custom_properties: Json | null
1836
+ flag_count_map: Json | null
1837
+ group_description: string | null
1838
+ hubspot_metadata: Json | null
1839
+ info_admins_only: boolean | null
1840
+ invite_link: string | null
1841
+ is_exited: boolean | null
1842
+ is_muted: boolean | null
1843
+ label_ids: Json | null
1844
+ latest_message: Json | null
1845
+ member_add_mode: string | null
1846
+ member_count: number | null
1847
+ message_unread_count: number | null
1848
+ messages_admins_only: boolean | null
1849
+ org_id: string | null
1850
+ org_phone: string | null
1851
+ updated_at: string | null
1852
+ }
1853
+ Relationships: []
1854
+ }
1855
+ view_org: {
1856
+ Row: {
1857
+ access_scopes: Json | null
1858
+ created_at: string | null
1859
+ is_enterprise: boolean | null
1860
+ is_free_trial: boolean | null
1861
+ is_freshdesk_connected: boolean | null
1862
+ is_hubspot_connected: boolean | null
1863
+ is_zohodesk_connected: boolean | null
1864
+ org_id: string | null
1865
+ org_image: string | null
1866
+ org_metadata: Json | null
1867
+ org_name: string | null
1868
+ org_plan: Json | null
1869
+ pending_days: number | null
1870
+ phone_limit: string | null
1871
+ plan_id: string | null
1872
+ stripe_customer_details: Json | null
1873
+ stripe_customer_id: string | null
1874
+ stripe_subscription_details: Json | null
1875
+ subscription_status: string | null
1876
+ support_link: string | null
1877
+ user_limit: string | null
1878
+ }
1879
+ Insert: {
1880
+ access_scopes?: never
1881
+ created_at?: string | null
1882
+ is_enterprise?: never
1883
+ is_free_trial?: never
1884
+ is_freshdesk_connected?: never
1885
+ is_hubspot_connected?: never
1886
+ is_zohodesk_connected?: never
1887
+ org_id?: string | null
1888
+ org_image?: string | null
1889
+ org_metadata?: Json | null
1890
+ org_name?: string | null
1891
+ org_plan?: Json | null
1892
+ pending_days?: never
1893
+ phone_limit?: never
1894
+ plan_id?: never
1895
+ stripe_customer_details?: Json | null
1896
+ stripe_customer_id?: string | null
1897
+ stripe_subscription_details?: Json | null
1898
+ subscription_status?: never
1899
+ support_link?: string | null
1900
+ user_limit?: never
1901
+ }
1902
+ Update: {
1903
+ access_scopes?: never
1904
+ created_at?: string | null
1905
+ is_enterprise?: never
1906
+ is_free_trial?: never
1907
+ is_freshdesk_connected?: never
1908
+ is_hubspot_connected?: never
1909
+ is_zohodesk_connected?: never
1910
+ org_id?: string | null
1911
+ org_image?: string | null
1912
+ org_metadata?: Json | null
1913
+ org_name?: string | null
1914
+ org_plan?: Json | null
1915
+ pending_days?: never
1916
+ phone_limit?: never
1917
+ plan_id?: never
1918
+ stripe_customer_details?: Json | null
1919
+ stripe_customer_id?: string | null
1920
+ stripe_subscription_details?: Json | null
1921
+ subscription_status?: never
1922
+ support_link?: string | null
1923
+ user_limit?: never
1924
+ }
1925
+ Relationships: []
1926
+ }
1927
+ }
1928
+ Functions: {
1929
+ check_feature_flag_access: {
1930
+ Args: {
1931
+ org_id_input: string
1932
+ feature_input: string
1933
+ }
1934
+ Returns: boolean
1935
+ }
1936
+ create_partition: {
1937
+ Args: {
1938
+ org_id_input: string
1939
+ }
1940
+ Returns: boolean
1941
+ }
1942
+ custom_access_token_hook: {
1943
+ Args: {
1944
+ event: Json
1945
+ }
1946
+ Returns: Json
1947
+ }
1948
+ drop_partition: {
1949
+ Args: {
1950
+ org_id_input: string
1951
+ }
1952
+ Returns: boolean
1953
+ }
1954
+ find_discrepancies: {
1955
+ Args: {
1956
+ p_org_id: string
1957
+ }
1958
+ Returns: {
1959
+ a_chat_id: string
1960
+ discrepancy_count: number
1961
+ }[]
1962
+ }
1963
+ gen_id: {
1964
+ Args: {
1965
+ prefix: string
1966
+ size?: number
1967
+ alphabet?: string
1968
+ }
1969
+ Returns: string
1970
+ }
1971
+ gen_ticket_id: {
1972
+ Args: {
1973
+ org_id_input: string
1974
+ }
1975
+ Returns: string
1976
+ }
1977
+ generate_access_token: {
1978
+ Args: {
1979
+ name_input?: string
1980
+ type_input?: Database["public"]["Enums"]["enum_integration_type"]
1981
+ org_id_input?: string
1982
+ }
1983
+ Returns: Json
1984
+ }
1985
+ get_api_auth_details: {
1986
+ Args: {
1987
+ org_id_input?: string
1988
+ org_phone_input?: string
1989
+ token_id_input?: string
1990
+ token_type_input?: Database["public"]["Enums"]["enum_integration_type"]
1991
+ }
1992
+ Returns: Json
1993
+ }
1994
+ get_chat_labels_data: {
1995
+ Args: {
1996
+ org_id_input: string
1997
+ chat_ids_input?: string[]
1998
+ }
1999
+ Returns: Json[]
2000
+ }
2001
+ get_chat_rule_info: {
2002
+ Args: {
2003
+ chat_id_input: string
2004
+ org_id_input: string
2005
+ org_phone_input: string
2006
+ }
2007
+ Returns: Json
2008
+ }
2009
+ get_chats: {
2010
+ Args: {
2011
+ org_id_input: string
2012
+ chat_id_input?: string[]
2013
+ with_members?: boolean
2014
+ last_updated_at?: string
2015
+ batch_limit?: number
2016
+ batch_offset?: number
2017
+ }
2018
+ Returns: Json
2019
+ }
2020
+ get_chats_info: {
2021
+ Args: {
2022
+ chat_id_input: string
2023
+ org_id_input: string
2024
+ org_phone_input?: string
2025
+ }
2026
+ Returns: Json
2027
+ }
2028
+ get_contacts: {
2029
+ Args: {
2030
+ org_id_input: string
2031
+ contact_ids_input?: string[]
2032
+ sync_phone_contacts?: boolean
2033
+ search_input?: string
2034
+ label_ids_input?: string[]
2035
+ is_internal_input?: boolean
2036
+ offset_input?: number
2037
+ limit_input?: number
2038
+ }
2039
+ Returns: Json
2040
+ }
2041
+ get_export_chats_data: {
2042
+ Args: {
2043
+ org_id_input: string
2044
+ chat_id_input?: string[]
2045
+ }
2046
+ Returns: Json
2047
+ }
2048
+ get_export_tickets_data: {
2049
+ Args: {
2050
+ org_id_input: string
2051
+ ticket_id_input?: string[]
2052
+ }
2053
+ Returns: Json
2054
+ }
2055
+ get_feature_flags: {
2056
+ Args: {
2057
+ org_id_input: string
2058
+ }
2059
+ Returns: {
2060
+ feature: string
2061
+ enabled: boolean
2062
+ }[]
2063
+ }
2064
+ get_integration_data: {
2065
+ Args: {
2066
+ org_id_input?: string
2067
+ }
2068
+ Returns: Json
2069
+ }
2070
+ get_message_rule_info: {
2071
+ Args: {
2072
+ message_id_input: string
2073
+ chat_id_input: string
2074
+ org_id_input: string
2075
+ org_phone_input: string
2076
+ sender_id_input: string
2077
+ }
2078
+ Returns: Json
2079
+ }
2080
+ get_messages_notifications_reactions: {
2081
+ Args: {
2082
+ org_id_input: string
2083
+ chat_id_input?: string[]
2084
+ limit_input?: number
2085
+ offset_input?: number
2086
+ }
2087
+ Returns: Json
2088
+ }
2089
+ get_org: {
2090
+ Args: {
2091
+ org_id_input?: string
2092
+ }
2093
+ Returns: Json
2094
+ }
2095
+ get_org_credits: {
2096
+ Args: {
2097
+ org_id_input?: string
2098
+ }
2099
+ Returns: Json
2100
+ }
2101
+ get_org_phones: {
2102
+ Args: {
2103
+ org_id_input?: string
2104
+ phone_id_input?: string
2105
+ }
2106
+ Returns: Json
2107
+ }
2108
+ get_reaction_rule_info: {
2109
+ Args: {
2110
+ reaction_id_input: string
2111
+ message_id_input: string
2112
+ chat_id_input: string
2113
+ org_id_input: string
2114
+ org_phone_input: string
2115
+ sender_id_input: string
2116
+ }
2117
+ Returns: Json
2118
+ }
2119
+ get_team_metrics_between_dates: {
2120
+ Args: {
2121
+ org_id_input: string
2122
+ start_date: string
2123
+ end_date: string
2124
+ chat_id_input?: string[]
2125
+ }
2126
+ Returns: Json
2127
+ }
2128
+ get_ticket_info: {
2129
+ Args: {
2130
+ ticket_id_input?: string
2131
+ org_id_input?: string
2132
+ chat_id_input?: string
2133
+ unique_message_id_input?: string
2134
+ }
2135
+ Returns: Json
2136
+ }
2137
+ get_ticket_rule_info: {
2138
+ Args: {
2139
+ ticket_id_input: string
2140
+ unique_message_id_input: string
2141
+ chat_id_input: string
2142
+ org_id_input: string
2143
+ }
2144
+ Returns: Json
2145
+ }
2146
+ get_universal_search_result: {
2147
+ Args: {
2148
+ search_category_input: string
2149
+ search_query_input: string
2150
+ org_id_input: string
2151
+ }
2152
+ Returns: {
2153
+ category: string
2154
+ result: Json
2155
+ }[]
2156
+ }
2157
+ image_path: {
2158
+ Args: {
2159
+ path_input?: string
2160
+ bucket_name?: string
2161
+ req_base?: boolean
2162
+ }
2163
+ Returns: string
2164
+ }
2165
+ list_org_from_user: {
2166
+ Args: Record<PropertyKey, never>
2167
+ Returns: string[]
2168
+ }
2169
+ list_role_from_user: {
2170
+ Args: Record<PropertyKey, never>
2171
+ Returns: Database["public"]["Enums"]["enum_member_role"]
2172
+ }
2173
+ update_chat_properties: {
2174
+ Args: {
2175
+ column_name: string
2176
+ org_id_input: string
2177
+ chat_id_input: string[]
2178
+ column_value_input?: unknown
2179
+ key_input?: string
2180
+ value_input?: Json
2181
+ }
2182
+ Returns: undefined
2183
+ }
2184
+ update_custom_properties: {
2185
+ Args: {
2186
+ org_id_input: string
2187
+ row_properties_map: Json
2188
+ replace_properties?: boolean
2189
+ }
2190
+ Returns: undefined
2191
+ }
2192
+ update_labels: {
2193
+ Args: {
2194
+ org_id_input: string
2195
+ tbl_type: string
2196
+ row_label_map: Json
2197
+ replace_labels?: boolean
2198
+ }
2199
+ Returns: undefined
2200
+ }
2201
+ }
2202
+ Enums: {
2203
+ enum_broadcast_status: "inprogress" | "completed" | "stopped" | "expired"
2204
+ enum_chat_colors:
2205
+ | "#B4876E"
2206
+ | "#A5B337"
2207
+ | "#06CF9C"
2208
+ | "#25D366"
2209
+ | "#02A698"
2210
+ | "#7D9EF1"
2211
+ | "#007BFC"
2212
+ | "#5E47DE"
2213
+ | "#7F66FF"
2214
+ | "#9333EA"
2215
+ | "#FA6533"
2216
+ | "#C4532D"
2217
+ | "#DC2626"
2218
+ | "#FF2E74"
2219
+ | "#DB2777"
2220
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
2221
+ enum_credit_transaction_type: "credit" | "debit"
2222
+ enum_integration_name:
2223
+ | "org.created"
2224
+ | "org.updated"
2225
+ | "org.member.created"
2226
+ | "org.member.updated"
2227
+ | "org.phone.created"
2228
+ | "org.phone.connected"
2229
+ | "org.phone.disconnected"
2230
+ | "org.subscription.trial_will_end"
2231
+ | "chat.created"
2232
+ | "chat.updated"
2233
+ | "chat.notification.created"
2234
+ | "message.created"
2235
+ | "message.updated"
2236
+ | "message.deleted"
2237
+ | "message.ack.updated"
2238
+ | "reaction.created"
2239
+ | "reaction.updated"
2240
+ | "ticket.created"
2241
+ | "ticket.updated"
2242
+ | "ticket.deleted"
2243
+ | "org.integrations.updated"
2244
+ | "message.flagged"
2245
+ | "message.unflagged"
2246
+ | "chat.label.updated"
2247
+ | "reaction.added"
2248
+ enum_integration_type:
2249
+ | "zapier"
2250
+ | "pabbly"
2251
+ | "api"
2252
+ | "webhook"
2253
+ | "hubspot"
2254
+ | "freshdesk"
2255
+ | "slack"
2256
+ | "jira"
2257
+ | "salesforce"
2258
+ | "zohodesk"
2259
+ | "gsheets"
2260
+ enum_member_role: "admin" | "member"
2261
+ }
2262
+ CompositeTypes: {
2263
+ [_ in never]: never
2264
+ }
2265
+ }
2266
+ storage: {
2267
+ Tables: {
2268
+ buckets: {
2269
+ Row: {
2270
+ allowed_mime_types: string[] | null
2271
+ avif_autodetection: boolean | null
2272
+ created_at: string | null
2273
+ file_size_limit: number | null
2274
+ id: string
2275
+ name: string
2276
+ owner: string | null
2277
+ owner_id: string | null
2278
+ public: boolean | null
2279
+ updated_at: string | null
2280
+ }
2281
+ Insert: {
2282
+ allowed_mime_types?: string[] | null
2283
+ avif_autodetection?: boolean | null
2284
+ created_at?: string | null
2285
+ file_size_limit?: number | null
2286
+ id: string
2287
+ name: string
2288
+ owner?: string | null
2289
+ owner_id?: string | null
2290
+ public?: boolean | null
2291
+ updated_at?: string | null
2292
+ }
2293
+ Update: {
2294
+ allowed_mime_types?: string[] | null
2295
+ avif_autodetection?: boolean | null
2296
+ created_at?: string | null
2297
+ file_size_limit?: number | null
2298
+ id?: string
2299
+ name?: string
2300
+ owner?: string | null
2301
+ owner_id?: string | null
2302
+ public?: boolean | null
2303
+ updated_at?: string | null
2304
+ }
2305
+ Relationships: []
2306
+ }
2307
+ migrations: {
2308
+ Row: {
2309
+ executed_at: string | null
2310
+ hash: string
2311
+ id: number
2312
+ name: string
2313
+ }
2314
+ Insert: {
2315
+ executed_at?: string | null
2316
+ hash: string
2317
+ id: number
2318
+ name: string
2319
+ }
2320
+ Update: {
2321
+ executed_at?: string | null
2322
+ hash?: string
2323
+ id?: number
2324
+ name?: string
2325
+ }
2326
+ Relationships: []
2327
+ }
2328
+ objects: {
2329
+ Row: {
2330
+ bucket_id: string | null
2331
+ created_at: string | null
2332
+ id: string
2333
+ last_accessed_at: string | null
2334
+ metadata: Json | null
2335
+ name: string | null
2336
+ owner: string | null
2337
+ owner_id: string | null
2338
+ path_tokens: string[] | null
2339
+ updated_at: string | null
2340
+ version: string | null
2341
+ }
2342
+ Insert: {
2343
+ bucket_id?: string | null
2344
+ created_at?: string | null
2345
+ id?: string
2346
+ last_accessed_at?: string | null
2347
+ metadata?: Json | null
2348
+ name?: string | null
2349
+ owner?: string | null
2350
+ owner_id?: string | null
2351
+ path_tokens?: string[] | null
2352
+ updated_at?: string | null
2353
+ version?: string | null
2354
+ }
2355
+ Update: {
2356
+ bucket_id?: string | null
2357
+ created_at?: string | null
2358
+ id?: string
2359
+ last_accessed_at?: string | null
2360
+ metadata?: Json | null
2361
+ name?: string | null
2362
+ owner?: string | null
2363
+ owner_id?: string | null
2364
+ path_tokens?: string[] | null
2365
+ updated_at?: string | null
2366
+ version?: string | null
2367
+ }
2368
+ Relationships: [
2369
+ {
2370
+ foreignKeyName: "objects_bucketId_fkey"
2371
+ columns: ["bucket_id"]
2372
+ isOneToOne: false
2373
+ referencedRelation: "buckets"
2374
+ referencedColumns: ["id"]
2375
+ },
2376
+ ]
2377
+ }
2378
+ s3_multipart_uploads: {
2379
+ Row: {
2380
+ bucket_id: string
2381
+ created_at: string
2382
+ id: string
2383
+ in_progress_size: number
2384
+ key: string
2385
+ owner_id: string | null
2386
+ upload_signature: string
2387
+ version: string
2388
+ }
2389
+ Insert: {
2390
+ bucket_id: string
2391
+ created_at?: string
2392
+ id: string
2393
+ in_progress_size?: number
2394
+ key: string
2395
+ owner_id?: string | null
2396
+ upload_signature: string
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
+ version?: string
2408
+ }
2409
+ Relationships: [
2410
+ {
2411
+ foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2412
+ columns: ["bucket_id"]
2413
+ isOneToOne: false
2414
+ referencedRelation: "buckets"
2415
+ referencedColumns: ["id"]
2416
+ },
2417
+ ]
2418
+ }
2419
+ s3_multipart_uploads_parts: {
2420
+ Row: {
2421
+ bucket_id: string
2422
+ created_at: string
2423
+ etag: string
2424
+ id: string
2425
+ key: string
2426
+ owner_id: string | null
2427
+ part_number: number
2428
+ size: number
2429
+ upload_id: string
2430
+ version: string
2431
+ }
2432
+ Insert: {
2433
+ bucket_id: string
2434
+ created_at?: string
2435
+ etag: string
2436
+ id?: string
2437
+ key: string
2438
+ owner_id?: string | null
2439
+ part_number: number
2440
+ size?: number
2441
+ upload_id: string
2442
+ version: string
2443
+ }
2444
+ Update: {
2445
+ bucket_id?: string
2446
+ created_at?: string
2447
+ etag?: string
2448
+ id?: string
2449
+ key?: string
2450
+ owner_id?: string | null
2451
+ part_number?: number
2452
+ size?: number
2453
+ upload_id?: string
2454
+ version?: string
2455
+ }
2456
+ Relationships: [
2457
+ {
2458
+ foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2459
+ columns: ["bucket_id"]
2460
+ isOneToOne: false
2461
+ referencedRelation: "buckets"
2462
+ referencedColumns: ["id"]
2463
+ },
2464
+ {
2465
+ foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2466
+ columns: ["upload_id"]
2467
+ isOneToOne: false
2468
+ referencedRelation: "s3_multipart_uploads"
2469
+ referencedColumns: ["id"]
2470
+ },
2471
+ ]
2472
+ }
2473
+ }
2474
+ Views: {
2475
+ [_ in never]: never
2476
+ }
2477
+ Functions: {
2478
+ can_insert_object: {
2479
+ Args: {
2480
+ bucketid: string
2481
+ name: string
2482
+ owner: string
2483
+ metadata: Json
2484
+ }
2485
+ Returns: undefined
2486
+ }
2487
+ extension: {
2488
+ Args: {
2489
+ name: string
2490
+ }
2491
+ Returns: string
2492
+ }
2493
+ filename: {
2494
+ Args: {
2495
+ name: string
2496
+ }
2497
+ Returns: string
2498
+ }
2499
+ foldername: {
2500
+ Args: {
2501
+ name: string
2502
+ }
2503
+ Returns: string[]
2504
+ }
2505
+ get_size_by_bucket: {
2506
+ Args: Record<PropertyKey, never>
2507
+ Returns: {
2508
+ size: number
2509
+ bucket_id: string
2510
+ }[]
2511
+ }
2512
+ list_multipart_uploads_with_delimiter: {
2513
+ Args: {
2514
+ bucket_id: string
2515
+ prefix_param: string
2516
+ delimiter_param: string
2517
+ max_keys?: number
2518
+ next_key_token?: string
2519
+ next_upload_token?: string
2520
+ }
2521
+ Returns: {
2522
+ key: string
2523
+ id: string
2524
+ created_at: string
2525
+ }[]
2526
+ }
2527
+ list_objects_with_delimiter: {
2528
+ Args: {
2529
+ bucket_id: string
2530
+ prefix_param: string
2531
+ delimiter_param: string
2532
+ max_keys?: number
2533
+ start_after?: string
2534
+ next_token?: string
2535
+ }
2536
+ Returns: {
2537
+ name: string
2538
+ id: string
2539
+ metadata: Json
2540
+ updated_at: string
2541
+ }[]
2542
+ }
2543
+ search: {
2544
+ Args: {
2545
+ prefix: string
2546
+ bucketname: string
2547
+ limits?: number
2548
+ levels?: number
2549
+ offsets?: number
2550
+ search?: string
2551
+ sortcolumn?: string
2552
+ sortorder?: string
2553
+ }
2554
+ Returns: {
2555
+ name: string
2556
+ id: string
2557
+ updated_at: string
2558
+ created_at: string
2559
+ last_accessed_at: string
2560
+ metadata: Json
2561
+ }[]
2562
+ }
2563
+ }
2564
+ Enums: {
2565
+ [_ in never]: never
2566
+ }
2567
+ CompositeTypes: {
2568
+ [_ in never]: never
2569
+ }
2570
+ }
2571
+ }
2572
+
2573
+ type PublicSchema = Database[Extract<keyof Database, "public">]
2574
+
2575
+ export type Tables<
2576
+ PublicTableNameOrOptions extends
2577
+ | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
2578
+ | { schema: keyof Database },
2579
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2580
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2581
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
2582
+ : never = never,
2583
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2584
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2585
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2586
+ Row: infer R
2587
+ }
2588
+ ? R
2589
+ : never
2590
+ : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
2591
+ PublicSchema["Views"])
2592
+ ? (PublicSchema["Tables"] &
2593
+ PublicSchema["Views"])[PublicTableNameOrOptions] extends {
2594
+ Row: infer R
2595
+ }
2596
+ ? R
2597
+ : never
2598
+ : never
2599
+
2600
+ export type TablesInsert<
2601
+ PublicTableNameOrOptions extends
2602
+ | keyof PublicSchema["Tables"]
2603
+ | { schema: keyof Database },
2604
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2605
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2606
+ : never = never,
2607
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2608
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2609
+ Insert: infer I
2610
+ }
2611
+ ? I
2612
+ : never
2613
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2614
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2615
+ Insert: infer I
2616
+ }
2617
+ ? I
2618
+ : never
2619
+ : never
2620
+
2621
+ export type TablesUpdate<
2622
+ PublicTableNameOrOptions extends
2623
+ | keyof PublicSchema["Tables"]
2624
+ | { schema: keyof Database },
2625
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2626
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2627
+ : never = never,
2628
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2629
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2630
+ Update: infer U
2631
+ }
2632
+ ? U
2633
+ : never
2634
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2635
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2636
+ Update: infer U
2637
+ }
2638
+ ? U
2639
+ : never
2640
+ : never
2641
+
2642
+ export type Enums<
2643
+ PublicEnumNameOrOptions extends
2644
+ | keyof PublicSchema["Enums"]
2645
+ | { schema: keyof Database },
2646
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2647
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
2648
+ : never = never,
2649
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
2650
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
2651
+ : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
2652
+ ? PublicSchema["Enums"][PublicEnumNameOrOptions]
2653
+ : never
2654
+
2665
2655