summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gui/packages/desktop/src/main/daemon-rpc.js207
-rw-r--r--gui/packages/desktop/src/main/index.js2
-rw-r--r--gui/packages/desktop/src/main/notification-controller.js2
-rw-r--r--gui/packages/desktop/src/renderer/app.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/Account.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/Login.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/NotificationArea.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/SelectLocation.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/Support.js2
-rw-r--r--gui/packages/desktop/src/renderer/components/TunnelControl.js2
-rw-r--r--gui/packages/desktop/src/renderer/lib/relay-settings-builder.js2
-rw-r--r--gui/packages/desktop/src/renderer/redux/account/actions.js2
-rw-r--r--gui/packages/desktop/src/renderer/redux/account/reducers.js2
-rw-r--r--gui/packages/desktop/src/renderer/redux/connection/actions.js6
-rw-r--r--gui/packages/desktop/src/renderer/redux/connection/reducers.js2
-rw-r--r--gui/packages/desktop/src/renderer/redux/settings/reducers.js2
-rw-r--r--gui/packages/desktop/src/renderer/redux/version/actions.js2
-rw-r--r--gui/packages/desktop/src/shared/daemon-rpc-types.js170
-rw-r--r--gui/packages/desktop/src/shared/ipc-event-channel.js2
-rw-r--r--gui/packages/desktop/test/account-data-cache.spec.js2
20 files changed, 203 insertions, 214 deletions
diff --git a/gui/packages/desktop/src/main/daemon-rpc.js b/gui/packages/desktop/src/main/daemon-rpc.js
index 1716190351..000dc544b9 100644
--- a/gui/packages/desktop/src/main/daemon-rpc.js
+++ b/gui/packages/desktop/src/main/daemon-rpc.js
@@ -6,6 +6,16 @@ import JsonRpcClient, {
SocketTransport,
} from './jsonrpc-client';
import { CommunicationError, InvalidAccountError, NoDaemonError } from './errors';
+import type {
+ AccountData,
+ AccountToken,
+ AppVersionInfo,
+ Location,
+ RelayList,
+ RelaySettingsUpdate,
+ Settings,
+ TunnelStateTransition,
+} from '../shared/daemon-rpc-types';
import {
object,
@@ -22,18 +32,6 @@ import { validate } from 'validated/object';
import type { Node as SchemaNode } from 'validated/schema';
-export type AccountData = { expiry: string };
-export type AccountToken = string;
-export type Ip = string;
-export type Location = {
- ip: ?string,
- country: string,
- city: ?string,
- latitude: number,
- longitude: number,
- mullvadExitIp: boolean,
- hostname: ?string,
-};
const LocationSchema = maybe(
partialObject({
ip: maybe(string),
@@ -46,95 +44,6 @@ const LocationSchema = maybe(
}),
);
-export type BlockReason =
- | {
- reason:
- | 'ipv6_unavailable'
- | 'set_security_policy_error'
- | 'set_dns_error'
- | 'start_tunnel_error'
- | 'no_matching_relay'
- | 'is_offline'
- | 'tap_adapter_problem',
- }
- | { reason: 'auth_failed', details: ?string };
-
-export type AfterDisconnect = 'nothing' | 'block' | 'reconnect';
-
-export type TunnelState = 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'blocked';
-
-export type TunnelEndpoint = {
- address: string,
- tunnel: TunnelEndpointData,
-};
-
-export type TunnelEndpointData = {
- openvpn: {
- port: number,
- protocol: RelayProtocol,
- },
-};
-
-export type TunnelStateTransition =
- | { state: 'disconnected' }
- | { state: 'connecting', details: ?TunnelEndpoint }
- | { state: 'connected', details: TunnelEndpoint }
- | { state: 'disconnecting', details: AfterDisconnect }
- | { state: 'blocked', details: BlockReason };
-
-export type RelayProtocol = 'tcp' | 'udp';
-export type RelayLocation =
- | {| hostname: [string, string, string] |}
- | {| city: [string, string] |}
- | {| country: string |};
-
-type OpenVpnConstraints = {
- port: 'any' | { only: number },
- protocol: 'any' | { only: RelayProtocol },
-};
-
-type TunnelConstraints<TOpenVpnConstraints> = {
- openvpn: TOpenVpnConstraints,
-};
-
-type RelaySettingsNormal<TTunnelConstraints> = {
- location:
- | 'any'
- | {
- only: RelayLocation,
- },
- tunnel:
- | 'any'
- | {
- only: TTunnelConstraints,
- },
-};
-
-// types describing the structure of RelaySettings
-export type RelaySettingsCustom = {
- host: string,
- tunnel: TunnelEndpointData,
-};
-export type RelaySettings =
- | {|
- normal: RelaySettingsNormal<TunnelConstraints<OpenVpnConstraints>>,
- |}
- | {|
- customTunnelEndpoint: RelaySettingsCustom,
- |};
-
-// types describing the partial update of RelaySettings
-export type RelaySettingsNormalUpdate = $Shape<
- RelaySettingsNormal<TunnelConstraints<$Shape<OpenVpnConstraints>>>,
->;
-export type RelaySettingsUpdate =
- | {|
- normal: RelaySettingsNormalUpdate,
- |}
- | {|
- customTunnelEndpoint: RelaySettingsCustom,
- |};
-
const constraint = <T>(constraintValue: SchemaNode<T>) => {
return oneOf(
string, // any
@@ -185,31 +94,6 @@ const RelaySettingsSchema = oneOf(
}),
);
-export type RelayList = {
- countries: Array<RelayListCountry>,
-};
-
-export type RelayListCountry = {
- name: string,
- code: string,
- cities: Array<RelayListCity>,
-};
-
-export type RelayListCity = {
- name: string,
- code: string,
- latitude: number,
- longitude: number,
- relays: Array<RelayListHostname>,
-};
-
-export type RelayListHostname = {
- hostname: string,
- ipv4AddrIn: string,
- includeInCountry: boolean,
- weight: number,
-};
-
const RelayListSchema = partialObject({
countries: arrayOf(
partialObject({
@@ -235,31 +119,6 @@ const RelayListSchema = partialObject({
),
});
-export type TunnelOptions = {
- enableIpv6: boolean,
- openvpn: {
- mssfix: ?number,
- },
- proxy: ?ProxySettings,
-};
-
-export type ProxySettings = LocalProxySettings | RemoteProxySettings;
-
-export type LocalProxySettings = {
- port: number,
- peer: string,
-};
-
-export type RemoteProxySettings = {
- address: string,
- auth: ?RemoteProxyAuth,
-};
-
-export type RemoteProxyAuth = {
- username: string,
- password: string,
-};
-
const OpenVpnProxySchema = maybe(
oneOf(
object({
@@ -331,14 +190,6 @@ const TunnelStateTransitionSchema = oneOf(
}),
);
-export type AppVersionInfo = {
- currentIsSupported: boolean,
- latest: {
- latestStable: string,
- latest: string,
- },
-};
-
const AppVersionInfoSchema = partialObject({
current_is_supported: boolean,
latest: partialObject({
@@ -383,15 +234,6 @@ export class SubscriptionListener<T> {
}
}
-export type Settings = {
- accountToken: ?AccountToken,
- allowLan: boolean,
- autoConnect: boolean,
- blockWhenDisconnected: boolean,
- relaySettings: RelaySettings,
- tunnelOptions: TunnelOptions,
-};
-
const SettingsSchema = partialObject({
account_token: maybe(string),
allow_lan: boolean,
@@ -401,33 +243,6 @@ const SettingsSchema = partialObject({
tunnel_options: TunnelOptionsSchema,
});
-export interface DaemonRpcProtocol {
- connect({ path: string }): void;
- disconnect(): void;
- getAccountData(AccountToken): Promise<AccountData>;
- getRelayLocations(): Promise<RelayList>;
- setAccount(accountToken: ?AccountToken): Promise<void>;
- updateRelaySettings(RelaySettingsUpdate): Promise<void>;
- setAllowLan(boolean): Promise<void>;
- setEnableIpv6(boolean): Promise<void>;
- setBlockWhenDisconnected(boolean): Promise<void>;
- setOpenVpnMssfix(?number): Promise<void>;
- setAutoConnect(boolean): Promise<void>;
- connectTunnel(): Promise<void>;
- disconnectTunnel(): Promise<void>;
- getLocation(): Promise<?Location>;
- getState(): Promise<TunnelStateTransition>;
- getSettings(): Promise<Settings>;
- subscribeStateListener(listener: SubscriptionListener<TunnelStateTransition>): Promise<void>;
- subscribeSettingsListener(listener: SubscriptionListener<Settings>): Promise<void>;
- addConnectionObserver(observer: ConnectionObserver): void;
- removeConnectionObserver(observer: ConnectionObserver): void;
- getAccountHistory(): Promise<Array<AccountToken>>;
- removeAccountFromHistory(accountToken: AccountToken): Promise<void>;
- getCurrentVersion(): Promise<string>;
- getVersionInfo(): Promise<AppVersionInfo>;
-}
-
export class ResponseParseError extends Error {
_validationError: ?Error;
@@ -444,7 +259,7 @@ export class ResponseParseError extends Error {
// Timeout used for RPC calls that do networking
const NETWORK_CALL_TIMEOUT = 10000;
-export class DaemonRpc implements DaemonRpcProtocol {
+export class DaemonRpc {
_transport = new JsonRpcClient(new SocketTransport());
connect(connectionParams: { path: string }) {
diff --git a/gui/packages/desktop/src/main/index.js b/gui/packages/desktop/src/main/index.js
index 99463a6c93..4d20e98d0a 100644
--- a/gui/packages/desktop/src/main/index.js
+++ b/gui/packages/desktop/src/main/index.js
@@ -26,7 +26,7 @@ import type {
RelaySettingsUpdate,
Settings,
TunnelStateTransition,
-} from './daemon-rpc';
+} from '../shared/daemon-rpc-types';
import GuiSettings from './gui-settings';
import ReconnectionBackoff from './reconnection-backoff';
diff --git a/gui/packages/desktop/src/main/notification-controller.js b/gui/packages/desktop/src/main/notification-controller.js
index 4992e6294e..5b3a3ddbc7 100644
--- a/gui/packages/desktop/src/main/notification-controller.js
+++ b/gui/packages/desktop/src/main/notification-controller.js
@@ -4,7 +4,7 @@ import { shell, Notification } from 'electron';
import log from 'electron-log';
import config from '../config';
-import type { TunnelStateTransition } from './daemon-rpc';
+import type { TunnelStateTransition } from '../shared/daemon-rpc-types';
export default class NotificationController {
_lastTunnelStateNotification: ?Notification;
diff --git a/gui/packages/desktop/src/renderer/app.js b/gui/packages/desktop/src/renderer/app.js
index bc4a93021e..afea9e9651 100644
--- a/gui/packages/desktop/src/renderer/app.js
+++ b/gui/packages/desktop/src/renderer/app.js
@@ -36,7 +36,7 @@ import type {
RelaySettings,
Settings,
TunnelStateTransition,
-} from '../main/daemon-rpc';
+} from '../shared/daemon-rpc-types';
export default class AppRenderer {
_memoryHistory = createMemoryHistory();
diff --git a/gui/packages/desktop/src/renderer/components/Account.js b/gui/packages/desktop/src/renderer/components/Account.js
index aaedd96db2..90c145c3d7 100644
--- a/gui/packages/desktop/src/renderer/components/Account.js
+++ b/gui/packages/desktop/src/renderer/components/Account.js
@@ -9,7 +9,7 @@ import { Layout, Container } from './Layout';
import { NavigationBar, BackBarItem } from './NavigationBar';
import styles from './AccountStyles';
-import type { AccountToken } from '../../main/daemon-rpc';
+import type { AccountToken } from '../../shared/daemon-rpc-types';
type Props = {
accountToken: AccountToken,
diff --git a/gui/packages/desktop/src/renderer/components/Login.js b/gui/packages/desktop/src/renderer/components/Login.js
index 1e69316393..70e4a5c7f4 100644
--- a/gui/packages/desktop/src/renderer/components/Login.js
+++ b/gui/packages/desktop/src/renderer/components/Login.js
@@ -10,7 +10,7 @@ import styles from './LoginStyles';
import { colors } from '../../config';
import type { LoginState } from '../redux/account/reducers';
-import type { AccountToken } from '../../main/daemon-rpc';
+import type { AccountToken } from '../../shared/daemon-rpc-types';
type Props = {
accountToken: ?AccountToken,
diff --git a/gui/packages/desktop/src/renderer/components/NotificationArea.js b/gui/packages/desktop/src/renderer/components/NotificationArea.js
index f077b3408a..cac4e2cd41 100644
--- a/gui/packages/desktop/src/renderer/components/NotificationArea.js
+++ b/gui/packages/desktop/src/renderer/components/NotificationArea.js
@@ -15,7 +15,7 @@ import {
import { AuthFailure } from '../lib/auth-failure';
import AccountExpiry from '../lib/account-expiry';
-import type { BlockReason, TunnelStateTransition } from '../../main/daemon-rpc';
+import type { BlockReason, TunnelStateTransition } from '../../shared/daemon-rpc-types';
import type { VersionReduxState } from '../redux/version/reducers';
type Props = {
diff --git a/gui/packages/desktop/src/renderer/components/SelectLocation.js b/gui/packages/desktop/src/renderer/components/SelectLocation.js
index 448a63ebbd..18b3ea9b52 100644
--- a/gui/packages/desktop/src/renderer/components/SelectLocation.js
+++ b/gui/packages/desktop/src/renderer/components/SelectLocation.js
@@ -19,7 +19,7 @@ import CityRow from './CityRow';
import RelayRow from './RelayRow';
import type { RelaySettingsRedux, RelayLocationRedux } from '../redux/settings/reducers';
-import type { RelayLocation } from '../../main/daemon-rpc';
+import type { RelayLocation } from '../../shared/daemon-rpc-types';
type Props = {
relaySettings: RelaySettingsRedux,
diff --git a/gui/packages/desktop/src/renderer/components/Support.js b/gui/packages/desktop/src/renderer/components/Support.js
index 62d94f4127..f9f167e68b 100644
--- a/gui/packages/desktop/src/renderer/components/Support.js
+++ b/gui/packages/desktop/src/renderer/components/Support.js
@@ -16,7 +16,7 @@ import { Layout, Container } from './Layout';
import { NavigationBar, BackBarItem } from './NavigationBar';
import styles from './SupportStyles';
-import type { AccountToken } from '../../main/daemon-rpc';
+import type { AccountToken } from '../../shared/daemon-rpc-types';
import type { SupportReportForm } from '../redux/support/actions';
type SupportState = {
email: string,
diff --git a/gui/packages/desktop/src/renderer/components/TunnelControl.js b/gui/packages/desktop/src/renderer/components/TunnelControl.js
index 5b2470f0b8..e88693a3f3 100644
--- a/gui/packages/desktop/src/renderer/components/TunnelControl.js
+++ b/gui/packages/desktop/src/renderer/components/TunnelControl.js
@@ -6,7 +6,7 @@ import { ConnectionInfo, SecuredLabel, SecuredDisplayStyle, ImageView } from '@m
import * as AppButton from './AppButton';
import { colors } from '../../config';
-import type { TunnelStateTransition, RelayProtocol } from '../../main/daemon-rpc';
+import type { TunnelStateTransition, RelayProtocol } from '../../shared/daemon-rpc-types';
export type RelayInAddress = {
ip: string,
diff --git a/gui/packages/desktop/src/renderer/lib/relay-settings-builder.js b/gui/packages/desktop/src/renderer/lib/relay-settings-builder.js
index 50175811fa..d81c4d6fac 100644
--- a/gui/packages/desktop/src/renderer/lib/relay-settings-builder.js
+++ b/gui/packages/desktop/src/renderer/lib/relay-settings-builder.js
@@ -6,7 +6,7 @@ import type {
RelaySettingsUpdate,
RelaySettingsNormalUpdate,
RelaySettingsCustom,
-} from '../../main/daemon-rpc';
+} from '../../shared/daemon-rpc-types';
type LocationBuilder<Self> = {
country: (country: string) => Self,
diff --git a/gui/packages/desktop/src/renderer/redux/account/actions.js b/gui/packages/desktop/src/renderer/redux/account/actions.js
index b69679e5c5..4d7dff03a3 100644
--- a/gui/packages/desktop/src/renderer/redux/account/actions.js
+++ b/gui/packages/desktop/src/renderer/redux/account/actions.js
@@ -1,6 +1,6 @@
// @flow
-import type { AccountToken } from '../../../main/daemon-rpc';
+import type { AccountToken } from '../../../shared/daemon-rpc-types';
type StartLoginAction = {
type: 'START_LOGIN',
diff --git a/gui/packages/desktop/src/renderer/redux/account/reducers.js b/gui/packages/desktop/src/renderer/redux/account/reducers.js
index c5a16217e2..8c560fac02 100644
--- a/gui/packages/desktop/src/renderer/redux/account/reducers.js
+++ b/gui/packages/desktop/src/renderer/redux/account/reducers.js
@@ -1,7 +1,7 @@
// @flow
import type { ReduxAction } from '../store';
-import type { AccountToken } from '../../../main/daemon-rpc';
+import type { AccountToken } from '../../../shared/daemon-rpc-types';
export type LoginState = 'none' | 'logging in' | 'failed' | 'ok';
export type AccountReduxState = {
diff --git a/gui/packages/desktop/src/renderer/redux/connection/actions.js b/gui/packages/desktop/src/renderer/redux/connection/actions.js
index 2dbd304014..68dafd58f5 100644
--- a/gui/packages/desktop/src/renderer/redux/connection/actions.js
+++ b/gui/packages/desktop/src/renderer/redux/connection/actions.js
@@ -1,6 +1,10 @@
// @flow
-import type { AfterDisconnect, BlockReason, TunnelEndpoint } from '../../../main/daemon-rpc';
+import type {
+ AfterDisconnect,
+ BlockReason,
+ TunnelEndpoint,
+} from '../../../shared/daemon-rpc-types';
type ConnectingAction = {
type: 'CONNECTING',
diff --git a/gui/packages/desktop/src/renderer/redux/connection/reducers.js b/gui/packages/desktop/src/renderer/redux/connection/reducers.js
index 2bbeb26b47..d1f78c841f 100644
--- a/gui/packages/desktop/src/renderer/redux/connection/reducers.js
+++ b/gui/packages/desktop/src/renderer/redux/connection/reducers.js
@@ -1,7 +1,7 @@
// @flow
import type { ReduxAction } from '../store';
-import type { TunnelStateTransition, Ip } from '../../../main/daemon-rpc';
+import type { TunnelStateTransition, Ip } from '../../../shared/daemon-rpc-types';
export type ConnectionReduxState = {
status: TunnelStateTransition,
diff --git a/gui/packages/desktop/src/renderer/redux/settings/reducers.js b/gui/packages/desktop/src/renderer/redux/settings/reducers.js
index 8de27e9f32..a51fe7fe02 100644
--- a/gui/packages/desktop/src/renderer/redux/settings/reducers.js
+++ b/gui/packages/desktop/src/renderer/redux/settings/reducers.js
@@ -1,7 +1,7 @@
// @flow
import type { ReduxAction } from '../store';
-import type { RelayProtocol, RelayLocation } from '../../../main/daemon-rpc';
+import type { RelayProtocol, RelayLocation } from '../../../shared/daemon-rpc-types';
import type { GuiSettingsState } from '../../../shared/gui-settings-state';
export type RelaySettingsRedux =
diff --git a/gui/packages/desktop/src/renderer/redux/version/actions.js b/gui/packages/desktop/src/renderer/redux/version/actions.js
index 8ab4b08757..96fd1db9e5 100644
--- a/gui/packages/desktop/src/renderer/redux/version/actions.js
+++ b/gui/packages/desktop/src/renderer/redux/version/actions.js
@@ -1,6 +1,6 @@
// @flow
-import type { AppVersionInfo } from '../../../main/daemon-rpc';
+import type { AppVersionInfo } from '../../../shared/daemon-rpc-types';
type UpdateLatestActionPayload = {
upToDate: boolean,
diff --git a/gui/packages/desktop/src/shared/daemon-rpc-types.js b/gui/packages/desktop/src/shared/daemon-rpc-types.js
new file mode 100644
index 0000000000..82e52a7603
--- /dev/null
+++ b/gui/packages/desktop/src/shared/daemon-rpc-types.js
@@ -0,0 +1,170 @@
+// @flow
+
+export type AccountData = { expiry: string };
+export type AccountToken = string;
+export type Ip = string;
+export type Location = {
+ ip: ?string,
+ country: string,
+ city: ?string,
+ latitude: number,
+ longitude: number,
+ mullvadExitIp: boolean,
+ hostname: ?string,
+};
+
+export type BlockReason =
+ | {
+ reason:
+ | 'ipv6_unavailable'
+ | 'set_security_policy_error'
+ | 'set_dns_error'
+ | 'start_tunnel_error'
+ | 'no_matching_relay'
+ | 'is_offline'
+ | 'tap_adapter_problem',
+ }
+ | { reason: 'auth_failed', details: ?string };
+
+export type AfterDisconnect = 'nothing' | 'block' | 'reconnect';
+
+export type TunnelState = 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'blocked';
+
+export type TunnelEndpoint = {
+ address: string,
+ tunnel: TunnelEndpointData,
+};
+
+export type TunnelEndpointData = {
+ openvpn: {
+ port: number,
+ protocol: RelayProtocol,
+ },
+};
+
+export type TunnelStateTransition =
+ | { state: 'disconnected' }
+ | { state: 'connecting', details: ?TunnelEndpoint }
+ | { state: 'connected', details: TunnelEndpoint }
+ | { state: 'disconnecting', details: AfterDisconnect }
+ | { state: 'blocked', details: BlockReason };
+
+export type RelayProtocol = 'tcp' | 'udp';
+export type RelayLocation =
+ | {| hostname: [string, string, string] |}
+ | {| city: [string, string] |}
+ | {| country: string |};
+
+type OpenVpnConstraints = {
+ port: 'any' | { only: number },
+ protocol: 'any' | { only: RelayProtocol },
+};
+
+type TunnelConstraints<TOpenVpnConstraints> = {
+ openvpn: TOpenVpnConstraints,
+};
+
+type RelaySettingsNormal<TTunnelConstraints> = {
+ location:
+ | 'any'
+ | {
+ only: RelayLocation,
+ },
+ tunnel:
+ | 'any'
+ | {
+ only: TTunnelConstraints,
+ },
+};
+
+// types describing the structure of RelaySettings
+export type RelaySettingsCustom = {
+ host: string,
+ tunnel: TunnelEndpointData,
+};
+export type RelaySettings =
+ | {|
+ normal: RelaySettingsNormal<TunnelConstraints<OpenVpnConstraints>>,
+ |}
+ | {|
+ customTunnelEndpoint: RelaySettingsCustom,
+ |};
+
+// types describing the partial update of RelaySettings
+export type RelaySettingsNormalUpdate = $Shape<
+ RelaySettingsNormal<TunnelConstraints<$Shape<OpenVpnConstraints>>>,
+>;
+export type RelaySettingsUpdate =
+ | {|
+ normal: RelaySettingsNormalUpdate,
+ |}
+ | {|
+ customTunnelEndpoint: RelaySettingsCustom,
+ |};
+
+export type RelayList = {
+ countries: Array<RelayListCountry>,
+};
+
+export type RelayListCountry = {
+ name: string,
+ code: string,
+ cities: Array<RelayListCity>,
+};
+
+export type RelayListCity = {
+ name: string,
+ code: string,
+ latitude: number,
+ longitude: number,
+ relays: Array<RelayListHostname>,
+};
+
+export type RelayListHostname = {
+ hostname: string,
+ ipv4AddrIn: string,
+ includeInCountry: boolean,
+ weight: number,
+};
+
+export type TunnelOptions = {
+ enableIpv6: boolean,
+ openvpn: {
+ mssfix: ?number,
+ },
+ proxy: ?ProxySettings,
+};
+
+export type ProxySettings = LocalProxySettings | RemoteProxySettings;
+
+export type LocalProxySettings = {
+ port: number,
+ peer: string,
+};
+
+export type RemoteProxySettings = {
+ address: string,
+ auth: ?RemoteProxyAuth,
+};
+
+export type RemoteProxyAuth = {
+ username: string,
+ password: string,
+};
+
+export type AppVersionInfo = {
+ currentIsSupported: boolean,
+ latest: {
+ latestStable: string,
+ latest: string,
+ },
+};
+
+export type Settings = {
+ accountToken: ?AccountToken,
+ allowLan: boolean,
+ autoConnect: boolean,
+ blockWhenDisconnected: boolean,
+ relaySettings: RelaySettings,
+ tunnelOptions: TunnelOptions,
+};
diff --git a/gui/packages/desktop/src/shared/ipc-event-channel.js b/gui/packages/desktop/src/shared/ipc-event-channel.js
index e2484b22b5..5e21c1c4ae 100644
--- a/gui/packages/desktop/src/shared/ipc-event-channel.js
+++ b/gui/packages/desktop/src/shared/ipc-event-channel.js
@@ -15,7 +15,7 @@ import type {
RelaySettingsUpdate,
Settings,
TunnelStateTransition,
-} from '../main/daemon-rpc';
+} from './daemon-rpc-types';
export type AppStateSnapshot = {
isConnected: boolean,
diff --git a/gui/packages/desktop/test/account-data-cache.spec.js b/gui/packages/desktop/test/account-data-cache.spec.js
index 105466a1a6..90c6ad2f80 100644
--- a/gui/packages/desktop/test/account-data-cache.spec.js
+++ b/gui/packages/desktop/test/account-data-cache.spec.js
@@ -1,7 +1,7 @@
// @flow
import { AccountDataCache } from '../src/renderer/app';
-import type { AccountData } from '../src/main/daemon-rpc';
+import type { AccountData } from '../src/shared/daemon-rpc-types';
describe('AccountData cache', () => {
const dummyAccountToken = '9876543210';