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