@classic-homes/auth 0.1.55 → 1.0.0
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/README.md +87 -1
- package/dist/auth.svelte-J62VV4TA.js +3 -0
- package/dist/{chunk-GRQL5FSH.js → chunk-2N2MDCWL.js} +130 -20
- package/dist/{chunk-RKSETJ4V.js → chunk-ILRNO4WH.js} +30 -7
- package/dist/{chunk-EM7PUNZB.js → chunk-O47YKG2F.js} +87 -2
- package/dist/{chunk-BK34CVH5.js → chunk-QBTMNWJH.js} +46 -42
- package/dist/{chunk-TUHQ4FHC.js → chunk-VVREZ25E.js} +8 -11
- package/dist/core/index.d.ts +147 -7
- package/dist/core/index.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/svelte/index.d.ts +43 -7
- package/dist/svelte/index.js +5 -5
- package/dist/testing/index.d.ts +7 -4
- package/dist/testing/index.js +14 -16
- package/dist/{types-BRxyphcX.d.ts → types-DXLdCdNC.d.ts} +54 -3
- package/dist/{user-utils-BSbNN3Hb.d.ts → user-utils-mQMLo7Il.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/auth.svelte-BBLX2MKB.js +0 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { authApi } from './chunk-
|
|
1
|
+
import { authApi } from './chunk-2N2MDCWL.js';
|
|
2
|
+
import { getUserRoles, hasAnyRole } from './chunk-O47YKG2F.js';
|
|
2
3
|
|
|
3
4
|
// src/core/guards.ts
|
|
4
5
|
function isMfaChallengeResponse(response) {
|
|
@@ -17,7 +18,7 @@ function getAvailableMethods(response) {
|
|
|
17
18
|
// src/core/errors.ts
|
|
18
19
|
var RoleDeniedError = class _RoleDeniedError extends Error {
|
|
19
20
|
constructor(user, requiredRoles, redirectTo) {
|
|
20
|
-
const userRoles = user.
|
|
21
|
+
const userRoles = getUserRoles(user).join(", ") || "none";
|
|
21
22
|
super(
|
|
22
23
|
`User "${user.username}" does not have required role(s). Has: [${userRoles}], Required: [${requiredRoles.join(", ")}]`
|
|
23
24
|
);
|
|
@@ -48,9 +49,7 @@ var AuthService = class {
|
|
|
48
49
|
async login(credentials, options) {
|
|
49
50
|
const response = await authApi.login(credentials);
|
|
50
51
|
if (options?.allowedRoles?.length && !isMfaChallengeResponse(response)) {
|
|
51
|
-
|
|
52
|
-
const hasAllowedRole = options.allowedRoles.some((r) => userRoles.includes(r));
|
|
53
|
-
if (!hasAllowedRole) {
|
|
52
|
+
if (!hasAnyRole(response.user, options.allowedRoles)) {
|
|
54
53
|
throw new RoleDeniedError(
|
|
55
54
|
response.user,
|
|
56
55
|
options.allowedRoles,
|
|
@@ -60,7 +59,7 @@ var AuthService = class {
|
|
|
60
59
|
}
|
|
61
60
|
if (options?.autoSetAuth !== false && !isMfaChallengeResponse(response)) {
|
|
62
61
|
try {
|
|
63
|
-
const { authStore } = await import('./auth.svelte-
|
|
62
|
+
const { authStore } = await import('./auth.svelte-J62VV4TA.js');
|
|
64
63
|
authStore.setAuth(
|
|
65
64
|
response.accessToken,
|
|
66
65
|
response.refreshToken,
|
|
@@ -234,9 +233,7 @@ var AuthService = class {
|
|
|
234
233
|
async verifyMFAChallenge(data, options) {
|
|
235
234
|
const response = await authApi.verifyMFAChallenge(data);
|
|
236
235
|
if (options?.allowedRoles?.length) {
|
|
237
|
-
|
|
238
|
-
const hasAllowedRole = options.allowedRoles.some((r) => userRoles.includes(r));
|
|
239
|
-
if (!hasAllowedRole) {
|
|
236
|
+
if (!hasAnyRole(response.user, options.allowedRoles)) {
|
|
240
237
|
throw new RoleDeniedError(
|
|
241
238
|
response.user,
|
|
242
239
|
options.allowedRoles,
|
|
@@ -246,7 +243,7 @@ var AuthService = class {
|
|
|
246
243
|
}
|
|
247
244
|
if (options?.autoSetAuth !== false) {
|
|
248
245
|
try {
|
|
249
|
-
const { authStore } = await import('./auth.svelte-
|
|
246
|
+
const { authStore } = await import('./auth.svelte-J62VV4TA.js');
|
|
250
247
|
authStore.setAuth(
|
|
251
248
|
response.accessToken,
|
|
252
249
|
response.refreshToken,
|
|
@@ -392,7 +389,7 @@ function getGreeting(user, includeTime = true) {
|
|
|
392
389
|
function formatUserRoles(user, options = {}) {
|
|
393
390
|
if (!user) return "";
|
|
394
391
|
const { max, separator = ", ", lowercase = false, capitalize = true } = options;
|
|
395
|
-
const roles =
|
|
392
|
+
const roles = getUserRoles(user);
|
|
396
393
|
if (roles.length === 0) return "";
|
|
397
394
|
const formatRole = (role) => {
|
|
398
395
|
if (lowercase) return role.toLowerCase();
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, C as ChangePasswordData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination } from '../types-
|
|
2
|
-
export { a as AuthConfig, b as AuthState, l as ResetPasswordData, S as SSOConfig, o as StorageAdapter,
|
|
3
|
-
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-
|
|
1
|
+
import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, C as ChangePasswordData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination, q as UserRolesResponse } from '../types-DXLdCdNC.js';
|
|
2
|
+
export { a as AuthConfig, b as AuthState, l as ResetPasswordData, S as SSOConfig, o as StorageAdapter, r as createMemoryStorage, s as createSessionStorage, t as getConfig, u as getDefaultStorage, v as getFetch, w as getStorage, x as initAuth, y as isInitialized, z as resetConfig } from '../types-DXLdCdNC.js';
|
|
3
|
+
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-mQMLo7Il.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* HTTP Client
|
|
@@ -47,9 +47,10 @@ declare function getSessionToken(): string | null;
|
|
|
47
47
|
* Update stored tokens.
|
|
48
48
|
* Also updates the Svelte auth store if available.
|
|
49
49
|
*
|
|
50
|
-
* Note: The read-modify-write on localStorage is not atomic across tabs
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* Note: The read-modify-write on localStorage is not atomic across tabs —
|
|
51
|
+
* concurrent refreshes in two tabs are last-write-wins. The `storage` event
|
|
52
|
+
* listener (set up via `initCrossTabSync`) propagates whichever write landed
|
|
53
|
+
* last, so tabs converge on the same tokens.
|
|
53
54
|
*/
|
|
54
55
|
declare function updateStoredTokens(accessToken: string, refreshToken: string): void;
|
|
55
56
|
/**
|
|
@@ -283,6 +284,38 @@ declare const authApi: {
|
|
|
283
284
|
events: SecurityEvent[];
|
|
284
285
|
pagination: Pagination;
|
|
285
286
|
}>;
|
|
287
|
+
/**
|
|
288
|
+
* List a user's roles.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* const { roles, primaryRole } = await authApi.getUserRoles(userId);
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
getUserRoles(userId: string, customFetch?: typeof fetch): Promise<UserRolesResponse>;
|
|
296
|
+
/**
|
|
297
|
+
* Grant a role to a user. Idempotent — granting a role they already hold
|
|
298
|
+
* succeeds and returns the unchanged set.
|
|
299
|
+
*
|
|
300
|
+
* @returns The user's full role set after the grant.
|
|
301
|
+
*/
|
|
302
|
+
grantUserRole(userId: string, role: string): Promise<UserRolesResponse>;
|
|
303
|
+
/**
|
|
304
|
+
* Revoke a role from a user.
|
|
305
|
+
*
|
|
306
|
+
* Rejected by the server if it would leave the user with no roles.
|
|
307
|
+
*
|
|
308
|
+
* @returns The user's full role set after the revoke.
|
|
309
|
+
*/
|
|
310
|
+
revokeUserRole(userId: string, role: string): Promise<UserRolesResponse>;
|
|
311
|
+
/**
|
|
312
|
+
* Replace a user's entire role set.
|
|
313
|
+
*
|
|
314
|
+
* Roles absent from `roles` are revoked, so read-modify-write against
|
|
315
|
+
* {@link getUserRoles} rather than passing a set built from stale state.
|
|
316
|
+
* Use {@link grantUserRole} / {@link revokeUserRole} for additive changes.
|
|
317
|
+
*/
|
|
318
|
+
setUserRoles(userId: string, roles: string[]): Promise<User>;
|
|
286
319
|
};
|
|
287
320
|
|
|
288
321
|
/**
|
|
@@ -412,4 +445,111 @@ declare function getTokenExpiration(token: string): Date | null;
|
|
|
412
445
|
*/
|
|
413
446
|
declare function extractClaims<T extends string>(token: string, claims: T[]): Pick<JWTPayload, T> | null;
|
|
414
447
|
|
|
415
|
-
|
|
448
|
+
/**
|
|
449
|
+
* Role Utilities
|
|
450
|
+
*
|
|
451
|
+
* A user holds a set of roles. Their effective permissions are the UNION of
|
|
452
|
+
* every role's permissions and their effective level is the MAX tier across
|
|
453
|
+
* them — the server computes both and bakes the result into the JWT.
|
|
454
|
+
*
|
|
455
|
+
* This module mirrors the role *taxonomy* from the API
|
|
456
|
+
* (`chapi/src/config/roles.ts`, `chapi/src/lib/users/roles.ts`). It deliberately
|
|
457
|
+
* does NOT mirror the permission definitions: `permissions` arrives pre-computed
|
|
458
|
+
* on the token, so duplicating the role→permission mapping here would only give
|
|
459
|
+
* it a second place to drift.
|
|
460
|
+
*
|
|
461
|
+
* SECURITY: everything here is for UI decisions only. Authorization is enforced
|
|
462
|
+
* server-side; a client-side role check is a hint, not a gate.
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Every role name, ordered from most to least privileged.
|
|
467
|
+
*
|
|
468
|
+
* Order is load-bearing: {@link computePrimaryRole} walks this list and takes
|
|
469
|
+
* the first match, which is what makes the result deterministic when several
|
|
470
|
+
* roles share a tier (e.g. `agent` + `builder`).
|
|
471
|
+
*
|
|
472
|
+
* Mirrors `ROLE_NAMES` in the API. `builder`/`customer_service`/`demo` are
|
|
473
|
+
* staff-tier clones of `agent`; `vendor`/`customer`/`subcontractor` are clones
|
|
474
|
+
* of `user`, row-scoped to their own homes.
|
|
475
|
+
*/
|
|
476
|
+
declare const ROLE_NAMES: readonly ["admin", "manager", "agent", "builder", "customer_service", "demo", "user", "vendor", "customer", "subcontractor", "guest"];
|
|
477
|
+
/**
|
|
478
|
+
* A known role name.
|
|
479
|
+
*
|
|
480
|
+
* Note that role-carrying values stay `string` at API boundaries — the server
|
|
481
|
+
* can add a role before this package ships a matching release, and an unknown
|
|
482
|
+
* role must degrade (contribute no permissions, level 0) rather than break
|
|
483
|
+
* decoding. This type is for authoring ergonomics, not runtime validation.
|
|
484
|
+
*/
|
|
485
|
+
type RoleName = (typeof ROLE_NAMES)[number];
|
|
486
|
+
/**
|
|
487
|
+
* Privilege level per role. Higher wins. Mirrors `ROLE_HIERARCHY` in the API.
|
|
488
|
+
*
|
|
489
|
+
* Used only to derive a display-facing primary role and effective level —
|
|
490
|
+
* never to imply one role from another. See {@link computePrimaryRole}.
|
|
491
|
+
*/
|
|
492
|
+
declare const ROLE_HIERARCHY: Record<string, number>;
|
|
493
|
+
/**
|
|
494
|
+
* Read a user's role set.
|
|
495
|
+
*
|
|
496
|
+
* The single place that normalizes roles off a user object, so callers never
|
|
497
|
+
* have to care whether the field is absent (e.g. a hand-built object, or a
|
|
498
|
+
* response shape that predates multi-role support).
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* ```typescript
|
|
502
|
+
* const roles = getUserRoles(user); // ['manager', 'agent']
|
|
503
|
+
* ```
|
|
504
|
+
*/
|
|
505
|
+
declare function getUserRoles(user: Pick<User, 'roles'> | null | undefined): string[];
|
|
506
|
+
/**
|
|
507
|
+
* The highest-tier role a user holds, for display.
|
|
508
|
+
*
|
|
509
|
+
* Resolved by {@link ROLE_NAMES} order rather than by comparing levels, so ties
|
|
510
|
+
* within a tier resolve deterministically and identically to the server.
|
|
511
|
+
* Returns `guest` when the set is empty or holds only unrecognized roles.
|
|
512
|
+
*
|
|
513
|
+
* This is a label, not a capability — a user's actual access is the union of
|
|
514
|
+
* all their roles, which is strictly broader than their primary role alone.
|
|
515
|
+
* Never gate on this; use {@link hasRole} or the store's role predicates.
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```typescript
|
|
519
|
+
* computePrimaryRole(['user', 'admin']); // 'admin'
|
|
520
|
+
* computePrimaryRole(['agent', 'builder']); // 'agent' — ROLE_NAMES order breaks the tie
|
|
521
|
+
* computePrimaryRole([]); // 'guest'
|
|
522
|
+
* ```
|
|
523
|
+
*/
|
|
524
|
+
declare function computePrimaryRole(roles: readonly string[]): RoleName;
|
|
525
|
+
/**
|
|
526
|
+
* Effective privilege level — the MAX across all roles held.
|
|
527
|
+
* Unrecognized roles contribute 0.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```typescript
|
|
531
|
+
* getEffectiveLevel(['user', 'manager']); // 3
|
|
532
|
+
* getEffectiveLevel([]); // 0
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
declare function getEffectiveLevel(roles: readonly string[]): number;
|
|
536
|
+
/**
|
|
537
|
+
* Whether a user holds a specific role.
|
|
538
|
+
*
|
|
539
|
+
* Exact membership — holding `admin` does NOT imply `agent`. This matches the
|
|
540
|
+
* API's `requireRole`, so the UI can't offer something the server will then
|
|
541
|
+
* reject with a 403.
|
|
542
|
+
*/
|
|
543
|
+
declare function hasRole(user: Pick<User, 'roles'> | null | undefined, role: string): boolean;
|
|
544
|
+
/**
|
|
545
|
+
* Whether a user holds at least one of the given roles.
|
|
546
|
+
* An empty `roles` list matches nothing.
|
|
547
|
+
*/
|
|
548
|
+
declare function hasAnyRole(user: Pick<User, 'roles'> | null | undefined, roles: readonly string[]): boolean;
|
|
549
|
+
/**
|
|
550
|
+
* Whether a user holds every one of the given roles.
|
|
551
|
+
* An empty `roles` list matches vacuously (nothing was required).
|
|
552
|
+
*/
|
|
553
|
+
declare function hasAllRoles(user: Pick<User, 'roles'> | null | undefined, roles: readonly string[]): boolean;
|
|
554
|
+
|
|
555
|
+
export { ApiKey, type ApiRequestOptions, type ApiResponse, ChangePasswordData, CreateApiKeyRequest, CreateApiKeyResponse, Device, type JWTPayload, LinkedAccount, LoginCredentials, LoginResponse, LogoutResponse, MFAChallengeData, MFASetupResponse, MFAStatus, Pagination, ProfileUpdateData, ROLE_HIERARCHY, ROLE_NAMES, RegisterData, RegisterResponse, type RoleName, SecurityEvent, Session, User, UserPreferences, UserRolesResponse, api, apiRequest, authApi, clearStoredAuth, computePrimaryRole, decodeJWT, extractClaims, extractData, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, updateStoredTokens };
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-
|
|
2
|
-
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-
|
|
3
|
-
export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from '../chunk-
|
|
1
|
+
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-VVREZ25E.js';
|
|
2
|
+
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-2N2MDCWL.js';
|
|
3
|
+
export { ROLE_HIERARCHY, ROLE_NAMES, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, extractClaims, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isInitialized, isTokenExpired, resetConfig } from '../chunk-O47YKG2F.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiKey, a as AuthConfig, b as AuthState, C as ChangePasswordData, c as CreateApiKeyRequest, d as CreateApiKeyResponse, D as Device, L as LinkedAccount, e as LoginCredentials, f as LoginResponse, g as LogoutResponse, M as MFAChallengeData, h as MFASetupResponse, i as MFAStatus, P as Pagination, j as ProfileUpdateData, R as RegisterData, k as RegisterResponse, l as ResetPasswordData, S as SSOConfig, m as SecurityEvent, n as Session, o as StorageAdapter, U as User, p as UserPreferences, q as
|
|
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
|
-
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from './user-utils-
|
|
1
|
+
export { A as ApiKey, a as AuthConfig, b as AuthState, C as ChangePasswordData, c as CreateApiKeyRequest, d as CreateApiKeyResponse, D as Device, L as LinkedAccount, e as LoginCredentials, f as LoginResponse, g as LogoutResponse, M as MFAChallengeData, h as MFASetupResponse, i as MFAStatus, P as Pagination, j as ProfileUpdateData, R as RegisterData, k as RegisterResponse, l as ResetPasswordData, S as SSOConfig, m as SecurityEvent, n as Session, o as StorageAdapter, U as User, p as UserPreferences, q as UserRolesResponse, r as createMemoryStorage, s as createSessionStorage, t as getConfig, u as getDefaultStorage, v as getFetch, w as getStorage, x as initAuth, y as isInitialized, z as resetConfig } from './types-DXLdCdNC.js';
|
|
2
|
+
export { ApiRequestOptions, ApiResponse, JWTPayload, ROLE_HIERARCHY, ROLE_NAMES, RoleName, api, apiRequest, authApi, clearStoredAuth, computePrimaryRole, decodeJWT, extractClaims, extractData, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, updateStoredTokens } from './core/index.js';
|
|
3
|
+
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from './user-utils-mQMLo7Il.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';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-
|
|
2
|
-
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-
|
|
4
|
-
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-
|
|
5
|
-
export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from './chunk-
|
|
1
|
+
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-ILRNO4WH.js';
|
|
2
|
+
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-VVREZ25E.js';
|
|
3
|
+
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-QBTMNWJH.js';
|
|
4
|
+
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-2N2MDCWL.js';
|
|
5
|
+
export { ROLE_HIERARCHY, ROLE_NAMES, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, extractClaims, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isInitialized, isTokenExpired, resetConfig } from './chunk-O47YKG2F.js';
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as AuthState, U as User, a as AuthConfig } from '../types-
|
|
2
|
-
export {
|
|
3
|
-
import { a as authService } from '../user-utils-
|
|
4
|
-
export { R as RoleDeniedError, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-
|
|
1
|
+
import { b as AuthState, U as User, a as AuthConfig } from '../types-DXLdCdNC.js';
|
|
2
|
+
export { x as initAuth, y as isInitialized } from '../types-DXLdCdNC.js';
|
|
3
|
+
import { a as authService } from '../user-utils-mQMLo7Il.js';
|
|
4
|
+
export { R as RoleDeniedError, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-mQMLo7Il.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Auth Store
|
|
@@ -69,15 +69,17 @@ declare class AuthStore {
|
|
|
69
69
|
*/
|
|
70
70
|
hasPermission(permission: string): boolean;
|
|
71
71
|
/**
|
|
72
|
-
* Check if user
|
|
72
|
+
* Check if the user holds a specific role.
|
|
73
|
+
*
|
|
74
|
+
* Exact membership — holding `admin` does not imply `agent`.
|
|
73
75
|
*/
|
|
74
76
|
hasRole(role: string): boolean;
|
|
75
77
|
/**
|
|
76
|
-
* Check if user
|
|
78
|
+
* Check if the user holds any of the specified roles.
|
|
77
79
|
*/
|
|
78
80
|
hasAnyRole(roles: string[]): boolean;
|
|
79
81
|
/**
|
|
80
|
-
* Check if user
|
|
82
|
+
* Check if the user holds all of the specified roles.
|
|
81
83
|
*/
|
|
82
84
|
hasAllRoles(roles: string[]): boolean;
|
|
83
85
|
/**
|
|
@@ -379,6 +381,13 @@ declare function createAuthClient(options: CreateAuthClientOptions): AuthClient;
|
|
|
379
381
|
interface RoleRestrictedItem {
|
|
380
382
|
/** Optional item identifier */
|
|
381
383
|
id?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Where this item navigates to, if anywhere.
|
|
386
|
+
*
|
|
387
|
+
* Only consulted when pruning empty parents: an item with an `href` survives
|
|
388
|
+
* losing all its children, since it remains a destination in its own right.
|
|
389
|
+
*/
|
|
390
|
+
href?: string;
|
|
382
391
|
/**
|
|
383
392
|
* Roles that can see this item.
|
|
384
393
|
* By default, user needs ANY of these roles (use requireAllRoles for ALL).
|
|
@@ -411,6 +420,27 @@ interface NavFilterOptions {
|
|
|
411
420
|
* If false (default), items without restrictions are visible to everyone.
|
|
412
421
|
*/
|
|
413
422
|
hideUnrestrictedForGuests?: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Property holding nested child items (e.g. 'children' for submenus).
|
|
425
|
+
*
|
|
426
|
+
* Set this for tree-shaped navigation. Without it, filtering is flat: a
|
|
427
|
+
* restricted child under an unrestricted parent stays visible, because
|
|
428
|
+
* nothing ever looks inside the parent.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* filterByAccess(navItems, user, { childrenKey: 'children' });
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
childrenKey?: string;
|
|
436
|
+
/**
|
|
437
|
+
* If true, a parent whose children are all filtered away is dropped too.
|
|
438
|
+
*
|
|
439
|
+
* Only applies to items that had children to begin with, and only when they
|
|
440
|
+
* are pure containers — an item with its own `href` stays, since it is still
|
|
441
|
+
* navigable on its own. Requires `childrenKey`. Default: true.
|
|
442
|
+
*/
|
|
443
|
+
pruneEmptyParents?: boolean;
|
|
414
444
|
}
|
|
415
445
|
/**
|
|
416
446
|
* Filter navigation items based on user roles and permissions.
|
|
@@ -431,6 +461,12 @@ interface NavFilterOptions {
|
|
|
431
461
|
* const filtered = filterByAccess(navItems, user);
|
|
432
462
|
* // Returns items the user can see based on their roles/permissions
|
|
433
463
|
* ```
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* // Tree-shaped navigation — without childrenKey, nested items are NOT filtered
|
|
468
|
+
* const filtered = filterByAccess(navItems, user, { childrenKey: 'children' });
|
|
469
|
+
* ```
|
|
434
470
|
*/
|
|
435
471
|
declare function filterByAccess<T extends RoleRestrictedItem>(items: T[], user: User | null, options?: NavFilterOptions): T[];
|
|
436
472
|
/**
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-
|
|
2
|
-
export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
export { initAuth, isInitialized } from '../chunk-
|
|
1
|
+
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-ILRNO4WH.js';
|
|
2
|
+
export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-VVREZ25E.js';
|
|
3
|
+
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-QBTMNWJH.js';
|
|
4
|
+
import '../chunk-2N2MDCWL.js';
|
|
5
|
+
export { initAuth, isInitialized } from '../chunk-O47YKG2F.js';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as User, D as Device, f as LoginResponse, m as SecurityEvent, n as Session, A as ApiKey, L as LinkedAccount, g as LogoutResponse, h as MFASetupResponse, i as MFAStatus, k as RegisterResponse, p as UserPreferences, o as StorageAdapter, b as AuthState, a as AuthConfig } from '../types-
|
|
1
|
+
import { U as User, D as Device, f as LoginResponse, m as SecurityEvent, n as Session, A as ApiKey, L as LinkedAccount, g as LogoutResponse, h as MFASetupResponse, i as MFAStatus, k as RegisterResponse, p as UserPreferences, o as StorageAdapter, b as AuthState, a as AuthConfig } from '../types-DXLdCdNC.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* User Fixtures
|
|
@@ -588,15 +588,18 @@ declare class MockAuthStore {
|
|
|
588
588
|
*/
|
|
589
589
|
hasPermission(permission: string): boolean;
|
|
590
590
|
/**
|
|
591
|
-
* Check if user
|
|
591
|
+
* Check if the user holds a specific role.
|
|
592
|
+
*
|
|
593
|
+
* Delegates to the same helpers as the real store — a mock that decides
|
|
594
|
+
* access differently from production is worse than no mock.
|
|
592
595
|
*/
|
|
593
596
|
hasRole(role: string): boolean;
|
|
594
597
|
/**
|
|
595
|
-
* Check if user
|
|
598
|
+
* Check if the user holds any of the specified roles.
|
|
596
599
|
*/
|
|
597
600
|
hasAnyRole(roles: string[]): boolean;
|
|
598
601
|
/**
|
|
599
|
-
* Check if user
|
|
602
|
+
* Check if the user holds all of the specified roles.
|
|
600
603
|
*/
|
|
601
604
|
hasAllRoles(roles: string[]): boolean;
|
|
602
605
|
/**
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { initAuth, resetConfig, isTokenExpired, decodeJWT } from '../chunk-
|
|
1
|
+
import { hasRole, hasAnyRole, hasAllRoles, initAuth, resetConfig, getUserRoles, isTokenExpired, decodeJWT } from '../chunk-O47YKG2F.js';
|
|
2
2
|
|
|
3
3
|
// src/testing/fixtures/users.ts
|
|
4
4
|
var mockUser = {
|
|
@@ -8,7 +8,6 @@ var mockUser = {
|
|
|
8
8
|
firstName: "Test",
|
|
9
9
|
lastName: "User",
|
|
10
10
|
phone: "+1234567890",
|
|
11
|
-
role: "user",
|
|
12
11
|
roles: ["user"],
|
|
13
12
|
permissions: ["read:profile", "write:profile"],
|
|
14
13
|
isActive: true,
|
|
@@ -24,7 +23,6 @@ var mockAdminUser = {
|
|
|
24
23
|
firstName: "Admin",
|
|
25
24
|
lastName: "User",
|
|
26
25
|
phone: "+1234567891",
|
|
27
|
-
role: "admin",
|
|
28
26
|
roles: ["admin", "user"],
|
|
29
27
|
permissions: [
|
|
30
28
|
"read:profile",
|
|
@@ -48,7 +46,6 @@ var mockSSOUser = {
|
|
|
48
46
|
email: "sso@example.com",
|
|
49
47
|
firstName: "SSO",
|
|
50
48
|
lastName: "User",
|
|
51
|
-
role: "user",
|
|
52
49
|
roles: ["user"],
|
|
53
50
|
permissions: ["read:profile", "write:profile"],
|
|
54
51
|
isActive: true,
|
|
@@ -64,7 +61,6 @@ var mockMFAUser = {
|
|
|
64
61
|
email: "mfa@example.com",
|
|
65
62
|
firstName: "MFA",
|
|
66
63
|
lastName: "User",
|
|
67
|
-
role: "user",
|
|
68
64
|
roles: ["user"],
|
|
69
65
|
permissions: ["read:profile", "write:profile"],
|
|
70
66
|
isActive: true,
|
|
@@ -79,7 +75,6 @@ var mockUnverifiedUser = {
|
|
|
79
75
|
email: "unverified@example.com",
|
|
80
76
|
firstName: "Unverified",
|
|
81
77
|
lastName: "User",
|
|
82
|
-
role: "user",
|
|
83
78
|
roles: ["user"],
|
|
84
79
|
permissions: [],
|
|
85
80
|
isActive: true,
|
|
@@ -93,7 +88,6 @@ var mockInactiveUser = {
|
|
|
93
88
|
email: "inactive@example.com",
|
|
94
89
|
firstName: "Inactive",
|
|
95
90
|
lastName: "User",
|
|
96
|
-
role: "user",
|
|
97
91
|
roles: ["user"],
|
|
98
92
|
permissions: [],
|
|
99
93
|
isActive: false,
|
|
@@ -110,7 +104,6 @@ function createMockUser(overrides = {}) {
|
|
|
110
104
|
}
|
|
111
105
|
function createMockUserWithRoles(roles, permissions, overrides = {}) {
|
|
112
106
|
return createMockUser({
|
|
113
|
-
role: roles[0] ?? "user",
|
|
114
107
|
roles,
|
|
115
108
|
permissions,
|
|
116
109
|
...overrides
|
|
@@ -1279,22 +1272,25 @@ var MockAuthStore = class {
|
|
|
1279
1272
|
return this.state.user?.permissions?.includes(permission) ?? false;
|
|
1280
1273
|
}
|
|
1281
1274
|
/**
|
|
1282
|
-
* Check if user
|
|
1275
|
+
* Check if the user holds a specific role.
|
|
1276
|
+
*
|
|
1277
|
+
* Delegates to the same helpers as the real store — a mock that decides
|
|
1278
|
+
* access differently from production is worse than no mock.
|
|
1283
1279
|
*/
|
|
1284
1280
|
hasRole(role) {
|
|
1285
|
-
return this.state.user
|
|
1281
|
+
return hasRole(this.state.user, role);
|
|
1286
1282
|
}
|
|
1287
1283
|
/**
|
|
1288
|
-
* Check if user
|
|
1284
|
+
* Check if the user holds any of the specified roles.
|
|
1289
1285
|
*/
|
|
1290
1286
|
hasAnyRole(roles) {
|
|
1291
|
-
return
|
|
1287
|
+
return hasAnyRole(this.state.user, roles);
|
|
1292
1288
|
}
|
|
1293
1289
|
/**
|
|
1294
|
-
* Check if user
|
|
1290
|
+
* Check if the user holds all of the specified roles.
|
|
1295
1291
|
*/
|
|
1296
1292
|
hasAllRoles(roles) {
|
|
1297
|
-
return
|
|
1293
|
+
return hasAllRoles(this.state.user, roles);
|
|
1298
1294
|
}
|
|
1299
1295
|
/**
|
|
1300
1296
|
* Check if user has any of the specified permissions.
|
|
@@ -1833,13 +1829,15 @@ function assertLacksPermissions(user, permissions, message) {
|
|
|
1833
1829
|
}
|
|
1834
1830
|
}
|
|
1835
1831
|
function assertHasRoles(user, roles, message) {
|
|
1836
|
-
const
|
|
1832
|
+
const held = getUserRoles(user);
|
|
1833
|
+
const missing = roles.filter((r) => !held.includes(r));
|
|
1837
1834
|
if (missing.length > 0) {
|
|
1838
1835
|
throw new Error(message ?? `User missing roles: ${missing.join(", ")}`);
|
|
1839
1836
|
}
|
|
1840
1837
|
}
|
|
1841
1838
|
function assertLacksRoles(user, roles, message) {
|
|
1842
|
-
const
|
|
1839
|
+
const held = getUserRoles(user);
|
|
1840
|
+
const present = roles.filter((r) => held.includes(r));
|
|
1843
1841
|
if (present.length > 0) {
|
|
1844
1842
|
throw new Error(message ?? `User should not have roles: ${present.join(", ")}`);
|
|
1845
1843
|
}
|
|
@@ -105,8 +105,29 @@ declare function resetConfig(): void;
|
|
|
105
105
|
/**
|
|
106
106
|
* Get the default storage adapter.
|
|
107
107
|
* Returns localStorage in browser, or a no-op adapter in SSR.
|
|
108
|
+
*
|
|
109
|
+
* SECURITY NOTE: localStorage persists tokens (including the long-lived
|
|
110
|
+
* refresh token) where any XSS on the page can read them. It is the default
|
|
111
|
+
* for cross-tab session continuity, but consider the safer alternatives:
|
|
112
|
+
* `createSessionStorage()` (per-tab, cleared on close),
|
|
113
|
+
* `createMemoryStorage()` (never persisted, lost on reload), or an
|
|
114
|
+
* httpOnly-cookie flow on your backend so tokens never reach JS at all.
|
|
115
|
+
* Pass the adapter via `initAuth({ storage: ... })`.
|
|
108
116
|
*/
|
|
109
117
|
declare function getDefaultStorage(): StorageAdapter;
|
|
118
|
+
/**
|
|
119
|
+
* Storage adapter backed by sessionStorage: tokens live per-tab and are
|
|
120
|
+
* cleared when the tab closes. Safer than localStorage against persistent
|
|
121
|
+
* token theft, at the cost of cross-tab session continuity.
|
|
122
|
+
* Falls back to no-op in SSR.
|
|
123
|
+
*/
|
|
124
|
+
declare function createSessionStorage(): StorageAdapter;
|
|
125
|
+
/**
|
|
126
|
+
* In-memory storage adapter: tokens are never persisted and are lost on
|
|
127
|
+
* page reload (the user re-authenticates or a silent SSO flow restores the
|
|
128
|
+
* session). The safest JS-side option against token exfiltration.
|
|
129
|
+
*/
|
|
130
|
+
declare function createMemoryStorage(): StorageAdapter;
|
|
110
131
|
/**
|
|
111
132
|
* Get the storage adapter from config or use default.
|
|
112
133
|
*/
|
|
@@ -128,8 +149,13 @@ interface User {
|
|
|
128
149
|
firstName?: string;
|
|
129
150
|
lastName?: string;
|
|
130
151
|
phone?: string;
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Every role the user holds. `permissions` is the union across all of them,
|
|
154
|
+
* so this is broader than any single role — see `computePrimaryRole` in
|
|
155
|
+
* `./roles.js` if you need one role to display.
|
|
156
|
+
*/
|
|
157
|
+
roles: string[];
|
|
158
|
+
/** Union of the permissions granted by every role in `roles`. */
|
|
133
159
|
permissions: string[];
|
|
134
160
|
isActive: boolean;
|
|
135
161
|
emailVerified: boolean;
|
|
@@ -138,6 +164,21 @@ interface User {
|
|
|
138
164
|
createdAt: string;
|
|
139
165
|
lastLoginAt?: string;
|
|
140
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* The result of reading or changing a user's roles.
|
|
169
|
+
*/
|
|
170
|
+
interface UserRolesResponse {
|
|
171
|
+
userId: string;
|
|
172
|
+
/** The user's full role set after the operation. */
|
|
173
|
+
roles: string[];
|
|
174
|
+
/**
|
|
175
|
+
* The highest-tier role in `roles`, as resolved by the server.
|
|
176
|
+
*
|
|
177
|
+
* A display label, not a capability — the user's actual access is the union
|
|
178
|
+
* of every role in `roles`, which is broader than this one alone.
|
|
179
|
+
*/
|
|
180
|
+
primaryRole: string;
|
|
181
|
+
}
|
|
141
182
|
interface AuthState {
|
|
142
183
|
accessToken: string | null;
|
|
143
184
|
refreshToken: string | null;
|
|
@@ -174,6 +215,12 @@ interface LogoutResponse {
|
|
|
174
215
|
message?: string;
|
|
175
216
|
ssoLogout?: boolean;
|
|
176
217
|
logoutUrl?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Set when the server-side logout call failed. `success` stays true so
|
|
220
|
+
* callers clear local state, but the server session may still be alive —
|
|
221
|
+
* check this to warn the user or retry revocation.
|
|
222
|
+
*/
|
|
223
|
+
serverError?: string;
|
|
177
224
|
}
|
|
178
225
|
interface RegisterResponse {
|
|
179
226
|
message: string;
|
|
@@ -200,6 +247,10 @@ interface ApiKey {
|
|
|
200
247
|
description?: string;
|
|
201
248
|
keyPreview: string;
|
|
202
249
|
permissions: string[];
|
|
250
|
+
/**
|
|
251
|
+
* The single role this key acts as. Unlike a user — who holds a set of roles
|
|
252
|
+
* whose permissions are unioned — an API key is scoped to at most one role.
|
|
253
|
+
*/
|
|
203
254
|
role: string | null;
|
|
204
255
|
isActive: boolean;
|
|
205
256
|
expiresAt: string | null;
|
|
@@ -320,4 +371,4 @@ interface ResetPasswordData {
|
|
|
320
371
|
newPassword: string;
|
|
321
372
|
}
|
|
322
373
|
|
|
323
|
-
export { type ApiKey as A, type ChangePasswordData as C, type Device as D, type LinkedAccount as L, type MFAChallengeData as M, type Pagination as P, type RegisterData as R, type SSOConfig as S, type User as U, type AuthConfig as a, type AuthState as b, type CreateApiKeyRequest as c, type CreateApiKeyResponse as d, type LoginCredentials as e, type LoginResponse as f, type LogoutResponse as g, type MFASetupResponse as h, type MFAStatus as i, type ProfileUpdateData as j, type RegisterResponse as k, type ResetPasswordData as l, type SecurityEvent as m, type Session as n, type StorageAdapter as o, type UserPreferences as p,
|
|
374
|
+
export { type ApiKey as A, type ChangePasswordData as C, type Device as D, type LinkedAccount as L, type MFAChallengeData as M, type Pagination as P, type RegisterData as R, type SSOConfig as S, type User as U, type AuthConfig as a, type AuthState as b, type CreateApiKeyRequest as c, type CreateApiKeyResponse as d, type LoginCredentials as e, type LoginResponse as f, type LogoutResponse as g, type MFASetupResponse as h, type MFAStatus as i, type ProfileUpdateData as j, type RegisterResponse as k, type ResetPasswordData as l, type SecurityEvent as m, type Session as n, type StorageAdapter as o, type UserPreferences as p, type UserRolesResponse as q, createMemoryStorage as r, createSessionStorage as s, getConfig as t, getDefaultStorage as u, getFetch as v, getStorage as w, initAuth as x, isInitialized as y, resetConfig as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination } from './types-
|
|
1
|
+
import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination } from './types-DXLdCdNC.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Auth Service
|
package/package.json
CHANGED