@periskope/types 0.6.7 → 0.6.9-2.1

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