@drax/identity-front 0.5.4 → 0.5.5
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 +4 -4
- package/src/i18n/identity-role-i18n.ts +18 -16
- package/src/i18n/identity-tenant-i18n.ts +2 -10
- package/src/i18n/identity-user-i18n.ts +53 -44
- package/src/providers/rest/RoleRestProvider.ts +22 -1
- package/src/providers/rest/TenantRestProvider.ts +0 -1
- package/src/providers/rest/UserRestProvider.ts +21 -1
- package/src/system/RoleSystem.ts +33 -1
- package/src/system/UserSystem.ts +31 -3
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.5.
|
|
6
|
+
"version": "0.5.5",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"format": "prettier --write src/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drax/common-front": "^0.5.
|
|
28
|
-
"@drax/crud-share": "^0.5.
|
|
27
|
+
"@drax/common-front": "^0.5.5",
|
|
28
|
+
"@drax/crud-share": "^0.5.5",
|
|
29
29
|
"@drax/identity-share": "^0.5.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"vite-plugin-dts": "^3.9.1",
|
|
49
49
|
"vitest": "^1.4.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c89751dd8eb2ede7d565b596f698c2b83e0c2fed"
|
|
52
52
|
}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
const messages = {
|
|
2
2
|
en: {
|
|
3
3
|
role: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
entity: 'Role',
|
|
5
|
+
menu: 'Roles',
|
|
6
|
+
crud: 'Manage Roles',
|
|
7
|
+
field:{
|
|
8
|
+
name: "Name",
|
|
9
|
+
permissions: "Username",
|
|
10
|
+
childRoles: "ChildRoles",
|
|
11
|
+
readonly: "Read Only",
|
|
12
|
+
}
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
es: {
|
|
15
16
|
role:{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
entity: 'Rol',
|
|
18
|
+
menu: 'Roles',
|
|
19
|
+
crud: 'Gestionando Roles',
|
|
20
|
+
field:{
|
|
21
|
+
name: "Nombre",
|
|
22
|
+
permissions: "Permisos",
|
|
23
|
+
childRoles: "Roles gestionados",
|
|
24
|
+
readonly: "Solo lectura",
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -4,11 +4,7 @@ const messages = {
|
|
|
4
4
|
entity: "Tenant",
|
|
5
5
|
name: "Name",
|
|
6
6
|
createdAt: 'Created At',
|
|
7
|
-
|
|
8
|
-
creating: "Creating Tenant",
|
|
9
|
-
deleting: "Deleting Tenant",
|
|
10
|
-
managing: 'Managing Tenant',
|
|
11
|
-
fields:{
|
|
7
|
+
field:{
|
|
12
8
|
id: 'ID',
|
|
13
9
|
name: 'Name'
|
|
14
10
|
}
|
|
@@ -19,11 +15,7 @@ const messages = {
|
|
|
19
15
|
entity: "Tenant",
|
|
20
16
|
name: "Nombre",
|
|
21
17
|
createdAt: 'Creado',
|
|
22
|
-
|
|
23
|
-
creating: "Creando Tenant",
|
|
24
|
-
deleting: "Eliminando Tenant",
|
|
25
|
-
managing: 'Gestionando Tenant',
|
|
26
|
-
fields:{
|
|
18
|
+
field:{
|
|
27
19
|
id: 'ID',
|
|
28
20
|
name: 'Nombre'
|
|
29
21
|
}
|
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
const messages = {
|
|
2
2
|
en: {
|
|
3
3
|
user: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
email: "Email",
|
|
7
|
-
password: "Password",
|
|
8
|
-
phone: "Phone",
|
|
9
|
-
avatar: "Avatar",
|
|
10
|
-
role: "Role",
|
|
11
|
-
tenant: "Tenant",
|
|
12
|
-
active: "Active",
|
|
13
|
-
groups: "Groups",
|
|
4
|
+
entity: 'User',
|
|
5
|
+
profile:'Profile',
|
|
14
6
|
code: "Code",
|
|
15
|
-
currentPassword: "Current Password",
|
|
16
|
-
newPassword: "New Password",
|
|
17
|
-
confirmPassword: "Confirm Password",
|
|
18
|
-
changeOwnPassword: "Change Password",
|
|
19
7
|
passwordChanged: "Password Changed",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
operation: {
|
|
9
|
+
changePassword: "Changing User Password",
|
|
10
|
+
},
|
|
11
|
+
action: {
|
|
12
|
+
changePassword: "Change Password",
|
|
13
|
+
changeOwnPassword: "Change Password",
|
|
14
|
+
login:'Login',
|
|
15
|
+
logout:'Logout',
|
|
16
|
+
},
|
|
17
|
+
field: {
|
|
18
|
+
name: "Name",
|
|
19
|
+
username: "Username",
|
|
20
|
+
email: "Email",
|
|
21
|
+
password: "Password",
|
|
22
|
+
phone: "Phone",
|
|
23
|
+
avatar: "Avatar",
|
|
24
|
+
role: "Role",
|
|
25
|
+
tenant: "Tenant",
|
|
26
|
+
active: "Active",
|
|
27
|
+
groups: "Groups",
|
|
28
|
+
currentPassword: "Current Password",
|
|
29
|
+
newPassword: "New Password",
|
|
30
|
+
confirmPassword: "Confirm Password",
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
es: {
|
|
31
35
|
user:{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
password: "Clave",
|
|
36
|
-
phone: "Télefono",
|
|
37
|
-
avatar: "Avatar",
|
|
38
|
-
role: "Rol",
|
|
39
|
-
tenant: "Tenant",
|
|
40
|
-
active: "Activo",
|
|
41
|
-
groups: "Grupos",
|
|
36
|
+
entity: 'Usuario',
|
|
37
|
+
|
|
38
|
+
profile:'Perfil',
|
|
42
39
|
code: "Codigo",
|
|
43
|
-
currentPassword: "Clave Actual",
|
|
44
|
-
newPassword: "Nueva Clave",
|
|
45
|
-
confirmPassword: "Confirmar Clave",
|
|
46
|
-
changeOwnPassword: "Cambiar Clave",
|
|
47
40
|
passwordChanged: "Clave Cambiada",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
operation: {
|
|
42
|
+
changePassword: "Cambiando Clave de Usuario",
|
|
43
|
+
},
|
|
44
|
+
action: {
|
|
45
|
+
changePassword: "Cambiar Clave",
|
|
46
|
+
changeOwnPassword: "Cambiar Clave",
|
|
47
|
+
login:'Iniciar Sesión',
|
|
48
|
+
logout:'Cerrar Sesión',
|
|
49
|
+
},
|
|
50
|
+
field: {
|
|
51
|
+
name: "Nombre",
|
|
52
|
+
username: "Usuario",
|
|
53
|
+
email: "Email",
|
|
54
|
+
password: "Clave",
|
|
55
|
+
phone: "Télefono",
|
|
56
|
+
avatar: "Avatar",
|
|
57
|
+
role: "Rol",
|
|
58
|
+
tenant: "Tenant",
|
|
59
|
+
active: "Activo",
|
|
60
|
+
groups: "Grupos",
|
|
61
|
+
currentPassword: "Clave Actual",
|
|
62
|
+
newPassword: "Nueva Clave",
|
|
63
|
+
confirmPassword: "Confirmar Clave",
|
|
64
|
+
}
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
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 {
|
|
4
|
+
import type {
|
|
5
|
+
IDraxCrudProviderExportResult,
|
|
6
|
+
IDraxExportOptions, IDraxFieldFilter,
|
|
7
|
+
IDraxPaginateOptions,
|
|
8
|
+
IDraxPaginateResult
|
|
9
|
+
} from "@drax/crud-share";
|
|
5
10
|
|
|
6
11
|
class RoleRestProvider implements IRoleProvider {
|
|
7
12
|
|
|
@@ -56,6 +61,22 @@ class RoleRestProvider implements IRoleProvider {
|
|
|
56
61
|
return roles
|
|
57
62
|
}
|
|
58
63
|
|
|
64
|
+
async export({
|
|
65
|
+
format = 'JSON',
|
|
66
|
+
headers = [],
|
|
67
|
+
separator = ';',
|
|
68
|
+
limit = 0,
|
|
69
|
+
orderBy = "",
|
|
70
|
+
order = false,
|
|
71
|
+
search = "",
|
|
72
|
+
filters = []
|
|
73
|
+
}: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
|
|
74
|
+
const url = '/api/roles/export'
|
|
75
|
+
const sFilters: string = filters.map((filter : IDraxFieldFilter ) => `${filter.field},${filter.operator},${filter.value}`).join('|')
|
|
76
|
+
const params: any = {format, headers, separator, limit, orderBy, order, search, filters: sFilters}
|
|
77
|
+
return await this.httpClient.get(url, {params}) as IDraxCrudProviderExportResult
|
|
78
|
+
}
|
|
79
|
+
|
|
59
80
|
}
|
|
60
81
|
|
|
61
82
|
export default RoleRestProvider
|
|
@@ -63,7 +63,6 @@ class TenantRestProvider implements ITenantProvider {
|
|
|
63
63
|
const sFilters: string = filters.map((filter : IDraxFieldFilter ) => `${filter.field},${filter.operator},${filter.value}`).join('|')
|
|
64
64
|
const params: any = {format, headers, separator, limit, orderBy, order, search, filters: sFilters}
|
|
65
65
|
return await this.httpClient.get(url, {params}) as IDraxCrudProviderExportResult
|
|
66
|
-
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
async search(value: any): Promise<any> {
|
|
@@ -1,7 +1,12 @@
|
|
|
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 {
|
|
4
|
+
import type {
|
|
5
|
+
IDraxCrudProviderExportResult,
|
|
6
|
+
IDraxExportOptions, IDraxFieldFilter,
|
|
7
|
+
IDraxPaginateOptions,
|
|
8
|
+
IDraxPaginateResult
|
|
9
|
+
} from "@drax/crud-share";
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
class UserRestProvider implements IUserProvider {
|
|
@@ -54,6 +59,21 @@ class UserRestProvider implements IUserProvider {
|
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
|
|
62
|
+
async export({
|
|
63
|
+
format = 'JSON',
|
|
64
|
+
headers = [],
|
|
65
|
+
separator = ';',
|
|
66
|
+
limit = 0,
|
|
67
|
+
orderBy = "",
|
|
68
|
+
order = false,
|
|
69
|
+
search = "",
|
|
70
|
+
filters = []
|
|
71
|
+
}: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
|
|
72
|
+
const url = '/api/users/export'
|
|
73
|
+
const sFilters: string = filters.map((filter : IDraxFieldFilter ) => `${filter.field},${filter.operator},${filter.value}`).join('|')
|
|
74
|
+
const params: any = {format, headers, separator, limit, orderBy, order, search, filters: sFilters}
|
|
75
|
+
return await this.httpClient.get(url, {params}) as IDraxCrudProviderExportResult
|
|
76
|
+
}
|
|
57
77
|
|
|
58
78
|
|
|
59
79
|
}
|
package/src/system/RoleSystem.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type {IRoleProvider} from "../interfaces/IRoleProvider";
|
|
2
2
|
import type {IRole, IRoleBase, ITenant} from "@drax/identity-share";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
IDraxCrudProviderExportResult,
|
|
5
|
+
IDraxExportOptions,
|
|
6
|
+
IDraxPaginateOptions,
|
|
7
|
+
IDraxPaginateResult
|
|
8
|
+
} from "@drax/crud-share";
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
class RoleSystem implements IRoleProvider {
|
|
@@ -46,6 +51,33 @@ class RoleSystem implements IRoleProvider {
|
|
|
46
51
|
return this._provider.delete(id)
|
|
47
52
|
}
|
|
48
53
|
|
|
54
|
+
async export({
|
|
55
|
+
format = 'JSON',
|
|
56
|
+
headers = [],
|
|
57
|
+
separator = ';',
|
|
58
|
+
limit = 0,
|
|
59
|
+
orderBy = "",
|
|
60
|
+
order = false,
|
|
61
|
+
search = "",
|
|
62
|
+
filters = []
|
|
63
|
+
}: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
|
|
64
|
+
|
|
65
|
+
if(!this._provider.export){
|
|
66
|
+
throw new Error(`RoleSystem.provider does not support export`) // assuming we have a custom error for this case // replace with actual error handling as needed // see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#error-handling-changes for more details on custom error classes in TypeScript 3.1+ // or use a library like 'ts-error' for a more robust and flexible error handling solution // or use a custom error type if you want to have a specific error type for this operation // or use a custom interface or class for the export result if you want to have a specific structure for the result // or use a custom function that returns the result if you want to have a specific function for the result // or use a custom interface or class if you want to have a specific structure for the result // or use a custom function that returns the result
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return this._provider.export({
|
|
70
|
+
format,
|
|
71
|
+
headers,
|
|
72
|
+
separator,
|
|
73
|
+
limit,
|
|
74
|
+
orderBy,
|
|
75
|
+
order,
|
|
76
|
+
search,
|
|
77
|
+
filters
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
49
81
|
}
|
|
50
82
|
|
|
51
83
|
export default RoleSystem
|
package/src/system/UserSystem.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type {IUserProvider} from "../interfaces/IUserProvider";
|
|
2
2
|
import type {IUser, IUserCreate, IUserUpdate} from "@drax/identity-share";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
IDraxCrudProviderExportResult,
|
|
5
|
+
IDraxExportOptions,
|
|
6
|
+
IDraxPaginateOptions,
|
|
7
|
+
IDraxPaginateResult
|
|
8
|
+
} from "@drax/crud-share";
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
class UserSystem implements IUserProvider{
|
|
@@ -44,9 +49,32 @@ class UserSystem implements IUserProvider{
|
|
|
44
49
|
return result
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
async export({
|
|
53
|
+
format = 'JSON',
|
|
54
|
+
headers = [],
|
|
55
|
+
separator = ';',
|
|
56
|
+
limit = 0,
|
|
57
|
+
orderBy = "",
|
|
58
|
+
order = false,
|
|
59
|
+
search = "",
|
|
60
|
+
filters = []
|
|
61
|
+
}: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
|
|
62
|
+
|
|
63
|
+
if(!this._provider.export){
|
|
64
|
+
throw new Error(`RoleSystem.provider does not support export`) // assuming we have a custom error for this case // replace with actual error handling as needed // see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#error-handling-changes for more details on custom error classes in TypeScript 3.1+ // or use a library like 'ts-error' for a more robust and flexible error handling solution // or use a custom error type if you want to have a specific error type for this operation // or use a custom interface or class for the export result if you want to have a specific structure for the result // or use a custom function that returns the result if you want to have a specific function for the result // or use a custom interface or class if you want to have a specific structure for the result // or use a custom function that returns the result
|
|
65
|
+
}
|
|
47
66
|
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
return this._provider.export({
|
|
68
|
+
format,
|
|
69
|
+
headers,
|
|
70
|
+
separator,
|
|
71
|
+
limit,
|
|
72
|
+
orderBy,
|
|
73
|
+
order,
|
|
74
|
+
search,
|
|
75
|
+
filters
|
|
76
|
+
})
|
|
77
|
+
}
|
|
50
78
|
|
|
51
79
|
}
|
|
52
80
|
|