@periskope/types 0.6.18 → 0.6.22

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,1128 @@
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
+ 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
+
1128
1128