@lazycatcloud/sdk 0.1.295 → 0.1.296

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