@classic-homes/auth 0.1.50 → 0.1.52
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/index.d.ts +0 -1
- package/dist/svelte/index.d.ts +33 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { m as ApiKey, A as AuthConfig, f as AuthState, v as ChangePasswordData,
|
|
|
2
2
|
export { ApiRequestOptions, ApiResponse, JWTPayload, api, apiRequest, authApi, clearStoredAuth, decodeJWT, extractClaims, extractData, getAccessToken, getAvailableMethods, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, updateStoredTokens } from './core/index.js';
|
|
3
3
|
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, c as getAvatarFallback, g as getDisplayName, e as getGreeting, d as getUserEmail, b as getUserInitials, i as isRoleDeniedError } from './user-utils-Bi3-FHxY.js';
|
|
4
4
|
export { AuthClient, AuthGuardOptions, AuthGuardResult, AuthHookOptions, CreateAuthClientOptions, NavFilterOptions, RoleRestrictedItem, authActions, authStore, canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, currentUser, filterByAccess, filterNavSections, isAuthenticated, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './svelte/index.js';
|
|
5
|
-
import '@sveltejs/kit';
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { f as AuthState, U as User, A as AuthConfig } from '../types-CKcLRCI_.js
|
|
|
2
2
|
export { i as initAuth, a as isInitialized } from '../types-CKcLRCI_.js';
|
|
3
3
|
import { a as authService } from '../user-utils-Bi3-FHxY.js';
|
|
4
4
|
export { R as RoleDeniedError, f as formatUserRoles, c as getAvatarFallback, g as getDisplayName, e as getGreeting, d as getUserEmail, b as getUserInitials, i as isRoleDeniedError } from '../user-utils-Bi3-FHxY.js';
|
|
5
|
-
import { RequestEvent, Handle } from '@sveltejs/kit';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Auth Store
|
|
@@ -511,7 +510,39 @@ declare function createNavFilter(defaultOptions?: NavFilterOptions): <T extends
|
|
|
511
510
|
* Server-side authentication middleware for SvelteKit.
|
|
512
511
|
* Use this in hooks.server.ts to protect routes at the server level.
|
|
513
512
|
*/
|
|
514
|
-
|
|
513
|
+
/** Helper type for SvelteKit's MaybePromise */
|
|
514
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
515
|
+
/**
|
|
516
|
+
* Minimal RequestEvent interface compatible with SvelteKit.
|
|
517
|
+
* We define this inline to avoid requiring @sveltejs/kit as a dependency.
|
|
518
|
+
*/
|
|
519
|
+
interface RequestEvent {
|
|
520
|
+
url: URL;
|
|
521
|
+
cookies: {
|
|
522
|
+
get(name: string): string | undefined;
|
|
523
|
+
set(name: string, value: string, opts?: Record<string, unknown>): void;
|
|
524
|
+
delete(name: string, opts?: Record<string, unknown>): void;
|
|
525
|
+
};
|
|
526
|
+
request: Request;
|
|
527
|
+
locals: Record<string, unknown>;
|
|
528
|
+
}
|
|
529
|
+
/** SvelteKit resolve options */
|
|
530
|
+
interface ResolveOptions {
|
|
531
|
+
transformPageChunk?: (input: {
|
|
532
|
+
html: string;
|
|
533
|
+
done: boolean;
|
|
534
|
+
}) => MaybePromise<string | undefined>;
|
|
535
|
+
filterSerializedResponseHeaders?: (name: string, value: string) => boolean;
|
|
536
|
+
preload?: (input: {
|
|
537
|
+
type: string;
|
|
538
|
+
path: string;
|
|
539
|
+
}) => boolean;
|
|
540
|
+
}
|
|
541
|
+
/** SvelteKit Handle function type */
|
|
542
|
+
type Handle = (input: {
|
|
543
|
+
event: RequestEvent;
|
|
544
|
+
resolve: (event: RequestEvent, opts?: ResolveOptions) => MaybePromise<Response>;
|
|
545
|
+
}) => MaybePromise<Response>;
|
|
515
546
|
/**
|
|
516
547
|
* Options for the auth hook.
|
|
517
548
|
*/
|