@periskope/types 0.6.83 → 0.6.85

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