@periskope/types 0.6.88 → 0.6.90

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