@periskope/types 0.6.8 → 0.6.9-2.2

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,1007 +1,1911 @@
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_chat_access: {
32
- Row: {
33
- chat_id: string
34
- email: string
35
- has_access: boolean | null
36
- last_read_timestamp: string | null
37
- org_id: string
38
- }
39
- Insert: {
40
- chat_id: string
41
- email: string
42
- has_access?: boolean | null
43
- last_read_timestamp?: string | null
44
- org_id?: string
45
- }
46
- Update: {
47
- chat_id?: string
48
- email?: string
49
- has_access?: boolean | null
50
- last_read_timestamp?: string | null
51
- org_id?: string
52
- }
53
- Relationships: [
54
- {
55
- foreignKeyName: "tbl_chat_access_org_id_fkey"
56
- columns: ["org_id"]
57
- isOneToOne: false
58
- referencedRelation: "tbl_org"
59
- referencedColumns: ["org_id"]
60
- }
61
- ]
62
- }
63
- tbl_chat_messages: {
64
- Row: {
65
- ack: string | null
66
- author: string | null
67
- body: string | null
68
- broadcast: boolean | null
69
- chat_id: string | null
70
- device_type: string | null
71
- duration: string | null
72
- forwarding_score: number | null
73
- from: string | null
74
- from_me: boolean | null
75
- has_media: boolean | null
76
- has_quoted_msg: boolean | null
77
- has_reaction: boolean | null
78
- id: Json | null
79
- invite_v4: Json | null
80
- is_ephemeral: boolean | null
81
- is_forwarded: boolean | null
82
- is_gif: boolean | null
83
- is_starred: boolean | null
84
- is_status: boolean | null
85
- links: Json | null
86
- location: Json | null
87
- media: Json | null
88
- media_key: string | null
89
- mentioned_ids: string[] | null
90
- message_id: string
91
- message_type: string | null
92
- order_id: string | null
93
- org_id: string
94
- org_phone: string
95
- performed_by: string | null
96
- quoted_message_id: string | null
97
- raw_data: Json | null
98
- sender_phone: string | null
99
- timestamp: string | null
100
- to: string | null
101
- token: string | null
102
- vcards: string[] | null
103
- }
104
- Insert: {
105
- ack?: string | null
106
- author?: string | null
107
- body?: string | null
108
- broadcast?: boolean | null
109
- chat_id?: string | null
110
- device_type?: string | null
111
- duration?: string | null
112
- forwarding_score?: number | null
113
- from?: string | null
114
- from_me?: boolean | null
115
- has_media?: boolean | null
116
- has_quoted_msg?: boolean | null
117
- has_reaction?: boolean | null
118
- id?: Json | null
119
- invite_v4?: Json | null
120
- is_ephemeral?: boolean | null
121
- is_forwarded?: boolean | null
122
- is_gif?: boolean | null
123
- is_starred?: boolean | null
124
- is_status?: boolean | null
125
- links?: Json | null
126
- location?: Json | null
127
- media?: Json | null
128
- media_key?: string | null
129
- mentioned_ids?: string[] | null
130
- message_id: string
131
- message_type?: string | null
132
- order_id?: string | null
133
- org_id: string
134
- org_phone: string
135
- performed_by?: string | null
136
- quoted_message_id?: string | null
137
- raw_data?: Json | null
138
- sender_phone?: string | null
139
- timestamp?: string | null
140
- to?: string | null
141
- token?: string | null
142
- vcards?: string[] | null
143
- }
144
- Update: {
145
- ack?: string | null
146
- author?: string | null
147
- body?: string | null
148
- broadcast?: boolean | null
149
- chat_id?: string | null
150
- device_type?: string | null
151
- duration?: string | null
152
- forwarding_score?: number | null
153
- from?: string | null
154
- from_me?: boolean | null
155
- has_media?: boolean | null
156
- has_quoted_msg?: boolean | null
157
- has_reaction?: boolean | null
158
- id?: Json | null
159
- invite_v4?: Json | null
160
- is_ephemeral?: boolean | null
161
- is_forwarded?: boolean | null
162
- is_gif?: boolean | null
163
- is_starred?: boolean | null
164
- is_status?: boolean | null
165
- links?: Json | null
166
- location?: Json | null
167
- media?: Json | null
168
- media_key?: string | null
169
- mentioned_ids?: string[] | null
170
- message_id?: string
171
- message_type?: string | null
172
- order_id?: string | null
173
- org_id?: string
174
- org_phone?: string
175
- performed_by?: string | null
176
- quoted_message_id?: string | null
177
- raw_data?: Json | null
178
- sender_phone?: string | null
179
- timestamp?: string | null
180
- to?: string | null
181
- token?: string | null
182
- vcards?: string[] | null
183
- }
184
- Relationships: [
185
- {
186
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
187
- columns: ["org_id", "org_phone"]
188
- isOneToOne: false
189
- referencedRelation: "tbl_org_phones"
190
- referencedColumns: ["org_id", "org_phone"]
191
- }
192
- ]
193
- }
194
- tbl_chat_notifications: {
195
- Row: {
196
- author: string | null
197
- body: string | null
198
- chat_id: string | null
199
- group_notification_id: string
200
- id: Json | null
201
- org_id: string
202
- org_phone: string
203
- recipientids: string[] | null
204
- timestamp: string | null
205
- type: string | null
206
- }
207
- Insert: {
208
- author?: string | null
209
- body?: string | null
210
- chat_id?: string | null
211
- group_notification_id: string
212
- id?: Json | null
213
- org_id: string
214
- org_phone: string
215
- recipientids?: string[] | null
216
- timestamp?: string | null
217
- type?: string | null
218
- }
219
- Update: {
220
- author?: string | null
221
- body?: string | null
222
- chat_id?: string | null
223
- group_notification_id?: string
224
- id?: Json | null
225
- org_id?: string
226
- org_phone?: string
227
- recipientids?: string[] | null
228
- timestamp?: string | null
229
- type?: string | null
230
- }
231
- Relationships: [
232
- {
233
- foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
234
- columns: ["org_id", "org_phone"]
235
- isOneToOne: false
236
- referencedRelation: "tbl_org_phones"
237
- referencedColumns: ["org_id", "org_phone"]
238
- }
239
- ]
240
- }
241
- tbl_chat_participants: {
242
- Row: {
243
- chat_id: string
244
- contact_id: string
245
- id: Json | null
246
- is_admin: boolean | null
247
- is_super_admin: boolean | null
248
- org_id: string
249
- }
250
- Insert: {
251
- chat_id: string
252
- contact_id: string
253
- id?: Json | null
254
- is_admin?: boolean | null
255
- is_super_admin?: boolean | null
256
- org_id: string
257
- }
258
- Update: {
259
- chat_id?: string
260
- contact_id?: string
261
- id?: Json | null
262
- is_admin?: boolean | null
263
- is_super_admin?: boolean | null
264
- org_id?: string
265
- }
266
- Relationships: []
267
- }
268
- tbl_chat_reactions: {
269
- Row: {
270
- ack: number | null
271
- id: Json | null
272
- message_id: string | null
273
- msg_id: Json | null
274
- org_id: string
275
- org_phone: string
276
- orphan: number | null
277
- orphan_reason: string | null
278
- reaction: string | null
279
- reaction_id: string
280
- read: boolean | null
281
- sender_id: string | null
282
- timestamp: string | null
283
- }
284
- Insert: {
285
- ack?: number | null
286
- id?: Json | null
287
- message_id?: string | null
288
- msg_id?: Json | null
289
- org_id: string
290
- org_phone: string
291
- orphan?: number | null
292
- orphan_reason?: string | null
293
- reaction?: string | null
294
- reaction_id: string
295
- read?: boolean | null
296
- sender_id?: string | null
297
- timestamp?: string | null
298
- }
299
- Update: {
300
- ack?: number | null
301
- id?: Json | null
302
- message_id?: string | null
303
- msg_id?: Json | null
304
- org_id?: string
305
- org_phone?: string
306
- orphan?: number | null
307
- orphan_reason?: string | null
308
- reaction?: string | null
309
- reaction_id?: string
310
- read?: boolean | null
311
- sender_id?: string | null
312
- timestamp?: string | null
313
- }
314
- Relationships: [
315
- {
316
- foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
317
- columns: ["org_id", "org_phone"]
318
- isOneToOne: false
319
- referencedRelation: "tbl_org_phones"
320
- referencedColumns: ["org_id", "org_phone"]
321
- }
322
- ]
323
- }
324
- tbl_chats: {
325
- Row: {
326
- archived: boolean | null
327
- chat_id: string
328
- chat_image: string | null
329
- group_metadata: Json | null
330
- id: Json | null
331
- invite_link: string | null
332
- is_group: boolean | null
333
- is_muted: boolean | null
334
- is_read_only: boolean | null
335
- label_ids: Json
336
- mute_expiration: number | null
337
- name: string | null
338
- org_id: string
339
- org_phone: string
340
- pinned: boolean | null
341
- timestamp: string | null
342
- unread_count: number | null
343
- }
344
- Insert: {
345
- archived?: boolean | null
346
- chat_id: string
347
- chat_image?: string | null
348
- group_metadata?: Json | null
349
- id?: Json | null
350
- invite_link?: string | null
351
- is_group?: boolean | null
352
- is_muted?: boolean | null
353
- is_read_only?: boolean | null
354
- label_ids?: Json
355
- mute_expiration?: number | null
356
- name?: string | null
357
- org_id: string
358
- org_phone: string
359
- pinned?: boolean | null
360
- timestamp?: string | null
361
- unread_count?: number | null
362
- }
363
- Update: {
364
- archived?: boolean | null
365
- chat_id?: string
366
- chat_image?: string | null
367
- group_metadata?: Json | null
368
- id?: Json | null
369
- invite_link?: string | null
370
- is_group?: boolean | null
371
- is_muted?: boolean | null
372
- is_read_only?: boolean | null
373
- label_ids?: Json
374
- mute_expiration?: number | null
375
- name?: string | null
376
- org_id?: string
377
- org_phone?: string
378
- pinned?: boolean | null
379
- timestamp?: string | null
380
- unread_count?: number | null
381
- }
382
- Relationships: [
383
- {
384
- foreignKeyName: "tbl_chats_org_id_fkey"
385
- columns: ["org_id"]
386
- isOneToOne: false
387
- referencedRelation: "tbl_org"
388
- referencedColumns: ["org_id"]
389
- }
390
- ]
391
- }
392
- tbl_contacts: {
393
- Row: {
394
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
395
- contact_id: string
396
- contact_image: string | null
397
- contact_type: string | null
398
- id: Json | null
399
- is_blocked: boolean | null
400
- is_business: boolean | null
401
- is_enterprise: boolean | null
402
- is_group: boolean | null
403
- is_internal: boolean | null
404
- is_me: boolean | null
405
- is_my_contact: boolean | null
406
- is_user: boolean | null
407
- is_wa_contact: boolean | null
408
- label_ids: Json
409
- name: string | null
410
- number: string | null
411
- org_id: string
412
- pushname: string | null
413
- short_name: string | null
414
- }
415
- Insert: {
416
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
417
- contact_id: string
418
- contact_image?: string | null
419
- contact_type?: string | null
420
- id?: Json | null
421
- is_blocked?: boolean | null
422
- is_business?: boolean | null
423
- is_enterprise?: boolean | null
424
- is_group?: boolean | null
425
- is_internal?: boolean | null
426
- is_me?: boolean | null
427
- is_my_contact?: boolean | null
428
- is_user?: boolean | null
429
- is_wa_contact?: boolean | null
430
- label_ids?: Json
431
- name?: string | null
432
- number?: string | null
433
- org_id: string
434
- pushname?: string | null
435
- short_name?: string | null
436
- }
437
- Update: {
438
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
439
- contact_id?: string
440
- contact_image?: string | null
441
- contact_type?: string | null
442
- id?: Json | null
443
- is_blocked?: boolean | null
444
- is_business?: boolean | null
445
- is_enterprise?: boolean | null
446
- is_group?: boolean | null
447
- is_internal?: boolean | null
448
- is_me?: boolean | null
449
- is_my_contact?: boolean | null
450
- is_user?: boolean | null
451
- is_wa_contact?: boolean | null
452
- label_ids?: Json
453
- name?: string | null
454
- number?: string | null
455
- org_id?: string
456
- pushname?: string | null
457
- short_name?: string | null
458
- }
459
- Relationships: [
460
- {
461
- foreignKeyName: "tbl_contacts_org_id_fkey"
462
- columns: ["org_id"]
463
- isOneToOne: false
464
- referencedRelation: "tbl_org"
465
- referencedColumns: ["org_id"]
466
- }
467
- ]
468
- }
469
- tbl_org: {
470
- Row: {
471
- created_at: string
472
- org_id: string
473
- org_image: string | null
474
- org_name: string | null
475
- support_link: string | null
476
- }
477
- Insert: {
478
- created_at?: string
479
- org_id?: string
480
- org_image?: string | null
481
- org_name?: string | null
482
- support_link?: string | null
483
- }
484
- Update: {
485
- created_at?: string
486
- org_id?: string
487
- org_image?: string | null
488
- org_name?: string | null
489
- support_link?: string | null
490
- }
491
- Relationships: []
492
- }
493
- tbl_org_labels: {
494
- Row: {
495
- color: string
496
- created_at: string
497
- label_id: string
498
- name: string
499
- org_id: string
500
- type: string
501
- }
502
- Insert: {
503
- color?: string
504
- created_at?: string
505
- label_id?: string
506
- name: string
507
- org_id?: string
508
- type?: string
509
- }
510
- Update: {
511
- color?: string
512
- created_at?: string
513
- label_id?: string
514
- name?: string
515
- org_id?: string
516
- type?: string
517
- }
518
- Relationships: [
519
- {
520
- foreignKeyName: "tbl_org_labels_org_id_fkey"
521
- columns: ["org_id"]
522
- isOneToOne: false
523
- referencedRelation: "tbl_org"
524
- referencedColumns: ["org_id"]
525
- }
526
- ]
527
- }
528
- tbl_org_members: {
529
- Row: {
530
- created_at: string | null
531
- email: string
532
- invited_at: string | null
533
- invited_by: string | null
534
- is_active: boolean
535
- member_image: string | null
536
- member_name: string | null
537
- org_id: string
538
- role: Database["public"]["Enums"]["enum_member_role"]
539
- user_id: string | null
540
- }
541
- Insert: {
542
- created_at?: string | null
543
- email: string
544
- invited_at?: string | null
545
- invited_by?: string | null
546
- is_active?: boolean
547
- member_image?: string | null
548
- member_name?: string | null
549
- org_id: string
550
- role?: Database["public"]["Enums"]["enum_member_role"]
551
- user_id?: string | null
552
- }
553
- Update: {
554
- created_at?: string | null
555
- email?: string
556
- invited_at?: string | null
557
- invited_by?: string | null
558
- is_active?: boolean
559
- member_image?: string | null
560
- member_name?: string | null
561
- org_id?: string
562
- role?: Database["public"]["Enums"]["enum_member_role"]
563
- user_id?: string | null
564
- }
565
- Relationships: [
566
- {
567
- foreignKeyName: "tbl_org_members_fkey_auth_users"
568
- columns: ["user_id"]
569
- isOneToOne: false
570
- referencedRelation: "users"
571
- referencedColumns: ["id"]
572
- },
573
- {
574
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
575
- columns: ["org_id"]
576
- isOneToOne: false
577
- referencedRelation: "tbl_org"
578
- referencedColumns: ["org_id"]
579
- }
580
- ]
581
- }
582
- tbl_org_phones: {
583
- Row: {
584
- created_at: string
585
- is_ready: boolean
586
- org_id: string
587
- org_phone: string | null
588
- phone_id: string
589
- phone_image: string | null
590
- phone_name: string | null
591
- qr_code: string | null
592
- updated_at: string
593
- wa_state: string | null
594
- }
595
- Insert: {
596
- created_at?: string
597
- is_ready?: boolean
598
- org_id: string
599
- org_phone?: string | null
600
- phone_id?: string
601
- phone_image?: string | null
602
- phone_name?: string | null
603
- qr_code?: string | null
604
- updated_at?: string
605
- wa_state?: string | null
606
- }
607
- Update: {
608
- created_at?: string
609
- is_ready?: boolean
610
- org_id?: string
611
- org_phone?: string | null
612
- phone_id?: string
613
- phone_image?: string | null
614
- phone_name?: string | null
615
- qr_code?: string | null
616
- updated_at?: string
617
- wa_state?: string | null
618
- }
619
- Relationships: [
620
- {
621
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
622
- columns: ["org_id"]
623
- isOneToOne: false
624
- referencedRelation: "tbl_org"
625
- referencedColumns: ["org_id"]
626
- }
627
- ]
628
- }
629
- }
630
- Views: {
631
- view_chats: {
632
- Row: {
633
- archived: boolean | null
634
- chat_access: Json | null
635
- chat_id: string | null
636
- chat_image: string | null
637
- chat_type: string | null
638
- group_metadata: Json | null
639
- has_access: boolean | null
640
- id: Json | null
641
- invite_link: string | null
642
- is_group: boolean | null
643
- is_muted: boolean | null
644
- is_read_only: boolean | null
645
- label_ids: Json | null
646
- last_read_timestamp: string | null
647
- latest_message: Json | null
648
- latest_message_timestamp: string | null
649
- member_count: number | null
650
- message_unread_count: number | null
651
- mute_expiration: number | null
652
- name: string | null
653
- org_id: string | null
654
- org_participants: Json | null
655
- org_phone: string | null
656
- pinned: boolean | null
657
- timestamp: string | null
658
- unread_count: number | null
659
- }
660
- Relationships: [
661
- {
662
- foreignKeyName: "tbl_chats_org_id_fkey"
663
- columns: ["org_id"]
664
- isOneToOne: false
665
- referencedRelation: "tbl_org"
666
- referencedColumns: ["org_id"]
667
- }
668
- ]
669
- }
670
- }
671
- Functions: {
672
- gen_id: {
673
- Args: {
674
- prefix: string
675
- size?: number
676
- alphabet?: string
677
- }
678
- Returns: string
679
- }
680
- get_chats: {
681
- Args: {
682
- chat_id_input?: string[]
683
- with_metadata?: boolean
684
- }
685
- Returns: Json
686
- }
687
- get_contacts: {
688
- Args: {
689
- contact_ids_input?: string[]
690
- }
691
- Returns: Json
692
- }
693
- get_media: {
694
- Args: {
695
- filters?: Json
696
- page_num?: number
697
- }
698
- Returns: Json
699
- }
700
- get_org: {
701
- Args: {
702
- org_id_input?: string
703
- }
704
- Returns: Json
705
- }
706
- list_org_from_user: {
707
- Args: Record<PropertyKey, never>
708
- Returns: string
709
- }
710
- list_role_from_user: {
711
- Args: Record<PropertyKey, never>
712
- Returns: Database["public"]["Enums"]["enum_member_role"]
713
- }
714
- update_labels: {
715
- Args: {
716
- tbl_type: string
717
- label_ids_input: Json
718
- row_id_input: string[]
719
- }
720
- Returns: undefined
721
- }
722
- }
723
- Enums: {
724
- enum_chat_colors:
725
- | "#B4876E"
726
- | "#A5B337"
727
- | "#06CF9C"
728
- | "#25D366"
729
- | "#02A698"
730
- | "#7D9EF1"
731
- | "#007BFC"
732
- | "#5E47DE"
733
- | "#7F66FF"
734
- | "#9333EA"
735
- | "#FA6533"
736
- | "#C4532D"
737
- | "#DC2626"
738
- | "#FF2E74"
739
- | "#DB2777"
740
- enum_member_role: "admin" | "member"
741
- }
742
- CompositeTypes: {
743
- [_ in never]: never
744
- }
745
- }
746
- storage: {
747
- Tables: {
748
- buckets: {
749
- Row: {
750
- allowed_mime_types: string[] | null
751
- avif_autodetection: boolean | null
752
- created_at: string | null
753
- file_size_limit: number | null
754
- id: string
755
- name: string
756
- owner: string | null
757
- owner_id: string | null
758
- public: boolean | null
759
- updated_at: string | null
760
- }
761
- Insert: {
762
- allowed_mime_types?: string[] | null
763
- avif_autodetection?: boolean | null
764
- created_at?: string | null
765
- file_size_limit?: number | null
766
- id: string
767
- name: string
768
- owner?: string | null
769
- owner_id?: string | null
770
- public?: boolean | null
771
- updated_at?: string | null
772
- }
773
- Update: {
774
- allowed_mime_types?: string[] | null
775
- avif_autodetection?: boolean | null
776
- created_at?: string | null
777
- file_size_limit?: number | null
778
- id?: string
779
- name?: string
780
- owner?: string | null
781
- owner_id?: string | null
782
- public?: boolean | null
783
- updated_at?: string | null
784
- }
785
- Relationships: []
786
- }
787
- migrations: {
788
- Row: {
789
- executed_at: string | null
790
- hash: string
791
- id: number
792
- name: string
793
- }
794
- Insert: {
795
- executed_at?: string | null
796
- hash: string
797
- id: number
798
- name: string
799
- }
800
- Update: {
801
- executed_at?: string | null
802
- hash?: string
803
- id?: number
804
- name?: string
805
- }
806
- Relationships: []
807
- }
808
- objects: {
809
- Row: {
810
- bucket_id: string | null
811
- created_at: string | null
812
- id: string
813
- last_accessed_at: string | null
814
- metadata: Json | null
815
- name: string | null
816
- owner: string | null
817
- owner_id: string | null
818
- path_tokens: string[] | null
819
- updated_at: string | null
820
- version: string | null
821
- }
822
- Insert: {
823
- bucket_id?: string | null
824
- created_at?: string | null
825
- id?: string
826
- last_accessed_at?: string | null
827
- metadata?: Json | null
828
- name?: string | null
829
- owner?: string | null
830
- owner_id?: string | null
831
- path_tokens?: string[] | null
832
- updated_at?: string | null
833
- version?: string | null
834
- }
835
- Update: {
836
- bucket_id?: string | null
837
- created_at?: string | null
838
- id?: string
839
- last_accessed_at?: string | null
840
- metadata?: Json | null
841
- name?: string | null
842
- owner?: string | null
843
- owner_id?: string | null
844
- path_tokens?: string[] | null
845
- updated_at?: string | null
846
- version?: string | null
847
- }
848
- Relationships: [
849
- {
850
- foreignKeyName: "objects_bucketId_fkey"
851
- columns: ["bucket_id"]
852
- isOneToOne: false
853
- referencedRelation: "buckets"
854
- referencedColumns: ["id"]
855
- }
856
- ]
857
- }
858
- }
859
- Views: {
860
- [_ in never]: never
861
- }
862
- Functions: {
863
- can_insert_object: {
864
- Args: {
865
- bucketid: string
866
- name: string
867
- owner: string
868
- metadata: Json
869
- }
870
- Returns: undefined
871
- }
872
- extension: {
873
- Args: {
874
- name: string
875
- }
876
- Returns: string
877
- }
878
- filename: {
879
- Args: {
880
- name: string
881
- }
882
- Returns: string
883
- }
884
- foldername: {
885
- Args: {
886
- name: string
887
- }
888
- Returns: unknown
889
- }
890
- get_size_by_bucket: {
891
- Args: Record<PropertyKey, never>
892
- Returns: {
893
- size: number
894
- bucket_id: string
895
- }[]
896
- }
897
- search: {
898
- Args: {
899
- prefix: string
900
- bucketname: string
901
- limits?: number
902
- levels?: number
903
- offsets?: number
904
- search?: string
905
- sortcolumn?: string
906
- sortorder?: string
907
- }
908
- Returns: {
909
- name: string
910
- id: string
911
- updated_at: string
912
- created_at: string
913
- last_accessed_at: string
914
- metadata: Json
915
- }[]
916
- }
917
- }
918
- Enums: {
919
- [_ in never]: never
920
- }
921
- CompositeTypes: {
922
- [_ in never]: never
923
- }
924
- }
925
- }
926
-
927
- export type Tables<
928
- PublicTableNameOrOptions extends
929
- | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
930
- | { schema: keyof Database },
931
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
932
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
933
- Database[PublicTableNameOrOptions["schema"]]["Views"])
934
- : never = never
935
- > = PublicTableNameOrOptions extends { schema: keyof Database }
936
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
937
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
938
- Row: infer R
939
- }
940
- ? R
941
- : never
942
- : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
943
- Database["public"]["Views"])
944
- ? (Database["public"]["Tables"] &
945
- Database["public"]["Views"])[PublicTableNameOrOptions] extends {
946
- Row: infer R
947
- }
948
- ? R
949
- : never
950
- : never
951
-
952
- export type TablesInsert<
953
- PublicTableNameOrOptions extends
954
- | keyof Database["public"]["Tables"]
955
- | { schema: keyof Database },
956
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
957
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
958
- : never = never
959
- > = PublicTableNameOrOptions extends { schema: keyof Database }
960
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
961
- Insert: infer I
962
- }
963
- ? I
964
- : never
965
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
966
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
967
- Insert: infer I
968
- }
969
- ? I
970
- : never
971
- : never
972
-
973
- export type TablesUpdate<
974
- PublicTableNameOrOptions extends
975
- | keyof Database["public"]["Tables"]
976
- | { schema: keyof Database },
977
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
978
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
979
- : never = never
980
- > = PublicTableNameOrOptions extends { schema: keyof Database }
981
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
982
- Update: infer U
983
- }
984
- ? U
985
- : never
986
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
987
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
988
- Update: infer U
989
- }
990
- ? U
991
- : never
992
- : never
993
-
994
- export type Enums<
995
- PublicEnumNameOrOptions extends
996
- | keyof Database["public"]["Enums"]
997
- | { schema: keyof Database },
998
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
999
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1000
- : never = never
1001
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1002
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1003
- : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1004
- ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1005
- : never
1006
-
1
+ export type Json = { [key: string]: any } | any
1007
2
 
3
+ export type 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_logs: {
32
+ Row: {
33
+ broadcast_id: string
34
+ chat_id: string
35
+ completed_at: string | null
36
+ created_at: string
37
+ delivered_count: number | null
38
+ delivery_info: Json | null
39
+ is_success: boolean | null
40
+ member_count: number | null
41
+ message_id: string | null
42
+ org_id: string
43
+ org_phone: string | null
44
+ read_count: number | null
45
+ }
46
+ Insert: {
47
+ broadcast_id: string
48
+ chat_id: string
49
+ completed_at?: string | null
50
+ created_at?: string
51
+ delivered_count?: number | null
52
+ delivery_info?: Json | null
53
+ is_success?: boolean | null
54
+ member_count?: number | null
55
+ message_id?: string | null
56
+ org_id: string
57
+ org_phone?: string | null
58
+ read_count?: number | null
59
+ }
60
+ Update: {
61
+ broadcast_id?: string
62
+ chat_id?: string
63
+ completed_at?: string | null
64
+ created_at?: string
65
+ delivered_count?: number | null
66
+ delivery_info?: Json | null
67
+ is_success?: boolean | null
68
+ member_count?: number | null
69
+ message_id?: string | null
70
+ org_id?: string
71
+ org_phone?: string | null
72
+ read_count?: number | null
73
+ }
74
+ Relationships: [
75
+ {
76
+ foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
77
+ columns: ["broadcast_id"]
78
+ referencedRelation: "tbl_broadcast_messages"
79
+ referencedColumns: ["broadcast_id"]
80
+ },
81
+ {
82
+ foreignKeyName: "tbl_broadcast_logs_broadcast_id_fkey"
83
+ columns: ["broadcast_id"]
84
+ referencedRelation: "view_broadcast_logs"
85
+ referencedColumns: ["broadcast_id"]
86
+ },
87
+ {
88
+ foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
89
+ columns: ["org_id"]
90
+ referencedRelation: "tbl_org"
91
+ referencedColumns: ["org_id"]
92
+ },
93
+ {
94
+ foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
95
+ columns: ["org_id"]
96
+ referencedRelation: "view_org"
97
+ referencedColumns: ["org_id"]
98
+ }
99
+ ]
100
+ }
101
+ tbl_broadcast_messages: {
102
+ Row: {
103
+ broadcast_id: string
104
+ broadcast_status: string | null
105
+ chat_ids: string[] | null
106
+ created_at: string
107
+ message_payload: Json | null
108
+ org_id: string
109
+ org_phone: string | null
110
+ performed_at: string | null
111
+ performed_by: string | null
112
+ scheduled_at: string | null
113
+ }
114
+ Insert: {
115
+ broadcast_id?: string
116
+ broadcast_status?: string | null
117
+ chat_ids?: string[] | null
118
+ created_at?: string
119
+ message_payload?: Json | null
120
+ org_id: string
121
+ org_phone?: string | null
122
+ performed_at?: string | null
123
+ performed_by?: string | null
124
+ scheduled_at?: string | null
125
+ }
126
+ Update: {
127
+ broadcast_id?: string
128
+ broadcast_status?: string | null
129
+ chat_ids?: string[] | null
130
+ created_at?: string
131
+ message_payload?: Json | null
132
+ org_id?: string
133
+ org_phone?: string | null
134
+ performed_at?: string | null
135
+ performed_by?: string | null
136
+ scheduled_at?: string | null
137
+ }
138
+ Relationships: [
139
+ {
140
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
141
+ columns: ["org_id"]
142
+ referencedRelation: "tbl_org"
143
+ referencedColumns: ["org_id"]
144
+ },
145
+ {
146
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
147
+ columns: ["org_id"]
148
+ referencedRelation: "view_org"
149
+ referencedColumns: ["org_id"]
150
+ }
151
+ ]
152
+ }
153
+ tbl_broadcast_templates: {
154
+ Row: {
155
+ created_at: string
156
+ message_payload: Json | null
157
+ org_id: string
158
+ template_id: string
159
+ template_name: string | null
160
+ updated_at: string | null
161
+ }
162
+ Insert: {
163
+ created_at?: string
164
+ message_payload?: Json | null
165
+ org_id: string
166
+ template_id?: string
167
+ template_name?: string | null
168
+ updated_at?: string | null
169
+ }
170
+ Update: {
171
+ created_at?: string
172
+ message_payload?: Json | null
173
+ org_id?: string
174
+ template_id?: string
175
+ template_name?: string | null
176
+ updated_at?: string | null
177
+ }
178
+ Relationships: [
179
+ {
180
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
181
+ columns: ["org_id"]
182
+ referencedRelation: "tbl_org"
183
+ referencedColumns: ["org_id"]
184
+ },
185
+ {
186
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
187
+ columns: ["org_id"]
188
+ referencedRelation: "view_org"
189
+ referencedColumns: ["org_id"]
190
+ }
191
+ ]
192
+ }
193
+ tbl_chat_access: {
194
+ Row: {
195
+ active_phone: string | null
196
+ chat_id: string
197
+ email: string
198
+ has_access: boolean | null
199
+ last_read_timestamp: string | null
200
+ message_unread_count: number | null
201
+ org_id: string
202
+ }
203
+ Insert: {
204
+ active_phone?: string | null
205
+ chat_id: string
206
+ email: string
207
+ has_access?: boolean | null
208
+ last_read_timestamp?: string | null
209
+ message_unread_count?: number | null
210
+ org_id: string
211
+ }
212
+ Update: {
213
+ active_phone?: string | null
214
+ chat_id?: string
215
+ email?: string
216
+ has_access?: boolean | null
217
+ last_read_timestamp?: string | null
218
+ message_unread_count?: number | null
219
+ org_id?: string
220
+ }
221
+ Relationships: [
222
+ {
223
+ foreignKeyName: "tbl_chat_access_org_id_email_fkey"
224
+ columns: ["org_id", "email"]
225
+ referencedRelation: "tbl_org_members"
226
+ referencedColumns: ["org_id", "email"]
227
+ }
228
+ ]
229
+ }
230
+ tbl_chat_messages: {
231
+ Row: {
232
+ ack: string | null
233
+ author: string | null
234
+ body: string | null
235
+ broadcast: boolean | null
236
+ broadcast_id: string | null
237
+ chat_id: string | null
238
+ delivery_info: Json | null
239
+ device_type: string | null
240
+ duration: string | null
241
+ flag_metadata: Json | null
242
+ flag_response_time: number | null
243
+ forwarding_score: number | null
244
+ from: string | null
245
+ from_me: boolean | null
246
+ has_media: boolean | null
247
+ has_quoted_msg: boolean | null
248
+ has_reaction: boolean | null
249
+ id: Json | null
250
+ invite_v4: Json | null
251
+ is_deleted: boolean | null
252
+ is_ephemeral: boolean | null
253
+ is_forwarded: boolean | null
254
+ is_gif: boolean | null
255
+ is_starred: boolean | null
256
+ is_status: boolean | null
257
+ links: Json | null
258
+ location: Json | null
259
+ media: Json | null
260
+ media_key: string | null
261
+ mentioned_ids: string[] | null
262
+ message_id: string
263
+ message_ticket_id: string | null
264
+ message_type: string | null
265
+ order_id: string | null
266
+ org_id: string
267
+ org_phone: string
268
+ performed_by: string | null
269
+ prev_body: string | null
270
+ quoted_message_id: string | null
271
+ raw_data: Json | null
272
+ sender_phone: string | null
273
+ sent_message_id: string | null
274
+ timestamp: string | null
275
+ to: string | null
276
+ token: string | null
277
+ unique_id: string | null
278
+ updated_at: string | null
279
+ vcards: string[] | null
280
+ }
281
+ Insert: {
282
+ ack?: string | null
283
+ author?: string | null
284
+ body?: string | null
285
+ broadcast?: boolean | null
286
+ broadcast_id?: string | null
287
+ chat_id?: string | null
288
+ delivery_info?: Json | null
289
+ device_type?: string | null
290
+ duration?: string | null
291
+ flag_metadata?: Json | null
292
+ flag_response_time?: number | null
293
+ forwarding_score?: number | null
294
+ from?: string | null
295
+ from_me?: boolean | null
296
+ has_media?: boolean | null
297
+ has_quoted_msg?: boolean | null
298
+ has_reaction?: boolean | null
299
+ id?: Json | null
300
+ invite_v4?: Json | null
301
+ is_deleted?: boolean | null
302
+ is_ephemeral?: boolean | null
303
+ is_forwarded?: boolean | null
304
+ is_gif?: boolean | null
305
+ is_starred?: boolean | null
306
+ is_status?: boolean | null
307
+ links?: Json | null
308
+ location?: Json | null
309
+ media?: Json | null
310
+ media_key?: string | null
311
+ mentioned_ids?: string[] | null
312
+ message_id: string
313
+ message_ticket_id?: string | null
314
+ message_type?: string | null
315
+ order_id?: string | null
316
+ org_id: string
317
+ org_phone: string
318
+ performed_by?: string | null
319
+ prev_body?: string | null
320
+ quoted_message_id?: string | null
321
+ raw_data?: Json | null
322
+ sender_phone?: string | null
323
+ sent_message_id?: string | null
324
+ timestamp?: string | null
325
+ to?: string | null
326
+ token?: string | null
327
+ unique_id?: string | null
328
+ updated_at?: string | null
329
+ vcards?: string[] | null
330
+ }
331
+ Update: {
332
+ ack?: string | null
333
+ author?: string | null
334
+ body?: string | null
335
+ broadcast?: boolean | null
336
+ broadcast_id?: string | null
337
+ chat_id?: string | null
338
+ delivery_info?: Json | null
339
+ device_type?: string | null
340
+ duration?: string | null
341
+ flag_metadata?: Json | null
342
+ flag_response_time?: number | null
343
+ forwarding_score?: number | null
344
+ from?: string | null
345
+ from_me?: boolean | null
346
+ has_media?: boolean | null
347
+ has_quoted_msg?: boolean | null
348
+ has_reaction?: boolean | null
349
+ id?: Json | null
350
+ invite_v4?: Json | null
351
+ is_deleted?: boolean | null
352
+ is_ephemeral?: boolean | null
353
+ is_forwarded?: boolean | null
354
+ is_gif?: boolean | null
355
+ is_starred?: boolean | null
356
+ is_status?: boolean | null
357
+ links?: Json | null
358
+ location?: Json | null
359
+ media?: Json | null
360
+ media_key?: string | null
361
+ mentioned_ids?: string[] | null
362
+ message_id?: string
363
+ message_ticket_id?: string | null
364
+ message_type?: string | null
365
+ order_id?: string | null
366
+ org_id?: string
367
+ org_phone?: string
368
+ performed_by?: string | null
369
+ prev_body?: string | null
370
+ quoted_message_id?: string | null
371
+ raw_data?: Json | null
372
+ sender_phone?: string | null
373
+ sent_message_id?: string | null
374
+ timestamp?: string | null
375
+ to?: string | null
376
+ token?: string | null
377
+ unique_id?: string | null
378
+ updated_at?: string | null
379
+ vcards?: string[] | null
380
+ }
381
+ Relationships: [
382
+ {
383
+ foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
384
+ columns: ["org_phone", "org_id"]
385
+ referencedRelation: "tbl_org_phones"
386
+ referencedColumns: ["org_phone", "org_id"]
387
+ }
388
+ ]
389
+ }
390
+ tbl_chat_notifications: {
391
+ Row: {
392
+ author: string | null
393
+ body: string | null
394
+ chat_id: string | null
395
+ id: Json | null
396
+ notification_id: string
397
+ org_id: string
398
+ org_phone: string
399
+ recipientids: string[] | null
400
+ timestamp: string | null
401
+ type: string | null
402
+ unique_id: string | null
403
+ }
404
+ Insert: {
405
+ author?: string | null
406
+ body?: string | null
407
+ chat_id?: string | null
408
+ id?: Json | null
409
+ notification_id: string
410
+ org_id: string
411
+ org_phone: string
412
+ recipientids?: string[] | null
413
+ timestamp?: string | null
414
+ type?: string | null
415
+ unique_id?: string | null
416
+ }
417
+ Update: {
418
+ author?: string | null
419
+ body?: string | null
420
+ chat_id?: string | null
421
+ id?: Json | null
422
+ notification_id?: string
423
+ org_id?: string
424
+ org_phone?: string
425
+ recipientids?: string[] | null
426
+ timestamp?: string | null
427
+ type?: string | null
428
+ unique_id?: string | null
429
+ }
430
+ Relationships: [
431
+ {
432
+ foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
433
+ columns: ["org_id", "org_phone"]
434
+ referencedRelation: "tbl_org_phones"
435
+ referencedColumns: ["org_id", "org_phone"]
436
+ }
437
+ ]
438
+ }
439
+ tbl_chat_participants: {
440
+ Row: {
441
+ chat_id: string
442
+ contact_id: string
443
+ id: Json | null
444
+ is_admin: boolean | null
445
+ is_super_admin: boolean | null
446
+ org_id: string
447
+ org_phone: string
448
+ }
449
+ Insert: {
450
+ chat_id: string
451
+ contact_id: string
452
+ id?: Json | null
453
+ is_admin?: boolean | null
454
+ is_super_admin?: boolean | null
455
+ org_id: string
456
+ org_phone: string
457
+ }
458
+ Update: {
459
+ chat_id?: string
460
+ contact_id?: string
461
+ id?: Json | null
462
+ is_admin?: boolean | null
463
+ is_super_admin?: boolean | null
464
+ org_id?: string
465
+ org_phone?: string
466
+ }
467
+ Relationships: [
468
+ {
469
+ foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
470
+ columns: ["org_id", "org_phone", "chat_id"]
471
+ referencedRelation: "tbl_chats"
472
+ referencedColumns: ["org_id", "org_phone", "chat_id"]
473
+ }
474
+ ]
475
+ }
476
+ tbl_chat_properties: {
477
+ Row: {
478
+ chat_id: string
479
+ custom_properties: Json | null
480
+ flag_count: number
481
+ hubspot_metadata: Json | null
482
+ label_ids: Json | null
483
+ org_id: string
484
+ }
485
+ Insert: {
486
+ chat_id: string
487
+ custom_properties?: Json | null
488
+ flag_count?: number
489
+ hubspot_metadata?: Json | null
490
+ label_ids?: Json | null
491
+ org_id: string
492
+ }
493
+ Update: {
494
+ chat_id?: string
495
+ custom_properties?: Json | null
496
+ flag_count?: number
497
+ hubspot_metadata?: Json | null
498
+ label_ids?: Json | null
499
+ org_id?: string
500
+ }
501
+ Relationships: []
502
+ }
503
+ tbl_chat_reactions: {
504
+ Row: {
505
+ ack: number | null
506
+ chat_id: string | null
507
+ id: Json | null
508
+ message_id: string
509
+ msg_id: Json | null
510
+ org_id: string
511
+ org_phone: string
512
+ orphan: number | null
513
+ orphan_reason: string | null
514
+ reaction: string | null
515
+ reaction_id: string
516
+ read: boolean | null
517
+ sender_id: string
518
+ timestamp: string | null
519
+ unique_id: string | null
520
+ }
521
+ Insert: {
522
+ ack?: number | null
523
+ chat_id?: string | null
524
+ id?: Json | null
525
+ message_id: string
526
+ msg_id?: Json | null
527
+ org_id: string
528
+ org_phone: string
529
+ orphan?: number | null
530
+ orphan_reason?: string | null
531
+ reaction?: string | null
532
+ reaction_id: string
533
+ read?: boolean | null
534
+ sender_id: string
535
+ timestamp?: string | null
536
+ unique_id?: string | null
537
+ }
538
+ Update: {
539
+ ack?: number | null
540
+ chat_id?: string | null
541
+ id?: Json | null
542
+ message_id?: string
543
+ msg_id?: Json | null
544
+ org_id?: string
545
+ org_phone?: string
546
+ orphan?: number | null
547
+ orphan_reason?: string | null
548
+ reaction?: string | null
549
+ reaction_id?: string
550
+ read?: boolean | null
551
+ sender_id?: string
552
+ timestamp?: string | null
553
+ unique_id?: string | null
554
+ }
555
+ Relationships: [
556
+ {
557
+ foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
558
+ columns: ["org_id", "org_phone"]
559
+ referencedRelation: "tbl_org_phones"
560
+ referencedColumns: ["org_id", "org_phone"]
561
+ }
562
+ ]
563
+ }
564
+ tbl_chat_tickets: {
565
+ Row: {
566
+ assigned_by: string | null
567
+ assignee: string | null
568
+ chat_id: string
569
+ created_at: string
570
+ due_date: string | null
571
+ hubspot_metadata: Json | null
572
+ is_deleted: boolean
573
+ label_ids: Json | null
574
+ last_updated_at: string
575
+ org_id: string
576
+ priority: number | null
577
+ quoted_message_id: string | null
578
+ raised_by: string | null
579
+ status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
580
+ subject: string
581
+ ticket_id: string
582
+ }
583
+ Insert: {
584
+ assigned_by?: string | null
585
+ assignee?: string | null
586
+ chat_id: string
587
+ created_at?: string
588
+ due_date?: string | null
589
+ hubspot_metadata?: Json | null
590
+ is_deleted?: boolean
591
+ label_ids?: Json | null
592
+ last_updated_at?: string
593
+ org_id: string
594
+ priority?: number | null
595
+ quoted_message_id?: string | null
596
+ raised_by?: string | null
597
+ status?:
598
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
599
+ | null
600
+ subject: string
601
+ ticket_id?: string
602
+ }
603
+ Update: {
604
+ assigned_by?: string | null
605
+ assignee?: string | null
606
+ chat_id?: string
607
+ created_at?: string
608
+ due_date?: string | null
609
+ hubspot_metadata?: Json | null
610
+ is_deleted?: boolean
611
+ label_ids?: Json | null
612
+ last_updated_at?: string
613
+ org_id?: string
614
+ priority?: number | null
615
+ quoted_message_id?: string | null
616
+ raised_by?: string | null
617
+ status?:
618
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
619
+ | null
620
+ subject?: string
621
+ ticket_id?: string
622
+ }
623
+ Relationships: [
624
+ {
625
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
626
+ columns: ["org_id"]
627
+ referencedRelation: "tbl_org"
628
+ referencedColumns: ["org_id"]
629
+ },
630
+ {
631
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
632
+ columns: ["org_id"]
633
+ referencedRelation: "view_org"
634
+ referencedColumns: ["org_id"]
635
+ }
636
+ ]
637
+ }
638
+ tbl_chats: {
639
+ Row: {
640
+ archived: boolean | null
641
+ chat_id: string
642
+ chat_image: string | null
643
+ chat_name: string | null
644
+ chat_type: string | null
645
+ created_at: string
646
+ group_metadata: Json | null
647
+ id: Json | null
648
+ invite_link: string | null
649
+ is_group: boolean | null
650
+ is_muted: boolean | null
651
+ is_read_only: boolean | null
652
+ latest_message: Json | null
653
+ member_count: number | null
654
+ mute_expiration: number | null
655
+ name: string | null
656
+ org_id: string
657
+ org_phone: string
658
+ pinned: boolean | null
659
+ timestamp: string | null
660
+ unread_count: number | null
661
+ updated_at: string
662
+ }
663
+ Insert: {
664
+ archived?: boolean | null
665
+ chat_id: string
666
+ chat_image?: string | null
667
+ chat_name?: string | null
668
+ chat_type?: string | null
669
+ created_at?: string
670
+ group_metadata?: Json | null
671
+ id?: Json | null
672
+ invite_link?: string | null
673
+ is_group?: boolean | null
674
+ is_muted?: boolean | null
675
+ is_read_only?: boolean | null
676
+ latest_message?: Json | null
677
+ member_count?: number | null
678
+ mute_expiration?: number | null
679
+ name?: string | null
680
+ org_id: string
681
+ org_phone: string
682
+ pinned?: boolean | null
683
+ timestamp?: string | null
684
+ unread_count?: number | null
685
+ updated_at?: string
686
+ }
687
+ Update: {
688
+ archived?: boolean | null
689
+ chat_id?: string
690
+ chat_image?: string | null
691
+ chat_name?: string | null
692
+ chat_type?: string | null
693
+ created_at?: string
694
+ group_metadata?: Json | null
695
+ id?: Json | null
696
+ invite_link?: string | null
697
+ is_group?: boolean | null
698
+ is_muted?: boolean | null
699
+ is_read_only?: boolean | null
700
+ latest_message?: Json | null
701
+ member_count?: number | null
702
+ mute_expiration?: number | null
703
+ name?: string | null
704
+ org_id?: string
705
+ org_phone?: string
706
+ pinned?: boolean | null
707
+ timestamp?: string | null
708
+ unread_count?: number | null
709
+ updated_at?: string
710
+ }
711
+ Relationships: [
712
+ {
713
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
714
+ columns: ["org_phone", "org_id"]
715
+ referencedRelation: "tbl_org_phones"
716
+ referencedColumns: ["org_phone", "org_id"]
717
+ }
718
+ ]
719
+ }
720
+ tbl_contacts: {
721
+ Row: {
722
+ business_profile: Json | null
723
+ contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
724
+ contact_id: string
725
+ contact_image: string | null
726
+ contact_name: string | null
727
+ contact_type: string | null
728
+ id: Json | null
729
+ is_blocked: boolean | null
730
+ is_business: boolean | null
731
+ is_enterprise: boolean | null
732
+ is_group: boolean | null
733
+ is_internal: boolean | null
734
+ is_me: boolean | null
735
+ is_my_contact: boolean | null
736
+ is_user: boolean | null
737
+ is_wa_contact: boolean | null
738
+ label_ids: Json
739
+ name: string | null
740
+ number: string | null
741
+ org_id: string
742
+ pushname: string | null
743
+ short_name: string | null
744
+ updated_at: string | null
745
+ verified_level: number | null
746
+ verified_name: string | null
747
+ }
748
+ Insert: {
749
+ business_profile?: Json | null
750
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
751
+ contact_id: string
752
+ contact_image?: string | null
753
+ contact_name?: string | null
754
+ contact_type?: string | null
755
+ id?: Json | null
756
+ is_blocked?: boolean | null
757
+ is_business?: boolean | null
758
+ is_enterprise?: boolean | null
759
+ is_group?: boolean | null
760
+ is_internal?: boolean | null
761
+ is_me?: boolean | null
762
+ is_my_contact?: boolean | null
763
+ is_user?: boolean | null
764
+ is_wa_contact?: boolean | null
765
+ label_ids?: Json
766
+ name?: string | null
767
+ number?: string | null
768
+ org_id: string
769
+ pushname?: string | null
770
+ short_name?: string | null
771
+ updated_at?: string | null
772
+ verified_level?: number | null
773
+ verified_name?: string | null
774
+ }
775
+ Update: {
776
+ business_profile?: Json | null
777
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
778
+ contact_id?: string
779
+ contact_image?: string | null
780
+ contact_name?: string | null
781
+ contact_type?: string | null
782
+ id?: Json | null
783
+ is_blocked?: boolean | null
784
+ is_business?: boolean | null
785
+ is_enterprise?: boolean | null
786
+ is_group?: boolean | null
787
+ is_internal?: boolean | null
788
+ is_me?: boolean | null
789
+ is_my_contact?: boolean | null
790
+ is_user?: boolean | null
791
+ is_wa_contact?: boolean | null
792
+ label_ids?: Json
793
+ name?: string | null
794
+ number?: string | null
795
+ org_id?: string
796
+ pushname?: string | null
797
+ short_name?: string | null
798
+ updated_at?: string | null
799
+ verified_level?: number | null
800
+ verified_name?: string | null
801
+ }
802
+ Relationships: [
803
+ {
804
+ foreignKeyName: "tbl_contacts_org_id_fkey"
805
+ columns: ["org_id"]
806
+ referencedRelation: "tbl_org"
807
+ referencedColumns: ["org_id"]
808
+ },
809
+ {
810
+ foreignKeyName: "tbl_contacts_org_id_fkey"
811
+ columns: ["org_id"]
812
+ referencedRelation: "view_org"
813
+ referencedColumns: ["org_id"]
814
+ }
815
+ ]
816
+ }
817
+ tbl_custom_properties: {
818
+ Row: {
819
+ created_at: string
820
+ created_by: string | null
821
+ org_id: string | null
822
+ property_id: string
823
+ property_name: string
824
+ property_value: string | null
825
+ property_value_type: string | null
826
+ type: string | null
827
+ }
828
+ Insert: {
829
+ created_at?: string
830
+ created_by?: string | null
831
+ org_id?: string | null
832
+ property_id?: string
833
+ property_name: string
834
+ property_value?: string | null
835
+ property_value_type?: string | null
836
+ type?: string | null
837
+ }
838
+ Update: {
839
+ created_at?: string
840
+ created_by?: string | null
841
+ org_id?: string | null
842
+ property_id?: string
843
+ property_name?: string
844
+ property_value?: string | null
845
+ property_value_type?: string | null
846
+ type?: string | null
847
+ }
848
+ Relationships: [
849
+ {
850
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
851
+ columns: ["org_id"]
852
+ referencedRelation: "tbl_org"
853
+ referencedColumns: ["org_id"]
854
+ },
855
+ {
856
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
857
+ columns: ["org_id"]
858
+ referencedRelation: "view_org"
859
+ referencedColumns: ["org_id"]
860
+ }
861
+ ]
862
+ }
863
+ tbl_integration_hooks: {
864
+ Row: {
865
+ hook_url: string
866
+ id: string
867
+ integration_id: string | null
868
+ integration_metadata: Json
869
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
870
+ integration_type: string
871
+ is_subscribed: boolean
872
+ org_id: string
873
+ subscribed_at: string
874
+ type: Database["public"]["Enums"]["enum_integration_type"]
875
+ }
876
+ Insert: {
877
+ hook_url: string
878
+ id?: string
879
+ integration_id?: string | null
880
+ integration_metadata: Json
881
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
882
+ integration_type: string
883
+ is_subscribed: boolean
884
+ org_id: string
885
+ subscribed_at?: string
886
+ type: Database["public"]["Enums"]["enum_integration_type"]
887
+ }
888
+ Update: {
889
+ hook_url?: string
890
+ id?: string
891
+ integration_id?: string | null
892
+ integration_metadata?: Json
893
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
894
+ integration_type?: string
895
+ is_subscribed?: boolean
896
+ org_id?: string
897
+ subscribed_at?: string
898
+ type?: Database["public"]["Enums"]["enum_integration_type"]
899
+ }
900
+ Relationships: [
901
+ {
902
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
903
+ columns: ["org_id"]
904
+ referencedRelation: "tbl_org"
905
+ referencedColumns: ["org_id"]
906
+ },
907
+ {
908
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
909
+ columns: ["org_id"]
910
+ referencedRelation: "view_org"
911
+ referencedColumns: ["org_id"]
912
+ }
913
+ ]
914
+ }
915
+ tbl_integration_logs: {
916
+ Row: {
917
+ created_at: string
918
+ id: string
919
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
920
+ integration_type: string
921
+ metadata: Json
922
+ org_id: string
923
+ response: Json | null
924
+ success: boolean
925
+ type: Database["public"]["Enums"]["enum_integration_type"]
926
+ }
927
+ Insert: {
928
+ created_at?: string
929
+ id?: string
930
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
931
+ integration_type: string
932
+ metadata?: Json
933
+ org_id: string
934
+ response?: Json | null
935
+ success?: boolean
936
+ type: Database["public"]["Enums"]["enum_integration_type"]
937
+ }
938
+ Update: {
939
+ created_at?: string
940
+ id?: string
941
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
942
+ integration_type?: string
943
+ metadata?: Json
944
+ org_id?: string
945
+ response?: Json | null
946
+ success?: boolean
947
+ type?: Database["public"]["Enums"]["enum_integration_type"]
948
+ }
949
+ Relationships: [
950
+ {
951
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
952
+ columns: ["org_id"]
953
+ referencedRelation: "tbl_org"
954
+ referencedColumns: ["org_id"]
955
+ },
956
+ {
957
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
958
+ columns: ["org_id"]
959
+ referencedRelation: "view_org"
960
+ referencedColumns: ["org_id"]
961
+ }
962
+ ]
963
+ }
964
+ tbl_integration_tokens: {
965
+ Row: {
966
+ exp: string
967
+ iat: string
968
+ id: string
969
+ is_revealed: boolean
970
+ name: string
971
+ org_id: string
972
+ role: string
973
+ token: string
974
+ token_metadata: Json | null
975
+ type: Database["public"]["Enums"]["enum_integration_type"]
976
+ }
977
+ Insert: {
978
+ exp: string
979
+ iat: string
980
+ id?: string
981
+ is_revealed?: boolean
982
+ name: string
983
+ org_id: string
984
+ role: string
985
+ token: string
986
+ token_metadata?: Json | null
987
+ type: Database["public"]["Enums"]["enum_integration_type"]
988
+ }
989
+ Update: {
990
+ exp?: string
991
+ iat?: string
992
+ id?: string
993
+ is_revealed?: boolean
994
+ name?: string
995
+ org_id?: string
996
+ role?: string
997
+ token?: string
998
+ token_metadata?: Json | null
999
+ type?: Database["public"]["Enums"]["enum_integration_type"]
1000
+ }
1001
+ Relationships: [
1002
+ {
1003
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1004
+ columns: ["org_id"]
1005
+ referencedRelation: "tbl_org"
1006
+ referencedColumns: ["org_id"]
1007
+ },
1008
+ {
1009
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1010
+ columns: ["org_id"]
1011
+ referencedRelation: "view_org"
1012
+ referencedColumns: ["org_id"]
1013
+ }
1014
+ ]
1015
+ }
1016
+ tbl_org: {
1017
+ Row: {
1018
+ created_at: string
1019
+ org_id: string
1020
+ org_image: string | null
1021
+ org_metadata: Json | null
1022
+ org_name: string | null
1023
+ org_plan: Json | null
1024
+ stripe_customer_details: Json | null
1025
+ stripe_customer_id: string | null
1026
+ stripe_subscription_details: Json | null
1027
+ support_link: string | null
1028
+ }
1029
+ Insert: {
1030
+ created_at?: string
1031
+ org_id?: string
1032
+ org_image?: string | null
1033
+ org_metadata?: Json | null
1034
+ org_name?: string | null
1035
+ org_plan?: Json | null
1036
+ stripe_customer_details?: Json | null
1037
+ stripe_customer_id?: string | null
1038
+ stripe_subscription_details?: Json | null
1039
+ support_link?: string | null
1040
+ }
1041
+ Update: {
1042
+ created_at?: string
1043
+ org_id?: string
1044
+ org_image?: string | null
1045
+ org_metadata?: Json | null
1046
+ org_name?: string | null
1047
+ org_plan?: Json | null
1048
+ stripe_customer_details?: Json | null
1049
+ stripe_customer_id?: string | null
1050
+ stripe_subscription_details?: Json | null
1051
+ support_link?: string | null
1052
+ }
1053
+ Relationships: []
1054
+ }
1055
+ tbl_org_labels: {
1056
+ Row: {
1057
+ color: string
1058
+ created_at: string
1059
+ label_id: string
1060
+ name: string
1061
+ org_id: string
1062
+ type: string
1063
+ }
1064
+ Insert: {
1065
+ color?: string
1066
+ created_at?: string
1067
+ label_id?: string
1068
+ name: string
1069
+ org_id: string
1070
+ type?: string
1071
+ }
1072
+ Update: {
1073
+ color?: string
1074
+ created_at?: string
1075
+ label_id?: string
1076
+ name?: string
1077
+ org_id?: string
1078
+ type?: string
1079
+ }
1080
+ Relationships: [
1081
+ {
1082
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1083
+ columns: ["org_id"]
1084
+ referencedRelation: "tbl_org"
1085
+ referencedColumns: ["org_id"]
1086
+ },
1087
+ {
1088
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
1089
+ columns: ["org_id"]
1090
+ referencedRelation: "view_org"
1091
+ referencedColumns: ["org_id"]
1092
+ }
1093
+ ]
1094
+ }
1095
+ tbl_org_members: {
1096
+ Row: {
1097
+ created_at: string | null
1098
+ email: string
1099
+ invited_at: string | null
1100
+ invited_by: string | null
1101
+ is_active: boolean
1102
+ is_owner: boolean | null
1103
+ label_ids: string[] | null
1104
+ member_color: Database["public"]["Enums"]["enum_chat_colors"]
1105
+ member_image: string | null
1106
+ member_name: string | null
1107
+ org_id: string
1108
+ org_phones: string[] | null
1109
+ preferences: Json
1110
+ role: Database["public"]["Enums"]["enum_member_role"]
1111
+ user_id: string | null
1112
+ }
1113
+ Insert: {
1114
+ created_at?: string | null
1115
+ email: string
1116
+ invited_at?: string | null
1117
+ invited_by?: string | null
1118
+ is_active?: boolean
1119
+ is_owner?: boolean | null
1120
+ label_ids?: string[] | null
1121
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1122
+ member_image?: string | null
1123
+ member_name?: string | null
1124
+ org_id: string
1125
+ org_phones?: string[] | null
1126
+ preferences?: Json
1127
+ role?: Database["public"]["Enums"]["enum_member_role"]
1128
+ user_id?: string | null
1129
+ }
1130
+ Update: {
1131
+ created_at?: string | null
1132
+ email?: string
1133
+ invited_at?: string | null
1134
+ invited_by?: string | null
1135
+ is_active?: boolean
1136
+ is_owner?: boolean | null
1137
+ label_ids?: string[] | null
1138
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1139
+ member_image?: string | null
1140
+ member_name?: string | null
1141
+ org_id?: string
1142
+ org_phones?: string[] | null
1143
+ preferences?: Json
1144
+ role?: Database["public"]["Enums"]["enum_member_role"]
1145
+ user_id?: string | null
1146
+ }
1147
+ Relationships: [
1148
+ {
1149
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
1150
+ columns: ["user_id"]
1151
+ referencedRelation: "users"
1152
+ referencedColumns: ["id"]
1153
+ },
1154
+ {
1155
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1156
+ columns: ["org_id"]
1157
+ referencedRelation: "tbl_org"
1158
+ referencedColumns: ["org_id"]
1159
+ },
1160
+ {
1161
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1162
+ columns: ["org_id"]
1163
+ referencedRelation: "view_org"
1164
+ referencedColumns: ["org_id"]
1165
+ }
1166
+ ]
1167
+ }
1168
+ tbl_org_phones: {
1169
+ Row: {
1170
+ created_at: string
1171
+ first_connected_at: string | null
1172
+ is_browser_open: boolean
1173
+ is_ready: boolean | null
1174
+ legacy_version: boolean | null
1175
+ org_id: string
1176
+ org_phone: string | null
1177
+ phone_id: string
1178
+ phone_image: string | null
1179
+ phone_name: string | null
1180
+ phone_state: Json | null
1181
+ qr_code: string | null
1182
+ server_ip: string | null
1183
+ updated_at: string | null
1184
+ wa_state: string | null
1185
+ wa_version: string | null
1186
+ }
1187
+ Insert: {
1188
+ created_at?: string
1189
+ first_connected_at?: string | null
1190
+ is_browser_open?: boolean
1191
+ is_ready?: boolean | null
1192
+ legacy_version?: boolean | null
1193
+ org_id: string
1194
+ org_phone?: string | null
1195
+ phone_id?: string
1196
+ phone_image?: string | null
1197
+ phone_name?: string | null
1198
+ phone_state?: Json | null
1199
+ qr_code?: string | null
1200
+ server_ip?: string | null
1201
+ updated_at?: string | null
1202
+ wa_state?: string | null
1203
+ wa_version?: string | null
1204
+ }
1205
+ Update: {
1206
+ created_at?: string
1207
+ first_connected_at?: string | null
1208
+ is_browser_open?: boolean
1209
+ is_ready?: boolean | null
1210
+ legacy_version?: boolean | null
1211
+ org_id?: string
1212
+ org_phone?: string | null
1213
+ phone_id?: string
1214
+ phone_image?: string | null
1215
+ phone_name?: string | null
1216
+ phone_state?: Json | null
1217
+ qr_code?: string | null
1218
+ server_ip?: string | null
1219
+ updated_at?: string | null
1220
+ wa_state?: string | null
1221
+ wa_version?: string | null
1222
+ }
1223
+ Relationships: [
1224
+ {
1225
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1226
+ columns: ["org_id"]
1227
+ referencedRelation: "tbl_org"
1228
+ referencedColumns: ["org_id"]
1229
+ },
1230
+ {
1231
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1232
+ columns: ["org_id"]
1233
+ referencedRelation: "view_org"
1234
+ referencedColumns: ["org_id"]
1235
+ },
1236
+ {
1237
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1238
+ columns: ["org_id"]
1239
+ referencedRelation: "tbl_org"
1240
+ referencedColumns: ["org_id"]
1241
+ },
1242
+ {
1243
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1244
+ columns: ["org_id"]
1245
+ referencedRelation: "view_org"
1246
+ referencedColumns: ["org_id"]
1247
+ }
1248
+ ]
1249
+ }
1250
+ tbl_quick_replies: {
1251
+ Row: {
1252
+ command: string | null
1253
+ created_at: string
1254
+ message_payload: Json | null
1255
+ org_id: string | null
1256
+ reply_id: string
1257
+ }
1258
+ Insert: {
1259
+ command?: string | null
1260
+ created_at?: string
1261
+ message_payload?: Json | null
1262
+ org_id?: string | null
1263
+ reply_id?: string
1264
+ }
1265
+ Update: {
1266
+ command?: string | null
1267
+ created_at?: string
1268
+ message_payload?: Json | null
1269
+ org_id?: string | null
1270
+ reply_id?: string
1271
+ }
1272
+ Relationships: [
1273
+ {
1274
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1275
+ columns: ["org_id"]
1276
+ referencedRelation: "tbl_org"
1277
+ referencedColumns: ["org_id"]
1278
+ },
1279
+ {
1280
+ foreignKeyName: "tbl_quick_replies_org_id_fkey"
1281
+ columns: ["org_id"]
1282
+ referencedRelation: "view_org"
1283
+ referencedColumns: ["org_id"]
1284
+ }
1285
+ ]
1286
+ }
1287
+ tbl_tools_whatsapp_links: {
1288
+ Row: {
1289
+ created_at: string
1290
+ link_id: string
1291
+ link_name: string
1292
+ message: string | null
1293
+ phone: string
1294
+ }
1295
+ Insert: {
1296
+ created_at?: string
1297
+ link_id?: string
1298
+ link_name: string
1299
+ message?: string | null
1300
+ phone: string
1301
+ }
1302
+ Update: {
1303
+ created_at?: string
1304
+ link_id?: string
1305
+ link_name?: string
1306
+ message?: string | null
1307
+ phone?: string
1308
+ }
1309
+ Relationships: []
1310
+ }
1311
+ }
1312
+ Views: {
1313
+ view_broadcast_logs: {
1314
+ Row: {
1315
+ broadcast_id: string | null
1316
+ created_at: string | null
1317
+ delivery_percentage: number | null
1318
+ failed_chats: number | null
1319
+ message_payload: Json | null
1320
+ org_id: string | null
1321
+ pending_chats: number | null
1322
+ performed_at: string | null
1323
+ performed_by: string | null
1324
+ read_percentage: number | null
1325
+ scheduled_at: string | null
1326
+ sent_chats: number | null
1327
+ total_chats: number | null
1328
+ total_delivered_count: number | null
1329
+ total_member_count: number | null
1330
+ total_read_count: number | null
1331
+ }
1332
+ Relationships: [
1333
+ {
1334
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1335
+ columns: ["org_id"]
1336
+ referencedRelation: "tbl_org"
1337
+ referencedColumns: ["org_id"]
1338
+ },
1339
+ {
1340
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1341
+ columns: ["org_id"]
1342
+ referencedRelation: "view_org"
1343
+ referencedColumns: ["org_id"]
1344
+ }
1345
+ ]
1346
+ }
1347
+ view_chats: {
1348
+ Row: {
1349
+ active_phone: string | null
1350
+ chat_access: Json | null
1351
+ chat_id: string | null
1352
+ chat_image: string | null
1353
+ chat_name: string | null
1354
+ chat_type: string | null
1355
+ created_at: string | null
1356
+ custom_properties: Json | null
1357
+ flag_count: number | null
1358
+ group_description: string | null
1359
+ hubspot_metadata: Json | null
1360
+ invite_link: string | null
1361
+ is_archived: boolean | null
1362
+ is_muted: boolean | null
1363
+ label_ids: Json | null
1364
+ last_read_timestamp: string | null
1365
+ latest_message: Json | null
1366
+ member_count: number | null
1367
+ message_unread_count: number | null
1368
+ org_id: string | null
1369
+ org_phone: string | null
1370
+ updated_at: string | null
1371
+ }
1372
+ Relationships: []
1373
+ }
1374
+ view_org: {
1375
+ Row: {
1376
+ created_at: string | null
1377
+ is_enterprise: boolean | null
1378
+ is_free_trial: boolean | null
1379
+ is_hubspot_connected: boolean | null
1380
+ org_id: string | null
1381
+ org_image: string | null
1382
+ org_metadata: Json | null
1383
+ org_name: string | null
1384
+ org_plan: Json | null
1385
+ pending_days: number | null
1386
+ phone_limit: string | null
1387
+ plan_id: string | null
1388
+ stripe_customer_details: Json | null
1389
+ stripe_customer_id: string | null
1390
+ stripe_subscription_details: Json | null
1391
+ subscription_status: string | null
1392
+ support_link: string | null
1393
+ user_limit: string | null
1394
+ }
1395
+ Insert: {
1396
+ created_at?: string | null
1397
+ is_enterprise?: never
1398
+ is_free_trial?: never
1399
+ is_hubspot_connected?: never
1400
+ org_id?: string | null
1401
+ org_image?: string | null
1402
+ org_metadata?: Json | null
1403
+ org_name?: string | null
1404
+ org_plan?: Json | null
1405
+ pending_days?: never
1406
+ phone_limit?: never
1407
+ plan_id?: never
1408
+ stripe_customer_details?: Json | null
1409
+ stripe_customer_id?: string | null
1410
+ stripe_subscription_details?: Json | null
1411
+ subscription_status?: never
1412
+ support_link?: string | null
1413
+ user_limit?: never
1414
+ }
1415
+ Update: {
1416
+ created_at?: string | null
1417
+ is_enterprise?: never
1418
+ is_free_trial?: never
1419
+ is_hubspot_connected?: never
1420
+ org_id?: string | null
1421
+ org_image?: string | null
1422
+ org_metadata?: Json | null
1423
+ org_name?: string | null
1424
+ org_plan?: Json | null
1425
+ pending_days?: never
1426
+ phone_limit?: never
1427
+ plan_id?: never
1428
+ stripe_customer_details?: Json | null
1429
+ stripe_customer_id?: string | null
1430
+ stripe_subscription_details?: Json | null
1431
+ subscription_status?: never
1432
+ support_link?: string | null
1433
+ user_limit?: never
1434
+ }
1435
+ Relationships: []
1436
+ }
1437
+ }
1438
+ Functions: {
1439
+ gen_id: {
1440
+ Args: {
1441
+ prefix: string
1442
+ size?: number
1443
+ alphabet?: string
1444
+ }
1445
+ Returns: string
1446
+ }
1447
+ gen_ticket_id: {
1448
+ Args: {
1449
+ org_id_input: string
1450
+ }
1451
+ Returns: string
1452
+ }
1453
+ generate_access_token: {
1454
+ Args: {
1455
+ name_input?: string
1456
+ type_input?: Database["public"]["Enums"]["enum_integration_type"]
1457
+ org_id_input?: string
1458
+ }
1459
+ Returns: Json
1460
+ }
1461
+ get_api_auth_details: {
1462
+ Args: {
1463
+ org_id_input?: string
1464
+ org_phone_input?: string
1465
+ token_id_input?: string
1466
+ token_type_input?: Database["public"]["Enums"]["enum_integration_type"]
1467
+ }
1468
+ Returns: Json
1469
+ }
1470
+ get_chat_labels_data: {
1471
+ Args: {
1472
+ org_id_input: string
1473
+ chat_ids_input?: string[]
1474
+ }
1475
+ Returns: unknown
1476
+ }
1477
+ get_chat_members: {
1478
+ Args: {
1479
+ org_id_input?: string
1480
+ chat_id_input?: string[]
1481
+ }
1482
+ Returns: Json
1483
+ }
1484
+ get_chats: {
1485
+ Args: {
1486
+ org_id_input?: string
1487
+ chat_id_input?: string[]
1488
+ }
1489
+ Returns: Json
1490
+ }
1491
+ get_chats_info: {
1492
+ Args: {
1493
+ chat_id_input: string
1494
+ org_id_input: string
1495
+ org_phone_input?: string
1496
+ }
1497
+ Returns: Json
1498
+ }
1499
+ get_contacts: {
1500
+ Args: {
1501
+ org_id_input: string
1502
+ contact_ids_input?: string[]
1503
+ with_chats?: boolean
1504
+ with_name?: boolean
1505
+ }
1506
+ Returns: Json
1507
+ }
1508
+ get_dashboard_statistics: {
1509
+ Args: {
1510
+ org_id_input: string
1511
+ interval_input?: unknown
1512
+ chat_id_input?: string[]
1513
+ }
1514
+ Returns: Json
1515
+ }
1516
+ get_export_chats_data: {
1517
+ Args: {
1518
+ org_id_input: string
1519
+ chat_ids?: string[]
1520
+ }
1521
+ Returns: Json
1522
+ }
1523
+ get_integration_data: {
1524
+ Args: {
1525
+ org_id_input?: string
1526
+ }
1527
+ Returns: Json
1528
+ }
1529
+ get_messages_notifications_reactions: {
1530
+ Args: {
1531
+ org_id_input: string
1532
+ chat_id_input?: string[]
1533
+ message_limit_input?: number
1534
+ reaction_notification_limit_input?: number
1535
+ last_updated_at_input?: string
1536
+ }
1537
+ Returns: Json
1538
+ }
1539
+ get_org: {
1540
+ Args: {
1541
+ org_id_input?: string
1542
+ }
1543
+ Returns: Json
1544
+ }
1545
+ get_org_phones: {
1546
+ Args: {
1547
+ org_id_input?: string
1548
+ phone_id_input?: string
1549
+ }
1550
+ Returns: Json
1551
+ }
1552
+ get_team_metrics: {
1553
+ Args: {
1554
+ org_id_input: string
1555
+ chat_id_input?: string[]
1556
+ interval_input?: unknown
1557
+ }
1558
+ Returns: Json
1559
+ }
1560
+ get_ticket_info: {
1561
+ Args: {
1562
+ ticket_id_input?: string
1563
+ org_id_input?: string
1564
+ chat_id_input?: string
1565
+ unique_message_id_input?: string
1566
+ }
1567
+ Returns: Json
1568
+ }
1569
+ image_path: {
1570
+ Args: {
1571
+ path_input?: string
1572
+ bucket_name?: string
1573
+ req_base?: boolean
1574
+ }
1575
+ Returns: string
1576
+ }
1577
+ list_org_from_user: {
1578
+ Args: Record<PropertyKey, never>
1579
+ Returns: unknown
1580
+ }
1581
+ list_role_from_user: {
1582
+ Args: Record<PropertyKey, never>
1583
+ Returns: Database["public"]["Enums"]["enum_member_role"]
1584
+ }
1585
+ update_labels: {
1586
+ Args: {
1587
+ org_id_input: string
1588
+ tbl_type: string
1589
+ label_ids_input: Json
1590
+ row_id_input: string[]
1591
+ replace_labels?: boolean
1592
+ }
1593
+ Returns: undefined
1594
+ }
1595
+ }
1596
+ Enums: {
1597
+ enum_chat_colors:
1598
+ | "#B4876E"
1599
+ | "#A5B337"
1600
+ | "#06CF9C"
1601
+ | "#25D366"
1602
+ | "#02A698"
1603
+ | "#7D9EF1"
1604
+ | "#007BFC"
1605
+ | "#5E47DE"
1606
+ | "#7F66FF"
1607
+ | "#9333EA"
1608
+ | "#FA6533"
1609
+ | "#C4532D"
1610
+ | "#DC2626"
1611
+ | "#FF2E74"
1612
+ | "#DB2777"
1613
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1614
+ enum_integration_name:
1615
+ | "org.created"
1616
+ | "org.updated"
1617
+ | "org.member.created"
1618
+ | "org.member.updated"
1619
+ | "org.phone.created"
1620
+ | "org.phone.connected"
1621
+ | "org.phone.disconnected"
1622
+ | "org.subscription.trial_will_end"
1623
+ | "chat.created"
1624
+ | "chat.updated"
1625
+ | "message.created"
1626
+ | "message.updated"
1627
+ | "message.deleted"
1628
+ | "message.ack.updated"
1629
+ | "reaction.created"
1630
+ | "reaction.updated"
1631
+ | "ticket.created"
1632
+ | "ticket.updated"
1633
+ | "ticket.deleted"
1634
+ enum_integration_type:
1635
+ | "zapier"
1636
+ | "pabbly"
1637
+ | "api"
1638
+ | "webhook"
1639
+ | "hubspot"
1640
+ | "freshdesk"
1641
+ | "slack"
1642
+ | "jira"
1643
+ | "salesforce"
1644
+ enum_member_role: "admin" | "member"
1645
+ }
1646
+ CompositeTypes: {
1647
+ [_ in never]: never
1648
+ }
1649
+ }
1650
+ storage: {
1651
+ Tables: {
1652
+ buckets: {
1653
+ Row: {
1654
+ allowed_mime_types: string[] | null
1655
+ avif_autodetection: boolean | null
1656
+ created_at: string | null
1657
+ file_size_limit: number | null
1658
+ id: string
1659
+ name: string
1660
+ owner: string | null
1661
+ public: boolean | null
1662
+ updated_at: string | null
1663
+ }
1664
+ Insert: {
1665
+ allowed_mime_types?: string[] | null
1666
+ avif_autodetection?: boolean | null
1667
+ created_at?: string | null
1668
+ file_size_limit?: number | null
1669
+ id: string
1670
+ name: string
1671
+ owner?: string | null
1672
+ public?: boolean | null
1673
+ updated_at?: string | null
1674
+ }
1675
+ Update: {
1676
+ allowed_mime_types?: string[] | null
1677
+ avif_autodetection?: boolean | null
1678
+ created_at?: string | null
1679
+ file_size_limit?: number | null
1680
+ id?: string
1681
+ name?: string
1682
+ owner?: string | null
1683
+ public?: boolean | null
1684
+ updated_at?: string | null
1685
+ }
1686
+ Relationships: [
1687
+ {
1688
+ foreignKeyName: "buckets_owner_fkey"
1689
+ columns: ["owner"]
1690
+ referencedRelation: "users"
1691
+ referencedColumns: ["id"]
1692
+ }
1693
+ ]
1694
+ }
1695
+ migrations: {
1696
+ Row: {
1697
+ executed_at: string | null
1698
+ hash: string
1699
+ id: number
1700
+ name: string
1701
+ }
1702
+ Insert: {
1703
+ executed_at?: string | null
1704
+ hash: string
1705
+ id: number
1706
+ name: string
1707
+ }
1708
+ Update: {
1709
+ executed_at?: string | null
1710
+ hash?: string
1711
+ id?: number
1712
+ name?: string
1713
+ }
1714
+ Relationships: []
1715
+ }
1716
+ objects: {
1717
+ Row: {
1718
+ bucket_id: string | null
1719
+ created_at: string | null
1720
+ id: string
1721
+ last_accessed_at: string | null
1722
+ metadata: Json | null
1723
+ name: string | null
1724
+ owner: string | null
1725
+ path_tokens: string[] | null
1726
+ updated_at: string | null
1727
+ version: string | null
1728
+ }
1729
+ Insert: {
1730
+ bucket_id?: string | null
1731
+ created_at?: string | null
1732
+ id?: string
1733
+ last_accessed_at?: string | null
1734
+ metadata?: Json | null
1735
+ name?: string | null
1736
+ owner?: string | null
1737
+ path_tokens?: string[] | null
1738
+ updated_at?: string | null
1739
+ version?: string | null
1740
+ }
1741
+ Update: {
1742
+ bucket_id?: string | null
1743
+ created_at?: string | null
1744
+ id?: string
1745
+ last_accessed_at?: string | null
1746
+ metadata?: Json | null
1747
+ name?: string | null
1748
+ owner?: string | null
1749
+ path_tokens?: string[] | null
1750
+ updated_at?: string | null
1751
+ version?: string | null
1752
+ }
1753
+ Relationships: [
1754
+ {
1755
+ foreignKeyName: "objects_bucketId_fkey"
1756
+ columns: ["bucket_id"]
1757
+ referencedRelation: "buckets"
1758
+ referencedColumns: ["id"]
1759
+ }
1760
+ ]
1761
+ }
1762
+ }
1763
+ Views: {
1764
+ [_ in never]: never
1765
+ }
1766
+ Functions: {
1767
+ can_insert_object: {
1768
+ Args: {
1769
+ bucketid: string
1770
+ name: string
1771
+ owner: string
1772
+ metadata: Json
1773
+ }
1774
+ Returns: undefined
1775
+ }
1776
+ extension: {
1777
+ Args: {
1778
+ name: string
1779
+ }
1780
+ Returns: string
1781
+ }
1782
+ filename: {
1783
+ Args: {
1784
+ name: string
1785
+ }
1786
+ Returns: string
1787
+ }
1788
+ foldername: {
1789
+ Args: {
1790
+ name: string
1791
+ }
1792
+ Returns: unknown
1793
+ }
1794
+ get_size_by_bucket: {
1795
+ Args: Record<PropertyKey, never>
1796
+ Returns: {
1797
+ size: number
1798
+ bucket_id: string
1799
+ }[]
1800
+ }
1801
+ search: {
1802
+ Args: {
1803
+ prefix: string
1804
+ bucketname: string
1805
+ limits?: number
1806
+ levels?: number
1807
+ offsets?: number
1808
+ search?: string
1809
+ sortcolumn?: string
1810
+ sortorder?: string
1811
+ }
1812
+ Returns: {
1813
+ name: string
1814
+ id: string
1815
+ updated_at: string
1816
+ created_at: string
1817
+ last_accessed_at: string
1818
+ metadata: Json
1819
+ }[]
1820
+ }
1821
+ }
1822
+ Enums: {
1823
+ [_ in never]: never
1824
+ }
1825
+ CompositeTypes: {
1826
+ [_ in never]: never
1827
+ }
1828
+ }
1829
+ }
1830
+
1831
+ type PublicSchema = Database[Extract<keyof Database, "public">]
1832
+
1833
+ export type Tables<
1834
+ PublicTableNameOrOptions extends
1835
+ | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
1836
+ | { schema: keyof Database },
1837
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1838
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1839
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
1840
+ : never = never,
1841
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1842
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1843
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1844
+ Row: infer R
1845
+ }
1846
+ ? R
1847
+ : never
1848
+ : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
1849
+ PublicSchema["Views"])
1850
+ ? (PublicSchema["Tables"] &
1851
+ PublicSchema["Views"])[PublicTableNameOrOptions] extends {
1852
+ Row: infer R
1853
+ }
1854
+ ? R
1855
+ : never
1856
+ : never
1857
+
1858
+ export type TablesInsert<
1859
+ PublicTableNameOrOptions extends
1860
+ | keyof PublicSchema["Tables"]
1861
+ | { schema: keyof Database },
1862
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1863
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1864
+ : never = never,
1865
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1866
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1867
+ Insert: infer I
1868
+ }
1869
+ ? I
1870
+ : never
1871
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1872
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1873
+ Insert: infer I
1874
+ }
1875
+ ? I
1876
+ : never
1877
+ : never
1878
+
1879
+ export type TablesUpdate<
1880
+ PublicTableNameOrOptions extends
1881
+ | keyof PublicSchema["Tables"]
1882
+ | { schema: keyof Database },
1883
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1884
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1885
+ : never = never,
1886
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1887
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1888
+ Update: infer U
1889
+ }
1890
+ ? U
1891
+ : never
1892
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1893
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1894
+ Update: infer U
1895
+ }
1896
+ ? U
1897
+ : never
1898
+ : never
1899
+
1900
+ export type Enums<
1901
+ PublicEnumNameOrOptions extends
1902
+ | keyof PublicSchema["Enums"]
1903
+ | { schema: keyof Database },
1904
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1905
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1906
+ : never = never,
1907
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
1908
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1909
+ : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
1910
+ ? PublicSchema["Enums"][PublicEnumNameOrOptions]
1911
+ : never