@ekhein/lamda-node-sdk 1.0.2 → 2.0.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/dist/src/constants/activity.flag.d.ts +22 -0
- package/dist/src/constants/activity.flag.js +22 -0
- package/dist/src/constants/android.intent.d.ts +56 -0
- package/dist/src/constants/android.intent.js +56 -0
- package/dist/src/constants/android.permission.d.ts +30 -0
- package/dist/src/constants/android.permission.js +30 -0
- package/dist/src/constants/index.d.ts +3 -0
- package/dist/src/constants/index.js +3 -0
- package/dist/src/decorators/inject.decorator.d.ts +2 -0
- package/dist/src/decorators/inject.decorator.js +15 -0
- package/dist/src/exceptions/remoteCall.exception.d.ts +7 -0
- package/dist/src/exceptions/remoteCall.exception.js +12 -0
- package/dist/src/exceptions/timeout.exception.d.ts +4 -0
- package/dist/src/exceptions/timeout.exception.js +6 -0
- package/dist/src/interceptor/remoteException.Interceptor.d.ts +2 -0
- package/dist/src/interceptor/remoteException.Interceptor.js +13 -0
- package/dist/{main.d.ts → src/main.d.ts} +9 -21
- package/dist/src/main.js +135 -0
- package/dist/src/rpc/application.d.ts +136 -0
- package/dist/src/rpc/application.js +1537 -0
- package/dist/src/rpc/debug.d.ts +19 -0
- package/dist/src/rpc/debug.js +56 -0
- package/dist/{rpc → src/rpc}/file.d.ts +11 -13
- package/dist/src/rpc/file.js +373 -0
- package/dist/src/rpc/google/protobuf/any.d.ts +20 -0
- package/dist/src/rpc/google/protobuf/any.js +98 -0
- package/dist/src/rpc/google/protobuf/empty.d.ts +18 -0
- package/dist/src/rpc/google/protobuf/empty.js +39 -0
- package/dist/{rpc → src/rpc}/google/protobuf/struct.d.ts +19 -21
- package/dist/src/rpc/google/protobuf/struct.js +438 -0
- package/dist/src/rpc/policy.d.ts +22 -0
- package/dist/src/rpc/policy.js +103 -0
- package/dist/src/rpc/proxy.d.ts +106 -0
- package/dist/src/rpc/proxy.js +774 -0
- package/dist/{rpc → src/rpc}/services.d.ts +421 -424
- package/dist/src/rpc/services.js +1493 -0
- package/dist/src/rpc/settings.d.ts +29 -0
- package/dist/src/rpc/settings.js +125 -0
- package/dist/src/rpc/shell.d.ts +34 -0
- package/dist/src/rpc/shell.js +294 -0
- package/dist/{rpc → src/rpc}/status.d.ts +17 -19
- package/dist/src/rpc/status.js +896 -0
- package/dist/src/rpc/storage.d.ts +22 -0
- package/dist/src/rpc/storage.js +128 -0
- package/dist/src/rpc/types.d.ts +34 -0
- package/dist/src/rpc/types.js +281 -0
- package/dist/{rpc → src/rpc}/uiautomator.d.ts +87 -89
- package/dist/src/rpc/uiautomator.js +5350 -0
- package/dist/src/rpc/util.d.ts +101 -0
- package/dist/src/rpc/util.js +1158 -0
- package/dist/{rpc → src/rpc}/wifi.d.ts +23 -25
- package/dist/src/rpc/wifi.js +971 -0
- package/package.json +4 -9
- package/dist/chunk-3HDKHFYE.js +0 -1602
- package/dist/chunk-3JBDAA2H.js +0 -439
- package/dist/chunk-4AHM55IO.js +0 -1172
- package/dist/chunk-6HD35RPW.js +0 -5370
- package/dist/chunk-7XF22HAW.js +0 -907
- package/dist/chunk-7YGA6EOV.js +0 -109
- package/dist/chunk-ADS4GRIL.js +0 -14
- package/dist/chunk-FSLE4VGI.js +0 -48
- package/dist/chunk-H7Z6XFBF.js +0 -134
- package/dist/chunk-KJKSI2WL.js +0 -62
- package/dist/chunk-O52JGDU7.js +0 -800
- package/dist/chunk-ORXTTWPB.js +0 -379
- package/dist/chunk-OZJH6SR7.js +0 -20
- package/dist/chunk-P53F45YO.js +0 -64
- package/dist/chunk-QXMPY6EE.js +0 -289
- package/dist/chunk-SBFKX3ZY.js +0 -1554
- package/dist/chunk-WFQEBPE6.js +0 -300
- package/dist/chunk-X4LTH2UN.js +0 -983
- package/dist/chunk-XAX5BZL3.js +0 -132
- package/dist/chunk-ZXF5DGTC.js +0 -45
- package/dist/constants/activity.flag.cjs +0 -92
- package/dist/constants/activity.flag.d.cts +0 -24
- package/dist/constants/activity.flag.d.ts +0 -24
- package/dist/constants/activity.flag.js +0 -49
- package/dist/constants/android.permission.cjs +0 -116
- package/dist/constants/android.permission.d.cts +0 -32
- package/dist/constants/android.permission.d.ts +0 -32
- package/dist/constants/android.permission.js +0 -65
- package/dist/constants/index.cjs +0 -186
- package/dist/constants/index.d.cts +0 -2
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/index.js +0 -111
- package/dist/decorators/inject.decorator.cjs +0 -43
- package/dist/decorators/inject.decorator.d.cts +0 -5
- package/dist/decorators/inject.decorator.d.ts +0 -5
- package/dist/decorators/inject.decorator.js +0 -7
- package/dist/main.cjs +0 -11969
- package/dist/main.d.cts +0 -37
- package/dist/main.js +0 -112
- package/dist/rpc/application.cjs +0 -2019
- package/dist/rpc/application.d.cts +0 -138
- package/dist/rpc/application.d.ts +0 -138
- package/dist/rpc/application.js +0 -50
- package/dist/rpc/debug.cjs +0 -86
- package/dist/rpc/debug.d.cts +0 -21
- package/dist/rpc/debug.d.ts +0 -21
- package/dist/rpc/debug.js +0 -9
- package/dist/rpc/file.cjs +0 -405
- package/dist/rpc/file.d.cts +0 -40
- package/dist/rpc/file.js +0 -13
- package/dist/rpc/google/protobuf/any.cjs +0 -126
- package/dist/rpc/google/protobuf/any.d.cts +0 -22
- package/dist/rpc/google/protobuf/any.d.ts +0 -22
- package/dist/rpc/google/protobuf/any.js +0 -103
- package/dist/rpc/google/protobuf/empty.cjs +0 -69
- package/dist/rpc/google/protobuf/empty.d.cts +0 -20
- package/dist/rpc/google/protobuf/empty.d.ts +0 -20
- package/dist/rpc/google/protobuf/empty.js +0 -9
- package/dist/rpc/google/protobuf/struct.cjs +0 -469
- package/dist/rpc/google/protobuf/struct.d.cts +0 -65
- package/dist/rpc/google/protobuf/struct.js +0 -21
- package/dist/rpc/policy.cjs +0 -133
- package/dist/rpc/policy.d.cts +0 -24
- package/dist/rpc/policy.d.ts +0 -24
- package/dist/rpc/policy.js +0 -9
- package/dist/rpc/proxy.cjs +0 -1109
- package/dist/rpc/proxy.d.cts +0 -108
- package/dist/rpc/proxy.d.ts +0 -108
- package/dist/rpc/proxy.js +0 -49
- package/dist/rpc/services.cjs +0 -11898
- package/dist/rpc/services.d.cts +0 -1920
- package/dist/rpc/services.js +0 -48
- package/dist/rpc/settings.cjs +0 -161
- package/dist/rpc/settings.d.cts +0 -31
- package/dist/rpc/settings.d.ts +0 -31
- package/dist/rpc/settings.js +0 -15
- package/dist/rpc/shell.cjs +0 -326
- package/dist/rpc/shell.d.cts +0 -36
- package/dist/rpc/shell.d.ts +0 -36
- package/dist/rpc/shell.js +0 -13
- package/dist/rpc/status.cjs +0 -936
- package/dist/rpc/status.d.cts +0 -76
- package/dist/rpc/status.js +0 -19
- package/dist/rpc/storage.cjs +0 -156
- package/dist/rpc/storage.d.cts +0 -24
- package/dist/rpc/storage.d.ts +0 -24
- package/dist/rpc/storage.js +0 -9
- package/dist/rpc/types.cjs +0 -317
- package/dist/rpc/types.d.cts +0 -36
- package/dist/rpc/types.d.ts +0 -36
- package/dist/rpc/types.js +0 -17
- package/dist/rpc/uiautomator.cjs +0 -5446
- package/dist/rpc/uiautomator.d.cts +0 -618
- package/dist/rpc/uiautomator.js +0 -113
- package/dist/rpc/util.cjs +0 -1212
- package/dist/rpc/util.d.cts +0 -103
- package/dist/rpc/util.d.ts +0 -103
- package/dist/rpc/util.js +0 -41
- package/dist/rpc/wifi.cjs +0 -1015
- package/dist/rpc/wifi.d.cts +0 -84
- package/dist/rpc/wifi.js +0 -25
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "lamda.rpc";
|
|
3
|
+
export declare enum Group {
|
|
4
|
+
GROUP_SYSTEM = 0,
|
|
5
|
+
GROUP_SECURE = 1,
|
|
6
|
+
GROUP_GLOBAL = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare function groupFromJSON(object: any): Group;
|
|
10
|
+
export declare function groupToJSON(object: Group): string;
|
|
11
|
+
export interface SettingsRequest {
|
|
12
|
+
group: Group;
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const SettingsRequest: MessageFns<SettingsRequest>;
|
|
17
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
18
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
19
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
20
|
+
} : Partial<T>;
|
|
21
|
+
export interface MessageFns<T> {
|
|
22
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
23
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
24
|
+
fromJSON(object: any): T;
|
|
25
|
+
toJSON(message: T): unknown;
|
|
26
|
+
create(base?: DeepPartial<T>): T;
|
|
27
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export const protobufPackage = "lamda.rpc";
|
|
3
|
+
export var Group;
|
|
4
|
+
(function (Group) {
|
|
5
|
+
Group[Group["GROUP_SYSTEM"] = 0] = "GROUP_SYSTEM";
|
|
6
|
+
Group[Group["GROUP_SECURE"] = 1] = "GROUP_SECURE";
|
|
7
|
+
Group[Group["GROUP_GLOBAL"] = 2] = "GROUP_GLOBAL";
|
|
8
|
+
Group[Group["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
9
|
+
})(Group || (Group = {}));
|
|
10
|
+
export function groupFromJSON(object) {
|
|
11
|
+
switch (object) {
|
|
12
|
+
case 0:
|
|
13
|
+
case "GROUP_SYSTEM":
|
|
14
|
+
return Group.GROUP_SYSTEM;
|
|
15
|
+
case 1:
|
|
16
|
+
case "GROUP_SECURE":
|
|
17
|
+
return Group.GROUP_SECURE;
|
|
18
|
+
case 2:
|
|
19
|
+
case "GROUP_GLOBAL":
|
|
20
|
+
return Group.GROUP_GLOBAL;
|
|
21
|
+
case -1:
|
|
22
|
+
case "UNRECOGNIZED":
|
|
23
|
+
default:
|
|
24
|
+
return Group.UNRECOGNIZED;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function groupToJSON(object) {
|
|
28
|
+
switch (object) {
|
|
29
|
+
case Group.GROUP_SYSTEM:
|
|
30
|
+
return "GROUP_SYSTEM";
|
|
31
|
+
case Group.GROUP_SECURE:
|
|
32
|
+
return "GROUP_SECURE";
|
|
33
|
+
case Group.GROUP_GLOBAL:
|
|
34
|
+
return "GROUP_GLOBAL";
|
|
35
|
+
case Group.UNRECOGNIZED:
|
|
36
|
+
default:
|
|
37
|
+
return "UNRECOGNIZED";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function createBaseSettingsRequest() {
|
|
41
|
+
return { group: 0, name: "", value: "" };
|
|
42
|
+
}
|
|
43
|
+
export const SettingsRequest = {
|
|
44
|
+
encode(message, writer = new BinaryWriter()) {
|
|
45
|
+
if (message.group !== 0) {
|
|
46
|
+
writer.uint32(8).int32(message.group);
|
|
47
|
+
}
|
|
48
|
+
if (message.name !== "") {
|
|
49
|
+
writer.uint32(18).string(message.name);
|
|
50
|
+
}
|
|
51
|
+
if (message.value !== "") {
|
|
52
|
+
writer.uint32(26).string(message.value);
|
|
53
|
+
}
|
|
54
|
+
return writer;
|
|
55
|
+
},
|
|
56
|
+
decode(input, length) {
|
|
57
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
58
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
59
|
+
const message = createBaseSettingsRequest();
|
|
60
|
+
while (reader.pos < end) {
|
|
61
|
+
const tag = reader.uint32();
|
|
62
|
+
switch (tag >>> 3) {
|
|
63
|
+
case 1: {
|
|
64
|
+
if (tag !== 8) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
message.group = reader.int32();
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
case 2: {
|
|
71
|
+
if (tag !== 18) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
message.name = reader.string();
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
case 3: {
|
|
78
|
+
if (tag !== 26) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
message.value = reader.string();
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
reader.skip(tag & 7);
|
|
89
|
+
}
|
|
90
|
+
return message;
|
|
91
|
+
},
|
|
92
|
+
fromJSON(object) {
|
|
93
|
+
return {
|
|
94
|
+
group: isSet(object.group) ? groupFromJSON(object.group) : 0,
|
|
95
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
96
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
toJSON(message) {
|
|
100
|
+
const obj = {};
|
|
101
|
+
if (message.group !== 0) {
|
|
102
|
+
obj.group = groupToJSON(message.group);
|
|
103
|
+
}
|
|
104
|
+
if (message.name !== "") {
|
|
105
|
+
obj.name = message.name;
|
|
106
|
+
}
|
|
107
|
+
if (message.value !== "") {
|
|
108
|
+
obj.value = message.value;
|
|
109
|
+
}
|
|
110
|
+
return obj;
|
|
111
|
+
},
|
|
112
|
+
create(base) {
|
|
113
|
+
return SettingsRequest.fromPartial(base ?? {});
|
|
114
|
+
},
|
|
115
|
+
fromPartial(object) {
|
|
116
|
+
const message = createBaseSettingsRequest();
|
|
117
|
+
message.group = object.group ?? 0;
|
|
118
|
+
message.name = object.name ?? "";
|
|
119
|
+
message.value = object.value ?? "";
|
|
120
|
+
return message;
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
function isSet(value) {
|
|
124
|
+
return value !== null && value !== undefined;
|
|
125
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "lamda.rpc";
|
|
3
|
+
export interface ShellRequest {
|
|
4
|
+
tid: string;
|
|
5
|
+
name: string;
|
|
6
|
+
script: string;
|
|
7
|
+
timeout: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ShellResult {
|
|
10
|
+
exitstatus: number;
|
|
11
|
+
stdout: Uint8Array;
|
|
12
|
+
stderr: Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export interface ShellTask {
|
|
15
|
+
tid: string;
|
|
16
|
+
name: string;
|
|
17
|
+
pid: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const ShellRequest: MessageFns<ShellRequest>;
|
|
20
|
+
export declare const ShellResult: MessageFns<ShellResult>;
|
|
21
|
+
export declare const ShellTask: MessageFns<ShellTask>;
|
|
22
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
23
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
24
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
25
|
+
} : Partial<T>;
|
|
26
|
+
export interface MessageFns<T> {
|
|
27
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
28
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
29
|
+
fromJSON(object: any): T;
|
|
30
|
+
toJSON(message: T): unknown;
|
|
31
|
+
create(base?: DeepPartial<T>): T;
|
|
32
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export const protobufPackage = "lamda.rpc";
|
|
3
|
+
function createBaseShellRequest() {
|
|
4
|
+
return { tid: "", name: "", script: "", timeout: 0 };
|
|
5
|
+
}
|
|
6
|
+
export const ShellRequest = {
|
|
7
|
+
encode(message, writer = new BinaryWriter()) {
|
|
8
|
+
if (message.tid !== "") {
|
|
9
|
+
writer.uint32(10).string(message.tid);
|
|
10
|
+
}
|
|
11
|
+
if (message.name !== "") {
|
|
12
|
+
writer.uint32(18).string(message.name);
|
|
13
|
+
}
|
|
14
|
+
if (message.script !== "") {
|
|
15
|
+
writer.uint32(26).string(message.script);
|
|
16
|
+
}
|
|
17
|
+
if (message.timeout !== 0) {
|
|
18
|
+
writer.uint32(32).int32(message.timeout);
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
},
|
|
22
|
+
decode(input, length) {
|
|
23
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
24
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
25
|
+
const message = createBaseShellRequest();
|
|
26
|
+
while (reader.pos < end) {
|
|
27
|
+
const tag = reader.uint32();
|
|
28
|
+
switch (tag >>> 3) {
|
|
29
|
+
case 1: {
|
|
30
|
+
if (tag !== 10) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
message.tid = reader.string();
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
case 2: {
|
|
37
|
+
if (tag !== 18) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
message.name = reader.string();
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
case 3: {
|
|
44
|
+
if (tag !== 26) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
message.script = reader.string();
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
case 4: {
|
|
51
|
+
if (tag !== 32) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
message.timeout = reader.int32();
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
reader.skip(tag & 7);
|
|
62
|
+
}
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
fromJSON(object) {
|
|
66
|
+
return {
|
|
67
|
+
tid: isSet(object.tid) ? globalThis.String(object.tid) : "",
|
|
68
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
69
|
+
script: isSet(object.script) ? globalThis.String(object.script) : "",
|
|
70
|
+
timeout: isSet(object.timeout) ? globalThis.Number(object.timeout) : 0,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
toJSON(message) {
|
|
74
|
+
const obj = {};
|
|
75
|
+
if (message.tid !== "") {
|
|
76
|
+
obj.tid = message.tid;
|
|
77
|
+
}
|
|
78
|
+
if (message.name !== "") {
|
|
79
|
+
obj.name = message.name;
|
|
80
|
+
}
|
|
81
|
+
if (message.script !== "") {
|
|
82
|
+
obj.script = message.script;
|
|
83
|
+
}
|
|
84
|
+
if (message.timeout !== 0) {
|
|
85
|
+
obj.timeout = Math.round(message.timeout);
|
|
86
|
+
}
|
|
87
|
+
return obj;
|
|
88
|
+
},
|
|
89
|
+
create(base) {
|
|
90
|
+
return ShellRequest.fromPartial(base ?? {});
|
|
91
|
+
},
|
|
92
|
+
fromPartial(object) {
|
|
93
|
+
const message = createBaseShellRequest();
|
|
94
|
+
message.tid = object.tid ?? "";
|
|
95
|
+
message.name = object.name ?? "";
|
|
96
|
+
message.script = object.script ?? "";
|
|
97
|
+
message.timeout = object.timeout ?? 0;
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
function createBaseShellResult() {
|
|
102
|
+
return { exitstatus: 0, stdout: new Uint8Array(0), stderr: new Uint8Array(0) };
|
|
103
|
+
}
|
|
104
|
+
export const ShellResult = {
|
|
105
|
+
encode(message, writer = new BinaryWriter()) {
|
|
106
|
+
if (message.exitstatus !== 0) {
|
|
107
|
+
writer.uint32(8).int32(message.exitstatus);
|
|
108
|
+
}
|
|
109
|
+
if (message.stdout.length !== 0) {
|
|
110
|
+
writer.uint32(18).bytes(message.stdout);
|
|
111
|
+
}
|
|
112
|
+
if (message.stderr.length !== 0) {
|
|
113
|
+
writer.uint32(26).bytes(message.stderr);
|
|
114
|
+
}
|
|
115
|
+
return writer;
|
|
116
|
+
},
|
|
117
|
+
decode(input, length) {
|
|
118
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
119
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
120
|
+
const message = createBaseShellResult();
|
|
121
|
+
while (reader.pos < end) {
|
|
122
|
+
const tag = reader.uint32();
|
|
123
|
+
switch (tag >>> 3) {
|
|
124
|
+
case 1: {
|
|
125
|
+
if (tag !== 8) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
message.exitstatus = reader.int32();
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
case 2: {
|
|
132
|
+
if (tag !== 18) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
message.stdout = reader.bytes();
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
case 3: {
|
|
139
|
+
if (tag !== 26) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
message.stderr = reader.bytes();
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
reader.skip(tag & 7);
|
|
150
|
+
}
|
|
151
|
+
return message;
|
|
152
|
+
},
|
|
153
|
+
fromJSON(object) {
|
|
154
|
+
return {
|
|
155
|
+
exitstatus: isSet(object.exitstatus) ? globalThis.Number(object.exitstatus) : 0,
|
|
156
|
+
stdout: isSet(object.stdout) ? bytesFromBase64(object.stdout) : new Uint8Array(0),
|
|
157
|
+
stderr: isSet(object.stderr) ? bytesFromBase64(object.stderr) : new Uint8Array(0),
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
toJSON(message) {
|
|
161
|
+
const obj = {};
|
|
162
|
+
if (message.exitstatus !== 0) {
|
|
163
|
+
obj.exitstatus = Math.round(message.exitstatus);
|
|
164
|
+
}
|
|
165
|
+
if (message.stdout.length !== 0) {
|
|
166
|
+
obj.stdout = base64FromBytes(message.stdout);
|
|
167
|
+
}
|
|
168
|
+
if (message.stderr.length !== 0) {
|
|
169
|
+
obj.stderr = base64FromBytes(message.stderr);
|
|
170
|
+
}
|
|
171
|
+
return obj;
|
|
172
|
+
},
|
|
173
|
+
create(base) {
|
|
174
|
+
return ShellResult.fromPartial(base ?? {});
|
|
175
|
+
},
|
|
176
|
+
fromPartial(object) {
|
|
177
|
+
const message = createBaseShellResult();
|
|
178
|
+
message.exitstatus = object.exitstatus ?? 0;
|
|
179
|
+
message.stdout = object.stdout ?? new Uint8Array(0);
|
|
180
|
+
message.stderr = object.stderr ?? new Uint8Array(0);
|
|
181
|
+
return message;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
function createBaseShellTask() {
|
|
185
|
+
return { tid: "", name: "", pid: 0 };
|
|
186
|
+
}
|
|
187
|
+
export const ShellTask = {
|
|
188
|
+
encode(message, writer = new BinaryWriter()) {
|
|
189
|
+
if (message.tid !== "") {
|
|
190
|
+
writer.uint32(10).string(message.tid);
|
|
191
|
+
}
|
|
192
|
+
if (message.name !== "") {
|
|
193
|
+
writer.uint32(18).string(message.name);
|
|
194
|
+
}
|
|
195
|
+
if (message.pid !== 0) {
|
|
196
|
+
writer.uint32(24).int32(message.pid);
|
|
197
|
+
}
|
|
198
|
+
return writer;
|
|
199
|
+
},
|
|
200
|
+
decode(input, length) {
|
|
201
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
202
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
203
|
+
const message = createBaseShellTask();
|
|
204
|
+
while (reader.pos < end) {
|
|
205
|
+
const tag = reader.uint32();
|
|
206
|
+
switch (tag >>> 3) {
|
|
207
|
+
case 1: {
|
|
208
|
+
if (tag !== 10) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
message.tid = reader.string();
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
case 2: {
|
|
215
|
+
if (tag !== 18) {
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
message.name = reader.string();
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
case 3: {
|
|
222
|
+
if (tag !== 24) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
message.pid = reader.int32();
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
reader.skip(tag & 7);
|
|
233
|
+
}
|
|
234
|
+
return message;
|
|
235
|
+
},
|
|
236
|
+
fromJSON(object) {
|
|
237
|
+
return {
|
|
238
|
+
tid: isSet(object.tid) ? globalThis.String(object.tid) : "",
|
|
239
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
240
|
+
pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0,
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
toJSON(message) {
|
|
244
|
+
const obj = {};
|
|
245
|
+
if (message.tid !== "") {
|
|
246
|
+
obj.tid = message.tid;
|
|
247
|
+
}
|
|
248
|
+
if (message.name !== "") {
|
|
249
|
+
obj.name = message.name;
|
|
250
|
+
}
|
|
251
|
+
if (message.pid !== 0) {
|
|
252
|
+
obj.pid = Math.round(message.pid);
|
|
253
|
+
}
|
|
254
|
+
return obj;
|
|
255
|
+
},
|
|
256
|
+
create(base) {
|
|
257
|
+
return ShellTask.fromPartial(base ?? {});
|
|
258
|
+
},
|
|
259
|
+
fromPartial(object) {
|
|
260
|
+
const message = createBaseShellTask();
|
|
261
|
+
message.tid = object.tid ?? "";
|
|
262
|
+
message.name = object.name ?? "";
|
|
263
|
+
message.pid = object.pid ?? 0;
|
|
264
|
+
return message;
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
function bytesFromBase64(b64) {
|
|
268
|
+
if (globalThis.Buffer) {
|
|
269
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
const bin = globalThis.atob(b64);
|
|
273
|
+
const arr = new Uint8Array(bin.length);
|
|
274
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
275
|
+
arr[i] = bin.charCodeAt(i);
|
|
276
|
+
}
|
|
277
|
+
return arr;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function base64FromBytes(arr) {
|
|
281
|
+
if (globalThis.Buffer) {
|
|
282
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
const bin = [];
|
|
286
|
+
arr.forEach((byte) => {
|
|
287
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
288
|
+
});
|
|
289
|
+
return globalThis.btoa(bin.join(""));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function isSet(value) {
|
|
293
|
+
return value !== null && value !== undefined;
|
|
294
|
+
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface BatteryInfo {
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "lamda.rpc";
|
|
3
|
+
export interface BatteryInfo {
|
|
5
4
|
battCharging: boolean;
|
|
6
5
|
battPercent: number;
|
|
7
6
|
battTemperature: number;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
interface CpuInfo {
|
|
8
|
+
export interface CpuInfo {
|
|
11
9
|
cpuPercent: number;
|
|
12
10
|
cpuCount: number;
|
|
13
11
|
cpuFreqCurrent: number;
|
|
@@ -17,15 +15,13 @@ interface CpuInfo {
|
|
|
17
15
|
cpuTimesSystem: number;
|
|
18
16
|
cpuTimesIdle: number;
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
interface DiskUsage {
|
|
18
|
+
export interface DiskUsage {
|
|
22
19
|
diskTotal: number;
|
|
23
20
|
diskUsed: number;
|
|
24
21
|
diskFree: number;
|
|
25
22
|
diskPercent: number;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
interface DiskIOInfo {
|
|
24
|
+
export interface DiskIOInfo {
|
|
29
25
|
diskIoReadBytes: number;
|
|
30
26
|
diskIoReadCount: number;
|
|
31
27
|
diskIoWriteBytes: number;
|
|
@@ -34,8 +30,7 @@ interface DiskIOInfo {
|
|
|
34
30
|
diskIoWriteTime: number;
|
|
35
31
|
diskIoBusyTime: number;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
|
-
interface NetIOInfo {
|
|
33
|
+
export interface NetIOInfo {
|
|
39
34
|
netIoBytesSent: number;
|
|
40
35
|
netIoPacketsSent: number;
|
|
41
36
|
netIoBytesRecv: number;
|
|
@@ -45,8 +40,7 @@ interface NetIOInfo {
|
|
|
45
40
|
netIoErrin: number;
|
|
46
41
|
netIoErrout: number;
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
interface MemInfo {
|
|
43
|
+
export interface MemInfo {
|
|
50
44
|
memTotal: number;
|
|
51
45
|
memAvailable: number;
|
|
52
46
|
memPercent: number;
|
|
@@ -59,12 +53,17 @@ interface MemInfo {
|
|
|
59
53
|
memShared: number;
|
|
60
54
|
memSlab: number;
|
|
61
55
|
}
|
|
62
|
-
declare const
|
|
56
|
+
export declare const BatteryInfo: MessageFns<BatteryInfo>;
|
|
57
|
+
export declare const CpuInfo: MessageFns<CpuInfo>;
|
|
58
|
+
export declare const DiskUsage: MessageFns<DiskUsage>;
|
|
59
|
+
export declare const DiskIOInfo: MessageFns<DiskIOInfo>;
|
|
60
|
+
export declare const NetIOInfo: MessageFns<NetIOInfo>;
|
|
61
|
+
export declare const MemInfo: MessageFns<MemInfo>;
|
|
63
62
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
64
|
-
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
63
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
65
64
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
66
65
|
} : Partial<T>;
|
|
67
|
-
interface MessageFns<T> {
|
|
66
|
+
export interface MessageFns<T> {
|
|
68
67
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
69
68
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
70
69
|
fromJSON(object: any): T;
|
|
@@ -72,5 +71,4 @@ interface MessageFns<T> {
|
|
|
72
71
|
create(base?: DeepPartial<T>): T;
|
|
73
72
|
fromPartial(object: DeepPartial<T>): T;
|
|
74
73
|
}
|
|
75
|
-
|
|
76
|
-
export { BatteryInfo, CpuInfo, type DeepPartial, DiskIOInfo, DiskUsage, MemInfo, type MessageFns, NetIOInfo, protobufPackage };
|
|
74
|
+
export {};
|