@periskope/types 0.6.84 → 0.6.85

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