@abpjs/identity 3.1.0 → 3.2.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,4 +1,4 @@
1
- import { RoutesService, ABP, RestService } from '@abpjs/core';
1
+ import { RoutesService, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleObject, PagedAndSortedResultRequestDto, PagedResultDto, ABP, RestService, ListResultDto } from '@abpjs/core';
2
2
  import React from 'react';
3
3
 
4
4
  /**
@@ -127,27 +127,179 @@ declare const eIdentityComponents: {
127
127
  */
128
128
  type IdentityComponentKey = (typeof eIdentityComponents)[keyof typeof eIdentityComponents];
129
129
 
130
+ /**
131
+ * Identity Proxy Models
132
+ * Translated from @abp/ng.identity v3.2.0
133
+ *
134
+ * These are the new typed DTOs for identity API operations.
135
+ * @since 3.2.0
136
+ */
137
+ /**
138
+ * Input for changing password
139
+ * @since 3.2.0
140
+ */
141
+ interface ChangePasswordInput {
142
+ currentPassword: string;
143
+ newPassword: string;
144
+ }
145
+ /**
146
+ * Profile DTO returned from API
147
+ * @since 3.2.0
148
+ */
149
+ interface ProfileDto extends ExtensibleObject {
150
+ userName: string;
151
+ email: string;
152
+ name: string;
153
+ surname: string;
154
+ phoneNumber: string;
155
+ isExternal: boolean;
156
+ hasPassword: boolean;
157
+ }
158
+ /**
159
+ * Input for updating profile
160
+ * @since 3.2.0
161
+ */
162
+ interface UpdateProfileDto extends ExtensibleObject {
163
+ userName: string;
164
+ email: string;
165
+ name: string;
166
+ surname: string;
167
+ phoneNumber: string;
168
+ }
169
+ /**
170
+ * Base DTO for role create/update operations
171
+ * @since 3.2.0
172
+ */
173
+ interface IdentityRoleCreateOrUpdateDtoBase extends ExtensibleObject {
174
+ name: string;
175
+ isDefault: boolean;
176
+ isPublic: boolean;
177
+ }
178
+ /**
179
+ * DTO for creating a role
180
+ * @since 3.2.0
181
+ */
182
+ type IdentityRoleCreateDto = IdentityRoleCreateOrUpdateDtoBase;
183
+ /**
184
+ * DTO for updating a role
185
+ * @since 3.2.0
186
+ */
187
+ interface IdentityRoleUpdateDto extends IdentityRoleCreateOrUpdateDtoBase {
188
+ concurrencyStamp: string;
189
+ }
190
+ /**
191
+ * Role DTO returned from API
192
+ * @since 3.2.0
193
+ */
194
+ interface IdentityRoleDto extends ExtensibleEntityDto<string> {
195
+ name: string;
196
+ isDefault: boolean;
197
+ isStatic: boolean;
198
+ isPublic: boolean;
199
+ concurrencyStamp: string;
200
+ }
201
+ /**
202
+ * Input for getting users with pagination and filtering
203
+ * @since 3.2.0
204
+ */
205
+ interface GetIdentityUsersInput extends PagedAndSortedResultRequestDto {
206
+ filter: string;
207
+ }
208
+ /**
209
+ * Base DTO for user create/update operations
210
+ * @since 3.2.0
211
+ */
212
+ interface IdentityUserCreateOrUpdateDtoBase extends ExtensibleObject {
213
+ userName: string;
214
+ name: string;
215
+ surname: string;
216
+ email: string;
217
+ phoneNumber: string;
218
+ lockoutEnabled: boolean;
219
+ roleNames: string[];
220
+ }
221
+ /**
222
+ * DTO for creating a user
223
+ * @since 3.2.0
224
+ */
225
+ interface IdentityUserCreateDto extends IdentityUserCreateOrUpdateDtoBase {
226
+ password: string;
227
+ }
228
+ /**
229
+ * DTO for updating a user
230
+ * @since 3.2.0
231
+ */
232
+ interface IdentityUserUpdateDto extends IdentityUserCreateOrUpdateDtoBase {
233
+ password: string;
234
+ concurrencyStamp: string;
235
+ }
236
+ /**
237
+ * DTO for updating user roles
238
+ * @since 3.2.0
239
+ */
240
+ interface IdentityUserUpdateRolesDto {
241
+ roleNames: string[];
242
+ }
243
+ /**
244
+ * User DTO returned from API
245
+ * @since 3.2.0
246
+ */
247
+ interface IdentityUserDto extends ExtensibleFullAuditedEntityDto<string> {
248
+ tenantId?: string;
249
+ userName: string;
250
+ name: string;
251
+ surname: string;
252
+ email: string;
253
+ emailConfirmed: boolean;
254
+ phoneNumber: string;
255
+ phoneNumberConfirmed: boolean;
256
+ lockoutEnabled: boolean;
257
+ lockoutEnd?: string;
258
+ concurrencyStamp: string;
259
+ }
260
+ /**
261
+ * Input for counting users in lookup
262
+ * @since 3.2.0
263
+ */
264
+ interface UserLookupCountInputDto {
265
+ filter: string;
266
+ }
267
+ /**
268
+ * Input for searching users in lookup
269
+ * @since 3.2.0
270
+ */
271
+ interface UserLookupSearchInputDto extends PagedAndSortedResultRequestDto {
272
+ filter: string;
273
+ }
274
+
130
275
  /**
131
276
  * Identity namespace containing all types related to identity management.
132
277
  * Translated from @abp/ng.identity Identity namespace.
278
+ *
279
+ * Changes in v3.2.0:
280
+ * - State now uses PagedResultDto and new proxy DTOs (IdentityRoleDto, IdentityUserDto)
281
+ * - Legacy types (RoleResponse, RoleItem, UserResponse, UserItem, etc.) deprecated
133
282
  */
134
283
  declare namespace Identity {
135
284
  /**
136
285
  * Identity state shape for state management
286
+ * @updated 3.2.0 - Now uses PagedResultDto and new proxy DTOs
137
287
  */
138
288
  interface State {
139
- roles: RoleResponse;
140
- users: UserResponse;
141
- selectedRole: RoleItem;
142
- selectedUser: UserItem;
143
- selectedUserRoles: RoleItem[];
289
+ roles: PagedResultDto<IdentityRoleDto>;
290
+ users: PagedResultDto<IdentityUserDto>;
291
+ selectedRole: IdentityRoleDto;
292
+ selectedUser: IdentityUserDto;
293
+ selectedUserRoles: IdentityRoleDto[];
144
294
  }
145
295
  /**
146
296
  * Paginated response for roles
297
+ * @deprecated To be deleted in v4.0. Use PagedResultDto<IdentityRoleDto> instead.
147
298
  */
148
299
  type RoleResponse = ABP.PagedResponse<RoleItem>;
149
300
  /**
150
301
  * Request payload for creating/updating a role
302
+ * @deprecated To be deleted in v4.0. Use IdentityRoleCreateDto or IdentityRoleUpdateDto instead.
151
303
  */
152
304
  interface RoleSaveRequest {
153
305
  name: string;
@@ -156,6 +308,7 @@ declare namespace Identity {
156
308
  }
157
309
  /**
158
310
  * Role item returned from the API
311
+ * @deprecated To be deleted in v4.0. Use IdentityRoleDto instead.
159
312
  */
160
313
  interface RoleItem extends RoleSaveRequest {
161
314
  isStatic: boolean;
@@ -164,10 +317,12 @@ declare namespace Identity {
164
317
  }
165
318
  /**
166
319
  * Paginated response for users
320
+ * @deprecated To be deleted in v4.0. Use PagedResultDto<IdentityUserDto> instead.
167
321
  */
168
322
  type UserResponse = ABP.PagedResponse<UserItem>;
169
323
  /**
170
324
  * Base user properties
325
+ * @deprecated To be deleted in v4.0. Use IdentityUserCreateOrUpdateDtoBase instead.
171
326
  */
172
327
  interface User {
173
328
  userName: string;
@@ -180,6 +335,7 @@ declare namespace Identity {
180
335
  }
181
336
  /**
182
337
  * User item returned from the API
338
+ * @deprecated To be deleted in v4.0. Use IdentityUserDto instead.
183
339
  */
184
340
  interface UserItem extends User {
185
341
  tenantId: string;
@@ -191,6 +347,7 @@ declare namespace Identity {
191
347
  }
192
348
  /**
193
349
  * Request payload for creating/updating a user
350
+ * @deprecated To be deleted in v4.0. Use IdentityUserCreateDto or IdentityUserUpdateDto instead.
194
351
  */
195
352
  interface UserSaveRequest extends User {
196
353
  password: string;
@@ -242,6 +399,225 @@ declare namespace Identity {
242
399
  }
243
400
  }
244
401
 
402
+ /**
403
+ * Identity Role proxy service for role management API calls
404
+ * Translated from @abp/ng.identity v3.2.0
405
+ *
406
+ * @since 3.2.0
407
+ */
408
+ declare class IdentityRoleService {
409
+ private restService;
410
+ /**
411
+ * The API name used for REST requests.
412
+ */
413
+ apiName: string;
414
+ constructor(restService: RestService);
415
+ /**
416
+ * Create a new role
417
+ * @param input - The role data to create
418
+ * @returns Promise with the created role
419
+ */
420
+ create: (input: IdentityRoleCreateDto) => Promise<IdentityRoleDto>;
421
+ /**
422
+ * Delete a role by ID
423
+ * @param id - The role ID to delete
424
+ * @returns Promise that resolves when deletion is complete
425
+ */
426
+ delete: (id: string) => Promise<void>;
427
+ /**
428
+ * Get a role by ID
429
+ * @param id - The role ID
430
+ * @returns Promise with the role
431
+ */
432
+ get: (id: string) => Promise<IdentityRoleDto>;
433
+ /**
434
+ * Get all roles without pagination
435
+ * @returns Promise with all roles
436
+ */
437
+ getAllList: () => Promise<ListResultDto<IdentityRoleDto>>;
438
+ /**
439
+ * Get roles with pagination
440
+ * @param input - Pagination and sorting parameters
441
+ * @returns Promise with paginated roles
442
+ */
443
+ getList: (input: PagedAndSortedResultRequestDto) => Promise<PagedResultDto<IdentityRoleDto>>;
444
+ /**
445
+ * Update a role
446
+ * @param id - The role ID to update
447
+ * @param input - The updated role data
448
+ * @returns Promise with the updated role
449
+ */
450
+ update: (id: string, input: IdentityRoleUpdateDto) => Promise<IdentityRoleDto>;
451
+ }
452
+
453
+ /**
454
+ * User data models for user lookup
455
+ * Translated from @abp/ng.identity v3.2.0
456
+ * @since 3.2.0
457
+ */
458
+ /**
459
+ * User data returned from user lookup service
460
+ * @since 3.2.0
461
+ */
462
+ interface UserData {
463
+ id: string;
464
+ tenantId?: string;
465
+ userName: string;
466
+ name: string;
467
+ surname: string;
468
+ email: string;
469
+ emailConfirmed: boolean;
470
+ phoneNumber: string;
471
+ phoneNumberConfirmed: boolean;
472
+ }
473
+
474
+ /**
475
+ * Identity User Lookup proxy service for user lookup API calls
476
+ * Translated from @abp/ng.identity v3.2.0
477
+ *
478
+ * @since 3.2.0
479
+ */
480
+ declare class IdentityUserLookupService {
481
+ private restService;
482
+ /**
483
+ * The API name used for REST requests.
484
+ */
485
+ apiName: string;
486
+ constructor(restService: RestService);
487
+ /**
488
+ * Find a user by ID
489
+ * @param id - The user ID
490
+ * @returns Promise with the user data
491
+ */
492
+ findById: (id: string) => Promise<UserData>;
493
+ /**
494
+ * Find a user by username
495
+ * @param userName - The username to search for
496
+ * @returns Promise with the user data
497
+ */
498
+ findByUserName: (userName: string) => Promise<UserData>;
499
+ /**
500
+ * Get count of users matching filter
501
+ * @param input - Filter parameters
502
+ * @returns Promise with the count
503
+ */
504
+ getCount: (input: UserLookupCountInputDto) => Promise<number>;
505
+ /**
506
+ * Search for users
507
+ * @param input - Search and pagination parameters
508
+ * @returns Promise with matching users
509
+ */
510
+ search: (input: UserLookupSearchInputDto) => Promise<ListResultDto<UserData>>;
511
+ }
512
+
513
+ /**
514
+ * Identity User proxy service for user management API calls
515
+ * Translated from @abp/ng.identity v3.2.0
516
+ *
517
+ * @since 3.2.0
518
+ */
519
+ declare class IdentityUserService {
520
+ private restService;
521
+ /**
522
+ * The API name used for REST requests.
523
+ */
524
+ apiName: string;
525
+ constructor(restService: RestService);
526
+ /**
527
+ * Create a new user
528
+ * @param input - The user data to create
529
+ * @returns Promise with the created user
530
+ */
531
+ create: (input: IdentityUserCreateDto) => Promise<IdentityUserDto>;
532
+ /**
533
+ * Delete a user by ID
534
+ * @param id - The user ID to delete
535
+ * @returns Promise that resolves when deletion is complete
536
+ */
537
+ delete: (id: string) => Promise<void>;
538
+ /**
539
+ * Find a user by email
540
+ * @param email - The user's email
541
+ * @returns Promise with the user
542
+ */
543
+ findByEmail: (email: string) => Promise<IdentityUserDto>;
544
+ /**
545
+ * Find a user by username
546
+ * @param username - The user's username
547
+ * @returns Promise with the user
548
+ */
549
+ findByUsername: (username: string) => Promise<IdentityUserDto>;
550
+ /**
551
+ * Get a user by ID
552
+ * @param id - The user ID
553
+ * @returns Promise with the user
554
+ */
555
+ get: (id: string) => Promise<IdentityUserDto>;
556
+ /**
557
+ * Get all roles that can be assigned to users
558
+ * @returns Promise with assignable roles
559
+ */
560
+ getAssignableRoles: () => Promise<ListResultDto<IdentityRoleDto>>;
561
+ /**
562
+ * Get users with pagination and filtering
563
+ * @param input - Pagination, sorting, and filter parameters
564
+ * @returns Promise with paginated users
565
+ */
566
+ getList: (input: GetIdentityUsersInput) => Promise<PagedResultDto<IdentityUserDto>>;
567
+ /**
568
+ * Get roles assigned to a user
569
+ * @param id - The user ID
570
+ * @returns Promise with the user's roles
571
+ */
572
+ getRoles: (id: string) => Promise<ListResultDto<IdentityRoleDto>>;
573
+ /**
574
+ * Update a user
575
+ * @param id - The user ID to update
576
+ * @param input - The updated user data
577
+ * @returns Promise with the updated user
578
+ */
579
+ update: (id: string, input: IdentityUserUpdateDto) => Promise<IdentityUserDto>;
580
+ /**
581
+ * Update a user's roles
582
+ * @param id - The user ID
583
+ * @param input - The new role assignments
584
+ * @returns Promise that resolves when update is complete
585
+ */
586
+ updateRoles: (id: string, input: IdentityUserUpdateRolesDto) => Promise<void>;
587
+ }
588
+
589
+ /**
590
+ * Profile proxy service for profile management API calls
591
+ * Translated from @abp/ng.identity v3.2.0
592
+ *
593
+ * @since 3.2.0
594
+ */
595
+ declare class ProfileService {
596
+ private restService;
597
+ /**
598
+ * The API name used for REST requests.
599
+ */
600
+ apiName: string;
601
+ constructor(restService: RestService);
602
+ /**
603
+ * Change the current user's password
604
+ * @param input - Current and new password
605
+ * @returns Promise that resolves when password is changed
606
+ */
607
+ changePassword: (input: ChangePasswordInput) => Promise<void>;
608
+ /**
609
+ * Get the current user's profile
610
+ * @returns Promise with the profile data
611
+ */
612
+ get: () => Promise<ProfileDto>;
613
+ /**
614
+ * Update the current user's profile
615
+ * @param input - Updated profile data
616
+ * @returns Promise with the updated profile
617
+ */
618
+ update: (input: UpdateProfileDto) => Promise<ProfileDto>;
619
+ }
620
+
245
621
  /**
246
622
  * Service for managing identity-related API operations.
247
623
  * Handles roles and users CRUD operations.
@@ -790,4 +1166,4 @@ declare const IDENTITY_POLICIES: {
790
1166
  readonly ROLES_DELETE: "AbpIdentity.Roles.Delete";
791
1167
  };
792
1168
 
793
- export { IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, IDENTITY_ROUTE_PROVIDERS, Identity, type IdentityComponentKey, type IdentityPolicyNameKey, type IdentityRouteNameKey, IdentityService, IdentityStateService, type PasswordRule, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserOperationResult, UsersComponent, type UsersComponentProps, configureRoutes, eIdentityComponents, eIdentityPolicyNames, eIdentityRouteNames, initializeIdentityRoutes, useIdentity, useRoles, useUsers };
1169
+ export { type ChangePasswordInput, type GetIdentityUsersInput, IDENTITY_POLICIES, IDENTITY_ROUTE_PATHS, IDENTITY_ROUTE_PROVIDERS, Identity, type IdentityComponentKey, type IdentityPolicyNameKey, type IdentityRoleCreateDto, type IdentityRoleCreateOrUpdateDtoBase, type IdentityRoleDto, IdentityRoleService, type IdentityRoleUpdateDto, type IdentityRouteNameKey, IdentityService, IdentityStateService, type IdentityUserCreateDto, type IdentityUserCreateOrUpdateDtoBase, type IdentityUserDto, IdentityUserLookupService, IdentityUserService, type IdentityUserUpdateDto, type IdentityUserUpdateRolesDto, type PasswordRule, type ProfileDto, ProfileService, type RoleOperationResult, RolesComponent, type RolesComponentProps, type SortOrder, type UpdateProfileDto, type UseIdentityReturn, type UseRolesReturn, type UseUsersReturn, type UserData, type UserLookupCountInputDto, type UserLookupSearchInputDto, type UserOperationResult, UsersComponent, type UsersComponentProps, configureRoutes, eIdentityComponents, eIdentityPolicyNames, eIdentityRouteNames, initializeIdentityRoutes, useIdentity, useRoles, useUsers };