mirror of
https://github.com/bitwarden/browser
synced 2026-02-06 19:53:59 +00:00
Add types, variables, and functions used across services and UI components
This commit is contained in:
@@ -166,5 +166,31 @@ export enum DrawerType {
|
||||
OrgAtRiskMembers = 2,
|
||||
OrgAtRiskApps = 3,
|
||||
}
|
||||
export interface RiskInsightsReport {
|
||||
organizationId: OrganizationId;
|
||||
date: string;
|
||||
reportData: string;
|
||||
totalMembers: number;
|
||||
totalAtRiskMembers: number;
|
||||
totalApplications: number;
|
||||
totalAtRiskApplications: number;
|
||||
totalCriticalApplications: number;
|
||||
}
|
||||
|
||||
// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented.
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface ReportInsightsReportData {}
|
||||
|
||||
// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented.
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface SaveRiskInsightsReportRequest {}
|
||||
|
||||
// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented.
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface SaveRiskInsightsReportResponse {}
|
||||
|
||||
// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented.
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface GetRiskInsightsReportResponse {}
|
||||
|
||||
export type PasswordHealthReportApplicationId = Opaque<string, "PasswordHealthReportApplicationId">;
|
||||
|
||||
@@ -4,3 +4,4 @@ export * from "./critical-apps.service";
|
||||
export * from "./critical-apps-api.service";
|
||||
export * from "./risk-insights-report.service";
|
||||
export * from "./risk-insights-data.service";
|
||||
export * from "./risk-insights-api.service";
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { OrganizationId } from "@bitwarden/common/types/guid";
|
||||
|
||||
import {
|
||||
GetRiskInsightsReportResponse,
|
||||
SaveRiskInsightsReportRequest,
|
||||
SaveRiskInsightsReportResponse,
|
||||
} from "../models/password-health";
|
||||
|
||||
export class RiskInsightsApiService {
|
||||
constructor(private apiService: ApiService) {}
|
||||
|
||||
// [FIX-ME] This method is not implemented yet.
|
||||
saveRiskInsightsReport(
|
||||
request: SaveRiskInsightsReportRequest,
|
||||
): Observable<SaveRiskInsightsReportResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
// [FIX-ME] This method is not implemented yet.
|
||||
getRiskInsightsReport(orgId: OrganizationId): Observable<GetRiskInsightsReportResponse | null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// FIXME: Update this file to be type safe
|
||||
// @ts-strict-ignore
|
||||
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
|
||||
import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service";
|
||||
import { OrganizationId } from "@bitwarden/common/types/guid";
|
||||
import { KeyService } from "@bitwarden/key-management";
|
||||
|
||||
import {
|
||||
ApplicationHealthReportDetail,
|
||||
ApplicationHealthReportSummary,
|
||||
RiskInsightsReport,
|
||||
GetRiskInsightsReportResponse,
|
||||
} from "../models/password-health";
|
||||
|
||||
export class RiskInsightsEncryptionService {
|
||||
constructor(
|
||||
private keyService: KeyService,
|
||||
private encryptService: EncryptService,
|
||||
private keyGeneratorService: KeyGenerationService,
|
||||
) {}
|
||||
|
||||
// [FIX-ME] This method is not implemented yet.
|
||||
async encryptRiskInsightsReport(
|
||||
organizationId: OrganizationId,
|
||||
details: ApplicationHealthReportDetail[],
|
||||
summary: ApplicationHealthReportSummary,
|
||||
): Promise<RiskInsightsReport> {
|
||||
return;
|
||||
}
|
||||
|
||||
// [FIX-ME] This method is not implemented yet.
|
||||
async decryptRiskInsightsReport(
|
||||
organizationId: OrganizationId,
|
||||
riskInsightsReportResponse: GetRiskInsightsReportResponse,
|
||||
): Promise<[ApplicationHealthReportDetail[], ApplicationHealthReportSummary]> {
|
||||
return [null, null];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user