@periskope/types 0.6.136 → 0.6.137

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