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