@abpjs/identity-pro 2.2.0 → 2.7.0
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/dist/index.d.mts +69 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +50 -0
- package/dist/index.mjs +48 -0
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -82,6 +82,14 @@ declare namespace Identity {
|
|
|
82
82
|
password: string;
|
|
83
83
|
roleNames: string[];
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Request payload for changing a user's password (admin action)
|
|
87
|
+
* @since 2.7.0
|
|
88
|
+
*/
|
|
89
|
+
interface ChangePasswordRequest {
|
|
90
|
+
/** The new password to set */
|
|
91
|
+
newPassword: string;
|
|
92
|
+
}
|
|
85
93
|
/**
|
|
86
94
|
* Simple claim type name for dropdowns
|
|
87
95
|
* Pro feature since 0.7.2
|
|
@@ -144,6 +152,47 @@ declare namespace Identity {
|
|
|
144
152
|
}
|
|
145
153
|
}
|
|
146
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Identity Pro Component Identifiers
|
|
157
|
+
* Translated from @volo/abp.ng.identity v2.7.0
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* Enum-like const object for identity component identifiers.
|
|
161
|
+
* Used for component registration and identification.
|
|
162
|
+
* @since 2.4.0
|
|
163
|
+
* @updated 2.7.0 - Changed from enum to const object
|
|
164
|
+
*/
|
|
165
|
+
declare const eIdentityComponents: {
|
|
166
|
+
readonly Claims: "Identity.ClaimsComponent";
|
|
167
|
+
readonly Roles: "Identity.RolesComponent";
|
|
168
|
+
readonly Users: "Identity.UsersComponent";
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Type for identity component key values
|
|
172
|
+
*/
|
|
173
|
+
type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Identity Pro Route Names
|
|
177
|
+
* Translated from @volo/abp.ng.identity v2.7.0
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Enum-like const object for identity route names.
|
|
181
|
+
* Used for localization and navigation configuration.
|
|
182
|
+
* @since 2.7.0
|
|
183
|
+
*/
|
|
184
|
+
declare const eIdentityRouteNames: {
|
|
185
|
+
readonly Administration: "AbpUiNavigation::Menu:Administration";
|
|
186
|
+
readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
|
|
187
|
+
readonly Roles: "AbpIdentity::Roles";
|
|
188
|
+
readonly Users: "AbpIdentity::Users";
|
|
189
|
+
readonly ClaimTypes: "AbpIdentity::ClaimTypes";
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Type for identity route name values
|
|
193
|
+
*/
|
|
194
|
+
type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
|
|
195
|
+
|
|
147
196
|
/**
|
|
148
197
|
* Service for managing identity-related API operations.
|
|
149
198
|
* Handles roles, users, and claim types CRUD operations.
|
|
@@ -156,6 +205,11 @@ declare namespace Identity {
|
|
|
156
205
|
* @since 2.0.0
|
|
157
206
|
*/
|
|
158
207
|
declare class IdentityService {
|
|
208
|
+
/**
|
|
209
|
+
* The API name used for REST requests.
|
|
210
|
+
* @since 2.4.0
|
|
211
|
+
*/
|
|
212
|
+
apiName: string;
|
|
159
213
|
private rest;
|
|
160
214
|
constructor(rest: RestService);
|
|
161
215
|
/**
|
|
@@ -164,6 +218,12 @@ declare class IdentityService {
|
|
|
164
218
|
* @returns Promise with paginated role response
|
|
165
219
|
*/
|
|
166
220
|
getRoles(params?: ABP.PageQueryParams): Promise<Identity.RoleResponse>;
|
|
221
|
+
/**
|
|
222
|
+
* Get all roles without pagination
|
|
223
|
+
* @since 2.4.0
|
|
224
|
+
* @returns Promise with all roles response
|
|
225
|
+
*/
|
|
226
|
+
getAllRoles(): Promise<Identity.RoleResponse>;
|
|
167
227
|
/**
|
|
168
228
|
* Get a role by ID
|
|
169
229
|
* @param id - The role ID
|
|
@@ -207,6 +267,14 @@ declare class IdentityService {
|
|
|
207
267
|
* @returns Promise with the user's roles
|
|
208
268
|
*/
|
|
209
269
|
getUserRoles(id: string): Promise<Identity.RoleResponse>;
|
|
270
|
+
/**
|
|
271
|
+
* Change a user's password (admin action)
|
|
272
|
+
* @since 2.7.0
|
|
273
|
+
* @param id - The user ID
|
|
274
|
+
* @param body - The password change request (newPassword required)
|
|
275
|
+
* @returns Promise resolving when complete
|
|
276
|
+
*/
|
|
277
|
+
changePassword(id: string, body: Identity.ChangePasswordRequest): Promise<void>;
|
|
210
278
|
/**
|
|
211
279
|
* Delete a user
|
|
212
280
|
* @param id - The user ID to delete
|
|
@@ -1005,4 +1073,4 @@ declare const IDENTITY_POLICIES: {
|
|
|
1005
1073
|
readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
|
|
1006
1074
|
};
|
|
1007
1075
|
|
|
1008
|
-
export { ClaimModal, type ClaimModalProps, type ClaimOperationResult, ClaimsComponent, type ClaimsComponentProps, IDENTITY_POLICIES, IDENTITY_ROUTES, IDENTITY_ROUTE_PATHS, Identity, IdentityService, IdentityStateService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseClaimsReturn, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, useClaims, useIdentity, useRoles, useUsers };
|
|
1076
|
+
export { ClaimModal, type ClaimModalProps, type ClaimOperationResult, ClaimsComponent, type ClaimsComponentProps, IDENTITY_POLICIES, IDENTITY_ROUTES, IDENTITY_ROUTE_PATHS, Identity, type IdentityComponentKey, type IdentityRouteNameKey, IdentityService, IdentityStateService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseClaimsReturn, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, eIdentityComponents, eIdentityRouteNames, useClaims, useIdentity, useRoles, useUsers };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,14 @@ declare namespace Identity {
|
|
|
82
82
|
password: string;
|
|
83
83
|
roleNames: string[];
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Request payload for changing a user's password (admin action)
|
|
87
|
+
* @since 2.7.0
|
|
88
|
+
*/
|
|
89
|
+
interface ChangePasswordRequest {
|
|
90
|
+
/** The new password to set */
|
|
91
|
+
newPassword: string;
|
|
92
|
+
}
|
|
85
93
|
/**
|
|
86
94
|
* Simple claim type name for dropdowns
|
|
87
95
|
* Pro feature since 0.7.2
|
|
@@ -144,6 +152,47 @@ declare namespace Identity {
|
|
|
144
152
|
}
|
|
145
153
|
}
|
|
146
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Identity Pro Component Identifiers
|
|
157
|
+
* Translated from @volo/abp.ng.identity v2.7.0
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* Enum-like const object for identity component identifiers.
|
|
161
|
+
* Used for component registration and identification.
|
|
162
|
+
* @since 2.4.0
|
|
163
|
+
* @updated 2.7.0 - Changed from enum to const object
|
|
164
|
+
*/
|
|
165
|
+
declare const eIdentityComponents: {
|
|
166
|
+
readonly Claims: "Identity.ClaimsComponent";
|
|
167
|
+
readonly Roles: "Identity.RolesComponent";
|
|
168
|
+
readonly Users: "Identity.UsersComponent";
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Type for identity component key values
|
|
172
|
+
*/
|
|
173
|
+
type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Identity Pro Route Names
|
|
177
|
+
* Translated from @volo/abp.ng.identity v2.7.0
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Enum-like const object for identity route names.
|
|
181
|
+
* Used for localization and navigation configuration.
|
|
182
|
+
* @since 2.7.0
|
|
183
|
+
*/
|
|
184
|
+
declare const eIdentityRouteNames: {
|
|
185
|
+
readonly Administration: "AbpUiNavigation::Menu:Administration";
|
|
186
|
+
readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
|
|
187
|
+
readonly Roles: "AbpIdentity::Roles";
|
|
188
|
+
readonly Users: "AbpIdentity::Users";
|
|
189
|
+
readonly ClaimTypes: "AbpIdentity::ClaimTypes";
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Type for identity route name values
|
|
193
|
+
*/
|
|
194
|
+
type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
|
|
195
|
+
|
|
147
196
|
/**
|
|
148
197
|
* Service for managing identity-related API operations.
|
|
149
198
|
* Handles roles, users, and claim types CRUD operations.
|
|
@@ -156,6 +205,11 @@ declare namespace Identity {
|
|
|
156
205
|
* @since 2.0.0
|
|
157
206
|
*/
|
|
158
207
|
declare class IdentityService {
|
|
208
|
+
/**
|
|
209
|
+
* The API name used for REST requests.
|
|
210
|
+
* @since 2.4.0
|
|
211
|
+
*/
|
|
212
|
+
apiName: string;
|
|
159
213
|
private rest;
|
|
160
214
|
constructor(rest: RestService);
|
|
161
215
|
/**
|
|
@@ -164,6 +218,12 @@ declare class IdentityService {
|
|
|
164
218
|
* @returns Promise with paginated role response
|
|
165
219
|
*/
|
|
166
220
|
getRoles(params?: ABP.PageQueryParams): Promise<Identity.RoleResponse>;
|
|
221
|
+
/**
|
|
222
|
+
* Get all roles without pagination
|
|
223
|
+
* @since 2.4.0
|
|
224
|
+
* @returns Promise with all roles response
|
|
225
|
+
*/
|
|
226
|
+
getAllRoles(): Promise<Identity.RoleResponse>;
|
|
167
227
|
/**
|
|
168
228
|
* Get a role by ID
|
|
169
229
|
* @param id - The role ID
|
|
@@ -207,6 +267,14 @@ declare class IdentityService {
|
|
|
207
267
|
* @returns Promise with the user's roles
|
|
208
268
|
*/
|
|
209
269
|
getUserRoles(id: string): Promise<Identity.RoleResponse>;
|
|
270
|
+
/**
|
|
271
|
+
* Change a user's password (admin action)
|
|
272
|
+
* @since 2.7.0
|
|
273
|
+
* @param id - The user ID
|
|
274
|
+
* @param body - The password change request (newPassword required)
|
|
275
|
+
* @returns Promise resolving when complete
|
|
276
|
+
*/
|
|
277
|
+
changePassword(id: string, body: Identity.ChangePasswordRequest): Promise<void>;
|
|
210
278
|
/**
|
|
211
279
|
* Delete a user
|
|
212
280
|
* @param id - The user ID to delete
|
|
@@ -1005,4 +1073,4 @@ declare const IDENTITY_POLICIES: {
|
|
|
1005
1073
|
readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
|
|
1006
1074
|
};
|
|
1007
1075
|
|
|
1008
|
-
export { ClaimModal, type ClaimModalProps, type ClaimOperationResult, ClaimsComponent, type ClaimsComponentProps, IDENTITY_POLICIES, IDENTITY_ROUTES, IDENTITY_ROUTE_PATHS, Identity, IdentityService, IdentityStateService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseClaimsReturn, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, useClaims, useIdentity, useRoles, useUsers };
|
|
1076
|
+
export { ClaimModal, type ClaimModalProps, type ClaimOperationResult, ClaimsComponent, type ClaimsComponentProps, IDENTITY_POLICIES, IDENTITY_ROUTES, IDENTITY_ROUTE_PATHS, Identity, type IdentityComponentKey, type IdentityRouteNameKey, IdentityService, IdentityStateService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseClaimsReturn, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, eIdentityComponents, eIdentityRouteNames, useClaims, useIdentity, useRoles, useUsers };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,8 @@ __export(index_exports, {
|
|
|
30
30
|
IdentityStateService: () => IdentityStateService,
|
|
31
31
|
RolesComponent: () => RolesComponent,
|
|
32
32
|
UsersComponent: () => UsersComponent,
|
|
33
|
+
eIdentityComponents: () => eIdentityComponents,
|
|
34
|
+
eIdentityRouteNames: () => eIdentityRouteNames,
|
|
33
35
|
useClaims: () => useClaims,
|
|
34
36
|
useIdentity: () => useIdentity,
|
|
35
37
|
useRoles: () => useRoles,
|
|
@@ -49,9 +51,30 @@ var Identity;
|
|
|
49
51
|
})(ClaimValueType = Identity2.ClaimValueType || (Identity2.ClaimValueType = {}));
|
|
50
52
|
})(Identity || (Identity = {}));
|
|
51
53
|
|
|
54
|
+
// src/enums/components.ts
|
|
55
|
+
var eIdentityComponents = {
|
|
56
|
+
Claims: "Identity.ClaimsComponent",
|
|
57
|
+
Roles: "Identity.RolesComponent",
|
|
58
|
+
Users: "Identity.UsersComponent"
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/enums/route-names.ts
|
|
62
|
+
var eIdentityRouteNames = {
|
|
63
|
+
Administration: "AbpUiNavigation::Menu:Administration",
|
|
64
|
+
IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
|
|
65
|
+
Roles: "AbpIdentity::Roles",
|
|
66
|
+
Users: "AbpIdentity::Users",
|
|
67
|
+
ClaimTypes: "AbpIdentity::ClaimTypes"
|
|
68
|
+
};
|
|
69
|
+
|
|
52
70
|
// src/services/identity.service.ts
|
|
53
71
|
var IdentityService = class {
|
|
54
72
|
constructor(rest) {
|
|
73
|
+
/**
|
|
74
|
+
* The API name used for REST requests.
|
|
75
|
+
* @since 2.4.0
|
|
76
|
+
*/
|
|
77
|
+
this.apiName = "default";
|
|
55
78
|
this.rest = rest;
|
|
56
79
|
}
|
|
57
80
|
// ========================
|
|
@@ -69,6 +92,17 @@ var IdentityService = class {
|
|
|
69
92
|
params
|
|
70
93
|
});
|
|
71
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Get all roles without pagination
|
|
97
|
+
* @since 2.4.0
|
|
98
|
+
* @returns Promise with all roles response
|
|
99
|
+
*/
|
|
100
|
+
getAllRoles() {
|
|
101
|
+
return this.rest.request({
|
|
102
|
+
method: "GET",
|
|
103
|
+
url: "/api/identity/roles/all"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
72
106
|
/**
|
|
73
107
|
* Get a role by ID
|
|
74
108
|
* @param id - The role ID
|
|
@@ -153,6 +187,20 @@ var IdentityService = class {
|
|
|
153
187
|
url: `/api/identity/users/${id}/roles`
|
|
154
188
|
});
|
|
155
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Change a user's password (admin action)
|
|
192
|
+
* @since 2.7.0
|
|
193
|
+
* @param id - The user ID
|
|
194
|
+
* @param body - The password change request (newPassword required)
|
|
195
|
+
* @returns Promise resolving when complete
|
|
196
|
+
*/
|
|
197
|
+
changePassword(id, body) {
|
|
198
|
+
return this.rest.request({
|
|
199
|
+
method: "PUT",
|
|
200
|
+
url: `/api/identity/users/${id}/change-password`,
|
|
201
|
+
body
|
|
202
|
+
});
|
|
203
|
+
}
|
|
156
204
|
/**
|
|
157
205
|
* Delete a user
|
|
158
206
|
* @param id - The user ID to delete
|
|
@@ -2222,6 +2270,8 @@ var IDENTITY_POLICIES = {
|
|
|
2222
2270
|
IdentityStateService,
|
|
2223
2271
|
RolesComponent,
|
|
2224
2272
|
UsersComponent,
|
|
2273
|
+
eIdentityComponents,
|
|
2274
|
+
eIdentityRouteNames,
|
|
2225
2275
|
useClaims,
|
|
2226
2276
|
useIdentity,
|
|
2227
2277
|
useRoles,
|
package/dist/index.mjs
CHANGED
|
@@ -10,9 +10,30 @@ var Identity;
|
|
|
10
10
|
})(ClaimValueType = Identity2.ClaimValueType || (Identity2.ClaimValueType = {}));
|
|
11
11
|
})(Identity || (Identity = {}));
|
|
12
12
|
|
|
13
|
+
// src/enums/components.ts
|
|
14
|
+
var eIdentityComponents = {
|
|
15
|
+
Claims: "Identity.ClaimsComponent",
|
|
16
|
+
Roles: "Identity.RolesComponent",
|
|
17
|
+
Users: "Identity.UsersComponent"
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/enums/route-names.ts
|
|
21
|
+
var eIdentityRouteNames = {
|
|
22
|
+
Administration: "AbpUiNavigation::Menu:Administration",
|
|
23
|
+
IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
|
|
24
|
+
Roles: "AbpIdentity::Roles",
|
|
25
|
+
Users: "AbpIdentity::Users",
|
|
26
|
+
ClaimTypes: "AbpIdentity::ClaimTypes"
|
|
27
|
+
};
|
|
28
|
+
|
|
13
29
|
// src/services/identity.service.ts
|
|
14
30
|
var IdentityService = class {
|
|
15
31
|
constructor(rest) {
|
|
32
|
+
/**
|
|
33
|
+
* The API name used for REST requests.
|
|
34
|
+
* @since 2.4.0
|
|
35
|
+
*/
|
|
36
|
+
this.apiName = "default";
|
|
16
37
|
this.rest = rest;
|
|
17
38
|
}
|
|
18
39
|
// ========================
|
|
@@ -30,6 +51,17 @@ var IdentityService = class {
|
|
|
30
51
|
params
|
|
31
52
|
});
|
|
32
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Get all roles without pagination
|
|
56
|
+
* @since 2.4.0
|
|
57
|
+
* @returns Promise with all roles response
|
|
58
|
+
*/
|
|
59
|
+
getAllRoles() {
|
|
60
|
+
return this.rest.request({
|
|
61
|
+
method: "GET",
|
|
62
|
+
url: "/api/identity/roles/all"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
33
65
|
/**
|
|
34
66
|
* Get a role by ID
|
|
35
67
|
* @param id - The role ID
|
|
@@ -114,6 +146,20 @@ var IdentityService = class {
|
|
|
114
146
|
url: `/api/identity/users/${id}/roles`
|
|
115
147
|
});
|
|
116
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Change a user's password (admin action)
|
|
151
|
+
* @since 2.7.0
|
|
152
|
+
* @param id - The user ID
|
|
153
|
+
* @param body - The password change request (newPassword required)
|
|
154
|
+
* @returns Promise resolving when complete
|
|
155
|
+
*/
|
|
156
|
+
changePassword(id, body) {
|
|
157
|
+
return this.rest.request({
|
|
158
|
+
method: "PUT",
|
|
159
|
+
url: `/api/identity/users/${id}/change-password`,
|
|
160
|
+
body
|
|
161
|
+
});
|
|
162
|
+
}
|
|
117
163
|
/**
|
|
118
164
|
* Delete a user
|
|
119
165
|
* @param id - The user ID to delete
|
|
@@ -2220,6 +2266,8 @@ export {
|
|
|
2220
2266
|
IdentityStateService,
|
|
2221
2267
|
RolesComponent,
|
|
2222
2268
|
UsersComponent,
|
|
2269
|
+
eIdentityComponents,
|
|
2270
|
+
eIdentityRouteNames,
|
|
2223
2271
|
useClaims,
|
|
2224
2272
|
useIdentity,
|
|
2225
2273
|
useRoles,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/identity-pro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "ABP Framework identity pro components for React - translated from @volo/abp.ng.identity",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@chakra-ui/react": "^3.2.0",
|
|
28
28
|
"@emotion/react": "^11.11.0",
|
|
29
29
|
"react-icons": "^5.3.0",
|
|
30
|
-
"@abpjs/theme-shared": "2.
|
|
31
|
-
"@abpjs/core": "2.
|
|
32
|
-
"@abpjs/permission-management": "2.
|
|
30
|
+
"@abpjs/theme-shared": "2.7.0",
|
|
31
|
+
"@abpjs/core": "2.7.0",
|
|
32
|
+
"@abpjs/permission-management": "2.7.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@volo/abp.ng.identity": "2.
|
|
35
|
+
"@volo/abp.ng.identity": "2.7.0",
|
|
36
36
|
"@testing-library/jest-dom": "^6.9.1",
|
|
37
37
|
"@testing-library/react": "^14.0.0",
|
|
38
38
|
"@testing-library/user-event": "^14.6.1",
|