@periskope/types 0.6.12 → 0.6.13-7.2

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