@abpjs/identity-pro 2.9.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.js CHANGED
@@ -22,16 +22,52 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ClaimModal: () => ClaimModal,
24
24
  ClaimsComponent: () => ClaimsComponent,
25
+ DEFAULT_CLAIMS_CREATE_FORM_PROPS: () => DEFAULT_CLAIMS_CREATE_FORM_PROPS,
26
+ DEFAULT_CLAIMS_EDIT_FORM_PROPS: () => DEFAULT_CLAIMS_EDIT_FORM_PROPS,
27
+ DEFAULT_CLAIMS_ENTITY_ACTIONS: () => DEFAULT_CLAIMS_ENTITY_ACTIONS,
28
+ DEFAULT_CLAIMS_ENTITY_PROPS: () => DEFAULT_CLAIMS_ENTITY_PROPS,
29
+ DEFAULT_CLAIMS_TOOLBAR_ACTIONS: () => DEFAULT_CLAIMS_TOOLBAR_ACTIONS,
30
+ DEFAULT_IDENTITY_CREATE_FORM_PROPS: () => DEFAULT_IDENTITY_CREATE_FORM_PROPS,
31
+ DEFAULT_IDENTITY_EDIT_FORM_PROPS: () => DEFAULT_IDENTITY_EDIT_FORM_PROPS,
32
+ DEFAULT_IDENTITY_ENTITY_ACTIONS: () => DEFAULT_IDENTITY_ENTITY_ACTIONS,
33
+ DEFAULT_IDENTITY_ENTITY_PROPS: () => DEFAULT_IDENTITY_ENTITY_PROPS,
34
+ DEFAULT_IDENTITY_TOOLBAR_ACTIONS: () => DEFAULT_IDENTITY_TOOLBAR_ACTIONS,
35
+ DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS: () => DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS,
36
+ DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS: () => DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS,
37
+ DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS: () => DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS,
38
+ DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS: () => DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS,
39
+ DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS: () => DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS,
40
+ DEFAULT_ROLES_CREATE_FORM_PROPS: () => DEFAULT_ROLES_CREATE_FORM_PROPS,
41
+ DEFAULT_ROLES_EDIT_FORM_PROPS: () => DEFAULT_ROLES_EDIT_FORM_PROPS,
42
+ DEFAULT_ROLES_ENTITY_ACTIONS: () => DEFAULT_ROLES_ENTITY_ACTIONS,
43
+ DEFAULT_ROLES_ENTITY_PROPS: () => DEFAULT_ROLES_ENTITY_PROPS,
44
+ DEFAULT_ROLES_TOOLBAR_ACTIONS: () => DEFAULT_ROLES_TOOLBAR_ACTIONS,
45
+ DEFAULT_USERS_CREATE_FORM_PROPS: () => DEFAULT_USERS_CREATE_FORM_PROPS,
46
+ DEFAULT_USERS_EDIT_FORM_PROPS: () => DEFAULT_USERS_EDIT_FORM_PROPS,
47
+ DEFAULT_USERS_ENTITY_ACTIONS: () => DEFAULT_USERS_ENTITY_ACTIONS,
48
+ DEFAULT_USERS_ENTITY_PROPS: () => DEFAULT_USERS_ENTITY_PROPS,
49
+ DEFAULT_USERS_TOOLBAR_ACTIONS: () => DEFAULT_USERS_TOOLBAR_ACTIONS,
50
+ IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS: () => IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
51
+ IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS: () => IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
52
+ IDENTITY_ENTITY_ACTION_CONTRIBUTORS: () => IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
53
+ IDENTITY_ENTITY_PROP_CONTRIBUTORS: () => IDENTITY_ENTITY_PROP_CONTRIBUTORS,
25
54
  IDENTITY_POLICIES: () => IDENTITY_POLICIES,
26
55
  IDENTITY_ROUTES: () => IDENTITY_ROUTES,
27
56
  IDENTITY_ROUTE_PATHS: () => IDENTITY_ROUTE_PATHS,
57
+ IDENTITY_ROUTE_PROVIDERS: () => IDENTITY_ROUTE_PROVIDERS,
58
+ IDENTITY_SETTING_TAB_CONFIG: () => IDENTITY_SETTING_TAB_CONFIG,
59
+ IDENTITY_SETTING_TAB_PROVIDERS: () => IDENTITY_SETTING_TAB_PROVIDERS,
60
+ IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS: () => IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
28
61
  Identity: () => Identity,
62
+ IdentityExtensionsGuard: () => IdentityExtensionsGuard,
29
63
  IdentityService: () => IdentityService,
30
64
  IdentityStateService: () => IdentityStateService,
31
65
  OrganizationUnitService: () => OrganizationUnitService,
32
66
  RolesComponent: () => RolesComponent,
33
67
  TreeAdapter: () => TreeAdapter,
34
68
  UsersComponent: () => UsersComponent,
69
+ configureRoutes: () => configureRoutes,
70
+ configureSettingTabs: () => configureSettingTabs,
35
71
  createGetOrganizationUnitInput: () => createGetOrganizationUnitInput,
36
72
  createOrganizationUnitCreateDto: () => createOrganizationUnitCreateDto,
37
73
  createOrganizationUnitCreateOrUpdateDtoBase: () => createOrganizationUnitCreateOrUpdateDtoBase,
@@ -42,14 +78,121 @@ __export(index_exports, {
42
78
  createOrganizationUnitWithDetailsDto: () => createOrganizationUnitWithDetailsDto,
43
79
  createTreeNode: () => createTreeNode,
44
80
  eIdentityComponents: () => eIdentityComponents,
81
+ eIdentityPolicyNames: () => eIdentityPolicyNames,
45
82
  eIdentityRouteNames: () => eIdentityRouteNames,
83
+ eIdentitySettingTabNames: () => eIdentitySettingTabNames,
84
+ identityExtensionsGuard: () => identityExtensionsGuard,
85
+ initializeIdentityRoutes: () => initializeIdentityRoutes,
86
+ initializeIdentitySettingTabs: () => initializeIdentitySettingTabs,
46
87
  useClaims: () => useClaims,
47
88
  useIdentity: () => useIdentity,
89
+ useIdentityExtensionsGuard: () => useIdentityExtensionsGuard,
48
90
  useRoles: () => useRoles,
49
91
  useUsers: () => useUsers
50
92
  });
51
93
  module.exports = __toCommonJS(index_exports);
52
94
 
95
+ // src/config/enums/policy-names.ts
96
+ var eIdentityPolicyNames = {
97
+ IdentityManagement: "AbpIdentity.Roles || AbpIdentity.Users || AbpIdentity.ClaimTypes || AbpIdentity.OrganizationUnits",
98
+ Roles: "AbpIdentity.Roles",
99
+ Users: "AbpIdentity.Users",
100
+ ClaimTypes: "AbpIdentity.ClaimTypes",
101
+ OrganizationUnits: "AbpIdentity.OrganizationUnits"
102
+ };
103
+
104
+ // src/config/enums/route-names.ts
105
+ var eIdentityRouteNames = {
106
+ IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
107
+ Roles: "AbpIdentity::Roles",
108
+ Users: "AbpIdentity::Users",
109
+ ClaimTypes: "AbpIdentity::ClaimTypes",
110
+ OrganizationUnits: "AbpIdentity::OrganizationUnits"
111
+ };
112
+
113
+ // src/config/enums/setting-tab-names.ts
114
+ var eIdentitySettingTabNames = {
115
+ IdentityManagement: "AbpIdentity::Menu:IdentityManagement"
116
+ };
117
+
118
+ // src/config/providers/route.provider.ts
119
+ var import_core = require("@abpjs/core");
120
+ function configureRoutes(routes) {
121
+ return () => {
122
+ routes.add([
123
+ {
124
+ path: "/identity",
125
+ name: eIdentityRouteNames.IdentityManagement,
126
+ requiredPolicy: eIdentityPolicyNames.IdentityManagement,
127
+ layout: import_core.eLayoutType.application,
128
+ iconClass: "fas fa-id-card-o",
129
+ order: 1,
130
+ children: [
131
+ {
132
+ path: "/identity/roles",
133
+ name: eIdentityRouteNames.Roles,
134
+ requiredPolicy: eIdentityPolicyNames.Roles,
135
+ order: 1
136
+ },
137
+ {
138
+ path: "/identity/users",
139
+ name: eIdentityRouteNames.Users,
140
+ requiredPolicy: eIdentityPolicyNames.Users,
141
+ order: 2
142
+ },
143
+ {
144
+ path: "/identity/claim-types",
145
+ name: eIdentityRouteNames.ClaimTypes,
146
+ requiredPolicy: eIdentityPolicyNames.ClaimTypes,
147
+ order: 3
148
+ },
149
+ {
150
+ path: "/identity/organization-units",
151
+ name: eIdentityRouteNames.OrganizationUnits,
152
+ requiredPolicy: eIdentityPolicyNames.OrganizationUnits,
153
+ order: 4
154
+ }
155
+ ]
156
+ }
157
+ ]);
158
+ };
159
+ }
160
+ function initializeIdentityRoutes() {
161
+ const routes = (0, import_core.getRoutesService)();
162
+ return configureRoutes(routes);
163
+ }
164
+ var IDENTITY_ROUTE_PROVIDERS = {
165
+ configureRoutes
166
+ };
167
+
168
+ // src/config/providers/setting-tab.provider.ts
169
+ var import_core2 = require("@abpjs/core");
170
+ var IDENTITY_SETTING_TAB_CONFIG = {
171
+ name: eIdentitySettingTabNames.IdentityManagement,
172
+ requiredPolicy: "AbpIdentity.SettingManagement",
173
+ order: 1
174
+ };
175
+ var IdentitySettingsPlaceholder = () => null;
176
+ function configureSettingTabs(settingTabs, component = IdentitySettingsPlaceholder) {
177
+ return () => {
178
+ settingTabs.add([
179
+ {
180
+ name: IDENTITY_SETTING_TAB_CONFIG.name,
181
+ requiredPolicy: IDENTITY_SETTING_TAB_CONFIG.requiredPolicy,
182
+ order: IDENTITY_SETTING_TAB_CONFIG.order,
183
+ component
184
+ }
185
+ ]);
186
+ };
187
+ }
188
+ function initializeIdentitySettingTabs(component) {
189
+ const settingTabs = (0, import_core2.getSettingTabsService)();
190
+ return configureSettingTabs(settingTabs, component);
191
+ }
192
+ var IDENTITY_SETTING_TAB_PROVIDERS = {
193
+ configureSettingTabs
194
+ };
195
+
53
196
  // src/models/identity.ts
54
197
  var Identity;
55
198
  ((Identity2) => {
@@ -154,14 +297,20 @@ var eIdentityComponents = {
154
297
  OrganizationRoles: "Identity.OrganizationRolesComponent"
155
298
  };
156
299
 
157
- // src/enums/route-names.ts
158
- var eIdentityRouteNames = {
159
- Administration: "AbpUiNavigation::Menu:Administration",
160
- IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
161
- Roles: "AbpIdentity::Roles",
162
- Users: "AbpIdentity::Users",
163
- ClaimTypes: "AbpIdentity::ClaimTypes",
164
- OrganizationUnits: "AbpIdentity::OrganizationUnits"
300
+ // src/guards/extensions.guard.ts
301
+ async function identityExtensionsGuard() {
302
+ return true;
303
+ }
304
+ function useIdentityExtensionsGuard() {
305
+ return {
306
+ isLoaded: true,
307
+ loading: false
308
+ };
309
+ }
310
+ var IdentityExtensionsGuard = class {
311
+ canActivate() {
312
+ return identityExtensionsGuard();
313
+ }
165
314
  };
166
315
 
167
316
  // src/services/identity.service.ts
@@ -358,18 +507,40 @@ var IdentityService = class {
358
507
  body
359
508
  });
360
509
  }
510
+ /**
511
+ * Get assignable roles for users
512
+ * @since 3.0.0
513
+ * @returns Promise with roles that can be assigned to users
514
+ */
515
+ getUserAssingableRoles() {
516
+ return this.rest.request({
517
+ method: "GET",
518
+ url: "/api/identity/users/assignable-roles"
519
+ });
520
+ }
361
521
  // ========================
362
522
  // Pro: Claim Type Operations
363
523
  // ========================
364
524
  /**
365
- * Get all claim type names for dropdowns
366
- * Pro feature since 0.7.2
367
- * @returns Promise with claim type names
525
+ * Get claim types available for roles
526
+ * @since 3.0.0
527
+ * @returns Promise with claim type names for roles
368
528
  */
369
- getClaimTypeNames() {
529
+ getRolesClaimTypes() {
370
530
  return this.rest.request({
371
531
  method: "GET",
372
- url: "/api/identity/claim-types/all"
532
+ url: "/api/identity/roles/available-claim-types"
533
+ });
534
+ }
535
+ /**
536
+ * Get claim types available for users
537
+ * @since 3.0.0
538
+ * @returns Promise with claim type names for users
539
+ */
540
+ getUsersClaimTypes() {
541
+ return this.rest.request({
542
+ method: "GET",
543
+ url: "/api/identity/users/available-claim-types"
373
544
  });
374
545
  }
375
546
  /**
@@ -475,7 +646,6 @@ var IdentityStateService = class {
475
646
  this._usersTotalCount = 0;
476
647
  this._claimTypes = [];
477
648
  this._claimTypesTotalCount = 0;
478
- this._claimTypeNames = [];
479
649
  this.identityService = new IdentityService(restService);
480
650
  }
481
651
  // ========================
@@ -517,12 +687,6 @@ var IdentityStateService = class {
517
687
  getClaimTypesTotalCount() {
518
688
  return this._claimTypesTotalCount;
519
689
  }
520
- /**
521
- * Get the claim type names
522
- */
523
- getClaimTypeNames() {
524
- return this._claimTypeNames;
525
- }
526
690
  // ========================
527
691
  // Role Dispatch Methods (v2.0.0)
528
692
  // ========================
@@ -637,16 +801,6 @@ var IdentityStateService = class {
637
801
  await this.dispatchGetClaimTypes();
638
802
  return result;
639
803
  }
640
- /**
641
- * Dispatch get claim type names action
642
- * @returns Promise resolving to the claim type names
643
- * @since 2.0.0
644
- */
645
- async dispatchGetClaimTypeNames() {
646
- const result = await this.identityService.getClaimTypeNames();
647
- this._claimTypeNames = result || [];
648
- return result;
649
- }
650
804
  // ========================
651
805
  // User Dispatch Methods (v2.0.0)
652
806
  // ========================
@@ -877,9 +1031,9 @@ var OrganizationUnitService = class {
877
1031
 
878
1032
  // src/hooks/useRoles.ts
879
1033
  var import_react = require("react");
880
- var import_core = require("@abpjs/core");
1034
+ var import_core3 = require("@abpjs/core");
881
1035
  function useRoles() {
882
- const restService = (0, import_core.useRestService)();
1036
+ const restService = (0, import_core3.useRestService)();
883
1037
  const service = (0, import_react.useMemo)(() => new IdentityService(restService), [restService]);
884
1038
  const [roles, setRoles] = (0, import_react.useState)([]);
885
1039
  const [totalCount, setTotalCount] = (0, import_react.useState)(0);
@@ -1020,14 +1174,14 @@ function useRoles() {
1020
1174
 
1021
1175
  // src/hooks/useUsers.ts
1022
1176
  var import_react2 = require("react");
1023
- var import_core2 = require("@abpjs/core");
1177
+ var import_core4 = require("@abpjs/core");
1024
1178
  var DEFAULT_PAGE_QUERY = {
1025
1179
  sorting: "userName",
1026
1180
  skipCount: 0,
1027
1181
  maxResultCount: 10
1028
1182
  };
1029
1183
  function useUsers() {
1030
- const restService = (0, import_core2.useRestService)();
1184
+ const restService = (0, import_core4.useRestService)();
1031
1185
  const service = (0, import_react2.useMemo)(() => new IdentityService(restService), [restService]);
1032
1186
  const [users, setUsers] = (0, import_react2.useState)([]);
1033
1187
  const [totalCount, setTotalCount] = (0, import_react2.useState)(0);
@@ -1242,9 +1396,9 @@ function useIdentity() {
1242
1396
 
1243
1397
  // src/hooks/useClaims.ts
1244
1398
  var import_react4 = require("react");
1245
- var import_core3 = require("@abpjs/core");
1399
+ var import_core5 = require("@abpjs/core");
1246
1400
  function useClaims() {
1247
- const restService = (0, import_core3.useRestService)();
1401
+ const restService = (0, import_core5.useRestService)();
1248
1402
  const service = (0, import_react4.useMemo)(() => new IdentityService(restService), [restService]);
1249
1403
  const [claimTypes, setClaimTypes] = (0, import_react4.useState)([]);
1250
1404
  const [totalCount, setTotalCount] = (0, import_react4.useState)(0);
@@ -1270,16 +1424,31 @@ function useClaims() {
1270
1424
  return { success: false, error: errorMessage };
1271
1425
  }
1272
1426
  }, [service]);
1273
- const fetchClaimTypeNames = (0, import_react4.useCallback)(async () => {
1427
+ const fetchRolesClaimTypes = (0, import_react4.useCallback)(async () => {
1428
+ setIsLoading(true);
1429
+ setError(null);
1430
+ try {
1431
+ const response = await service.getRolesClaimTypes();
1432
+ setClaimTypeNames(response || []);
1433
+ setIsLoading(false);
1434
+ return { success: true };
1435
+ } catch (err) {
1436
+ const errorMessage = err instanceof Error ? err.message : "Failed to fetch role claim types";
1437
+ setError(errorMessage);
1438
+ setIsLoading(false);
1439
+ return { success: false, error: errorMessage };
1440
+ }
1441
+ }, [service]);
1442
+ const fetchUsersClaimTypes = (0, import_react4.useCallback)(async () => {
1274
1443
  setIsLoading(true);
1275
1444
  setError(null);
1276
1445
  try {
1277
- const response = await service.getClaimTypeNames();
1446
+ const response = await service.getUsersClaimTypes();
1278
1447
  setClaimTypeNames(response || []);
1279
1448
  setIsLoading(false);
1280
1449
  return { success: true };
1281
1450
  } catch (err) {
1282
- const errorMessage = err instanceof Error ? err.message : "Failed to fetch claim type names";
1451
+ const errorMessage = err instanceof Error ? err.message : "Failed to fetch user claim types";
1283
1452
  setError(errorMessage);
1284
1453
  setIsLoading(false);
1285
1454
  return { success: false, error: errorMessage };
@@ -1401,7 +1570,8 @@ function useClaims() {
1401
1570
  sortKey,
1402
1571
  sortOrder,
1403
1572
  fetchClaimTypes,
1404
- fetchClaimTypeNames,
1573
+ fetchRolesClaimTypes,
1574
+ fetchUsersClaimTypes,
1405
1575
  getClaimTypeById,
1406
1576
  createClaimType,
1407
1577
  updateClaimType,
@@ -1417,7 +1587,7 @@ function useClaims() {
1417
1587
 
1418
1588
  // src/components/Roles/RolesComponent.tsx
1419
1589
  var import_react5 = require("react");
1420
- var import_core4 = require("@abpjs/core");
1590
+ var import_core6 = require("@abpjs/core");
1421
1591
  var import_theme_shared = require("@abpjs/theme-shared");
1422
1592
  var import_permission_management = require("@abpjs/permission-management");
1423
1593
  var import_react6 = require("@chakra-ui/react");
@@ -1432,7 +1602,7 @@ function RolesComponent({
1432
1602
  onRoleUpdated,
1433
1603
  onRoleDeleted
1434
1604
  }) {
1435
- const { t } = (0, import_core4.useLocalization)();
1605
+ const { t } = (0, import_core6.useLocalization)();
1436
1606
  const confirmation = (0, import_theme_shared.useConfirmation)();
1437
1607
  const {
1438
1608
  roles,
@@ -1492,7 +1662,7 @@ function RolesComponent({
1492
1662
  t("AbpIdentity::RoleDeletionConfirmationMessage", name),
1493
1663
  t("AbpIdentity::AreYouSure")
1494
1664
  );
1495
- if (status === import_theme_shared.Toaster.Status.confirm) {
1665
+ if (status === import_theme_shared.Confirmation.Status.confirm) {
1496
1666
  const result = await deleteRole(id);
1497
1667
  if (result.success) {
1498
1668
  onRoleDeleted?.(id);
@@ -1647,7 +1817,7 @@ function RolesComponent({
1647
1817
 
1648
1818
  // src/components/Users/UsersComponent.tsx
1649
1819
  var import_react7 = require("react");
1650
- var import_core5 = require("@abpjs/core");
1820
+ var import_core7 = require("@abpjs/core");
1651
1821
  var import_theme_shared2 = require("@abpjs/theme-shared");
1652
1822
  var import_permission_management2 = require("@abpjs/permission-management");
1653
1823
  var import_react8 = require("@chakra-ui/react");
@@ -1668,7 +1838,7 @@ function UsersComponent({
1668
1838
  onUserUpdated,
1669
1839
  onUserDeleted
1670
1840
  }) {
1671
- const { t } = (0, import_core5.useLocalization)();
1841
+ const { t } = (0, import_core7.useLocalization)();
1672
1842
  const confirmation = (0, import_theme_shared2.useConfirmation)();
1673
1843
  const {
1674
1844
  users,
@@ -1750,7 +1920,7 @@ function UsersComponent({
1750
1920
  t("AbpIdentity::UserDeletionConfirmationMessage", userName),
1751
1921
  t("AbpIdentity::AreYouSure")
1752
1922
  );
1753
- if (status === import_theme_shared2.Toaster.Status.confirm) {
1923
+ if (status === import_theme_shared2.Confirmation.Status.confirm) {
1754
1924
  const result = await deleteUser(id);
1755
1925
  if (result.success) {
1756
1926
  onUserDeleted?.(id);
@@ -2038,7 +2208,7 @@ function UsersComponent({
2038
2208
 
2039
2209
  // src/components/Claims/ClaimsComponent.tsx
2040
2210
  var import_react9 = require("react");
2041
- var import_core6 = require("@abpjs/core");
2211
+ var import_core8 = require("@abpjs/core");
2042
2212
  var import_theme_shared3 = require("@abpjs/theme-shared");
2043
2213
  var import_react10 = require("@chakra-ui/react");
2044
2214
  var import_react11 = require("@chakra-ui/react");
@@ -2066,7 +2236,7 @@ function ClaimsComponent({
2066
2236
  onClaimTypeUpdated,
2067
2237
  onClaimTypeDeleted
2068
2238
  }) {
2069
- const { t } = (0, import_core6.useLocalization)();
2239
+ const { t } = (0, import_core8.useLocalization)();
2070
2240
  const confirmation = (0, import_theme_shared3.useConfirmation)();
2071
2241
  const {
2072
2242
  claimTypes,
@@ -2130,7 +2300,7 @@ function ClaimsComponent({
2130
2300
  t("AbpIdentity::ClaimTypeDeletionConfirmationMessage", name) || `Are you sure you want to delete the claim type '${name}'?`,
2131
2301
  t("AbpIdentity::AreYouSure")
2132
2302
  );
2133
- if (status === import_theme_shared3.Toaster.Status.confirm) {
2303
+ if (status === import_theme_shared3.Confirmation.Status.confirm) {
2134
2304
  const result = await deleteClaimType(id);
2135
2305
  if (result.success) {
2136
2306
  onClaimTypeDeleted?.(id);
@@ -2298,7 +2468,7 @@ function ClaimsComponent({
2298
2468
 
2299
2469
  // src/components/Claims/ClaimModal.tsx
2300
2470
  var import_react12 = require("react");
2301
- var import_core7 = require("@abpjs/core");
2471
+ var import_core9 = require("@abpjs/core");
2302
2472
  var import_theme_shared4 = require("@abpjs/theme-shared");
2303
2473
  var import_react13 = require("@chakra-ui/react");
2304
2474
  var import_react14 = require("@chakra-ui/react");
@@ -2311,10 +2481,11 @@ function ClaimModal({
2311
2481
  subjectType,
2312
2482
  onSaved
2313
2483
  }) {
2314
- const { t } = (0, import_core7.useLocalization)();
2484
+ const { t } = (0, import_core9.useLocalization)();
2315
2485
  const {
2316
2486
  claimTypeNames,
2317
- fetchClaimTypeNames,
2487
+ fetchRolesClaimTypes,
2488
+ fetchUsersClaimTypes,
2318
2489
  getClaims,
2319
2490
  updateClaims,
2320
2491
  isLoading
@@ -2325,10 +2496,14 @@ function ClaimModal({
2325
2496
  const [isSaving, setIsSaving] = (0, import_react12.useState)(false);
2326
2497
  const initModal = (0, import_react12.useCallback)(async () => {
2327
2498
  if (!visible || !subjectId) return;
2328
- await fetchClaimTypeNames();
2499
+ if (subjectType === "roles") {
2500
+ await fetchRolesClaimTypes();
2501
+ } else {
2502
+ await fetchUsersClaimTypes();
2503
+ }
2329
2504
  const claims = await getClaims(subjectId, subjectType);
2330
2505
  setSubjectClaims(claims);
2331
- }, [visible, subjectId, subjectType, fetchClaimTypeNames, getClaims]);
2506
+ }, [visible, subjectId, subjectType, fetchRolesClaimTypes, fetchUsersClaimTypes, getClaims]);
2332
2507
  (0, import_react12.useEffect)(() => {
2333
2508
  if (visible) {
2334
2509
  initModal();
@@ -2470,7 +2645,7 @@ function ClaimModal({
2470
2645
  }
2471
2646
 
2472
2647
  // src/constants/routes.ts
2473
- var import_core8 = require("@abpjs/core");
2648
+ var import_core10 = require("@abpjs/core");
2474
2649
  var IDENTITY_ROUTES = {
2475
2650
  routes: [
2476
2651
  {
@@ -2484,7 +2659,7 @@ var IDENTITY_ROUTES = {
2484
2659
  path: "identity",
2485
2660
  order: 1,
2486
2661
  parentName: "AbpUiNavigation::Menu:Administration",
2487
- layout: import_core8.eLayoutType.application,
2662
+ layout: import_core10.eLayoutType.application,
2488
2663
  children: [
2489
2664
  {
2490
2665
  path: "roles",
@@ -2529,6 +2704,208 @@ var IDENTITY_POLICIES = {
2529
2704
  ROLES_DELETE: "AbpIdentity.Roles.Delete"
2530
2705
  };
2531
2706
 
2707
+ // src/tokens/extensions.token.ts
2708
+ var DEFAULT_CLAIMS_ENTITY_ACTIONS = [
2709
+ {
2710
+ text: "AbpIdentity::Edit",
2711
+ permission: "AbpIdentity.ClaimTypes.Update",
2712
+ icon: "fa fa-pencil"
2713
+ },
2714
+ {
2715
+ text: "AbpIdentity::Delete",
2716
+ permission: "AbpIdentity.ClaimTypes.Delete",
2717
+ icon: "fa fa-trash"
2718
+ }
2719
+ ];
2720
+ var DEFAULT_ROLES_ENTITY_ACTIONS = [
2721
+ {
2722
+ text: "AbpIdentity::Edit",
2723
+ permission: "AbpIdentity.Roles.Update",
2724
+ icon: "fa fa-pencil"
2725
+ },
2726
+ {
2727
+ text: "AbpIdentity::Claims",
2728
+ permission: "AbpIdentity.Roles.Update",
2729
+ icon: "fa fa-list"
2730
+ },
2731
+ {
2732
+ text: "AbpIdentity::Permissions",
2733
+ permission: "AbpIdentity.Roles.ManagePermissions",
2734
+ icon: "fa fa-lock"
2735
+ },
2736
+ {
2737
+ text: "AbpIdentity::Delete",
2738
+ permission: "AbpIdentity.Roles.Delete",
2739
+ icon: "fa fa-trash"
2740
+ }
2741
+ ];
2742
+ var DEFAULT_USERS_ENTITY_ACTIONS = [
2743
+ {
2744
+ text: "AbpIdentity::Edit",
2745
+ permission: "AbpIdentity.Users.Update",
2746
+ icon: "fa fa-pencil"
2747
+ },
2748
+ {
2749
+ text: "AbpIdentity::Claims",
2750
+ permission: "AbpIdentity.Users.Update",
2751
+ icon: "fa fa-list"
2752
+ },
2753
+ {
2754
+ text: "AbpIdentity::Permissions",
2755
+ permission: "AbpIdentity.Users.ManagePermissions",
2756
+ icon: "fa fa-lock"
2757
+ },
2758
+ {
2759
+ text: "AbpIdentity::SetPassword",
2760
+ permission: "AbpIdentity.Users.Update",
2761
+ icon: "fa fa-key"
2762
+ },
2763
+ {
2764
+ text: "AbpIdentity::Unlock",
2765
+ permission: "AbpIdentity.Users.Update",
2766
+ icon: "fa fa-unlock"
2767
+ },
2768
+ {
2769
+ text: "AbpIdentity::Delete",
2770
+ permission: "AbpIdentity.Users.Delete",
2771
+ icon: "fa fa-trash"
2772
+ }
2773
+ ];
2774
+ var DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS = [
2775
+ {
2776
+ text: "AbpIdentity::Delete",
2777
+ permission: "AbpIdentity.OrganizationUnits.ManageMembers",
2778
+ icon: "fa fa-trash"
2779
+ }
2780
+ ];
2781
+ var DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS = [
2782
+ {
2783
+ text: "AbpIdentity::Delete",
2784
+ permission: "AbpIdentity.OrganizationUnits.ManageRoles",
2785
+ icon: "fa fa-trash"
2786
+ }
2787
+ ];
2788
+ var DEFAULT_IDENTITY_ENTITY_ACTIONS = {
2789
+ "Identity.ClaimsComponent": DEFAULT_CLAIMS_ENTITY_ACTIONS,
2790
+ "Identity.RolesComponent": DEFAULT_ROLES_ENTITY_ACTIONS,
2791
+ "Identity.UsersComponent": DEFAULT_USERS_ENTITY_ACTIONS,
2792
+ "Identity.OrganizationMembersComponent": DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS,
2793
+ "Identity.OrganizationRolesComponent": DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS
2794
+ };
2795
+ var DEFAULT_CLAIMS_TOOLBAR_ACTIONS = [
2796
+ {
2797
+ text: "AbpIdentity::NewClaimType",
2798
+ permission: "AbpIdentity.ClaimTypes.Create",
2799
+ icon: "fa fa-plus"
2800
+ }
2801
+ ];
2802
+ var DEFAULT_ROLES_TOOLBAR_ACTIONS = [
2803
+ {
2804
+ text: "AbpIdentity::NewRole",
2805
+ permission: "AbpIdentity.Roles.Create",
2806
+ icon: "fa fa-plus"
2807
+ }
2808
+ ];
2809
+ var DEFAULT_USERS_TOOLBAR_ACTIONS = [
2810
+ {
2811
+ text: "AbpIdentity::NewUser",
2812
+ permission: "AbpIdentity.Users.Create",
2813
+ icon: "fa fa-plus"
2814
+ }
2815
+ ];
2816
+ var DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS = [
2817
+ {
2818
+ text: "AbpIdentity::NewOrganizationUnit",
2819
+ permission: "AbpIdentity.OrganizationUnits.Create",
2820
+ icon: "fa fa-plus"
2821
+ }
2822
+ ];
2823
+ var DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
2824
+ "Identity.ClaimsComponent": DEFAULT_CLAIMS_TOOLBAR_ACTIONS,
2825
+ "Identity.RolesComponent": DEFAULT_ROLES_TOOLBAR_ACTIONS,
2826
+ "Identity.UsersComponent": DEFAULT_USERS_TOOLBAR_ACTIONS,
2827
+ "Identity.OrganizationUnitsComponent": DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS
2828
+ };
2829
+ var DEFAULT_CLAIMS_ENTITY_PROPS = [
2830
+ { type: "string", name: "name", displayName: "AbpIdentity::DisplayName:ClaimName", sortable: true },
2831
+ { type: "string", name: "valueType", displayName: "AbpIdentity::DisplayName:ClaimValueType", sortable: true },
2832
+ { type: "string", name: "regex", displayName: "AbpIdentity::DisplayName:Regex", sortable: false },
2833
+ { type: "boolean", name: "required", displayName: "AbpIdentity::DisplayName:Required", sortable: false }
2834
+ ];
2835
+ var DEFAULT_ROLES_ENTITY_PROPS = [
2836
+ { type: "string", name: "name", displayName: "AbpIdentity::RoleName", sortable: true }
2837
+ ];
2838
+ var DEFAULT_USERS_ENTITY_PROPS = [
2839
+ { type: "string", name: "userName", displayName: "AbpIdentity::UserName", sortable: true },
2840
+ { type: "string", name: "email", displayName: "AbpIdentity::EmailAddress", sortable: true },
2841
+ { type: "string", name: "phoneNumber", displayName: "AbpIdentity::PhoneNumber", sortable: false }
2842
+ ];
2843
+ var DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS = [
2844
+ { type: "string", name: "userName", displayName: "AbpIdentity::UserName", sortable: true },
2845
+ { type: "string", name: "email", displayName: "AbpIdentity::EmailAddress", sortable: true }
2846
+ ];
2847
+ var DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS = [
2848
+ { type: "string", name: "name", displayName: "AbpIdentity::RoleName", sortable: true }
2849
+ ];
2850
+ var DEFAULT_IDENTITY_ENTITY_PROPS = {
2851
+ "Identity.ClaimsComponent": DEFAULT_CLAIMS_ENTITY_PROPS,
2852
+ "Identity.RolesComponent": DEFAULT_ROLES_ENTITY_PROPS,
2853
+ "Identity.UsersComponent": DEFAULT_USERS_ENTITY_PROPS,
2854
+ "Identity.OrganizationMembersComponent": DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS,
2855
+ "Identity.OrganizationRolesComponent": DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS
2856
+ };
2857
+ var DEFAULT_CLAIMS_CREATE_FORM_PROPS = [
2858
+ { type: "string", name: "name", displayName: "AbpIdentity::DisplayName:ClaimName" },
2859
+ { type: "select", name: "valueType", displayName: "AbpIdentity::DisplayName:ClaimValueType" },
2860
+ { type: "string", name: "regex", displayName: "AbpIdentity::DisplayName:Regex" },
2861
+ { type: "string", name: "regexDescription", displayName: "AbpIdentity::DisplayName:RegexDescription" },
2862
+ { type: "boolean", name: "required", displayName: "AbpIdentity::DisplayName:Required" },
2863
+ { type: "string", name: "description", displayName: "AbpIdentity::DisplayName:Description" }
2864
+ ];
2865
+ var DEFAULT_CLAIMS_EDIT_FORM_PROPS = [
2866
+ ...DEFAULT_CLAIMS_CREATE_FORM_PROPS
2867
+ ];
2868
+ var DEFAULT_ROLES_CREATE_FORM_PROPS = [
2869
+ { type: "string", name: "name", displayName: "AbpIdentity::RoleName" },
2870
+ { type: "boolean", name: "isDefault", displayName: "AbpIdentity::DisplayName:IsDefault" },
2871
+ { type: "boolean", name: "isPublic", displayName: "AbpIdentity::DisplayName:IsPublic" }
2872
+ ];
2873
+ var DEFAULT_ROLES_EDIT_FORM_PROPS = [
2874
+ ...DEFAULT_ROLES_CREATE_FORM_PROPS
2875
+ ];
2876
+ var DEFAULT_USERS_CREATE_FORM_PROPS = [
2877
+ { type: "string", name: "userName", displayName: "AbpIdentity::UserName" },
2878
+ { type: "string", name: "name", displayName: "AbpIdentity::DisplayName:Name" },
2879
+ { type: "string", name: "surname", displayName: "AbpIdentity::DisplayName:Surname" },
2880
+ { type: "email", name: "email", displayName: "AbpIdentity::EmailAddress" },
2881
+ { type: "string", name: "phoneNumber", displayName: "AbpIdentity::PhoneNumber" },
2882
+ { type: "password", name: "password", displayName: "AbpIdentity::Password" },
2883
+ { type: "boolean", name: "lockoutEnabled", displayName: "AbpIdentity::DisplayName:LockoutEnabled" }
2884
+ ];
2885
+ var DEFAULT_USERS_EDIT_FORM_PROPS = [
2886
+ { type: "string", name: "userName", displayName: "AbpIdentity::UserName" },
2887
+ { type: "string", name: "name", displayName: "AbpIdentity::DisplayName:Name" },
2888
+ { type: "string", name: "surname", displayName: "AbpIdentity::DisplayName:Surname" },
2889
+ { type: "email", name: "email", displayName: "AbpIdentity::EmailAddress" },
2890
+ { type: "string", name: "phoneNumber", displayName: "AbpIdentity::PhoneNumber" },
2891
+ { type: "boolean", name: "lockoutEnabled", displayName: "AbpIdentity::DisplayName:LockoutEnabled" }
2892
+ ];
2893
+ var DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
2894
+ "Identity.ClaimsComponent": DEFAULT_CLAIMS_CREATE_FORM_PROPS,
2895
+ "Identity.RolesComponent": DEFAULT_ROLES_CREATE_FORM_PROPS,
2896
+ "Identity.UsersComponent": DEFAULT_USERS_CREATE_FORM_PROPS
2897
+ };
2898
+ var DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
2899
+ "Identity.ClaimsComponent": DEFAULT_CLAIMS_EDIT_FORM_PROPS,
2900
+ "Identity.RolesComponent": DEFAULT_ROLES_EDIT_FORM_PROPS,
2901
+ "Identity.UsersComponent": DEFAULT_USERS_EDIT_FORM_PROPS
2902
+ };
2903
+ var IDENTITY_ENTITY_ACTION_CONTRIBUTORS = /* @__PURE__ */ Symbol("IDENTITY_ENTITY_ACTION_CONTRIBUTORS");
2904
+ var IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = /* @__PURE__ */ Symbol("IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS");
2905
+ var IDENTITY_ENTITY_PROP_CONTRIBUTORS = /* @__PURE__ */ Symbol("IDENTITY_ENTITY_PROP_CONTRIBUTORS");
2906
+ var IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = /* @__PURE__ */ Symbol("IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS");
2907
+ var IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS = /* @__PURE__ */ Symbol("IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS");
2908
+
2532
2909
  // src/utils/tree-adapter.ts
2533
2910
  function createTreeNode(entity, nameResolver) {
2534
2911
  const resolvedName = nameResolver ? nameResolver(entity) : entity.displayName || entity.name || "";
@@ -2713,16 +3090,52 @@ var TreeAdapter = class {
2713
3090
  0 && (module.exports = {
2714
3091
  ClaimModal,
2715
3092
  ClaimsComponent,
3093
+ DEFAULT_CLAIMS_CREATE_FORM_PROPS,
3094
+ DEFAULT_CLAIMS_EDIT_FORM_PROPS,
3095
+ DEFAULT_CLAIMS_ENTITY_ACTIONS,
3096
+ DEFAULT_CLAIMS_ENTITY_PROPS,
3097
+ DEFAULT_CLAIMS_TOOLBAR_ACTIONS,
3098
+ DEFAULT_IDENTITY_CREATE_FORM_PROPS,
3099
+ DEFAULT_IDENTITY_EDIT_FORM_PROPS,
3100
+ DEFAULT_IDENTITY_ENTITY_ACTIONS,
3101
+ DEFAULT_IDENTITY_ENTITY_PROPS,
3102
+ DEFAULT_IDENTITY_TOOLBAR_ACTIONS,
3103
+ DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS,
3104
+ DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS,
3105
+ DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS,
3106
+ DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS,
3107
+ DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS,
3108
+ DEFAULT_ROLES_CREATE_FORM_PROPS,
3109
+ DEFAULT_ROLES_EDIT_FORM_PROPS,
3110
+ DEFAULT_ROLES_ENTITY_ACTIONS,
3111
+ DEFAULT_ROLES_ENTITY_PROPS,
3112
+ DEFAULT_ROLES_TOOLBAR_ACTIONS,
3113
+ DEFAULT_USERS_CREATE_FORM_PROPS,
3114
+ DEFAULT_USERS_EDIT_FORM_PROPS,
3115
+ DEFAULT_USERS_ENTITY_ACTIONS,
3116
+ DEFAULT_USERS_ENTITY_PROPS,
3117
+ DEFAULT_USERS_TOOLBAR_ACTIONS,
3118
+ IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
3119
+ IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
3120
+ IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
3121
+ IDENTITY_ENTITY_PROP_CONTRIBUTORS,
2716
3122
  IDENTITY_POLICIES,
2717
3123
  IDENTITY_ROUTES,
2718
3124
  IDENTITY_ROUTE_PATHS,
3125
+ IDENTITY_ROUTE_PROVIDERS,
3126
+ IDENTITY_SETTING_TAB_CONFIG,
3127
+ IDENTITY_SETTING_TAB_PROVIDERS,
3128
+ IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
2719
3129
  Identity,
3130
+ IdentityExtensionsGuard,
2720
3131
  IdentityService,
2721
3132
  IdentityStateService,
2722
3133
  OrganizationUnitService,
2723
3134
  RolesComponent,
2724
3135
  TreeAdapter,
2725
3136
  UsersComponent,
3137
+ configureRoutes,
3138
+ configureSettingTabs,
2726
3139
  createGetOrganizationUnitInput,
2727
3140
  createOrganizationUnitCreateDto,
2728
3141
  createOrganizationUnitCreateOrUpdateDtoBase,
@@ -2733,9 +3146,15 @@ var TreeAdapter = class {
2733
3146
  createOrganizationUnitWithDetailsDto,
2734
3147
  createTreeNode,
2735
3148
  eIdentityComponents,
3149
+ eIdentityPolicyNames,
2736
3150
  eIdentityRouteNames,
3151
+ eIdentitySettingTabNames,
3152
+ identityExtensionsGuard,
3153
+ initializeIdentityRoutes,
3154
+ initializeIdentitySettingTabs,
2737
3155
  useClaims,
2738
3156
  useIdentity,
3157
+ useIdentityExtensionsGuard,
2739
3158
  useRoles,
2740
3159
  useUsers
2741
3160
  });