@plyaz/types 1.46.5 → 1.46.7

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.
@@ -1,18 +1,18 @@
1
1
  import type { AuthAdapterUser, AuthSession, Tokens } from "./adapter-interface";
2
2
  import type { AUTHPROVIDER } from "./enums";
3
3
  import type { AuthCredentials, AuthUser, ConnectedAccount, Session } from "./types";
4
- interface Permission {
4
+ export interface AuthPermission {
5
5
  resource: string;
6
6
  action: string;
7
7
  conditions: Record<string, string>;
8
8
  }
9
- export interface AuthPermissions extends AuthUser {
10
- permissions?: Permission[];
9
+ export interface AuthUserPermissions extends AuthUser {
10
+ permissions?: AuthPermission[];
11
11
  isActive: boolean;
12
12
  isVerified: boolean;
13
13
  }
14
14
  export interface UseAuthReturn {
15
- user: AuthPermissions | null;
15
+ user: AuthUserPermissions | null;
16
16
  isAuthenticated: boolean;
17
17
  isLoading: boolean;
18
18
  error: string | null;
@@ -35,10 +35,10 @@ export interface UseConnectedAccountsReturn {
35
35
  refreshAccounts: () => Promise<void>;
36
36
  }
37
37
  export interface UsePermissionsReturn {
38
- permissions: Permission[];
39
- hasPermission: (permission: Permission) => boolean;
40
- hasAnyPermission: (permissions: Permission[]) => boolean;
41
- hasAllPermissions: (permissions: Permission[]) => boolean;
38
+ permissions: AuthPermission[];
39
+ hasPermission: (permission: AuthPermission) => boolean;
40
+ hasAnyPermission: (permissions: AuthPermission[]) => boolean;
41
+ hasAllPermissions: (permissions: AuthPermission[]) => boolean;
42
42
  }
43
43
  export interface UseRBACReturn {
44
44
  hasRole: (role: string) => boolean;
@@ -54,4 +54,3 @@ export interface UseSessionRetrun {
54
54
  expiresAt: Date | null;
55
55
  refresh: () => Promise<void>;
56
56
  }
57
- export {};