@nocobase/auth 0.10.1-alpha.1 → 0.11.1-alpha.1
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/lib/auth-manager.d.ts +3 -3
- package/lib/auth-manager.js +1 -1
- package/lib/auth.d.ts +2 -2
- package/lib/base/jwt-service.d.ts +1 -1
- package/package.json +6 -6
package/lib/auth-manager.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ import { Registry } from '@nocobase/utils';
|
|
|
4
4
|
import { Auth, AuthExtend } from './auth';
|
|
5
5
|
import { JwtOptions, JwtService } from './base/jwt-service';
|
|
6
6
|
import { ITokenBlacklistService } from './base/token-blacklist-service';
|
|
7
|
-
|
|
7
|
+
type Storer = {
|
|
8
8
|
get: (name: string) => Promise<Model>;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type AuthManagerOptions = {
|
|
11
11
|
authKey: string;
|
|
12
12
|
default?: string;
|
|
13
13
|
jwt?: JwtOptions;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type AuthConfig = {
|
|
16
16
|
auth: AuthExtend<Auth>;
|
|
17
17
|
};
|
|
18
18
|
export declare class AuthManager {
|
package/lib/auth-manager.js
CHANGED
package/lib/auth.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Context } from '@nocobase/actions';
|
|
2
2
|
import { Model } from '@nocobase/database';
|
|
3
|
-
export
|
|
3
|
+
export type AuthConfig = {
|
|
4
4
|
authenticator: Model;
|
|
5
5
|
options: {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
8
|
ctx: Context;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type AuthExtend<T extends Auth> = new (config: AuthConfig) => T;
|
|
11
11
|
interface IAuth {
|
|
12
12
|
user: Model;
|
|
13
13
|
check(): Promise<Model>;
|
|
@@ -4,7 +4,7 @@ export interface JwtOptions {
|
|
|
4
4
|
secret: string;
|
|
5
5
|
expiresIn?: string;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type SignPayload = Parameters<typeof jwt.sign>[0];
|
|
8
8
|
export declare class JwtService {
|
|
9
9
|
protected options: JwtOptions;
|
|
10
10
|
constructor(options?: JwtOptions);
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "0.
|
|
10
|
-
"@nocobase/database": "0.
|
|
11
|
-
"@nocobase/resourcer": "0.
|
|
12
|
-
"@nocobase/utils": "0.
|
|
9
|
+
"@nocobase/actions": "0.11.1-alpha.1",
|
|
10
|
+
"@nocobase/database": "0.11.1-alpha.1",
|
|
11
|
+
"@nocobase/resourcer": "0.11.1-alpha.1",
|
|
12
|
+
"@nocobase/utils": "0.11.1-alpha.1"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
17
17
|
"directory": "packages/auth"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "9ed1dba520bc5f3a7cb1255ea8d92ccbefc11bc8"
|
|
20
20
|
}
|