@periskope/types 0.6.112 → 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,2293 +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
- 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
- with_name?: boolean
1728
- sync_phone_contacts?: boolean
1729
- search_input?: string
1730
- label_ids_input?: string[]
1731
- is_internal_input?: boolean
1732
- page_number?: number
1733
- page_size?: number
1734
- }
1735
- Returns: Json
1736
- }
1737
- get_dashboard_statistics_between_dates: {
1738
- Args: {
1739
- org_id_input: string
1740
- start_date: string
1741
- end_date: string
1742
- chat_id_input?: string[]
1743
- }
1744
- Returns: Json
1745
- }
1746
- get_export_chats_data: {
1747
- Args: {
1748
- org_id_input: string
1749
- chat_ids?: string[]
1750
- }
1751
- Returns: Json
1752
- }
1753
- get_integration_data: {
1754
- Args: {
1755
- org_id_input?: string
1756
- }
1757
- Returns: Json
1758
- }
1759
- get_messages_notifications_reactions: {
1760
- Args: {
1761
- org_id_input: string
1762
- chat_id_input?: string[]
1763
- limit_input?: number
1764
- offset_input?: number
1765
- }
1766
- Returns: Json
1767
- }
1768
- get_org: {
1769
- Args: {
1770
- org_id_input?: string
1771
- }
1772
- Returns: Json
1773
- }
1774
- get_org_phones: {
1775
- Args: {
1776
- org_id_input?: string
1777
- phone_id_input?: string
1778
- }
1779
- Returns: Json
1780
- }
1781
- get_team_metrics_between_dates: {
1782
- Args: {
1783
- org_id_input: string
1784
- start_date: string
1785
- end_date: string
1786
- chat_id_input?: string[]
1787
- }
1788
- Returns: Json
1789
- }
1790
- get_ticket_info: {
1791
- Args: {
1792
- ticket_id_input?: string
1793
- org_id_input?: string
1794
- chat_id_input?: string
1795
- unique_message_id_input?: string
1796
- }
1797
- Returns: Json
1798
- }
1799
- get_universal_search_result: {
1800
- Args: {
1801
- search_category_input: string
1802
- search_query_input: string
1803
- org_id_input: string
1804
- }
1805
- Returns: {
1806
- category: string
1807
- result: Json
1808
- }[]
1809
- }
1810
- image_path: {
1811
- Args: {
1812
- path_input?: string
1813
- bucket_name?: string
1814
- req_base?: boolean
1815
- }
1816
- Returns: string
1817
- }
1818
- list_org_from_user: {
1819
- Args: Record<PropertyKey, never>
1820
- Returns: string[]
1821
- }
1822
- list_role_from_user: {
1823
- Args: Record<PropertyKey, never>
1824
- Returns: Database["public"]["Enums"]["enum_member_role"]
1825
- }
1826
- update_custom_properties: {
1827
- Args: {
1828
- org_id_input: string
1829
- row_properties_map: Json
1830
- replace_properties?: boolean
1831
- }
1832
- Returns: undefined
1833
- }
1834
- update_labels: {
1835
- Args: {
1836
- org_id_input: string
1837
- tbl_type: string
1838
- row_label_map: Json
1839
- replace_labels?: boolean
1840
- }
1841
- Returns: undefined
1842
- }
1843
- }
1844
- Enums: {
1845
- enum_broadcast_status: "inprogress" | "completed" | "stopped"
1846
- enum_chat_colors:
1847
- | "#B4876E"
1848
- | "#A5B337"
1849
- | "#06CF9C"
1850
- | "#25D366"
1851
- | "#02A698"
1852
- | "#7D9EF1"
1853
- | "#007BFC"
1854
- | "#5E47DE"
1855
- | "#7F66FF"
1856
- | "#9333EA"
1857
- | "#FA6533"
1858
- | "#C4532D"
1859
- | "#DC2626"
1860
- | "#FF2E74"
1861
- | "#DB2777"
1862
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1863
- enum_integration_name:
1864
- | "org.created"
1865
- | "org.updated"
1866
- | "org.member.created"
1867
- | "org.member.updated"
1868
- | "org.phone.created"
1869
- | "org.phone.connected"
1870
- | "org.phone.disconnected"
1871
- | "org.subscription.trial_will_end"
1872
- | "chat.created"
1873
- | "chat.updated"
1874
- | "chat.notification.created"
1875
- | "message.created"
1876
- | "message.updated"
1877
- | "message.deleted"
1878
- | "message.ack.updated"
1879
- | "reaction.created"
1880
- | "reaction.updated"
1881
- | "ticket.created"
1882
- | "ticket.updated"
1883
- | "ticket.deleted"
1884
- enum_integration_type:
1885
- | "zapier"
1886
- | "pabbly"
1887
- | "api"
1888
- | "webhook"
1889
- | "hubspot"
1890
- | "freshdesk"
1891
- | "slack"
1892
- | "jira"
1893
- | "salesforce"
1894
- enum_member_role: "admin" | "member"
1895
- }
1896
- CompositeTypes: {
1897
- [_ in never]: never
1898
- }
1899
- }
1900
- storage: {
1901
- Tables: {
1902
- buckets: {
1903
- Row: {
1904
- allowed_mime_types: string[] | null
1905
- avif_autodetection: boolean | null
1906
- created_at: string | null
1907
- file_size_limit: number | null
1908
- id: string
1909
- name: string
1910
- owner: string | null
1911
- owner_id: string | null
1912
- public: boolean | null
1913
- updated_at: string | null
1914
- }
1915
- Insert: {
1916
- allowed_mime_types?: string[] | null
1917
- avif_autodetection?: boolean | null
1918
- created_at?: string | null
1919
- file_size_limit?: number | null
1920
- id: string
1921
- name: string
1922
- owner?: string | null
1923
- owner_id?: string | null
1924
- public?: boolean | null
1925
- updated_at?: string | null
1926
- }
1927
- Update: {
1928
- allowed_mime_types?: string[] | null
1929
- avif_autodetection?: boolean | null
1930
- created_at?: string | null
1931
- file_size_limit?: number | null
1932
- id?: string
1933
- name?: string
1934
- owner?: string | null
1935
- owner_id?: string | null
1936
- public?: boolean | null
1937
- updated_at?: string | null
1938
- }
1939
- Relationships: []
1940
- }
1941
- migrations: {
1942
- Row: {
1943
- executed_at: string | null
1944
- hash: string
1945
- id: number
1946
- name: string
1947
- }
1948
- Insert: {
1949
- executed_at?: string | null
1950
- hash: string
1951
- id: number
1952
- name: string
1953
- }
1954
- Update: {
1955
- executed_at?: string | null
1956
- hash?: string
1957
- id?: number
1958
- name?: string
1959
- }
1960
- Relationships: []
1961
- }
1962
- objects: {
1963
- Row: {
1964
- bucket_id: string | null
1965
- created_at: string | null
1966
- id: string
1967
- last_accessed_at: string | null
1968
- metadata: Json | null
1969
- name: string | null
1970
- owner: string | null
1971
- owner_id: string | null
1972
- path_tokens: string[] | null
1973
- updated_at: string | null
1974
- version: string | null
1975
- }
1976
- Insert: {
1977
- bucket_id?: string | null
1978
- created_at?: string | null
1979
- id?: string
1980
- last_accessed_at?: string | null
1981
- metadata?: Json | null
1982
- name?: string | null
1983
- owner?: string | null
1984
- owner_id?: string | null
1985
- path_tokens?: string[] | null
1986
- updated_at?: string | null
1987
- version?: string | null
1988
- }
1989
- Update: {
1990
- bucket_id?: string | null
1991
- created_at?: string | null
1992
- id?: string
1993
- last_accessed_at?: string | null
1994
- metadata?: Json | null
1995
- name?: string | null
1996
- owner?: string | null
1997
- owner_id?: string | null
1998
- path_tokens?: string[] | null
1999
- updated_at?: string | null
2000
- version?: string | null
2001
- }
2002
- Relationships: [
2003
- {
2004
- foreignKeyName: "objects_bucketId_fkey"
2005
- columns: ["bucket_id"]
2006
- isOneToOne: false
2007
- referencedRelation: "buckets"
2008
- referencedColumns: ["id"]
2009
- },
2010
- ]
2011
- }
2012
- s3_multipart_uploads: {
2013
- Row: {
2014
- bucket_id: string
2015
- created_at: string
2016
- id: string
2017
- in_progress_size: number
2018
- key: string
2019
- owner_id: string | null
2020
- upload_signature: string
2021
- version: string
2022
- }
2023
- Insert: {
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
- Update: {
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
- Relationships: [
2044
- {
2045
- foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2046
- columns: ["bucket_id"]
2047
- isOneToOne: false
2048
- referencedRelation: "buckets"
2049
- referencedColumns: ["id"]
2050
- },
2051
- ]
2052
- }
2053
- s3_multipart_uploads_parts: {
2054
- Row: {
2055
- bucket_id: string
2056
- created_at: string
2057
- etag: string
2058
- id: string
2059
- key: string
2060
- owner_id: string | null
2061
- part_number: number
2062
- size: number
2063
- upload_id: string
2064
- version: string
2065
- }
2066
- Insert: {
2067
- bucket_id: string
2068
- created_at?: string
2069
- etag: string
2070
- id?: string
2071
- key: string
2072
- owner_id?: string | null
2073
- part_number: number
2074
- size?: number
2075
- upload_id: string
2076
- version: string
2077
- }
2078
- Update: {
2079
- bucket_id?: string
2080
- created_at?: string
2081
- etag?: string
2082
- id?: string
2083
- key?: string
2084
- owner_id?: string | null
2085
- part_number?: number
2086
- size?: number
2087
- upload_id?: string
2088
- version?: string
2089
- }
2090
- Relationships: [
2091
- {
2092
- foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2093
- columns: ["bucket_id"]
2094
- isOneToOne: false
2095
- referencedRelation: "buckets"
2096
- referencedColumns: ["id"]
2097
- },
2098
- {
2099
- foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2100
- columns: ["upload_id"]
2101
- isOneToOne: false
2102
- referencedRelation: "s3_multipart_uploads"
2103
- referencedColumns: ["id"]
2104
- },
2105
- ]
2106
- }
2107
- }
2108
- Views: {
2109
- [_ in never]: never
2110
- }
2111
- Functions: {
2112
- can_insert_object: {
2113
- Args: {
2114
- bucketid: string
2115
- name: string
2116
- owner: string
2117
- metadata: Json
2118
- }
2119
- Returns: undefined
2120
- }
2121
- extension: {
2122
- Args: {
2123
- name: string
2124
- }
2125
- Returns: string
2126
- }
2127
- filename: {
2128
- Args: {
2129
- name: string
2130
- }
2131
- Returns: string
2132
- }
2133
- foldername: {
2134
- Args: {
2135
- name: string
2136
- }
2137
- Returns: string[]
2138
- }
2139
- get_size_by_bucket: {
2140
- Args: Record<PropertyKey, never>
2141
- Returns: {
2142
- size: number
2143
- bucket_id: string
2144
- }[]
2145
- }
2146
- list_multipart_uploads_with_delimiter: {
2147
- Args: {
2148
- bucket_id: string
2149
- prefix_param: string
2150
- delimiter_param: string
2151
- max_keys?: number
2152
- next_key_token?: string
2153
- next_upload_token?: string
2154
- }
2155
- Returns: {
2156
- key: string
2157
- id: string
2158
- created_at: string
2159
- }[]
2160
- }
2161
- list_objects_with_delimiter: {
2162
- Args: {
2163
- bucket_id: string
2164
- prefix_param: string
2165
- delimiter_param: string
2166
- max_keys?: number
2167
- start_after?: string
2168
- next_token?: string
2169
- }
2170
- Returns: {
2171
- name: string
2172
- id: string
2173
- metadata: Json
2174
- updated_at: string
2175
- }[]
2176
- }
2177
- operation: {
2178
- Args: Record<PropertyKey, never>
2179
- Returns: string
2180
- }
2181
- search: {
2182
- Args: {
2183
- prefix: string
2184
- bucketname: string
2185
- limits?: number
2186
- levels?: number
2187
- offsets?: number
2188
- search?: string
2189
- sortcolumn?: string
2190
- sortorder?: string
2191
- }
2192
- Returns: {
2193
- name: string
2194
- id: string
2195
- updated_at: string
2196
- created_at: string
2197
- last_accessed_at: string
2198
- metadata: Json
2199
- }[]
2200
- }
2201
- }
2202
- Enums: {
2203
- [_ in never]: never
2204
- }
2205
- CompositeTypes: {
2206
- [_ in never]: never
2207
- }
2208
- }
2209
- }
2210
-
2211
- type PublicSchema = Database[Extract<keyof Database, "public">]
2212
-
2213
- export type Tables<
2214
- PublicTableNameOrOptions extends
2215
- | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
2216
- | { schema: keyof Database },
2217
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2218
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2219
- Database[PublicTableNameOrOptions["schema"]]["Views"])
2220
- : never = never,
2221
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2222
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
2223
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2224
- Row: infer R
2225
- }
2226
- ? R
2227
- : never
2228
- : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
2229
- PublicSchema["Views"])
2230
- ? (PublicSchema["Tables"] &
2231
- PublicSchema["Views"])[PublicTableNameOrOptions] extends {
2232
- Row: infer R
2233
- }
2234
- ? R
2235
- : never
2236
- : never
2237
-
2238
- export type TablesInsert<
2239
- PublicTableNameOrOptions extends
2240
- | keyof PublicSchema["Tables"]
2241
- | { schema: keyof Database },
2242
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2243
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2244
- : never = never,
2245
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2246
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2247
- Insert: infer I
2248
- }
2249
- ? I
2250
- : never
2251
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2252
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2253
- Insert: infer I
2254
- }
2255
- ? I
2256
- : never
2257
- : never
2258
-
2259
- export type TablesUpdate<
2260
- PublicTableNameOrOptions extends
2261
- | keyof PublicSchema["Tables"]
2262
- | { schema: keyof Database },
2263
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2264
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
2265
- : never = never,
2266
- > = PublicTableNameOrOptions extends { schema: keyof Database }
2267
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2268
- Update: infer U
2269
- }
2270
- ? U
2271
- : never
2272
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
2273
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
2274
- Update: infer U
2275
- }
2276
- ? U
2277
- : never
2278
- : never
2279
-
2280
- export type Enums<
2281
- PublicEnumNameOrOptions extends
2282
- | keyof PublicSchema["Enums"]
2283
- | { schema: keyof Database },
2284
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2285
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
2286
- : never = never,
2287
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
2288
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
2289
- : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
2290
- ? PublicSchema["Enums"][PublicEnumNameOrOptions]
2291
- : never
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
+ 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
+
2293
2292