1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00
Files
browser/libs/admin-console/src/common/organization-user/abstractions/organization-user.service.ts
Brandon Treston 8162c06700 [PM-26372] Add auto confirm service (#17001)
* add state definition for auto confirm

* typo

* refactor organziation user service

* WIP create auto confirm service

* add POST method, finish implementation

* add missing userId param, jsdoc

* fix DI

* refactor organziation user service

* WIP create auto confirm service

* add POST method, finish implementation

* add missing userId param, jsdoc

* clean up, more DI fixes

* remove @Injectable from service, fix tests

* remove from libs/common, fix dir structure, add tests
2025-10-28 09:47:54 -04:00

46 lines
1.6 KiB
TypeScript

import { Observable } from "rxjs";
import {
OrganizationUserConfirmRequest,
OrganizationUserBulkResponse,
} from "@bitwarden/admin-console/common";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { ListResponse } from "@bitwarden/common/models/response/list.response";
export abstract class OrganizationUserService {
/**
* Builds a confirmation request for an organization user.
* @param organization - The organization the user belongs to
* @param publicKey - The user's public key
* @returns An observable that emits the confirmation request
*/
abstract buildConfirmRequest(
organization: Organization,
publicKey: Uint8Array,
): Observable<OrganizationUserConfirmRequest>;
/**
* Confirms a user in an organization.
* @param organization - The organization the user belongs to
* @param userId - The ID of the user to confirm
* @param publicKey - The user's public key
* @returns An observable that completes when the user is confirmed
*/
abstract confirmUser(
organization: Organization,
userId: string,
publicKey: Uint8Array,
): Observable<void>;
/**
* Confirms multiple users in an organization.
* @param organization - The organization the users belong to
* @param userIdsWithKeys - Array of user IDs with their encrypted keys
* @returns An observable that emits the bulk confirmation response
*/
abstract bulkConfirmUsers(
organization: Organization,
userIdsWithKeys: { id: string; key: string }[],
): Observable<ListResponse<OrganizationUserBulkResponse>>;
}