@periskope/types 0.6.104 → 0.6.105

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