@plutocms/supabase 0.0.1-alpha.1 → 0.0.1-alpha.11
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/app/components/navbar/NavbarAdmin.vue +5 -5
- package/app/composables/auth.ts +17 -1
- package/app/middleware/auth.ts +5 -1
- package/app/middleware/setup-check.ts +30 -18
- package/app/pages/admin/(auth)/signup.vue +16 -10
- package/app/pages/admin/setup.vue +30 -27
- package/app/pages/admin.vue +1 -0
- package/bun.lock +160 -8
- package/modules/pluto-migrations.ts +71 -0
- package/nuxt.config.ts +13 -19
- package/package.json +6 -4
- package/public/schema.sql +155 -32
- package/server/api/settings/first_setup.get.ts +2 -2
- package/server/api/setup/create.post.ts +44 -10
- package/server/api/signup.post.ts +26 -8
- package/server/plugins/migrations.ts +48 -0
- package/server/utils/migrations.ts +88 -0
- package/server/utils/sql.ts +81 -0
- package/shared/types/supabase.ts +78 -117
package/shared/types/supabase.ts
CHANGED
|
@@ -10,95 +10,113 @@ export type Database = {
|
|
|
10
10
|
// Allows to automatically instantiate createClient with right options
|
|
11
11
|
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
|
12
12
|
__InternalSupabase: {
|
|
13
|
-
PostgrestVersion: "
|
|
13
|
+
PostgrestVersion: "14.1"
|
|
14
14
|
}
|
|
15
15
|
public: {
|
|
16
16
|
Tables: {
|
|
17
|
-
|
|
17
|
+
healthcheck: {
|
|
18
18
|
Row: {
|
|
19
|
-
|
|
19
|
+
config_name: Database["public"]["Enums"]["thealthcheck"]
|
|
20
|
+
config_value: string
|
|
20
21
|
id: number
|
|
21
|
-
label: string | null
|
|
22
|
-
slug: string | null
|
|
23
22
|
}
|
|
24
23
|
Insert: {
|
|
25
|
-
|
|
24
|
+
config_name: Database["public"]["Enums"]["thealthcheck"]
|
|
25
|
+
config_value: string
|
|
26
26
|
id?: number
|
|
27
|
-
label?: string | null
|
|
28
|
-
slug?: string | null
|
|
29
27
|
}
|
|
30
28
|
Update: {
|
|
31
|
-
|
|
29
|
+
config_name?: Database["public"]["Enums"]["thealthcheck"]
|
|
30
|
+
config_value?: string
|
|
32
31
|
id?: number
|
|
33
|
-
label?: string | null
|
|
34
|
-
slug?: string | null
|
|
35
32
|
}
|
|
36
33
|
Relationships: []
|
|
37
34
|
}
|
|
38
|
-
|
|
35
|
+
pluto_migrations: {
|
|
39
36
|
Row: {
|
|
40
|
-
|
|
37
|
+
applied_at: string
|
|
38
|
+
id: number
|
|
39
|
+
layer_name: string
|
|
40
|
+
}
|
|
41
|
+
Insert: {
|
|
42
|
+
applied_at?: string
|
|
43
|
+
id?: number
|
|
44
|
+
layer_name: string
|
|
45
|
+
}
|
|
46
|
+
Update: {
|
|
47
|
+
applied_at?: string
|
|
48
|
+
id?: number
|
|
49
|
+
layer_name?: string
|
|
50
|
+
}
|
|
51
|
+
Relationships: []
|
|
52
|
+
}
|
|
53
|
+
product_availability: {
|
|
54
|
+
Row: {
|
|
55
|
+
created_at: string
|
|
41
56
|
id: number
|
|
42
57
|
label: string
|
|
43
58
|
slug: string
|
|
44
59
|
}
|
|
45
60
|
Insert: {
|
|
46
|
-
|
|
47
|
-
id?:
|
|
61
|
+
created_at?: string
|
|
62
|
+
id?: never
|
|
48
63
|
label: string
|
|
49
64
|
slug: string
|
|
50
65
|
}
|
|
51
66
|
Update: {
|
|
52
|
-
|
|
53
|
-
id?:
|
|
67
|
+
created_at?: string
|
|
68
|
+
id?: never
|
|
54
69
|
label?: string
|
|
55
70
|
slug?: string
|
|
56
71
|
}
|
|
57
72
|
Relationships: []
|
|
58
73
|
}
|
|
59
|
-
|
|
74
|
+
product_categories: {
|
|
60
75
|
Row: {
|
|
61
|
-
|
|
62
|
-
config_value: string | null
|
|
76
|
+
description: string | null
|
|
63
77
|
id: number
|
|
78
|
+
label: string
|
|
79
|
+
slug: string
|
|
64
80
|
}
|
|
65
81
|
Insert: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
82
|
+
description?: string | null
|
|
83
|
+
id?: never
|
|
84
|
+
label: string
|
|
85
|
+
slug: string
|
|
69
86
|
}
|
|
70
87
|
Update: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
description?: string | null
|
|
89
|
+
id?: never
|
|
90
|
+
label?: string
|
|
91
|
+
slug?: string
|
|
74
92
|
}
|
|
75
93
|
Relationships: []
|
|
76
94
|
}
|
|
77
|
-
|
|
95
|
+
product_media: {
|
|
78
96
|
Row: {
|
|
79
97
|
alt: string | null
|
|
80
98
|
created_at: string
|
|
81
99
|
id: number
|
|
82
|
-
name: string
|
|
100
|
+
name: string
|
|
83
101
|
product_id: number | null
|
|
84
102
|
}
|
|
85
103
|
Insert: {
|
|
86
104
|
alt?: string | null
|
|
87
105
|
created_at?: string
|
|
88
|
-
id?:
|
|
89
|
-
name
|
|
106
|
+
id?: never
|
|
107
|
+
name: string
|
|
90
108
|
product_id?: number | null
|
|
91
109
|
}
|
|
92
110
|
Update: {
|
|
93
111
|
alt?: string | null
|
|
94
112
|
created_at?: string
|
|
95
|
-
id?:
|
|
96
|
-
name?: string
|
|
113
|
+
id?: never
|
|
114
|
+
name?: string
|
|
97
115
|
product_id?: number | null
|
|
98
116
|
}
|
|
99
117
|
Relationships: [
|
|
100
118
|
{
|
|
101
|
-
foreignKeyName: "
|
|
119
|
+
foreignKeyName: "product_media_product_id_fkey"
|
|
102
120
|
columns: ["product_id"]
|
|
103
121
|
isOneToOne: false
|
|
104
122
|
referencedRelation: "products"
|
|
@@ -106,56 +124,6 @@ export type Database = {
|
|
|
106
124
|
},
|
|
107
125
|
]
|
|
108
126
|
}
|
|
109
|
-
posts: {
|
|
110
|
-
Row: {
|
|
111
|
-
author_id: string
|
|
112
|
-
content: string | null
|
|
113
|
-
created_at: string
|
|
114
|
-
deleted_at: string | null
|
|
115
|
-
excerpt: string | null
|
|
116
|
-
id: number
|
|
117
|
-
is_draft: boolean | null
|
|
118
|
-
published_at: string | null
|
|
119
|
-
slug: string
|
|
120
|
-
title: string | null
|
|
121
|
-
updated_at: string | null
|
|
122
|
-
}
|
|
123
|
-
Insert: {
|
|
124
|
-
author_id: string
|
|
125
|
-
content?: string | null
|
|
126
|
-
created_at?: string
|
|
127
|
-
deleted_at?: string | null
|
|
128
|
-
excerpt?: string | null
|
|
129
|
-
id?: number
|
|
130
|
-
is_draft?: boolean | null
|
|
131
|
-
published_at?: string | null
|
|
132
|
-
slug: string
|
|
133
|
-
title?: string | null
|
|
134
|
-
updated_at?: string | null
|
|
135
|
-
}
|
|
136
|
-
Update: {
|
|
137
|
-
author_id?: string
|
|
138
|
-
content?: string | null
|
|
139
|
-
created_at?: string
|
|
140
|
-
deleted_at?: string | null
|
|
141
|
-
excerpt?: string | null
|
|
142
|
-
id?: number
|
|
143
|
-
is_draft?: boolean | null
|
|
144
|
-
published_at?: string | null
|
|
145
|
-
slug?: string
|
|
146
|
-
title?: string | null
|
|
147
|
-
updated_at?: string | null
|
|
148
|
-
}
|
|
149
|
-
Relationships: [
|
|
150
|
-
{
|
|
151
|
-
foreignKeyName: "posts_author_id_fkey"
|
|
152
|
-
columns: ["author_id"]
|
|
153
|
-
isOneToOne: true
|
|
154
|
-
referencedRelation: "profiles"
|
|
155
|
-
referencedColumns: ["id"]
|
|
156
|
-
},
|
|
157
|
-
]
|
|
158
|
-
}
|
|
159
127
|
products: {
|
|
160
128
|
Row: {
|
|
161
129
|
availability: number | null
|
|
@@ -172,9 +140,9 @@ export type Database = {
|
|
|
172
140
|
Insert: {
|
|
173
141
|
availability?: number | null
|
|
174
142
|
category?: number | null
|
|
175
|
-
created_at
|
|
143
|
+
created_at?: string
|
|
176
144
|
description?: string | null
|
|
177
|
-
id?:
|
|
145
|
+
id?: never
|
|
178
146
|
is_custom?: boolean
|
|
179
147
|
name: string
|
|
180
148
|
price: number
|
|
@@ -186,7 +154,7 @@ export type Database = {
|
|
|
186
154
|
category?: number | null
|
|
187
155
|
created_at?: string
|
|
188
156
|
description?: string | null
|
|
189
|
-
id?:
|
|
157
|
+
id?: never
|
|
190
158
|
is_custom?: boolean
|
|
191
159
|
name?: string
|
|
192
160
|
price?: number
|
|
@@ -198,53 +166,59 @@ export type Database = {
|
|
|
198
166
|
foreignKeyName: "products_availability_fkey"
|
|
199
167
|
columns: ["availability"]
|
|
200
168
|
isOneToOne: false
|
|
201
|
-
referencedRelation: "
|
|
169
|
+
referencedRelation: "product_availability"
|
|
202
170
|
referencedColumns: ["id"]
|
|
203
171
|
},
|
|
204
172
|
{
|
|
205
173
|
foreignKeyName: "products_category_fkey"
|
|
206
174
|
columns: ["category"]
|
|
207
175
|
isOneToOne: false
|
|
208
|
-
referencedRelation: "
|
|
176
|
+
referencedRelation: "product_categories"
|
|
209
177
|
referencedColumns: ["id"]
|
|
210
178
|
},
|
|
211
179
|
]
|
|
212
180
|
}
|
|
213
181
|
profiles: {
|
|
214
182
|
Row: {
|
|
215
|
-
|
|
183
|
+
display_name: string | null
|
|
184
|
+
email: string | null
|
|
216
185
|
id: string
|
|
217
|
-
is_admin: boolean
|
|
218
|
-
|
|
186
|
+
is_admin: boolean
|
|
187
|
+
updated_at: string | null
|
|
188
|
+
username: string | null
|
|
219
189
|
}
|
|
220
190
|
Insert: {
|
|
221
|
-
|
|
191
|
+
display_name?: string | null
|
|
192
|
+
email?: string | null
|
|
222
193
|
id: string
|
|
223
|
-
is_admin?: boolean
|
|
224
|
-
|
|
194
|
+
is_admin?: boolean
|
|
195
|
+
updated_at?: string | null
|
|
196
|
+
username?: string | null
|
|
225
197
|
}
|
|
226
198
|
Update: {
|
|
227
|
-
|
|
199
|
+
display_name?: string | null
|
|
200
|
+
email?: string | null
|
|
228
201
|
id?: string
|
|
229
|
-
is_admin?: boolean
|
|
230
|
-
|
|
202
|
+
is_admin?: boolean
|
|
203
|
+
updated_at?: string | null
|
|
204
|
+
username?: string | null
|
|
231
205
|
}
|
|
232
206
|
Relationships: []
|
|
233
207
|
}
|
|
234
208
|
settings: {
|
|
235
209
|
Row: {
|
|
236
210
|
id: number
|
|
237
|
-
setting_name: Database["public"]["Enums"]["
|
|
211
|
+
setting_name: Database["public"]["Enums"]["tsettings"]
|
|
238
212
|
setting_value: string
|
|
239
213
|
}
|
|
240
214
|
Insert: {
|
|
241
215
|
id?: number
|
|
242
|
-
setting_name: Database["public"]["Enums"]["
|
|
216
|
+
setting_name: Database["public"]["Enums"]["tsettings"]
|
|
243
217
|
setting_value: string
|
|
244
218
|
}
|
|
245
219
|
Update: {
|
|
246
220
|
id?: number
|
|
247
|
-
setting_name?: Database["public"]["Enums"]["
|
|
221
|
+
setting_name?: Database["public"]["Enums"]["tsettings"]
|
|
248
222
|
setting_value?: string
|
|
249
223
|
}
|
|
250
224
|
Relationships: []
|
|
@@ -257,14 +231,8 @@ export type Database = {
|
|
|
257
231
|
[_ in never]: never
|
|
258
232
|
}
|
|
259
233
|
Enums: {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
Settings:
|
|
263
|
-
| "admin_email"
|
|
264
|
-
| "website_description"
|
|
265
|
-
| "website_title"
|
|
266
|
-
| "website_url"
|
|
267
|
-
| "users_can_register"
|
|
234
|
+
thealthcheck: "first_setup"
|
|
235
|
+
tsettings: "website_title" | "website_url" | "website_description"
|
|
268
236
|
}
|
|
269
237
|
CompositeTypes: {
|
|
270
238
|
[_ in never]: never
|
|
@@ -392,15 +360,8 @@ export type CompositeTypes<
|
|
|
392
360
|
export const Constants = {
|
|
393
361
|
public: {
|
|
394
362
|
Enums: {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
Settings: [
|
|
398
|
-
"admin_email",
|
|
399
|
-
"website_description",
|
|
400
|
-
"website_title",
|
|
401
|
-
"website_url",
|
|
402
|
-
"users_can_register",
|
|
403
|
-
],
|
|
363
|
+
thealthcheck: ["first_setup"],
|
|
364
|
+
tsettings: ["website_title", "website_url", "website_description"],
|
|
404
365
|
},
|
|
405
366
|
},
|
|
406
367
|
} as const
|