@periskope/types 0.6.12 → 0.6.13-7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/supabase.types.ts CHANGED
@@ -1,1119 +1,2492 @@
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_scheduled_messages: {
32
- Row: {
33
- added_by: string | null
34
- chat_ids: Json | null
35
- created_at: string
36
- message_payload: Json | null
37
- org_id: string | null
38
- scheduled_at: string | null
39
- scheduled_message_id: string
40
- status: string | null
41
- template_id: string | null
42
- }
43
- Insert: {
44
- added_by?: string | null
45
- chat_ids?: Json | null
46
- created_at?: string
47
- message_payload?: Json | null
48
- org_id?: string | null
49
- scheduled_at?: string | null
50
- scheduled_message_id?: string
51
- status?: string | null
52
- template_id?: string | null
53
- }
54
- Update: {
55
- added_by?: string | null
56
- chat_ids?: Json | null
57
- created_at?: string
58
- message_payload?: Json | null
59
- org_id?: string | null
60
- scheduled_at?: string | null
61
- scheduled_message_id?: string
62
- status?: string | null
63
- template_id?: string | null
64
- }
65
- Relationships: [
66
- {
67
- foreignKeyName: "tbl_broadcast_scheduled_messages_org_id_fkey"
68
- columns: ["org_id"]
69
- isOneToOne: false
70
- referencedRelation: "tbl_org"
71
- referencedColumns: ["org_id"]
72
- },
73
- {
74
- foreignKeyName: "tbl_broadcast_scheduled_messages_template_id_fkey"
75
- columns: ["template_id"]
76
- isOneToOne: false
77
- referencedRelation: "tbl_broadcast_templates"
78
- referencedColumns: ["template_id"]
79
- }
80
- ]
81
- }
82
- tbl_broadcast_templates: {
83
- Row: {
84
- body: string | null
85
- created_at: string
86
- filename: string | null
87
- mimetype: string | null
88
- org_id: string
89
- template_id: string
90
- template_name: string | null
91
- updated_at: string | null
92
- url: string | null
93
- }
94
- Insert: {
95
- body?: string | null
96
- created_at?: string
97
- filename?: string | null
98
- mimetype?: string | null
99
- org_id?: string
100
- template_id?: string
101
- template_name?: string | null
102
- updated_at?: string | null
103
- url?: string | null
104
- }
105
- Update: {
106
- body?: string | null
107
- created_at?: string
108
- filename?: string | null
109
- mimetype?: string | null
110
- org_id?: string
111
- template_id?: string
112
- template_name?: string | null
113
- updated_at?: string | null
114
- url?: string | null
115
- }
116
- Relationships: [
117
- {
118
- foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
119
- columns: ["org_id"]
120
- isOneToOne: false
121
- referencedRelation: "tbl_org"
122
- referencedColumns: ["org_id"]
123
- }
124
- ]
125
- }
126
- tbl_chat_access: {
127
- Row: {
128
- chat_id: string
129
- email: string
130
- has_access: boolean | null
131
- last_read_timestamp: string | null
132
- org_id: string
133
- }
134
- Insert: {
135
- chat_id: string
136
- email: string
137
- has_access?: boolean | null
138
- last_read_timestamp?: string | null
139
- org_id?: string
140
- }
141
- Update: {
142
- chat_id?: string
143
- email?: string
144
- has_access?: boolean | null
145
- last_read_timestamp?: string | null
146
- org_id?: string
147
- }
148
- Relationships: [
149
- {
150
- foreignKeyName: "tbl_chat_access_org_id_fkey"
151
- columns: ["org_id"]
152
- isOneToOne: false
153
- referencedRelation: "tbl_org"
154
- referencedColumns: ["org_id"]
155
- }
156
- ]
157
- }
158
- tbl_chat_messages: {
159
- Row: {
160
- ack: string | null
161
- author: string | null
162
- body: string | null
163
- broadcast: boolean | null
164
- chat_id: string | null
165
- device_type: string | null
166
- duration: string | null
167
- forwarding_score: number | null
168
- from: string | null
169
- from_me: boolean | null
170
- has_media: boolean | null
171
- has_quoted_msg: boolean | null
172
- has_reaction: boolean | null
173
- id: Json | null
174
- invite_v4: Json | null
175
- is_deleted: boolean | null
176
- is_ephemeral: boolean | null
177
- is_forwarded: boolean | null
178
- is_gif: boolean | null
179
- is_starred: boolean | null
180
- is_status: boolean | null
181
- links: Json | null
182
- location: Json | null
183
- media: Json | null
184
- media_key: string | null
185
- mentioned_ids: string[] | null
186
- message_id: string
187
- message_type: string | null
188
- order_id: string | null
189
- org_id: string
190
- org_phone: string
191
- performed_by: string | null
192
- prev_body: string | null
193
- quoted_message_id: string | null
194
- raw_data: Json | null
195
- sender_phone: string | null
196
- timestamp: string | null
197
- to: string | null
198
- token: string | null
199
- vcards: string[] | null
200
- }
201
- Insert: {
202
- ack?: string | null
203
- author?: string | null
204
- body?: string | null
205
- broadcast?: boolean | null
206
- chat_id?: string | null
207
- device_type?: string | null
208
- duration?: string | null
209
- forwarding_score?: number | null
210
- from?: string | null
211
- from_me?: boolean | null
212
- has_media?: boolean | null
213
- has_quoted_msg?: boolean | null
214
- has_reaction?: boolean | null
215
- id?: Json | null
216
- invite_v4?: Json | null
217
- is_deleted?: boolean | null
218
- is_ephemeral?: boolean | null
219
- is_forwarded?: boolean | null
220
- is_gif?: boolean | null
221
- is_starred?: boolean | null
222
- is_status?: boolean | null
223
- links?: Json | null
224
- location?: Json | null
225
- media?: Json | null
226
- media_key?: string | null
227
- mentioned_ids?: string[] | null
228
- message_id: string
229
- message_type?: string | null
230
- order_id?: string | null
231
- org_id: string
232
- org_phone: string
233
- performed_by?: string | null
234
- prev_body?: string | null
235
- quoted_message_id?: string | null
236
- raw_data?: Json | null
237
- sender_phone?: string | null
238
- timestamp?: string | null
239
- to?: string | null
240
- token?: string | null
241
- vcards?: string[] | null
242
- }
243
- Update: {
244
- ack?: string | null
245
- author?: string | null
246
- body?: string | null
247
- broadcast?: boolean | null
248
- chat_id?: string | null
249
- device_type?: string | null
250
- duration?: string | null
251
- forwarding_score?: number | null
252
- from?: string | null
253
- from_me?: boolean | null
254
- has_media?: boolean | null
255
- has_quoted_msg?: boolean | null
256
- has_reaction?: boolean | null
257
- id?: Json | null
258
- invite_v4?: Json | null
259
- is_deleted?: boolean | null
260
- is_ephemeral?: boolean | null
261
- is_forwarded?: boolean | null
262
- is_gif?: boolean | null
263
- is_starred?: boolean | null
264
- is_status?: boolean | null
265
- links?: Json | null
266
- location?: Json | null
267
- media?: Json | null
268
- media_key?: string | null
269
- mentioned_ids?: string[] | null
270
- message_id?: string
271
- message_type?: string | null
272
- order_id?: string | null
273
- org_id?: string
274
- org_phone?: string
275
- performed_by?: string | null
276
- prev_body?: string | null
277
- quoted_message_id?: string | null
278
- raw_data?: Json | null
279
- sender_phone?: string | null
280
- timestamp?: string | null
281
- to?: string | null
282
- token?: string | null
283
- vcards?: string[] | null
284
- }
285
- Relationships: [
286
- {
287
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
288
- columns: ["org_id", "org_phone"]
289
- isOneToOne: false
290
- referencedRelation: "tbl_org_phones"
291
- referencedColumns: ["org_id", "org_phone"]
292
- }
293
- ]
294
- }
295
- tbl_chat_notifications: {
296
- Row: {
297
- author: string | null
298
- body: string | null
299
- chat_id: string | null
300
- id: Json | null
301
- notification_id: string
302
- org_id: string
303
- org_phone: string
304
- recipientids: string[] | null
305
- timestamp: string | null
306
- type: string | null
307
- }
308
- Insert: {
309
- author?: string | null
310
- body?: string | null
311
- chat_id?: string | null
312
- id?: Json | null
313
- notification_id: string
314
- org_id: string
315
- org_phone: string
316
- recipientids?: string[] | null
317
- timestamp?: string | null
318
- type?: string | null
319
- }
320
- Update: {
321
- author?: string | null
322
- body?: string | null
323
- chat_id?: string | null
324
- id?: Json | null
325
- notification_id?: string
326
- org_id?: string
327
- org_phone?: string
328
- recipientids?: string[] | null
329
- timestamp?: string | null
330
- type?: string | null
331
- }
332
- Relationships: [
333
- {
334
- foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
335
- columns: ["org_id", "org_phone"]
336
- isOneToOne: false
337
- referencedRelation: "tbl_org_phones"
338
- referencedColumns: ["org_id", "org_phone"]
339
- }
340
- ]
341
- }
342
- tbl_chat_participants: {
343
- Row: {
344
- chat_id: string
345
- contact_id: string
346
- id: Json | null
347
- is_admin: boolean | null
348
- is_super_admin: boolean | null
349
- org_id: string
350
- }
351
- Insert: {
352
- chat_id: string
353
- contact_id: string
354
- id?: Json | null
355
- is_admin?: boolean | null
356
- is_super_admin?: boolean | null
357
- org_id: string
358
- }
359
- Update: {
360
- chat_id?: string
361
- contact_id?: string
362
- id?: Json | null
363
- is_admin?: boolean | null
364
- is_super_admin?: boolean | null
365
- org_id?: string
366
- }
367
- Relationships: []
368
- }
369
- tbl_chat_reactions: {
370
- Row: {
371
- ack: number | null
372
- id: Json | null
373
- message_id: string | null
374
- msg_id: Json | null
375
- org_id: string
376
- org_phone: string
377
- orphan: number | null
378
- orphan_reason: string | null
379
- reaction: string | null
380
- reaction_id: string
381
- read: boolean | null
382
- sender_id: string | null
383
- timestamp: string | null
384
- }
385
- Insert: {
386
- ack?: number | null
387
- id?: Json | null
388
- message_id?: string | null
389
- msg_id?: Json | null
390
- org_id: string
391
- org_phone: string
392
- orphan?: number | null
393
- orphan_reason?: string | null
394
- reaction?: string | null
395
- reaction_id: string
396
- read?: boolean | null
397
- sender_id?: string | null
398
- timestamp?: string | null
399
- }
400
- Update: {
401
- ack?: number | null
402
- id?: Json | null
403
- message_id?: string | null
404
- msg_id?: Json | null
405
- org_id?: string
406
- org_phone?: string
407
- orphan?: number | null
408
- orphan_reason?: string | null
409
- reaction?: string | null
410
- reaction_id?: string
411
- read?: boolean | null
412
- sender_id?: string | null
413
- timestamp?: string | null
414
- }
415
- Relationships: [
416
- {
417
- foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
418
- columns: ["org_id", "org_phone"]
419
- isOneToOne: false
420
- referencedRelation: "tbl_org_phones"
421
- referencedColumns: ["org_id", "org_phone"]
422
- }
423
- ]
424
- }
425
- tbl_chats: {
426
- Row: {
427
- archived: boolean | null
428
- chat_id: string
429
- chat_image: string | null
430
- group_metadata: Json | null
431
- id: Json | null
432
- invite_link: string | null
433
- is_group: boolean | null
434
- is_muted: boolean | null
435
- is_read_only: boolean | null
436
- label_ids: Json
437
- mute_expiration: number | null
438
- name: string | null
439
- org_id: string
440
- org_phone: string
441
- pinned: boolean | null
442
- timestamp: string | null
443
- unread_count: number | null
444
- }
445
- Insert: {
446
- archived?: boolean | null
447
- chat_id: string
448
- chat_image?: string | null
449
- group_metadata?: Json | null
450
- id?: Json | null
451
- invite_link?: string | null
452
- is_group?: boolean | null
453
- is_muted?: boolean | null
454
- is_read_only?: boolean | null
455
- label_ids?: Json
456
- mute_expiration?: number | null
457
- name?: string | null
458
- org_id: string
459
- org_phone: string
460
- pinned?: boolean | null
461
- timestamp?: string | null
462
- unread_count?: number | null
463
- }
464
- Update: {
465
- archived?: boolean | null
466
- chat_id?: string
467
- chat_image?: string | null
468
- group_metadata?: Json | null
469
- id?: Json | null
470
- invite_link?: string | null
471
- is_group?: boolean | null
472
- is_muted?: boolean | null
473
- is_read_only?: boolean | null
474
- label_ids?: Json
475
- mute_expiration?: number | null
476
- name?: string | null
477
- org_id?: string
478
- org_phone?: string
479
- pinned?: boolean | null
480
- timestamp?: string | null
481
- unread_count?: number | null
482
- }
483
- Relationships: [
484
- {
485
- foreignKeyName: "tbl_chats_org_id_fkey"
486
- columns: ["org_id"]
487
- isOneToOne: false
488
- referencedRelation: "tbl_org"
489
- referencedColumns: ["org_id"]
490
- }
491
- ]
492
- }
493
- tbl_contacts: {
494
- Row: {
495
- business_profile: Json | null
496
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
497
- contact_id: string
498
- contact_image: string | null
499
- contact_name: string | null
500
- contact_type: string | null
501
- id: Json | null
502
- is_blocked: boolean | null
503
- is_business: boolean | null
504
- is_enterprise: boolean | null
505
- is_group: boolean | null
506
- is_internal: boolean | null
507
- is_me: boolean | null
508
- is_my_contact: boolean | null
509
- is_user: boolean | null
510
- is_wa_contact: boolean | null
511
- label_ids: Json
512
- name: string | null
513
- number: string | null
514
- org_id: string
515
- pushname: string | null
516
- short_name: string | null
517
- verified_level: number | null
518
- verified_name: string | null
519
- }
520
- Insert: {
521
- business_profile?: Json | null
522
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
523
- contact_id: string
524
- contact_image?: string | null
525
- contact_name?: string | null
526
- contact_type?: string | null
527
- id?: Json | null
528
- is_blocked?: boolean | null
529
- is_business?: boolean | null
530
- is_enterprise?: boolean | null
531
- is_group?: boolean | null
532
- is_internal?: boolean | null
533
- is_me?: boolean | null
534
- is_my_contact?: boolean | null
535
- is_user?: boolean | null
536
- is_wa_contact?: boolean | null
537
- label_ids?: Json
538
- name?: string | null
539
- number?: string | null
540
- org_id: string
541
- pushname?: string | null
542
- short_name?: string | null
543
- verified_level?: number | null
544
- verified_name?: string | null
545
- }
546
- Update: {
547
- business_profile?: Json | null
548
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
549
- contact_id?: string
550
- contact_image?: string | null
551
- contact_name?: string | null
552
- contact_type?: string | null
553
- id?: Json | null
554
- is_blocked?: boolean | null
555
- is_business?: boolean | null
556
- is_enterprise?: boolean | null
557
- is_group?: boolean | null
558
- is_internal?: boolean | null
559
- is_me?: boolean | null
560
- is_my_contact?: boolean | null
561
- is_user?: boolean | null
562
- is_wa_contact?: boolean | null
563
- label_ids?: Json
564
- name?: string | null
565
- number?: string | null
566
- org_id?: string
567
- pushname?: string | null
568
- short_name?: string | null
569
- verified_level?: number | null
570
- verified_name?: string | null
571
- }
572
- Relationships: [
573
- {
574
- foreignKeyName: "tbl_contacts_org_id_fkey"
575
- columns: ["org_id"]
576
- isOneToOne: false
577
- referencedRelation: "tbl_org"
578
- referencedColumns: ["org_id"]
579
- }
580
- ]
581
- }
582
- tbl_org: {
583
- Row: {
584
- created_at: string
585
- org_id: string
586
- org_image: string | null
587
- org_name: string | null
588
- support_link: string | null
589
- }
590
- Insert: {
591
- created_at?: string
592
- org_id?: string
593
- org_image?: string | null
594
- org_name?: string | null
595
- support_link?: string | null
596
- }
597
- Update: {
598
- created_at?: string
599
- org_id?: string
600
- org_image?: string | null
601
- org_name?: string | null
602
- support_link?: string | null
603
- }
604
- Relationships: []
605
- }
606
- tbl_org_labels: {
607
- Row: {
608
- color: string
609
- created_at: string
610
- label_id: string
611
- name: string
612
- org_id: string
613
- type: string
614
- }
615
- Insert: {
616
- color?: string
617
- created_at?: string
618
- label_id?: string
619
- name: string
620
- org_id?: string
621
- type?: string
622
- }
623
- Update: {
624
- color?: string
625
- created_at?: string
626
- label_id?: string
627
- name?: string
628
- org_id?: string
629
- type?: string
630
- }
631
- Relationships: [
632
- {
633
- foreignKeyName: "tbl_org_labels_org_id_fkey"
634
- columns: ["org_id"]
635
- isOneToOne: false
636
- referencedRelation: "tbl_org"
637
- referencedColumns: ["org_id"]
638
- }
639
- ]
640
- }
641
- tbl_org_members: {
642
- Row: {
643
- created_at: string | null
644
- email: string
645
- invited_at: string | null
646
- invited_by: string | null
647
- is_active: boolean
648
- member_image: string | null
649
- member_name: string | null
650
- org_id: string
651
- role: Database["public"]["Enums"]["enum_member_role"]
652
- user_id: string | null
653
- }
654
- Insert: {
655
- created_at?: string | null
656
- email: string
657
- invited_at?: string | null
658
- invited_by?: string | null
659
- is_active?: boolean
660
- member_image?: string | null
661
- member_name?: string | null
662
- org_id: string
663
- role?: Database["public"]["Enums"]["enum_member_role"]
664
- user_id?: string | null
665
- }
666
- Update: {
667
- created_at?: string | null
668
- email?: string
669
- invited_at?: string | null
670
- invited_by?: string | null
671
- is_active?: boolean
672
- member_image?: string | null
673
- member_name?: string | null
674
- org_id?: string
675
- role?: Database["public"]["Enums"]["enum_member_role"]
676
- user_id?: string | null
677
- }
678
- Relationships: [
679
- {
680
- foreignKeyName: "tbl_org_members_fkey_auth_users"
681
- columns: ["user_id"]
682
- isOneToOne: false
683
- referencedRelation: "users"
684
- referencedColumns: ["id"]
685
- },
686
- {
687
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
688
- columns: ["org_id"]
689
- isOneToOne: false
690
- referencedRelation: "tbl_org"
691
- referencedColumns: ["org_id"]
692
- }
693
- ]
694
- }
695
- tbl_org_phones: {
696
- Row: {
697
- created_at: string
698
- is_ready: boolean
699
- org_id: string
700
- org_phone: string | null
701
- phone_id: string
702
- phone_image: string | null
703
- phone_name: string | null
704
- qr_code: string | null
705
- updated_at: string
706
- wa_state: string | null
707
- }
708
- Insert: {
709
- created_at?: string
710
- is_ready?: boolean
711
- org_id: string
712
- org_phone?: string | null
713
- phone_id?: string
714
- phone_image?: string | null
715
- phone_name?: string | null
716
- qr_code?: string | null
717
- updated_at?: string
718
- wa_state?: string | null
719
- }
720
- Update: {
721
- created_at?: string
722
- is_ready?: boolean
723
- org_id?: string
724
- org_phone?: string | null
725
- phone_id?: string
726
- phone_image?: string | null
727
- phone_name?: string | null
728
- qr_code?: string | null
729
- updated_at?: string
730
- wa_state?: string | null
731
- }
732
- Relationships: [
733
- {
734
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
735
- columns: ["org_id"]
736
- isOneToOne: false
737
- referencedRelation: "tbl_org"
738
- referencedColumns: ["org_id"]
739
- }
740
- ]
741
- }
742
- }
743
- Views: {
744
- view_chats: {
745
- Row: {
746
- archived: boolean | null
747
- chat_access: Json | null
748
- chat_id: string | null
749
- chat_image: string | null
750
- chat_type: string | null
751
- group_metadata: Json | null
752
- has_access: boolean | null
753
- id: Json | null
754
- invite_link: string | null
755
- is_group: boolean | null
756
- is_muted: boolean | null
757
- is_read_only: boolean | null
758
- label_ids: Json | null
759
- last_read_timestamp: string | null
760
- latest_message: Json | null
761
- latest_message_timestamp: string | null
762
- member_count: number | null
763
- message_unread_count: number | null
764
- mute_expiration: number | null
765
- name: string | null
766
- org_id: string | null
767
- org_phone: string | null
768
- pinned: boolean | null
769
- timestamp: string | null
770
- unread_count: number | null
771
- }
772
- Relationships: [
773
- {
774
- foreignKeyName: "tbl_chats_org_id_fkey"
775
- columns: ["org_id"]
776
- isOneToOne: false
777
- referencedRelation: "tbl_org"
778
- referencedColumns: ["org_id"]
779
- }
780
- ]
781
- }
782
- }
783
- Functions: {
784
- gen_id: {
785
- Args: {
786
- prefix: string
787
- size?: number
788
- alphabet?: string
789
- }
790
- Returns: string
791
- }
792
- get_chats: {
793
- Args: {
794
- chat_id_input?: string[]
795
- with_metadata?: boolean
796
- }
797
- Returns: Json
798
- }
799
- get_contacts: {
800
- Args: {
801
- contact_ids_input?: string[]
802
- }
803
- Returns: Json
804
- }
805
- get_media: {
806
- Args: {
807
- filters?: Json
808
- page_num?: number
809
- }
810
- Returns: Json
811
- }
812
- get_org: {
813
- Args: {
814
- org_id_input?: string
815
- }
816
- Returns: Json
817
- }
818
- list_org_from_user: {
819
- Args: Record<PropertyKey, never>
820
- Returns: string
821
- }
822
- list_role_from_user: {
823
- Args: Record<PropertyKey, never>
824
- Returns: Database["public"]["Enums"]["enum_member_role"]
825
- }
826
- update_labels: {
827
- Args: {
828
- tbl_type: string
829
- label_ids_input: Json
830
- row_id_input: string[]
831
- }
832
- Returns: undefined
833
- }
834
- }
835
- Enums: {
836
- enum_chat_colors:
837
- | "#B4876E"
838
- | "#A5B337"
839
- | "#06CF9C"
840
- | "#25D366"
841
- | "#02A698"
842
- | "#7D9EF1"
843
- | "#007BFC"
844
- | "#5E47DE"
845
- | "#7F66FF"
846
- | "#9333EA"
847
- | "#FA6533"
848
- | "#C4532D"
849
- | "#DC2626"
850
- | "#FF2E74"
851
- | "#DB2777"
852
- enum_member_role: "admin" | "member"
853
- }
854
- CompositeTypes: {
855
- [_ in never]: never
856
- }
857
- }
858
- storage: {
859
- Tables: {
860
- buckets: {
861
- Row: {
862
- allowed_mime_types: string[] | null
863
- avif_autodetection: boolean | null
864
- created_at: string | null
865
- file_size_limit: number | null
866
- id: string
867
- name: string
868
- owner: string | null
869
- owner_id: string | null
870
- public: boolean | null
871
- updated_at: string | null
872
- }
873
- Insert: {
874
- allowed_mime_types?: string[] | null
875
- avif_autodetection?: boolean | null
876
- created_at?: string | null
877
- file_size_limit?: number | null
878
- id: string
879
- name: string
880
- owner?: string | null
881
- owner_id?: string | null
882
- public?: boolean | null
883
- updated_at?: string | null
884
- }
885
- Update: {
886
- allowed_mime_types?: string[] | null
887
- avif_autodetection?: boolean | null
888
- created_at?: string | null
889
- file_size_limit?: number | null
890
- id?: string
891
- name?: string
892
- owner?: string | null
893
- owner_id?: string | null
894
- public?: boolean | null
895
- updated_at?: string | null
896
- }
897
- Relationships: []
898
- }
899
- migrations: {
900
- Row: {
901
- executed_at: string | null
902
- hash: string
903
- id: number
904
- name: string
905
- }
906
- Insert: {
907
- executed_at?: string | null
908
- hash: string
909
- id: number
910
- name: string
911
- }
912
- Update: {
913
- executed_at?: string | null
914
- hash?: string
915
- id?: number
916
- name?: string
917
- }
918
- Relationships: []
919
- }
920
- objects: {
921
- Row: {
922
- bucket_id: string | null
923
- created_at: string | null
924
- id: string
925
- last_accessed_at: string | null
926
- metadata: Json | null
927
- name: string | null
928
- owner: string | null
929
- owner_id: string | null
930
- path_tokens: string[] | null
931
- updated_at: string | null
932
- version: string | null
933
- }
934
- Insert: {
935
- bucket_id?: string | null
936
- created_at?: string | null
937
- id?: string
938
- last_accessed_at?: string | null
939
- metadata?: Json | null
940
- name?: string | null
941
- owner?: string | null
942
- owner_id?: string | null
943
- path_tokens?: string[] | null
944
- updated_at?: string | null
945
- version?: string | null
946
- }
947
- Update: {
948
- bucket_id?: string | null
949
- created_at?: string | null
950
- id?: string
951
- last_accessed_at?: string | null
952
- metadata?: Json | null
953
- name?: string | null
954
- owner?: string | null
955
- owner_id?: string | null
956
- path_tokens?: string[] | null
957
- updated_at?: string | null
958
- version?: string | null
959
- }
960
- Relationships: [
961
- {
962
- foreignKeyName: "objects_bucketId_fkey"
963
- columns: ["bucket_id"]
964
- isOneToOne: false
965
- referencedRelation: "buckets"
966
- referencedColumns: ["id"]
967
- }
968
- ]
969
- }
970
- }
971
- Views: {
972
- [_ in never]: never
973
- }
974
- Functions: {
975
- can_insert_object: {
976
- Args: {
977
- bucketid: string
978
- name: string
979
- owner: string
980
- metadata: Json
981
- }
982
- Returns: undefined
983
- }
984
- extension: {
985
- Args: {
986
- name: string
987
- }
988
- Returns: string
989
- }
990
- filename: {
991
- Args: {
992
- name: string
993
- }
994
- Returns: string
995
- }
996
- foldername: {
997
- Args: {
998
- name: string
999
- }
1000
- Returns: unknown
1001
- }
1002
- get_size_by_bucket: {
1003
- Args: Record<PropertyKey, never>
1004
- Returns: {
1005
- size: number
1006
- bucket_id: string
1007
- }[]
1008
- }
1009
- search: {
1010
- Args: {
1011
- prefix: string
1012
- bucketname: string
1013
- limits?: number
1014
- levels?: number
1015
- offsets?: number
1016
- search?: string
1017
- sortcolumn?: string
1018
- sortorder?: string
1019
- }
1020
- Returns: {
1021
- name: string
1022
- id: string
1023
- updated_at: string
1024
- created_at: string
1025
- last_accessed_at: string
1026
- metadata: Json
1027
- }[]
1028
- }
1029
- }
1030
- Enums: {
1031
- [_ in never]: never
1032
- }
1033
- CompositeTypes: {
1034
- [_ in never]: never
1035
- }
1036
- }
1037
- }
1038
-
1039
- export type Tables<
1040
- PublicTableNameOrOptions extends
1041
- | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1042
- | { schema: keyof Database },
1043
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1044
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1045
- Database[PublicTableNameOrOptions["schema"]]["Views"])
1046
- : never = never
1047
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1048
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1049
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1050
- Row: infer R
1051
- }
1052
- ? R
1053
- : never
1054
- : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1055
- Database["public"]["Views"])
1056
- ? (Database["public"]["Tables"] &
1057
- Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1058
- Row: infer R
1059
- }
1060
- ? R
1061
- : never
1062
- : never
1063
-
1064
- export type TablesInsert<
1065
- PublicTableNameOrOptions extends
1066
- | keyof Database["public"]["Tables"]
1067
- | { schema: keyof Database },
1068
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1069
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1070
- : never = never
1071
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1072
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1073
- Insert: infer I
1074
- }
1075
- ? I
1076
- : never
1077
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1078
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1079
- Insert: infer I
1080
- }
1081
- ? I
1082
- : never
1083
- : never
1084
-
1085
- export type TablesUpdate<
1086
- PublicTableNameOrOptions extends
1087
- | keyof Database["public"]["Tables"]
1088
- | { schema: keyof Database },
1089
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1090
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1091
- : never = never
1092
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1093
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1094
- Update: infer U
1095
- }
1096
- ? U
1097
- : never
1098
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1099
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1100
- Update: infer U
1101
- }
1102
- ? U
1103
- : never
1104
- : never
1105
-
1106
- export type Enums<
1107
- PublicEnumNameOrOptions extends
1108
- | keyof Database["public"]["Enums"]
1109
- | { schema: keyof Database },
1110
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1111
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1112
- : never = never
1113
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1114
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1115
- : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1116
- ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1117
- : never
1118
-
1
+ export type Json = { [key: string]: any } | any;
1119
2
 
3
+ export type Database = {
4
+ internal: {
5
+ Tables: {
6
+ config: {
7
+ Row: {
8
+ key: string;
9
+ updated_at: string;
10
+ value: string | null;
11
+ };
12
+ Insert: {
13
+ key: string;
14
+ updated_at?: string;
15
+ value?: string | null;
16
+ };
17
+ Update: {
18
+ key?: string;
19
+ updated_at?: string;
20
+ value?: string | null;
21
+ };
22
+ Relationships: [];
23
+ };
24
+ tbl_communication_logs: {
25
+ Row: {
26
+ communication_type: string | null;
27
+ created_at: string;
28
+ id: number;
29
+ metadata: Json | null;
30
+ org_id: string | null;
31
+ recipient: string | null;
32
+ success: boolean | null;
33
+ type: string | null;
34
+ };
35
+ Insert: {
36
+ communication_type?: string | null;
37
+ created_at?: string;
38
+ id?: number;
39
+ metadata?: Json | null;
40
+ org_id?: string | null;
41
+ recipient?: string | null;
42
+ success?: boolean | null;
43
+ type?: string | null;
44
+ };
45
+ Update: {
46
+ communication_type?: string | null;
47
+ created_at?: string;
48
+ id?: number;
49
+ metadata?: Json | null;
50
+ org_id?: string | null;
51
+ recipient?: string | null;
52
+ success?: boolean | null;
53
+ type?: string | null;
54
+ };
55
+ Relationships: [];
56
+ };
57
+ tbl_trigger_logs: {
58
+ Row: {
59
+ created_at: string;
60
+ id: number;
61
+ request_body: Json;
62
+ request_id: string;
63
+ trace_id: string;
64
+ trigger_name: string;
65
+ };
66
+ Insert: {
67
+ created_at?: string;
68
+ id?: number;
69
+ request_body: Json;
70
+ request_id: string;
71
+ trace_id?: string;
72
+ trigger_name: string;
73
+ };
74
+ Update: {
75
+ created_at?: string;
76
+ id?: number;
77
+ request_body?: Json;
78
+ request_id?: string;
79
+ trace_id?: string;
80
+ trigger_name?: string;
81
+ };
82
+ Relationships: [];
83
+ };
84
+ };
85
+ Views: {
86
+ [_ in never]: never;
87
+ };
88
+ Functions: {
89
+ [_ in never]: never;
90
+ };
91
+ Enums: {
92
+ [_ in never]: never;
93
+ };
94
+ CompositeTypes: {
95
+ [_ in never]: never;
96
+ };
97
+ };
98
+ public: {
99
+ Tables: {
100
+ tbl_api_logs: {
101
+ Row: {
102
+ org_id: string;
103
+ path: string;
104
+ req: Json;
105
+ request_id: string;
106
+ res: Json | null;
107
+ status: number;
108
+ timestamp: string;
109
+ token_id: string;
110
+ };
111
+ Insert: {
112
+ org_id: string;
113
+ path: string;
114
+ req: Json;
115
+ request_id: string;
116
+ res?: Json | null;
117
+ status: number;
118
+ timestamp: string;
119
+ token_id: string;
120
+ };
121
+ Update: {
122
+ org_id?: string;
123
+ path?: string;
124
+ req?: Json;
125
+ request_id?: string;
126
+ res?: Json | null;
127
+ status?: number;
128
+ timestamp?: string;
129
+ token_id?: string;
130
+ };
131
+ Relationships: [];
132
+ };
133
+ tbl_automation_rules: {
134
+ Row: {
135
+ actions: Json;
136
+ conditions: Json;
137
+ created_at: string;
138
+ id: string;
139
+ is_active: boolean;
140
+ last_updated_at: string;
141
+ last_updated_by: string;
142
+ org_id: string;
143
+ rule_name: string;
144
+ trigger: string;
145
+ };
146
+ Insert: {
147
+ actions: Json;
148
+ conditions: Json;
149
+ created_at?: string;
150
+ id?: string;
151
+ is_active?: boolean;
152
+ last_updated_at?: string;
153
+ last_updated_by: string;
154
+ org_id: string;
155
+ rule_name: string;
156
+ trigger: string;
157
+ };
158
+ Update: {
159
+ actions?: Json;
160
+ conditions?: Json;
161
+ created_at?: string;
162
+ id?: string;
163
+ is_active?: boolean;
164
+ last_updated_at?: string;
165
+ last_updated_by?: string;
166
+ org_id?: string;
167
+ rule_name?: string;
168
+ trigger?: string;
169
+ };
170
+ Relationships: [
171
+ {
172
+ foreignKeyName: 'public_tbl_automation_rules_org_id_fkey';
173
+ columns: ['org_id'];
174
+ isOneToOne: false;
175
+ referencedRelation: 'tbl_org';
176
+ referencedColumns: ['org_id'];
177
+ },
178
+ {
179
+ foreignKeyName: 'public_tbl_automation_rules_org_id_fkey';
180
+ columns: ['org_id'];
181
+ isOneToOne: false;
182
+ referencedRelation: 'view_org';
183
+ referencedColumns: ['org_id'];
184
+ },
185
+ ];
186
+ };
187
+ tbl_broadcast_logs: {
188
+ Row: {
189
+ broadcast_id: string;
190
+ chat_id: string;
191
+ completed_at: string | null;
192
+ created_at: string;
193
+ delivered_count: number | null;
194
+ delivery_info: Json | null;
195
+ is_success: boolean | null;
196
+ member_count: number | null;
197
+ message_id: string | null;
198
+ org_id: string;
199
+ org_phone: string | null;
200
+ read_count: number | null;
201
+ };
202
+ Insert: {
203
+ broadcast_id: string;
204
+ chat_id: string;
205
+ completed_at?: string | null;
206
+ created_at?: string;
207
+ delivered_count?: number | null;
208
+ delivery_info?: Json | null;
209
+ is_success?: boolean | null;
210
+ member_count?: number | null;
211
+ message_id?: string | null;
212
+ org_id: string;
213
+ org_phone?: string | null;
214
+ read_count?: number | null;
215
+ };
216
+ Update: {
217
+ broadcast_id?: string;
218
+ chat_id?: string;
219
+ completed_at?: string | null;
220
+ created_at?: string;
221
+ delivered_count?: number | null;
222
+ delivery_info?: Json | null;
223
+ is_success?: boolean | null;
224
+ member_count?: number | null;
225
+ message_id?: string | null;
226
+ org_id?: string;
227
+ org_phone?: string | null;
228
+ read_count?: number | null;
229
+ };
230
+ Relationships: [
231
+ {
232
+ foreignKeyName: 'tbl_broadcast_logs_broadcast_id_fkey';
233
+ columns: ['broadcast_id'];
234
+ isOneToOne: false;
235
+ referencedRelation: 'tbl_broadcast_messages';
236
+ referencedColumns: ['broadcast_id'];
237
+ },
238
+ {
239
+ foreignKeyName: 'tbl_broadcast_logs_broadcast_id_fkey';
240
+ columns: ['broadcast_id'];
241
+ isOneToOne: false;
242
+ referencedRelation: 'view_broadcast_logs';
243
+ referencedColumns: ['broadcast_id'];
244
+ },
245
+ {
246
+ foreignKeyName: 'tbl_broadcast_logs_org_id_fkey';
247
+ columns: ['org_id'];
248
+ isOneToOne: false;
249
+ referencedRelation: 'tbl_org';
250
+ referencedColumns: ['org_id'];
251
+ },
252
+ {
253
+ foreignKeyName: 'tbl_broadcast_logs_org_id_fkey';
254
+ columns: ['org_id'];
255
+ isOneToOne: false;
256
+ referencedRelation: 'view_org';
257
+ referencedColumns: ['org_id'];
258
+ },
259
+ ];
260
+ };
261
+ tbl_broadcast_messages: {
262
+ Row: {
263
+ broadcast_id: string;
264
+ broadcast_status:
265
+ | Database['public']['Enums']['enum_broadcast_status']
266
+ | null;
267
+ chat_ids: string[] | null;
268
+ created_at: string;
269
+ message_payload: Json | null;
270
+ org_id: string;
271
+ org_phone: string | null;
272
+ performed_at: string | null;
273
+ performed_by: string | null;
274
+ scheduled_at: string | null;
275
+ variables: Json | null;
276
+ };
277
+ Insert: {
278
+ broadcast_id?: string;
279
+ broadcast_status?:
280
+ | Database['public']['Enums']['enum_broadcast_status']
281
+ | null;
282
+ chat_ids?: string[] | null;
283
+ created_at?: string;
284
+ message_payload?: Json | null;
285
+ org_id: string;
286
+ org_phone?: string | null;
287
+ performed_at?: string | null;
288
+ performed_by?: string | null;
289
+ scheduled_at?: string | null;
290
+ variables?: Json | null;
291
+ };
292
+ Update: {
293
+ broadcast_id?: string;
294
+ broadcast_status?:
295
+ | Database['public']['Enums']['enum_broadcast_status']
296
+ | null;
297
+ chat_ids?: string[] | null;
298
+ created_at?: string;
299
+ message_payload?: Json | null;
300
+ org_id?: string;
301
+ org_phone?: string | null;
302
+ performed_at?: string | null;
303
+ performed_by?: string | null;
304
+ scheduled_at?: string | null;
305
+ variables?: Json | null;
306
+ };
307
+ Relationships: [
308
+ {
309
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
310
+ columns: ['org_id'];
311
+ isOneToOne: false;
312
+ referencedRelation: 'tbl_org';
313
+ referencedColumns: ['org_id'];
314
+ },
315
+ {
316
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
317
+ columns: ['org_id'];
318
+ isOneToOne: false;
319
+ referencedRelation: 'view_org';
320
+ referencedColumns: ['org_id'];
321
+ },
322
+ ];
323
+ };
324
+ tbl_broadcast_templates: {
325
+ Row: {
326
+ created_at: string;
327
+ message_payload: Json | null;
328
+ org_id: string;
329
+ template_id: string;
330
+ template_name: string | null;
331
+ updated_at: string | null;
332
+ variable_names: Json | null;
333
+ };
334
+ Insert: {
335
+ created_at?: string;
336
+ message_payload?: Json | null;
337
+ org_id: string;
338
+ template_id?: string;
339
+ template_name?: string | null;
340
+ updated_at?: string | null;
341
+ variable_names?: Json | null;
342
+ };
343
+ Update: {
344
+ created_at?: string;
345
+ message_payload?: Json | null;
346
+ org_id?: string;
347
+ template_id?: string;
348
+ template_name?: string | null;
349
+ updated_at?: string | null;
350
+ variable_names?: Json | null;
351
+ };
352
+ Relationships: [
353
+ {
354
+ foreignKeyName: 'tbl_broadcast_templates_org_id_fkey';
355
+ columns: ['org_id'];
356
+ isOneToOne: false;
357
+ referencedRelation: 'tbl_org';
358
+ referencedColumns: ['org_id'];
359
+ },
360
+ {
361
+ foreignKeyName: 'tbl_broadcast_templates_org_id_fkey';
362
+ columns: ['org_id'];
363
+ isOneToOne: false;
364
+ referencedRelation: 'view_org';
365
+ referencedColumns: ['org_id'];
366
+ },
367
+ ];
368
+ };
369
+ tbl_chat_logs: {
370
+ Row: {
371
+ action: string | null;
372
+ chat_id: string | null;
373
+ is_success: boolean | null;
374
+ log_id: string;
375
+ metadata: Json | null;
376
+ operation_id: string;
377
+ org_id: string;
378
+ org_phone: string;
379
+ participant_id: string | null;
380
+ performed_by: string | null;
381
+ timestamp: string | null;
382
+ };
383
+ Insert: {
384
+ action?: string | null;
385
+ chat_id?: string | null;
386
+ is_success?: boolean | null;
387
+ log_id?: string;
388
+ metadata?: Json | null;
389
+ operation_id: string;
390
+ org_id: string;
391
+ org_phone: string;
392
+ participant_id?: string | null;
393
+ performed_by?: string | null;
394
+ timestamp?: string | null;
395
+ };
396
+ Update: {
397
+ action?: string | null;
398
+ chat_id?: string | null;
399
+ is_success?: boolean | null;
400
+ log_id?: string;
401
+ metadata?: Json | null;
402
+ operation_id?: string;
403
+ org_id?: string;
404
+ org_phone?: string;
405
+ participant_id?: string | null;
406
+ performed_by?: string | null;
407
+ timestamp?: string | null;
408
+ };
409
+ Relationships: [
410
+ {
411
+ foreignKeyName: 'tbl_chat_logs_org_id_fkey';
412
+ columns: ['org_id'];
413
+ isOneToOne: false;
414
+ referencedRelation: 'tbl_org';
415
+ referencedColumns: ['org_id'];
416
+ },
417
+ {
418
+ foreignKeyName: 'tbl_chat_logs_org_id_fkey';
419
+ columns: ['org_id'];
420
+ isOneToOne: false;
421
+ referencedRelation: 'view_org';
422
+ referencedColumns: ['org_id'];
423
+ },
424
+ ];
425
+ };
426
+ tbl_chat_messages: {
427
+ Row: {
428
+ ack: string | null;
429
+ author: string | null;
430
+ body: string | null;
431
+ broadcast: boolean | null;
432
+ broadcast_id: string | null;
433
+ chat_id: string | null;
434
+ delivery_info: Json | null;
435
+ device_type: string | null;
436
+ duration: string | null;
437
+ flag_metadata: Json | null;
438
+ flag_response_time: number | null;
439
+ flag_status: boolean | null;
440
+ forwarding_score: number | null;
441
+ from: string | null;
442
+ from_me: boolean | null;
443
+ fts: unknown | null;
444
+ has_media: boolean | null;
445
+ has_quoted_msg: boolean | null;
446
+ has_reaction: boolean | null;
447
+ id: Json | null;
448
+ invite_v4: Json | null;
449
+ is_deleted: boolean | null;
450
+ is_ephemeral: boolean | null;
451
+ is_forwarded: boolean | null;
452
+ is_gif: boolean | null;
453
+ is_starred: boolean | null;
454
+ is_status: boolean | null;
455
+ links: Json | null;
456
+ location: Json | null;
457
+ media: Json | null;
458
+ media_key: string | null;
459
+ mentioned_ids: string[] | null;
460
+ message_id: string;
461
+ message_ticket_id: string | null;
462
+ message_type: string | null;
463
+ order_id: string | null;
464
+ org_id: string;
465
+ org_phone: string;
466
+ performed_by: string | null;
467
+ poll_info: Json | null;
468
+ poll_results: Json | null;
469
+ prev_body: string | null;
470
+ quoted_message_id: string | null;
471
+ raw_data: Json | null;
472
+ sender_phone: string | null;
473
+ sent_message_id: string | null;
474
+ timestamp: string | null;
475
+ to: string | null;
476
+ token: string | null;
477
+ unique_id: string | null;
478
+ updated_at: string | null;
479
+ vcards: string[] | null;
480
+ };
481
+ Insert: {
482
+ ack?: string | null;
483
+ author?: string | null;
484
+ body?: string | null;
485
+ broadcast?: boolean | null;
486
+ broadcast_id?: string | null;
487
+ chat_id?: string | null;
488
+ delivery_info?: Json | null;
489
+ device_type?: string | null;
490
+ duration?: string | null;
491
+ flag_metadata?: Json | null;
492
+ flag_response_time?: number | null;
493
+ flag_status?: boolean | null;
494
+ forwarding_score?: number | null;
495
+ from?: string | null;
496
+ from_me?: boolean | null;
497
+ fts?: unknown | null;
498
+ has_media?: boolean | null;
499
+ has_quoted_msg?: boolean | null;
500
+ has_reaction?: boolean | null;
501
+ id?: Json | null;
502
+ invite_v4?: Json | null;
503
+ is_deleted?: boolean | null;
504
+ is_ephemeral?: boolean | null;
505
+ is_forwarded?: boolean | null;
506
+ is_gif?: boolean | null;
507
+ is_starred?: boolean | null;
508
+ is_status?: boolean | null;
509
+ links?: Json | null;
510
+ location?: Json | null;
511
+ media?: Json | null;
512
+ media_key?: string | null;
513
+ mentioned_ids?: string[] | null;
514
+ message_id: string;
515
+ message_ticket_id?: string | null;
516
+ message_type?: string | null;
517
+ order_id?: string | null;
518
+ org_id: string;
519
+ org_phone: string;
520
+ performed_by?: string | null;
521
+ poll_info?: Json | null;
522
+ poll_results?: Json | null;
523
+ prev_body?: string | null;
524
+ quoted_message_id?: string | null;
525
+ raw_data?: Json | null;
526
+ sender_phone?: string | null;
527
+ sent_message_id?: string | null;
528
+ timestamp?: string | null;
529
+ to?: string | null;
530
+ token?: string | null;
531
+ unique_id?: string | null;
532
+ updated_at?: string | null;
533
+ vcards?: string[] | null;
534
+ };
535
+ Update: {
536
+ ack?: string | null;
537
+ author?: string | null;
538
+ body?: string | null;
539
+ broadcast?: boolean | null;
540
+ broadcast_id?: string | null;
541
+ chat_id?: string | null;
542
+ delivery_info?: Json | null;
543
+ device_type?: string | null;
544
+ duration?: string | null;
545
+ flag_metadata?: Json | null;
546
+ flag_response_time?: number | null;
547
+ flag_status?: boolean | null;
548
+ forwarding_score?: number | null;
549
+ from?: string | null;
550
+ from_me?: boolean | null;
551
+ fts?: unknown | null;
552
+ has_media?: boolean | null;
553
+ has_quoted_msg?: boolean | null;
554
+ has_reaction?: boolean | null;
555
+ id?: Json | null;
556
+ invite_v4?: Json | null;
557
+ is_deleted?: boolean | null;
558
+ is_ephemeral?: boolean | null;
559
+ is_forwarded?: boolean | null;
560
+ is_gif?: boolean | null;
561
+ is_starred?: boolean | null;
562
+ is_status?: boolean | null;
563
+ links?: Json | null;
564
+ location?: Json | null;
565
+ media?: Json | null;
566
+ media_key?: string | null;
567
+ mentioned_ids?: string[] | null;
568
+ message_id?: string;
569
+ message_ticket_id?: string | null;
570
+ message_type?: string | null;
571
+ order_id?: string | null;
572
+ org_id?: string;
573
+ org_phone?: string;
574
+ performed_by?: string | null;
575
+ poll_info?: Json | null;
576
+ poll_results?: Json | null;
577
+ prev_body?: string | null;
578
+ quoted_message_id?: string | null;
579
+ raw_data?: Json | null;
580
+ sender_phone?: string | null;
581
+ sent_message_id?: string | null;
582
+ timestamp?: string | null;
583
+ to?: string | null;
584
+ token?: string | null;
585
+ unique_id?: string | null;
586
+ updated_at?: string | null;
587
+ vcards?: string[] | null;
588
+ };
589
+ Relationships: [
590
+ {
591
+ foreignKeyName: 'tbl_chat_messages_fkey_tbl_org_phones';
592
+ columns: ['org_phone', 'org_id'];
593
+ isOneToOne: false;
594
+ referencedRelation: 'tbl_org_phones';
595
+ referencedColumns: ['org_phone', 'org_id'];
596
+ },
597
+ ];
598
+ };
599
+ tbl_chat_notifications: {
600
+ Row: {
601
+ author: string | null;
602
+ body: string | null;
603
+ chat_id: string | null;
604
+ id: Json | null;
605
+ notification_id: string;
606
+ org_id: string;
607
+ org_phone: string;
608
+ recipientids: string[] | null;
609
+ timestamp: string | null;
610
+ type: string | null;
611
+ unique_id: string | null;
612
+ };
613
+ Insert: {
614
+ author?: string | null;
615
+ body?: string | null;
616
+ chat_id?: string | null;
617
+ id?: Json | null;
618
+ notification_id: string;
619
+ org_id: string;
620
+ org_phone: string;
621
+ recipientids?: string[] | null;
622
+ timestamp?: string | null;
623
+ type?: string | null;
624
+ unique_id?: string | null;
625
+ };
626
+ Update: {
627
+ author?: string | null;
628
+ body?: string | null;
629
+ chat_id?: string | null;
630
+ id?: Json | null;
631
+ notification_id?: string;
632
+ org_id?: string;
633
+ org_phone?: string;
634
+ recipientids?: string[] | null;
635
+ timestamp?: string | null;
636
+ type?: string | null;
637
+ unique_id?: string | null;
638
+ };
639
+ Relationships: [
640
+ {
641
+ foreignKeyName: 'tbl_chat_notifications_fkey_tbl_org_phones';
642
+ columns: ['org_id', 'org_phone'];
643
+ isOneToOne: false;
644
+ referencedRelation: 'tbl_org_phones';
645
+ referencedColumns: ['org_id', 'org_phone'];
646
+ },
647
+ ];
648
+ };
649
+ tbl_chat_participants: {
650
+ Row: {
651
+ chat_id: string;
652
+ contact_id: string;
653
+ id: Json | null;
654
+ is_admin: boolean | null;
655
+ is_super_admin: boolean | null;
656
+ org_id: string;
657
+ org_phone: string;
658
+ };
659
+ Insert: {
660
+ chat_id: string;
661
+ contact_id: string;
662
+ id?: Json | null;
663
+ is_admin?: boolean | null;
664
+ is_super_admin?: boolean | null;
665
+ org_id: string;
666
+ org_phone: string;
667
+ };
668
+ Update: {
669
+ chat_id?: string;
670
+ contact_id?: string;
671
+ id?: Json | null;
672
+ is_admin?: boolean | null;
673
+ is_super_admin?: boolean | null;
674
+ org_id?: string;
675
+ org_phone?: string;
676
+ };
677
+ Relationships: [
678
+ {
679
+ foreignKeyName: 'fkey_tbl_org_phones';
680
+ columns: ['org_id', 'org_phone'];
681
+ isOneToOne: false;
682
+ referencedRelation: 'tbl_org_phones';
683
+ referencedColumns: ['org_id', 'org_phone'];
684
+ },
685
+ ];
686
+ };
687
+ tbl_chat_properties: {
688
+ Row: {
689
+ assigned_to: string | null;
690
+ chat_access: Json | null;
691
+ chat_id: string;
692
+ chat_org_phones: string[];
693
+ custom_properties: Json | null;
694
+ flag_count_map: Json | null;
695
+ hubspot_metadata: Json | null;
696
+ label_ids: Json | null;
697
+ org_id: string;
698
+ unread_count: Json | null;
699
+ updated_at: string | null;
700
+ };
701
+ Insert: {
702
+ assigned_to?: string | null;
703
+ chat_access?: Json | null;
704
+ chat_id: string;
705
+ chat_org_phones?: string[];
706
+ custom_properties?: Json | null;
707
+ flag_count_map?: Json | null;
708
+ hubspot_metadata?: Json | null;
709
+ label_ids?: Json | null;
710
+ org_id: string;
711
+ unread_count?: Json | null;
712
+ updated_at?: string | null;
713
+ };
714
+ Update: {
715
+ assigned_to?: string | null;
716
+ chat_access?: Json | null;
717
+ chat_id?: string;
718
+ chat_org_phones?: string[];
719
+ custom_properties?: Json | null;
720
+ flag_count_map?: Json | null;
721
+ hubspot_metadata?: Json | null;
722
+ label_ids?: Json | null;
723
+ org_id?: string;
724
+ unread_count?: Json | null;
725
+ updated_at?: string | null;
726
+ };
727
+ Relationships: [];
728
+ };
729
+ tbl_chat_reactions: {
730
+ Row: {
731
+ ack: number | null;
732
+ chat_id: string | null;
733
+ id: Json | null;
734
+ message_id: string;
735
+ msg_id: Json | null;
736
+ org_id: string;
737
+ org_phone: string;
738
+ orphan: number | null;
739
+ orphan_reason: string | null;
740
+ reaction: string | null;
741
+ reaction_id: string;
742
+ read: boolean | null;
743
+ sender_id: string;
744
+ timestamp: string | null;
745
+ unique_id: string | null;
746
+ };
747
+ Insert: {
748
+ ack?: number | null;
749
+ chat_id?: string | null;
750
+ id?: Json | null;
751
+ message_id: string;
752
+ msg_id?: Json | null;
753
+ org_id: string;
754
+ org_phone: string;
755
+ orphan?: number | null;
756
+ orphan_reason?: string | null;
757
+ reaction?: string | null;
758
+ reaction_id: string;
759
+ read?: boolean | null;
760
+ sender_id: string;
761
+ timestamp?: string | null;
762
+ unique_id?: string | null;
763
+ };
764
+ Update: {
765
+ ack?: number | null;
766
+ chat_id?: string | null;
767
+ id?: Json | null;
768
+ message_id?: string;
769
+ msg_id?: Json | null;
770
+ org_id?: string;
771
+ org_phone?: string;
772
+ orphan?: number | null;
773
+ orphan_reason?: string | null;
774
+ reaction?: string | null;
775
+ reaction_id?: string;
776
+ read?: boolean | null;
777
+ sender_id?: string;
778
+ timestamp?: string | null;
779
+ unique_id?: string | null;
780
+ };
781
+ Relationships: [
782
+ {
783
+ foreignKeyName: 'tbl_chat_reactions_fkey_tbl_org_phones';
784
+ columns: ['org_id', 'org_phone'];
785
+ isOneToOne: false;
786
+ referencedRelation: 'tbl_org_phones';
787
+ referencedColumns: ['org_id', 'org_phone'];
788
+ },
789
+ ];
790
+ };
791
+ tbl_chat_tickets: {
792
+ Row: {
793
+ assigned_by: string | null;
794
+ assignee: string | null;
795
+ chat_id: string;
796
+ close_ticket_metadata: Json | null;
797
+ closed_at: string | null;
798
+ created_at: string;
799
+ custom_properties: Json | null;
800
+ due_date: string | null;
801
+ freshdesk_metadata: Json | null;
802
+ hubspot_metadata: Json | null;
803
+ is_deleted: boolean;
804
+ label_ids: Json | null;
805
+ last_updated_at: string;
806
+ org_id: string;
807
+ priority: number | null;
808
+ quoted_message_id: string | null;
809
+ raised_by: string | null;
810
+ response_time: number | null;
811
+ status:
812
+ | Database['public']['Enums']['enum_chat_tickets_status']
813
+ | null;
814
+ subject: string;
815
+ ticket_id: string;
816
+ zohodesk_metadata: Json | null;
817
+ };
818
+ Insert: {
819
+ assigned_by?: string | null;
820
+ assignee?: string | null;
821
+ chat_id: string;
822
+ close_ticket_metadata?: Json | null;
823
+ closed_at?: string | null;
824
+ created_at?: string;
825
+ custom_properties?: Json | null;
826
+ due_date?: string | null;
827
+ freshdesk_metadata?: Json | null;
828
+ hubspot_metadata?: Json | null;
829
+ is_deleted?: boolean;
830
+ label_ids?: Json | null;
831
+ last_updated_at?: string;
832
+ org_id: string;
833
+ priority?: number | null;
834
+ quoted_message_id?: string | null;
835
+ raised_by?: string | null;
836
+ response_time?: number | null;
837
+ status?:
838
+ | Database['public']['Enums']['enum_chat_tickets_status']
839
+ | null;
840
+ subject: string;
841
+ ticket_id?: string;
842
+ zohodesk_metadata?: Json | null;
843
+ };
844
+ Update: {
845
+ assigned_by?: string | null;
846
+ assignee?: string | null;
847
+ chat_id?: string;
848
+ close_ticket_metadata?: Json | null;
849
+ closed_at?: string | null;
850
+ created_at?: string;
851
+ custom_properties?: Json | null;
852
+ due_date?: string | null;
853
+ freshdesk_metadata?: Json | null;
854
+ hubspot_metadata?: Json | null;
855
+ is_deleted?: boolean;
856
+ label_ids?: Json | null;
857
+ last_updated_at?: string;
858
+ org_id?: string;
859
+ priority?: number | null;
860
+ quoted_message_id?: string | null;
861
+ raised_by?: string | null;
862
+ response_time?: number | null;
863
+ status?:
864
+ | Database['public']['Enums']['enum_chat_tickets_status']
865
+ | null;
866
+ subject?: string;
867
+ ticket_id?: string;
868
+ zohodesk_metadata?: Json | null;
869
+ };
870
+ Relationships: [
871
+ {
872
+ foreignKeyName: 'tbl_chat_tickets_org_id_fkey';
873
+ columns: ['org_id'];
874
+ isOneToOne: false;
875
+ referencedRelation: 'tbl_org';
876
+ referencedColumns: ['org_id'];
877
+ },
878
+ {
879
+ foreignKeyName: 'tbl_chat_tickets_org_id_fkey';
880
+ columns: ['org_id'];
881
+ isOneToOne: false;
882
+ referencedRelation: 'view_org';
883
+ referencedColumns: ['org_id'];
884
+ },
885
+ ];
886
+ };
887
+ tbl_chats: {
888
+ Row: {
889
+ archived: boolean | null;
890
+ chat_id: string;
891
+ chat_image: string | null;
892
+ chat_name: string | null;
893
+ chat_type: string | null;
894
+ created_at: string;
895
+ group_metadata: Json | null;
896
+ id: Json | null;
897
+ invite_link: string | null;
898
+ is_group: boolean | null;
899
+ is_muted: boolean | null;
900
+ is_read_only: boolean | null;
901
+ latest_message: Json | null;
902
+ member_count: number | null;
903
+ mute_expiration: number | null;
904
+ name: string | null;
905
+ org_id: string;
906
+ org_phone: string;
907
+ pinned: boolean | null;
908
+ timestamp: string | null;
909
+ unread_count: number | null;
910
+ updated_at: string;
911
+ };
912
+ Insert: {
913
+ archived?: boolean | null;
914
+ chat_id: string;
915
+ chat_image?: string | null;
916
+ chat_name?: string | null;
917
+ chat_type?: string | null;
918
+ created_at?: string;
919
+ group_metadata?: Json | null;
920
+ id?: Json | null;
921
+ invite_link?: string | null;
922
+ is_group?: boolean | null;
923
+ is_muted?: boolean | null;
924
+ is_read_only?: boolean | null;
925
+ latest_message?: Json | null;
926
+ member_count?: number | null;
927
+ mute_expiration?: number | null;
928
+ name?: string | null;
929
+ org_id: string;
930
+ org_phone: string;
931
+ pinned?: boolean | null;
932
+ timestamp?: string | null;
933
+ unread_count?: number | null;
934
+ updated_at?: string;
935
+ };
936
+ Update: {
937
+ archived?: boolean | null;
938
+ chat_id?: string;
939
+ chat_image?: string | null;
940
+ chat_name?: string | null;
941
+ chat_type?: string | null;
942
+ created_at?: string;
943
+ group_metadata?: Json | null;
944
+ id?: Json | null;
945
+ invite_link?: string | null;
946
+ is_group?: boolean | null;
947
+ is_muted?: boolean | null;
948
+ is_read_only?: boolean | null;
949
+ latest_message?: Json | null;
950
+ member_count?: number | null;
951
+ mute_expiration?: number | null;
952
+ name?: string | null;
953
+ org_id?: string;
954
+ org_phone?: string;
955
+ pinned?: boolean | null;
956
+ timestamp?: string | null;
957
+ unread_count?: number | null;
958
+ updated_at?: string;
959
+ };
960
+ Relationships: [
961
+ {
962
+ foreignKeyName: 'fkey_tbl_org_phones';
963
+ columns: ['org_id', 'org_phone'];
964
+ isOneToOne: false;
965
+ referencedRelation: 'tbl_org_phones';
966
+ referencedColumns: ['org_id', 'org_phone'];
967
+ },
968
+ ];
969
+ };
970
+ tbl_contacts: {
971
+ Row: {
972
+ business_profile: Json | null;
973
+ contact_color: Database['public']['Enums']['enum_chat_colors'] | null;
974
+ contact_id: string;
975
+ contact_image: string | null;
976
+ contact_name: string | null;
977
+ contact_type: string | null;
978
+ id: Json | null;
979
+ is_blocked: boolean | null;
980
+ is_business: boolean | null;
981
+ is_enterprise: boolean | null;
982
+ is_group: boolean | null;
983
+ is_imported: boolean | null;
984
+ is_internal: boolean | null;
985
+ is_me: boolean | null;
986
+ is_my_contact: boolean | null;
987
+ is_user: boolean | null;
988
+ is_wa_contact: boolean | null;
989
+ label_ids: Json;
990
+ name: string | null;
991
+ number: string | null;
992
+ org_id: string;
993
+ periskope_name: string | null;
994
+ pushname: string | null;
995
+ short_name: string | null;
996
+ updated_at: string | null;
997
+ verified_level: number | null;
998
+ verified_name: string | null;
999
+ };
1000
+ Insert: {
1001
+ business_profile?: Json | null;
1002
+ contact_color?:
1003
+ | Database['public']['Enums']['enum_chat_colors']
1004
+ | null;
1005
+ contact_id: string;
1006
+ contact_image?: string | null;
1007
+ contact_name?: string | null;
1008
+ contact_type?: string | null;
1009
+ id?: Json | null;
1010
+ is_blocked?: boolean | null;
1011
+ is_business?: boolean | null;
1012
+ is_enterprise?: boolean | null;
1013
+ is_group?: boolean | null;
1014
+ is_imported?: boolean | null;
1015
+ is_internal?: boolean | null;
1016
+ is_me?: boolean | null;
1017
+ is_my_contact?: boolean | null;
1018
+ is_user?: boolean | null;
1019
+ is_wa_contact?: boolean | null;
1020
+ label_ids?: Json;
1021
+ name?: string | null;
1022
+ number?: string | null;
1023
+ org_id: string;
1024
+ periskope_name?: string | null;
1025
+ pushname?: string | null;
1026
+ short_name?: string | null;
1027
+ updated_at?: string | null;
1028
+ verified_level?: number | null;
1029
+ verified_name?: string | null;
1030
+ };
1031
+ Update: {
1032
+ business_profile?: Json | null;
1033
+ contact_color?:
1034
+ | Database['public']['Enums']['enum_chat_colors']
1035
+ | null;
1036
+ contact_id?: string;
1037
+ contact_image?: string | null;
1038
+ contact_name?: string | null;
1039
+ contact_type?: string | null;
1040
+ id?: Json | null;
1041
+ is_blocked?: boolean | null;
1042
+ is_business?: boolean | null;
1043
+ is_enterprise?: boolean | null;
1044
+ is_group?: boolean | null;
1045
+ is_imported?: boolean | null;
1046
+ is_internal?: boolean | null;
1047
+ is_me?: boolean | null;
1048
+ is_my_contact?: boolean | null;
1049
+ is_user?: boolean | null;
1050
+ is_wa_contact?: boolean | null;
1051
+ label_ids?: Json;
1052
+ name?: string | null;
1053
+ number?: string | null;
1054
+ org_id?: string;
1055
+ periskope_name?: string | null;
1056
+ pushname?: string | null;
1057
+ short_name?: string | null;
1058
+ updated_at?: string | null;
1059
+ verified_level?: number | null;
1060
+ verified_name?: string | null;
1061
+ };
1062
+ Relationships: [
1063
+ {
1064
+ foreignKeyName: 'tbl_contacts_org_id_fkey';
1065
+ columns: ['org_id'];
1066
+ isOneToOne: false;
1067
+ referencedRelation: 'tbl_org';
1068
+ referencedColumns: ['org_id'];
1069
+ },
1070
+ {
1071
+ foreignKeyName: 'tbl_contacts_org_id_fkey';
1072
+ columns: ['org_id'];
1073
+ isOneToOne: false;
1074
+ referencedRelation: 'view_org';
1075
+ referencedColumns: ['org_id'];
1076
+ },
1077
+ ];
1078
+ };
1079
+ tbl_custom_properties: {
1080
+ Row: {
1081
+ created_at: string;
1082
+ created_by: string | null;
1083
+ org_id: string | null;
1084
+ property_id: string;
1085
+ property_name: string;
1086
+ property_value: Json | null;
1087
+ property_value_type: string | null;
1088
+ type: string | null;
1089
+ };
1090
+ Insert: {
1091
+ created_at?: string;
1092
+ created_by?: string | null;
1093
+ org_id?: string | null;
1094
+ property_id?: string;
1095
+ property_name: string;
1096
+ property_value?: Json | null;
1097
+ property_value_type?: string | null;
1098
+ type?: string | null;
1099
+ };
1100
+ Update: {
1101
+ created_at?: string;
1102
+ created_by?: string | null;
1103
+ org_id?: string | null;
1104
+ property_id?: string;
1105
+ property_name?: string;
1106
+ property_value?: Json | null;
1107
+ property_value_type?: string | null;
1108
+ type?: string | null;
1109
+ };
1110
+ Relationships: [
1111
+ {
1112
+ foreignKeyName: 'tbl_custom_properties_org_id_fkey';
1113
+ columns: ['org_id'];
1114
+ isOneToOne: false;
1115
+ referencedRelation: 'tbl_org';
1116
+ referencedColumns: ['org_id'];
1117
+ },
1118
+ {
1119
+ foreignKeyName: 'tbl_custom_properties_org_id_fkey';
1120
+ columns: ['org_id'];
1121
+ isOneToOne: false;
1122
+ referencedRelation: 'view_org';
1123
+ referencedColumns: ['org_id'];
1124
+ },
1125
+ ];
1126
+ };
1127
+ tbl_integration_hooks: {
1128
+ Row: {
1129
+ hook_url: string;
1130
+ id: string;
1131
+ integration_id: string | null;
1132
+ integration_metadata: Json;
1133
+ integration_name: Database['public']['Enums']['enum_integration_name'];
1134
+ integration_type: string;
1135
+ is_subscribed: boolean;
1136
+ org_id: string;
1137
+ subscribed_at: string;
1138
+ type: Database['public']['Enums']['enum_integration_type'];
1139
+ };
1140
+ Insert: {
1141
+ hook_url: string;
1142
+ id?: string;
1143
+ integration_id?: string | null;
1144
+ integration_metadata: Json;
1145
+ integration_name: Database['public']['Enums']['enum_integration_name'];
1146
+ integration_type: string;
1147
+ is_subscribed: boolean;
1148
+ org_id: string;
1149
+ subscribed_at?: string;
1150
+ type: Database['public']['Enums']['enum_integration_type'];
1151
+ };
1152
+ Update: {
1153
+ hook_url?: string;
1154
+ id?: string;
1155
+ integration_id?: string | null;
1156
+ integration_metadata?: Json;
1157
+ integration_name?: Database['public']['Enums']['enum_integration_name'];
1158
+ integration_type?: string;
1159
+ is_subscribed?: boolean;
1160
+ org_id?: string;
1161
+ subscribed_at?: string;
1162
+ type?: Database['public']['Enums']['enum_integration_type'];
1163
+ };
1164
+ Relationships: [
1165
+ {
1166
+ foreignKeyName: 'tbl_integration_hooks_org_id_fkey';
1167
+ columns: ['org_id'];
1168
+ isOneToOne: false;
1169
+ referencedRelation: 'tbl_org';
1170
+ referencedColumns: ['org_id'];
1171
+ },
1172
+ {
1173
+ foreignKeyName: 'tbl_integration_hooks_org_id_fkey';
1174
+ columns: ['org_id'];
1175
+ isOneToOne: false;
1176
+ referencedRelation: 'view_org';
1177
+ referencedColumns: ['org_id'];
1178
+ },
1179
+ ];
1180
+ };
1181
+ tbl_integration_logs: {
1182
+ Row: {
1183
+ created_at: string;
1184
+ id: string;
1185
+ integration_name: Database['public']['Enums']['enum_integration_name'];
1186
+ integration_type: string;
1187
+ metadata: Json;
1188
+ org_id: string;
1189
+ response: Json | null;
1190
+ success: boolean;
1191
+ type: Database['public']['Enums']['enum_integration_type'];
1192
+ };
1193
+ Insert: {
1194
+ created_at?: string;
1195
+ id?: string;
1196
+ integration_name: Database['public']['Enums']['enum_integration_name'];
1197
+ integration_type: string;
1198
+ metadata?: Json;
1199
+ org_id: string;
1200
+ response?: Json | null;
1201
+ success?: boolean;
1202
+ type: Database['public']['Enums']['enum_integration_type'];
1203
+ };
1204
+ Update: {
1205
+ created_at?: string;
1206
+ id?: string;
1207
+ integration_name?: Database['public']['Enums']['enum_integration_name'];
1208
+ integration_type?: string;
1209
+ metadata?: Json;
1210
+ org_id?: string;
1211
+ response?: Json | null;
1212
+ success?: boolean;
1213
+ type?: Database['public']['Enums']['enum_integration_type'];
1214
+ };
1215
+ Relationships: [
1216
+ {
1217
+ foreignKeyName: 'tbl_integration_logs_org_id_fkey';
1218
+ columns: ['org_id'];
1219
+ isOneToOne: false;
1220
+ referencedRelation: 'tbl_org';
1221
+ referencedColumns: ['org_id'];
1222
+ },
1223
+ {
1224
+ foreignKeyName: 'tbl_integration_logs_org_id_fkey';
1225
+ columns: ['org_id'];
1226
+ isOneToOne: false;
1227
+ referencedRelation: 'view_org';
1228
+ referencedColumns: ['org_id'];
1229
+ },
1230
+ ];
1231
+ };
1232
+ tbl_integration_tokens: {
1233
+ Row: {
1234
+ exp: string;
1235
+ iat: string;
1236
+ id: string;
1237
+ is_revealed: boolean;
1238
+ name: string;
1239
+ org_id: string;
1240
+ role: string;
1241
+ token: string;
1242
+ token_metadata: Json | null;
1243
+ type: Database['public']['Enums']['enum_integration_type'];
1244
+ };
1245
+ Insert: {
1246
+ exp: string;
1247
+ iat: string;
1248
+ id?: string;
1249
+ is_revealed?: boolean;
1250
+ name: string;
1251
+ org_id: string;
1252
+ role: string;
1253
+ token: string;
1254
+ token_metadata?: Json | null;
1255
+ type: Database['public']['Enums']['enum_integration_type'];
1256
+ };
1257
+ Update: {
1258
+ exp?: string;
1259
+ iat?: string;
1260
+ id?: string;
1261
+ is_revealed?: boolean;
1262
+ name?: string;
1263
+ org_id?: string;
1264
+ role?: string;
1265
+ token?: string;
1266
+ token_metadata?: Json | null;
1267
+ type?: Database['public']['Enums']['enum_integration_type'];
1268
+ };
1269
+ Relationships: [
1270
+ {
1271
+ foreignKeyName: 'public_tbl_integration_tokens_org_id_fkey';
1272
+ columns: ['org_id'];
1273
+ isOneToOne: false;
1274
+ referencedRelation: 'tbl_org';
1275
+ referencedColumns: ['org_id'];
1276
+ },
1277
+ {
1278
+ foreignKeyName: 'public_tbl_integration_tokens_org_id_fkey';
1279
+ columns: ['org_id'];
1280
+ isOneToOne: false;
1281
+ referencedRelation: 'view_org';
1282
+ referencedColumns: ['org_id'];
1283
+ },
1284
+ ];
1285
+ };
1286
+ tbl_org: {
1287
+ Row: {
1288
+ created_at: string;
1289
+ org_id: string;
1290
+ org_image: string | null;
1291
+ org_metadata: Json | null;
1292
+ org_name: string | null;
1293
+ org_plan: Json | null;
1294
+ stripe_customer_details: Json | null;
1295
+ stripe_customer_id: string | null;
1296
+ stripe_subscription_details: Json | null;
1297
+ support_link: string | null;
1298
+ };
1299
+ Insert: {
1300
+ created_at?: string;
1301
+ org_id?: string;
1302
+ org_image?: string | null;
1303
+ org_metadata?: Json | null;
1304
+ org_name?: string | null;
1305
+ org_plan?: Json | null;
1306
+ stripe_customer_details?: Json | null;
1307
+ stripe_customer_id?: string | null;
1308
+ stripe_subscription_details?: Json | null;
1309
+ support_link?: string | null;
1310
+ };
1311
+ Update: {
1312
+ created_at?: string;
1313
+ org_id?: string;
1314
+ org_image?: string | null;
1315
+ org_metadata?: Json | null;
1316
+ org_name?: string | null;
1317
+ org_plan?: Json | null;
1318
+ stripe_customer_details?: Json | null;
1319
+ stripe_customer_id?: string | null;
1320
+ stripe_subscription_details?: Json | null;
1321
+ support_link?: string | null;
1322
+ };
1323
+ Relationships: [];
1324
+ };
1325
+ tbl_org_labels: {
1326
+ Row: {
1327
+ color: string;
1328
+ created_at: string;
1329
+ label_id: string;
1330
+ name: string;
1331
+ org_id: string;
1332
+ type: string;
1333
+ };
1334
+ Insert: {
1335
+ color?: string;
1336
+ created_at?: string;
1337
+ label_id?: string;
1338
+ name: string;
1339
+ org_id: string;
1340
+ type?: string;
1341
+ };
1342
+ Update: {
1343
+ color?: string;
1344
+ created_at?: string;
1345
+ label_id?: string;
1346
+ name?: string;
1347
+ org_id?: string;
1348
+ type?: string;
1349
+ };
1350
+ Relationships: [
1351
+ {
1352
+ foreignKeyName: 'tbl_org_labels_org_id_fkey';
1353
+ columns: ['org_id'];
1354
+ isOneToOne: false;
1355
+ referencedRelation: 'tbl_org';
1356
+ referencedColumns: ['org_id'];
1357
+ },
1358
+ {
1359
+ foreignKeyName: 'tbl_org_labels_org_id_fkey';
1360
+ columns: ['org_id'];
1361
+ isOneToOne: false;
1362
+ referencedRelation: 'view_org';
1363
+ referencedColumns: ['org_id'];
1364
+ },
1365
+ ];
1366
+ };
1367
+ tbl_org_members: {
1368
+ Row: {
1369
+ created_at: string | null;
1370
+ email: string;
1371
+ invited_at: string | null;
1372
+ invited_by: string | null;
1373
+ is_active: boolean;
1374
+ is_owner: boolean | null;
1375
+ label_ids: string[] | null;
1376
+ member_color: Database['public']['Enums']['enum_chat_colors'];
1377
+ member_image: string | null;
1378
+ member_name: string | null;
1379
+ org_id: string;
1380
+ org_phones: string[] | null;
1381
+ preferences: Json;
1382
+ role: Database['public']['Enums']['enum_member_role'];
1383
+ user_id: string | null;
1384
+ };
1385
+ Insert: {
1386
+ created_at?: string | null;
1387
+ email: string;
1388
+ invited_at?: string | null;
1389
+ invited_by?: string | null;
1390
+ is_active?: boolean;
1391
+ is_owner?: boolean | null;
1392
+ label_ids?: string[] | null;
1393
+ member_color?: Database['public']['Enums']['enum_chat_colors'];
1394
+ member_image?: string | null;
1395
+ member_name?: string | null;
1396
+ org_id: string;
1397
+ org_phones?: string[] | null;
1398
+ preferences?: Json;
1399
+ role?: Database['public']['Enums']['enum_member_role'];
1400
+ user_id?: string | null;
1401
+ };
1402
+ Update: {
1403
+ created_at?: string | null;
1404
+ email?: string;
1405
+ invited_at?: string | null;
1406
+ invited_by?: string | null;
1407
+ is_active?: boolean;
1408
+ is_owner?: boolean | null;
1409
+ label_ids?: string[] | null;
1410
+ member_color?: Database['public']['Enums']['enum_chat_colors'];
1411
+ member_image?: string | null;
1412
+ member_name?: string | null;
1413
+ org_id?: string;
1414
+ org_phones?: string[] | null;
1415
+ preferences?: Json;
1416
+ role?: Database['public']['Enums']['enum_member_role'];
1417
+ user_id?: string | null;
1418
+ };
1419
+ Relationships: [
1420
+ {
1421
+ foreignKeyName: 'tbl_org_members_fkey_auth_users';
1422
+ columns: ['user_id'];
1423
+ isOneToOne: false;
1424
+ referencedRelation: 'users';
1425
+ referencedColumns: ['id'];
1426
+ },
1427
+ {
1428
+ foreignKeyName: 'tbl_org_members_fkey_tbl_org';
1429
+ columns: ['org_id'];
1430
+ isOneToOne: false;
1431
+ referencedRelation: 'tbl_org';
1432
+ referencedColumns: ['org_id'];
1433
+ },
1434
+ {
1435
+ foreignKeyName: 'tbl_org_members_fkey_tbl_org';
1436
+ columns: ['org_id'];
1437
+ isOneToOne: false;
1438
+ referencedRelation: 'view_org';
1439
+ referencedColumns: ['org_id'];
1440
+ },
1441
+ ];
1442
+ };
1443
+ tbl_org_phones: {
1444
+ Row: {
1445
+ created_at: string;
1446
+ first_connected_at: string | null;
1447
+ is_browser_open: boolean;
1448
+ is_ready: boolean | null;
1449
+ legacy_version: boolean | null;
1450
+ library: string | null;
1451
+ org_id: string;
1452
+ org_phone: string | null;
1453
+ phone_id: string;
1454
+ phone_image: string | null;
1455
+ phone_name: string | null;
1456
+ phone_state: Json | null;
1457
+ qr_code: string | null;
1458
+ server_image: string | null;
1459
+ server_ip: string | null;
1460
+ soft_restart: boolean;
1461
+ updated_at: string | null;
1462
+ wa_state: string | null;
1463
+ wa_version: string | null;
1464
+ };
1465
+ Insert: {
1466
+ created_at?: string;
1467
+ first_connected_at?: string | null;
1468
+ is_browser_open?: boolean;
1469
+ is_ready?: boolean | null;
1470
+ legacy_version?: boolean | null;
1471
+ library?: string | null;
1472
+ org_id: string;
1473
+ org_phone?: string | null;
1474
+ phone_id?: string;
1475
+ phone_image?: string | null;
1476
+ phone_name?: string | null;
1477
+ phone_state?: Json | null;
1478
+ qr_code?: string | null;
1479
+ server_image?: string | null;
1480
+ server_ip?: string | null;
1481
+ soft_restart?: boolean;
1482
+ updated_at?: string | null;
1483
+ wa_state?: string | null;
1484
+ wa_version?: string | null;
1485
+ };
1486
+ Update: {
1487
+ created_at?: string;
1488
+ first_connected_at?: string | null;
1489
+ is_browser_open?: boolean;
1490
+ is_ready?: boolean | null;
1491
+ legacy_version?: boolean | null;
1492
+ library?: string | null;
1493
+ org_id?: string;
1494
+ org_phone?: string | null;
1495
+ phone_id?: string;
1496
+ phone_image?: string | null;
1497
+ phone_name?: string | null;
1498
+ phone_state?: Json | null;
1499
+ qr_code?: string | null;
1500
+ server_image?: string | null;
1501
+ server_ip?: string | null;
1502
+ soft_restart?: boolean;
1503
+ updated_at?: string | null;
1504
+ wa_state?: string | null;
1505
+ wa_version?: string | null;
1506
+ };
1507
+ Relationships: [
1508
+ {
1509
+ foreignKeyName: 'tbl_org_phones_fkey_tbl_org';
1510
+ columns: ['org_id'];
1511
+ isOneToOne: false;
1512
+ referencedRelation: 'tbl_org';
1513
+ referencedColumns: ['org_id'];
1514
+ },
1515
+ {
1516
+ foreignKeyName: 'tbl_org_phones_fkey_tbl_org';
1517
+ columns: ['org_id'];
1518
+ isOneToOne: false;
1519
+ referencedRelation: 'view_org';
1520
+ referencedColumns: ['org_id'];
1521
+ },
1522
+ {
1523
+ foreignKeyName: 'tbl_org_phones_org_id_fkey';
1524
+ columns: ['org_id'];
1525
+ isOneToOne: false;
1526
+ referencedRelation: 'tbl_org';
1527
+ referencedColumns: ['org_id'];
1528
+ },
1529
+ {
1530
+ foreignKeyName: 'tbl_org_phones_org_id_fkey';
1531
+ columns: ['org_id'];
1532
+ isOneToOne: false;
1533
+ referencedRelation: 'view_org';
1534
+ referencedColumns: ['org_id'];
1535
+ },
1536
+ ];
1537
+ };
1538
+ tbl_quick_replies: {
1539
+ Row: {
1540
+ command: string | null;
1541
+ created_at: string;
1542
+ message_payload: Json | null;
1543
+ org_id: string;
1544
+ reply_id: string;
1545
+ };
1546
+ Insert: {
1547
+ command?: string | null;
1548
+ created_at?: string;
1549
+ message_payload?: Json | null;
1550
+ org_id: string;
1551
+ reply_id?: string;
1552
+ };
1553
+ Update: {
1554
+ command?: string | null;
1555
+ created_at?: string;
1556
+ message_payload?: Json | null;
1557
+ org_id?: string;
1558
+ reply_id?: string;
1559
+ };
1560
+ Relationships: [
1561
+ {
1562
+ foreignKeyName: 'tbl_quick_replies_org_id_fkey';
1563
+ columns: ['org_id'];
1564
+ isOneToOne: false;
1565
+ referencedRelation: 'tbl_org';
1566
+ referencedColumns: ['org_id'];
1567
+ },
1568
+ {
1569
+ foreignKeyName: 'tbl_quick_replies_org_id_fkey';
1570
+ columns: ['org_id'];
1571
+ isOneToOne: false;
1572
+ referencedRelation: 'view_org';
1573
+ referencedColumns: ['org_id'];
1574
+ },
1575
+ ];
1576
+ };
1577
+ tbl_scheduled_messages: {
1578
+ Row: {
1579
+ chat_id: string;
1580
+ created_at: string;
1581
+ message_id: string | null;
1582
+ message_payload: Json | null;
1583
+ org_id: string;
1584
+ org_phone: string | null;
1585
+ performed_by: string | null;
1586
+ scheduled_at: string;
1587
+ sent_message_id: string;
1588
+ status: boolean | null;
1589
+ updated_at: string | null;
1590
+ };
1591
+ Insert: {
1592
+ chat_id: string;
1593
+ created_at?: string;
1594
+ message_id?: string | null;
1595
+ message_payload?: Json | null;
1596
+ org_id: string;
1597
+ org_phone?: string | null;
1598
+ performed_by?: string | null;
1599
+ scheduled_at: string;
1600
+ sent_message_id: string;
1601
+ status?: boolean | null;
1602
+ updated_at?: string | null;
1603
+ };
1604
+ Update: {
1605
+ chat_id?: string;
1606
+ created_at?: string;
1607
+ message_id?: string | null;
1608
+ message_payload?: Json | null;
1609
+ org_id?: string;
1610
+ org_phone?: string | null;
1611
+ performed_by?: string | null;
1612
+ scheduled_at?: string;
1613
+ sent_message_id?: string;
1614
+ status?: boolean | null;
1615
+ updated_at?: string | null;
1616
+ };
1617
+ Relationships: [
1618
+ {
1619
+ foreignKeyName: 'tbl_scheduled_messages_org_id_fkey';
1620
+ columns: ['org_id'];
1621
+ isOneToOne: false;
1622
+ referencedRelation: 'tbl_org';
1623
+ referencedColumns: ['org_id'];
1624
+ },
1625
+ {
1626
+ foreignKeyName: 'tbl_scheduled_messages_org_id_fkey';
1627
+ columns: ['org_id'];
1628
+ isOneToOne: false;
1629
+ referencedRelation: 'view_org';
1630
+ referencedColumns: ['org_id'];
1631
+ },
1632
+ ];
1633
+ };
1634
+ tbl_tools_whatsapp_links: {
1635
+ Row: {
1636
+ created_at: string;
1637
+ link_id: string;
1638
+ link_name: string;
1639
+ message: string | null;
1640
+ phone: string;
1641
+ };
1642
+ Insert: {
1643
+ created_at?: string;
1644
+ link_id?: string;
1645
+ link_name: string;
1646
+ message?: string | null;
1647
+ phone: string;
1648
+ };
1649
+ Update: {
1650
+ created_at?: string;
1651
+ link_id?: string;
1652
+ link_name?: string;
1653
+ message?: string | null;
1654
+ phone?: string;
1655
+ };
1656
+ Relationships: [];
1657
+ };
1658
+ };
1659
+ Views: {
1660
+ view_broadcast_logs: {
1661
+ Row: {
1662
+ broadcast_id: string | null;
1663
+ broadcast_status:
1664
+ | Database['public']['Enums']['enum_broadcast_status']
1665
+ | null;
1666
+ created_at: string | null;
1667
+ delivery_percentage: number | null;
1668
+ failed_chats: number | null;
1669
+ message_payload: Json | null;
1670
+ org_id: string | null;
1671
+ pending_chats: number | null;
1672
+ performed_at: string | null;
1673
+ performed_by: string | null;
1674
+ read_percentage: number | null;
1675
+ scheduled_at: string | null;
1676
+ sent_chats: number | null;
1677
+ total_chats: number | null;
1678
+ total_delivered_count: number | null;
1679
+ total_member_count: number | null;
1680
+ total_read_count: number | null;
1681
+ };
1682
+ Relationships: [
1683
+ {
1684
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
1685
+ columns: ['org_id'];
1686
+ isOneToOne: false;
1687
+ referencedRelation: 'tbl_org';
1688
+ referencedColumns: ['org_id'];
1689
+ },
1690
+ {
1691
+ foreignKeyName: 'tbl_broadcast_messages_org_id_fkey';
1692
+ columns: ['org_id'];
1693
+ isOneToOne: false;
1694
+ referencedRelation: 'view_org';
1695
+ referencedColumns: ['org_id'];
1696
+ },
1697
+ ];
1698
+ };
1699
+ view_chat_logs: {
1700
+ Row: {
1701
+ action: string | null;
1702
+ failed: number | null;
1703
+ operation_id: string | null;
1704
+ org_id: string | null;
1705
+ pending: number | null;
1706
+ performed_at: string | null;
1707
+ performed_by: string | null;
1708
+ success: number | null;
1709
+ total_chats: number | null;
1710
+ total_logs: number | null;
1711
+ total_participants: number | null;
1712
+ };
1713
+ Relationships: [
1714
+ {
1715
+ foreignKeyName: 'tbl_chat_logs_org_id_fkey';
1716
+ columns: ['org_id'];
1717
+ isOneToOne: false;
1718
+ referencedRelation: 'tbl_org';
1719
+ referencedColumns: ['org_id'];
1720
+ },
1721
+ {
1722
+ foreignKeyName: 'tbl_chat_logs_org_id_fkey';
1723
+ columns: ['org_id'];
1724
+ isOneToOne: false;
1725
+ referencedRelation: 'view_org';
1726
+ referencedColumns: ['org_id'];
1727
+ },
1728
+ ];
1729
+ };
1730
+ view_chats: {
1731
+ Row: {
1732
+ assigned_to: string | null;
1733
+ chat_access: Json | null;
1734
+ chat_id: string | null;
1735
+ chat_image: string | null;
1736
+ chat_name: string | null;
1737
+ chat_org_phones: string[] | null;
1738
+ chat_type: string | null;
1739
+ created_at: string | null;
1740
+ custom_properties: Json | null;
1741
+ flag_count: number | null;
1742
+ flag_count_map: Json | null;
1743
+ group_description: string | null;
1744
+ hubspot_metadata: Json | null;
1745
+ info_admins_only: boolean | null;
1746
+ invite_link: string | null;
1747
+ is_archived: boolean | null;
1748
+ is_muted: boolean | null;
1749
+ label_ids: Json | null;
1750
+ last_read_timestamp: string | null;
1751
+ latest_message: Json | null;
1752
+ member_count: number | null;
1753
+ message_unread_count: number | null;
1754
+ messages_admins_only: boolean | null;
1755
+ org_id: string | null;
1756
+ org_phone: string | null;
1757
+ updated_at: string | null;
1758
+ };
1759
+ Relationships: [];
1760
+ };
1761
+ view_org: {
1762
+ Row: {
1763
+ access_scopes: Json | null;
1764
+ created_at: string | null;
1765
+ is_enterprise: boolean | null;
1766
+ is_free_trial: boolean | null;
1767
+ is_freshdesk_connected: boolean | null;
1768
+ is_hubspot_connected: boolean | null;
1769
+ is_zohodesk_connected: boolean | null;
1770
+ org_id: string | null;
1771
+ org_image: string | null;
1772
+ org_metadata: Json | null;
1773
+ org_name: string | null;
1774
+ org_plan: Json | null;
1775
+ pending_days: number | null;
1776
+ phone_limit: string | null;
1777
+ plan_id: string | null;
1778
+ stripe_customer_details: Json | null;
1779
+ stripe_customer_id: string | null;
1780
+ stripe_subscription_details: Json | null;
1781
+ subscription_status: string | null;
1782
+ support_link: string | null;
1783
+ user_limit: string | null;
1784
+ };
1785
+ Insert: {
1786
+ access_scopes?: never;
1787
+ created_at?: string | null;
1788
+ is_enterprise?: never;
1789
+ is_free_trial?: never;
1790
+ is_freshdesk_connected?: never;
1791
+ is_hubspot_connected?: never;
1792
+ is_zohodesk_connected?: never;
1793
+ org_id?: string | null;
1794
+ org_image?: string | null;
1795
+ org_metadata?: Json | null;
1796
+ org_name?: string | null;
1797
+ org_plan?: Json | null;
1798
+ pending_days?: never;
1799
+ phone_limit?: never;
1800
+ plan_id?: never;
1801
+ stripe_customer_details?: Json | null;
1802
+ stripe_customer_id?: string | null;
1803
+ stripe_subscription_details?: Json | null;
1804
+ subscription_status?: never;
1805
+ support_link?: string | null;
1806
+ user_limit?: never;
1807
+ };
1808
+ Update: {
1809
+ access_scopes?: never;
1810
+ created_at?: string | null;
1811
+ is_enterprise?: never;
1812
+ is_free_trial?: never;
1813
+ is_freshdesk_connected?: never;
1814
+ is_hubspot_connected?: never;
1815
+ is_zohodesk_connected?: never;
1816
+ org_id?: string | null;
1817
+ org_image?: string | null;
1818
+ org_metadata?: Json | null;
1819
+ org_name?: string | null;
1820
+ org_plan?: Json | null;
1821
+ pending_days?: never;
1822
+ phone_limit?: never;
1823
+ plan_id?: never;
1824
+ stripe_customer_details?: Json | null;
1825
+ stripe_customer_id?: string | null;
1826
+ stripe_subscription_details?: Json | null;
1827
+ subscription_status?: never;
1828
+ support_link?: string | null;
1829
+ user_limit?: never;
1830
+ };
1831
+ Relationships: [];
1832
+ };
1833
+ };
1834
+ Functions: {
1835
+ create_partition: {
1836
+ Args: {
1837
+ org_id_input: string;
1838
+ };
1839
+ Returns: boolean;
1840
+ };
1841
+ custom_access_token_hook: {
1842
+ Args: {
1843
+ event: Json;
1844
+ };
1845
+ Returns: Json;
1846
+ };
1847
+ drop_partition: {
1848
+ Args: {
1849
+ org_id_input: string;
1850
+ };
1851
+ Returns: boolean;
1852
+ };
1853
+ gen_id: {
1854
+ Args: {
1855
+ prefix: string;
1856
+ size?: number;
1857
+ alphabet?: string;
1858
+ };
1859
+ Returns: string;
1860
+ };
1861
+ gen_ticket_id: {
1862
+ Args: {
1863
+ org_id_input: string;
1864
+ };
1865
+ Returns: string;
1866
+ };
1867
+ generate_access_token: {
1868
+ Args: {
1869
+ name_input?: string;
1870
+ type_input?: Database['public']['Enums']['enum_integration_type'];
1871
+ org_id_input?: string;
1872
+ };
1873
+ Returns: Json;
1874
+ };
1875
+ get_api_auth_details: {
1876
+ Args: {
1877
+ org_id_input?: string;
1878
+ org_phone_input?: string;
1879
+ token_id_input?: string;
1880
+ token_type_input?: Database['public']['Enums']['enum_integration_type'];
1881
+ };
1882
+ Returns: Json;
1883
+ };
1884
+ get_chat_labels_data: {
1885
+ Args: {
1886
+ org_id_input: string;
1887
+ chat_ids_input?: string[];
1888
+ };
1889
+ Returns: Json[];
1890
+ };
1891
+ get_chats: {
1892
+ Args: {
1893
+ org_id_input: string;
1894
+ chat_id_input?: string[];
1895
+ with_members?: boolean;
1896
+ last_updated_at?: string;
1897
+ };
1898
+ Returns: Json;
1899
+ };
1900
+ get_chats_info: {
1901
+ Args: {
1902
+ chat_id_input: string;
1903
+ org_id_input: string;
1904
+ org_phone_input?: string;
1905
+ };
1906
+ Returns: Json;
1907
+ };
1908
+ get_contacts: {
1909
+ Args: {
1910
+ org_id_input: string;
1911
+ contact_ids_input?: string[];
1912
+ sync_phone_contacts?: boolean;
1913
+ search_input?: string;
1914
+ label_ids_input?: string[];
1915
+ is_internal_input?: boolean;
1916
+ offset_input?: number;
1917
+ limit_input?: number;
1918
+ };
1919
+ Returns: Json;
1920
+ };
1921
+ get_export_chats_data: {
1922
+ Args: {
1923
+ org_id_input: string;
1924
+ chat_id_input?: string[];
1925
+ };
1926
+ Returns: Json;
1927
+ };
1928
+ get_export_tickets_data: {
1929
+ Args: {
1930
+ org_id_input: string;
1931
+ ticket_id_input?: string[];
1932
+ };
1933
+ Returns: Json;
1934
+ };
1935
+ get_integration_data: {
1936
+ Args: {
1937
+ org_id_input?: string;
1938
+ };
1939
+ Returns: Json;
1940
+ };
1941
+ get_messages_notifications_reactions: {
1942
+ Args: {
1943
+ org_id_input: string;
1944
+ chat_id_input?: string[];
1945
+ limit_input?: number;
1946
+ offset_input?: number;
1947
+ };
1948
+ Returns: Json;
1949
+ };
1950
+ get_org: {
1951
+ Args: {
1952
+ org_id_input?: string;
1953
+ };
1954
+ Returns: Json;
1955
+ };
1956
+ get_org_phones: {
1957
+ Args: {
1958
+ org_id_input?: string;
1959
+ phone_id_input?: string;
1960
+ };
1961
+ Returns: Json;
1962
+ };
1963
+ get_team_metrics_between_dates: {
1964
+ Args: {
1965
+ org_id_input: string;
1966
+ start_date: string;
1967
+ end_date: string;
1968
+ chat_id_input?: string[];
1969
+ };
1970
+ Returns: Json;
1971
+ };
1972
+ get_ticket_info: {
1973
+ Args: {
1974
+ ticket_id_input?: string;
1975
+ org_id_input?: string;
1976
+ chat_id_input?: string;
1977
+ unique_message_id_input?: string;
1978
+ };
1979
+ Returns: Json;
1980
+ };
1981
+ get_universal_search_result: {
1982
+ Args: {
1983
+ search_category_input: string;
1984
+ search_query_input: string;
1985
+ org_id_input: string;
1986
+ };
1987
+ Returns: {
1988
+ category: string;
1989
+ result: Json;
1990
+ }[];
1991
+ };
1992
+ image_path: {
1993
+ Args: {
1994
+ path_input?: string;
1995
+ bucket_name?: string;
1996
+ req_base?: boolean;
1997
+ };
1998
+ Returns: string;
1999
+ };
2000
+ list_org_from_user: {
2001
+ Args: Record<PropertyKey, never>;
2002
+ Returns: string[];
2003
+ };
2004
+ list_role_from_user: {
2005
+ Args: Record<PropertyKey, never>;
2006
+ Returns: Database['public']['Enums']['enum_member_role'];
2007
+ };
2008
+ update_chat_properties: {
2009
+ Args: {
2010
+ column_name: string;
2011
+ org_id_input: string;
2012
+ chat_id_input: string[];
2013
+ key_input: string;
2014
+ value_input: Json;
2015
+ };
2016
+ Returns: undefined;
2017
+ };
2018
+ update_custom_properties: {
2019
+ Args: {
2020
+ org_id_input: string;
2021
+ row_properties_map: Json;
2022
+ replace_properties?: boolean;
2023
+ };
2024
+ Returns: undefined;
2025
+ };
2026
+ update_labels: {
2027
+ Args: {
2028
+ org_id_input: string;
2029
+ tbl_type: string;
2030
+ row_label_map: Json;
2031
+ replace_labels?: boolean;
2032
+ };
2033
+ Returns: undefined;
2034
+ };
2035
+ };
2036
+ Enums: {
2037
+ enum_broadcast_status: 'inprogress' | 'completed' | 'stopped';
2038
+ enum_chat_colors:
2039
+ | '#B4876E'
2040
+ | '#A5B337'
2041
+ | '#06CF9C'
2042
+ | '#25D366'
2043
+ | '#02A698'
2044
+ | '#7D9EF1'
2045
+ | '#007BFC'
2046
+ | '#5E47DE'
2047
+ | '#7F66FF'
2048
+ | '#9333EA'
2049
+ | '#FA6533'
2050
+ | '#C4532D'
2051
+ | '#DC2626'
2052
+ | '#FF2E74'
2053
+ | '#DB2777';
2054
+ enum_chat_tickets_status: 'open' | 'inprogress' | 'closed' | 'archived';
2055
+ enum_integration_name:
2056
+ | 'org.created'
2057
+ | 'org.updated'
2058
+ | 'org.member.created'
2059
+ | 'org.member.updated'
2060
+ | 'org.phone.created'
2061
+ | 'org.phone.connected'
2062
+ | 'org.phone.disconnected'
2063
+ | 'org.subscription.trial_will_end'
2064
+ | 'chat.created'
2065
+ | 'chat.updated'
2066
+ | 'chat.notification.created'
2067
+ | 'message.created'
2068
+ | 'message.updated'
2069
+ | 'message.deleted'
2070
+ | 'message.ack.updated'
2071
+ | 'reaction.created'
2072
+ | 'reaction.updated'
2073
+ | 'ticket.created'
2074
+ | 'ticket.updated'
2075
+ | 'ticket.deleted'
2076
+ | 'org.integrations.updated';
2077
+ enum_integration_type:
2078
+ | 'zapier'
2079
+ | 'pabbly'
2080
+ | 'api'
2081
+ | 'webhook'
2082
+ | 'hubspot'
2083
+ | 'freshdesk'
2084
+ | 'slack'
2085
+ | 'jira'
2086
+ | 'salesforce'
2087
+ | 'zohodesk'
2088
+ | 'gsheets';
2089
+ enum_member_role: 'admin' | 'member';
2090
+ };
2091
+ CompositeTypes: {
2092
+ [_ in never]: never;
2093
+ };
2094
+ };
2095
+ storage: {
2096
+ Tables: {
2097
+ buckets: {
2098
+ Row: {
2099
+ allowed_mime_types: string[] | null;
2100
+ avif_autodetection: boolean | null;
2101
+ created_at: string | null;
2102
+ file_size_limit: number | null;
2103
+ id: string;
2104
+ name: string;
2105
+ owner: string | null;
2106
+ owner_id: string | null;
2107
+ public: boolean | null;
2108
+ updated_at: string | null;
2109
+ };
2110
+ Insert: {
2111
+ allowed_mime_types?: string[] | null;
2112
+ avif_autodetection?: boolean | null;
2113
+ created_at?: string | null;
2114
+ file_size_limit?: number | null;
2115
+ id: string;
2116
+ name: string;
2117
+ owner?: string | null;
2118
+ owner_id?: string | null;
2119
+ public?: boolean | null;
2120
+ updated_at?: string | null;
2121
+ };
2122
+ Update: {
2123
+ allowed_mime_types?: string[] | null;
2124
+ avif_autodetection?: boolean | null;
2125
+ created_at?: string | null;
2126
+ file_size_limit?: number | null;
2127
+ id?: string;
2128
+ name?: string;
2129
+ owner?: string | null;
2130
+ owner_id?: string | null;
2131
+ public?: boolean | null;
2132
+ updated_at?: string | null;
2133
+ };
2134
+ Relationships: [];
2135
+ };
2136
+ migrations: {
2137
+ Row: {
2138
+ executed_at: string | null;
2139
+ hash: string;
2140
+ id: number;
2141
+ name: string;
2142
+ };
2143
+ Insert: {
2144
+ executed_at?: string | null;
2145
+ hash: string;
2146
+ id: number;
2147
+ name: string;
2148
+ };
2149
+ Update: {
2150
+ executed_at?: string | null;
2151
+ hash?: string;
2152
+ id?: number;
2153
+ name?: string;
2154
+ };
2155
+ Relationships: [];
2156
+ };
2157
+ objects: {
2158
+ Row: {
2159
+ bucket_id: string | null;
2160
+ created_at: string | null;
2161
+ id: string;
2162
+ last_accessed_at: string | null;
2163
+ metadata: Json | null;
2164
+ name: string | null;
2165
+ owner: string | null;
2166
+ owner_id: string | null;
2167
+ path_tokens: string[] | null;
2168
+ updated_at: string | null;
2169
+ user_metadata: Json | null;
2170
+ version: string | null;
2171
+ };
2172
+ Insert: {
2173
+ bucket_id?: string | null;
2174
+ created_at?: string | null;
2175
+ id?: string;
2176
+ last_accessed_at?: string | null;
2177
+ metadata?: Json | null;
2178
+ name?: string | null;
2179
+ owner?: string | null;
2180
+ owner_id?: string | null;
2181
+ path_tokens?: string[] | null;
2182
+ updated_at?: string | null;
2183
+ user_metadata?: Json | null;
2184
+ version?: string | null;
2185
+ };
2186
+ Update: {
2187
+ bucket_id?: string | null;
2188
+ created_at?: string | null;
2189
+ id?: string;
2190
+ last_accessed_at?: string | null;
2191
+ metadata?: Json | null;
2192
+ name?: string | null;
2193
+ owner?: string | null;
2194
+ owner_id?: string | null;
2195
+ path_tokens?: string[] | null;
2196
+ updated_at?: string | null;
2197
+ user_metadata?: Json | null;
2198
+ version?: string | null;
2199
+ };
2200
+ Relationships: [
2201
+ {
2202
+ foreignKeyName: 'objects_bucketId_fkey';
2203
+ columns: ['bucket_id'];
2204
+ isOneToOne: false;
2205
+ referencedRelation: 'buckets';
2206
+ referencedColumns: ['id'];
2207
+ },
2208
+ ];
2209
+ };
2210
+ s3_multipart_uploads: {
2211
+ Row: {
2212
+ bucket_id: string;
2213
+ created_at: string;
2214
+ id: string;
2215
+ in_progress_size: number;
2216
+ key: string;
2217
+ owner_id: string | null;
2218
+ upload_signature: string;
2219
+ user_metadata: Json | null;
2220
+ version: string;
2221
+ };
2222
+ Insert: {
2223
+ bucket_id: string;
2224
+ created_at?: string;
2225
+ id: string;
2226
+ in_progress_size?: number;
2227
+ key: string;
2228
+ owner_id?: string | null;
2229
+ upload_signature: string;
2230
+ user_metadata?: Json | null;
2231
+ version: string;
2232
+ };
2233
+ Update: {
2234
+ bucket_id?: string;
2235
+ created_at?: string;
2236
+ id?: string;
2237
+ in_progress_size?: number;
2238
+ key?: string;
2239
+ owner_id?: string | null;
2240
+ upload_signature?: string;
2241
+ user_metadata?: Json | null;
2242
+ version?: string;
2243
+ };
2244
+ Relationships: [
2245
+ {
2246
+ foreignKeyName: 's3_multipart_uploads_bucket_id_fkey';
2247
+ columns: ['bucket_id'];
2248
+ isOneToOne: false;
2249
+ referencedRelation: 'buckets';
2250
+ referencedColumns: ['id'];
2251
+ },
2252
+ ];
2253
+ };
2254
+ s3_multipart_uploads_parts: {
2255
+ Row: {
2256
+ bucket_id: string;
2257
+ created_at: string;
2258
+ etag: string;
2259
+ id: string;
2260
+ key: string;
2261
+ owner_id: string | null;
2262
+ part_number: number;
2263
+ size: number;
2264
+ upload_id: string;
2265
+ version: string;
2266
+ };
2267
+ Insert: {
2268
+ bucket_id: string;
2269
+ created_at?: string;
2270
+ etag: string;
2271
+ id?: string;
2272
+ key: string;
2273
+ owner_id?: string | null;
2274
+ part_number: number;
2275
+ size?: number;
2276
+ upload_id: string;
2277
+ version: string;
2278
+ };
2279
+ Update: {
2280
+ bucket_id?: string;
2281
+ created_at?: string;
2282
+ etag?: string;
2283
+ id?: string;
2284
+ key?: string;
2285
+ owner_id?: string | null;
2286
+ part_number?: number;
2287
+ size?: number;
2288
+ upload_id?: string;
2289
+ version?: string;
2290
+ };
2291
+ Relationships: [
2292
+ {
2293
+ foreignKeyName: 's3_multipart_uploads_parts_bucket_id_fkey';
2294
+ columns: ['bucket_id'];
2295
+ isOneToOne: false;
2296
+ referencedRelation: 'buckets';
2297
+ referencedColumns: ['id'];
2298
+ },
2299
+ {
2300
+ foreignKeyName: 's3_multipart_uploads_parts_upload_id_fkey';
2301
+ columns: ['upload_id'];
2302
+ isOneToOne: false;
2303
+ referencedRelation: 's3_multipart_uploads';
2304
+ referencedColumns: ['id'];
2305
+ },
2306
+ ];
2307
+ };
2308
+ };
2309
+ Views: {
2310
+ [_ in never]: never;
2311
+ };
2312
+ Functions: {
2313
+ can_insert_object: {
2314
+ Args: {
2315
+ bucketid: string;
2316
+ name: string;
2317
+ owner: string;
2318
+ metadata: Json;
2319
+ };
2320
+ Returns: undefined;
2321
+ };
2322
+ extension: {
2323
+ Args: {
2324
+ name: string;
2325
+ };
2326
+ Returns: string;
2327
+ };
2328
+ filename: {
2329
+ Args: {
2330
+ name: string;
2331
+ };
2332
+ Returns: string;
2333
+ };
2334
+ foldername: {
2335
+ Args: {
2336
+ name: string;
2337
+ };
2338
+ Returns: string[];
2339
+ };
2340
+ get_size_by_bucket: {
2341
+ Args: Record<PropertyKey, never>;
2342
+ Returns: {
2343
+ size: number;
2344
+ bucket_id: string;
2345
+ }[];
2346
+ };
2347
+ list_multipart_uploads_with_delimiter: {
2348
+ Args: {
2349
+ bucket_id: string;
2350
+ prefix_param: string;
2351
+ delimiter_param: string;
2352
+ max_keys?: number;
2353
+ next_key_token?: string;
2354
+ next_upload_token?: string;
2355
+ };
2356
+ Returns: {
2357
+ key: string;
2358
+ id: string;
2359
+ created_at: string;
2360
+ }[];
2361
+ };
2362
+ list_objects_with_delimiter: {
2363
+ Args: {
2364
+ bucket_id: string;
2365
+ prefix_param: string;
2366
+ delimiter_param: string;
2367
+ max_keys?: number;
2368
+ start_after?: string;
2369
+ next_token?: string;
2370
+ };
2371
+ Returns: {
2372
+ name: string;
2373
+ id: string;
2374
+ metadata: Json;
2375
+ updated_at: string;
2376
+ }[];
2377
+ };
2378
+ operation: {
2379
+ Args: Record<PropertyKey, never>;
2380
+ Returns: string;
2381
+ };
2382
+ search: {
2383
+ Args: {
2384
+ prefix: string;
2385
+ bucketname: string;
2386
+ limits?: number;
2387
+ levels?: number;
2388
+ offsets?: number;
2389
+ search?: string;
2390
+ sortcolumn?: string;
2391
+ sortorder?: string;
2392
+ };
2393
+ Returns: {
2394
+ name: string;
2395
+ id: string;
2396
+ updated_at: string;
2397
+ created_at: string;
2398
+ last_accessed_at: string;
2399
+ metadata: Json;
2400
+ }[];
2401
+ };
2402
+ };
2403
+ Enums: {
2404
+ [_ in never]: never;
2405
+ };
2406
+ CompositeTypes: {
2407
+ [_ in never]: never;
2408
+ };
2409
+ };
2410
+ };
2411
+
2412
+ type PublicSchema = Database[Extract<keyof Database, 'public'>];
2413
+
2414
+ export type Tables<
2415
+ PublicTableNameOrOptions extends
2416
+ | keyof (PublicSchema['Tables'] & PublicSchema['Views'])
2417
+ | { schema: keyof Database },
2418
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2419
+ ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] &
2420
+ Database[PublicTableNameOrOptions['schema']]['Views'])
2421
+ : never = never,
2422
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2423
+ ? (Database[PublicTableNameOrOptions['schema']]['Tables'] &
2424
+ Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends {
2425
+ Row: infer R;
2426
+ }
2427
+ ? R
2428
+ : never
2429
+ : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] &
2430
+ PublicSchema['Views'])
2431
+ ? (PublicSchema['Tables'] &
2432
+ PublicSchema['Views'])[PublicTableNameOrOptions] extends {
2433
+ Row: infer R;
2434
+ }
2435
+ ? R
2436
+ : never
2437
+ : never;
2438
+
2439
+ export type TablesInsert<
2440
+ PublicTableNameOrOptions extends
2441
+ | keyof PublicSchema['Tables']
2442
+ | { schema: keyof Database },
2443
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2444
+ ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
2445
+ : never = never,
2446
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2447
+ ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
2448
+ Insert: infer I;
2449
+ }
2450
+ ? I
2451
+ : never
2452
+ : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
2453
+ ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
2454
+ Insert: infer I;
2455
+ }
2456
+ ? I
2457
+ : never
2458
+ : never;
2459
+
2460
+ export type TablesUpdate<
2461
+ PublicTableNameOrOptions extends
2462
+ | keyof PublicSchema['Tables']
2463
+ | { schema: keyof Database },
2464
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
2465
+ ? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
2466
+ : never = never,
2467
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
2468
+ ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends {
2469
+ Update: infer U;
2470
+ }
2471
+ ? U
2472
+ : never
2473
+ : PublicTableNameOrOptions extends keyof PublicSchema['Tables']
2474
+ ? PublicSchema['Tables'][PublicTableNameOrOptions] extends {
2475
+ Update: infer U;
2476
+ }
2477
+ ? U
2478
+ : never
2479
+ : never;
2480
+
2481
+ export type Enums<
2482
+ PublicEnumNameOrOptions extends
2483
+ | keyof PublicSchema['Enums']
2484
+ | { schema: keyof Database },
2485
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
2486
+ ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
2487
+ : never = never,
2488
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
2489
+ ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName]
2490
+ : PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
2491
+ ? PublicSchema['Enums'][PublicEnumNameOrOptions]
2492
+ : never;