@periskope/types 0.6.63 → 0.6.64

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,1403 +1,1556 @@
1
- export type Json = { [key: string]: any } | any
2
-
3
- export interface Database {
4
- graphql_public: {
5
- Tables: {
6
- [_ in never]: never
7
- }
8
- Views: {
9
- [_ in never]: never
10
- }
11
- Functions: {
12
- graphql: {
13
- Args: {
14
- operationName?: string
15
- query?: string
16
- variables?: Json
17
- extensions?: Json
18
- }
19
- Returns: Json
20
- }
21
- }
22
- Enums: {
23
- [_ in never]: never
24
- }
25
- CompositeTypes: {
26
- [_ in never]: never
27
- }
28
- }
29
- public: {
30
- Tables: {
31
- tbl_broadcast_messages: {
32
- Row: {
33
- broadcast_id: string
34
- chat_ids: string[] | null
35
- completed_at: string | null
36
- created_at: string
37
- message_payload: Json | null
38
- org_id: string
39
- performed_by: string | null
40
- scheduled_at: string | null
41
- }
42
- Insert: {
43
- broadcast_id?: string
44
- chat_ids?: string[] | null
45
- completed_at?: string | null
46
- created_at?: string
47
- message_payload?: Json | null
48
- org_id: string
49
- performed_by?: string | null
50
- scheduled_at?: string | null
51
- }
52
- Update: {
53
- broadcast_id?: string
54
- chat_ids?: string[] | null
55
- completed_at?: string | null
56
- created_at?: string
57
- message_payload?: Json | null
58
- org_id?: string
59
- performed_by?: string | null
60
- scheduled_at?: string | null
61
- }
62
- Relationships: [
63
- {
64
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
65
- columns: ["org_id"]
66
- isOneToOne: false
67
- referencedRelation: "tbl_org"
68
- referencedColumns: ["org_id"]
69
- }
70
- ]
71
- }
72
- tbl_broadcast_templates: {
73
- Row: {
74
- created_at: string
75
- message_payload: Json | null
76
- org_id: string
77
- template_id: string
78
- template_name: string | null
79
- updated_at: string | null
80
- }
81
- Insert: {
82
- created_at?: string
83
- message_payload?: Json | null
84
- org_id: string
85
- template_id?: string
86
- template_name?: string | null
87
- updated_at?: string | null
88
- }
89
- Update: {
90
- created_at?: string
91
- message_payload?: Json | null
92
- org_id?: string
93
- template_id?: string
94
- template_name?: string | null
95
- updated_at?: string | null
96
- }
97
- Relationships: [
98
- {
99
- foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
100
- columns: ["org_id"]
101
- isOneToOne: false
102
- referencedRelation: "tbl_org"
103
- referencedColumns: ["org_id"]
104
- }
105
- ]
106
- }
107
- tbl_chat_access: {
108
- Row: {
109
- active_phone: string | null
110
- chat_id: string
111
- email: string
112
- has_access: boolean | null
113
- is_archived: boolean
114
- is_muted: boolean
115
- last_read_timestamp: string | null
116
- org_id: string
117
- }
118
- Insert: {
119
- active_phone?: string | null
120
- chat_id: string
121
- email: string
122
- has_access?: boolean | null
123
- is_archived?: boolean
124
- is_muted?: boolean
125
- last_read_timestamp?: string | null
126
- org_id: string
127
- }
128
- Update: {
129
- active_phone?: string | null
130
- chat_id?: string
131
- email?: string
132
- has_access?: boolean | null
133
- is_archived?: boolean
134
- is_muted?: boolean
135
- last_read_timestamp?: string | null
136
- org_id?: string
137
- }
138
- Relationships: [
139
- {
140
- foreignKeyName: "tbl_chat_access_org_id_email_fkey"
141
- columns: ["org_id", "email"]
142
- isOneToOne: false
143
- referencedRelation: "tbl_org_members"
144
- referencedColumns: ["org_id", "email"]
145
- }
146
- ]
147
- }
148
- tbl_chat_messages: {
149
- Row: {
150
- ack: string | null
151
- author: string | null
152
- body: string | null
153
- broadcast: boolean | null
154
- broadcast_id: string | null
155
- chat_id: string | null
156
- delivery_info: Json | null
157
- device_type: string | null
158
- duration: string | null
159
- forwarding_score: number | null
160
- from: string | null
161
- from_me: boolean | null
162
- frt_timestamp: string | null
163
- has_media: boolean | null
164
- has_quoted_msg: boolean | null
165
- has_reaction: boolean | null
166
- id: Json | null
167
- invite_v4: Json | null
168
- is_deleted: boolean | null
169
- is_ephemeral: boolean | null
170
- is_flagged: boolean | null
171
- is_forwarded: boolean | null
172
- is_gif: boolean | null
173
- is_starred: boolean | null
174
- is_status: boolean | null
175
- links: Json | null
176
- location: Json | null
177
- media: Json | null
178
- media_key: string | null
179
- mentioned_ids: string[] | null
180
- message_id: string
181
- message_ticket_id: string | null
182
- message_type: string | null
183
- order_id: string | null
184
- org_id: string
185
- org_phone: string
186
- performed_by: string | null
187
- prev_body: string | null
188
- quoted_message_id: string | null
189
- raw_data: Json | null
190
- sender_phone: string | null
191
- sent_message_id: string | null
192
- timestamp: string | null
193
- to: string | null
194
- token: string | null
195
- unique_id: string | null
196
- updated_at: string | null
197
- vcards: string[] | null
198
- }
199
- Insert: {
200
- ack?: string | null
201
- author?: string | null
202
- body?: string | null
203
- broadcast?: boolean | null
204
- broadcast_id?: string | null
205
- chat_id?: string | null
206
- delivery_info?: Json | null
207
- device_type?: string | null
208
- duration?: string | null
209
- forwarding_score?: number | null
210
- from?: string | null
211
- from_me?: boolean | null
212
- frt_timestamp?: string | null
213
- has_media?: boolean | null
214
- has_quoted_msg?: boolean | null
215
- has_reaction?: boolean | null
216
- id?: Json | null
217
- invite_v4?: Json | null
218
- is_deleted?: boolean | null
219
- is_ephemeral?: boolean | null
220
- is_flagged?: boolean | null
221
- is_forwarded?: boolean | null
222
- is_gif?: boolean | null
223
- is_starred?: boolean | null
224
- is_status?: boolean | null
225
- links?: Json | null
226
- location?: Json | null
227
- media?: Json | null
228
- media_key?: string | null
229
- mentioned_ids?: string[] | null
230
- message_id: string
231
- message_ticket_id?: string | null
232
- message_type?: string | null
233
- order_id?: string | null
234
- org_id: string
235
- org_phone: string
236
- performed_by?: string | null
237
- prev_body?: string | null
238
- quoted_message_id?: string | null
239
- raw_data?: Json | null
240
- sender_phone?: string | null
241
- sent_message_id?: string | null
242
- timestamp?: string | null
243
- to?: string | null
244
- token?: string | null
245
- unique_id?: string | null
246
- updated_at?: string | null
247
- vcards?: string[] | null
248
- }
249
- Update: {
250
- ack?: string | null
251
- author?: string | null
252
- body?: string | null
253
- broadcast?: boolean | null
254
- broadcast_id?: string | null
255
- chat_id?: string | null
256
- delivery_info?: Json | null
257
- device_type?: string | null
258
- duration?: string | null
259
- forwarding_score?: number | null
260
- from?: string | null
261
- from_me?: boolean | null
262
- frt_timestamp?: string | null
263
- has_media?: boolean | null
264
- has_quoted_msg?: boolean | null
265
- has_reaction?: boolean | null
266
- id?: Json | null
267
- invite_v4?: Json | null
268
- is_deleted?: boolean | null
269
- is_ephemeral?: boolean | null
270
- is_flagged?: boolean | null
271
- is_forwarded?: boolean | null
272
- is_gif?: boolean | null
273
- is_starred?: boolean | null
274
- is_status?: boolean | null
275
- links?: Json | null
276
- location?: Json | null
277
- media?: Json | null
278
- media_key?: string | null
279
- mentioned_ids?: string[] | null
280
- message_id?: string
281
- message_ticket_id?: string | null
282
- message_type?: string | null
283
- order_id?: string | null
284
- org_id?: string
285
- org_phone?: string
286
- performed_by?: string | null
287
- prev_body?: string | null
288
- quoted_message_id?: string | null
289
- raw_data?: Json | null
290
- sender_phone?: string | null
291
- sent_message_id?: string | null
292
- timestamp?: string | null
293
- to?: string | null
294
- token?: string | null
295
- unique_id?: string | null
296
- updated_at?: string | null
297
- vcards?: string[] | null
298
- }
299
- Relationships: [
300
- {
301
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
302
- columns: ["org_phone", "org_id"]
303
- isOneToOne: false
304
- referencedRelation: "tbl_org_phones"
305
- referencedColumns: ["org_phone", "org_id"]
306
- }
307
- ]
308
- }
309
- tbl_chat_notifications: {
310
- Row: {
311
- author: string | null
312
- body: string | null
313
- chat_id: string | null
314
- id: Json | null
315
- notification_id: string
316
- org_id: string
317
- org_phone: string
318
- recipientids: string[] | null
319
- timestamp: string | null
320
- type: string | null
321
- unique_id: string | null
322
- }
323
- Insert: {
324
- author?: string | null
325
- body?: string | null
326
- chat_id?: string | null
327
- id?: Json | null
328
- notification_id: string
329
- org_id: string
330
- org_phone: string
331
- recipientids?: string[] | null
332
- timestamp?: string | null
333
- type?: string | null
334
- unique_id?: string | null
335
- }
336
- Update: {
337
- author?: string | null
338
- body?: string | null
339
- chat_id?: string | null
340
- id?: Json | null
341
- notification_id?: string
342
- org_id?: string
343
- org_phone?: string
344
- recipientids?: string[] | null
345
- timestamp?: string | null
346
- type?: string | null
347
- unique_id?: string | null
348
- }
349
- Relationships: [
350
- {
351
- foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
352
- columns: ["org_id", "org_phone"]
353
- isOneToOne: false
354
- referencedRelation: "tbl_org_phones"
355
- referencedColumns: ["org_id", "org_phone"]
356
- }
357
- ]
358
- }
359
- tbl_chat_participants: {
360
- Row: {
361
- chat_id: string
362
- contact_id: string
363
- id: Json | null
364
- is_admin: boolean | null
365
- is_super_admin: boolean | null
366
- org_id: string
367
- org_phone: string
368
- }
369
- Insert: {
370
- chat_id: string
371
- contact_id: string
372
- id?: Json | null
373
- is_admin?: boolean | null
374
- is_super_admin?: boolean | null
375
- org_id: string
376
- org_phone: string
377
- }
378
- Update: {
379
- chat_id?: string
380
- contact_id?: string
381
- id?: Json | null
382
- is_admin?: boolean | null
383
- is_super_admin?: boolean | null
384
- org_id?: string
385
- org_phone?: string
386
- }
387
- Relationships: [
388
- {
389
- foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
390
- columns: ["org_id", "org_phone", "chat_id"]
391
- isOneToOne: false
392
- referencedRelation: "tbl_chats"
393
- referencedColumns: ["org_id", "org_phone", "chat_id"]
394
- },
395
- {
396
- foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
397
- columns: ["org_id", "org_phone", "chat_id"]
398
- isOneToOne: false
399
- referencedRelation: "view_chats"
400
- referencedColumns: ["org_id", "org_phone", "chat_id"]
401
- }
402
- ]
403
- }
404
- tbl_chat_reactions: {
405
- Row: {
406
- ack: number | null
407
- chat_id: string | null
408
- id: Json | null
409
- message_id: string
410
- msg_id: Json | null
411
- org_id: string
412
- org_phone: string
413
- orphan: number | null
414
- orphan_reason: string | null
415
- reaction: string | null
416
- reaction_id: string
417
- read: boolean | null
418
- sender_id: string
419
- timestamp: string | null
420
- unique_id: string | null
421
- }
422
- Insert: {
423
- ack?: number | null
424
- chat_id?: string | null
425
- id?: Json | null
426
- message_id: string
427
- msg_id?: Json | null
428
- org_id: string
429
- org_phone: string
430
- orphan?: number | null
431
- orphan_reason?: string | null
432
- reaction?: string | null
433
- reaction_id: string
434
- read?: boolean | null
435
- sender_id: string
436
- timestamp?: string | null
437
- unique_id?: string | null
438
- }
439
- Update: {
440
- ack?: number | null
441
- chat_id?: string | null
442
- id?: Json | null
443
- message_id?: string
444
- msg_id?: Json | null
445
- org_id?: string
446
- org_phone?: string
447
- orphan?: number | null
448
- orphan_reason?: string | null
449
- reaction?: string | null
450
- reaction_id?: string
451
- read?: boolean | null
452
- sender_id?: string
453
- timestamp?: string | null
454
- unique_id?: string | null
455
- }
456
- Relationships: [
457
- {
458
- foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
459
- columns: ["org_id", "org_phone"]
460
- isOneToOne: false
461
- referencedRelation: "tbl_org_phones"
462
- referencedColumns: ["org_id", "org_phone"]
463
- }
464
- ]
465
- }
466
- tbl_chat_tickets: {
467
- Row: {
468
- assigned_by: string | null
469
- assignee: string | null
470
- chat_id: string
471
- created_at: string
472
- due_date: string | null
473
- is_deleted: boolean
474
- label_ids: Json | null
475
- last_updated_at: string
476
- org_id: string
477
- priority: number | null
478
- quoted_message_id: string | null
479
- raised_by: string | null
480
- status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
481
- subject: string
482
- ticket_id: string
483
- }
484
- Insert: {
485
- assigned_by?: string | null
486
- assignee?: string | null
487
- chat_id: string
488
- created_at?: string
489
- due_date?: string | null
490
- is_deleted?: boolean
491
- label_ids?: Json | null
492
- last_updated_at?: string
493
- org_id: string
494
- priority?: number | null
495
- quoted_message_id?: string | null
496
- raised_by?: string | null
497
- status?:
498
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
499
- | null
500
- subject: string
501
- ticket_id?: string
502
- }
503
- Update: {
504
- assigned_by?: string | null
505
- assignee?: string | null
506
- chat_id?: string
507
- created_at?: string
508
- due_date?: string | null
509
- is_deleted?: boolean
510
- label_ids?: Json | null
511
- last_updated_at?: string
512
- org_id?: string
513
- priority?: number | null
514
- quoted_message_id?: string | null
515
- raised_by?: string | null
516
- status?:
517
- | Database["public"]["Enums"]["enum_chat_tickets_status"]
518
- | null
519
- subject?: string
520
- ticket_id?: string
521
- }
522
- Relationships: [
523
- {
524
- foreignKeyName: "tbl_chat_tickets_org_id_fkey"
525
- columns: ["org_id"]
526
- isOneToOne: false
527
- referencedRelation: "tbl_org"
528
- referencedColumns: ["org_id"]
529
- }
530
- ]
531
- }
532
- tbl_chats: {
533
- Row: {
534
- archived: boolean | null
535
- chat_id: string
536
- chat_image: string | null
537
- custom_properties: Json | null
538
- group_metadata: Json | null
539
- id: Json | null
540
- invite_link: string | null
541
- is_group: boolean | null
542
- is_muted: boolean | null
543
- is_read_only: boolean | null
544
- label_ids: Json
545
- latest_message: Json | null
546
- member_count: number | null
547
- mute_expiration: number | null
548
- name: string | null
549
- org_id: string
550
- org_phone: string
551
- pinned: boolean | null
552
- timestamp: string | null
553
- unread_count: number | null
554
- updated_at: string
555
- }
556
- Insert: {
557
- archived?: boolean | null
558
- chat_id: string
559
- chat_image?: string | null
560
- custom_properties?: Json | null
561
- group_metadata?: Json | null
562
- id?: Json | null
563
- invite_link?: string | null
564
- is_group?: boolean | null
565
- is_muted?: boolean | null
566
- is_read_only?: boolean | null
567
- label_ids?: Json
568
- latest_message?: Json | null
569
- member_count?: number | null
570
- mute_expiration?: number | null
571
- name?: string | null
572
- org_id: string
573
- org_phone: string
574
- pinned?: boolean | null
575
- timestamp?: string | null
576
- unread_count?: number | null
577
- updated_at?: string
578
- }
579
- Update: {
580
- archived?: boolean | null
581
- chat_id?: string
582
- chat_image?: string | null
583
- custom_properties?: Json | null
584
- group_metadata?: Json | null
585
- id?: Json | null
586
- invite_link?: string | null
587
- is_group?: boolean | null
588
- is_muted?: boolean | null
589
- is_read_only?: boolean | null
590
- label_ids?: Json
591
- latest_message?: Json | null
592
- member_count?: number | null
593
- mute_expiration?: number | null
594
- name?: string | null
595
- org_id?: string
596
- org_phone?: string
597
- pinned?: boolean | null
598
- timestamp?: string | null
599
- unread_count?: number | null
600
- updated_at?: string
601
- }
602
- Relationships: [
603
- {
604
- foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
605
- columns: ["org_phone", "org_id"]
606
- isOneToOne: false
607
- referencedRelation: "tbl_org_phones"
608
- referencedColumns: ["org_phone", "org_id"]
609
- }
610
- ]
611
- }
612
- tbl_contacts: {
613
- Row: {
614
- business_profile: Json | null
615
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
616
- contact_id: string
617
- contact_image: string | null
618
- contact_name: string | null
619
- contact_type: string | null
620
- id: Json | null
621
- is_blocked: boolean | null
622
- is_business: boolean | null
623
- is_enterprise: boolean | null
624
- is_group: boolean | null
625
- is_internal: boolean | null
626
- is_me: boolean | null
627
- is_my_contact: boolean | null
628
- is_user: boolean | null
629
- is_wa_contact: boolean | null
630
- label_ids: Json
631
- name: string | null
632
- number: string | null
633
- org_id: string
634
- pushname: string | null
635
- short_name: string | null
636
- updated_at: string | null
637
- verified_level: number | null
638
- verified_name: string | null
639
- }
640
- Insert: {
641
- business_profile?: Json | null
642
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
643
- contact_id: string
644
- contact_image?: string | null
645
- contact_name?: string | null
646
- contact_type?: string | null
647
- id?: Json | null
648
- is_blocked?: boolean | null
649
- is_business?: boolean | null
650
- is_enterprise?: boolean | null
651
- is_group?: boolean | null
652
- is_internal?: boolean | null
653
- is_me?: boolean | null
654
- is_my_contact?: boolean | null
655
- is_user?: boolean | null
656
- is_wa_contact?: boolean | null
657
- label_ids?: Json
658
- name?: string | null
659
- number?: string | null
660
- org_id: string
661
- pushname?: string | null
662
- short_name?: string | null
663
- updated_at?: string | null
664
- verified_level?: number | null
665
- verified_name?: string | null
666
- }
667
- Update: {
668
- business_profile?: Json | null
669
- contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
670
- contact_id?: string
671
- contact_image?: string | null
672
- contact_name?: string | null
673
- contact_type?: string | null
674
- id?: Json | null
675
- is_blocked?: boolean | null
676
- is_business?: boolean | null
677
- is_enterprise?: boolean | null
678
- is_group?: boolean | null
679
- is_internal?: boolean | null
680
- is_me?: boolean | null
681
- is_my_contact?: boolean | null
682
- is_user?: boolean | null
683
- is_wa_contact?: boolean | null
684
- label_ids?: Json
685
- name?: string | null
686
- number?: string | null
687
- org_id?: string
688
- pushname?: string | null
689
- short_name?: string | null
690
- updated_at?: string | null
691
- verified_level?: number | null
692
- verified_name?: string | null
693
- }
694
- Relationships: [
695
- {
696
- foreignKeyName: "tbl_contacts_org_id_fkey"
697
- columns: ["org_id"]
698
- isOneToOne: false
699
- referencedRelation: "tbl_org"
700
- referencedColumns: ["org_id"]
701
- }
702
- ]
703
- }
704
- tbl_custom_properties: {
705
- Row: {
706
- created_at: string
707
- created_by: string | null
708
- org_id: string | null
709
- property_id: string
710
- property_name: string
711
- property_value: string | null
712
- property_value_type: string | null
713
- type: string | null
714
- }
715
- Insert: {
716
- created_at?: string
717
- created_by?: string | null
718
- org_id?: string | null
719
- property_id?: string
720
- property_name: string
721
- property_value?: string | null
722
- property_value_type?: string | null
723
- type?: string | null
724
- }
725
- Update: {
726
- created_at?: string
727
- created_by?: string | null
728
- org_id?: string | null
729
- property_id?: string
730
- property_name?: string
731
- property_value?: string | null
732
- property_value_type?: string | null
733
- type?: string | null
734
- }
735
- Relationships: [
736
- {
737
- foreignKeyName: "tbl_custom_properties_org_id_fkey"
738
- columns: ["org_id"]
739
- isOneToOne: false
740
- referencedRelation: "tbl_org"
741
- referencedColumns: ["org_id"]
742
- }
743
- ]
744
- }
745
- tbl_org: {
746
- Row: {
747
- created_at: string
748
- org_id: string
749
- org_image: string | null
750
- org_metadata: Json | null
751
- org_name: string | null
752
- org_plan: Json | null
753
- stripe_customer_details: Json | null
754
- stripe_customer_id: string | null
755
- stripe_subscription_details: Json | null
756
- support_link: string | null
757
- }
758
- Insert: {
759
- created_at?: string
760
- org_id?: string
761
- org_image?: string | null
762
- org_metadata?: Json | null
763
- org_name?: string | null
764
- org_plan?: Json | null
765
- stripe_customer_details?: Json | null
766
- stripe_customer_id?: string | null
767
- stripe_subscription_details?: Json | null
768
- support_link?: string | null
769
- }
770
- Update: {
771
- created_at?: string
772
- org_id?: string
773
- org_image?: string | null
774
- org_metadata?: Json | null
775
- org_name?: string | null
776
- org_plan?: Json | null
777
- stripe_customer_details?: Json | null
778
- stripe_customer_id?: string | null
779
- stripe_subscription_details?: Json | null
780
- support_link?: string | null
781
- }
782
- Relationships: []
783
- }
784
- tbl_org_labels: {
785
- Row: {
786
- color: string
787
- created_at: string
788
- label_id: string
789
- name: string
790
- org_id: string
791
- type: string
792
- }
793
- Insert: {
794
- color?: string
795
- created_at?: string
796
- label_id?: string
797
- name: string
798
- org_id: string
799
- type?: string
800
- }
801
- Update: {
802
- color?: string
803
- created_at?: string
804
- label_id?: string
805
- name?: string
806
- org_id?: string
807
- type?: string
808
- }
809
- Relationships: [
810
- {
811
- foreignKeyName: "tbl_org_labels_org_id_fkey"
812
- columns: ["org_id"]
813
- isOneToOne: false
814
- referencedRelation: "tbl_org"
815
- referencedColumns: ["org_id"]
816
- }
817
- ]
818
- }
819
- tbl_org_members: {
820
- Row: {
821
- created_at: string | null
822
- email: string
823
- invited_at: string | null
824
- invited_by: string | null
825
- is_active: boolean
826
- member_color: Database["public"]["Enums"]["enum_chat_colors"]
827
- member_image: string | null
828
- member_name: string | null
829
- org_id: string
830
- role: Database["public"]["Enums"]["enum_member_role"]
831
- user_id: string | null
832
- }
833
- Insert: {
834
- created_at?: string | null
835
- email: string
836
- invited_at?: string | null
837
- invited_by?: string | null
838
- is_active?: boolean
839
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
840
- member_image?: string | null
841
- member_name?: string | null
842
- org_id: string
843
- role?: Database["public"]["Enums"]["enum_member_role"]
844
- user_id?: string | null
845
- }
846
- Update: {
847
- created_at?: string | null
848
- email?: string
849
- invited_at?: string | null
850
- invited_by?: string | null
851
- is_active?: boolean
852
- member_color?: Database["public"]["Enums"]["enum_chat_colors"]
853
- member_image?: string | null
854
- member_name?: string | null
855
- org_id?: string
856
- role?: Database["public"]["Enums"]["enum_member_role"]
857
- user_id?: string | null
858
- }
859
- Relationships: [
860
- {
861
- foreignKeyName: "tbl_org_members_fkey_auth_users"
862
- columns: ["user_id"]
863
- isOneToOne: false
864
- referencedRelation: "users"
865
- referencedColumns: ["id"]
866
- },
867
- {
868
- foreignKeyName: "tbl_org_members_fkey_tbl_org"
869
- columns: ["org_id"]
870
- isOneToOne: false
871
- referencedRelation: "tbl_org"
872
- referencedColumns: ["org_id"]
873
- }
874
- ]
875
- }
876
- tbl_org_phones: {
877
- Row: {
878
- created_at: string
879
- is_ready: boolean | null
880
- org_id: string
881
- org_phone: string | null
882
- phone_id: string
883
- phone_image: string | null
884
- phone_name: string | null
885
- qr_code: string | null
886
- server_ip: string | null
887
- updated_at: string | null
888
- wa_state: string | null
889
- }
890
- Insert: {
891
- created_at?: string
892
- is_ready?: boolean | null
893
- org_id: string
894
- org_phone?: string | null
895
- phone_id?: string
896
- phone_image?: string | null
897
- phone_name?: string | null
898
- qr_code?: string | null
899
- server_ip?: string | null
900
- updated_at?: string | null
901
- wa_state?: string | null
902
- }
903
- Update: {
904
- created_at?: string
905
- is_ready?: boolean | null
906
- org_id?: string
907
- org_phone?: string | null
908
- phone_id?: string
909
- phone_image?: string | null
910
- phone_name?: string | null
911
- qr_code?: string | null
912
- server_ip?: string | null
913
- updated_at?: string | null
914
- wa_state?: string | null
915
- }
916
- Relationships: [
917
- {
918
- foreignKeyName: "tbl_org_phones_fkey_tbl_org"
919
- columns: ["org_id"]
920
- isOneToOne: false
921
- referencedRelation: "tbl_org"
922
- referencedColumns: ["org_id"]
923
- },
924
- {
925
- foreignKeyName: "tbl_org_phones_org_id_fkey"
926
- columns: ["org_id"]
927
- isOneToOne: false
928
- referencedRelation: "tbl_org"
929
- referencedColumns: ["org_id"]
930
- }
931
- ]
932
- }
933
- tbl_tools_whatsapp_links: {
934
- Row: {
935
- created_at: string
936
- link_id: string
937
- link_name: string
938
- message: string | null
939
- phone: string
940
- }
941
- Insert: {
942
- created_at?: string
943
- link_id?: string
944
- link_name: string
945
- message?: string | null
946
- phone: string
947
- }
948
- Update: {
949
- created_at?: string
950
- link_id?: string
951
- link_name?: string
952
- message?: string | null
953
- phone?: string
954
- }
955
- Relationships: []
956
- }
957
- }
958
- Views: {
959
- view_broadcast_logs: {
960
- Row: {
961
- broadcast_id: string | null
962
- completed_at: string | null
963
- created_at: string | null
964
- delivered_member_count: number | null
965
- delivery_percentage: number | null
966
- failed_chats: number | null
967
- message_payload: Json | null
968
- org_id: string | null
969
- performed_by: string | null
970
- read_member_count: number | null
971
- read_percentage: number | null
972
- scheduled_at: string | null
973
- sent_chats: number | null
974
- total_chats: number | null
975
- total_member_count: number | null
976
- }
977
- Relationships: [
978
- {
979
- foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
980
- columns: ["org_id"]
981
- isOneToOne: false
982
- referencedRelation: "tbl_org"
983
- referencedColumns: ["org_id"]
984
- }
985
- ]
986
- }
987
- view_chats: {
988
- Row: {
989
- active_phone: string | null
990
- chat_access: Json | null
991
- chat_id: string | null
992
- chat_image: string | null
993
- chat_name: string | null
994
- chat_org_phones: string[] | null
995
- chat_type: string | null
996
- custom_properties: Json | null
997
- group_description: string | null
998
- has_access: boolean | null
999
- invite_link: string | null
1000
- is_archived: boolean | null
1001
- is_muted: boolean | null
1002
- label_ids: Json | null
1003
- last_read_timestamp: string | null
1004
- latest_message: Json | null
1005
- member_count: number | null
1006
- members: Json | null
1007
- org_id: string | null
1008
- org_phone: string | null
1009
- updated_at: string | null
1010
- }
1011
- Relationships: [
1012
- {
1013
- foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
1014
- columns: ["org_phone", "org_id"]
1015
- isOneToOne: false
1016
- referencedRelation: "tbl_org_phones"
1017
- referencedColumns: ["org_phone", "org_id"]
1018
- }
1019
- ]
1020
- }
1021
- }
1022
- Functions: {
1023
- gen_id: {
1024
- Args: {
1025
- prefix: string
1026
- size?: number
1027
- alphabet?: string
1028
- }
1029
- Returns: string
1030
- }
1031
- gen_ticket_id: {
1032
- Args: {
1033
- org_id_input: string
1034
- }
1035
- Returns: string
1036
- }
1037
- get_broadcast_id: {
1038
- Args: {
1039
- broadcast_id_input: string
1040
- chat_id_input?: string
1041
- }
1042
- Returns: Json
1043
- }
1044
- get_chat_labels_data: {
1045
- Args: {
1046
- org_id_input: string
1047
- chat_ids_input?: string[]
1048
- }
1049
- Returns: unknown
1050
- }
1051
- get_chats: {
1052
- Args: {
1053
- org_id_input: string
1054
- chat_id_input?: string[]
1055
- with_metadata?: boolean
1056
- last_updated_at_input?: string
1057
- }
1058
- Returns: Json
1059
- }
1060
- get_contacts: {
1061
- Args: {
1062
- org_id_input: string
1063
- contact_ids_input?: string[]
1064
- last_updated_at_input?: string
1065
- }
1066
- Returns: Json
1067
- }
1068
- get_dashboard_statistics: {
1069
- Args: {
1070
- org_id_input: string
1071
- type_input?: string
1072
- interval_input?: unknown
1073
- }
1074
- Returns: Json
1075
- }
1076
- get_export_chats_data: {
1077
- Args: {
1078
- org_id_input: string
1079
- chat_ids?: string[]
1080
- }
1081
- Returns: Json
1082
- }
1083
- get_messages_notifications_reactions: {
1084
- Args: {
1085
- org_id_input: string
1086
- chat_id_input?: string[]
1087
- message_limit_input?: number
1088
- reaction_notification_limit_input?: number
1089
- last_updated_at_input?: string
1090
- }
1091
- Returns: Json
1092
- }
1093
- get_org: {
1094
- Args: {
1095
- org_id_input?: string
1096
- }
1097
- Returns: Json
1098
- }
1099
- list_org_from_user: {
1100
- Args: Record<PropertyKey, never>
1101
- Returns: unknown
1102
- }
1103
- list_role_from_user: {
1104
- Args: Record<PropertyKey, never>
1105
- Returns: Database["public"]["Enums"]["enum_member_role"]
1106
- }
1107
- update_labels: {
1108
- Args: {
1109
- org_id_input: string
1110
- tbl_type: string
1111
- label_ids_input: Json
1112
- row_id_input: string[]
1113
- replace_labels?: boolean
1114
- }
1115
- Returns: undefined
1116
- }
1117
- }
1118
- Enums: {
1119
- enum_chat_colors:
1120
- | "#B4876E"
1121
- | "#A5B337"
1122
- | "#06CF9C"
1123
- | "#25D366"
1124
- | "#02A698"
1125
- | "#7D9EF1"
1126
- | "#007BFC"
1127
- | "#5E47DE"
1128
- | "#7F66FF"
1129
- | "#9333EA"
1130
- | "#FA6533"
1131
- | "#C4532D"
1132
- | "#DC2626"
1133
- | "#FF2E74"
1134
- | "#DB2777"
1135
- enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1136
- enum_member_role: "admin" | "member"
1137
- }
1138
- CompositeTypes: {
1139
- [_ in never]: never
1140
- }
1141
- }
1142
- storage: {
1143
- Tables: {
1144
- buckets: {
1145
- Row: {
1146
- allowed_mime_types: string[] | null
1147
- avif_autodetection: boolean | null
1148
- created_at: string | null
1149
- file_size_limit: number | null
1150
- id: string
1151
- name: string
1152
- owner: string | null
1153
- owner_id: string | null
1154
- public: boolean | null
1155
- updated_at: string | null
1156
- }
1157
- Insert: {
1158
- allowed_mime_types?: string[] | null
1159
- avif_autodetection?: boolean | null
1160
- created_at?: string | null
1161
- file_size_limit?: number | null
1162
- id: string
1163
- name: string
1164
- owner?: string | null
1165
- owner_id?: string | null
1166
- public?: boolean | null
1167
- updated_at?: string | null
1168
- }
1169
- Update: {
1170
- allowed_mime_types?: string[] | null
1171
- avif_autodetection?: boolean | null
1172
- created_at?: string | null
1173
- file_size_limit?: number | null
1174
- id?: string
1175
- name?: string
1176
- owner?: string | null
1177
- owner_id?: string | null
1178
- public?: boolean | null
1179
- updated_at?: string | null
1180
- }
1181
- Relationships: []
1182
- }
1183
- migrations: {
1184
- Row: {
1185
- executed_at: string | null
1186
- hash: string
1187
- id: number
1188
- name: string
1189
- }
1190
- Insert: {
1191
- executed_at?: string | null
1192
- hash: string
1193
- id: number
1194
- name: string
1195
- }
1196
- Update: {
1197
- executed_at?: string | null
1198
- hash?: string
1199
- id?: number
1200
- name?: string
1201
- }
1202
- Relationships: []
1203
- }
1204
- objects: {
1205
- Row: {
1206
- bucket_id: string | null
1207
- created_at: string | null
1208
- id: string
1209
- last_accessed_at: string | null
1210
- metadata: Json | null
1211
- name: string | null
1212
- owner: string | null
1213
- owner_id: string | null
1214
- path_tokens: string[] | null
1215
- updated_at: string | null
1216
- version: string | null
1217
- }
1218
- Insert: {
1219
- bucket_id?: string | null
1220
- created_at?: string | null
1221
- id?: string
1222
- last_accessed_at?: string | null
1223
- metadata?: Json | null
1224
- name?: string | null
1225
- owner?: string | null
1226
- owner_id?: string | null
1227
- path_tokens?: string[] | null
1228
- updated_at?: string | null
1229
- version?: string | null
1230
- }
1231
- Update: {
1232
- bucket_id?: string | null
1233
- created_at?: string | null
1234
- id?: string
1235
- last_accessed_at?: string | null
1236
- metadata?: Json | null
1237
- name?: string | null
1238
- owner?: string | null
1239
- owner_id?: string | null
1240
- path_tokens?: string[] | null
1241
- updated_at?: string | null
1242
- version?: string | null
1243
- }
1244
- Relationships: [
1245
- {
1246
- foreignKeyName: "objects_bucketId_fkey"
1247
- columns: ["bucket_id"]
1248
- isOneToOne: false
1249
- referencedRelation: "buckets"
1250
- referencedColumns: ["id"]
1251
- }
1252
- ]
1253
- }
1254
- }
1255
- Views: {
1256
- [_ in never]: never
1257
- }
1258
- Functions: {
1259
- can_insert_object: {
1260
- Args: {
1261
- bucketid: string
1262
- name: string
1263
- owner: string
1264
- metadata: Json
1265
- }
1266
- Returns: undefined
1267
- }
1268
- extension: {
1269
- Args: {
1270
- name: string
1271
- }
1272
- Returns: string
1273
- }
1274
- filename: {
1275
- Args: {
1276
- name: string
1277
- }
1278
- Returns: string
1279
- }
1280
- foldername: {
1281
- Args: {
1282
- name: string
1283
- }
1284
- Returns: unknown
1285
- }
1286
- get_size_by_bucket: {
1287
- Args: Record<PropertyKey, never>
1288
- Returns: {
1289
- size: number
1290
- bucket_id: string
1291
- }[]
1292
- }
1293
- search: {
1294
- Args: {
1295
- prefix: string
1296
- bucketname: string
1297
- limits?: number
1298
- levels?: number
1299
- offsets?: number
1300
- search?: string
1301
- sortcolumn?: string
1302
- sortorder?: string
1303
- }
1304
- Returns: {
1305
- name: string
1306
- id: string
1307
- updated_at: string
1308
- created_at: string
1309
- last_accessed_at: string
1310
- metadata: Json
1311
- }[]
1312
- }
1313
- }
1314
- Enums: {
1315
- [_ in never]: never
1316
- }
1317
- CompositeTypes: {
1318
- [_ in never]: never
1319
- }
1320
- }
1321
- }
1322
-
1323
- export type Tables<
1324
- PublicTableNameOrOptions extends
1325
- | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1326
- | { schema: keyof Database },
1327
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1328
- ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1329
- Database[PublicTableNameOrOptions["schema"]]["Views"])
1330
- : never = never
1331
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1332
- ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1333
- Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1334
- Row: infer R
1335
- }
1336
- ? R
1337
- : never
1338
- : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1339
- Database["public"]["Views"])
1340
- ? (Database["public"]["Tables"] &
1341
- Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1342
- Row: infer R
1343
- }
1344
- ? R
1345
- : never
1346
- : never
1347
-
1348
- export type TablesInsert<
1349
- PublicTableNameOrOptions extends
1350
- | keyof Database["public"]["Tables"]
1351
- | { schema: keyof Database },
1352
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1353
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1354
- : never = never
1355
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1356
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1357
- Insert: infer I
1358
- }
1359
- ? I
1360
- : never
1361
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1362
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1363
- Insert: infer I
1364
- }
1365
- ? I
1366
- : never
1367
- : never
1368
-
1369
- export type TablesUpdate<
1370
- PublicTableNameOrOptions extends
1371
- | keyof Database["public"]["Tables"]
1372
- | { schema: keyof Database },
1373
- TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1374
- ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1375
- : never = never
1376
- > = PublicTableNameOrOptions extends { schema: keyof Database }
1377
- ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1378
- Update: infer U
1379
- }
1380
- ? U
1381
- : never
1382
- : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1383
- ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1384
- Update: infer U
1385
- }
1386
- ? U
1387
- : never
1388
- : never
1389
-
1390
- export type Enums<
1391
- PublicEnumNameOrOptions extends
1392
- | keyof Database["public"]["Enums"]
1393
- | { schema: keyof Database },
1394
- EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1395
- ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1396
- : never = never
1397
- > = PublicEnumNameOrOptions extends { schema: keyof Database }
1398
- ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1399
- : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1400
- ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1401
- : never
1402
-
1
+ export type Json = { [key: string]: any } | any
2
+
3
+ export interface Database {
4
+ graphql_public: {
5
+ Tables: {
6
+ [_ in never]: never
7
+ }
8
+ Views: {
9
+ [_ in never]: never
10
+ }
11
+ Functions: {
12
+ graphql: {
13
+ Args: {
14
+ operationName?: string
15
+ query?: string
16
+ variables?: Json
17
+ extensions?: Json
18
+ }
19
+ Returns: Json
20
+ }
21
+ }
22
+ Enums: {
23
+ [_ in never]: never
24
+ }
25
+ CompositeTypes: {
26
+ [_ in never]: never
27
+ }
28
+ }
29
+ public: {
30
+ Tables: {
31
+ tbl_broadcast_messages: {
32
+ Row: {
33
+ broadcast_id: string
34
+ chat_ids: string[] | null
35
+ completed_at: string | null
36
+ created_at: string
37
+ message_payload: Json | null
38
+ org_id: string
39
+ performed_by: string | null
40
+ scheduled_at: string | null
41
+ }
42
+ Insert: {
43
+ broadcast_id?: string
44
+ chat_ids?: string[] | null
45
+ completed_at?: string | null
46
+ created_at?: string
47
+ message_payload?: Json | null
48
+ org_id: string
49
+ performed_by?: string | null
50
+ scheduled_at?: string | null
51
+ }
52
+ Update: {
53
+ broadcast_id?: string
54
+ chat_ids?: string[] | null
55
+ completed_at?: string | null
56
+ created_at?: string
57
+ message_payload?: Json | null
58
+ org_id?: string
59
+ performed_by?: string | null
60
+ scheduled_at?: string | null
61
+ }
62
+ Relationships: [
63
+ {
64
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
65
+ columns: ["org_id"]
66
+ isOneToOne: false
67
+ referencedRelation: "tbl_org"
68
+ referencedColumns: ["org_id"]
69
+ }
70
+ ]
71
+ }
72
+ tbl_broadcast_templates: {
73
+ Row: {
74
+ created_at: string
75
+ message_payload: Json | null
76
+ org_id: string
77
+ template_id: string
78
+ template_name: string | null
79
+ updated_at: string | null
80
+ }
81
+ Insert: {
82
+ created_at?: string
83
+ message_payload?: Json | null
84
+ org_id: string
85
+ template_id?: string
86
+ template_name?: string | null
87
+ updated_at?: string | null
88
+ }
89
+ Update: {
90
+ created_at?: string
91
+ message_payload?: Json | null
92
+ org_id?: string
93
+ template_id?: string
94
+ template_name?: string | null
95
+ updated_at?: string | null
96
+ }
97
+ Relationships: [
98
+ {
99
+ foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
100
+ columns: ["org_id"]
101
+ isOneToOne: false
102
+ referencedRelation: "tbl_org"
103
+ referencedColumns: ["org_id"]
104
+ }
105
+ ]
106
+ }
107
+ tbl_chat_access: {
108
+ Row: {
109
+ active_phone: string | null
110
+ chat_id: string
111
+ email: string
112
+ has_access: boolean | null
113
+ is_archived: boolean
114
+ is_muted: boolean
115
+ last_read_timestamp: string | null
116
+ org_id: string
117
+ }
118
+ Insert: {
119
+ active_phone?: string | null
120
+ chat_id: string
121
+ email: string
122
+ has_access?: boolean | null
123
+ is_archived?: boolean
124
+ is_muted?: boolean
125
+ last_read_timestamp?: string | null
126
+ org_id: string
127
+ }
128
+ Update: {
129
+ active_phone?: string | null
130
+ chat_id?: string
131
+ email?: string
132
+ has_access?: boolean | null
133
+ is_archived?: boolean
134
+ is_muted?: boolean
135
+ last_read_timestamp?: string | null
136
+ org_id?: string
137
+ }
138
+ Relationships: [
139
+ {
140
+ foreignKeyName: "tbl_chat_access_org_id_email_fkey"
141
+ columns: ["org_id", "email"]
142
+ isOneToOne: false
143
+ referencedRelation: "tbl_org_members"
144
+ referencedColumns: ["org_id", "email"]
145
+ }
146
+ ]
147
+ }
148
+ tbl_chat_messages: {
149
+ Row: {
150
+ ack: string | null
151
+ author: string | null
152
+ body: string | null
153
+ broadcast: boolean | null
154
+ broadcast_id: string | null
155
+ chat_id: string | null
156
+ delivery_info: Json | null
157
+ device_type: string | null
158
+ duration: string | null
159
+ forwarding_score: number | null
160
+ from: string | null
161
+ from_me: boolean | null
162
+ frt_timestamp: string | null
163
+ has_media: boolean | null
164
+ has_quoted_msg: boolean | null
165
+ has_reaction: boolean | null
166
+ id: Json | null
167
+ invite_v4: Json | null
168
+ is_deleted: boolean | null
169
+ is_ephemeral: boolean | null
170
+ is_flagged: boolean | null
171
+ is_forwarded: boolean | null
172
+ is_gif: boolean | null
173
+ is_starred: boolean | null
174
+ is_status: boolean | null
175
+ links: Json | null
176
+ location: Json | null
177
+ media: Json | null
178
+ media_key: string | null
179
+ mentioned_ids: string[] | null
180
+ message_id: string
181
+ message_ticket_id: string | null
182
+ message_type: string | null
183
+ order_id: string | null
184
+ org_id: string
185
+ org_phone: string
186
+ performed_by: string | null
187
+ prev_body: string | null
188
+ quoted_message_id: string | null
189
+ raw_data: Json | null
190
+ sender_phone: string | null
191
+ sent_message_id: string | null
192
+ timestamp: string | null
193
+ to: string | null
194
+ token: string | null
195
+ unique_id: string | null
196
+ updated_at: string | null
197
+ vcards: string[] | null
198
+ }
199
+ Insert: {
200
+ ack?: string | null
201
+ author?: string | null
202
+ body?: string | null
203
+ broadcast?: boolean | null
204
+ broadcast_id?: string | null
205
+ chat_id?: string | null
206
+ delivery_info?: Json | null
207
+ device_type?: string | null
208
+ duration?: string | null
209
+ forwarding_score?: number | null
210
+ from?: string | null
211
+ from_me?: boolean | null
212
+ frt_timestamp?: string | null
213
+ has_media?: boolean | null
214
+ has_quoted_msg?: boolean | null
215
+ has_reaction?: boolean | null
216
+ id?: Json | null
217
+ invite_v4?: Json | null
218
+ is_deleted?: boolean | null
219
+ is_ephemeral?: boolean | null
220
+ is_flagged?: boolean | null
221
+ is_forwarded?: boolean | null
222
+ is_gif?: boolean | null
223
+ is_starred?: boolean | null
224
+ is_status?: boolean | null
225
+ links?: Json | null
226
+ location?: Json | null
227
+ media?: Json | null
228
+ media_key?: string | null
229
+ mentioned_ids?: string[] | null
230
+ message_id: string
231
+ message_ticket_id?: string | null
232
+ message_type?: string | null
233
+ order_id?: string | null
234
+ org_id: string
235
+ org_phone: string
236
+ performed_by?: string | null
237
+ prev_body?: string | null
238
+ quoted_message_id?: string | null
239
+ raw_data?: Json | null
240
+ sender_phone?: string | null
241
+ sent_message_id?: string | null
242
+ timestamp?: string | null
243
+ to?: string | null
244
+ token?: string | null
245
+ unique_id?: string | null
246
+ updated_at?: string | null
247
+ vcards?: string[] | null
248
+ }
249
+ Update: {
250
+ ack?: string | null
251
+ author?: string | null
252
+ body?: string | null
253
+ broadcast?: boolean | null
254
+ broadcast_id?: string | null
255
+ chat_id?: string | null
256
+ delivery_info?: Json | null
257
+ device_type?: string | null
258
+ duration?: string | null
259
+ forwarding_score?: number | null
260
+ from?: string | null
261
+ from_me?: boolean | null
262
+ frt_timestamp?: string | null
263
+ has_media?: boolean | null
264
+ has_quoted_msg?: boolean | null
265
+ has_reaction?: boolean | null
266
+ id?: Json | null
267
+ invite_v4?: Json | null
268
+ is_deleted?: boolean | null
269
+ is_ephemeral?: boolean | null
270
+ is_flagged?: boolean | null
271
+ is_forwarded?: boolean | null
272
+ is_gif?: boolean | null
273
+ is_starred?: boolean | null
274
+ is_status?: boolean | null
275
+ links?: Json | null
276
+ location?: Json | null
277
+ media?: Json | null
278
+ media_key?: string | null
279
+ mentioned_ids?: string[] | null
280
+ message_id?: string
281
+ message_ticket_id?: string | null
282
+ message_type?: string | null
283
+ order_id?: string | null
284
+ org_id?: string
285
+ org_phone?: string
286
+ performed_by?: string | null
287
+ prev_body?: string | null
288
+ quoted_message_id?: string | null
289
+ raw_data?: Json | null
290
+ sender_phone?: string | null
291
+ sent_message_id?: string | null
292
+ timestamp?: string | null
293
+ to?: string | null
294
+ token?: string | null
295
+ unique_id?: string | null
296
+ updated_at?: string | null
297
+ vcards?: string[] | null
298
+ }
299
+ Relationships: [
300
+ {
301
+ foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones"
302
+ columns: ["org_phone", "org_id"]
303
+ isOneToOne: false
304
+ referencedRelation: "tbl_org_phones"
305
+ referencedColumns: ["org_phone", "org_id"]
306
+ }
307
+ ]
308
+ }
309
+ tbl_chat_notifications: {
310
+ Row: {
311
+ author: string | null
312
+ body: string | null
313
+ chat_id: string | null
314
+ id: Json | null
315
+ notification_id: string
316
+ org_id: string
317
+ org_phone: string
318
+ recipientids: string[] | null
319
+ timestamp: string | null
320
+ type: string | null
321
+ unique_id: string | null
322
+ }
323
+ Insert: {
324
+ author?: string | null
325
+ body?: string | null
326
+ chat_id?: string | null
327
+ id?: Json | null
328
+ notification_id: string
329
+ org_id: string
330
+ org_phone: string
331
+ recipientids?: string[] | null
332
+ timestamp?: string | null
333
+ type?: string | null
334
+ unique_id?: string | null
335
+ }
336
+ Update: {
337
+ author?: string | null
338
+ body?: string | null
339
+ chat_id?: string | null
340
+ id?: Json | null
341
+ notification_id?: string
342
+ org_id?: string
343
+ org_phone?: string
344
+ recipientids?: string[] | null
345
+ timestamp?: string | null
346
+ type?: string | null
347
+ unique_id?: string | null
348
+ }
349
+ Relationships: [
350
+ {
351
+ foreignKeyName: "tbl_chat_notifications_fkey_tbl_org_phones"
352
+ columns: ["org_id", "org_phone"]
353
+ isOneToOne: false
354
+ referencedRelation: "tbl_org_phones"
355
+ referencedColumns: ["org_id", "org_phone"]
356
+ }
357
+ ]
358
+ }
359
+ tbl_chat_participants: {
360
+ Row: {
361
+ chat_id: string
362
+ contact_id: string
363
+ id: Json | null
364
+ is_admin: boolean | null
365
+ is_super_admin: boolean | null
366
+ org_id: string
367
+ org_phone: string
368
+ }
369
+ Insert: {
370
+ chat_id: string
371
+ contact_id: string
372
+ id?: Json | null
373
+ is_admin?: boolean | null
374
+ is_super_admin?: boolean | null
375
+ org_id: string
376
+ org_phone: string
377
+ }
378
+ Update: {
379
+ chat_id?: string
380
+ contact_id?: string
381
+ id?: Json | null
382
+ is_admin?: boolean | null
383
+ is_super_admin?: boolean | null
384
+ org_id?: string
385
+ org_phone?: string
386
+ }
387
+ Relationships: [
388
+ {
389
+ foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
390
+ columns: ["org_id", "org_phone", "chat_id"]
391
+ isOneToOne: false
392
+ referencedRelation: "tbl_chats"
393
+ referencedColumns: ["org_id", "org_phone", "chat_id"]
394
+ },
395
+ {
396
+ foreignKeyName: "tbl_chat_participants_fkey_tbl_chats"
397
+ columns: ["org_id", "org_phone", "chat_id"]
398
+ isOneToOne: false
399
+ referencedRelation: "view_chats"
400
+ referencedColumns: ["org_id", "org_phone", "chat_id"]
401
+ }
402
+ ]
403
+ }
404
+ tbl_chat_reactions: {
405
+ Row: {
406
+ ack: number | null
407
+ chat_id: string | null
408
+ id: Json | null
409
+ message_id: string
410
+ msg_id: Json | null
411
+ org_id: string
412
+ org_phone: string
413
+ orphan: number | null
414
+ orphan_reason: string | null
415
+ reaction: string | null
416
+ reaction_id: string
417
+ read: boolean | null
418
+ sender_id: string
419
+ timestamp: string | null
420
+ unique_id: string | null
421
+ }
422
+ Insert: {
423
+ ack?: number | null
424
+ chat_id?: string | null
425
+ id?: Json | null
426
+ message_id: string
427
+ msg_id?: Json | null
428
+ org_id: string
429
+ org_phone: string
430
+ orphan?: number | null
431
+ orphan_reason?: string | null
432
+ reaction?: string | null
433
+ reaction_id: string
434
+ read?: boolean | null
435
+ sender_id: string
436
+ timestamp?: string | null
437
+ unique_id?: string | null
438
+ }
439
+ Update: {
440
+ ack?: number | null
441
+ chat_id?: string | null
442
+ id?: Json | null
443
+ message_id?: string
444
+ msg_id?: Json | null
445
+ org_id?: string
446
+ org_phone?: string
447
+ orphan?: number | null
448
+ orphan_reason?: string | null
449
+ reaction?: string | null
450
+ reaction_id?: string
451
+ read?: boolean | null
452
+ sender_id?: string
453
+ timestamp?: string | null
454
+ unique_id?: string | null
455
+ }
456
+ Relationships: [
457
+ {
458
+ foreignKeyName: "tbl_chat_reactions_fkey_tbl_org_phones"
459
+ columns: ["org_id", "org_phone"]
460
+ isOneToOne: false
461
+ referencedRelation: "tbl_org_phones"
462
+ referencedColumns: ["org_id", "org_phone"]
463
+ }
464
+ ]
465
+ }
466
+ tbl_chat_tickets: {
467
+ Row: {
468
+ assigned_by: string | null
469
+ assignee: string | null
470
+ chat_id: string
471
+ created_at: string
472
+ due_date: string | null
473
+ is_deleted: boolean
474
+ label_ids: Json | null
475
+ last_updated_at: string
476
+ org_id: string
477
+ priority: number | null
478
+ quoted_message_id: string | null
479
+ raised_by: string | null
480
+ status: Database["public"]["Enums"]["enum_chat_tickets_status"] | null
481
+ subject: string
482
+ ticket_id: string
483
+ }
484
+ Insert: {
485
+ assigned_by?: string | null
486
+ assignee?: string | null
487
+ chat_id: string
488
+ created_at?: string
489
+ due_date?: string | null
490
+ is_deleted?: boolean
491
+ label_ids?: Json | null
492
+ last_updated_at?: string
493
+ org_id: string
494
+ priority?: number | null
495
+ quoted_message_id?: string | null
496
+ raised_by?: string | null
497
+ status?:
498
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
499
+ | null
500
+ subject: string
501
+ ticket_id?: string
502
+ }
503
+ Update: {
504
+ assigned_by?: string | null
505
+ assignee?: string | null
506
+ chat_id?: string
507
+ created_at?: string
508
+ due_date?: string | null
509
+ is_deleted?: boolean
510
+ label_ids?: Json | null
511
+ last_updated_at?: string
512
+ org_id?: string
513
+ priority?: number | null
514
+ quoted_message_id?: string | null
515
+ raised_by?: string | null
516
+ status?:
517
+ | Database["public"]["Enums"]["enum_chat_tickets_status"]
518
+ | null
519
+ subject?: string
520
+ ticket_id?: string
521
+ }
522
+ Relationships: [
523
+ {
524
+ foreignKeyName: "tbl_chat_tickets_org_id_fkey"
525
+ columns: ["org_id"]
526
+ isOneToOne: false
527
+ referencedRelation: "tbl_org"
528
+ referencedColumns: ["org_id"]
529
+ }
530
+ ]
531
+ }
532
+ tbl_chats: {
533
+ Row: {
534
+ archived: boolean | null
535
+ chat_id: string
536
+ chat_image: string | null
537
+ custom_properties: Json | null
538
+ group_metadata: Json | null
539
+ id: Json | null
540
+ invite_link: string | null
541
+ is_group: boolean | null
542
+ is_muted: boolean | null
543
+ is_read_only: boolean | null
544
+ label_ids: Json
545
+ latest_message: Json | null
546
+ member_count: number | null
547
+ mute_expiration: number | null
548
+ name: string | null
549
+ org_id: string
550
+ org_phone: string
551
+ pinned: boolean | null
552
+ timestamp: string | null
553
+ unread_count: number | null
554
+ updated_at: string
555
+ }
556
+ Insert: {
557
+ archived?: boolean | null
558
+ chat_id: string
559
+ chat_image?: string | null
560
+ custom_properties?: Json | null
561
+ group_metadata?: Json | null
562
+ id?: Json | null
563
+ invite_link?: string | null
564
+ is_group?: boolean | null
565
+ is_muted?: boolean | null
566
+ is_read_only?: boolean | null
567
+ label_ids?: Json
568
+ latest_message?: Json | null
569
+ member_count?: number | null
570
+ mute_expiration?: number | null
571
+ name?: string | null
572
+ org_id: string
573
+ org_phone: string
574
+ pinned?: boolean | null
575
+ timestamp?: string | null
576
+ unread_count?: number | null
577
+ updated_at?: string
578
+ }
579
+ Update: {
580
+ archived?: boolean | null
581
+ chat_id?: string
582
+ chat_image?: string | null
583
+ custom_properties?: Json | null
584
+ group_metadata?: Json | null
585
+ id?: Json | null
586
+ invite_link?: string | null
587
+ is_group?: boolean | null
588
+ is_muted?: boolean | null
589
+ is_read_only?: boolean | null
590
+ label_ids?: Json
591
+ latest_message?: Json | null
592
+ member_count?: number | null
593
+ mute_expiration?: number | null
594
+ name?: string | null
595
+ org_id?: string
596
+ org_phone?: string
597
+ pinned?: boolean | null
598
+ timestamp?: string | null
599
+ unread_count?: number | null
600
+ updated_at?: string
601
+ }
602
+ Relationships: [
603
+ {
604
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
605
+ columns: ["org_phone", "org_id"]
606
+ isOneToOne: false
607
+ referencedRelation: "tbl_org_phones"
608
+ referencedColumns: ["org_phone", "org_id"]
609
+ }
610
+ ]
611
+ }
612
+ tbl_contacts: {
613
+ Row: {
614
+ business_profile: Json | null
615
+ contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null
616
+ contact_id: string
617
+ contact_image: string | null
618
+ contact_name: string | null
619
+ contact_type: string | null
620
+ id: Json | null
621
+ is_blocked: boolean | null
622
+ is_business: boolean | null
623
+ is_enterprise: boolean | null
624
+ is_group: boolean | null
625
+ is_internal: boolean | null
626
+ is_me: boolean | null
627
+ is_my_contact: boolean | null
628
+ is_user: boolean | null
629
+ is_wa_contact: boolean | null
630
+ label_ids: Json
631
+ name: string | null
632
+ number: string | null
633
+ org_id: string
634
+ pushname: string | null
635
+ short_name: string | null
636
+ updated_at: string | null
637
+ verified_level: number | null
638
+ verified_name: string | null
639
+ }
640
+ Insert: {
641
+ business_profile?: Json | null
642
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
643
+ contact_id: string
644
+ contact_image?: string | null
645
+ contact_name?: string | null
646
+ contact_type?: string | null
647
+ id?: Json | null
648
+ is_blocked?: boolean | null
649
+ is_business?: boolean | null
650
+ is_enterprise?: boolean | null
651
+ is_group?: boolean | null
652
+ is_internal?: boolean | null
653
+ is_me?: boolean | null
654
+ is_my_contact?: boolean | null
655
+ is_user?: boolean | null
656
+ is_wa_contact?: boolean | null
657
+ label_ids?: Json
658
+ name?: string | null
659
+ number?: string | null
660
+ org_id: string
661
+ pushname?: string | null
662
+ short_name?: string | null
663
+ updated_at?: string | null
664
+ verified_level?: number | null
665
+ verified_name?: string | null
666
+ }
667
+ Update: {
668
+ business_profile?: Json | null
669
+ contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null
670
+ contact_id?: string
671
+ contact_image?: string | null
672
+ contact_name?: string | null
673
+ contact_type?: string | null
674
+ id?: Json | null
675
+ is_blocked?: boolean | null
676
+ is_business?: boolean | null
677
+ is_enterprise?: boolean | null
678
+ is_group?: boolean | null
679
+ is_internal?: boolean | null
680
+ is_me?: boolean | null
681
+ is_my_contact?: boolean | null
682
+ is_user?: boolean | null
683
+ is_wa_contact?: boolean | null
684
+ label_ids?: Json
685
+ name?: string | null
686
+ number?: string | null
687
+ org_id?: string
688
+ pushname?: string | null
689
+ short_name?: string | null
690
+ updated_at?: string | null
691
+ verified_level?: number | null
692
+ verified_name?: string | null
693
+ }
694
+ Relationships: [
695
+ {
696
+ foreignKeyName: "tbl_contacts_org_id_fkey"
697
+ columns: ["org_id"]
698
+ isOneToOne: false
699
+ referencedRelation: "tbl_org"
700
+ referencedColumns: ["org_id"]
701
+ }
702
+ ]
703
+ }
704
+ tbl_custom_properties: {
705
+ Row: {
706
+ created_at: string
707
+ created_by: string | null
708
+ org_id: string | null
709
+ property_id: string
710
+ property_name: string
711
+ property_value: string | null
712
+ property_value_type: string | null
713
+ type: string | null
714
+ }
715
+ Insert: {
716
+ created_at?: string
717
+ created_by?: string | null
718
+ org_id?: string | null
719
+ property_id?: string
720
+ property_name: string
721
+ property_value?: string | null
722
+ property_value_type?: string | null
723
+ type?: string | null
724
+ }
725
+ Update: {
726
+ created_at?: string
727
+ created_by?: string | null
728
+ org_id?: string | null
729
+ property_id?: string
730
+ property_name?: string
731
+ property_value?: string | null
732
+ property_value_type?: string | null
733
+ type?: string | null
734
+ }
735
+ Relationships: [
736
+ {
737
+ foreignKeyName: "tbl_custom_properties_org_id_fkey"
738
+ columns: ["org_id"]
739
+ isOneToOne: false
740
+ referencedRelation: "tbl_org"
741
+ referencedColumns: ["org_id"]
742
+ }
743
+ ]
744
+ }
745
+ tbl_integration_hooks: {
746
+ Row: {
747
+ hook_url: string
748
+ id: string
749
+ integration_id: string | null
750
+ integration_metadata: Json
751
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
752
+ integration_type: string
753
+ is_subscribed: boolean
754
+ org_id: string
755
+ subscribed_at: string
756
+ type: string
757
+ }
758
+ Insert: {
759
+ hook_url: string
760
+ id?: string
761
+ integration_id?: string | null
762
+ integration_metadata: Json
763
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
764
+ integration_type: string
765
+ is_subscribed: boolean
766
+ org_id: string
767
+ subscribed_at?: string
768
+ type: string
769
+ }
770
+ Update: {
771
+ hook_url?: string
772
+ id?: string
773
+ integration_id?: string | null
774
+ integration_metadata?: Json
775
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
776
+ integration_type?: string
777
+ is_subscribed?: boolean
778
+ org_id?: string
779
+ subscribed_at?: string
780
+ type?: string
781
+ }
782
+ Relationships: [
783
+ {
784
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey"
785
+ columns: ["org_id"]
786
+ isOneToOne: false
787
+ referencedRelation: "tbl_org"
788
+ referencedColumns: ["org_id"]
789
+ }
790
+ ]
791
+ }
792
+ tbl_integration_logs: {
793
+ Row: {
794
+ created_at: string
795
+ id: string
796
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
797
+ integration_type: string
798
+ metadata: Json
799
+ org_id: string
800
+ success: boolean
801
+ type: string
802
+ }
803
+ Insert: {
804
+ created_at?: string
805
+ id?: string
806
+ integration_name: Database["public"]["Enums"]["enum_integration_name"]
807
+ integration_type: string
808
+ metadata?: Json
809
+ org_id: string
810
+ success?: boolean
811
+ type: string
812
+ }
813
+ Update: {
814
+ created_at?: string
815
+ id?: string
816
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"]
817
+ integration_type?: string
818
+ metadata?: Json
819
+ org_id?: string
820
+ success?: boolean
821
+ type?: string
822
+ }
823
+ Relationships: [
824
+ {
825
+ foreignKeyName: "tbl_integration_logs_org_id_fkey"
826
+ columns: ["org_id"]
827
+ isOneToOne: false
828
+ referencedRelation: "tbl_org"
829
+ referencedColumns: ["org_id"]
830
+ }
831
+ ]
832
+ }
833
+ tbl_integration_tokens: {
834
+ Row: {
835
+ exp: string
836
+ iat: string
837
+ id: string
838
+ is_revealed: boolean
839
+ name: string
840
+ org_id: string
841
+ role: string
842
+ token: string
843
+ type: string
844
+ }
845
+ Insert: {
846
+ exp: string
847
+ iat: string
848
+ id?: string
849
+ is_revealed?: boolean
850
+ name: string
851
+ org_id: string
852
+ role: string
853
+ token: string
854
+ type: string
855
+ }
856
+ Update: {
857
+ exp?: string
858
+ iat?: string
859
+ id?: string
860
+ is_revealed?: boolean
861
+ name?: string
862
+ org_id?: string
863
+ role?: string
864
+ token?: string
865
+ type?: string
866
+ }
867
+ Relationships: [
868
+ {
869
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
870
+ columns: ["org_id"]
871
+ isOneToOne: false
872
+ referencedRelation: "tbl_org"
873
+ referencedColumns: ["org_id"]
874
+ }
875
+ ]
876
+ }
877
+ tbl_org: {
878
+ Row: {
879
+ created_at: string
880
+ org_id: string
881
+ org_image: string | null
882
+ org_metadata: Json | null
883
+ org_name: string | null
884
+ org_plan: Json | null
885
+ stripe_customer_details: Json | null
886
+ stripe_customer_id: string | null
887
+ stripe_subscription_details: Json | null
888
+ support_link: string | null
889
+ }
890
+ Insert: {
891
+ created_at?: string
892
+ org_id?: string
893
+ org_image?: string | null
894
+ org_metadata?: Json | null
895
+ org_name?: string | null
896
+ org_plan?: Json | null
897
+ stripe_customer_details?: Json | null
898
+ stripe_customer_id?: string | null
899
+ stripe_subscription_details?: Json | null
900
+ support_link?: string | null
901
+ }
902
+ Update: {
903
+ created_at?: string
904
+ org_id?: string
905
+ org_image?: string | null
906
+ org_metadata?: Json | null
907
+ org_name?: string | null
908
+ org_plan?: Json | null
909
+ stripe_customer_details?: Json | null
910
+ stripe_customer_id?: string | null
911
+ stripe_subscription_details?: Json | null
912
+ support_link?: string | null
913
+ }
914
+ Relationships: []
915
+ }
916
+ tbl_org_labels: {
917
+ Row: {
918
+ color: string
919
+ created_at: string
920
+ label_id: string
921
+ name: string
922
+ org_id: string
923
+ type: string
924
+ }
925
+ Insert: {
926
+ color?: string
927
+ created_at?: string
928
+ label_id?: string
929
+ name: string
930
+ org_id: string
931
+ type?: string
932
+ }
933
+ Update: {
934
+ color?: string
935
+ created_at?: string
936
+ label_id?: string
937
+ name?: string
938
+ org_id?: string
939
+ type?: string
940
+ }
941
+ Relationships: [
942
+ {
943
+ foreignKeyName: "tbl_org_labels_org_id_fkey"
944
+ columns: ["org_id"]
945
+ isOneToOne: false
946
+ referencedRelation: "tbl_org"
947
+ referencedColumns: ["org_id"]
948
+ }
949
+ ]
950
+ }
951
+ tbl_org_members: {
952
+ Row: {
953
+ created_at: string | null
954
+ email: string
955
+ invited_at: string | null
956
+ invited_by: string | null
957
+ is_active: boolean
958
+ member_color: Database["public"]["Enums"]["enum_chat_colors"]
959
+ member_image: string | null
960
+ member_name: string | null
961
+ org_id: string
962
+ role: Database["public"]["Enums"]["enum_member_role"]
963
+ user_id: string | null
964
+ }
965
+ Insert: {
966
+ created_at?: string | null
967
+ email: string
968
+ invited_at?: string | null
969
+ invited_by?: string | null
970
+ is_active?: boolean
971
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
972
+ member_image?: string | null
973
+ member_name?: string | null
974
+ org_id: string
975
+ role?: Database["public"]["Enums"]["enum_member_role"]
976
+ user_id?: string | null
977
+ }
978
+ Update: {
979
+ created_at?: string | null
980
+ email?: string
981
+ invited_at?: string | null
982
+ invited_by?: string | null
983
+ is_active?: boolean
984
+ member_color?: Database["public"]["Enums"]["enum_chat_colors"]
985
+ member_image?: string | null
986
+ member_name?: string | null
987
+ org_id?: string
988
+ role?: Database["public"]["Enums"]["enum_member_role"]
989
+ user_id?: string | null
990
+ }
991
+ Relationships: [
992
+ {
993
+ foreignKeyName: "tbl_org_members_fkey_auth_users"
994
+ columns: ["user_id"]
995
+ isOneToOne: false
996
+ referencedRelation: "users"
997
+ referencedColumns: ["id"]
998
+ },
999
+ {
1000
+ foreignKeyName: "tbl_org_members_fkey_tbl_org"
1001
+ columns: ["org_id"]
1002
+ isOneToOne: false
1003
+ referencedRelation: "tbl_org"
1004
+ referencedColumns: ["org_id"]
1005
+ }
1006
+ ]
1007
+ }
1008
+ tbl_org_phones: {
1009
+ Row: {
1010
+ created_at: string
1011
+ first_connected_at: string | null
1012
+ is_ready: boolean | null
1013
+ org_id: string
1014
+ org_phone: string | null
1015
+ phone_id: string
1016
+ phone_image: string | null
1017
+ phone_name: string | null
1018
+ qr_code: string | null
1019
+ server_ip: string | null
1020
+ updated_at: string | null
1021
+ wa_state: string | null
1022
+ }
1023
+ Insert: {
1024
+ created_at?: string
1025
+ first_connected_at?: string | null
1026
+ is_ready?: boolean | null
1027
+ org_id: string
1028
+ org_phone?: string | null
1029
+ phone_id?: string
1030
+ phone_image?: string | null
1031
+ phone_name?: string | null
1032
+ qr_code?: string | null
1033
+ server_ip?: string | null
1034
+ updated_at?: string | null
1035
+ wa_state?: string | null
1036
+ }
1037
+ Update: {
1038
+ created_at?: string
1039
+ first_connected_at?: string | null
1040
+ is_ready?: boolean | null
1041
+ org_id?: string
1042
+ org_phone?: string | null
1043
+ phone_id?: string
1044
+ phone_image?: string | null
1045
+ phone_name?: string | null
1046
+ qr_code?: string | null
1047
+ server_ip?: string | null
1048
+ updated_at?: string | null
1049
+ wa_state?: string | null
1050
+ }
1051
+ Relationships: [
1052
+ {
1053
+ foreignKeyName: "tbl_org_phones_fkey_tbl_org"
1054
+ columns: ["org_id"]
1055
+ isOneToOne: false
1056
+ referencedRelation: "tbl_org"
1057
+ referencedColumns: ["org_id"]
1058
+ },
1059
+ {
1060
+ foreignKeyName: "tbl_org_phones_org_id_fkey"
1061
+ columns: ["org_id"]
1062
+ isOneToOne: false
1063
+ referencedRelation: "tbl_org"
1064
+ referencedColumns: ["org_id"]
1065
+ }
1066
+ ]
1067
+ }
1068
+ tbl_tools_whatsapp_links: {
1069
+ Row: {
1070
+ created_at: string
1071
+ link_id: string
1072
+ link_name: string
1073
+ message: string | null
1074
+ phone: string
1075
+ }
1076
+ Insert: {
1077
+ created_at?: string
1078
+ link_id?: string
1079
+ link_name: string
1080
+ message?: string | null
1081
+ phone: string
1082
+ }
1083
+ Update: {
1084
+ created_at?: string
1085
+ link_id?: string
1086
+ link_name?: string
1087
+ message?: string | null
1088
+ phone?: string
1089
+ }
1090
+ Relationships: []
1091
+ }
1092
+ }
1093
+ Views: {
1094
+ view_broadcast_logs: {
1095
+ Row: {
1096
+ broadcast_id: string | null
1097
+ completed_at: string | null
1098
+ created_at: string | null
1099
+ delivered_member_count: number | null
1100
+ delivery_percentage: number | null
1101
+ failed_chats: number | null
1102
+ message_payload: Json | null
1103
+ org_id: string | null
1104
+ performed_by: string | null
1105
+ read_member_count: number | null
1106
+ read_percentage: number | null
1107
+ scheduled_at: string | null
1108
+ sent_chats: number | null
1109
+ total_chats: number | null
1110
+ total_member_count: number | null
1111
+ }
1112
+ Relationships: [
1113
+ {
1114
+ foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
1115
+ columns: ["org_id"]
1116
+ isOneToOne: false
1117
+ referencedRelation: "tbl_org"
1118
+ referencedColumns: ["org_id"]
1119
+ }
1120
+ ]
1121
+ }
1122
+ view_chats: {
1123
+ Row: {
1124
+ active_phone: string | null
1125
+ chat_access: Json | null
1126
+ chat_id: string | null
1127
+ chat_image: string | null
1128
+ chat_name: string | null
1129
+ chat_org_phones: string[] | null
1130
+ chat_type: string | null
1131
+ custom_properties: Json | null
1132
+ group_description: string | null
1133
+ has_access: boolean | null
1134
+ invite_link: string | null
1135
+ is_archived: boolean | null
1136
+ is_muted: boolean | null
1137
+ label_ids: Json | null
1138
+ last_read_timestamp: string | null
1139
+ latest_message: Json | null
1140
+ member_count: number | null
1141
+ members: Json | null
1142
+ org_id: string | null
1143
+ org_phone: string | null
1144
+ updated_at: string | null
1145
+ }
1146
+ Relationships: [
1147
+ {
1148
+ foreignKeyName: "tbl_chats_fkey_tbl_org_phones"
1149
+ columns: ["org_phone", "org_id"]
1150
+ isOneToOne: false
1151
+ referencedRelation: "tbl_org_phones"
1152
+ referencedColumns: ["org_phone", "org_id"]
1153
+ }
1154
+ ]
1155
+ }
1156
+ }
1157
+ Functions: {
1158
+ gen_id: {
1159
+ Args: {
1160
+ prefix: string
1161
+ size?: number
1162
+ alphabet?: string
1163
+ }
1164
+ Returns: string
1165
+ }
1166
+ gen_ticket_id: {
1167
+ Args: {
1168
+ org_id_input: string
1169
+ }
1170
+ Returns: string
1171
+ }
1172
+ generate_access_token: {
1173
+ Args: {
1174
+ name_input?: string
1175
+ type_input?: string
1176
+ org_id_input?: string
1177
+ }
1178
+ Returns: Json
1179
+ }
1180
+ get_broadcast_id: {
1181
+ Args: {
1182
+ broadcast_id_input: string
1183
+ chat_id_input?: string
1184
+ }
1185
+ Returns: Json
1186
+ }
1187
+ get_chat_labels_data: {
1188
+ Args: {
1189
+ org_id_input: string
1190
+ chat_ids_input?: string[]
1191
+ }
1192
+ Returns: unknown
1193
+ }
1194
+ get_chats: {
1195
+ Args: {
1196
+ org_id_input: string
1197
+ chat_id_input?: string[]
1198
+ with_metadata?: boolean
1199
+ last_updated_at_input?: string
1200
+ }
1201
+ Returns: Json
1202
+ }
1203
+ get_contacts: {
1204
+ Args: {
1205
+ org_id_input: string
1206
+ contact_ids_input?: string[]
1207
+ last_updated_at_input?: string
1208
+ }
1209
+ Returns: Json
1210
+ }
1211
+ get_dashboard_statistics: {
1212
+ Args: {
1213
+ org_id_input: string
1214
+ type_input?: string
1215
+ interval_input?: unknown
1216
+ }
1217
+ Returns: Json
1218
+ }
1219
+ get_export_chats_data: {
1220
+ Args: {
1221
+ org_id_input: string
1222
+ chat_ids?: string[]
1223
+ }
1224
+ Returns: Json
1225
+ }
1226
+ get_messages_notifications_reactions: {
1227
+ Args: {
1228
+ org_id_input: string
1229
+ chat_id_input?: string[]
1230
+ message_limit_input?: number
1231
+ reaction_notification_limit_input?: number
1232
+ last_updated_at_input?: string
1233
+ }
1234
+ Returns: Json
1235
+ }
1236
+ get_org: {
1237
+ Args: {
1238
+ org_id_input?: string
1239
+ }
1240
+ Returns: Json
1241
+ }
1242
+ get_ticket_info: {
1243
+ Args: {
1244
+ ticket_id_input?: string
1245
+ org_id_input?: string
1246
+ chat_id_input?: string
1247
+ unique_message_id_input?: string
1248
+ }
1249
+ Returns: Json
1250
+ }
1251
+ list_org_from_user: {
1252
+ Args: Record<PropertyKey, never>
1253
+ Returns: unknown
1254
+ }
1255
+ list_role_from_user: {
1256
+ Args: Record<PropertyKey, never>
1257
+ Returns: Database["public"]["Enums"]["enum_member_role"]
1258
+ }
1259
+ update_labels: {
1260
+ Args: {
1261
+ org_id_input: string
1262
+ tbl_type: string
1263
+ label_ids_input: Json
1264
+ row_id_input: string[]
1265
+ replace_labels?: boolean
1266
+ }
1267
+ Returns: undefined
1268
+ }
1269
+ }
1270
+ Enums: {
1271
+ enum_chat_colors:
1272
+ | "#B4876E"
1273
+ | "#A5B337"
1274
+ | "#06CF9C"
1275
+ | "#25D366"
1276
+ | "#02A698"
1277
+ | "#7D9EF1"
1278
+ | "#007BFC"
1279
+ | "#5E47DE"
1280
+ | "#7F66FF"
1281
+ | "#9333EA"
1282
+ | "#FA6533"
1283
+ | "#C4532D"
1284
+ | "#DC2626"
1285
+ | "#FF2E74"
1286
+ | "#DB2777"
1287
+ enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived"
1288
+ enum_integration_name: "new_ticket"
1289
+ enum_member_role: "admin" | "member"
1290
+ }
1291
+ CompositeTypes: {
1292
+ [_ in never]: never
1293
+ }
1294
+ }
1295
+ storage: {
1296
+ Tables: {
1297
+ buckets: {
1298
+ Row: {
1299
+ allowed_mime_types: string[] | null
1300
+ avif_autodetection: boolean | null
1301
+ created_at: string | null
1302
+ file_size_limit: number | null
1303
+ id: string
1304
+ name: string
1305
+ owner: string | null
1306
+ owner_id: string | null
1307
+ public: boolean | null
1308
+ updated_at: string | null
1309
+ }
1310
+ Insert: {
1311
+ allowed_mime_types?: string[] | null
1312
+ avif_autodetection?: boolean | null
1313
+ created_at?: string | null
1314
+ file_size_limit?: number | null
1315
+ id: string
1316
+ name: string
1317
+ owner?: string | null
1318
+ owner_id?: string | null
1319
+ public?: boolean | null
1320
+ updated_at?: string | null
1321
+ }
1322
+ Update: {
1323
+ allowed_mime_types?: string[] | null
1324
+ avif_autodetection?: boolean | null
1325
+ created_at?: string | null
1326
+ file_size_limit?: number | null
1327
+ id?: string
1328
+ name?: string
1329
+ owner?: string | null
1330
+ owner_id?: string | null
1331
+ public?: boolean | null
1332
+ updated_at?: string | null
1333
+ }
1334
+ Relationships: []
1335
+ }
1336
+ migrations: {
1337
+ Row: {
1338
+ executed_at: string | null
1339
+ hash: string
1340
+ id: number
1341
+ name: string
1342
+ }
1343
+ Insert: {
1344
+ executed_at?: string | null
1345
+ hash: string
1346
+ id: number
1347
+ name: string
1348
+ }
1349
+ Update: {
1350
+ executed_at?: string | null
1351
+ hash?: string
1352
+ id?: number
1353
+ name?: string
1354
+ }
1355
+ Relationships: []
1356
+ }
1357
+ objects: {
1358
+ Row: {
1359
+ bucket_id: string | null
1360
+ created_at: string | null
1361
+ id: string
1362
+ last_accessed_at: string | null
1363
+ metadata: Json | null
1364
+ name: string | null
1365
+ owner: string | null
1366
+ owner_id: string | null
1367
+ path_tokens: string[] | null
1368
+ updated_at: string | null
1369
+ version: string | null
1370
+ }
1371
+ Insert: {
1372
+ bucket_id?: string | null
1373
+ created_at?: string | null
1374
+ id?: string
1375
+ last_accessed_at?: string | null
1376
+ metadata?: Json | null
1377
+ name?: string | null
1378
+ owner?: string | null
1379
+ owner_id?: string | null
1380
+ path_tokens?: string[] | null
1381
+ updated_at?: string | null
1382
+ version?: string | null
1383
+ }
1384
+ Update: {
1385
+ bucket_id?: string | null
1386
+ created_at?: string | null
1387
+ id?: string
1388
+ last_accessed_at?: string | null
1389
+ metadata?: Json | null
1390
+ name?: string | null
1391
+ owner?: string | null
1392
+ owner_id?: string | null
1393
+ path_tokens?: string[] | null
1394
+ updated_at?: string | null
1395
+ version?: string | null
1396
+ }
1397
+ Relationships: [
1398
+ {
1399
+ foreignKeyName: "objects_bucketId_fkey"
1400
+ columns: ["bucket_id"]
1401
+ isOneToOne: false
1402
+ referencedRelation: "buckets"
1403
+ referencedColumns: ["id"]
1404
+ }
1405
+ ]
1406
+ }
1407
+ }
1408
+ Views: {
1409
+ [_ in never]: never
1410
+ }
1411
+ Functions: {
1412
+ can_insert_object: {
1413
+ Args: {
1414
+ bucketid: string
1415
+ name: string
1416
+ owner: string
1417
+ metadata: Json
1418
+ }
1419
+ Returns: undefined
1420
+ }
1421
+ extension: {
1422
+ Args: {
1423
+ name: string
1424
+ }
1425
+ Returns: string
1426
+ }
1427
+ filename: {
1428
+ Args: {
1429
+ name: string
1430
+ }
1431
+ Returns: string
1432
+ }
1433
+ foldername: {
1434
+ Args: {
1435
+ name: string
1436
+ }
1437
+ Returns: unknown
1438
+ }
1439
+ get_size_by_bucket: {
1440
+ Args: Record<PropertyKey, never>
1441
+ Returns: {
1442
+ size: number
1443
+ bucket_id: string
1444
+ }[]
1445
+ }
1446
+ search: {
1447
+ Args: {
1448
+ prefix: string
1449
+ bucketname: string
1450
+ limits?: number
1451
+ levels?: number
1452
+ offsets?: number
1453
+ search?: string
1454
+ sortcolumn?: string
1455
+ sortorder?: string
1456
+ }
1457
+ Returns: {
1458
+ name: string
1459
+ id: string
1460
+ updated_at: string
1461
+ created_at: string
1462
+ last_accessed_at: string
1463
+ metadata: Json
1464
+ }[]
1465
+ }
1466
+ }
1467
+ Enums: {
1468
+ [_ in never]: never
1469
+ }
1470
+ CompositeTypes: {
1471
+ [_ in never]: never
1472
+ }
1473
+ }
1474
+ }
1475
+
1476
+ export type Tables<
1477
+ PublicTableNameOrOptions extends
1478
+ | keyof (Database["public"]["Tables"] & Database["public"]["Views"])
1479
+ | { schema: keyof Database },
1480
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1481
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1482
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
1483
+ : never = never
1484
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1485
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
1486
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1487
+ Row: infer R
1488
+ }
1489
+ ? R
1490
+ : never
1491
+ : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] &
1492
+ Database["public"]["Views"])
1493
+ ? (Database["public"]["Tables"] &
1494
+ Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1495
+ Row: infer R
1496
+ }
1497
+ ? R
1498
+ : never
1499
+ : never
1500
+
1501
+ export type TablesInsert<
1502
+ PublicTableNameOrOptions extends
1503
+ | keyof Database["public"]["Tables"]
1504
+ | { schema: keyof Database },
1505
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1506
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1507
+ : never = never
1508
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1509
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1510
+ Insert: infer I
1511
+ }
1512
+ ? I
1513
+ : never
1514
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1515
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1516
+ Insert: infer I
1517
+ }
1518
+ ? I
1519
+ : never
1520
+ : never
1521
+
1522
+ export type TablesUpdate<
1523
+ PublicTableNameOrOptions extends
1524
+ | keyof Database["public"]["Tables"]
1525
+ | { schema: keyof Database },
1526
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
1527
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
1528
+ : never = never
1529
+ > = PublicTableNameOrOptions extends { schema: keyof Database }
1530
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1531
+ Update: infer U
1532
+ }
1533
+ ? U
1534
+ : never
1535
+ : PublicTableNameOrOptions extends keyof Database["public"]["Tables"]
1536
+ ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1537
+ Update: infer U
1538
+ }
1539
+ ? U
1540
+ : never
1541
+ : never
1542
+
1543
+ export type Enums<
1544
+ PublicEnumNameOrOptions extends
1545
+ | keyof Database["public"]["Enums"]
1546
+ | { schema: keyof Database },
1547
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
1548
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
1549
+ : never = never
1550
+ > = PublicEnumNameOrOptions extends { schema: keyof Database }
1551
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
1552
+ : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"]
1553
+ ? Database["public"]["Enums"][PublicEnumNameOrOptions]
1554
+ : never
1555
+
1403
1556