@ekhein/lamda-node-sdk 1.0.3 → 2.0.1
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 +5 -10
- package/dist/chunk-3JBDAA2H.js +0 -439
- package/dist/chunk-4AHM55IO.js +0 -1172
- package/dist/chunk-4NKGYNMS.js +0 -116
- package/dist/chunk-6HD35RPW.js +0 -5370
- package/dist/chunk-76Y3OVVH.js +0 -1602
- 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.intent.cjs +0 -194
- package/dist/constants/android.intent.d.cts +0 -58
- package/dist/constants/android.intent.d.ts +0 -58
- package/dist/constants/android.intent.js +0 -117
- 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 -356
- package/dist/constants/index.d.cts +0 -3
- package/dist/constants/index.d.ts +0 -3
- package/dist/constants/index.js +0 -225
- 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,22 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "lamda.rpc";
|
|
3
|
+
export interface StorageRequest {
|
|
4
|
+
container: string;
|
|
5
|
+
key: string;
|
|
6
|
+
value: Uint8Array;
|
|
7
|
+
ttl: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const StorageRequest: MessageFns<StorageRequest>;
|
|
10
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
11
|
+
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 {} ? {
|
|
12
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
13
|
+
} : Partial<T>;
|
|
14
|
+
export interface MessageFns<T> {
|
|
15
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
16
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
17
|
+
fromJSON(object: any): T;
|
|
18
|
+
toJSON(message: T): unknown;
|
|
19
|
+
create(base?: DeepPartial<T>): T;
|
|
20
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export const protobufPackage = "lamda.rpc";
|
|
3
|
+
function createBaseStorageRequest() {
|
|
4
|
+
return { container: "", key: "", value: new Uint8Array(0), ttl: 0 };
|
|
5
|
+
}
|
|
6
|
+
export const StorageRequest = {
|
|
7
|
+
encode(message, writer = new BinaryWriter()) {
|
|
8
|
+
if (message.container !== "") {
|
|
9
|
+
writer.uint32(10).string(message.container);
|
|
10
|
+
}
|
|
11
|
+
if (message.key !== "") {
|
|
12
|
+
writer.uint32(18).string(message.key);
|
|
13
|
+
}
|
|
14
|
+
if (message.value.length !== 0) {
|
|
15
|
+
writer.uint32(26).bytes(message.value);
|
|
16
|
+
}
|
|
17
|
+
if (message.ttl !== 0) {
|
|
18
|
+
writer.uint32(32).uint32(message.ttl);
|
|
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 = createBaseStorageRequest();
|
|
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.container = reader.string();
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
case 2: {
|
|
37
|
+
if (tag !== 18) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
message.key = reader.string();
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
case 3: {
|
|
44
|
+
if (tag !== 26) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
message.value = reader.bytes();
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
case 4: {
|
|
51
|
+
if (tag !== 32) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
message.ttl = reader.uint32();
|
|
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
|
+
container: isSet(object.container) ? globalThis.String(object.container) : "",
|
|
68
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
69
|
+
value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
|
|
70
|
+
ttl: isSet(object.ttl) ? globalThis.Number(object.ttl) : 0,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
toJSON(message) {
|
|
74
|
+
const obj = {};
|
|
75
|
+
if (message.container !== "") {
|
|
76
|
+
obj.container = message.container;
|
|
77
|
+
}
|
|
78
|
+
if (message.key !== "") {
|
|
79
|
+
obj.key = message.key;
|
|
80
|
+
}
|
|
81
|
+
if (message.value.length !== 0) {
|
|
82
|
+
obj.value = base64FromBytes(message.value);
|
|
83
|
+
}
|
|
84
|
+
if (message.ttl !== 0) {
|
|
85
|
+
obj.ttl = Math.round(message.ttl);
|
|
86
|
+
}
|
|
87
|
+
return obj;
|
|
88
|
+
},
|
|
89
|
+
create(base) {
|
|
90
|
+
return StorageRequest.fromPartial(base ?? {});
|
|
91
|
+
},
|
|
92
|
+
fromPartial(object) {
|
|
93
|
+
const message = createBaseStorageRequest();
|
|
94
|
+
message.container = object.container ?? "";
|
|
95
|
+
message.key = object.key ?? "";
|
|
96
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
97
|
+
message.ttl = object.ttl ?? 0;
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
function bytesFromBase64(b64) {
|
|
102
|
+
if (globalThis.Buffer) {
|
|
103
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const bin = globalThis.atob(b64);
|
|
107
|
+
const arr = new Uint8Array(bin.length);
|
|
108
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
109
|
+
arr[i] = bin.charCodeAt(i);
|
|
110
|
+
}
|
|
111
|
+
return arr;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function base64FromBytes(arr) {
|
|
115
|
+
if (globalThis.Buffer) {
|
|
116
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const bin = [];
|
|
120
|
+
arr.forEach((byte) => {
|
|
121
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
122
|
+
});
|
|
123
|
+
return globalThis.btoa(bin.join(""));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function isSet(value) {
|
|
127
|
+
return value !== null && value !== undefined;
|
|
128
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "lamda.rpc";
|
|
3
|
+
export interface Boolean {
|
|
4
|
+
value: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface Integer {
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
export interface String {
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Bytes {
|
|
13
|
+
value: Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
export interface Empty {
|
|
16
|
+
}
|
|
17
|
+
export declare const Boolean: MessageFns<Boolean>;
|
|
18
|
+
export declare const Integer: MessageFns<Integer>;
|
|
19
|
+
export declare const String: MessageFns<String>;
|
|
20
|
+
export declare const Bytes: MessageFns<Bytes>;
|
|
21
|
+
export declare const Empty: MessageFns<Empty>;
|
|
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,281 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export const protobufPackage = "lamda.rpc";
|
|
3
|
+
function createBaseBoolean() {
|
|
4
|
+
return { value: false };
|
|
5
|
+
}
|
|
6
|
+
export const Boolean = {
|
|
7
|
+
encode(message, writer = new BinaryWriter()) {
|
|
8
|
+
if (message.value !== false) {
|
|
9
|
+
writer.uint32(8).bool(message.value);
|
|
10
|
+
}
|
|
11
|
+
return writer;
|
|
12
|
+
},
|
|
13
|
+
decode(input, length) {
|
|
14
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
16
|
+
const message = createBaseBoolean();
|
|
17
|
+
while (reader.pos < end) {
|
|
18
|
+
const tag = reader.uint32();
|
|
19
|
+
switch (tag >>> 3) {
|
|
20
|
+
case 1: {
|
|
21
|
+
if (tag !== 8) {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
message.value = reader.bool();
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
reader.skip(tag & 7);
|
|
32
|
+
}
|
|
33
|
+
return message;
|
|
34
|
+
},
|
|
35
|
+
fromJSON(object) {
|
|
36
|
+
return { value: isSet(object.value) ? globalThis.Boolean(object.value) : false };
|
|
37
|
+
},
|
|
38
|
+
toJSON(message) {
|
|
39
|
+
const obj = {};
|
|
40
|
+
if (message.value !== false) {
|
|
41
|
+
obj.value = message.value;
|
|
42
|
+
}
|
|
43
|
+
return obj;
|
|
44
|
+
},
|
|
45
|
+
create(base) {
|
|
46
|
+
return Boolean.fromPartial(base ?? {});
|
|
47
|
+
},
|
|
48
|
+
fromPartial(object) {
|
|
49
|
+
const message = createBaseBoolean();
|
|
50
|
+
message.value = object.value ?? false;
|
|
51
|
+
return message;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
function createBaseInteger() {
|
|
55
|
+
return { value: 0 };
|
|
56
|
+
}
|
|
57
|
+
export const Integer = {
|
|
58
|
+
encode(message, writer = new BinaryWriter()) {
|
|
59
|
+
if (message.value !== 0) {
|
|
60
|
+
writer.uint32(8).int64(message.value);
|
|
61
|
+
}
|
|
62
|
+
return writer;
|
|
63
|
+
},
|
|
64
|
+
decode(input, length) {
|
|
65
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
66
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
67
|
+
const message = createBaseInteger();
|
|
68
|
+
while (reader.pos < end) {
|
|
69
|
+
const tag = reader.uint32();
|
|
70
|
+
switch (tag >>> 3) {
|
|
71
|
+
case 1: {
|
|
72
|
+
if (tag !== 8) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
message.value = longToNumber(reader.int64());
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
reader.skip(tag & 7);
|
|
83
|
+
}
|
|
84
|
+
return message;
|
|
85
|
+
},
|
|
86
|
+
fromJSON(object) {
|
|
87
|
+
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
88
|
+
},
|
|
89
|
+
toJSON(message) {
|
|
90
|
+
const obj = {};
|
|
91
|
+
if (message.value !== 0) {
|
|
92
|
+
obj.value = Math.round(message.value);
|
|
93
|
+
}
|
|
94
|
+
return obj;
|
|
95
|
+
},
|
|
96
|
+
create(base) {
|
|
97
|
+
return Integer.fromPartial(base ?? {});
|
|
98
|
+
},
|
|
99
|
+
fromPartial(object) {
|
|
100
|
+
const message = createBaseInteger();
|
|
101
|
+
message.value = object.value ?? 0;
|
|
102
|
+
return message;
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
function createBaseString() {
|
|
106
|
+
return { value: "" };
|
|
107
|
+
}
|
|
108
|
+
export const String = {
|
|
109
|
+
encode(message, writer = new BinaryWriter()) {
|
|
110
|
+
if (message.value !== "") {
|
|
111
|
+
writer.uint32(10).string(message.value);
|
|
112
|
+
}
|
|
113
|
+
return writer;
|
|
114
|
+
},
|
|
115
|
+
decode(input, length) {
|
|
116
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
117
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
118
|
+
const message = createBaseString();
|
|
119
|
+
while (reader.pos < end) {
|
|
120
|
+
const tag = reader.uint32();
|
|
121
|
+
switch (tag >>> 3) {
|
|
122
|
+
case 1: {
|
|
123
|
+
if (tag !== 10) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
message.value = reader.string();
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
reader.skip(tag & 7);
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
fromJSON(object) {
|
|
138
|
+
return { value: isSet(object.value) ? globalThis.String(object.value) : "" };
|
|
139
|
+
},
|
|
140
|
+
toJSON(message) {
|
|
141
|
+
const obj = {};
|
|
142
|
+
if (message.value !== "") {
|
|
143
|
+
obj.value = message.value;
|
|
144
|
+
}
|
|
145
|
+
return obj;
|
|
146
|
+
},
|
|
147
|
+
create(base) {
|
|
148
|
+
return String.fromPartial(base ?? {});
|
|
149
|
+
},
|
|
150
|
+
fromPartial(object) {
|
|
151
|
+
const message = createBaseString();
|
|
152
|
+
message.value = object.value ?? "";
|
|
153
|
+
return message;
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
function createBaseBytes() {
|
|
157
|
+
return { value: new Uint8Array(0) };
|
|
158
|
+
}
|
|
159
|
+
export const Bytes = {
|
|
160
|
+
encode(message, writer = new BinaryWriter()) {
|
|
161
|
+
if (message.value.length !== 0) {
|
|
162
|
+
writer.uint32(10).bytes(message.value);
|
|
163
|
+
}
|
|
164
|
+
return writer;
|
|
165
|
+
},
|
|
166
|
+
decode(input, length) {
|
|
167
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
168
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
169
|
+
const message = createBaseBytes();
|
|
170
|
+
while (reader.pos < end) {
|
|
171
|
+
const tag = reader.uint32();
|
|
172
|
+
switch (tag >>> 3) {
|
|
173
|
+
case 1: {
|
|
174
|
+
if (tag !== 10) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
message.value = reader.bytes();
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
reader.skip(tag & 7);
|
|
185
|
+
}
|
|
186
|
+
return message;
|
|
187
|
+
},
|
|
188
|
+
fromJSON(object) {
|
|
189
|
+
return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0) };
|
|
190
|
+
},
|
|
191
|
+
toJSON(message) {
|
|
192
|
+
const obj = {};
|
|
193
|
+
if (message.value.length !== 0) {
|
|
194
|
+
obj.value = base64FromBytes(message.value);
|
|
195
|
+
}
|
|
196
|
+
return obj;
|
|
197
|
+
},
|
|
198
|
+
create(base) {
|
|
199
|
+
return Bytes.fromPartial(base ?? {});
|
|
200
|
+
},
|
|
201
|
+
fromPartial(object) {
|
|
202
|
+
const message = createBaseBytes();
|
|
203
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
204
|
+
return message;
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
function createBaseEmpty() {
|
|
208
|
+
return {};
|
|
209
|
+
}
|
|
210
|
+
export const Empty = {
|
|
211
|
+
encode(_, writer = new BinaryWriter()) {
|
|
212
|
+
return writer;
|
|
213
|
+
},
|
|
214
|
+
decode(input, length) {
|
|
215
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
216
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
217
|
+
const message = createBaseEmpty();
|
|
218
|
+
while (reader.pos < end) {
|
|
219
|
+
const tag = reader.uint32();
|
|
220
|
+
switch (tag >>> 3) {
|
|
221
|
+
}
|
|
222
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
reader.skip(tag & 7);
|
|
226
|
+
}
|
|
227
|
+
return message;
|
|
228
|
+
},
|
|
229
|
+
fromJSON(_) {
|
|
230
|
+
return {};
|
|
231
|
+
},
|
|
232
|
+
toJSON(_) {
|
|
233
|
+
const obj = {};
|
|
234
|
+
return obj;
|
|
235
|
+
},
|
|
236
|
+
create(base) {
|
|
237
|
+
return Empty.fromPartial(base ?? {});
|
|
238
|
+
},
|
|
239
|
+
fromPartial(_) {
|
|
240
|
+
const message = createBaseEmpty();
|
|
241
|
+
return message;
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
function bytesFromBase64(b64) {
|
|
245
|
+
if (globalThis.Buffer) {
|
|
246
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const bin = globalThis.atob(b64);
|
|
250
|
+
const arr = new Uint8Array(bin.length);
|
|
251
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
252
|
+
arr[i] = bin.charCodeAt(i);
|
|
253
|
+
}
|
|
254
|
+
return arr;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function base64FromBytes(arr) {
|
|
258
|
+
if (globalThis.Buffer) {
|
|
259
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const bin = [];
|
|
263
|
+
arr.forEach((byte) => {
|
|
264
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
265
|
+
});
|
|
266
|
+
return globalThis.btoa(bin.join(""));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function longToNumber(int64) {
|
|
270
|
+
const num = globalThis.Number(int64.toString());
|
|
271
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
272
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
273
|
+
}
|
|
274
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
275
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
276
|
+
}
|
|
277
|
+
return num;
|
|
278
|
+
}
|
|
279
|
+
function isSet(value) {
|
|
280
|
+
return value !== null && value !== undefined;
|
|
281
|
+
}
|