@periskope/types 0.6.114 → 0.6.115

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