@plutocms/supabase 0.0.1-alpha.3 → 0.0.1-alpha.5
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.
|
@@ -2,7 +2,11 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
|
2
2
|
if (to.path !== '/admin/setup' && to.path.startsWith('/admin')) {
|
|
3
3
|
try {
|
|
4
4
|
const data = await $fetch('/api/settings/first_setup')
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
if (!data.success) {
|
|
7
|
+
return navigateTo('/admin/setup')
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
if (
|
|
7
11
|
data.is_first_setup === true &&
|
|
8
12
|
from.path.startsWith('/admin') &&
|
|
@@ -10,7 +14,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
|
10
14
|
) {
|
|
11
15
|
return navigateTo('/admin/setup')
|
|
12
16
|
}
|
|
13
|
-
|
|
17
|
+
|
|
14
18
|
if (
|
|
15
19
|
data.is_first_setup === false &&
|
|
16
20
|
from.path.startsWith('/admin') &&
|
|
@@ -18,7 +22,11 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
|
18
22
|
) {
|
|
19
23
|
return navigateTo('/')
|
|
20
24
|
}
|
|
21
|
-
} catch(error) {
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (import.meta.dev) {
|
|
27
|
+
console.error('Error checking first setup status:', error)
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
return navigateTo('/admin/setup')
|
|
23
31
|
}
|
|
24
32
|
}
|
package/bun.lock
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"name": "supabase",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@nuxtjs/supabase": "2.0.3",
|
|
9
|
-
"@plutocms/pluto": "^0.0.1-alpha.
|
|
9
|
+
"@plutocms/pluto": "^0.0.1-alpha.4",
|
|
10
10
|
"@plutocms/utils": "^0.0.1-alpha.5",
|
|
11
11
|
"postgres": "^3.4.8",
|
|
12
12
|
"supabase": "^2.76.15",
|
|
@@ -29,8 +29,10 @@
|
|
|
29
29
|
"trustedDependencies": [
|
|
30
30
|
"@parcel/watcher",
|
|
31
31
|
"esbuild",
|
|
32
|
-
"vue-demi",
|
|
33
32
|
"unrs-resolver",
|
|
33
|
+
"@plutocms/pluto",
|
|
34
|
+
"@plutocms/utils",
|
|
35
|
+
"vue-demi",
|
|
34
36
|
"supabase",
|
|
35
37
|
],
|
|
36
38
|
"packages": {
|
|
@@ -448,7 +450,7 @@
|
|
|
448
450
|
|
|
449
451
|
"@pkgr/core": ["@pkgr/core@0.2.9", "", {}, "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA=="],
|
|
450
452
|
|
|
451
|
-
"@plutocms/pluto": ["@plutocms/pluto@0.0.1-alpha.
|
|
453
|
+
"@plutocms/pluto": ["@plutocms/pluto@0.0.1-alpha.4", "", { "dependencies": { "@plutocms/utils": "^0.0.1-alpha.5", "@vueuse/nuxt": "^14.2.1" } }, "sha512-Z2PKZmgjOsTttIWTBFnO9Eb46FYphA1mSTdEbsSu7i5XEfSMbCeTGGiGf0Vr/BUJnzZj5zZ3xG+outVNVUEtMA=="],
|
|
452
454
|
|
|
453
455
|
"@plutocms/utils": ["@plutocms/utils@0.0.1-alpha.5", "", { "dependencies": { "@nuxt/eslint": "^1.15.2" } }, "sha512-CEWAFZxCUOFAnxzUzhjCn66Q9qQ17L7toHCOdDFbkVKzMC6BudMBbl6bx5c9jzxGtqQ4fRmy2WwDoeZcYYAqjQ=="],
|
|
454
456
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plutocms/supabase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.5",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "nuxt build",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@nuxtjs/supabase": "2.0.3",
|
|
19
|
-
"@plutocms/pluto": "^0.0.1-alpha.
|
|
19
|
+
"@plutocms/pluto": "^0.0.1-alpha.4",
|
|
20
20
|
"@plutocms/utils": "^0.0.1-alpha.5",
|
|
21
21
|
"postgres": "^3.4.8",
|
|
22
22
|
"supabase": "^2.76.15",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"trustedDependencies": [
|
|
38
38
|
"@parcel/watcher",
|
|
39
|
+
"@plutocms/pluto",
|
|
40
|
+
"@plutocms/utils",
|
|
39
41
|
"esbuild",
|
|
40
42
|
"supabase",
|
|
41
43
|
"unrs-resolver",
|
|
@@ -10,7 +10,7 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
|
|
11
11
|
if (error) {
|
|
12
12
|
return {
|
|
13
|
-
success: false,
|
|
13
|
+
success: false as const,
|
|
14
14
|
message: 'Error retrieving healthcheck settings',
|
|
15
15
|
error: error.message,
|
|
16
16
|
}
|
|
@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
|
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
|
-
success: true,
|
|
35
|
+
success: true as const,
|
|
36
36
|
message: 'Healthcheck settings retrieved successfully',
|
|
37
37
|
is_first_setup: isFirstSetup.first_setup === 'true',
|
|
38
38
|
}
|
|
@@ -30,9 +30,9 @@ export default defineEventHandler(async (event) => {
|
|
|
30
30
|
const sql = postgres(connectionString)
|
|
31
31
|
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
await sql.begin(async (sql) => {
|
|
34
34
|
await sql.unsafe(schema)
|
|
35
|
-
})
|
|
35
|
+
})
|
|
36
36
|
|
|
37
37
|
// Set the first_setup flag in the healthcheck table to false
|
|
38
38
|
await sql`
|