@limrun/api 0.5.2 → 0.6.2
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/CHANGELOG.md +23 -112
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js +12 -6
- package/client.js.map +1 -1
- package/client.mjs +12 -6
- package/client.mjs.map +1 -1
- package/index.d.mts +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -2
- package/index.js.map +1 -1
- package/index.mjs +0 -1
- package/package.json +1 -4
- package/resources/android-instances-helpers.d.mts +51 -24
- package/resources/android-instances-helpers.d.mts.map +1 -1
- package/resources/android-instances-helpers.d.ts +51 -24
- package/resources/android-instances-helpers.d.ts.map +1 -1
- package/resources/android-instances-helpers.js +199 -107
- package/resources/android-instances-helpers.js.map +1 -1
- package/resources/android-instances-helpers.mjs +198 -103
- package/resources/android-instances-helpers.mjs.map +1 -1
- package/resources/android-instances.d.mts +4 -7
- package/resources/android-instances.d.mts.map +1 -1
- package/resources/android-instances.d.ts +4 -7
- package/resources/android-instances.d.ts.map +1 -1
- package/resources/android-instances.js.map +1 -1
- package/resources/android-instances.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/tunnel.d.mts +25 -0
- package/resources/tunnel.d.mts.map +1 -0
- package/resources/tunnel.d.ts +25 -0
- package/resources/tunnel.d.ts.map +1 -0
- package/resources/tunnel.js +102 -0
- package/resources/tunnel.js.map +1 -0
- package/resources/tunnel.mjs +98 -0
- package/resources/tunnel.mjs.map +1 -0
- package/src/client.ts +18 -14
- package/src/index.ts +0 -2
- package/src/resources/android-instances-helpers.ts +318 -127
- package/src/resources/android-instances.ts +3 -8
- package/src/resources/index.ts +0 -1
- package/src/resources/tunnel.ts +126 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAA6C;AAApC,iGAAA,MAAM,OAAW;AAE1B,6CAAyD;AAA/B,iGAAA,MAAM,OAAA;AAChC,qDAAgD;AAAvC,yGAAA,UAAU,OAAA;AACnB,sCAAsD;AAA7C,gGAAA,MAAM,OAAA;AACf,yCAcsB;AAbpB,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA"}
|
package/index.mjs
CHANGED
|
@@ -4,5 +4,4 @@ export { toFile } from "./core/uploads.mjs";
|
|
|
4
4
|
export { APIPromise } from "./core/api-promise.mjs";
|
|
5
5
|
export { Limrun } from "./client.mjs";
|
|
6
6
|
export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
|
|
7
|
-
export * from "./resources/android-instances-helpers.mjs";
|
|
8
7
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limrun/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "The official TypeScript library for the Limrun API",
|
|
5
5
|
"author": "Limrun <contact@limrun.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -136,8 +136,5 @@
|
|
|
136
136
|
"./version.mjs": {
|
|
137
137
|
"default": "./version.mjs"
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
"optionalDependencies": {
|
|
141
|
-
"bufferutil": "^4.0.9"
|
|
142
139
|
}
|
|
143
140
|
}
|
|
@@ -1,30 +1,57 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Tunnel } from "./tunnel.mjs";
|
|
2
|
+
export type { Tunnel } from "./tunnel.mjs";
|
|
2
3
|
import { AndroidInstance } from "./android-instances.mjs";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
* client to it.
|
|
5
|
+
* A client for interacting with a Limbar instance
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export type InstanceClient = {
|
|
8
|
+
/**
|
|
9
|
+
* Take a screenshot of the current screen
|
|
10
|
+
* @returns A promise that resolves to the screenshot data
|
|
11
|
+
*/
|
|
12
|
+
screenshot: () => Promise<ScreenshotData>;
|
|
13
|
+
/**
|
|
14
|
+
* Disconnect from the Limbar instance
|
|
15
|
+
*/
|
|
16
|
+
disconnect: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Establish an ADB tunnel to the instance.
|
|
19
|
+
* Returns the local TCP port and a cleanup function.
|
|
20
|
+
*/
|
|
21
|
+
startAdbTunnel: () => Promise<Tunnel>;
|
|
22
|
+
/**
|
|
23
|
+
* Send an asset URL to the instance. The instance will download the asset
|
|
24
|
+
* and process it (currently APK install is supported). Resolves on success,
|
|
25
|
+
* rejects with an Error on failure.
|
|
26
|
+
*/
|
|
27
|
+
sendAsset: (url: string) => Promise<void>;
|
|
28
|
+
};
|
|
13
29
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* The function creates a local TCP server that listens on an ephemeral port on
|
|
17
|
-
* 127.0.0.1. As soon as the **first** TCP client connects the server stops
|
|
18
|
-
* accepting further connections and forwards all traffic between that client
|
|
19
|
-
* and `remoteURL` through an authenticated WebSocket. If you need to proxy
|
|
20
|
-
* more than one TCP connection, call `startTcpProxy` again to create a new
|
|
21
|
-
* proxy instance.
|
|
22
|
-
*
|
|
23
|
-
* @param remoteURL Remote WebSocket endpoint (e.g. wss://example.com/instance)
|
|
24
|
-
* @param token Bearer token sent as `Authorization` header
|
|
25
|
-
* @param hostname Optional IP address to listen on. Default is 127.0.0.1
|
|
26
|
-
* @param port Optional port number to listen on. Default is to ask Node.js
|
|
27
|
-
* to find an available non-privileged port.
|
|
30
|
+
* Controls the verbosity of logging in the client
|
|
28
31
|
*/
|
|
29
|
-
export
|
|
32
|
+
export type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
33
|
+
/**
|
|
34
|
+
* Configuration options for creating an Instance API client
|
|
35
|
+
*/
|
|
36
|
+
export type InstanceClientOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Path to the ADB executable.
|
|
39
|
+
* @default 'adb'
|
|
40
|
+
*/
|
|
41
|
+
adbPath?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Controls logging verbosity
|
|
44
|
+
* @default 'info'
|
|
45
|
+
*/
|
|
46
|
+
logLevel?: LogLevel;
|
|
47
|
+
};
|
|
48
|
+
type ScreenshotData = {
|
|
49
|
+
dataUri: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Creates a client for interacting with a Limbar instance
|
|
53
|
+
* @param options Configuration options including webrtcUrl, token and log level
|
|
54
|
+
* @returns An InstanceClient for controlling the instance
|
|
55
|
+
*/
|
|
56
|
+
export declare function createInstanceClient(androidInstance: AndroidInstance, options?: InstanceClientOptions): Promise<InstanceClient>;
|
|
30
57
|
//# sourceMappingURL=android-instances-helpers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-instances-helpers.d.mts","sourceRoot":"","sources":["../src/resources/android-instances-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"android-instances-helpers.d.mts","sourceRoot":"","sources":["../src/resources/android-instances-helpers.ts"],"names":[],"mappings":"OAIO,KAAK,EAAE,MAAM,EAAE;YACV,EAAE,MAAM,EAAE;OACf,EAAE,eAAe,EAAE;AAE1B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB;;;OAGG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAaF,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA0BF;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,eAAe,EAChC,OAAO,GAAE,qBAGR,GACA,OAAO,CAAC,cAAc,CAAC,CAmPzB"}
|
|
@@ -1,30 +1,57 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Tunnel } from "./tunnel.js";
|
|
2
|
+
export type { Tunnel } from "./tunnel.js";
|
|
2
3
|
import { AndroidInstance } from "./android-instances.js";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
* client to it.
|
|
5
|
+
* A client for interacting with a Limbar instance
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export type InstanceClient = {
|
|
8
|
+
/**
|
|
9
|
+
* Take a screenshot of the current screen
|
|
10
|
+
* @returns A promise that resolves to the screenshot data
|
|
11
|
+
*/
|
|
12
|
+
screenshot: () => Promise<ScreenshotData>;
|
|
13
|
+
/**
|
|
14
|
+
* Disconnect from the Limbar instance
|
|
15
|
+
*/
|
|
16
|
+
disconnect: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Establish an ADB tunnel to the instance.
|
|
19
|
+
* Returns the local TCP port and a cleanup function.
|
|
20
|
+
*/
|
|
21
|
+
startAdbTunnel: () => Promise<Tunnel>;
|
|
22
|
+
/**
|
|
23
|
+
* Send an asset URL to the instance. The instance will download the asset
|
|
24
|
+
* and process it (currently APK install is supported). Resolves on success,
|
|
25
|
+
* rejects with an Error on failure.
|
|
26
|
+
*/
|
|
27
|
+
sendAsset: (url: string) => Promise<void>;
|
|
28
|
+
};
|
|
13
29
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* The function creates a local TCP server that listens on an ephemeral port on
|
|
17
|
-
* 127.0.0.1. As soon as the **first** TCP client connects the server stops
|
|
18
|
-
* accepting further connections and forwards all traffic between that client
|
|
19
|
-
* and `remoteURL` through an authenticated WebSocket. If you need to proxy
|
|
20
|
-
* more than one TCP connection, call `startTcpProxy` again to create a new
|
|
21
|
-
* proxy instance.
|
|
22
|
-
*
|
|
23
|
-
* @param remoteURL Remote WebSocket endpoint (e.g. wss://example.com/instance)
|
|
24
|
-
* @param token Bearer token sent as `Authorization` header
|
|
25
|
-
* @param hostname Optional IP address to listen on. Default is 127.0.0.1
|
|
26
|
-
* @param port Optional port number to listen on. Default is to ask Node.js
|
|
27
|
-
* to find an available non-privileged port.
|
|
30
|
+
* Controls the verbosity of logging in the client
|
|
28
31
|
*/
|
|
29
|
-
export
|
|
32
|
+
export type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
33
|
+
/**
|
|
34
|
+
* Configuration options for creating an Instance API client
|
|
35
|
+
*/
|
|
36
|
+
export type InstanceClientOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Path to the ADB executable.
|
|
39
|
+
* @default 'adb'
|
|
40
|
+
*/
|
|
41
|
+
adbPath?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Controls logging verbosity
|
|
44
|
+
* @default 'info'
|
|
45
|
+
*/
|
|
46
|
+
logLevel?: LogLevel;
|
|
47
|
+
};
|
|
48
|
+
type ScreenshotData = {
|
|
49
|
+
dataUri: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Creates a client for interacting with a Limbar instance
|
|
53
|
+
* @param options Configuration options including webrtcUrl, token and log level
|
|
54
|
+
* @returns An InstanceClient for controlling the instance
|
|
55
|
+
*/
|
|
56
|
+
export declare function createInstanceClient(androidInstance: AndroidInstance, options?: InstanceClientOptions): Promise<InstanceClient>;
|
|
30
57
|
//# sourceMappingURL=android-instances-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-instances-helpers.d.ts","sourceRoot":"","sources":["../src/resources/android-instances-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"android-instances-helpers.d.ts","sourceRoot":"","sources":["../src/resources/android-instances-helpers.ts"],"names":[],"mappings":"OAIO,KAAK,EAAE,MAAM,EAAE;YACV,EAAE,MAAM,EAAE;OACf,EAAE,eAAe,EAAE;AAE1B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB;;;OAGG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAaF,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA0BF;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,eAAe,EAChC,OAAO,GAAE,qBAGR,GACA,OAAO,CAAC,cAAc,CAAC,CAmPzB"}
|
|
@@ -1,129 +1,221 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.startTcpProxy = startTcpProxy;
|
|
5
|
-
const tslib_1 = require("../internal/tslib.js");
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
const net = tslib_1.__importStar(require("net"));
|
|
3
|
+
exports.createInstanceClient = createInstanceClient;
|
|
8
4
|
const ws_1 = require("ws");
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const tunnel_js_1 = require("./tunnel.js");
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Creates a client for interacting with a Limbar instance
|
|
9
|
+
* @param options Configuration options including webrtcUrl, token and log level
|
|
10
|
+
* @returns An InstanceClient for controlling the instance
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*/
|
|
50
|
-
async function startTcpProxy(remoteURL, token, hostname, port) {
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
const server = net.createServer();
|
|
53
|
-
let ws;
|
|
54
|
-
let pingInterval;
|
|
55
|
-
// close helper
|
|
56
|
-
const close = () => {
|
|
57
|
-
if (pingInterval) {
|
|
58
|
-
clearInterval(pingInterval);
|
|
59
|
-
pingInterval = undefined;
|
|
12
|
+
async function createInstanceClient(androidInstance, options = {
|
|
13
|
+
adbPath: 'adb',
|
|
14
|
+
logLevel: 'info',
|
|
15
|
+
}) {
|
|
16
|
+
const token = androidInstance.status.token;
|
|
17
|
+
const serverAddress = `${androidInstance.status.endpointWebSocketUrl}?token=${token}`;
|
|
18
|
+
const logLevel = options.logLevel ?? 'info';
|
|
19
|
+
let ws = undefined;
|
|
20
|
+
const screenshotRequests = new Map();
|
|
21
|
+
const assetRequests = new Map();
|
|
22
|
+
// Logger functions
|
|
23
|
+
const logger = {
|
|
24
|
+
debug: (...args) => {
|
|
25
|
+
if (logLevel === 'debug')
|
|
26
|
+
console.log(...args);
|
|
27
|
+
},
|
|
28
|
+
info: (...args) => {
|
|
29
|
+
if (logLevel === 'info' || logLevel === 'debug')
|
|
30
|
+
console.log(...args);
|
|
31
|
+
},
|
|
32
|
+
warn: (...args) => {
|
|
33
|
+
if (logLevel === 'warn' || logLevel === 'info' || logLevel === 'debug')
|
|
34
|
+
console.warn(...args);
|
|
35
|
+
},
|
|
36
|
+
error: (...args) => {
|
|
37
|
+
if (logLevel !== 'none')
|
|
38
|
+
console.error(...args);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
return new Promise((resolveConnection, rejectConnection) => {
|
|
42
|
+
logger.debug(`Attempting to connect to WebSocket server at ${serverAddress}...`);
|
|
43
|
+
ws = new ws_1.WebSocket(serverAddress);
|
|
44
|
+
ws.on('message', (data) => {
|
|
45
|
+
let message;
|
|
46
|
+
try {
|
|
47
|
+
message = JSON.parse(data.toString());
|
|
60
48
|
}
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error({ data, error: e }, 'Failed to parse JSON message');
|
|
51
|
+
return;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
switch (message.type) {
|
|
54
|
+
case 'screenshot': {
|
|
55
|
+
if (!('dataUri' in message) || typeof message.dataUri !== 'string' || !('id' in message)) {
|
|
56
|
+
logger.warn('Received invalid screenshot message:', message);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
const screenshotMessage = message;
|
|
60
|
+
const request = screenshotRequests.get(screenshotMessage.id);
|
|
61
|
+
if (!request) {
|
|
62
|
+
logger.warn(`Received screenshot data for unknown or already handled session: ${screenshotMessage.id}`);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
logger.debug(`Received screenshot data URI for session ${screenshotMessage.id}.`);
|
|
66
|
+
request.resolver({ dataUri: screenshotMessage.dataUri });
|
|
67
|
+
screenshotRequests.delete(screenshotMessage.id);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case 'screenshotError': {
|
|
71
|
+
if (!('message' in message) || !('id' in message)) {
|
|
72
|
+
logger.warn('Received invalid screenshot error message:', message);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
const errorMessage = message;
|
|
76
|
+
const request = screenshotRequests.get(errorMessage.id);
|
|
77
|
+
if (!request) {
|
|
78
|
+
logger.warn(`Received screenshot error for unknown or already handled session: ${errorMessage.id}`);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
logger.error(`Server reported an error capturing screenshot for session ${errorMessage.id}:`, errorMessage.message);
|
|
82
|
+
request.rejecter(new Error(errorMessage.message));
|
|
83
|
+
screenshotRequests.delete(errorMessage.id);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'assetResult': {
|
|
87
|
+
logger.debug('Received assetResult:', message);
|
|
88
|
+
const request = assetRequests.get(message.url);
|
|
89
|
+
if (!request) {
|
|
90
|
+
logger.warn(`Received assetResult for unknown or already handled url: ${message.url}`);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (message.result === 'success') {
|
|
94
|
+
logger.debug('Asset result is success');
|
|
95
|
+
request.resolver();
|
|
96
|
+
assetRequests.delete(message.url);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
const errorMessage = typeof message.message === 'string' && message.message ?
|
|
100
|
+
message.message
|
|
101
|
+
: `Asset processing failed: ${JSON.stringify(message)}`;
|
|
102
|
+
logger.debug('Asset result is failure', errorMessage);
|
|
103
|
+
request.rejecter(new Error(errorMessage));
|
|
104
|
+
assetRequests.delete(message.url);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
logger.warn(`Received unexpected message type: ${message.type}`);
|
|
109
|
+
break;
|
|
66
110
|
}
|
|
67
|
-
};
|
|
68
|
-
// No AbortController support – proxy can be closed via the returned handle
|
|
69
|
-
// TCP server error
|
|
70
|
-
server.once('error', (err) => {
|
|
71
|
-
close();
|
|
72
|
-
reject(new Error(`TCP server error: ${err.message}`));
|
|
73
111
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
close();
|
|
79
|
-
return reject(new Error('Failed to obtain listening address'));
|
|
112
|
+
ws.on('error', (err) => {
|
|
113
|
+
logger.error('WebSocket error:', err.message);
|
|
114
|
+
if (ws && (ws.readyState === ws_1.WebSocket.CONNECTING || ws.readyState === ws_1.WebSocket.OPEN)) {
|
|
115
|
+
rejectConnection(err);
|
|
80
116
|
}
|
|
81
|
-
|
|
117
|
+
screenshotRequests.forEach((request) => request.rejecter(err));
|
|
82
118
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
}, 30000);
|
|
104
|
-
// TCP → WS
|
|
105
|
-
tcpSocket.on('data', (chunk) => {
|
|
106
|
-
if (socket.readyState === ws_1.WebSocket.OPEN) {
|
|
107
|
-
socket.send(chunk);
|
|
119
|
+
ws.on('close', () => {
|
|
120
|
+
logger.debug('Disconnected from server.');
|
|
121
|
+
screenshotRequests.forEach((request) => request.rejecter('Disconnected from server'));
|
|
122
|
+
});
|
|
123
|
+
const screenshot = async () => {
|
|
124
|
+
if (!ws || ws.readyState !== ws_1.WebSocket.OPEN) {
|
|
125
|
+
return Promise.reject(new Error('WebSocket is not connected or connection is not open.'));
|
|
126
|
+
}
|
|
127
|
+
const id = 'ts-client-' + Date.now();
|
|
128
|
+
const screenshotRequest = {
|
|
129
|
+
type: 'screenshot',
|
|
130
|
+
id,
|
|
131
|
+
};
|
|
132
|
+
return new Promise((resolve, reject) => {
|
|
133
|
+
logger.debug('Sending screenshot request:', screenshotRequest);
|
|
134
|
+
ws.send(JSON.stringify(screenshotRequest), (err) => {
|
|
135
|
+
if (err) {
|
|
136
|
+
logger.error('Failed to send screenshot request:', err);
|
|
137
|
+
reject(err);
|
|
108
138
|
}
|
|
109
139
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
140
|
+
const timeout = setTimeout(() => {
|
|
141
|
+
if (screenshotRequests.has(id)) {
|
|
142
|
+
logger.error(`Screenshot request timed out for session ${id}`);
|
|
143
|
+
screenshotRequests.get(id)?.rejecter(new Error('Screenshot request timed out'));
|
|
144
|
+
screenshotRequests.delete(id);
|
|
114
145
|
}
|
|
146
|
+
}, 30000);
|
|
147
|
+
screenshotRequests.set(id, {
|
|
148
|
+
resolver: (value) => {
|
|
149
|
+
clearTimeout(timeout);
|
|
150
|
+
resolve(value);
|
|
151
|
+
screenshotRequests.delete(id);
|
|
152
|
+
},
|
|
153
|
+
rejecter: (reason) => {
|
|
154
|
+
clearTimeout(timeout);
|
|
155
|
+
reject(reason);
|
|
156
|
+
screenshotRequests.delete(id);
|
|
157
|
+
},
|
|
115
158
|
});
|
|
116
159
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
160
|
+
};
|
|
161
|
+
const disconnect = () => {
|
|
162
|
+
if (ws) {
|
|
163
|
+
logger.debug('Closing WebSocket connection.');
|
|
164
|
+
ws.close();
|
|
165
|
+
}
|
|
166
|
+
screenshotRequests.forEach((request) => request.rejecter('Websocket connection closed'));
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Opens a WebSocket TCP proxy for the ADB port and connects the local adb
|
|
170
|
+
* client to it.
|
|
171
|
+
*/
|
|
172
|
+
const startAdbTunnel = async () => {
|
|
173
|
+
if (!androidInstance.status.adbWebSocketUrl) {
|
|
174
|
+
return Promise.reject(new Error('ADB WebSocket URL is not set'));
|
|
175
|
+
}
|
|
176
|
+
const { address, close } = await (0, tunnel_js_1.startTcpTunnel)(androidInstance.status.adbWebSocketUrl, token, '127.0.0.1', 0);
|
|
177
|
+
try {
|
|
178
|
+
await new Promise((resolve, reject) => {
|
|
179
|
+
(0, node_child_process_1.exec)(`${options.adbPath ?? 'adb'} connect ${address.address}:${address.port}`, (err) => {
|
|
180
|
+
if (err)
|
|
181
|
+
return reject(err);
|
|
182
|
+
resolve();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
logger.debug(`ADB connected on ${address.address}`);
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
121
188
|
close();
|
|
189
|
+
throw err;
|
|
190
|
+
}
|
|
191
|
+
return { address, close };
|
|
192
|
+
};
|
|
193
|
+
const sendAsset = async (url) => {
|
|
194
|
+
if (!ws || ws.readyState !== ws_1.WebSocket.OPEN) {
|
|
195
|
+
return Promise.reject(new Error('WebSocket is not connected or connection is not open.'));
|
|
196
|
+
}
|
|
197
|
+
const assetRequest = {
|
|
198
|
+
type: 'asset',
|
|
199
|
+
url,
|
|
200
|
+
};
|
|
201
|
+
ws.send(JSON.stringify(assetRequest), (err) => {
|
|
202
|
+
if (err) {
|
|
203
|
+
logger.error('Failed to send asset request:', err);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return new Promise((resolve, reject) => {
|
|
207
|
+
assetRequests.set(url, { resolver: resolve, rejecter: reject });
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
ws.on('open', () => {
|
|
211
|
+
logger.debug(`Connected to ${serverAddress}`);
|
|
212
|
+
resolveConnection({
|
|
213
|
+
screenshot,
|
|
214
|
+
disconnect,
|
|
215
|
+
startAdbTunnel,
|
|
216
|
+
sendAsset,
|
|
122
217
|
});
|
|
123
|
-
ws.on('close', () => tcpSocket.destroy());
|
|
124
218
|
});
|
|
125
|
-
// Start listening
|
|
126
|
-
server.listen(port, hostname);
|
|
127
219
|
});
|
|
128
220
|
}
|
|
129
221
|
//# sourceMappingURL=android-instances-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-instances-helpers.js","sourceRoot":"","sources":["../src/resources/android-instances-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"android-instances-helpers.js","sourceRoot":"","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