@periskope/types 0.6.145 → 0.6.146

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