@frequencyads/db 0.1.0

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.
@@ -0,0 +1,1233 @@
1
+ import * as _supabase_supabase_js from '@supabase/supabase-js';
2
+ import { Database, Json } from './types.mjs';
3
+
4
+ declare function createServerClient(hostname?: string): Promise<_supabase_supabase_js.SupabaseClient<Database, "public", "public", {
5
+ Tables: {
6
+ cata_chat_message: {
7
+ Row: {
8
+ approved: boolean | null;
9
+ content: string;
10
+ conversation_id: string;
11
+ created_at: string;
12
+ deleted_at: string | null;
13
+ id: string;
14
+ role: string;
15
+ tool_input: string | null;
16
+ tool_name: string | null;
17
+ tool_use_id: string | null;
18
+ updated_at: string;
19
+ };
20
+ Insert: {
21
+ approved?: boolean | null;
22
+ content: string;
23
+ conversation_id: string;
24
+ created_at?: string;
25
+ deleted_at?: string | null;
26
+ id?: string;
27
+ role: string;
28
+ tool_input?: string | null;
29
+ tool_name?: string | null;
30
+ tool_use_id?: string | null;
31
+ updated_at?: string;
32
+ };
33
+ Update: {
34
+ approved?: boolean | null;
35
+ content?: string;
36
+ conversation_id?: string;
37
+ created_at?: string;
38
+ deleted_at?: string | null;
39
+ id?: string;
40
+ role?: string;
41
+ tool_input?: string | null;
42
+ tool_name?: string | null;
43
+ tool_use_id?: string | null;
44
+ updated_at?: string;
45
+ };
46
+ Relationships: [];
47
+ };
48
+ cata_conversation: {
49
+ Row: {
50
+ created_at: string;
51
+ deleted_at: string | null;
52
+ id: string;
53
+ last_message_at: string | null;
54
+ organization_id: string;
55
+ title: string | null;
56
+ updated_at: string;
57
+ user_id: string;
58
+ };
59
+ Insert: {
60
+ created_at?: string;
61
+ deleted_at?: string | null;
62
+ id?: string;
63
+ last_message_at?: string | null;
64
+ organization_id: string;
65
+ title?: string | null;
66
+ updated_at?: string;
67
+ user_id: string;
68
+ };
69
+ Update: {
70
+ created_at?: string;
71
+ deleted_at?: string | null;
72
+ id?: string;
73
+ last_message_at?: string | null;
74
+ organization_id?: string;
75
+ title?: string | null;
76
+ updated_at?: string;
77
+ user_id?: string;
78
+ };
79
+ Relationships: [{
80
+ foreignKeyName: "fk_cata_conversation_organization_id";
81
+ columns: ["organization_id"];
82
+ isOneToOne: false;
83
+ referencedRelation: "organization";
84
+ referencedColumns: ["id"];
85
+ }];
86
+ };
87
+ cata_dismissed_duplicate: {
88
+ Row: {
89
+ created_at: string;
90
+ deleted_at: string | null;
91
+ dismissed_by: string;
92
+ id: string;
93
+ organization_id: string;
94
+ record_a_fingerprint: string;
95
+ record_b_fingerprint: string;
96
+ updated_at: string;
97
+ };
98
+ Insert: {
99
+ created_at?: string;
100
+ deleted_at?: string | null;
101
+ dismissed_by: string;
102
+ id?: string;
103
+ organization_id: string;
104
+ record_a_fingerprint: string;
105
+ record_b_fingerprint: string;
106
+ updated_at?: string;
107
+ };
108
+ Update: {
109
+ created_at?: string;
110
+ deleted_at?: string | null;
111
+ dismissed_by?: string;
112
+ id?: string;
113
+ organization_id?: string;
114
+ record_a_fingerprint?: string;
115
+ record_b_fingerprint?: string;
116
+ updated_at?: string;
117
+ };
118
+ Relationships: [{
119
+ foreignKeyName: "fk_cata_dismissed_duplicate_dismissed_by";
120
+ columns: ["dismissed_by"];
121
+ isOneToOne: false;
122
+ referencedRelation: "user";
123
+ referencedColumns: ["id"];
124
+ }, {
125
+ foreignKeyName: "fk_cata_dismissed_duplicate_organization_id";
126
+ columns: ["organization_id"];
127
+ isOneToOne: false;
128
+ referencedRelation: "organization";
129
+ referencedColumns: ["id"];
130
+ }];
131
+ };
132
+ category: {
133
+ Row: {
134
+ color: string | null;
135
+ created_at: string;
136
+ deleted_at: string | null;
137
+ id: string;
138
+ name: string;
139
+ slug: string | null;
140
+ updated_at: string;
141
+ };
142
+ Insert: {
143
+ color?: string | null;
144
+ created_at?: string;
145
+ deleted_at?: string | null;
146
+ id?: string;
147
+ name: string;
148
+ slug?: string | null;
149
+ updated_at?: string;
150
+ };
151
+ Update: {
152
+ color?: string | null;
153
+ created_at?: string;
154
+ deleted_at?: string | null;
155
+ id?: string;
156
+ name?: string;
157
+ slug?: string | null;
158
+ updated_at?: string;
159
+ };
160
+ Relationships: [];
161
+ };
162
+ collection: {
163
+ Row: {
164
+ color: string | null;
165
+ created_at: string;
166
+ created_by: string;
167
+ deleted_at: string | null;
168
+ description: string | null;
169
+ icon: string | null;
170
+ id: string;
171
+ last_edited_by: string | null;
172
+ name: string;
173
+ organization_id: string;
174
+ show_count: number | null;
175
+ slug: string;
176
+ updated_at: string;
177
+ };
178
+ Insert: {
179
+ color?: string | null;
180
+ created_at?: string;
181
+ created_by: string;
182
+ deleted_at?: string | null;
183
+ description?: string | null;
184
+ icon?: string | null;
185
+ id?: string;
186
+ last_edited_by?: string | null;
187
+ name: string;
188
+ organization_id: string;
189
+ show_count?: number | null;
190
+ slug: string;
191
+ updated_at?: string;
192
+ };
193
+ Update: {
194
+ color?: string | null;
195
+ created_at?: string;
196
+ created_by?: string;
197
+ deleted_at?: string | null;
198
+ description?: string | null;
199
+ icon?: string | null;
200
+ id?: string;
201
+ last_edited_by?: string | null;
202
+ name?: string;
203
+ organization_id?: string;
204
+ show_count?: number | null;
205
+ slug?: string;
206
+ updated_at?: string;
207
+ };
208
+ Relationships: [{
209
+ foreignKeyName: "fk_collection_organization_id";
210
+ columns: ["organization_id"];
211
+ isOneToOne: false;
212
+ referencedRelation: "organization";
213
+ referencedColumns: ["id"];
214
+ }];
215
+ };
216
+ collection_show: {
217
+ Row: {
218
+ collection_id: string;
219
+ created_at: string;
220
+ deleted_at: string | null;
221
+ id: string;
222
+ organization_id: string;
223
+ position: number | null;
224
+ show_id: string;
225
+ updated_at: string;
226
+ };
227
+ Insert: {
228
+ collection_id: string;
229
+ created_at?: string;
230
+ deleted_at?: string | null;
231
+ id?: string;
232
+ organization_id: string;
233
+ position?: number | null;
234
+ show_id: string;
235
+ updated_at?: string;
236
+ };
237
+ Update: {
238
+ collection_id?: string;
239
+ created_at?: string;
240
+ deleted_at?: string | null;
241
+ id?: string;
242
+ organization_id?: string;
243
+ position?: number | null;
244
+ show_id?: string;
245
+ updated_at?: string;
246
+ };
247
+ Relationships: [{
248
+ foreignKeyName: "fk_collection_show_collection_id";
249
+ columns: ["collection_id"];
250
+ isOneToOne: false;
251
+ referencedRelation: "collection";
252
+ referencedColumns: ["id"];
253
+ }, {
254
+ foreignKeyName: "fk_collection_show_organization_id";
255
+ columns: ["organization_id"];
256
+ isOneToOne: false;
257
+ referencedRelation: "organization";
258
+ referencedColumns: ["id"];
259
+ }, {
260
+ foreignKeyName: "fk_collection_show_show_id";
261
+ columns: ["show_id"];
262
+ isOneToOne: false;
263
+ referencedRelation: "show";
264
+ referencedColumns: ["id"];
265
+ }];
266
+ };
267
+ import_job: {
268
+ Row: {
269
+ completed_at: string | null;
270
+ created_at: string;
271
+ created_by: string;
272
+ deleted_at: string | null;
273
+ error_count: number | null;
274
+ file_name: string;
275
+ id: string;
276
+ imported_count: number | null;
277
+ organization_id: string;
278
+ row_count: number | null;
279
+ status: string;
280
+ updated_at: string;
281
+ warning_count: number | null;
282
+ };
283
+ Insert: {
284
+ completed_at?: string | null;
285
+ created_at?: string;
286
+ created_by: string;
287
+ deleted_at?: string | null;
288
+ error_count?: number | null;
289
+ file_name: string;
290
+ id?: string;
291
+ imported_count?: number | null;
292
+ organization_id: string;
293
+ row_count?: number | null;
294
+ status: string;
295
+ updated_at?: string;
296
+ warning_count?: number | null;
297
+ };
298
+ Update: {
299
+ completed_at?: string | null;
300
+ created_at?: string;
301
+ created_by?: string;
302
+ deleted_at?: string | null;
303
+ error_count?: number | null;
304
+ file_name?: string;
305
+ id?: string;
306
+ imported_count?: number | null;
307
+ organization_id?: string;
308
+ row_count?: number | null;
309
+ status?: string;
310
+ updated_at?: string;
311
+ warning_count?: number | null;
312
+ };
313
+ Relationships: [{
314
+ foreignKeyName: "fk_import_job_created_by";
315
+ columns: ["created_by"];
316
+ isOneToOne: false;
317
+ referencedRelation: "user";
318
+ referencedColumns: ["id"];
319
+ }, {
320
+ foreignKeyName: "fk_import_job_organization_id";
321
+ columns: ["organization_id"];
322
+ isOneToOne: false;
323
+ referencedRelation: "organization";
324
+ referencedColumns: ["id"];
325
+ }];
326
+ };
327
+ network: {
328
+ Row: {
329
+ created_at: string;
330
+ deleted_at: string | null;
331
+ description: string | null;
332
+ id: string;
333
+ name: string;
334
+ organization_id: string;
335
+ slug: string | null;
336
+ updated_at: string;
337
+ website_url: string | null;
338
+ };
339
+ Insert: {
340
+ created_at?: string;
341
+ deleted_at?: string | null;
342
+ description?: string | null;
343
+ id?: string;
344
+ name: string;
345
+ organization_id: string;
346
+ slug?: string | null;
347
+ updated_at?: string;
348
+ website_url?: string | null;
349
+ };
350
+ Update: {
351
+ created_at?: string;
352
+ deleted_at?: string | null;
353
+ description?: string | null;
354
+ id?: string;
355
+ name?: string;
356
+ organization_id?: string;
357
+ slug?: string | null;
358
+ updated_at?: string;
359
+ website_url?: string | null;
360
+ };
361
+ Relationships: [{
362
+ foreignKeyName: "fk_network_organization_id";
363
+ columns: ["organization_id"];
364
+ isOneToOne: false;
365
+ referencedRelation: "organization";
366
+ referencedColumns: ["id"];
367
+ }];
368
+ };
369
+ organization: {
370
+ Row: {
371
+ created_at: string | null;
372
+ deleted_at: string | null;
373
+ description: string | null;
374
+ id: string;
375
+ name: string;
376
+ slug: string | null;
377
+ updated_at: string | null;
378
+ };
379
+ Insert: {
380
+ created_at?: string | null;
381
+ deleted_at?: string | null;
382
+ description?: string | null;
383
+ id?: string;
384
+ name: string;
385
+ slug?: string | null;
386
+ updated_at?: string | null;
387
+ };
388
+ Update: {
389
+ created_at?: string | null;
390
+ deleted_at?: string | null;
391
+ description?: string | null;
392
+ id?: string;
393
+ name?: string;
394
+ slug?: string | null;
395
+ updated_at?: string | null;
396
+ };
397
+ Relationships: [];
398
+ };
399
+ perm_org_setting: {
400
+ Row: {
401
+ created_at: string;
402
+ deleted_at: string | null;
403
+ description: string | null;
404
+ id: string;
405
+ key: string;
406
+ org_id: string;
407
+ tenant_id: string;
408
+ updated_at: string;
409
+ value: Json;
410
+ };
411
+ Insert: {
412
+ created_at?: string;
413
+ deleted_at?: string | null;
414
+ description?: string | null;
415
+ id?: string;
416
+ key: string;
417
+ org_id: string;
418
+ tenant_id: string;
419
+ updated_at?: string;
420
+ value: Json;
421
+ };
422
+ Update: {
423
+ created_at?: string;
424
+ deleted_at?: string | null;
425
+ description?: string | null;
426
+ id?: string;
427
+ key?: string;
428
+ org_id?: string;
429
+ tenant_id?: string;
430
+ updated_at?: string;
431
+ value?: Json;
432
+ };
433
+ Relationships: [{
434
+ foreignKeyName: "fk_perm_org_setting_org_id";
435
+ columns: ["org_id"];
436
+ isOneToOne: false;
437
+ referencedRelation: "organization";
438
+ referencedColumns: ["id"];
439
+ }, {
440
+ foreignKeyName: "fk_perm_org_setting_tenant_id";
441
+ columns: ["tenant_id"];
442
+ isOneToOne: false;
443
+ referencedRelation: "organization";
444
+ referencedColumns: ["id"];
445
+ }];
446
+ };
447
+ perm_organization_domain: {
448
+ Row: {
449
+ created_at: string;
450
+ default_role: string;
451
+ deleted_at: string | null;
452
+ domain: string;
453
+ grant_global_admin: boolean;
454
+ id: string;
455
+ organization_id: string;
456
+ updated_at: string;
457
+ };
458
+ Insert: {
459
+ created_at?: string;
460
+ default_role?: string;
461
+ deleted_at?: string | null;
462
+ domain: string;
463
+ grant_global_admin?: boolean;
464
+ id?: string;
465
+ organization_id: string;
466
+ updated_at?: string;
467
+ };
468
+ Update: {
469
+ created_at?: string;
470
+ default_role?: string;
471
+ deleted_at?: string | null;
472
+ domain?: string;
473
+ grant_global_admin?: boolean;
474
+ id?: string;
475
+ organization_id?: string;
476
+ updated_at?: string;
477
+ };
478
+ Relationships: [{
479
+ foreignKeyName: "organization_domain_organization_id_fkey";
480
+ columns: ["organization_id"];
481
+ isOneToOne: false;
482
+ referencedRelation: "organization";
483
+ referencedColumns: ["id"];
484
+ }];
485
+ };
486
+ perm_organization_member: {
487
+ Row: {
488
+ created_at: string | null;
489
+ deleted_at: string | null;
490
+ id: string;
491
+ organization_id: string;
492
+ role: string;
493
+ status: string;
494
+ updated_at: string;
495
+ user_id: string;
496
+ };
497
+ Insert: {
498
+ created_at?: string | null;
499
+ deleted_at?: string | null;
500
+ id?: string;
501
+ organization_id: string;
502
+ role: string;
503
+ status?: string;
504
+ updated_at?: string;
505
+ user_id: string;
506
+ };
507
+ Update: {
508
+ created_at?: string | null;
509
+ deleted_at?: string | null;
510
+ id?: string;
511
+ organization_id?: string;
512
+ role?: string;
513
+ status?: string;
514
+ updated_at?: string;
515
+ user_id?: string;
516
+ };
517
+ Relationships: [{
518
+ foreignKeyName: "fk_perm_organization_member_user_id";
519
+ columns: ["user_id"];
520
+ isOneToOne: false;
521
+ referencedRelation: "user";
522
+ referencedColumns: ["id"];
523
+ }, {
524
+ foreignKeyName: "perm_organization_member_org_fk";
525
+ columns: ["organization_id"];
526
+ isOneToOne: false;
527
+ referencedRelation: "organization";
528
+ referencedColumns: ["id"];
529
+ }];
530
+ };
531
+ perm_permission: {
532
+ Row: {
533
+ action: string;
534
+ conditions: Json | null;
535
+ created_at: string | null;
536
+ deleted_at: string | null;
537
+ entity: string;
538
+ id: string;
539
+ role_id: string;
540
+ scope: string;
541
+ updated_at: string;
542
+ };
543
+ Insert: {
544
+ action: string;
545
+ conditions?: Json | null;
546
+ created_at?: string | null;
547
+ deleted_at?: string | null;
548
+ entity: string;
549
+ id?: string;
550
+ role_id: string;
551
+ scope: string;
552
+ updated_at?: string;
553
+ };
554
+ Update: {
555
+ action?: string;
556
+ conditions?: Json | null;
557
+ created_at?: string | null;
558
+ deleted_at?: string | null;
559
+ entity?: string;
560
+ id?: string;
561
+ role_id?: string;
562
+ scope?: string;
563
+ updated_at?: string;
564
+ };
565
+ Relationships: [{
566
+ foreignKeyName: "fk_perm_permission_role_id";
567
+ columns: ["role_id"];
568
+ isOneToOne: false;
569
+ referencedRelation: "perm_role";
570
+ referencedColumns: ["id"];
571
+ }];
572
+ };
573
+ perm_role: {
574
+ Row: {
575
+ created_at: string | null;
576
+ deleted_at: string | null;
577
+ description: string | null;
578
+ id: string;
579
+ name: string;
580
+ tenant_id: string;
581
+ updated_at: string;
582
+ };
583
+ Insert: {
584
+ created_at?: string | null;
585
+ deleted_at?: string | null;
586
+ description?: string | null;
587
+ id?: string;
588
+ name: string;
589
+ tenant_id: string;
590
+ updated_at?: string;
591
+ };
592
+ Update: {
593
+ created_at?: string | null;
594
+ deleted_at?: string | null;
595
+ description?: string | null;
596
+ id?: string;
597
+ name?: string;
598
+ tenant_id?: string;
599
+ updated_at?: string;
600
+ };
601
+ Relationships: [{
602
+ foreignKeyName: "fk_perm_role_tenant_id";
603
+ columns: ["tenant_id"];
604
+ isOneToOne: false;
605
+ referencedRelation: "organization";
606
+ referencedColumns: ["id"];
607
+ }];
608
+ };
609
+ perm_show_manager: {
610
+ Row: {
611
+ created_at: string;
612
+ deleted_at: string | null;
613
+ id: string;
614
+ show_id: string;
615
+ updated_at: string;
616
+ user_id: string;
617
+ };
618
+ Insert: {
619
+ created_at?: string;
620
+ deleted_at?: string | null;
621
+ id?: string;
622
+ show_id: string;
623
+ updated_at?: string;
624
+ user_id: string;
625
+ };
626
+ Update: {
627
+ created_at?: string;
628
+ deleted_at?: string | null;
629
+ id?: string;
630
+ show_id?: string;
631
+ updated_at?: string;
632
+ user_id?: string;
633
+ };
634
+ Relationships: [{
635
+ foreignKeyName: "fk_perm_show_manager_show_id";
636
+ columns: ["show_id"];
637
+ isOneToOne: false;
638
+ referencedRelation: "show";
639
+ referencedColumns: ["id"];
640
+ }, {
641
+ foreignKeyName: "fk_perm_show_manager_user_id";
642
+ columns: ["user_id"];
643
+ isOneToOne: false;
644
+ referencedRelation: "user";
645
+ referencedColumns: ["id"];
646
+ }];
647
+ };
648
+ perm_tenant_setting: {
649
+ Row: {
650
+ created_at: string;
651
+ deleted_at: string | null;
652
+ description: string | null;
653
+ id: string;
654
+ key: string;
655
+ tenant_id: string;
656
+ updated_at: string;
657
+ value: Json;
658
+ };
659
+ Insert: {
660
+ created_at?: string;
661
+ deleted_at?: string | null;
662
+ description?: string | null;
663
+ id?: string;
664
+ key: string;
665
+ tenant_id: string;
666
+ updated_at?: string;
667
+ value: Json;
668
+ };
669
+ Update: {
670
+ created_at?: string;
671
+ deleted_at?: string | null;
672
+ description?: string | null;
673
+ id?: string;
674
+ key?: string;
675
+ tenant_id?: string;
676
+ updated_at?: string;
677
+ value?: Json;
678
+ };
679
+ Relationships: [{
680
+ foreignKeyName: "fk_perm_tenant_setting_tenant_id";
681
+ columns: ["tenant_id"];
682
+ isOneToOne: false;
683
+ referencedRelation: "organization";
684
+ referencedColumns: ["id"];
685
+ }];
686
+ };
687
+ perm_user_global_role: {
688
+ Row: {
689
+ created_at: string;
690
+ deleted_at: string | null;
691
+ id: string;
692
+ role: string;
693
+ updated_at: string;
694
+ user_id: string;
695
+ };
696
+ Insert: {
697
+ created_at?: string;
698
+ deleted_at?: string | null;
699
+ id?: string;
700
+ role: string;
701
+ updated_at?: string;
702
+ user_id: string;
703
+ };
704
+ Update: {
705
+ created_at?: string;
706
+ deleted_at?: string | null;
707
+ id?: string;
708
+ role?: string;
709
+ updated_at?: string;
710
+ user_id?: string;
711
+ };
712
+ Relationships: [{
713
+ foreignKeyName: "fk_perm_user_global_role_user_id";
714
+ columns: ["user_id"];
715
+ isOneToOne: true;
716
+ referencedRelation: "user";
717
+ referencedColumns: ["id"];
718
+ }];
719
+ };
720
+ perm_user_role: {
721
+ Row: {
722
+ created_at: string | null;
723
+ deleted_at: string | null;
724
+ id: string;
725
+ org_id: string | null;
726
+ role_id: string;
727
+ tenant_id: string;
728
+ updated_at: string;
729
+ user_id: string;
730
+ };
731
+ Insert: {
732
+ created_at?: string | null;
733
+ deleted_at?: string | null;
734
+ id?: string;
735
+ org_id?: string | null;
736
+ role_id: string;
737
+ tenant_id: string;
738
+ updated_at?: string;
739
+ user_id: string;
740
+ };
741
+ Update: {
742
+ created_at?: string | null;
743
+ deleted_at?: string | null;
744
+ id?: string;
745
+ org_id?: string | null;
746
+ role_id?: string;
747
+ tenant_id?: string;
748
+ updated_at?: string;
749
+ user_id?: string;
750
+ };
751
+ Relationships: [{
752
+ foreignKeyName: "fk_perm_user_role_org_id";
753
+ columns: ["org_id"];
754
+ isOneToOne: false;
755
+ referencedRelation: "organization";
756
+ referencedColumns: ["id"];
757
+ }, {
758
+ foreignKeyName: "fk_perm_user_role_role_id";
759
+ columns: ["role_id"];
760
+ isOneToOne: false;
761
+ referencedRelation: "perm_role";
762
+ referencedColumns: ["id"];
763
+ }, {
764
+ foreignKeyName: "fk_perm_user_role_tenant_id";
765
+ columns: ["tenant_id"];
766
+ isOneToOne: false;
767
+ referencedRelation: "organization";
768
+ referencedColumns: ["id"];
769
+ }, {
770
+ foreignKeyName: "fk_perm_user_role_user_id";
771
+ columns: ["user_id"];
772
+ isOneToOne: false;
773
+ referencedRelation: "user";
774
+ referencedColumns: ["id"];
775
+ }];
776
+ };
777
+ perm_visibility_setting: {
778
+ Row: {
779
+ created_at: string;
780
+ deleted_at: string | null;
781
+ entity: string;
782
+ id: string;
783
+ owner_org_id: string;
784
+ owner_user_id: string;
785
+ record_id: string;
786
+ tenant_id: string;
787
+ updated_at: string;
788
+ visibility: string;
789
+ };
790
+ Insert: {
791
+ created_at?: string;
792
+ deleted_at?: string | null;
793
+ entity: string;
794
+ id?: string;
795
+ owner_org_id: string;
796
+ owner_user_id: string;
797
+ record_id: string;
798
+ tenant_id: string;
799
+ updated_at?: string;
800
+ visibility: string;
801
+ };
802
+ Update: {
803
+ created_at?: string;
804
+ deleted_at?: string | null;
805
+ entity?: string;
806
+ id?: string;
807
+ owner_org_id?: string;
808
+ owner_user_id?: string;
809
+ record_id?: string;
810
+ tenant_id?: string;
811
+ updated_at?: string;
812
+ visibility?: string;
813
+ };
814
+ Relationships: [{
815
+ foreignKeyName: "fk_perm_visibility_setting_owner_org_id";
816
+ columns: ["owner_org_id"];
817
+ isOneToOne: false;
818
+ referencedRelation: "organization";
819
+ referencedColumns: ["id"];
820
+ }, {
821
+ foreignKeyName: "fk_perm_visibility_setting_owner_user_id";
822
+ columns: ["owner_user_id"];
823
+ isOneToOne: false;
824
+ referencedRelation: "user";
825
+ referencedColumns: ["id"];
826
+ }, {
827
+ foreignKeyName: "fk_perm_visibility_setting_tenant_id";
828
+ columns: ["tenant_id"];
829
+ isOneToOne: false;
830
+ referencedRelation: "organization";
831
+ referencedColumns: ["id"];
832
+ }];
833
+ };
834
+ share: {
835
+ Row: {
836
+ collection_id: string;
837
+ created_at: string;
838
+ created_by: string;
839
+ deleted_at: string | null;
840
+ expires_at: string | null;
841
+ id: string;
842
+ last_accessed_at: string | null;
843
+ organization_id: string;
844
+ permission: string;
845
+ personal_message: string | null;
846
+ recipient_email: string;
847
+ revoked: boolean;
848
+ revoked_at: string | null;
849
+ token: string;
850
+ updated_at: string;
851
+ };
852
+ Insert: {
853
+ collection_id: string;
854
+ created_at?: string;
855
+ created_by: string;
856
+ deleted_at?: string | null;
857
+ expires_at?: string | null;
858
+ id?: string;
859
+ last_accessed_at?: string | null;
860
+ organization_id: string;
861
+ permission?: string;
862
+ personal_message?: string | null;
863
+ recipient_email: string;
864
+ revoked?: boolean;
865
+ revoked_at?: string | null;
866
+ token: string;
867
+ updated_at?: string;
868
+ };
869
+ Update: {
870
+ collection_id?: string;
871
+ created_at?: string;
872
+ created_by?: string;
873
+ deleted_at?: string | null;
874
+ expires_at?: string | null;
875
+ id?: string;
876
+ last_accessed_at?: string | null;
877
+ organization_id?: string;
878
+ permission?: string;
879
+ personal_message?: string | null;
880
+ recipient_email?: string;
881
+ revoked?: boolean;
882
+ revoked_at?: string | null;
883
+ token?: string;
884
+ updated_at?: string;
885
+ };
886
+ Relationships: [{
887
+ foreignKeyName: "fk_share_collection_id";
888
+ columns: ["collection_id"];
889
+ isOneToOne: false;
890
+ referencedRelation: "collection";
891
+ referencedColumns: ["id"];
892
+ }, {
893
+ foreignKeyName: "fk_share_organization_id";
894
+ columns: ["organization_id"];
895
+ isOneToOne: false;
896
+ referencedRelation: "organization";
897
+ referencedColumns: ["id"];
898
+ }];
899
+ };
900
+ show: {
901
+ Row: {
902
+ artwork_url: string | null;
903
+ audio_downloads: number | null;
904
+ created_at: string;
905
+ deleted_at: string | null;
906
+ description: string | null;
907
+ embedded_impressions: number | null;
908
+ host_name: string[] | null;
909
+ id: string;
910
+ name: string;
911
+ organization_id: string;
912
+ rss_feed: string | null;
913
+ slug: string | null;
914
+ supports_audio: boolean | null;
915
+ supports_dai: boolean | null;
916
+ supports_embedded: boolean | null;
917
+ supports_video: boolean | null;
918
+ updated_at: string;
919
+ };
920
+ Insert: {
921
+ artwork_url?: string | null;
922
+ audio_downloads?: number | null;
923
+ created_at?: string;
924
+ deleted_at?: string | null;
925
+ description?: string | null;
926
+ embedded_impressions?: number | null;
927
+ host_name?: string[] | null;
928
+ id?: string;
929
+ name: string;
930
+ organization_id: string;
931
+ rss_feed?: string | null;
932
+ slug?: string | null;
933
+ supports_audio?: boolean | null;
934
+ supports_dai?: boolean | null;
935
+ supports_embedded?: boolean | null;
936
+ supports_video?: boolean | null;
937
+ updated_at?: string;
938
+ };
939
+ Update: {
940
+ artwork_url?: string | null;
941
+ audio_downloads?: number | null;
942
+ created_at?: string;
943
+ deleted_at?: string | null;
944
+ description?: string | null;
945
+ embedded_impressions?: number | null;
946
+ host_name?: string[] | null;
947
+ id?: string;
948
+ name?: string;
949
+ organization_id?: string;
950
+ rss_feed?: string | null;
951
+ slug?: string | null;
952
+ supports_audio?: boolean | null;
953
+ supports_dai?: boolean | null;
954
+ supports_embedded?: boolean | null;
955
+ supports_video?: boolean | null;
956
+ updated_at?: string;
957
+ };
958
+ Relationships: [{
959
+ foreignKeyName: "show_organization_id_fkey";
960
+ columns: ["organization_id"];
961
+ isOneToOne: false;
962
+ referencedRelation: "organization";
963
+ referencedColumns: ["id"];
964
+ }];
965
+ };
966
+ show_category: {
967
+ Row: {
968
+ category_id: string;
969
+ created_at: string;
970
+ deleted_at: string | null;
971
+ id: string;
972
+ organization_id: string;
973
+ show_id: string;
974
+ updated_at: string;
975
+ };
976
+ Insert: {
977
+ category_id: string;
978
+ created_at?: string;
979
+ deleted_at?: string | null;
980
+ id?: string;
981
+ organization_id: string;
982
+ show_id: string;
983
+ updated_at?: string;
984
+ };
985
+ Update: {
986
+ category_id?: string;
987
+ created_at?: string;
988
+ deleted_at?: string | null;
989
+ id?: string;
990
+ organization_id?: string;
991
+ show_id?: string;
992
+ updated_at?: string;
993
+ };
994
+ Relationships: [{
995
+ foreignKeyName: "fk_show_category_category_id";
996
+ columns: ["category_id"];
997
+ isOneToOne: false;
998
+ referencedRelation: "category";
999
+ referencedColumns: ["id"];
1000
+ }, {
1001
+ foreignKeyName: "fk_show_category_organization_id";
1002
+ columns: ["organization_id"];
1003
+ isOneToOne: false;
1004
+ referencedRelation: "organization";
1005
+ referencedColumns: ["id"];
1006
+ }, {
1007
+ foreignKeyName: "fk_show_category_show_id";
1008
+ columns: ["show_id"];
1009
+ isOneToOne: false;
1010
+ referencedRelation: "show";
1011
+ referencedColumns: ["id"];
1012
+ }];
1013
+ };
1014
+ show_tag: {
1015
+ Row: {
1016
+ created_at: string;
1017
+ deleted_at: string | null;
1018
+ id: string;
1019
+ organization_id: string;
1020
+ show_id: string;
1021
+ tag_id: string;
1022
+ updated_at: string;
1023
+ };
1024
+ Insert: {
1025
+ created_at?: string;
1026
+ deleted_at?: string | null;
1027
+ id?: string;
1028
+ organization_id: string;
1029
+ show_id: string;
1030
+ tag_id: string;
1031
+ updated_at?: string;
1032
+ };
1033
+ Update: {
1034
+ created_at?: string;
1035
+ deleted_at?: string | null;
1036
+ id?: string;
1037
+ organization_id?: string;
1038
+ show_id?: string;
1039
+ tag_id?: string;
1040
+ updated_at?: string;
1041
+ };
1042
+ Relationships: [{
1043
+ foreignKeyName: "fk_show_tag_organization_id";
1044
+ columns: ["organization_id"];
1045
+ isOneToOne: false;
1046
+ referencedRelation: "organization";
1047
+ referencedColumns: ["id"];
1048
+ }, {
1049
+ foreignKeyName: "fk_show_tag_show_id";
1050
+ columns: ["show_id"];
1051
+ isOneToOne: false;
1052
+ referencedRelation: "show";
1053
+ referencedColumns: ["id"];
1054
+ }, {
1055
+ foreignKeyName: "fk_show_tag_tag_id";
1056
+ columns: ["tag_id"];
1057
+ isOneToOne: false;
1058
+ referencedRelation: "tag";
1059
+ referencedColumns: ["id"];
1060
+ }];
1061
+ };
1062
+ tag: {
1063
+ Row: {
1064
+ color: string | null;
1065
+ created_at: string;
1066
+ deleted_at: string | null;
1067
+ entity_type: string;
1068
+ id: string;
1069
+ name: string;
1070
+ organization_id: string;
1071
+ slug: string | null;
1072
+ updated_at: string;
1073
+ };
1074
+ Insert: {
1075
+ color?: string | null;
1076
+ created_at?: string;
1077
+ deleted_at?: string | null;
1078
+ entity_type: string;
1079
+ id?: string;
1080
+ name: string;
1081
+ organization_id: string;
1082
+ slug?: string | null;
1083
+ updated_at?: string;
1084
+ };
1085
+ Update: {
1086
+ color?: string | null;
1087
+ created_at?: string;
1088
+ deleted_at?: string | null;
1089
+ entity_type?: string;
1090
+ id?: string;
1091
+ name?: string;
1092
+ organization_id?: string;
1093
+ slug?: string | null;
1094
+ updated_at?: string;
1095
+ };
1096
+ Relationships: [{
1097
+ foreignKeyName: "fk_tag_organization_id";
1098
+ columns: ["organization_id"];
1099
+ isOneToOne: false;
1100
+ referencedRelation: "organization";
1101
+ referencedColumns: ["id"];
1102
+ }];
1103
+ };
1104
+ user: {
1105
+ Row: {
1106
+ avatar_url: string | null;
1107
+ created_at: string | null;
1108
+ deleted_at: string | null;
1109
+ display_name: string | null;
1110
+ email: string;
1111
+ id: string;
1112
+ updated_at: string | null;
1113
+ };
1114
+ Insert: {
1115
+ avatar_url?: string | null;
1116
+ created_at?: string | null;
1117
+ deleted_at?: string | null;
1118
+ display_name?: string | null;
1119
+ email: string;
1120
+ id: string;
1121
+ updated_at?: string | null;
1122
+ };
1123
+ Update: {
1124
+ avatar_url?: string | null;
1125
+ created_at?: string | null;
1126
+ deleted_at?: string | null;
1127
+ display_name?: string | null;
1128
+ email?: string;
1129
+ id?: string;
1130
+ updated_at?: string | null;
1131
+ };
1132
+ Relationships: [];
1133
+ };
1134
+ user_profile: {
1135
+ Row: {
1136
+ created_at: string;
1137
+ date_format: string;
1138
+ deleted_at: string | null;
1139
+ locale: string;
1140
+ notification_preferences: Json;
1141
+ timezone: string;
1142
+ updated_at: string;
1143
+ user_id: string;
1144
+ };
1145
+ Insert: {
1146
+ created_at?: string;
1147
+ date_format?: string;
1148
+ deleted_at?: string | null;
1149
+ locale?: string;
1150
+ notification_preferences?: Json;
1151
+ timezone?: string;
1152
+ updated_at?: string;
1153
+ user_id: string;
1154
+ };
1155
+ Update: {
1156
+ created_at?: string;
1157
+ date_format?: string;
1158
+ deleted_at?: string | null;
1159
+ locale?: string;
1160
+ notification_preferences?: Json;
1161
+ timezone?: string;
1162
+ updated_at?: string;
1163
+ user_id?: string;
1164
+ };
1165
+ Relationships: [{
1166
+ foreignKeyName: "user_profile_user_id_fkey";
1167
+ columns: ["user_id"];
1168
+ isOneToOne: true;
1169
+ referencedRelation: "user";
1170
+ referencedColumns: ["id"];
1171
+ }];
1172
+ };
1173
+ };
1174
+ Views: { [_ in never]: never; };
1175
+ Functions: {
1176
+ before_user_created: {
1177
+ Args: {
1178
+ event: Json;
1179
+ };
1180
+ Returns: Json;
1181
+ };
1182
+ get_org_for_email: {
1183
+ Args: {
1184
+ p_email: string;
1185
+ };
1186
+ Returns: {
1187
+ default_role: string;
1188
+ organization_id: string;
1189
+ }[];
1190
+ };
1191
+ is_catalog_client: {
1192
+ Args: never;
1193
+ Returns: boolean;
1194
+ };
1195
+ is_own_org: {
1196
+ Args: {
1197
+ org_id: string;
1198
+ };
1199
+ Returns: boolean;
1200
+ };
1201
+ is_share_permitted: {
1202
+ Args: {
1203
+ p_collection_id: string;
1204
+ p_required_permission: string;
1205
+ };
1206
+ Returns: boolean;
1207
+ };
1208
+ is_superadmin: {
1209
+ Args: never;
1210
+ Returns: boolean;
1211
+ };
1212
+ shares_org_with_current_user: {
1213
+ Args: {
1214
+ target_user_id: string;
1215
+ };
1216
+ Returns: boolean;
1217
+ };
1218
+ };
1219
+ Enums: {
1220
+ import_job_status: "pending" | "processing" | "complete" | "failed";
1221
+ message_role: "user" | "assistant" | "tool_use" | "tool_result";
1222
+ perm_global_role: "ADMIN" | "EMPLOYEE" | "GUEST" | "CLIENT";
1223
+ perm_organization_member_status: "pending" | "active";
1224
+ perm_organization_role: "NETWORK_ADMIN" | "NETWORK_EDITOR";
1225
+ perm_scope_type: "tenant" | "org" | "mine";
1226
+ perm_visibility_mode: "private" | "rollup" | "published";
1227
+ };
1228
+ CompositeTypes: { [_ in never]: never; };
1229
+ }, {
1230
+ PostgrestVersion: "12";
1231
+ }>>;
1232
+
1233
+ export { createServerClient };