@ekhein/lamda-node-sdk 2.0.6 → 2.0.7
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/constants/activity.flag.js +25 -22
- package/dist/constants/android.intent.js +60 -56
- package/dist/constants/android.permission.js +33 -30
- package/dist/constants/index.js +19 -3
- package/dist/decorators/inject.decorator.js +4 -1
- package/dist/exceptions/remoteCall.exception.js +7 -3
- package/dist/exceptions/remoteRpc.exception.js +7 -3
- package/dist/exceptions/timeout.exception.js +7 -3
- package/dist/interceptor/remoteException.Interceptor.js +8 -5
- package/dist/main.js +32 -28
- package/dist/rpc/application.js +86 -77
- package/dist/rpc/debug.js +9 -6
- package/dist/rpc/file.js +17 -14
- package/dist/rpc/google/protobuf/any.js +9 -6
- package/dist/rpc/google/protobuf/empty.js +9 -6
- package/dist/rpc/google/protobuf/struct.js +37 -32
- package/dist/rpc/policy.js +9 -6
- package/dist/rpc/proxy.js +55 -40
- package/dist/rpc/services.js +381 -378
- package/dist/rpc/settings.js +15 -10
- package/dist/rpc/shell.js +17 -14
- package/dist/rpc/status.js +29 -26
- package/dist/rpc/storage.js +9 -6
- package/dist/rpc/types.js +25 -22
- package/dist/rpc/uiautomator.js +309 -290
- package/dist/rpc/util.js +102 -97
- package/dist/rpc/wifi.js +56 -53
- package/package.json +1 -1
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FLAG_ACTIVITY_TASK_ON_HOME = exports.FLAG_ACTIVITY_SINGLE_TOP = exports.FLAG_ACTIVITY_RETAIN_IN_RECENTS = exports.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = exports.FLAG_ACTIVITY_REQUIRE_NON_BROWSER = exports.FLAG_ACTIVITY_REQUIRE_DEFAULT = exports.FLAG_ACTIVITY_REORDER_TO_FRONT = exports.FLAG_ACTIVITY_PREVIOUS_IS_TOP = exports.FLAG_ACTIVITY_NO_USER_ACTION = exports.FLAG_ACTIVITY_NO_HISTORY = exports.FLAG_ACTIVITY_NO_ANIMATION = exports.FLAG_ACTIVITY_NEW_TASK = exports.FLAG_ACTIVITY_NEW_DOCUMENT = exports.FLAG_ACTIVITY_MULTIPLE_TASK = exports.FLAG_ACTIVITY_MATCH_EXTERNAL = exports.FLAG_ACTIVITY_LAUNCH_ADJACENT = exports.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = exports.FLAG_ACTIVITY_FORWARD_RESULT = exports.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = exports.FLAG_ACTIVITY_CLEAR_TOP = exports.FLAG_ACTIVITY_CLEAR_TASK = exports.FLAG_ACTIVITY_BROUGHT_TO_FRONT = void 0;
|
|
4
|
+
exports.FLAG_ACTIVITY_BROUGHT_TO_FRONT = 0x00400000;
|
|
5
|
+
exports.FLAG_ACTIVITY_CLEAR_TASK = 0x00008000;
|
|
6
|
+
exports.FLAG_ACTIVITY_CLEAR_TOP = 0x04000000;
|
|
7
|
+
exports.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = 0x00800000;
|
|
8
|
+
exports.FLAG_ACTIVITY_FORWARD_RESULT = 0x02000000;
|
|
9
|
+
exports.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = 0x00100000;
|
|
10
|
+
exports.FLAG_ACTIVITY_LAUNCH_ADJACENT = 0x00001000;
|
|
11
|
+
exports.FLAG_ACTIVITY_MATCH_EXTERNAL = 0x00000800;
|
|
12
|
+
exports.FLAG_ACTIVITY_MULTIPLE_TASK = 0x08000000;
|
|
13
|
+
exports.FLAG_ACTIVITY_NEW_DOCUMENT = 0x00080000;
|
|
14
|
+
exports.FLAG_ACTIVITY_NEW_TASK = 0x10000000;
|
|
15
|
+
exports.FLAG_ACTIVITY_NO_ANIMATION = 0x00010000;
|
|
16
|
+
exports.FLAG_ACTIVITY_NO_HISTORY = 0x40000000;
|
|
17
|
+
exports.FLAG_ACTIVITY_NO_USER_ACTION = 0x00040000;
|
|
18
|
+
exports.FLAG_ACTIVITY_PREVIOUS_IS_TOP = 0x01000000;
|
|
19
|
+
exports.FLAG_ACTIVITY_REORDER_TO_FRONT = 0x00020000;
|
|
20
|
+
exports.FLAG_ACTIVITY_REQUIRE_DEFAULT = 0x00000200;
|
|
21
|
+
exports.FLAG_ACTIVITY_REQUIRE_NON_BROWSER = 0x00000400;
|
|
22
|
+
exports.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 0x00200000;
|
|
23
|
+
exports.FLAG_ACTIVITY_RETAIN_IN_RECENTS = 0x00002000;
|
|
24
|
+
exports.FLAG_ACTIVITY_SINGLE_TOP = 0x20000000;
|
|
25
|
+
exports.FLAG_ACTIVITY_TASK_ON_HOME = 0x00004000;
|
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACTION_MEDIA_RECORD_PAUSE = exports.ACTION_MEDIA_RECORD = exports.ACTION_MEDIA_STOP_RECORDING = exports.ACTION_MEDIA_PLAY_PAUSE = exports.ACTION_MEDIA_REWIND = exports.ACTION_MEDIA_FAST_FORWARD = exports.ACTION_MEDIA_PREVIOUS = exports.ACTION_MEDIA_NEXT = exports.ACTION_MEDIA_STOP = exports.ACTION_MEDIA_PAUSE = exports.ACTION_MEDIA_PLAY = exports.ACTION_MEDIA_REORDER = exports.ACTION_MEDIA_EJECT = exports.ACTION_MEDIA_SHARED = exports.ACTION_MEDIA_UNMOUNTABLE = exports.ACTION_MEDIA_BAD_REMOVAL = exports.ACTION_MEDIA_UNMOUNTED = exports.ACTION_MEDIA_MOUNTED = exports.ACTION_MEDIA_SCANNER_FINISHED = exports.ACTION_MEDIA_SCANNER_STARTED = exports.ACTION_MEDIA_SCANNER_SCAN_FILE = exports.ACTION_CONFIGURATION_CHANGED = exports.ACTION_LOCALE_CHANGED = exports.ACTION_AIRPLANE_MODE_CHANGED = exports.ACTION_TIMEZONE_CHANGED = exports.ACTION_DATE_CHANGED = exports.ACTION_TIME_CHANGED = exports.ACTION_SCREEN_OFF = exports.ACTION_SCREEN_ON = exports.ACTION_HEADSET_PLUG = exports.ACTION_BATTERY_OKAY = exports.ACTION_BATTERY_LOW = exports.ACTION_POWER_DISCONNECTED = exports.ACTION_POWER_CONNECTED = exports.ACTION_MAIN = exports.ACTION_SYNC = exports.ACTION_UNINSTALL_PACKAGE = exports.ACTION_INSTALL_PACKAGE = exports.ACTION_GET_CONTENT = exports.ACTION_CHOOSER = exports.ACTION_PICK = exports.ACTION_SEND_MULTIPLE = exports.ACTION_SMS = exports.ACTION_CALL_BUTTON = exports.ACTION_CALL = exports.ACTION_DIAL = exports.ACTION_SENDTO = exports.ACTION_SEND = exports.ACTION_EDIT = exports.ACTION_VIEW = void 0;
|
|
4
|
+
exports.ACTION_MEDIA_RECORD_RESET = exports.ACTION_MEDIA_RECORD_RESTART = exports.ACTION_MEDIA_RECORD_END = exports.ACTION_MEDIA_RECORD_START = exports.ACTION_MEDIA_RECORD_RESUME = exports.ACTION_MEDIA_RECORD_STOP = void 0;
|
|
5
|
+
exports.ACTION_VIEW = "android.intent.action.VIEW";
|
|
6
|
+
exports.ACTION_EDIT = "android.intent.action.EDIT";
|
|
7
|
+
exports.ACTION_SEND = "android.intent.action.SEND";
|
|
8
|
+
exports.ACTION_SENDTO = "android.intent.action.SENDTO";
|
|
9
|
+
exports.ACTION_DIAL = "android.intent.action.DIAL";
|
|
10
|
+
exports.ACTION_CALL = "android.intent.action.CALL";
|
|
11
|
+
exports.ACTION_CALL_BUTTON = "android.intent.action.CALL_BUTTON";
|
|
12
|
+
exports.ACTION_SMS = "android.intent.action.SMS";
|
|
13
|
+
exports.ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE";
|
|
14
|
+
exports.ACTION_PICK = "android.intent.action.PICK";
|
|
15
|
+
exports.ACTION_CHOOSER = "android.intent.action.CHOOSER";
|
|
16
|
+
exports.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
|
|
17
|
+
exports.ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
|
|
18
|
+
exports.ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE";
|
|
19
|
+
exports.ACTION_SYNC = "android.intent.action.SYNC";
|
|
20
|
+
exports.ACTION_MAIN = "android.intent.action.MAIN";
|
|
21
|
+
exports.ACTION_POWER_CONNECTED = "android.intent.action.ACTION_POWER_CONNECTED";
|
|
22
|
+
exports.ACTION_POWER_DISCONNECTED = "android.intent.action.ACTION_POWER_DISCONNECTED";
|
|
23
|
+
exports.ACTION_BATTERY_LOW = "android.intent.action.ACTION_BATTERY_LOW";
|
|
24
|
+
exports.ACTION_BATTERY_OKAY = "android.intent.action.ACTION_BATTERY_OKAY";
|
|
25
|
+
exports.ACTION_HEADSET_PLUG = "android.intent.action.ACTION_HEADSET_PLUG";
|
|
26
|
+
exports.ACTION_SCREEN_ON = "android.intent.action.ACTION_SCREEN_ON";
|
|
27
|
+
exports.ACTION_SCREEN_OFF = "android.intent.action.ACTION_SCREEN_OFF";
|
|
28
|
+
exports.ACTION_TIME_CHANGED = "android.intent.action.ACTION_TIME_CHANGED";
|
|
29
|
+
exports.ACTION_DATE_CHANGED = "android.intent.action.ACTION_DATE_CHANGED";
|
|
30
|
+
exports.ACTION_TIMEZONE_CHANGED = "android.intent.action.ACTION_TIMEZONE_CHANGED";
|
|
31
|
+
exports.ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.ACTION_AIRPLANE_MODE_CHANGED";
|
|
32
|
+
exports.ACTION_LOCALE_CHANGED = "android.intent.action.ACTION_LOCALE_CHANGED";
|
|
33
|
+
exports.ACTION_CONFIGURATION_CHANGED = "android.intent.action.ACTION_CONFIGURATION_CHANGED";
|
|
34
|
+
exports.ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.ACTION_MEDIA_SCANNER_SCAN_FILE";
|
|
35
|
+
exports.ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.ACTION_MEDIA_SCANNER_STARTED";
|
|
36
|
+
exports.ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.ACTION_MEDIA_SCANNER_FINISHED";
|
|
37
|
+
exports.ACTION_MEDIA_MOUNTED = "android.intent.action.ACTION_MEDIA_MOUNTED";
|
|
38
|
+
exports.ACTION_MEDIA_UNMOUNTED = "android.intent.action.ACTION_MEDIA_UNMOUNTED";
|
|
39
|
+
exports.ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.ACTION_MEDIA_BAD_REMOVAL";
|
|
40
|
+
exports.ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.ACTION_MEDIA_UNMOUNTABLE";
|
|
41
|
+
exports.ACTION_MEDIA_SHARED = "android.intent.action.ACTION_MEDIA_SHARED";
|
|
42
|
+
exports.ACTION_MEDIA_EJECT = "android.intent.action.ACTION_MEDIA_EJECT";
|
|
43
|
+
exports.ACTION_MEDIA_REORDER = "android.intent.action.ACTION_MEDIA_REORDER";
|
|
44
|
+
exports.ACTION_MEDIA_PLAY = "android.intent.action.ACTION_MEDIA_PLAY";
|
|
45
|
+
exports.ACTION_MEDIA_PAUSE = "android.intent.action.ACTION_MEDIA_PAUSE";
|
|
46
|
+
exports.ACTION_MEDIA_STOP = "android.intent.action.ACTION_MEDIA_STOP";
|
|
47
|
+
exports.ACTION_MEDIA_NEXT = "android.intent.action.ACTION_MEDIA_NEXT";
|
|
48
|
+
exports.ACTION_MEDIA_PREVIOUS = "android.intent.action.ACTION_MEDIA_PREVIOUS";
|
|
49
|
+
exports.ACTION_MEDIA_FAST_FORWARD = "android.intent.action.ACTION_MEDIA_FAST_FORWARD";
|
|
50
|
+
exports.ACTION_MEDIA_REWIND = "android.intent.action.ACTION_MEDIA_REWIND";
|
|
51
|
+
exports.ACTION_MEDIA_PLAY_PAUSE = "android.intent.action.ACTION_MEDIA_PLAY_PAUSE";
|
|
52
|
+
exports.ACTION_MEDIA_STOP_RECORDING = "android.intent.action.ACTION_MEDIA_STOP_RECORDING";
|
|
53
|
+
exports.ACTION_MEDIA_RECORD = "android.intent.action.ACTION_MEDIA_RECORD";
|
|
54
|
+
exports.ACTION_MEDIA_RECORD_PAUSE = "android.intent.action.ACTION_MEDIA_RECORD_PAUSE";
|
|
55
|
+
exports.ACTION_MEDIA_RECORD_STOP = "android.intent.action.ACTION_MEDIA_RECORD_STOP";
|
|
56
|
+
exports.ACTION_MEDIA_RECORD_RESUME = "android.intent.action.ACTION_MEDIA_RECORD_RESUME";
|
|
57
|
+
exports.ACTION_MEDIA_RECORD_START = "android.intent.action.ACTION_MEDIA_RECORD_START";
|
|
58
|
+
exports.ACTION_MEDIA_RECORD_END = "android.intent.action.ACTION_MEDIA_RECORD_END";
|
|
59
|
+
exports.ACTION_MEDIA_RECORD_RESTART = "android.intent.action.ACTION_MEDIA_RECORD_RESTART";
|
|
60
|
+
exports.ACTION_MEDIA_RECORD_RESET = "android.intent.action.ACTION_MEDIA_RECORD_RESET";
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERMISSION_ACCESS_MEDIA_LOCATION = exports.PERMISSION_ACCESS_BACKGROUND_LOCATION = exports.PERMISSION_READ_CONTACTS = exports.PERMISSION_RECORD_AUDIO = exports.PERMISSION_ACTIVITY_RECOGNITION = exports.PERMISSION_WRITE_EXTERNAL_STORAGE = exports.PERMISSION_GET_ACCOUNTS = exports.PERMISSION_READ_CELL_BROADCASTS = exports.PERMISSION_PROCESS_OUTGOING_CALLS = exports.PERMISSION_USE_SIP = exports.PERMISSION_WRITE_CALL_LOG = exports.PERMISSION_WRITE_CALENDAR = exports.PERMISSION_CAMERA = exports.PERMISSION_ACCEPT_HANDOVER = exports.PERMISSION_WRITE_CONTACTS = exports.PERMISSION_CALL_PHONE = exports.PERMISSION_SEND_SMS = exports.PERMISSION_READ_PHONE_STATE = exports.PERMISSION_ACCESS_COARSE_LOCATION = exports.PERMISSION_READ_EXTERNAL_STORAGE = exports.PERMISSION_RECEIVE_SMS = exports.PERMISSION_RECEIVE_MMS = exports.PERMISSION_READ_PHONE_NUMBERS = exports.PERMISSION_BODY_SENSORS = exports.PERMISSION_RECEIVE_WAP_PUSH = exports.PERMISSION_ANSWER_PHONE_CALLS = exports.PERMISSION_ACCESS_FINE_LOCATION = exports.PERMISSION_READ_CALL_LOG = exports.PERMISSION_READ_CALENDAR = exports.PERMISSION_READ_SMS = void 0;
|
|
4
|
+
exports.PERMISSION_READ_SMS = "android.permission.READ_SMS";
|
|
5
|
+
exports.PERMISSION_READ_CALENDAR = "android.permission.READ_CALENDAR";
|
|
6
|
+
exports.PERMISSION_READ_CALL_LOG = "android.permission.READ_CALL_LOG";
|
|
7
|
+
exports.PERMISSION_ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
|
|
8
|
+
exports.PERMISSION_ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
|
|
9
|
+
exports.PERMISSION_RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
|
|
10
|
+
exports.PERMISSION_BODY_SENSORS = "android.permission.BODY_SENSORS";
|
|
11
|
+
exports.PERMISSION_READ_PHONE_NUMBERS = "android.permission.READ_PHONE_NUMBERS";
|
|
12
|
+
exports.PERMISSION_RECEIVE_MMS = "android.permission.RECEIVE_MMS";
|
|
13
|
+
exports.PERMISSION_RECEIVE_SMS = "android.permission.RECEIVE_SMS";
|
|
14
|
+
exports.PERMISSION_READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
|
|
15
|
+
exports.PERMISSION_ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
|
|
16
|
+
exports.PERMISSION_READ_PHONE_STATE = "android.permission.READ_PHONE_STATE";
|
|
17
|
+
exports.PERMISSION_SEND_SMS = "android.permission.SEND_SMS";
|
|
18
|
+
exports.PERMISSION_CALL_PHONE = "android.permission.CALL_PHONE";
|
|
19
|
+
exports.PERMISSION_WRITE_CONTACTS = "android.permission.WRITE_CONTACTS";
|
|
20
|
+
exports.PERMISSION_ACCEPT_HANDOVER = "android.permission.ACCEPT_HANDOVER";
|
|
21
|
+
exports.PERMISSION_CAMERA = "android.permission.CAMERA";
|
|
22
|
+
exports.PERMISSION_WRITE_CALENDAR = "android.permission.WRITE_CALENDAR";
|
|
23
|
+
exports.PERMISSION_WRITE_CALL_LOG = "android.permission.WRITE_CALL_LOG";
|
|
24
|
+
exports.PERMISSION_USE_SIP = "android.permission.USE_SIP";
|
|
25
|
+
exports.PERMISSION_PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
|
|
26
|
+
exports.PERMISSION_READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
|
|
27
|
+
exports.PERMISSION_GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
|
|
28
|
+
exports.PERMISSION_WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
|
|
29
|
+
exports.PERMISSION_ACTIVITY_RECOGNITION = "android.permission.ACTIVITY_RECOGNITION";
|
|
30
|
+
exports.PERMISSION_RECORD_AUDIO = "android.permission.RECORD_AUDIO";
|
|
31
|
+
exports.PERMISSION_READ_CONTACTS = "android.permission.READ_CONTACTS";
|
|
32
|
+
exports.PERMISSION_ACCESS_BACKGROUND_LOCATION = "android.permission.ACCESS_BACKGROUND_LOCATION";
|
|
33
|
+
exports.PERMISSION_ACCESS_MEDIA_LOCATION = "android.permission.ACCESS_MEDIA_LOCATION";
|
package/dist/constants/index.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./activity.flag"), exports);
|
|
18
|
+
__exportStar(require("./android.permission"), exports);
|
|
19
|
+
__exportStar(require("./android.intent"), exports);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteCallException = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
class RemoteCallException extends Error {
|
|
3
6
|
call;
|
|
4
7
|
name;
|
|
5
8
|
args;
|
|
6
9
|
constructor(call, name, args) {
|
|
7
|
-
super(format("%s %s::%s", name, call.method.path, args));
|
|
10
|
+
super((0, util_1.format)("%s %s::%s", name, call.method.path, args));
|
|
8
11
|
this.call = call;
|
|
9
12
|
this.name = name;
|
|
10
13
|
this.args = args;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
16
|
+
exports.RemoteCallException = RemoteCallException;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteRPCException = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
class RemoteRPCException extends Error {
|
|
3
6
|
call;
|
|
4
7
|
error;
|
|
5
8
|
constructor(call, error) {
|
|
6
|
-
super(format("%s %s::%s", RemoteRPCException.name, call.method.path, error.details));
|
|
9
|
+
super((0, util_1.format)("%s %s::%s", RemoteRPCException.name, call.method.path, error.details));
|
|
7
10
|
this.call = call;
|
|
8
11
|
this.error = error;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
exports.RemoteRPCException = RemoteRPCException;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeoutException = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
class TimeoutException extends Error {
|
|
3
6
|
constructor(args) {
|
|
4
|
-
super(format("%s %sms selector [%s]", TimeoutException.name, args.timeout, args.selector));
|
|
7
|
+
super((0, util_1.format)("%s %sms selector [%s]", TimeoutException.name, args.timeout, args.selector));
|
|
5
8
|
}
|
|
6
9
|
}
|
|
10
|
+
exports.TimeoutException = TimeoutException;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteExceptionInterceptor = RemoteExceptionInterceptor;
|
|
4
|
+
const remoteRpc_exception_1 = require("../exceptions/remoteRpc.exception");
|
|
5
|
+
const remoteCall_exception_1 = require("../exceptions/remoteCall.exception");
|
|
6
|
+
function RemoteExceptionInterceptor() {
|
|
4
7
|
return async function* (call, options) {
|
|
5
8
|
try {
|
|
6
9
|
return yield* call.next(call.request, options);
|
|
@@ -9,10 +12,10 @@ export function RemoteExceptionInterceptor() {
|
|
|
9
12
|
try {
|
|
10
13
|
const { exception } = JSON.parse(error.details);
|
|
11
14
|
const { name, args } = JSON.parse(exception);
|
|
12
|
-
throw new RemoteCallException(call, name, args);
|
|
15
|
+
throw new remoteCall_exception_1.RemoteCallException(call, name, args);
|
|
13
16
|
}
|
|
14
17
|
catch (_) {
|
|
15
|
-
throw new RemoteRPCException(call, error);
|
|
18
|
+
throw new remoteRpc_exception_1.RemoteRPCException(call, error);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
};
|
package/dist/main.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,22 +8,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Device = void 0;
|
|
13
|
+
const nice_grpc_1 = require("nice-grpc");
|
|
14
|
+
const inject_decorator_1 = require("./decorators/inject.decorator");
|
|
15
|
+
const android_intent_1 = require("./constants/android.intent");
|
|
16
|
+
const activity_flag_1 = require("./constants/activity.flag");
|
|
17
|
+
const remoteException_Interceptor_1 = require("./interceptor/remoteException.Interceptor");
|
|
18
|
+
const timeout_exception_1 = require("./exceptions/timeout.exception");
|
|
19
|
+
const services_1 = require("./rpc/services");
|
|
20
|
+
class Device {
|
|
18
21
|
channel;
|
|
19
22
|
client;
|
|
20
23
|
constructor(host = "127.0.0.1", prot = 65000) {
|
|
21
24
|
const address = Array(host, prot).join(":");
|
|
22
|
-
const credentials = ChannelCredentials.createInsecure();
|
|
23
|
-
this.client = createClientFactory()
|
|
24
|
-
.use(RemoteExceptionInterceptor());
|
|
25
|
-
this.channel = createChannel(address, credentials, {
|
|
25
|
+
const credentials = nice_grpc_1.ChannelCredentials.createInsecure();
|
|
26
|
+
this.client = (0, nice_grpc_1.createClientFactory)()
|
|
27
|
+
.use((0, remoteException_Interceptor_1.RemoteExceptionInterceptor)());
|
|
28
|
+
this.channel = (0, nice_grpc_1.createChannel)(address, credentials, {
|
|
26
29
|
["grpc.max_send_message_length"]: 64 * 1024 * 1024,
|
|
27
30
|
["grpc.max_receive_message_length"]: 128 * 1024 * 1024,
|
|
28
31
|
["grpc.keepalive_time_ms"]: 60 * 1000,
|
|
@@ -54,7 +57,7 @@ export class Device {
|
|
|
54
57
|
.selectorWaitForExists(...args)
|
|
55
58
|
.then(async (exists) => {
|
|
56
59
|
if (!exists.value) {
|
|
57
|
-
throw new TimeoutException(args[0]);
|
|
60
|
+
throw new timeout_exception_1.TimeoutException(args[0]);
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
63
|
}
|
|
@@ -72,8 +75,8 @@ export class Device {
|
|
|
72
75
|
return this.Application
|
|
73
76
|
.startActivity({
|
|
74
77
|
data,
|
|
75
|
-
action: ACTION_VIEW,
|
|
76
|
-
flags: (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_CLEAR_TASK)
|
|
78
|
+
action: android_intent_1.ACTION_VIEW,
|
|
79
|
+
flags: (activity_flag_1.FLAG_ACTIVITY_NEW_TASK | activity_flag_1.FLAG_ACTIVITY_CLEAR_TOP | activity_flag_1.FLAG_ACTIVITY_CLEAR_TASK)
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
82
|
async kill(...args) {
|
|
@@ -89,55 +92,56 @@ export class Device {
|
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
}
|
|
95
|
+
exports.Device = Device;
|
|
92
96
|
__decorate([
|
|
93
|
-
Inject(UtilDefinition),
|
|
97
|
+
(0, inject_decorator_1.Inject)(services_1.UtilDefinition),
|
|
94
98
|
__metadata("design:type", Object)
|
|
95
99
|
], Device.prototype, "Util", void 0);
|
|
96
100
|
__decorate([
|
|
97
|
-
Inject(UiAutomatorDefinition),
|
|
101
|
+
(0, inject_decorator_1.Inject)(services_1.UiAutomatorDefinition),
|
|
98
102
|
__metadata("design:type", Object)
|
|
99
103
|
], Device.prototype, "UiAutomator", void 0);
|
|
100
104
|
__decorate([
|
|
101
|
-
Inject(ApplicationDefinition),
|
|
105
|
+
(0, inject_decorator_1.Inject)(services_1.ApplicationDefinition),
|
|
102
106
|
__metadata("design:type", Object)
|
|
103
107
|
], Device.prototype, "Application", void 0);
|
|
104
108
|
__decorate([
|
|
105
|
-
Inject(DebugDefinition),
|
|
109
|
+
(0, inject_decorator_1.Inject)(services_1.DebugDefinition),
|
|
106
110
|
__metadata("design:type", Object)
|
|
107
111
|
], Device.prototype, "Debug", void 0);
|
|
108
112
|
__decorate([
|
|
109
|
-
Inject(FileDefinition),
|
|
113
|
+
(0, inject_decorator_1.Inject)(services_1.FileDefinition),
|
|
110
114
|
__metadata("design:type", Object)
|
|
111
115
|
], Device.prototype, "File", void 0);
|
|
112
116
|
__decorate([
|
|
113
|
-
Inject(LockDefinition),
|
|
117
|
+
(0, inject_decorator_1.Inject)(services_1.LockDefinition),
|
|
114
118
|
__metadata("design:type", Object)
|
|
115
119
|
], Device.prototype, "Lock", void 0);
|
|
116
120
|
__decorate([
|
|
117
|
-
Inject(ProxyDefinition),
|
|
121
|
+
(0, inject_decorator_1.Inject)(services_1.ProxyDefinition),
|
|
118
122
|
__metadata("design:type", Object)
|
|
119
123
|
], Device.prototype, "Proxy", void 0);
|
|
120
124
|
__decorate([
|
|
121
|
-
Inject(SelinuxPolicyDefinition),
|
|
125
|
+
(0, inject_decorator_1.Inject)(services_1.SelinuxPolicyDefinition),
|
|
122
126
|
__metadata("design:type", Object)
|
|
123
127
|
], Device.prototype, "Selinux", void 0);
|
|
124
128
|
__decorate([
|
|
125
|
-
Inject(ShellDefinition),
|
|
129
|
+
(0, inject_decorator_1.Inject)(services_1.ShellDefinition),
|
|
126
130
|
__metadata("design:type", Object)
|
|
127
131
|
], Device.prototype, "Shell", void 0);
|
|
128
132
|
__decorate([
|
|
129
|
-
Inject(StatusDefinition),
|
|
133
|
+
(0, inject_decorator_1.Inject)(services_1.StatusDefinition),
|
|
130
134
|
__metadata("design:type", Object)
|
|
131
135
|
], Device.prototype, "Status", void 0);
|
|
132
136
|
__decorate([
|
|
133
|
-
Inject(StorageDefinition),
|
|
137
|
+
(0, inject_decorator_1.Inject)(services_1.StorageDefinition),
|
|
134
138
|
__metadata("design:type", Object)
|
|
135
139
|
], Device.prototype, "Storage", void 0);
|
|
136
140
|
__decorate([
|
|
137
|
-
Inject(WifiDefinition),
|
|
141
|
+
(0, inject_decorator_1.Inject)(services_1.WifiDefinition),
|
|
138
142
|
__metadata("design:type", Object)
|
|
139
143
|
], Device.prototype, "Wifi", void 0);
|
|
140
144
|
__decorate([
|
|
141
|
-
Inject(SettingsDefinition),
|
|
145
|
+
(0, inject_decorator_1.Inject)(services_1.SettingsDefinition),
|
|
142
146
|
__metadata("design:type", Object)
|
|
143
147
|
], Device.prototype, "Settings", void 0);
|