1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

Bulk remove organization users (#376)

* Add support for bulk deleeting org users

* Rename to UserBulkDeleteRequest

* Combine UserBulkReinviteRequest and DeleteRequest to OrganizationUserBulkRequest
This commit is contained in:
Oscar Hinton 2021-05-17 10:11:15 +02:00 committed by GitHub
parent 8659d0975d
commit 6b9246c272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -35,6 +35,7 @@ import { OrganizationTaxInfoUpdateRequest } from '../models/request/organization
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest'; import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest'; import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest'; import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';
import { OrganizationUserBulkRequest } from '../models/request/organizationUserBulkRequest';
import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest'; import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';
import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest'; import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';
import { OrganizationUserResetPasswordEnrollmentRequest } from '../models/request/organizationUserResetPasswordEnrollmentRequest'; import { OrganizationUserResetPasswordEnrollmentRequest } from '../models/request/organizationUserResetPasswordEnrollmentRequest';
@ -67,7 +68,6 @@ import { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEm
import { UpdateTwoFactorWebAuthnDeleteRequest } from '../models/request/updateTwoFactorWebAuthnDeleteRequest'; import { UpdateTwoFactorWebAuthnDeleteRequest } from '../models/request/updateTwoFactorWebAuthnDeleteRequest';
import { UpdateTwoFactorWebAuthnRequest } from '../models/request/updateTwoFactorWebAuthnRequest'; import { UpdateTwoFactorWebAuthnRequest } from '../models/request/updateTwoFactorWebAuthnRequest';
import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest'; import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';
import { UserBulkReinviteRequest } from '../models/request/userBulkReinviteRequest';
import { VerifyBankRequest } from '../models/request/verifyBankRequest'; import { VerifyBankRequest } from '../models/request/verifyBankRequest';
import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest'; import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';
import { VerifyEmailRequest } from '../models/request/verifyEmailRequest'; import { VerifyEmailRequest } from '../models/request/verifyEmailRequest';
@ -273,7 +273,7 @@ export abstract class ApiService {
getOrganizationUsers: (organizationId: string) => Promise<ListResponse<OrganizationUserUserDetailsResponse>>; getOrganizationUsers: (organizationId: string) => Promise<ListResponse<OrganizationUserUserDetailsResponse>>;
postOrganizationUserInvite: (organizationId: string, request: OrganizationUserInviteRequest) => Promise<any>; postOrganizationUserInvite: (organizationId: string, request: OrganizationUserInviteRequest) => Promise<any>;
postOrganizationUserReinvite: (organizationId: string, id: string) => Promise<any>; postOrganizationUserReinvite: (organizationId: string, id: string) => Promise<any>;
postManyOrganizationUserReinvite: (organizationId: string, request: UserBulkReinviteRequest) => Promise<any>; postManyOrganizationUserReinvite: (organizationId: string, request: OrganizationUserBulkRequest) => Promise<any>;
postOrganizationUserAccept: (organizationId: string, id: string, postOrganizationUserAccept: (organizationId: string, id: string,
request: OrganizationUserAcceptRequest) => Promise<any>; request: OrganizationUserAcceptRequest) => Promise<any>;
postOrganizationUserConfirm: (organizationId: string, id: string, postOrganizationUserConfirm: (organizationId: string, id: string,
@ -284,6 +284,7 @@ export abstract class ApiService {
putOrganizationUserResetPasswordEnrollment: (organizationId: string, userId: string, putOrganizationUserResetPasswordEnrollment: (organizationId: string, userId: string,
request: OrganizationUserResetPasswordEnrollmentRequest) => Promise<any>; request: OrganizationUserResetPasswordEnrollmentRequest) => Promise<any>;
deleteOrganizationUser: (organizationId: string, id: string) => Promise<any>; deleteOrganizationUser: (organizationId: string, id: string) => Promise<any>;
deleteManyOrganizationUsers: (organizationId: string, request: OrganizationUserBulkRequest) => Promise<any>;
getSync: () => Promise<SyncResponse>; getSync: () => Promise<SyncResponse>;
postImportDirectory: (organizationId: string, request: ImportDirectoryRequest) => Promise<any>; postImportDirectory: (organizationId: string, request: ImportDirectoryRequest) => Promise<any>;

View File

@ -1,4 +1,4 @@
export class UserBulkReinviteRequest { export class OrganizationUserBulkRequest {
ids: string[]; ids: string[];
constructor(ids: string[]) { constructor(ids: string[]) {

View File

@ -39,6 +39,7 @@ import { OrganizationTaxInfoUpdateRequest } from '../models/request/organization
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest'; import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest'; import { OrganizationUpgradeRequest } from '../models/request/organizationUpgradeRequest';
import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest'; import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';
import { OrganizationUserBulkRequest } from '../models/request/organizationUserBulkRequest';
import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest'; import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';
import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest'; import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';
import { OrganizationUserResetPasswordEnrollmentRequest } from '../models/request/organizationUserResetPasswordEnrollmentRequest'; import { OrganizationUserResetPasswordEnrollmentRequest } from '../models/request/organizationUserResetPasswordEnrollmentRequest';
@ -71,7 +72,6 @@ import { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEm
import { UpdateTwoFactorWebAuthnDeleteRequest } from '../models/request/updateTwoFactorWebAuthnDeleteRequest'; import { UpdateTwoFactorWebAuthnDeleteRequest } from '../models/request/updateTwoFactorWebAuthnDeleteRequest';
import { UpdateTwoFactorWebAuthnRequest } from '../models/request/updateTwoFactorWebAuthnRequest'; import { UpdateTwoFactorWebAuthnRequest } from '../models/request/updateTwoFactorWebAuthnRequest';
import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest'; import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';
import { UserBulkReinviteRequest } from '../models/request/userBulkReinviteRequest';
import { VerifyBankRequest } from '../models/request/verifyBankRequest'; import { VerifyBankRequest } from '../models/request/verifyBankRequest';
import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest'; import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';
import { VerifyEmailRequest } from '../models/request/verifyEmailRequest'; import { VerifyEmailRequest } from '../models/request/verifyEmailRequest';
@ -802,7 +802,7 @@ export class ApiService implements ApiServiceAbstraction {
return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/reinvite', null, true, false); return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/reinvite', null, true, false);
} }
postManyOrganizationUserReinvite(organizationId: string, request: UserBulkReinviteRequest): Promise<any> { postManyOrganizationUserReinvite(organizationId: string, request: OrganizationUserBulkRequest): Promise<any> {
return this.send('POST', '/organizations/' + organizationId + '/users/reinvite', request, true, false); return this.send('POST', '/organizations/' + organizationId + '/users/reinvite', request, true, false);
} }
@ -836,6 +836,10 @@ export class ApiService implements ApiServiceAbstraction {
return this.send('DELETE', '/organizations/' + organizationId + '/users/' + id, null, true, false); return this.send('DELETE', '/organizations/' + organizationId + '/users/' + id, null, true, false);
} }
deleteManyOrganizationUsers(organizationId: string, request: OrganizationUserBulkRequest): Promise<any> {
return this.send('DELETE', '/organizations/' + organizationId + '/users', request, true, false);
}
// Plan APIs // Plan APIs
async getPlans(): Promise<ListResponse<PlanResponse>> { async getPlans(): Promise<ListResponse<PlanResponse>> {