@addev-be/ui 0.6.13 → 0.6.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@addev-be/ui",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "watch": "tsc -b --watch",
@@ -6,7 +6,6 @@ export * from './globalSearch';
6
6
  export * from './requests/auth';
7
7
  export * from './requests/users';
8
8
  export * from './requests/userProfiles';
9
- export * from './requests/userPermissions';
10
9
 
11
10
  export * from './types/auth';
12
11
  export * from './types/base';
@@ -1,104 +1,3 @@
1
- import * as t from 'io-ts';
2
-
3
- import { baseModelDtoCodec } from './base';
4
-
5
- export const userPermissionDtoCodec = t.type(
6
- {
7
- ...baseModelDtoCodec.props,
8
- name: t.string,
9
- },
10
- 'UserPermissionDTO'
11
- );
12
-
13
- export type UserPermissionDTO = t.TypeOf<typeof userPermissionDtoCodec>;
14
-
15
- /*****/
16
-
17
- export const getUserPermissionRequestDtoCodec = t.type(
18
- {
19
- id: t.string,
20
- },
21
- 'GetUserPermissionRequestDTO'
22
- );
23
-
24
- export const getUserPermissionResponseDtoCodec = t.type(
25
- {
26
- data: userPermissionDtoCodec,
27
- },
28
- 'GetUserPermissionResponseDTO'
29
- );
30
-
31
- export type GetUserPermissionRequestDTO = t.TypeOf<
32
- typeof getUserPermissionRequestDtoCodec
33
- >;
34
- export type GetUserPermissionResponseDTO = t.TypeOf<
35
- typeof getUserPermissionResponseDtoCodec
36
- >;
37
-
38
- /*****/
39
-
40
- export const getAllUserPermissionsRequestDtoCodec = t.type(
41
- {},
42
- 'GetAllUserPermissionsRequestDTO'
43
- );
44
-
45
- export const getAllUserPermissionsResponseDtoCodec = t.type(
46
- {
47
- data: t.array(userPermissionDtoCodec),
48
- },
49
- 'GetAllUserPermissionsResponseDTO'
50
- );
51
-
52
- export type GetAllUserPermissionsRequestDTO = t.TypeOf<
53
- typeof getAllUserPermissionsRequestDtoCodec
54
- >;
55
- export type GetAllUserPermissionsResponseDTO = t.TypeOf<
56
- typeof getAllUserPermissionsResponseDtoCodec
57
- >;
58
-
59
- /*****/
60
-
61
- export const saveUserPermissionRequestDtoCodec = t.type(
62
- {
63
- id: t.string,
64
- },
65
- 'SaveUserPermissionRequestDTO'
66
- );
67
-
68
- export const saveUserPermissionResponseDtoCodec = t.type(
69
- {
70
- status: t.number,
71
- data: userPermissionDtoCodec,
72
- },
73
- 'SaveUserPermissionResponseDTO'
74
- );
75
-
76
- export type SaveUserPermissionRequestDTO = t.TypeOf<
77
- typeof saveUserPermissionRequestDtoCodec
78
- >;
79
- export type SaveUserPermissionResponseDTO = t.TypeOf<
80
- typeof saveUserPermissionResponseDtoCodec
81
- >;
82
-
83
- /*****/
84
-
85
- export const deleteUserPermissionRequestDtoCodec = t.type(
86
- {
87
- id: t.string,
88
- },
89
- 'DeleteUserPermissionRequestDTO'
90
- );
91
-
92
- export const deleteUserPermissionResponseDtoCodec = t.type(
93
- {
94
- status: t.number,
95
- },
96
- 'DeleteUserPermissionResponseDTO'
97
- );
98
-
99
- export type DeleteUserPermissionRequestDTO = t.TypeOf<
100
- typeof deleteUserPermissionRequestDtoCodec
101
- >;
102
- export type DeleteUserPermissionResponseDTO = t.TypeOf<
103
- typeof deleteUserPermissionResponseDtoCodec
104
- >;
1
+ export const userPermissions: Record<string, string> = {
2
+ 'users:manage': 'Gérer les utilisateurs',
3
+ };
@@ -6,6 +6,7 @@ export const userProfileDtoCodec = t.type(
6
6
  {
7
7
  ...baseModelDtoCodec.props,
8
8
  name: t.string,
9
+ permissions: t.array(t.string),
9
10
  isAdmin: t.string,
10
11
  },
11
12
  'UserProfileDTO'
@@ -7,6 +7,7 @@ export const userDtoCodec = t.intersection(
7
7
  t.type({
8
8
  ...baseModelDtoCodec.props,
9
9
  username: t.string,
10
+ permissions: t.array(t.string),
10
11
  isAdmin: t.boolean,
11
12
  }),
12
13
  t.partial({