@drax/identity-front 0.2.0 → 0.3.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/package.json +5 -5
- package/src/providers/gql/RoleGqlProvider.ts +3 -3
- package/src/providers/gql/TenantGqlProvider.ts +3 -3
- package/src/providers/gql/UserApiKeyGqlProvider.ts +3 -3
- package/src/providers/gql/UserGqlProvider.ts +3 -3
- package/src/providers/rest/RoleRestProvider.ts +3 -3
- package/src/providers/rest/TenantRestProvider.ts +3 -3
- package/src/providers/rest/UserApiKeyRestProvider.ts +3 -3
- package/src/providers/rest/UserRestProvider.ts +3 -3
- package/src/system/RoleSystem.ts +2 -2
- package/src/system/TenantSystem.ts +2 -2
- package/src/system/UserApiKeySystem.ts +2 -2
- package/src/system/UserSystem.ts +2 -2
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.3.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"format": "prettier --write src/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drax/common-front": "^0.
|
|
28
|
-
"@drax/common-share": "^0.
|
|
29
|
-
"@drax/identity-share": "^0.
|
|
27
|
+
"@drax/common-front": "^0.3.1",
|
|
28
|
+
"@drax/common-share": "^0.3.0",
|
|
29
|
+
"@drax/identity-share": "^0.3.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rushstack/eslint-patch": "^1.8.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"vite-plugin-dts": "^3.9.1",
|
|
49
49
|
"vitest": "^1.4.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "772d3c3db63cfd7ff9e4ef8e3e2795d3fc148467"
|
|
52
52
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IGqlClient} from '@drax/common-front'
|
|
2
2
|
import type {IRoleProvider} from "../../interfaces/IRoleProvider";
|
|
3
3
|
import type {IRole, IRoleBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class RoleGqlProvider implements IRoleProvider {
|
|
@@ -58,13 +58,13 @@ class RoleGqlProvider implements IRoleProvider {
|
|
|
58
58
|
return data.deleteRole
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
61
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IRole>> {
|
|
62
62
|
const query: string = `query paginateRole($options: PaginateOptions) {
|
|
63
63
|
paginateRole(options: $options) {
|
|
64
64
|
total, page, limit, items{id name permissions childRoles{id name} readonly }
|
|
65
65
|
}
|
|
66
66
|
}`
|
|
67
|
-
const variables = {options: {page, limit, orderBy,
|
|
67
|
+
const variables = {options: {page, limit, orderBy, order, search}}
|
|
68
68
|
let data = await this.gqlClient.query(query, variables)
|
|
69
69
|
return data.paginateRole
|
|
70
70
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IGqlClient} from '@drax/common-front'
|
|
2
2
|
import type {ITenantProvider} from "../../interfaces/ITenantProvider";
|
|
3
3
|
import type {ITenant, ITenantBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TenantGqlProvider implements ITenantProvider {
|
|
@@ -52,13 +52,13 @@ class TenantGqlProvider implements ITenantProvider {
|
|
|
52
52
|
return data.deleteTenant
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
55
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<ITenant>> {
|
|
56
56
|
const query: string = `query paginateTenant($options: PaginateOptions) {
|
|
57
57
|
paginateTenant(options: $options) {
|
|
58
58
|
total page limit items{ id name createdAt updatedAt }
|
|
59
59
|
}
|
|
60
60
|
}`
|
|
61
|
-
const variables = {options: {page, limit, orderBy,
|
|
61
|
+
const variables = {options: {page, limit, orderBy, order, search}}
|
|
62
62
|
let data = await this.gqlClient.query(query, variables)
|
|
63
63
|
return data.paginateTenant
|
|
64
64
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IGqlClient} from '@drax/common-front'
|
|
2
2
|
import type {IUserApiKeyProvider} from "../../interfaces/IUserApiKeyProvider";
|
|
3
3
|
import type {IUserApiKey, IUserApiKeyBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
class UserApiKeyGqlProvider implements IUserApiKeyProvider {
|
|
7
7
|
|
|
@@ -48,13 +48,13 @@ class UserApiKeyGqlProvider implements IUserApiKeyProvider {
|
|
|
48
48
|
return data.deleteUserApiKey
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
51
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IUserApiKey>> {
|
|
52
52
|
const query: string = `query paginateUserApiKey($options: PaginateOptions) {
|
|
53
53
|
paginateUserApiKey(options: $options) {
|
|
54
54
|
total page limit items{ id name ipv4 ipv6 user{id username} createdAt updatedAt }
|
|
55
55
|
}
|
|
56
56
|
}`
|
|
57
|
-
const variables = {options: {page, limit, orderBy,
|
|
57
|
+
const variables = {options: {page, limit, orderBy, order, search}}
|
|
58
58
|
let data = await this.gqlClient.query(query, variables)
|
|
59
59
|
return data.paginateUserApiKey
|
|
60
60
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IGqlClient} from '@drax/common-front'
|
|
2
2
|
import type {IUserProvider} from "../../interfaces/IUserProvider";
|
|
3
3
|
import type {IUser, IUserCreate, IUserUpdate} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
class UserGqlProvider implements IUserProvider {
|
|
7
7
|
|
|
@@ -49,13 +49,13 @@ class UserGqlProvider implements IUserProvider {
|
|
|
49
49
|
return data.deleteUser
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
52
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}:IDraxPaginateOptions): Promise<IDraxPaginateResult<IUser>> {
|
|
53
53
|
const query: string = `query paginateUser($options: PaginateOptions) {
|
|
54
54
|
paginateUser(options: $options) {
|
|
55
55
|
total page limit items{ id name username email phone active role{id, name} tenant{id name} createdAt updatedAt }
|
|
56
56
|
}
|
|
57
57
|
}`
|
|
58
|
-
const variables = {options: {page, limit, orderBy,
|
|
58
|
+
const variables = {options: {page, limit, orderBy, order, search}}
|
|
59
59
|
let data = await this.gqlClient.query(query, variables)
|
|
60
60
|
return data.paginateUser
|
|
61
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IHttpClient} from '@drax/common-front'
|
|
2
2
|
import type {IRoleProvider} from "../../interfaces/IRoleProvider.ts";
|
|
3
3
|
import type {IRole, IRoleBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
class RoleRestProvider implements IRoleProvider {
|
|
7
7
|
|
|
@@ -41,9 +41,9 @@ class RoleRestProvider implements IRoleProvider {
|
|
|
41
41
|
return user
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
44
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IRole>> {
|
|
45
45
|
const url = '/api/roles'
|
|
46
|
-
const params = {page, limit, orderBy,
|
|
46
|
+
const params = {page, limit, orderBy, order, search}
|
|
47
47
|
let paginatedRoles = await this.httpClient.get(url, {params})
|
|
48
48
|
return paginatedRoles as IDraxPaginateResult<IRole>
|
|
49
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IHttpClient} from '@drax/common-front'
|
|
2
2
|
import type {ITenantProvider} from "../../interfaces/ITenantProvider.ts";
|
|
3
3
|
import type {ITenant, ITenantBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
class TenantRestProvider implements ITenantProvider {
|
|
7
7
|
|
|
@@ -36,9 +36,9 @@ class TenantRestProvider implements ITenantProvider {
|
|
|
36
36
|
return user
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
39
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<ITenant>> {
|
|
40
40
|
const url = '/api/tenants'
|
|
41
|
-
const params = {page, limit, orderBy,
|
|
41
|
+
const params = {page, limit, orderBy, order, search}
|
|
42
42
|
let paginatedTenants = await this.httpClient.get(url, {params})
|
|
43
43
|
return paginatedTenants as IDraxPaginateResult<ITenant>
|
|
44
44
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IHttpClient} from '@drax/common-front'
|
|
2
2
|
import type {IUserApiKeyProvider} from "../../interfaces/IUserApiKeyProvider";
|
|
3
3
|
import type {IUserApiKey, IUserApiKeyBase} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class UserApiKeyRestProvider implements IUserApiKeyProvider {
|
|
@@ -31,9 +31,9 @@ class UserApiKeyRestProvider implements IUserApiKeyProvider {
|
|
|
31
31
|
return user
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
34
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IUserApiKey>> {
|
|
35
35
|
const url = '/api/user-api-keys'
|
|
36
|
-
const params = {page, limit, orderBy,
|
|
36
|
+
const params = {page, limit, orderBy, order, search}
|
|
37
37
|
let paginatedUsers = await this.httpClient.get(url, {params})
|
|
38
38
|
return paginatedUsers as IDraxPaginateResult<IUserApiKey>
|
|
39
39
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {IHttpClient} from '@drax/common-front'
|
|
2
2
|
import type {IUserProvider} from "../../interfaces/IUserProvider.ts";
|
|
3
3
|
import type {IUser, IUserCreate, IUserUpdate} from "@drax/identity-share";
|
|
4
|
-
import type {IDraxPaginateResult} from "@drax/common-share";
|
|
4
|
+
import type {IDraxPaginateOptions, IDraxPaginateResult} from "@drax/common-share";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class UserRestProvider implements IUserProvider {
|
|
@@ -31,9 +31,9 @@ class UserRestProvider implements IUserProvider {
|
|
|
31
31
|
return user
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
34
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IUser>> {
|
|
35
35
|
const url = '/api/users'
|
|
36
|
-
const params = {page, limit, orderBy,
|
|
36
|
+
const params = {page, limit, orderBy, order, search}
|
|
37
37
|
let paginatedUsers = await this.httpClient.get(url, {params})
|
|
38
38
|
return paginatedUsers as IDraxPaginateResult<IUser>
|
|
39
39
|
|
package/src/system/RoleSystem.ts
CHANGED
|
@@ -21,8 +21,8 @@ class RoleSystem implements IRoleProvider {
|
|
|
21
21
|
return this._provider.fetchPermissions()
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
25
|
-
return this._provider.paginate({page, limit, orderBy,
|
|
24
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}): Promise<IDraxPaginateResult<IRole>> {
|
|
25
|
+
return this._provider.paginate({page, limit, orderBy, order, search})
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async create(userPayload: IRoleBase):Promise<IRole> {
|
|
@@ -17,8 +17,8 @@ class TenantSystem {
|
|
|
17
17
|
return this._provider.fetchTenant()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
21
|
-
return this._provider.paginate({page, limit, orderBy,
|
|
20
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}):Promise<IDraxPaginateResult<ITenant>> {
|
|
21
|
+
return this._provider.paginate({page, limit, orderBy, order, search})
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async create(userPayload: ITenantBase):Promise<ITenant> {
|
|
@@ -13,8 +13,8 @@ class UserApiKeySystem {
|
|
|
13
13
|
this.prototype = 'UserSystem'
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
17
|
-
return this._provider.paginate({page, limit, orderBy,
|
|
16
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}):Promise<IDraxPaginateResult<IUserApiKey>> {
|
|
17
|
+
return this._provider.paginate({page, limit, orderBy, order, search})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
async create(userPayload: IUserApiKeyBase):Promise<IUserApiKey> {
|
package/src/system/UserSystem.ts
CHANGED
|
@@ -13,8 +13,8 @@ class UserSystem {
|
|
|
13
13
|
this.prototype = 'UserSystem'
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async paginate({page= 1, limit= 5, orderBy="",
|
|
17
|
-
return this._provider.paginate({page, limit, orderBy,
|
|
16
|
+
async paginate({page= 1, limit= 5, orderBy="", order=false, search = ""}):Promise<IDraxPaginateResult<IUser>> {
|
|
17
|
+
return this._provider.paginate({page, limit, orderBy, order, search})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
async create(userPayload: IUserCreate):Promise<IUser> {
|