mirror of https://github.com/abpframework/abp.git
15 changed files with 5678 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", |
||||
|
"dest": "../../../dist/packages/identity/proxy", |
||||
|
"lib": { |
||||
|
"entryFile": "src/public-api.ts" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
export * from './proxy/identity'; |
||||
|
export * from './proxy/users'; |
||||
@ -0,0 +1,17 @@ |
|||||
|
# Proxy Generation Output |
||||
|
|
||||
|
This directory includes the output of the latest proxy generation. |
||||
|
The files and folders in it will be overwritten when proxy generation is run again. |
||||
|
Therefore, please do not place your own content in this folder. |
||||
|
|
||||
|
In addition, `generate-proxy.json` works like a lock file. |
||||
|
It includes information used by the proxy generator, so please do not delete or modify it. |
||||
|
|
||||
|
Finally, the name of the files and folders should not be changed for two reasons: |
||||
|
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content. |
||||
|
- ABP Suite generates files which include imports from this folder. |
||||
|
|
||||
|
> **Important Notice:** If you are building a module and are planning to publish to npm, |
||||
|
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case, |
||||
|
> please make sure you export files directly and not from barrel exports. In other words, |
||||
|
> do not include index.ts exports in your public-api.ts exports. |
||||
File diff suppressed because it is too large
@ -0,0 +1,58 @@ |
|||||
|
import type { GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleDto, IdentityRoleUpdateDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import type { ListResultDto, PagedResultDto } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class IdentityRoleService { |
||||
|
apiName = 'AbpIdentity'; |
||||
|
|
||||
|
create = (input: IdentityRoleCreateDto) => |
||||
|
this.restService.request<any, IdentityRoleDto>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/identity/roles', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
delete = (id: string) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'DELETE', |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
get = (id: string) => |
||||
|
this.restService.request<any, IdentityRoleDto>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getAllList = () => |
||||
|
this.restService.request<any, ListResultDto<IdentityRoleDto>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/roles/all', |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getList = (input: GetIdentityRolesInput) => |
||||
|
this.restService.request<any, PagedResultDto<IdentityRoleDto>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/roles', |
||||
|
params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (id: string, input: IdentityRoleUpdateDto) => |
||||
|
this.restService.request<any, IdentityRoleDto>({ |
||||
|
method: 'PUT', |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
import type { UserLookupCountInputDto, UserLookupSearchInputDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import type { ListResultDto } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
import type { UserData } from '../users/models'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class IdentityUserLookupService { |
||||
|
apiName = 'AbpIdentity'; |
||||
|
|
||||
|
findById = (id: string) => |
||||
|
this.restService.request<any, UserData>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/lookup/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
findByUserName = (userName: string) => |
||||
|
this.restService.request<any, UserData>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/lookup/by-username/${userName}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getCount = (input: UserLookupCountInputDto) => |
||||
|
this.restService.request<any, number>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/users/lookup/count', |
||||
|
params: { filter: input.filter }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
search = (input: UserLookupSearchInputDto) => |
||||
|
this.restService.request<any, ListResultDto<UserData>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/users/lookup/search', |
||||
|
params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
import type { GetIdentityUsersInput, IdentityRoleDto, IdentityUserCreateDto, IdentityUserDto, IdentityUserUpdateDto, IdentityUserUpdateRolesDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import type { ListResultDto, PagedResultDto } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class IdentityUserService { |
||||
|
apiName = 'AbpIdentity'; |
||||
|
|
||||
|
create = (input: IdentityUserCreateDto) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/identity/users', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
delete = (id: string) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'DELETE', |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
findByEmail = (email: string) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/by-email/${email}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
findByUsername = (userName: string) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/by-username/${userName}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
get = (id: string) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getAssignableRoles = () => |
||||
|
this.restService.request<any, ListResultDto<IdentityRoleDto>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/users/assignable-roles', |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getList = (input: GetIdentityUsersInput) => |
||||
|
this.restService.request<any, PagedResultDto<IdentityUserDto>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/users', |
||||
|
params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getRoles = (id: string) => |
||||
|
this.restService.request<any, ListResultDto<IdentityRoleDto>>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/identity/users/${id}/roles`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (id: string, input: IdentityUserUpdateDto) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'PUT', |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
updateRoles = (id: string, input: IdentityUserUpdateRolesDto) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'PUT', |
||||
|
url: `/api/identity/users/${id}/roles`, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
export * from './identity-role.service'; |
||||
|
export * from './identity-user-lookup.service'; |
||||
|
export * from './identity-user.service'; |
||||
|
export * from './models'; |
||||
|
export * from './profile.service'; |
||||
@ -0,0 +1,100 @@ |
|||||
|
import type { ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleObject, PagedAndSortedResultRequestDto } from '@abp/ng.core'; |
||||
|
|
||||
|
export interface ChangePasswordInput { |
||||
|
currentPassword?: string; |
||||
|
newPassword: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetIdentityRolesInput extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetIdentityUsersInput extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityRoleCreateDto extends IdentityRoleCreateOrUpdateDtoBase { |
||||
|
} |
||||
|
|
||||
|
export interface IdentityRoleCreateOrUpdateDtoBase extends ExtensibleObject { |
||||
|
name: string; |
||||
|
isDefault: boolean; |
||||
|
isPublic: boolean; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityRoleDto extends ExtensibleEntityDto<string> { |
||||
|
name?: string; |
||||
|
isDefault: boolean; |
||||
|
isStatic: boolean; |
||||
|
isPublic: boolean; |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityRoleUpdateDto extends IdentityRoleCreateOrUpdateDtoBase { |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityUserCreateDto extends IdentityUserCreateOrUpdateDtoBase { |
||||
|
password: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityUserCreateOrUpdateDtoBase extends ExtensibleObject { |
||||
|
userName: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
email: string; |
||||
|
phoneNumber?: string; |
||||
|
lockoutEnabled: boolean; |
||||
|
roleNames: string[]; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityUserDto extends ExtensibleFullAuditedEntityDto<string> { |
||||
|
tenantId?: string; |
||||
|
userName?: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
email?: string; |
||||
|
emailConfirmed: boolean; |
||||
|
phoneNumber?: string; |
||||
|
phoneNumberConfirmed: boolean; |
||||
|
lockoutEnabled: boolean; |
||||
|
lockoutEnd?: string; |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityUserUpdateDto extends IdentityUserCreateOrUpdateDtoBase { |
||||
|
password?: string; |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityUserUpdateRolesDto { |
||||
|
roleNames: string[]; |
||||
|
} |
||||
|
|
||||
|
export interface ProfileDto extends ExtensibleObject { |
||||
|
userName?: string; |
||||
|
email?: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
phoneNumber?: string; |
||||
|
isExternal: boolean; |
||||
|
hasPassword: boolean; |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface UpdateProfileDto extends ExtensibleObject { |
||||
|
userName?: string; |
||||
|
email?: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
phoneNumber?: string; |
||||
|
concurrencyStamp?: string; |
||||
|
} |
||||
|
|
||||
|
export interface UserLookupCountInputDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface UserLookupSearchInputDto extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
import type { ChangePasswordInput, ProfileDto, UpdateProfileDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class ProfileService { |
||||
|
apiName = 'AbpIdentity'; |
||||
|
|
||||
|
changePassword = (input: ChangePasswordInput) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/identity/my-profile/change-password', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
get = () => |
||||
|
this.restService.request<any, ProfileDto>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/identity/my-profile', |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (input: UpdateProfileDto) => |
||||
|
this.restService.request<any, ProfileDto>({ |
||||
|
method: 'PUT', |
||||
|
url: '/api/identity/my-profile', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
import * as Identity from './identity'; |
||||
|
import * as Users from './users'; |
||||
|
export { Identity, Users }; |
||||
@ -0,0 +1 @@ |
|||||
|
export * from './models'; |
||||
@ -0,0 +1,12 @@ |
|||||
|
|
||||
|
export interface UserData { |
||||
|
id?: string; |
||||
|
tenantId?: string; |
||||
|
userName?: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
email?: string; |
||||
|
emailConfirmed: boolean; |
||||
|
phoneNumber?: string; |
||||
|
phoneNumberConfirmed: boolean; |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
export * from './lib'; |
||||
Loading…
Reference in new issue