mirror of https://github.com/abpframework/abp.git
committed by
GitHub
119 changed files with 12323 additions and 17357 deletions
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", |
||||
|
"dest": "../../../dist/packages/account-core/proxy", |
||||
|
"lib": { |
||||
|
"entryFile": "src/public-api.ts" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
export * from './proxy/account'; |
||||
|
export * from './proxy/identity'; |
||||
@ -0,0 +1,37 @@ |
|||||
|
import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
import type { IdentityUserDto } from '../identity/models'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class AccountService { |
||||
|
apiName = 'AbpAccount'; |
||||
|
|
||||
|
register = (input: RegisterDto) => |
||||
|
this.restService.request<any, IdentityUserDto>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/register', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
resetPassword = (input: ResetPasswordDto) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/reset-password', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
sendPasswordResetCode = (input: SendPasswordResetCodeDto) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/send-password-reset-code', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
import type { AbpLoginResult, UserLoginInfo } from './models/models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class AccountService { |
||||
|
apiName = 'AbpAccount'; |
||||
|
|
||||
|
checkPasswordByLogin = (login: UserLoginInfo) => |
||||
|
this.restService.request<any, AbpLoginResult>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/check-password', |
||||
|
body: login, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
loginByLogin = (login: UserLoginInfo) => |
||||
|
this.restService.request<any, AbpLoginResult>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/login', |
||||
|
body: login, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
logout = () => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/account/logout', |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1 @@ |
|||||
|
export * from './lib/index'; |
||||
@ -1,43 +0,0 @@ |
|||||
import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models'; |
|
||||
import { RestService } from '@abp/ng.core'; |
|
||||
import { Injectable } from '@angular/core'; |
|
||||
import type { IdentityUserDto } from '../identity/models'; |
|
||||
|
|
||||
@Injectable({ |
|
||||
providedIn: 'root', |
|
||||
}) |
|
||||
export class AccountService { |
|
||||
apiName = 'AbpAccount'; |
|
||||
|
|
||||
register = (input: RegisterDto) => |
|
||||
this.restService.request<any, IdentityUserDto>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/account/register', |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
resetPassword = (input: ResetPasswordDto) => |
|
||||
this.restService.request<any, void>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/account/reset-password', |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
sendPasswordResetCode = (input: SendPasswordResetCodeDto) => |
|
||||
this.restService.request<any, void>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/account/send-password-reset-code', |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
constructor(private restService: RestService) {} |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
import type { AbpLoginResult, UserLoginInfo } from './models/models'; |
|
||||
import { RestService } from '@abp/ng.core'; |
|
||||
import { Injectable } from '@angular/core'; |
|
||||
|
|
||||
@Injectable({ |
|
||||
providedIn: 'root', |
|
||||
}) |
|
||||
export class AccountService { |
|
||||
apiName = 'AbpAccount'; |
|
||||
|
|
||||
checkPasswordByLogin = (login: UserLoginInfo) => |
|
||||
this.restService.request<any, AbpLoginResult>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/account/check-password', |
|
||||
body: login, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
loginByLogin = (login: UserLoginInfo) => |
|
||||
this.restService.request<any, AbpLoginResult>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/account/login', |
|
||||
body: login, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
logout = () => |
|
||||
this.restService.request<any, void>( |
|
||||
{ |
|
||||
method: 'GET', |
|
||||
url: '/api/account/logout', |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
constructor(private restService: RestService) {} |
|
||||
} |
|
||||
@ -1,26 +0,0 @@ |
|||||
import { ExtensibleObject } from './dtos'; |
|
||||
|
|
||||
export interface ChangePasswordInput { |
|
||||
currentPassword: string; |
|
||||
newPassword: string; |
|
||||
} |
|
||||
|
|
||||
export interface ProfileDto extends ExtensibleObject { |
|
||||
userName: string; |
|
||||
email: string; |
|
||||
name: string; |
|
||||
surname: string; |
|
||||
phoneNumber: string; |
|
||||
isExternal?: boolean; |
|
||||
hasPassword?: boolean; |
|
||||
emailConfirmed?: boolean; |
|
||||
phoneNumberConfirmed?: boolean; |
|
||||
} |
|
||||
|
|
||||
export interface UpdateProfileDto extends ExtensibleObject { |
|
||||
userName: string; |
|
||||
email: string; |
|
||||
name: string; |
|
||||
surname: string; |
|
||||
phoneNumber: string; |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
import { Injectable } from '@angular/core'; |
|
||||
import { ChangePasswordInput, ProfileDto, UpdateProfileDto } from '../models/profile'; |
|
||||
import { RestService } from './rest.service'; |
|
||||
|
|
||||
@Injectable({ |
|
||||
providedIn: 'root', |
|
||||
}) |
|
||||
export class ProfileService { |
|
||||
apiName = 'AbpIdentity'; |
|
||||
|
|
||||
changePassword = (input: ChangePasswordInput, skipHandleError = false) => |
|
||||
this.restService.request<ChangePasswordInput, void>( |
|
||||
{ |
|
||||
method: 'POST', |
|
||||
url: '/api/identity/my-profile/change-password', |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName, skipHandleError }, |
|
||||
); |
|
||||
|
|
||||
get = () => |
|
||||
this.restService.request<null, ProfileDto>( |
|
||||
{ |
|
||||
method: 'GET', |
|
||||
url: '/api/identity/my-profile', |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
update = (input: UpdateProfileDto) => |
|
||||
this.restService.request<UpdateProfileDto, ProfileDto>( |
|
||||
{ |
|
||||
method: 'PUT', |
|
||||
url: '/api/identity/my-profile', |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
constructor(protected restService: RestService) {} |
|
||||
} |
|
||||
@ -1,59 +0,0 @@ |
|||||
import { createHttpFactory, HttpMethod, SpectatorHttp, SpyObject } from '@ngneat/spectator/jest'; |
|
||||
import { UpdateProfileDto } from '../models'; |
|
||||
import { |
|
||||
EnvironmentService, |
|
||||
HttpErrorReporterService, |
|
||||
ProfileService, |
|
||||
RestService, |
|
||||
} from '../services'; |
|
||||
import { CORE_OPTIONS } from '../tokens'; |
|
||||
|
|
||||
describe('ProfileService', () => { |
|
||||
let spectator: SpectatorHttp<ProfileService>; |
|
||||
let environmentService: SpyObject<EnvironmentService>; |
|
||||
|
|
||||
const createHttp = createHttpFactory({ |
|
||||
service: ProfileService, |
|
||||
providers: [RestService, HttpErrorReporterService, { provide: CORE_OPTIONS, useValue: {} }], |
|
||||
mocks: [EnvironmentService], |
|
||||
}); |
|
||||
|
|
||||
beforeEach(() => { |
|
||||
spectator = createHttp(); |
|
||||
environmentService = spectator.inject(EnvironmentService); |
|
||||
const getApiUrlSpy = jest.spyOn(environmentService, 'getApiUrl'); |
|
||||
getApiUrlSpy.mockReturnValue('https://abp.io'); |
|
||||
}); |
|
||||
|
|
||||
it('should send a GET to my-profile API', () => { |
|
||||
spectator.service.get().subscribe(); |
|
||||
spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.GET); |
|
||||
}); |
|
||||
|
|
||||
it('should send a POST to change-password API', () => { |
|
||||
const mock = { currentPassword: 'test', newPassword: 'test' }; |
|
||||
spectator.service.changePassword(mock).subscribe(); |
|
||||
const req = spectator.expectOne( |
|
||||
'https://abp.io/api/identity/my-profile/change-password', |
|
||||
HttpMethod.POST, |
|
||||
); |
|
||||
expect(req.request.body).toEqual(mock); |
|
||||
}); |
|
||||
|
|
||||
it('should send a PUT to my-profile API', () => { |
|
||||
const mock = { |
|
||||
email: 'info@volosoft.com', |
|
||||
userName: 'admin', |
|
||||
name: 'John', |
|
||||
surname: 'Doe', |
|
||||
phoneNumber: '+123456', |
|
||||
isExternal: false, |
|
||||
hasPassword: false, |
|
||||
extraProperties: {}, |
|
||||
} as UpdateProfileDto; |
|
||||
|
|
||||
spectator.service.update(mock).subscribe(); |
|
||||
const req = spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.PUT); |
|
||||
expect(req.request.body).toEqual(mock); |
|
||||
}); |
|
||||
}); |
|
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", |
||||
|
"dest": "../../../dist/packages/feature-management/proxy", |
||||
|
"lib": { |
||||
|
"entryFile": "src/public-api.ts" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
export * from './proxy/feature-management'; |
||||
|
export * from './proxy/validation'; |
||||
@ -0,0 +1,29 @@ |
|||||
|
import type { GetFeatureListResultDto, UpdateFeaturesDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class FeaturesService { |
||||
|
apiName = 'AbpFeatureManagement'; |
||||
|
|
||||
|
get = (providerName: string, providerKey: string) => |
||||
|
this.restService.request<any, GetFeatureListResultDto>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/feature-management/features', |
||||
|
params: { providerName, providerKey }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (providerName: string, providerKey: string, input: UpdateFeaturesDto) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'PUT', |
||||
|
url: '/api/feature-management/features', |
||||
|
params: { providerName, providerKey }, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,3 @@ |
|||||
|
import * as FeatureManagement from './feature-management'; |
||||
|
import * as Validation from './validation'; |
||||
|
export { FeatureManagement, Validation }; |
||||
@ -0,0 +1,2 @@ |
|||||
|
import * as StringValues from './string-values'; |
||||
|
export { StringValues }; |
||||
@ -1,14 +1,13 @@ |
|||||
/* eslint-disable @typescript-eslint/ban-types */ |
|
||||
|
|
||||
export interface IStringValueType { |
export interface IStringValueType { |
||||
name: string; |
name?: string; |
||||
item: object; |
item: object; |
||||
properties: Record<string, object>; |
properties: Record<string, object>; |
||||
validator: IValueValidator; |
validator: IValueValidator; |
||||
} |
} |
||||
|
|
||||
export interface IValueValidator { |
export interface IValueValidator { |
||||
name: string; |
name?: string; |
||||
item: object; |
item: object; |
||||
properties: Record<string, object>; |
properties: Record<string, object>; |
||||
} |
} |
||||
@ -0,0 +1 @@ |
|||||
|
export * from './lib/index'; |
||||
@ -1,33 +0,0 @@ |
|||||
import type { GetFeatureListResultDto, UpdateFeaturesDto } from './models'; |
|
||||
import { RestService } from '@abp/ng.core'; |
|
||||
import { Injectable } from '@angular/core'; |
|
||||
|
|
||||
@Injectable({ |
|
||||
providedIn: 'root', |
|
||||
}) |
|
||||
export class FeaturesService { |
|
||||
apiName = 'AbpFeatureManagement'; |
|
||||
|
|
||||
get = (providerName: string, providerKey: string) => |
|
||||
this.restService.request<any, GetFeatureListResultDto>( |
|
||||
{ |
|
||||
method: 'GET', |
|
||||
url: '/api/feature-management/features', |
|
||||
params: { providerName, providerKey }, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
update = (providerName: string, providerKey: string, input: UpdateFeaturesDto) => |
|
||||
this.restService.request<any, void>( |
|
||||
{ |
|
||||
method: 'PUT', |
|
||||
url: '/api/feature-management/features', |
|
||||
params: { providerName, providerKey }, |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
constructor(private restService: RestService) {} |
|
||||
} |
|
||||
File diff suppressed because it is too large
@ -1,2 +0,0 @@ |
|||||
export * as FeatureManagement from './feature-management'; |
|
||||
export * as Validation from './validation'; |
|
||||
@ -1 +0,0 @@ |
|||||
export * as StringValues from './string-values'; |
|
||||
@ -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'; |
||||
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,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,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/index'; |
||||
@ -1,74 +0,0 @@ |
|||||
import type { ListResultDto, PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; |
|
||||
import { RestService } from '@abp/ng.core'; |
|
||||
import { Injectable } from '@angular/core'; |
|
||||
import type { IdentityRoleCreateDto, IdentityRoleDto, IdentityRoleUpdateDto } from './models'; |
|
||||
|
|
||||
@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: PagedAndSortedResultRequestDto) => |
|
||||
this.restService.request<any, PagedResultDto<IdentityRoleDto>>( |
|
||||
{ |
|
||||
method: 'GET', |
|
||||
url: '/api/identity/roles', |
|
||||
params: { |
|
||||
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) {} |
|
||||
} |
|
||||
@ -1,57 +0,0 @@ |
|||||
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) {} |
|
||||
} |
|
||||
@ -1,119 +0,0 @@ |
|||||
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) {} |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
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) {} |
|
||||
} |
|
||||
@ -1,11 +0,0 @@ |
|||||
export interface UserData { |
|
||||
id: string; |
|
||||
tenantId?: string; |
|
||||
userName: string; |
|
||||
name: string; |
|
||||
surname: string; |
|
||||
email: string; |
|
||||
emailConfirmed: boolean; |
|
||||
phoneNumber: string; |
|
||||
phoneNumberConfirmed: boolean; |
|
||||
} |
|
||||
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", |
||||
|
"dest": "../../../dist/packages/permission-management/proxy", |
||||
|
"lib": { |
||||
|
"entryFile": "src/public-api.ts" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
export * from './proxy'; |
||||
File diff suppressed because it is too large
@ -1,30 +1,31 @@ |
|||||
|
|
||||
export interface GetPermissionListResultDto { |
export interface GetPermissionListResultDto { |
||||
entityDisplayName: string; |
entityDisplayName?: string; |
||||
groups: PermissionGroupDto[]; |
groups: PermissionGroupDto[]; |
||||
} |
} |
||||
|
|
||||
export interface PermissionGrantInfoDto { |
export interface PermissionGrantInfoDto { |
||||
name: string; |
name?: string; |
||||
displayName: string; |
displayName?: string; |
||||
parentName: string; |
parentName?: string; |
||||
isGranted: boolean; |
isGranted: boolean; |
||||
allowedProviders: string[]; |
allowedProviders: string[]; |
||||
grantedProviders: ProviderInfoDto[]; |
grantedProviders: ProviderInfoDto[]; |
||||
} |
} |
||||
|
|
||||
export interface PermissionGroupDto { |
export interface PermissionGroupDto { |
||||
name: string; |
name?: string; |
||||
displayName: string; |
displayName?: string; |
||||
permissions: PermissionGrantInfoDto[]; |
permissions: PermissionGrantInfoDto[]; |
||||
} |
} |
||||
|
|
||||
export interface ProviderInfoDto { |
export interface ProviderInfoDto { |
||||
providerName: string; |
providerName?: string; |
||||
providerKey: string; |
providerKey?: string; |
||||
} |
} |
||||
|
|
||||
export interface UpdatePermissionDto { |
export interface UpdatePermissionDto { |
||||
name: string; |
name?: string; |
||||
isGranted: boolean; |
isGranted: boolean; |
||||
} |
} |
||||
|
|
||||
@ -0,0 +1,29 @@ |
|||||
|
import type { GetPermissionListResultDto, UpdatePermissionsDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class PermissionsService { |
||||
|
apiName = 'AbpPermissionManagement'; |
||||
|
|
||||
|
get = (providerName: string, providerKey: string) => |
||||
|
this.restService.request<any, GetPermissionListResultDto>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/permission-management/permissions', |
||||
|
params: { providerName, providerKey }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (providerName: string, providerKey: string, input: UpdatePermissionsDto) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'PUT', |
||||
|
url: '/api/permission-management/permissions', |
||||
|
params: { providerName, providerKey }, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
export * from './lib/index'; |
||||
@ -1,33 +0,0 @@ |
|||||
import type { GetPermissionListResultDto, UpdatePermissionsDto } from './models'; |
|
||||
import { RestService } from '@abp/ng.core'; |
|
||||
import { Injectable } from '@angular/core'; |
|
||||
|
|
||||
@Injectable({ |
|
||||
providedIn: 'root', |
|
||||
}) |
|
||||
export class PermissionsService { |
|
||||
apiName = 'AbpPermissionManagement'; |
|
||||
|
|
||||
get = (providerName: string, providerKey: string) => |
|
||||
this.restService.request<any, GetPermissionListResultDto>( |
|
||||
{ |
|
||||
method: 'GET', |
|
||||
url: '/api/permission-management/permissions', |
|
||||
params: { providerName, providerKey }, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
update = (providerName: string, providerKey: string, input: UpdatePermissionsDto) => |
|
||||
this.restService.request<any, void>( |
|
||||
{ |
|
||||
method: 'PUT', |
|
||||
url: '/api/permission-management/permissions', |
|
||||
params: { providerName, providerKey }, |
|
||||
body: input, |
|
||||
}, |
|
||||
{ apiName: this.apiName }, |
|
||||
); |
|
||||
|
|
||||
constructor(private restService: RestService) {} |
|
||||
} |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue