@lazycatcloud/sdk 0.1.296 → 0.1.298

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.
Files changed (184) hide show
  1. package/dist/common/apk_shell.d.ts +3 -2
  2. package/dist/common/apk_shell.d.ts.map +1 -1
  3. package/dist/common/apk_shell.js +67 -54
  4. package/dist/common/apk_shell.js.map +1 -1
  5. package/dist/common/box.d.ts +3 -2
  6. package/dist/common/box.d.ts.map +1 -1
  7. package/dist/common/box.js +113 -134
  8. package/dist/common/box.js.map +1 -1
  9. package/dist/common/browseronly.d.ts +3 -2
  10. package/dist/common/browseronly.d.ts.map +1 -1
  11. package/dist/common/browseronly.js +91 -86
  12. package/dist/common/browseronly.js.map +1 -1
  13. package/dist/common/end_device.d.ts +3 -2
  14. package/dist/common/end_device.d.ts.map +1 -1
  15. package/dist/common/end_device.js +112 -115
  16. package/dist/common/end_device.js.map +1 -1
  17. package/dist/common/file_handler.d.ts +3 -2
  18. package/dist/common/file_handler.d.ts.map +1 -1
  19. package/dist/common/file_handler.js +162 -195
  20. package/dist/common/file_handler.js.map +1 -1
  21. package/dist/common/filetrans.d.ts +3 -2
  22. package/dist/common/filetrans.d.ts.map +1 -1
  23. package/dist/common/filetrans.js +273 -355
  24. package/dist/common/filetrans.js.map +1 -1
  25. package/dist/common/gateway.d.ts +3 -2
  26. package/dist/common/gateway.d.ts.map +1 -1
  27. package/dist/common/gateway.js +79 -87
  28. package/dist/common/gateway.js.map +1 -1
  29. package/dist/common/media_meta.d.ts +3 -2
  30. package/dist/common/media_meta.d.ts.map +1 -1
  31. package/dist/common/media_meta.js +90 -81
  32. package/dist/common/media_meta.js.map +1 -1
  33. package/dist/common/message.d.ts +3 -2
  34. package/dist/common/message.d.ts.map +1 -1
  35. package/dist/common/message.js +128 -141
  36. package/dist/common/message.js.map +1 -1
  37. package/dist/common/peripheral_device.d.ts +3 -2
  38. package/dist/common/peripheral_device.d.ts.map +1 -1
  39. package/dist/common/peripheral_device.js +124 -128
  40. package/dist/common/peripheral_device.js.map +1 -1
  41. package/dist/common/security_context.d.ts +3 -2
  42. package/dist/common/security_context.d.ts.map +1 -1
  43. package/dist/common/security_context.js +75 -69
  44. package/dist/common/security_context.js.map +1 -1
  45. package/dist/common/users.d.ts +3 -2
  46. package/dist/common/users.d.ts.map +1 -1
  47. package/dist/common/users.js +117 -133
  48. package/dist/common/users.js.map +1 -1
  49. package/dist/dlna/dlna.d.ts +3 -2
  50. package/dist/dlna/dlna.d.ts.map +1 -1
  51. package/dist/dlna/dlna.js +129 -144
  52. package/dist/dlna/dlna.js.map +1 -1
  53. package/dist/extentions/app_common.d.ts +3 -3
  54. package/dist/extentions/app_common.d.ts.map +1 -1
  55. package/dist/extentions/app_common.js +6 -6
  56. package/dist/extentions/app_common.js.map +1 -1
  57. package/dist/google/protobuf/descriptor.d.ts.map +1 -1
  58. package/dist/google/protobuf/descriptor.js +607 -724
  59. package/dist/google/protobuf/descriptor.js.map +1 -1
  60. package/dist/google/protobuf/empty.d.ts.map +1 -1
  61. package/dist/google/protobuf/empty.js +1 -1
  62. package/dist/google/protobuf/empty.js.map +1 -1
  63. package/dist/google/protobuf/timestamp.d.ts.map +1 -1
  64. package/dist/google/protobuf/timestamp.js +24 -13
  65. package/dist/google/protobuf/timestamp.js.map +1 -1
  66. package/dist/lanforward/lanforward.d.ts +99 -0
  67. package/dist/lanforward/lanforward.d.ts.map +1 -0
  68. package/dist/lanforward/lanforward.js +254 -0
  69. package/dist/lanforward/lanforward.js.map +1 -0
  70. package/dist/localdevice/client.d.ts +3 -2
  71. package/dist/localdevice/client.d.ts.map +1 -1
  72. package/dist/localdevice/client.js +40 -22
  73. package/dist/localdevice/client.js.map +1 -1
  74. package/dist/localdevice/clipboard.d.ts +3 -2
  75. package/dist/localdevice/clipboard.d.ts.map +1 -1
  76. package/dist/localdevice/clipboard.js +89 -74
  77. package/dist/localdevice/clipboard.js.map +1 -1
  78. package/dist/localdevice/config.d.ts +3 -2
  79. package/dist/localdevice/config.d.ts.map +1 -1
  80. package/dist/localdevice/config.js +65 -63
  81. package/dist/localdevice/config.js.map +1 -1
  82. package/dist/localdevice/device.d.ts +4 -2
  83. package/dist/localdevice/device.d.ts.map +1 -1
  84. package/dist/localdevice/device.js +47 -35
  85. package/dist/localdevice/device.js.map +1 -1
  86. package/dist/localdevice/dialog.d.ts +3 -2
  87. package/dist/localdevice/dialog.d.ts.map +1 -1
  88. package/dist/localdevice/dialog.js +83 -85
  89. package/dist/localdevice/dialog.js.map +1 -1
  90. package/dist/localdevice/local-launch.d.ts +3 -2
  91. package/dist/localdevice/local-launch.d.ts.map +1 -1
  92. package/dist/localdevice/local-launch.js +90 -96
  93. package/dist/localdevice/local-launch.js.map +1 -1
  94. package/dist/localdevice/network.d.ts +3 -2
  95. package/dist/localdevice/network.d.ts.map +1 -1
  96. package/dist/localdevice/network.js +37 -19
  97. package/dist/localdevice/network.js.map +1 -1
  98. package/dist/localdevice/permission.d.ts +3 -2
  99. package/dist/localdevice/permission.d.ts.map +1 -1
  100. package/dist/localdevice/permission.js +88 -84
  101. package/dist/localdevice/permission.js.map +1 -1
  102. package/dist/localdevice/photo.d.ts +3 -2
  103. package/dist/localdevice/photo.d.ts.map +1 -1
  104. package/dist/localdevice/photo.js +280 -348
  105. package/dist/localdevice/photo.js.map +1 -1
  106. package/dist/localdevice/remote-input-method.d.ts +3 -2
  107. package/dist/localdevice/remote-input-method.d.ts.map +1 -1
  108. package/dist/localdevice/remote-input-method.js +69 -52
  109. package/dist/localdevice/remote-input-method.js.map +1 -1
  110. package/dist/package.json +1 -1
  111. package/dist/ssdp/ssdp.d.ts +113 -0
  112. package/dist/ssdp/ssdp.d.ts.map +1 -0
  113. package/dist/ssdp/ssdp.js +292 -0
  114. package/dist/ssdp/ssdp.js.map +1 -0
  115. package/dist/sys/OS_daemon.d.ts +111 -0
  116. package/dist/sys/OS_daemon.d.ts.map +1 -0
  117. package/dist/sys/OS_daemon.js +281 -0
  118. package/dist/sys/OS_daemon.js.map +1 -0
  119. package/dist/sys/OS_snapshot.d.ts +3 -2
  120. package/dist/sys/OS_snapshot.d.ts.map +1 -1
  121. package/dist/sys/OS_snapshot.js +147 -177
  122. package/dist/sys/OS_snapshot.js.map +1 -1
  123. package/dist/sys/OS_upgrader.d.ts +3 -2
  124. package/dist/sys/OS_upgrader.d.ts.map +1 -1
  125. package/dist/sys/OS_upgrader.js +70 -66
  126. package/dist/sys/OS_upgrader.js.map +1 -1
  127. package/dist/sys/box-status.d.ts +572 -0
  128. package/dist/sys/box-status.d.ts.map +1 -0
  129. package/dist/sys/box-status.js +911 -0
  130. package/dist/sys/box-status.js.map +1 -0
  131. package/dist/sys/btled.d.ts +3 -2
  132. package/dist/sys/btled.d.ts.map +1 -1
  133. package/dist/sys/btled.js +80 -70
  134. package/dist/sys/btled.js.map +1 -1
  135. package/dist/sys/btrfs.d.ts +3 -2
  136. package/dist/sys/btrfs.d.ts.map +1 -1
  137. package/dist/sys/btrfs.js +76 -80
  138. package/dist/sys/btrfs.js.map +1 -1
  139. package/dist/sys/devopt.d.ts +3 -2
  140. package/dist/sys/devopt.d.ts.map +1 -1
  141. package/dist/sys/devopt.js +58 -52
  142. package/dist/sys/devopt.js.map +1 -1
  143. package/dist/sys/dirmon.d.ts +3 -2
  144. package/dist/sys/dirmon.d.ts.map +1 -1
  145. package/dist/sys/dirmon.js +61 -41
  146. package/dist/sys/dirmon.js.map +1 -1
  147. package/dist/sys/event.d.ts +3 -2
  148. package/dist/sys/event.d.ts.map +1 -1
  149. package/dist/sys/event.js +87 -82
  150. package/dist/sys/event.js.map +1 -1
  151. package/dist/sys/hc-core/hc-core.d.ts +3 -2
  152. package/dist/sys/hc-core/hc-core.d.ts.map +1 -1
  153. package/dist/sys/hc-core/hc-core.js +134 -155
  154. package/dist/sys/hc-core/hc-core.js.map +1 -1
  155. package/dist/sys/ingress.d.ts +3 -2
  156. package/dist/sys/ingress.d.ts.map +1 -1
  157. package/dist/sys/ingress.js +58 -44
  158. package/dist/sys/ingress.js.map +1 -1
  159. package/dist/sys/installer.d.ts +3 -2
  160. package/dist/sys/installer.d.ts.map +1 -1
  161. package/dist/sys/installer.js +101 -99
  162. package/dist/sys/installer.js.map +1 -1
  163. package/dist/sys/network_manager.d.ts +3 -2
  164. package/dist/sys/network_manager.d.ts.map +1 -1
  165. package/dist/sys/network_manager.js +117 -144
  166. package/dist/sys/network_manager.js.map +1 -1
  167. package/dist/sys/package_manager.d.ts +3 -2
  168. package/dist/sys/package_manager.d.ts.map +1 -1
  169. package/dist/sys/package_manager.js +230 -313
  170. package/dist/sys/package_manager.js.map +1 -1
  171. package/dist/sys/portal-server/portal-server.d.ts +3 -2
  172. package/dist/sys/portal-server/portal-server.d.ts.map +1 -1
  173. package/dist/sys/portal-server/portal-server.js +270 -358
  174. package/dist/sys/portal-server/portal-server.js.map +1 -1
  175. package/dist/sys/snapd.d.ts +3 -2
  176. package/dist/sys/snapd.d.ts.map +1 -1
  177. package/dist/sys/snapd.js +88 -88
  178. package/dist/sys/snapd.js.map +1 -1
  179. package/dist/sys/version.d.ts +3 -2
  180. package/dist/sys/version.d.ts.map +1 -1
  181. package/dist/sys/version.js +35 -15
  182. package/dist/sys/version.js.map +1 -1
  183. package/dist/tsconfig.tsbuildinfo +1 -1
  184. package/package.json +1 -1
@@ -206,49 +206,49 @@ exports.RegisterBoxServiceRequest = {
206
206
  const tag = reader.uint32();
207
207
  switch (tag >>> 3) {
208
208
  case 1:
209
- if (tag !== 10) {
209
+ if (tag != 10) {
210
210
  break;
211
211
  }
212
212
  message.serviceName = reader.string();
213
213
  continue;
214
214
  case 2:
215
- if (tag !== 18) {
215
+ if (tag != 18) {
216
216
  break;
217
217
  }
218
218
  message.serviceNetwork = reader.string();
219
219
  continue;
220
220
  case 3:
221
- if (tag !== 26) {
221
+ if (tag != 26) {
222
222
  break;
223
223
  }
224
224
  message.serviceAddress = reader.string();
225
225
  continue;
226
226
  case 4:
227
- if (tag !== 34) {
227
+ if (tag != 34) {
228
228
  break;
229
229
  }
230
230
  message.description = reader.string();
231
231
  continue;
232
232
  case 6:
233
- if (tag !== 50) {
233
+ if (tag != 50) {
234
234
  break;
235
235
  }
236
236
  message.extraInfo = reader.string();
237
237
  continue;
238
238
  case 7:
239
- if (tag !== 56) {
239
+ if (tag != 56) {
240
240
  break;
241
241
  }
242
242
  message.requireDialerRole = reader.int32();
243
243
  continue;
244
244
  case 8:
245
- if (tag !== 64) {
245
+ if (tag != 64) {
246
246
  break;
247
247
  }
248
248
  message.requireTrustDev = reader.bool();
249
249
  continue;
250
250
  }
251
- if ((tag & 7) === 4 || tag === 0) {
251
+ if ((tag & 7) == 4 || tag == 0) {
252
252
  break;
253
253
  }
254
254
  reader.skipType(tag & 7);
@@ -257,38 +257,24 @@ exports.RegisterBoxServiceRequest = {
257
257
  },
258
258
  fromJSON(object) {
259
259
  return {
260
- serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
261
- serviceNetwork: isSet(object.serviceNetwork) ? globalThis.String(object.serviceNetwork) : "",
262
- serviceAddress: isSet(object.serviceAddress) ? globalThis.String(object.serviceAddress) : "",
263
- description: isSet(object.description) ? globalThis.String(object.description) : "",
264
- extraInfo: isSet(object.extraInfo) ? globalThis.String(object.extraInfo) : "",
260
+ serviceName: isSet(object.serviceName) ? String(object.serviceName) : "",
261
+ serviceNetwork: isSet(object.serviceNetwork) ? String(object.serviceNetwork) : "",
262
+ serviceAddress: isSet(object.serviceAddress) ? String(object.serviceAddress) : "",
263
+ description: isSet(object.description) ? String(object.description) : "",
264
+ extraInfo: isSet(object.extraInfo) ? String(object.extraInfo) : "",
265
265
  requireDialerRole: isSet(object.requireDialerRole) ? dialerRoleFromJSON(object.requireDialerRole) : 0,
266
- requireTrustDev: isSet(object.requireTrustDev) ? globalThis.Boolean(object.requireTrustDev) : false,
266
+ requireTrustDev: isSet(object.requireTrustDev) ? Boolean(object.requireTrustDev) : false,
267
267
  };
268
268
  },
269
269
  toJSON(message) {
270
270
  const obj = {};
271
- if (message.serviceName !== "") {
272
- obj.serviceName = message.serviceName;
273
- }
274
- if (message.serviceNetwork !== "") {
275
- obj.serviceNetwork = message.serviceNetwork;
276
- }
277
- if (message.serviceAddress !== "") {
278
- obj.serviceAddress = message.serviceAddress;
279
- }
280
- if (message.description !== "") {
281
- obj.description = message.description;
282
- }
283
- if (message.extraInfo !== "") {
284
- obj.extraInfo = message.extraInfo;
285
- }
286
- if (message.requireDialerRole !== 0) {
287
- obj.requireDialerRole = dialerRoleToJSON(message.requireDialerRole);
288
- }
289
- if (message.requireTrustDev === true) {
290
- obj.requireTrustDev = message.requireTrustDev;
291
- }
271
+ message.serviceName !== undefined && (obj.serviceName = message.serviceName);
272
+ message.serviceNetwork !== undefined && (obj.serviceNetwork = message.serviceNetwork);
273
+ message.serviceAddress !== undefined && (obj.serviceAddress = message.serviceAddress);
274
+ message.description !== undefined && (obj.description = message.description);
275
+ message.extraInfo !== undefined && (obj.extraInfo = message.extraInfo);
276
+ message.requireDialerRole !== undefined && (obj.requireDialerRole = dialerRoleToJSON(message.requireDialerRole));
277
+ message.requireTrustDev !== undefined && (obj.requireTrustDev = message.requireTrustDev);
292
278
  return obj;
293
279
  },
294
280
  create(base) {
@@ -322,7 +308,7 @@ exports.RegisterBoxServiceReply = {
322
308
  const tag = reader.uint32();
323
309
  switch (tag >>> 3) {
324
310
  }
325
- if ((tag & 7) === 4 || tag === 0) {
311
+ if ((tag & 7) == 4 || tag == 0) {
326
312
  break;
327
313
  }
328
314
  reader.skipType(tag & 7);
@@ -362,13 +348,13 @@ exports.EmitBoxServiceChangedRequest = {
362
348
  const tag = reader.uint32();
363
349
  switch (tag >>> 3) {
364
350
  case 1:
365
- if (tag !== 10) {
351
+ if (tag != 10) {
366
352
  break;
367
353
  }
368
354
  message.serviceName = reader.string();
369
355
  continue;
370
356
  }
371
- if ((tag & 7) === 4 || tag === 0) {
357
+ if ((tag & 7) == 4 || tag == 0) {
372
358
  break;
373
359
  }
374
360
  reader.skipType(tag & 7);
@@ -376,13 +362,11 @@ exports.EmitBoxServiceChangedRequest = {
376
362
  return message;
377
363
  },
378
364
  fromJSON(object) {
379
- return { serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "" };
365
+ return { serviceName: isSet(object.serviceName) ? String(object.serviceName) : "" };
380
366
  },
381
367
  toJSON(message) {
382
368
  const obj = {};
383
- if (message.serviceName !== "") {
384
- obj.serviceName = message.serviceName;
385
- }
369
+ message.serviceName !== undefined && (obj.serviceName = message.serviceName);
386
370
  return obj;
387
371
  },
388
372
  create(base) {
@@ -419,25 +403,25 @@ exports.QueryBoxServicePeerCredRequest = {
419
403
  const tag = reader.uint32();
420
404
  switch (tag >>> 3) {
421
405
  case 1:
422
- if (tag !== 10) {
406
+ if (tag != 10) {
423
407
  break;
424
408
  }
425
409
  message.remoteAddr = reader.string();
426
410
  continue;
427
411
  case 2:
428
- if (tag !== 18) {
412
+ if (tag != 18) {
429
413
  break;
430
414
  }
431
415
  message.localAddr = reader.string();
432
416
  continue;
433
417
  case 3:
434
- if (tag !== 26) {
418
+ if (tag != 26) {
435
419
  break;
436
420
  }
437
421
  message.protocol = reader.string();
438
422
  continue;
439
423
  }
440
- if ((tag & 7) === 4 || tag === 0) {
424
+ if ((tag & 7) == 4 || tag == 0) {
441
425
  break;
442
426
  }
443
427
  reader.skipType(tag & 7);
@@ -446,22 +430,16 @@ exports.QueryBoxServicePeerCredRequest = {
446
430
  },
447
431
  fromJSON(object) {
448
432
  return {
449
- remoteAddr: isSet(object.remoteAddr) ? globalThis.String(object.remoteAddr) : "",
450
- localAddr: isSet(object.localAddr) ? globalThis.String(object.localAddr) : "",
451
- protocol: isSet(object.protocol) ? globalThis.String(object.protocol) : "",
433
+ remoteAddr: isSet(object.remoteAddr) ? String(object.remoteAddr) : "",
434
+ localAddr: isSet(object.localAddr) ? String(object.localAddr) : "",
435
+ protocol: isSet(object.protocol) ? String(object.protocol) : "",
452
436
  };
453
437
  },
454
438
  toJSON(message) {
455
439
  const obj = {};
456
- if (message.remoteAddr !== "") {
457
- obj.remoteAddr = message.remoteAddr;
458
- }
459
- if (message.localAddr !== "") {
460
- obj.localAddr = message.localAddr;
461
- }
462
- if (message.protocol !== "") {
463
- obj.protocol = message.protocol;
464
- }
440
+ message.remoteAddr !== undefined && (obj.remoteAddr = message.remoteAddr);
441
+ message.localAddr !== undefined && (obj.localAddr = message.localAddr);
442
+ message.protocol !== undefined && (obj.protocol = message.protocol);
465
443
  return obj;
466
444
  },
467
445
  create(base) {
@@ -509,43 +487,43 @@ exports.QueryBoxServicePeerCredResponse = {
509
487
  const tag = reader.uint32();
510
488
  switch (tag >>> 3) {
511
489
  case 1:
512
- if (tag !== 10) {
490
+ if (tag != 10) {
513
491
  break;
514
492
  }
515
493
  message.uid = reader.string();
516
494
  continue;
517
495
  case 3:
518
- if (tag !== 26) {
496
+ if (tag != 26) {
519
497
  break;
520
498
  }
521
499
  message.deviceVersion = reader.string();
522
500
  continue;
523
501
  case 4:
524
- if (tag !== 34) {
502
+ if (tag != 34) {
525
503
  break;
526
504
  }
527
505
  message.virtualIp = reader.string();
528
506
  continue;
529
507
  case 5:
530
- if (tag !== 42) {
508
+ if (tag != 42) {
531
509
  break;
532
510
  }
533
511
  message.peerId = reader.string();
534
512
  continue;
535
513
  case 6:
536
- if (tag !== 48) {
514
+ if (tag != 48) {
537
515
  break;
538
516
  }
539
517
  message.isLogined = reader.bool();
540
518
  continue;
541
519
  case 7:
542
- if (tag !== 56) {
520
+ if (tag != 56) {
543
521
  break;
544
522
  }
545
523
  message.isTrustDev = reader.bool();
546
524
  continue;
547
525
  }
548
- if ((tag & 7) === 4 || tag === 0) {
526
+ if ((tag & 7) == 4 || tag == 0) {
549
527
  break;
550
528
  }
551
529
  reader.skipType(tag & 7);
@@ -554,34 +532,22 @@ exports.QueryBoxServicePeerCredResponse = {
554
532
  },
555
533
  fromJSON(object) {
556
534
  return {
557
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
558
- deviceVersion: isSet(object.deviceVersion) ? globalThis.String(object.deviceVersion) : "",
559
- virtualIp: isSet(object.virtualIp) ? globalThis.String(object.virtualIp) : "",
560
- peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "",
561
- isLogined: isSet(object.isLogined) ? globalThis.Boolean(object.isLogined) : false,
562
- isTrustDev: isSet(object.isTrustDev) ? globalThis.Boolean(object.isTrustDev) : false,
535
+ uid: isSet(object.uid) ? String(object.uid) : "",
536
+ deviceVersion: isSet(object.deviceVersion) ? String(object.deviceVersion) : "",
537
+ virtualIp: isSet(object.virtualIp) ? String(object.virtualIp) : "",
538
+ peerId: isSet(object.peerId) ? String(object.peerId) : "",
539
+ isLogined: isSet(object.isLogined) ? Boolean(object.isLogined) : false,
540
+ isTrustDev: isSet(object.isTrustDev) ? Boolean(object.isTrustDev) : false,
563
541
  };
564
542
  },
565
543
  toJSON(message) {
566
544
  const obj = {};
567
- if (message.uid !== "") {
568
- obj.uid = message.uid;
569
- }
570
- if (message.deviceVersion !== "") {
571
- obj.deviceVersion = message.deviceVersion;
572
- }
573
- if (message.virtualIp !== "") {
574
- obj.virtualIp = message.virtualIp;
575
- }
576
- if (message.peerId !== "") {
577
- obj.peerId = message.peerId;
578
- }
579
- if (message.isLogined === true) {
580
- obj.isLogined = message.isLogined;
581
- }
582
- if (message.isTrustDev === true) {
583
- obj.isTrustDev = message.isTrustDev;
584
- }
545
+ message.uid !== undefined && (obj.uid = message.uid);
546
+ message.deviceVersion !== undefined && (obj.deviceVersion = message.deviceVersion);
547
+ message.virtualIp !== undefined && (obj.virtualIp = message.virtualIp);
548
+ message.peerId !== undefined && (obj.peerId = message.peerId);
549
+ message.isLogined !== undefined && (obj.isLogined = message.isLogined);
550
+ message.isTrustDev !== undefined && (obj.isTrustDev = message.isTrustDev);
585
551
  return obj;
586
552
  },
587
553
  create(base) {
@@ -620,19 +586,19 @@ exports.RemoteSocksRequest = {
620
586
  const tag = reader.uint32();
621
587
  switch (tag >>> 3) {
622
588
  case 1:
623
- if (tag !== 8) {
589
+ if (tag != 8) {
624
590
  break;
625
591
  }
626
592
  message.locationType = reader.int32();
627
593
  continue;
628
594
  case 2:
629
- if (tag !== 18) {
595
+ if (tag != 18) {
630
596
  break;
631
597
  }
632
598
  message.target = reader.string();
633
599
  continue;
634
600
  }
635
- if ((tag & 7) === 4 || tag === 0) {
601
+ if ((tag & 7) == 4 || tag == 0) {
636
602
  break;
637
603
  }
638
604
  reader.skipType(tag & 7);
@@ -642,17 +608,14 @@ exports.RemoteSocksRequest = {
642
608
  fromJSON(object) {
643
609
  return {
644
610
  locationType: isSet(object.locationType) ? remoteSocksRequest_LocationTypeFromJSON(object.locationType) : 0,
645
- target: isSet(object.target) ? globalThis.String(object.target) : "",
611
+ target: isSet(object.target) ? String(object.target) : "",
646
612
  };
647
613
  },
648
614
  toJSON(message) {
649
615
  const obj = {};
650
- if (message.locationType !== 0) {
651
- obj.locationType = remoteSocksRequest_LocationTypeToJSON(message.locationType);
652
- }
653
- if (message.target !== "") {
654
- obj.target = message.target;
655
- }
616
+ message.locationType !== undefined &&
617
+ (obj.locationType = remoteSocksRequest_LocationTypeToJSON(message.locationType));
618
+ message.target !== undefined && (obj.target = message.target);
656
619
  return obj;
657
620
  },
658
621
  create(base) {
@@ -684,13 +647,13 @@ exports.RemoteSocksReply = {
684
647
  const tag = reader.uint32();
685
648
  switch (tag >>> 3) {
686
649
  case 1:
687
- if (tag !== 10) {
650
+ if (tag != 10) {
688
651
  break;
689
652
  }
690
653
  message.serverUrl = reader.string();
691
654
  continue;
692
655
  }
693
- if ((tag & 7) === 4 || tag === 0) {
656
+ if ((tag & 7) == 4 || tag == 0) {
694
657
  break;
695
658
  }
696
659
  reader.skipType(tag & 7);
@@ -698,13 +661,11 @@ exports.RemoteSocksReply = {
698
661
  return message;
699
662
  },
700
663
  fromJSON(object) {
701
- return { serverUrl: isSet(object.serverUrl) ? globalThis.String(object.serverUrl) : "" };
664
+ return { serverUrl: isSet(object.serverUrl) ? String(object.serverUrl) : "" };
702
665
  },
703
666
  toJSON(message) {
704
667
  const obj = {};
705
- if (message.serverUrl !== "") {
706
- obj.serverUrl = message.serverUrl;
707
- }
668
+ message.serverUrl !== undefined && (obj.serverUrl = message.serverUrl);
708
669
  return obj;
709
670
  },
710
671
  create(base) {
@@ -735,13 +696,13 @@ exports.ListUsersReply = {
735
696
  const tag = reader.uint32();
736
697
  switch (tag >>> 3) {
737
698
  case 1:
738
- if (tag !== 10) {
699
+ if (tag != 10) {
739
700
  break;
740
701
  }
741
702
  message.uids.push(reader.string());
742
703
  continue;
743
704
  }
744
- if ((tag & 7) === 4 || tag === 0) {
705
+ if ((tag & 7) == 4 || tag == 0) {
745
706
  break;
746
707
  }
747
708
  reader.skipType(tag & 7);
@@ -749,13 +710,15 @@ exports.ListUsersReply = {
749
710
  return message;
750
711
  },
751
712
  fromJSON(object) {
752
- return { uids: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.uids) ? object.uids.map((e) => globalThis.String(e)) : [] };
713
+ return { uids: Array.isArray(object === null || object === void 0 ? void 0 : object.uids) ? object.uids.map((e) => String(e)) : [] };
753
714
  },
754
715
  toJSON(message) {
755
- var _a;
756
716
  const obj = {};
757
- if ((_a = message.uids) === null || _a === void 0 ? void 0 : _a.length) {
758
- obj.uids = message.uids;
717
+ if (message.uids) {
718
+ obj.uids = message.uids.map((e) => e);
719
+ }
720
+ else {
721
+ obj.uids = [];
759
722
  }
760
723
  return obj;
761
724
  },
@@ -799,37 +762,37 @@ exports.HServerInfo = {
799
762
  const tag = reader.uint32();
800
763
  switch (tag >>> 3) {
801
764
  case 1:
802
- if (tag !== 10) {
765
+ if (tag != 10) {
803
766
  break;
804
767
  }
805
768
  message.originServer = reader.string();
806
769
  continue;
807
770
  case 2:
808
- if (tag !== 18) {
771
+ if (tag != 18) {
809
772
  break;
810
773
  }
811
774
  message.virtualIp = reader.string();
812
775
  continue;
813
776
  case 3:
814
- if (tag !== 26) {
777
+ if (tag != 26) {
815
778
  break;
816
779
  }
817
780
  message.boxId = reader.string();
818
781
  continue;
819
782
  case 4:
820
- if (tag !== 34) {
783
+ if (tag != 34) {
821
784
  break;
822
785
  }
823
786
  message.boxName = reader.string();
824
787
  continue;
825
788
  case 5:
826
- if (tag !== 42) {
789
+ if (tag != 42) {
827
790
  break;
828
791
  }
829
792
  message.boxDomain = reader.string();
830
793
  continue;
831
794
  }
832
- if ((tag & 7) === 4 || tag === 0) {
795
+ if ((tag & 7) == 4 || tag == 0) {
833
796
  break;
834
797
  }
835
798
  reader.skipType(tag & 7);
@@ -838,30 +801,20 @@ exports.HServerInfo = {
838
801
  },
839
802
  fromJSON(object) {
840
803
  return {
841
- originServer: isSet(object.originServer) ? globalThis.String(object.originServer) : "",
842
- virtualIp: isSet(object.virtualIp) ? globalThis.String(object.virtualIp) : "",
843
- boxId: isSet(object.boxId) ? globalThis.String(object.boxId) : "",
844
- boxName: isSet(object.boxName) ? globalThis.String(object.boxName) : "",
845
- boxDomain: isSet(object.boxDomain) ? globalThis.String(object.boxDomain) : "",
804
+ originServer: isSet(object.originServer) ? String(object.originServer) : "",
805
+ virtualIp: isSet(object.virtualIp) ? String(object.virtualIp) : "",
806
+ boxId: isSet(object.boxId) ? String(object.boxId) : "",
807
+ boxName: isSet(object.boxName) ? String(object.boxName) : "",
808
+ boxDomain: isSet(object.boxDomain) ? String(object.boxDomain) : "",
846
809
  };
847
810
  },
848
811
  toJSON(message) {
849
812
  const obj = {};
850
- if (message.originServer !== "") {
851
- obj.originServer = message.originServer;
852
- }
853
- if (message.virtualIp !== "") {
854
- obj.virtualIp = message.virtualIp;
855
- }
856
- if (message.boxId !== "") {
857
- obj.boxId = message.boxId;
858
- }
859
- if (message.boxName !== "") {
860
- obj.boxName = message.boxName;
861
- }
862
- if (message.boxDomain !== "") {
863
- obj.boxDomain = message.boxDomain;
864
- }
813
+ message.originServer !== undefined && (obj.originServer = message.originServer);
814
+ message.virtualIp !== undefined && (obj.virtualIp = message.virtualIp);
815
+ message.boxId !== undefined && (obj.boxId = message.boxId);
816
+ message.boxName !== undefined && (obj.boxName = message.boxName);
817
+ message.boxDomain !== undefined && (obj.boxDomain = message.boxDomain);
865
818
  return obj;
866
819
  },
867
820
  create(base) {
@@ -902,25 +855,25 @@ exports.Device = {
902
855
  const tag = reader.uint32();
903
856
  switch (tag >>> 3) {
904
857
  case 1:
905
- if (tag !== 10) {
858
+ if (tag != 10) {
906
859
  break;
907
860
  }
908
861
  message.peerId = reader.string();
909
862
  continue;
910
863
  case 2:
911
- if (tag !== 16) {
864
+ if (tag != 16) {
912
865
  break;
913
866
  }
914
867
  message.isOnline = reader.bool();
915
868
  continue;
916
869
  case 6:
917
- if (tag !== 50) {
870
+ if (tag != 50) {
918
871
  break;
919
872
  }
920
873
  message.bindingTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
921
874
  continue;
922
875
  }
923
- if ((tag & 7) === 4 || tag === 0) {
876
+ if ((tag & 7) == 4 || tag == 0) {
924
877
  break;
925
878
  }
926
879
  reader.skipType(tag & 7);
@@ -929,22 +882,16 @@ exports.Device = {
929
882
  },
930
883
  fromJSON(object) {
931
884
  return {
932
- peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "",
933
- isOnline: isSet(object.isOnline) ? globalThis.Boolean(object.isOnline) : false,
885
+ peerId: isSet(object.peerId) ? String(object.peerId) : "",
886
+ isOnline: isSet(object.isOnline) ? Boolean(object.isOnline) : false,
934
887
  bindingTime: isSet(object.bindingTime) ? fromJsonTimestamp(object.bindingTime) : undefined,
935
888
  };
936
889
  },
937
890
  toJSON(message) {
938
891
  const obj = {};
939
- if (message.peerId !== "") {
940
- obj.peerId = message.peerId;
941
- }
942
- if (message.isOnline === true) {
943
- obj.isOnline = message.isOnline;
944
- }
945
- if (message.bindingTime !== undefined) {
946
- obj.bindingTime = message.bindingTime.toISOString();
947
- }
892
+ message.peerId !== undefined && (obj.peerId = message.peerId);
893
+ message.isOnline !== undefined && (obj.isOnline = message.isOnline);
894
+ message.bindingTime !== undefined && (obj.bindingTime = message.bindingTime.toISOString());
948
895
  return obj;
949
896
  },
950
897
  create(base) {
@@ -977,13 +924,13 @@ exports.ListEndDeviceRequest = {
977
924
  const tag = reader.uint32();
978
925
  switch (tag >>> 3) {
979
926
  case 1:
980
- if (tag !== 10) {
927
+ if (tag != 10) {
981
928
  break;
982
929
  }
983
930
  message.uid = reader.string();
984
931
  continue;
985
932
  }
986
- if ((tag & 7) === 4 || tag === 0) {
933
+ if ((tag & 7) == 4 || tag == 0) {
987
934
  break;
988
935
  }
989
936
  reader.skipType(tag & 7);
@@ -991,13 +938,11 @@ exports.ListEndDeviceRequest = {
991
938
  return message;
992
939
  },
993
940
  fromJSON(object) {
994
- return { uid: isSet(object.uid) ? globalThis.String(object.uid) : "" };
941
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
995
942
  },
996
943
  toJSON(message) {
997
944
  const obj = {};
998
- if (message.uid !== "") {
999
- obj.uid = message.uid;
1000
- }
945
+ message.uid !== undefined && (obj.uid = message.uid);
1001
946
  return obj;
1002
947
  },
1003
948
  create(base) {
@@ -1028,13 +973,13 @@ exports.ListEndDeviceReply = {
1028
973
  const tag = reader.uint32();
1029
974
  switch (tag >>> 3) {
1030
975
  case 1:
1031
- if (tag !== 10) {
976
+ if (tag != 10) {
1032
977
  break;
1033
978
  }
1034
979
  message.devices.push(exports.Device.decode(reader, reader.uint32()));
1035
980
  continue;
1036
981
  }
1037
- if ((tag & 7) === 4 || tag === 0) {
982
+ if ((tag & 7) == 4 || tag == 0) {
1038
983
  break;
1039
984
  }
1040
985
  reader.skipType(tag & 7);
@@ -1042,15 +987,15 @@ exports.ListEndDeviceReply = {
1042
987
  return message;
1043
988
  },
1044
989
  fromJSON(object) {
1045
- return {
1046
- devices: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.devices) ? object.devices.map((e) => exports.Device.fromJSON(e)) : [],
1047
- };
990
+ return { devices: Array.isArray(object === null || object === void 0 ? void 0 : object.devices) ? object.devices.map((e) => exports.Device.fromJSON(e)) : [] };
1048
991
  },
1049
992
  toJSON(message) {
1050
- var _a;
1051
993
  const obj = {};
1052
- if ((_a = message.devices) === null || _a === void 0 ? void 0 : _a.length) {
1053
- obj.devices = message.devices.map((e) => exports.Device.toJSON(e));
994
+ if (message.devices) {
995
+ obj.devices = message.devices.map((e) => e ? exports.Device.toJSON(e) : undefined);
996
+ }
997
+ else {
998
+ obj.devices = [];
1054
999
  }
1055
1000
  return obj;
1056
1001
  },
@@ -1082,13 +1027,13 @@ exports.UserID = {
1082
1027
  const tag = reader.uint32();
1083
1028
  switch (tag >>> 3) {
1084
1029
  case 1:
1085
- if (tag !== 10) {
1030
+ if (tag != 10) {
1086
1031
  break;
1087
1032
  }
1088
1033
  message.uid = reader.string();
1089
1034
  continue;
1090
1035
  }
1091
- if ((tag & 7) === 4 || tag === 0) {
1036
+ if ((tag & 7) == 4 || tag == 0) {
1092
1037
  break;
1093
1038
  }
1094
1039
  reader.skipType(tag & 7);
@@ -1096,13 +1041,11 @@ exports.UserID = {
1096
1041
  return message;
1097
1042
  },
1098
1043
  fromJSON(object) {
1099
- return { uid: isSet(object.uid) ? globalThis.String(object.uid) : "" };
1044
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1100
1045
  },
1101
1046
  toJSON(message) {
1102
1047
  const obj = {};
1103
- if (message.uid !== "") {
1104
- obj.uid = message.uid;
1105
- }
1048
+ message.uid !== undefined && (obj.uid = message.uid);
1106
1049
  return obj;
1107
1050
  },
1108
1051
  create(base) {
@@ -1136,19 +1079,19 @@ exports.ChangeRoleReqeust = {
1136
1079
  const tag = reader.uint32();
1137
1080
  switch (tag >>> 3) {
1138
1081
  case 1:
1139
- if (tag !== 10) {
1082
+ if (tag != 10) {
1140
1083
  break;
1141
1084
  }
1142
1085
  message.uid = reader.string();
1143
1086
  continue;
1144
1087
  case 2:
1145
- if (tag !== 16) {
1088
+ if (tag != 16) {
1146
1089
  break;
1147
1090
  }
1148
1091
  message.role = reader.int32();
1149
1092
  continue;
1150
1093
  }
1151
- if ((tag & 7) === 4 || tag === 0) {
1094
+ if ((tag & 7) == 4 || tag == 0) {
1152
1095
  break;
1153
1096
  }
1154
1097
  reader.skipType(tag & 7);
@@ -1157,18 +1100,14 @@ exports.ChangeRoleReqeust = {
1157
1100
  },
1158
1101
  fromJSON(object) {
1159
1102
  return {
1160
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1103
+ uid: isSet(object.uid) ? String(object.uid) : "",
1161
1104
  role: isSet(object.role) ? roleFromJSON(object.role) : 0,
1162
1105
  };
1163
1106
  },
1164
1107
  toJSON(message) {
1165
1108
  const obj = {};
1166
- if (message.uid !== "") {
1167
- obj.uid = message.uid;
1168
- }
1169
- if (message.role !== 0) {
1170
- obj.role = roleToJSON(message.role);
1171
- }
1109
+ message.uid !== undefined && (obj.uid = message.uid);
1110
+ message.role !== undefined && (obj.role = roleToJSON(message.role));
1172
1111
  return obj;
1173
1112
  },
1174
1113
  create(base) {
@@ -1203,19 +1142,19 @@ exports.QueryRoleReply = {
1203
1142
  const tag = reader.uint32();
1204
1143
  switch (tag >>> 3) {
1205
1144
  case 1:
1206
- if (tag !== 10) {
1145
+ if (tag != 10) {
1207
1146
  break;
1208
1147
  }
1209
1148
  message.uid = reader.string();
1210
1149
  continue;
1211
1150
  case 2:
1212
- if (tag !== 16) {
1151
+ if (tag != 16) {
1213
1152
  break;
1214
1153
  }
1215
1154
  message.role = reader.int32();
1216
1155
  continue;
1217
1156
  }
1218
- if ((tag & 7) === 4 || tag === 0) {
1157
+ if ((tag & 7) == 4 || tag == 0) {
1219
1158
  break;
1220
1159
  }
1221
1160
  reader.skipType(tag & 7);
@@ -1224,18 +1163,14 @@ exports.QueryRoleReply = {
1224
1163
  },
1225
1164
  fromJSON(object) {
1226
1165
  return {
1227
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1166
+ uid: isSet(object.uid) ? String(object.uid) : "",
1228
1167
  role: isSet(object.role) ? roleFromJSON(object.role) : 0,
1229
1168
  };
1230
1169
  },
1231
1170
  toJSON(message) {
1232
1171
  const obj = {};
1233
- if (message.uid !== "") {
1234
- obj.uid = message.uid;
1235
- }
1236
- if (message.role !== 0) {
1237
- obj.role = roleToJSON(message.role);
1238
- }
1172
+ message.uid !== undefined && (obj.uid = message.uid);
1173
+ message.role !== undefined && (obj.role = roleToJSON(message.role));
1239
1174
  return obj;
1240
1175
  },
1241
1176
  create(base) {
@@ -1270,19 +1205,19 @@ exports.ResetPasswordRequest = {
1270
1205
  const tag = reader.uint32();
1271
1206
  switch (tag >>> 3) {
1272
1207
  case 1:
1273
- if (tag !== 10) {
1208
+ if (tag != 10) {
1274
1209
  break;
1275
1210
  }
1276
1211
  message.uid = reader.string();
1277
1212
  continue;
1278
1213
  case 3:
1279
- if (tag !== 26) {
1214
+ if (tag != 26) {
1280
1215
  break;
1281
1216
  }
1282
1217
  message.newPassword = reader.string();
1283
1218
  continue;
1284
1219
  }
1285
- if ((tag & 7) === 4 || tag === 0) {
1220
+ if ((tag & 7) == 4 || tag == 0) {
1286
1221
  break;
1287
1222
  }
1288
1223
  reader.skipType(tag & 7);
@@ -1291,18 +1226,14 @@ exports.ResetPasswordRequest = {
1291
1226
  },
1292
1227
  fromJSON(object) {
1293
1228
  return {
1294
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1295
- newPassword: isSet(object.newPassword) ? globalThis.String(object.newPassword) : "",
1229
+ uid: isSet(object.uid) ? String(object.uid) : "",
1230
+ newPassword: isSet(object.newPassword) ? String(object.newPassword) : "",
1296
1231
  };
1297
1232
  },
1298
1233
  toJSON(message) {
1299
1234
  const obj = {};
1300
- if (message.uid !== "") {
1301
- obj.uid = message.uid;
1302
- }
1303
- if (message.newPassword !== "") {
1304
- obj.newPassword = message.newPassword;
1305
- }
1235
+ message.uid !== undefined && (obj.uid = message.uid);
1236
+ message.newPassword !== undefined && (obj.newPassword = message.newPassword);
1306
1237
  return obj;
1307
1238
  },
1308
1239
  create(base) {
@@ -1334,13 +1265,13 @@ exports.DeleteUserRequest = {
1334
1265
  const tag = reader.uint32();
1335
1266
  switch (tag >>> 3) {
1336
1267
  case 1:
1337
- if (tag !== 10) {
1268
+ if (tag != 10) {
1338
1269
  break;
1339
1270
  }
1340
1271
  message.uid = reader.string();
1341
1272
  continue;
1342
1273
  }
1343
- if ((tag & 7) === 4 || tag === 0) {
1274
+ if ((tag & 7) == 4 || tag == 0) {
1344
1275
  break;
1345
1276
  }
1346
1277
  reader.skipType(tag & 7);
@@ -1348,13 +1279,11 @@ exports.DeleteUserRequest = {
1348
1279
  return message;
1349
1280
  },
1350
1281
  fromJSON(object) {
1351
- return { uid: isSet(object.uid) ? globalThis.String(object.uid) : "" };
1282
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1352
1283
  },
1353
1284
  toJSON(message) {
1354
1285
  const obj = {};
1355
- if (message.uid !== "") {
1356
- obj.uid = message.uid;
1357
- }
1286
+ message.uid !== undefined && (obj.uid = message.uid);
1358
1287
  return obj;
1359
1288
  },
1360
1289
  create(base) {
@@ -1391,25 +1320,25 @@ exports.CreateUserRequest = {
1391
1320
  const tag = reader.uint32();
1392
1321
  switch (tag >>> 3) {
1393
1322
  case 1:
1394
- if (tag !== 10) {
1323
+ if (tag != 10) {
1395
1324
  break;
1396
1325
  }
1397
1326
  message.uid = reader.string();
1398
1327
  continue;
1399
1328
  case 2:
1400
- if (tag !== 18) {
1329
+ if (tag != 18) {
1401
1330
  break;
1402
1331
  }
1403
1332
  message.password = reader.string();
1404
1333
  continue;
1405
1334
  case 3:
1406
- if (tag !== 24) {
1335
+ if (tag != 24) {
1407
1336
  break;
1408
1337
  }
1409
1338
  message.role = reader.int32();
1410
1339
  continue;
1411
1340
  }
1412
- if ((tag & 7) === 4 || tag === 0) {
1341
+ if ((tag & 7) == 4 || tag == 0) {
1413
1342
  break;
1414
1343
  }
1415
1344
  reader.skipType(tag & 7);
@@ -1418,22 +1347,16 @@ exports.CreateUserRequest = {
1418
1347
  },
1419
1348
  fromJSON(object) {
1420
1349
  return {
1421
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1422
- password: isSet(object.password) ? globalThis.String(object.password) : "",
1350
+ uid: isSet(object.uid) ? String(object.uid) : "",
1351
+ password: isSet(object.password) ? String(object.password) : "",
1423
1352
  role: isSet(object.role) ? roleFromJSON(object.role) : 0,
1424
1353
  };
1425
1354
  },
1426
1355
  toJSON(message) {
1427
1356
  const obj = {};
1428
- if (message.uid !== "") {
1429
- obj.uid = message.uid;
1430
- }
1431
- if (message.password !== "") {
1432
- obj.password = message.password;
1433
- }
1434
- if (message.role !== 0) {
1435
- obj.role = roleToJSON(message.role);
1436
- }
1357
+ message.uid !== undefined && (obj.uid = message.uid);
1358
+ message.password !== undefined && (obj.password = message.password);
1359
+ message.role !== undefined && (obj.role = roleToJSON(message.role));
1437
1360
  return obj;
1438
1361
  },
1439
1362
  create(base) {
@@ -1469,19 +1392,19 @@ exports.CheckPasswordRequest = {
1469
1392
  const tag = reader.uint32();
1470
1393
  switch (tag >>> 3) {
1471
1394
  case 1:
1472
- if (tag !== 10) {
1395
+ if (tag != 10) {
1473
1396
  break;
1474
1397
  }
1475
1398
  message.uid = reader.string();
1476
1399
  continue;
1477
1400
  case 2:
1478
- if (tag !== 18) {
1401
+ if (tag != 18) {
1479
1402
  break;
1480
1403
  }
1481
1404
  message.password = reader.string();
1482
1405
  continue;
1483
1406
  }
1484
- if ((tag & 7) === 4 || tag === 0) {
1407
+ if ((tag & 7) == 4 || tag == 0) {
1485
1408
  break;
1486
1409
  }
1487
1410
  reader.skipType(tag & 7);
@@ -1490,18 +1413,14 @@ exports.CheckPasswordRequest = {
1490
1413
  },
1491
1414
  fromJSON(object) {
1492
1415
  return {
1493
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1494
- password: isSet(object.password) ? globalThis.String(object.password) : "",
1416
+ uid: isSet(object.uid) ? String(object.uid) : "",
1417
+ password: isSet(object.password) ? String(object.password) : "",
1495
1418
  };
1496
1419
  },
1497
1420
  toJSON(message) {
1498
1421
  const obj = {};
1499
- if (message.uid !== "") {
1500
- obj.uid = message.uid;
1501
- }
1502
- if (message.password !== "") {
1503
- obj.password = message.password;
1504
- }
1422
+ message.uid !== undefined && (obj.uid = message.uid);
1423
+ message.password !== undefined && (obj.password = message.password);
1505
1424
  return obj;
1506
1425
  },
1507
1426
  create(base) {
@@ -1539,25 +1458,25 @@ exports.ChangeTrustEndDeviceRequest = {
1539
1458
  const tag = reader.uint32();
1540
1459
  switch (tag >>> 3) {
1541
1460
  case 1:
1542
- if (tag !== 10) {
1461
+ if (tag != 10) {
1543
1462
  break;
1544
1463
  }
1545
1464
  message.uid = reader.string();
1546
1465
  continue;
1547
1466
  case 2:
1548
- if (tag !== 18) {
1467
+ if (tag != 18) {
1549
1468
  break;
1550
1469
  }
1551
1470
  message.cid = reader.string();
1552
1471
  continue;
1553
1472
  case 3:
1554
- if (tag !== 24) {
1473
+ if (tag != 24) {
1555
1474
  break;
1556
1475
  }
1557
1476
  message.action = reader.int32();
1558
1477
  continue;
1559
1478
  }
1560
- if ((tag & 7) === 4 || tag === 0) {
1479
+ if ((tag & 7) == 4 || tag == 0) {
1561
1480
  break;
1562
1481
  }
1563
1482
  reader.skipType(tag & 7);
@@ -1566,22 +1485,16 @@ exports.ChangeTrustEndDeviceRequest = {
1566
1485
  },
1567
1486
  fromJSON(object) {
1568
1487
  return {
1569
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
1570
- cid: isSet(object.cid) ? globalThis.String(object.cid) : "",
1488
+ uid: isSet(object.uid) ? String(object.uid) : "",
1489
+ cid: isSet(object.cid) ? String(object.cid) : "",
1571
1490
  action: isSet(object.action) ? changeTrustEndDeviceRequest_ActionFromJSON(object.action) : 0,
1572
1491
  };
1573
1492
  },
1574
1493
  toJSON(message) {
1575
1494
  const obj = {};
1576
- if (message.uid !== "") {
1577
- obj.uid = message.uid;
1578
- }
1579
- if (message.cid !== "") {
1580
- obj.cid = message.cid;
1581
- }
1582
- if (message.action !== 0) {
1583
- obj.action = changeTrustEndDeviceRequest_ActionToJSON(message.action);
1584
- }
1495
+ message.uid !== undefined && (obj.uid = message.uid);
1496
+ message.cid !== undefined && (obj.cid = message.cid);
1497
+ message.action !== undefined && (obj.action = changeTrustEndDeviceRequest_ActionToJSON(message.action));
1585
1498
  return obj;
1586
1499
  },
1587
1500
  create(base) {
@@ -1611,7 +1524,7 @@ exports.ChangeTrustEndDeviceReply = {
1611
1524
  const tag = reader.uint32();
1612
1525
  switch (tag >>> 3) {
1613
1526
  }
1614
- if ((tag & 7) === 4 || tag === 0) {
1527
+ if ((tag & 7) == 4 || tag == 0) {
1615
1528
  break;
1616
1529
  }
1617
1530
  reader.skipType(tag & 7);
@@ -1660,31 +1573,31 @@ exports.SetupHServerRequest = {
1660
1573
  const tag = reader.uint32();
1661
1574
  switch (tag >>> 3) {
1662
1575
  case 1:
1663
- if (tag !== 10) {
1576
+ if (tag != 10) {
1664
1577
  break;
1665
1578
  }
1666
1579
  message.originServer = reader.string();
1667
1580
  continue;
1668
1581
  case 2:
1669
- if (tag !== 18) {
1582
+ if (tag != 18) {
1670
1583
  break;
1671
1584
  }
1672
1585
  message.boxName = reader.string();
1673
1586
  continue;
1674
1587
  case 3:
1675
- if (tag !== 26) {
1588
+ if (tag != 26) {
1676
1589
  break;
1677
1590
  }
1678
1591
  message.username = reader.string();
1679
1592
  continue;
1680
1593
  case 4:
1681
- if (tag !== 34) {
1594
+ if (tag != 34) {
1682
1595
  break;
1683
1596
  }
1684
1597
  message.password = reader.string();
1685
1598
  continue;
1686
1599
  }
1687
- if ((tag & 7) === 4 || tag === 0) {
1600
+ if ((tag & 7) == 4 || tag == 0) {
1688
1601
  break;
1689
1602
  }
1690
1603
  reader.skipType(tag & 7);
@@ -1693,26 +1606,18 @@ exports.SetupHServerRequest = {
1693
1606
  },
1694
1607
  fromJSON(object) {
1695
1608
  return {
1696
- originServer: isSet(object.originServer) ? globalThis.String(object.originServer) : "",
1697
- boxName: isSet(object.boxName) ? globalThis.String(object.boxName) : "",
1698
- username: isSet(object.username) ? globalThis.String(object.username) : "",
1699
- password: isSet(object.password) ? globalThis.String(object.password) : "",
1609
+ originServer: isSet(object.originServer) ? String(object.originServer) : "",
1610
+ boxName: isSet(object.boxName) ? String(object.boxName) : "",
1611
+ username: isSet(object.username) ? String(object.username) : "",
1612
+ password: isSet(object.password) ? String(object.password) : "",
1700
1613
  };
1701
1614
  },
1702
1615
  toJSON(message) {
1703
1616
  const obj = {};
1704
- if (message.originServer !== "") {
1705
- obj.originServer = message.originServer;
1706
- }
1707
- if (message.boxName !== "") {
1708
- obj.boxName = message.boxName;
1709
- }
1710
- if (message.username !== "") {
1711
- obj.username = message.username;
1712
- }
1713
- if (message.password !== "") {
1714
- obj.password = message.password;
1715
- }
1617
+ message.originServer !== undefined && (obj.originServer = message.originServer);
1618
+ message.boxName !== undefined && (obj.boxName = message.boxName);
1619
+ message.username !== undefined && (obj.username = message.username);
1620
+ message.password !== undefined && (obj.password = message.password);
1716
1621
  return obj;
1717
1622
  },
1718
1623
  create(base) {
@@ -1749,19 +1654,19 @@ exports.SetupHServerReply = {
1749
1654
  const tag = reader.uint32();
1750
1655
  switch (tag >>> 3) {
1751
1656
  case 1:
1752
- if (tag !== 8) {
1657
+ if (tag != 8) {
1753
1658
  break;
1754
1659
  }
1755
1660
  message.ok = reader.bool();
1756
1661
  continue;
1757
1662
  case 2:
1758
- if (tag !== 18) {
1663
+ if (tag != 18) {
1759
1664
  break;
1760
1665
  }
1761
1666
  message.reason = reader.string();
1762
1667
  continue;
1763
1668
  }
1764
- if ((tag & 7) === 4 || tag === 0) {
1669
+ if ((tag & 7) == 4 || tag == 0) {
1765
1670
  break;
1766
1671
  }
1767
1672
  reader.skipType(tag & 7);
@@ -1770,18 +1675,14 @@ exports.SetupHServerReply = {
1770
1675
  },
1771
1676
  fromJSON(object) {
1772
1677
  return {
1773
- ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false,
1774
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
1678
+ ok: isSet(object.ok) ? Boolean(object.ok) : false,
1679
+ reason: isSet(object.reason) ? String(object.reason) : "",
1775
1680
  };
1776
1681
  },
1777
1682
  toJSON(message) {
1778
1683
  const obj = {};
1779
- if (message.ok === true) {
1780
- obj.ok = message.ok;
1781
- }
1782
- if (message.reason !== "") {
1783
- obj.reason = message.reason;
1784
- }
1684
+ message.ok !== undefined && (obj.ok = message.ok);
1685
+ message.reason !== undefined && (obj.reason = message.reason);
1785
1686
  return obj;
1786
1687
  },
1787
1688
  create(base) {
@@ -1813,13 +1714,13 @@ exports.ResetHServerRequest = {
1813
1714
  const tag = reader.uint32();
1814
1715
  switch (tag >>> 3) {
1815
1716
  case 1:
1816
- if (tag !== 10) {
1717
+ if (tag != 10) {
1817
1718
  break;
1818
1719
  }
1819
1720
  message.originServer = reader.string();
1820
1721
  continue;
1821
1722
  }
1822
- if ((tag & 7) === 4 || tag === 0) {
1723
+ if ((tag & 7) == 4 || tag == 0) {
1823
1724
  break;
1824
1725
  }
1825
1726
  reader.skipType(tag & 7);
@@ -1827,13 +1728,11 @@ exports.ResetHServerRequest = {
1827
1728
  return message;
1828
1729
  },
1829
1730
  fromJSON(object) {
1830
- return { originServer: isSet(object.originServer) ? globalThis.String(object.originServer) : "" };
1731
+ return { originServer: isSet(object.originServer) ? String(object.originServer) : "" };
1831
1732
  },
1832
1733
  toJSON(message) {
1833
1734
  const obj = {};
1834
- if (message.originServer !== "") {
1835
- obj.originServer = message.originServer;
1836
- }
1735
+ message.originServer !== undefined && (obj.originServer = message.originServer);
1837
1736
  return obj;
1838
1737
  },
1839
1738
  create(base) {
@@ -1861,7 +1760,7 @@ exports.ResetHServerReply = {
1861
1760
  const tag = reader.uint32();
1862
1761
  switch (tag >>> 3) {
1863
1762
  }
1864
- if ((tag & 7) === 4 || tag === 0) {
1763
+ if ((tag & 7) == 4 || tag == 0) {
1865
1764
  break;
1866
1765
  }
1867
1766
  reader.skipType(tag & 7);
@@ -1901,13 +1800,13 @@ exports.PeersInfo = {
1901
1800
  const tag = reader.uint32();
1902
1801
  switch (tag >>> 3) {
1903
1802
  case 1:
1904
- if (tag !== 10) {
1803
+ if (tag != 10) {
1905
1804
  break;
1906
1805
  }
1907
1806
  message.peerInfo = reader.string();
1908
1807
  continue;
1909
1808
  }
1910
- if ((tag & 7) === 4 || tag === 0) {
1809
+ if ((tag & 7) == 4 || tag == 0) {
1911
1810
  break;
1912
1811
  }
1913
1812
  reader.skipType(tag & 7);
@@ -1915,13 +1814,11 @@ exports.PeersInfo = {
1915
1814
  return message;
1916
1815
  },
1917
1816
  fromJSON(object) {
1918
- return { peerInfo: isSet(object.peerInfo) ? globalThis.String(object.peerInfo) : "" };
1817
+ return { peerInfo: isSet(object.peerInfo) ? String(object.peerInfo) : "" };
1919
1818
  },
1920
1819
  toJSON(message) {
1921
1820
  const obj = {};
1922
- if (message.peerInfo !== "") {
1923
- obj.peerInfo = message.peerInfo;
1924
- }
1821
+ message.peerInfo !== undefined && (obj.peerInfo = message.peerInfo);
1925
1822
  return obj;
1926
1823
  },
1927
1824
  create(base) {
@@ -1952,13 +1849,13 @@ exports.GetPasswordHashRequest = {
1952
1849
  const tag = reader.uint32();
1953
1850
  switch (tag >>> 3) {
1954
1851
  case 1:
1955
- if (tag !== 10) {
1852
+ if (tag != 10) {
1956
1853
  break;
1957
1854
  }
1958
1855
  message.uid = reader.string();
1959
1856
  continue;
1960
1857
  }
1961
- if ((tag & 7) === 4 || tag === 0) {
1858
+ if ((tag & 7) == 4 || tag == 0) {
1962
1859
  break;
1963
1860
  }
1964
1861
  reader.skipType(tag & 7);
@@ -1966,13 +1863,11 @@ exports.GetPasswordHashRequest = {
1966
1863
  return message;
1967
1864
  },
1968
1865
  fromJSON(object) {
1969
- return { uid: isSet(object.uid) ? globalThis.String(object.uid) : "" };
1866
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1970
1867
  },
1971
1868
  toJSON(message) {
1972
1869
  const obj = {};
1973
- if (message.uid !== "") {
1974
- obj.uid = message.uid;
1975
- }
1870
+ message.uid !== undefined && (obj.uid = message.uid);
1976
1871
  return obj;
1977
1872
  },
1978
1873
  create(base) {
@@ -2003,13 +1898,13 @@ exports.GetPasswordHashResponse = {
2003
1898
  const tag = reader.uint32();
2004
1899
  switch (tag >>> 3) {
2005
1900
  case 1:
2006
- if (tag !== 10) {
1901
+ if (tag != 10) {
2007
1902
  break;
2008
1903
  }
2009
1904
  message.passwordHash = reader.string();
2010
1905
  continue;
2011
1906
  }
2012
- if ((tag & 7) === 4 || tag === 0) {
1907
+ if ((tag & 7) == 4 || tag == 0) {
2013
1908
  break;
2014
1909
  }
2015
1910
  reader.skipType(tag & 7);
@@ -2017,13 +1912,11 @@ exports.GetPasswordHashResponse = {
2017
1912
  return message;
2018
1913
  },
2019
1914
  fromJSON(object) {
2020
- return { passwordHash: isSet(object.passwordHash) ? globalThis.String(object.passwordHash) : "" };
1915
+ return { passwordHash: isSet(object.passwordHash) ? String(object.passwordHash) : "" };
2021
1916
  },
2022
1917
  toJSON(message) {
2023
1918
  const obj = {};
2024
- if (message.passwordHash !== "") {
2025
- obj.passwordHash = message.passwordHash;
2026
- }
1919
+ message.passwordHash !== undefined && (obj.passwordHash = message.passwordHash);
2027
1920
  return obj;
2028
1921
  },
2029
1922
  create(base) {
@@ -2057,19 +1950,19 @@ exports.SetPasswordHashRequest = {
2057
1950
  const tag = reader.uint32();
2058
1951
  switch (tag >>> 3) {
2059
1952
  case 1:
2060
- if (tag !== 10) {
1953
+ if (tag != 10) {
2061
1954
  break;
2062
1955
  }
2063
1956
  message.uid = reader.string();
2064
1957
  continue;
2065
1958
  case 2:
2066
- if (tag !== 18) {
1959
+ if (tag != 18) {
2067
1960
  break;
2068
1961
  }
2069
1962
  message.passwordHash = reader.string();
2070
1963
  continue;
2071
1964
  }
2072
- if ((tag & 7) === 4 || tag === 0) {
1965
+ if ((tag & 7) == 4 || tag == 0) {
2073
1966
  break;
2074
1967
  }
2075
1968
  reader.skipType(tag & 7);
@@ -2078,18 +1971,14 @@ exports.SetPasswordHashRequest = {
2078
1971
  },
2079
1972
  fromJSON(object) {
2080
1973
  return {
2081
- uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
2082
- passwordHash: isSet(object.passwordHash) ? globalThis.String(object.passwordHash) : "",
1974
+ uid: isSet(object.uid) ? String(object.uid) : "",
1975
+ passwordHash: isSet(object.passwordHash) ? String(object.passwordHash) : "",
2083
1976
  };
2084
1977
  },
2085
1978
  toJSON(message) {
2086
1979
  const obj = {};
2087
- if (message.uid !== "") {
2088
- obj.uid = message.uid;
2089
- }
2090
- if (message.passwordHash !== "") {
2091
- obj.passwordHash = message.passwordHash;
2092
- }
1980
+ message.uid !== undefined && (obj.uid = message.uid);
1981
+ message.passwordHash !== undefined && (obj.passwordHash = message.passwordHash);
2093
1982
  return obj;
2094
1983
  },
2095
1984
  create(base) {
@@ -2557,10 +2446,15 @@ class GrpcWebImpl {
2557
2446
  const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
2558
2447
  const maybeCombinedMetadata = metadata && this.options.metadata
2559
2448
  ? new browser_headers_1.BrowserHeaders(Object.assign(Object.assign({}, (_a = this.options) === null || _a === void 0 ? void 0 : _a.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))
2560
- : metadata !== null && metadata !== void 0 ? metadata : this.options.metadata;
2449
+ : metadata || this.options.metadata;
2561
2450
  return new Promise((resolve, reject) => {
2562
- var _a;
2563
- const client = grpc_web_1.grpc.unary(methodDesc, Object.assign(Object.assign({ request, host: this.host, metadata: maybeCombinedMetadata !== null && maybeCombinedMetadata !== void 0 ? maybeCombinedMetadata : {} }, (this.options.transport !== undefined ? { transport: this.options.transport } : {})), { debug: (_a = this.options.debug) !== null && _a !== void 0 ? _a : false, onEnd: function (response) {
2451
+ const client = grpc_web_1.grpc.unary(methodDesc, {
2452
+ request,
2453
+ host: this.host,
2454
+ metadata: maybeCombinedMetadata,
2455
+ transport: this.options.transport,
2456
+ debug: this.options.debug,
2457
+ onEnd: function (response) {
2564
2458
  if (response.status === grpc_web_1.grpc.Code.OK) {
2565
2459
  resolve(response.message.toObject());
2566
2460
  }
@@ -2568,28 +2462,35 @@ class GrpcWebImpl {
2568
2462
  const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
2569
2463
  reject(err);
2570
2464
  }
2571
- } }));
2465
+ },
2466
+ });
2467
+ const abortHandler = () => {
2468
+ client.close();
2469
+ reject(new Error("Aborted"));
2470
+ };
2572
2471
  if (abortSignal) {
2573
- abortSignal.addEventListener("abort", () => {
2574
- client.close();
2575
- reject(abortSignal.reason);
2576
- });
2472
+ abortSignal.addEventListener("abort", abortHandler);
2577
2473
  }
2578
2474
  });
2579
2475
  }
2580
2476
  invoke(methodDesc, _request, metadata, abortSignal) {
2581
- var _a, _b, _c;
2582
- const upStreamCodes = (_a = this.options.upStreamRetryCodes) !== null && _a !== void 0 ? _a : [];
2477
+ var _a;
2478
+ const upStreamCodes = this.options.upStreamRetryCodes || [];
2583
2479
  const DEFAULT_TIMEOUT_TIME = 3000;
2584
2480
  const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
2585
- const transport = (_b = this.options.streamingTransport) !== null && _b !== void 0 ? _b : this.options.transport;
2586
2481
  const maybeCombinedMetadata = metadata && this.options.metadata
2587
- ? new browser_headers_1.BrowserHeaders(Object.assign(Object.assign({}, (_c = this.options) === null || _c === void 0 ? void 0 : _c.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))
2588
- : metadata !== null && metadata !== void 0 ? metadata : this.options.metadata;
2482
+ ? new browser_headers_1.BrowserHeaders(Object.assign(Object.assign({}, (_a = this.options) === null || _a === void 0 ? void 0 : _a.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))
2483
+ : metadata || this.options.metadata;
2589
2484
  return new rxjs_1.Observable((observer) => {
2590
- const upStream = () => {
2591
- var _a;
2592
- const client = grpc_web_1.grpc.invoke(methodDesc, Object.assign(Object.assign({ host: this.host, request }, (transport !== undefined ? { transport } : {})), { metadata: maybeCombinedMetadata !== null && maybeCombinedMetadata !== void 0 ? maybeCombinedMetadata : {}, debug: (_a = this.options.debug) !== null && _a !== void 0 ? _a : false, onMessage: (next) => observer.next(next), onEnd: (code, message, trailers) => {
2485
+ const upStream = (() => {
2486
+ const client = grpc_web_1.grpc.invoke(methodDesc, {
2487
+ host: this.host,
2488
+ request,
2489
+ transport: this.options.streamingTransport || this.options.transport,
2490
+ metadata: maybeCombinedMetadata,
2491
+ debug: this.options.debug,
2492
+ onMessage: (next) => observer.next(next),
2493
+ onEnd: (code, message, trailers) => {
2593
2494
  if (code === 0) {
2594
2495
  observer.complete();
2595
2496
  }
@@ -2602,46 +2503,57 @@ class GrpcWebImpl {
2602
2503
  err.metadata = trailers;
2603
2504
  observer.error(err);
2604
2505
  }
2605
- } }));
2506
+ },
2507
+ });
2508
+ observer.add(() => {
2509
+ if (!observer.closed) {
2510
+ return client.close();
2511
+ }
2512
+ });
2513
+ const abortHandler = () => {
2514
+ observer.error("Aborted");
2515
+ client.close();
2516
+ };
2606
2517
  if (abortSignal) {
2607
- const abort = () => {
2608
- observer.error(abortSignal.reason);
2609
- client.close();
2610
- };
2611
- abortSignal.addEventListener("abort", abort);
2612
- observer.add(() => {
2613
- if (abortSignal.aborted) {
2614
- return;
2615
- }
2616
- abortSignal.removeEventListener("abort", abort);
2617
- client.close();
2618
- });
2518
+ abortSignal.addEventListener("abort", abortHandler);
2619
2519
  }
2620
- else {
2621
- observer.add(() => client.close());
2622
- }
2623
- };
2520
+ });
2624
2521
  upStream();
2625
2522
  }).pipe((0, operators_1.share)());
2626
2523
  }
2627
2524
  }
2628
2525
  exports.GrpcWebImpl = GrpcWebImpl;
2526
+ var tsProtoGlobalThis = (() => {
2527
+ if (typeof globalThis !== "undefined") {
2528
+ return globalThis;
2529
+ }
2530
+ if (typeof self !== "undefined") {
2531
+ return self;
2532
+ }
2533
+ if (typeof window !== "undefined") {
2534
+ return window;
2535
+ }
2536
+ if (typeof global !== "undefined") {
2537
+ return global;
2538
+ }
2539
+ throw "Unable to locate global object";
2540
+ })();
2629
2541
  function toTimestamp(date) {
2630
2542
  const seconds = date.getTime() / 1000;
2631
2543
  const nanos = (date.getTime() % 1000) * 1000000;
2632
2544
  return { seconds, nanos };
2633
2545
  }
2634
2546
  function fromTimestamp(t) {
2635
- let millis = (t.seconds || 0) * 1000;
2636
- millis += (t.nanos || 0) / 1000000;
2637
- return new globalThis.Date(millis);
2547
+ let millis = t.seconds * 1000;
2548
+ millis += t.nanos / 1000000;
2549
+ return new Date(millis);
2638
2550
  }
2639
2551
  function fromJsonTimestamp(o) {
2640
- if (o instanceof globalThis.Date) {
2552
+ if (o instanceof Date) {
2641
2553
  return o;
2642
2554
  }
2643
2555
  else if (typeof o === "string") {
2644
- return new globalThis.Date(o);
2556
+ return new Date(o);
2645
2557
  }
2646
2558
  else {
2647
2559
  return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
@@ -2650,7 +2562,7 @@ function fromJsonTimestamp(o) {
2650
2562
  function isSet(value) {
2651
2563
  return value !== null && value !== undefined;
2652
2564
  }
2653
- class GrpcWebError extends globalThis.Error {
2565
+ class GrpcWebError extends tsProtoGlobalThis.Error {
2654
2566
  constructor(message, code, metadata) {
2655
2567
  super(message);
2656
2568
  this.code = code;