@drax/identity-front 0.11.4 → 0.12.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/i18n/identity-userApiKey-i18n.ts +30 -22
- package/src/interfaces/IAuthProvider.ts +1 -1
- package/src/providers/gql/AuthGqlProvider.ts +2 -4
- package/src/providers/gql/UserApiKeyGqlProvider.ts +1 -1
- package/src/providers/rest/AuthRestProvider.ts +2 -2
- package/src/providers/rest/RoleRestProvider.ts +1 -1
- package/src/providers/rest/TenantRestProvider.ts +1 -1
- package/src/providers/rest/UserRestProvider.ts +1 -1
- package/src/system/AuthSystem.ts +2 -2
- package/src/system/RoleSystem.ts +1 -1
- package/src/system/TenantSystem.ts +1 -1
- package/src/system/UserApiKeySystem.ts +1 -1
- package/src/system/UserSystem.ts +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.12.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"format": "prettier --write src/"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@drax/common-front": "^0.
|
|
29
|
-
"@drax/crud-share": "^0.
|
|
30
|
-
"@drax/identity-share": "^0.
|
|
28
|
+
"@drax/common-front": "^0.12.1",
|
|
29
|
+
"@drax/crud-share": "^0.12.1",
|
|
30
|
+
"@drax/identity-share": "^0.12.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@rushstack/eslint-patch": "^1.8.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"vite-plugin-dts": "^3.9.1",
|
|
50
50
|
"vitest": "^1.4.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "76fd366e12449f5f605662197f985a28d98058a2"
|
|
53
53
|
}
|
|
@@ -1,32 +1,40 @@
|
|
|
1
1
|
const messages = {
|
|
2
2
|
en: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
userapikey: {
|
|
4
|
+
entity: 'ApiKey',
|
|
5
|
+
menu: 'ApiKey',
|
|
6
|
+
crud: 'Manage UserApiKey',
|
|
7
|
+
field:{
|
|
8
|
+
name: "Reference Name",
|
|
9
|
+
secret: "Secret",
|
|
10
|
+
ipv4: "Allowed IPV4",
|
|
11
|
+
ipv6: "Allowed IPV6",
|
|
12
|
+
user: "User",
|
|
13
|
+
createdAt: 'Created At',
|
|
14
|
+
createdBy: 'Created By',
|
|
15
|
+
},
|
|
6
16
|
secretWarning: "ApiKey only shows once. Keep the ApiKey securely.",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
user: "User",
|
|
10
|
-
createdAt: 'Created At',
|
|
11
|
-
updating: "Updating API Key",
|
|
12
|
-
creating: "Creating API Key",
|
|
13
|
-
deleting: "Deleting API Key",
|
|
14
|
-
managing: 'Managing API Key',
|
|
17
|
+
created: 'ApiKey created successfully',
|
|
18
|
+
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
es: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
userapikey:{
|
|
23
|
+
entity: 'ApiKey',
|
|
24
|
+
menu: 'ApiKey',
|
|
25
|
+
crud: 'Gestionar ApiKey',
|
|
26
|
+
field:{
|
|
27
|
+
name: "Nombre de referencia",
|
|
28
|
+
secret: "Secreto",
|
|
29
|
+
ipv4: "IPv4 permitidos",
|
|
30
|
+
ipv6: "IPv6 permitidos",
|
|
31
|
+
user: "Usuario",
|
|
32
|
+
createdAt: 'Fecha Creación',
|
|
33
|
+
createdBy: 'Creado por',
|
|
34
|
+
},
|
|
21
35
|
secretWarning: "La ApiKey solo se muestra una vez. Guarde la ApiKey de forma segura.",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
user: "Usuario",
|
|
25
|
-
createdAt: 'Creado',
|
|
26
|
-
updating: "Actualizando API Key",
|
|
27
|
-
creating: "Creando API Key",
|
|
28
|
-
deleting: "Eliminando API Key",
|
|
29
|
-
managing: 'Administrando API Key',
|
|
36
|
+
created: 'ApiKey creado con éxito',
|
|
37
|
+
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
}
|
|
@@ -9,7 +9,7 @@ interface IAuthProvider {
|
|
|
9
9
|
changeOwnPassword(currentPassword:string, newPassword:string):Promise<boolean>
|
|
10
10
|
recoveryPasswordRequest(email:string):Promise<boolean>
|
|
11
11
|
recoveryPasswordComplete(recoveryCode:string, newPassword:string):Promise<boolean>
|
|
12
|
-
register(form:IUserRegistration):Promise<boolean>
|
|
12
|
+
register(form:IUserRegistration):Promise<{success:boolean, message: string}>
|
|
13
13
|
changeAvatar(file: File): Promise<boolean>
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -3,8 +3,6 @@ import type {IAuthProvider} from "../../interfaces/IAuthProvider.ts";
|
|
|
3
3
|
import type {IAuthUser} from "../../interfaces/IAuthUser";
|
|
4
4
|
import type {ILoginResponse} from "../../interfaces/ILoginResponse";
|
|
5
5
|
import type {IUserRegistration} from "../../interfaces/IUserRegistration";
|
|
6
|
-
import type {Promise} from "cypress/types/cy-bluebird";
|
|
7
|
-
import type {File} from "vitest";
|
|
8
6
|
|
|
9
7
|
class AuthGqlProvider implements IAuthProvider {
|
|
10
8
|
|
|
@@ -58,7 +56,7 @@ class AuthGqlProvider implements IAuthProvider {
|
|
|
58
56
|
return /true/i.test(r as string)
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
async changeAvatar(file:
|
|
59
|
+
async changeAvatar(file: Blob): Promise<boolean> {
|
|
62
60
|
//const query: string = `mutation changeAvatar( $file: File!) { changeAvatar }`
|
|
63
61
|
const operations = `{ "query": "mutation ($file: File!) { changeAvatar(file: $file) }", "variables": { "file": null } }`
|
|
64
62
|
const data = new FormData()
|
|
@@ -78,7 +76,7 @@ class AuthGqlProvider implements IAuthProvider {
|
|
|
78
76
|
throw new Error('Not implemented')
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
register(form: IUserRegistration): Promise<boolean> {
|
|
79
|
+
register(form: IUserRegistration): Promise<{success: boolean; message: string}> {
|
|
82
80
|
throw new Error('Not implemented')
|
|
83
81
|
}
|
|
84
82
|
}
|
|
@@ -20,7 +20,7 @@ class UserApiKeyGqlProvider implements IUserApiKeyProvider {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
get gqlFields(){
|
|
23
|
-
return `id name secret ipv4 ipv6 createdAt updatedAt`
|
|
23
|
+
return `id name secret ipv4 ipv6 createdAt updatedAt createdBy`
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async search(value: any): Promise<IUserApiKey[]> {
|
|
@@ -62,10 +62,10 @@ class AuthRestProvider implements IAuthProvider {
|
|
|
62
62
|
return /true/i.test(r as string)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
async register(form: IUserRegistration): Promise<boolean> {
|
|
65
|
+
async register(form: IUserRegistration): Promise<{success: boolean; message: string}> {
|
|
66
66
|
const url = '/api/users/register'
|
|
67
67
|
let r = await this.httpClient.post(url, form)
|
|
68
|
-
return
|
|
68
|
+
return r as {success: boolean; message: string}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
async changeAvatar(file: File): Promise<boolean> {
|
|
@@ -46,7 +46,7 @@ class RoleRestProvider implements IRoleProvider {
|
|
|
46
46
|
return user
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
async paginate({page= 1, limit= 5, orderBy="", order=
|
|
49
|
+
async paginate({page= 1, limit= 5, orderBy="", order= "asc", search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IRole>> {
|
|
50
50
|
const url = '/api/roles'
|
|
51
51
|
const params = {page, limit, orderBy, order, search}
|
|
52
52
|
let paginatedRoles = await this.httpClient.get(url, {params})
|
|
@@ -41,7 +41,7 @@ class TenantRestProvider implements ITenantProvider {
|
|
|
41
41
|
return user
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async paginate({page= 1, limit= 5, orderBy="", order=
|
|
44
|
+
async paginate({page= 1, limit= 5, orderBy="", order= "asc", search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<ITenant>> {
|
|
45
45
|
const url = '/api/tenants'
|
|
46
46
|
const params = {page, limit, orderBy, order, search}
|
|
47
47
|
let paginatedTenants = await this.httpClient.get(url, {params})
|
|
@@ -36,7 +36,7 @@ class UserRestProvider implements IUserProvider {
|
|
|
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= "asc", search = ""}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IUser>> {
|
|
40
40
|
const url = '/api/users'
|
|
41
41
|
const params = {page, limit, orderBy, order, search}
|
|
42
42
|
let paginatedUsers = await this.httpClient.get(url, {params})
|
package/src/system/AuthSystem.ts
CHANGED
|
@@ -41,8 +41,8 @@ class AuthSystem implements IAuthProvider {
|
|
|
41
41
|
return result
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async register(form: IUserRegistration):Promise<boolean> {
|
|
45
|
-
const result
|
|
44
|
+
async register(form: IUserRegistration):Promise<{success:boolean, message: string}> {
|
|
45
|
+
const result = await this._provider.register(form)
|
|
46
46
|
return result
|
|
47
47
|
}
|
|
48
48
|
|
package/src/system/RoleSystem.ts
CHANGED
|
@@ -35,7 +35,7 @@ class RoleSystem implements IRoleProvider {
|
|
|
35
35
|
return this._provider.fetchPermissions()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
async paginate({page= 1, limit= 5, orderBy="", order=
|
|
38
|
+
async paginate({page= 1, limit= 5, orderBy="", order="asc", search = "", filters = []}: IDraxPaginateOptions): Promise<IDraxPaginateResult<IRole>> {
|
|
39
39
|
return this._provider.paginate({page, limit, orderBy, order, search, filters})
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -35,7 +35,7 @@ class TenantSystem implements IDraxCrudProvider<ITenant, ITenantBase, ITenantBas
|
|
|
35
35
|
page = 1,
|
|
36
36
|
limit = 5,
|
|
37
37
|
orderBy = "",
|
|
38
|
-
order =
|
|
38
|
+
order = "asc",
|
|
39
39
|
search = "",
|
|
40
40
|
filters = []
|
|
41
41
|
}: IDraxPaginateOptions): Promise<IDraxPaginateResult<ITenant>> {
|
|
@@ -22,7 +22,7 @@ class UserApiKeySystem implements IUserApiKeyProvider{
|
|
|
22
22
|
return this._provider.search(value)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async paginate({page= 1, limit= 5, orderBy="", order=
|
|
25
|
+
async paginate({page= 1, limit= 5, orderBy="", order="asc", search = "", filters = []}: IDraxPaginateOptions):Promise<IDraxPaginateResult<IUserApiKey>> {
|
|
26
26
|
return this._provider.paginate({page, limit, orderBy, order, search, filters})
|
|
27
27
|
}
|
|
28
28
|
|
package/src/system/UserSystem.ts
CHANGED
|
@@ -27,7 +27,7 @@ class UserSystem implements IUserProvider{
|
|
|
27
27
|
return this._provider.search(value)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async paginate({page= 1, limit= 5, orderBy="", order=
|
|
30
|
+
async paginate({page= 1, limit= 5, orderBy= "", order= "asc", search = "", filters = []}: IDraxPaginateOptions):Promise<IDraxPaginateResult<IUser>> {
|
|
31
31
|
return this._provider.paginate({page, limit, orderBy, order, search, filters})
|
|
32
32
|
}
|
|
33
33
|
|