@periskope/types 0.6.74 → 0.6.76

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,1905 +1,1926 @@
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
- org_id: string
866
- response_id: string | null
867
- response_timestamp: string | null
868
- response_type: string | null
869
- unique_id: string
870
- }
871
- Insert: {
872
- chat_id?: string | null
873
- org_id: string
874
- response_id?: string | null
875
- response_timestamp?: string | null
876
- response_type?: string | null
877
- unique_id: string
878
- }
879
- Update: {
880
- chat_id?: string | null
881
- org_id?: string
882
- response_id?: string | null
883
- response_timestamp?: string | null
884
- response_type?: string | null
885
- unique_id?: string
886
- }
887
- Relationships: [
888
- {
889
- foreignKeyName: "tbl_flagged_messages_org_id_fkey"
890
- columns: ["org_id"]
891
- isOneToOne: false
892
- referencedRelation: "tbl_org"
893
- referencedColumns: ["org_id"]
894
- },
895
- {
896
- foreignKeyName: "tbl_flagged_messages_org_id_fkey"
897
- columns: ["org_id"]
898
- isOneToOne: false
899
- referencedRelation: "view_org"
900
- referencedColumns: ["org_id"]
901
- },
902
- ]
903
- }
904
- tbl_integration_hooks: {
905
- Row: {
906
- hook_url: string
907
- id: string
908
- integration_id: string | null
909
- integration_metadata: Json
910
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
911
- integration_type: string
912
- is_subscribed: boolean
913
- org_id: string
914
- subscribed_at: string
915
- type: string
916
- }
917
- Insert: {
918
- hook_url: string
919
- id?: string
920
- integration_id?: string | null
921
- integration_metadata: Json
922
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
923
- integration_type: string
924
- is_subscribed: boolean
925
- org_id: string
926
- subscribed_at?: string
927
- type: string
928
- }
929
- Update: {
930
- hook_url?: string
931
- id?: string
932
- integration_id?: string | null
933
- integration_metadata?: Json
934
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
935
- integration_type?: string
936
- is_subscribed?: boolean
937
- org_id?: string
938
- subscribed_at?: string
939
- type?: string
940
- }
941
- Relationships: [
942
- {
943
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
944
- columns: ["org_id"]
945
- isOneToOne: false
946
- referencedRelation: "tbl_org"
947
- referencedColumns: ["org_id"]
948
- },
949
- {
950
- foreignKeyName: "tbl_integration_hooks_org_id_fkey"
951
- columns: ["org_id"]
952
- isOneToOne: false
953
- referencedRelation: "view_org"
954
- referencedColumns: ["org_id"]
955
- },
956
- ]
957
- }
958
- tbl_integration_logs: {
959
- Row: {
960
- created_at: string
961
- id: string
962
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
963
- integration_type: string
964
- metadata: Json
965
- org_id: string
966
- success: boolean
967
- type: string
968
- }
969
- Insert: {
970
- created_at?: string
971
- id?: string
972
- integration_name: Database["public"]["Enums"]["enum_integration_name"]
973
- integration_type: string
974
- metadata?: Json
975
- org_id: string
976
- success?: boolean
977
- type: string
978
- }
979
- Update: {
980
- created_at?: string
981
- id?: string
982
- integration_name?: Database["public"]["Enums"]["enum_integration_name"]
983
- integration_type?: string
984
- metadata?: Json
985
- org_id?: string
986
- success?: boolean
987
- type?: string
988
- }
989
- Relationships: [
990
- {
991
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
992
- columns: ["org_id"]
993
- isOneToOne: false
994
- referencedRelation: "tbl_org"
995
- referencedColumns: ["org_id"]
996
- },
997
- {
998
- foreignKeyName: "tbl_integration_logs_org_id_fkey"
999
- columns: ["org_id"]
1000
- isOneToOne: false
1001
- referencedRelation: "view_org"
1002
- referencedColumns: ["org_id"]
1003
- },
1004
- ]
1005
- }
1006
- tbl_integration_tokens: {
1007
- Row: {
1008
- exp: string
1009
- iat: string
1010
- id: string
1011
- is_revealed: boolean
1012
- name: string
1013
- org_id: string
1014
- role: string
1015
- token: string
1016
- type: string
1017
- }
1018
- Insert: {
1019
- exp: string
1020
- iat: string
1021
- id?: string
1022
- is_revealed?: boolean
1023
- name: string
1024
- org_id: string
1025
- role: string
1026
- token: string
1027
- type: string
1028
- }
1029
- Update: {
1030
- exp?: string
1031
- iat?: string
1032
- id?: string
1033
- is_revealed?: boolean
1034
- name?: string
1035
- org_id?: string
1036
- role?: string
1037
- token?: string
1038
- type?: string
1039
- }
1040
- Relationships: [
1041
- {
1042
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1043
- columns: ["org_id"]
1044
- isOneToOne: false
1045
- referencedRelation: "tbl_org"
1046
- referencedColumns: ["org_id"]
1047
- },
1048
- {
1049
- foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
1050
- columns: ["org_id"]
1051
- isOneToOne: false
1052
- referencedRelation: "view_org"
1053
- referencedColumns: ["org_id"]
1054
- },
1055
- ]
1056
- }
1057
- tbl_org: {
1058
- Row: {
1059
- created_at: string
1060
- org_id: string
1061
- org_image: string | null
1062
- org_metadata: Json | null
1063
- org_name: string | null
1064
- org_plan: Json | null
1065
- stripe_customer_details: Json | null
1066
- stripe_customer_id: string | null
1067
- stripe_subscription_details: Json | null
1068
- support_link: string | null
1069
- }
1070
- Insert: {
1071
- created_at?: string
1072
- org_id?: string
1073
- org_image?: string | null
1074
- org_metadata?: Json | null
1075
- org_name?: string | null
1076
- org_plan?: Json | null
1077
- stripe_customer_details?: Json | null
1078
- stripe_customer_id?: string | null
1079
- stripe_subscription_details?: Json | null
1080
- support_link?: string | null
1081
- }
1082
- Update: {
1083
- created_at?: string
1084
- org_id?: string
1085
- org_image?: string | null
1086
- org_metadata?: Json | null
1087
- org_name?: string | null
1088
- org_plan?: Json | null
1089
- stripe_customer_details?: Json | null
1090
- stripe_customer_id?: string | null
1091
- stripe_subscription_details?: Json | null
1092
- support_link?: string | null
1093
- }
1094
- Relationships: []
1095
- }
1096
- tbl_org_labels: {
1097
- Row: {
1098
- color: string
1099
- created_at: string
1100
- label_id: string
1101
- name: string
1102
- org_id: string
1103
- type: string
1104
- }
1105
- Insert: {
1106
- color?: string
1107
- created_at?: string
1108
- label_id?: string
1109
- name: string
1110
- org_id: string
1111
- type?: string
1112
- }
1113
- Update: {
1114
- color?: string
1115
- created_at?: string
1116
- label_id?: string
1117
- name?: string
1118
- org_id?: string
1119
- type?: string
1120
- }
1121
- Relationships: [
1122
- {
1123
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1124
- columns: ["org_id"]
1125
- isOneToOne: false
1126
- referencedRelation: "tbl_org"
1127
- referencedColumns: ["org_id"]
1128
- },
1129
- {
1130
- foreignKeyName: "tbl_org_labels_org_id_fkey"
1131
- columns: ["org_id"]
1132
- isOneToOne: false
1133
- referencedRelation: "view_org"
1134
- referencedColumns: ["org_id"]
1135
- },
1136
- ]
1137
- }
1138
- tbl_org_members: {
1139
- Row: {
1140
- created_at: string | null
1141
- email: string
1142
- invited_at: string | null
1143
- invited_by: string | null
1144
- is_active: boolean
1145
- is_owner: boolean | null
1146
- label_ids: string[] | null
1147
- member_color: Database["public"]["Enums"]["enum_chat_colors"]
1148
- member_image: string | null
1149
- member_name: string | null
1150
- org_id: string
1151
- org_phones: string[] | null
1152
- role: Database["public"]["Enums"]["enum_member_role"]
1153
- user_id: string | null
1154
- }
1155
- Insert: {
1156
- created_at?: string | null
1157
- email: string
1158
- invited_at?: string | null
1159
- invited_by?: string | null
1160
- is_active?: boolean
1161
- is_owner?: boolean | null
1162
- label_ids?: string[] | null
1163
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1164
- member_image?: string | null
1165
- member_name?: string | null
1166
- org_id: string
1167
- org_phones?: string[] | null
1168
- role?: Database["public"]["Enums"]["enum_member_role"]
1169
- user_id?: string | null
1170
- }
1171
- Update: {
1172
- created_at?: string | null
1173
- email?: string
1174
- invited_at?: string | null
1175
- invited_by?: string | null
1176
- is_active?: boolean
1177
- is_owner?: boolean | null
1178
- label_ids?: string[] | null
1179
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1180
- member_image?: string | null
1181
- member_name?: string | null
1182
- org_id?: string
1183
- org_phones?: string[] | null
1184
- role?: Database["public"]["Enums"]["enum_member_role"]
1185
- user_id?: string | null
1186
- }
1187
- Relationships: [
1188
- {
1189
- foreignKeyName: "tbl_org_members_fkey_auth_users"
1190
- columns: ["user_id"]
1191
- isOneToOne: false
1192
- referencedRelation: "users"
1193
- referencedColumns: ["id"]
1194
- },
1195
- {
1196
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1197
- columns: ["org_id"]
1198
- isOneToOne: false
1199
- referencedRelation: "tbl_org"
1200
- referencedColumns: ["org_id"]
1201
- },
1202
- {
1203
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
1204
- columns: ["org_id"]
1205
- isOneToOne: false
1206
- referencedRelation: "view_org"
1207
- referencedColumns: ["org_id"]
1208
- },
1209
- ]
1210
- }
1211
- tbl_org_phones: {
1212
- Row: {
1213
- created_at: string
1214
- first_connected_at: string | null
1215
- is_ready: boolean | null
1216
- org_id: string
1217
- org_phone: string | null
1218
- phone_id: string
1219
- phone_image: string | null
1220
- phone_name: string | null
1221
- phone_state: Json | null
1222
- qr_code: string | null
1223
- server_ip: string | null
1224
- updated_at: string | null
1225
- wa_state: string | null
1226
- wa_version: string | null
1227
- }
1228
- Insert: {
1229
- created_at?: string
1230
- first_connected_at?: string | null
1231
- is_ready?: boolean | null
1232
- org_id: string
1233
- org_phone?: string | null
1234
- phone_id?: string
1235
- phone_image?: string | null
1236
- phone_name?: string | null
1237
- phone_state?: Json | null
1238
- qr_code?: string | null
1239
- server_ip?: string | null
1240
- updated_at?: string | null
1241
- wa_state?: string | null
1242
- wa_version?: string | null
1243
- }
1244
- Update: {
1245
- created_at?: string
1246
- first_connected_at?: string | null
1247
- is_ready?: 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
- Relationships: [
1261
- {
1262
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1263
- columns: ["org_id"]
1264
- isOneToOne: false
1265
- referencedRelation: "tbl_org"
1266
- referencedColumns: ["org_id"]
1267
- },
1268
- {
1269
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1270
- columns: ["org_id"]
1271
- isOneToOne: false
1272
- referencedRelation: "view_org"
1273
- referencedColumns: ["org_id"]
1274
- },
1275
- {
1276
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1277
- columns: ["org_id"]
1278
- isOneToOne: false
1279
- referencedRelation: "tbl_org"
1280
- referencedColumns: ["org_id"]
1281
- },
1282
- {
1283
- foreignKeyName: "tbl_org_phones_org_id_fkey"
1284
- columns: ["org_id"]
1285
- isOneToOne: false
1286
- referencedRelation: "view_org"
1287
- referencedColumns: ["org_id"]
1288
- },
1289
- ]
1290
- }
1291
- tbl_quick_replies: {
1292
- Row: {
1293
- command: string | null
1294
- created_at: string
1295
- message_payload: Json | null
1296
- org_id: string | null
1297
- reply_id: string
1298
- }
1299
- Insert: {
1300
- command?: string | null
1301
- created_at?: string
1302
- message_payload?: Json | null
1303
- org_id?: string | null
1304
- reply_id?: string
1305
- }
1306
- Update: {
1307
- command?: string | null
1308
- created_at?: string
1309
- message_payload?: Json | null
1310
- org_id?: string | null
1311
- reply_id?: string
1312
- }
1313
- Relationships: [
1314
- {
1315
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1316
- columns: ["org_id"]
1317
- isOneToOne: false
1318
- referencedRelation: "tbl_org"
1319
- referencedColumns: ["org_id"]
1320
- },
1321
- {
1322
- foreignKeyName: "tbl_quick_replies_org_id_fkey"
1323
- columns: ["org_id"]
1324
- isOneToOne: false
1325
- referencedRelation: "view_org"
1326
- referencedColumns: ["org_id"]
1327
- },
1328
- ]
1329
- }
1330
- tbl_tools_whatsapp_links: {
1331
- Row: {
1332
- created_at: string
1333
- link_id: string
1334
- link_name: string
1335
- message: string | null
1336
- phone: string
1337
- }
1338
- Insert: {
1339
- created_at?: string
1340
- link_id?: string
1341
- link_name: string
1342
- message?: string | null
1343
- phone: string
1344
- }
1345
- Update: {
1346
- created_at?: string
1347
- link_id?: string
1348
- link_name?: string
1349
- message?: string | null
1350
- phone?: string
1351
- }
1352
- Relationships: []
1353
- }
1354
- }
1355
- Views: {
1356
- view_broadcast_logs: {
1357
- Row: {
1358
- broadcast_id: string | null
1359
- created_at: string | null
1360
- delivery_percentage: number | null
1361
- failed_chats: number | null
1362
- message_payload: Json | null
1363
- org_id: string | null
1364
- pending_chats: number | null
1365
- performed_at: string | null
1366
- performed_by: string | null
1367
- read_percentage: number | null
1368
- scheduled_at: string | null
1369
- sent_chats: number | null
1370
- total_chats: number | null
1371
- total_delivered_count: number | null
1372
- total_member_count: number | null
1373
- total_read_count: number | null
1374
- }
1375
- Relationships: [
1376
- {
1377
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1378
- columns: ["org_id"]
1379
- isOneToOne: false
1380
- referencedRelation: "tbl_org"
1381
- referencedColumns: ["org_id"]
1382
- },
1383
- {
1384
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1385
- columns: ["org_id"]
1386
- isOneToOne: false
1387
- referencedRelation: "view_org"
1388
- referencedColumns: ["org_id"]
1389
- },
1390
- ]
1391
- }
1392
- view_chats: {
1393
- Row: {
1394
- active_phone: string | null
1395
- chat_access: Json | null
1396
- chat_id: string | null
1397
- chat_image: string | null
1398
- chat_name: string | null
1399
- chat_type: string | null
1400
- created_at: string | null
1401
- custom_properties: Json | null
1402
- group_description: string | null
1403
- invite_link: string | null
1404
- is_archived: boolean | null
1405
- is_muted: boolean | null
1406
- label_ids: Json | null
1407
- last_read_timestamp: string | null
1408
- latest_message: Json | null
1409
- member_count: number | null
1410
- message_unread_count: number | null
1411
- org_id: string | null
1412
- org_phone: string | null
1413
- updated_at: string | null
1414
- }
1415
- Relationships: []
1416
- }
1417
- view_org: {
1418
- Row: {
1419
- created_at: string | null
1420
- is_enterprise: boolean | null
1421
- is_free_trial: boolean | null
1422
- org_id: string | null
1423
- org_image: string | null
1424
- org_metadata: Json | null
1425
- org_name: string | null
1426
- org_plan: Json | null
1427
- pending_days: number | null
1428
- phone_limit: string | null
1429
- plan_id: string | null
1430
- stripe_customer_details: Json | null
1431
- stripe_customer_id: string | null
1432
- stripe_subscription_details: Json | null
1433
- subscription_status: string | null
1434
- support_link: string | null
1435
- user_limit: string | null
1436
- }
1437
- Insert: {
1438
- created_at?: string | null
1439
- is_enterprise?: never
1440
- is_free_trial?: never
1441
- org_id?: string | null
1442
- org_image?: string | null
1443
- org_metadata?: Json | null
1444
- org_name?: string | null
1445
- org_plan?: Json | null
1446
- pending_days?: never
1447
- phone_limit?: never
1448
- plan_id?: never
1449
- stripe_customer_details?: Json | null
1450
- stripe_customer_id?: string | null
1451
- stripe_subscription_details?: Json | null
1452
- subscription_status?: never
1453
- support_link?: string | null
1454
- user_limit?: never
1455
- }
1456
- Update: {
1457
- created_at?: string | null
1458
- is_enterprise?: never
1459
- is_free_trial?: never
1460
- org_id?: string | null
1461
- org_image?: string | null
1462
- org_metadata?: Json | null
1463
- org_name?: string | null
1464
- org_plan?: Json | null
1465
- pending_days?: never
1466
- phone_limit?: never
1467
- plan_id?: never
1468
- stripe_customer_details?: Json | null
1469
- stripe_customer_id?: string | null
1470
- stripe_subscription_details?: Json | null
1471
- subscription_status?: never
1472
- support_link?: string | null
1473
- user_limit?: never
1474
- }
1475
- Relationships: []
1476
- }
1477
- }
1478
- Functions: {
1479
- gen_id: {
1480
- Args: {
1481
- prefix: string
1482
- size?: number
1483
- alphabet?: string
1484
- }
1485
- Returns: string
1486
- }
1487
- gen_ticket_id: {
1488
- Args: {
1489
- org_id_input: string
1490
- }
1491
- Returns: string
1492
- }
1493
- generate_access_token: {
1494
- Args: {
1495
- name_input?: string
1496
- type_input?: string
1497
- org_id_input?: string
1498
- }
1499
- Returns: Json
1500
- }
1501
- get_api_auth_details: {
1502
- Args: {
1503
- org_id_input?: string
1504
- org_phone_input?: string
1505
- token_id_input?: string
1506
- token_type_input?: string
1507
- }
1508
- Returns: Json
1509
- }
1510
- get_chat_labels_data: {
1511
- Args: {
1512
- org_id_input: string
1513
- chat_ids_input?: string[]
1514
- }
1515
- Returns: Json[]
1516
- }
1517
- get_chats: {
1518
- Args: {
1519
- org_id_input?: string
1520
- chat_id_input?: string[]
1521
- }
1522
- Returns: Json
1523
- }
1524
- get_contacts: {
1525
- Args: {
1526
- org_id_input: string
1527
- contact_ids_input?: string[]
1528
- last_updated_at_input?: string
1529
- }
1530
- Returns: Json
1531
- }
1532
- get_dashboard_statistics: {
1533
- Args: {
1534
- org_id_input: string
1535
- type_input?: string
1536
- interval_input?: unknown
1537
- }
1538
- Returns: Json
1539
- }
1540
- get_export_chats_data: {
1541
- Args: {
1542
- org_id_input: string
1543
- chat_ids?: string[]
1544
- }
1545
- Returns: Json
1546
- }
1547
- get_messages_notifications_reactions: {
1548
- Args: {
1549
- org_id_input: string
1550
- chat_id_input?: string[]
1551
- message_limit_input?: number
1552
- reaction_notification_limit_input?: number
1553
- last_updated_at_input?: string
1554
- }
1555
- Returns: Json
1556
- }
1557
- get_org: {
1558
- Args: {
1559
- org_id_input?: string
1560
- }
1561
- Returns: Json
1562
- }
1563
- get_org_phones: {
1564
- Args: {
1565
- org_id_input?: string
1566
- phone_id_input?: string
1567
- }
1568
- Returns: Json
1569
- }
1570
- get_ticket_info: {
1571
- Args: {
1572
- ticket_id_input?: string
1573
- org_id_input?: string
1574
- chat_id_input?: string
1575
- unique_message_id_input?: string
1576
- }
1577
- Returns: Json
1578
- }
1579
- list_org_from_user: {
1580
- Args: Record<PropertyKey, never>
1581
- Returns: string[]
1582
- }
1583
- list_role_from_user: {
1584
- Args: Record<PropertyKey, never>
1585
- Returns: Database["public"]["Enums"]["enum_member_role"]
1586
- }
1587
- update_labels: {
1588
- Args: {
1589
- org_id_input: string
1590
- tbl_type: string
1591
- label_ids_input: Json
1592
- row_id_input: string[]
1593
- replace_labels?: boolean
1594
- }
1595
- Returns: undefined
1596
- }
1597
- }
1598
- Enums: {
1599
- enum_chat_colors:
1600
- | "#B4876E"
1601
- | "#A5B337"
1602
- | "#06CF9C"
1603
- | "#25D366"
1604
- | "#02A698"
1605
- | "#7D9EF1"
1606
- | "#007BFC"
1607
- | "#5E47DE"
1608
- | "#7F66FF"
1609
- | "#9333EA"
1610
- | "#FA6533"
1611
- | "#C4532D"
1612
- | "#DC2626"
1613
- | "#FF2E74"
1614
- | "#DB2777"
1615
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1616
- enum_integration_name:
1617
- | "org.created"
1618
- | "org.updated"
1619
- | "org.member.created"
1620
- | "org.member.updated"
1621
- | "org.phone.created"
1622
- | "org.phone.connected"
1623
- | "org.phone.disconnected"
1624
- | "org.subscription.trial_will_end"
1625
- | "chat.created"
1626
- | "chat.updated"
1627
- | "message.created"
1628
- | "message.updated"
1629
- | "message.deleted"
1630
- | "message.ack.updated"
1631
- | "reaction.created"
1632
- | "reaction.updated"
1633
- | "ticket.created"
1634
- | "ticket.updated"
1635
- | "ticket.deleted"
1636
- enum_member_role: "admin" | "member"
1637
- }
1638
- CompositeTypes: {
1639
- [_ in never]: never
1640
- }
1641
- }
1642
- storage: {
1643
- Tables: {
1644
- buckets: {
1645
- Row: {
1646
- allowed_mime_types: string[] | null
1647
- avif_autodetection: boolean | null
1648
- created_at: string | null
1649
- file_size_limit: number | null
1650
- id: string
1651
- name: string
1652
- owner: string | null
1653
- owner_id: string | null
1654
- public: boolean | null
1655
- updated_at: string | null
1656
- }
1657
- Insert: {
1658
- allowed_mime_types?: string[] | null
1659
- avif_autodetection?: boolean | null
1660
- created_at?: string | null
1661
- file_size_limit?: number | null
1662
- id: string
1663
- name: string
1664
- owner?: string | null
1665
- owner_id?: string | null
1666
- public?: boolean | null
1667
- updated_at?: string | null
1668
- }
1669
- Update: {
1670
- allowed_mime_types?: string[] | null
1671
- avif_autodetection?: boolean | null
1672
- created_at?: string | null
1673
- file_size_limit?: number | null
1674
- id?: string
1675
- name?: string
1676
- owner?: string | null
1677
- owner_id?: string | null
1678
- public?: boolean | null
1679
- updated_at?: string | null
1680
- }
1681
- Relationships: []
1682
- }
1683
- migrations: {
1684
- Row: {
1685
- executed_at: string | null
1686
- hash: string
1687
- id: number
1688
- name: string
1689
- }
1690
- Insert: {
1691
- executed_at?: string | null
1692
- hash: string
1693
- id: number
1694
- name: string
1695
- }
1696
- Update: {
1697
- executed_at?: string | null
1698
- hash?: string
1699
- id?: number
1700
- name?: string
1701
- }
1702
- Relationships: []
1703
- }
1704
- objects: {
1705
- Row: {
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
- owner_id: string | null
1714
- path_tokens: string[] | null
1715
- updated_at: string | null
1716
- version: string | null
1717
- }
1718
- Insert: {
1719
- bucket_id?: string | null
1720
- created_at?: string | null
1721
- id?: string
1722
- last_accessed_at?: string | null
1723
- metadata?: Json | null
1724
- name?: string | null
1725
- owner?: string | null
1726
- owner_id?: string | null
1727
- path_tokens?: string[] | null
1728
- updated_at?: string | null
1729
- version?: string | null
1730
- }
1731
- Update: {
1732
- bucket_id?: string | null
1733
- created_at?: string | null
1734
- id?: string
1735
- last_accessed_at?: string | null
1736
- metadata?: Json | null
1737
- name?: string | null
1738
- owner?: string | null
1739
- owner_id?: string | null
1740
- path_tokens?: string[] | null
1741
- updated_at?: string | null
1742
- version?: string | null
1743
- }
1744
- Relationships: [
1745
- {
1746
- foreignKeyName: "objects_bucketId_fkey"
1747
- columns: ["bucket_id"]
1748
- isOneToOne: false
1749
- referencedRelation: "buckets"
1750
- referencedColumns: ["id"]
1751
- },
1752
- ]
1753
- }
1754
- }
1755
- Views: {
1756
- [_ in never]: never
1757
- }
1758
- Functions: {
1759
- can_insert_object: {
1760
- Args: {
1761
- bucketid: string
1762
- name: string
1763
- owner: string
1764
- metadata: Json
1765
- }
1766
- Returns: undefined
1767
- }
1768
- extension: {
1769
- Args: {
1770
- name: string
1771
- }
1772
- Returns: string
1773
- }
1774
- filename: {
1775
- Args: {
1776
- name: string
1777
- }
1778
- Returns: string
1779
- }
1780
- foldername: {
1781
- Args: {
1782
- name: string
1783
- }
1784
- Returns: string[]
1785
- }
1786
- get_size_by_bucket: {
1787
- Args: Record<PropertyKey, never>
1788
- Returns: {
1789
- size: number
1790
- bucket_id: string
1791
- }[]
1792
- }
1793
- search: {
1794
- Args: {
1795
- prefix: string
1796
- bucketname: string
1797
- limits?: number
1798
- levels?: number
1799
- offsets?: number
1800
- search?: string
1801
- sortcolumn?: string
1802
- sortorder?: string
1803
- }
1804
- Returns: {
1805
- name: string
1806
- id: string
1807
- updated_at: string
1808
- created_at: string
1809
- last_accessed_at: string
1810
- metadata: Json
1811
- }[]
1812
- }
1813
- }
1814
- Enums: {
1815
- [_ in never]: never
1816
- }
1817
- CompositeTypes: {
1818
- [_ in never]: never
1819
- }
1820
- }
1821
- }
1822
-
1823
- type PublicSchema = Database[Extract<keyof Database, "public">]
1824
-
1825
- export type Tables<
1826
- PublicTableNameOrOptions extends
1827
- | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
1828
- | { schema: keyof Database },
1829
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1830
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1831
- Database[PublicTableNameOrOptions["schema"]]["Views"])
1832
- : never = never,
1833
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1834
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1835
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1836
- Row: infer R
1837
- }
1838
- ? R
1839
- : never
1840
- : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
1841
- PublicSchema["Views"])
1842
- ? (PublicSchema["Tables"] &
1843
- PublicSchema["Views"])[PublicTableNameOrOptions] extends {
1844
- Row: infer R
1845
- }
1846
- ? R
1847
- : never
1848
- : never
1849
-
1850
- export type TablesInsert<
1851
- PublicTableNameOrOptions extends
1852
- | keyof PublicSchema["Tables"]
1853
- | { schema: keyof Database },
1854
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1855
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1856
- : never = never,
1857
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1858
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1859
- Insert: infer I
1860
- }
1861
- ? I
1862
- : never
1863
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1864
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1865
- Insert: infer I
1866
- }
1867
- ? I
1868
- : never
1869
- : never
1870
-
1871
- export type TablesUpdate<
1872
- PublicTableNameOrOptions extends
1873
- | keyof PublicSchema["Tables"]
1874
- | { schema: keyof Database },
1875
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1876
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1877
- : never = never,
1878
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1879
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1880
- Update: infer U
1881
- }
1882
- ? U
1883
- : never
1884
- : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
1885
- ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1886
- Update: infer U
1887
- }
1888
- ? U
1889
- : never
1890
- : never
1891
-
1892
- export type Enums<
1893
- PublicEnumNameOrOptions extends
1894
- | keyof PublicSchema["Enums"]
1895
- | { schema: keyof Database },
1896
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1897
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1898
- : never = never,
1899
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1900
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1901
- : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
1902
- ? PublicSchema["Enums"][PublicEnumNameOrOptions]
1903
- : never
1904
-
1
+ export type Json = { [key: string]: any } | any;
1905
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:
574
+ | Database['public']['Enums']['enum_chat_tickets_status']
575
+ | null;
576
+ subject: string;
577
+ ticket_id: string;
578
+ };
579
+ Insert: {
580
+ assigned_by?: string | null;
581
+ assignee?: string | null;
582
+ chat_id: string;
583
+ created_at?: string;
584
+ due_date?: string | null;
585
+ is_deleted?: boolean;
586
+ label_ids?: Json | null;
587
+ last_updated_at?: string;
588
+ org_id: string;
589
+ priority?: number | null;
590
+ quoted_message_id?: string | null;
591
+ raised_by?: string | null;
592
+ status?:
593
+ | Database['public']['Enums']['enum_chat_tickets_status']
594
+ | null;
595
+ subject: string;
596
+ ticket_id?: string;
597
+ };
598
+ Update: {
599
+ assigned_by?: string | null;
600
+ assignee?: string | null;
601
+ chat_id?: string;
602
+ created_at?: string;
603
+ due_date?: string | null;
604
+ is_deleted?: boolean;
605
+ label_ids?: Json | null;
606
+ last_updated_at?: string;
607
+ org_id?: string;
608
+ priority?: number | null;
609
+ quoted_message_id?: string | null;
610
+ raised_by?: string | null;
611
+ status?:
612
+ | Database['public']['Enums']['enum_chat_tickets_status']
613
+ | null;
614
+ subject?: string;
615
+ ticket_id?: string;
616
+ };
617
+ Relationships: [
618
+ {
619
+ foreignKeyName: 'tbl_chat_tickets_org_id_fkey';
620
+ columns: ['org_id'];
621
+ isOneToOne: false;
622
+ referencedRelation: 'tbl_org';
623
+ referencedColumns: ['org_id'];
624
+ },
625
+ {
626
+ foreignKeyName: 'tbl_chat_tickets_org_id_fkey';
627
+ columns: ['org_id'];
628
+ isOneToOne: false;
629
+ referencedRelation: 'view_org';
630
+ referencedColumns: ['org_id'];
631
+ },
632
+ ];
633
+ };
634
+ tbl_chats: {
635
+ Row: {
636
+ archived: boolean | null;
637
+ chat_id: string;
638
+ chat_image: string | null;
639
+ chat_name: string | null;
640
+ chat_type: string | null;
641
+ created_at: string;
642
+ group_metadata: Json | null;
643
+ id: Json | null;
644
+ invite_link: string | null;
645
+ is_group: boolean | null;
646
+ is_muted: boolean | null;
647
+ is_read_only: boolean | null;
648
+ latest_message: Json | null;
649
+ member_count: number | null;
650
+ mute_expiration: number | null;
651
+ name: string | null;
652
+ org_id: string;
653
+ org_phone: string;
654
+ pinned: boolean | null;
655
+ timestamp: string | null;
656
+ unread_count: number | null;
657
+ updated_at: string;
658
+ };
659
+ Insert: {
660
+ archived?: boolean | null;
661
+ chat_id: string;
662
+ chat_image?: string | null;
663
+ chat_name?: string | null;
664
+ chat_type?: string | null;
665
+ created_at?: string;
666
+ group_metadata?: Json | null;
667
+ id?: Json | null;
668
+ invite_link?: string | null;
669
+ is_group?: boolean | null;
670
+ is_muted?: boolean | null;
671
+ is_read_only?: boolean | null;
672
+ latest_message?: Json | null;
673
+ member_count?: number | null;
674
+ mute_expiration?: number | null;
675
+ name?: string | null;
676
+ org_id: string;
677
+ org_phone: string;
678
+ pinned?: boolean | null;
679
+ timestamp?: string | null;
680
+ unread_count?: number | null;
681
+ updated_at?: string;
682
+ };
683
+ Update: {
684
+ archived?: boolean | null;
685
+ chat_id?: string;
686
+ chat_image?: string | null;
687
+ chat_name?: string | null;
688
+ chat_type?: string | null;
689
+ created_at?: string;
690
+ group_metadata?: Json | null;
691
+ id?: Json | null;
692
+ invite_link?: string | null;
693
+ is_group?: boolean | null;
694
+ is_muted?: boolean | null;
695
+ is_read_only?: boolean | null;
696
+ latest_message?: Json | null;
697
+ member_count?: number | null;
698
+ mute_expiration?: number | null;
699
+ name?: string | null;
700
+ org_id?: string;
701
+ org_phone?: string;
702
+ pinned?: boolean | null;
703
+ timestamp?: string | null;
704
+ unread_count?: number | null;
705
+ updated_at?: string;
706
+ };
707
+ Relationships: [
708
+ {
709
+ foreignKeyName: 'tbl_chats_fkey_tbl_org_phones';
710
+ columns: ['org_phone', 'org_id'];
711
+ isOneToOne: false;
712
+ referencedRelation: 'tbl_org_phones';
713
+ referencedColumns: ['org_phone', 'org_id'];
714
+ },
715
+ ];
716
+ };
717
+ tbl_contacts: {
718
+ Row: {
719
+ business_profile: Json | null;
720
+ contact_color: Database['public']['Enums']['enum_chat_colors'] | null;
721
+ contact_id: string;
722
+ contact_image: string | null;
723
+ contact_name: string | null;
724
+ contact_type: string | null;
725
+ id: Json | null;
726
+ is_blocked: boolean | null;
727
+ is_business: boolean | null;
728
+ is_enterprise: boolean | null;
729
+ is_group: boolean | null;
730
+ is_internal: boolean | null;
731
+ is_me: boolean | null;
732
+ is_my_contact: boolean | null;
733
+ is_user: boolean | null;
734
+ is_wa_contact: boolean | null;
735
+ label_ids: Json;
736
+ name: string | null;
737
+ number: string | null;
738
+ org_id: string;
739
+ pushname: string | null;
740
+ short_name: string | null;
741
+ updated_at: string | null;
742
+ verified_level: number | null;
743
+ verified_name: string | null;
744
+ };
745
+ Insert: {
746
+ business_profile?: Json | null;
747
+ contact_color?:
748
+ | Database['public']['Enums']['enum_chat_colors']
749
+ | null;
750
+ contact_id: string;
751
+ contact_image?: string | null;
752
+ contact_name?: string | null;
753
+ contact_type?: string | null;
754
+ id?: Json | null;
755
+ is_blocked?: boolean | null;
756
+ is_business?: boolean | null;
757
+ is_enterprise?: boolean | null;
758
+ is_group?: boolean | null;
759
+ is_internal?: boolean | null;
760
+ is_me?: boolean | null;
761
+ is_my_contact?: boolean | null;
762
+ is_user?: boolean | null;
763
+ is_wa_contact?: boolean | null;
764
+ label_ids?: Json;
765
+ name?: string | null;
766
+ number?: string | null;
767
+ org_id: string;
768
+ pushname?: string | null;
769
+ short_name?: string | null;
770
+ updated_at?: string | null;
771
+ verified_level?: number | null;
772
+ verified_name?: string | null;
773
+ };
774
+ Update: {
775
+ business_profile?: Json | null;
776
+ contact_color?:
777
+ | Database['public']['Enums']['enum_chat_colors']
778
+ | null;
779
+ contact_id?: string;
780
+ contact_image?: string | null;
781
+ contact_name?: string | null;
782
+ contact_type?: string | null;
783
+ id?: Json | null;
784
+ is_blocked?: boolean | null;
785
+ is_business?: boolean | null;
786
+ is_enterprise?: boolean | null;
787
+ is_group?: boolean | null;
788
+ is_internal?: boolean | null;
789
+ is_me?: boolean | null;
790
+ is_my_contact?: boolean | null;
791
+ is_user?: boolean | null;
792
+ is_wa_contact?: boolean | null;
793
+ label_ids?: Json;
794
+ name?: string | null;
795
+ number?: string | null;
796
+ org_id?: string;
797
+ pushname?: string | null;
798
+ short_name?: string | null;
799
+ updated_at?: string | null;
800
+ verified_level?: number | null;
801
+ verified_name?: string | null;
802
+ };
803
+ Relationships: [
804
+ {
805
+ foreignKeyName: 'tbl_contacts_org_id_fkey';
806
+ columns: ['org_id'];
807
+ isOneToOne: false;
808
+ referencedRelation: 'tbl_org';
809
+ referencedColumns: ['org_id'];
810
+ },
811
+ {
812
+ foreignKeyName: 'tbl_contacts_org_id_fkey';
813
+ columns: ['org_id'];
814
+ isOneToOne: false;
815
+ referencedRelation: 'view_org';
816
+ referencedColumns: ['org_id'];
817
+ },
818
+ ];
819
+ };
820
+ tbl_custom_properties: {
821
+ Row: {
822
+ created_at: string;
823
+ created_by: string | null;
824
+ org_id: string | null;
825
+ property_id: string;
826
+ property_name: string;
827
+ property_value: string | null;
828
+ property_value_type: string | null;
829
+ type: string | null;
830
+ };
831
+ Insert: {
832
+ created_at?: string;
833
+ created_by?: string | null;
834
+ org_id?: string | null;
835
+ property_id?: string;
836
+ property_name: string;
837
+ property_value?: string | null;
838
+ property_value_type?: string | null;
839
+ type?: string | null;
840
+ };
841
+ Update: {
842
+ created_at?: string;
843
+ created_by?: string | null;
844
+ org_id?: string | null;
845
+ property_id?: string;
846
+ property_name?: string;
847
+ property_value?: string | null;
848
+ property_value_type?: string | null;
849
+ type?: string | null;
850
+ };
851
+ Relationships: [
852
+ {
853
+ foreignKeyName: 'tbl_custom_properties_org_id_fkey';
854
+ columns: ['org_id'];
855
+ isOneToOne: false;
856
+ referencedRelation: 'tbl_org';
857
+ referencedColumns: ['org_id'];
858
+ },
859
+ {
860
+ foreignKeyName: 'tbl_custom_properties_org_id_fkey';
861
+ columns: ['org_id'];
862
+ isOneToOne: false;
863
+ referencedRelation: 'view_org';
864
+ referencedColumns: ['org_id'];
865
+ },
866
+ ];
867
+ };
868
+ tbl_flagged_messages: {
869
+ Row: {
870
+ chat_id: string | null;
871
+ org_id: string;
872
+ response_id: string | null;
873
+ response_timestamp: string | null;
874
+ response_type: string | null;
875
+ unique_id: string;
876
+ };
877
+ Insert: {
878
+ chat_id?: string | null;
879
+ org_id: string;
880
+ response_id?: string | null;
881
+ response_timestamp?: string | null;
882
+ response_type?: string | null;
883
+ unique_id: string;
884
+ };
885
+ Update: {
886
+ chat_id?: string | null;
887
+ org_id?: string;
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
+ success: boolean;
973
+ type: Database['public']['Enums']['enum_integration_type'];
974
+ };
975
+ Insert: {
976
+ created_at?: string;
977
+ id?: string;
978
+ integration_name: Database['public']['Enums']['enum_integration_name'];
979
+ integration_type: string;
980
+ metadata?: Json;
981
+ org_id: string;
982
+ success?: boolean;
983
+ type: Database['public']['Enums']['enum_integration_type'];
984
+ };
985
+ Update: {
986
+ created_at?: string;
987
+ id?: string;
988
+ integration_name?: Database['public']['Enums']['enum_integration_name'];
989
+ integration_type?: string;
990
+ metadata?: Json;
991
+ org_id?: string;
992
+ success?: boolean;
993
+ type?: Database['public']['Enums']['enum_integration_type'];
994
+ };
995
+ Relationships: [
996
+ {
997
+ foreignKeyName: 'tbl_integration_logs_org_id_fkey';
998
+ columns: ['org_id'];
999
+ isOneToOne: false;
1000
+ referencedRelation: 'tbl_org';
1001
+ referencedColumns: ['org_id'];
1002
+ },
1003
+ {
1004
+ foreignKeyName: 'tbl_integration_logs_org_id_fkey';
1005
+ columns: ['org_id'];
1006
+ isOneToOne: false;
1007
+ referencedRelation: 'view_org';
1008
+ referencedColumns: ['org_id'];
1009
+ },
1010
+ ];
1011
+ };
1012
+ tbl_integration_tokens: {
1013
+ Row: {
1014
+ exp: string;
1015
+ iat: string;
1016
+ id: string;
1017
+ is_revealed: boolean;
1018
+ name: string;
1019
+ org_id: string;
1020
+ role: string;
1021
+ token: string;
1022
+ type: Database['public']['Enums']['enum_integration_type'];
1023
+ };
1024
+ Insert: {
1025
+ exp: string;
1026
+ iat: string;
1027
+ id?: string;
1028
+ is_revealed?: boolean;
1029
+ name: string;
1030
+ org_id: string;
1031
+ role: string;
1032
+ token: string;
1033
+ type: Database['public']['Enums']['enum_integration_type'];
1034
+ };
1035
+ Update: {
1036
+ exp?: string;
1037
+ iat?: string;
1038
+ id?: string;
1039
+ is_revealed?: boolean;
1040
+ name?: string;
1041
+ org_id?: string;
1042
+ role?: string;
1043
+ token?: string;
1044
+ type?: Database['public']['Enums']['enum_integration_type'];
1045
+ };
1046
+ Relationships: [
1047
+ {
1048
+ foreignKeyName: 'public_tbl_integration_tokens_org_id_fkey';
1049
+ columns: ['org_id'];
1050
+ isOneToOne: false;
1051
+ referencedRelation: 'tbl_org';
1052
+ referencedColumns: ['org_id'];
1053
+ },
1054
+ {
1055
+ foreignKeyName: 'public_tbl_integration_tokens_org_id_fkey';
1056
+ columns: ['org_id'];
1057
+ isOneToOne: false;
1058
+ referencedRelation: 'view_org';
1059
+ referencedColumns: ['org_id'];
1060
+ },
1061
+ ];
1062
+ };
1063
+ tbl_org: {
1064
+ Row: {
1065
+ created_at: string;
1066
+ org_id: string;
1067
+ org_image: string | null;
1068
+ org_metadata: Json | null;
1069
+ org_name: string | null;
1070
+ org_plan: Json | null;
1071
+ stripe_customer_details: Json | null;
1072
+ stripe_customer_id: string | null;
1073
+ stripe_subscription_details: Json | null;
1074
+ support_link: string | null;
1075
+ };
1076
+ Insert: {
1077
+ created_at?: string;
1078
+ org_id?: string;
1079
+ org_image?: string | null;
1080
+ org_metadata?: Json | null;
1081
+ org_name?: string | null;
1082
+ org_plan?: Json | null;
1083
+ stripe_customer_details?: Json | null;
1084
+ stripe_customer_id?: string | null;
1085
+ stripe_subscription_details?: Json | null;
1086
+ support_link?: string | null;
1087
+ };
1088
+ Update: {
1089
+ created_at?: string;
1090
+ org_id?: string;
1091
+ org_image?: string | null;
1092
+ org_metadata?: Json | null;
1093
+ org_name?: string | null;
1094
+ org_plan?: Json | null;
1095
+ stripe_customer_details?: Json | null;
1096
+ stripe_customer_id?: string | null;
1097
+ stripe_subscription_details?: Json | null;
1098
+ support_link?: string | null;
1099
+ };
1100
+ Relationships: [];
1101
+ };
1102
+ tbl_org_labels: {
1103
+ Row: {
1104
+ color: string;
1105
+ created_at: string;
1106
+ label_id: string;
1107
+ name: string;
1108
+ org_id: string;
1109
+ type: string;
1110
+ };
1111
+ Insert: {
1112
+ color?: string;
1113
+ created_at?: string;
1114
+ label_id?: string;
1115
+ name: string;
1116
+ org_id: string;
1117
+ type?: string;
1118
+ };
1119
+ Update: {
1120
+ color?: string;
1121
+ created_at?: string;
1122
+ label_id?: string;
1123
+ name?: string;
1124
+ org_id?: string;
1125
+ type?: string;
1126
+ };
1127
+ Relationships: [
1128
+ {
1129
+ foreignKeyName: 'tbl_org_labels_org_id_fkey';
1130
+ columns: ['org_id'];
1131
+ isOneToOne: false;
1132
+ referencedRelation: 'tbl_org';
1133
+ referencedColumns: ['org_id'];
1134
+ },
1135
+ {
1136
+ foreignKeyName: 'tbl_org_labels_org_id_fkey';
1137
+ columns: ['org_id'];
1138
+ isOneToOne: false;
1139
+ referencedRelation: 'view_org';
1140
+ referencedColumns: ['org_id'];
1141
+ },
1142
+ ];
1143
+ };
1144
+ tbl_org_members: {
1145
+ Row: {
1146
+ created_at: string | null;
1147
+ email: string;
1148
+ invited_at: string | null;
1149
+ invited_by: string | null;
1150
+ is_active: boolean;
1151
+ is_owner: boolean | null;
1152
+ label_ids: string[] | null;
1153
+ member_color: Database['public']['Enums']['enum_chat_colors'];
1154
+ member_image: string | null;
1155
+ member_name: string | null;
1156
+ org_id: string;
1157
+ org_phones: string[] | null;
1158
+ preferences: Json;
1159
+ role: Database['public']['Enums']['enum_member_role'];
1160
+ user_id: string | null;
1161
+ };
1162
+ Insert: {
1163
+ created_at?: string | null;
1164
+ email: string;
1165
+ invited_at?: string | null;
1166
+ invited_by?: string | null;
1167
+ is_active?: boolean;
1168
+ is_owner?: boolean | null;
1169
+ label_ids?: string[] | null;
1170
+ member_color?: Database['public']['Enums']['enum_chat_colors'];
1171
+ member_image?: string | null;
1172
+ member_name?: string | null;
1173
+ org_id: string;
1174
+ org_phones?: string[] | null;
1175
+ preferences?: Json;
1176
+ role?: Database['public']['Enums']['enum_member_role'];
1177
+ user_id?: string | null;
1178
+ };
1179
+ Update: {
1180
+ created_at?: string | null;
1181
+ email?: string;
1182
+ invited_at?: string | null;
1183
+ invited_by?: string | null;
1184
+ is_active?: boolean;
1185
+ is_owner?: boolean | null;
1186
+ label_ids?: string[] | null;
1187
+ member_color?: Database['public']['Enums']['enum_chat_colors'];
1188
+ member_image?: string | null;
1189
+ member_name?: string | null;
1190
+ org_id?: string;
1191
+ org_phones?: string[] | null;
1192
+ preferences?: Json;
1193
+ role?: Database['public']['Enums']['enum_member_role'];
1194
+ user_id?: string | null;
1195
+ };
1196
+ Relationships: [
1197
+ {
1198
+ foreignKeyName: 'tbl_org_members_fkey_auth_users';
1199
+ columns: ['user_id'];
1200
+ isOneToOne: false;
1201
+ referencedRelation: 'users';
1202
+ referencedColumns: ['id'];
1203
+ },
1204
+ {
1205
+ foreignKeyName: 'tbl_org_members_fkey_tbl_org';
1206
+ columns: ['org_id'];
1207
+ isOneToOne: false;
1208
+ referencedRelation: 'tbl_org';
1209
+ referencedColumns: ['org_id'];
1210
+ },
1211
+ {
1212
+ foreignKeyName: 'tbl_org_members_fkey_tbl_org';
1213
+ columns: ['org_id'];
1214
+ isOneToOne: false;
1215
+ referencedRelation: 'view_org';
1216
+ referencedColumns: ['org_id'];
1217
+ },
1218
+ ];
1219
+ };
1220
+ tbl_org_phones: {
1221
+ Row: {
1222
+ created_at: string;
1223
+ first_connected_at: string | null;
1224
+ is_ready: boolean | null;
1225
+ legacy_version: boolean | null;
1226
+ org_id: string;
1227
+ org_phone: string | null;
1228
+ phone_id: string;
1229
+ phone_image: string | null;
1230
+ phone_name: string | null;
1231
+ phone_state: Json | null;
1232
+ qr_code: string | null;
1233
+ server_ip: string | null;
1234
+ updated_at: string | null;
1235
+ wa_state: string | null;
1236
+ wa_version: string | null;
1237
+ };
1238
+ Insert: {
1239
+ created_at?: string;
1240
+ first_connected_at?: string | null;
1241
+ is_ready?: boolean | null;
1242
+ legacy_version?: boolean | null;
1243
+ org_id: string;
1244
+ org_phone?: string | null;
1245
+ phone_id?: string;
1246
+ phone_image?: string | null;
1247
+ phone_name?: string | null;
1248
+ phone_state?: Json | null;
1249
+ qr_code?: string | null;
1250
+ server_ip?: string | null;
1251
+ updated_at?: string | null;
1252
+ wa_state?: string | null;
1253
+ wa_version?: string | null;
1254
+ };
1255
+ Update: {
1256
+ created_at?: string;
1257
+ first_connected_at?: string | null;
1258
+ is_ready?: boolean | null;
1259
+ legacy_version?: boolean | null;
1260
+ org_id?: string;
1261
+ org_phone?: string | null;
1262
+ phone_id?: string;
1263
+ phone_image?: string | null;
1264
+ phone_name?: string | null;
1265
+ phone_state?: Json | null;
1266
+ qr_code?: string | null;
1267
+ server_ip?: string | null;
1268
+ updated_at?: string | null;
1269
+ wa_state?: string | null;
1270
+ wa_version?: string | null;
1271
+ };
1272
+ Relationships: [
1273
+ {
1274
+ foreignKeyName: 'tbl_org_phones_fkey_tbl_org';
1275
+ columns: ['org_id'];
1276
+ isOneToOne: false;
1277
+ referencedRelation: 'tbl_org';
1278
+ referencedColumns: ['org_id'];
1279
+ },
1280
+ {
1281
+ foreignKeyName: 'tbl_org_phones_fkey_tbl_org';
1282
+ columns: ['org_id'];
1283
+ isOneToOne: false;
1284
+ referencedRelation: 'view_org';
1285
+ referencedColumns: ['org_id'];
1286
+ },
1287
+ {
1288
+ foreignKeyName: 'tbl_org_phones_org_id_fkey';
1289
+ columns: ['org_id'];
1290
+ isOneToOne: false;
1291
+ referencedRelation: 'tbl_org';
1292
+ referencedColumns: ['org_id'];
1293
+ },
1294
+ {
1295
+ foreignKeyName: 'tbl_org_phones_org_id_fkey';
1296
+ columns: ['org_id'];
1297
+ isOneToOne: false;
1298
+ referencedRelation: 'view_org';
1299
+ referencedColumns: ['org_id'];
1300
+ },
1301
+ ];
1302
+ };
1303
+ tbl_quick_replies: {
1304
+ Row: {
1305
+ command: string | null;
1306
+ created_at: string;
1307
+ message_payload: Json | null;
1308
+ org_id: string | null;
1309
+ reply_id: string;
1310
+ };
1311
+ Insert: {
1312
+ command?: string | null;
1313
+ created_at?: string;
1314
+ message_payload?: Json | null;
1315
+ org_id?: string | null;
1316
+ reply_id?: string;
1317
+ };
1318
+ Update: {
1319
+ command?: string | null;
1320
+ created_at?: string;
1321
+ message_payload?: Json | null;
1322
+ org_id?: string | null;
1323
+ reply_id?: string;
1324
+ };
1325
+ Relationships: [
1326
+ {
1327
+ foreignKeyName: 'tbl_quick_replies_org_id_fkey';
1328
+ columns: ['org_id'];
1329
+ isOneToOne: false;
1330
+ referencedRelation: 'tbl_org';
1331
+ referencedColumns: ['org_id'];
1332
+ },
1333
+ {
1334
+ foreignKeyName: 'tbl_quick_replies_org_id_fkey';
1335
+ columns: ['org_id'];
1336
+ isOneToOne: false;
1337
+ referencedRelation: 'view_org';
1338
+ referencedColumns: ['org_id'];
1339
+ },
1340
+ ];
1341
+ };
1342
+ tbl_tools_whatsapp_links: {
1343
+ Row: {
1344
+ created_at: string;
1345
+ link_id: string;
1346
+ link_name: string;
1347
+ message: string | null;
1348
+ phone: string;
1349
+ };
1350
+ Insert: {
1351
+ created_at?: string;
1352
+ link_id?: string;
1353
+ link_name: string;
1354
+ message?: string | null;
1355
+ phone: string;
1356
+ };
1357
+ Update: {
1358
+ created_at?: string;
1359
+ link_id?: string;
1360
+ link_name?: string;
1361
+ message?: string | null;
1362
+ phone?: string;
1363
+ };
1364
+ Relationships: [];
1365
+ };
1366
+ };
1367
+ Views: {
1368
+ view_broadcast_logs: {
1369
+ Row: {
1370
+ broadcast_id: string | null;
1371
+ created_at: string | null;
1372
+ delivery_percentage: number | null;
1373
+ failed_chats: number | null;
1374
+ message_payload: Json | null;
1375
+ org_id: string | null;
1376
+ pending_chats: number | null;
1377
+ performed_at: string | null;
1378
+ performed_by: string | null;
1379
+ read_percentage: number | null;
1380
+ scheduled_at: string | null;
1381
+ sent_chats: number | null;
1382
+ total_chats: number | null;
1383
+ total_delivered_count: number | null;
1384
+ total_member_count: number | null;
1385
+ total_read_count: number | null;
1386
+ };
1387
+ Relationships: [
1388
+ {
1389
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
1390
+ columns: ['org_id'];
1391
+ isOneToOne: false;
1392
+ referencedRelation: 'tbl_org';
1393
+ referencedColumns: ['org_id'];
1394
+ },
1395
+ {
1396
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
1397
+ columns: ['org_id'];
1398
+ isOneToOne: false;
1399
+ referencedRelation: 'view_org';
1400
+ referencedColumns: ['org_id'];
1401
+ },
1402
+ ];
1403
+ };
1404
+ view_chats: {
1405
+ Row: {
1406
+ active_phone: string | null;
1407
+ chat_access: Json | null;
1408
+ chat_id: string | null;
1409
+ chat_image: string | null;
1410
+ chat_name: string | null;
1411
+ chat_type: string | null;
1412
+ created_at: string | null;
1413
+ custom_properties: Json | null;
1414
+ group_description: string | null;
1415
+ invite_link: string | null;
1416
+ is_archived: boolean | null;
1417
+ is_muted: boolean | null;
1418
+ label_ids: Json | null;
1419
+ last_read_timestamp: string | null;
1420
+ latest_message: Json | null;
1421
+ member_count: number | null;
1422
+ message_unread_count: number | null;
1423
+ org_id: string | null;
1424
+ org_phone: string | null;
1425
+ updated_at: string | null;
1426
+ };
1427
+ Relationships: [];
1428
+ };
1429
+ view_org: {
1430
+ Row: {
1431
+ created_at: string | null;
1432
+ is_enterprise: boolean | null;
1433
+ is_free_trial: boolean | null;
1434
+ org_id: string | null;
1435
+ org_image: string | null;
1436
+ org_metadata: Json | null;
1437
+ org_name: string | null;
1438
+ org_plan: Json | null;
1439
+ pending_days: number | null;
1440
+ phone_limit: string | null;
1441
+ plan_id: string | null;
1442
+ stripe_customer_details: Json | null;
1443
+ stripe_customer_id: string | null;
1444
+ stripe_subscription_details: Json | null;
1445
+ subscription_status: string | null;
1446
+ support_link: string | null;
1447
+ user_limit: string | null;
1448
+ };
1449
+ Insert: {
1450
+ created_at?: string | null;
1451
+ is_enterprise?: never;
1452
+ is_free_trial?: never;
1453
+ org_id?: string | null;
1454
+ org_image?: string | null;
1455
+ org_metadata?: Json | null;
1456
+ org_name?: string | null;
1457
+ org_plan?: Json | null;
1458
+ pending_days?: never;
1459
+ phone_limit?: never;
1460
+ plan_id?: never;
1461
+ stripe_customer_details?: Json | null;
1462
+ stripe_customer_id?: string | null;
1463
+ stripe_subscription_details?: Json | null;
1464
+ subscription_status?: never;
1465
+ support_link?: string | null;
1466
+ user_limit?: never;
1467
+ };
1468
+ Update: {
1469
+ created_at?: string | null;
1470
+ is_enterprise?: never;
1471
+ is_free_trial?: never;
1472
+ org_id?: string | null;
1473
+ org_image?: string | null;
1474
+ org_metadata?: Json | null;
1475
+ org_name?: string | null;
1476
+ org_plan?: Json | null;
1477
+ pending_days?: never;
1478
+ phone_limit?: never;
1479
+ plan_id?: never;
1480
+ stripe_customer_details?: Json | null;
1481
+ stripe_customer_id?: string | null;
1482
+ stripe_subscription_details?: Json | null;
1483
+ subscription_status?: never;
1484
+ support_link?: string | null;
1485
+ user_limit?: never;
1486
+ };
1487
+ Relationships: [];
1488
+ };
1489
+ };
1490
+ Functions: {
1491
+ gen_id: {
1492
+ Args: {
1493
+ prefix: string;
1494
+ size?: number;
1495
+ alphabet?: string;
1496
+ };
1497
+ Returns: string;
1498
+ };
1499
+ gen_ticket_id: {
1500
+ Args: {
1501
+ org_id_input: string;
1502
+ };
1503
+ Returns: string;
1504
+ };
1505
+ generate_access_token: {
1506
+ Args: {
1507
+ name_input?: string;
1508
+ type_input?: string;
1509
+ org_id_input?: string;
1510
+ };
1511
+ Returns: Json;
1512
+ };
1513
+ get_api_auth_details: {
1514
+ Args: {
1515
+ org_id_input?: string;
1516
+ org_phone_input?: string;
1517
+ token_id_input?: string;
1518
+ token_type_input?: string;
1519
+ };
1520
+ Returns: Json;
1521
+ };
1522
+ get_chat_labels_data: {
1523
+ Args: {
1524
+ org_id_input: string;
1525
+ chat_ids_input?: string[];
1526
+ };
1527
+ Returns: Json[];
1528
+ };
1529
+ get_chats: {
1530
+ Args: {
1531
+ org_id_input?: string;
1532
+ chat_id_input?: string[];
1533
+ };
1534
+ Returns: Json;
1535
+ };
1536
+ get_contacts: {
1537
+ Args: {
1538
+ org_id_input: string;
1539
+ contact_ids_input?: string[];
1540
+ last_updated_at_input?: string;
1541
+ };
1542
+ Returns: Json;
1543
+ };
1544
+ get_dashboard_statistics: {
1545
+ Args: {
1546
+ org_id_input: string;
1547
+ type_input?: string;
1548
+ interval_input?: unknown;
1549
+ };
1550
+ Returns: Json;
1551
+ };
1552
+ get_export_chats_data: {
1553
+ Args: {
1554
+ org_id_input: string;
1555
+ chat_ids?: string[];
1556
+ };
1557
+ Returns: Json;
1558
+ };
1559
+ get_messages_notifications_reactions: {
1560
+ Args: {
1561
+ org_id_input: string;
1562
+ chat_id_input?: string[];
1563
+ message_limit_input?: number;
1564
+ reaction_notification_limit_input?: number;
1565
+ last_updated_at_input?: string;
1566
+ };
1567
+ Returns: Json;
1568
+ };
1569
+ get_org: {
1570
+ Args: {
1571
+ org_id_input?: string;
1572
+ };
1573
+ Returns: Json;
1574
+ };
1575
+ get_org_phones: {
1576
+ Args: {
1577
+ org_id_input?: string;
1578
+ phone_id_input?: string;
1579
+ };
1580
+ Returns: Json;
1581
+ };
1582
+ get_ticket_info: {
1583
+ Args: {
1584
+ ticket_id_input?: string;
1585
+ org_id_input?: string;
1586
+ chat_id_input?: string;
1587
+ unique_message_id_input?: string;
1588
+ };
1589
+ Returns: Json;
1590
+ };
1591
+ list_org_from_user: {
1592
+ Args: Record<PropertyKey, never>;
1593
+ Returns: string[];
1594
+ };
1595
+ list_role_from_user: {
1596
+ Args: Record<PropertyKey, never>;
1597
+ Returns: Database['public']['Enums']['enum_member_role'];
1598
+ };
1599
+ update_labels: {
1600
+ Args: {
1601
+ org_id_input: string;
1602
+ tbl_type: string;
1603
+ label_ids_input: Json;
1604
+ row_id_input: string[];
1605
+ replace_labels?: boolean;
1606
+ };
1607
+ Returns: undefined;
1608
+ };
1609
+ };
1610
+ Enums: {
1611
+ enum_chat_colors:
1612
+ | '#B4876E'
1613
+ | '#A5B337'
1614
+ | '#06CF9C'
1615
+ | '#25D366'
1616
+ | '#02A698'
1617
+ | '#7D9EF1'
1618
+ | '#007BFC'
1619
+ | '#5E47DE'
1620
+ | '#7F66FF'
1621
+ | '#9333EA'
1622
+ | '#FA6533'
1623
+ | '#C4532D'
1624
+ | '#DC2626'
1625
+ | '#FF2E74'
1626
+ | '#DB2777';
1627
+ enum_chat_tickets_status: 'open' | 'inprogress' | 'closed' | 'archived';
1628
+ enum_integration_name:
1629
+ | 'org.created'
1630
+ | 'org.updated'
1631
+ | 'org.member.created'
1632
+ | 'org.member.updated'
1633
+ | 'org.phone.created'
1634
+ | 'org.phone.connected'
1635
+ | 'org.phone.disconnected'
1636
+ | 'org.subscription.trial_will_end'
1637
+ | 'chat.created'
1638
+ | 'chat.updated'
1639
+ | 'message.created'
1640
+ | 'message.updated'
1641
+ | 'message.deleted'
1642
+ | 'message.ack.updated'
1643
+ | 'reaction.created'
1644
+ | 'reaction.updated'
1645
+ | 'reaction.deleted'
1646
+ | 'ticket.created'
1647
+ | 'ticket.updated'
1648
+ | 'ticket.deleted';
1649
+ enum_integration_type:
1650
+ | 'zapier'
1651
+ | 'pabbly'
1652
+ | 'api'
1653
+ | 'webhook'
1654
+ | 'hubspot'
1655
+ | 'freshdesk'
1656
+ | 'slack'
1657
+ | 'jira'
1658
+ | 'salesforce';
1659
+ enum_member_role: 'admin' | 'member';
1660
+ };
1661
+ CompositeTypes: {
1662
+ [_ in never]: never;
1663
+ };
1664
+ };
1665
+ storage: {
1666
+ Tables: {
1667
+ buckets: {
1668
+ Row: {
1669
+ allowed_mime_types: string[] | null;
1670
+ avif_autodetection: boolean | null;
1671
+ created_at: string | null;
1672
+ file_size_limit: number | null;
1673
+ id: string;
1674
+ name: string;
1675
+ owner: string | null;
1676
+ owner_id: string | null;
1677
+ public: boolean | null;
1678
+ updated_at: string | null;
1679
+ };
1680
+ Insert: {
1681
+ allowed_mime_types?: string[] | null;
1682
+ avif_autodetection?: boolean | null;
1683
+ created_at?: string | null;
1684
+ file_size_limit?: number | null;
1685
+ id: string;
1686
+ name: string;
1687
+ owner?: string | null;
1688
+ owner_id?: string | null;
1689
+ public?: boolean | null;
1690
+ updated_at?: string | null;
1691
+ };
1692
+ Update: {
1693
+ allowed_mime_types?: string[] | null;
1694
+ avif_autodetection?: boolean | null;
1695
+ created_at?: string | null;
1696
+ file_size_limit?: number | null;
1697
+ id?: string;
1698
+ name?: string;
1699
+ owner?: string | null;
1700
+ owner_id?: string | null;
1701
+ public?: boolean | null;
1702
+ updated_at?: string | null;
1703
+ };
1704
+ Relationships: [];
1705
+ };
1706
+ migrations: {
1707
+ Row: {
1708
+ executed_at: string | null;
1709
+ hash: string;
1710
+ id: number;
1711
+ name: string;
1712
+ };
1713
+ Insert: {
1714
+ executed_at?: string | null;
1715
+ hash: string;
1716
+ id: number;
1717
+ name: string;
1718
+ };
1719
+ Update: {
1720
+ executed_at?: string | null;
1721
+ hash?: string;
1722
+ id?: number;
1723
+ name?: string;
1724
+ };
1725
+ Relationships: [];
1726
+ };
1727
+ objects: {
1728
+ Row: {
1729
+ bucket_id: string | null;
1730
+ created_at: string | null;
1731
+ id: string;
1732
+ last_accessed_at: string | null;
1733
+ metadata: Json | null;
1734
+ name: string | null;
1735
+ owner: string | null;
1736
+ owner_id: string | null;
1737
+ path_tokens: string[] | null;
1738
+ updated_at: string | null;
1739
+ version: string | null;
1740
+ };
1741
+ Insert: {
1742
+ bucket_id?: string | null;
1743
+ created_at?: string | null;
1744
+ id?: string;
1745
+ last_accessed_at?: string | null;
1746
+ metadata?: Json | null;
1747
+ name?: string | null;
1748
+ owner?: string | null;
1749
+ owner_id?: string | null;
1750
+ path_tokens?: string[] | null;
1751
+ updated_at?: string | null;
1752
+ version?: string | null;
1753
+ };
1754
+ Update: {
1755
+ bucket_id?: string | null;
1756
+ created_at?: string | null;
1757
+ id?: string;
1758
+ last_accessed_at?: string | null;
1759
+ metadata?: Json | null;
1760
+ name?: string | null;
1761
+ owner?: string | null;
1762
+ owner_id?: string | null;
1763
+ path_tokens?: string[] | null;
1764
+ updated_at?: string | null;
1765
+ version?: string | null;
1766
+ };
1767
+ Relationships: [
1768
+ {
1769
+ foreignKeyName: 'objects_bucketId_fkey';
1770
+ columns: ['bucket_id'];
1771
+ isOneToOne: false;
1772
+ referencedRelation: 'buckets';
1773
+ referencedColumns: ['id'];
1774
+ },
1775
+ ];
1776
+ };
1777
+ };
1778
+ Views: {
1779
+ [_ in never]: never;
1780
+ };
1781
+ Functions: {
1782
+ can_insert_object: {
1783
+ Args: {
1784
+ bucketid: string;
1785
+ name: string;
1786
+ owner: string;
1787
+ metadata: Json;
1788
+ };
1789
+ Returns: undefined;
1790
+ };
1791
+ extension: {
1792
+ Args: {
1793
+ name: string;
1794
+ };
1795
+ Returns: string;
1796
+ };
1797
+ filename: {
1798
+ Args: {
1799
+ name: string;
1800
+ };
1801
+ Returns: string;
1802
+ };
1803
+ foldername: {
1804
+ Args: {
1805
+ name: string;
1806
+ };
1807
+ Returns: string[];
1808
+ };
1809
+ get_size_by_bucket: {
1810
+ Args: Record<PropertyKey, never>;
1811
+ Returns: {
1812
+ size: number;
1813
+ bucket_id: string;
1814
+ }[];
1815
+ };
1816
+ search: {
1817
+ Args: {
1818
+ prefix: string;
1819
+ bucketname: string;
1820
+ limits?: number;
1821
+ levels?: number;
1822
+ offsets?: number;
1823
+ search?: string;
1824
+ sortcolumn?: string;
1825
+ sortorder?: string;
1826
+ };
1827
+ Returns: {
1828
+ name: string;
1829
+ id: string;
1830
+ updated_at: string;
1831
+ created_at: string;
1832
+ last_accessed_at: string;
1833
+ metadata: Json;
1834
+ }[];
1835
+ };
1836
+ };
1837
+ Enums: {
1838
+ [_ in never]: never;
1839
+ };
1840
+ CompositeTypes: {
1841
+ [_ in never]: never;
1842
+ };
1843
+ };
1844
+ };
1845
+
1846
+ type PublicSchema = Database[Extract<keyof Database, 'public'>];
1847
+
1848
+ export type Tables<
1849
+ PublicTableNameOrOptions extends
1850
+ | keyof (PublicSchema['Tables'] & PublicSchema['Views'])
1851
+ | { schema: keyof Database },
1852
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1853
+ ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] &
1854
+ Database[PublicTableNameOrOptions['schema']]['Views'])
1855
+ : never = never,
1856
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1857
+ ? (Database[PublicTableNameOrOptions['schema']]['Tables'] &
1858
+ Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends {
1859
+ Row: infer R;
1860
+ }
1861
+ ? R
1862
+ : never
1863
+ : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] &
1864
+ PublicSchema['Views'])
1865
+ ? (PublicSchema['Tables'] &
1866
+ PublicSchema['Views'])[PublicTableNameOrOptions] extends {
1867
+ Row: infer R;
1868
+ }
1869
+ ? R
1870
+ : never
1871
+ : never;
1872
+
1873
+ export type TablesInsert<
1874
+ PublicTableNameOrOptions extends
1875
+ | keyof PublicSchema['Tables']
1876
+ | { schema: keyof Database },
1877
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1878
+ ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
1879
+ : never = never,
1880
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1881
+ ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
1882
+ Insert: infer I;
1883
+ }
1884
+ ? I
1885
+ : never
1886
+ : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
1887
+ ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
1888
+ Insert: infer I;
1889
+ }
1890
+ ? I
1891
+ : never
1892
+ : never;
1893
+
1894
+ export type TablesUpdate<
1895
+ PublicTableNameOrOptions extends
1896
+ | keyof PublicSchema['Tables']
1897
+ | { schema: keyof Database },
1898
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1899
+ ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
1900
+ : never = never,
1901
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1902
+ ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
1903
+ Update: infer U;
1904
+ }
1905
+ ? U
1906
+ : never
1907
+ : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
1908
+ ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
1909
+ Update: infer U;
1910
+ }
1911
+ ? U
1912
+ : never
1913
+ : never;
1914
+
1915
+ export type Enums<
1916
+ PublicEnumNameOrOptions extends
1917
+ | keyof PublicSchema['Enums']
1918
+ | { schema: keyof Database },
1919
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1920
+ ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
1921
+ : never = never,
1922
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
1923
+ ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName]
1924
+ : PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
1925
+ ? PublicSchema['Enums'][PublicEnumNameOrOptions]
1926
+ : never;