@lenne.tech/nuxt-extensions 1.5.3 → 1.5.4
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.mjs +10 -19
- package/dist/runtime/components/transition/LtTransitionFade.vue +1 -3
- package/dist/runtime/components/transition/LtTransitionFadeScale.vue +1 -3
- package/dist/runtime/composables/auth/use-lt-auth.d.ts +1 -1
- package/dist/runtime/composables/auth/use-lt-auth.js +6 -20
- package/dist/runtime/composables/auth/use-system-setup.d.ts +1 -1
- package/dist/runtime/composables/index.d.ts +7 -7
- package/dist/runtime/composables/use-lt-auth-client.d.ts +1 -1
- package/dist/runtime/composables/use-lt-auth-client.js +1 -4
- package/dist/runtime/composables/use-lt-error-translation.d.ts +1 -1
- package/dist/runtime/composables/use-lt-error-translation.js +1 -4
- package/dist/runtime/composables/use-lt-file.d.ts +1 -1
- package/dist/runtime/composables/use-lt-share.js +1 -4
- package/dist/runtime/composables/use-lt-tus-upload.d.ts +1 -1
- package/dist/runtime/composables/use-lt-tus-upload.js +1 -3
- package/dist/runtime/lib/auth-client.d.ts +1 -1
- package/dist/runtime/lib/auth-client.js +4 -16
- package/dist/runtime/lib/auth-state.d.ts +1 -1
- package/dist/runtime/lib/auth-state.js +1 -3
- package/dist/runtime/lib/index.d.ts +2 -2
- package/dist/runtime/lib/index.js +1 -11
- package/dist/runtime/middleware/setup.d.ts +1 -1
- package/dist/runtime/plugins/auth-interceptor.client.d.ts +1 -1
- package/dist/runtime/plugins/auth-interceptor.client.js +1 -8
- package/dist/runtime/plugins/error-translation.client.d.ts +1 -1
- package/dist/runtime/testing/index.d.ts +1 -1
- package/dist/runtime/testing/playwright-helpers.d.ts +2 -2
- package/dist/runtime/types/auth.d.ts +2 -2
- package/dist/runtime/types/error.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +4 -4
- package/dist/runtime/types/module.d.ts +2 -2
- package/dist/runtime/types/upload.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +2 -2
- package/package.json +4 -2
package/dist/module.mjs
CHANGED
|
@@ -125,13 +125,7 @@ const module$1 = defineNuxtModule({
|
|
|
125
125
|
{ name: "createLtAuthFetch", from: resolve("./runtime/lib/auth-state") },
|
|
126
126
|
{ name: "ltAuthFetch", from: resolve("./runtime/lib/auth-state") }
|
|
127
127
|
]);
|
|
128
|
-
const transitionComponents = [
|
|
129
|
-
"LtTransitionFade",
|
|
130
|
-
"LtTransitionSlide",
|
|
131
|
-
"LtTransitionSlideBottom",
|
|
132
|
-
"LtTransitionSlideRevert",
|
|
133
|
-
"LtTransitionFadeScale"
|
|
134
|
-
];
|
|
128
|
+
const transitionComponents = ["LtTransitionFade", "LtTransitionSlide", "LtTransitionSlideBottom", "LtTransitionSlideRevert", "LtTransitionFadeScale"];
|
|
135
129
|
for (const componentName of transitionComponents) {
|
|
136
130
|
addComponent({
|
|
137
131
|
name: componentName,
|
|
@@ -152,18 +146,15 @@ const module$1 = defineNuxtModule({
|
|
|
152
146
|
addPlugin(resolve("./runtime/plugins/error-translation.client"));
|
|
153
147
|
}
|
|
154
148
|
if (resolvedOptions.i18n?.autoMerge) {
|
|
155
|
-
nuxt.hook(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
);
|
|
149
|
+
nuxt.hook("i18n:registerModule", (register) => {
|
|
150
|
+
register({
|
|
151
|
+
langDir: resolve("./runtime/locales"),
|
|
152
|
+
locales: [
|
|
153
|
+
{ code: "en", file: "en.json" },
|
|
154
|
+
{ code: "de", file: "de.json" }
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
});
|
|
167
158
|
}
|
|
168
159
|
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
169
160
|
nuxt.options.build.transpile.push("tus-js-client");
|
|
@@ -6,9 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<div
|
|
10
|
-
:style="`--start-duration: ${props.startDuration}ms; --leave-duration: ${props.leaveDuration}ms;`"
|
|
11
|
-
>
|
|
9
|
+
<div :style="`--start-duration: ${props.startDuration}ms; --leave-duration: ${props.leaveDuration}ms;`">
|
|
12
10
|
<Transition
|
|
13
11
|
enter-active-class="transition ease-out duration-[--start-duration]"
|
|
14
12
|
enter-from-class="transform opacity-0"
|
|
@@ -6,9 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<div
|
|
10
|
-
:style="`--start-duration: ${props.startDuration}ms; --leave-duration: ${props.leaveDuration}ms;`"
|
|
11
|
-
>
|
|
9
|
+
<div :style="`--start-duration: ${props.startDuration}ms; --leave-duration: ${props.leaveDuration}ms;`">
|
|
12
10
|
<Transition
|
|
13
11
|
enter-active-class="transition ease-out duration-[--start-duration]"
|
|
14
12
|
enter-from-class="transform opacity-0 scale-95"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - If session cookie works -> use cookies
|
|
10
10
|
* - If cookies fail (401) -> switch to JWT mode
|
|
11
11
|
*/
|
|
12
|
-
import type { UseLtAuthReturn } from
|
|
12
|
+
import type { UseLtAuthReturn } from '../../types/index.js';
|
|
13
13
|
/**
|
|
14
14
|
* Better Auth composable with Cookie/JWT dual-mode authentication
|
|
15
15
|
*
|
|
@@ -51,10 +51,7 @@ export function useLtAuth() {
|
|
|
51
51
|
const isAuthenticated = computed(() => !!user.value);
|
|
52
52
|
const isAdmin = computed(() => user.value?.role === "admin");
|
|
53
53
|
const is2FAEnabled = computed(() => user.value?.twoFactorEnabled ?? false);
|
|
54
|
-
const features = useState(
|
|
55
|
-
"lt-auth-features",
|
|
56
|
-
() => ({})
|
|
57
|
-
);
|
|
54
|
+
const features = useState("lt-auth-features", () => ({}));
|
|
58
55
|
const featuresFetched = useState("lt-auth-features-fetched", () => false);
|
|
59
56
|
function setUser(userData, mode = "cookie") {
|
|
60
57
|
const newState = { user: userData, authMode: mode };
|
|
@@ -74,13 +71,7 @@ export function useLtAuth() {
|
|
|
74
71
|
const secure = globalThis.location?.protocol === "https:" ? "; secure" : "";
|
|
75
72
|
document.cookie = `lt-auth-state=${encodeURIComponent(JSON.stringify(clearedState))}; path=/; max-age=${maxAge}; samesite=lax${secure}`;
|
|
76
73
|
document.cookie = `lt-jwt-token=; path=/; max-age=0`;
|
|
77
|
-
const sessionCookieNames = [
|
|
78
|
-
"better-auth.session_token",
|
|
79
|
-
"better-auth.session",
|
|
80
|
-
"__Secure-better-auth.session_token",
|
|
81
|
-
"session_token",
|
|
82
|
-
"session"
|
|
83
|
-
];
|
|
74
|
+
const sessionCookieNames = ["better-auth.session_token", "better-auth.session", "__Secure-better-auth.session_token", "session_token", "session"];
|
|
84
75
|
for (const name of sessionCookieNames) {
|
|
85
76
|
document.cookie = `${name}=; path=/; max-age=0`;
|
|
86
77
|
document.cookie = `${name}=; path=/api; max-age=0`;
|
|
@@ -180,9 +171,7 @@ export function useLtAuth() {
|
|
|
180
171
|
async function fetchFeatures() {
|
|
181
172
|
try {
|
|
182
173
|
const apiBase = getLtApiBase();
|
|
183
|
-
const result = await $fetch(
|
|
184
|
-
`${apiBase}/features`
|
|
185
|
-
);
|
|
174
|
+
const result = await $fetch(`${apiBase}/features`);
|
|
186
175
|
if (result) {
|
|
187
176
|
features.value = result;
|
|
188
177
|
featuresFetched.value = true;
|
|
@@ -258,12 +247,9 @@ export function useLtAuth() {
|
|
|
258
247
|
isLoading.value = true;
|
|
259
248
|
try {
|
|
260
249
|
const apiBase = getLtApiBase();
|
|
261
|
-
const optionsResponse = await fetchWithAuth(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
method: "GET"
|
|
265
|
-
}
|
|
266
|
-
);
|
|
250
|
+
const optionsResponse = await fetchWithAuth(`${apiBase}/passkey/generate-authenticate-options`, {
|
|
251
|
+
method: "GET"
|
|
252
|
+
});
|
|
267
253
|
if (!optionsResponse.ok) {
|
|
268
254
|
return {
|
|
269
255
|
success: false,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* URL handling is delegated to {@link buildLtApiUrl} (SSR / proxy / direct).
|
|
10
10
|
*/
|
|
11
|
-
import type { ComputedRef } from
|
|
11
|
+
import type { ComputedRef } from 'vue';
|
|
12
12
|
export interface UseSystemSetupReturn {
|
|
13
13
|
/** Whether the system needs initial setup (null = not checked yet) */
|
|
14
14
|
needsSetup: ComputedRef<boolean | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { useLtAuth } from
|
|
2
|
-
export { useSystemSetup } from
|
|
3
|
-
export { useLtAuthClient, ltAuthClient } from
|
|
4
|
-
export { useLtTusUpload } from
|
|
5
|
-
export { useLtFile } from
|
|
6
|
-
export { useLtShare, type UseLtShareReturn } from
|
|
7
|
-
export { useLtErrorTranslation } from
|
|
1
|
+
export { useLtAuth } from './auth/use-lt-auth.js';
|
|
2
|
+
export { useSystemSetup } from './auth/use-system-setup.js';
|
|
3
|
+
export { useLtAuthClient, ltAuthClient } from './use-lt-auth-client.js';
|
|
4
|
+
export { useLtTusUpload } from './use-lt-tus-upload.js';
|
|
5
|
+
export { useLtFile } from './use-lt-file.js';
|
|
6
|
+
export { useLtShare, type UseLtShareReturn } from './use-lt-share.js';
|
|
7
|
+
export { useLtErrorTranslation } from './use-lt-error-translation.js';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* await authClient.passkey.listUserPasskeys();
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
import { type LtAuthClient } from
|
|
19
|
+
import { type LtAuthClient } from '../lib/auth-client.js';
|
|
20
20
|
/**
|
|
21
21
|
* Reset the auth client singleton (useful for testing or config changes)
|
|
22
22
|
*/
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig } from "#imports";
|
|
2
|
-
import {
|
|
3
|
-
getOrCreateLtAuthClient,
|
|
4
|
-
resetLtAuthClientSingleton
|
|
5
|
-
} from "../lib/auth-client.js";
|
|
2
|
+
import { getOrCreateLtAuthClient, resetLtAuthClientSingleton } from "../lib/auth-client.js";
|
|
6
3
|
import { isLocalDevApiProxy } from "../lib/auth-state.js";
|
|
7
4
|
export function resetLtAuthClient() {
|
|
8
5
|
resetLtAuthClientSingleton();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* URL handling is delegated to {@link buildLtApiUrl} (SSR / proxy / direct).
|
|
11
11
|
*/
|
|
12
|
-
import type { UseLtErrorTranslationReturn } from
|
|
12
|
+
import type { UseLtErrorTranslationReturn } from '../types/error.js';
|
|
13
13
|
/**
|
|
14
14
|
* Error Translation composable
|
|
15
15
|
*
|
|
@@ -4,10 +4,7 @@ const ERROR_CODE_REGEX = /^#([A-Z_]+_\d+):\s*(.+)$/;
|
|
|
4
4
|
export function useLtErrorTranslation() {
|
|
5
5
|
const nuxtApp = useNuxtApp();
|
|
6
6
|
const runtimeConfig = useRuntimeConfig();
|
|
7
|
-
const translations = useState(
|
|
8
|
-
"lt-error-translations",
|
|
9
|
-
() => ({})
|
|
10
|
-
);
|
|
7
|
+
const translations = useState("lt-error-translations", () => ({}));
|
|
11
8
|
const isLoading = ref(false);
|
|
12
9
|
const config = runtimeConfig.public?.ltExtensions?.errorTranslation;
|
|
13
10
|
function t(key, germanFallback) {
|
|
@@ -32,10 +32,7 @@ export function useLtShare() {
|
|
|
32
32
|
const toast = useToast();
|
|
33
33
|
toast.add({
|
|
34
34
|
color: "success",
|
|
35
|
-
description: t(
|
|
36
|
-
"lt.share.copiedDescription",
|
|
37
|
-
"Der Link wurde in die Zwischenablage kopiert."
|
|
38
|
-
),
|
|
35
|
+
description: t("lt.share.copiedDescription", "Der Link wurde in die Zwischenablage kopiert."),
|
|
39
36
|
title: t("lt.share.copied", "Link kopiert")
|
|
40
37
|
});
|
|
41
38
|
} catch {
|
|
@@ -5,9 +5,7 @@ async function getTusModule() {
|
|
|
5
5
|
try {
|
|
6
6
|
tusModule = await import("tus-js-client");
|
|
7
7
|
} catch {
|
|
8
|
-
throw new Error(
|
|
9
|
-
"[useLtTusUpload] tus-js-client is not installed. Please install it: npm install tus-js-client"
|
|
10
|
-
);
|
|
8
|
+
throw new Error("[useLtTusUpload] tus-js-client is not installed. Please install it: npm install tus-js-client");
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
return tusModule;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SECURITY: Passwords are hashed with SHA256 client-side to prevent
|
|
8
8
|
* plain text password transmission over the network.
|
|
9
9
|
*/
|
|
10
|
-
import type { LtAuthClientConfig } from
|
|
10
|
+
import type { LtAuthClientConfig } from '../types/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* Register additional Better Auth plugins before auth client initialization.
|
|
13
13
|
*
|
|
@@ -95,14 +95,8 @@ export function createLtAuthClient(config = {}) {
|
|
|
95
95
|
*/
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
97
|
changePassword: async (params, options) => {
|
|
98
|
-
const [hashedCurrent, hashedNew] = await Promise.all([
|
|
99
|
-
|
|
100
|
-
ltSha256(params.newPassword)
|
|
101
|
-
]);
|
|
102
|
-
return baseClient.changePassword?.(
|
|
103
|
-
{ currentPassword: hashedCurrent, newPassword: hashedNew },
|
|
104
|
-
options
|
|
105
|
-
);
|
|
98
|
+
const [hashedCurrent, hashedNew] = await Promise.all([ltSha256(params.currentPassword), ltSha256(params.newPassword)]);
|
|
99
|
+
return baseClient.changePassword?.({ currentPassword: hashedCurrent, newPassword: hashedNew }, options);
|
|
106
100
|
},
|
|
107
101
|
/**
|
|
108
102
|
* Reset password with token (new password is hashed before sending)
|
|
@@ -110,10 +104,7 @@ export function createLtAuthClient(config = {}) {
|
|
|
110
104
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
105
|
resetPassword: async (params, options) => {
|
|
112
106
|
const hashedPassword = await ltSha256(params.newPassword);
|
|
113
|
-
return baseClient.resetPassword?.(
|
|
114
|
-
{ newPassword: hashedPassword, token: params.token },
|
|
115
|
-
options
|
|
116
|
-
);
|
|
107
|
+
return baseClient.resetPassword?.({ newPassword: hashedPassword, token: params.token }, options);
|
|
117
108
|
},
|
|
118
109
|
// Override signIn to hash password (keep passkey method from plugin)
|
|
119
110
|
signIn: {
|
|
@@ -173,10 +164,7 @@ export function createLtAuthClient(config = {}) {
|
|
|
173
164
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
165
|
generateBackupCodes: async (params, options) => {
|
|
175
166
|
const hashedPassword = await ltSha256(params.password);
|
|
176
|
-
return baseClient.twoFactor.generateBackupCodes(
|
|
177
|
-
{ password: hashedPassword },
|
|
178
|
-
options
|
|
179
|
-
);
|
|
167
|
+
return baseClient.twoFactor.generateBackupCodes({ password: hashedPassword }, options);
|
|
180
168
|
},
|
|
181
169
|
/**
|
|
182
170
|
* Verify TOTP code (pass through to base client)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The state is persisted in cookies for SSR compatibility.
|
|
13
13
|
*/
|
|
14
|
-
import type { LtAuthMode } from
|
|
14
|
+
import type { LtAuthMode } from '../types/index.js';
|
|
15
15
|
/**
|
|
16
16
|
* Determines if HTTP requests should use the Nuxt Vite dev proxy.
|
|
17
17
|
*
|
|
@@ -33,9 +33,7 @@ export function buildLtApiUrl(path) {
|
|
|
33
33
|
if (import.meta.server) {
|
|
34
34
|
const apiUrl2 = runtimeConfig.apiUrl || publicUrl || authBaseURL;
|
|
35
35
|
if (!apiUrl2) {
|
|
36
|
-
console.warn(
|
|
37
|
-
"[LtExtensions] No API URL configured. Set NUXT_API_URL or NUXT_PUBLIC_API_URL."
|
|
38
|
-
);
|
|
36
|
+
console.warn("[LtExtensions] No API URL configured. Set NUXT_API_URL or NUXT_PUBLIC_API_URL.");
|
|
39
37
|
}
|
|
40
38
|
return `${(apiUrl2 || "").replace(/\/+$/, "")}${path}`;
|
|
41
39
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { attemptLtJwtSwitch, createLtAuthFetch, getLtApiBase, getLtAuthMode, getLtJwtToken, isLtAuthenticated, ltAuthFetch, setLtAuthMode, setLtJwtToken
|
|
2
|
-
export { clearLtAuthPluginRegistry, createLtAuthClient, getOrCreateLtAuthClient, getLtAuthPluginRegistry, registerLtAuthPlugins, resetLtAuthClientSingleton, type LtAuthClient, } from
|
|
1
|
+
export { attemptLtJwtSwitch, createLtAuthFetch, getLtApiBase, getLtAuthMode, getLtJwtToken, isLtAuthenticated, ltAuthFetch, setLtAuthMode, setLtJwtToken } from './auth-state.js';
|
|
2
|
+
export { clearLtAuthPluginRegistry, createLtAuthClient, getOrCreateLtAuthClient, getLtAuthPluginRegistry, registerLtAuthPlugins, resetLtAuthClientSingleton, type LtAuthClient, } from './auth-client.js';
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
attemptLtJwtSwitch,
|
|
3
|
-
createLtAuthFetch,
|
|
4
|
-
getLtApiBase,
|
|
5
|
-
getLtAuthMode,
|
|
6
|
-
getLtJwtToken,
|
|
7
|
-
isLtAuthenticated,
|
|
8
|
-
ltAuthFetch,
|
|
9
|
-
setLtAuthMode,
|
|
10
|
-
setLtJwtToken
|
|
11
|
-
} from "./auth-state.js";
|
|
1
|
+
export { attemptLtJwtSwitch, createLtAuthFetch, getLtApiBase, getLtAuthMode, getLtJwtToken, isLtAuthenticated, ltAuthFetch, setLtAuthMode, setLtJwtToken } from "./auth-state.js";
|
|
12
2
|
export {
|
|
13
3
|
clearLtAuthPluginRegistry,
|
|
14
4
|
createLtAuthClient,
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* - needsSetup === true AND route != setupPath -> redirect to setupPath
|
|
9
9
|
* - needsSetup === false AND route === setupPath -> redirect to loginPath
|
|
10
10
|
*/
|
|
11
|
-
import type { RouteMiddleware } from
|
|
11
|
+
import type { RouteMiddleware } from '#app';
|
|
12
12
|
declare const _default: RouteMiddleware;
|
|
13
13
|
export default _default;
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* Note: This is a client-only plugin (.client.ts) since auth state
|
|
10
10
|
* management only makes sense in the browser context.
|
|
11
11
|
*/
|
|
12
|
-
import type { NuxtApp } from
|
|
12
|
+
import type { NuxtApp } from '#app';
|
|
13
13
|
declare const _default: (nuxtApp: NuxtApp) => void;
|
|
14
14
|
export default _default;
|
|
@@ -12,14 +12,7 @@ export default (nuxtApp) => {
|
|
|
12
12
|
const loginPath = runtimeConfig.loginPath || "/auth/login";
|
|
13
13
|
const configuredPublicPaths = runtimeConfig.interceptor?.publicPaths || [];
|
|
14
14
|
let isHandling401 = false;
|
|
15
|
-
const defaultPublicPaths = [
|
|
16
|
-
"/auth/login",
|
|
17
|
-
"/auth/register",
|
|
18
|
-
"/auth/forgot-password",
|
|
19
|
-
"/auth/reset-password",
|
|
20
|
-
"/auth/2fa",
|
|
21
|
-
"/auth/setup"
|
|
22
|
-
];
|
|
15
|
+
const defaultPublicPaths = ["/auth/login", "/auth/register", "/auth/forgot-password", "/auth/reset-password", "/auth/2fa", "/auth/setup"];
|
|
23
16
|
const publicAuthPaths = [.../* @__PURE__ */ new Set([...defaultPublicPaths, ...configuredPublicPaths])];
|
|
24
17
|
function isPublicAuthRoute() {
|
|
25
18
|
const router = nuxtApp.$router;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Automatically loads error translations on app start.
|
|
5
5
|
* Provides global helper methods: $ltTranslateError, $ltShowErrorToast
|
|
6
6
|
*/
|
|
7
|
-
import type { ObjectPlugin, Plugin } from
|
|
7
|
+
import type { ObjectPlugin, Plugin } from '#app';
|
|
8
8
|
declare const _default: Plugin & ObjectPlugin;
|
|
9
9
|
export default _default;
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
|
-
export { waitForHydration, gotoAndWaitForHydration, waitForURLAndHydration, DEFAULT_HYDRATION_TIMEOUT, fillInput, fillInputs, generateTestUser, generateRandomString, generateTOTP, extractTOTPSecret, parseTOTPUrl, waitForElement, waitForNetworkIdle, hasText, getAllText, type TestUser, } from
|
|
21
|
+
export { waitForHydration, gotoAndWaitForHydration, waitForURLAndHydration, DEFAULT_HYDRATION_TIMEOUT, fillInput, fillInputs, generateTestUser, generateRandomString, generateTOTP, extractTOTPSecret, parseTOTPUrl, waitForElement, waitForNetworkIdle, hasText, getAllText, type TestUser, } from './playwright-helpers.js';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* });
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
import type { Page } from
|
|
23
|
+
import type { Page } from '@playwright/test';
|
|
24
24
|
/**
|
|
25
25
|
* Default timeout for hydration waiting (in milliseconds)
|
|
26
26
|
*/
|
|
@@ -191,7 +191,7 @@ export declare function generateRandomString(length?: number, charset?: string):
|
|
|
191
191
|
export declare function generateTOTP(secret: string, options?: {
|
|
192
192
|
digits?: number;
|
|
193
193
|
period?: number;
|
|
194
|
-
algorithm?:
|
|
194
|
+
algorithm?: 'sha1' | 'sha256' | 'sha512';
|
|
195
195
|
}): string;
|
|
196
196
|
/**
|
|
197
197
|
* Extract TOTP secret from otpauth:// URL
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComputedRef, Ref } from
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* User type for Better Auth session
|
|
4
4
|
* Compatible with @lenne.tech/nest-server IAM module
|
|
@@ -20,7 +20,7 @@ export interface LtUser {
|
|
|
20
20
|
* - 'cookie': Primary mode using HttpOnly session cookies (more secure)
|
|
21
21
|
* - 'jwt': Fallback mode using JWT tokens in Authorization header
|
|
22
22
|
*/
|
|
23
|
-
export type LtAuthMode =
|
|
23
|
+
export type LtAuthMode = 'cookie' | 'jwt';
|
|
24
24
|
/**
|
|
25
25
|
* Stored auth state (persisted in cookie for SSR compatibility)
|
|
26
26
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { LtAuthClientConfig, LtAuthMode, LtAuthResponse, LtAuthState, LtPasskeyAuthResult, LtPasskeyRegisterResult, LtUser, UseLtAuthReturn
|
|
2
|
-
export type { LtFileInfo, LtUploadItem, LtUploadOptions, LtUploadProgress, LtUploadStatus, UseLtFileReturn, UseLtTusUploadReturn
|
|
3
|
-
export type { LtAuthModuleOptions, LtErrorTranslationModuleOptions, LtExtensionsModuleOptions, LtExtensionsPublicRuntimeConfig, LtI18nModuleOptions, LtSystemSetupModuleOptions, LtTusModuleOptions, } from
|
|
4
|
-
export type { LtErrorTranslationResponse, LtParsedError, UseLtErrorTranslationReturn
|
|
1
|
+
export type { LtAuthClientConfig, LtAuthMode, LtAuthResponse, LtAuthState, LtPasskeyAuthResult, LtPasskeyRegisterResult, LtUser, UseLtAuthReturn } from './auth.js';
|
|
2
|
+
export type { LtFileInfo, LtUploadItem, LtUploadOptions, LtUploadProgress, LtUploadStatus, UseLtFileReturn, UseLtTusUploadReturn } from './upload.js';
|
|
3
|
+
export type { LtAuthModuleOptions, LtErrorTranslationModuleOptions, LtExtensionsModuleOptions, LtExtensionsPublicRuntimeConfig, LtI18nModuleOptions, LtSystemSetupModuleOptions, LtTusModuleOptions, } from './module.js';
|
|
4
|
+
export type { LtErrorTranslationResponse, LtParsedError, UseLtErrorTranslationReturn } from './error.js';
|
|
@@ -122,11 +122,11 @@ export interface LtExtensionsPublicRuntimeConfig {
|
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
declare module
|
|
125
|
+
declare module 'nuxt/schema' {
|
|
126
126
|
interface PublicRuntimeConfig extends LtExtensionsPublicRuntimeConfig {
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
declare module
|
|
129
|
+
declare module '@nuxt/schema' {
|
|
130
130
|
interface PublicRuntimeConfig extends LtExtensionsPublicRuntimeConfig {
|
|
131
131
|
}
|
|
132
132
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ComputedRef } from
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* Status of an upload item
|
|
4
4
|
*/
|
|
5
|
-
export type LtUploadStatus =
|
|
5
|
+
export type LtUploadStatus = 'completed' | 'error' | 'idle' | 'paused' | 'uploading';
|
|
6
6
|
/**
|
|
7
7
|
* Progress information for an upload
|
|
8
8
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ltArrayBufferToBase64Url, ltBase64UrlToUint8Array, ltSha256 } from
|
|
2
|
-
export { tw } from
|
|
1
|
+
export { ltArrayBufferToBase64Url, ltBase64UrlToUint8Array, ltSha256 } from './crypto.js';
|
|
2
|
+
export { tw } from './tw.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nuxt-extensions",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Reusable Nuxt 4 composables, components, and Better-Auth integration for lenne.tech projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"prepare": "git config core.hooksPath .githooks",
|
|
51
51
|
"prepack": "node scripts/sync-module-version.mjs && nuxt-module-build build",
|
|
52
52
|
"c": "pnpm run check",
|
|
53
|
-
"check": "pnpm audit && pnpm run format:check && pnpm run lint && pnpm test:types && pnpm test && pnpm run build",
|
|
53
|
+
"check": "pnpm audit && pnpm run format:check && pnpm run lint && pnpm run dev:prepare && pnpm test:types && pnpm test && pnpm run build",
|
|
54
54
|
"check:fix": "pnpm install && pnpm audit --fix && pnpm run format && pnpm run lint:fix && pnpm test:types && pnpm test && pnpm run build",
|
|
55
55
|
"check:naf": "pnpm install && pnpm run format && pnpm run lint:fix && pnpm test:types && pnpm test && pnpm run build",
|
|
56
56
|
"cf": "pnpm run check:fix",
|
|
@@ -133,6 +133,8 @@
|
|
|
133
133
|
"srvx@<0.11.13": ">=0.11.13",
|
|
134
134
|
"svgo@=4.0.0": ">=4.0.1",
|
|
135
135
|
"tar@<7.5.11": "7.5.11",
|
|
136
|
+
"unhead@<2.1.13": ">=2.1.13",
|
|
137
|
+
"vite@<7.3.2": ">=7.3.2",
|
|
136
138
|
"yaml@>=2.0.0 <2.8.3": ">=2.8.3"
|
|
137
139
|
}
|
|
138
140
|
},
|