@periskope/types 0.6.104 → 0.6.106

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