@periskope/types 0.6.28 → 0.6.29

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,1240 +1,1258 @@
1
- export type Json = { [key: string]: any } | any
2
-
3
- export interface 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_messages: {
32
- Row: {
33
- broadcast_id: string
34
- chat_ids: string[] | null
35
- completed_at: string | null
36
- created_at: string
37
- message_payload: Json | null
38
- org_id: string
39
- scheduled_at: string | null
40
- sent_by: string | null
41
- status: string | null
42
- }
43
- Insert: {
44
- broadcast_id?: string
45
- chat_ids?: string[] | null
46
- completed_at?: string | null
47
- created_at?: string
48
- message_payload?: Json | null
49
- org_id?: string
50
- scheduled_at?: string | null
51
- sent_by?: string | null
52
- status?: string | null
53
- }
54
- Update: {
55
- broadcast_id?: string
56
- chat_ids?: string[] | null
57
- completed_at?: string | null
58
- created_at?: string
59
- message_payload?: Json | null
60
- org_id?: string
61
- scheduled_at?: string | null
62
- sent_by?: string | null
63
- status?: string | null
64
- }
65
- Relationships: [
66
- {
67
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
68
- columns: ["org_id"]
69
- isOneToOne: false
70
- referencedRelation: "tbl_org"
71
- referencedColumns: ["org_id"]
72
- }
73
- ]
74
- }
75
- tbl_broadcast_templates: {
76
- Row: {
77
- created_at: string
78
- message_payload: Json | null
79
- org_id: string
80
- template_id: string
81
- template_name: string | null
82
- updated_at: string | null
83
- }
84
- Insert: {
85
- created_at?: string
86
- message_payload?: Json | null
87
- org_id?: string
88
- template_id?: string
89
- template_name?: string | null
90
- updated_at?: string | null
91
- }
92
- Update: {
93
- created_at?: string
94
- message_payload?: Json | null
95
- org_id?: string
96
- template_id?: string
97
- template_name?: string | null
98
- updated_at?: string | null
99
- }
100
- Relationships: [
101
- {
102
- foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
103
- columns: ["org_id"]
104
- isOneToOne: false
105
- referencedRelation: "tbl_org"
106
- referencedColumns: ["org_id"]
107
- }
108
- ]
109
- }
110
- tbl_chat_access: {
111
- Row: {
112
- chat_id: string
113
- email: string
114
- has_access: boolean | null
115
- last_read_timestamp: string | null
116
- org_id: string
117
- }
118
- Insert: {
119
- chat_id: string
120
- email: string
121
- has_access?: boolean | null
122
- last_read_timestamp?: string | null
123
- org_id?: string
124
- }
125
- Update: {
126
- chat_id?: string
127
- email?: string
128
- has_access?: boolean | null
129
- last_read_timestamp?: string | null
130
- org_id?: string
131
- }
132
- Relationships: [
133
- {
134
- foreignKeyName: "tbl_chat_access_org_id_fkey"
135
- columns: ["org_id"]
136
- isOneToOne: false
137
- referencedRelation: "tbl_org"
138
- referencedColumns: ["org_id"]
139
- }
140
- ]
141
- }
142
- tbl_chat_messages: {
143
- Row: {
144
- ack: string | null
145
- author: string | null
146
- body: string | null
147
- broadcast: boolean | null
148
- broadcast_id: string | null
149
- chat_id: string | null
150
- delivery_info: Json | null
151
- device_type: string | null
152
- duration: string | null
153
- forwarding_score: number | null
154
- from: string | null
155
- from_me: boolean | null
156
- has_media: boolean | null
157
- has_quoted_msg: boolean | null
158
- has_reaction: boolean | null
159
- id: Json | null
160
- invite_v4: Json | null
161
- is_deleted: boolean | null
162
- is_ephemeral: boolean | null
163
- is_forwarded: boolean | null
164
- is_gif: boolean | null
165
- is_starred: boolean | null
166
- is_status: boolean | null
167
- links: Json | null
168
- location: Json | null
169
- media: Json | null
170
- media_key: string | null
171
- mentioned_ids: string[] | null
172
- message_id: string
173
- message_ticket_id: string | null
174
- message_type: string | null
175
- order_id: string | null
176
- org_id: string
177
- org_phone: string
178
- performed_by: string | null
179
- prev_body: string | null
180
- quoted_message_id: string | null
181
- raw_data: Json | null
182
- sender_phone: string | null
183
- sent_message_id: string | null
184
- timestamp: string | null
185
- to: string | null
186
- token: string | null
187
- updated_at: string | null
188
- vcards: string[] | null
189
- }
190
- Insert: {
191
- ack?: string | null
192
- author?: string | null
193
- body?: string | null
194
- broadcast?: boolean | null
195
- broadcast_id?: string | null
196
- chat_id?: string | null
197
- delivery_info?: Json | null
198
- device_type?: string | null
199
- duration?: string | null
200
- forwarding_score?: number | null
201
- from?: string | null
202
- from_me?: boolean | null
203
- has_media?: boolean | null
204
- has_quoted_msg?: boolean | null
205
- has_reaction?: boolean | null
206
- id?: Json | null
207
- invite_v4?: Json | null
208
- is_deleted?: boolean | null
209
- is_ephemeral?: boolean | null
210
- is_forwarded?: boolean | null
211
- is_gif?: boolean | null
212
- is_starred?: boolean | null
213
- is_status?: boolean | null
214
- links?: Json | null
215
- location?: Json | null
216
- media?: Json | null
217
- media_key?: string | null
218
- mentioned_ids?: string[] | null
219
- message_id: string
220
- message_ticket_id?: string | null
221
- message_type?: string | null
222
- order_id?: string | null
223
- org_id: string
224
- org_phone: string
225
- performed_by?: string | null
226
- prev_body?: string | null
227
- quoted_message_id?: string | null
228
- raw_data?: Json | null
229
- sender_phone?: string | null
230
- sent_message_id?: string | null
231
- timestamp?: string | null
232
- to?: string | null
233
- token?: string | null
234
- updated_at?: string | null
235
- vcards?: string[] | null
236
- }
237
- Update: {
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
- updated_at?: string | null
282
- vcards?: string[] | null
283
- }
284
- Relationships: [
285
- {
286
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
287
- columns: ["org_id", "org_phone"]
288
- isOneToOne: false
289
- referencedRelation: "tbl_org_phones"
290
- referencedColumns: ["org_id", "org_phone"]
291
- }
292
- ]
293
- }
294
- tbl_chat_notifications: {
295
- Row: {
296
- author: string | null
297
- body: string | null
298
- chat_id: string | null
299
- id: Json | null
300
- notification_id: string
301
- org_id: string
302
- org_phone: string
303
- recipientids: string[] | null
304
- timestamp: string | null
305
- type: string | null
306
- }
307
- Insert: {
308
- author?: string | null
309
- body?: string | null
310
- chat_id?: string | null
311
- id?: Json | null
312
- notification_id: string
313
- org_id: string
314
- org_phone: string
315
- recipientids?: string[] | null
316
- timestamp?: string | null
317
- type?: string | null
318
- }
319
- Update: {
320
- author?: string | null
321
- body?: string | null
322
- chat_id?: string | null
323
- id?: Json | null
324
- notification_id?: string
325
- org_id?: string
326
- org_phone?: string
327
- recipientids?: string[] | null
328
- timestamp?: string | null
329
- type?: string | null
330
- }
331
- Relationships: [
332
- {
333
- foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
334
- columns: ["org_id", "org_phone"]
335
- isOneToOne: false
336
- referencedRelation: "tbl_org_phones"
337
- referencedColumns: ["org_id", "org_phone"]
338
- }
339
- ]
340
- }
341
- tbl_chat_participants: {
342
- Row: {
343
- chat_id: string
344
- contact_id: string
345
- id: Json | null
346
- is_admin: boolean | null
347
- is_super_admin: boolean | null
348
- org_id: string
349
- org_phone: string
350
- }
351
- Insert: {
352
- chat_id: string
353
- contact_id: string
354
- id?: Json | null
355
- is_admin?: boolean | null
356
- is_super_admin?: boolean | null
357
- org_id: string
358
- org_phone: string
359
- }
360
- Update: {
361
- chat_id?: string
362
- contact_id?: string
363
- id?: Json | null
364
- is_admin?: boolean | null
365
- is_super_admin?: boolean | null
366
- org_id?: string
367
- org_phone?: string
368
- }
369
- Relationships: [
370
- {
371
- foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
372
- columns: ["org_id", "org_phone", "chat_id"]
373
- isOneToOne: false
374
- referencedRelation: "tbl_chats"
375
- referencedColumns: ["org_id", "org_phone", "chat_id"]
376
- },
377
- {
378
- foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
379
- columns: ["org_id", "org_phone", "chat_id"]
380
- isOneToOne: false
381
- referencedRelation: "view_chats"
382
- referencedColumns: ["org_id", "org_phone", "chat_id"]
383
- }
384
- ]
385
- }
386
- tbl_chat_reactions: {
387
- Row: {
388
- ack: number | null
389
- id: Json | null
390
- message_id: string | null
391
- msg_id: Json | null
392
- org_id: string
393
- org_phone: string
394
- orphan: number | null
395
- orphan_reason: string | null
396
- reaction: string | null
397
- reaction_id: string
398
- read: boolean | null
399
- sender_id: string | null
400
- timestamp: string | null
401
- }
402
- Insert: {
403
- ack?: number | null
404
- id?: Json | null
405
- message_id?: string | null
406
- msg_id?: Json | null
407
- org_id: string
408
- org_phone: string
409
- orphan?: number | null
410
- orphan_reason?: string | null
411
- reaction?: string | null
412
- reaction_id: string
413
- read?: boolean | null
414
- sender_id?: string | null
415
- timestamp?: string | null
416
- }
417
- Update: {
418
- ack?: number | null
419
- id?: Json | null
420
- message_id?: string | null
421
- msg_id?: Json | null
422
- org_id?: string
423
- org_phone?: string
424
- orphan?: number | null
425
- orphan_reason?: string | null
426
- reaction?: string | null
427
- reaction_id?: string
428
- read?: boolean | null
429
- sender_id?: string | null
430
- timestamp?: string | null
431
- }
432
- Relationships: [
433
- {
434
- foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
435
- columns: ["org_id", "org_phone"]
436
- isOneToOne: false
437
- referencedRelation: "tbl_org_phones"
438
- referencedColumns: ["org_id", "org_phone"]
439
- }
440
- ]
441
- }
442
- tbl_chat_tickets: {
443
- Row: {
444
- assigned_by: string | null
445
- assignee: string | null
446
- chat_id: string
447
- created_at: string
448
- due_date: string | null
449
- label_ids: Json | null
450
- last_updated_at: string
451
- org_id: string
452
- priority: number | null
453
- quoted_message_id: string
454
- raised_by: string | null
455
- status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
456
- subject: string
457
- ticket_id: string
458
- }
459
- Insert: {
460
- assigned_by?: string | null
461
- assignee?: string | null
462
- chat_id: string
463
- created_at?: string
464
- due_date?: string | null
465
- label_ids?: Json | null
466
- last_updated_at?: string
467
- org_id: string
468
- priority?: number | null
469
- quoted_message_id: string
470
- raised_by?: string | null
471
- status?:
472
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
473
- | null
474
- subject: string
475
- ticket_id?: string
476
- }
477
- Update: {
478
- assigned_by?: string | null
479
- assignee?: string | null
480
- chat_id?: string
481
- created_at?: string
482
- due_date?: string | null
483
- label_ids?: Json | null
484
- last_updated_at?: string
485
- org_id?: string
486
- priority?: number | null
487
- quoted_message_id?: string
488
- raised_by?: string | null
489
- status?:
490
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
491
- | null
492
- subject?: string
493
- ticket_id?: string
494
- }
495
- Relationships: [
496
- {
497
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
498
- columns: ["org_id"]
499
- isOneToOne: false
500
- referencedRelation: "tbl_org"
501
- referencedColumns: ["org_id"]
502
- }
503
- ]
504
- }
505
- tbl_chats: {
506
- Row: {
507
- archived: boolean | null
508
- chat_id: string
509
- chat_image: string | null
510
- group_metadata: Json | null
511
- id: Json | null
512
- invite_link: string | null
513
- is_group: boolean | null
514
- is_muted: boolean | null
515
- is_read_only: boolean | null
516
- label_ids: Json
517
- mute_expiration: number | null
518
- name: string | null
519
- org_id: string
520
- org_phone: string
521
- pinned: boolean | null
522
- timestamp: string | null
523
- unread_count: number | null
524
- }
525
- Insert: {
526
- archived?: boolean | null
527
- chat_id: string
528
- chat_image?: string | null
529
- group_metadata?: Json | null
530
- id?: Json | null
531
- invite_link?: string | null
532
- is_group?: boolean | null
533
- is_muted?: boolean | null
534
- is_read_only?: boolean | null
535
- label_ids?: Json
536
- mute_expiration?: number | null
537
- name?: string | null
538
- org_id: string
539
- org_phone: string
540
- pinned?: boolean | null
541
- timestamp?: string | null
542
- unread_count?: number | null
543
- }
544
- Update: {
545
- archived?: boolean | null
546
- chat_id?: string
547
- chat_image?: string | null
548
- group_metadata?: Json | null
549
- id?: Json | null
550
- invite_link?: string | null
551
- is_group?: boolean | null
552
- is_muted?: boolean | null
553
- is_read_only?: boolean | null
554
- label_ids?: Json
555
- mute_expiration?: number | null
556
- name?: string | null
557
- org_id?: string
558
- org_phone?: string
559
- pinned?: boolean | null
560
- timestamp?: string | null
561
- unread_count?: number | null
562
- }
563
- Relationships: [
564
- {
565
- foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
566
- columns: ["org_phone", "org_id"]
567
- isOneToOne: false
568
- referencedRelation: "tbl_org_phones"
569
- referencedColumns: ["org_phone", "org_id"]
570
- }
571
- ]
572
- }
573
- tbl_contacts: {
574
- Row: {
575
- business_profile: Json | null
576
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
577
- contact_id: string
578
- contact_image: string | null
579
- contact_name: string | null
580
- contact_type: string | null
581
- id: Json | null
582
- is_blocked: boolean | null
583
- is_business: boolean | null
584
- is_enterprise: boolean | null
585
- is_group: boolean | null
586
- is_internal: boolean | null
587
- is_me: boolean | null
588
- is_my_contact: boolean | null
589
- is_user: boolean | null
590
- is_wa_contact: boolean | null
591
- label_ids: Json
592
- name: string | null
593
- number: string | null
594
- org_id: string
595
- pushname: string | null
596
- short_name: string | null
597
- verified_level: number | null
598
- verified_name: string | null
599
- }
600
- Insert: {
601
- business_profile?: Json | null
602
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
603
- contact_id: string
604
- contact_image?: string | null
605
- contact_name?: string | null
606
- contact_type?: string | null
607
- id?: Json | null
608
- is_blocked?: boolean | null
609
- is_business?: boolean | null
610
- is_enterprise?: boolean | null
611
- is_group?: boolean | null
612
- is_internal?: boolean | null
613
- is_me?: boolean | null
614
- is_my_contact?: boolean | null
615
- is_user?: boolean | null
616
- is_wa_contact?: boolean | null
617
- label_ids?: Json
618
- name?: string | null
619
- number?: string | null
620
- org_id: string
621
- pushname?: string | null
622
- short_name?: string | null
623
- verified_level?: number | null
624
- verified_name?: string | null
625
- }
626
- Update: {
627
- business_profile?: Json | null
628
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
629
- contact_id?: string
630
- contact_image?: string | null
631
- contact_name?: string | null
632
- contact_type?: string | null
633
- id?: Json | null
634
- is_blocked?: boolean | null
635
- is_business?: boolean | null
636
- is_enterprise?: boolean | null
637
- is_group?: boolean | null
638
- is_internal?: boolean | null
639
- is_me?: boolean | null
640
- is_my_contact?: boolean | null
641
- is_user?: boolean | null
642
- is_wa_contact?: boolean | null
643
- label_ids?: Json
644
- name?: string | null
645
- number?: string | null
646
- org_id?: string
647
- pushname?: string | null
648
- short_name?: string | null
649
- verified_level?: number | null
650
- verified_name?: string | null
651
- }
652
- Relationships: [
653
- {
654
- foreignKeyName: "tbl_contacts_org_id_fkey"
655
- columns: ["org_id"]
656
- isOneToOne: false
657
- referencedRelation: "tbl_org"
658
- referencedColumns: ["org_id"]
659
- }
660
- ]
661
- }
662
- tbl_org: {
663
- Row: {
664
- created_at: string
665
- org_id: string
666
- org_image: string | null
667
- org_name: string | null
668
- support_link: string | null
669
- }
670
- Insert: {
671
- created_at?: string
672
- org_id?: string
673
- org_image?: string | null
674
- org_name?: string | null
675
- support_link?: string | null
676
- }
677
- Update: {
678
- created_at?: string
679
- org_id?: string
680
- org_image?: string | null
681
- org_name?: string | null
682
- support_link?: string | null
683
- }
684
- Relationships: []
685
- }
686
- tbl_org_labels: {
687
- Row: {
688
- color: string
689
- created_at: string
690
- label_id: string
691
- name: string
692
- org_id: string
693
- type: string
694
- }
695
- Insert: {
696
- color?: string
697
- created_at?: string
698
- label_id?: string
699
- name: string
700
- org_id?: string
701
- type?: string
702
- }
703
- Update: {
704
- color?: string
705
- created_at?: string
706
- label_id?: string
707
- name?: string
708
- org_id?: string
709
- type?: string
710
- }
711
- Relationships: [
712
- {
713
- foreignKeyName: "tbl_org_labels_org_id_fkey"
714
- columns: ["org_id"]
715
- isOneToOne: false
716
- referencedRelation: "tbl_org"
717
- referencedColumns: ["org_id"]
718
- }
719
- ]
720
- }
721
- tbl_org_members: {
722
- Row: {
723
- created_at: string | null
724
- email: string
725
- invited_at: string | null
726
- invited_by: string | null
727
- is_active: boolean
728
- member_image: string | null
729
- member_name: string | null
730
- org_id: string
731
- role: Database["public"]["Enums"]["enum_member_role"]
732
- user_id: string | null
733
- }
734
- Insert: {
735
- created_at?: string | null
736
- email: string
737
- invited_at?: string | null
738
- invited_by?: string | null
739
- is_active?: boolean
740
- member_image?: string | null
741
- member_name?: string | null
742
- org_id: string
743
- role?: Database["public"]["Enums"]["enum_member_role"]
744
- user_id?: string | null
745
- }
746
- Update: {
747
- created_at?: string | null
748
- email?: string
749
- invited_at?: string | null
750
- invited_by?: string | null
751
- is_active?: boolean
752
- member_image?: string | null
753
- member_name?: string | null
754
- org_id?: string
755
- role?: Database["public"]["Enums"]["enum_member_role"]
756
- user_id?: string | null
757
- }
758
- Relationships: [
759
- {
760
- foreignKeyName: "tbl_org_members_fkey_auth_users"
761
- columns: ["user_id"]
762
- isOneToOne: false
763
- referencedRelation: "users"
764
- referencedColumns: ["id"]
765
- },
766
- {
767
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
768
- columns: ["org_id"]
769
- isOneToOne: false
770
- referencedRelation: "tbl_org"
771
- referencedColumns: ["org_id"]
772
- }
773
- ]
774
- }
775
- tbl_org_phones: {
776
- Row: {
777
- created_at: string
778
- is_ready: boolean | null
779
- org_id: string
780
- org_phone: string | null
781
- phone_id: string
782
- phone_image: string | null
783
- phone_name: string | null
784
- qr_code: string | null
785
- server_ip: string | null
786
- updated_at: string
787
- wa_state: string | null
788
- }
789
- Insert: {
790
- created_at?: string
791
- is_ready?: boolean | null
792
- org_id: string
793
- org_phone?: string | null
794
- phone_id?: string
795
- phone_image?: string | null
796
- phone_name?: string | null
797
- qr_code?: string | null
798
- server_ip?: string | null
799
- updated_at?: string
800
- wa_state?: string | null
801
- }
802
- Update: {
803
- created_at?: string
804
- is_ready?: boolean | null
805
- org_id?: string
806
- org_phone?: string | null
807
- phone_id?: string
808
- phone_image?: string | null
809
- phone_name?: string | null
810
- qr_code?: string | null
811
- server_ip?: string | null
812
- updated_at?: string
813
- wa_state?: string | null
814
- }
815
- Relationships: [
816
- {
817
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
818
- columns: ["org_id"]
819
- isOneToOne: false
820
- referencedRelation: "tbl_org"
821
- referencedColumns: ["org_id"]
822
- }
823
- ]
824
- }
825
- }
826
- Views: {
827
- view_broadcast_logs: {
828
- Row: {
829
- broadcast_id: string | null
830
- completed_at: string | null
831
- delivered_member_count: number | null
832
- failed_chats: number | null
833
- message_payload: Json | null
834
- org_id: string | null
835
- read_member_count: number | null
836
- scheduled_at: string | null
837
- sent_chats: number | null
838
- status: string | null
839
- total_chats: number | null
840
- total_member_count: number | null
841
- }
842
- Relationships: [
843
- {
844
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
845
- columns: ["org_id"]
846
- isOneToOne: false
847
- referencedRelation: "tbl_org"
848
- referencedColumns: ["org_id"]
849
- }
850
- ]
851
- }
852
- view_chats: {
853
- Row: {
854
- archived: boolean | null
855
- chat_access: Json | null
856
- chat_id: string | null
857
- chat_image: string | null
858
- chat_name: string | null
859
- chat_type: string | null
860
- group_metadata: Json | null
861
- has_access: boolean | null
862
- id: Json | null
863
- invite_link: string | null
864
- is_group: boolean | null
865
- is_muted: boolean | null
866
- is_read_only: boolean | null
867
- label_ids: Json | null
868
- last_read_timestamp: string | null
869
- latest_message: Json | null
870
- latest_message_timestamp: string | null
871
- member_count: number | null
872
- message_unread_count: number | null
873
- mute_expiration: number | null
874
- name: string | null
875
- org_id: string | null
876
- org_phone: string | null
877
- pinned: boolean | null
878
- timestamp: string | null
879
- unread_count: number | null
880
- }
881
- Relationships: [
882
- {
883
- foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
884
- columns: ["org_phone", "org_id"]
885
- isOneToOne: false
886
- referencedRelation: "tbl_org_phones"
887
- referencedColumns: ["org_phone", "org_id"]
888
- }
889
- ]
890
- }
891
- }
892
- Functions: {
893
- gen_id: {
894
- Args: {
895
- prefix: string
896
- size?: number
897
- alphabet?: string
898
- }
899
- Returns: string
900
- }
901
- gen_ticket_id: {
902
- Args: Record<PropertyKey, never>
903
- Returns: string
904
- }
905
- get_broadcast_id: {
906
- Args: {
907
- broadcast_id_input: string
908
- chat_id_input?: string
909
- }
910
- Returns: Json
911
- }
912
- get_chats: {
913
- Args: {
914
- chat_id_input?: string[]
915
- with_metadata?: boolean
916
- }
917
- Returns: Json
918
- }
919
- get_contacts: {
920
- Args: {
921
- contact_ids_input?: string[]
922
- }
923
- Returns: Json
924
- }
925
- get_media: {
926
- Args: {
927
- filters?: Json
928
- page_num?: number
929
- }
930
- Returns: Json
931
- }
932
- get_org: {
933
- Args: {
934
- org_id_input?: string
935
- }
936
- Returns: Json
937
- }
938
- list_org_from_user: {
939
- Args: Record<PropertyKey, never>
940
- Returns: string
941
- }
942
- list_role_from_user: {
943
- Args: Record<PropertyKey, never>
944
- Returns: Database["public"]["Enums"]["enum_member_role"]
945
- }
946
- update_labels: {
947
- Args: {
948
- tbl_type: string
949
- label_ids_input: Json
950
- row_id_input: string[]
951
- }
952
- Returns: undefined
953
- }
954
- }
955
- Enums: {
956
- enum_chat_colors:
957
- | "#B4876E"
958
- | "#A5B337"
959
- | "#06CF9C"
960
- | "#25D366"
961
- | "#02A698"
962
- | "#7D9EF1"
963
- | "#007BFC"
964
- | "#5E47DE"
965
- | "#7F66FF"
966
- | "#9333EA"
967
- | "#FA6533"
968
- | "#C4532D"
969
- | "#DC2626"
970
- | "#FF2E74"
971
- | "#DB2777"
972
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
973
- enum_member_role: "admin" | "member"
974
- }
975
- CompositeTypes: {
976
- [_ in never]: never
977
- }
978
- }
979
- storage: {
980
- Tables: {
981
- buckets: {
982
- Row: {
983
- allowed_mime_types: string[] | null
984
- avif_autodetection: boolean | null
985
- created_at: string | null
986
- file_size_limit: number | null
987
- id: string
988
- name: string
989
- owner: string | null
990
- owner_id: string | null
991
- public: boolean | null
992
- updated_at: string | null
993
- }
994
- Insert: {
995
- allowed_mime_types?: string[] | null
996
- avif_autodetection?: boolean | null
997
- created_at?: string | null
998
- file_size_limit?: number | null
999
- id: string
1000
- name: string
1001
- owner?: string | null
1002
- owner_id?: string | null
1003
- public?: boolean | null
1004
- updated_at?: string | null
1005
- }
1006
- Update: {
1007
- allowed_mime_types?: string[] | null
1008
- avif_autodetection?: boolean | null
1009
- created_at?: string | null
1010
- file_size_limit?: number | null
1011
- id?: string
1012
- name?: string
1013
- owner?: string | null
1014
- owner_id?: string | null
1015
- public?: boolean | null
1016
- updated_at?: string | null
1017
- }
1018
- Relationships: []
1019
- }
1020
- migrations: {
1021
- Row: {
1022
- executed_at: string | null
1023
- hash: string
1024
- id: number
1025
- name: string
1026
- }
1027
- Insert: {
1028
- executed_at?: string | null
1029
- hash: string
1030
- id: number
1031
- name: string
1032
- }
1033
- Update: {
1034
- executed_at?: string | null
1035
- hash?: string
1036
- id?: number
1037
- name?: string
1038
- }
1039
- Relationships: []
1040
- }
1041
- objects: {
1042
- Row: {
1043
- bucket_id: string | null
1044
- created_at: string | null
1045
- id: string
1046
- last_accessed_at: string | null
1047
- metadata: Json | null
1048
- name: string | null
1049
- owner: string | null
1050
- owner_id: string | null
1051
- path_tokens: string[] | null
1052
- updated_at: string | null
1053
- version: string | null
1054
- }
1055
- Insert: {
1056
- bucket_id?: string | null
1057
- created_at?: string | null
1058
- id?: string
1059
- last_accessed_at?: string | null
1060
- metadata?: Json | null
1061
- name?: string | null
1062
- owner?: string | null
1063
- owner_id?: string | null
1064
- path_tokens?: string[] | null
1065
- updated_at?: string | null
1066
- version?: string | null
1067
- }
1068
- Update: {
1069
- bucket_id?: string | null
1070
- created_at?: string | null
1071
- id?: string
1072
- last_accessed_at?: string | null
1073
- metadata?: Json | null
1074
- name?: string | null
1075
- owner?: string | null
1076
- owner_id?: string | null
1077
- path_tokens?: string[] | null
1078
- updated_at?: string | null
1079
- version?: string | null
1080
- }
1081
- Relationships: [
1082
- {
1083
- foreignKeyName: "objects_bucketId_fkey"
1084
- columns: ["bucket_id"]
1085
- isOneToOne: false
1086
- referencedRelation: "buckets"
1087
- referencedColumns: ["id"]
1088
- }
1089
- ]
1090
- }
1091
- }
1092
- Views: {
1093
- [_ in never]: never
1094
- }
1095
- Functions: {
1096
- can_insert_object: {
1097
- Args: {
1098
- bucketid: string
1099
- name: string
1100
- owner: string
1101
- metadata: Json
1102
- }
1103
- Returns: undefined
1104
- }
1105
- extension: {
1106
- Args: {
1107
- name: string
1108
- }
1109
- Returns: string
1110
- }
1111
- filename: {
1112
- Args: {
1113
- name: string
1114
- }
1115
- Returns: string
1116
- }
1117
- foldername: {
1118
- Args: {
1119
- name: string
1120
- }
1121
- Returns: unknown
1122
- }
1123
- get_size_by_bucket: {
1124
- Args: Record<PropertyKey, never>
1125
- Returns: {
1126
- size: number
1127
- bucket_id: string
1128
- }[]
1129
- }
1130
- search: {
1131
- Args: {
1132
- prefix: string
1133
- bucketname: string
1134
- limits?: number
1135
- levels?: number
1136
- offsets?: number
1137
- search?: string
1138
- sortcolumn?: string
1139
- sortorder?: string
1140
- }
1141
- Returns: {
1142
- name: string
1143
- id: string
1144
- updated_at: string
1145
- created_at: string
1146
- last_accessed_at: string
1147
- metadata: Json
1148
- }[]
1149
- }
1150
- }
1151
- Enums: {
1152
- [_ in never]: never
1153
- }
1154
- CompositeTypes: {
1155
- [_ in never]: never
1156
- }
1157
- }
1158
- }
1159
-
1160
- export type Tables<
1161
- PublicTableNameOrOptions extends
1162
- | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1163
- | { schema: keyof Database },
1164
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1165
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1166
- Database[PublicTableNameOrOptions["schema"]]["Views"])
1167
- : never = never
1168
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1169
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1170
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1171
- Row: infer R
1172
- }
1173
- ? R
1174
- : never
1175
- : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1176
- Database["public"]["Views"])
1177
- ? (Database["public"]["Tables"] &
1178
- Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1179
- Row: infer R
1180
- }
1181
- ? R
1182
- : never
1183
- : never
1184
-
1185
- export type TablesInsert<
1186
- PublicTableNameOrOptions extends
1187
- | keyof Database["public"]["Tables"]
1188
- | { schema: keyof Database },
1189
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1190
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1191
- : never = never
1192
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1193
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1194
- Insert: infer I
1195
- }
1196
- ? I
1197
- : never
1198
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1199
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1200
- Insert: infer I
1201
- }
1202
- ? I
1203
- : never
1204
- : never
1205
-
1206
- export type TablesUpdate<
1207
- PublicTableNameOrOptions extends
1208
- | keyof Database["public"]["Tables"]
1209
- | { schema: keyof Database },
1210
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1211
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1212
- : never = never
1213
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1214
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1215
- Update: infer U
1216
- }
1217
- ? U
1218
- : never
1219
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1220
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1221
- Update: infer U
1222
- }
1223
- ? U
1224
- : never
1225
- : never
1226
-
1227
- export type Enums<
1228
- PublicEnumNameOrOptions extends
1229
- | keyof Database["public"]["Enums"]
1230
- | { schema: keyof Database },
1231
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1232
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1233
- : never = never
1234
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1235
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1236
- : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1237
- ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1238
- : never
1239
-
1
+ export type Json = { [key: string]: any } | any
2
+
3
+ export interface 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_messages: {
32
+ Row: {
33
+ broadcast_id: string
34
+ chat_ids: string[] | null
35
+ completed_at: string | null
36
+ created_at: string
37
+ message_payload: Json | null
38
+ org_id: string
39
+ scheduled_at: string | null
40
+ sent_by: string | null
41
+ status: string | null
42
+ }
43
+ Insert: {
44
+ broadcast_id?: string
45
+ chat_ids?: string[] | null
46
+ completed_at?: string | null
47
+ created_at?: string
48
+ message_payload?: Json | null
49
+ org_id?: string
50
+ scheduled_at?: string | null
51
+ sent_by?: string | null
52
+ status?: string | null
53
+ }
54
+ Update: {
55
+ broadcast_id?: string
56
+ chat_ids?: string[] | null
57
+ completed_at?: string | null
58
+ created_at?: string
59
+ message_payload?: Json | null
60
+ org_id?: string
61
+ scheduled_at?: string | null
62
+ sent_by?: string | null
63
+ status?: string | null
64
+ }
65
+ Relationships: [
66
+ {
67
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
68
+ columns: ["org_id"]
69
+ isOneToOne: false
70
+ referencedRelation: "tbl_org"
71
+ referencedColumns: ["org_id"]
72
+ }
73
+ ]
74
+ }
75
+ tbl_broadcast_templates: {
76
+ Row: {
77
+ created_at: string
78
+ message_payload: Json | null
79
+ org_id: string
80
+ template_id: string
81
+ template_name: string | null
82
+ updated_at: string | null
83
+ }
84
+ Insert: {
85
+ created_at?: string
86
+ message_payload?: Json | null
87
+ org_id?: string
88
+ template_id?: string
89
+ template_name?: string | null
90
+ updated_at?: string | null
91
+ }
92
+ Update: {
93
+ created_at?: string
94
+ message_payload?: Json | null
95
+ org_id?: string
96
+ template_id?: string
97
+ template_name?: string | null
98
+ updated_at?: string | null
99
+ }
100
+ Relationships: [
101
+ {
102
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
103
+ columns: ["org_id"]
104
+ isOneToOne: false
105
+ referencedRelation: "tbl_org"
106
+ referencedColumns: ["org_id"]
107
+ }
108
+ ]
109
+ }
110
+ tbl_chat_access: {
111
+ Row: {
112
+ chat_id: string
113
+ email: string
114
+ has_access: boolean | null
115
+ last_read_timestamp: string | null
116
+ org_id: string
117
+ }
118
+ Insert: {
119
+ chat_id: string
120
+ email: string
121
+ has_access?: boolean | null
122
+ last_read_timestamp?: string | null
123
+ org_id?: string
124
+ }
125
+ Update: {
126
+ chat_id?: string
127
+ email?: string
128
+ has_access?: boolean | null
129
+ last_read_timestamp?: string | null
130
+ org_id?: string
131
+ }
132
+ Relationships: [
133
+ {
134
+ foreignKeyName: "tbl_chat_access_org_id_fkey"
135
+ columns: ["org_id"]
136
+ isOneToOne: false
137
+ referencedRelation: "tbl_org"
138
+ referencedColumns: ["org_id"]
139
+ }
140
+ ]
141
+ }
142
+ tbl_chat_messages: {
143
+ Row: {
144
+ ack: string | null
145
+ author: string | null
146
+ body: string | null
147
+ broadcast: boolean | null
148
+ broadcast_id: string | null
149
+ chat_id: string | null
150
+ delivery_info: Json | null
151
+ device_type: string | null
152
+ duration: string | null
153
+ forwarding_score: number | null
154
+ from: string | null
155
+ from_me: boolean | null
156
+ has_media: boolean | null
157
+ has_quoted_msg: boolean | null
158
+ has_reaction: boolean | null
159
+ id: Json | null
160
+ invite_v4: Json | null
161
+ is_deleted: boolean | null
162
+ is_ephemeral: boolean | null
163
+ is_forwarded: boolean | null
164
+ is_gif: boolean | null
165
+ is_starred: boolean | null
166
+ is_status: boolean | null
167
+ links: Json | null
168
+ location: Json | null
169
+ media: Json | null
170
+ media_key: string | null
171
+ mentioned_ids: string[] | null
172
+ message_id: string
173
+ message_ticket_id: string | null
174
+ message_type: string | null
175
+ order_id: string | null
176
+ org_id: string
177
+ org_phone: string
178
+ performed_by: string | null
179
+ prev_body: string | null
180
+ quoted_message_id: string | null
181
+ raw_data: Json | null
182
+ sender_phone: string | null
183
+ sent_message_id: string | null
184
+ timestamp: string | null
185
+ to: string | null
186
+ token: string | null
187
+ updated_at: string | null
188
+ vcards: string[] | null
189
+ }
190
+ Insert: {
191
+ ack?: string | null
192
+ author?: string | null
193
+ body?: string | null
194
+ broadcast?: boolean | null
195
+ broadcast_id?: string | null
196
+ chat_id?: string | null
197
+ delivery_info?: Json | null
198
+ device_type?: string | null
199
+ duration?: string | null
200
+ forwarding_score?: number | null
201
+ from?: string | null
202
+ from_me?: boolean | null
203
+ has_media?: boolean | null
204
+ has_quoted_msg?: boolean | null
205
+ has_reaction?: boolean | null
206
+ id?: Json | null
207
+ invite_v4?: Json | null
208
+ is_deleted?: boolean | null
209
+ is_ephemeral?: boolean | null
210
+ is_forwarded?: boolean | null
211
+ is_gif?: boolean | null
212
+ is_starred?: boolean | null
213
+ is_status?: boolean | null
214
+ links?: Json | null
215
+ location?: Json | null
216
+ media?: Json | null
217
+ media_key?: string | null
218
+ mentioned_ids?: string[] | null
219
+ message_id: string
220
+ message_ticket_id?: string | null
221
+ message_type?: string | null
222
+ order_id?: string | null
223
+ org_id: string
224
+ org_phone: string
225
+ performed_by?: string | null
226
+ prev_body?: string | null
227
+ quoted_message_id?: string | null
228
+ raw_data?: Json | null
229
+ sender_phone?: string | null
230
+ sent_message_id?: string | null
231
+ timestamp?: string | null
232
+ to?: string | null
233
+ token?: string | null
234
+ updated_at?: string | null
235
+ vcards?: string[] | null
236
+ }
237
+ Update: {
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
+ updated_at?: string | null
282
+ vcards?: string[] | null
283
+ }
284
+ Relationships: [
285
+ {
286
+ foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
287
+ columns: ["org_id", "org_phone"]
288
+ isOneToOne: false
289
+ referencedRelation: "tbl_org_phones"
290
+ referencedColumns: ["org_id", "org_phone"]
291
+ }
292
+ ]
293
+ }
294
+ tbl_chat_notifications: {
295
+ Row: {
296
+ author: string | null
297
+ body: string | null
298
+ chat_id: string | null
299
+ id: Json | null
300
+ notification_id: string
301
+ org_id: string
302
+ org_phone: string
303
+ recipientids: string[] | null
304
+ timestamp: string | null
305
+ type: string | null
306
+ }
307
+ Insert: {
308
+ author?: string | null
309
+ body?: string | null
310
+ chat_id?: string | null
311
+ id?: Json | null
312
+ notification_id: string
313
+ org_id: string
314
+ org_phone: string
315
+ recipientids?: string[] | null
316
+ timestamp?: string | null
317
+ type?: string | null
318
+ }
319
+ Update: {
320
+ author?: string | null
321
+ body?: string | null
322
+ chat_id?: string | null
323
+ id?: Json | null
324
+ notification_id?: string
325
+ org_id?: string
326
+ org_phone?: string
327
+ recipientids?: string[] | null
328
+ timestamp?: string | null
329
+ type?: string | null
330
+ }
331
+ Relationships: [
332
+ {
333
+ foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
334
+ columns: ["org_id", "org_phone"]
335
+ isOneToOne: false
336
+ referencedRelation: "tbl_org_phones"
337
+ referencedColumns: ["org_id", "org_phone"]
338
+ }
339
+ ]
340
+ }
341
+ tbl_chat_participants: {
342
+ Row: {
343
+ chat_id: string
344
+ contact_id: string
345
+ id: Json | null
346
+ is_admin: boolean | null
347
+ is_super_admin: boolean | null
348
+ org_id: string
349
+ org_phone: string
350
+ }
351
+ Insert: {
352
+ chat_id: string
353
+ contact_id: string
354
+ id?: Json | null
355
+ is_admin?: boolean | null
356
+ is_super_admin?: boolean | null
357
+ org_id: string
358
+ org_phone: string
359
+ }
360
+ Update: {
361
+ chat_id?: string
362
+ contact_id?: string
363
+ id?: Json | null
364
+ is_admin?: boolean | null
365
+ is_super_admin?: boolean | null
366
+ org_id?: string
367
+ org_phone?: string
368
+ }
369
+ Relationships: [
370
+ {
371
+ foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
372
+ columns: ["org_id", "org_phone", "chat_id"]
373
+ isOneToOne: false
374
+ referencedRelation: "tbl_chats"
375
+ referencedColumns: ["org_id", "org_phone", "chat_id"]
376
+ },
377
+ {
378
+ foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
379
+ columns: ["org_id", "org_phone", "chat_id"]
380
+ isOneToOne: false
381
+ referencedRelation: "view_chats"
382
+ referencedColumns: ["org_id", "org_phone", "chat_id"]
383
+ }
384
+ ]
385
+ }
386
+ tbl_chat_reactions: {
387
+ Row: {
388
+ ack: number | null
389
+ id: Json | null
390
+ message_id: string | null
391
+ msg_id: Json | null
392
+ org_id: string
393
+ org_phone: string
394
+ orphan: number | null
395
+ orphan_reason: string | null
396
+ reaction: string | null
397
+ reaction_id: string
398
+ read: boolean | null
399
+ sender_id: string | null
400
+ timestamp: string | null
401
+ }
402
+ Insert: {
403
+ ack?: number | null
404
+ id?: Json | null
405
+ message_id?: string | null
406
+ msg_id?: Json | null
407
+ org_id: string
408
+ org_phone: string
409
+ orphan?: number | null
410
+ orphan_reason?: string | null
411
+ reaction?: string | null
412
+ reaction_id: string
413
+ read?: boolean | null
414
+ sender_id?: string | null
415
+ timestamp?: string | null
416
+ }
417
+ Update: {
418
+ ack?: number | null
419
+ id?: Json | null
420
+ message_id?: string | null
421
+ msg_id?: Json | null
422
+ org_id?: string
423
+ org_phone?: string
424
+ orphan?: number | null
425
+ orphan_reason?: string | null
426
+ reaction?: string | null
427
+ reaction_id?: string
428
+ read?: boolean | null
429
+ sender_id?: string | null
430
+ timestamp?: string | null
431
+ }
432
+ Relationships: [
433
+ {
434
+ foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
435
+ columns: ["org_id", "org_phone"]
436
+ isOneToOne: false
437
+ referencedRelation: "tbl_org_phones"
438
+ referencedColumns: ["org_id", "org_phone"]
439
+ }
440
+ ]
441
+ }
442
+ tbl_chat_tickets: {
443
+ Row: {
444
+ assigned_by: string | null
445
+ assignee: string | null
446
+ chat_id: string
447
+ created_at: string
448
+ due_date: string | null
449
+ label_ids: Json | null
450
+ last_updated_at: string
451
+ org_id: string
452
+ priority: number | null
453
+ quoted_message_id: string
454
+ raised_by: string | null
455
+ status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
456
+ subject: string
457
+ ticket_id: string
458
+ }
459
+ Insert: {
460
+ assigned_by?: string | null
461
+ assignee?: string | null
462
+ chat_id: string
463
+ created_at?: string
464
+ due_date?: string | null
465
+ label_ids?: Json | null
466
+ last_updated_at?: string
467
+ org_id: string
468
+ priority?: number | null
469
+ quoted_message_id: string
470
+ raised_by?: string | null
471
+ status?:
472
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
473
+ | null
474
+ subject: string
475
+ ticket_id?: string
476
+ }
477
+ Update: {
478
+ assigned_by?: string | null
479
+ assignee?: string | null
480
+ chat_id?: string
481
+ created_at?: string
482
+ due_date?: string | null
483
+ label_ids?: Json | null
484
+ last_updated_at?: string
485
+ org_id?: string
486
+ priority?: number | null
487
+ quoted_message_id?: string
488
+ raised_by?: string | null
489
+ status?:
490
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
491
+ | null
492
+ subject?: string
493
+ ticket_id?: string
494
+ }
495
+ Relationships: [
496
+ {
497
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
498
+ columns: ["org_id"]
499
+ isOneToOne: false
500
+ referencedRelation: "tbl_org"
501
+ referencedColumns: ["org_id"]
502
+ }
503
+ ]
504
+ }
505
+ tbl_chats: {
506
+ Row: {
507
+ archived: boolean | null
508
+ chat_id: string
509
+ chat_image: string | null
510
+ group_metadata: Json | null
511
+ id: Json | null
512
+ invite_link: string | null
513
+ is_group: boolean | null
514
+ is_muted: boolean | null
515
+ is_read_only: boolean | null
516
+ label_ids: Json
517
+ mute_expiration: number | null
518
+ name: string | null
519
+ org_id: string
520
+ org_phone: string
521
+ pinned: boolean | null
522
+ timestamp: string | null
523
+ unread_count: number | null
524
+ updated_at: string
525
+ }
526
+ Insert: {
527
+ archived?: boolean | null
528
+ chat_id: string
529
+ chat_image?: string | null
530
+ group_metadata?: Json | null
531
+ id?: Json | null
532
+ invite_link?: string | null
533
+ is_group?: boolean | null
534
+ is_muted?: boolean | null
535
+ is_read_only?: boolean | null
536
+ label_ids?: Json
537
+ mute_expiration?: number | null
538
+ name?: string | null
539
+ org_id: string
540
+ org_phone: string
541
+ pinned?: boolean | null
542
+ timestamp?: string | null
543
+ unread_count?: number | null
544
+ updated_at?: string
545
+ }
546
+ Update: {
547
+ archived?: boolean | null
548
+ chat_id?: string
549
+ chat_image?: string | null
550
+ group_metadata?: Json | null
551
+ id?: Json | null
552
+ invite_link?: string | null
553
+ is_group?: boolean | null
554
+ is_muted?: boolean | null
555
+ is_read_only?: boolean | null
556
+ label_ids?: Json
557
+ mute_expiration?: number | null
558
+ name?: string | null
559
+ org_id?: string
560
+ org_phone?: string
561
+ pinned?: boolean | null
562
+ timestamp?: string | null
563
+ unread_count?: number | null
564
+ updated_at?: string
565
+ }
566
+ Relationships: [
567
+ {
568
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
569
+ columns: ["org_phone", "org_id"]
570
+ isOneToOne: false
571
+ referencedRelation: "tbl_org_phones"
572
+ referencedColumns: ["org_phone", "org_id"]
573
+ }
574
+ ]
575
+ }
576
+ tbl_contacts: {
577
+ Row: {
578
+ business_profile: Json | null
579
+ contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
580
+ contact_id: string
581
+ contact_image: string | null
582
+ contact_name: string | null
583
+ contact_type: string | null
584
+ id: Json | null
585
+ is_blocked: boolean | null
586
+ is_business: boolean | null
587
+ is_enterprise: boolean | null
588
+ is_group: boolean | null
589
+ is_internal: boolean | null
590
+ is_me: boolean | null
591
+ is_my_contact: boolean | null
592
+ is_user: boolean | null
593
+ is_wa_contact: boolean | null
594
+ label_ids: Json
595
+ name: string | null
596
+ number: string | null
597
+ org_id: string
598
+ pushname: string | null
599
+ short_name: string | null
600
+ updated_at: string | null
601
+ verified_level: number | null
602
+ verified_name: string | null
603
+ }
604
+ Insert: {
605
+ business_profile?: Json | null
606
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
607
+ contact_id: string
608
+ contact_image?: string | null
609
+ contact_name?: string | null
610
+ contact_type?: string | null
611
+ id?: Json | null
612
+ is_blocked?: boolean | null
613
+ is_business?: boolean | null
614
+ is_enterprise?: boolean | null
615
+ is_group?: boolean | null
616
+ is_internal?: boolean | null
617
+ is_me?: boolean | null
618
+ is_my_contact?: boolean | null
619
+ is_user?: boolean | null
620
+ is_wa_contact?: boolean | null
621
+ label_ids?: Json
622
+ name?: string | null
623
+ number?: string | null
624
+ org_id: string
625
+ pushname?: string | null
626
+ short_name?: string | null
627
+ updated_at?: string | null
628
+ verified_level?: number | null
629
+ verified_name?: string | null
630
+ }
631
+ Update: {
632
+ business_profile?: Json | null
633
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
634
+ contact_id?: string
635
+ contact_image?: string | null
636
+ contact_name?: string | null
637
+ contact_type?: string | null
638
+ id?: Json | null
639
+ is_blocked?: boolean | null
640
+ is_business?: boolean | null
641
+ is_enterprise?: boolean | null
642
+ is_group?: boolean | null
643
+ is_internal?: boolean | null
644
+ is_me?: boolean | null
645
+ is_my_contact?: boolean | null
646
+ is_user?: boolean | null
647
+ is_wa_contact?: boolean | null
648
+ label_ids?: Json
649
+ name?: string | null
650
+ number?: string | null
651
+ org_id?: string
652
+ pushname?: string | null
653
+ short_name?: string | null
654
+ updated_at?: string | null
655
+ verified_level?: number | null
656
+ verified_name?: string | null
657
+ }
658
+ Relationships: [
659
+ {
660
+ foreignKeyName: "tbl_contacts_org_id_fkey"
661
+ columns: ["org_id"]
662
+ isOneToOne: false
663
+ referencedRelation: "tbl_org"
664
+ referencedColumns: ["org_id"]
665
+ }
666
+ ]
667
+ }
668
+ tbl_org: {
669
+ Row: {
670
+ created_at: string
671
+ org_id: string
672
+ org_image: string | null
673
+ org_metadata: Json | null
674
+ org_name: string | null
675
+ support_link: string | null
676
+ }
677
+ Insert: {
678
+ created_at?: string
679
+ org_id?: string
680
+ org_image?: string | null
681
+ org_metadata?: Json | null
682
+ org_name?: string | null
683
+ support_link?: string | null
684
+ }
685
+ Update: {
686
+ created_at?: string
687
+ org_id?: string
688
+ org_image?: string | null
689
+ org_metadata?: Json | null
690
+ org_name?: string | null
691
+ support_link?: string | null
692
+ }
693
+ Relationships: []
694
+ }
695
+ tbl_org_labels: {
696
+ Row: {
697
+ color: string
698
+ created_at: string
699
+ label_id: string
700
+ name: string
701
+ org_id: string
702
+ type: string
703
+ }
704
+ Insert: {
705
+ color?: string
706
+ created_at?: string
707
+ label_id?: string
708
+ name: string
709
+ org_id?: string
710
+ type?: string
711
+ }
712
+ Update: {
713
+ color?: string
714
+ created_at?: string
715
+ label_id?: string
716
+ name?: string
717
+ org_id?: string
718
+ type?: string
719
+ }
720
+ Relationships: [
721
+ {
722
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
723
+ columns: ["org_id"]
724
+ isOneToOne: false
725
+ referencedRelation: "tbl_org"
726
+ referencedColumns: ["org_id"]
727
+ }
728
+ ]
729
+ }
730
+ tbl_org_members: {
731
+ Row: {
732
+ created_at: string | null
733
+ email: string
734
+ invited_at: string | null
735
+ invited_by: string | null
736
+ is_active: boolean
737
+ member_image: string | null
738
+ member_name: string | null
739
+ org_id: string
740
+ role: Database["public"]["Enums"]["enum_member_role"]
741
+ user_id: string | null
742
+ }
743
+ Insert: {
744
+ created_at?: string | null
745
+ email: string
746
+ invited_at?: string | null
747
+ invited_by?: string | null
748
+ is_active?: boolean
749
+ member_image?: string | null
750
+ member_name?: string | null
751
+ org_id: string
752
+ role?: Database["public"]["Enums"]["enum_member_role"]
753
+ user_id?: string | null
754
+ }
755
+ Update: {
756
+ created_at?: string | null
757
+ email?: string
758
+ invited_at?: string | null
759
+ invited_by?: string | null
760
+ is_active?: boolean
761
+ member_image?: string | null
762
+ member_name?: string | null
763
+ org_id?: string
764
+ role?: Database["public"]["Enums"]["enum_member_role"]
765
+ user_id?: string | null
766
+ }
767
+ Relationships: [
768
+ {
769
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
770
+ columns: ["user_id"]
771
+ isOneToOne: false
772
+ referencedRelation: "users"
773
+ referencedColumns: ["id"]
774
+ },
775
+ {
776
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
777
+ columns: ["org_id"]
778
+ isOneToOne: false
779
+ referencedRelation: "tbl_org"
780
+ referencedColumns: ["org_id"]
781
+ }
782
+ ]
783
+ }
784
+ tbl_org_phones: {
785
+ Row: {
786
+ created_at: string
787
+ is_ready: boolean | null
788
+ org_id: string
789
+ org_phone: string | null
790
+ phone_id: string
791
+ phone_image: string | null
792
+ phone_name: string | null
793
+ qr_code: string | null
794
+ server_ip: string | null
795
+ updated_at: string
796
+ wa_state: string | null
797
+ }
798
+ Insert: {
799
+ created_at?: string
800
+ is_ready?: boolean | null
801
+ org_id: string
802
+ org_phone?: string | null
803
+ phone_id?: string
804
+ phone_image?: string | null
805
+ phone_name?: string | null
806
+ qr_code?: string | null
807
+ server_ip?: string | null
808
+ updated_at?: string
809
+ wa_state?: string | null
810
+ }
811
+ Update: {
812
+ created_at?: string
813
+ is_ready?: boolean | null
814
+ org_id?: string
815
+ org_phone?: string | null
816
+ phone_id?: string
817
+ phone_image?: string | null
818
+ phone_name?: string | null
819
+ qr_code?: string | null
820
+ server_ip?: string | null
821
+ updated_at?: string
822
+ wa_state?: string | null
823
+ }
824
+ Relationships: [
825
+ {
826
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
827
+ columns: ["org_id"]
828
+ isOneToOne: false
829
+ referencedRelation: "tbl_org"
830
+ referencedColumns: ["org_id"]
831
+ }
832
+ ]
833
+ }
834
+ }
835
+ Views: {
836
+ view_broadcast_logs: {
837
+ Row: {
838
+ broadcast_id: string | null
839
+ completed_at: string | null
840
+ delivered_member_count: number | null
841
+ failed_chats: number | null
842
+ message_payload: Json | null
843
+ org_id: string | null
844
+ read_member_count: number | null
845
+ scheduled_at: string | null
846
+ sent_chats: number | null
847
+ status: string | null
848
+ total_chats: number | null
849
+ total_member_count: number | null
850
+ }
851
+ Relationships: [
852
+ {
853
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
854
+ columns: ["org_id"]
855
+ isOneToOne: false
856
+ referencedRelation: "tbl_org"
857
+ referencedColumns: ["org_id"]
858
+ }
859
+ ]
860
+ }
861
+ view_chats: {
862
+ Row: {
863
+ archived: boolean | null
864
+ chat_access: Json | null
865
+ chat_id: string | null
866
+ chat_image: string | null
867
+ chat_name: string | null
868
+ chat_type: string | null
869
+ group_metadata: Json | null
870
+ has_access: boolean | null
871
+ id: Json | null
872
+ invite_link: string | null
873
+ is_group: boolean | null
874
+ is_muted: boolean | null
875
+ is_read_only: boolean | null
876
+ label_ids: Json | null
877
+ last_read_timestamp: string | null
878
+ latest_message: Json | null
879
+ latest_message_timestamp: string | null
880
+ member_count: number | null
881
+ message_unread_count: number | null
882
+ mute_expiration: number | null
883
+ name: string | null
884
+ org_id: string | null
885
+ org_phone: string | null
886
+ pinned: boolean | null
887
+ timestamp: string | null
888
+ unread_count: number | null
889
+ updated_at: string | null
890
+ }
891
+ Relationships: [
892
+ {
893
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
894
+ columns: ["org_phone", "org_id"]
895
+ isOneToOne: false
896
+ referencedRelation: "tbl_org_phones"
897
+ referencedColumns: ["org_phone", "org_id"]
898
+ }
899
+ ]
900
+ }
901
+ }
902
+ Functions: {
903
+ gen_id: {
904
+ Args: {
905
+ prefix: string
906
+ size?: number
907
+ alphabet?: string
908
+ }
909
+ Returns: string
910
+ }
911
+ gen_ticket_id: {
912
+ Args: Record<PropertyKey, never>
913
+ Returns: string
914
+ }
915
+ get_broadcast_id: {
916
+ Args: {
917
+ broadcast_id_input: string
918
+ chat_id_input?: string
919
+ }
920
+ Returns: Json
921
+ }
922
+ get_chats: {
923
+ Args: {
924
+ chat_id_input?: string[]
925
+ with_metadata?: boolean
926
+ last_updated_at_input?: string
927
+ }
928
+ Returns: Json
929
+ }
930
+ get_contacts: {
931
+ Args: {
932
+ contact_ids_input?: string[]
933
+ last_updated_at_input?: string
934
+ }
935
+ Returns: Json
936
+ }
937
+ get_dashboard_statistics: {
938
+ Args: {
939
+ org_id_input?: string
940
+ }
941
+ Returns: Json
942
+ }
943
+ get_media: {
944
+ Args: {
945
+ filters?: Json
946
+ page_num?: number
947
+ }
948
+ Returns: Json
949
+ }
950
+ get_org: {
951
+ Args: {
952
+ org_id_input?: string
953
+ }
954
+ Returns: Json
955
+ }
956
+ list_org_from_user: {
957
+ Args: Record<PropertyKey, never>
958
+ Returns: string
959
+ }
960
+ list_role_from_user: {
961
+ Args: Record<PropertyKey, never>
962
+ Returns: Database["public"]["Enums"]["enum_member_role"]
963
+ }
964
+ update_labels: {
965
+ Args: {
966
+ tbl_type: string
967
+ label_ids_input: Json
968
+ row_id_input: string[]
969
+ }
970
+ Returns: undefined
971
+ }
972
+ }
973
+ Enums: {
974
+ enum_chat_colors:
975
+ | "#B4876E"
976
+ | "#A5B337"
977
+ | "#06CF9C"
978
+ | "#25D366"
979
+ | "#02A698"
980
+ | "#7D9EF1"
981
+ | "#007BFC"
982
+ | "#5E47DE"
983
+ | "#7F66FF"
984
+ | "#9333EA"
985
+ | "#FA6533"
986
+ | "#C4532D"
987
+ | "#DC2626"
988
+ | "#FF2E74"
989
+ | "#DB2777"
990
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
991
+ enum_member_role: "admin" | "member"
992
+ }
993
+ CompositeTypes: {
994
+ [_ in never]: never
995
+ }
996
+ }
997
+ storage: {
998
+ Tables: {
999
+ buckets: {
1000
+ Row: {
1001
+ allowed_mime_types: string[] | null
1002
+ avif_autodetection: boolean | null
1003
+ created_at: string | null
1004
+ file_size_limit: number | null
1005
+ id: string
1006
+ name: string
1007
+ owner: string | null
1008
+ owner_id: string | null
1009
+ public: boolean | null
1010
+ updated_at: string | null
1011
+ }
1012
+ Insert: {
1013
+ allowed_mime_types?: string[] | null
1014
+ avif_autodetection?: boolean | null
1015
+ created_at?: string | null
1016
+ file_size_limit?: number | null
1017
+ id: string
1018
+ name: string
1019
+ owner?: string | null
1020
+ owner_id?: string | null
1021
+ public?: boolean | null
1022
+ updated_at?: string | null
1023
+ }
1024
+ Update: {
1025
+ allowed_mime_types?: string[] | null
1026
+ avif_autodetection?: boolean | null
1027
+ created_at?: string | null
1028
+ file_size_limit?: number | null
1029
+ id?: string
1030
+ name?: string
1031
+ owner?: string | null
1032
+ owner_id?: string | null
1033
+ public?: boolean | null
1034
+ updated_at?: string | null
1035
+ }
1036
+ Relationships: []
1037
+ }
1038
+ migrations: {
1039
+ Row: {
1040
+ executed_at: string | null
1041
+ hash: string
1042
+ id: number
1043
+ name: string
1044
+ }
1045
+ Insert: {
1046
+ executed_at?: string | null
1047
+ hash: string
1048
+ id: number
1049
+ name: string
1050
+ }
1051
+ Update: {
1052
+ executed_at?: string | null
1053
+ hash?: string
1054
+ id?: number
1055
+ name?: string
1056
+ }
1057
+ Relationships: []
1058
+ }
1059
+ objects: {
1060
+ Row: {
1061
+ bucket_id: string | null
1062
+ created_at: string | null
1063
+ id: string
1064
+ last_accessed_at: string | null
1065
+ metadata: Json | null
1066
+ name: string | null
1067
+ owner: string | null
1068
+ owner_id: string | null
1069
+ path_tokens: string[] | null
1070
+ updated_at: string | null
1071
+ version: string | null
1072
+ }
1073
+ Insert: {
1074
+ bucket_id?: string | null
1075
+ created_at?: string | null
1076
+ id?: string
1077
+ last_accessed_at?: string | null
1078
+ metadata?: Json | null
1079
+ name?: string | null
1080
+ owner?: string | null
1081
+ owner_id?: string | null
1082
+ path_tokens?: string[] | null
1083
+ updated_at?: string | null
1084
+ version?: string | null
1085
+ }
1086
+ Update: {
1087
+ bucket_id?: string | null
1088
+ created_at?: string | null
1089
+ id?: string
1090
+ last_accessed_at?: string | null
1091
+ metadata?: Json | null
1092
+ name?: string | null
1093
+ owner?: string | null
1094
+ owner_id?: string | null
1095
+ path_tokens?: string[] | null
1096
+ updated_at?: string | null
1097
+ version?: string | null
1098
+ }
1099
+ Relationships: [
1100
+ {
1101
+ foreignKeyName: "objects_bucketId_fkey"
1102
+ columns: ["bucket_id"]
1103
+ isOneToOne: false
1104
+ referencedRelation: "buckets"
1105
+ referencedColumns: ["id"]
1106
+ }
1107
+ ]
1108
+ }
1109
+ }
1110
+ Views: {
1111
+ [_ in never]: never
1112
+ }
1113
+ Functions: {
1114
+ can_insert_object: {
1115
+ Args: {
1116
+ bucketid: string
1117
+ name: string
1118
+ owner: string
1119
+ metadata: Json
1120
+ }
1121
+ Returns: undefined
1122
+ }
1123
+ extension: {
1124
+ Args: {
1125
+ name: string
1126
+ }
1127
+ Returns: string
1128
+ }
1129
+ filename: {
1130
+ Args: {
1131
+ name: string
1132
+ }
1133
+ Returns: string
1134
+ }
1135
+ foldername: {
1136
+ Args: {
1137
+ name: string
1138
+ }
1139
+ Returns: unknown
1140
+ }
1141
+ get_size_by_bucket: {
1142
+ Args: Record<PropertyKey, never>
1143
+ Returns: {
1144
+ size: number
1145
+ bucket_id: string
1146
+ }[]
1147
+ }
1148
+ search: {
1149
+ Args: {
1150
+ prefix: string
1151
+ bucketname: string
1152
+ limits?: number
1153
+ levels?: number
1154
+ offsets?: number
1155
+ search?: string
1156
+ sortcolumn?: string
1157
+ sortorder?: string
1158
+ }
1159
+ Returns: {
1160
+ name: string
1161
+ id: string
1162
+ updated_at: string
1163
+ created_at: string
1164
+ last_accessed_at: string
1165
+ metadata: Json
1166
+ }[]
1167
+ }
1168
+ }
1169
+ Enums: {
1170
+ [_ in never]: never
1171
+ }
1172
+ CompositeTypes: {
1173
+ [_ in never]: never
1174
+ }
1175
+ }
1176
+ }
1177
+
1178
+ export type Tables<
1179
+ PublicTableNameOrOptions extends
1180
+ | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1181
+ | { schema: keyof Database },
1182
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1183
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1184
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
1185
+ : never = never
1186
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1187
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1188
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1189
+ Row: infer R
1190
+ }
1191
+ ? R
1192
+ : never
1193
+ : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1194
+ Database["public"]["Views"])
1195
+ ? (Database["public"]["Tables"] &
1196
+ Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1197
+ Row: infer R
1198
+ }
1199
+ ? R
1200
+ : never
1201
+ : never
1202
+
1203
+ export type TablesInsert<
1204
+ PublicTableNameOrOptions extends
1205
+ | keyof Database["public"]["Tables"]
1206
+ | { schema: keyof Database },
1207
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1208
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1209
+ : never = never
1210
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1211
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1212
+ Insert: infer I
1213
+ }
1214
+ ? I
1215
+ : never
1216
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1217
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1218
+ Insert: infer I
1219
+ }
1220
+ ? I
1221
+ : never
1222
+ : never
1223
+
1224
+ export type TablesUpdate<
1225
+ PublicTableNameOrOptions extends
1226
+ | keyof Database["public"]["Tables"]
1227
+ | { schema: keyof Database },
1228
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1229
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1230
+ : never = never
1231
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1232
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1233
+ Update: infer U
1234
+ }
1235
+ ? U
1236
+ : never
1237
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1238
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1239
+ Update: infer U
1240
+ }
1241
+ ? U
1242
+ : never
1243
+ : never
1244
+
1245
+ export type Enums<
1246
+ PublicEnumNameOrOptions extends
1247
+ | keyof Database["public"]["Enums"]
1248
+ | { schema: keyof Database },
1249
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1250
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1251
+ : never = never
1252
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
1253
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1254
+ : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1255
+ ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1256
+ : never
1257
+
1240
1258