@ekhein/lamda-node-sdk 10.8.0 → 10.8.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/dist/main.d.ts +3 -3
- package/dist/main.js +8 -8
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -16,14 +16,14 @@ export declare class Device {
|
|
|
16
16
|
readonly Settings: SettingsClient;
|
|
17
17
|
private channel;
|
|
18
18
|
private client;
|
|
19
|
-
constructor();
|
|
19
|
+
constructor(ipaddr: string, port?: number);
|
|
20
20
|
click(selector: Partial<Selector>, corner?: Corner): Promise<import("./rpc/types").Boolean>;
|
|
21
21
|
keyboard(keys: string, selector: Record<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9", Partial<Selector>>): Promise<void>;
|
|
22
22
|
waitFor(selector: Partial<Selector>, timeout?: number): Promise<true>;
|
|
23
23
|
sleep(min?: number, max?: number): Promise<unknown>;
|
|
24
|
-
|
|
24
|
+
openURLScheme(data: string): Promise<import("./rpc/types").Boolean>;
|
|
25
25
|
kill(name: string): Promise<import("./rpc/types").Boolean>;
|
|
26
|
-
|
|
26
|
+
start(name: string): Promise<import("./rpc/types").Boolean>;
|
|
27
27
|
restart(name: string): Promise<void>;
|
|
28
28
|
call(args: {
|
|
29
29
|
package: string;
|
package/dist/main.js
CHANGED
|
@@ -20,16 +20,16 @@ const services_1 = require("./rpc/services");
|
|
|
20
20
|
class Device {
|
|
21
21
|
channel;
|
|
22
22
|
client;
|
|
23
|
-
constructor() {
|
|
24
|
-
const address =
|
|
23
|
+
constructor(ipaddr, port = 65000) {
|
|
24
|
+
const address = Array(ipaddr, port).join(":");
|
|
25
25
|
const credentials = nice_grpc_1.ChannelCredentials.createInsecure();
|
|
26
26
|
this.client = (0, nice_grpc_1.createClientFactory)()
|
|
27
27
|
.use((0, remoteException_Interceptor_1.RemoteExceptionInterceptor)());
|
|
28
|
-
this.channel = (0, nice_grpc_1.createChannel)(address
|
|
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
31
|
["grpc.keepalive_time_ms"]: 60 * 1000,
|
|
32
|
-
["grpc.keepalive_timeout_ms"]:
|
|
32
|
+
["grpc.keepalive_timeout_ms"]: 20 * 1000,
|
|
33
33
|
["grpc.keepalive_permit_without_calls"]: 1,
|
|
34
34
|
["grpc.max_pings_without_data"]: 0,
|
|
35
35
|
["grpc.enable_http_proxy"]: 0,
|
|
@@ -57,7 +57,7 @@ class Device {
|
|
|
57
57
|
await this.click(selector[keys[i]]);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
async waitFor(selector, timeout =
|
|
60
|
+
async waitFor(selector, timeout = 15000) {
|
|
61
61
|
return this.UiAutomator
|
|
62
62
|
.selectorWaitForExists({ selector, timeout })
|
|
63
63
|
.then(async (exists) => {
|
|
@@ -70,7 +70,7 @@ class Device {
|
|
|
70
70
|
const ms = Math.random() * (max - min) + min;
|
|
71
71
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
72
72
|
}
|
|
73
|
-
async
|
|
73
|
+
async openURLScheme(data) {
|
|
74
74
|
return this.Application
|
|
75
75
|
.startActivity({
|
|
76
76
|
data,
|
|
@@ -82,14 +82,14 @@ class Device {
|
|
|
82
82
|
return this.Application
|
|
83
83
|
.stopApplication({ name });
|
|
84
84
|
}
|
|
85
|
-
async
|
|
85
|
+
async start(name) {
|
|
86
86
|
return this.Application
|
|
87
87
|
.startApplication({ name });
|
|
88
88
|
}
|
|
89
89
|
async restart(name) {
|
|
90
90
|
await this.kill(name);
|
|
91
91
|
await this.sleep(200);
|
|
92
|
-
await this.
|
|
92
|
+
await this.start(name);
|
|
93
93
|
}
|
|
94
94
|
async call(args) {
|
|
95
95
|
const callinfo = JSON.stringify(args.callinfo);
|