abckit 0.0.10 → 0.0.12
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/dist/module.d.mts +16 -1
- package/dist/module.mjs +5 -5
- package/dist/runtime/components/app/AppBreadcrumbs.vue +1 -2
- package/dist/runtime/components/app/AppHeader.vue +2 -2
- package/dist/runtime/components/app/AppNavMain.d.vue.ts +1 -2
- package/dist/runtime/components/app/AppNavMain.vue +4 -4
- package/dist/runtime/components/app/AppNavMain.vue.d.ts +1 -2
- package/dist/runtime/components/ui/accordion/AccordionTrigger.vue +3 -2
- package/dist/runtime/components/ui/auto-form/AutoFormFieldArray.vue +3 -3
- package/dist/runtime/components/ui/auto-form/AutoFormFieldDate.vue +2 -2
- package/dist/runtime/components/ui/auto-form/AutoFormFieldFile.vue +2 -2
- package/dist/runtime/components/ui/breadcrumb/BreadcrumbEllipsis.vue +2 -2
- package/dist/runtime/components/ui/breadcrumb/BreadcrumbSeparator.vue +2 -2
- package/dist/runtime/components/ui/calendar/CalendarNextButton.vue +2 -2
- package/dist/runtime/components/ui/calendar/CalendarPrevButton.vue +2 -2
- package/dist/runtime/components/ui/carousel/CarouselNext.vue +2 -2
- package/dist/runtime/components/ui/carousel/CarouselPrevious.vue +2 -2
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +2 -2
- package/dist/runtime/components/ui/combobox/ComboboxInput.vue +2 -2
- package/dist/runtime/components/ui/command/CommandInput.vue +2 -2
- package/dist/runtime/components/ui/context-menu/ContextMenuCheckboxItem.vue +2 -2
- package/dist/runtime/components/ui/context-menu/ContextMenuRadioItem.vue +2 -2
- package/dist/runtime/components/ui/context-menu/ContextMenuSubTrigger.vue +2 -2
- package/dist/runtime/components/ui/dialog/DialogContent.vue +2 -2
- package/dist/runtime/components/ui/dialog/DialogScrollContent.vue +2 -2
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +2 -2
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +2 -2
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +2 -2
- package/dist/runtime/components/ui/file/FileEmptyState.vue +3 -3
- package/dist/runtime/components/ui/file/FileGrid.vue +10 -10
- package/dist/runtime/components/ui/file/FileTable.vue +16 -17
- package/dist/runtime/components/ui/input-otp/InputOTPSeparator.vue +2 -2
- package/dist/runtime/components/ui/menubar/MenubarCheckboxItem.vue +2 -2
- package/dist/runtime/components/ui/menubar/MenubarRadioItem.vue +2 -2
- package/dist/runtime/components/ui/menubar/MenubarSubTrigger.vue +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -2
- package/dist/runtime/components/ui/navigation-menu/NavigationMenuTrigger.vue +3 -2
- package/dist/runtime/components/ui/number-field/NumberFieldDecrement.vue +2 -2
- package/dist/runtime/components/ui/number-field/NumberFieldIncrement.vue +2 -2
- package/dist/runtime/components/ui/pagination/PaginationEllipsis.vue +2 -2
- package/dist/runtime/components/ui/pagination/PaginationFirst.vue +2 -2
- package/dist/runtime/components/ui/pagination/PaginationLast.vue +2 -2
- package/dist/runtime/components/ui/pagination/PaginationNext.vue +2 -2
- package/dist/runtime/components/ui/pagination/PaginationPrevious.vue +2 -2
- package/dist/runtime/components/ui/pin-input/PinInputSeparator.vue +2 -2
- package/dist/runtime/components/ui/radio-group/RadioGroupItem.vue +2 -2
- package/dist/runtime/components/ui/range-calendar/RangeCalendarNextButton.vue +2 -2
- package/dist/runtime/components/ui/range-calendar/RangeCalendarPrevButton.vue +2 -2
- package/dist/runtime/components/ui/resizable/ResizableHandle.vue +2 -2
- package/dist/runtime/components/ui/select/SelectItem.vue +2 -2
- package/dist/runtime/components/ui/select/SelectScrollDownButton.vue +2 -2
- package/dist/runtime/components/ui/select/SelectScrollUpButton.vue +2 -2
- package/dist/runtime/components/ui/select/SelectTrigger.vue +2 -2
- package/dist/runtime/components/ui/sheet/InnerSheetContent.vue +2 -2
- package/dist/runtime/components/ui/sheet/SheetContent.vue +2 -2
- package/dist/runtime/components/ui/sidebar/SidebarTrigger.vue +2 -2
- package/dist/runtime/components/ui/sonner/Sonner.vue +7 -7
- package/dist/runtime/components/ui/spinner/Spinner.vue +3 -2
- package/dist/runtime/components/ui/storage/StorageActionBar.vue +3 -4
- package/dist/runtime/components/ui/storage/StorageEmptyState.vue +3 -4
- package/dist/runtime/components/ui/storage/StorageGrid.vue +10 -11
- package/dist/runtime/components/ui/storage/StorageSelectionBar.vue +3 -3
- package/dist/runtime/components/ui/storage/StorageTable.vue +10 -11
- package/dist/runtime/components/ui/storage/StorageUploadZone.vue +5 -4
- package/dist/runtime/components/ui/tags-input/TagsInputItemDelete.vue +2 -2
- package/dist/runtime/composables/useAuth.d.ts +982 -1813
- package/dist/runtime/composables/useAuth.js +27 -9
- package/dist/runtime/shared/constants/r2.js +12 -6
- package/dist/runtime/types/nitro-graphql-client.d.ts +0 -1
- package/dist/types.d.mts +1 -1
- package/package.json +13 -14
|
@@ -2,11 +2,20 @@ import { navigateTo, useRuntimeConfig } from "#app";
|
|
|
2
2
|
import { adminClient } from "better-auth/client/plugins";
|
|
3
3
|
import { createAuthClient } from "better-auth/vue";
|
|
4
4
|
import { computed, watch } from "vue";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
let authClient = null;
|
|
6
|
+
function getAuthClient() {
|
|
7
|
+
if (authClient) return authClient;
|
|
8
|
+
const config = useRuntimeConfig();
|
|
9
|
+
const baseURL = config.public.abckit?.auth?.baseURL;
|
|
10
|
+
authClient = createAuthClient({
|
|
11
|
+
baseURL,
|
|
12
|
+
plugins: [adminClient()]
|
|
13
|
+
});
|
|
14
|
+
return authClient;
|
|
15
|
+
}
|
|
8
16
|
export function useAuth() {
|
|
9
|
-
const
|
|
17
|
+
const client = getAuthClient();
|
|
18
|
+
const session = client.useSession();
|
|
10
19
|
const config = useRuntimeConfig();
|
|
11
20
|
const isLoading = computed(() => session.value.isPending);
|
|
12
21
|
const isAuthenticated = computed(() => !!session.value.data?.user);
|
|
@@ -30,11 +39,11 @@ export function useAuth() {
|
|
|
30
39
|
navigateTo(`/auth/register${query}`);
|
|
31
40
|
}
|
|
32
41
|
async function logout() {
|
|
33
|
-
await
|
|
42
|
+
await client.signOut();
|
|
34
43
|
navigateTo("/");
|
|
35
44
|
}
|
|
36
45
|
async function refreshSession() {
|
|
37
|
-
const result = await
|
|
46
|
+
const result = await client.getSession({ fetchOptions: { cache: "no-store" } });
|
|
38
47
|
return result;
|
|
39
48
|
}
|
|
40
49
|
return {
|
|
@@ -46,8 +55,17 @@ export function useAuth() {
|
|
|
46
55
|
register,
|
|
47
56
|
logout,
|
|
48
57
|
refreshSession,
|
|
49
|
-
authClient
|
|
58
|
+
authClient: client
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function getAuthClientExports() {
|
|
62
|
+
const client = getAuthClient();
|
|
63
|
+
return {
|
|
64
|
+
signIn: client.signIn,
|
|
65
|
+
signUp: client.signUp,
|
|
66
|
+
signOut: client.signOut,
|
|
67
|
+
useSession: client.useSession,
|
|
68
|
+
getSession: client.getSession,
|
|
69
|
+
authClient: client
|
|
50
70
|
};
|
|
51
71
|
}
|
|
52
|
-
export const { signIn, signUp, signOut, useSession, getSession } = authClient;
|
|
53
|
-
export { authClient };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function bytesToSize(bytes) {
|
|
2
|
-
if (bytes === 0)
|
|
2
|
+
if (bytes === 0)
|
|
3
|
+
return "0 B";
|
|
3
4
|
const k = 1024;
|
|
4
5
|
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
5
6
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
@@ -9,10 +10,15 @@ export function getFileExtension(filename) {
|
|
|
9
10
|
return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
|
|
10
11
|
}
|
|
11
12
|
export function getMimeTypeCategory(mimeType) {
|
|
12
|
-
if (mimeType.startsWith("image/"))
|
|
13
|
-
|
|
14
|
-
if (mimeType.startsWith("
|
|
15
|
-
|
|
16
|
-
if (mimeType.
|
|
13
|
+
if (mimeType.startsWith("image/"))
|
|
14
|
+
return "image";
|
|
15
|
+
if (mimeType.startsWith("video/"))
|
|
16
|
+
return "video";
|
|
17
|
+
if (mimeType.startsWith("audio/"))
|
|
18
|
+
return "audio";
|
|
19
|
+
if (mimeType.includes("pdf") || mimeType.includes("document") || mimeType.includes("text/"))
|
|
20
|
+
return "document";
|
|
21
|
+
if (mimeType.includes("zip") || mimeType.includes("tar") || mimeType.includes("rar") || mimeType.includes("7z"))
|
|
22
|
+
return "archive";
|
|
17
23
|
return "other";
|
|
18
24
|
}
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abckit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"@nuxtjs/i18n": "^10.2.1",
|
|
63
63
|
"@nuxtjs/tailwindcss": "7.0.0-beta.1",
|
|
64
64
|
"@openfga/sdk": "^0.9.1",
|
|
65
|
-
"@pinia/colada": "^0.18.
|
|
65
|
+
"@pinia/colada": "^0.18.1",
|
|
66
66
|
"@pinia/colada-nuxt": "^0.2.4",
|
|
67
67
|
"@pinia/nuxt": "^0.11.3",
|
|
68
68
|
"@polar-sh/sdk": "^0.41.5",
|
|
69
|
-
"@sentry/nuxt": "^10.
|
|
69
|
+
"@sentry/nuxt": "^10.30.0",
|
|
70
70
|
"@sindresorhus/slugify": "^3.0.0",
|
|
71
71
|
"@tailwindcss/typography": "^0.5.19",
|
|
72
72
|
"@tanstack/vue-table": "^8.21.3",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@vueuse/router": "^14.1.0",
|
|
78
78
|
"apiful": "^4.0.0",
|
|
79
79
|
"aws4fetch": "^1.0.20",
|
|
80
|
-
"better-auth": "^1.4.
|
|
80
|
+
"better-auth": "^1.4.6",
|
|
81
81
|
"class-variance-authority": "^0.7.1",
|
|
82
82
|
"clsx": "^2.1.1",
|
|
83
83
|
"consola": "^3.4.2",
|
|
@@ -85,15 +85,14 @@
|
|
|
85
85
|
"date-fns": "^4.1.0",
|
|
86
86
|
"defu": "^6.1.4",
|
|
87
87
|
"drizzle-kit": "^0.31.8",
|
|
88
|
-
"drizzle-orm": "^0.45.
|
|
88
|
+
"drizzle-orm": "^0.45.1",
|
|
89
89
|
"drizzle-zod": "^0.8.3",
|
|
90
90
|
"embla-carousel-vue": "^8.6.0",
|
|
91
91
|
"graphql": "^16.12.0",
|
|
92
92
|
"graphql-config": "^5.1.5",
|
|
93
93
|
"graphql-scalars": "^1.25.0",
|
|
94
94
|
"graphql-yoga": "^5.17.1",
|
|
95
|
-
"
|
|
96
|
-
"md-editor-v3": "^6.2.0",
|
|
95
|
+
"md-editor-v3": "^6.2.1",
|
|
97
96
|
"nitro-graphql": "^1.6.1",
|
|
98
97
|
"nitropack": "^2.12.9",
|
|
99
98
|
"notivue": "^2.4.5",
|
|
@@ -101,7 +100,7 @@
|
|
|
101
100
|
"pinia": "^3.0.4",
|
|
102
101
|
"reka-ui": "^2.6.1",
|
|
103
102
|
"tailwind-merge": "^3.4.0",
|
|
104
|
-
"tailwindcss": "^4.1.
|
|
103
|
+
"tailwindcss": "^4.1.18",
|
|
105
104
|
"tw-animate-css": "^1.4.0",
|
|
106
105
|
"unstorage": "^1.17.3",
|
|
107
106
|
"uuid": "^13.0.0",
|
|
@@ -110,20 +109,20 @@
|
|
|
110
109
|
"vite-tsconfig-paths": "^5.1.4",
|
|
111
110
|
"vue": "^3.5.25",
|
|
112
111
|
"vue-input-otp": "^0.3.2",
|
|
113
|
-
"vue-router": "^4.6.
|
|
112
|
+
"vue-router": "^4.6.4",
|
|
114
113
|
"vue-sonner": "^2.0.9",
|
|
115
|
-
"vue-tsc": "^3.1.
|
|
114
|
+
"vue-tsc": "^3.1.8",
|
|
116
115
|
"zod": "^4.1.13"
|
|
117
116
|
},
|
|
118
117
|
"devDependencies": {
|
|
119
|
-
"@antfu/eslint-config": "^6.
|
|
118
|
+
"@antfu/eslint-config": "^6.6.1",
|
|
120
119
|
"@nuxt/eslint": "latest",
|
|
121
120
|
"@nuxt/module-builder": "^1.0.2",
|
|
122
|
-
"@types/node": "^24.10.
|
|
123
|
-
"@types/pg": "^8.
|
|
121
|
+
"@types/node": "^24.10.3",
|
|
122
|
+
"@types/pg": "^8.16.0",
|
|
124
123
|
"eslint": "^9.39.1",
|
|
125
124
|
"h3": "^1.15.4",
|
|
126
|
-
"nuxt": "^4.2.
|
|
125
|
+
"nuxt": "^4.2.2",
|
|
127
126
|
"typescript": "^5.9.3",
|
|
128
127
|
"vue": "^3.5.25"
|
|
129
128
|
},
|