extensive changes
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
|
||||
export type SimulationCommands = "start" | "pause" | "resume" | "clear" | "end" | "add";
|
||||
|
||||
export type DeviceCommands= "start_tunnel" | "stop_tunnel" | "shutdown";
|
||||
|
||||
export interface CtrlAttrs {
|
||||
[key: string]: CtrlAttr;
|
||||
}
|
||||
|
||||
|
||||
export type SimulationCommands = 'start' | 'pause' | 'resume' | 'clear' | 'end' | 'add';
|
||||
|
||||
export type DeviceCommands = 'start_tunnel' | 'stop_tunnel' | 'shutdown' | 'reboot';
|
||||
|
||||
export type TunnelCommands = 'start' | 'start-watcher' | 'end-watcher' | 'shutdown' | 'restart' | 'clear' | 'cancel' ;
|
||||
|
||||
export interface CtrlAttr {
|
||||
name: string;
|
||||
cmd: string;
|
||||
@@ -16,6 +18,15 @@ export interface CtrlAttr {
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface DevCtrlAttr {
|
||||
name: string;
|
||||
cmd: DeviceCommands;
|
||||
cmdClass: 'device_control';
|
||||
icon: string;
|
||||
cnfrm: boolean;
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface LocationQueue {
|
||||
[key: string]: LocationMark
|
||||
}
|
||||
@@ -24,9 +35,155 @@ interface LocationMark {
|
||||
loc_id: string;
|
||||
latitude: number | undefined | null;
|
||||
longitude: number | undefined | null;
|
||||
address?: string | undefined | null;
|
||||
delay?: number | undefined | null;
|
||||
start_time: string | undefined | null;
|
||||
end_time?: string | undefined | null ;
|
||||
start?: string | undefined | null;
|
||||
end?: string | undefined | null ;
|
||||
}
|
||||
|
||||
// SERVER TO CLIENT
|
||||
|
||||
export interface ServerToClientEvents {
|
||||
noArg: () => void;
|
||||
withAck: (a: string, callback: (b: number) => void) => void;
|
||||
simulation_status: (c: SimulationStatus) => void;
|
||||
status: (d: StatusUpdate) => void;
|
||||
device_status: (d: DeviceStatus) => void;
|
||||
error: (data: ErrorFull) => void;
|
||||
message: (e: string) => void;
|
||||
icloud_2fa_request: (callback: (e: number) => void) => void;
|
||||
fmf_update: (d: FindMyUpdate) => void;
|
||||
}
|
||||
|
||||
interface SimulationStatus {
|
||||
status: boolean;
|
||||
data: {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
start: string;
|
||||
end?: string;
|
||||
next_move?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface StatusUpdate {
|
||||
connected_clients: { [key: string]: string };
|
||||
current_location: {
|
||||
loc_id: string;
|
||||
latitude: number | undefined | null;
|
||||
longitude: number | undefined | null;
|
||||
start?: string | undefined | null;
|
||||
};
|
||||
device_name: string | undefined | null;
|
||||
fmf_location: FindMyUpdate | undefined | null;
|
||||
icloud: {
|
||||
consumer_queue: number | undefined | null;
|
||||
consumer_task: string | undefined | null;
|
||||
monitor_enabled: boolean;
|
||||
monitor_task: string | undefined | null;
|
||||
monitor_running: boolean;
|
||||
};
|
||||
next_move?: number | undefined | null;
|
||||
set_location_enabled: boolean;
|
||||
simulation_queue: {
|
||||
active: boolean;
|
||||
data: {
|
||||
[key: string]: LocationMark;
|
||||
};
|
||||
order: string[];
|
||||
state: string | undefined | null;
|
||||
worker_task: string | undefined | null;
|
||||
};
|
||||
test_mode: boolean;
|
||||
tunnel: string | undefined | null;
|
||||
tunnel_watcher_running: boolean;
|
||||
device_count?: number | undefined | null;
|
||||
udid?: string | null;
|
||||
product_version?: string | null | undefined;
|
||||
phone_number?: string | null | undefined;
|
||||
developer_mode_enabled?: boolean | undefined | null;
|
||||
ddi_mounted?: boolean;
|
||||
rsd_address?: string | null | undefined;
|
||||
rsd_port?: number | undefined | null;
|
||||
lockdown_trusted_port?: number | undefined | null;
|
||||
lockdown_untrusted_port?: number | undefined | null;
|
||||
lockdown_trusted_reachable?: boolean | undefined | null;
|
||||
lockdown_untrusted_reachable?: boolean | undefined | null;
|
||||
dtservicehub_reachable?: boolean | undefined | null;
|
||||
}
|
||||
|
||||
interface DeviceStatus {
|
||||
device_connected: boolean;
|
||||
device_count: number;
|
||||
udid?: string | null;
|
||||
device_name?: string | null;
|
||||
product_version?: string | null;
|
||||
phone_number?: string | null;
|
||||
developer_mode_enabled?: boolean;
|
||||
ddi_mounted?: boolean;
|
||||
rsd_address?: string | null;
|
||||
rsd_port?: number;
|
||||
lockdown_trusted_port?: number;
|
||||
lockdown_untrusted_port?: number;
|
||||
lockdown_trusted_reachable?: boolean;
|
||||
lockdown_untrusted_reachable?: boolean;
|
||||
dtservicehub_reachable?: boolean;
|
||||
}
|
||||
|
||||
export interface ErrorFull {
|
||||
type: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface FindMyUpdate {
|
||||
altitude: number;
|
||||
batteryLevel: number;
|
||||
deviceDisplayName: string;
|
||||
deviceStatus: number;
|
||||
horizontalAccuracy: number;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
name: string;
|
||||
timeStamp: number;
|
||||
verticalAccuracy: number;
|
||||
}
|
||||
|
||||
// END SERVER TO CLIENT
|
||||
|
||||
// CLIENT TO SERVER
|
||||
|
||||
export interface ClientToServerEvents {
|
||||
message: (e: string, callback: (b: boolean, r: string) => void) => void;
|
||||
request_update: (callback: (response: StatusUpdate) => void) => void;
|
||||
simulation_control: (
|
||||
args: {
|
||||
command: SimulationCommands;
|
||||
latitude?: number | null | undefined;
|
||||
longitude?: number | null | undefined;
|
||||
delay?: number | undefined;
|
||||
},
|
||||
callback: (response: SimulationControlResponse) => void,
|
||||
) => void;
|
||||
device_control: (
|
||||
args: {
|
||||
command: DeviceCommands;
|
||||
delay?: number;
|
||||
},
|
||||
callback?: (response: DeviceControlResponse) => void,
|
||||
) => void;
|
||||
tunnel_control: (
|
||||
args: {
|
||||
command: TunnelCommands;
|
||||
delay?: number;
|
||||
},
|
||||
callback?: (response: DeviceControlResponse) => void,
|
||||
) => void;
|
||||
icloud_monitor_control: (
|
||||
args: {
|
||||
command: string;
|
||||
},
|
||||
callback?: (response: iCloudMonitorResponse) => void,
|
||||
) => void;
|
||||
}
|
||||
|
||||
export interface SimulationControlResponse {
|
||||
@@ -47,119 +204,20 @@ interface DeviceControlResponse {
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
interface StatusUpdate {
|
||||
simulation_active: boolean;
|
||||
set_location_enabled: boolean;
|
||||
queue: number,
|
||||
latitude: number | undefined | null;
|
||||
longitude: number | undefined | null;
|
||||
next_move?: number | undefined | null;
|
||||
queue_list: LocationQueue[]
|
||||
queue_state: string | undefined | null;
|
||||
queue_status: boolean;
|
||||
simulation_task: string | undefined | null;
|
||||
test_mode: boolean
|
||||
tunnel: string | undefined | null;
|
||||
device_count?: number | undefined | null;
|
||||
udid?: string | null;
|
||||
device_name?: string | null | undefined;
|
||||
product_version?: string | null | undefined;
|
||||
phone_number?: string | null | undefined;
|
||||
developer_mode_enabled?: boolean | undefined | null;
|
||||
ddi_mounted?: boolean ;
|
||||
rsd_address?: string | null | undefined;
|
||||
rsd_port?: number | undefined | null;
|
||||
lockdown_trusted_port?: number | undefined | null;
|
||||
lockdown_untrusted_port?: number | undefined | null;
|
||||
lockdown_trusted_reachable?: boolean | undefined | null;
|
||||
lockdown_untrusted_reachable?: boolean | undefined | null;
|
||||
dtservicehub_reachable?: boolean | undefined | null
|
||||
export interface iCloudMonitorResponse {
|
||||
status: string;
|
||||
command: string;
|
||||
icloud_monitor_enabled?: boolean | undefined | null;
|
||||
icloud_monitor_running?: boolean | undefined | null;
|
||||
message?: string | undefined | null;
|
||||
}
|
||||
|
||||
export interface ServerToClientEvents {
|
||||
noArg: () => void;
|
||||
withAck: (a: string, callback: (b: number) => void) => void;
|
||||
simulationStatus: (c: SimulationStatus) => void;
|
||||
status: (d: StatusUpdate) => void;
|
||||
device_status: (d: DeviceStatus) => void;
|
||||
error: (data: ErrorFull) => void;
|
||||
message: (e: string) => void;
|
||||
}
|
||||
|
||||
export interface ClientToServerEvents {
|
||||
message: (e: string, callback: (b: boolean, r: string) => void) => void;
|
||||
simulation_control: (
|
||||
args: {
|
||||
command: SimulationCommands,
|
||||
latitude?: number | null | undefined,
|
||||
longitude?: number | null | undefined,
|
||||
delay?: number | undefined
|
||||
},
|
||||
callback: (response: SimulationControlResponse) => void
|
||||
) => void;
|
||||
device_control: (
|
||||
args: {
|
||||
command: DeviceCommands,
|
||||
delay?: number
|
||||
},
|
||||
callback?: (response: DeviceControlResponse) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
interface SimulationStatus {
|
||||
status: boolean;
|
||||
data: {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
start: string;
|
||||
end?: string;
|
||||
next_move?: number;
|
||||
};
|
||||
}
|
||||
// END CLIENT TO SERVER
|
||||
|
||||
export interface Meta {
|
||||
totalCount: number;
|
||||
}
|
||||
|
||||
|
||||
interface DeviceStatus {
|
||||
device_connected: boolean;
|
||||
device_count: number;
|
||||
udid?: string | null;
|
||||
device_name?: string | null;
|
||||
product_version?: string | null;
|
||||
phone_number?: string | null;
|
||||
developer_mode_enabled?: boolean;
|
||||
ddi_mounted?: boolean;
|
||||
rsd_address?: string | null;
|
||||
rsd_port?: number;
|
||||
lockdown_trusted_port?: number;
|
||||
lockdown_untrusted_port?: number;
|
||||
lockdown_trusted_reachable?: boolean;
|
||||
lockdown_untrusted_reachable?: boolean;
|
||||
dtservicehub_reachable?: boolean;
|
||||
}
|
||||
|
||||
export type Control = DeviceControl | SimulationControl;
|
||||
|
||||
export interface DeviceControl {
|
||||
id: number;
|
||||
name: string;
|
||||
cmd: DeviceCommands
|
||||
cmdClass: "device_control"
|
||||
icon: string;
|
||||
confirm: boolean;
|
||||
}
|
||||
|
||||
export interface SimulationControl {
|
||||
id: number;
|
||||
name: string;
|
||||
cmd: SimulationCommands;
|
||||
cmdClass: 'simulation_control';
|
||||
icon: string;
|
||||
confirm: boolean;
|
||||
}
|
||||
|
||||
export interface coords {
|
||||
lat: number;
|
||||
lng: number;
|
||||
@@ -183,9 +241,11 @@ export interface SearchControlProps {
|
||||
|
||||
export interface CurrentLocation {
|
||||
loc_id: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
next_move?: number | null
|
||||
latitude: number| null | undefined;
|
||||
longitude: number| null | undefined;
|
||||
// start_time?: string | null | undefined;
|
||||
// end_time?: string | null | undefined
|
||||
next_move?: number | null | undefined;
|
||||
}
|
||||
|
||||
export interface NextLocation {
|
||||
@@ -195,7 +255,4 @@ export interface NextLocation {
|
||||
time_at_location?: number | null;
|
||||
}
|
||||
|
||||
export interface ErrorFull {
|
||||
type: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user