@periskope/types 0.6.113 → 0.6.114

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