@periskope/types 0.6.38 → 0.6.40

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