@periskope/types 0.6.26 → 0.6.28

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