@nextblock-cms/db 0.2.8 → 0.2.10
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.
- package/lib/supabase/client.d.ts +9 -0
- package/lib/supabase/middleware.d.ts +2 -0
- package/lib/supabase/server.d.ts +7 -0
- package/lib/supabase/ssg-client.d.ts +2 -0
- package/lib/supabase/types.d.ts +635 -0
- package/package.json +3 -13
- package/supabase/config.toml +0 -319
- package/supabase/migrations/20250513194738_setup_roles_and_profiles.sql +0 -41
- package/supabase/migrations/20250513194910_auto_create_profile_trigger.sql +0 -48
- package/supabase/migrations/20250513194916_rls_for_profiles.sql +0 -85
- package/supabase/migrations/20250514125634_fix_recursive_rls_policies.sql +0 -51
- package/supabase/migrations/20250514143016_setup_languages_table.sql +0 -66
- package/supabase/migrations/20250514171549_create_pages_table.sql +0 -73
- package/supabase/migrations/20250514171550_create_posts_table.sql +0 -61
- package/supabase/migrations/20250514171552_create_media_table.sql +0 -45
- package/supabase/migrations/20250514171553_create_blocks_table.sql +0 -54
- package/supabase/migrations/20250514171615_create_navigation_table.sql +0 -56
- package/supabase/migrations/20250514171627_rls_policies_for_content_tables.sql +0 -70
- package/supabase/migrations/20250515194800_add_translation_group_id.sql +0 -39
- package/supabase/migrations/20250520171900_add_translation_group_to_nav_items.sql +0 -21
- package/supabase/migrations/20250521143933_seed_homepage_and_nav.sql +0 -64
- package/supabase/migrations/20250523145833_add_feature_image_to_posts.sql +0 -8
- package/supabase/migrations/20250523151737_add_rls_to_media_table.sql +0 -18
- package/supabase/migrations/20250526110400_add_image_dimensions_to_media.sql +0 -14
- package/supabase/migrations/20250526153321_optimize_rls_policies.sql +0 -188
- package/supabase/migrations/20250526172513_resolve_select_policy_overlaps.sql +0 -96
- package/supabase/migrations/20250526172853_resolve_remaining_rls_v5.sql +0 -107
- package/supabase/migrations/20250526173538_finalize_rls_cleanup_v7.sql +0 -110
- package/supabase/migrations/20250526174710_separate_write_policies_v8.sql +0 -147
- package/supabase/migrations/20250526175359_fix_languages_select_rls_v9.sql +0 -81
- package/supabase/migrations/20250526182940_fix_nav_read_policy_v10.sql +0 -27
- package/supabase/migrations/20250526183239_fix_posts_read_rls_v11.sql +0 -59
- package/supabase/migrations/20250526183746_fix_media_select_rls_v12.sql +0 -39
- package/supabase/migrations/20250526184205_consolidate_content_read_rls_v13.sql +0 -61
- package/supabase/migrations/20250526185854_optimize_indexes.sql +0 -47
- package/supabase/migrations/20250526190900_debug_blocks_rls.sql +0 -56
- package/supabase/migrations/20250526191217_consolidate_blocks_select_rls.sql +0 -79
- package/supabase/migrations/20250526192822_fix_handle_languages_update_search_path.sql +0 -32
- package/supabase/migrations/20250527150500_fix_blocks_rls_policy.sql +0 -54
- package/supabase/migrations/20250602150602_add_blur_data_url_to_media.sql +0 -4
- package/supabase/migrations/20250602150959_add_variants_to_media.sql +0 -4
- package/supabase/migrations/20250618124000_create_get_my_claim_function.sql +0 -5
- package/supabase/migrations/20250618124100_create_logos_table.sql +0 -29
- package/supabase/migrations/20250618130000_fix_linter_warnings.sql +0 -58
- package/supabase/migrations/20250618151500_revert_storage_rls.sql +0 -6
- package/supabase/migrations/20250619084800_reinstate_storage_rls.sql +0 -13
- package/supabase/migrations/20250619092430_widen_logo_insert_policy.sql +0 -6
- package/supabase/migrations/20250619093122_fix_get_my_claim_volatility.sql +0 -5
- package/supabase/migrations/20250619104249_consolidated_logo_rls_fix.sql +0 -56
- package/supabase/migrations/20250619110700_fix_logo_rls_again.sql +0 -59
- package/supabase/migrations/20250619113200_add_file_path_to_media.sql +0 -4
- package/supabase/migrations/20250619124100_fix_rls_performance_warnings.sql +0 -74
- package/supabase/migrations/20250619195500_create_site_settings_table.sql +0 -28
- package/supabase/migrations/20250619201500_add_anon_read_to_site_settings.sql +0 -7
- package/supabase/migrations/20250619202000_add_is_active_to_languages.sql +0 -5
- package/supabase/migrations/20250620085700_fix_site_settings_write_rls.sql +0 -27
- package/supabase/migrations/20250620095500_fix_profiles_read_rls.sql +0 -11
- package/supabase/migrations/20250620100000_use_security_definer_for_rls.sql +0 -39
- package/supabase/migrations/20250620130000_add_public_read_to_logos.sql +0 -4
- package/supabase/migrations/20250708091700_create_translations_table.sql +0 -55
- package/supabase/migrations/20250708093403_seed_translations_table.sql +0 -20
- package/supabase/migrations/20250708110600_fix_translations_rls_policies.sql +0 -11
- package/supabase/migrations/20250708112300_add_new_translations.sql +0 -9
- package/supabase/migrations/20250709120000_create_revisions_tables.sql +0 -109
- package/supabase/migrations/20251001113000_add_folder_to_media.sql +0 -14
- package/supabase/migrations/20251112113736_fix_search_path_functions.sql +0 -74
- package/supabase/migrations/20251112124444_fix_rls_performance.sql +0 -63
- package/supabase/migrations/20251112125935_fix_combined_policies.sql +0 -194
- package/supabase/migrations/20251112132146_fix_foreign_key_indexes.sql +0 -21
- package/supabase/migrations/20251112132525_cleanup_unused_indexes.sql +0 -10
- package/supabase/migrations/20251112132822_fix_final_indexes.sql +0 -14
- package/supabase/migrations/20251112140000_scaffold_foundational_content.sql +0 -95
- package/supabase/migrations/20251112141000_seed_homepage_blocks.sql +0 -656
- package/supabase/migrations/20251112142000_seed_how_it_works_post_blocks.sql +0 -100
- package/supabase/migrations/20251112143000_seed_additional_translations.sql +0 -102
- package/supabase/migrations/20251112145000_grant_public_schema_usage.sql +0 -6
- package/supabase/migrations/20251112145500_grant_select_on_public_tables.sql +0 -19
- package/supabase/migrations/20251117093000_add_admin_created_flag.sql +0 -21
- package/supabase/migrations/20251117103000_relax_profile_username_constraint.sql +0 -6
- package/supabase/migrations/20251117110000_relax_profiles_site_settings_rls_for_signup.sql +0 -20
- package/supabase/migrations/20251117112000_fix_handle_new_user_role_enum.sql +0 -45
- package/supabase/migrations/20251117113000_cleanup_rls_duplicates.sql +0 -20
- package/supabase/migrations/20251117200000_media_service_role_insert.sql +0 -14
- package/supabase/migrations/20251117201500_media_service_role_select.sql +0 -11
- package/supabase/migrations/20251117203000_media_admin_writer_select.sql +0 -11
- package/supabase/migrations/20251117204500_fix_media_permissions.sql +0 -43
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import { Database } from './types';
|
|
3
|
+
type Profile = Database['public']['Tables']['profiles']['Row'];
|
|
4
|
+
type Language = Database['public']['Tables']['languages']['Row'];
|
|
5
|
+
export declare const createClient: () => SupabaseClient<any, "public", "public", any, any>;
|
|
6
|
+
export declare function getProfileWithRoleClientSide(supabase: SupabaseClient, // Accept the client instance
|
|
7
|
+
userId: string): Promise<Profile | null>;
|
|
8
|
+
export declare function getActiveLanguagesClientSide(): Promise<Language[]>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
export type Json = string | number | boolean | null | {
|
|
2
|
+
[key: string]: Json | undefined;
|
|
3
|
+
} | Json[];
|
|
4
|
+
export type Database = {
|
|
5
|
+
__InternalSupabase: {
|
|
6
|
+
PostgrestVersion: "12.2.3 (519615d)";
|
|
7
|
+
};
|
|
8
|
+
public: {
|
|
9
|
+
Tables: {
|
|
10
|
+
blocks: {
|
|
11
|
+
Row: {
|
|
12
|
+
block_type: string;
|
|
13
|
+
content: Json | null;
|
|
14
|
+
created_at: string;
|
|
15
|
+
id: number;
|
|
16
|
+
language_id: number;
|
|
17
|
+
order: number;
|
|
18
|
+
page_id: number | null;
|
|
19
|
+
post_id: number | null;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
};
|
|
22
|
+
Insert: {
|
|
23
|
+
block_type: string;
|
|
24
|
+
content?: Json | null;
|
|
25
|
+
created_at?: string;
|
|
26
|
+
id?: number;
|
|
27
|
+
language_id: number;
|
|
28
|
+
order?: number;
|
|
29
|
+
page_id?: number | null;
|
|
30
|
+
post_id?: number | null;
|
|
31
|
+
updated_at?: string;
|
|
32
|
+
};
|
|
33
|
+
Update: {
|
|
34
|
+
block_type?: string;
|
|
35
|
+
content?: Json | null;
|
|
36
|
+
created_at?: string;
|
|
37
|
+
id?: number;
|
|
38
|
+
language_id?: number;
|
|
39
|
+
order?: number;
|
|
40
|
+
page_id?: number | null;
|
|
41
|
+
post_id?: number | null;
|
|
42
|
+
updated_at?: string;
|
|
43
|
+
};
|
|
44
|
+
Relationships: [
|
|
45
|
+
{
|
|
46
|
+
foreignKeyName: "blocks_language_id_fkey";
|
|
47
|
+
columns: ["language_id"];
|
|
48
|
+
isOneToOne: false;
|
|
49
|
+
referencedRelation: "languages";
|
|
50
|
+
referencedColumns: ["id"];
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
foreignKeyName: "blocks_page_id_fkey";
|
|
54
|
+
columns: ["page_id"];
|
|
55
|
+
isOneToOne: false;
|
|
56
|
+
referencedRelation: "pages";
|
|
57
|
+
referencedColumns: ["id"];
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
foreignKeyName: "blocks_post_id_fkey";
|
|
61
|
+
columns: ["post_id"];
|
|
62
|
+
isOneToOne: false;
|
|
63
|
+
referencedRelation: "posts";
|
|
64
|
+
referencedColumns: ["id"];
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
};
|
|
68
|
+
languages: {
|
|
69
|
+
Row: {
|
|
70
|
+
code: string;
|
|
71
|
+
created_at: string;
|
|
72
|
+
id: number;
|
|
73
|
+
is_active: boolean;
|
|
74
|
+
is_default: boolean;
|
|
75
|
+
name: string;
|
|
76
|
+
updated_at: string;
|
|
77
|
+
};
|
|
78
|
+
Insert: {
|
|
79
|
+
code: string;
|
|
80
|
+
created_at?: string;
|
|
81
|
+
id?: number;
|
|
82
|
+
is_active?: boolean;
|
|
83
|
+
is_default?: boolean;
|
|
84
|
+
name: string;
|
|
85
|
+
updated_at?: string;
|
|
86
|
+
};
|
|
87
|
+
Update: {
|
|
88
|
+
code?: string;
|
|
89
|
+
created_at?: string;
|
|
90
|
+
id?: number;
|
|
91
|
+
is_active?: boolean;
|
|
92
|
+
is_default?: boolean;
|
|
93
|
+
name?: string;
|
|
94
|
+
updated_at?: string;
|
|
95
|
+
};
|
|
96
|
+
Relationships: [];
|
|
97
|
+
};
|
|
98
|
+
logos: {
|
|
99
|
+
Row: {
|
|
100
|
+
created_at: string;
|
|
101
|
+
id: string;
|
|
102
|
+
media_id: string | null;
|
|
103
|
+
name: string;
|
|
104
|
+
};
|
|
105
|
+
Insert: {
|
|
106
|
+
created_at?: string;
|
|
107
|
+
id?: string;
|
|
108
|
+
media_id?: string | null;
|
|
109
|
+
name: string;
|
|
110
|
+
};
|
|
111
|
+
Update: {
|
|
112
|
+
created_at?: string;
|
|
113
|
+
id?: string;
|
|
114
|
+
media_id?: string | null;
|
|
115
|
+
name?: string;
|
|
116
|
+
};
|
|
117
|
+
Relationships: [
|
|
118
|
+
{
|
|
119
|
+
foreignKeyName: "logos_media_id_fkey";
|
|
120
|
+
columns: ["media_id"];
|
|
121
|
+
isOneToOne: false;
|
|
122
|
+
referencedRelation: "media";
|
|
123
|
+
referencedColumns: ["id"];
|
|
124
|
+
}
|
|
125
|
+
];
|
|
126
|
+
};
|
|
127
|
+
media: {
|
|
128
|
+
Row: {
|
|
129
|
+
blur_data_url: string | null;
|
|
130
|
+
created_at: string;
|
|
131
|
+
description: string | null;
|
|
132
|
+
file_name: string;
|
|
133
|
+
file_path: string | null;
|
|
134
|
+
file_type: string | null;
|
|
135
|
+
folder: string | null;
|
|
136
|
+
height: number | null;
|
|
137
|
+
id: string;
|
|
138
|
+
object_key: string;
|
|
139
|
+
size_bytes: number | null;
|
|
140
|
+
updated_at: string;
|
|
141
|
+
uploader_id: string | null;
|
|
142
|
+
variants: Json | null;
|
|
143
|
+
width: number | null;
|
|
144
|
+
};
|
|
145
|
+
Insert: {
|
|
146
|
+
blur_data_url?: string | null;
|
|
147
|
+
created_at?: string;
|
|
148
|
+
description?: string | null;
|
|
149
|
+
file_name: string;
|
|
150
|
+
file_path?: string | null;
|
|
151
|
+
file_type?: string | null;
|
|
152
|
+
folder?: string | null;
|
|
153
|
+
height?: number | null;
|
|
154
|
+
id?: string;
|
|
155
|
+
object_key: string;
|
|
156
|
+
size_bytes?: number | null;
|
|
157
|
+
updated_at?: string;
|
|
158
|
+
uploader_id?: string | null;
|
|
159
|
+
variants?: Json | null;
|
|
160
|
+
width?: number | null;
|
|
161
|
+
};
|
|
162
|
+
Update: {
|
|
163
|
+
blur_data_url?: string | null;
|
|
164
|
+
created_at?: string;
|
|
165
|
+
description?: string | null;
|
|
166
|
+
file_name?: string;
|
|
167
|
+
file_path?: string | null;
|
|
168
|
+
file_type?: string | null;
|
|
169
|
+
folder?: string | null;
|
|
170
|
+
height?: number | null;
|
|
171
|
+
id?: string;
|
|
172
|
+
object_key?: string;
|
|
173
|
+
size_bytes?: number | null;
|
|
174
|
+
updated_at?: string;
|
|
175
|
+
uploader_id?: string | null;
|
|
176
|
+
variants?: Json | null;
|
|
177
|
+
width?: number | null;
|
|
178
|
+
};
|
|
179
|
+
Relationships: [
|
|
180
|
+
{
|
|
181
|
+
foreignKeyName: "media_uploader_id_fkey";
|
|
182
|
+
columns: ["uploader_id"];
|
|
183
|
+
isOneToOne: false;
|
|
184
|
+
referencedRelation: "profiles";
|
|
185
|
+
referencedColumns: ["id"];
|
|
186
|
+
}
|
|
187
|
+
];
|
|
188
|
+
};
|
|
189
|
+
navigation_items: {
|
|
190
|
+
Row: {
|
|
191
|
+
created_at: string;
|
|
192
|
+
id: number;
|
|
193
|
+
label: string;
|
|
194
|
+
language_id: number;
|
|
195
|
+
menu_key: Database["public"]["Enums"]["menu_location"];
|
|
196
|
+
order: number;
|
|
197
|
+
page_id: number | null;
|
|
198
|
+
parent_id: number | null;
|
|
199
|
+
translation_group_id: string;
|
|
200
|
+
updated_at: string;
|
|
201
|
+
url: string;
|
|
202
|
+
};
|
|
203
|
+
Insert: {
|
|
204
|
+
created_at?: string;
|
|
205
|
+
id?: number;
|
|
206
|
+
label: string;
|
|
207
|
+
language_id: number;
|
|
208
|
+
menu_key: Database["public"]["Enums"]["menu_location"];
|
|
209
|
+
order?: number;
|
|
210
|
+
page_id?: number | null;
|
|
211
|
+
parent_id?: number | null;
|
|
212
|
+
translation_group_id?: string;
|
|
213
|
+
updated_at?: string;
|
|
214
|
+
url: string;
|
|
215
|
+
};
|
|
216
|
+
Update: {
|
|
217
|
+
created_at?: string;
|
|
218
|
+
id?: number;
|
|
219
|
+
label?: string;
|
|
220
|
+
language_id?: number;
|
|
221
|
+
menu_key?: Database["public"]["Enums"]["menu_location"];
|
|
222
|
+
order?: number;
|
|
223
|
+
page_id?: number | null;
|
|
224
|
+
parent_id?: number | null;
|
|
225
|
+
translation_group_id?: string;
|
|
226
|
+
updated_at?: string;
|
|
227
|
+
url?: string;
|
|
228
|
+
};
|
|
229
|
+
Relationships: [
|
|
230
|
+
{
|
|
231
|
+
foreignKeyName: "navigation_items_language_id_fkey";
|
|
232
|
+
columns: ["language_id"];
|
|
233
|
+
isOneToOne: false;
|
|
234
|
+
referencedRelation: "languages";
|
|
235
|
+
referencedColumns: ["id"];
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
foreignKeyName: "navigation_items_page_id_fkey";
|
|
239
|
+
columns: ["page_id"];
|
|
240
|
+
isOneToOne: false;
|
|
241
|
+
referencedRelation: "pages";
|
|
242
|
+
referencedColumns: ["id"];
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
foreignKeyName: "navigation_items_parent_id_fkey";
|
|
246
|
+
columns: ["parent_id"];
|
|
247
|
+
isOneToOne: false;
|
|
248
|
+
referencedRelation: "navigation_items";
|
|
249
|
+
referencedColumns: ["id"];
|
|
250
|
+
}
|
|
251
|
+
];
|
|
252
|
+
};
|
|
253
|
+
page_revisions: {
|
|
254
|
+
Row: {
|
|
255
|
+
author_id: string | null;
|
|
256
|
+
content: Json;
|
|
257
|
+
created_at: string;
|
|
258
|
+
id: number;
|
|
259
|
+
page_id: number;
|
|
260
|
+
revision_type: Database["public"]["Enums"]["revision_type"];
|
|
261
|
+
version: number;
|
|
262
|
+
};
|
|
263
|
+
Insert: {
|
|
264
|
+
author_id?: string | null;
|
|
265
|
+
content: Json;
|
|
266
|
+
created_at?: string;
|
|
267
|
+
id?: number;
|
|
268
|
+
page_id: number;
|
|
269
|
+
revision_type: Database["public"]["Enums"]["revision_type"];
|
|
270
|
+
version: number;
|
|
271
|
+
};
|
|
272
|
+
Update: {
|
|
273
|
+
author_id?: string | null;
|
|
274
|
+
content?: Json;
|
|
275
|
+
created_at?: string;
|
|
276
|
+
id?: number;
|
|
277
|
+
page_id?: number;
|
|
278
|
+
revision_type?: Database["public"]["Enums"]["revision_type"];
|
|
279
|
+
version?: number;
|
|
280
|
+
};
|
|
281
|
+
Relationships: [
|
|
282
|
+
{
|
|
283
|
+
foreignKeyName: "page_revisions_author_id_fkey";
|
|
284
|
+
columns: ["author_id"];
|
|
285
|
+
isOneToOne: false;
|
|
286
|
+
referencedRelation: "profiles";
|
|
287
|
+
referencedColumns: ["id"];
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
foreignKeyName: "page_revisions_page_id_fkey";
|
|
291
|
+
columns: ["page_id"];
|
|
292
|
+
isOneToOne: false;
|
|
293
|
+
referencedRelation: "pages";
|
|
294
|
+
referencedColumns: ["id"];
|
|
295
|
+
}
|
|
296
|
+
];
|
|
297
|
+
};
|
|
298
|
+
pages: {
|
|
299
|
+
Row: {
|
|
300
|
+
author_id: string | null;
|
|
301
|
+
created_at: string;
|
|
302
|
+
id: number;
|
|
303
|
+
language_id: number;
|
|
304
|
+
meta_description: string | null;
|
|
305
|
+
meta_title: string | null;
|
|
306
|
+
slug: string;
|
|
307
|
+
status: Database["public"]["Enums"]["page_status"];
|
|
308
|
+
title: string;
|
|
309
|
+
translation_group_id: string;
|
|
310
|
+
updated_at: string;
|
|
311
|
+
version: number;
|
|
312
|
+
};
|
|
313
|
+
Insert: {
|
|
314
|
+
author_id?: string | null;
|
|
315
|
+
created_at?: string;
|
|
316
|
+
id?: number;
|
|
317
|
+
language_id: number;
|
|
318
|
+
meta_description?: string | null;
|
|
319
|
+
meta_title?: string | null;
|
|
320
|
+
slug: string;
|
|
321
|
+
status?: Database["public"]["Enums"]["page_status"];
|
|
322
|
+
title: string;
|
|
323
|
+
translation_group_id?: string;
|
|
324
|
+
updated_at?: string;
|
|
325
|
+
version?: number;
|
|
326
|
+
};
|
|
327
|
+
Update: {
|
|
328
|
+
author_id?: string | null;
|
|
329
|
+
created_at?: string;
|
|
330
|
+
id?: number;
|
|
331
|
+
language_id?: number;
|
|
332
|
+
meta_description?: string | null;
|
|
333
|
+
meta_title?: string | null;
|
|
334
|
+
slug?: string;
|
|
335
|
+
status?: Database["public"]["Enums"]["page_status"];
|
|
336
|
+
title?: string;
|
|
337
|
+
translation_group_id?: string;
|
|
338
|
+
updated_at?: string;
|
|
339
|
+
version?: number;
|
|
340
|
+
};
|
|
341
|
+
Relationships: [
|
|
342
|
+
{
|
|
343
|
+
foreignKeyName: "pages_author_id_fkey";
|
|
344
|
+
columns: ["author_id"];
|
|
345
|
+
isOneToOne: false;
|
|
346
|
+
referencedRelation: "profiles";
|
|
347
|
+
referencedColumns: ["id"];
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
foreignKeyName: "pages_language_id_fkey";
|
|
351
|
+
columns: ["language_id"];
|
|
352
|
+
isOneToOne: false;
|
|
353
|
+
referencedRelation: "languages";
|
|
354
|
+
referencedColumns: ["id"];
|
|
355
|
+
}
|
|
356
|
+
];
|
|
357
|
+
};
|
|
358
|
+
post_revisions: {
|
|
359
|
+
Row: {
|
|
360
|
+
author_id: string | null;
|
|
361
|
+
content: Json;
|
|
362
|
+
created_at: string;
|
|
363
|
+
id: number;
|
|
364
|
+
post_id: number;
|
|
365
|
+
revision_type: Database["public"]["Enums"]["revision_type"];
|
|
366
|
+
version: number;
|
|
367
|
+
};
|
|
368
|
+
Insert: {
|
|
369
|
+
author_id?: string | null;
|
|
370
|
+
content: Json;
|
|
371
|
+
created_at?: string;
|
|
372
|
+
id?: number;
|
|
373
|
+
post_id: number;
|
|
374
|
+
revision_type: Database["public"]["Enums"]["revision_type"];
|
|
375
|
+
version: number;
|
|
376
|
+
};
|
|
377
|
+
Update: {
|
|
378
|
+
author_id?: string | null;
|
|
379
|
+
content?: Json;
|
|
380
|
+
created_at?: string;
|
|
381
|
+
id?: number;
|
|
382
|
+
post_id?: number;
|
|
383
|
+
revision_type?: Database["public"]["Enums"]["revision_type"];
|
|
384
|
+
version?: number;
|
|
385
|
+
};
|
|
386
|
+
Relationships: [
|
|
387
|
+
{
|
|
388
|
+
foreignKeyName: "post_revisions_author_id_fkey";
|
|
389
|
+
columns: ["author_id"];
|
|
390
|
+
isOneToOne: false;
|
|
391
|
+
referencedRelation: "profiles";
|
|
392
|
+
referencedColumns: ["id"];
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
foreignKeyName: "post_revisions_post_id_fkey";
|
|
396
|
+
columns: ["post_id"];
|
|
397
|
+
isOneToOne: false;
|
|
398
|
+
referencedRelation: "posts";
|
|
399
|
+
referencedColumns: ["id"];
|
|
400
|
+
}
|
|
401
|
+
];
|
|
402
|
+
};
|
|
403
|
+
posts: {
|
|
404
|
+
Row: {
|
|
405
|
+
author_id: string | null;
|
|
406
|
+
created_at: string;
|
|
407
|
+
excerpt: string | null;
|
|
408
|
+
feature_image_id: string | null;
|
|
409
|
+
id: number;
|
|
410
|
+
language_id: number;
|
|
411
|
+
meta_description: string | null;
|
|
412
|
+
meta_title: string | null;
|
|
413
|
+
published_at: string | null;
|
|
414
|
+
slug: string;
|
|
415
|
+
status: Database["public"]["Enums"]["page_status"];
|
|
416
|
+
title: string;
|
|
417
|
+
translation_group_id: string;
|
|
418
|
+
updated_at: string;
|
|
419
|
+
version: number;
|
|
420
|
+
};
|
|
421
|
+
Insert: {
|
|
422
|
+
author_id?: string | null;
|
|
423
|
+
created_at?: string;
|
|
424
|
+
excerpt?: string | null;
|
|
425
|
+
feature_image_id?: string | null;
|
|
426
|
+
id?: number;
|
|
427
|
+
language_id: number;
|
|
428
|
+
meta_description?: string | null;
|
|
429
|
+
meta_title?: string | null;
|
|
430
|
+
published_at?: string | null;
|
|
431
|
+
slug: string;
|
|
432
|
+
status?: Database["public"]["Enums"]["page_status"];
|
|
433
|
+
title: string;
|
|
434
|
+
translation_group_id?: string;
|
|
435
|
+
updated_at?: string;
|
|
436
|
+
version?: number;
|
|
437
|
+
};
|
|
438
|
+
Update: {
|
|
439
|
+
author_id?: string | null;
|
|
440
|
+
created_at?: string;
|
|
441
|
+
excerpt?: string | null;
|
|
442
|
+
feature_image_id?: string | null;
|
|
443
|
+
id?: number;
|
|
444
|
+
language_id?: number;
|
|
445
|
+
meta_description?: string | null;
|
|
446
|
+
meta_title?: string | null;
|
|
447
|
+
published_at?: string | null;
|
|
448
|
+
slug?: string;
|
|
449
|
+
status?: Database["public"]["Enums"]["page_status"];
|
|
450
|
+
title?: string;
|
|
451
|
+
translation_group_id?: string;
|
|
452
|
+
updated_at?: string;
|
|
453
|
+
version?: number;
|
|
454
|
+
};
|
|
455
|
+
Relationships: [
|
|
456
|
+
{
|
|
457
|
+
foreignKeyName: "fk_feature_image";
|
|
458
|
+
columns: ["feature_image_id"];
|
|
459
|
+
isOneToOne: false;
|
|
460
|
+
referencedRelation: "media";
|
|
461
|
+
referencedColumns: ["id"];
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
foreignKeyName: "posts_author_id_fkey";
|
|
465
|
+
columns: ["author_id"];
|
|
466
|
+
isOneToOne: false;
|
|
467
|
+
referencedRelation: "profiles";
|
|
468
|
+
referencedColumns: ["id"];
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
foreignKeyName: "posts_language_id_fkey";
|
|
472
|
+
columns: ["language_id"];
|
|
473
|
+
isOneToOne: false;
|
|
474
|
+
referencedRelation: "languages";
|
|
475
|
+
referencedColumns: ["id"];
|
|
476
|
+
}
|
|
477
|
+
];
|
|
478
|
+
};
|
|
479
|
+
profiles: {
|
|
480
|
+
Row: {
|
|
481
|
+
avatar_url: string | null;
|
|
482
|
+
full_name: string | null;
|
|
483
|
+
id: string;
|
|
484
|
+
role: Database["public"]["Enums"]["user_role"];
|
|
485
|
+
updated_at: string | null;
|
|
486
|
+
username: string | null;
|
|
487
|
+
website: string | null;
|
|
488
|
+
};
|
|
489
|
+
Insert: {
|
|
490
|
+
avatar_url?: string | null;
|
|
491
|
+
full_name?: string | null;
|
|
492
|
+
id: string;
|
|
493
|
+
role?: Database["public"]["Enums"]["user_role"];
|
|
494
|
+
updated_at?: string | null;
|
|
495
|
+
username?: string | null;
|
|
496
|
+
website?: string | null;
|
|
497
|
+
};
|
|
498
|
+
Update: {
|
|
499
|
+
avatar_url?: string | null;
|
|
500
|
+
full_name?: string | null;
|
|
501
|
+
id?: string;
|
|
502
|
+
role?: Database["public"]["Enums"]["user_role"];
|
|
503
|
+
updated_at?: string | null;
|
|
504
|
+
username?: string | null;
|
|
505
|
+
website?: string | null;
|
|
506
|
+
};
|
|
507
|
+
Relationships: [];
|
|
508
|
+
};
|
|
509
|
+
site_settings: {
|
|
510
|
+
Row: {
|
|
511
|
+
key: string;
|
|
512
|
+
value: Json | null;
|
|
513
|
+
};
|
|
514
|
+
Insert: {
|
|
515
|
+
key: string;
|
|
516
|
+
value?: Json | null;
|
|
517
|
+
};
|
|
518
|
+
Update: {
|
|
519
|
+
key?: string;
|
|
520
|
+
value?: Json | null;
|
|
521
|
+
};
|
|
522
|
+
Relationships: [];
|
|
523
|
+
};
|
|
524
|
+
translations: {
|
|
525
|
+
Row: {
|
|
526
|
+
created_at: string;
|
|
527
|
+
key: string;
|
|
528
|
+
translations: Json;
|
|
529
|
+
updated_at: string;
|
|
530
|
+
};
|
|
531
|
+
Insert: {
|
|
532
|
+
created_at?: string;
|
|
533
|
+
key: string;
|
|
534
|
+
translations: Json;
|
|
535
|
+
updated_at?: string;
|
|
536
|
+
};
|
|
537
|
+
Update: {
|
|
538
|
+
created_at?: string;
|
|
539
|
+
key?: string;
|
|
540
|
+
translations?: Json;
|
|
541
|
+
updated_at?: string;
|
|
542
|
+
};
|
|
543
|
+
Relationships: [];
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
Views: {
|
|
547
|
+
[_ in never]: never;
|
|
548
|
+
};
|
|
549
|
+
Functions: {
|
|
550
|
+
get_current_user_role: {
|
|
551
|
+
Args: never;
|
|
552
|
+
Returns: Database["public"]["Enums"]["user_role"];
|
|
553
|
+
};
|
|
554
|
+
get_my_claim: {
|
|
555
|
+
Args: {
|
|
556
|
+
claim: string;
|
|
557
|
+
};
|
|
558
|
+
Returns: string;
|
|
559
|
+
};
|
|
560
|
+
get_my_role: {
|
|
561
|
+
Args: never;
|
|
562
|
+
Returns: string;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
Enums: {
|
|
566
|
+
menu_location: "HEADER" | "FOOTER" | "SIDEBAR";
|
|
567
|
+
page_status: "draft" | "published" | "archived";
|
|
568
|
+
revision_type: "snapshot" | "diff";
|
|
569
|
+
user_role: "ADMIN" | "WRITER" | "USER";
|
|
570
|
+
};
|
|
571
|
+
CompositeTypes: {
|
|
572
|
+
[_ in never]: never;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
|
|
577
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
|
|
578
|
+
export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
|
|
579
|
+
schema: keyof DatabaseWithoutInternals;
|
|
580
|
+
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
581
|
+
schema: keyof DatabaseWithoutInternals;
|
|
582
|
+
} ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
583
|
+
schema: keyof DatabaseWithoutInternals;
|
|
584
|
+
} ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
585
|
+
Row: infer R;
|
|
586
|
+
} ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
|
|
587
|
+
Row: infer R;
|
|
588
|
+
} ? R : never : never;
|
|
589
|
+
export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
|
|
590
|
+
schema: keyof DatabaseWithoutInternals;
|
|
591
|
+
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
592
|
+
schema: keyof DatabaseWithoutInternals;
|
|
593
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
594
|
+
schema: keyof DatabaseWithoutInternals;
|
|
595
|
+
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
596
|
+
Insert: infer I;
|
|
597
|
+
} ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
598
|
+
Insert: infer I;
|
|
599
|
+
} ? I : never : never;
|
|
600
|
+
export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
|
|
601
|
+
schema: keyof DatabaseWithoutInternals;
|
|
602
|
+
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
603
|
+
schema: keyof DatabaseWithoutInternals;
|
|
604
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
605
|
+
schema: keyof DatabaseWithoutInternals;
|
|
606
|
+
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
607
|
+
Update: infer U;
|
|
608
|
+
} ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
609
|
+
Update: infer U;
|
|
610
|
+
} ? U : never : never;
|
|
611
|
+
export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
|
|
612
|
+
schema: keyof DatabaseWithoutInternals;
|
|
613
|
+
}, EnumName extends DefaultSchemaEnumNameOrOptions extends {
|
|
614
|
+
schema: keyof DatabaseWithoutInternals;
|
|
615
|
+
} ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
|
|
616
|
+
schema: keyof DatabaseWithoutInternals;
|
|
617
|
+
} ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
|
|
618
|
+
export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
|
|
619
|
+
schema: keyof DatabaseWithoutInternals;
|
|
620
|
+
}, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
|
621
|
+
schema: keyof DatabaseWithoutInternals;
|
|
622
|
+
} ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
|
|
623
|
+
schema: keyof DatabaseWithoutInternals;
|
|
624
|
+
} ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
|
|
625
|
+
export declare const Constants: {
|
|
626
|
+
readonly public: {
|
|
627
|
+
readonly Enums: {
|
|
628
|
+
readonly menu_location: readonly ["HEADER", "FOOTER", "SIDEBAR"];
|
|
629
|
+
readonly page_status: readonly ["draft", "published", "archived"];
|
|
630
|
+
readonly revision_type: readonly ["snapshot", "diff"];
|
|
631
|
+
readonly user_role: readonly ["ADMIN", "WRITER", "USER"];
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextblock-cms/db",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"main": "index.cjs.js",
|
|
5
5
|
"module": "index.es.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -16,15 +16,5 @@
|
|
|
16
16
|
"default": "./server.es.js"
|
|
17
17
|
},
|
|
18
18
|
"./package.json": "./package.json"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
"dist",
|
|
22
|
-
"supabase",
|
|
23
|
-
"supabase/**",
|
|
24
|
-
"*.js",
|
|
25
|
-
"*.cjs.js",
|
|
26
|
-
"*.es.js",
|
|
27
|
-
"*.mjs",
|
|
28
|
-
"*.d.ts"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
19
|
+
}
|
|
20
|
+
}
|