@periskope/types 0.6.41 → 0.6.42

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,1375 +1,1385 @@
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_email_fkey"
135
- columns: ["org_id", "email"]
136
- isOneToOne: false
137
- referencedRelation: "tbl_org_members"
138
- referencedColumns: ["org_id", "email"]
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_color: Database["public"]["Enums"]["enum_chat_colors"]
753
- member_image: string | null
754
- member_name: string | null
755
- org_id: string
756
- role: Database["public"]["Enums"]["enum_member_role"]
757
- user_id: string | null
758
- }
759
- Insert: {
760
- created_at?: string | null
761
- email: string
762
- invited_at?: string | null
763
- invited_by?: string | null
764
- is_active?: boolean
765
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
766
- member_image?: string | null
767
- member_name?: string | null
768
- org_id: string
769
- role?: Database["public"]["Enums"]["enum_member_role"]
770
- user_id?: string | null
771
- }
772
- Update: {
773
- created_at?: string | null
774
- email?: string
775
- invited_at?: string | null
776
- invited_by?: string | null
777
- is_active?: boolean
778
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
779
- member_image?: string | null
780
- member_name?: string | null
781
- org_id?: string
782
- role?: Database["public"]["Enums"]["enum_member_role"]
783
- user_id?: string | null
784
- }
785
- Relationships: [
786
- {
787
- foreignKeyName: "tbl_org_members_fkey_auth_users"
788
- columns: ["user_id"]
789
- isOneToOne: false
790
- referencedRelation: "users"
791
- referencedColumns: ["id"]
792
- },
793
- {
794
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
795
- columns: ["org_id"]
796
- isOneToOne: false
797
- referencedRelation: "tbl_org"
798
- referencedColumns: ["org_id"]
799
- }
800
- ]
801
- }
802
- tbl_org_phones: {
803
- Row: {
804
- created_at: string
805
- is_ready: boolean | null
806
- org_id: string
807
- org_phone: string | null
808
- phone_id: string
809
- phone_image: string | null
810
- phone_name: string | null
811
- qr_code: string | null
812
- server_ip: string | null
813
- updated_at: string
814
- wa_state: string | null
815
- }
816
- Insert: {
817
- created_at?: string
818
- is_ready?: boolean | null
819
- org_id?: string
820
- org_phone?: string | null
821
- phone_id?: string
822
- phone_image?: string | null
823
- phone_name?: string | null
824
- qr_code?: string | null
825
- server_ip?: string | null
826
- updated_at?: string
827
- wa_state?: string | null
828
- }
829
- Update: {
830
- created_at?: string
831
- is_ready?: boolean | null
832
- org_id?: string
833
- org_phone?: string | null
834
- phone_id?: string
835
- phone_image?: string | null
836
- phone_name?: string | null
837
- qr_code?: string | null
838
- server_ip?: string | null
839
- updated_at?: string
840
- wa_state?: string | null
841
- }
842
- Relationships: [
843
- {
844
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
845
- columns: ["org_id"]
846
- isOneToOne: false
847
- referencedRelation: "tbl_org"
848
- referencedColumns: ["org_id"]
849
- },
850
- {
851
- foreignKeyName: "tbl_org_phones_org_id_fkey"
852
- columns: ["org_id"]
853
- isOneToOne: false
854
- referencedRelation: "tbl_org"
855
- referencedColumns: ["org_id"]
856
- }
857
- ]
858
- }
859
- }
860
- Views: {
861
- view_broadcast_logs: {
862
- Row: {
863
- broadcast_id: string | null
864
- completed_at: string | null
865
- created_at: string | null
866
- delivered_member_count: number | null
867
- delivery_percentage: number | null
868
- failed_chats: number | null
869
- message_payload: Json | null
870
- org_id: string | null
871
- performed_by: string | null
872
- read_member_count: number | null
873
- read_percentage: number | null
874
- scheduled_at: string | null
875
- sent_chats: number | null
876
- total_chats: number | null
877
- total_member_count: number | null
878
- }
879
- Relationships: [
880
- {
881
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
882
- columns: ["org_id"]
883
- isOneToOne: false
884
- referencedRelation: "tbl_org"
885
- referencedColumns: ["org_id"]
886
- }
887
- ]
888
- }
889
- view_chat_messages: {
890
- Row: {
891
- ack: string | null
892
- author: string | null
893
- body: string | null
894
- broadcast_id: string | null
895
- chat_id: string | null
896
- delivery_info: Json | null
897
- from_me: boolean | null
898
- invite_v4: Json | null
899
- is_deleted: boolean | null
900
- links: Json | null
901
- location: Json | null
902
- media: Json | null
903
- mentioned_ids: string[] | null
904
- message_id: string | null
905
- message_ticket_id: string | null
906
- message_type: string | null
907
- org_id: string | null
908
- org_phone: string | null
909
- performed_by: string | null
910
- prev_body: string | null
911
- quoted_message_id: string | null
912
- sender_phone: string | null
913
- sent_message_id: string | null
914
- timestamp: string | null
915
- unique_id: string | null
916
- updated_at: string | null
917
- vcards: string[] | null
918
- }
919
- Insert: {
920
- ack?: string | null
921
- author?: string | null
922
- body?: string | null
923
- broadcast_id?: string | null
924
- chat_id?: string | null
925
- delivery_info?: Json | null
926
- from_me?: boolean | null
927
- invite_v4?: Json | null
928
- is_deleted?: boolean | null
929
- links?: Json | null
930
- location?: Json | null
931
- media?: Json | null
932
- mentioned_ids?: string[] | null
933
- message_id?: string | null
934
- message_ticket_id?: string | null
935
- message_type?: string | null
936
- org_id?: string | null
937
- org_phone?: string | null
938
- performed_by?: string | null
939
- prev_body?: string | null
940
- quoted_message_id?: string | null
941
- sender_phone?: string | null
942
- sent_message_id?: string | null
943
- timestamp?: string | null
944
- unique_id?: string | null
945
- updated_at?: string | null
946
- vcards?: string[] | null
947
- }
948
- Update: {
949
- ack?: string | null
950
- author?: string | null
951
- body?: string | null
952
- broadcast_id?: string | null
953
- chat_id?: string | null
954
- delivery_info?: Json | null
955
- from_me?: boolean | null
956
- invite_v4?: Json | null
957
- is_deleted?: boolean | null
958
- links?: Json | null
959
- location?: Json | null
960
- media?: Json | null
961
- mentioned_ids?: string[] | null
962
- message_id?: string | null
963
- message_ticket_id?: string | null
964
- message_type?: string | null
965
- org_id?: string | null
966
- org_phone?: string | null
967
- performed_by?: string | null
968
- prev_body?: string | null
969
- quoted_message_id?: string | null
970
- sender_phone?: string | null
971
- sent_message_id?: string | null
972
- timestamp?: string | null
973
- unique_id?: string | null
974
- updated_at?: string | null
975
- vcards?: string[] | null
976
- }
977
- Relationships: [
978
- {
979
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
980
- columns: ["org_phone", "org_id"]
981
- isOneToOne: false
982
- referencedRelation: "tbl_org_phones"
983
- referencedColumns: ["org_phone", "org_id"]
984
- }
985
- ]
986
- }
987
- view_chats: {
988
- Row: {
989
- active_phone: string | null
990
- chat_access: Json | null
991
- chat_id: string | null
992
- chat_image: string | null
993
- chat_name: string | null
994
- chat_org_phones: string[] | null
995
- chat_type: string | null
996
- has_access: boolean | null
997
- invite_link: string | null
998
- label_ids: Json | null
999
- last_read_timestamp: string | null
1000
- latest_message: Json | null
1001
- member_count: number | null
1002
- message_unread_count: number | null
1003
- org_id: string | null
1004
- org_phone: string | null
1005
- updated_at: string | null
1006
- }
1007
- Relationships: [
1008
- {
1009
- foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
1010
- columns: ["org_phone", "org_id"]
1011
- isOneToOne: false
1012
- referencedRelation: "tbl_org_phones"
1013
- referencedColumns: ["org_phone", "org_id"]
1014
- }
1015
- ]
1016
- }
1017
- }
1018
- Functions: {
1019
- gen_id: {
1020
- Args: {
1021
- prefix: string
1022
- size?: number
1023
- alphabet?: string
1024
- }
1025
- Returns: string
1026
- }
1027
- gen_ticket_id: {
1028
- Args: Record<PropertyKey, never>
1029
- Returns: string
1030
- }
1031
- get_broadcast_id: {
1032
- Args: {
1033
- broadcast_id_input: string
1034
- chat_id_input?: string
1035
- }
1036
- Returns: Json
1037
- }
1038
- get_chat_labels_data: {
1039
- Args: {
1040
- chat_ids_input?: string[]
1041
- }
1042
- Returns: unknown
1043
- }
1044
- get_chats: {
1045
- Args: {
1046
- chat_id_input?: string[]
1047
- with_metadata?: boolean
1048
- last_updated_at_input?: string
1049
- }
1050
- Returns: Json
1051
- }
1052
- get_contacts: {
1053
- Args: {
1054
- contact_ids_input?: string[]
1055
- last_updated_at_input?: string
1056
- }
1057
- Returns: Json
1058
- }
1059
- get_export_chats_data: {
1060
- Args: {
1061
- chat_ids: string[]
1062
- org_id_input?: string
1063
- }
1064
- Returns: Json
1065
- }
1066
- get_org: {
1067
- Args: {
1068
- org_id_input?: string
1069
- }
1070
- Returns: Json
1071
- }
1072
- list_org_from_user: {
1073
- Args: Record<PropertyKey, never>
1074
- Returns: string
1075
- }
1076
- list_role_from_user: {
1077
- Args: Record<PropertyKey, never>
1078
- Returns: Database["public"]["Enums"]["enum_member_role"]
1079
- }
1080
- update_labels: {
1081
- Args: {
1082
- tbl_type: string
1083
- label_ids_input: Json
1084
- row_id_input: string[]
1085
- replace_labels?: boolean
1086
- }
1087
- Returns: undefined
1088
- }
1089
- }
1090
- Enums: {
1091
- enum_chat_colors:
1092
- | "#B4876E"
1093
- | "#A5B337"
1094
- | "#06CF9C"
1095
- | "#25D366"
1096
- | "#02A698"
1097
- | "#7D9EF1"
1098
- | "#007BFC"
1099
- | "#5E47DE"
1100
- | "#7F66FF"
1101
- | "#9333EA"
1102
- | "#FA6533"
1103
- | "#C4532D"
1104
- | "#DC2626"
1105
- | "#FF2E74"
1106
- | "#DB2777"
1107
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1108
- enum_member_role: "admin" | "member"
1109
- }
1110
- CompositeTypes: {
1111
- [_ in never]: never
1112
- }
1113
- }
1114
- storage: {
1115
- Tables: {
1116
- buckets: {
1117
- Row: {
1118
- allowed_mime_types: string[] | null
1119
- avif_autodetection: boolean | null
1120
- created_at: string | null
1121
- file_size_limit: number | null
1122
- id: string
1123
- name: string
1124
- owner: string | null
1125
- owner_id: string | null
1126
- public: boolean | null
1127
- updated_at: string | null
1128
- }
1129
- Insert: {
1130
- allowed_mime_types?: string[] | null
1131
- avif_autodetection?: boolean | null
1132
- created_at?: string | null
1133
- file_size_limit?: number | null
1134
- id: string
1135
- name: string
1136
- owner?: string | null
1137
- owner_id?: string | null
1138
- public?: boolean | null
1139
- updated_at?: string | null
1140
- }
1141
- Update: {
1142
- allowed_mime_types?: string[] | null
1143
- avif_autodetection?: boolean | null
1144
- created_at?: string | null
1145
- file_size_limit?: number | null
1146
- id?: string
1147
- name?: string
1148
- owner?: string | null
1149
- owner_id?: string | null
1150
- public?: boolean | null
1151
- updated_at?: string | null
1152
- }
1153
- Relationships: []
1154
- }
1155
- migrations: {
1156
- Row: {
1157
- executed_at: string | null
1158
- hash: string
1159
- id: number
1160
- name: string
1161
- }
1162
- Insert: {
1163
- executed_at?: string | null
1164
- hash: string
1165
- id: number
1166
- name: string
1167
- }
1168
- Update: {
1169
- executed_at?: string | null
1170
- hash?: string
1171
- id?: number
1172
- name?: string
1173
- }
1174
- Relationships: []
1175
- }
1176
- objects: {
1177
- Row: {
1178
- bucket_id: string | null
1179
- created_at: string | null
1180
- id: string
1181
- last_accessed_at: string | null
1182
- metadata: Json | null
1183
- name: string | null
1184
- owner: string | null
1185
- owner_id: string | null
1186
- path_tokens: string[] | null
1187
- updated_at: string | null
1188
- version: string | null
1189
- }
1190
- Insert: {
1191
- bucket_id?: string | null
1192
- created_at?: string | null
1193
- id?: string
1194
- last_accessed_at?: string | null
1195
- metadata?: Json | null
1196
- name?: string | null
1197
- owner?: string | null
1198
- owner_id?: string | null
1199
- path_tokens?: string[] | null
1200
- updated_at?: string | null
1201
- version?: string | null
1202
- }
1203
- Update: {
1204
- bucket_id?: string | null
1205
- created_at?: string | null
1206
- id?: string
1207
- last_accessed_at?: string | null
1208
- metadata?: Json | null
1209
- name?: string | null
1210
- owner?: string | null
1211
- owner_id?: string | null
1212
- path_tokens?: string[] | null
1213
- updated_at?: string | null
1214
- version?: string | null
1215
- }
1216
- Relationships: [
1217
- {
1218
- foreignKeyName: "objects_bucketId_fkey"
1219
- columns: ["bucket_id"]
1220
- isOneToOne: false
1221
- referencedRelation: "buckets"
1222
- referencedColumns: ["id"]
1223
- }
1224
- ]
1225
- }
1226
- }
1227
- Views: {
1228
- [_ in never]: never
1229
- }
1230
- Functions: {
1231
- can_insert_object: {
1232
- Args: {
1233
- bucketid: string
1234
- name: string
1235
- owner: string
1236
- metadata: Json
1237
- }
1238
- Returns: undefined
1239
- }
1240
- extension: {
1241
- Args: {
1242
- name: string
1243
- }
1244
- Returns: string
1245
- }
1246
- filename: {
1247
- Args: {
1248
- name: string
1249
- }
1250
- Returns: string
1251
- }
1252
- foldername: {
1253
- Args: {
1254
- name: string
1255
- }
1256
- Returns: unknown
1257
- }
1258
- get_size_by_bucket: {
1259
- Args: Record<PropertyKey, never>
1260
- Returns: {
1261
- size: number
1262
- bucket_id: string
1263
- }[]
1264
- }
1265
- search: {
1266
- Args: {
1267
- prefix: string
1268
- bucketname: string
1269
- limits?: number
1270
- levels?: number
1271
- offsets?: number
1272
- search?: string
1273
- sortcolumn?: string
1274
- sortorder?: string
1275
- }
1276
- Returns: {
1277
- name: string
1278
- id: string
1279
- updated_at: string
1280
- created_at: string
1281
- last_accessed_at: string
1282
- metadata: Json
1283
- }[]
1284
- }
1285
- }
1286
- Enums: {
1287
- [_ in never]: never
1288
- }
1289
- CompositeTypes: {
1290
- [_ in never]: never
1291
- }
1292
- }
1293
- }
1294
-
1295
- export type Tables<
1296
- PublicTableNameOrOptions extends
1297
- | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1298
- | { schema: keyof Database },
1299
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1300
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1301
- Database[PublicTableNameOrOptions["schema"]]["Views"])
1302
- : never = never
1303
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1304
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1305
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1306
- Row: infer R
1307
- }
1308
- ? R
1309
- : never
1310
- : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1311
- Database["public"]["Views"])
1312
- ? (Database["public"]["Tables"] &
1313
- Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1314
- Row: infer R
1315
- }
1316
- ? R
1317
- : never
1318
- : never
1319
-
1320
- export type TablesInsert<
1321
- PublicTableNameOrOptions extends
1322
- | keyof Database["public"]["Tables"]
1323
- | { schema: keyof Database },
1324
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1325
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1326
- : never = never
1327
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1328
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1329
- Insert: infer I
1330
- }
1331
- ? I
1332
- : never
1333
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1334
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1335
- Insert: infer I
1336
- }
1337
- ? I
1338
- : never
1339
- : never
1340
-
1341
- export type TablesUpdate<
1342
- PublicTableNameOrOptions extends
1343
- | keyof Database["public"]["Tables"]
1344
- | { schema: keyof Database },
1345
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1346
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1347
- : never = never
1348
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1349
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1350
- Update: infer U
1351
- }
1352
- ? U
1353
- : never
1354
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1355
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1356
- Update: infer U
1357
- }
1358
- ? U
1359
- : never
1360
- : never
1361
-
1362
- export type Enums<
1363
- PublicEnumNameOrOptions extends
1364
- | keyof Database["public"]["Enums"]
1365
- | { schema: keyof Database },
1366
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1367
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1368
- : never = never
1369
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1370
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1371
- : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1372
- ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1373
- : never
1374
-
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_email_fkey"
135
+ columns: ["org_id", "email"]
136
+ isOneToOne: false
137
+ referencedRelation: "tbl_org_members"
138
+ referencedColumns: ["org_id", "email"]
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_color: Database["public"]["Enums"]["enum_chat_colors"]
753
+ member_image: string | null
754
+ member_name: string | null
755
+ org_id: string
756
+ role: Database["public"]["Enums"]["enum_member_role"]
757
+ user_id: string | null
758
+ }
759
+ Insert: {
760
+ created_at?: string | null
761
+ email: string
762
+ invited_at?: string | null
763
+ invited_by?: string | null
764
+ is_active?: boolean
765
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
766
+ member_image?: string | null
767
+ member_name?: string | null
768
+ org_id: string
769
+ role?: Database["public"]["Enums"]["enum_member_role"]
770
+ user_id?: string | null
771
+ }
772
+ Update: {
773
+ created_at?: string | null
774
+ email?: string
775
+ invited_at?: string | null
776
+ invited_by?: string | null
777
+ is_active?: boolean
778
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
779
+ member_image?: string | null
780
+ member_name?: string | null
781
+ org_id?: string
782
+ role?: Database["public"]["Enums"]["enum_member_role"]
783
+ user_id?: string | null
784
+ }
785
+ Relationships: [
786
+ {
787
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
788
+ columns: ["user_id"]
789
+ isOneToOne: false
790
+ referencedRelation: "users"
791
+ referencedColumns: ["id"]
792
+ },
793
+ {
794
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
795
+ columns: ["org_id"]
796
+ isOneToOne: false
797
+ referencedRelation: "tbl_org"
798
+ referencedColumns: ["org_id"]
799
+ }
800
+ ]
801
+ }
802
+ tbl_org_phones: {
803
+ Row: {
804
+ created_at: string
805
+ is_ready: boolean | null
806
+ org_id: string
807
+ org_phone: string | null
808
+ phone_id: string
809
+ phone_image: string | null
810
+ phone_name: string | null
811
+ qr_code: string | null
812
+ server_ip: string | null
813
+ updated_at: string
814
+ wa_state: string | null
815
+ }
816
+ Insert: {
817
+ created_at?: string
818
+ is_ready?: boolean | null
819
+ org_id?: string
820
+ org_phone?: string | null
821
+ phone_id?: string
822
+ phone_image?: string | null
823
+ phone_name?: string | null
824
+ qr_code?: string | null
825
+ server_ip?: string | null
826
+ updated_at?: string
827
+ wa_state?: string | null
828
+ }
829
+ Update: {
830
+ created_at?: string
831
+ is_ready?: boolean | null
832
+ org_id?: string
833
+ org_phone?: string | null
834
+ phone_id?: string
835
+ phone_image?: string | null
836
+ phone_name?: string | null
837
+ qr_code?: string | null
838
+ server_ip?: string | null
839
+ updated_at?: string
840
+ wa_state?: string | null
841
+ }
842
+ Relationships: [
843
+ {
844
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
845
+ columns: ["org_id"]
846
+ isOneToOne: false
847
+ referencedRelation: "tbl_org"
848
+ referencedColumns: ["org_id"]
849
+ },
850
+ {
851
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
852
+ columns: ["org_id"]
853
+ isOneToOne: false
854
+ referencedRelation: "tbl_org"
855
+ referencedColumns: ["org_id"]
856
+ }
857
+ ]
858
+ }
859
+ }
860
+ Views: {
861
+ view_broadcast_logs: {
862
+ Row: {
863
+ broadcast_id: string | null
864
+ completed_at: string | null
865
+ created_at: string | null
866
+ delivered_member_count: number | null
867
+ delivery_percentage: number | null
868
+ failed_chats: number | null
869
+ message_payload: Json | null
870
+ org_id: string | null
871
+ performed_by: string | null
872
+ read_member_count: number | null
873
+ read_percentage: number | null
874
+ scheduled_at: string | null
875
+ sent_chats: number | null
876
+ total_chats: number | null
877
+ total_member_count: number | null
878
+ }
879
+ Relationships: [
880
+ {
881
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
882
+ columns: ["org_id"]
883
+ isOneToOne: false
884
+ referencedRelation: "tbl_org"
885
+ referencedColumns: ["org_id"]
886
+ }
887
+ ]
888
+ }
889
+ view_chat_messages: {
890
+ Row: {
891
+ ack: string | null
892
+ author: string | null
893
+ body: string | null
894
+ broadcast_id: string | null
895
+ chat_id: string | null
896
+ delivery_info: Json | null
897
+ from_me: boolean | null
898
+ invite_v4: Json | null
899
+ is_deleted: boolean | null
900
+ links: Json | null
901
+ location: Json | null
902
+ media: Json | null
903
+ mentioned_ids: string[] | null
904
+ message_id: string | null
905
+ message_ticket_id: string | null
906
+ message_type: string | null
907
+ org_id: string | null
908
+ org_phone: string | null
909
+ performed_by: string | null
910
+ prev_body: string | null
911
+ quoted_message_id: string | null
912
+ sender_phone: string | null
913
+ sent_message_id: string | null
914
+ timestamp: string | null
915
+ unique_id: string | null
916
+ updated_at: string | null
917
+ vcards: string[] | null
918
+ }
919
+ Insert: {
920
+ ack?: string | null
921
+ author?: string | null
922
+ body?: string | null
923
+ broadcast_id?: string | null
924
+ chat_id?: string | null
925
+ delivery_info?: Json | null
926
+ from_me?: boolean | null
927
+ invite_v4?: Json | null
928
+ is_deleted?: boolean | null
929
+ links?: Json | null
930
+ location?: Json | null
931
+ media?: Json | null
932
+ mentioned_ids?: string[] | null
933
+ message_id?: string | null
934
+ message_ticket_id?: string | null
935
+ message_type?: string | null
936
+ org_id?: string | null
937
+ org_phone?: string | null
938
+ performed_by?: string | null
939
+ prev_body?: string | null
940
+ quoted_message_id?: string | null
941
+ sender_phone?: string | null
942
+ sent_message_id?: string | null
943
+ timestamp?: string | null
944
+ unique_id?: string | null
945
+ updated_at?: string | null
946
+ vcards?: string[] | null
947
+ }
948
+ Update: {
949
+ ack?: string | null
950
+ author?: string | null
951
+ body?: string | null
952
+ broadcast_id?: string | null
953
+ chat_id?: string | null
954
+ delivery_info?: Json | null
955
+ from_me?: boolean | null
956
+ invite_v4?: Json | null
957
+ is_deleted?: boolean | null
958
+ links?: Json | null
959
+ location?: Json | null
960
+ media?: Json | null
961
+ mentioned_ids?: string[] | null
962
+ message_id?: string | null
963
+ message_ticket_id?: string | null
964
+ message_type?: string | null
965
+ org_id?: string | null
966
+ org_phone?: string | null
967
+ performed_by?: string | null
968
+ prev_body?: string | null
969
+ quoted_message_id?: string | null
970
+ sender_phone?: string | null
971
+ sent_message_id?: string | null
972
+ timestamp?: string | null
973
+ unique_id?: string | null
974
+ updated_at?: string | null
975
+ vcards?: string[] | null
976
+ }
977
+ Relationships: [
978
+ {
979
+ foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
980
+ columns: ["org_phone", "org_id"]
981
+ isOneToOne: false
982
+ referencedRelation: "tbl_org_phones"
983
+ referencedColumns: ["org_phone", "org_id"]
984
+ }
985
+ ]
986
+ }
987
+ view_chats: {
988
+ Row: {
989
+ active_phone: string | null
990
+ chat_access: Json | null
991
+ chat_id: string | null
992
+ chat_image: string | null
993
+ chat_name: string | null
994
+ chat_org_phones: string[] | null
995
+ chat_type: string | null
996
+ has_access: boolean | null
997
+ invite_link: string | null
998
+ label_ids: Json | null
999
+ last_read_timestamp: string | null
1000
+ latest_message: Json | null
1001
+ member_count: number | null
1002
+ message_unread_count: number | null
1003
+ org_id: string | null
1004
+ org_phone: string | null
1005
+ updated_at: string | null
1006
+ }
1007
+ Relationships: [
1008
+ {
1009
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
1010
+ columns: ["org_phone", "org_id"]
1011
+ isOneToOne: false
1012
+ referencedRelation: "tbl_org_phones"
1013
+ referencedColumns: ["org_phone", "org_id"]
1014
+ }
1015
+ ]
1016
+ }
1017
+ }
1018
+ Functions: {
1019
+ gen_id: {
1020
+ Args: {
1021
+ prefix: string
1022
+ size?: number
1023
+ alphabet?: string
1024
+ }
1025
+ Returns: string
1026
+ }
1027
+ gen_ticket_id: {
1028
+ Args: Record<PropertyKey, never>
1029
+ Returns: string
1030
+ }
1031
+ get_broadcast_id: {
1032
+ Args: {
1033
+ broadcast_id_input: string
1034
+ chat_id_input?: string
1035
+ }
1036
+ Returns: Json
1037
+ }
1038
+ get_chat_labels_data: {
1039
+ Args: {
1040
+ chat_ids_input?: string[]
1041
+ }
1042
+ Returns: unknown
1043
+ }
1044
+ get_chats: {
1045
+ Args: {
1046
+ chat_id_input?: string[]
1047
+ with_metadata?: boolean
1048
+ last_updated_at_input?: string
1049
+ }
1050
+ Returns: Json
1051
+ }
1052
+ get_contacts: {
1053
+ Args: {
1054
+ contact_ids_input?: string[]
1055
+ last_updated_at_input?: string
1056
+ }
1057
+ Returns: Json
1058
+ }
1059
+ get_export_chats_data: {
1060
+ Args: {
1061
+ chat_ids: string[]
1062
+ org_id_input?: string
1063
+ }
1064
+ Returns: Json
1065
+ }
1066
+ get_messages_notifications_reactions: {
1067
+ Args: {
1068
+ chat_id_input?: string[]
1069
+ message_limit_input?: number
1070
+ reaction_notification_limit_input?: number
1071
+ org_id_input?: string
1072
+ last_updated_at_input?: string
1073
+ }
1074
+ Returns: Json
1075
+ }
1076
+ get_org: {
1077
+ Args: {
1078
+ org_id_input?: string
1079
+ }
1080
+ Returns: Json
1081
+ }
1082
+ list_org_from_user: {
1083
+ Args: Record<PropertyKey, never>
1084
+ Returns: string
1085
+ }
1086
+ list_role_from_user: {
1087
+ Args: Record<PropertyKey, never>
1088
+ Returns: Database["public"]["Enums"]["enum_member_role"]
1089
+ }
1090
+ update_labels: {
1091
+ Args: {
1092
+ tbl_type: string
1093
+ label_ids_input: Json
1094
+ row_id_input: string[]
1095
+ replace_labels?: boolean
1096
+ }
1097
+ Returns: undefined
1098
+ }
1099
+ }
1100
+ Enums: {
1101
+ enum_chat_colors:
1102
+ | "#B4876E"
1103
+ | "#A5B337"
1104
+ | "#06CF9C"
1105
+ | "#25D366"
1106
+ | "#02A698"
1107
+ | "#7D9EF1"
1108
+ | "#007BFC"
1109
+ | "#5E47DE"
1110
+ | "#7F66FF"
1111
+ | "#9333EA"
1112
+ | "#FA6533"
1113
+ | "#C4532D"
1114
+ | "#DC2626"
1115
+ | "#FF2E74"
1116
+ | "#DB2777"
1117
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1118
+ enum_member_role: "admin" | "member"
1119
+ }
1120
+ CompositeTypes: {
1121
+ [_ in never]: never
1122
+ }
1123
+ }
1124
+ storage: {
1125
+ Tables: {
1126
+ buckets: {
1127
+ Row: {
1128
+ allowed_mime_types: string[] | null
1129
+ avif_autodetection: boolean | null
1130
+ created_at: string | null
1131
+ file_size_limit: number | null
1132
+ id: string
1133
+ name: string
1134
+ owner: string | null
1135
+ owner_id: string | null
1136
+ public: boolean | null
1137
+ updated_at: string | null
1138
+ }
1139
+ Insert: {
1140
+ allowed_mime_types?: string[] | null
1141
+ avif_autodetection?: boolean | null
1142
+ created_at?: string | null
1143
+ file_size_limit?: number | null
1144
+ id: string
1145
+ name: string
1146
+ owner?: string | null
1147
+ owner_id?: string | null
1148
+ public?: boolean | null
1149
+ updated_at?: string | null
1150
+ }
1151
+ Update: {
1152
+ allowed_mime_types?: string[] | null
1153
+ avif_autodetection?: boolean | null
1154
+ created_at?: string | null
1155
+ file_size_limit?: number | null
1156
+ id?: string
1157
+ name?: string
1158
+ owner?: string | null
1159
+ owner_id?: string | null
1160
+ public?: boolean | null
1161
+ updated_at?: string | null
1162
+ }
1163
+ Relationships: []
1164
+ }
1165
+ migrations: {
1166
+ Row: {
1167
+ executed_at: string | null
1168
+ hash: string
1169
+ id: number
1170
+ name: string
1171
+ }
1172
+ Insert: {
1173
+ executed_at?: string | null
1174
+ hash: string
1175
+ id: number
1176
+ name: string
1177
+ }
1178
+ Update: {
1179
+ executed_at?: string | null
1180
+ hash?: string
1181
+ id?: number
1182
+ name?: string
1183
+ }
1184
+ Relationships: []
1185
+ }
1186
+ objects: {
1187
+ Row: {
1188
+ bucket_id: string | null
1189
+ created_at: string | null
1190
+ id: string
1191
+ last_accessed_at: string | null
1192
+ metadata: Json | null
1193
+ name: string | null
1194
+ owner: string | null
1195
+ owner_id: string | null
1196
+ path_tokens: string[] | null
1197
+ updated_at: string | null
1198
+ version: string | null
1199
+ }
1200
+ Insert: {
1201
+ bucket_id?: string | null
1202
+ created_at?: string | null
1203
+ id?: string
1204
+ last_accessed_at?: string | null
1205
+ metadata?: Json | null
1206
+ name?: string | null
1207
+ owner?: string | null
1208
+ owner_id?: string | null
1209
+ path_tokens?: string[] | null
1210
+ updated_at?: string | null
1211
+ version?: string | null
1212
+ }
1213
+ Update: {
1214
+ bucket_id?: string | null
1215
+ created_at?: string | null
1216
+ id?: string
1217
+ last_accessed_at?: string | null
1218
+ metadata?: Json | null
1219
+ name?: string | null
1220
+ owner?: string | null
1221
+ owner_id?: string | null
1222
+ path_tokens?: string[] | null
1223
+ updated_at?: string | null
1224
+ version?: string | null
1225
+ }
1226
+ Relationships: [
1227
+ {
1228
+ foreignKeyName: "objects_bucketId_fkey"
1229
+ columns: ["bucket_id"]
1230
+ isOneToOne: false
1231
+ referencedRelation: "buckets"
1232
+ referencedColumns: ["id"]
1233
+ }
1234
+ ]
1235
+ }
1236
+ }
1237
+ Views: {
1238
+ [_ in never]: never
1239
+ }
1240
+ Functions: {
1241
+ can_insert_object: {
1242
+ Args: {
1243
+ bucketid: string
1244
+ name: string
1245
+ owner: string
1246
+ metadata: Json
1247
+ }
1248
+ Returns: undefined
1249
+ }
1250
+ extension: {
1251
+ Args: {
1252
+ name: string
1253
+ }
1254
+ Returns: string
1255
+ }
1256
+ filename: {
1257
+ Args: {
1258
+ name: string
1259
+ }
1260
+ Returns: string
1261
+ }
1262
+ foldername: {
1263
+ Args: {
1264
+ name: string
1265
+ }
1266
+ Returns: unknown
1267
+ }
1268
+ get_size_by_bucket: {
1269
+ Args: Record<PropertyKey, never>
1270
+ Returns: {
1271
+ size: number
1272
+ bucket_id: string
1273
+ }[]
1274
+ }
1275
+ search: {
1276
+ Args: {
1277
+ prefix: string
1278
+ bucketname: string
1279
+ limits?: number
1280
+ levels?: number
1281
+ offsets?: number
1282
+ search?: string
1283
+ sortcolumn?: string
1284
+ sortorder?: string
1285
+ }
1286
+ Returns: {
1287
+ name: string
1288
+ id: string
1289
+ updated_at: string
1290
+ created_at: string
1291
+ last_accessed_at: string
1292
+ metadata: Json
1293
+ }[]
1294
+ }
1295
+ }
1296
+ Enums: {
1297
+ [_ in never]: never
1298
+ }
1299
+ CompositeTypes: {
1300
+ [_ in never]: never
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ export type Tables<
1306
+ PublicTableNameOrOptions extends
1307
+ | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1308
+ | { schema: keyof Database },
1309
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1310
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1311
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
1312
+ : never = never
1313
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1314
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1315
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1316
+ Row: infer R
1317
+ }
1318
+ ? R
1319
+ : never
1320
+ : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1321
+ Database["public"]["Views"])
1322
+ ? (Database["public"]["Tables"] &
1323
+ Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1324
+ Row: infer R
1325
+ }
1326
+ ? R
1327
+ : never
1328
+ : never
1329
+
1330
+ export type TablesInsert<
1331
+ PublicTableNameOrOptions extends
1332
+ | keyof Database["public"]["Tables"]
1333
+ | { schema: keyof Database },
1334
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1335
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1336
+ : never = never
1337
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1338
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1339
+ Insert: infer I
1340
+ }
1341
+ ? I
1342
+ : never
1343
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1344
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1345
+ Insert: infer I
1346
+ }
1347
+ ? I
1348
+ : never
1349
+ : never
1350
+
1351
+ export type TablesUpdate<
1352
+ PublicTableNameOrOptions extends
1353
+ | keyof Database["public"]["Tables"]
1354
+ | { schema: keyof Database },
1355
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1356
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1357
+ : never = never
1358
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1359
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1360
+ Update: infer U
1361
+ }
1362
+ ? U
1363
+ : never
1364
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1365
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1366
+ Update: infer U
1367
+ }
1368
+ ? U
1369
+ : never
1370
+ : never
1371
+
1372
+ export type Enums<
1373
+ PublicEnumNameOrOptions extends
1374
+ | keyof Database["public"]["Enums"]
1375
+ | { schema: keyof Database },
1376
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1377
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1378
+ : never = never
1379
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
1380
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1381
+ : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1382
+ ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1383
+ : never
1384
+
1375
1385