@periskope/types 0.6.90 → 0.6.92

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