@periskope/types 0.6.28 → 0.6.30

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