@abpjs/identity 3.1.0 → 4.0.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 +402 -166
- package/dist/index.d.ts +402 -166
- package/dist/index.js +358 -217
- package/dist/index.mjs +354 -216
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RoutesService,
|
|
1
|
+
import { RoutesService, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleObject, PagedAndSortedResultRequestDto, PagedResultDto, RestService, ListResultDto } from '@abpjs/core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -67,17 +67,17 @@ type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityR
|
|
|
67
67
|
* Configures the identity module routes.
|
|
68
68
|
* Returns a function that adds the routes to the RoutesService.
|
|
69
69
|
*
|
|
70
|
-
* @param
|
|
70
|
+
* @param routesService - The RoutesService instance to add routes to
|
|
71
71
|
* @returns A function that adds the identity routes when called
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```typescript
|
|
75
75
|
* const routes = getRoutesService();
|
|
76
|
-
* const addRoutes = configureRoutes(
|
|
76
|
+
* const addRoutes = configureRoutes(routesService);
|
|
77
77
|
* addRoutes();
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
declare function configureRoutes(
|
|
80
|
+
declare function configureRoutes(routesService: RoutesService): () => void;
|
|
81
81
|
/**
|
|
82
82
|
* Identity route providers configuration object.
|
|
83
83
|
* Use this to configure identity routes in your application.
|
|
@@ -86,7 +86,7 @@ declare function configureRoutes(routes: RoutesService): () => void;
|
|
|
86
86
|
* ```typescript
|
|
87
87
|
* // In your app initialization:
|
|
88
88
|
* const routes = getRoutesService();
|
|
89
|
-
* const addRoutes = IDENTITY_ROUTE_PROVIDERS.configureRoutes(
|
|
89
|
+
* const addRoutes = IDENTITY_ROUTE_PROVIDERS.configureRoutes(routesService);
|
|
90
90
|
* addRoutes();
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
@@ -127,84 +127,185 @@ declare const eIdentityComponents: {
|
|
|
127
127
|
*/
|
|
128
128
|
type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Identity Proxy Models
|
|
132
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
133
|
+
*
|
|
134
|
+
* These are the new typed DTOs for identity API operations.
|
|
135
|
+
* @since 3.2.0
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* Input for changing password
|
|
139
|
+
* @since 3.2.0
|
|
140
|
+
*/
|
|
141
|
+
interface ChangePasswordInput {
|
|
142
|
+
currentPassword: string;
|
|
143
|
+
newPassword: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Profile DTO returned from API
|
|
147
|
+
* @since 3.2.0
|
|
148
|
+
*/
|
|
149
|
+
interface ProfileDto extends ExtensibleObject {
|
|
150
|
+
userName: string;
|
|
151
|
+
email: string;
|
|
152
|
+
name: string;
|
|
153
|
+
surname: string;
|
|
154
|
+
phoneNumber: string;
|
|
155
|
+
isExternal: boolean;
|
|
156
|
+
hasPassword: boolean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Input for updating profile
|
|
160
|
+
* @since 3.2.0
|
|
161
|
+
*/
|
|
162
|
+
interface UpdateProfileDto extends ExtensibleObject {
|
|
163
|
+
userName: string;
|
|
164
|
+
email: string;
|
|
165
|
+
name: string;
|
|
166
|
+
surname: string;
|
|
167
|
+
phoneNumber: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Base DTO for role create/update operations
|
|
171
|
+
* @since 3.2.0
|
|
172
|
+
*/
|
|
173
|
+
interface IdentityRoleCreateOrUpdateDtoBase extends ExtensibleObject {
|
|
174
|
+
name: string;
|
|
175
|
+
isDefault: boolean;
|
|
176
|
+
isPublic: boolean;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* DTO for creating a role
|
|
180
|
+
* @since 3.2.0
|
|
181
|
+
*/
|
|
182
|
+
type IdentityRoleCreateDto = IdentityRoleCreateOrUpdateDtoBase;
|
|
183
|
+
/**
|
|
184
|
+
* DTO for updating a role
|
|
185
|
+
* @since 3.2.0
|
|
186
|
+
*/
|
|
187
|
+
interface IdentityRoleUpdateDto extends IdentityRoleCreateOrUpdateDtoBase {
|
|
188
|
+
concurrencyStamp: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Role DTO returned from API
|
|
192
|
+
* @since 3.2.0
|
|
193
|
+
*/
|
|
194
|
+
interface IdentityRoleDto extends ExtensibleEntityDto<string> {
|
|
195
|
+
name: string;
|
|
196
|
+
isDefault: boolean;
|
|
197
|
+
isStatic: boolean;
|
|
198
|
+
isPublic: boolean;
|
|
199
|
+
concurrencyStamp: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Input for getting users with pagination and filtering
|
|
203
|
+
* @since 3.2.0
|
|
204
|
+
*/
|
|
205
|
+
interface GetIdentityUsersInput extends PagedAndSortedResultRequestDto {
|
|
206
|
+
filter: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Base DTO for user create/update operations
|
|
210
|
+
* @since 3.2.0
|
|
211
|
+
*/
|
|
212
|
+
interface IdentityUserCreateOrUpdateDtoBase extends ExtensibleObject {
|
|
213
|
+
userName: string;
|
|
214
|
+
name: string;
|
|
215
|
+
surname: string;
|
|
216
|
+
email: string;
|
|
217
|
+
phoneNumber: string;
|
|
218
|
+
lockoutEnabled: boolean;
|
|
219
|
+
roleNames: string[];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* DTO for creating a user
|
|
223
|
+
* @since 3.2.0
|
|
224
|
+
*/
|
|
225
|
+
interface IdentityUserCreateDto extends IdentityUserCreateOrUpdateDtoBase {
|
|
226
|
+
password: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* DTO for updating a user
|
|
230
|
+
* @since 3.2.0
|
|
231
|
+
*/
|
|
232
|
+
interface IdentityUserUpdateDto extends IdentityUserCreateOrUpdateDtoBase {
|
|
233
|
+
password: string;
|
|
234
|
+
concurrencyStamp: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* DTO for updating user roles
|
|
238
|
+
* @since 3.2.0
|
|
239
|
+
*/
|
|
240
|
+
interface IdentityUserUpdateRolesDto {
|
|
241
|
+
roleNames: string[];
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* User DTO returned from API
|
|
245
|
+
* @since 3.2.0
|
|
246
|
+
*/
|
|
247
|
+
interface IdentityUserDto extends ExtensibleFullAuditedEntityDto<string> {
|
|
248
|
+
tenantId?: string;
|
|
249
|
+
userName: string;
|
|
250
|
+
name: string;
|
|
251
|
+
surname: string;
|
|
252
|
+
email: string;
|
|
253
|
+
emailConfirmed: boolean;
|
|
254
|
+
phoneNumber: string;
|
|
255
|
+
phoneNumberConfirmed: boolean;
|
|
256
|
+
lockoutEnabled: boolean;
|
|
257
|
+
lockoutEnd?: string;
|
|
258
|
+
concurrencyStamp: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Input for counting users in lookup
|
|
262
|
+
* @since 3.2.0
|
|
263
|
+
*/
|
|
264
|
+
interface UserLookupCountInputDto {
|
|
265
|
+
filter: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Input for searching users in lookup
|
|
269
|
+
* @since 3.2.0
|
|
270
|
+
*/
|
|
271
|
+
interface UserLookupSearchInputDto extends PagedAndSortedResultRequestDto {
|
|
272
|
+
filter: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
130
275
|
/**
|
|
131
276
|
* Identity namespace containing all types related to identity management.
|
|
132
277
|
* Translated from @abp/ng.identity Identity namespace.
|
|
278
|
+
*
|
|
279
|
+
* Changes in v4.0.0:
|
|
280
|
+
* - Removed deprecated legacy types (RoleResponse, RoleSaveRequest, RoleItem,
|
|
281
|
+
* UserResponse, User, UserItem, UserSaveRequest)
|
|
282
|
+
* - Component interface types now use IdentityRoleDto/IdentityUserDto
|
|
283
|
+
*
|
|
284
|
+
* Changes in v3.2.0:
|
|
285
|
+
* - State now uses PagedResultDto and new proxy DTOs (IdentityRoleDto, IdentityUserDto)
|
|
133
286
|
*/
|
|
134
287
|
declare namespace Identity {
|
|
135
288
|
/**
|
|
136
289
|
* Identity state shape for state management
|
|
290
|
+
* @updated 3.2.0 - Now uses PagedResultDto and new proxy DTOs
|
|
137
291
|
*/
|
|
138
292
|
interface State {
|
|
139
|
-
roles:
|
|
140
|
-
users:
|
|
141
|
-
selectedRole:
|
|
142
|
-
selectedUser:
|
|
143
|
-
selectedUserRoles:
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Paginated response for roles
|
|
147
|
-
*/
|
|
148
|
-
type RoleResponse = ABP.PagedResponse<RoleItem>;
|
|
149
|
-
/**
|
|
150
|
-
* Request payload for creating/updating a role
|
|
151
|
-
*/
|
|
152
|
-
interface RoleSaveRequest {
|
|
153
|
-
name: string;
|
|
154
|
-
isDefault: boolean;
|
|
155
|
-
isPublic: boolean;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Role item returned from the API
|
|
159
|
-
*/
|
|
160
|
-
interface RoleItem extends RoleSaveRequest {
|
|
161
|
-
isStatic: boolean;
|
|
162
|
-
concurrencyStamp: string;
|
|
163
|
-
id: string;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Paginated response for users
|
|
167
|
-
*/
|
|
168
|
-
type UserResponse = ABP.PagedResponse<UserItem>;
|
|
169
|
-
/**
|
|
170
|
-
* Base user properties
|
|
171
|
-
*/
|
|
172
|
-
interface User {
|
|
173
|
-
userName: string;
|
|
174
|
-
name: string;
|
|
175
|
-
surname: string;
|
|
176
|
-
email: string;
|
|
177
|
-
phoneNumber: string;
|
|
178
|
-
twoFactorEnabled: boolean;
|
|
179
|
-
lockoutEnabled: boolean;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* User item returned from the API
|
|
183
|
-
*/
|
|
184
|
-
interface UserItem extends User {
|
|
185
|
-
tenantId: string;
|
|
186
|
-
emailConfirmed: boolean;
|
|
187
|
-
phoneNumberConfirmed: boolean;
|
|
188
|
-
isLockedOut: boolean;
|
|
189
|
-
concurrencyStamp: string;
|
|
190
|
-
id: string;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Request payload for creating/updating a user
|
|
194
|
-
*/
|
|
195
|
-
interface UserSaveRequest extends User {
|
|
196
|
-
password: string;
|
|
197
|
-
roleNames: string[];
|
|
293
|
+
roles: PagedResultDto<IdentityRoleDto>;
|
|
294
|
+
users: PagedResultDto<IdentityUserDto>;
|
|
295
|
+
selectedRole: IdentityRoleDto;
|
|
296
|
+
selectedUser: IdentityUserDto;
|
|
297
|
+
selectedUserRoles: IdentityRoleDto[];
|
|
198
298
|
}
|
|
199
299
|
/**
|
|
200
300
|
* Input props for RolesComponent
|
|
201
301
|
* @since 2.0.0
|
|
302
|
+
* @updated 4.0.0 - Callbacks now use IdentityRoleDto instead of RoleItem
|
|
202
303
|
*/
|
|
203
304
|
interface RolesComponentInputs {
|
|
204
305
|
/** Callback when a role is created */
|
|
205
|
-
readonly onRoleCreated?: (role:
|
|
306
|
+
readonly onRoleCreated?: (role: IdentityRoleDto) => void;
|
|
206
307
|
/** Callback when a role is updated */
|
|
207
|
-
readonly onRoleUpdated?: (role:
|
|
308
|
+
readonly onRoleUpdated?: (role: IdentityRoleDto) => void;
|
|
208
309
|
/** Callback when a role is deleted */
|
|
209
310
|
readonly onRoleDeleted?: (id: string) => void;
|
|
210
311
|
}
|
|
@@ -219,12 +320,13 @@ declare namespace Identity {
|
|
|
219
320
|
/**
|
|
220
321
|
* Input props for UsersComponent
|
|
221
322
|
* @since 2.0.0
|
|
323
|
+
* @updated 4.0.0 - Callbacks now use IdentityUserDto instead of UserItem
|
|
222
324
|
*/
|
|
223
325
|
interface UsersComponentInputs {
|
|
224
326
|
/** Callback when a user is created */
|
|
225
|
-
readonly onUserCreated?: (user:
|
|
327
|
+
readonly onUserCreated?: (user: IdentityUserDto) => void;
|
|
226
328
|
/** Callback when a user is updated */
|
|
227
|
-
readonly onUserUpdated?: (user:
|
|
329
|
+
readonly onUserUpdated?: (user: IdentityUserDto) => void;
|
|
228
330
|
/** Callback when a user is deleted */
|
|
229
331
|
readonly onUserDeleted?: (id: string) => void;
|
|
230
332
|
/** Password validation rules to display */
|
|
@@ -243,109 +345,228 @@ declare namespace Identity {
|
|
|
243
345
|
}
|
|
244
346
|
|
|
245
347
|
/**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* Translated from @abp/ng.identity IdentityService v3.0.0
|
|
348
|
+
* Identity Role proxy service for role management API calls
|
|
349
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
250
350
|
*
|
|
251
|
-
* @since 3.
|
|
351
|
+
* @since 3.2.0
|
|
252
352
|
*/
|
|
253
|
-
declare class
|
|
254
|
-
private
|
|
353
|
+
declare class IdentityRoleService {
|
|
354
|
+
private restService;
|
|
255
355
|
/**
|
|
256
356
|
* The API name used for REST requests.
|
|
257
|
-
* @since 2.4.0
|
|
258
357
|
*/
|
|
259
358
|
apiName: string;
|
|
260
|
-
constructor(
|
|
359
|
+
constructor(restService: RestService);
|
|
261
360
|
/**
|
|
262
|
-
*
|
|
263
|
-
* @param
|
|
264
|
-
* @returns Promise with
|
|
361
|
+
* Create a new role
|
|
362
|
+
* @param input - The role data to create
|
|
363
|
+
* @returns Promise with the created role
|
|
265
364
|
*/
|
|
266
|
-
|
|
365
|
+
create: (input: IdentityRoleCreateDto) => Promise<IdentityRoleDto>;
|
|
267
366
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* @
|
|
271
|
-
* @returns Promise with all roles
|
|
367
|
+
* Delete a role by ID
|
|
368
|
+
* @param id - The role ID to delete
|
|
369
|
+
* @returns Promise that resolves when deletion is complete
|
|
272
370
|
*/
|
|
273
|
-
|
|
371
|
+
delete: (id: string) => Promise<void>;
|
|
274
372
|
/**
|
|
275
373
|
* Get a role by ID
|
|
276
374
|
* @param id - The role ID
|
|
277
|
-
* @returns Promise with the role
|
|
375
|
+
* @returns Promise with the role
|
|
278
376
|
*/
|
|
279
|
-
|
|
377
|
+
get: (id: string) => Promise<IdentityRoleDto>;
|
|
280
378
|
/**
|
|
281
|
-
*
|
|
282
|
-
* @
|
|
283
|
-
* @returns Promise with the deleted role
|
|
379
|
+
* Get all roles without pagination
|
|
380
|
+
* @returns Promise with all roles
|
|
284
381
|
*/
|
|
285
|
-
|
|
382
|
+
getAllList: () => Promise<ListResultDto<IdentityRoleDto>>;
|
|
286
383
|
/**
|
|
287
|
-
*
|
|
288
|
-
* @param
|
|
289
|
-
* @returns Promise with
|
|
384
|
+
* Get roles with pagination
|
|
385
|
+
* @param input - Pagination and sorting parameters
|
|
386
|
+
* @returns Promise with paginated roles
|
|
290
387
|
*/
|
|
291
|
-
|
|
388
|
+
getList: (input: PagedAndSortedResultRequestDto) => Promise<PagedResultDto<IdentityRoleDto>>;
|
|
292
389
|
/**
|
|
293
|
-
* Update
|
|
390
|
+
* Update a role
|
|
294
391
|
* @param id - The role ID to update
|
|
295
|
-
* @param
|
|
392
|
+
* @param input - The updated role data
|
|
296
393
|
* @returns Promise with the updated role
|
|
297
394
|
*/
|
|
298
|
-
|
|
395
|
+
update: (id: string, input: IdentityRoleUpdateDto) => Promise<IdentityRoleDto>;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* User data models for user lookup
|
|
400
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
401
|
+
* @since 3.2.0
|
|
402
|
+
*/
|
|
403
|
+
/**
|
|
404
|
+
* User data returned from user lookup service
|
|
405
|
+
* @since 3.2.0
|
|
406
|
+
*/
|
|
407
|
+
interface UserData {
|
|
408
|
+
id: string;
|
|
409
|
+
tenantId?: string;
|
|
410
|
+
userName: string;
|
|
411
|
+
name: string;
|
|
412
|
+
surname: string;
|
|
413
|
+
email: string;
|
|
414
|
+
emailConfirmed: boolean;
|
|
415
|
+
phoneNumber: string;
|
|
416
|
+
phoneNumberConfirmed: boolean;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Identity User Lookup proxy service for user lookup API calls
|
|
421
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
422
|
+
*
|
|
423
|
+
* @since 3.2.0
|
|
424
|
+
*/
|
|
425
|
+
declare class IdentityUserLookupService {
|
|
426
|
+
private restService;
|
|
299
427
|
/**
|
|
300
|
-
*
|
|
301
|
-
* @param params - Query parameters for pagination and filtering
|
|
302
|
-
* @returns Promise with paginated user response
|
|
428
|
+
* The API name used for REST requests.
|
|
303
429
|
*/
|
|
304
|
-
|
|
430
|
+
apiName: string;
|
|
431
|
+
constructor(restService: RestService);
|
|
305
432
|
/**
|
|
306
|
-
*
|
|
433
|
+
* Find a user by ID
|
|
307
434
|
* @param id - The user ID
|
|
308
|
-
* @returns Promise with the user
|
|
435
|
+
* @returns Promise with the user data
|
|
309
436
|
*/
|
|
310
|
-
|
|
437
|
+
findById: (id: string) => Promise<UserData>;
|
|
311
438
|
/**
|
|
312
|
-
*
|
|
313
|
-
* @param
|
|
314
|
-
* @returns Promise with the user
|
|
439
|
+
* Find a user by username
|
|
440
|
+
* @param userName - The username to search for
|
|
441
|
+
* @returns Promise with the user data
|
|
315
442
|
*/
|
|
316
|
-
|
|
443
|
+
findByUserName: (userName: string) => Promise<UserData>;
|
|
317
444
|
/**
|
|
318
|
-
* Get
|
|
319
|
-
*
|
|
320
|
-
* @
|
|
321
|
-
* @returns Promise with assignable roles
|
|
445
|
+
* Get count of users matching filter
|
|
446
|
+
* @param input - Filter parameters
|
|
447
|
+
* @returns Promise with the count
|
|
322
448
|
*/
|
|
323
|
-
|
|
449
|
+
getCount: (input: UserLookupCountInputDto) => Promise<number>;
|
|
324
450
|
/**
|
|
325
|
-
*
|
|
326
|
-
* @param
|
|
327
|
-
* @returns Promise
|
|
451
|
+
* Search for users
|
|
452
|
+
* @param input - Search and pagination parameters
|
|
453
|
+
* @returns Promise with matching users
|
|
328
454
|
*/
|
|
329
|
-
|
|
455
|
+
search: (input: UserLookupSearchInputDto) => Promise<ListResultDto<UserData>>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Identity User proxy service for user management API calls
|
|
460
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
461
|
+
*
|
|
462
|
+
* @since 3.2.0
|
|
463
|
+
*/
|
|
464
|
+
declare class IdentityUserService {
|
|
465
|
+
private restService;
|
|
466
|
+
/**
|
|
467
|
+
* The API name used for REST requests.
|
|
468
|
+
*/
|
|
469
|
+
apiName: string;
|
|
470
|
+
constructor(restService: RestService);
|
|
330
471
|
/**
|
|
331
472
|
* Create a new user
|
|
332
|
-
* @param
|
|
473
|
+
* @param input - The user data to create
|
|
333
474
|
* @returns Promise with the created user
|
|
334
475
|
*/
|
|
335
|
-
|
|
476
|
+
create: (input: IdentityUserCreateDto) => Promise<IdentityUserDto>;
|
|
477
|
+
/**
|
|
478
|
+
* Delete a user by ID
|
|
479
|
+
* @param id - The user ID to delete
|
|
480
|
+
* @returns Promise that resolves when deletion is complete
|
|
481
|
+
*/
|
|
482
|
+
delete: (id: string) => Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* Find a user by email
|
|
485
|
+
* @param email - The user's email
|
|
486
|
+
* @returns Promise with the user
|
|
487
|
+
*/
|
|
488
|
+
findByEmail: (email: string) => Promise<IdentityUserDto>;
|
|
489
|
+
/**
|
|
490
|
+
* Find a user by username
|
|
491
|
+
* @param username - The user's username
|
|
492
|
+
* @returns Promise with the user
|
|
493
|
+
*/
|
|
494
|
+
findByUsername: (username: string) => Promise<IdentityUserDto>;
|
|
495
|
+
/**
|
|
496
|
+
* Get a user by ID
|
|
497
|
+
* @param id - The user ID
|
|
498
|
+
* @returns Promise with the user
|
|
499
|
+
*/
|
|
500
|
+
get: (id: string) => Promise<IdentityUserDto>;
|
|
501
|
+
/**
|
|
502
|
+
* Get all roles that can be assigned to users
|
|
503
|
+
* @returns Promise with assignable roles
|
|
504
|
+
*/
|
|
505
|
+
getAssignableRoles: () => Promise<ListResultDto<IdentityRoleDto>>;
|
|
506
|
+
/**
|
|
507
|
+
* Get users with pagination and filtering
|
|
508
|
+
* @param input - Pagination, sorting, and filter parameters
|
|
509
|
+
* @returns Promise with paginated users
|
|
510
|
+
*/
|
|
511
|
+
getList: (input: GetIdentityUsersInput) => Promise<PagedResultDto<IdentityUserDto>>;
|
|
512
|
+
/**
|
|
513
|
+
* Get roles assigned to a user
|
|
514
|
+
* @param id - The user ID
|
|
515
|
+
* @returns Promise with the user's roles
|
|
516
|
+
*/
|
|
517
|
+
getRoles: (id: string) => Promise<ListResultDto<IdentityRoleDto>>;
|
|
336
518
|
/**
|
|
337
|
-
* Update
|
|
519
|
+
* Update a user
|
|
338
520
|
* @param id - The user ID to update
|
|
339
|
-
* @param
|
|
521
|
+
* @param input - The updated user data
|
|
340
522
|
* @returns Promise with the updated user
|
|
341
523
|
*/
|
|
342
|
-
|
|
524
|
+
update: (id: string, input: IdentityUserUpdateDto) => Promise<IdentityUserDto>;
|
|
525
|
+
/**
|
|
526
|
+
* Update a user's roles
|
|
527
|
+
* @param id - The user ID
|
|
528
|
+
* @param input - The new role assignments
|
|
529
|
+
* @returns Promise that resolves when update is complete
|
|
530
|
+
*/
|
|
531
|
+
updateRoles: (id: string, input: IdentityUserUpdateRolesDto) => Promise<void>;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Profile proxy service for profile management API calls
|
|
536
|
+
* Translated from @abp/ng.identity v3.2.0
|
|
537
|
+
*
|
|
538
|
+
* @since 3.2.0
|
|
539
|
+
*/
|
|
540
|
+
declare class ProfileService {
|
|
541
|
+
private restService;
|
|
542
|
+
/**
|
|
543
|
+
* The API name used for REST requests.
|
|
544
|
+
*/
|
|
545
|
+
apiName: string;
|
|
546
|
+
constructor(restService: RestService);
|
|
547
|
+
/**
|
|
548
|
+
* Change the current user's password
|
|
549
|
+
* @param input - Current and new password
|
|
550
|
+
* @returns Promise that resolves when password is changed
|
|
551
|
+
*/
|
|
552
|
+
changePassword: (input: ChangePasswordInput) => Promise<void>;
|
|
553
|
+
/**
|
|
554
|
+
* Get the current user's profile
|
|
555
|
+
* @returns Promise with the profile data
|
|
556
|
+
*/
|
|
557
|
+
get: () => Promise<ProfileDto>;
|
|
558
|
+
/**
|
|
559
|
+
* Update the current user's profile
|
|
560
|
+
* @param input - Updated profile data
|
|
561
|
+
* @returns Promise with the updated profile
|
|
562
|
+
*/
|
|
563
|
+
update: (input: UpdateProfileDto) => Promise<ProfileDto>;
|
|
343
564
|
}
|
|
344
565
|
|
|
345
566
|
/**
|
|
346
567
|
* IdentityStateService - A stateful service facade for identity operations.
|
|
347
568
|
*
|
|
348
|
-
* This service provides a stateful wrapper around
|
|
569
|
+
* This service provides a stateful wrapper around the proxy services, maintaining
|
|
349
570
|
* local state for roles and users. It's the React equivalent of Angular's
|
|
350
571
|
* IdentityStateService which wraps NGXS store operations.
|
|
351
572
|
*
|
|
@@ -353,15 +574,17 @@ declare class IdentityService {
|
|
|
353
574
|
* instead of this class. This class is provided for programmatic/non-hook scenarios.
|
|
354
575
|
*
|
|
355
576
|
* @since 2.0.0
|
|
577
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityRoleService/IdentityUserService
|
|
356
578
|
*
|
|
357
579
|
* @example
|
|
358
580
|
* ```typescript
|
|
359
|
-
* import { IdentityStateService,
|
|
581
|
+
* import { IdentityStateService, IdentityRoleService, IdentityUserService } from '@abpjs/identity';
|
|
360
582
|
* import { RestService } from '@abpjs/core';
|
|
361
583
|
*
|
|
362
584
|
* const rest = new RestService();
|
|
363
|
-
* const
|
|
364
|
-
* const
|
|
585
|
+
* const roleService = new IdentityRoleService(rest);
|
|
586
|
+
* const userService = new IdentityUserService(rest);
|
|
587
|
+
* const stateService = new IdentityStateService(roleService, userService);
|
|
365
588
|
*
|
|
366
589
|
* // Fetch and get roles
|
|
367
590
|
* await stateService.dispatchGetRoles();
|
|
@@ -369,66 +592,69 @@ declare class IdentityService {
|
|
|
369
592
|
* ```
|
|
370
593
|
*/
|
|
371
594
|
declare class IdentityStateService {
|
|
372
|
-
private
|
|
595
|
+
private identityRoleService;
|
|
596
|
+
private identityUserService;
|
|
373
597
|
private roles;
|
|
374
598
|
private rolesTotalCount;
|
|
375
599
|
private users;
|
|
376
600
|
private usersTotalCount;
|
|
377
|
-
constructor(
|
|
601
|
+
constructor(identityRoleService: IdentityRoleService, identityUserService: IdentityUserService);
|
|
378
602
|
/**
|
|
379
603
|
* Get the current roles from state
|
|
604
|
+
* @updated 4.0.0 - Returns IdentityRoleDto[] instead of Identity.RoleItem[]
|
|
380
605
|
*/
|
|
381
|
-
getRoles():
|
|
606
|
+
getRoles(): IdentityRoleDto[];
|
|
382
607
|
/**
|
|
383
608
|
* Get the total count of roles
|
|
384
609
|
*/
|
|
385
610
|
getRolesTotalCount(): number;
|
|
386
611
|
/**
|
|
387
612
|
* Get the current users from state
|
|
613
|
+
* @updated 4.0.0 - Returns IdentityUserDto[] instead of Identity.UserItem[]
|
|
388
614
|
*/
|
|
389
|
-
getUsers():
|
|
615
|
+
getUsers(): IdentityUserDto[];
|
|
390
616
|
/**
|
|
391
617
|
* Get the total count of users
|
|
392
618
|
*/
|
|
393
619
|
getUsersTotalCount(): number;
|
|
394
620
|
/**
|
|
395
621
|
* Fetch roles and update internal state
|
|
396
|
-
* @param params - Optional
|
|
622
|
+
* @param params - Optional pagination/sorting parameters
|
|
397
623
|
*/
|
|
398
|
-
dispatchGetRoles(params?:
|
|
624
|
+
dispatchGetRoles(params?: PagedAndSortedResultRequestDto): Promise<PagedResultDto<IdentityRoleDto>>;
|
|
399
625
|
/**
|
|
400
626
|
* Fetch a role by ID
|
|
401
627
|
* @param id - The role ID
|
|
402
628
|
*/
|
|
403
|
-
dispatchGetRoleById(id: string): Promise<
|
|
629
|
+
dispatchGetRoleById(id: string): Promise<IdentityRoleDto>;
|
|
404
630
|
/**
|
|
405
631
|
* Delete a role and refresh the list
|
|
406
632
|
* @param id - The role ID to delete
|
|
407
633
|
*/
|
|
408
|
-
dispatchDeleteRole(id: string): Promise<
|
|
634
|
+
dispatchDeleteRole(id: string): Promise<void>;
|
|
409
635
|
/**
|
|
410
636
|
* Create a new role and refresh the list
|
|
411
637
|
* @param body - The role data to create
|
|
412
638
|
*/
|
|
413
|
-
dispatchCreateRole(body:
|
|
639
|
+
dispatchCreateRole(body: IdentityRoleCreateDto): Promise<IdentityRoleDto>;
|
|
414
640
|
/**
|
|
415
641
|
* Update an existing role and refresh the list
|
|
416
642
|
* @param payload - Object containing id and updated role data
|
|
417
643
|
*/
|
|
418
644
|
dispatchUpdateRole(payload: {
|
|
419
645
|
id: string;
|
|
420
|
-
body:
|
|
421
|
-
}): Promise<
|
|
646
|
+
body: IdentityRoleUpdateDto;
|
|
647
|
+
}): Promise<IdentityRoleDto>;
|
|
422
648
|
/**
|
|
423
649
|
* Fetch users and update internal state
|
|
424
650
|
* @param params - Optional query parameters for pagination/filtering
|
|
425
651
|
*/
|
|
426
|
-
dispatchGetUsers(params?:
|
|
652
|
+
dispatchGetUsers(params?: GetIdentityUsersInput): Promise<PagedResultDto<IdentityUserDto>>;
|
|
427
653
|
/**
|
|
428
654
|
* Fetch a user by ID
|
|
429
655
|
* @param id - The user ID
|
|
430
656
|
*/
|
|
431
|
-
dispatchGetUserById(id: string): Promise<
|
|
657
|
+
dispatchGetUserById(id: string): Promise<IdentityUserDto>;
|
|
432
658
|
/**
|
|
433
659
|
* Delete a user and refresh the list
|
|
434
660
|
* @param id - The user ID to delete
|
|
@@ -438,20 +664,20 @@ declare class IdentityStateService {
|
|
|
438
664
|
* Create a new user and refresh the list
|
|
439
665
|
* @param body - The user data to create
|
|
440
666
|
*/
|
|
441
|
-
dispatchCreateUser(body:
|
|
667
|
+
dispatchCreateUser(body: IdentityUserCreateDto): Promise<IdentityUserDto>;
|
|
442
668
|
/**
|
|
443
669
|
* Update an existing user and refresh the list
|
|
444
670
|
* @param payload - Object containing id and updated user data
|
|
445
671
|
*/
|
|
446
672
|
dispatchUpdateUser(payload: {
|
|
447
673
|
id: string;
|
|
448
|
-
body:
|
|
449
|
-
}): Promise<
|
|
674
|
+
body: IdentityUserUpdateDto;
|
|
675
|
+
}): Promise<IdentityUserDto>;
|
|
450
676
|
/**
|
|
451
677
|
* Get roles assigned to a user
|
|
452
678
|
* @param id - The user ID
|
|
453
679
|
*/
|
|
454
|
-
dispatchGetUserRoles(id: string): Promise<
|
|
680
|
+
dispatchGetUserRoles(id: string): Promise<ListResultDto<IdentityRoleDto>>;
|
|
455
681
|
}
|
|
456
682
|
|
|
457
683
|
/**
|
|
@@ -468,14 +694,15 @@ interface RoleOperationResult {
|
|
|
468
694
|
type SortOrder = 'asc' | 'desc' | '';
|
|
469
695
|
/**
|
|
470
696
|
* Return type for useRoles hook
|
|
697
|
+
* @updated 4.0.0 - Now uses IdentityRoleDto, IdentityRoleCreateDto, IdentityRoleUpdateDto
|
|
471
698
|
*/
|
|
472
699
|
interface UseRolesReturn {
|
|
473
700
|
/** List of roles */
|
|
474
|
-
roles:
|
|
701
|
+
roles: IdentityRoleDto[];
|
|
475
702
|
/** Total count of roles */
|
|
476
703
|
totalCount: number;
|
|
477
704
|
/** Currently selected role for editing */
|
|
478
|
-
selectedRole:
|
|
705
|
+
selectedRole: IdentityRoleDto | null;
|
|
479
706
|
/** Loading state */
|
|
480
707
|
isLoading: boolean;
|
|
481
708
|
/** Error message if any */
|
|
@@ -485,17 +712,17 @@ interface UseRolesReturn {
|
|
|
485
712
|
/** Current sort order @since 1.0.0 */
|
|
486
713
|
sortOrder: SortOrder;
|
|
487
714
|
/** Fetch all roles with optional pagination/filtering */
|
|
488
|
-
fetchRoles: (params?:
|
|
715
|
+
fetchRoles: (params?: PagedAndSortedResultRequestDto) => Promise<RoleOperationResult>;
|
|
489
716
|
/** Get a role by ID and set it as selected */
|
|
490
717
|
getRoleById: (id: string) => Promise<RoleOperationResult>;
|
|
491
718
|
/** Create a new role */
|
|
492
|
-
createRole: (role:
|
|
719
|
+
createRole: (role: IdentityRoleCreateDto) => Promise<RoleOperationResult>;
|
|
493
720
|
/** Update an existing role */
|
|
494
|
-
updateRole: (id: string, role:
|
|
721
|
+
updateRole: (id: string, role: IdentityRoleUpdateDto) => Promise<RoleOperationResult>;
|
|
495
722
|
/** Delete a role */
|
|
496
723
|
deleteRole: (id: string) => Promise<RoleOperationResult>;
|
|
497
724
|
/** Set the selected role */
|
|
498
|
-
setSelectedRole: (role:
|
|
725
|
+
setSelectedRole: (role: IdentityRoleDto | null) => void;
|
|
499
726
|
/** Set sort key @since 1.0.0 */
|
|
500
727
|
setSortKey: (key: string) => void;
|
|
501
728
|
/** Set sort order @since 1.0.0 */
|
|
@@ -509,6 +736,8 @@ interface UseRolesReturn {
|
|
|
509
736
|
* This hook provides all the state and actions needed for role management.
|
|
510
737
|
* It handles fetching, creating, updating, and deleting roles.
|
|
511
738
|
*
|
|
739
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityRoleService
|
|
740
|
+
*
|
|
512
741
|
* @example
|
|
513
742
|
* ```tsx
|
|
514
743
|
* function RolesPage() {
|
|
@@ -524,7 +753,7 @@ interface UseRolesReturn {
|
|
|
524
753
|
* fetchRoles();
|
|
525
754
|
* }, [fetchRoles]);
|
|
526
755
|
*
|
|
527
|
-
* const handleCreate = async (data:
|
|
756
|
+
* const handleCreate = async (data: IdentityRoleCreateDto) => {
|
|
528
757
|
* const result = await createRole(data);
|
|
529
758
|
* if (result.success) {
|
|
530
759
|
* // Handle success
|
|
@@ -552,42 +781,43 @@ interface UserOperationResult {
|
|
|
552
781
|
}
|
|
553
782
|
/**
|
|
554
783
|
* Return type for useUsers hook
|
|
784
|
+
* @updated 4.0.0 - Now uses IdentityUserDto, IdentityUserCreateDto, IdentityUserUpdateDto, IdentityRoleDto
|
|
555
785
|
*/
|
|
556
786
|
interface UseUsersReturn {
|
|
557
787
|
/** List of users */
|
|
558
|
-
users:
|
|
788
|
+
users: IdentityUserDto[];
|
|
559
789
|
/** Total count of users */
|
|
560
790
|
totalCount: number;
|
|
561
791
|
/** Currently selected user for editing */
|
|
562
|
-
selectedUser:
|
|
792
|
+
selectedUser: IdentityUserDto | null;
|
|
563
793
|
/** Roles assigned to the selected user */
|
|
564
|
-
selectedUserRoles:
|
|
794
|
+
selectedUserRoles: IdentityRoleDto[];
|
|
565
795
|
/** Loading state */
|
|
566
796
|
isLoading: boolean;
|
|
567
797
|
/** Error message if any */
|
|
568
798
|
error: string | null;
|
|
569
799
|
/** Current page query parameters */
|
|
570
|
-
pageQuery:
|
|
800
|
+
pageQuery: GetIdentityUsersInput;
|
|
571
801
|
/** Current sort key @since 1.0.0 */
|
|
572
802
|
sortKey: string;
|
|
573
803
|
/** Current sort order @since 1.0.0 */
|
|
574
804
|
sortOrder: SortOrder;
|
|
575
805
|
/** Fetch users with pagination */
|
|
576
|
-
fetchUsers: (params?:
|
|
806
|
+
fetchUsers: (params?: GetIdentityUsersInput) => Promise<UserOperationResult>;
|
|
577
807
|
/** Get a user by ID and set it as selected */
|
|
578
808
|
getUserById: (id: string) => Promise<UserOperationResult>;
|
|
579
809
|
/** Get roles for a user */
|
|
580
810
|
getUserRoles: (id: string) => Promise<UserOperationResult>;
|
|
581
811
|
/** Create a new user */
|
|
582
|
-
createUser: (user:
|
|
812
|
+
createUser: (user: IdentityUserCreateDto) => Promise<UserOperationResult>;
|
|
583
813
|
/** Update an existing user */
|
|
584
|
-
updateUser: (id: string, user:
|
|
814
|
+
updateUser: (id: string, user: IdentityUserUpdateDto) => Promise<UserOperationResult>;
|
|
585
815
|
/** Delete a user */
|
|
586
816
|
deleteUser: (id: string) => Promise<UserOperationResult>;
|
|
587
817
|
/** Set the selected user */
|
|
588
|
-
setSelectedUser: (user:
|
|
818
|
+
setSelectedUser: (user: IdentityUserDto | null) => void;
|
|
589
819
|
/** Set page query parameters */
|
|
590
|
-
setPageQuery: (query:
|
|
820
|
+
setPageQuery: (query: GetIdentityUsersInput) => void;
|
|
591
821
|
/** Set sort key @since 1.0.0 */
|
|
592
822
|
setSortKey: (key: string) => void;
|
|
593
823
|
/** Set sort order @since 1.0.0 */
|
|
@@ -601,6 +831,8 @@ interface UseUsersReturn {
|
|
|
601
831
|
* This hook provides all the state and actions needed for user management.
|
|
602
832
|
* It handles fetching, creating, updating, and deleting users with pagination support.
|
|
603
833
|
*
|
|
834
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityUserService
|
|
835
|
+
*
|
|
604
836
|
* @example
|
|
605
837
|
* ```tsx
|
|
606
838
|
* function UsersPage() {
|
|
@@ -683,12 +915,13 @@ declare function useIdentity(): UseIdentityReturn;
|
|
|
683
915
|
|
|
684
916
|
/**
|
|
685
917
|
* Props for RolesComponent
|
|
918
|
+
* @updated 4.0.0 - Callbacks now use IdentityRoleDto instead of Identity.RoleItem
|
|
686
919
|
*/
|
|
687
920
|
interface RolesComponentProps {
|
|
688
921
|
/** Optional callback when a role is created */
|
|
689
|
-
onRoleCreated?: (role:
|
|
922
|
+
onRoleCreated?: (role: IdentityRoleDto) => void;
|
|
690
923
|
/** Optional callback when a role is updated */
|
|
691
|
-
onRoleUpdated?: (role:
|
|
924
|
+
onRoleUpdated?: (role: IdentityRoleDto) => void;
|
|
692
925
|
/** Optional callback when a role is deleted */
|
|
693
926
|
onRoleDeleted?: (id: string) => void;
|
|
694
927
|
/**
|
|
@@ -728,11 +961,14 @@ type PasswordRule = 'number' | 'small' | 'capital' | 'special';
|
|
|
728
961
|
/**
|
|
729
962
|
* Props for UsersComponent
|
|
730
963
|
*/
|
|
964
|
+
/**
|
|
965
|
+
* @updated 4.0.0 - Callbacks now use IdentityUserDto instead of Identity.UserItem
|
|
966
|
+
*/
|
|
731
967
|
interface UsersComponentProps {
|
|
732
968
|
/** Optional callback when a user is created */
|
|
733
|
-
onUserCreated?: (user:
|
|
969
|
+
onUserCreated?: (user: IdentityUserDto) => void;
|
|
734
970
|
/** Optional callback when a user is updated */
|
|
735
|
-
onUserUpdated?: (user:
|
|
971
|
+
onUserUpdated?: (user: IdentityUserDto) => void;
|
|
736
972
|
/** Optional callback when a user is deleted */
|
|
737
973
|
onUserDeleted?: (id: string) => void;
|
|
738
974
|
/**
|
|
@@ -790,4 +1026,4 @@ declare const IDENTITY_POLICIES: {
|
|
|
790
1026
|
readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
|
|
791
1027
|
};
|
|
792
1028
|
|
|
793
|
-
export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, IDENTITY_ROUTE_PROVIDERS, Identity, type IdentityComponentKey, type IdentityPolicyNameKey, type
|
|
1029
|
+
export { type ChangePasswordInput, type GetIdentityUsersInput, IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, IDENTITY_ROUTE_PROVIDERS, Identity, type IdentityComponentKey, type IdentityPolicyNameKey, type IdentityRoleCreateDto, type IdentityRoleCreateOrUpdateDtoBase, type IdentityRoleDto, IdentityRoleService, type IdentityRoleUpdateDto, type IdentityRouteNameKey, IdentityStateService, type IdentityUserCreateDto, type IdentityUserCreateOrUpdateDtoBase, type IdentityUserDto, IdentityUserLookupService, IdentityUserService, type IdentityUserUpdateDto, type IdentityUserUpdateRolesDto, type PasswordRule, type ProfileDto, ProfileService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UpdateProfileDto, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserData, type UserLookupCountInputDto, type UserLookupSearchInputDto, type UserOperationResult, UsersComponent, type UsersComponentProps, configureRoutes, eIdentityComponents, eIdentityPolicyNames, eIdentityRouteNames, initializeIdentityRoutes, useIdentity, useRoles, useUsers };
|