summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-11-03 19:38:17 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-03-14 13:58:44 +0100
commitd5f21653bec09d342112d66c5d20eca38e16b49e (patch)
tree9d6b8baacd70c2f84909e45fc7ea9976e9314e4d /gui/src/shared
parent46fa74ad03658ad0afa9dc984565b7f10106af94 (diff)
downloadmullvadvpn-d5f21653bec09d342112d66c5d20eca38e16b49e.tar.xz
mullvadvpn-d5f21653bec09d342112d66c5d20eca38e16b49e.zip
Add rpc and ipc calls for listing and removing devices
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/daemon-rpc-types.ts17
-rw-r--r--gui/src/shared/ipc-schema.ts10
2 files changed, 19 insertions, 8 deletions
diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts
index 3b0f7774d3..61a068c08e 100644
--- a/gui/src/shared/daemon-rpc-types.ts
+++ b/gui/src/shared/daemon-rpc-types.ts
@@ -105,7 +105,7 @@ export type DaemonEvent =
| { settings: ISettings }
| { relayList: IRelayList }
| { appVersionInfo: IAppVersionInfo }
- | { deviceConfig: IDeviceConfig };
+ | { deviceConfig: DeviceConfig };
export interface ITunnelStateRelayInfo {
endpoint: ITunnelEndpoint;
@@ -321,16 +321,23 @@ export interface IAppVersionInfo {
suggestedIsBeta?: boolean;
}
-export interface IDeviceConfig {
- accountToken?: AccountToken;
- device?: IDevice;
-}
+export type DeviceConfig =
+ | undefined
+ | {
+ accountToken: AccountToken;
+ device?: IDevice;
+ };
export interface IDevice {
id: string;
name: string;
}
+export interface IDeviceRemoval {
+ accountToken: string;
+ deviceId: string;
+}
+
export interface ISettings {
allowLan: boolean;
autoConnect: boolean;
diff --git a/gui/src/shared/ipc-schema.ts b/gui/src/shared/ipc-schema.ts
index 6b3082cdd7..6ea154bf89 100644
--- a/gui/src/shared/ipc-schema.ts
+++ b/gui/src/shared/ipc-schema.ts
@@ -6,7 +6,9 @@ import {
BridgeState,
IAccountData,
IAppVersionInfo,
- IDeviceConfig,
+ IDevice,
+ DeviceConfig,
+ IDeviceRemoval,
IDnsOptions,
ILocation,
IRelayList,
@@ -51,7 +53,7 @@ export interface IAppStateSnapshot {
accountHistory?: AccountToken;
tunnelState: TunnelState;
settings: ISettings;
- deviceConfig: IDeviceConfig;
+ deviceConfig: DeviceConfig;
relayListPair: IRelayListPair;
currentVersion: ICurrentAppVersionInfo;
upgradeVersion: IAppVersionInfo;
@@ -165,13 +167,15 @@ export const ipcSchema = {
},
account: {
'': notifyRenderer<IAccountData | undefined>(),
- device: notifyRenderer<IDeviceConfig>(),
+ device: notifyRenderer<DeviceConfig>(),
create: invoke<void, string>(),
login: invoke<AccountToken, void>(),
logout: invoke<void, void>(),
getWwwAuthToken: invoke<void, string>(),
submitVoucher: invoke<string, VoucherResponse>(),
updateData: send<void>(),
+ listDevices: invoke<AccountToken, Array<IDevice>>(),
+ removeDevice: invoke<IDeviceRemoval, void>(),
},
accountHistory: {
'': notifyRenderer<AccountToken | undefined>(),