flipper-frontend-core 0.0.1-security → 0.171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/lib/AbstractClient.d.ts +65 -0
- package/lib/AbstractClient.d.ts.map +1 -0
- package/lib/AbstractClient.js +334 -0
- package/lib/AbstractClient.js.map +1 -0
- package/lib/RenderHost.d.ts +84 -0
- package/lib/RenderHost.d.ts.map +1 -0
- package/lib/RenderHost.js +11 -0
- package/lib/RenderHost.js.map +1 -0
- package/lib/client/FlipperServerClient.d.ts +10 -0
- package/lib/client/FlipperServerClient.d.ts.map +1 -0
- package/lib/client/FlipperServerClient.js +140 -0
- package/lib/client/FlipperServerClient.js.map +1 -0
- package/lib/devices/ArchivedDevice.d.ts +21 -0
- package/lib/devices/ArchivedDevice.d.ts.map +1 -0
- package/lib/devices/ArchivedDevice.js +49 -0
- package/lib/devices/ArchivedDevice.js.map +1 -0
- package/lib/devices/BaseDevice.d.ts +71 -0
- package/lib/devices/BaseDevice.d.ts.map +1 -0
- package/lib/devices/BaseDevice.js +245 -0
- package/lib/devices/BaseDevice.js.map +1 -0
- package/lib/devices/TestDevice.d.ts +8 -0
- package/lib/devices/TestDevice.d.ts.map +1 -0
- package/lib/devices/TestDevice.js +27 -0
- package/lib/devices/TestDevice.js.map +1 -0
- package/lib/fb-stubs/constants.d.ts +5 -0
- package/lib/fb-stubs/constants.d.ts.map +1 -0
- package/lib/fb-stubs/constants.js +6 -0
- package/lib/fb-stubs/constants.js.map +1 -0
- package/lib/flipperLibImplementation/downloadFile.d.ts +4 -0
- package/lib/flipperLibImplementation/downloadFile.d.ts.map +1 -0
- package/lib/flipperLibImplementation/downloadFile.js +40 -0
- package/lib/flipperLibImplementation/downloadFile.js.map +1 -0
- package/lib/flipperLibImplementation/index.d.ts +5 -0
- package/lib/flipperLibImplementation/index.d.ts.map +1 -0
- package/lib/flipperLibImplementation/index.js +61 -0
- package/lib/flipperLibImplementation/index.js.map +1 -0
- package/lib/globalObject.d.ts +16 -0
- package/lib/globalObject.d.ts.map +1 -0
- package/lib/globalObject.js +10 -0
- package/lib/globalObject.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins.d.ts +31 -0
- package/lib/plugins.d.ts.map +1 -0
- package/lib/plugins.js +181 -0
- package/lib/plugins.js.map +1 -0
- package/lib/utils/createServerAddOnControls.d.ts +3 -0
- package/lib/utils/createServerAddOnControls.d.ts.map +1 -0
- package/lib/utils/createServerAddOnControls.js +60 -0
- package/lib/utils/createServerAddOnControls.js.map +1 -0
- package/lib/utils/isPluginCompatible.d.ts +4 -0
- package/lib/utils/isPluginCompatible.d.ts.map +1 -0
- package/lib/utils/isPluginCompatible.js +18 -0
- package/lib/utils/isPluginCompatible.js.map +1 -0
- package/lib/utils/isPluginVersionMoreRecent.d.ts +4 -0
- package/lib/utils/isPluginVersionMoreRecent.d.ts.map +1 -0
- package/lib/utils/isPluginVersionMoreRecent.js +28 -0
- package/lib/utils/isPluginVersionMoreRecent.js.map +1 -0
- package/lib/utils/isProduction.d.ts +2 -0
- package/lib/utils/isProduction.d.ts.map +1 -0
- package/lib/utils/isProduction.js +8 -0
- package/lib/utils/isProduction.js.map +1 -0
- package/lib/utils/pluginKey.d.ts +5 -0
- package/lib/utils/pluginKey.d.ts.map +1 -0
- package/lib/utils/pluginKey.js +18 -0
- package/lib/utils/pluginKey.js.map +1 -0
- package/package.json +35 -3
@@ -0,0 +1,140 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.createFlipperServerWithSocket = exports.createFlipperServer = exports.FlipperServerState = void 0;
|
7
|
+
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
8
|
+
const reconnecting_websocket_1 = __importDefault(require("reconnecting-websocket"));
|
9
|
+
const CONNECTION_TIMEOUT = 30 * 1000;
|
10
|
+
const EXEC_TIMEOUT = 45 * 1000;
|
11
|
+
var FlipperServerState;
|
12
|
+
(function (FlipperServerState) {
|
13
|
+
FlipperServerState[FlipperServerState["CONNECTING"] = 0] = "CONNECTING";
|
14
|
+
FlipperServerState[FlipperServerState["CONNECTED"] = 1] = "CONNECTED";
|
15
|
+
FlipperServerState[FlipperServerState["DISCONNECTED"] = 2] = "DISCONNECTED";
|
16
|
+
})(FlipperServerState = exports.FlipperServerState || (exports.FlipperServerState = {}));
|
17
|
+
function createFlipperServer(host, port, onStateChange) {
|
18
|
+
const socket = new reconnecting_websocket_1.default(`ws://${host}:${port}`);
|
19
|
+
return createFlipperServerWithSocket(socket, onStateChange);
|
20
|
+
}
|
21
|
+
exports.createFlipperServer = createFlipperServer;
|
22
|
+
function createFlipperServerWithSocket(socket, onStateChange) {
|
23
|
+
onStateChange(FlipperServerState.CONNECTING);
|
24
|
+
return new Promise((resolve, reject) => {
|
25
|
+
let initialConnectionTimeout = window.setTimeout(() => {
|
26
|
+
reject(new Error('Failed to connect to flipper-server in a timely manner'));
|
27
|
+
}, CONNECTION_TIMEOUT);
|
28
|
+
const eventEmitter = new eventemitter3_1.default();
|
29
|
+
const pendingRequests = new Map();
|
30
|
+
let requestId = 0;
|
31
|
+
let connected = false;
|
32
|
+
socket.addEventListener('open', () => {
|
33
|
+
if (initialConnectionTimeout) {
|
34
|
+
resolve(flipperServer);
|
35
|
+
clearTimeout(initialConnectionTimeout);
|
36
|
+
initialConnectionTimeout = undefined;
|
37
|
+
}
|
38
|
+
onStateChange(FlipperServerState.CONNECTED);
|
39
|
+
connected = true;
|
40
|
+
});
|
41
|
+
socket.addEventListener('close', () => {
|
42
|
+
onStateChange(FlipperServerState.DISCONNECTED);
|
43
|
+
connected = false;
|
44
|
+
pendingRequests.forEach((r) => r.reject(new Error('flipper-server disconnected')));
|
45
|
+
pendingRequests.clear();
|
46
|
+
});
|
47
|
+
socket.addEventListener('message', ({ data }) => {
|
48
|
+
const { event, payload } = JSON.parse(data.toString());
|
49
|
+
switch (event) {
|
50
|
+
case 'exec-response': {
|
51
|
+
console.debug('flipper-server: exec <<<', payload);
|
52
|
+
const entry = pendingRequests.get(payload.id);
|
53
|
+
if (!entry) {
|
54
|
+
console.warn(`Unknown request id `, payload.id);
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
pendingRequests.delete(payload.id);
|
58
|
+
clearTimeout(entry.timeout);
|
59
|
+
entry.resolve(payload.data);
|
60
|
+
}
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
case 'exec-response-error': {
|
64
|
+
console.debug('flipper-server: exec <<< [SERVER ERROR]', payload.id, payload.data);
|
65
|
+
const entry = pendingRequests.get(payload.id);
|
66
|
+
if (!entry) {
|
67
|
+
console.warn(`flipper-server: Unknown request id `, payload.id);
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
pendingRequests.delete(payload.id);
|
71
|
+
clearTimeout(entry.timeout);
|
72
|
+
entry.reject(payload.data);
|
73
|
+
}
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
case 'server-event': {
|
77
|
+
eventEmitter.emit(payload.event, payload.data);
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
default: {
|
81
|
+
console.warn('flipper-server: received unknown message type', data.toString());
|
82
|
+
}
|
83
|
+
}
|
84
|
+
});
|
85
|
+
const commandOrOptionsIsOptions = (commandOrOptions) => typeof commandOrOptions === 'object';
|
86
|
+
const flipperServer = {
|
87
|
+
async connect() { },
|
88
|
+
close() { },
|
89
|
+
exec(commandOrOptions, ...argsAmbiguous) {
|
90
|
+
let timeout;
|
91
|
+
let command;
|
92
|
+
let args;
|
93
|
+
if (commandOrOptionsIsOptions(commandOrOptions)) {
|
94
|
+
timeout = commandOrOptions.timeout;
|
95
|
+
command = argsAmbiguous[0];
|
96
|
+
args = argsAmbiguous.slice(1);
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
timeout = EXEC_TIMEOUT;
|
100
|
+
command = commandOrOptions;
|
101
|
+
args = argsAmbiguous;
|
102
|
+
}
|
103
|
+
if (connected) {
|
104
|
+
const id = ++requestId;
|
105
|
+
return new Promise((resolve, reject) => {
|
106
|
+
console.debug('flipper-server: exec >>>', id, command, args);
|
107
|
+
pendingRequests.set(id, {
|
108
|
+
resolve,
|
109
|
+
reject,
|
110
|
+
timeout: setInterval(() => {
|
111
|
+
pendingRequests.delete(id);
|
112
|
+
reject(new Error(`flipper-server: timeout for command '${command}'`));
|
113
|
+
}, timeout),
|
114
|
+
});
|
115
|
+
const execMessage = {
|
116
|
+
event: 'exec',
|
117
|
+
payload: {
|
118
|
+
id,
|
119
|
+
command,
|
120
|
+
args,
|
121
|
+
},
|
122
|
+
};
|
123
|
+
socket.send(JSON.stringify(execMessage));
|
124
|
+
});
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
throw new Error('Not connected to Flipper server');
|
128
|
+
}
|
129
|
+
},
|
130
|
+
on(event, callback) {
|
131
|
+
eventEmitter.on(event, callback);
|
132
|
+
},
|
133
|
+
off(event, callback) {
|
134
|
+
eventEmitter.off(event, callback);
|
135
|
+
},
|
136
|
+
};
|
137
|
+
});
|
138
|
+
}
|
139
|
+
exports.createFlipperServerWithSocket = createFlipperServerWithSocket;
|
140
|
+
//# sourceMappingURL=FlipperServerClient.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FlipperServerClient.js","sourceRoot":"","sources":["../../src/client/FlipperServerClient.tsx"],"names":[],"mappings":";;;;;;AASA,kEAAyC;AAQzC,oFAA2D;AAE3D,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,MAAM,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC;AAE/B,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,uEAAU,CAAA;IACV,qEAAS,CAAA;IACT,2EAAY,CAAA;AACd,CAAC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E;wBAC1C,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;wBAE7D,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE;4BACtB,OAAO;4BACP,MAAM;4BACN,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE;gCACxB,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gCAC3B,MAAM,CACJ,IAAI,KAAK,CAAC,wCAAwC,OAAO,GAAG,CAAC,CAC9D,CAAC;4BACJ,CAAC,EAAE,OAAO,CAAC;yBACZ,CAAC,CAAC;wBAEH,MAAM,WAAW,GAAG;4BAClB,KAAK,EAAE,MAAM;4BACb,OAAO,EAAE;gCACP,EAAE;gCACF,OAAO;gCACP,IAAI;6BACL;yBACsB,CAAC;wBAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;oBAC3C,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;iBACpD;YACH,CAAC;YACD,EAAE,CAAC,KAAK,EAAE,QAAQ;gBAChB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACnC,CAAC;YACD,GAAG,CAAC,KAAK,EAAE,QAAQ;gBACjB,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACpC,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AA5JD,sEA4JC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import BaseDevice from './BaseDevice';
|
2
|
+
import type { DeviceOS, DeviceType } from 'flipper-plugin-core';
|
3
|
+
export default class ArchivedDevice extends BaseDevice {
|
4
|
+
isArchived: boolean;
|
5
|
+
constructor(options: {
|
6
|
+
serial: string;
|
7
|
+
deviceType: DeviceType;
|
8
|
+
title: string;
|
9
|
+
os: DeviceOS;
|
10
|
+
screenshotHandle?: string | null;
|
11
|
+
source?: string;
|
12
|
+
supportRequestDetails?: object;
|
13
|
+
});
|
14
|
+
archivedScreenshotHandle: string | null;
|
15
|
+
displayTitle(): string;
|
16
|
+
supportRequestDetails?: object;
|
17
|
+
getArchivedScreenshotHandle(): string | null;
|
18
|
+
startLogging(): Promise<void>;
|
19
|
+
stopLogging(): Promise<void>;
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=ArchivedDevice.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ArchivedDevice.d.ts","sourceRoot":"","sources":["../../src/devices/ArchivedDevice.tsx"],"names":[],"mappings":"AASA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IACpD,UAAU,UAAQ;gBAEN,OAAO,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,UAAU,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,EAAE,EAAE,QAAQ,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC;IAmCD,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC,YAAY,IAAI,MAAM;IAItB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,2BAA2B,IAAI,MAAM,GAAG,IAAI;IAOtC,YAAY;IAOZ,WAAW;CAGlB"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const BaseDevice_1 = __importDefault(require("./BaseDevice"));
|
7
|
+
class ArchivedDevice extends BaseDevice_1.default {
|
8
|
+
constructor(options) {
|
9
|
+
var _a;
|
10
|
+
super({
|
11
|
+
async connect() { },
|
12
|
+
close() { },
|
13
|
+
exec(command, ..._args) {
|
14
|
+
throw new Error(`[Archived device] Cannot invoke command ${command} on an archived device`);
|
15
|
+
},
|
16
|
+
on(event) {
|
17
|
+
console.warn(`Cannot subscribe to server events from an Archived device: ${event}`);
|
18
|
+
},
|
19
|
+
off() { },
|
20
|
+
}, {
|
21
|
+
deviceType: options.deviceType,
|
22
|
+
title: options.title,
|
23
|
+
os: options.os,
|
24
|
+
serial: options.serial,
|
25
|
+
icon: 'box',
|
26
|
+
features: {
|
27
|
+
screenCaptureAvailable: false,
|
28
|
+
screenshotAvailable: false,
|
29
|
+
},
|
30
|
+
});
|
31
|
+
this.isArchived = true;
|
32
|
+
this.connected.set(false);
|
33
|
+
this.source = options.source || '';
|
34
|
+
this.supportRequestDetails = options.supportRequestDetails;
|
35
|
+
this.archivedScreenshotHandle = (_a = options.screenshotHandle) !== null && _a !== void 0 ? _a : null;
|
36
|
+
}
|
37
|
+
displayTitle() {
|
38
|
+
return `${this.title} ${this.source ? '(Imported)' : '(Offline)'}`;
|
39
|
+
}
|
40
|
+
getArchivedScreenshotHandle() {
|
41
|
+
return this.archivedScreenshotHandle;
|
42
|
+
}
|
43
|
+
async startLogging() {
|
44
|
+
}
|
45
|
+
async stopLogging() {
|
46
|
+
}
|
47
|
+
}
|
48
|
+
exports.default = ArchivedDevice;
|
49
|
+
//# sourceMappingURL=ArchivedDevice.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ArchivedDevice.js","sourceRoot":"","sources":["../../src/devices/ArchivedDevice.tsx"],"names":[],"mappings":";;;;;AASA,8DAAsC;AAGtC,MAAqB,cAAe,SAAQ,oBAAU;IAGpD,YAAY,OAQX;;QACC,KAAK,CACH;YACE,KAAK,CAAC,OAAO,KAAI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LogListener, Idler, CrashLogListener } from 'flipper-plugin-core';
|
2
|
+
import { DeviceLogEntry, DeviceOS, DeviceType, DeviceDescription, FlipperServer, CrashLog } from 'flipper-common';
|
3
|
+
import { DeviceSpec, PluginDetails } from 'flipper-common';
|
4
|
+
declare type PluginDefinition = _SandyPluginDefinition;
|
5
|
+
declare type PluginMap = Map<string, PluginDefinition>;
|
6
|
+
export declare type DeviceExport = {
|
7
|
+
os: DeviceOS;
|
8
|
+
title: string;
|
9
|
+
deviceType: DeviceType;
|
10
|
+
serial: string;
|
11
|
+
pluginStates: Record<string, any>;
|
12
|
+
};
|
13
|
+
export default class BaseDevice implements Device {
|
14
|
+
private pluginErrorHandler?;
|
15
|
+
description: DeviceDescription;
|
16
|
+
flipperServer: FlipperServer;
|
17
|
+
isArchived: boolean;
|
18
|
+
hasDevicePlugins: boolean;
|
19
|
+
private readonly serverAddOnControls;
|
20
|
+
constructor(flipperServer: FlipperServer, description: DeviceDescription, pluginErrorHandler?: ((msg: string) => void) | undefined);
|
21
|
+
get isConnected(): boolean;
|
22
|
+
get os(): import("flipper-common").OS;
|
23
|
+
get title(): string;
|
24
|
+
get deviceType(): DeviceType;
|
25
|
+
get serial(): string;
|
26
|
+
get specs(): DeviceSpec[];
|
27
|
+
get icon(): string | undefined;
|
28
|
+
logListeners: Map<Symbol, DeviceLogListener>;
|
29
|
+
crashListeners: Map<Symbol, CrashLogListener>;
|
30
|
+
readonly connected: import("flipper-plugin-core").Atom<boolean>;
|
31
|
+
source: string;
|
32
|
+
sandyPluginStates: Map<string, _SandyDevicePluginInstance>;
|
33
|
+
supportsOS(os: DeviceOS): boolean;
|
34
|
+
displayTitle(): string;
|
35
|
+
exportState(idler: Idler, onStatusMessage: (msg: string) => void, selectedPlugins: string[]): Promise<Record<string, any>>;
|
36
|
+
toJSON(): {
|
37
|
+
os: import("flipper-common").OS;
|
38
|
+
title: string;
|
39
|
+
deviceType: DeviceType;
|
40
|
+
serial: string;
|
41
|
+
};
|
42
|
+
private deviceLogEventHandler;
|
43
|
+
addLogEntry(entry: DeviceLogEntry): void;
|
44
|
+
startLogging(): Promise<void>;
|
45
|
+
stopLogging(): void;
|
46
|
+
addLogListener(callback: DeviceLogListener): Symbol;
|
47
|
+
removeLogListener(id: Symbol): void;
|
48
|
+
private crashLogEventHandler;
|
49
|
+
addCrashEntry(entry: CrashLog): void;
|
50
|
+
startCrashWatcher(): Promise<void>;
|
51
|
+
stopCrashWatcher(): void;
|
52
|
+
addCrashListener(callback: CrashLogListener): Symbol;
|
53
|
+
removeCrashListener(id: Symbol): void;
|
54
|
+
navigateToLocation(location: string): Promise<void>;
|
55
|
+
installApp(appBundlePath: string, timeout?: number): Promise<void>;
|
56
|
+
screenshot(): Promise<Uint8Array | undefined>;
|
57
|
+
startScreenCapture(destination: string): Promise<void>;
|
58
|
+
stopScreenCapture(): Promise<string | null>;
|
59
|
+
executeShell(command: string): Promise<string>;
|
60
|
+
sendMetroCommand(command: string): Promise<void>;
|
61
|
+
forwardPort(local: string, remote: string): Promise<boolean>;
|
62
|
+
clearLogs(): Promise<void>;
|
63
|
+
supportsPlugin(plugin: PluginDefinition | PluginDetails): any;
|
64
|
+
loadDevicePlugins(devicePlugins: PluginMap, enabledDevicePlugins: Set<string>, pluginStates?: Record<string, any>): void;
|
65
|
+
loadDevicePlugin(plugin: PluginDefinition, initialState?: any): void;
|
66
|
+
unloadDevicePlugin(pluginId: string): void;
|
67
|
+
disconnect(): void;
|
68
|
+
destroy(): void;
|
69
|
+
}
|
70
|
+
export {};
|
71
|
+
//# sourceMappingURL=BaseDevice.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseDevice.d.ts","sourceRoot":"","sources":["../../src/devices/BaseDevice.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,MAAM,EACN,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,EAGL,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,c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OAAO,CAAC;IAS5D,SAAS;IAIf,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,aAAa;IAiCvD,iBAAiB,CACf,aAAa,EAAE,SAAS,EACxB,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,EACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAapC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,GAAG;IA0B7D,kBAAkB,CAAC,QAAQ,EAAE,MAAM;IAQnC,UAAU;IAQV,OAAO;CAQR"}
|
@@ -0,0 +1,245 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const flipper_plugin_core_1 = require("flipper-plugin-core");
|
4
|
+
const pluginKey_1 = require("../utils/pluginKey");
|
5
|
+
const js_base64_1 = require("js-base64");
|
6
|
+
const createServerAddOnControls_1 = require("../utils/createServerAddOnControls");
|
7
|
+
class BaseDevice {
|
8
|
+
constructor(flipperServer, description, pluginErrorHandler) {
|
9
|
+
this.pluginErrorHandler = pluginErrorHandler;
|
10
|
+
this.isArchived = false;
|
11
|
+
this.hasDevicePlugins = false;
|
12
|
+
this.logListeners = new Map();
|
13
|
+
this.crashListeners = new Map();
|
14
|
+
this.connected = (0, flipper_plugin_core_1.createState)(true);
|
15
|
+
this.source = '';
|
16
|
+
this.sandyPluginStates = new Map();
|
17
|
+
this.deviceLogEventHandler = (payload) => {
|
18
|
+
if (payload.serial === this.serial && this.logListeners.size > 0) {
|
19
|
+
this.addLogEntry(payload.entry);
|
20
|
+
}
|
21
|
+
};
|
22
|
+
this.crashLogEventHandler = (payload) => {
|
23
|
+
if (payload.serial === this.serial && this.crashListeners.size > 0) {
|
24
|
+
this.addCrashEntry(payload.crash);
|
25
|
+
}
|
26
|
+
};
|
27
|
+
this.flipperServer = flipperServer;
|
28
|
+
this.description = description;
|
29
|
+
this.serverAddOnControls = (0, createServerAddOnControls_1.createServerAddOnControls)(this.flipperServer);
|
30
|
+
}
|
31
|
+
get isConnected() {
|
32
|
+
return this.connected.get();
|
33
|
+
}
|
34
|
+
get os() {
|
35
|
+
return this.description.os;
|
36
|
+
}
|
37
|
+
get title() {
|
38
|
+
return this.description.title;
|
39
|
+
}
|
40
|
+
get deviceType() {
|
41
|
+
return this.description.deviceType;
|
42
|
+
}
|
43
|
+
get serial() {
|
44
|
+
return this.description.serial;
|
45
|
+
}
|
46
|
+
get specs() {
|
47
|
+
var _a;
|
48
|
+
return (_a = this.description.specs) !== null && _a !== void 0 ? _a : [];
|
49
|
+
}
|
50
|
+
get icon() {
|
51
|
+
return this.description.icon;
|
52
|
+
}
|
53
|
+
supportsOS(os) {
|
54
|
+
return os.toLowerCase() === this.os.toLowerCase();
|
55
|
+
}
|
56
|
+
displayTitle() {
|
57
|
+
return this.connected.get() ? this.title : `${this.title} (Offline)`;
|
58
|
+
}
|
59
|
+
async exportState(idler, onStatusMessage, selectedPlugins) {
|
60
|
+
const pluginStates = {};
|
61
|
+
for (const instance of this.sandyPluginStates.values()) {
|
62
|
+
if (selectedPlugins.includes(instance.definition.id) &&
|
63
|
+
instance.isPersistable()) {
|
64
|
+
pluginStates[instance.definition.id] = await instance.exportState(idler, onStatusMessage);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
return pluginStates;
|
68
|
+
}
|
69
|
+
toJSON() {
|
70
|
+
return {
|
71
|
+
os: this.os,
|
72
|
+
title: this.title,
|
73
|
+
deviceType: this.deviceType,
|
74
|
+
serial: this.serial,
|
75
|
+
};
|
76
|
+
}
|
77
|
+
addLogEntry(entry) {
|
78
|
+
this.logListeners.forEach((listener) => {
|
79
|
+
try {
|
80
|
+
listener(entry);
|
81
|
+
}
|
82
|
+
catch (e) {
|
83
|
+
console.error(`Log listener exception:`, e);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
}
|
87
|
+
async startLogging() {
|
88
|
+
this.flipperServer.on('device-log', this.deviceLogEventHandler);
|
89
|
+
}
|
90
|
+
stopLogging() {
|
91
|
+
this.flipperServer.off('device-log', this.deviceLogEventHandler);
|
92
|
+
}
|
93
|
+
addLogListener(callback) {
|
94
|
+
if (this.logListeners.size === 0) {
|
95
|
+
this.startLogging();
|
96
|
+
}
|
97
|
+
const id = Symbol();
|
98
|
+
this.logListeners.set(id, callback);
|
99
|
+
return id;
|
100
|
+
}
|
101
|
+
removeLogListener(id) {
|
102
|
+
this.logListeners.delete(id);
|
103
|
+
if (this.logListeners.size === 0) {
|
104
|
+
this.stopLogging();
|
105
|
+
}
|
106
|
+
}
|
107
|
+
addCrashEntry(entry) {
|
108
|
+
this.crashListeners.forEach((listener) => {
|
109
|
+
try {
|
110
|
+
listener(entry);
|
111
|
+
}
|
112
|
+
catch (e) {
|
113
|
+
console.error(`Crash listener exception:`, e);
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
async startCrashWatcher() {
|
118
|
+
this.flipperServer.on('device-crash', this.crashLogEventHandler);
|
119
|
+
}
|
120
|
+
stopCrashWatcher() {
|
121
|
+
this.flipperServer.off('device-crash', this.crashLogEventHandler);
|
122
|
+
}
|
123
|
+
addCrashListener(callback) {
|
124
|
+
if (this.crashListeners.size === 0) {
|
125
|
+
this.startCrashWatcher();
|
126
|
+
}
|
127
|
+
const id = Symbol();
|
128
|
+
this.crashListeners.set(id, callback);
|
129
|
+
return id;
|
130
|
+
}
|
131
|
+
removeCrashListener(id) {
|
132
|
+
this.crashListeners.delete(id);
|
133
|
+
if (this.crashListeners.size === 0) {
|
134
|
+
this.stopCrashWatcher();
|
135
|
+
}
|
136
|
+
}
|
137
|
+
async navigateToLocation(location) {
|
138
|
+
return this.flipperServer.exec('device-navigate', this.serial, location);
|
139
|
+
}
|
140
|
+
async installApp(appBundlePath, timeout) {
|
141
|
+
return timeout
|
142
|
+
? this.flipperServer.exec({ timeout }, 'device-install-app', this.serial, appBundlePath)
|
143
|
+
: this.flipperServer.exec('device-install-app', this.serial, appBundlePath);
|
144
|
+
}
|
145
|
+
async screenshot() {
|
146
|
+
if (!this.description.features.screenshotAvailable || this.isArchived) {
|
147
|
+
return;
|
148
|
+
}
|
149
|
+
return js_base64_1.Base64.toUint8Array(await this.flipperServer.exec('device-take-screenshot', this.serial));
|
150
|
+
}
|
151
|
+
async startScreenCapture(destination) {
|
152
|
+
return this.flipperServer.exec('device-start-screencapture', this.serial, destination);
|
153
|
+
}
|
154
|
+
async stopScreenCapture() {
|
155
|
+
return this.flipperServer.exec('device-stop-screencapture', this.serial);
|
156
|
+
}
|
157
|
+
async executeShell(command) {
|
158
|
+
return this.flipperServer.exec('device-shell-exec', this.serial, command);
|
159
|
+
}
|
160
|
+
async sendMetroCommand(command) {
|
161
|
+
return this.flipperServer.exec('metro-command', this.serial, command);
|
162
|
+
}
|
163
|
+
async forwardPort(local, remote) {
|
164
|
+
return this.flipperServer.exec('device-forward-port', this.serial, local, remote);
|
165
|
+
}
|
166
|
+
async clearLogs() {
|
167
|
+
return this.flipperServer.exec('device-clear-logs', this.serial);
|
168
|
+
}
|
169
|
+
supportsPlugin(plugin) {
|
170
|
+
var _a, _b, _c, _d;
|
171
|
+
let pluginDetails;
|
172
|
+
if (plugin instanceof flipper_plugin_core_1._SandyPluginDefinition) {
|
173
|
+
pluginDetails = plugin.details;
|
174
|
+
if (!pluginDetails.pluginType && !pluginDetails.supportedDevices) {
|
175
|
+
if (plugin instanceof flipper_plugin_core_1._SandyPluginDefinition) {
|
176
|
+
return (plugin.isDevicePlugin &&
|
177
|
+
((_c = (_b = (_a = plugin.asDevicePluginModule()).supportsDevice) === null || _b === void 0 ? void 0 : _b.call(_a, this)) !== null && _c !== void 0 ? _c : false));
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
return plugin.supportsDevice(this);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
else {
|
185
|
+
pluginDetails = plugin;
|
186
|
+
}
|
187
|
+
return (pluginDetails.pluginType === 'device' &&
|
188
|
+
(!pluginDetails.supportedDevices ||
|
189
|
+
((_d = pluginDetails.supportedDevices) === null || _d === void 0 ? void 0 : _d.some((d) => (!d.os || d.os === this.os) &&
|
190
|
+
(!d.type || d.type === this.deviceType) &&
|
191
|
+
(d.archived === undefined || d.archived === this.isArchived) &&
|
192
|
+
(!d.specs || d.specs.every((spec) => this.specs.includes(spec)))))));
|
193
|
+
}
|
194
|
+
loadDevicePlugins(devicePlugins, enabledDevicePlugins, pluginStates) {
|
195
|
+
if (!devicePlugins) {
|
196
|
+
return;
|
197
|
+
}
|
198
|
+
const plugins = Array.from(devicePlugins.values()).filter((p) => enabledDevicePlugins === null || enabledDevicePlugins === void 0 ? void 0 : enabledDevicePlugins.has(p.id));
|
199
|
+
for (const plugin of plugins) {
|
200
|
+
this.loadDevicePlugin(plugin, pluginStates === null || pluginStates === void 0 ? void 0 : pluginStates[plugin.id]);
|
201
|
+
}
|
202
|
+
}
|
203
|
+
loadDevicePlugin(plugin, initialState) {
|
204
|
+
if (!this.supportsPlugin(plugin)) {
|
205
|
+
return;
|
206
|
+
}
|
207
|
+
this.hasDevicePlugins = true;
|
208
|
+
if (plugin instanceof flipper_plugin_core_1._SandyPluginDefinition) {
|
209
|
+
try {
|
210
|
+
const pluginInstance = new flipper_plugin_core_1._SandyDevicePluginInstance(this.serverAddOnControls, (0, flipper_plugin_core_1.getFlipperLib)(), plugin, this, (0, pluginKey_1.getPluginKey)(undefined, { serial: this.serial }, plugin.id), initialState);
|
211
|
+
if (this.pluginErrorHandler) {
|
212
|
+
pluginInstance.events.on('error', this.pluginErrorHandler);
|
213
|
+
}
|
214
|
+
this.sandyPluginStates.set(plugin.id, pluginInstance);
|
215
|
+
}
|
216
|
+
catch (e) {
|
217
|
+
console.error(`Failed to start device plugin '${plugin.id}': `, e);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
unloadDevicePlugin(pluginId) {
|
222
|
+
const instance = this.sandyPluginStates.get(pluginId);
|
223
|
+
if (instance) {
|
224
|
+
instance.destroy();
|
225
|
+
this.sandyPluginStates.delete(pluginId);
|
226
|
+
}
|
227
|
+
}
|
228
|
+
disconnect() {
|
229
|
+
this.logListeners.clear();
|
230
|
+
this.stopLogging();
|
231
|
+
this.crashListeners.clear();
|
232
|
+
this.stopCrashWatcher();
|
233
|
+
this.connected.set(false);
|
234
|
+
}
|
235
|
+
destroy() {
|
236
|
+
this.disconnect();
|
237
|
+
this.sandyPluginStates.forEach((instance) => {
|
238
|
+
instance.destroy();
|
239
|
+
});
|
240
|
+
this.sandyPluginStates.clear();
|
241
|
+
this.serverAddOnControls.unsubscribe();
|
242
|
+
}
|
243
|
+
}
|
244
|
+
exports.default = BaseDevice;
|
245
|
+
//# sourceMappingURL=BaseDevice.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseDevice.js","sourceRoot":"","sources":["../../src/devices/BaseDevice.tsx"],"names":[],"mappings":";;AASA,6DAS6B;AAW7B,kDAAgD;AAChD,yCAAiC;AACjC,kFAA6E;AAa7E,MAAqB,UAAU;IAO7B,YACE,aAA4B,EAC5B,WAA8B,EACtB,kBAA0C;QAA1C,uBAAkB,GAAlB,kBAAkB,CAAwB;QAPpD,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;QA+CzB,iBAAY,GAAmC,IAAI,GAAG,EAAE,CAAC;QAEzD,mBAAc,GAAkC,IAAI,GAAG,EAAE,CAAC;QAEjD,cAAS,GAAG,IAAA,iCAAW,EAAC,IAAI,CAAC,CAAC;QAGvC,WAAM,GAAG,EAAE,CAAC;QAGZ,sBAAiB,GAA4C,IAAI,GAAG,EAGjE,CAAC;QAyCI,0BAAqB,GAAG,CAAC,OAGhC,EAAE,EAAE;YACH,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE;gBAChE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aACj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ClB,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;CACF;AAjWD,6BAiWC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { DeviceOS, DeviceType } from 'flipper-plugin-core';
|
2
|
+
import { DeviceSpec } from 'flipper-common';
|
3
|
+
import BaseDevice from './BaseDevice';
|
4
|
+
export declare class TestDevice extends BaseDevice {
|
5
|
+
constructor(serial: string, deviceType: DeviceType, title: string, os: DeviceOS, specs?: DeviceSpec[]);
|
6
|
+
startLogging(): Promise<void>;
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=TestDevice.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TestDevice.d.ts","sourceRoot":"","sources":["../../src/devices/TestDevice.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,qBAAa,UAAW,SAAQ,UAAU;gBAEtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,QAAQ,EACZ,KAAK,CAAC,EAAE,UAAU,EAAE;IAehB,YAAY;CAGnB"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.TestDevice = void 0;
|
7
|
+
const BaseDevice_1 = __importDefault(require("./BaseDevice"));
|
8
|
+
const RenderHost_1 = require("../RenderHost");
|
9
|
+
class TestDevice extends BaseDevice_1.default {
|
10
|
+
constructor(serial, deviceType, title, os, specs) {
|
11
|
+
super((0, RenderHost_1.getRenderHostInstance)().flipperServer, {
|
12
|
+
serial,
|
13
|
+
deviceType,
|
14
|
+
title,
|
15
|
+
os,
|
16
|
+
specs,
|
17
|
+
features: {
|
18
|
+
screenCaptureAvailable: false,
|
19
|
+
screenshotAvailable: false,
|
20
|
+
},
|
21
|
+
});
|
22
|
+
}
|
23
|
+
async startLogging() {
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.TestDevice = TestDevice;
|
27
|
+
//# sourceMappingURL=TestDevice.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TestDevice.js","sourceRoot":"","sources":["../../src/devices/TestDevice.tsx"],"names":[],"mappings":";;;;;;AAWA,8DAAsC;AACtC,8CAAoD;AAEpD,MAAa,UAAW,SAAQ,oBAAU;IACxC,YACE,MAAc,EACd,UAAsB,EACtB,KAAa,EACb,EAAY,EACZ,KAAoB;QAEpB,KAAK,CAAC,IAAA,kCAAqB,GAAE,CAAC,aAAa,EAAE;YAC3C,MAAM;YACN,UAAU;YACV,KAAK;YACL,EAAE;YACF,KAAK;YACL,QAAQ,EAAE;gBACR,sBAAsB,EAAE,KAAK;gBAC7B,mBAAmB,EAAE,KAAK;aAC3B;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,YAAY;IAElB,CAAC;CACF;AAxBD,gCAwBC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/fb-stubs/constants.tsx"],"names":[],"mappings":";;;AASA,wBAEG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/fb-stubs/constants.tsx"],"names":[],"mappings":";;AASA,kBAAe,MAAM,CAAC,MAAM,CAAC;IAC3B,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"downloadFile.d.ts","sourceRoot":"","sources":["../../src/flipperLibImplementation/downloadFile.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,eAAO,MAAM,mBAAmB,eACjB,UAAU,KAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC,cAAc,CAyDzE,CAAC"}
|