@nextblock-cms/db 0.9.62 → 0.9.91

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,2197 @@
1
+ import { Database } from './types';
2
+ type Profile = Database['public']['Tables']['profiles']['Row'];
3
+ type Language = Database['public']['Tables']['languages']['Row'];
4
+ export declare const createClient: () => import('@supabase/supabase-js').SupabaseClient<any, "public", "public", any, any>;
5
+ export declare function getProfileWithRoleServerSide(userId: string): Promise<Profile | null>;
6
+ export declare function getActiveLanguagesServerSide(): Promise<Language[]>;
7
+ /**
8
+ * Creates a Supabase client with the Service Role key.
9
+ * ⚠️ WARNING: This bypasses ALL Row Level Security (RLS).
10
+ * MUST ONLY be used in secure server-side contexts (Server Actions/Route Handlers).
11
+ */
12
+ export declare const getServiceRoleSupabaseClient: () => import('@supabase/supabase-js').SupabaseClient<Database, "public", "public", {
13
+ Tables: {
14
+ blocks: {
15
+ Row: {
16
+ block_type: string;
17
+ content: import('./types').Json | null;
18
+ created_at: string;
19
+ id: number;
20
+ language_id: number;
21
+ order: number;
22
+ page_id: number | null;
23
+ post_id: number | null;
24
+ product_id: string | null;
25
+ updated_at: string;
26
+ };
27
+ Insert: {
28
+ block_type: string;
29
+ content?: import('./types').Json | null;
30
+ created_at?: string;
31
+ id?: number;
32
+ language_id: number;
33
+ order?: number;
34
+ page_id?: number | null;
35
+ post_id?: number | null;
36
+ product_id?: string | null;
37
+ updated_at?: string;
38
+ };
39
+ Update: {
40
+ block_type?: string;
41
+ content?: import('./types').Json | null;
42
+ created_at?: string;
43
+ id?: number;
44
+ language_id?: number;
45
+ order?: number;
46
+ page_id?: number | null;
47
+ post_id?: number | null;
48
+ product_id?: string | null;
49
+ updated_at?: string;
50
+ };
51
+ Relationships: [{
52
+ foreignKeyName: "blocks_language_id_fkey";
53
+ columns: ["language_id"];
54
+ isOneToOne: false;
55
+ referencedRelation: "languages";
56
+ referencedColumns: ["id"];
57
+ }, {
58
+ foreignKeyName: "blocks_page_id_fkey";
59
+ columns: ["page_id"];
60
+ isOneToOne: false;
61
+ referencedRelation: "pages";
62
+ referencedColumns: ["id"];
63
+ }, {
64
+ foreignKeyName: "blocks_post_id_fkey";
65
+ columns: ["post_id"];
66
+ isOneToOne: false;
67
+ referencedRelation: "posts";
68
+ referencedColumns: ["id"];
69
+ }, {
70
+ foreignKeyName: "blocks_product_id_fkey";
71
+ columns: ["product_id"];
72
+ isOneToOne: false;
73
+ referencedRelation: "products";
74
+ referencedColumns: ["id"];
75
+ }];
76
+ };
77
+ categories: {
78
+ Row: {
79
+ created_at: string;
80
+ description: string | null;
81
+ description_translations: import('./types').Json;
82
+ id: string;
83
+ name: string;
84
+ name_translations: import('./types').Json;
85
+ slug: string;
86
+ };
87
+ Insert: {
88
+ created_at?: string;
89
+ description?: string | null;
90
+ description_translations?: import('./types').Json;
91
+ id?: string;
92
+ name: string;
93
+ name_translations?: import('./types').Json;
94
+ slug: string;
95
+ };
96
+ Update: {
97
+ created_at?: string;
98
+ description?: string | null;
99
+ description_translations?: import('./types').Json;
100
+ id?: string;
101
+ name?: string;
102
+ name_translations?: import('./types').Json;
103
+ slug?: string;
104
+ };
105
+ Relationships: [];
106
+ };
107
+ content_drafts: {
108
+ Row: {
109
+ author_id: string | null;
110
+ base_version: number;
111
+ blocks: import('./types').Json;
112
+ created_at: string;
113
+ id: number;
114
+ meta: import('./types').Json;
115
+ parent_id: number;
116
+ parent_type: string;
117
+ updated_at: string;
118
+ };
119
+ Insert: {
120
+ author_id?: string | null;
121
+ base_version?: number;
122
+ blocks?: import('./types').Json;
123
+ created_at?: string;
124
+ id?: number;
125
+ meta?: import('./types').Json;
126
+ parent_id: number;
127
+ parent_type: string;
128
+ updated_at?: string;
129
+ };
130
+ Update: {
131
+ author_id?: string | null;
132
+ base_version?: number;
133
+ blocks?: import('./types').Json;
134
+ created_at?: string;
135
+ id?: number;
136
+ meta?: import('./types').Json;
137
+ parent_id?: number;
138
+ parent_type?: string;
139
+ updated_at?: string;
140
+ };
141
+ Relationships: [{
142
+ foreignKeyName: "content_drafts_author_id_fkey";
143
+ columns: ["author_id"];
144
+ isOneToOne: false;
145
+ referencedRelation: "profiles";
146
+ referencedColumns: ["id"];
147
+ }];
148
+ };
149
+ cortex_ai_db_mutation_audit: {
150
+ Row: {
151
+ action_name: string;
152
+ actor_user_id: string | null;
153
+ created_at: string;
154
+ error_message: string | null;
155
+ id: string;
156
+ operation_summary: string;
157
+ payload: import('./types').Json;
158
+ payload_hash: string;
159
+ preview: import('./types').Json;
160
+ status: string;
161
+ target_tables: string[];
162
+ tool_name: string;
163
+ };
164
+ Insert: {
165
+ action_name: string;
166
+ actor_user_id?: string | null;
167
+ created_at?: string;
168
+ error_message?: string | null;
169
+ id?: string;
170
+ operation_summary: string;
171
+ payload?: import('./types').Json;
172
+ payload_hash: string;
173
+ preview?: import('./types').Json;
174
+ status: string;
175
+ target_tables?: string[];
176
+ tool_name: string;
177
+ };
178
+ Update: {
179
+ action_name?: string;
180
+ actor_user_id?: string | null;
181
+ created_at?: string;
182
+ error_message?: string | null;
183
+ id?: string;
184
+ operation_summary?: string;
185
+ payload?: import('./types').Json;
186
+ payload_hash?: string;
187
+ preview?: import('./types').Json;
188
+ status?: string;
189
+ target_tables?: string[];
190
+ tool_name?: string;
191
+ };
192
+ Relationships: [{
193
+ foreignKeyName: "cortex_ai_db_mutation_audit_actor_user_id_fkey";
194
+ columns: ["actor_user_id"];
195
+ isOneToOne: false;
196
+ referencedRelation: "profiles";
197
+ referencedColumns: ["id"];
198
+ }];
199
+ };
200
+ coupon_freemius_mappings: {
201
+ Row: {
202
+ coupon_id: string;
203
+ created_at: string;
204
+ freemius_coupon_code: string;
205
+ freemius_coupon_id: string | null;
206
+ freemius_product_id: string;
207
+ id: string;
208
+ last_synced_at: string | null;
209
+ product_id: string | null;
210
+ remote_payload: import('./types').Json | null;
211
+ sync_error: string | null;
212
+ sync_status: string;
213
+ updated_at: string;
214
+ };
215
+ Insert: {
216
+ coupon_id: string;
217
+ created_at?: string;
218
+ freemius_coupon_code: string;
219
+ freemius_coupon_id?: string | null;
220
+ freemius_product_id: string;
221
+ id?: string;
222
+ last_synced_at?: string | null;
223
+ product_id?: string | null;
224
+ remote_payload?: import('./types').Json | null;
225
+ sync_error?: string | null;
226
+ sync_status?: string;
227
+ updated_at?: string;
228
+ };
229
+ Update: {
230
+ coupon_id?: string;
231
+ created_at?: string;
232
+ freemius_coupon_code?: string;
233
+ freemius_coupon_id?: string | null;
234
+ freemius_product_id?: string;
235
+ id?: string;
236
+ last_synced_at?: string | null;
237
+ product_id?: string | null;
238
+ remote_payload?: import('./types').Json | null;
239
+ sync_error?: string | null;
240
+ sync_status?: string;
241
+ updated_at?: string;
242
+ };
243
+ Relationships: [{
244
+ foreignKeyName: "coupon_freemius_mappings_coupon_id_fkey";
245
+ columns: ["coupon_id"];
246
+ isOneToOne: false;
247
+ referencedRelation: "coupons";
248
+ referencedColumns: ["id"];
249
+ }, {
250
+ foreignKeyName: "coupon_freemius_mappings_product_id_fkey";
251
+ columns: ["product_id"];
252
+ isOneToOne: false;
253
+ referencedRelation: "products";
254
+ referencedColumns: ["id"];
255
+ }];
256
+ };
257
+ coupon_products: {
258
+ Row: {
259
+ coupon_id: string;
260
+ created_at: string;
261
+ product_id: string;
262
+ };
263
+ Insert: {
264
+ coupon_id: string;
265
+ created_at?: string;
266
+ product_id: string;
267
+ };
268
+ Update: {
269
+ coupon_id?: string;
270
+ created_at?: string;
271
+ product_id?: string;
272
+ };
273
+ Relationships: [{
274
+ foreignKeyName: "coupon_products_coupon_id_fkey";
275
+ columns: ["coupon_id"];
276
+ isOneToOne: false;
277
+ referencedRelation: "coupons";
278
+ referencedColumns: ["id"];
279
+ }, {
280
+ foreignKeyName: "coupon_products_product_id_fkey";
281
+ columns: ["product_id"];
282
+ isOneToOne: false;
283
+ referencedRelation: "products";
284
+ referencedColumns: ["id"];
285
+ }];
286
+ };
287
+ coupon_redemptions: {
288
+ Row: {
289
+ coupon_code: string;
290
+ coupon_id: string | null;
291
+ customer_email: string | null;
292
+ discount_total: number;
293
+ id: string;
294
+ metadata: import('./types').Json;
295
+ order_id: string | null;
296
+ provider: string;
297
+ redeemed_at: string;
298
+ user_id: string | null;
299
+ };
300
+ Insert: {
301
+ coupon_code: string;
302
+ coupon_id?: string | null;
303
+ customer_email?: string | null;
304
+ discount_total?: number;
305
+ id?: string;
306
+ metadata?: import('./types').Json;
307
+ order_id?: string | null;
308
+ provider: string;
309
+ redeemed_at?: string;
310
+ user_id?: string | null;
311
+ };
312
+ Update: {
313
+ coupon_code?: string;
314
+ coupon_id?: string | null;
315
+ customer_email?: string | null;
316
+ discount_total?: number;
317
+ id?: string;
318
+ metadata?: import('./types').Json;
319
+ order_id?: string | null;
320
+ provider?: string;
321
+ redeemed_at?: string;
322
+ user_id?: string | null;
323
+ };
324
+ Relationships: [{
325
+ foreignKeyName: "coupon_redemptions_coupon_id_fkey";
326
+ columns: ["coupon_id"];
327
+ isOneToOne: false;
328
+ referencedRelation: "coupons";
329
+ referencedColumns: ["id"];
330
+ }, {
331
+ foreignKeyName: "coupon_redemptions_order_id_fkey";
332
+ columns: ["order_id"];
333
+ isOneToOne: false;
334
+ referencedRelation: "orders";
335
+ referencedColumns: ["id"];
336
+ }];
337
+ };
338
+ coupons: {
339
+ Row: {
340
+ code: string;
341
+ created_at: string;
342
+ discount_amount: number;
343
+ discount_type: string;
344
+ ends_at: string | null;
345
+ freemius_sync_error: string | null;
346
+ freemius_sync_status: string;
347
+ id: string;
348
+ internal_note: string | null;
349
+ is_active: boolean;
350
+ name: string;
351
+ provider_scope: string;
352
+ redemption_limit: number | null;
353
+ redemptions_count: number;
354
+ starts_at: string | null;
355
+ updated_at: string;
356
+ };
357
+ Insert: {
358
+ code: string;
359
+ created_at?: string;
360
+ discount_amount: number;
361
+ discount_type: string;
362
+ ends_at?: string | null;
363
+ freemius_sync_error?: string | null;
364
+ freemius_sync_status?: string;
365
+ id?: string;
366
+ internal_note?: string | null;
367
+ is_active?: boolean;
368
+ name: string;
369
+ provider_scope?: string;
370
+ redemption_limit?: number | null;
371
+ redemptions_count?: number;
372
+ starts_at?: string | null;
373
+ updated_at?: string;
374
+ };
375
+ Update: {
376
+ code?: string;
377
+ created_at?: string;
378
+ discount_amount?: number;
379
+ discount_type?: string;
380
+ ends_at?: string | null;
381
+ freemius_sync_error?: string | null;
382
+ freemius_sync_status?: string;
383
+ id?: string;
384
+ internal_note?: string | null;
385
+ is_active?: boolean;
386
+ name?: string;
387
+ provider_scope?: string;
388
+ redemption_limit?: number | null;
389
+ redemptions_count?: number;
390
+ starts_at?: string | null;
391
+ updated_at?: string;
392
+ };
393
+ Relationships: [];
394
+ };
395
+ currencies: {
396
+ Row: {
397
+ auto_sync_product_prices: boolean;
398
+ auto_update_exchange_rate: boolean;
399
+ code: string;
400
+ created_at: string;
401
+ exchange_rate: number;
402
+ exchange_rate_source: string | null;
403
+ exchange_rate_updated_at: string | null;
404
+ id: string;
405
+ is_active: boolean;
406
+ is_default: boolean;
407
+ rounding_charm_amount: number | null;
408
+ rounding_increment: number;
409
+ rounding_mode: string;
410
+ symbol: string;
411
+ updated_at: string;
412
+ };
413
+ Insert: {
414
+ auto_sync_product_prices?: boolean;
415
+ auto_update_exchange_rate?: boolean;
416
+ code: string;
417
+ created_at?: string;
418
+ exchange_rate: number;
419
+ exchange_rate_source?: string | null;
420
+ exchange_rate_updated_at?: string | null;
421
+ id?: string;
422
+ is_active?: boolean;
423
+ is_default?: boolean;
424
+ rounding_charm_amount?: number | null;
425
+ rounding_increment?: number;
426
+ rounding_mode?: string;
427
+ symbol: string;
428
+ updated_at?: string;
429
+ };
430
+ Update: {
431
+ auto_sync_product_prices?: boolean;
432
+ auto_update_exchange_rate?: boolean;
433
+ code?: string;
434
+ created_at?: string;
435
+ exchange_rate?: number;
436
+ exchange_rate_source?: string | null;
437
+ exchange_rate_updated_at?: string | null;
438
+ id?: string;
439
+ is_active?: boolean;
440
+ is_default?: boolean;
441
+ rounding_charm_amount?: number | null;
442
+ rounding_increment?: number;
443
+ rounding_mode?: string;
444
+ symbol?: string;
445
+ updated_at?: string;
446
+ };
447
+ Relationships: [];
448
+ };
449
+ custom_block_definitions: {
450
+ Row: {
451
+ description: string;
452
+ fields: import('./types').Json;
453
+ id: string;
454
+ is_original: boolean;
455
+ layout_schema: import('./types').Json;
456
+ name: string;
457
+ slug: string;
458
+ };
459
+ Insert: {
460
+ description?: string;
461
+ fields?: import('./types').Json;
462
+ id?: string;
463
+ is_original?: boolean;
464
+ layout_schema: import('./types').Json;
465
+ name: string;
466
+ slug: string;
467
+ };
468
+ Update: {
469
+ description?: string;
470
+ fields?: import('./types').Json;
471
+ id?: string;
472
+ is_original?: boolean;
473
+ layout_schema?: import('./types').Json;
474
+ name?: string;
475
+ slug?: string;
476
+ };
477
+ Relationships: [];
478
+ };
479
+ email_2fa_challenges: {
480
+ Row: {
481
+ consumed_at: string | null;
482
+ created_at: string;
483
+ expires_at: string;
484
+ id: string;
485
+ token_hash: string;
486
+ user_id: string;
487
+ };
488
+ Insert: {
489
+ consumed_at?: string | null;
490
+ created_at?: string;
491
+ expires_at: string;
492
+ id?: string;
493
+ token_hash: string;
494
+ user_id: string;
495
+ };
496
+ Update: {
497
+ consumed_at?: string | null;
498
+ created_at?: string;
499
+ expires_at?: string;
500
+ id?: string;
501
+ token_hash?: string;
502
+ user_id?: string;
503
+ };
504
+ Relationships: [];
505
+ };
506
+ freemius_plans: {
507
+ Row: {
508
+ created_at: string;
509
+ id: string;
510
+ name: string;
511
+ product_id: string;
512
+ title: string | null;
513
+ updated_at: string;
514
+ };
515
+ Insert: {
516
+ created_at?: string;
517
+ id?: string;
518
+ name: string;
519
+ product_id: string;
520
+ title?: string | null;
521
+ updated_at?: string;
522
+ };
523
+ Update: {
524
+ created_at?: string;
525
+ id?: string;
526
+ name?: string;
527
+ product_id?: string;
528
+ title?: string | null;
529
+ updated_at?: string;
530
+ };
531
+ Relationships: [{
532
+ foreignKeyName: "freemius_plans_product_id_fkey";
533
+ columns: ["product_id"];
534
+ isOneToOne: false;
535
+ referencedRelation: "products";
536
+ referencedColumns: ["id"];
537
+ }];
538
+ };
539
+ freemius_pricing: {
540
+ Row: {
541
+ api_annual_price: number | null;
542
+ api_lifetime_price: number | null;
543
+ api_monthly_price: number | null;
544
+ created_at: string;
545
+ id: string;
546
+ is_active: boolean;
547
+ license_quota: number | null;
548
+ override_annual_price: number | null;
549
+ override_lifetime_price: number | null;
550
+ override_monthly_price: number | null;
551
+ plan_id: string;
552
+ updated_at: string;
553
+ };
554
+ Insert: {
555
+ api_annual_price?: number | null;
556
+ api_lifetime_price?: number | null;
557
+ api_monthly_price?: number | null;
558
+ created_at?: string;
559
+ id?: string;
560
+ is_active?: boolean;
561
+ license_quota?: number | null;
562
+ override_annual_price?: number | null;
563
+ override_lifetime_price?: number | null;
564
+ override_monthly_price?: number | null;
565
+ plan_id: string;
566
+ updated_at?: string;
567
+ };
568
+ Update: {
569
+ api_annual_price?: number | null;
570
+ api_lifetime_price?: number | null;
571
+ api_monthly_price?: number | null;
572
+ created_at?: string;
573
+ id?: string;
574
+ is_active?: boolean;
575
+ license_quota?: number | null;
576
+ override_annual_price?: number | null;
577
+ override_lifetime_price?: number | null;
578
+ override_monthly_price?: number | null;
579
+ plan_id?: string;
580
+ updated_at?: string;
581
+ };
582
+ Relationships: [{
583
+ foreignKeyName: "freemius_pricing_plan_id_fkey";
584
+ columns: ["plan_id"];
585
+ isOneToOne: false;
586
+ referencedRelation: "freemius_plans";
587
+ referencedColumns: ["id"];
588
+ }];
589
+ };
590
+ inventory_items: {
591
+ Row: {
592
+ created_at: string;
593
+ quantity: number;
594
+ sku: string;
595
+ updated_at: string;
596
+ };
597
+ Insert: {
598
+ created_at?: string;
599
+ quantity?: number;
600
+ sku: string;
601
+ updated_at?: string;
602
+ };
603
+ Update: {
604
+ created_at?: string;
605
+ quantity?: number;
606
+ sku?: string;
607
+ updated_at?: string;
608
+ };
609
+ Relationships: [];
610
+ };
611
+ languages: {
612
+ Row: {
613
+ code: string;
614
+ created_at: string;
615
+ id: number;
616
+ is_active: boolean | null;
617
+ is_default: boolean;
618
+ name: string;
619
+ updated_at: string;
620
+ };
621
+ Insert: {
622
+ code: string;
623
+ created_at?: string;
624
+ id?: number;
625
+ is_active?: boolean | null;
626
+ is_default?: boolean;
627
+ name: string;
628
+ updated_at?: string;
629
+ };
630
+ Update: {
631
+ code?: string;
632
+ created_at?: string;
633
+ id?: number;
634
+ is_active?: boolean | null;
635
+ is_default?: boolean;
636
+ name?: string;
637
+ updated_at?: string;
638
+ };
639
+ Relationships: [];
640
+ };
641
+ logos: {
642
+ Row: {
643
+ created_at: string;
644
+ id: string;
645
+ media_id: string | null;
646
+ name: string;
647
+ };
648
+ Insert: {
649
+ created_at?: string;
650
+ id?: string;
651
+ media_id?: string | null;
652
+ name: string;
653
+ };
654
+ Update: {
655
+ created_at?: string;
656
+ id?: string;
657
+ media_id?: string | null;
658
+ name?: string;
659
+ };
660
+ Relationships: [{
661
+ foreignKeyName: "logos_media_id_fkey";
662
+ columns: ["media_id"];
663
+ isOneToOne: false;
664
+ referencedRelation: "media";
665
+ referencedColumns: ["id"];
666
+ }];
667
+ };
668
+ media: {
669
+ Row: {
670
+ blur_data_url: string | null;
671
+ created_at: string;
672
+ description: string | null;
673
+ file_name: string;
674
+ file_path: string | null;
675
+ file_type: string | null;
676
+ folder: string | null;
677
+ height: number | null;
678
+ id: string;
679
+ object_key: string;
680
+ size_bytes: number | null;
681
+ updated_at: string;
682
+ uploader_id: string | null;
683
+ variants: import('./types').Json | null;
684
+ width: number | null;
685
+ };
686
+ Insert: {
687
+ blur_data_url?: string | null;
688
+ created_at?: string;
689
+ description?: string | null;
690
+ file_name: string;
691
+ file_path?: string | null;
692
+ file_type?: string | null;
693
+ folder?: string | null;
694
+ height?: number | null;
695
+ id?: string;
696
+ object_key: string;
697
+ size_bytes?: number | null;
698
+ updated_at?: string;
699
+ uploader_id?: string | null;
700
+ variants?: import('./types').Json | null;
701
+ width?: number | null;
702
+ };
703
+ Update: {
704
+ blur_data_url?: string | null;
705
+ created_at?: string;
706
+ description?: string | null;
707
+ file_name?: string;
708
+ file_path?: string | null;
709
+ file_type?: string | null;
710
+ folder?: string | null;
711
+ height?: number | null;
712
+ id?: string;
713
+ object_key?: string;
714
+ size_bytes?: number | null;
715
+ updated_at?: string;
716
+ uploader_id?: string | null;
717
+ variants?: import('./types').Json | null;
718
+ width?: number | null;
719
+ };
720
+ Relationships: [{
721
+ foreignKeyName: "media_uploader_id_fkey";
722
+ columns: ["uploader_id"];
723
+ isOneToOne: false;
724
+ referencedRelation: "profiles";
725
+ referencedColumns: ["id"];
726
+ }];
727
+ };
728
+ navigation_items: {
729
+ Row: {
730
+ created_at: string;
731
+ id: number;
732
+ label: string;
733
+ language_id: number;
734
+ menu_key: Database["public"]["Enums"]["menu_location"];
735
+ order: number;
736
+ page_id: number | null;
737
+ parent_id: number | null;
738
+ translation_group_id: string;
739
+ updated_at: string;
740
+ url: string;
741
+ };
742
+ Insert: {
743
+ created_at?: string;
744
+ id?: number;
745
+ label: string;
746
+ language_id: number;
747
+ menu_key: Database["public"]["Enums"]["menu_location"];
748
+ order?: number;
749
+ page_id?: number | null;
750
+ parent_id?: number | null;
751
+ translation_group_id?: string;
752
+ updated_at?: string;
753
+ url: string;
754
+ };
755
+ Update: {
756
+ created_at?: string;
757
+ id?: number;
758
+ label?: string;
759
+ language_id?: number;
760
+ menu_key?: Database["public"]["Enums"]["menu_location"];
761
+ order?: number;
762
+ page_id?: number | null;
763
+ parent_id?: number | null;
764
+ translation_group_id?: string;
765
+ updated_at?: string;
766
+ url?: string;
767
+ };
768
+ Relationships: [{
769
+ foreignKeyName: "navigation_items_language_id_fkey";
770
+ columns: ["language_id"];
771
+ isOneToOne: false;
772
+ referencedRelation: "languages";
773
+ referencedColumns: ["id"];
774
+ }, {
775
+ foreignKeyName: "navigation_items_page_id_fkey";
776
+ columns: ["page_id"];
777
+ isOneToOne: false;
778
+ referencedRelation: "pages";
779
+ referencedColumns: ["id"];
780
+ }, {
781
+ foreignKeyName: "navigation_items_parent_id_fkey";
782
+ columns: ["parent_id"];
783
+ isOneToOne: false;
784
+ referencedRelation: "navigation_items";
785
+ referencedColumns: ["id"];
786
+ }];
787
+ };
788
+ order_items: {
789
+ Row: {
790
+ id: string;
791
+ order_id: string;
792
+ price_at_purchase: number;
793
+ product_id: string | null;
794
+ quantity: number;
795
+ variant_id: string | null;
796
+ };
797
+ Insert: {
798
+ id?: string;
799
+ order_id: string;
800
+ price_at_purchase: number;
801
+ product_id?: string | null;
802
+ quantity: number;
803
+ variant_id?: string | null;
804
+ };
805
+ Update: {
806
+ id?: string;
807
+ order_id?: string;
808
+ price_at_purchase?: number;
809
+ product_id?: string | null;
810
+ quantity?: number;
811
+ variant_id?: string | null;
812
+ };
813
+ Relationships: [{
814
+ foreignKeyName: "order_items_order_id_fkey";
815
+ columns: ["order_id"];
816
+ isOneToOne: false;
817
+ referencedRelation: "orders";
818
+ referencedColumns: ["id"];
819
+ }, {
820
+ foreignKeyName: "order_items_product_id_fkey";
821
+ columns: ["product_id"];
822
+ isOneToOne: false;
823
+ referencedRelation: "products";
824
+ referencedColumns: ["id"];
825
+ }, {
826
+ foreignKeyName: "order_items_variant_id_fkey";
827
+ columns: ["variant_id"];
828
+ isOneToOne: false;
829
+ referencedRelation: "product_variants";
830
+ referencedColumns: ["id"];
831
+ }];
832
+ };
833
+ orders: {
834
+ Row: {
835
+ coupon_code: string | null;
836
+ coupon_id: string | null;
837
+ created_at: string | null;
838
+ currency: string;
839
+ customer_details: import('./types').Json | null;
840
+ discount_details: import('./types').Json | null;
841
+ discount_total: number;
842
+ exchange_rate_at_purchase: number;
843
+ freemius_last_event_type: string | null;
844
+ freemius_last_synced_at: string | null;
845
+ freemius_license_id: string | null;
846
+ freemius_plan_id: string | null;
847
+ freemius_product_id: string | null;
848
+ freemius_subscription_id: string | null;
849
+ freemius_trial_ends_at: string | null;
850
+ freemius_trial_id: string | null;
851
+ freemius_user_id: string | null;
852
+ id: string;
853
+ inventory_deducted_at: string | null;
854
+ invoice_number: string | null;
855
+ paid_at: string | null;
856
+ payment_intent_id: string | null;
857
+ provider: string | null;
858
+ shipping_total: number | null;
859
+ status: string;
860
+ stripe_session_id: string | null;
861
+ subtotal: number | null;
862
+ tax_details: import('./types').Json | null;
863
+ tax_total: number;
864
+ total: number;
865
+ user_id: string | null;
866
+ };
867
+ Insert: {
868
+ coupon_code?: string | null;
869
+ coupon_id?: string | null;
870
+ created_at?: string | null;
871
+ currency?: string;
872
+ customer_details?: import('./types').Json | null;
873
+ discount_details?: import('./types').Json | null;
874
+ discount_total?: number;
875
+ exchange_rate_at_purchase?: number;
876
+ freemius_last_event_type?: string | null;
877
+ freemius_last_synced_at?: string | null;
878
+ freemius_license_id?: string | null;
879
+ freemius_plan_id?: string | null;
880
+ freemius_product_id?: string | null;
881
+ freemius_subscription_id?: string | null;
882
+ freemius_trial_ends_at?: string | null;
883
+ freemius_trial_id?: string | null;
884
+ freemius_user_id?: string | null;
885
+ id?: string;
886
+ inventory_deducted_at?: string | null;
887
+ invoice_number?: string | null;
888
+ paid_at?: string | null;
889
+ payment_intent_id?: string | null;
890
+ provider?: string | null;
891
+ shipping_total?: number | null;
892
+ status?: string;
893
+ stripe_session_id?: string | null;
894
+ subtotal?: number | null;
895
+ tax_details?: import('./types').Json | null;
896
+ tax_total?: number;
897
+ total: number;
898
+ user_id?: string | null;
899
+ };
900
+ Update: {
901
+ coupon_code?: string | null;
902
+ coupon_id?: string | null;
903
+ created_at?: string | null;
904
+ currency?: string;
905
+ customer_details?: import('./types').Json | null;
906
+ discount_details?: import('./types').Json | null;
907
+ discount_total?: number;
908
+ exchange_rate_at_purchase?: number;
909
+ freemius_last_event_type?: string | null;
910
+ freemius_last_synced_at?: string | null;
911
+ freemius_license_id?: string | null;
912
+ freemius_plan_id?: string | null;
913
+ freemius_product_id?: string | null;
914
+ freemius_subscription_id?: string | null;
915
+ freemius_trial_ends_at?: string | null;
916
+ freemius_trial_id?: string | null;
917
+ freemius_user_id?: string | null;
918
+ id?: string;
919
+ inventory_deducted_at?: string | null;
920
+ invoice_number?: string | null;
921
+ paid_at?: string | null;
922
+ payment_intent_id?: string | null;
923
+ provider?: string | null;
924
+ shipping_total?: number | null;
925
+ status?: string;
926
+ stripe_session_id?: string | null;
927
+ subtotal?: number | null;
928
+ tax_details?: import('./types').Json | null;
929
+ tax_total?: number;
930
+ total?: number;
931
+ user_id?: string | null;
932
+ };
933
+ Relationships: [{
934
+ foreignKeyName: "orders_coupon_id_fkey";
935
+ columns: ["coupon_id"];
936
+ isOneToOne: false;
937
+ referencedRelation: "coupons";
938
+ referencedColumns: ["id"];
939
+ }];
940
+ };
941
+ package_activations: {
942
+ Row: {
943
+ created_at: string | null;
944
+ id: string;
945
+ instance_name: string;
946
+ last_validated_at: string | null;
947
+ license_key: string;
948
+ meta: import('./types').Json | null;
949
+ package_id: string;
950
+ status: string;
951
+ };
952
+ Insert: {
953
+ created_at?: string | null;
954
+ id?: string;
955
+ instance_name: string;
956
+ last_validated_at?: string | null;
957
+ license_key: string;
958
+ meta?: import('./types').Json | null;
959
+ package_id: string;
960
+ status?: string;
961
+ };
962
+ Update: {
963
+ created_at?: string | null;
964
+ id?: string;
965
+ instance_name?: string;
966
+ last_validated_at?: string | null;
967
+ license_key?: string;
968
+ meta?: import('./types').Json | null;
969
+ package_id?: string;
970
+ status?: string;
971
+ };
972
+ Relationships: [];
973
+ };
974
+ page_revisions: {
975
+ Row: {
976
+ author_id: string | null;
977
+ content: import('./types').Json;
978
+ created_at: string;
979
+ id: number;
980
+ page_id: number;
981
+ revision_type: Database["public"]["Enums"]["revision_type"];
982
+ version: number;
983
+ };
984
+ Insert: {
985
+ author_id?: string | null;
986
+ content: import('./types').Json;
987
+ created_at?: string;
988
+ id?: number;
989
+ page_id: number;
990
+ revision_type: Database["public"]["Enums"]["revision_type"];
991
+ version: number;
992
+ };
993
+ Update: {
994
+ author_id?: string | null;
995
+ content?: import('./types').Json;
996
+ created_at?: string;
997
+ id?: number;
998
+ page_id?: number;
999
+ revision_type?: Database["public"]["Enums"]["revision_type"];
1000
+ version?: number;
1001
+ };
1002
+ Relationships: [{
1003
+ foreignKeyName: "page_revisions_author_id_fkey";
1004
+ columns: ["author_id"];
1005
+ isOneToOne: false;
1006
+ referencedRelation: "profiles";
1007
+ referencedColumns: ["id"];
1008
+ }, {
1009
+ foreignKeyName: "page_revisions_page_id_fkey";
1010
+ columns: ["page_id"];
1011
+ isOneToOne: false;
1012
+ referencedRelation: "pages";
1013
+ referencedColumns: ["id"];
1014
+ }];
1015
+ };
1016
+ pages: {
1017
+ Row: {
1018
+ author_id: string | null;
1019
+ created_at: string;
1020
+ feature_image_id: string | null;
1021
+ id: number;
1022
+ language_id: number;
1023
+ meta_description: string | null;
1024
+ meta_title: string | null;
1025
+ slug: string;
1026
+ status: Database["public"]["Enums"]["page_status"];
1027
+ title: string;
1028
+ translation_group_id: string;
1029
+ updated_at: string;
1030
+ version: number;
1031
+ };
1032
+ Insert: {
1033
+ author_id?: string | null;
1034
+ created_at?: string;
1035
+ feature_image_id?: string | null;
1036
+ id?: number;
1037
+ language_id: number;
1038
+ meta_description?: string | null;
1039
+ meta_title?: string | null;
1040
+ slug: string;
1041
+ status?: Database["public"]["Enums"]["page_status"];
1042
+ title: string;
1043
+ translation_group_id?: string;
1044
+ updated_at?: string;
1045
+ version?: number;
1046
+ };
1047
+ Update: {
1048
+ author_id?: string | null;
1049
+ created_at?: string;
1050
+ feature_image_id?: string | null;
1051
+ id?: number;
1052
+ language_id?: number;
1053
+ meta_description?: string | null;
1054
+ meta_title?: string | null;
1055
+ slug?: string;
1056
+ status?: Database["public"]["Enums"]["page_status"];
1057
+ title?: string;
1058
+ translation_group_id?: string;
1059
+ updated_at?: string;
1060
+ version?: number;
1061
+ };
1062
+ Relationships: [{
1063
+ foreignKeyName: "pages_author_id_fkey";
1064
+ columns: ["author_id"];
1065
+ isOneToOne: false;
1066
+ referencedRelation: "profiles";
1067
+ referencedColumns: ["id"];
1068
+ }, {
1069
+ foreignKeyName: "pages_feature_image_id_fkey";
1070
+ columns: ["feature_image_id"];
1071
+ isOneToOne: false;
1072
+ referencedRelation: "media";
1073
+ referencedColumns: ["id"];
1074
+ }, {
1075
+ foreignKeyName: "pages_language_id_fkey";
1076
+ columns: ["language_id"];
1077
+ isOneToOne: false;
1078
+ referencedRelation: "languages";
1079
+ referencedColumns: ["id"];
1080
+ }];
1081
+ };
1082
+ post_revisions: {
1083
+ Row: {
1084
+ author_id: string | null;
1085
+ content: import('./types').Json;
1086
+ created_at: string;
1087
+ id: number;
1088
+ post_id: number;
1089
+ revision_type: Database["public"]["Enums"]["revision_type"];
1090
+ version: number;
1091
+ };
1092
+ Insert: {
1093
+ author_id?: string | null;
1094
+ content: import('./types').Json;
1095
+ created_at?: string;
1096
+ id?: number;
1097
+ post_id: number;
1098
+ revision_type: Database["public"]["Enums"]["revision_type"];
1099
+ version: number;
1100
+ };
1101
+ Update: {
1102
+ author_id?: string | null;
1103
+ content?: import('./types').Json;
1104
+ created_at?: string;
1105
+ id?: number;
1106
+ post_id?: number;
1107
+ revision_type?: Database["public"]["Enums"]["revision_type"];
1108
+ version?: number;
1109
+ };
1110
+ Relationships: [{
1111
+ foreignKeyName: "post_revisions_author_id_fkey";
1112
+ columns: ["author_id"];
1113
+ isOneToOne: false;
1114
+ referencedRelation: "profiles";
1115
+ referencedColumns: ["id"];
1116
+ }, {
1117
+ foreignKeyName: "post_revisions_post_id_fkey";
1118
+ columns: ["post_id"];
1119
+ isOneToOne: false;
1120
+ referencedRelation: "posts";
1121
+ referencedColumns: ["id"];
1122
+ }];
1123
+ };
1124
+ posts: {
1125
+ Row: {
1126
+ author_id: string | null;
1127
+ created_at: string;
1128
+ excerpt: string | null;
1129
+ feature_image_id: string | null;
1130
+ id: number;
1131
+ label: string | null;
1132
+ language_id: number;
1133
+ meta_description: string | null;
1134
+ meta_title: string | null;
1135
+ published_at: string | null;
1136
+ slug: string;
1137
+ status: Database["public"]["Enums"]["page_status"];
1138
+ subtitle: string | null;
1139
+ title: string;
1140
+ translation_group_id: string;
1141
+ updated_at: string;
1142
+ version: number;
1143
+ };
1144
+ Insert: {
1145
+ author_id?: string | null;
1146
+ created_at?: string;
1147
+ excerpt?: string | null;
1148
+ feature_image_id?: string | null;
1149
+ id?: number;
1150
+ label?: string | null;
1151
+ language_id: number;
1152
+ meta_description?: string | null;
1153
+ meta_title?: string | null;
1154
+ published_at?: string | null;
1155
+ slug: string;
1156
+ status?: Database["public"]["Enums"]["page_status"];
1157
+ subtitle?: string | null;
1158
+ title: string;
1159
+ translation_group_id?: string;
1160
+ updated_at?: string;
1161
+ version?: number;
1162
+ };
1163
+ Update: {
1164
+ author_id?: string | null;
1165
+ created_at?: string;
1166
+ excerpt?: string | null;
1167
+ feature_image_id?: string | null;
1168
+ id?: number;
1169
+ label?: string | null;
1170
+ language_id?: number;
1171
+ meta_description?: string | null;
1172
+ meta_title?: string | null;
1173
+ published_at?: string | null;
1174
+ slug?: string;
1175
+ status?: Database["public"]["Enums"]["page_status"];
1176
+ subtitle?: string | null;
1177
+ title?: string;
1178
+ translation_group_id?: string;
1179
+ updated_at?: string;
1180
+ version?: number;
1181
+ };
1182
+ Relationships: [{
1183
+ foreignKeyName: "posts_author_id_fkey";
1184
+ columns: ["author_id"];
1185
+ isOneToOne: false;
1186
+ referencedRelation: "profiles";
1187
+ referencedColumns: ["id"];
1188
+ }, {
1189
+ foreignKeyName: "posts_feature_image_id_fkey";
1190
+ columns: ["feature_image_id"];
1191
+ isOneToOne: false;
1192
+ referencedRelation: "media";
1193
+ referencedColumns: ["id"];
1194
+ }, {
1195
+ foreignKeyName: "posts_language_id_fkey";
1196
+ columns: ["language_id"];
1197
+ isOneToOne: false;
1198
+ referencedRelation: "languages";
1199
+ referencedColumns: ["id"];
1200
+ }];
1201
+ };
1202
+ privacy_consent_logs: {
1203
+ Row: {
1204
+ categories: import('./types').Json;
1205
+ consent_token: string;
1206
+ created_at: string;
1207
+ id: string;
1208
+ ip_masked: string | null;
1209
+ user_agent: string | null;
1210
+ };
1211
+ Insert: {
1212
+ categories?: import('./types').Json;
1213
+ consent_token: string;
1214
+ created_at?: string;
1215
+ id?: string;
1216
+ ip_masked?: string | null;
1217
+ user_agent?: string | null;
1218
+ };
1219
+ Update: {
1220
+ categories?: import('./types').Json;
1221
+ consent_token?: string;
1222
+ created_at?: string;
1223
+ id?: string;
1224
+ ip_masked?: string | null;
1225
+ user_agent?: string | null;
1226
+ };
1227
+ Relationships: [];
1228
+ };
1229
+ product_attribute_terms: {
1230
+ Row: {
1231
+ attribute_id: string;
1232
+ created_at: string | null;
1233
+ id: string;
1234
+ slug: string;
1235
+ sort_order: number;
1236
+ updated_at: string | null;
1237
+ value: string;
1238
+ value_translations: import('./types').Json;
1239
+ };
1240
+ Insert: {
1241
+ attribute_id: string;
1242
+ created_at?: string | null;
1243
+ id?: string;
1244
+ slug: string;
1245
+ sort_order?: number;
1246
+ updated_at?: string | null;
1247
+ value: string;
1248
+ value_translations?: import('./types').Json;
1249
+ };
1250
+ Update: {
1251
+ attribute_id?: string;
1252
+ created_at?: string | null;
1253
+ id?: string;
1254
+ slug?: string;
1255
+ sort_order?: number;
1256
+ updated_at?: string | null;
1257
+ value?: string;
1258
+ value_translations?: import('./types').Json;
1259
+ };
1260
+ Relationships: [{
1261
+ foreignKeyName: "product_attribute_terms_attribute_id_fkey";
1262
+ columns: ["attribute_id"];
1263
+ isOneToOne: false;
1264
+ referencedRelation: "product_attributes";
1265
+ referencedColumns: ["id"];
1266
+ }];
1267
+ };
1268
+ product_attributes: {
1269
+ Row: {
1270
+ created_at: string | null;
1271
+ id: string;
1272
+ name: string;
1273
+ name_translations: import('./types').Json;
1274
+ slug: string;
1275
+ updated_at: string | null;
1276
+ };
1277
+ Insert: {
1278
+ created_at?: string | null;
1279
+ id?: string;
1280
+ name: string;
1281
+ name_translations?: import('./types').Json;
1282
+ slug: string;
1283
+ updated_at?: string | null;
1284
+ };
1285
+ Update: {
1286
+ created_at?: string | null;
1287
+ id?: string;
1288
+ name?: string;
1289
+ name_translations?: import('./types').Json;
1290
+ slug?: string;
1291
+ updated_at?: string | null;
1292
+ };
1293
+ Relationships: [];
1294
+ };
1295
+ product_categories: {
1296
+ Row: {
1297
+ category_id: string;
1298
+ product_id: string;
1299
+ };
1300
+ Insert: {
1301
+ category_id: string;
1302
+ product_id: string;
1303
+ };
1304
+ Update: {
1305
+ category_id?: string;
1306
+ product_id?: string;
1307
+ };
1308
+ Relationships: [{
1309
+ foreignKeyName: "product_categories_category_id_fkey";
1310
+ columns: ["category_id"];
1311
+ isOneToOne: false;
1312
+ referencedRelation: "categories";
1313
+ referencedColumns: ["id"];
1314
+ }, {
1315
+ foreignKeyName: "product_categories_product_id_fkey";
1316
+ columns: ["product_id"];
1317
+ isOneToOne: false;
1318
+ referencedRelation: "products";
1319
+ referencedColumns: ["id"];
1320
+ }];
1321
+ };
1322
+ product_drafts: {
1323
+ Row: {
1324
+ author_id: string | null;
1325
+ blocks: import('./types').Json;
1326
+ created_at: string;
1327
+ id: number;
1328
+ meta: import('./types').Json;
1329
+ product_id: string;
1330
+ updated_at: string;
1331
+ };
1332
+ Insert: {
1333
+ author_id?: string | null;
1334
+ blocks?: import('./types').Json;
1335
+ created_at?: string;
1336
+ id?: number;
1337
+ meta?: import('./types').Json;
1338
+ product_id: string;
1339
+ updated_at?: string;
1340
+ };
1341
+ Update: {
1342
+ author_id?: string | null;
1343
+ blocks?: import('./types').Json;
1344
+ created_at?: string;
1345
+ id?: number;
1346
+ meta?: import('./types').Json;
1347
+ product_id?: string;
1348
+ updated_at?: string;
1349
+ };
1350
+ Relationships: [{
1351
+ foreignKeyName: "product_drafts_author_id_fkey";
1352
+ columns: ["author_id"];
1353
+ isOneToOne: false;
1354
+ referencedRelation: "profiles";
1355
+ referencedColumns: ["id"];
1356
+ }, {
1357
+ foreignKeyName: "product_drafts_product_id_fkey";
1358
+ columns: ["product_id"];
1359
+ isOneToOne: true;
1360
+ referencedRelation: "products";
1361
+ referencedColumns: ["id"];
1362
+ }];
1363
+ };
1364
+ product_freemius_sale_coupons: {
1365
+ Row: {
1366
+ created_at: string;
1367
+ discount_percent: number | null;
1368
+ ends_at: string | null;
1369
+ freemius_coupon_code: string;
1370
+ freemius_coupon_id: string | null;
1371
+ freemius_plan_id: string | null;
1372
+ freemius_product_id: string;
1373
+ id: string;
1374
+ is_active: boolean;
1375
+ last_synced_at: string | null;
1376
+ product_id: string;
1377
+ remote_payload: import('./types').Json | null;
1378
+ starts_at: string | null;
1379
+ sync_error: string | null;
1380
+ sync_status: string;
1381
+ updated_at: string;
1382
+ };
1383
+ Insert: {
1384
+ created_at?: string;
1385
+ discount_percent?: number | null;
1386
+ ends_at?: string | null;
1387
+ freemius_coupon_code: string;
1388
+ freemius_coupon_id?: string | null;
1389
+ freemius_plan_id?: string | null;
1390
+ freemius_product_id: string;
1391
+ id?: string;
1392
+ is_active?: boolean;
1393
+ last_synced_at?: string | null;
1394
+ product_id: string;
1395
+ remote_payload?: import('./types').Json | null;
1396
+ starts_at?: string | null;
1397
+ sync_error?: string | null;
1398
+ sync_status?: string;
1399
+ updated_at?: string;
1400
+ };
1401
+ Update: {
1402
+ created_at?: string;
1403
+ discount_percent?: number | null;
1404
+ ends_at?: string | null;
1405
+ freemius_coupon_code?: string;
1406
+ freemius_coupon_id?: string | null;
1407
+ freemius_plan_id?: string | null;
1408
+ freemius_product_id?: string;
1409
+ id?: string;
1410
+ is_active?: boolean;
1411
+ last_synced_at?: string | null;
1412
+ product_id?: string;
1413
+ remote_payload?: import('./types').Json | null;
1414
+ starts_at?: string | null;
1415
+ sync_error?: string | null;
1416
+ sync_status?: string;
1417
+ updated_at?: string;
1418
+ };
1419
+ Relationships: [{
1420
+ foreignKeyName: "product_freemius_sale_coupons_product_id_fkey";
1421
+ columns: ["product_id"];
1422
+ isOneToOne: true;
1423
+ referencedRelation: "products";
1424
+ referencedColumns: ["id"];
1425
+ }];
1426
+ };
1427
+ product_media: {
1428
+ Row: {
1429
+ media_id: string;
1430
+ product_id: string;
1431
+ sort_order: number | null;
1432
+ };
1433
+ Insert: {
1434
+ media_id: string;
1435
+ product_id: string;
1436
+ sort_order?: number | null;
1437
+ };
1438
+ Update: {
1439
+ media_id?: string;
1440
+ product_id?: string;
1441
+ sort_order?: number | null;
1442
+ };
1443
+ Relationships: [{
1444
+ foreignKeyName: "product_media_media_id_fkey";
1445
+ columns: ["media_id"];
1446
+ isOneToOne: false;
1447
+ referencedRelation: "media";
1448
+ referencedColumns: ["id"];
1449
+ }, {
1450
+ foreignKeyName: "product_media_product_id_fkey";
1451
+ columns: ["product_id"];
1452
+ isOneToOne: false;
1453
+ referencedRelation: "products";
1454
+ referencedColumns: ["id"];
1455
+ }];
1456
+ };
1457
+ product_variants: {
1458
+ Row: {
1459
+ created_at: string | null;
1460
+ id: string;
1461
+ main_media_id: string | null;
1462
+ price: number;
1463
+ price_adjustment: number;
1464
+ prices: import('./types').Json;
1465
+ product_id: string;
1466
+ sale_end_at: string | null;
1467
+ sale_price: number | null;
1468
+ sale_prices: import('./types').Json | null;
1469
+ sale_start_at: string | null;
1470
+ scheduled_price: number | null;
1471
+ scheduled_price_at: string | null;
1472
+ scheduled_prices: import('./types').Json | null;
1473
+ sku: string;
1474
+ stock_quantity: number;
1475
+ upc: string | null;
1476
+ updated_at: string | null;
1477
+ };
1478
+ Insert: {
1479
+ created_at?: string | null;
1480
+ id?: string;
1481
+ main_media_id?: string | null;
1482
+ price?: number;
1483
+ price_adjustment?: number;
1484
+ prices?: import('./types').Json;
1485
+ product_id: string;
1486
+ sale_end_at?: string | null;
1487
+ sale_price?: number | null;
1488
+ sale_prices?: import('./types').Json | null;
1489
+ sale_start_at?: string | null;
1490
+ scheduled_price?: number | null;
1491
+ scheduled_price_at?: string | null;
1492
+ scheduled_prices?: import('./types').Json | null;
1493
+ sku: string;
1494
+ stock_quantity?: number;
1495
+ upc?: string | null;
1496
+ updated_at?: string | null;
1497
+ };
1498
+ Update: {
1499
+ created_at?: string | null;
1500
+ id?: string;
1501
+ main_media_id?: string | null;
1502
+ price?: number;
1503
+ price_adjustment?: number;
1504
+ prices?: import('./types').Json;
1505
+ product_id?: string;
1506
+ sale_end_at?: string | null;
1507
+ sale_price?: number | null;
1508
+ sale_prices?: import('./types').Json | null;
1509
+ sale_start_at?: string | null;
1510
+ scheduled_price?: number | null;
1511
+ scheduled_price_at?: string | null;
1512
+ scheduled_prices?: import('./types').Json | null;
1513
+ sku?: string;
1514
+ stock_quantity?: number;
1515
+ upc?: string | null;
1516
+ updated_at?: string | null;
1517
+ };
1518
+ Relationships: [{
1519
+ foreignKeyName: "product_variants_main_media_id_fkey";
1520
+ columns: ["main_media_id"];
1521
+ isOneToOne: false;
1522
+ referencedRelation: "media";
1523
+ referencedColumns: ["id"];
1524
+ }, {
1525
+ foreignKeyName: "product_variants_product_id_fkey";
1526
+ columns: ["product_id"];
1527
+ isOneToOne: false;
1528
+ referencedRelation: "products";
1529
+ referencedColumns: ["id"];
1530
+ }];
1531
+ };
1532
+ products: {
1533
+ Row: {
1534
+ created_at: string | null;
1535
+ description_json: import('./types').Json | null;
1536
+ freemius_plan_id: string | null;
1537
+ freemius_product_id: string | null;
1538
+ id: string;
1539
+ is_taxable: boolean;
1540
+ language_id: number;
1541
+ meta_description: string | null;
1542
+ meta_title: string | null;
1543
+ metadata: import('./types').Json | null;
1544
+ payment_provider: string;
1545
+ price: number;
1546
+ prices: import('./types').Json;
1547
+ product_type: string;
1548
+ sale_end_at: string | null;
1549
+ sale_price: number | null;
1550
+ sale_prices: import('./types').Json | null;
1551
+ sale_start_at: string | null;
1552
+ scheduled_price: number | null;
1553
+ scheduled_price_at: string | null;
1554
+ scheduled_prices: import('./types').Json | null;
1555
+ short_description: string | null;
1556
+ sku: string;
1557
+ slug: string;
1558
+ status: string;
1559
+ stock: number | null;
1560
+ title: string;
1561
+ translation_group_id: string;
1562
+ trial_period_days: number;
1563
+ trial_requires_payment_method: boolean;
1564
+ upc: string | null;
1565
+ updated_at: string | null;
1566
+ };
1567
+ Insert: {
1568
+ created_at?: string | null;
1569
+ description_json?: import('./types').Json | null;
1570
+ freemius_plan_id?: string | null;
1571
+ freemius_product_id?: string | null;
1572
+ id?: string;
1573
+ is_taxable?: boolean;
1574
+ language_id: number;
1575
+ meta_description?: string | null;
1576
+ meta_title?: string | null;
1577
+ metadata?: import('./types').Json | null;
1578
+ payment_provider: string;
1579
+ price: number;
1580
+ prices?: import('./types').Json;
1581
+ product_type: string;
1582
+ sale_end_at?: string | null;
1583
+ sale_price?: number | null;
1584
+ sale_prices?: import('./types').Json | null;
1585
+ sale_start_at?: string | null;
1586
+ scheduled_price?: number | null;
1587
+ scheduled_price_at?: string | null;
1588
+ scheduled_prices?: import('./types').Json | null;
1589
+ short_description?: string | null;
1590
+ sku: string;
1591
+ slug: string;
1592
+ status?: string;
1593
+ stock?: number | null;
1594
+ title: string;
1595
+ translation_group_id?: string;
1596
+ trial_period_days?: number;
1597
+ trial_requires_payment_method?: boolean;
1598
+ upc?: string | null;
1599
+ updated_at?: string | null;
1600
+ };
1601
+ Update: {
1602
+ created_at?: string | null;
1603
+ description_json?: import('./types').Json | null;
1604
+ freemius_plan_id?: string | null;
1605
+ freemius_product_id?: string | null;
1606
+ id?: string;
1607
+ is_taxable?: boolean;
1608
+ language_id?: number;
1609
+ meta_description?: string | null;
1610
+ meta_title?: string | null;
1611
+ metadata?: import('./types').Json | null;
1612
+ payment_provider?: string;
1613
+ price?: number;
1614
+ prices?: import('./types').Json;
1615
+ product_type?: string;
1616
+ sale_end_at?: string | null;
1617
+ sale_price?: number | null;
1618
+ sale_prices?: import('./types').Json | null;
1619
+ sale_start_at?: string | null;
1620
+ scheduled_price?: number | null;
1621
+ scheduled_price_at?: string | null;
1622
+ scheduled_prices?: import('./types').Json | null;
1623
+ short_description?: string | null;
1624
+ sku?: string;
1625
+ slug?: string;
1626
+ status?: string;
1627
+ stock?: number | null;
1628
+ title?: string;
1629
+ translation_group_id?: string;
1630
+ trial_period_days?: number;
1631
+ trial_requires_payment_method?: boolean;
1632
+ upc?: string | null;
1633
+ updated_at?: string | null;
1634
+ };
1635
+ Relationships: [{
1636
+ foreignKeyName: "products_language_id_fkey";
1637
+ columns: ["language_id"];
1638
+ isOneToOne: false;
1639
+ referencedRelation: "languages";
1640
+ referencedColumns: ["id"];
1641
+ }];
1642
+ };
1643
+ profiles: {
1644
+ Row: {
1645
+ avatar_url: string | null;
1646
+ full_name: string | null;
1647
+ github_username: string | null;
1648
+ id: string;
1649
+ phone: string | null;
1650
+ role: Database["public"]["Enums"]["user_role"];
1651
+ updated_at: string | null;
1652
+ website: string | null;
1653
+ };
1654
+ Insert: {
1655
+ avatar_url?: string | null;
1656
+ full_name?: string | null;
1657
+ github_username?: string | null;
1658
+ id: string;
1659
+ phone?: string | null;
1660
+ role?: Database["public"]["Enums"]["user_role"];
1661
+ updated_at?: string | null;
1662
+ website?: string | null;
1663
+ };
1664
+ Update: {
1665
+ avatar_url?: string | null;
1666
+ full_name?: string | null;
1667
+ github_username?: string | null;
1668
+ id?: string;
1669
+ phone?: string | null;
1670
+ role?: Database["public"]["Enums"]["user_role"];
1671
+ updated_at?: string | null;
1672
+ website?: string | null;
1673
+ };
1674
+ Relationships: [];
1675
+ };
1676
+ shipping_zone_locations: {
1677
+ Row: {
1678
+ country_code: string;
1679
+ created_at: string | null;
1680
+ id: string;
1681
+ postal_code: string | null;
1682
+ state_code: string | null;
1683
+ zone_id: string;
1684
+ };
1685
+ Insert: {
1686
+ country_code: string;
1687
+ created_at?: string | null;
1688
+ id?: string;
1689
+ postal_code?: string | null;
1690
+ state_code?: string | null;
1691
+ zone_id: string;
1692
+ };
1693
+ Update: {
1694
+ country_code?: string;
1695
+ created_at?: string | null;
1696
+ id?: string;
1697
+ postal_code?: string | null;
1698
+ state_code?: string | null;
1699
+ zone_id?: string;
1700
+ };
1701
+ Relationships: [{
1702
+ foreignKeyName: "shipping_zone_locations_zone_id_fkey";
1703
+ columns: ["zone_id"];
1704
+ isOneToOne: false;
1705
+ referencedRelation: "shipping_zones";
1706
+ referencedColumns: ["id"];
1707
+ }];
1708
+ };
1709
+ shipping_zone_methods: {
1710
+ Row: {
1711
+ cost_amount: number;
1712
+ cost_amounts: import('./types').Json;
1713
+ cost_currency: string;
1714
+ created_at: string | null;
1715
+ currency_pricing_mode: string;
1716
+ id: string;
1717
+ method_type: string;
1718
+ min_order_amount: number;
1719
+ min_order_amounts: import('./types').Json;
1720
+ name: string;
1721
+ name_translations: import('./types').Json;
1722
+ updated_at: string | null;
1723
+ zone_id: string;
1724
+ };
1725
+ Insert: {
1726
+ cost_amount?: number;
1727
+ cost_amounts?: import('./types').Json;
1728
+ cost_currency?: string;
1729
+ created_at?: string | null;
1730
+ currency_pricing_mode?: string;
1731
+ id?: string;
1732
+ method_type: string;
1733
+ min_order_amount?: number;
1734
+ min_order_amounts?: import('./types').Json;
1735
+ name: string;
1736
+ name_translations?: import('./types').Json;
1737
+ updated_at?: string | null;
1738
+ zone_id: string;
1739
+ };
1740
+ Update: {
1741
+ cost_amount?: number;
1742
+ cost_amounts?: import('./types').Json;
1743
+ cost_currency?: string;
1744
+ created_at?: string | null;
1745
+ currency_pricing_mode?: string;
1746
+ id?: string;
1747
+ method_type?: string;
1748
+ min_order_amount?: number;
1749
+ min_order_amounts?: import('./types').Json;
1750
+ name?: string;
1751
+ name_translations?: import('./types').Json;
1752
+ updated_at?: string | null;
1753
+ zone_id?: string;
1754
+ };
1755
+ Relationships: [{
1756
+ foreignKeyName: "shipping_zone_methods_zone_id_fkey";
1757
+ columns: ["zone_id"];
1758
+ isOneToOne: false;
1759
+ referencedRelation: "shipping_zones";
1760
+ referencedColumns: ["id"];
1761
+ }];
1762
+ };
1763
+ shipping_zones: {
1764
+ Row: {
1765
+ created_at: string | null;
1766
+ id: string;
1767
+ name: string;
1768
+ priority_order: number;
1769
+ updated_at: string | null;
1770
+ };
1771
+ Insert: {
1772
+ created_at?: string | null;
1773
+ id?: string;
1774
+ name: string;
1775
+ priority_order?: number;
1776
+ updated_at?: string | null;
1777
+ };
1778
+ Update: {
1779
+ created_at?: string | null;
1780
+ id?: string;
1781
+ name?: string;
1782
+ priority_order?: number;
1783
+ updated_at?: string | null;
1784
+ };
1785
+ Relationships: [];
1786
+ };
1787
+ site_settings: {
1788
+ Row: {
1789
+ key: string;
1790
+ value: import('./types').Json | null;
1791
+ };
1792
+ Insert: {
1793
+ key: string;
1794
+ value?: import('./types').Json | null;
1795
+ };
1796
+ Update: {
1797
+ key?: string;
1798
+ value?: import('./types').Json | null;
1799
+ };
1800
+ Relationships: [];
1801
+ };
1802
+ system_configuration: {
1803
+ Row: {
1804
+ auto_accept_signups: boolean;
1805
+ id: number;
1806
+ settings: import('./types').Json;
1807
+ updated_at: string;
1808
+ };
1809
+ Insert: {
1810
+ auto_accept_signups?: boolean;
1811
+ id?: number;
1812
+ settings?: import('./types').Json;
1813
+ updated_at?: string;
1814
+ };
1815
+ Update: {
1816
+ auto_accept_signups?: boolean;
1817
+ id?: number;
1818
+ settings?: import('./types').Json;
1819
+ updated_at?: string;
1820
+ };
1821
+ Relationships: [];
1822
+ };
1823
+ tax_rates: {
1824
+ Row: {
1825
+ country_code: string;
1826
+ created_at: string;
1827
+ id: string;
1828
+ state_code: string | null;
1829
+ tax_name: string;
1830
+ tax_rate: number;
1831
+ updated_at: string;
1832
+ };
1833
+ Insert: {
1834
+ country_code: string;
1835
+ created_at?: string;
1836
+ id?: string;
1837
+ state_code?: string | null;
1838
+ tax_name: string;
1839
+ tax_rate: number;
1840
+ updated_at?: string;
1841
+ };
1842
+ Update: {
1843
+ country_code?: string;
1844
+ created_at?: string;
1845
+ id?: string;
1846
+ state_code?: string | null;
1847
+ tax_name?: string;
1848
+ tax_rate?: number;
1849
+ updated_at?: string;
1850
+ };
1851
+ Relationships: [];
1852
+ };
1853
+ translations: {
1854
+ Row: {
1855
+ created_at: string;
1856
+ key: string;
1857
+ translations: import('./types').Json;
1858
+ updated_at: string;
1859
+ };
1860
+ Insert: {
1861
+ created_at?: string;
1862
+ key: string;
1863
+ translations: import('./types').Json;
1864
+ updated_at?: string;
1865
+ };
1866
+ Update: {
1867
+ created_at?: string;
1868
+ key?: string;
1869
+ translations?: import('./types').Json;
1870
+ updated_at?: string;
1871
+ };
1872
+ Relationships: [];
1873
+ };
1874
+ ucp_cart_sessions: {
1875
+ Row: {
1876
+ attribution: import('./types').Json;
1877
+ buyer_identity: import('./types').Json;
1878
+ checkout_url: string | null;
1879
+ context: import('./types').Json;
1880
+ created_at: string;
1881
+ currency: string;
1882
+ expires_at: string;
1883
+ id: string;
1884
+ line_items: import('./types').Json;
1885
+ locale: string | null;
1886
+ metadata: import('./types').Json;
1887
+ signals: import('./types').Json;
1888
+ status: string;
1889
+ totals: import('./types').Json;
1890
+ updated_at: string;
1891
+ };
1892
+ Insert: {
1893
+ attribution?: import('./types').Json;
1894
+ buyer_identity?: import('./types').Json;
1895
+ checkout_url?: string | null;
1896
+ context?: import('./types').Json;
1897
+ created_at?: string;
1898
+ currency?: string;
1899
+ expires_at?: string;
1900
+ id?: string;
1901
+ line_items?: import('./types').Json;
1902
+ locale?: string | null;
1903
+ metadata?: import('./types').Json;
1904
+ signals?: import('./types').Json;
1905
+ status?: string;
1906
+ totals?: import('./types').Json;
1907
+ updated_at?: string;
1908
+ };
1909
+ Update: {
1910
+ attribution?: import('./types').Json;
1911
+ buyer_identity?: import('./types').Json;
1912
+ checkout_url?: string | null;
1913
+ context?: import('./types').Json;
1914
+ created_at?: string;
1915
+ currency?: string;
1916
+ expires_at?: string;
1917
+ id?: string;
1918
+ line_items?: import('./types').Json;
1919
+ locale?: string | null;
1920
+ metadata?: import('./types').Json;
1921
+ signals?: import('./types').Json;
1922
+ status?: string;
1923
+ totals?: import('./types').Json;
1924
+ updated_at?: string;
1925
+ };
1926
+ Relationships: [];
1927
+ };
1928
+ user_addresses: {
1929
+ Row: {
1930
+ address_type: string;
1931
+ city: string | null;
1932
+ company_name: string | null;
1933
+ country_code: string | null;
1934
+ created_at: string;
1935
+ id: string;
1936
+ is_default: boolean;
1937
+ line1: string | null;
1938
+ line2: string | null;
1939
+ postal_code: string | null;
1940
+ recipient_name: string | null;
1941
+ state: string | null;
1942
+ updated_at: string;
1943
+ user_id: string;
1944
+ };
1945
+ Insert: {
1946
+ address_type: string;
1947
+ city?: string | null;
1948
+ company_name?: string | null;
1949
+ country_code?: string | null;
1950
+ created_at?: string;
1951
+ id?: string;
1952
+ is_default?: boolean;
1953
+ line1?: string | null;
1954
+ line2?: string | null;
1955
+ postal_code?: string | null;
1956
+ recipient_name?: string | null;
1957
+ state?: string | null;
1958
+ updated_at?: string;
1959
+ user_id: string;
1960
+ };
1961
+ Update: {
1962
+ address_type?: string;
1963
+ city?: string | null;
1964
+ company_name?: string | null;
1965
+ country_code?: string | null;
1966
+ created_at?: string;
1967
+ id?: string;
1968
+ is_default?: boolean;
1969
+ line1?: string | null;
1970
+ line2?: string | null;
1971
+ postal_code?: string | null;
1972
+ recipient_name?: string | null;
1973
+ state?: string | null;
1974
+ updated_at?: string;
1975
+ user_id?: string;
1976
+ };
1977
+ Relationships: [{
1978
+ foreignKeyName: "user_addresses_user_id_fkey";
1979
+ columns: ["user_id"];
1980
+ isOneToOne: false;
1981
+ referencedRelation: "profiles";
1982
+ referencedColumns: ["id"];
1983
+ }];
1984
+ };
1985
+ user_security_settings: {
1986
+ Row: {
1987
+ mfa_enabled: boolean;
1988
+ mfa_type: string | null;
1989
+ updated_at: string;
1990
+ user_id: string;
1991
+ };
1992
+ Insert: {
1993
+ mfa_enabled?: boolean;
1994
+ mfa_type?: string | null;
1995
+ updated_at?: string;
1996
+ user_id: string;
1997
+ };
1998
+ Update: {
1999
+ mfa_enabled?: boolean;
2000
+ mfa_type?: string | null;
2001
+ updated_at?: string;
2002
+ user_id?: string;
2003
+ };
2004
+ Relationships: [];
2005
+ };
2006
+ user_trusted_devices: {
2007
+ Row: {
2008
+ browser_metadata: string | null;
2009
+ created_at: string;
2010
+ device_hash: string;
2011
+ expires_at: string;
2012
+ id: string;
2013
+ user_id: string;
2014
+ };
2015
+ Insert: {
2016
+ browser_metadata?: string | null;
2017
+ created_at?: string;
2018
+ device_hash: string;
2019
+ expires_at: string;
2020
+ id?: string;
2021
+ user_id: string;
2022
+ };
2023
+ Update: {
2024
+ browser_metadata?: string | null;
2025
+ created_at?: string;
2026
+ device_hash?: string;
2027
+ expires_at?: string;
2028
+ id?: string;
2029
+ user_id?: string;
2030
+ };
2031
+ Relationships: [];
2032
+ };
2033
+ variant_attribute_mapping: {
2034
+ Row: {
2035
+ attribute_term_id: string;
2036
+ variant_id: string;
2037
+ };
2038
+ Insert: {
2039
+ attribute_term_id: string;
2040
+ variant_id: string;
2041
+ };
2042
+ Update: {
2043
+ attribute_term_id?: string;
2044
+ variant_id?: string;
2045
+ };
2046
+ Relationships: [{
2047
+ foreignKeyName: "variant_attribute_mapping_attribute_term_id_fkey";
2048
+ columns: ["attribute_term_id"];
2049
+ isOneToOne: false;
2050
+ referencedRelation: "product_attribute_terms";
2051
+ referencedColumns: ["id"];
2052
+ }, {
2053
+ foreignKeyName: "variant_attribute_mapping_variant_id_fkey";
2054
+ columns: ["variant_id"];
2055
+ isOneToOne: false;
2056
+ referencedRelation: "product_variants";
2057
+ referencedColumns: ["id"];
2058
+ }];
2059
+ };
2060
+ };
2061
+ Views: { [_ in never]: never; };
2062
+ Functions: {
2063
+ apply_order_inventory_deduction: {
2064
+ Args: {
2065
+ p_order_id: string;
2066
+ };
2067
+ Returns: undefined;
2068
+ };
2069
+ assign_order_invoice_metadata: {
2070
+ Args: {
2071
+ p_order_id: string;
2072
+ p_paid_at?: string;
2073
+ };
2074
+ Returns: {
2075
+ invoice_number: string;
2076
+ paid_at: string;
2077
+ }[];
2078
+ };
2079
+ clear_currency_price_overrides: {
2080
+ Args: {
2081
+ target_currency: string;
2082
+ };
2083
+ Returns: undefined;
2084
+ };
2085
+ duplicate_block_definition: {
2086
+ Args: {
2087
+ target_id: string;
2088
+ };
2089
+ Returns: {
2090
+ description: string;
2091
+ fields: import('./types').Json;
2092
+ id: string;
2093
+ is_original: boolean;
2094
+ layout_schema: import('./types').Json;
2095
+ name: string;
2096
+ slug: string;
2097
+ };
2098
+ SetofOptions: {
2099
+ from: "*";
2100
+ to: "custom_block_definitions";
2101
+ isOneToOne: true;
2102
+ isSetofReturn: false;
2103
+ };
2104
+ };
2105
+ format_order_invoice_number: {
2106
+ Args: {
2107
+ p_value: number;
2108
+ };
2109
+ Returns: string;
2110
+ };
2111
+ generate_order_invoice_number: {
2112
+ Args: never;
2113
+ Returns: string;
2114
+ };
2115
+ get_current_user_role: {
2116
+ Args: never;
2117
+ Returns: Database["public"]["Enums"]["user_role"];
2118
+ };
2119
+ get_default_currency_code: {
2120
+ Args: never;
2121
+ Returns: string;
2122
+ };
2123
+ get_ecommerce_track_quantities: {
2124
+ Args: never;
2125
+ Returns: boolean;
2126
+ };
2127
+ get_my_claim: {
2128
+ Args: {
2129
+ claim: string;
2130
+ };
2131
+ Returns: import('./types').Json;
2132
+ };
2133
+ is_admin: {
2134
+ Args: never;
2135
+ Returns: boolean;
2136
+ };
2137
+ is_valid_currency_amount_map: {
2138
+ Args: {
2139
+ amounts: import('./types').Json;
2140
+ };
2141
+ Returns: boolean;
2142
+ };
2143
+ is_valid_custom_block_fields: {
2144
+ Args: {
2145
+ candidate: import('./types').Json;
2146
+ };
2147
+ Returns: boolean;
2148
+ };
2149
+ is_valid_custom_block_layout_schema: {
2150
+ Args: {
2151
+ candidate: import('./types').Json;
2152
+ };
2153
+ Returns: boolean;
2154
+ };
2155
+ is_valid_sale_price_map: {
2156
+ Args: {
2157
+ prices: import('./types').Json;
2158
+ sale_prices: import('./types').Json;
2159
+ };
2160
+ Returns: boolean;
2161
+ };
2162
+ normalize_currency_amount_map: {
2163
+ Args: {
2164
+ amounts: import('./types').Json;
2165
+ };
2166
+ Returns: import('./types').Json;
2167
+ };
2168
+ sync_inventory_cache_for_sku: {
2169
+ Args: {
2170
+ p_sku: string;
2171
+ };
2172
+ Returns: undefined;
2173
+ };
2174
+ sync_legacy_price_columns_for_currency: {
2175
+ Args: {
2176
+ target_currency: string;
2177
+ };
2178
+ Returns: undefined;
2179
+ };
2180
+ upsert_product_with_variants: {
2181
+ Args: {
2182
+ product_payload: import('./types').Json;
2183
+ };
2184
+ Returns: string;
2185
+ };
2186
+ };
2187
+ Enums: {
2188
+ menu_location: "HEADER" | "FOOTER" | "SIDEBAR";
2189
+ page_status: "draft" | "published" | "archived";
2190
+ revision_type: "snapshot" | "diff";
2191
+ user_role: "ADMIN" | "WRITER" | "USER";
2192
+ };
2193
+ CompositeTypes: { [_ in never]: never; };
2194
+ }, {
2195
+ PostgrestVersion: "14.1";
2196
+ }>;
2197
+ export {};