@abpjs/identity 2.2.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,56 @@
1
1
  import { ABP, RestService } from '@abpjs/core';
2
2
  import React from 'react';
3
3
 
4
+ /**
5
+ * Component keys for the Identity module.
6
+ * These keys are used for component replacement/customization.
7
+ * @since 2.7.0
8
+ */
9
+ declare const eIdentityComponents: {
10
+ /**
11
+ * Key for the Roles component.
12
+ * Use this to replace the default RolesComponent with a custom implementation.
13
+ */
14
+ readonly Roles: "Identity.RolesComponent";
15
+ /**
16
+ * Key for the Users component.
17
+ * Use this to replace the default UsersComponent with a custom implementation.
18
+ */
19
+ readonly Users: "Identity.UsersComponent";
20
+ };
21
+ /**
22
+ * Type for identity component key values
23
+ */
24
+ type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
25
+
26
+ /**
27
+ * Route names for the Identity module.
28
+ * These are used for navigation menu items and breadcrumbs.
29
+ * @since 2.7.0
30
+ */
31
+ declare const eIdentityRouteNames: {
32
+ /**
33
+ * Administration menu item name.
34
+ */
35
+ readonly Administration: "AbpUiNavigation::Menu:Administration";
36
+ /**
37
+ * Identity Management menu item name.
38
+ */
39
+ readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
40
+ /**
41
+ * Roles menu item name.
42
+ */
43
+ readonly Roles: "AbpIdentity::Roles";
44
+ /**
45
+ * Users menu item name.
46
+ */
47
+ readonly Users: "AbpIdentity::Users";
48
+ };
49
+ /**
50
+ * Type for identity route name values
51
+ */
52
+ type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
53
+
4
54
  /**
5
55
  * Identity namespace containing all types related to identity management.
6
56
  * Translated from @abp/ng.identity Identity namespace.
@@ -120,10 +170,15 @@ declare namespace Identity {
120
170
  * Service for managing identity-related API operations.
121
171
  * Handles roles and users CRUD operations.
122
172
  *
123
- * Translated from @abp/ng.identity IdentityService
173
+ * Translated from @abp/ng.identity IdentityService v2.4.0
124
174
  */
125
175
  declare class IdentityService {
126
176
  private rest;
177
+ /**
178
+ * The API name used for REST requests.
179
+ * @since 2.4.0
180
+ */
181
+ apiName: string;
127
182
  constructor(rest: RestService);
128
183
  /**
129
184
  * Get all roles with optional pagination/filtering (v0.9.0)
@@ -131,6 +186,13 @@ declare class IdentityService {
131
186
  * @returns Promise with paginated role response
132
187
  */
133
188
  getRoles(params?: ABP.PageQueryParams): Promise<Identity.RoleResponse>;
189
+ /**
190
+ * Get all roles without pagination.
191
+ * Fetches all roles in a single request.
192
+ * @since 2.4.0
193
+ * @returns Promise with all roles
194
+ */
195
+ getAllRoles(): Promise<Identity.RoleResponse>;
134
196
  /**
135
197
  * Get a role by ID
136
198
  * @param id - The role ID
@@ -569,6 +631,9 @@ interface RolesComponentProps {
569
631
  * ```
570
632
  */
571
633
  declare function RolesComponent({ onRoleCreated, onRoleUpdated, onRoleDeleted, onVisiblePermissionChange, }: RolesComponentProps): React.ReactElement;
634
+ declare namespace RolesComponent {
635
+ var componentKey: "Identity.RolesComponent";
636
+ }
572
637
 
573
638
  /**
574
639
  * Password rule type for validation display
@@ -602,6 +667,9 @@ interface UsersComponentProps {
602
667
  onVisiblePermissionChange?: (visible: boolean) => void;
603
668
  }
604
669
  declare function UsersComponent({ onUserCreated, onUserUpdated, onUserDeleted, passwordRulesArr, requiredPasswordLength, onVisiblePermissionChange, }: UsersComponentProps): React.ReactElement;
670
+ declare namespace UsersComponent {
671
+ var componentKey: "Identity.UsersComponent";
672
+ }
605
673
 
606
674
  /**
607
675
  * Route paths for the identity module.
@@ -637,4 +705,4 @@ declare const IDENTITY_POLICIES: {
637
705
  readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
638
706
  };
639
707
 
640
- export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, Identity, IdentityService, IdentityStateService, type PasswordRule, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, useIdentity, useRoles, useUsers };
708
+ export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, Identity, type IdentityComponentKey, type IdentityRouteNameKey, IdentityService, IdentityStateService, type PasswordRule, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, eIdentityComponents, eIdentityRouteNames, useIdentity, useRoles, useUsers };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,56 @@
1
1
  import { ABP, RestService } from '@abpjs/core';
2
2
  import React from 'react';
3
3
 
4
+ /**
5
+ * Component keys for the Identity module.
6
+ * These keys are used for component replacement/customization.
7
+ * @since 2.7.0
8
+ */
9
+ declare const eIdentityComponents: {
10
+ /**
11
+ * Key for the Roles component.
12
+ * Use this to replace the default RolesComponent with a custom implementation.
13
+ */
14
+ readonly Roles: "Identity.RolesComponent";
15
+ /**
16
+ * Key for the Users component.
17
+ * Use this to replace the default UsersComponent with a custom implementation.
18
+ */
19
+ readonly Users: "Identity.UsersComponent";
20
+ };
21
+ /**
22
+ * Type for identity component key values
23
+ */
24
+ type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
25
+
26
+ /**
27
+ * Route names for the Identity module.
28
+ * These are used for navigation menu items and breadcrumbs.
29
+ * @since 2.7.0
30
+ */
31
+ declare const eIdentityRouteNames: {
32
+ /**
33
+ * Administration menu item name.
34
+ */
35
+ readonly Administration: "AbpUiNavigation::Menu:Administration";
36
+ /**
37
+ * Identity Management menu item name.
38
+ */
39
+ readonly IdentityManagement: "AbpIdentity::Menu:IdentityManagement";
40
+ /**
41
+ * Roles menu item name.
42
+ */
43
+ readonly Roles: "AbpIdentity::Roles";
44
+ /**
45
+ * Users menu item name.
46
+ */
47
+ readonly Users: "AbpIdentity::Users";
48
+ };
49
+ /**
50
+ * Type for identity route name values
51
+ */
52
+ type IdentityRouteNameKey = (typeof eIdentityRouteNames)[keyof typeof eIdentityRouteNames];
53
+
4
54
  /**
5
55
  * Identity namespace containing all types related to identity management.
6
56
  * Translated from @abp/ng.identity Identity namespace.
@@ -120,10 +170,15 @@ declare namespace Identity {
120
170
  * Service for managing identity-related API operations.
121
171
  * Handles roles and users CRUD operations.
122
172
  *
123
- * Translated from @abp/ng.identity IdentityService
173
+ * Translated from @abp/ng.identity IdentityService v2.4.0
124
174
  */
125
175
  declare class IdentityService {
126
176
  private rest;
177
+ /**
178
+ * The API name used for REST requests.
179
+ * @since 2.4.0
180
+ */
181
+ apiName: string;
127
182
  constructor(rest: RestService);
128
183
  /**
129
184
  * Get all roles with optional pagination/filtering (v0.9.0)
@@ -131,6 +186,13 @@ declare class IdentityService {
131
186
  * @returns Promise with paginated role response
132
187
  */
133
188
  getRoles(params?: ABP.PageQueryParams): Promise<Identity.RoleResponse>;
189
+ /**
190
+ * Get all roles without pagination.
191
+ * Fetches all roles in a single request.
192
+ * @since 2.4.0
193
+ * @returns Promise with all roles
194
+ */
195
+ getAllRoles(): Promise<Identity.RoleResponse>;
134
196
  /**
135
197
  * Get a role by ID
136
198
  * @param id - The role ID
@@ -569,6 +631,9 @@ interface RolesComponentProps {
569
631
  * ```
570
632
  */
571
633
  declare function RolesComponent({ onRoleCreated, onRoleUpdated, onRoleDeleted, onVisiblePermissionChange, }: RolesComponentProps): React.ReactElement;
634
+ declare namespace RolesComponent {
635
+ var componentKey: "Identity.RolesComponent";
636
+ }
572
637
 
573
638
  /**
574
639
  * Password rule type for validation display
@@ -602,6 +667,9 @@ interface UsersComponentProps {
602
667
  onVisiblePermissionChange?: (visible: boolean) => void;
603
668
  }
604
669
  declare function UsersComponent({ onUserCreated, onUserUpdated, onUserDeleted, passwordRulesArr, requiredPasswordLength, onVisiblePermissionChange, }: UsersComponentProps): React.ReactElement;
670
+ declare namespace UsersComponent {
671
+ var componentKey: "Identity.UsersComponent";
672
+ }
605
673
 
606
674
  /**
607
675
  * Route paths for the identity module.
@@ -637,4 +705,4 @@ declare const IDENTITY_POLICIES: {
637
705
  readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
638
706
  };
639
707
 
640
- export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, Identity, IdentityService, IdentityStateService, type PasswordRule, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, useIdentity, useRoles, useUsers };
708
+ export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, Identity, type IdentityComponentKey, type IdentityRouteNameKey, IdentityService, IdentityStateService, type PasswordRule, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, eIdentityComponents, eIdentityRouteNames, useIdentity, useRoles, useUsers };
package/dist/index.js CHANGED
@@ -26,15 +26,56 @@ __export(index_exports, {
26
26
  IdentityStateService: () => IdentityStateService,
27
27
  RolesComponent: () => RolesComponent,
28
28
  UsersComponent: () => UsersComponent,
29
+ eIdentityComponents: () => eIdentityComponents,
30
+ eIdentityRouteNames: () => eIdentityRouteNames,
29
31
  useIdentity: () => useIdentity,
30
32
  useRoles: () => useRoles,
31
33
  useUsers: () => useUsers
32
34
  });
33
35
  module.exports = __toCommonJS(index_exports);
34
36
 
37
+ // src/enums/components.ts
38
+ var eIdentityComponents = {
39
+ /**
40
+ * Key for the Roles component.
41
+ * Use this to replace the default RolesComponent with a custom implementation.
42
+ */
43
+ Roles: "Identity.RolesComponent",
44
+ /**
45
+ * Key for the Users component.
46
+ * Use this to replace the default UsersComponent with a custom implementation.
47
+ */
48
+ Users: "Identity.UsersComponent"
49
+ };
50
+
51
+ // src/enums/route-names.ts
52
+ var eIdentityRouteNames = {
53
+ /**
54
+ * Administration menu item name.
55
+ */
56
+ Administration: "AbpUiNavigation::Menu:Administration",
57
+ /**
58
+ * Identity Management menu item name.
59
+ */
60
+ IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
61
+ /**
62
+ * Roles menu item name.
63
+ */
64
+ Roles: "AbpIdentity::Roles",
65
+ /**
66
+ * Users menu item name.
67
+ */
68
+ Users: "AbpIdentity::Users"
69
+ };
70
+
35
71
  // src/services/identity.service.ts
36
72
  var IdentityService = class {
37
73
  constructor(rest) {
74
+ /**
75
+ * The API name used for REST requests.
76
+ * @since 2.4.0
77
+ */
78
+ this.apiName = "default";
38
79
  this.rest = rest;
39
80
  }
40
81
  // ========================
@@ -52,6 +93,18 @@ var IdentityService = class {
52
93
  params
53
94
  });
54
95
  }
96
+ /**
97
+ * Get all roles without pagination.
98
+ * Fetches all roles in a single request.
99
+ * @since 2.4.0
100
+ * @returns Promise with all roles
101
+ */
102
+ getAllRoles() {
103
+ return this.rest.request({
104
+ method: "GET",
105
+ url: "/api/identity/roles/all"
106
+ });
107
+ }
55
108
  /**
56
109
  * Get a role by ID
57
110
  * @param id - The role ID
@@ -857,6 +910,7 @@ function RolesComponent({
857
910
  )
858
911
  ] });
859
912
  }
913
+ RolesComponent.componentKey = eIdentityComponents.Roles;
860
914
 
861
915
  // src/components/Users/UsersComponent.tsx
862
916
  var import_react6 = require("react");
@@ -1275,6 +1329,7 @@ function UsersComponent({
1275
1329
  )
1276
1330
  ] });
1277
1331
  }
1332
+ UsersComponent.componentKey = eIdentityComponents.Users;
1278
1333
 
1279
1334
  // src/constants/routes.ts
1280
1335
  var IDENTITY_ROUTE_PATHS = {
@@ -1311,6 +1366,8 @@ var IDENTITY_POLICIES = {
1311
1366
  IdentityStateService,
1312
1367
  RolesComponent,
1313
1368
  UsersComponent,
1369
+ eIdentityComponents,
1370
+ eIdentityRouteNames,
1314
1371
  useIdentity,
1315
1372
  useRoles,
1316
1373
  useUsers
package/dist/index.mjs CHANGED
@@ -1,6 +1,45 @@
1
+ // src/enums/components.ts
2
+ var eIdentityComponents = {
3
+ /**
4
+ * Key for the Roles component.
5
+ * Use this to replace the default RolesComponent with a custom implementation.
6
+ */
7
+ Roles: "Identity.RolesComponent",
8
+ /**
9
+ * Key for the Users component.
10
+ * Use this to replace the default UsersComponent with a custom implementation.
11
+ */
12
+ Users: "Identity.UsersComponent"
13
+ };
14
+
15
+ // src/enums/route-names.ts
16
+ var eIdentityRouteNames = {
17
+ /**
18
+ * Administration menu item name.
19
+ */
20
+ Administration: "AbpUiNavigation::Menu:Administration",
21
+ /**
22
+ * Identity Management menu item name.
23
+ */
24
+ IdentityManagement: "AbpIdentity::Menu:IdentityManagement",
25
+ /**
26
+ * Roles menu item name.
27
+ */
28
+ Roles: "AbpIdentity::Roles",
29
+ /**
30
+ * Users menu item name.
31
+ */
32
+ Users: "AbpIdentity::Users"
33
+ };
34
+
1
35
  // src/services/identity.service.ts
2
36
  var IdentityService = class {
3
37
  constructor(rest) {
38
+ /**
39
+ * The API name used for REST requests.
40
+ * @since 2.4.0
41
+ */
42
+ this.apiName = "default";
4
43
  this.rest = rest;
5
44
  }
6
45
  // ========================
@@ -18,6 +57,18 @@ var IdentityService = class {
18
57
  params
19
58
  });
20
59
  }
60
+ /**
61
+ * Get all roles without pagination.
62
+ * Fetches all roles in a single request.
63
+ * @since 2.4.0
64
+ * @returns Promise with all roles
65
+ */
66
+ getAllRoles() {
67
+ return this.rest.request({
68
+ method: "GET",
69
+ url: "/api/identity/roles/all"
70
+ });
71
+ }
21
72
  /**
22
73
  * Get a role by ID
23
74
  * @param id - The role ID
@@ -832,6 +883,7 @@ function RolesComponent({
832
883
  )
833
884
  ] });
834
885
  }
886
+ RolesComponent.componentKey = eIdentityComponents.Roles;
835
887
 
836
888
  // src/components/Users/UsersComponent.tsx
837
889
  import { useEffect as useEffect2, useState as useState4, useCallback as useCallback5, useMemo as useMemo4 } from "react";
@@ -1261,6 +1313,7 @@ function UsersComponent({
1261
1313
  )
1262
1314
  ] });
1263
1315
  }
1316
+ UsersComponent.componentKey = eIdentityComponents.Users;
1264
1317
 
1265
1318
  // src/constants/routes.ts
1266
1319
  var IDENTITY_ROUTE_PATHS = {
@@ -1296,6 +1349,8 @@ export {
1296
1349
  IdentityStateService,
1297
1350
  RolesComponent,
1298
1351
  UsersComponent,
1352
+ eIdentityComponents,
1353
+ eIdentityRouteNames,
1299
1354
  useIdentity,
1300
1355
  useRoles,
1301
1356
  useUsers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abpjs/identity",
3
- "version": "2.2.0",
3
+ "version": "2.7.0",
4
4
  "description": "ABP Framework identity components for React - translated from @abp/ng.identity",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@chakra-ui/react": "^3.2.0",
27
27
  "@emotion/react": "^11.11.0",
28
- "@abpjs/theme-shared": "2.2.0",
29
- "@abpjs/core": "2.2.0",
30
- "@abpjs/permission-management": "2.2.0"
28
+ "@abpjs/theme-shared": "2.7.0",
29
+ "@abpjs/core": "2.7.0",
30
+ "@abpjs/permission-management": "2.7.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@abp/ng.identity": "2.2.0",
33
+ "@abp/ng.identity": "2.7.0",
34
34
  "@testing-library/jest-dom": "^6.9.1",
35
35
  "@testing-library/react": "^14.0.0",
36
36
  "@testing-library/user-event": "^14.6.1",