@periskope/types 0.6.76 → 0.6.79

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