Separate Client in server and client part
Summary: This diff separates the concept of a Client as now on the UI, from the concept of a Client as known on the server, and makes all interactions with client and vice versa async. Reviewed By: timur-valiev Differential Revision: D31235682 fbshipit-source-id: 99089e9b390b4c5359f97f6f2b15bf4b182b6cb9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eab4804792
commit
740093d0d9
@@ -51,7 +51,18 @@ export type ClientQuery = {
|
||||
export type ClientDescription = {
|
||||
readonly id: string;
|
||||
readonly query: ClientQuery;
|
||||
readonly sdkVersion: number;
|
||||
};
|
||||
|
||||
export type ClientErrorType = {
|
||||
message: string;
|
||||
stacktrace: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type ClientResponseType = {
|
||||
success?: Object;
|
||||
error?: ClientErrorType;
|
||||
length: number;
|
||||
};
|
||||
|
||||
export type FlipperServerEvents = {
|
||||
@@ -64,11 +75,16 @@ export type FlipperServerEvents = {
|
||||
};
|
||||
'device-connected': DeviceDescription;
|
||||
'device-disconnected': DeviceDescription;
|
||||
'client-connected': ClientDescription;
|
||||
'device-log': {
|
||||
serial: string;
|
||||
entry: DeviceLogEntry;
|
||||
};
|
||||
'client-connected': ClientDescription;
|
||||
'client-disconnected': {id: string};
|
||||
'client-message': {
|
||||
id: string;
|
||||
message: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type FlipperServerCommands = {
|
||||
@@ -91,6 +107,11 @@ export type FlipperServerCommands = {
|
||||
'device-clear-logs': (serial: string) => Promise<void>;
|
||||
'device-navigate': (serial: string, location: string) => Promise<void>;
|
||||
'metro-command': (serial: string, command: string) => Promise<void>;
|
||||
'client-request': (clientId: string, payload: any) => Promise<void>;
|
||||
'client-request-response': (
|
||||
clientId: string,
|
||||
payload: any,
|
||||
) => Promise<ClientResponseType>;
|
||||
};
|
||||
|
||||
export interface FlipperServer {
|
||||
|
||||
Reference in New Issue
Block a user