@periskope/types 0.6.89 → 0.6.91

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