1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-18042] Build request response structure (#15163)

* feat: add support for discover command

* feat: make client public to allow RPC

* feat: update SDK
This commit is contained in:
Andreas Coroiu
2025-06-26 14:01:31 +02:00
committed by GitHub
parent 473ab3a1f7
commit 71d4f989b7
6 changed files with 30 additions and 9 deletions

View File

@@ -1,17 +1,20 @@
import { inject } from "@angular/core";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SdkLoadService } from "@bitwarden/common/platform/abstractions/sdk/sdk-load.service";
import { IpcMessage, IpcService, isIpcMessage } from "@bitwarden/common/platform/ipc";
import {
IncomingMessage,
IpcClient,
IpcCommunicationBackend,
ipcRegisterDiscoverHandler,
OutgoingMessage,
} from "@bitwarden/sdk-internal";
export class WebIpcService extends IpcService {
private logService = inject(LogService);
private platformUtilsService = inject(PlatformUtilsService);
private communicationBackend?: IpcCommunicationBackend;
override async init() {
@@ -68,6 +71,12 @@ export class WebIpcService extends IpcService {
});
await super.initWithClient(new IpcClient(this.communicationBackend));
if (this.platformUtilsService.isDev()) {
await ipcRegisterDiscoverHandler(this.client, {
version: await this.platformUtilsService.getApplicationVersion(),
});
}
} catch (e) {
this.logService.error("[IPC] Initialization failed", e);
}