@periskope/types 0.6.76 → 0.6.77

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