@ekhein/lamda-node-sdk 10.8.2 → 10.8.6
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/dist/main.d.ts +5 -0
- package/dist/main.js +12 -2
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare class Device {
|
|
|
17
17
|
private channel;
|
|
18
18
|
private client;
|
|
19
19
|
constructor(ipaddr: string, port?: number);
|
|
20
|
+
dispose(): Promise<void>;
|
|
20
21
|
click(selector: Partial<Selector>, corner?: Corner): Promise<import("./rpc/types").Boolean>;
|
|
21
22
|
keyboard(keys: string, selector: Record<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9", Partial<Selector>>): Promise<void>;
|
|
22
23
|
waitFor(selector: Partial<Selector>, timeout?: number): Promise<true>;
|
|
@@ -32,4 +33,8 @@ export declare class Device {
|
|
|
32
33
|
args: Array<any>;
|
|
33
34
|
};
|
|
34
35
|
}): Promise<any>;
|
|
36
|
+
screenshot(options?: Partial<{
|
|
37
|
+
selector: Selector;
|
|
38
|
+
quality: number;
|
|
39
|
+
}>): Promise<Buffer<ArrayBuffer>>;
|
|
35
40
|
}
|
package/dist/main.js
CHANGED
|
@@ -28,10 +28,9 @@ class Device {
|
|
|
28
28
|
this.channel = (0, nice_grpc_1.createChannel)(address, credentials, {
|
|
29
29
|
["grpc.max_send_message_length"]: 64 * 1024 * 1024,
|
|
30
30
|
["grpc.max_receive_message_length"]: 128 * 1024 * 1024,
|
|
31
|
-
["grpc.keepalive_time_ms"]: 60 * 1000,
|
|
31
|
+
["grpc.keepalive_time_ms"]: 5 * 60 * 1000,
|
|
32
32
|
["grpc.keepalive_timeout_ms"]: 20 * 1000,
|
|
33
33
|
["grpc.keepalive_permit_without_calls"]: 1,
|
|
34
|
-
["grpc.max_pings_without_data"]: 0,
|
|
35
34
|
["grpc.enable_http_proxy"]: 0,
|
|
36
35
|
["grpc.service_config"]: JSON.stringify({
|
|
37
36
|
["methodConfig"]: [{
|
|
@@ -47,6 +46,10 @@ class Device {
|
|
|
47
46
|
})
|
|
48
47
|
});
|
|
49
48
|
}
|
|
49
|
+
async dispose() {
|
|
50
|
+
return this.channel
|
|
51
|
+
.close();
|
|
52
|
+
}
|
|
50
53
|
async click(selector, corner) {
|
|
51
54
|
return this.UiAutomator
|
|
52
55
|
.selectorClick({ selector, corner });
|
|
@@ -99,6 +102,13 @@ class Device {
|
|
|
99
102
|
return JSON.parse(call.callresult);
|
|
100
103
|
});
|
|
101
104
|
}
|
|
105
|
+
async screenshot(options) {
|
|
106
|
+
return this.UiAutomator
|
|
107
|
+
.selectorTakeScreenshot(options)
|
|
108
|
+
.then(async (result) => {
|
|
109
|
+
return Buffer.from(result.value);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
102
112
|
}
|
|
103
113
|
exports.Device = Device;
|
|
104
114
|
__decorate([
|