@periskope/types 0.6.103 → 0.6.104

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