@abpjs/identity 3.2.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 +73 -213
- package/dist/index.d.ts +73 -213
- package/dist/index.js +52 -227
- package/dist/index.mjs +52 -226
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RoutesService, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleObject, PagedAndSortedResultRequestDto, PagedResultDto,
|
|
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
|
*/
|
|
@@ -276,9 +276,13 @@ interface UserLookupSearchInputDto extends PagedAndSortedResultRequestDto {
|
|
|
276
276
|
* Identity namespace containing all types related to identity management.
|
|
277
277
|
* Translated from @abp/ng.identity Identity namespace.
|
|
278
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
|
+
*
|
|
279
284
|
* Changes in v3.2.0:
|
|
280
285
|
* - State now uses PagedResultDto and new proxy DTOs (IdentityRoleDto, IdentityUserDto)
|
|
281
|
-
* - Legacy types (RoleResponse, RoleItem, UserResponse, UserItem, etc.) deprecated
|
|
282
286
|
*/
|
|
283
287
|
declare namespace Identity {
|
|
284
288
|
/**
|
|
@@ -292,76 +296,16 @@ declare namespace Identity {
|
|
|
292
296
|
selectedUser: IdentityUserDto;
|
|
293
297
|
selectedUserRoles: IdentityRoleDto[];
|
|
294
298
|
}
|
|
295
|
-
/**
|
|
296
|
-
* Paginated response for roles
|
|
297
|
-
* @deprecated To be deleted in v4.0. Use PagedResultDto<IdentityRoleDto> instead.
|
|
298
|
-
*/
|
|
299
|
-
type RoleResponse = ABP.PagedResponse<RoleItem>;
|
|
300
|
-
/**
|
|
301
|
-
* Request payload for creating/updating a role
|
|
302
|
-
* @deprecated To be deleted in v4.0. Use IdentityRoleCreateDto or IdentityRoleUpdateDto instead.
|
|
303
|
-
*/
|
|
304
|
-
interface RoleSaveRequest {
|
|
305
|
-
name: string;
|
|
306
|
-
isDefault: boolean;
|
|
307
|
-
isPublic: boolean;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Role item returned from the API
|
|
311
|
-
* @deprecated To be deleted in v4.0. Use IdentityRoleDto instead.
|
|
312
|
-
*/
|
|
313
|
-
interface RoleItem extends RoleSaveRequest {
|
|
314
|
-
isStatic: boolean;
|
|
315
|
-
concurrencyStamp: string;
|
|
316
|
-
id: string;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Paginated response for users
|
|
320
|
-
* @deprecated To be deleted in v4.0. Use PagedResultDto<IdentityUserDto> instead.
|
|
321
|
-
*/
|
|
322
|
-
type UserResponse = ABP.PagedResponse<UserItem>;
|
|
323
|
-
/**
|
|
324
|
-
* Base user properties
|
|
325
|
-
* @deprecated To be deleted in v4.0. Use IdentityUserCreateOrUpdateDtoBase instead.
|
|
326
|
-
*/
|
|
327
|
-
interface User {
|
|
328
|
-
userName: string;
|
|
329
|
-
name: string;
|
|
330
|
-
surname: string;
|
|
331
|
-
email: string;
|
|
332
|
-
phoneNumber: string;
|
|
333
|
-
twoFactorEnabled: boolean;
|
|
334
|
-
lockoutEnabled: boolean;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* User item returned from the API
|
|
338
|
-
* @deprecated To be deleted in v4.0. Use IdentityUserDto instead.
|
|
339
|
-
*/
|
|
340
|
-
interface UserItem extends User {
|
|
341
|
-
tenantId: string;
|
|
342
|
-
emailConfirmed: boolean;
|
|
343
|
-
phoneNumberConfirmed: boolean;
|
|
344
|
-
isLockedOut: boolean;
|
|
345
|
-
concurrencyStamp: string;
|
|
346
|
-
id: string;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Request payload for creating/updating a user
|
|
350
|
-
* @deprecated To be deleted in v4.0. Use IdentityUserCreateDto or IdentityUserUpdateDto instead.
|
|
351
|
-
*/
|
|
352
|
-
interface UserSaveRequest extends User {
|
|
353
|
-
password: string;
|
|
354
|
-
roleNames: string[];
|
|
355
|
-
}
|
|
356
299
|
/**
|
|
357
300
|
* Input props for RolesComponent
|
|
358
301
|
* @since 2.0.0
|
|
302
|
+
* @updated 4.0.0 - Callbacks now use IdentityRoleDto instead of RoleItem
|
|
359
303
|
*/
|
|
360
304
|
interface RolesComponentInputs {
|
|
361
305
|
/** Callback when a role is created */
|
|
362
|
-
readonly onRoleCreated?: (role:
|
|
306
|
+
readonly onRoleCreated?: (role: IdentityRoleDto) => void;
|
|
363
307
|
/** Callback when a role is updated */
|
|
364
|
-
readonly onRoleUpdated?: (role:
|
|
308
|
+
readonly onRoleUpdated?: (role: IdentityRoleDto) => void;
|
|
365
309
|
/** Callback when a role is deleted */
|
|
366
310
|
readonly onRoleDeleted?: (id: string) => void;
|
|
367
311
|
}
|
|
@@ -376,12 +320,13 @@ declare namespace Identity {
|
|
|
376
320
|
/**
|
|
377
321
|
* Input props for UsersComponent
|
|
378
322
|
* @since 2.0.0
|
|
323
|
+
* @updated 4.0.0 - Callbacks now use IdentityUserDto instead of UserItem
|
|
379
324
|
*/
|
|
380
325
|
interface UsersComponentInputs {
|
|
381
326
|
/** Callback when a user is created */
|
|
382
|
-
readonly onUserCreated?: (user:
|
|
327
|
+
readonly onUserCreated?: (user: IdentityUserDto) => void;
|
|
383
328
|
/** Callback when a user is updated */
|
|
384
|
-
readonly onUserUpdated?: (user:
|
|
329
|
+
readonly onUserUpdated?: (user: IdentityUserDto) => void;
|
|
385
330
|
/** Callback when a user is deleted */
|
|
386
331
|
readonly onUserDeleted?: (id: string) => void;
|
|
387
332
|
/** Password validation rules to display */
|
|
@@ -618,110 +563,10 @@ declare class ProfileService {
|
|
|
618
563
|
update: (input: UpdateProfileDto) => Promise<ProfileDto>;
|
|
619
564
|
}
|
|
620
565
|
|
|
621
|
-
/**
|
|
622
|
-
* Service for managing identity-related API operations.
|
|
623
|
-
* Handles roles and users CRUD operations.
|
|
624
|
-
*
|
|
625
|
-
* Translated from @abp/ng.identity IdentityService v3.0.0
|
|
626
|
-
*
|
|
627
|
-
* @since 3.0.0 - Added getUserAssignableRoles method
|
|
628
|
-
*/
|
|
629
|
-
declare class IdentityService {
|
|
630
|
-
private rest;
|
|
631
|
-
/**
|
|
632
|
-
* The API name used for REST requests.
|
|
633
|
-
* @since 2.4.0
|
|
634
|
-
*/
|
|
635
|
-
apiName: string;
|
|
636
|
-
constructor(rest: RestService);
|
|
637
|
-
/**
|
|
638
|
-
* Get all roles with optional pagination/filtering (v0.9.0)
|
|
639
|
-
* @param params - Optional query parameters for pagination and filtering
|
|
640
|
-
* @returns Promise with paginated role response
|
|
641
|
-
*/
|
|
642
|
-
getRoles(params?: ABP.PageQueryParams): Promise<Identity.RoleResponse>;
|
|
643
|
-
/**
|
|
644
|
-
* Get all roles without pagination.
|
|
645
|
-
* Fetches all roles in a single request.
|
|
646
|
-
* @since 2.4.0
|
|
647
|
-
* @returns Promise with all roles
|
|
648
|
-
*/
|
|
649
|
-
getAllRoles(): Promise<Identity.RoleResponse>;
|
|
650
|
-
/**
|
|
651
|
-
* Get a role by ID
|
|
652
|
-
* @param id - The role ID
|
|
653
|
-
* @returns Promise with the role item
|
|
654
|
-
*/
|
|
655
|
-
getRoleById(id: string): Promise<Identity.RoleItem>;
|
|
656
|
-
/**
|
|
657
|
-
* Delete a role
|
|
658
|
-
* @param id - The role ID to delete
|
|
659
|
-
* @returns Promise with the deleted role
|
|
660
|
-
*/
|
|
661
|
-
deleteRole(id: string): Promise<Identity.RoleItem>;
|
|
662
|
-
/**
|
|
663
|
-
* Create a new role
|
|
664
|
-
* @param body - The role data to create
|
|
665
|
-
* @returns Promise with the created role
|
|
666
|
-
*/
|
|
667
|
-
createRole(body: Identity.RoleSaveRequest): Promise<Identity.RoleItem>;
|
|
668
|
-
/**
|
|
669
|
-
* Update an existing role
|
|
670
|
-
* @param id - The role ID to update
|
|
671
|
-
* @param body - The updated role data
|
|
672
|
-
* @returns Promise with the updated role
|
|
673
|
-
*/
|
|
674
|
-
updateRole(id: string, body: Identity.RoleSaveRequest): Promise<Identity.RoleItem>;
|
|
675
|
-
/**
|
|
676
|
-
* Get users with pagination and filtering
|
|
677
|
-
* @param params - Query parameters for pagination and filtering
|
|
678
|
-
* @returns Promise with paginated user response
|
|
679
|
-
*/
|
|
680
|
-
getUsers(params?: ABP.PageQueryParams): Promise<Identity.UserResponse>;
|
|
681
|
-
/**
|
|
682
|
-
* Get a user by ID
|
|
683
|
-
* @param id - The user ID
|
|
684
|
-
* @returns Promise with the user item
|
|
685
|
-
*/
|
|
686
|
-
getUserById(id: string): Promise<Identity.UserItem>;
|
|
687
|
-
/**
|
|
688
|
-
* Get roles assigned to a user
|
|
689
|
-
* @param id - The user ID
|
|
690
|
-
* @returns Promise with the user's roles
|
|
691
|
-
*/
|
|
692
|
-
getUserRoles(id: string): Promise<Identity.RoleResponse>;
|
|
693
|
-
/**
|
|
694
|
-
* Get all roles that can be assigned to users.
|
|
695
|
-
* This returns the list of available roles for user assignment.
|
|
696
|
-
* @since 3.0.0
|
|
697
|
-
* @returns Promise with assignable roles
|
|
698
|
-
*/
|
|
699
|
-
getUserAssignableRoles(): Promise<Identity.RoleResponse>;
|
|
700
|
-
/**
|
|
701
|
-
* Delete a user
|
|
702
|
-
* @param id - The user ID to delete
|
|
703
|
-
* @returns Promise resolving when complete
|
|
704
|
-
*/
|
|
705
|
-
deleteUser(id: string): Promise<void>;
|
|
706
|
-
/**
|
|
707
|
-
* Create a new user
|
|
708
|
-
* @param body - The user data to create
|
|
709
|
-
* @returns Promise with the created user
|
|
710
|
-
*/
|
|
711
|
-
createUser(body: Identity.UserSaveRequest): Promise<Identity.UserItem>;
|
|
712
|
-
/**
|
|
713
|
-
* Update an existing user
|
|
714
|
-
* @param id - The user ID to update
|
|
715
|
-
* @param body - The updated user data
|
|
716
|
-
* @returns Promise with the updated user
|
|
717
|
-
*/
|
|
718
|
-
updateUser(id: string, body: Identity.UserSaveRequest): Promise<Identity.UserItem>;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
566
|
/**
|
|
722
567
|
* IdentityStateService - A stateful service facade for identity operations.
|
|
723
568
|
*
|
|
724
|
-
* This service provides a stateful wrapper around
|
|
569
|
+
* This service provides a stateful wrapper around the proxy services, maintaining
|
|
725
570
|
* local state for roles and users. It's the React equivalent of Angular's
|
|
726
571
|
* IdentityStateService which wraps NGXS store operations.
|
|
727
572
|
*
|
|
@@ -729,15 +574,17 @@ declare class IdentityService {
|
|
|
729
574
|
* instead of this class. This class is provided for programmatic/non-hook scenarios.
|
|
730
575
|
*
|
|
731
576
|
* @since 2.0.0
|
|
577
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityRoleService/IdentityUserService
|
|
732
578
|
*
|
|
733
579
|
* @example
|
|
734
580
|
* ```typescript
|
|
735
|
-
* import { IdentityStateService,
|
|
581
|
+
* import { IdentityStateService, IdentityRoleService, IdentityUserService } from '@abpjs/identity';
|
|
736
582
|
* import { RestService } from '@abpjs/core';
|
|
737
583
|
*
|
|
738
584
|
* const rest = new RestService();
|
|
739
|
-
* const
|
|
740
|
-
* const
|
|
585
|
+
* const roleService = new IdentityRoleService(rest);
|
|
586
|
+
* const userService = new IdentityUserService(rest);
|
|
587
|
+
* const stateService = new IdentityStateService(roleService, userService);
|
|
741
588
|
*
|
|
742
589
|
* // Fetch and get roles
|
|
743
590
|
* await stateService.dispatchGetRoles();
|
|
@@ -745,66 +592,69 @@ declare class IdentityService {
|
|
|
745
592
|
* ```
|
|
746
593
|
*/
|
|
747
594
|
declare class IdentityStateService {
|
|
748
|
-
private
|
|
595
|
+
private identityRoleService;
|
|
596
|
+
private identityUserService;
|
|
749
597
|
private roles;
|
|
750
598
|
private rolesTotalCount;
|
|
751
599
|
private users;
|
|
752
600
|
private usersTotalCount;
|
|
753
|
-
constructor(
|
|
601
|
+
constructor(identityRoleService: IdentityRoleService, identityUserService: IdentityUserService);
|
|
754
602
|
/**
|
|
755
603
|
* Get the current roles from state
|
|
604
|
+
* @updated 4.0.0 - Returns IdentityRoleDto[] instead of Identity.RoleItem[]
|
|
756
605
|
*/
|
|
757
|
-
getRoles():
|
|
606
|
+
getRoles(): IdentityRoleDto[];
|
|
758
607
|
/**
|
|
759
608
|
* Get the total count of roles
|
|
760
609
|
*/
|
|
761
610
|
getRolesTotalCount(): number;
|
|
762
611
|
/**
|
|
763
612
|
* Get the current users from state
|
|
613
|
+
* @updated 4.0.0 - Returns IdentityUserDto[] instead of Identity.UserItem[]
|
|
764
614
|
*/
|
|
765
|
-
getUsers():
|
|
615
|
+
getUsers(): IdentityUserDto[];
|
|
766
616
|
/**
|
|
767
617
|
* Get the total count of users
|
|
768
618
|
*/
|
|
769
619
|
getUsersTotalCount(): number;
|
|
770
620
|
/**
|
|
771
621
|
* Fetch roles and update internal state
|
|
772
|
-
* @param params - Optional
|
|
622
|
+
* @param params - Optional pagination/sorting parameters
|
|
773
623
|
*/
|
|
774
|
-
dispatchGetRoles(params?:
|
|
624
|
+
dispatchGetRoles(params?: PagedAndSortedResultRequestDto): Promise<PagedResultDto<IdentityRoleDto>>;
|
|
775
625
|
/**
|
|
776
626
|
* Fetch a role by ID
|
|
777
627
|
* @param id - The role ID
|
|
778
628
|
*/
|
|
779
|
-
dispatchGetRoleById(id: string): Promise<
|
|
629
|
+
dispatchGetRoleById(id: string): Promise<IdentityRoleDto>;
|
|
780
630
|
/**
|
|
781
631
|
* Delete a role and refresh the list
|
|
782
632
|
* @param id - The role ID to delete
|
|
783
633
|
*/
|
|
784
|
-
dispatchDeleteRole(id: string): Promise<
|
|
634
|
+
dispatchDeleteRole(id: string): Promise<void>;
|
|
785
635
|
/**
|
|
786
636
|
* Create a new role and refresh the list
|
|
787
637
|
* @param body - The role data to create
|
|
788
638
|
*/
|
|
789
|
-
dispatchCreateRole(body:
|
|
639
|
+
dispatchCreateRole(body: IdentityRoleCreateDto): Promise<IdentityRoleDto>;
|
|
790
640
|
/**
|
|
791
641
|
* Update an existing role and refresh the list
|
|
792
642
|
* @param payload - Object containing id and updated role data
|
|
793
643
|
*/
|
|
794
644
|
dispatchUpdateRole(payload: {
|
|
795
645
|
id: string;
|
|
796
|
-
body:
|
|
797
|
-
}): Promise<
|
|
646
|
+
body: IdentityRoleUpdateDto;
|
|
647
|
+
}): Promise<IdentityRoleDto>;
|
|
798
648
|
/**
|
|
799
649
|
* Fetch users and update internal state
|
|
800
650
|
* @param params - Optional query parameters for pagination/filtering
|
|
801
651
|
*/
|
|
802
|
-
dispatchGetUsers(params?:
|
|
652
|
+
dispatchGetUsers(params?: GetIdentityUsersInput): Promise<PagedResultDto<IdentityUserDto>>;
|
|
803
653
|
/**
|
|
804
654
|
* Fetch a user by ID
|
|
805
655
|
* @param id - The user ID
|
|
806
656
|
*/
|
|
807
|
-
dispatchGetUserById(id: string): Promise<
|
|
657
|
+
dispatchGetUserById(id: string): Promise<IdentityUserDto>;
|
|
808
658
|
/**
|
|
809
659
|
* Delete a user and refresh the list
|
|
810
660
|
* @param id - The user ID to delete
|
|
@@ -814,20 +664,20 @@ declare class IdentityStateService {
|
|
|
814
664
|
* Create a new user and refresh the list
|
|
815
665
|
* @param body - The user data to create
|
|
816
666
|
*/
|
|
817
|
-
dispatchCreateUser(body:
|
|
667
|
+
dispatchCreateUser(body: IdentityUserCreateDto): Promise<IdentityUserDto>;
|
|
818
668
|
/**
|
|
819
669
|
* Update an existing user and refresh the list
|
|
820
670
|
* @param payload - Object containing id and updated user data
|
|
821
671
|
*/
|
|
822
672
|
dispatchUpdateUser(payload: {
|
|
823
673
|
id: string;
|
|
824
|
-
body:
|
|
825
|
-
}): Promise<
|
|
674
|
+
body: IdentityUserUpdateDto;
|
|
675
|
+
}): Promise<IdentityUserDto>;
|
|
826
676
|
/**
|
|
827
677
|
* Get roles assigned to a user
|
|
828
678
|
* @param id - The user ID
|
|
829
679
|
*/
|
|
830
|
-
dispatchGetUserRoles(id: string): Promise<
|
|
680
|
+
dispatchGetUserRoles(id: string): Promise<ListResultDto<IdentityRoleDto>>;
|
|
831
681
|
}
|
|
832
682
|
|
|
833
683
|
/**
|
|
@@ -844,14 +694,15 @@ interface RoleOperationResult {
|
|
|
844
694
|
type SortOrder = 'asc' | 'desc' | '';
|
|
845
695
|
/**
|
|
846
696
|
* Return type for useRoles hook
|
|
697
|
+
* @updated 4.0.0 - Now uses IdentityRoleDto, IdentityRoleCreateDto, IdentityRoleUpdateDto
|
|
847
698
|
*/
|
|
848
699
|
interface UseRolesReturn {
|
|
849
700
|
/** List of roles */
|
|
850
|
-
roles:
|
|
701
|
+
roles: IdentityRoleDto[];
|
|
851
702
|
/** Total count of roles */
|
|
852
703
|
totalCount: number;
|
|
853
704
|
/** Currently selected role for editing */
|
|
854
|
-
selectedRole:
|
|
705
|
+
selectedRole: IdentityRoleDto | null;
|
|
855
706
|
/** Loading state */
|
|
856
707
|
isLoading: boolean;
|
|
857
708
|
/** Error message if any */
|
|
@@ -861,17 +712,17 @@ interface UseRolesReturn {
|
|
|
861
712
|
/** Current sort order @since 1.0.0 */
|
|
862
713
|
sortOrder: SortOrder;
|
|
863
714
|
/** Fetch all roles with optional pagination/filtering */
|
|
864
|
-
fetchRoles: (params?:
|
|
715
|
+
fetchRoles: (params?: PagedAndSortedResultRequestDto) => Promise<RoleOperationResult>;
|
|
865
716
|
/** Get a role by ID and set it as selected */
|
|
866
717
|
getRoleById: (id: string) => Promise<RoleOperationResult>;
|
|
867
718
|
/** Create a new role */
|
|
868
|
-
createRole: (role:
|
|
719
|
+
createRole: (role: IdentityRoleCreateDto) => Promise<RoleOperationResult>;
|
|
869
720
|
/** Update an existing role */
|
|
870
|
-
updateRole: (id: string, role:
|
|
721
|
+
updateRole: (id: string, role: IdentityRoleUpdateDto) => Promise<RoleOperationResult>;
|
|
871
722
|
/** Delete a role */
|
|
872
723
|
deleteRole: (id: string) => Promise<RoleOperationResult>;
|
|
873
724
|
/** Set the selected role */
|
|
874
|
-
setSelectedRole: (role:
|
|
725
|
+
setSelectedRole: (role: IdentityRoleDto | null) => void;
|
|
875
726
|
/** Set sort key @since 1.0.0 */
|
|
876
727
|
setSortKey: (key: string) => void;
|
|
877
728
|
/** Set sort order @since 1.0.0 */
|
|
@@ -885,6 +736,8 @@ interface UseRolesReturn {
|
|
|
885
736
|
* This hook provides all the state and actions needed for role management.
|
|
886
737
|
* It handles fetching, creating, updating, and deleting roles.
|
|
887
738
|
*
|
|
739
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityRoleService
|
|
740
|
+
*
|
|
888
741
|
* @example
|
|
889
742
|
* ```tsx
|
|
890
743
|
* function RolesPage() {
|
|
@@ -900,7 +753,7 @@ interface UseRolesReturn {
|
|
|
900
753
|
* fetchRoles();
|
|
901
754
|
* }, [fetchRoles]);
|
|
902
755
|
*
|
|
903
|
-
* const handleCreate = async (data:
|
|
756
|
+
* const handleCreate = async (data: IdentityRoleCreateDto) => {
|
|
904
757
|
* const result = await createRole(data);
|
|
905
758
|
* if (result.success) {
|
|
906
759
|
* // Handle success
|
|
@@ -928,42 +781,43 @@ interface UserOperationResult {
|
|
|
928
781
|
}
|
|
929
782
|
/**
|
|
930
783
|
* Return type for useUsers hook
|
|
784
|
+
* @updated 4.0.0 - Now uses IdentityUserDto, IdentityUserCreateDto, IdentityUserUpdateDto, IdentityRoleDto
|
|
931
785
|
*/
|
|
932
786
|
interface UseUsersReturn {
|
|
933
787
|
/** List of users */
|
|
934
|
-
users:
|
|
788
|
+
users: IdentityUserDto[];
|
|
935
789
|
/** Total count of users */
|
|
936
790
|
totalCount: number;
|
|
937
791
|
/** Currently selected user for editing */
|
|
938
|
-
selectedUser:
|
|
792
|
+
selectedUser: IdentityUserDto | null;
|
|
939
793
|
/** Roles assigned to the selected user */
|
|
940
|
-
selectedUserRoles:
|
|
794
|
+
selectedUserRoles: IdentityRoleDto[];
|
|
941
795
|
/** Loading state */
|
|
942
796
|
isLoading: boolean;
|
|
943
797
|
/** Error message if any */
|
|
944
798
|
error: string | null;
|
|
945
799
|
/** Current page query parameters */
|
|
946
|
-
pageQuery:
|
|
800
|
+
pageQuery: GetIdentityUsersInput;
|
|
947
801
|
/** Current sort key @since 1.0.0 */
|
|
948
802
|
sortKey: string;
|
|
949
803
|
/** Current sort order @since 1.0.0 */
|
|
950
804
|
sortOrder: SortOrder;
|
|
951
805
|
/** Fetch users with pagination */
|
|
952
|
-
fetchUsers: (params?:
|
|
806
|
+
fetchUsers: (params?: GetIdentityUsersInput) => Promise<UserOperationResult>;
|
|
953
807
|
/** Get a user by ID and set it as selected */
|
|
954
808
|
getUserById: (id: string) => Promise<UserOperationResult>;
|
|
955
809
|
/** Get roles for a user */
|
|
956
810
|
getUserRoles: (id: string) => Promise<UserOperationResult>;
|
|
957
811
|
/** Create a new user */
|
|
958
|
-
createUser: (user:
|
|
812
|
+
createUser: (user: IdentityUserCreateDto) => Promise<UserOperationResult>;
|
|
959
813
|
/** Update an existing user */
|
|
960
|
-
updateUser: (id: string, user:
|
|
814
|
+
updateUser: (id: string, user: IdentityUserUpdateDto) => Promise<UserOperationResult>;
|
|
961
815
|
/** Delete a user */
|
|
962
816
|
deleteUser: (id: string) => Promise<UserOperationResult>;
|
|
963
817
|
/** Set the selected user */
|
|
964
|
-
setSelectedUser: (user:
|
|
818
|
+
setSelectedUser: (user: IdentityUserDto | null) => void;
|
|
965
819
|
/** Set page query parameters */
|
|
966
|
-
setPageQuery: (query:
|
|
820
|
+
setPageQuery: (query: GetIdentityUsersInput) => void;
|
|
967
821
|
/** Set sort key @since 1.0.0 */
|
|
968
822
|
setSortKey: (key: string) => void;
|
|
969
823
|
/** Set sort order @since 1.0.0 */
|
|
@@ -977,6 +831,8 @@ interface UseUsersReturn {
|
|
|
977
831
|
* This hook provides all the state and actions needed for user management.
|
|
978
832
|
* It handles fetching, creating, updating, and deleting users with pagination support.
|
|
979
833
|
*
|
|
834
|
+
* @updated 4.0.0 - Migrated from deprecated IdentityService to IdentityUserService
|
|
835
|
+
*
|
|
980
836
|
* @example
|
|
981
837
|
* ```tsx
|
|
982
838
|
* function UsersPage() {
|
|
@@ -1059,12 +915,13 @@ declare function useIdentity(): UseIdentityReturn;
|
|
|
1059
915
|
|
|
1060
916
|
/**
|
|
1061
917
|
* Props for RolesComponent
|
|
918
|
+
* @updated 4.0.0 - Callbacks now use IdentityRoleDto instead of Identity.RoleItem
|
|
1062
919
|
*/
|
|
1063
920
|
interface RolesComponentProps {
|
|
1064
921
|
/** Optional callback when a role is created */
|
|
1065
|
-
onRoleCreated?: (role:
|
|
922
|
+
onRoleCreated?: (role: IdentityRoleDto) => void;
|
|
1066
923
|
/** Optional callback when a role is updated */
|
|
1067
|
-
onRoleUpdated?: (role:
|
|
924
|
+
onRoleUpdated?: (role: IdentityRoleDto) => void;
|
|
1068
925
|
/** Optional callback when a role is deleted */
|
|
1069
926
|
onRoleDeleted?: (id: string) => void;
|
|
1070
927
|
/**
|
|
@@ -1104,11 +961,14 @@ type PasswordRule = 'number' | 'small' | 'capital' | 'special';
|
|
|
1104
961
|
/**
|
|
1105
962
|
* Props for UsersComponent
|
|
1106
963
|
*/
|
|
964
|
+
/**
|
|
965
|
+
* @updated 4.0.0 - Callbacks now use IdentityUserDto instead of Identity.UserItem
|
|
966
|
+
*/
|
|
1107
967
|
interface UsersComponentProps {
|
|
1108
968
|
/** Optional callback when a user is created */
|
|
1109
|
-
onUserCreated?: (user:
|
|
969
|
+
onUserCreated?: (user: IdentityUserDto) => void;
|
|
1110
970
|
/** Optional callback when a user is updated */
|
|
1111
|
-
onUserUpdated?: (user:
|
|
971
|
+
onUserUpdated?: (user: IdentityUserDto) => void;
|
|
1112
972
|
/** Optional callback when a user is deleted */
|
|
1113
973
|
onUserDeleted?: (id: string) => void;
|
|
1114
974
|
/**
|
|
@@ -1166,4 +1026,4 @@ declare const IDENTITY_POLICIES: {
|
|
|
1166
1026
|
readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
|
|
1167
1027
|
};
|
|
1168
1028
|
|
|
1169
|
-
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,
|
|
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 };
|