@drax/identity-front 0.0.18 → 0.0.20
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/package.json +3 -3
- package/src/interfaces/IAuthProvider.ts +2 -2
- package/src/interfaces/IAuthUser.ts +1 -1
- package/src/interfaces/IUser.ts +2 -2
- package/src/interfaces/IUserProvider.ts +1 -1
- package/src/system/AuthSystem.ts +3 -3
- package/src/system/RoleSystem.ts +2 -2
- package/src/system/TenantSystem.ts +2 -2
- package/src/system/UserSystem.ts +2 -2
- package/src/factories/providers/AuthProviderFactory.ts +0 -29
- package/src/factories/system/AuthSystemFactory.ts +0 -12
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.20",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"format": "prettier --write src/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drax/common-front": "^0.0.
|
|
27
|
+
"@drax/common-front": "^0.0.20"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@rushstack/eslint-patch": "^1.8.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vite-plugin-dts": "^3.9.1",
|
|
47
47
|
"vitest": "^1.4.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5d01fbe44ee689c8512d7605f4b2fe2fc94fb599"
|
|
50
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {IAuthUser} from "
|
|
2
|
-
import type {ILoginResponse} from "
|
|
1
|
+
import type {IAuthUser} from "./IAuthUser";
|
|
2
|
+
import type {ILoginResponse} from "./ILoginResponse";
|
|
3
3
|
|
|
4
4
|
interface IAuthProvider {
|
|
5
5
|
login(username: string, password: string): Promise<ILoginResponse>
|
package/src/interfaces/IUser.ts
CHANGED
package/src/system/AuthSystem.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {IAuthProvider} from "../interfaces/IAuthProvider
|
|
2
|
-
import type {IAuthUser} from "
|
|
3
|
-
import type {ILoginResponse} from "
|
|
1
|
+
import type {IAuthProvider} from "../interfaces/IAuthProvider";
|
|
2
|
+
import type {IAuthUser} from "../interfaces/IAuthUser";
|
|
3
|
+
import type {ILoginResponse} from "../interfaces/ILoginResponse";
|
|
4
4
|
|
|
5
5
|
class AuthSystem {
|
|
6
6
|
|
package/src/system/RoleSystem.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {IRoleProvider} from "
|
|
2
|
-
import type {IRole} from "
|
|
1
|
+
import type {IRoleProvider} from "../interfaces/IRoleProvider";
|
|
2
|
+
import type {IRole} from "../interfaces/IRole";
|
|
3
3
|
import type {IPaginateClient} from "@drax/common-front";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {ITenantProvider} from "
|
|
2
|
-
import type {ITenant} from "
|
|
1
|
+
import type {ITenantProvider} from "../interfaces/ITenantProvider";
|
|
2
|
+
import type {ITenant} from "../interfaces/ITenant";
|
|
3
3
|
import type {IPaginateClient} from "@drax/common-front";
|
|
4
4
|
|
|
5
5
|
|
package/src/system/UserSystem.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {IUserProvider} from "
|
|
2
|
-
import type {IUser, IUserCreate, IUserUpdate} from "
|
|
1
|
+
import type {IUserProvider} from "../interfaces/IUserProvider";
|
|
2
|
+
import type {IUser, IUserCreate, IUserUpdate} from "../interfaces/IUser";
|
|
3
3
|
import type {IPaginateClient} from "@drax/common-front";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type {IGqlClient, IHttpClient} from '@drax/common-front'
|
|
2
|
-
import {HttpGqlClientFactory, HttpFetchClientFactory} from '@drax/common-front';
|
|
3
|
-
import type {IAuthProvider} from "@/core/interfaces/IAuthProvider";
|
|
4
|
-
import AuthRestProvider from "@/core/providers/rest/AuthRestProvider";
|
|
5
|
-
import AuthGqlProvider from "@/core/providers/gql/AuthGqlProvider";
|
|
6
|
-
class AuthProviderFactory{
|
|
7
|
-
static create(type: string = 'rest'): IAuthProvider {
|
|
8
|
-
if (type === 'gql') {
|
|
9
|
-
return AuthProviderFactory.createGql()
|
|
10
|
-
}
|
|
11
|
-
return AuthProviderFactory.createRest()
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static createGql(): IAuthProvider {
|
|
15
|
-
const gqlClient: IGqlClient = HttpGqlClientFactory.create('/graphql')
|
|
16
|
-
return new AuthGqlProvider(gqlClient)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static createRest(): IAuthProvider {
|
|
20
|
-
const baseUrl = import.meta.env.API_URL ? import.meta.env.API_URL : ''
|
|
21
|
-
console.log("baseUrl",baseUrl)
|
|
22
|
-
const baseHeaders = new Headers()
|
|
23
|
-
const httpClient: IHttpClient = HttpFetchClientFactory.create(baseUrl,baseHeaders)
|
|
24
|
-
return new AuthRestProvider(httpClient)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default AuthProviderFactory
|
|
29
|
-
export {AuthProviderFactory}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import AuthSystem from "@/core/system/AuthSystem";
|
|
2
|
-
import type {IAuthProvider} from "@/core/interfaces/IAuthProvider";
|
|
3
|
-
import AuthRestProviderFactory from "@/core/factories/providers/AuthProviderFactory";
|
|
4
|
-
|
|
5
|
-
class AuthSystemFactory {
|
|
6
|
-
|
|
7
|
-
static create(type: string = 'rest'): AuthSystem {
|
|
8
|
-
const provider: IAuthProvider = AuthRestProviderFactory.create(type)
|
|
9
|
-
|
|
10
|
-
return new AuthSystem(provider)
|
|
11
|
-
}
|
|
12
|
-
}
|