vona-module-a-user 5.0.35 → 5.0.37
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/bean/bean.passport.d.ts +4 -4
- package/dist/service/authTokenAdapter.d.ts +6 -6
- package/dist/service/redisToken.d.ts +6 -6
- package/dist/types/auth.d.ts +3 -3
- package/dist/types/authProfile.d.ts +2 -2
- package/dist/types/authToken.d.ts +6 -6
- package/dist/types/passport.d.ts +5 -5
- package/dist/types/user.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IJwtClientRecord, IJwtSignOptions, IJwtToken, IJwtVerifyOptions,
|
|
2
|
-
import type {
|
|
1
|
+
import type { IJwtClientRecord, IJwtSignOptions, IJwtToken, IJwtVerifyOptions, IPayloadData } from 'vona-module-a-jwt';
|
|
2
|
+
import type { IAuth, IAuthIdRecord, ISigninOptions } from '../types/auth.ts';
|
|
3
3
|
import type { IPassport } from '../types/passport.ts';
|
|
4
4
|
import type { IRole } from '../types/role.ts';
|
|
5
5
|
import type { IUser, IUserNameRecord } from '../types/user.ts';
|
|
@@ -16,7 +16,7 @@ export declare class BeanPassport extends BeanBase {
|
|
|
16
16
|
setCurrent(passport: IPassport | undefined): Promise<void>;
|
|
17
17
|
getCurrent(): IPassport | undefined;
|
|
18
18
|
getCurrentUser(): IUser | undefined;
|
|
19
|
-
getCurrentAuth():
|
|
19
|
+
getCurrentAuth(): IAuth | undefined;
|
|
20
20
|
getCurrentRoles(): IRole[] | undefined;
|
|
21
21
|
signin(passport: IPassport, options?: ISigninOptions): Promise<IJwtToken>;
|
|
22
22
|
signout(): Promise<void>;
|
|
@@ -24,7 +24,7 @@ export declare class BeanPassport extends BeanBase {
|
|
|
24
24
|
signinMock(name?: keyof IUserNameRecord, options?: ISigninOptions): Promise<IJwtToken>;
|
|
25
25
|
signinWithAnonymous(): Promise<void>;
|
|
26
26
|
kickOut(user?: IUser): Promise<void>;
|
|
27
|
-
checkAuthToken(accessToken?: string, clientName?: keyof IJwtClientRecord, options?: IJwtVerifyOptions): Promise<
|
|
27
|
+
checkAuthToken(accessToken?: string, clientName?: keyof IJwtClientRecord, options?: IJwtVerifyOptions): Promise<IPayloadData | undefined>;
|
|
28
28
|
refreshAuthToken(refreshToken: string): Promise<IJwtToken>;
|
|
29
29
|
createTempAuthToken(options?: IJwtSignOptions): Promise<string>;
|
|
30
30
|
createOauthAuthToken(options?: IJwtSignOptions): Promise<string>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IPayloadData } from 'vona-module-a-jwt';
|
|
2
2
|
import type { IAuthTokenAdapter } from '../types/authToken.ts';
|
|
3
3
|
import type { IUser } from '../types/user.ts';
|
|
4
4
|
import { BeanBase } from 'vona';
|
|
5
5
|
export declare class ServiceAuthTokenAdapter extends BeanBase implements IAuthTokenAdapter {
|
|
6
|
-
create(payloadData:
|
|
7
|
-
retrieve(payloadData:
|
|
8
|
-
verify(payloadData:
|
|
9
|
-
refresh(payloadData:
|
|
10
|
-
remove(payloadData:
|
|
6
|
+
create(payloadData: IPayloadData): Promise<IPayloadData>;
|
|
7
|
+
retrieve(payloadData: IPayloadData): Promise<IPayloadData | undefined>;
|
|
8
|
+
verify(payloadData: IPayloadData): Promise<boolean>;
|
|
9
|
+
refresh(payloadData: IPayloadData): Promise<void>;
|
|
10
|
+
remove(payloadData: IPayloadData): Promise<void>;
|
|
11
11
|
removeAll(user: IUser): Promise<void>;
|
|
12
12
|
private _getAuthId;
|
|
13
13
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IPayloadData } from 'vona-module-a-jwt';
|
|
2
2
|
import type { IUser } from 'vona-module-a-user';
|
|
3
3
|
import { BeanBase } from 'vona';
|
|
4
4
|
export declare class ServiceRedisToken extends BeanBase {
|
|
5
|
-
verify(payloadData:
|
|
6
|
-
retrieve(payloadData:
|
|
7
|
-
create(payloadData:
|
|
8
|
-
refresh(payloadData:
|
|
9
|
-
remove(payloadData:
|
|
5
|
+
verify(payloadData: IPayloadData): Promise<boolean>;
|
|
6
|
+
retrieve(payloadData: IPayloadData): Promise<IPayloadData | undefined>;
|
|
7
|
+
create(payloadData: IPayloadData): Promise<undefined>;
|
|
8
|
+
refresh(payloadData: IPayloadData): Promise<undefined>;
|
|
9
|
+
remove(payloadData: IPayloadData): Promise<void>;
|
|
10
10
|
removeAll(user: IUser): Promise<void>;
|
|
11
11
|
private _getAuthRedisKey;
|
|
12
12
|
private _getAuthRedisKeyPrefix;
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ export interface IAuthIdRecord {
|
|
|
4
4
|
'-1': 'dev';
|
|
5
5
|
'-10000': 'mock';
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface IAuthProvider {
|
|
8
8
|
id: TableIdentity;
|
|
9
9
|
providerName: keyof IAuthProviderRecord;
|
|
10
10
|
clientName: string;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface IAuth {
|
|
13
13
|
id: TableIdentity;
|
|
14
14
|
profileId?: string;
|
|
15
|
-
authProvider?:
|
|
15
|
+
authProvider?: IAuthProvider;
|
|
16
16
|
}
|
|
17
17
|
export type TypeAuthToken = 'recreate' | 'refresh' | 'nochange';
|
|
18
18
|
export interface ISigninOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILocaleRecord } from 'vona';
|
|
2
2
|
export interface IAuthUserProfilePropSlice {
|
|
3
3
|
value: string;
|
|
4
4
|
}
|
|
@@ -16,6 +16,6 @@ export interface IAuthUserProfile {
|
|
|
16
16
|
profileUrl?: string;
|
|
17
17
|
emails?: IAuthUserProfilePropSlice[];
|
|
18
18
|
photos?: IAuthUserProfilePropSlice[];
|
|
19
|
-
locale?: keyof
|
|
19
|
+
locale?: keyof ILocaleRecord;
|
|
20
20
|
confirmed?: boolean;
|
|
21
21
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IPayloadData } from 'vona-module-a-jwt';
|
|
2
2
|
import type { IUser } from './user.ts';
|
|
3
3
|
export interface IAuthTokenAdapter {
|
|
4
|
-
create(payloadData:
|
|
5
|
-
retrieve(payloadData:
|
|
6
|
-
verify(payloadData:
|
|
7
|
-
refresh(payloadData:
|
|
8
|
-
remove(payloadData:
|
|
4
|
+
create(payloadData: IPayloadData): Promise<IPayloadData>;
|
|
5
|
+
retrieve(payloadData: IPayloadData): Promise<IPayloadData | undefined>;
|
|
6
|
+
verify(payloadData: IPayloadData): Promise<boolean>;
|
|
7
|
+
refresh(payloadData: IPayloadData): Promise<void>;
|
|
8
|
+
remove(payloadData: IPayloadData): Promise<void>;
|
|
9
9
|
removeAll(user: IUser): Promise<void>;
|
|
10
10
|
}
|
package/dist/types/passport.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IPayloadData } from 'vona-module-a-jwt';
|
|
2
|
+
import type { IAuth } from './auth.ts';
|
|
3
3
|
import type { IRole } from './role.ts';
|
|
4
4
|
import type { IUser } from './user.ts';
|
|
5
5
|
export interface IPassport {
|
|
6
6
|
user?: IUser;
|
|
7
|
-
auth?:
|
|
7
|
+
auth?: IAuth;
|
|
8
8
|
roles?: IRole[];
|
|
9
9
|
}
|
|
10
10
|
export interface IPassportAdapter {
|
|
11
11
|
isAdmin(passport: IPassport | undefined): Promise<boolean>;
|
|
12
12
|
setCurrent(passport: IPassport | undefined): Promise<IPassport | undefined>;
|
|
13
|
-
serialize(passport: IPassport): Promise<
|
|
14
|
-
deserialize(payloadData:
|
|
13
|
+
serialize(passport: IPassport): Promise<IPayloadData>;
|
|
14
|
+
deserialize(payloadData: IPayloadData): Promise<IPassport | undefined>;
|
|
15
15
|
}
|
|
16
16
|
declare module 'vona' {
|
|
17
17
|
interface ContextState {
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableIdentity } from 'table-identity';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ILocaleRecord } from 'vona';
|
|
3
3
|
import type { IAuthUserProfile } from './authProfile.ts';
|
|
4
4
|
export interface IUserNameRecord {
|
|
5
5
|
admin: never;
|
|
@@ -14,7 +14,7 @@ export interface IUser {
|
|
|
14
14
|
email?: string;
|
|
15
15
|
mobile?: string;
|
|
16
16
|
activated?: boolean;
|
|
17
|
-
locale?: keyof
|
|
17
|
+
locale?: keyof ILocaleRecord | undefined;
|
|
18
18
|
anonymous?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export interface IUserAdapter {
|