@periskope/types 0.6.40 → 0.6.41

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,1420 +1,1375 @@
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
-
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
+
1420
1375