@lazycatcloud/lzc-cli 1.1.12 → 1.2.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/lib/app/index.js +52 -33
- package/lib/app/lpk_build.js +1 -5
- package/lib/app/lpk_create.js +9 -3
- package/lib/app/lpk_debug_bridge.js +101 -0
- package/lib/app/lpk_devshell.js +59 -129
- package/lib/app/lpk_installer.js +43 -50
- package/lib/appstore/publish.js +18 -8
- package/lib/box/index.js +2 -86
- package/lib/env.js +18 -178
- package/lib/lzc_sdk.js +75 -17
- package/lib/shellapi.js +95 -0
- package/lib/shellapi.proto +301 -0
- package/lib/utils.js +7 -103
- package/package.json +3 -21
- package/scripts/cli.js +6 -6
- package/template/_lpk/busybox-1.35.0 +0 -0
- package/template/_lpk/exec.sh +1 -10
- package/template/_lpk/init_debug_bridge.sh +24 -0
- package/template/_lpk/vue.lzc-build.yml.in +0 -16
- package/template/golang/lzc-build.yml +0 -15
- package/template/ionic_vue3/lzc-build.yml +0 -16
- package/template/ionic_vue3/package-lock.json +8100 -0
- package/template/lite/lzc-build.yml +0 -28
- package/lib/api.js +0 -155
- package/lib/app/lpk_devshell_docker.js +0 -211
- package/lib/app/lpk_log.js +0 -68
- package/lib/app/lpk_status.js +0 -18
- package/lib/app/lpk_uninstall.js +0 -19
- package/lib/box/api/clientapi.js +0 -1322
- package/lib/box/api/empty.js +0 -35
- package/lib/box/check_qemu.js +0 -51
- package/lib/box/qemu_vm_mgr.js +0 -608
- package/lib/box/schemes/vm_box_system_debian.json +0 -47
- package/lib/docker/promise.js +0 -91
- package/lib/docker-compose.js +0 -50
- package/lib/git/git-commit.sh +0 -7
- package/lib/git/git-reset.sh +0 -15
- package/lib/key.js +0 -102
- package/lib/sdk.js +0 -135
package/lib/box/api/clientapi.js
DELETED
|
@@ -1,1322 +0,0 @@
|
|
|
1
|
-
// generated by clientapi.ts
|
|
2
|
-
// Don't edit
|
|
3
|
-
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
import grpcweb from "@improbable-eng/grpc-web";
|
|
6
|
-
const { grpc } = grpcweb;
|
|
7
|
-
import { NodeHttpTransport } from "@improbable-eng/grpc-web-node-http-transport";
|
|
8
|
-
grpc.setDefaultTransport(NodeHttpTransport());
|
|
9
|
-
|
|
10
|
-
import { Empty } from "./empty.js";
|
|
11
|
-
import { BrowserHeaders } from "browser-headers";
|
|
12
|
-
import { share } from "rxjs/operators";
|
|
13
|
-
import { Observable } from "rxjs";
|
|
14
|
-
import _m0 from "protobufjs/minimal.js";
|
|
15
|
-
/** 盒子只会处于以下四种状态之一 */
|
|
16
|
-
export var BoxStatus;
|
|
17
|
-
(function (BoxStatus) {
|
|
18
|
-
/** DISABLED - 此盒子当前未激活 */
|
|
19
|
-
BoxStatus[(BoxStatus["DISABLED"] = 0)] = "DISABLED";
|
|
20
|
-
/**
|
|
21
|
-
* CONNECTING - 正在连接中,此过程持续时间无法评估,
|
|
22
|
-
* 可能瞬间结束也可能持续一两分钟(在确实可以连接上的前提下)
|
|
23
|
-
*/
|
|
24
|
-
BoxStatus[(BoxStatus["CONNECTING"] = 1)] = "CONNECTING";
|
|
25
|
-
/** CONNECTED - 成功连接上了 */
|
|
26
|
-
BoxStatus[(BoxStatus["CONNECTED"] = 2)] = "CONNECTED";
|
|
27
|
-
/**
|
|
28
|
-
* FAILED - 确定无法连接,此时不会继续重试,需要客户端
|
|
29
|
-
* 修正环境后,重新调用ModifyBox后继续尝试。
|
|
30
|
-
*/
|
|
31
|
-
BoxStatus[(BoxStatus["FAILED"] = 3)] = "FAILED";
|
|
32
|
-
BoxStatus[(BoxStatus["UNRECOGNIZED"] = -1)] = "UNRECOGNIZED";
|
|
33
|
-
})(BoxStatus || (BoxStatus = {}));
|
|
34
|
-
export function boxStatusFromJSON(object) {
|
|
35
|
-
switch (object) {
|
|
36
|
-
case 0:
|
|
37
|
-
case "DISABLED":
|
|
38
|
-
return BoxStatus.DISABLED;
|
|
39
|
-
case 1:
|
|
40
|
-
case "CONNECTING":
|
|
41
|
-
return BoxStatus.CONNECTING;
|
|
42
|
-
case 2:
|
|
43
|
-
case "CONNECTED":
|
|
44
|
-
return BoxStatus.CONNECTED;
|
|
45
|
-
case 3:
|
|
46
|
-
case "FAILED":
|
|
47
|
-
return BoxStatus.FAILED;
|
|
48
|
-
case -1:
|
|
49
|
-
case "UNRECOGNIZED":
|
|
50
|
-
default:
|
|
51
|
-
return BoxStatus.UNRECOGNIZED;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export function boxStatusToJSON(object) {
|
|
55
|
-
switch (object) {
|
|
56
|
-
case BoxStatus.DISABLED:
|
|
57
|
-
return "DISABLED";
|
|
58
|
-
case BoxStatus.CONNECTING:
|
|
59
|
-
return "CONNECTING";
|
|
60
|
-
case BoxStatus.CONNECTED:
|
|
61
|
-
return "CONNECTED";
|
|
62
|
-
case BoxStatus.FAILED:
|
|
63
|
-
return "FAILED";
|
|
64
|
-
case BoxStatus.UNRECOGNIZED:
|
|
65
|
-
default:
|
|
66
|
-
return "UNRECOGNIZED";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export var FailedStatus;
|
|
70
|
-
(function (FailedStatus) {
|
|
71
|
-
/** FAILED_UNKNOWN - 未知原因失败 */
|
|
72
|
-
FailedStatus[(FailedStatus["FAILED_UNKNOWN"] = 0)] = "FAILED_UNKNOWN";
|
|
73
|
-
/** FAILED_NO_ADMINUSER - 当前盒子无管理员帐号,需要调用CreateUser创建管理员帐号 */
|
|
74
|
-
FailedStatus[(FailedStatus["FAILED_NO_ADMINUSER"] = 1)] =
|
|
75
|
-
"FAILED_NO_ADMINUSER";
|
|
76
|
-
/** FAILED_NO_BOXNAME - 当前盒子未注册盒子名称,需要调用SetupNewBox向horigin申请盒子名称以及配套资源 */
|
|
77
|
-
FailedStatus[(FailedStatus["FAILED_NO_BOXNAME"] = 2)] = "FAILED_NO_BOXNAME";
|
|
78
|
-
/** FAILED_INVALID_PASSWORD - 当前登陆信息不正确,需要调用ModifyBox设置新的auth信息 */
|
|
79
|
-
FailedStatus[(FailedStatus["FAILED_INVALID_PASSWORD"] = 3)] =
|
|
80
|
-
"FAILED_INVALID_PASSWORD";
|
|
81
|
-
/** FAILED_MISMATCH_BOX_VERSION - 当前客户端与服务器版本不匹配,无法连接,需要升级盒子系统或客户端软件 */
|
|
82
|
-
FailedStatus[(FailedStatus["FAILED_MISMATCH_BOX_VERSION"] = 4)] =
|
|
83
|
-
"FAILED_MISMATCH_BOX_VERSION";
|
|
84
|
-
FailedStatus[(FailedStatus["UNRECOGNIZED"] = -1)] = "UNRECOGNIZED";
|
|
85
|
-
})(FailedStatus || (FailedStatus = {}));
|
|
86
|
-
export function failedStatusFromJSON(object) {
|
|
87
|
-
switch (object) {
|
|
88
|
-
case 0:
|
|
89
|
-
case "FAILED_UNKNOWN":
|
|
90
|
-
return FailedStatus.FAILED_UNKNOWN;
|
|
91
|
-
case 1:
|
|
92
|
-
case "FAILED_NO_ADMINUSER":
|
|
93
|
-
return FailedStatus.FAILED_NO_ADMINUSER;
|
|
94
|
-
case 2:
|
|
95
|
-
case "FAILED_NO_BOXNAME":
|
|
96
|
-
return FailedStatus.FAILED_NO_BOXNAME;
|
|
97
|
-
case 3:
|
|
98
|
-
case "FAILED_INVALID_PASSWORD":
|
|
99
|
-
return FailedStatus.FAILED_INVALID_PASSWORD;
|
|
100
|
-
case 4:
|
|
101
|
-
case "FAILED_MISMATCH_BOX_VERSION":
|
|
102
|
-
return FailedStatus.FAILED_MISMATCH_BOX_VERSION;
|
|
103
|
-
case -1:
|
|
104
|
-
case "UNRECOGNIZED":
|
|
105
|
-
default:
|
|
106
|
-
return FailedStatus.UNRECOGNIZED;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
export function failedStatusToJSON(object) {
|
|
110
|
-
switch (object) {
|
|
111
|
-
case FailedStatus.FAILED_UNKNOWN:
|
|
112
|
-
return "FAILED_UNKNOWN";
|
|
113
|
-
case FailedStatus.FAILED_NO_ADMINUSER:
|
|
114
|
-
return "FAILED_NO_ADMINUSER";
|
|
115
|
-
case FailedStatus.FAILED_NO_BOXNAME:
|
|
116
|
-
return "FAILED_NO_BOXNAME";
|
|
117
|
-
case FailedStatus.FAILED_INVALID_PASSWORD:
|
|
118
|
-
return "FAILED_INVALID_PASSWORD";
|
|
119
|
-
case FailedStatus.FAILED_MISMATCH_BOX_VERSION:
|
|
120
|
-
return "FAILED_MISMATCH_BOX_VERSION";
|
|
121
|
-
case FailedStatus.UNRECOGNIZED:
|
|
122
|
-
default:
|
|
123
|
-
return "UNRECOGNIZED";
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function createBaseAddBoxRequest() {
|
|
127
|
-
return { idOrName: "" };
|
|
128
|
-
}
|
|
129
|
-
export const AddBoxRequest = {
|
|
130
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
131
|
-
if (message.idOrName !== "") {
|
|
132
|
-
writer.uint32(10).string(message.idOrName);
|
|
133
|
-
}
|
|
134
|
-
return writer;
|
|
135
|
-
},
|
|
136
|
-
decode(input, length) {
|
|
137
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
138
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
139
|
-
const message = createBaseAddBoxRequest();
|
|
140
|
-
while (reader.pos < end) {
|
|
141
|
-
const tag = reader.uint32();
|
|
142
|
-
switch (tag >>> 3) {
|
|
143
|
-
case 1:
|
|
144
|
-
message.idOrName = reader.string();
|
|
145
|
-
break;
|
|
146
|
-
default:
|
|
147
|
-
reader.skipType(tag & 7);
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return message;
|
|
152
|
-
},
|
|
153
|
-
fromJSON(object) {
|
|
154
|
-
return {
|
|
155
|
-
idOrName: isSet(object.idOrName) ? String(object.idOrName) : "",
|
|
156
|
-
};
|
|
157
|
-
},
|
|
158
|
-
toJSON(message) {
|
|
159
|
-
const obj = {};
|
|
160
|
-
message.idOrName !== undefined && (obj.idOrName = message.idOrName);
|
|
161
|
-
return obj;
|
|
162
|
-
},
|
|
163
|
-
fromPartial(object) {
|
|
164
|
-
const message = createBaseAddBoxRequest();
|
|
165
|
-
message.idOrName = object.idOrName ?? "";
|
|
166
|
-
return message;
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
function createBaseBoxID() {
|
|
170
|
-
return { id: "" };
|
|
171
|
-
}
|
|
172
|
-
export const BoxID = {
|
|
173
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
174
|
-
if (message.id !== "") {
|
|
175
|
-
writer.uint32(10).string(message.id);
|
|
176
|
-
}
|
|
177
|
-
return writer;
|
|
178
|
-
},
|
|
179
|
-
decode(input, length) {
|
|
180
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
181
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
182
|
-
const message = createBaseBoxID();
|
|
183
|
-
while (reader.pos < end) {
|
|
184
|
-
const tag = reader.uint32();
|
|
185
|
-
switch (tag >>> 3) {
|
|
186
|
-
case 1:
|
|
187
|
-
message.id = reader.string();
|
|
188
|
-
break;
|
|
189
|
-
default:
|
|
190
|
-
reader.skipType(tag & 7);
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return message;
|
|
195
|
-
},
|
|
196
|
-
fromJSON(object) {
|
|
197
|
-
return {
|
|
198
|
-
id: isSet(object.id) ? String(object.id) : "",
|
|
199
|
-
};
|
|
200
|
-
},
|
|
201
|
-
toJSON(message) {
|
|
202
|
-
const obj = {};
|
|
203
|
-
message.id !== undefined && (obj.id = message.id);
|
|
204
|
-
return obj;
|
|
205
|
-
},
|
|
206
|
-
fromPartial(object) {
|
|
207
|
-
const message = createBaseBoxID();
|
|
208
|
-
message.id = object.id ?? "";
|
|
209
|
-
return message;
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
function createBaseBoxName() {
|
|
213
|
-
return { name: "" };
|
|
214
|
-
}
|
|
215
|
-
export const BoxName = {
|
|
216
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
217
|
-
if (message.name !== "") {
|
|
218
|
-
writer.uint32(10).string(message.name);
|
|
219
|
-
}
|
|
220
|
-
return writer;
|
|
221
|
-
},
|
|
222
|
-
decode(input, length) {
|
|
223
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
224
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
225
|
-
const message = createBaseBoxName();
|
|
226
|
-
while (reader.pos < end) {
|
|
227
|
-
const tag = reader.uint32();
|
|
228
|
-
switch (tag >>> 3) {
|
|
229
|
-
case 1:
|
|
230
|
-
message.name = reader.string();
|
|
231
|
-
break;
|
|
232
|
-
default:
|
|
233
|
-
reader.skipType(tag & 7);
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return message;
|
|
238
|
-
},
|
|
239
|
-
fromJSON(object) {
|
|
240
|
-
return {
|
|
241
|
-
name: isSet(object.name) ? String(object.name) : "",
|
|
242
|
-
};
|
|
243
|
-
},
|
|
244
|
-
toJSON(message) {
|
|
245
|
-
const obj = {};
|
|
246
|
-
message.name !== undefined && (obj.name = message.name);
|
|
247
|
-
return obj;
|
|
248
|
-
},
|
|
249
|
-
fromPartial(object) {
|
|
250
|
-
const message = createBaseBoxName();
|
|
251
|
-
message.name = object.name ?? "";
|
|
252
|
-
return message;
|
|
253
|
-
},
|
|
254
|
-
};
|
|
255
|
-
function createBaseBoxSetting() {
|
|
256
|
-
return { id: "", name: undefined, enabled: undefined, auth: undefined };
|
|
257
|
-
}
|
|
258
|
-
export const BoxSetting = {
|
|
259
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
260
|
-
if (message.id !== "") {
|
|
261
|
-
writer.uint32(10).string(message.id);
|
|
262
|
-
}
|
|
263
|
-
if (message.name !== undefined) {
|
|
264
|
-
writer.uint32(18).string(message.name);
|
|
265
|
-
}
|
|
266
|
-
if (message.enabled !== undefined) {
|
|
267
|
-
writer.uint32(24).bool(message.enabled);
|
|
268
|
-
}
|
|
269
|
-
if (message.auth !== undefined) {
|
|
270
|
-
BoxSetting_AuthInfo.encode(
|
|
271
|
-
message.auth,
|
|
272
|
-
writer.uint32(34).fork()
|
|
273
|
-
).ldelim();
|
|
274
|
-
}
|
|
275
|
-
return writer;
|
|
276
|
-
},
|
|
277
|
-
decode(input, length) {
|
|
278
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
279
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
280
|
-
const message = createBaseBoxSetting();
|
|
281
|
-
while (reader.pos < end) {
|
|
282
|
-
const tag = reader.uint32();
|
|
283
|
-
switch (tag >>> 3) {
|
|
284
|
-
case 1:
|
|
285
|
-
message.id = reader.string();
|
|
286
|
-
break;
|
|
287
|
-
case 2:
|
|
288
|
-
message.name = reader.string();
|
|
289
|
-
break;
|
|
290
|
-
case 3:
|
|
291
|
-
message.enabled = reader.bool();
|
|
292
|
-
break;
|
|
293
|
-
case 4:
|
|
294
|
-
message.auth = BoxSetting_AuthInfo.decode(reader, reader.uint32());
|
|
295
|
-
break;
|
|
296
|
-
default:
|
|
297
|
-
reader.skipType(tag & 7);
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return message;
|
|
302
|
-
},
|
|
303
|
-
fromJSON(object) {
|
|
304
|
-
return {
|
|
305
|
-
id: isSet(object.id) ? String(object.id) : "",
|
|
306
|
-
name: isSet(object.name) ? String(object.name) : undefined,
|
|
307
|
-
enabled: isSet(object.enabled) ? Boolean(object.enabled) : undefined,
|
|
308
|
-
auth: isSet(object.auth)
|
|
309
|
-
? BoxSetting_AuthInfo.fromJSON(object.auth)
|
|
310
|
-
: undefined,
|
|
311
|
-
};
|
|
312
|
-
},
|
|
313
|
-
toJSON(message) {
|
|
314
|
-
const obj = {};
|
|
315
|
-
message.id !== undefined && (obj.id = message.id);
|
|
316
|
-
message.name !== undefined && (obj.name = message.name);
|
|
317
|
-
message.enabled !== undefined && (obj.enabled = message.enabled);
|
|
318
|
-
message.auth !== undefined &&
|
|
319
|
-
(obj.auth = message.auth
|
|
320
|
-
? BoxSetting_AuthInfo.toJSON(message.auth)
|
|
321
|
-
: undefined);
|
|
322
|
-
return obj;
|
|
323
|
-
},
|
|
324
|
-
fromPartial(object) {
|
|
325
|
-
const message = createBaseBoxSetting();
|
|
326
|
-
message.id = object.id ?? "";
|
|
327
|
-
message.name = object.name ?? undefined;
|
|
328
|
-
message.enabled = object.enabled ?? undefined;
|
|
329
|
-
message.auth =
|
|
330
|
-
object.auth !== undefined && object.auth !== null
|
|
331
|
-
? BoxSetting_AuthInfo.fromPartial(object.auth)
|
|
332
|
-
: undefined;
|
|
333
|
-
return message;
|
|
334
|
-
},
|
|
335
|
-
};
|
|
336
|
-
function createBaseBoxSetting_AuthInfo() {
|
|
337
|
-
return { user: "", password: "" };
|
|
338
|
-
}
|
|
339
|
-
export const BoxSetting_AuthInfo = {
|
|
340
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
341
|
-
if (message.user !== "") {
|
|
342
|
-
writer.uint32(26).string(message.user);
|
|
343
|
-
}
|
|
344
|
-
if (message.password !== "") {
|
|
345
|
-
writer.uint32(34).string(message.password);
|
|
346
|
-
}
|
|
347
|
-
return writer;
|
|
348
|
-
},
|
|
349
|
-
decode(input, length) {
|
|
350
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
351
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
352
|
-
const message = createBaseBoxSetting_AuthInfo();
|
|
353
|
-
while (reader.pos < end) {
|
|
354
|
-
const tag = reader.uint32();
|
|
355
|
-
switch (tag >>> 3) {
|
|
356
|
-
case 3:
|
|
357
|
-
message.user = reader.string();
|
|
358
|
-
break;
|
|
359
|
-
case 4:
|
|
360
|
-
message.password = reader.string();
|
|
361
|
-
break;
|
|
362
|
-
default:
|
|
363
|
-
reader.skipType(tag & 7);
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return message;
|
|
368
|
-
},
|
|
369
|
-
fromJSON(object) {
|
|
370
|
-
return {
|
|
371
|
-
user: isSet(object.user) ? String(object.user) : "",
|
|
372
|
-
password: isSet(object.password) ? String(object.password) : "",
|
|
373
|
-
};
|
|
374
|
-
},
|
|
375
|
-
toJSON(message) {
|
|
376
|
-
const obj = {};
|
|
377
|
-
message.user !== undefined && (obj.user = message.user);
|
|
378
|
-
message.password !== undefined && (obj.password = message.password);
|
|
379
|
-
return obj;
|
|
380
|
-
},
|
|
381
|
-
fromPartial(object) {
|
|
382
|
-
const message = createBaseBoxSetting_AuthInfo();
|
|
383
|
-
message.user = object.user ?? "";
|
|
384
|
-
message.password = object.password ?? "";
|
|
385
|
-
return message;
|
|
386
|
-
},
|
|
387
|
-
};
|
|
388
|
-
function createBaseBoxInfo() {
|
|
389
|
-
return {
|
|
390
|
-
boxId: "",
|
|
391
|
-
boxName: "",
|
|
392
|
-
boxDomain: "",
|
|
393
|
-
status: 0,
|
|
394
|
-
statusReason: "",
|
|
395
|
-
failedStatus: undefined,
|
|
396
|
-
loginUser: "",
|
|
397
|
-
isAdminLogin: false,
|
|
398
|
-
authToken: "",
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
export const BoxInfo = {
|
|
402
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
403
|
-
if (message.boxId !== "") {
|
|
404
|
-
writer.uint32(10).string(message.boxId);
|
|
405
|
-
}
|
|
406
|
-
if (message.boxName !== "") {
|
|
407
|
-
writer.uint32(18).string(message.boxName);
|
|
408
|
-
}
|
|
409
|
-
if (message.boxDomain !== "") {
|
|
410
|
-
writer.uint32(26).string(message.boxDomain);
|
|
411
|
-
}
|
|
412
|
-
if (message.status !== 0) {
|
|
413
|
-
writer.uint32(32).int32(message.status);
|
|
414
|
-
}
|
|
415
|
-
if (message.statusReason !== "") {
|
|
416
|
-
writer.uint32(42).string(message.statusReason);
|
|
417
|
-
}
|
|
418
|
-
if (message.failedStatus !== undefined) {
|
|
419
|
-
writer.uint32(48).int32(message.failedStatus);
|
|
420
|
-
}
|
|
421
|
-
if (message.loginUser !== "") {
|
|
422
|
-
writer.uint32(58).string(message.loginUser);
|
|
423
|
-
}
|
|
424
|
-
if (message.isAdminLogin === true) {
|
|
425
|
-
writer.uint32(64).bool(message.isAdminLogin);
|
|
426
|
-
}
|
|
427
|
-
if (message.authToken !== "") {
|
|
428
|
-
writer.uint32(74).string(message.authToken);
|
|
429
|
-
}
|
|
430
|
-
return writer;
|
|
431
|
-
},
|
|
432
|
-
decode(input, length) {
|
|
433
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
434
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
435
|
-
const message = createBaseBoxInfo();
|
|
436
|
-
while (reader.pos < end) {
|
|
437
|
-
const tag = reader.uint32();
|
|
438
|
-
switch (tag >>> 3) {
|
|
439
|
-
case 1:
|
|
440
|
-
message.boxId = reader.string();
|
|
441
|
-
break;
|
|
442
|
-
case 2:
|
|
443
|
-
message.boxName = reader.string();
|
|
444
|
-
break;
|
|
445
|
-
case 3:
|
|
446
|
-
message.boxDomain = reader.string();
|
|
447
|
-
break;
|
|
448
|
-
case 4:
|
|
449
|
-
message.status = reader.int32();
|
|
450
|
-
break;
|
|
451
|
-
case 5:
|
|
452
|
-
message.statusReason = reader.string();
|
|
453
|
-
break;
|
|
454
|
-
case 6:
|
|
455
|
-
message.failedStatus = reader.int32();
|
|
456
|
-
break;
|
|
457
|
-
case 7:
|
|
458
|
-
message.loginUser = reader.string();
|
|
459
|
-
break;
|
|
460
|
-
case 8:
|
|
461
|
-
message.isAdminLogin = reader.bool();
|
|
462
|
-
break;
|
|
463
|
-
case 9:
|
|
464
|
-
message.authToken = reader.string();
|
|
465
|
-
break;
|
|
466
|
-
default:
|
|
467
|
-
reader.skipType(tag & 7);
|
|
468
|
-
break;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
return message;
|
|
472
|
-
},
|
|
473
|
-
fromJSON(object) {
|
|
474
|
-
return {
|
|
475
|
-
boxId: isSet(object.boxId) ? String(object.boxId) : "",
|
|
476
|
-
boxName: isSet(object.boxName) ? String(object.boxName) : "",
|
|
477
|
-
boxDomain: isSet(object.boxDomain) ? String(object.boxDomain) : "",
|
|
478
|
-
status: isSet(object.status) ? boxStatusFromJSON(object.status) : 0,
|
|
479
|
-
statusReason: isSet(object.statusReason)
|
|
480
|
-
? String(object.statusReason)
|
|
481
|
-
: "",
|
|
482
|
-
failedStatus: isSet(object.failedStatus)
|
|
483
|
-
? failedStatusFromJSON(object.failedStatus)
|
|
484
|
-
: undefined,
|
|
485
|
-
loginUser: isSet(object.loginUser) ? String(object.loginUser) : "",
|
|
486
|
-
isAdminLogin: isSet(object.isAdminLogin)
|
|
487
|
-
? Boolean(object.isAdminLogin)
|
|
488
|
-
: false,
|
|
489
|
-
authToken: isSet(object.authToken) ? String(object.authToken) : "",
|
|
490
|
-
};
|
|
491
|
-
},
|
|
492
|
-
toJSON(message) {
|
|
493
|
-
const obj = {};
|
|
494
|
-
message.boxId !== undefined && (obj.boxId = message.boxId);
|
|
495
|
-
message.boxName !== undefined && (obj.boxName = message.boxName);
|
|
496
|
-
message.boxDomain !== undefined && (obj.boxDomain = message.boxDomain);
|
|
497
|
-
message.status !== undefined &&
|
|
498
|
-
(obj.status = boxStatusToJSON(message.status));
|
|
499
|
-
message.statusReason !== undefined &&
|
|
500
|
-
(obj.statusReason = message.statusReason);
|
|
501
|
-
message.failedStatus !== undefined &&
|
|
502
|
-
(obj.failedStatus =
|
|
503
|
-
message.failedStatus !== undefined
|
|
504
|
-
? failedStatusToJSON(message.failedStatus)
|
|
505
|
-
: undefined);
|
|
506
|
-
message.loginUser !== undefined && (obj.loginUser = message.loginUser);
|
|
507
|
-
message.isAdminLogin !== undefined &&
|
|
508
|
-
(obj.isAdminLogin = message.isAdminLogin);
|
|
509
|
-
message.authToken !== undefined && (obj.authToken = message.authToken);
|
|
510
|
-
return obj;
|
|
511
|
-
},
|
|
512
|
-
fromPartial(object) {
|
|
513
|
-
const message = createBaseBoxInfo();
|
|
514
|
-
message.boxId = object.boxId ?? "";
|
|
515
|
-
message.boxName = object.boxName ?? "";
|
|
516
|
-
message.boxDomain = object.boxDomain ?? "";
|
|
517
|
-
message.status = object.status ?? 0;
|
|
518
|
-
message.statusReason = object.statusReason ?? "";
|
|
519
|
-
message.failedStatus = object.failedStatus ?? undefined;
|
|
520
|
-
message.loginUser = object.loginUser ?? "";
|
|
521
|
-
message.isAdminLogin = object.isAdminLogin ?? false;
|
|
522
|
-
message.authToken = object.authToken ?? "";
|
|
523
|
-
return message;
|
|
524
|
-
},
|
|
525
|
-
};
|
|
526
|
-
function createBaseBoxList() {
|
|
527
|
-
return { boxes: [] };
|
|
528
|
-
}
|
|
529
|
-
export const BoxList = {
|
|
530
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
531
|
-
for (const v of message.boxes) {
|
|
532
|
-
BoxInfo.encode(v, writer.uint32(10).fork()).ldelim();
|
|
533
|
-
}
|
|
534
|
-
return writer;
|
|
535
|
-
},
|
|
536
|
-
decode(input, length) {
|
|
537
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
538
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
539
|
-
const message = createBaseBoxList();
|
|
540
|
-
while (reader.pos < end) {
|
|
541
|
-
const tag = reader.uint32();
|
|
542
|
-
switch (tag >>> 3) {
|
|
543
|
-
case 1:
|
|
544
|
-
message.boxes.push(BoxInfo.decode(reader, reader.uint32()));
|
|
545
|
-
break;
|
|
546
|
-
default:
|
|
547
|
-
reader.skipType(tag & 7);
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
return message;
|
|
552
|
-
},
|
|
553
|
-
fromJSON(object) {
|
|
554
|
-
return {
|
|
555
|
-
boxes: Array.isArray(object?.boxes)
|
|
556
|
-
? object.boxes.map((e) => BoxInfo.fromJSON(e))
|
|
557
|
-
: [],
|
|
558
|
-
};
|
|
559
|
-
},
|
|
560
|
-
toJSON(message) {
|
|
561
|
-
const obj = {};
|
|
562
|
-
if (message.boxes) {
|
|
563
|
-
obj.boxes = message.boxes.map((e) => (e ? BoxInfo.toJSON(e) : undefined));
|
|
564
|
-
} else {
|
|
565
|
-
obj.boxes = [];
|
|
566
|
-
}
|
|
567
|
-
return obj;
|
|
568
|
-
},
|
|
569
|
-
fromPartial(object) {
|
|
570
|
-
const message = createBaseBoxList();
|
|
571
|
-
message.boxes = object.boxes?.map((e) => BoxInfo.fromPartial(e)) || [];
|
|
572
|
-
return message;
|
|
573
|
-
},
|
|
574
|
-
};
|
|
575
|
-
function createBaseClientInfo() {
|
|
576
|
-
return {
|
|
577
|
-
id: "",
|
|
578
|
-
tunIp: "",
|
|
579
|
-
localIps: [],
|
|
580
|
-
originServer: "",
|
|
581
|
-
deviceDomain: "",
|
|
582
|
-
version: "",
|
|
583
|
-
ifceIps: [],
|
|
584
|
-
listenIps: [],
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
export const ClientInfo = {
|
|
588
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
589
|
-
if (message.id !== "") {
|
|
590
|
-
writer.uint32(10).string(message.id);
|
|
591
|
-
}
|
|
592
|
-
if (message.tunIp !== "") {
|
|
593
|
-
writer.uint32(18).string(message.tunIp);
|
|
594
|
-
}
|
|
595
|
-
for (const v of message.localIps) {
|
|
596
|
-
writer.uint32(26).string(v);
|
|
597
|
-
}
|
|
598
|
-
if (message.originServer !== "") {
|
|
599
|
-
writer.uint32(34).string(message.originServer);
|
|
600
|
-
}
|
|
601
|
-
if (message.deviceDomain !== "") {
|
|
602
|
-
writer.uint32(42).string(message.deviceDomain);
|
|
603
|
-
}
|
|
604
|
-
if (message.version !== "") {
|
|
605
|
-
writer.uint32(50).string(message.version);
|
|
606
|
-
}
|
|
607
|
-
for (const v of message.ifceIps) {
|
|
608
|
-
writer.uint32(58).string(v);
|
|
609
|
-
}
|
|
610
|
-
for (const v of message.listenIps) {
|
|
611
|
-
writer.uint32(66).string(v);
|
|
612
|
-
}
|
|
613
|
-
return writer;
|
|
614
|
-
},
|
|
615
|
-
decode(input, length) {
|
|
616
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
617
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
618
|
-
const message = createBaseClientInfo();
|
|
619
|
-
while (reader.pos < end) {
|
|
620
|
-
const tag = reader.uint32();
|
|
621
|
-
switch (tag >>> 3) {
|
|
622
|
-
case 1:
|
|
623
|
-
message.id = reader.string();
|
|
624
|
-
break;
|
|
625
|
-
case 2:
|
|
626
|
-
message.tunIp = reader.string();
|
|
627
|
-
break;
|
|
628
|
-
case 3:
|
|
629
|
-
message.localIps.push(reader.string());
|
|
630
|
-
break;
|
|
631
|
-
case 4:
|
|
632
|
-
message.originServer = reader.string();
|
|
633
|
-
break;
|
|
634
|
-
case 5:
|
|
635
|
-
message.deviceDomain = reader.string();
|
|
636
|
-
break;
|
|
637
|
-
case 6:
|
|
638
|
-
message.version = reader.string();
|
|
639
|
-
break;
|
|
640
|
-
case 7:
|
|
641
|
-
message.ifceIps.push(reader.string());
|
|
642
|
-
break;
|
|
643
|
-
case 8:
|
|
644
|
-
message.listenIps.push(reader.string());
|
|
645
|
-
break;
|
|
646
|
-
default:
|
|
647
|
-
reader.skipType(tag & 7);
|
|
648
|
-
break;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return message;
|
|
652
|
-
},
|
|
653
|
-
fromJSON(object) {
|
|
654
|
-
return {
|
|
655
|
-
id: isSet(object.id) ? String(object.id) : "",
|
|
656
|
-
tunIp: isSet(object.tunIp) ? String(object.tunIp) : "",
|
|
657
|
-
localIps: Array.isArray(object?.localIps)
|
|
658
|
-
? object.localIps.map((e) => String(e))
|
|
659
|
-
: [],
|
|
660
|
-
originServer: isSet(object.originServer)
|
|
661
|
-
? String(object.originServer)
|
|
662
|
-
: "",
|
|
663
|
-
deviceDomain: isSet(object.deviceDomain)
|
|
664
|
-
? String(object.deviceDomain)
|
|
665
|
-
: "",
|
|
666
|
-
version: isSet(object.version) ? String(object.version) : "",
|
|
667
|
-
ifceIps: Array.isArray(object?.ifceIps)
|
|
668
|
-
? object.ifceIps.map((e) => String(e))
|
|
669
|
-
: [],
|
|
670
|
-
listenIps: Array.isArray(object?.listenIps)
|
|
671
|
-
? object.listenIps.map((e) => String(e))
|
|
672
|
-
: [],
|
|
673
|
-
};
|
|
674
|
-
},
|
|
675
|
-
toJSON(message) {
|
|
676
|
-
const obj = {};
|
|
677
|
-
message.id !== undefined && (obj.id = message.id);
|
|
678
|
-
message.tunIp !== undefined && (obj.tunIp = message.tunIp);
|
|
679
|
-
if (message.localIps) {
|
|
680
|
-
obj.localIps = message.localIps.map((e) => e);
|
|
681
|
-
} else {
|
|
682
|
-
obj.localIps = [];
|
|
683
|
-
}
|
|
684
|
-
message.originServer !== undefined &&
|
|
685
|
-
(obj.originServer = message.originServer);
|
|
686
|
-
message.deviceDomain !== undefined &&
|
|
687
|
-
(obj.deviceDomain = message.deviceDomain);
|
|
688
|
-
message.version !== undefined && (obj.version = message.version);
|
|
689
|
-
if (message.ifceIps) {
|
|
690
|
-
obj.ifceIps = message.ifceIps.map((e) => e);
|
|
691
|
-
} else {
|
|
692
|
-
obj.ifceIps = [];
|
|
693
|
-
}
|
|
694
|
-
if (message.listenIps) {
|
|
695
|
-
obj.listenIps = message.listenIps.map((e) => e);
|
|
696
|
-
} else {
|
|
697
|
-
obj.listenIps = [];
|
|
698
|
-
}
|
|
699
|
-
return obj;
|
|
700
|
-
},
|
|
701
|
-
fromPartial(object) {
|
|
702
|
-
const message = createBaseClientInfo();
|
|
703
|
-
message.id = object.id ?? "";
|
|
704
|
-
message.tunIp = object.tunIp ?? "";
|
|
705
|
-
message.localIps = object.localIps?.map((e) => e) || [];
|
|
706
|
-
message.originServer = object.originServer ?? "";
|
|
707
|
-
message.deviceDomain = object.deviceDomain ?? "";
|
|
708
|
-
message.version = object.version ?? "";
|
|
709
|
-
message.ifceIps = object.ifceIps?.map((e) => e) || [];
|
|
710
|
-
message.listenIps = object.listenIps?.map((e) => e) || [];
|
|
711
|
-
return message;
|
|
712
|
-
},
|
|
713
|
-
};
|
|
714
|
-
function createBaseCreateUserRequest() {
|
|
715
|
-
return { boxId: "", user: "", password: "", token: undefined };
|
|
716
|
-
}
|
|
717
|
-
export const CreateUserRequest = {
|
|
718
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
719
|
-
if (message.boxId !== "") {
|
|
720
|
-
writer.uint32(10).string(message.boxId);
|
|
721
|
-
}
|
|
722
|
-
if (message.user !== "") {
|
|
723
|
-
writer.uint32(18).string(message.user);
|
|
724
|
-
}
|
|
725
|
-
if (message.password !== "") {
|
|
726
|
-
writer.uint32(26).string(message.password);
|
|
727
|
-
}
|
|
728
|
-
if (message.token !== undefined) {
|
|
729
|
-
writer.uint32(34).string(message.token);
|
|
730
|
-
}
|
|
731
|
-
return writer;
|
|
732
|
-
},
|
|
733
|
-
decode(input, length) {
|
|
734
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
735
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
736
|
-
const message = createBaseCreateUserRequest();
|
|
737
|
-
while (reader.pos < end) {
|
|
738
|
-
const tag = reader.uint32();
|
|
739
|
-
switch (tag >>> 3) {
|
|
740
|
-
case 1:
|
|
741
|
-
message.boxId = reader.string();
|
|
742
|
-
break;
|
|
743
|
-
case 2:
|
|
744
|
-
message.user = reader.string();
|
|
745
|
-
break;
|
|
746
|
-
case 3:
|
|
747
|
-
message.password = reader.string();
|
|
748
|
-
break;
|
|
749
|
-
case 4:
|
|
750
|
-
message.token = reader.string();
|
|
751
|
-
break;
|
|
752
|
-
default:
|
|
753
|
-
reader.skipType(tag & 7);
|
|
754
|
-
break;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
return message;
|
|
758
|
-
},
|
|
759
|
-
fromJSON(object) {
|
|
760
|
-
return {
|
|
761
|
-
boxId: isSet(object.boxId) ? String(object.boxId) : "",
|
|
762
|
-
user: isSet(object.user) ? String(object.user) : "",
|
|
763
|
-
password: isSet(object.password) ? String(object.password) : "",
|
|
764
|
-
token: isSet(object.token) ? String(object.token) : undefined,
|
|
765
|
-
};
|
|
766
|
-
},
|
|
767
|
-
toJSON(message) {
|
|
768
|
-
const obj = {};
|
|
769
|
-
message.boxId !== undefined && (obj.boxId = message.boxId);
|
|
770
|
-
message.user !== undefined && (obj.user = message.user);
|
|
771
|
-
message.password !== undefined && (obj.password = message.password);
|
|
772
|
-
message.token !== undefined && (obj.token = message.token);
|
|
773
|
-
return obj;
|
|
774
|
-
},
|
|
775
|
-
fromPartial(object) {
|
|
776
|
-
const message = createBaseCreateUserRequest();
|
|
777
|
-
message.boxId = object.boxId ?? "";
|
|
778
|
-
message.user = object.user ?? "";
|
|
779
|
-
message.password = object.password ?? "";
|
|
780
|
-
message.token = object.token ?? undefined;
|
|
781
|
-
return message;
|
|
782
|
-
},
|
|
783
|
-
};
|
|
784
|
-
function createBaseSetupBoxRequest() {
|
|
785
|
-
return { boxId: "", orignServer: "", boxName: "" };
|
|
786
|
-
}
|
|
787
|
-
export const SetupBoxRequest = {
|
|
788
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
789
|
-
if (message.boxId !== "") {
|
|
790
|
-
writer.uint32(10).string(message.boxId);
|
|
791
|
-
}
|
|
792
|
-
if (message.orignServer !== "") {
|
|
793
|
-
writer.uint32(18).string(message.orignServer);
|
|
794
|
-
}
|
|
795
|
-
if (message.boxName !== "") {
|
|
796
|
-
writer.uint32(26).string(message.boxName);
|
|
797
|
-
}
|
|
798
|
-
return writer;
|
|
799
|
-
},
|
|
800
|
-
decode(input, length) {
|
|
801
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
802
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
803
|
-
const message = createBaseSetupBoxRequest();
|
|
804
|
-
while (reader.pos < end) {
|
|
805
|
-
const tag = reader.uint32();
|
|
806
|
-
switch (tag >>> 3) {
|
|
807
|
-
case 1:
|
|
808
|
-
message.boxId = reader.string();
|
|
809
|
-
break;
|
|
810
|
-
case 2:
|
|
811
|
-
message.orignServer = reader.string();
|
|
812
|
-
break;
|
|
813
|
-
case 3:
|
|
814
|
-
message.boxName = reader.string();
|
|
815
|
-
break;
|
|
816
|
-
default:
|
|
817
|
-
reader.skipType(tag & 7);
|
|
818
|
-
break;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
return message;
|
|
822
|
-
},
|
|
823
|
-
fromJSON(object) {
|
|
824
|
-
return {
|
|
825
|
-
boxId: isSet(object.boxId) ? String(object.boxId) : "",
|
|
826
|
-
orignServer: isSet(object.orignServer) ? String(object.orignServer) : "",
|
|
827
|
-
boxName: isSet(object.boxName) ? String(object.boxName) : "",
|
|
828
|
-
};
|
|
829
|
-
},
|
|
830
|
-
toJSON(message) {
|
|
831
|
-
const obj = {};
|
|
832
|
-
message.boxId !== undefined && (obj.boxId = message.boxId);
|
|
833
|
-
message.orignServer !== undefined &&
|
|
834
|
-
(obj.orignServer = message.orignServer);
|
|
835
|
-
message.boxName !== undefined && (obj.boxName = message.boxName);
|
|
836
|
-
return obj;
|
|
837
|
-
},
|
|
838
|
-
fromPartial(object) {
|
|
839
|
-
const message = createBaseSetupBoxRequest();
|
|
840
|
-
message.boxId = object.boxId ?? "";
|
|
841
|
-
message.orignServer = object.orignServer ?? "";
|
|
842
|
-
message.boxName = object.boxName ?? "";
|
|
843
|
-
return message;
|
|
844
|
-
},
|
|
845
|
-
};
|
|
846
|
-
function createBaseSwitchOriginRequest() {
|
|
847
|
-
return { origin: "" };
|
|
848
|
-
}
|
|
849
|
-
export const SwitchOriginRequest = {
|
|
850
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
851
|
-
if (message.origin !== "") {
|
|
852
|
-
writer.uint32(10).string(message.origin);
|
|
853
|
-
}
|
|
854
|
-
return writer;
|
|
855
|
-
},
|
|
856
|
-
decode(input, length) {
|
|
857
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
858
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
859
|
-
const message = createBaseSwitchOriginRequest();
|
|
860
|
-
while (reader.pos < end) {
|
|
861
|
-
const tag = reader.uint32();
|
|
862
|
-
switch (tag >>> 3) {
|
|
863
|
-
case 1:
|
|
864
|
-
message.origin = reader.string();
|
|
865
|
-
break;
|
|
866
|
-
default:
|
|
867
|
-
reader.skipType(tag & 7);
|
|
868
|
-
break;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
return message;
|
|
872
|
-
},
|
|
873
|
-
fromJSON(object) {
|
|
874
|
-
return {
|
|
875
|
-
origin: isSet(object.origin) ? String(object.origin) : "",
|
|
876
|
-
};
|
|
877
|
-
},
|
|
878
|
-
toJSON(message) {
|
|
879
|
-
const obj = {};
|
|
880
|
-
message.origin !== undefined && (obj.origin = message.origin);
|
|
881
|
-
return obj;
|
|
882
|
-
},
|
|
883
|
-
fromPartial(object) {
|
|
884
|
-
const message = createBaseSwitchOriginRequest();
|
|
885
|
-
message.origin = object.origin ?? "";
|
|
886
|
-
return message;
|
|
887
|
-
},
|
|
888
|
-
};
|
|
889
|
-
function createBaseBoxDesc() {
|
|
890
|
-
return { id: "", name: undefined };
|
|
891
|
-
}
|
|
892
|
-
export const BoxDesc = {
|
|
893
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
894
|
-
if (message.id !== "") {
|
|
895
|
-
writer.uint32(10).string(message.id);
|
|
896
|
-
}
|
|
897
|
-
if (message.name !== undefined) {
|
|
898
|
-
writer.uint32(18).string(message.name);
|
|
899
|
-
}
|
|
900
|
-
return writer;
|
|
901
|
-
},
|
|
902
|
-
decode(input, length) {
|
|
903
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
904
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
905
|
-
const message = createBaseBoxDesc();
|
|
906
|
-
while (reader.pos < end) {
|
|
907
|
-
const tag = reader.uint32();
|
|
908
|
-
switch (tag >>> 3) {
|
|
909
|
-
case 1:
|
|
910
|
-
message.id = reader.string();
|
|
911
|
-
break;
|
|
912
|
-
case 2:
|
|
913
|
-
message.name = reader.string();
|
|
914
|
-
break;
|
|
915
|
-
default:
|
|
916
|
-
reader.skipType(tag & 7);
|
|
917
|
-
break;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
return message;
|
|
921
|
-
},
|
|
922
|
-
fromJSON(object) {
|
|
923
|
-
return {
|
|
924
|
-
id: isSet(object.id) ? String(object.id) : "",
|
|
925
|
-
name: isSet(object.name) ? String(object.name) : undefined,
|
|
926
|
-
};
|
|
927
|
-
},
|
|
928
|
-
toJSON(message) {
|
|
929
|
-
const obj = {};
|
|
930
|
-
message.id !== undefined && (obj.id = message.id);
|
|
931
|
-
message.name !== undefined && (obj.name = message.name);
|
|
932
|
-
return obj;
|
|
933
|
-
},
|
|
934
|
-
fromPartial(object) {
|
|
935
|
-
const message = createBaseBoxDesc();
|
|
936
|
-
message.id = object.id ?? "";
|
|
937
|
-
message.name = object.name ?? undefined;
|
|
938
|
-
return message;
|
|
939
|
-
},
|
|
940
|
-
};
|
|
941
|
-
export class ShellCoreClientImpl {
|
|
942
|
-
rpc;
|
|
943
|
-
constructor(rpc) {
|
|
944
|
-
this.rpc = rpc;
|
|
945
|
-
this.ScanBox = this.ScanBox.bind(this);
|
|
946
|
-
this.AddBox = this.AddBox.bind(this);
|
|
947
|
-
this.DelBox = this.DelBox.bind(this);
|
|
948
|
-
this.ModifyBox = this.ModifyBox.bind(this);
|
|
949
|
-
this.QueryBoxList = this.QueryBoxList.bind(this);
|
|
950
|
-
this.CreateUser = this.CreateUser.bind(this);
|
|
951
|
-
this.SetupNewBox = this.SetupNewBox.bind(this);
|
|
952
|
-
this.QueryBoxID = this.QueryBoxID.bind(this);
|
|
953
|
-
this.QueryShellCoreInfo = this.QueryShellCoreInfo.bind(this);
|
|
954
|
-
}
|
|
955
|
-
ScanBox(request, metadata) {
|
|
956
|
-
return this.rpc.invoke(
|
|
957
|
-
ShellCoreScanBoxDesc,
|
|
958
|
-
Empty.fromPartial(request),
|
|
959
|
-
metadata
|
|
960
|
-
);
|
|
961
|
-
}
|
|
962
|
-
AddBox(request, metadata) {
|
|
963
|
-
return this.rpc.unary(
|
|
964
|
-
ShellCoreAddBoxDesc,
|
|
965
|
-
AddBoxRequest.fromPartial(request),
|
|
966
|
-
metadata
|
|
967
|
-
);
|
|
968
|
-
}
|
|
969
|
-
DelBox(request, metadata) {
|
|
970
|
-
return this.rpc.unary(
|
|
971
|
-
ShellCoreDelBoxDesc,
|
|
972
|
-
BoxID.fromPartial(request),
|
|
973
|
-
metadata
|
|
974
|
-
);
|
|
975
|
-
}
|
|
976
|
-
ModifyBox(request, metadata) {
|
|
977
|
-
return this.rpc.unary(
|
|
978
|
-
ShellCoreModifyBoxDesc,
|
|
979
|
-
BoxSetting.fromPartial(request),
|
|
980
|
-
metadata
|
|
981
|
-
);
|
|
982
|
-
}
|
|
983
|
-
QueryBoxList(request, metadata) {
|
|
984
|
-
return this.rpc.unary(
|
|
985
|
-
ShellCoreQueryBoxListDesc,
|
|
986
|
-
Empty.fromPartial(request),
|
|
987
|
-
metadata
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
CreateUser(request, metadata) {
|
|
991
|
-
return this.rpc.unary(
|
|
992
|
-
ShellCoreCreateUserDesc,
|
|
993
|
-
CreateUserRequest.fromPartial(request),
|
|
994
|
-
metadata
|
|
995
|
-
);
|
|
996
|
-
}
|
|
997
|
-
SetupNewBox(request, metadata) {
|
|
998
|
-
return this.rpc.unary(
|
|
999
|
-
ShellCoreSetupNewBoxDesc,
|
|
1000
|
-
SetupBoxRequest.fromPartial(request),
|
|
1001
|
-
metadata
|
|
1002
|
-
);
|
|
1003
|
-
}
|
|
1004
|
-
QueryBoxID(request, metadata) {
|
|
1005
|
-
return this.rpc.unary(
|
|
1006
|
-
ShellCoreQueryBoxIDDesc,
|
|
1007
|
-
BoxName.fromPartial(request),
|
|
1008
|
-
metadata
|
|
1009
|
-
);
|
|
1010
|
-
}
|
|
1011
|
-
QueryShellCoreInfo(request, metadata) {
|
|
1012
|
-
return this.rpc.unary(
|
|
1013
|
-
ShellCoreQueryShellCoreInfoDesc,
|
|
1014
|
-
Empty.fromPartial(request),
|
|
1015
|
-
metadata
|
|
1016
|
-
);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
export const ShellCoreDesc = {
|
|
1020
|
-
serviceName: "space.heiyu.hportal.shell.ShellCore",
|
|
1021
|
-
};
|
|
1022
|
-
export const ShellCoreScanBoxDesc = {
|
|
1023
|
-
methodName: "ScanBox",
|
|
1024
|
-
service: ShellCoreDesc,
|
|
1025
|
-
requestStream: false,
|
|
1026
|
-
responseStream: true,
|
|
1027
|
-
requestType: {
|
|
1028
|
-
serializeBinary() {
|
|
1029
|
-
return Empty.encode(this).finish();
|
|
1030
|
-
},
|
|
1031
|
-
},
|
|
1032
|
-
responseType: {
|
|
1033
|
-
deserializeBinary(data) {
|
|
1034
|
-
return {
|
|
1035
|
-
...BoxDesc.decode(data),
|
|
1036
|
-
toObject() {
|
|
1037
|
-
return this;
|
|
1038
|
-
},
|
|
1039
|
-
};
|
|
1040
|
-
},
|
|
1041
|
-
},
|
|
1042
|
-
};
|
|
1043
|
-
export const ShellCoreAddBoxDesc = {
|
|
1044
|
-
methodName: "AddBox",
|
|
1045
|
-
service: ShellCoreDesc,
|
|
1046
|
-
requestStream: false,
|
|
1047
|
-
responseStream: false,
|
|
1048
|
-
requestType: {
|
|
1049
|
-
serializeBinary() {
|
|
1050
|
-
return AddBoxRequest.encode(this).finish();
|
|
1051
|
-
},
|
|
1052
|
-
},
|
|
1053
|
-
responseType: {
|
|
1054
|
-
deserializeBinary(data) {
|
|
1055
|
-
return {
|
|
1056
|
-
...Empty.decode(data),
|
|
1057
|
-
toObject() {
|
|
1058
|
-
return this;
|
|
1059
|
-
},
|
|
1060
|
-
};
|
|
1061
|
-
},
|
|
1062
|
-
},
|
|
1063
|
-
};
|
|
1064
|
-
export const ShellCoreDelBoxDesc = {
|
|
1065
|
-
methodName: "DelBox",
|
|
1066
|
-
service: ShellCoreDesc,
|
|
1067
|
-
requestStream: false,
|
|
1068
|
-
responseStream: false,
|
|
1069
|
-
requestType: {
|
|
1070
|
-
serializeBinary() {
|
|
1071
|
-
return BoxID.encode(this).finish();
|
|
1072
|
-
},
|
|
1073
|
-
},
|
|
1074
|
-
responseType: {
|
|
1075
|
-
deserializeBinary(data) {
|
|
1076
|
-
return {
|
|
1077
|
-
...Empty.decode(data),
|
|
1078
|
-
toObject() {
|
|
1079
|
-
return this;
|
|
1080
|
-
},
|
|
1081
|
-
};
|
|
1082
|
-
},
|
|
1083
|
-
},
|
|
1084
|
-
};
|
|
1085
|
-
export const ShellCoreModifyBoxDesc = {
|
|
1086
|
-
methodName: "ModifyBox",
|
|
1087
|
-
service: ShellCoreDesc,
|
|
1088
|
-
requestStream: false,
|
|
1089
|
-
responseStream: false,
|
|
1090
|
-
requestType: {
|
|
1091
|
-
serializeBinary() {
|
|
1092
|
-
return BoxSetting.encode(this).finish();
|
|
1093
|
-
},
|
|
1094
|
-
},
|
|
1095
|
-
responseType: {
|
|
1096
|
-
deserializeBinary(data) {
|
|
1097
|
-
return {
|
|
1098
|
-
...Empty.decode(data),
|
|
1099
|
-
toObject() {
|
|
1100
|
-
return this;
|
|
1101
|
-
},
|
|
1102
|
-
};
|
|
1103
|
-
},
|
|
1104
|
-
},
|
|
1105
|
-
};
|
|
1106
|
-
export const ShellCoreQueryBoxListDesc = {
|
|
1107
|
-
methodName: "QueryBoxList",
|
|
1108
|
-
service: ShellCoreDesc,
|
|
1109
|
-
requestStream: false,
|
|
1110
|
-
responseStream: false,
|
|
1111
|
-
requestType: {
|
|
1112
|
-
serializeBinary() {
|
|
1113
|
-
return Empty.encode(this).finish();
|
|
1114
|
-
},
|
|
1115
|
-
},
|
|
1116
|
-
responseType: {
|
|
1117
|
-
deserializeBinary(data) {
|
|
1118
|
-
return {
|
|
1119
|
-
...BoxList.decode(data),
|
|
1120
|
-
toObject() {
|
|
1121
|
-
return this;
|
|
1122
|
-
},
|
|
1123
|
-
};
|
|
1124
|
-
},
|
|
1125
|
-
},
|
|
1126
|
-
};
|
|
1127
|
-
export const ShellCoreCreateUserDesc = {
|
|
1128
|
-
methodName: "CreateUser",
|
|
1129
|
-
service: ShellCoreDesc,
|
|
1130
|
-
requestStream: false,
|
|
1131
|
-
responseStream: false,
|
|
1132
|
-
requestType: {
|
|
1133
|
-
serializeBinary() {
|
|
1134
|
-
return CreateUserRequest.encode(this).finish();
|
|
1135
|
-
},
|
|
1136
|
-
},
|
|
1137
|
-
responseType: {
|
|
1138
|
-
deserializeBinary(data) {
|
|
1139
|
-
return {
|
|
1140
|
-
...Empty.decode(data),
|
|
1141
|
-
toObject() {
|
|
1142
|
-
return this;
|
|
1143
|
-
},
|
|
1144
|
-
};
|
|
1145
|
-
},
|
|
1146
|
-
},
|
|
1147
|
-
};
|
|
1148
|
-
export const ShellCoreSetupNewBoxDesc = {
|
|
1149
|
-
methodName: "SetupNewBox",
|
|
1150
|
-
service: ShellCoreDesc,
|
|
1151
|
-
requestStream: false,
|
|
1152
|
-
responseStream: false,
|
|
1153
|
-
requestType: {
|
|
1154
|
-
serializeBinary() {
|
|
1155
|
-
return SetupBoxRequest.encode(this).finish();
|
|
1156
|
-
},
|
|
1157
|
-
},
|
|
1158
|
-
responseType: {
|
|
1159
|
-
deserializeBinary(data) {
|
|
1160
|
-
return {
|
|
1161
|
-
...Empty.decode(data),
|
|
1162
|
-
toObject() {
|
|
1163
|
-
return this;
|
|
1164
|
-
},
|
|
1165
|
-
};
|
|
1166
|
-
},
|
|
1167
|
-
},
|
|
1168
|
-
};
|
|
1169
|
-
export const ShellCoreQueryBoxIDDesc = {
|
|
1170
|
-
methodName: "QueryBoxID",
|
|
1171
|
-
service: ShellCoreDesc,
|
|
1172
|
-
requestStream: false,
|
|
1173
|
-
responseStream: false,
|
|
1174
|
-
requestType: {
|
|
1175
|
-
serializeBinary() {
|
|
1176
|
-
return BoxName.encode(this).finish();
|
|
1177
|
-
},
|
|
1178
|
-
},
|
|
1179
|
-
responseType: {
|
|
1180
|
-
deserializeBinary(data) {
|
|
1181
|
-
return {
|
|
1182
|
-
...BoxID.decode(data),
|
|
1183
|
-
toObject() {
|
|
1184
|
-
return this;
|
|
1185
|
-
},
|
|
1186
|
-
};
|
|
1187
|
-
},
|
|
1188
|
-
},
|
|
1189
|
-
};
|
|
1190
|
-
export const ShellCoreQueryShellCoreInfoDesc = {
|
|
1191
|
-
methodName: "QueryShellCoreInfo",
|
|
1192
|
-
service: ShellCoreDesc,
|
|
1193
|
-
requestStream: false,
|
|
1194
|
-
responseStream: false,
|
|
1195
|
-
requestType: {
|
|
1196
|
-
serializeBinary() {
|
|
1197
|
-
return Empty.encode(this).finish();
|
|
1198
|
-
},
|
|
1199
|
-
},
|
|
1200
|
-
responseType: {
|
|
1201
|
-
deserializeBinary(data) {
|
|
1202
|
-
return {
|
|
1203
|
-
...ClientInfo.decode(data),
|
|
1204
|
-
toObject() {
|
|
1205
|
-
return this;
|
|
1206
|
-
},
|
|
1207
|
-
};
|
|
1208
|
-
},
|
|
1209
|
-
},
|
|
1210
|
-
};
|
|
1211
|
-
export class GrpcWebImpl {
|
|
1212
|
-
host;
|
|
1213
|
-
options;
|
|
1214
|
-
constructor(host, options) {
|
|
1215
|
-
this.host = host;
|
|
1216
|
-
this.options = options;
|
|
1217
|
-
}
|
|
1218
|
-
unary(methodDesc, _request, metadata) {
|
|
1219
|
-
const request = { ..._request, ...methodDesc.requestType };
|
|
1220
|
-
const maybeCombinedMetadata =
|
|
1221
|
-
metadata && this.options.metadata
|
|
1222
|
-
? new BrowserHeaders({
|
|
1223
|
-
...this.options?.metadata.headersMap,
|
|
1224
|
-
...metadata?.headersMap,
|
|
1225
|
-
})
|
|
1226
|
-
: metadata || this.options.metadata;
|
|
1227
|
-
return new Promise((resolve, reject) => {
|
|
1228
|
-
grpc.unary(methodDesc, {
|
|
1229
|
-
request,
|
|
1230
|
-
host: this.host,
|
|
1231
|
-
metadata: maybeCombinedMetadata,
|
|
1232
|
-
transport: this.options.transport,
|
|
1233
|
-
debug: this.options.debug,
|
|
1234
|
-
onEnd: function (response) {
|
|
1235
|
-
if (response.status === grpc.Code.OK) {
|
|
1236
|
-
resolve(response.message);
|
|
1237
|
-
} else {
|
|
1238
|
-
const err = new Error(response.statusMessage);
|
|
1239
|
-
err.code = response.status;
|
|
1240
|
-
err.metadata = response.trailers;
|
|
1241
|
-
reject(err);
|
|
1242
|
-
}
|
|
1243
|
-
},
|
|
1244
|
-
});
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
invoke(methodDesc, _request, metadata) {
|
|
1248
|
-
const upStreamCodes = this.options.upStreamRetryCodes || [];
|
|
1249
|
-
const DEFAULT_TIMEOUT_TIME = 3000;
|
|
1250
|
-
const request = { ..._request, ...methodDesc.requestType };
|
|
1251
|
-
const maybeCombinedMetadata =
|
|
1252
|
-
metadata && this.options.metadata
|
|
1253
|
-
? new BrowserHeaders({
|
|
1254
|
-
...this.options?.metadata.headersMap,
|
|
1255
|
-
...metadata?.headersMap,
|
|
1256
|
-
})
|
|
1257
|
-
: metadata || this.options.metadata;
|
|
1258
|
-
return new Observable((observer) => {
|
|
1259
|
-
const upStream = () => {
|
|
1260
|
-
const client = grpc.invoke(methodDesc, {
|
|
1261
|
-
host: this.host,
|
|
1262
|
-
request,
|
|
1263
|
-
transport: this.options.streamingTransport || this.options.transport,
|
|
1264
|
-
metadata: maybeCombinedMetadata,
|
|
1265
|
-
debug: this.options.debug,
|
|
1266
|
-
onMessage: (next) => observer.next(next),
|
|
1267
|
-
onEnd: (code, message) => {
|
|
1268
|
-
if (code === 0) {
|
|
1269
|
-
observer.complete();
|
|
1270
|
-
} else if (upStreamCodes.includes(code)) {
|
|
1271
|
-
setTimeout(upStream, DEFAULT_TIMEOUT_TIME);
|
|
1272
|
-
} else {
|
|
1273
|
-
observer.error(new Error(`Error ${code} ${message}`));
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
});
|
|
1277
|
-
observer.add(() => client.close());
|
|
1278
|
-
};
|
|
1279
|
-
upStream();
|
|
1280
|
-
}).pipe(share());
|
|
1281
|
-
}
|
|
1282
|
-
stream(methodDesc, _request, metadata, rpcOptions) {
|
|
1283
|
-
const defaultOptions = {
|
|
1284
|
-
host: this.host,
|
|
1285
|
-
debug: rpcOptions?.debug || this.options.debug,
|
|
1286
|
-
transport:
|
|
1287
|
-
rpcOptions?.transport ||
|
|
1288
|
-
this.options.streamingTransport ||
|
|
1289
|
-
this.options.transport,
|
|
1290
|
-
};
|
|
1291
|
-
let started = false;
|
|
1292
|
-
const client = grpc.client(methodDesc, defaultOptions);
|
|
1293
|
-
const subscription = _request.subscribe((_req) => {
|
|
1294
|
-
const request = { ..._req, ...methodDesc.requestType };
|
|
1295
|
-
if (!started) {
|
|
1296
|
-
client.start(metadata);
|
|
1297
|
-
started = true;
|
|
1298
|
-
}
|
|
1299
|
-
client.send(request);
|
|
1300
|
-
});
|
|
1301
|
-
subscription.add(() => {
|
|
1302
|
-
client.finishSend();
|
|
1303
|
-
});
|
|
1304
|
-
return new Observable((observer) => {
|
|
1305
|
-
client.onEnd((code, message, trailers) => {
|
|
1306
|
-
subscription.unsubscribe();
|
|
1307
|
-
if (code === 0) {
|
|
1308
|
-
observer.complete();
|
|
1309
|
-
} else {
|
|
1310
|
-
observer.error(new Error(`Error ${code} ${message}`));
|
|
1311
|
-
}
|
|
1312
|
-
});
|
|
1313
|
-
client.onMessage((res) => {
|
|
1314
|
-
observer.next(res);
|
|
1315
|
-
});
|
|
1316
|
-
observer.add(() => client.close());
|
|
1317
|
-
}).pipe(share());
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
function isSet(value) {
|
|
1321
|
-
return value !== null && value !== undefined;
|
|
1322
|
-
}
|