@abpjs/identity-pro 2.7.0 → 3.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 CHANGED
@@ -1,5 +1,241 @@
1
- import { ABP, RestService } from '@abpjs/core';
2
- import React from 'react';
1
+ import { RoutesService, SettingTabsService, PagedResultDto, ABP, PagedAndSortedResultRequestDto, RestService } from '@abpjs/core';
2
+ import React, { ComponentType } from 'react';
3
+
4
+ /**
5
+ * Identity Policy Names
6
+ * Policy names for permission checking in the Identity module.
7
+ * @since 3.0.0
8
+ */
9
+ /**
10
+ * Identity policy names enum.
11
+ * Used for checking permissions in the identity management module.
12
+ * @since 3.0.0
13
+ */
14
+ declare const eIdentityPolicyNames: {
15
+ readonly IdentityManagement: "AbpIdentity.Roles || AbpIdentity.Users || AbpIdentity.ClaimTypes || AbpIdentity.OrganizationUnits";
16
+ readonly Roles: "AbpIdentity.Roles";
17
+ readonly Users: "AbpIdentity.Users";
18
+ readonly ClaimTypes: "AbpIdentity.ClaimTypes";
19
+ readonly OrganizationUnits: "AbpIdentity.OrganizationUnits";
20
+ };
21
+ /**
22
+ * Type for identity policy name values
23
+ */
24
+ type IdentityPolicyNameKey = (typeof eIdentityPolicyNames)[keyof typeof eIdentityPolicyNames];
25
+
26
+ /**
27
+ * Identity Route Names
28
+ * Route names for the Identity module navigation.
29
+ * @since 3.0.0
30
+ */
31
+ /**
32
+ * Identity route names enum.
33
+ * Used for localization and navigation configuration.
34
+ *
35
+ * Note: In v3.0.0, the Administration key was removed.
36
+ * Routes are now organized under IdentityManagement.
37
+ *
38
+ * @since 3.0.0
39
+ */
40
+ declare const eIdentityRouteNames: {
41
+ readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
42
+ readonly Roles: "AbpIdentity::Roles";
43
+ readonly Users: "AbpIdentity::Users";
44
+ readonly ClaimTypes: "AbpIdentity::ClaimTypes";
45
+ readonly OrganizationUnits: "AbpIdentity::OrganizationUnits";
46
+ };
47
+ /**
48
+ * Type for identity route name values
49
+ */
50
+ type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
51
+
52
+ /**
53
+ * Identity Setting Tab Names
54
+ * Setting tab names for the Identity module settings.
55
+ * @since 3.0.0
56
+ */
57
+ /**
58
+ * Identity setting tab names enum.
59
+ * Used for settings panel tab configuration.
60
+ * @since 3.0.0
61
+ */
62
+ declare const eIdentitySettingTabNames: {
63
+ readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
64
+ };
65
+ /**
66
+ * Type for identity setting tab name values
67
+ */
68
+ type IdentitySettingTabNameKey = (typeof eIdentitySettingTabNames)[keyof typeof eIdentitySettingTabNames];
69
+
70
+ /**
71
+ * Identity Settings Models
72
+ * Models for identity settings configuration.
73
+ * @since 3.0.0
74
+ */
75
+ /**
76
+ * Identity settings structure containing all identity-related settings.
77
+ */
78
+ interface Settings {
79
+ password: Password;
80
+ lockout: Lockout;
81
+ signIn: SignIn;
82
+ user: User;
83
+ }
84
+ /**
85
+ * Lockout settings for user account lockout behavior.
86
+ */
87
+ interface Lockout {
88
+ allowedForNewUsers: boolean;
89
+ lockoutDuration: number;
90
+ maxFailedAccessAttempts: number;
91
+ }
92
+ /**
93
+ * Password settings for password validation rules.
94
+ */
95
+ interface Password {
96
+ requiredLength: number;
97
+ requiredUniqueChars: number;
98
+ requireNonAlphanumeric: boolean;
99
+ requireLowercase: boolean;
100
+ requireUppercase: boolean;
101
+ requireDigit: boolean;
102
+ }
103
+ /**
104
+ * Sign-in settings for login behavior.
105
+ */
106
+ interface SignIn {
107
+ requireConfirmedEmail: boolean;
108
+ enablePhoneNumberConfirmation: boolean;
109
+ requireConfirmedPhoneNumber: boolean;
110
+ }
111
+ /**
112
+ * User settings for user profile behavior.
113
+ */
114
+ interface User {
115
+ isUserNameUpdateEnabled: boolean;
116
+ isEmailUpdateEnabled: boolean;
117
+ }
118
+
119
+ type identitySettings_Lockout = Lockout;
120
+ type identitySettings_Password = Password;
121
+ type identitySettings_Settings = Settings;
122
+ type identitySettings_SignIn = SignIn;
123
+ type identitySettings_User = User;
124
+ declare namespace identitySettings {
125
+ export type { identitySettings_Lockout as Lockout, identitySettings_Password as Password, identitySettings_Settings as Settings, identitySettings_SignIn as SignIn, identitySettings_User as User };
126
+ }
127
+
128
+ /**
129
+ * Identity Route Provider
130
+ * Provides route configuration for the Identity module.
131
+ * @since 3.0.0
132
+ */
133
+
134
+ /**
135
+ * Configures identity routes using the provided RoutesService.
136
+ * @param routes - The RoutesService instance to configure routes with
137
+ * @returns A function that adds identity routes when called
138
+ */
139
+ declare function configureRoutes(routes: RoutesService): () => void;
140
+ /**
141
+ * Initializes identity routes using the global RoutesService.
142
+ * Convenience function that uses the global RoutesService singleton.
143
+ * @returns A function that adds identity routes when called
144
+ */
145
+ declare function initializeIdentityRoutes(): () => void;
146
+ /**
147
+ * Identity route providers object.
148
+ * Can be used for DI-style configuration.
149
+ */
150
+ declare const IDENTITY_ROUTE_PROVIDERS: {
151
+ configureRoutes: typeof configureRoutes;
152
+ };
153
+
154
+ /**
155
+ * Identity Setting Tab Provider
156
+ * Provides setting tab configuration for the Identity module.
157
+ * @since 3.0.0
158
+ */
159
+
160
+ /**
161
+ * Identity setting tab configuration metadata.
162
+ * This is the configuration used to create the setting tab.
163
+ */
164
+ interface IdentitySettingTabConfig {
165
+ name: string;
166
+ requiredPolicy: string;
167
+ order: number;
168
+ }
169
+ /**
170
+ * Default identity setting tab configuration metadata.
171
+ * Contains the metadata for the Identity settings tab.
172
+ */
173
+ declare const IDENTITY_SETTING_TAB_CONFIG: IdentitySettingTabConfig;
174
+ /**
175
+ * Configures identity setting tabs using the provided SettingTabsService.
176
+ * @param settingTabs - The SettingTabsService instance to configure tabs with
177
+ * @param component - Optional component to render for the tab (defaults to placeholder)
178
+ * @returns A function that adds identity setting tabs when called
179
+ */
180
+ declare function configureSettingTabs(settingTabs: SettingTabsService, component?: ComponentType<unknown>): () => void;
181
+ /**
182
+ * Initializes identity setting tabs using the global SettingTabsService.
183
+ * Convenience function that uses the global SettingTabsService singleton.
184
+ * @param component - Optional component to render for the tab
185
+ * @returns A function that adds identity setting tabs when called
186
+ */
187
+ declare function initializeIdentitySettingTabs(component?: ComponentType<unknown>): () => void;
188
+ /**
189
+ * Identity setting tab providers object.
190
+ * Can be used for DI-style configuration.
191
+ */
192
+ declare const IDENTITY_SETTING_TAB_PROVIDERS: {
193
+ configureSettingTabs: typeof configureSettingTabs;
194
+ };
195
+
196
+ /**
197
+ * Organization Unit With Details DTO
198
+ * Translated from @volo/abp.ng.identity v2.9.0
199
+ * @since 2.9.0
200
+ */
201
+ /**
202
+ * Represents an organization unit with full details.
203
+ * Used for displaying and managing organization units in the hierarchy.
204
+ */
205
+ interface OrganizationUnitWithDetailsDto {
206
+ /** Parent organization unit ID (null for root units) */
207
+ parentId?: string;
208
+ /** Hierarchical code of the organization unit (e.g., "00001.00002") */
209
+ code: string;
210
+ /** Display name of the organization unit */
211
+ displayName: string;
212
+ /** Roles assigned to this organization unit */
213
+ roles: unknown[];
214
+ /** Whether this unit has been soft-deleted */
215
+ isDeleted: boolean;
216
+ /** ID of the user who deleted this unit */
217
+ deleterId?: string;
218
+ /** Date and time when the unit was deleted */
219
+ deletionTime?: string;
220
+ /** Date and time of last modification */
221
+ lastModificationTime?: string;
222
+ /** ID of the user who last modified this unit */
223
+ lastModifierId?: string;
224
+ /** Date and time when the unit was created */
225
+ creationTime: string;
226
+ /** ID of the user who created this unit */
227
+ creatorId?: string;
228
+ /** Unique identifier of the organization unit */
229
+ id: string;
230
+ /** Extra properties for extensibility */
231
+ extraProperties: unknown[];
232
+ }
233
+ /**
234
+ * Factory function to create an OrganizationUnitWithDetailsDto with defaults.
235
+ * @param initialValues - Partial values to initialize the DTO
236
+ * @returns A new OrganizationUnitWithDetailsDto instance
237
+ */
238
+ declare function createOrganizationUnitWithDetailsDto(initialValues?: Partial<OrganizationUnitWithDetailsDto>): OrganizationUnitWithDetailsDto;
3
239
 
4
240
  /**
5
241
  * Identity namespace containing all types related to identity management.
@@ -8,8 +244,10 @@ import React from 'react';
8
244
  * Pro features include:
9
245
  * - Claim type management
10
246
  * - User/Role claims management
247
+ * - Organization unit management (v2.9.0)
11
248
  *
12
249
  * @since 0.7.2
250
+ * @updated 2.9.0 - Added organization units support
13
251
  */
14
252
  declare namespace Identity {
15
253
  /**
@@ -27,6 +265,8 @@ declare namespace Identity {
27
265
  claims: ClaimResponse;
28
266
  /** Pro: Selected claim type for editing */
29
267
  selectedClaim: ClaimType;
268
+ /** Pro: Organization units (v2.9.0) */
269
+ organizationUnits: PagedResultDto<OrganizationUnitWithDetailsDto>;
30
270
  }
31
271
  /**
32
272
  * Paginated response for roles
@@ -77,10 +317,13 @@ declare namespace Identity {
77
317
  }
78
318
  /**
79
319
  * Request payload for creating/updating a user
320
+ * @updated 2.9.0 - Added organizationUnitIds
80
321
  */
81
322
  interface UserSaveRequest extends User {
82
323
  password: string;
83
324
  roleNames: string[];
325
+ /** Organization unit IDs the user belongs to (v2.9.0) */
326
+ organizationUnitIds: string[];
84
327
  }
85
328
  /**
86
329
  * Request payload for changing a user's password (admin action)
@@ -152,20 +395,169 @@ declare namespace Identity {
152
395
  }
153
396
  }
154
397
 
398
+ /**
399
+ * Get Organization Unit Input
400
+ * Translated from @volo/abp.ng.identity v2.9.0
401
+ * @since 2.9.0
402
+ */
403
+
404
+ /**
405
+ * Input parameters for querying organization units.
406
+ * Extends PagedAndSortedResultRequestDto for pagination and sorting support.
407
+ */
408
+ interface GetOrganizationUnitInput extends PagedAndSortedResultRequestDto {
409
+ /** Filter string for searching organization units */
410
+ filter?: string;
411
+ }
412
+ /**
413
+ * Factory function to create a GetOrganizationUnitInput with defaults.
414
+ * @param initialValues - Partial values to initialize the input
415
+ * @returns A new GetOrganizationUnitInput instance
416
+ */
417
+ declare function createGetOrganizationUnitInput(initialValues?: Partial<GetOrganizationUnitInput>): GetOrganizationUnitInput;
418
+
419
+ /**
420
+ * Organization Unit Create/Update Base DTO
421
+ * Translated from @volo/abp.ng.identity v2.9.0
422
+ * @since 2.9.0
423
+ */
424
+ /**
425
+ * Base interface for creating or updating organization units.
426
+ * Contains common properties shared between create and update operations.
427
+ */
428
+ interface OrganizationUnitCreateOrUpdateDtoBase {
429
+ /** Display name of the organization unit */
430
+ displayName: string;
431
+ }
432
+ /**
433
+ * Factory function to create an OrganizationUnitCreateOrUpdateDtoBase with defaults.
434
+ * @param initialValues - Partial values to initialize the DTO
435
+ * @returns A new OrganizationUnitCreateOrUpdateDtoBase instance
436
+ */
437
+ declare function createOrganizationUnitCreateOrUpdateDtoBase(initialValues?: Partial<OrganizationUnitCreateOrUpdateDtoBase>): OrganizationUnitCreateOrUpdateDtoBase;
438
+
439
+ /**
440
+ * Organization Unit Create DTO
441
+ * Translated from @volo/abp.ng.identity v2.9.0
442
+ * @since 2.9.0
443
+ */
444
+
445
+ /**
446
+ * DTO for creating a new organization unit.
447
+ * Extends the base DTO with parent ID for hierarchy placement.
448
+ */
449
+ interface OrganizationUnitCreateDto extends OrganizationUnitCreateOrUpdateDtoBase {
450
+ /** Parent organization unit ID (optional, null for root units) */
451
+ parentId?: string;
452
+ /** Extra properties for extensibility */
453
+ extraProperties?: unknown[];
454
+ }
455
+ /**
456
+ * Factory function to create an OrganizationUnitCreateDto with defaults.
457
+ * @param initialValues - Partial values to initialize the DTO
458
+ * @returns A new OrganizationUnitCreateDto instance
459
+ */
460
+ declare function createOrganizationUnitCreateDto(initialValues?: Partial<OrganizationUnitCreateDto>): OrganizationUnitCreateDto;
461
+
462
+ /**
463
+ * Organization Unit Move Input
464
+ * Translated from @volo/abp.ng.identity v2.9.0
465
+ * @since 2.9.0
466
+ */
467
+ /**
468
+ * Input for moving an organization unit to a new parent.
469
+ * Used when reorganizing the hierarchy tree.
470
+ */
471
+ interface OrganizationUnitMoveInput {
472
+ /** New parent organization unit ID (null to move to root level) */
473
+ newParentId?: string;
474
+ }
475
+ /**
476
+ * Factory function to create an OrganizationUnitMoveInput with defaults.
477
+ * @param initialValues - Partial values to initialize the input
478
+ * @returns A new OrganizationUnitMoveInput instance
479
+ */
480
+ declare function createOrganizationUnitMoveInput(initialValues?: Partial<OrganizationUnitMoveInput>): OrganizationUnitMoveInput;
481
+
482
+ /**
483
+ * Organization Unit Role Input
484
+ * Translated from @volo/abp.ng.identity v2.9.0
485
+ * @since 2.9.0
486
+ */
487
+ /**
488
+ * Input for adding roles to an organization unit.
489
+ * Used when assigning roles to organization units.
490
+ */
491
+ interface OrganizationUnitRoleInput {
492
+ /** Array of role IDs to add to the organization unit */
493
+ roleIds: string[];
494
+ }
495
+ /**
496
+ * Factory function to create an OrganizationUnitRoleInput with defaults.
497
+ * @param initialValues - Partial values to initialize the input
498
+ * @returns A new OrganizationUnitRoleInput instance
499
+ */
500
+ declare function createOrganizationUnitRoleInput(initialValues?: Partial<OrganizationUnitRoleInput>): OrganizationUnitRoleInput;
501
+
502
+ /**
503
+ * Organization Unit Update DTO
504
+ * Translated from @volo/abp.ng.identity v2.9.0
505
+ * @since 2.9.0
506
+ */
507
+
508
+ /**
509
+ * DTO for updating an existing organization unit.
510
+ * Extends the base DTO with optional extra properties.
511
+ */
512
+ interface OrganizationUnitUpdateDto extends OrganizationUnitCreateOrUpdateDtoBase {
513
+ /** Extra properties for extensibility */
514
+ extraProperties?: unknown[];
515
+ }
516
+ /**
517
+ * Factory function to create an OrganizationUnitUpdateDto with defaults.
518
+ * @param initialValues - Partial values to initialize the DTO
519
+ * @returns A new OrganizationUnitUpdateDto instance
520
+ */
521
+ declare function createOrganizationUnitUpdateDto(initialValues?: Partial<OrganizationUnitUpdateDto>): OrganizationUnitUpdateDto;
522
+
523
+ /**
524
+ * Organization Unit User Input
525
+ * Translated from @volo/abp.ng.identity v2.9.0
526
+ * @since 2.9.0
527
+ */
528
+ /**
529
+ * Input for adding users (members) to an organization unit.
530
+ * Used when assigning members to organization units.
531
+ */
532
+ interface OrganizationUnitUserInput {
533
+ /** Array of user IDs to add to the organization unit */
534
+ userIds: string[];
535
+ }
536
+ /**
537
+ * Factory function to create an OrganizationUnitUserInput with defaults.
538
+ * @param initialValues - Partial values to initialize the input
539
+ * @returns A new OrganizationUnitUserInput instance
540
+ */
541
+ declare function createOrganizationUnitUserInput(initialValues?: Partial<OrganizationUnitUserInput>): OrganizationUnitUserInput;
542
+
155
543
  /**
156
544
  * Identity Pro Component Identifiers
157
- * Translated from @volo/abp.ng.identity v2.7.0
545
+ * Translated from @volo/abp.ng.identity v2.9.0
158
546
  */
159
547
  /**
160
548
  * Enum-like const object for identity component identifiers.
161
549
  * Used for component registration and identification.
162
550
  * @since 2.4.0
163
551
  * @updated 2.7.0 - Changed from enum to const object
552
+ * @updated 2.9.0 - Added OrganizationUnits, OrganizationMembers, OrganizationRoles
164
553
  */
165
554
  declare const eIdentityComponents: {
166
555
  readonly Claims: "Identity.ClaimsComponent";
167
556
  readonly Roles: "Identity.RolesComponent";
168
557
  readonly Users: "Identity.UsersComponent";
558
+ readonly OrganizationUnits: "Identity.OrganizationUnitsComponent";
559
+ readonly OrganizationMembers: "Identity.OrganizationMembersComponent";
560
+ readonly OrganizationRoles: "Identity.OrganizationRolesComponent";
169
561
  };
170
562
  /**
171
563
  * Type for identity component key values
@@ -173,25 +565,49 @@ declare const eIdentityComponents: {
173
565
  type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
174
566
 
175
567
  /**
176
- * Identity Pro Route Names
177
- * Translated from @volo/abp.ng.identity v2.7.0
568
+ * Identity Extensions Guard
569
+ * Guard for loading identity extensions before route activation.
570
+ * @since 3.0.0
178
571
  */
179
572
  /**
180
- * Enum-like const object for identity route names.
181
- * Used for localization and navigation configuration.
182
- * @since 2.7.0
573
+ * Hook to guard identity routes and load extensions.
574
+ * In Angular, this was a CanActivate guard that loaded entity actions,
575
+ * toolbar actions, entity props, and form props for identity components.
576
+ *
577
+ * In React, this is implemented as a hook that can be used in route loaders
578
+ * or component initialization.
579
+ *
580
+ * @returns Promise that resolves to true when extensions are loaded
183
581
  */
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";
582
+ declare function identityExtensionsGuard(): Promise<boolean>;
583
+ /**
584
+ * React hook version of the extensions guard.
585
+ * Can be used in route loaders or useEffect.
586
+ *
587
+ * @example
588
+ * ```tsx
589
+ * import { useIdentityExtensionsGuard } from '@abpjs/identity-pro';
590
+ *
591
+ * function IdentityLayout() {
592
+ * const { isLoaded, loading } = useIdentityExtensionsGuard();
593
+ *
594
+ * if (loading) return <Loading />;
595
+ *
596
+ * return <Outlet />;
597
+ * }
598
+ * ```
599
+ */
600
+ declare function useIdentityExtensionsGuard(): {
601
+ isLoaded: boolean;
602
+ loading: boolean;
190
603
  };
191
604
  /**
192
- * Type for identity route name values
605
+ * Identity Extensions Guard class (for compatibility with Angular pattern).
606
+ * @deprecated Use identityExtensionsGuard function or useIdentityExtensionsGuard hook instead.
193
607
  */
194
- type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
608
+ declare class IdentityExtensionsGuard {
609
+ canActivate(): Promise<boolean>;
610
+ }
195
611
 
196
612
  /**
197
613
  * Service for managing identity-related API operations.
@@ -267,6 +683,13 @@ declare class IdentityService {
267
683
  * @returns Promise with the user's roles
268
684
  */
269
685
  getUserRoles(id: string): Promise<Identity.RoleResponse>;
686
+ /**
687
+ * Get organization units assigned to a user
688
+ * @since 2.9.0
689
+ * @param id - The user ID
690
+ * @returns Promise with the user's organization units
691
+ */
692
+ getUserOrganizationUnits(id: string): Promise<OrganizationUnitWithDetailsDto[]>;
270
693
  /**
271
694
  * Change a user's password (admin action)
272
695
  * @since 2.7.0
@@ -302,11 +725,23 @@ declare class IdentityService {
302
725
  */
303
726
  updateUser(id: string, body: Identity.UserSaveRequest): Promise<Identity.UserItem>;
304
727
  /**
305
- * Get all claim type names for dropdowns
306
- * Pro feature since 0.7.2
307
- * @returns Promise with claim type names
728
+ * Get assignable roles for users
729
+ * @since 3.0.0
730
+ * @returns Promise with roles that can be assigned to users
731
+ */
732
+ getUserAssingableRoles(): Promise<Identity.RoleResponse>;
733
+ /**
734
+ * Get claim types available for roles
735
+ * @since 3.0.0
736
+ * @returns Promise with claim type names for roles
308
737
  */
309
- getClaimTypeNames(): Promise<Identity.ClaimTypeName[]>;
738
+ getRolesClaimTypes(): Promise<Identity.ClaimTypeName[]>;
739
+ /**
740
+ * Get claim types available for users
741
+ * @since 3.0.0
742
+ * @returns Promise with claim type names for users
743
+ */
744
+ getUsersClaimTypes(): Promise<Identity.ClaimTypeName[]>;
310
745
  /**
311
746
  * Get claim types with pagination
312
747
  * Pro feature since 0.7.2
@@ -367,12 +802,13 @@ declare class IdentityService {
367
802
 
368
803
  /**
369
804
  * Identity State Service
370
- * Translated from @volo/abp.ng.identity v2.0.0
805
+ * Translated from @volo/abp.ng.identity v3.0.0
371
806
  *
372
807
  * This service provides facade methods for dispatching identity actions.
373
808
  * In Angular, this uses NGXS store dispatch. In React, we wrap the API calls.
374
809
  *
375
810
  * @since 2.0.0
811
+ * @updated 3.0.0 - Removed getClaimTypeNames and dispatchGetClaimTypeNames
376
812
  */
377
813
 
378
814
  /**
@@ -382,6 +818,7 @@ declare class IdentityService {
382
818
  * Pro features include all dispatch methods for roles, users, and claim types.
383
819
  *
384
820
  * @since 2.0.0
821
+ * @updated 3.0.0 - Removed claim type names state (use getRolesClaimTypes/getUsersClaimTypes instead)
385
822
  */
386
823
  declare class IdentityStateService {
387
824
  private identityService;
@@ -391,7 +828,6 @@ declare class IdentityStateService {
391
828
  private _usersTotalCount;
392
829
  private _claimTypes;
393
830
  private _claimTypesTotalCount;
394
- private _claimTypeNames;
395
831
  constructor(restService: RestService);
396
832
  /**
397
833
  * Get the current roles
@@ -417,10 +853,6 @@ declare class IdentityStateService {
417
853
  * Get the total count of claim types
418
854
  */
419
855
  getClaimTypesTotalCount(): number;
420
- /**
421
- * Get the claim type names
422
- */
423
- getClaimTypeNames(): Identity.ClaimTypeName[];
424
856
  /**
425
857
  * Dispatch get roles action
426
858
  * @param params Query parameters for fetching roles
@@ -492,12 +924,6 @@ declare class IdentityStateService {
492
924
  * @since 2.0.0
493
925
  */
494
926
  dispatchUpdateClaimType(body: Identity.ClaimType): Promise<Identity.ClaimType>;
495
- /**
496
- * Dispatch get claim type names action
497
- * @returns Promise resolving to the claim type names
498
- * @since 2.0.0
499
- */
500
- dispatchGetClaimTypeNames(): Promise<Identity.ClaimTypeName[]>;
501
927
  /**
502
928
  * Dispatch get users action
503
929
  * @param params Query parameters for fetching users
@@ -543,6 +969,102 @@ declare class IdentityStateService {
543
969
  dispatchGetUserRoles(id: string): Promise<Identity.RoleItem[]>;
544
970
  }
545
971
 
972
+ /**
973
+ * Service for managing organization unit operations.
974
+ * Handles CRUD operations for organization units hierarchy.
975
+ *
976
+ * Translated from @volo/abp.ng.identity OrganizationUnitService
977
+ * @since 2.9.0
978
+ */
979
+ declare class OrganizationUnitService {
980
+ /**
981
+ * The API name used for REST requests.
982
+ */
983
+ apiName: string;
984
+ private rest;
985
+ constructor(rest: RestService);
986
+ /**
987
+ * Add roles to an organization unit
988
+ * @param body - The role IDs to add
989
+ * @param id - The organization unit ID
990
+ * @returns Promise resolving when complete
991
+ */
992
+ addRolesByIdAndInput(body: OrganizationUnitRoleInput, id: string): Promise<void>;
993
+ /**
994
+ * Add members (users) to an organization unit
995
+ * @param body - The user IDs to add
996
+ * @param id - The organization unit ID
997
+ * @returns Promise resolving when complete
998
+ */
999
+ addMembersByIdAndInput(body: OrganizationUnitUserInput, id: string): Promise<void>;
1000
+ /**
1001
+ * Create a new organization unit
1002
+ * @param body - The organization unit data
1003
+ * @returns Promise with the created organization unit
1004
+ */
1005
+ createByInput(body: OrganizationUnitCreateDto): Promise<OrganizationUnitWithDetailsDto>;
1006
+ /**
1007
+ * Delete an organization unit
1008
+ * @param id - The organization unit ID to delete
1009
+ * @returns Promise resolving when complete
1010
+ */
1011
+ deleteById(id: string): Promise<void>;
1012
+ /**
1013
+ * Get an organization unit by ID
1014
+ * @param id - The organization unit ID
1015
+ * @returns Promise with the organization unit
1016
+ */
1017
+ getById(id: string): Promise<OrganizationUnitWithDetailsDto>;
1018
+ /**
1019
+ * Get organization units with optional filtering and pagination
1020
+ * @param params - Query parameters for filtering and pagination
1021
+ * @returns Promise with paginated organization units
1022
+ */
1023
+ getListByInput(params?: GetOrganizationUnitInput): Promise<PagedResultDto<OrganizationUnitWithDetailsDto>>;
1024
+ /**
1025
+ * Get roles assigned to an organization unit
1026
+ * @param params - Query parameters for pagination
1027
+ * @param id - The organization unit ID
1028
+ * @returns Promise with paginated roles
1029
+ */
1030
+ getRolesById(params: ABP.PageQueryParams, id: string): Promise<PagedResultDto<Identity.RoleItem>>;
1031
+ /**
1032
+ * Get members (users) of an organization unit
1033
+ * @param params - Query parameters for pagination
1034
+ * @param id - The organization unit ID
1035
+ * @returns Promise with paginated users
1036
+ */
1037
+ getMembersById(params: ABP.PageQueryParams, id: string): Promise<PagedResultDto<Identity.UserItem>>;
1038
+ /**
1039
+ * Move an organization unit to a new parent
1040
+ * @param body - The move input with new parent ID
1041
+ * @param id - The organization unit ID to move
1042
+ * @returns Promise resolving when complete
1043
+ */
1044
+ moveByIdAndInput(body: OrganizationUnitMoveInput, id: string): Promise<void>;
1045
+ /**
1046
+ * Update an organization unit
1047
+ * @param body - The updated organization unit data
1048
+ * @param id - The organization unit ID to update
1049
+ * @returns Promise with the updated organization unit
1050
+ */
1051
+ updateByIdAndInput(body: OrganizationUnitUpdateDto, id: string): Promise<OrganizationUnitWithDetailsDto>;
1052
+ /**
1053
+ * Remove a member (user) from an organization unit
1054
+ * @param id - The organization unit ID
1055
+ * @param memberId - The user ID to remove
1056
+ * @returns Promise resolving when complete
1057
+ */
1058
+ removeMemberByIdAndMemberId(id: string, memberId: string): Promise<void>;
1059
+ /**
1060
+ * Remove a role from an organization unit
1061
+ * @param id - The organization unit ID
1062
+ * @param roleId - The role ID to remove
1063
+ * @returns Promise resolving when complete
1064
+ */
1065
+ removeRoleByIdAndRoleId(id: string, roleId: string): Promise<void>;
1066
+ }
1067
+
546
1068
  /**
547
1069
  * Result from role operations
548
1070
  */
@@ -799,13 +1321,14 @@ interface ClaimOperationResult {
799
1321
  /**
800
1322
  * Return type for useClaims hook
801
1323
  * @since 0.7.2
1324
+ * @updated 3.0.0 - Added fetchRolesClaimTypes and fetchUsersClaimTypes
802
1325
  */
803
1326
  interface UseClaimsReturn {
804
1327
  /** List of claim types */
805
1328
  claimTypes: Identity.ClaimType[];
806
1329
  /** Total count of claim types */
807
1330
  totalCount: number;
808
- /** Claim type names for dropdowns */
1331
+ /** Claim type names for dropdowns (roles) */
809
1332
  claimTypeNames: Identity.ClaimTypeName[];
810
1333
  /** Currently selected claim type for editing */
811
1334
  selectedClaimType: Identity.ClaimType | null;
@@ -819,8 +1342,16 @@ interface UseClaimsReturn {
819
1342
  sortOrder: SortOrder;
820
1343
  /** Fetch all claim types with optional pagination/filtering */
821
1344
  fetchClaimTypes: (params?: ABP.PageQueryParams) => Promise<ClaimOperationResult>;
822
- /** Fetch claim type names for dropdowns */
823
- fetchClaimTypeNames: () => Promise<ClaimOperationResult>;
1345
+ /**
1346
+ * Fetch claim type names for roles
1347
+ * @since 3.0.0
1348
+ */
1349
+ fetchRolesClaimTypes: () => Promise<ClaimOperationResult>;
1350
+ /**
1351
+ * Fetch claim type names for users
1352
+ * @since 3.0.0
1353
+ */
1354
+ fetchUsersClaimTypes: () => Promise<ClaimOperationResult>;
824
1355
  /** Get a claim type by ID and set it as selected */
825
1356
  getClaimTypeById: (id: string) => Promise<ClaimOperationResult>;
826
1357
  /** Create a new claim type */
@@ -1073,4 +1604,432 @@ declare const IDENTITY_POLICIES: {
1073
1604
  readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
1074
1605
  };
1075
1606
 
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 };
1607
+ /**
1608
+ * Identity Extension Tokens
1609
+ * Provides extension points for customizing identity components.
1610
+ * @since 3.0.0
1611
+ */
1612
+
1613
+ /**
1614
+ * Entity action definition for grid row actions.
1615
+ * @template T - The entity type for the action
1616
+ */
1617
+ interface EntityAction<T> {
1618
+ text: string;
1619
+ action?: (record: {
1620
+ record: T;
1621
+ }) => void;
1622
+ visible?: (data: {
1623
+ record: T;
1624
+ }) => boolean;
1625
+ permission?: string;
1626
+ icon?: string;
1627
+ }
1628
+ /**
1629
+ * Toolbar action definition for grid toolbar buttons.
1630
+ * @template T - The entity array type for the action
1631
+ */
1632
+ interface ToolbarAction<T> {
1633
+ text: string;
1634
+ action?: (data: {
1635
+ data: T;
1636
+ }) => void;
1637
+ visible?: (data: {
1638
+ data: T;
1639
+ }) => boolean;
1640
+ permission?: string;
1641
+ icon?: string;
1642
+ }
1643
+ /**
1644
+ * Entity prop definition for grid columns.
1645
+ * @template T - The entity type for the prop
1646
+ */
1647
+ interface EntityProp<T> {
1648
+ type: string;
1649
+ name: keyof T | string;
1650
+ displayName: string;
1651
+ sortable?: boolean;
1652
+ visible?: (data: {
1653
+ record: T;
1654
+ }) => boolean;
1655
+ valueResolver?: (data: {
1656
+ record: T;
1657
+ }) => string | number | boolean;
1658
+ }
1659
+ /**
1660
+ * Form prop definition for form fields.
1661
+ * @template T - The entity type for the form
1662
+ */
1663
+ interface FormProp<T> {
1664
+ type: string;
1665
+ name: keyof T | string;
1666
+ displayName: string;
1667
+ validators?: unknown[];
1668
+ visible?: (data: {
1669
+ entity?: T;
1670
+ }) => boolean;
1671
+ defaultValue?: unknown;
1672
+ options?: unknown[];
1673
+ }
1674
+ type EntityActionContributorCallback<T> = (actions: EntityAction<T>[]) => EntityAction<T>[];
1675
+ type ToolbarActionContributorCallback<T> = (actions: ToolbarAction<T>[]) => ToolbarAction<T>[];
1676
+ type EntityPropContributorCallback<T> = (props: EntityProp<T>[]) => EntityProp<T>[];
1677
+ type CreateFormPropContributorCallback<T> = (props: FormProp<T>[]) => FormProp<T>[];
1678
+ type EditFormPropContributorCallback<T> = (props: FormProp<T>[]) => FormProp<T>[];
1679
+ /**
1680
+ * Default entity actions for Claims component.
1681
+ */
1682
+ declare const DEFAULT_CLAIMS_ENTITY_ACTIONS: EntityAction<Identity.ClaimType>[];
1683
+ /**
1684
+ * Default entity actions for Roles component.
1685
+ */
1686
+ declare const DEFAULT_ROLES_ENTITY_ACTIONS: EntityAction<Identity.RoleItem>[];
1687
+ /**
1688
+ * Default entity actions for Users component.
1689
+ */
1690
+ declare const DEFAULT_USERS_ENTITY_ACTIONS: EntityAction<Identity.UserItem>[];
1691
+ /**
1692
+ * Default entity actions for Organization Members component.
1693
+ */
1694
+ declare const DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS: EntityAction<Identity.UserItem>[];
1695
+ /**
1696
+ * Default entity actions for Organization Roles component.
1697
+ */
1698
+ declare const DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS: EntityAction<Identity.RoleItem>[];
1699
+ /**
1700
+ * Combined default identity entity actions.
1701
+ */
1702
+ declare const DEFAULT_IDENTITY_ENTITY_ACTIONS: {
1703
+ readonly 'Identity.ClaimsComponent': EntityAction<Identity.ClaimType>[];
1704
+ readonly 'Identity.RolesComponent': EntityAction<Identity.RoleItem>[];
1705
+ readonly 'Identity.UsersComponent': EntityAction<Identity.UserItem>[];
1706
+ readonly 'Identity.OrganizationMembersComponent': EntityAction<Identity.UserItem>[];
1707
+ readonly 'Identity.OrganizationRolesComponent': EntityAction<Identity.RoleItem>[];
1708
+ };
1709
+ /**
1710
+ * Default toolbar actions for Claims component.
1711
+ */
1712
+ declare const DEFAULT_CLAIMS_TOOLBAR_ACTIONS: ToolbarAction<Identity.ClaimType[]>[];
1713
+ /**
1714
+ * Default toolbar actions for Roles component.
1715
+ */
1716
+ declare const DEFAULT_ROLES_TOOLBAR_ACTIONS: ToolbarAction<Identity.RoleItem[]>[];
1717
+ /**
1718
+ * Default toolbar actions for Users component.
1719
+ */
1720
+ declare const DEFAULT_USERS_TOOLBAR_ACTIONS: ToolbarAction<Identity.UserItem[]>[];
1721
+ /**
1722
+ * Default toolbar actions for Organization Units component.
1723
+ */
1724
+ declare const DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS: ToolbarAction<OrganizationUnitWithDetailsDto[]>[];
1725
+ /**
1726
+ * Combined default identity toolbar actions.
1727
+ */
1728
+ declare const DEFAULT_IDENTITY_TOOLBAR_ACTIONS: {
1729
+ readonly 'Identity.ClaimsComponent': ToolbarAction<Identity.ClaimType[]>[];
1730
+ readonly 'Identity.RolesComponent': ToolbarAction<Identity.RoleItem[]>[];
1731
+ readonly 'Identity.UsersComponent': ToolbarAction<Identity.UserItem[]>[];
1732
+ readonly 'Identity.OrganizationUnitsComponent': ToolbarAction<OrganizationUnitWithDetailsDto[]>[];
1733
+ };
1734
+ /**
1735
+ * Default entity props for Claims component.
1736
+ */
1737
+ declare const DEFAULT_CLAIMS_ENTITY_PROPS: EntityProp<Identity.ClaimType>[];
1738
+ /**
1739
+ * Default entity props for Roles component.
1740
+ */
1741
+ declare const DEFAULT_ROLES_ENTITY_PROPS: EntityProp<Identity.RoleItem>[];
1742
+ /**
1743
+ * Default entity props for Users component.
1744
+ */
1745
+ declare const DEFAULT_USERS_ENTITY_PROPS: EntityProp<Identity.UserItem>[];
1746
+ /**
1747
+ * Default entity props for Organization Members component.
1748
+ */
1749
+ declare const DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS: EntityProp<Identity.UserItem>[];
1750
+ /**
1751
+ * Default entity props for Organization Roles component.
1752
+ */
1753
+ declare const DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS: EntityProp<Identity.RoleItem>[];
1754
+ /**
1755
+ * Combined default identity entity props.
1756
+ */
1757
+ declare const DEFAULT_IDENTITY_ENTITY_PROPS: {
1758
+ readonly 'Identity.ClaimsComponent': EntityProp<Identity.ClaimType>[];
1759
+ readonly 'Identity.RolesComponent': EntityProp<Identity.RoleItem>[];
1760
+ readonly 'Identity.UsersComponent': EntityProp<Identity.UserItem>[];
1761
+ readonly 'Identity.OrganizationMembersComponent': EntityProp<Identity.UserItem>[];
1762
+ readonly 'Identity.OrganizationRolesComponent': EntityProp<Identity.RoleItem>[];
1763
+ };
1764
+ /**
1765
+ * Default create form props for Claims component.
1766
+ */
1767
+ declare const DEFAULT_CLAIMS_CREATE_FORM_PROPS: FormProp<Identity.ClaimType>[];
1768
+ /**
1769
+ * Default edit form props for Claims component.
1770
+ */
1771
+ declare const DEFAULT_CLAIMS_EDIT_FORM_PROPS: FormProp<Identity.ClaimType>[];
1772
+ /**
1773
+ * Default create form props for Roles component.
1774
+ */
1775
+ declare const DEFAULT_ROLES_CREATE_FORM_PROPS: FormProp<Identity.RoleItem>[];
1776
+ /**
1777
+ * Default edit form props for Roles component.
1778
+ */
1779
+ declare const DEFAULT_ROLES_EDIT_FORM_PROPS: FormProp<Identity.RoleItem>[];
1780
+ /**
1781
+ * Default create form props for Users component.
1782
+ */
1783
+ declare const DEFAULT_USERS_CREATE_FORM_PROPS: FormProp<Identity.UserItem>[];
1784
+ /**
1785
+ * Default edit form props for Users component.
1786
+ */
1787
+ declare const DEFAULT_USERS_EDIT_FORM_PROPS: FormProp<Identity.UserItem>[];
1788
+ /**
1789
+ * Combined default identity create form props.
1790
+ */
1791
+ declare const DEFAULT_IDENTITY_CREATE_FORM_PROPS: {
1792
+ readonly 'Identity.ClaimsComponent': FormProp<Identity.ClaimType>[];
1793
+ readonly 'Identity.RolesComponent': FormProp<Identity.RoleItem>[];
1794
+ readonly 'Identity.UsersComponent': FormProp<Identity.UserItem>[];
1795
+ };
1796
+ /**
1797
+ * Combined default identity edit form props.
1798
+ */
1799
+ declare const DEFAULT_IDENTITY_EDIT_FORM_PROPS: {
1800
+ readonly 'Identity.ClaimsComponent': FormProp<Identity.ClaimType>[];
1801
+ readonly 'Identity.RolesComponent': FormProp<Identity.RoleItem>[];
1802
+ readonly 'Identity.UsersComponent': FormProp<Identity.UserItem>[];
1803
+ };
1804
+ /**
1805
+ * Entity action contributors type.
1806
+ */
1807
+ type IdentityEntityActionContributors = Partial<{
1808
+ [eIdentityComponents.Claims]: EntityActionContributorCallback<Identity.ClaimType>[];
1809
+ [eIdentityComponents.Roles]: EntityActionContributorCallback<Identity.RoleItem>[];
1810
+ [eIdentityComponents.Users]: EntityActionContributorCallback<Identity.UserItem>[];
1811
+ [eIdentityComponents.OrganizationMembers]: EntityActionContributorCallback<Identity.UserItem>[];
1812
+ [eIdentityComponents.OrganizationRoles]: EntityActionContributorCallback<Identity.RoleItem>[];
1813
+ }>;
1814
+ /**
1815
+ * Toolbar action contributors type.
1816
+ */
1817
+ type IdentityToolbarActionContributors = Partial<{
1818
+ [eIdentityComponents.Claims]: ToolbarActionContributorCallback<Identity.ClaimType[]>[];
1819
+ [eIdentityComponents.Roles]: ToolbarActionContributorCallback<Identity.RoleItem[]>[];
1820
+ [eIdentityComponents.Users]: ToolbarActionContributorCallback<Identity.UserItem[]>[];
1821
+ [eIdentityComponents.OrganizationUnits]: ToolbarActionContributorCallback<OrganizationUnitWithDetailsDto[]>[];
1822
+ }>;
1823
+ /**
1824
+ * Entity prop contributors type.
1825
+ */
1826
+ type IdentityEntityPropContributors = Partial<{
1827
+ [eIdentityComponents.Claims]: EntityPropContributorCallback<Identity.ClaimType>[];
1828
+ [eIdentityComponents.Roles]: EntityPropContributorCallback<Identity.RoleItem>[];
1829
+ [eIdentityComponents.Users]: EntityPropContributorCallback<Identity.UserItem>[];
1830
+ [eIdentityComponents.OrganizationMembers]: EntityPropContributorCallback<Identity.UserItem>[];
1831
+ [eIdentityComponents.OrganizationRoles]: EntityPropContributorCallback<Identity.RoleItem>[];
1832
+ }>;
1833
+ /**
1834
+ * Create form prop contributors type.
1835
+ */
1836
+ type IdentityCreateFormPropContributors = Partial<{
1837
+ [eIdentityComponents.Claims]: CreateFormPropContributorCallback<Identity.ClaimType>[];
1838
+ [eIdentityComponents.Roles]: CreateFormPropContributorCallback<Identity.RoleItem>[];
1839
+ [eIdentityComponents.Users]: CreateFormPropContributorCallback<Identity.UserItem>[];
1840
+ }>;
1841
+ /**
1842
+ * Edit form prop contributors type.
1843
+ */
1844
+ type IdentityEditFormPropContributors = Partial<{
1845
+ [eIdentityComponents.Claims]: EditFormPropContributorCallback<Identity.ClaimType>[];
1846
+ [eIdentityComponents.Roles]: EditFormPropContributorCallback<Identity.RoleItem>[];
1847
+ [eIdentityComponents.Users]: EditFormPropContributorCallback<Identity.UserItem>[];
1848
+ }>;
1849
+ /**
1850
+ * Token for identity entity action contributors.
1851
+ * Use as a React Context key.
1852
+ */
1853
+ declare const IDENTITY_ENTITY_ACTION_CONTRIBUTORS: unique symbol;
1854
+ /**
1855
+ * Token for identity toolbar action contributors.
1856
+ * Use as a React Context key.
1857
+ */
1858
+ declare const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS: unique symbol;
1859
+ /**
1860
+ * Token for identity entity prop contributors.
1861
+ * Use as a React Context key.
1862
+ */
1863
+ declare const IDENTITY_ENTITY_PROP_CONTRIBUTORS: unique symbol;
1864
+ /**
1865
+ * Token for identity create form prop contributors.
1866
+ * Use as a React Context key.
1867
+ */
1868
+ declare const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS: unique symbol;
1869
+ /**
1870
+ * Token for identity edit form prop contributors.
1871
+ * Use as a React Context key.
1872
+ */
1873
+ declare const IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS: unique symbol;
1874
+
1875
+ /**
1876
+ * Tree Adapter Utility
1877
+ * Translated from @volo/abp.ng.identity v2.9.0
1878
+ * @since 2.9.0
1879
+ *
1880
+ * Provides utility classes for converting flat lists to tree structures.
1881
+ * Used primarily for organization unit hierarchy management.
1882
+ */
1883
+ /**
1884
+ * Base node interface for tree structures.
1885
+ * Entities must implement this interface to be used with TreeAdapter.
1886
+ */
1887
+ interface BaseNode {
1888
+ /** Unique identifier */
1889
+ id: string;
1890
+ /** Parent node ID (null for root nodes) */
1891
+ parentId: string | null;
1892
+ /** Optional name property */
1893
+ name?: string;
1894
+ /** Optional display name property */
1895
+ displayName?: string;
1896
+ }
1897
+ /**
1898
+ * Tree node wrapping an entity for tree display.
1899
+ * Compatible with various tree UI libraries.
1900
+ */
1901
+ interface TreeNode<T extends BaseNode> {
1902
+ /** The wrapped entity */
1903
+ entity: T;
1904
+ /** Display title (resolved from name or displayName) */
1905
+ title: string;
1906
+ /** Unique key (same as entity id) */
1907
+ key: string;
1908
+ /** Optional icon */
1909
+ icon: string | null;
1910
+ /** Child nodes */
1911
+ children: TreeNode<T>[];
1912
+ /** Whether this is a leaf node (no children) */
1913
+ isLeaf: boolean;
1914
+ /** Whether this node is checked */
1915
+ checked: boolean;
1916
+ /** Whether this node is selected */
1917
+ selected: boolean;
1918
+ /** Whether this node is expanded */
1919
+ expanded: boolean;
1920
+ /** Whether this node can be selected */
1921
+ selectable: boolean;
1922
+ /** Whether this node is disabled */
1923
+ disabled: boolean;
1924
+ /** Whether the checkbox is disabled */
1925
+ disableCheckbox: boolean;
1926
+ /** Reference to parent node */
1927
+ parentNode: TreeNode<T> | null;
1928
+ /** Parent ID from entity */
1929
+ parentId: string | null;
1930
+ /** ID from entity */
1931
+ id: string;
1932
+ }
1933
+ /**
1934
+ * Creates a TreeNode from an entity.
1935
+ * @param entity - The entity to wrap
1936
+ * @param nameResolver - Optional function to resolve display name
1937
+ * @returns A new TreeNode instance
1938
+ */
1939
+ declare function createTreeNode<T extends BaseNode>(entity: T, nameResolver?: (ent: T) => string): TreeNode<T>;
1940
+ /**
1941
+ * TreeAdapter class for managing hierarchical data.
1942
+ * Converts flat lists into tree structures for UI rendering.
1943
+ *
1944
+ * @example
1945
+ * ```tsx
1946
+ * const units = await organizationUnitService.getListByInput();
1947
+ * const adapter = new TreeAdapter(units.items);
1948
+ * const treeNodes = adapter.getTree();
1949
+ * ```
1950
+ */
1951
+ declare class TreeAdapter<T extends BaseNode = BaseNode> {
1952
+ private nameResolver?;
1953
+ private list;
1954
+ private tree;
1955
+ private nodeMap;
1956
+ /**
1957
+ * Creates a new TreeAdapter instance.
1958
+ * @param list - Optional initial list of entities
1959
+ * @param nameResolver - Optional function to resolve display names
1960
+ */
1961
+ constructor(list?: T[], nameResolver?: ((ent: T) => string) | undefined);
1962
+ /**
1963
+ * Sets the list and rebuilds the tree.
1964
+ * @param list - The new list of entities
1965
+ */
1966
+ setList(list: T[]): void;
1967
+ /**
1968
+ * Gets the original flat list.
1969
+ * @returns The flat list of entities
1970
+ */
1971
+ getList(): T[];
1972
+ /**
1973
+ * Gets the tree structure.
1974
+ * @returns Array of root TreeNodes
1975
+ */
1976
+ getTree(): TreeNode<T>[];
1977
+ /**
1978
+ * Gets a node by its ID.
1979
+ * @param id - The node ID
1980
+ * @returns The TreeNode or undefined
1981
+ */
1982
+ getNodeById(id: string): TreeNode<T> | undefined;
1983
+ /**
1984
+ * Handles a drop operation (moving a node).
1985
+ * Updates the internal structure after drag-and-drop.
1986
+ * @param node - The node that was dropped
1987
+ */
1988
+ handleDrop(node: TreeNode<T>): void;
1989
+ /**
1990
+ * Handles removing a node from the tree.
1991
+ * @param node - The node to remove
1992
+ */
1993
+ handleRemove(node: TreeNode<T>): void;
1994
+ /**
1995
+ * Builds the tree structure from the flat list.
1996
+ */
1997
+ private buildTree;
1998
+ /**
1999
+ * Recursively sorts children by title.
2000
+ * @param nodes - Array of nodes to sort
2001
+ */
2002
+ private sortChildren;
2003
+ /**
2004
+ * Expands all nodes in the tree.
2005
+ */
2006
+ expandAll(): void;
2007
+ /**
2008
+ * Collapses all nodes in the tree.
2009
+ */
2010
+ collapseAll(): void;
2011
+ /**
2012
+ * Gets all expanded node keys.
2013
+ * @returns Array of expanded node IDs
2014
+ */
2015
+ getExpandedKeys(): string[];
2016
+ /**
2017
+ * Sets expanded state for specific nodes.
2018
+ * @param keys - Array of node IDs to expand
2019
+ */
2020
+ setExpandedKeys(keys: string[]): void;
2021
+ /**
2022
+ * Finds a node and all its ancestors.
2023
+ * Useful for expanding path to a specific node.
2024
+ * @param id - The target node ID
2025
+ * @returns Array of nodes from root to target
2026
+ */
2027
+ getPathToNode(id: string): TreeNode<T>[];
2028
+ /**
2029
+ * Expands the path to a specific node.
2030
+ * @param id - The target node ID
2031
+ */
2032
+ expandPathToNode(id: string): void;
2033
+ }
2034
+
2035
+ export { type BaseNode, ClaimModal, type ClaimModalProps, type ClaimOperationResult, ClaimsComponent, type ClaimsComponentProps, type CreateFormPropContributorCallback, DEFAULT_CLAIMS_CREATE_FORM_PROPS, DEFAULT_CLAIMS_EDIT_FORM_PROPS, DEFAULT_CLAIMS_ENTITY_ACTIONS, DEFAULT_CLAIMS_ENTITY_PROPS, DEFAULT_CLAIMS_TOOLBAR_ACTIONS, DEFAULT_IDENTITY_CREATE_FORM_PROPS, DEFAULT_IDENTITY_EDIT_FORM_PROPS, DEFAULT_IDENTITY_ENTITY_ACTIONS, DEFAULT_IDENTITY_ENTITY_PROPS, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS, DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS, DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS, DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS, DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS, DEFAULT_ROLES_CREATE_FORM_PROPS, DEFAULT_ROLES_EDIT_FORM_PROPS, DEFAULT_ROLES_ENTITY_ACTIONS, DEFAULT_ROLES_ENTITY_PROPS, DEFAULT_ROLES_TOOLBAR_ACTIONS, DEFAULT_USERS_CREATE_FORM_PROPS, DEFAULT_USERS_EDIT_FORM_PROPS, DEFAULT_USERS_ENTITY_ACTIONS, DEFAULT_USERS_ENTITY_PROPS, DEFAULT_USERS_TOOLBAR_ACTIONS, type EditFormPropContributorCallback, type EntityAction, type EntityActionContributorCallback, type EntityProp, type EntityPropContributorCallback, type FormProp, type GetOrganizationUnitInput, IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, IDENTITY_ENTITY_ACTION_CONTRIBUTORS, IDENTITY_ENTITY_PROP_CONTRIBUTORS, IDENTITY_POLICIES, IDENTITY_ROUTES, IDENTITY_ROUTE_PATHS, IDENTITY_ROUTE_PROVIDERS, IDENTITY_SETTING_TAB_CONFIG, IDENTITY_SETTING_TAB_PROVIDERS, IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, Identity, type IdentityComponentKey, type IdentityCreateFormPropContributors, type IdentityEditFormPropContributors, type IdentityEntityActionContributors, type IdentityEntityPropContributors, IdentityExtensionsGuard, type IdentityPolicyNameKey, type IdentityRouteNameKey, IdentityService, type IdentitySettingTabConfig, type IdentitySettingTabNameKey, identitySettings as IdentitySettings, IdentityStateService, type IdentityToolbarActionContributors, type OrganizationUnitCreateDto, type OrganizationUnitCreateOrUpdateDtoBase, type OrganizationUnitMoveInput, type OrganizationUnitRoleInput, OrganizationUnitService, type OrganizationUnitUpdateDto, type OrganizationUnitUserInput, type OrganizationUnitWithDetailsDto, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type ToolbarAction, type ToolbarActionContributorCallback, TreeAdapter, type TreeNode, type UseClaimsReturn, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, configureRoutes, configureSettingTabs, createGetOrganizationUnitInput, createOrganizationUnitCreateDto, createOrganizationUnitCreateOrUpdateDtoBase, createOrganizationUnitMoveInput, createOrganizationUnitRoleInput, createOrganizationUnitUpdateDto, createOrganizationUnitUserInput, createOrganizationUnitWithDetailsDto, createTreeNode, eIdentityComponents, eIdentityPolicyNames, eIdentityRouteNames, eIdentitySettingTabNames, identityExtensionsGuard, initializeIdentityRoutes, initializeIdentitySettingTabs, useClaims, useIdentity, useIdentityExtensionsGuard, useRoles, useUsers };