@periskope/types 0.6.22 → 0.6.24

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