@periskope/types 0.6.243 → 0.6.244

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