@lazycatcloud/sdk 0.1.29 → 0.1.30

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 (101) hide show
  1. package/dist/common/box.d.ts +11 -6
  2. package/dist/common/box.d.ts.map +1 -1
  3. package/dist/common/box.js +31 -41
  4. package/dist/common/box.js.map +1 -1
  5. package/dist/common/browseronly.d.ts +10 -5
  6. package/dist/common/browseronly.d.ts.map +1 -1
  7. package/dist/common/browseronly.js +22 -27
  8. package/dist/common/browseronly.js.map +1 -1
  9. package/dist/common/end_device.d.ts +14 -9
  10. package/dist/common/end_device.d.ts.map +1 -1
  11. package/dist/common/end_device.js +28 -45
  12. package/dist/common/end_device.js.map +1 -1
  13. package/dist/common/gateway.d.ts +11 -6
  14. package/dist/common/gateway.d.ts.map +1 -1
  15. package/dist/common/gateway.js +24 -37
  16. package/dist/common/gateway.js.map +1 -1
  17. package/dist/common/peripheral_device.d.ts +14 -9
  18. package/dist/common/peripheral_device.d.ts.map +1 -1
  19. package/dist/common/peripheral_device.js +24 -24
  20. package/dist/common/peripheral_device.js.map +1 -1
  21. package/dist/common/security_context.d.ts +13 -8
  22. package/dist/common/security_context.d.ts.map +1 -1
  23. package/dist/common/security_context.js +21 -37
  24. package/dist/common/security_context.js.map +1 -1
  25. package/dist/common/users.d.ts +18 -13
  26. package/dist/common/users.d.ts.map +1 -1
  27. package/dist/common/users.js +20 -28
  28. package/dist/common/users.js.map +1 -1
  29. package/dist/google/protobuf/descriptor.d.ts +1643 -1644
  30. package/dist/google/protobuf/descriptor.d.ts.map +1 -1
  31. package/dist/google/protobuf/descriptor.js +196 -420
  32. package/dist/google/protobuf/descriptor.js.map +1 -1
  33. package/dist/google/protobuf/empty.d.ts +1 -1
  34. package/dist/google/protobuf/empty.d.ts.map +1 -1
  35. package/dist/google/protobuf/empty.js.map +1 -1
  36. package/dist/google/protobuf/timestamp.d.ts +1 -3
  37. package/dist/google/protobuf/timestamp.d.ts.map +1 -1
  38. package/dist/google/protobuf/timestamp.js +9 -6
  39. package/dist/google/protobuf/timestamp.js.map +1 -1
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +2 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/localdevice/clipboard.d.ts +10 -5
  45. package/dist/localdevice/clipboard.d.ts.map +1 -1
  46. package/dist/localdevice/clipboard.js +46 -40
  47. package/dist/localdevice/clipboard.js.map +1 -1
  48. package/dist/localdevice/device.d.ts +7 -2
  49. package/dist/localdevice/device.d.ts.map +1 -1
  50. package/dist/localdevice/device.js +12 -8
  51. package/dist/localdevice/device.js.map +1 -1
  52. package/dist/localdevice/dialog.d.ts +11 -6
  53. package/dist/localdevice/dialog.d.ts.map +1 -1
  54. package/dist/localdevice/dialog.js +15 -16
  55. package/dist/localdevice/dialog.js.map +1 -1
  56. package/dist/localdevice/network.d.ts +7 -2
  57. package/dist/localdevice/network.d.ts.map +1 -1
  58. package/dist/localdevice/network.js +13 -10
  59. package/dist/localdevice/network.js.map +1 -1
  60. package/dist/localdevice/photo.d.ts +24 -19
  61. package/dist/localdevice/photo.d.ts.map +1 -1
  62. package/dist/localdevice/photo.js +74 -160
  63. package/dist/localdevice/photo.js.map +1 -1
  64. package/dist/package.json +1 -1
  65. package/dist/sys/OS_snapshot.d.ts +25 -20
  66. package/dist/sys/OS_snapshot.d.ts.map +1 -1
  67. package/dist/sys/OS_snapshot.js +51 -85
  68. package/dist/sys/OS_snapshot.js.map +1 -1
  69. package/dist/sys/OS_upgrader.d.ts +12 -7
  70. package/dist/sys/OS_upgrader.d.ts.map +1 -1
  71. package/dist/sys/OS_upgrader.js +32 -43
  72. package/dist/sys/OS_upgrader.js.map +1 -1
  73. package/dist/sys/hc-core/hc-core.d.ts +35 -30
  74. package/dist/sys/hc-core/hc-core.d.ts.map +1 -1
  75. package/dist/sys/hc-core/hc-core.js +62 -83
  76. package/dist/sys/hc-core/hc-core.js.map +1 -1
  77. package/dist/sys/ingress.d.ts +16 -11
  78. package/dist/sys/ingress.d.ts.map +1 -1
  79. package/dist/sys/ingress.js +28 -37
  80. package/dist/sys/ingress.js.map +1 -1
  81. package/dist/sys/network_manager.d.ts +15 -10
  82. package/dist/sys/network_manager.d.ts.map +1 -1
  83. package/dist/sys/network_manager.js +32 -70
  84. package/dist/sys/network_manager.js.map +1 -1
  85. package/dist/sys/package_manager.d.ts +31 -26
  86. package/dist/sys/package_manager.d.ts.map +1 -1
  87. package/dist/sys/package_manager.js +48 -87
  88. package/dist/sys/package_manager.js.map +1 -1
  89. package/dist/sys/portal-server/portal-server.d.ts +38 -33
  90. package/dist/sys/portal-server/portal-server.d.ts.map +1 -1
  91. package/dist/sys/portal-server/portal-server.js +85 -165
  92. package/dist/sys/portal-server/portal-server.js.map +1 -1
  93. package/dist/sys/snapd.d.ts +17 -12
  94. package/dist/sys/snapd.d.ts.map +1 -1
  95. package/dist/sys/snapd.js +30 -54
  96. package/dist/sys/snapd.js.map +1 -1
  97. package/package.json +1 -1
  98. package/dist/common/permissions.d.ts +0 -94
  99. package/dist/common/permissions.d.ts.map +0 -1
  100. package/dist/common/permissions.js +0 -247
  101. package/dist/common/permissions.js.map +0 -1
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HPortalSysCreateUserDesc = exports.HPortalSysDeleteUserDesc = exports.HPortalSysResetPasswordDesc = exports.HPortalSysChangeRoleDesc = exports.HPortalSysQueryRoleDesc = exports.HPortalSysListUsersDesc = exports.HPortalSysPairDevicesDesc = exports.HPortalSysFreeVirtualExternalIPDesc = exports.HPortalSysAllocVirtualExternalIPDesc = exports.HPortalSysGetAppCertDesc = exports.HPortalSysGetDomainCertDesc = exports.HPortalSysQueryBoxInfoDesc = exports.HPortalSysQueryDeviceByIDDesc = exports.HPortalSysListDevicesDesc = exports.HPortalSysQueryLoginDesc = exports.HPortalSysDesc = exports.HPortalSysClientImpl = exports.LogoutRequest = exports.ForceResetPasswordRequest = exports.CreateUserRequest = exports.DeleteUserRequest = exports.ResetPasswordRequest = exports.QueryRoleReply = exports.ChangeRoleReqeust = exports.UserID = exports.ListDeviceReply = exports.ListDeviceRequest = exports.Device = exports.DomainCertReply = exports.DomainCertRequest = exports.BoxInfo = exports.DeviceID = exports.LoginInfo = exports.AuthToken = exports.AppCertReply = exports.AppCertRequest = exports.FreeVEIPReply = exports.FreeVEIPRequest = exports.AllocVEIPReply = exports.AllocVEIPRequest = exports.PairDevicesRequest = exports.ListUsersReply = exports.UserInvitation = exports.GenUserInvitationRequest = exports.logoutRequest_ReasonToJSON = exports.logoutRequest_ReasonFromJSON = exports.LogoutRequest_Reason = exports.roleToJSON = exports.roleFromJSON = exports.Role = void 0;
7
- exports.GrpcWebImpl = exports.HPortalSysLogoutDesc = exports.HPortalSysGenUserInvitationDesc = exports.HPortalSysForceResetPasswordDesc = void 0;
7
+ exports.GrpcWebError = exports.GrpcWebImpl = exports.HPortalSysLogoutDesc = exports.HPortalSysGenUserInvitationDesc = exports.HPortalSysForceResetPasswordDesc = void 0;
8
8
  /* eslint-disable */
9
9
  const grpc_web_1 = require("@improbable-eng/grpc-web");
10
- const empty_1 = require("../../google/protobuf/empty");
11
10
  const browser_headers_1 = require("browser-headers");
11
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
12
+ const rxjs_1 = require("rxjs");
12
13
  const operators_1 = require("rxjs/operators");
14
+ const empty_1 = require("../../google/protobuf/empty");
13
15
  const timestamp_1 = require("../../google/protobuf/timestamp");
14
- const rxjs_1 = require("rxjs");
15
- const minimal_1 = __importDefault(require("protobufjs/minimal"));
16
16
  var Role;
17
17
  (function (Role) {
18
18
  Role[Role["NORMAL"] = 0] = "NORMAL";
@@ -80,12 +80,7 @@ function logoutRequest_ReasonToJSON(object) {
80
80
  }
81
81
  exports.logoutRequest_ReasonToJSON = logoutRequest_ReasonToJSON;
82
82
  function createBaseGenUserInvitationRequest() {
83
- return {
84
- limitUid: undefined,
85
- notAfter: undefined,
86
- limitUsageCount: undefined,
87
- limitRole: undefined,
88
- };
83
+ return { limitUid: undefined, notAfter: undefined, limitUsageCount: undefined, limitRole: undefined };
89
84
  }
90
85
  exports.GenUserInvitationRequest = {
91
86
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -132,29 +127,18 @@ exports.GenUserInvitationRequest = {
132
127
  fromJSON(object) {
133
128
  return {
134
129
  limitUid: isSet(object.limitUid) ? String(object.limitUid) : undefined,
135
- notAfter: isSet(object.notAfter)
136
- ? fromJsonTimestamp(object.notAfter)
137
- : undefined,
138
- limitUsageCount: isSet(object.limitUsageCount)
139
- ? Number(object.limitUsageCount)
140
- : undefined,
141
- limitRole: isSet(object.limitRole)
142
- ? roleFromJSON(object.limitRole)
143
- : undefined,
130
+ notAfter: isSet(object.notAfter) ? fromJsonTimestamp(object.notAfter) : undefined,
131
+ limitUsageCount: isSet(object.limitUsageCount) ? Number(object.limitUsageCount) : undefined,
132
+ limitRole: isSet(object.limitRole) ? roleFromJSON(object.limitRole) : undefined,
144
133
  };
145
134
  },
146
135
  toJSON(message) {
147
136
  const obj = {};
148
137
  message.limitUid !== undefined && (obj.limitUid = message.limitUid);
149
- message.notAfter !== undefined &&
150
- (obj.notAfter = message.notAfter.toISOString());
151
- message.limitUsageCount !== undefined &&
152
- (obj.limitUsageCount = Math.round(message.limitUsageCount));
138
+ message.notAfter !== undefined && (obj.notAfter = message.notAfter.toISOString());
139
+ message.limitUsageCount !== undefined && (obj.limitUsageCount = Math.round(message.limitUsageCount));
153
140
  message.limitRole !== undefined &&
154
- (obj.limitRole =
155
- message.limitRole !== undefined
156
- ? roleToJSON(message.limitRole)
157
- : undefined);
141
+ (obj.limitRole = message.limitRole !== undefined ? roleToJSON(message.limitRole) : undefined);
158
142
  return obj;
159
143
  },
160
144
  fromPartial(object) {
@@ -195,9 +179,7 @@ exports.UserInvitation = {
195
179
  return message;
196
180
  },
197
181
  fromJSON(object) {
198
- return {
199
- token: isSet(object.token) ? String(object.token) : "",
200
- };
182
+ return { token: isSet(object.token) ? String(object.token) : "" };
201
183
  },
202
184
  toJSON(message) {
203
185
  const obj = {};
@@ -239,11 +221,7 @@ exports.ListUsersReply = {
239
221
  return message;
240
222
  },
241
223
  fromJSON(object) {
242
- return {
243
- uids: Array.isArray(object === null || object === void 0 ? void 0 : object.uids)
244
- ? object.uids.map((e) => String(e))
245
- : [],
246
- };
224
+ return { uids: Array.isArray(object === null || object === void 0 ? void 0 : object.uids) ? object.uids.map((e) => String(e)) : [] };
247
225
  },
248
226
  toJSON(message) {
249
227
  const obj = {};
@@ -298,9 +276,7 @@ exports.PairDevicesRequest = {
298
276
  fromJSON(object) {
299
277
  return {
300
278
  srcId: isSet(object.srcId) ? String(object.srcId) : "",
301
- otherIds: Array.isArray(object === null || object === void 0 ? void 0 : object.otherIds)
302
- ? object.otherIds.map((e) => String(e))
303
- : [],
279
+ otherIds: Array.isArray(object === null || object === void 0 ? void 0 : object.otherIds) ? object.otherIds.map((e) => String(e)) : [],
304
280
  };
305
281
  },
306
282
  toJSON(message) {
@@ -403,9 +379,7 @@ exports.AllocVEIPReply = {
403
379
  return message;
404
380
  },
405
381
  fromJSON(object) {
406
- return {
407
- ip: isSet(object.ip) ? String(object.ip) : "",
408
- };
382
+ return { ip: isSet(object.ip) ? String(object.ip) : "" };
409
383
  },
410
384
  toJSON(message) {
411
385
  const obj = {};
@@ -461,8 +435,7 @@ exports.FreeVEIPRequest = {
461
435
  toJSON(message) {
462
436
  const obj = {};
463
437
  message.ip !== undefined && (obj.ip = message.ip);
464
- message.waitSecond !== undefined &&
465
- (obj.waitSecond = Math.round(message.waitSecond));
438
+ message.waitSecond !== undefined && (obj.waitSecond = Math.round(message.waitSecond));
466
439
  return obj;
467
440
  },
468
441
  fromPartial(object) {
@@ -549,17 +522,14 @@ exports.AppCertRequest = {
549
522
  return {
550
523
  appid: isSet(object.appid) ? String(object.appid) : "",
551
524
  uid: isSet(object.uid) ? String(object.uid) : "",
552
- validSeconds: isSet(object.validSeconds)
553
- ? Number(object.validSeconds)
554
- : 0,
525
+ validSeconds: isSet(object.validSeconds) ? Number(object.validSeconds) : 0,
555
526
  };
556
527
  },
557
528
  toJSON(message) {
558
529
  const obj = {};
559
530
  message.appid !== undefined && (obj.appid = message.appid);
560
531
  message.uid !== undefined && (obj.uid = message.uid);
561
- message.validSeconds !== undefined &&
562
- (obj.validSeconds = Math.round(message.validSeconds));
532
+ message.validSeconds !== undefined && (obj.validSeconds = Math.round(message.validSeconds));
563
533
  return obj;
564
534
  },
565
535
  fromPartial(object) {
@@ -634,12 +604,7 @@ exports.AppCertReply = {
634
604
  },
635
605
  };
636
606
  function createBaseAuthToken() {
637
- return {
638
- token: "",
639
- autologinTokenPostUrl: "",
640
- accessIp: "",
641
- autologinRedirectUrl: "",
642
- };
607
+ return { token: "", autologinTokenPostUrl: "", accessIp: "", autologinRedirectUrl: "" };
643
608
  }
644
609
  exports.AuthToken = {
645
610
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -686,23 +651,17 @@ exports.AuthToken = {
686
651
  fromJSON(object) {
687
652
  return {
688
653
  token: isSet(object.token) ? String(object.token) : "",
689
- autologinTokenPostUrl: isSet(object.autologinTokenPostUrl)
690
- ? String(object.autologinTokenPostUrl)
691
- : "",
654
+ autologinTokenPostUrl: isSet(object.autologinTokenPostUrl) ? String(object.autologinTokenPostUrl) : "",
692
655
  accessIp: isSet(object.accessIp) ? String(object.accessIp) : "",
693
- autologinRedirectUrl: isSet(object.autologinRedirectUrl)
694
- ? String(object.autologinRedirectUrl)
695
- : "",
656
+ autologinRedirectUrl: isSet(object.autologinRedirectUrl) ? String(object.autologinRedirectUrl) : "",
696
657
  };
697
658
  },
698
659
  toJSON(message) {
699
660
  const obj = {};
700
661
  message.token !== undefined && (obj.token = message.token);
701
- message.autologinTokenPostUrl !== undefined &&
702
- (obj.autologinTokenPostUrl = message.autologinTokenPostUrl);
662
+ message.autologinTokenPostUrl !== undefined && (obj.autologinTokenPostUrl = message.autologinTokenPostUrl);
703
663
  message.accessIp !== undefined && (obj.accessIp = message.accessIp);
704
- message.autologinRedirectUrl !== undefined &&
705
- (obj.autologinRedirectUrl = message.autologinRedirectUrl);
664
+ message.autologinRedirectUrl !== undefined && (obj.autologinRedirectUrl = message.autologinRedirectUrl);
706
665
  return obj;
707
666
  },
708
667
  fromPartial(object) {
@@ -716,12 +675,7 @@ exports.AuthToken = {
716
675
  },
717
676
  };
718
677
  function createBaseLoginInfo() {
719
- return {
720
- uid: "",
721
- deviceId: "",
722
- when: undefined,
723
- autologinTokenRequestContent: "",
724
- };
678
+ return { uid: "", deviceId: "", when: undefined, autologinTokenRequestContent: "" };
725
679
  }
726
680
  exports.LoginInfo = {
727
681
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -790,8 +744,7 @@ exports.LoginInfo = {
790
744
  message.uid = (_a = object.uid) !== null && _a !== void 0 ? _a : "";
791
745
  message.deviceId = (_b = object.deviceId) !== null && _b !== void 0 ? _b : "";
792
746
  message.when = (_c = object.when) !== null && _c !== void 0 ? _c : undefined;
793
- message.autologinTokenRequestContent =
794
- (_d = object.autologinTokenRequestContent) !== null && _d !== void 0 ? _d : "";
747
+ message.autologinTokenRequestContent = (_d = object.autologinTokenRequestContent) !== null && _d !== void 0 ? _d : "";
795
748
  return message;
796
749
  },
797
750
  };
@@ -823,9 +776,7 @@ exports.DeviceID = {
823
776
  return message;
824
777
  },
825
778
  fromJSON(object) {
826
- return {
827
- id: isSet(object.id) ? String(object.id) : "",
828
- };
779
+ return { id: isSet(object.id) ? String(object.id) : "" };
829
780
  },
830
781
  toJSON(message) {
831
782
  const obj = {};
@@ -840,15 +791,7 @@ exports.DeviceID = {
840
791
  },
841
792
  };
842
793
  function createBaseBoxInfo() {
843
- return {
844
- originServer: "",
845
- virtualIp: "",
846
- boxId: "",
847
- boxName: "",
848
- boxDomain: "",
849
- certReady: false,
850
- boxCert: "",
851
- };
794
+ return { originServer: "", virtualIp: "", boxId: "", boxName: "", boxDomain: "", certReady: false, boxCert: "" };
852
795
  }
853
796
  exports.BoxInfo = {
854
797
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -912,9 +855,7 @@ exports.BoxInfo = {
912
855
  },
913
856
  fromJSON(object) {
914
857
  return {
915
- originServer: isSet(object.originServer)
916
- ? String(object.originServer)
917
- : "",
858
+ originServer: isSet(object.originServer) ? String(object.originServer) : "",
918
859
  virtualIp: isSet(object.virtualIp) ? String(object.virtualIp) : "",
919
860
  boxId: isSet(object.boxId) ? String(object.boxId) : "",
920
861
  boxName: isSet(object.boxName) ? String(object.boxName) : "",
@@ -925,8 +866,7 @@ exports.BoxInfo = {
925
866
  },
926
867
  toJSON(message) {
927
868
  const obj = {};
928
- message.originServer !== undefined &&
929
- (obj.originServer = message.originServer);
869
+ message.originServer !== undefined && (obj.originServer = message.originServer);
930
870
  message.virtualIp !== undefined && (obj.virtualIp = message.virtualIp);
931
871
  message.boxId !== undefined && (obj.boxId = message.boxId);
932
872
  message.boxName !== undefined && (obj.boxName = message.boxName);
@@ -976,9 +916,7 @@ exports.DomainCertRequest = {
976
916
  return message;
977
917
  },
978
918
  fromJSON(object) {
979
- return {
980
- domain: isSet(object.domain) ? String(object.domain) : "",
981
- };
919
+ return { domain: isSet(object.domain) ? String(object.domain) : "" };
982
920
  },
983
921
  toJSON(message) {
984
922
  const obj = {};
@@ -1035,9 +973,7 @@ exports.DomainCertReply = {
1035
973
  return {
1036
974
  cert: isSet(object.cert) ? String(object.cert) : "",
1037
975
  key: isSet(object.key) ? String(object.key) : "",
1038
- ocsp: isSet(object.ocsp)
1039
- ? bytesFromBase64(object.ocsp)
1040
- : new Uint8Array(),
976
+ ocsp: isSet(object.ocsp) ? bytesFromBase64(object.ocsp) : new Uint8Array(),
1041
977
  };
1042
978
  },
1043
979
  toJSON(message) {
@@ -1058,15 +994,7 @@ exports.DomainCertReply = {
1058
994
  },
1059
995
  };
1060
996
  function createBaseDevice() {
1061
- return {
1062
- udid: "",
1063
- peerId: "",
1064
- isOnline: false,
1065
- deviceApiUrl: "",
1066
- name: "",
1067
- model: "",
1068
- bindingTime: undefined,
1069
- };
997
+ return { udid: "", peerId: "", isOnline: false, deviceApiUrl: "", name: "", model: "", bindingTime: undefined };
1070
998
  }
1071
999
  exports.Device = {
1072
1000
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1133,14 +1061,10 @@ exports.Device = {
1133
1061
  udid: isSet(object.udid) ? String(object.udid) : "",
1134
1062
  peerId: isSet(object.peerId) ? String(object.peerId) : "",
1135
1063
  isOnline: isSet(object.isOnline) ? Boolean(object.isOnline) : false,
1136
- deviceApiUrl: isSet(object.deviceApiUrl)
1137
- ? String(object.deviceApiUrl)
1138
- : "",
1064
+ deviceApiUrl: isSet(object.deviceApiUrl) ? String(object.deviceApiUrl) : "",
1139
1065
  name: isSet(object.name) ? String(object.name) : "",
1140
1066
  model: isSet(object.model) ? String(object.model) : "",
1141
- bindingTime: isSet(object.bindingTime)
1142
- ? fromJsonTimestamp(object.bindingTime)
1143
- : undefined,
1067
+ bindingTime: isSet(object.bindingTime) ? fromJsonTimestamp(object.bindingTime) : undefined,
1144
1068
  };
1145
1069
  },
1146
1070
  toJSON(message) {
@@ -1148,12 +1072,10 @@ exports.Device = {
1148
1072
  message.udid !== undefined && (obj.udid = message.udid);
1149
1073
  message.peerId !== undefined && (obj.peerId = message.peerId);
1150
1074
  message.isOnline !== undefined && (obj.isOnline = message.isOnline);
1151
- message.deviceApiUrl !== undefined &&
1152
- (obj.deviceApiUrl = message.deviceApiUrl);
1075
+ message.deviceApiUrl !== undefined && (obj.deviceApiUrl = message.deviceApiUrl);
1153
1076
  message.name !== undefined && (obj.name = message.name);
1154
1077
  message.model !== undefined && (obj.model = message.model);
1155
- message.bindingTime !== undefined &&
1156
- (obj.bindingTime = message.bindingTime.toISOString());
1078
+ message.bindingTime !== undefined && (obj.bindingTime = message.bindingTime.toISOString());
1157
1079
  return obj;
1158
1080
  },
1159
1081
  fromPartial(object) {
@@ -1197,9 +1119,7 @@ exports.ListDeviceRequest = {
1197
1119
  return message;
1198
1120
  },
1199
1121
  fromJSON(object) {
1200
- return {
1201
- uid: isSet(object.uid) ? String(object.uid) : "",
1202
- };
1122
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1203
1123
  },
1204
1124
  toJSON(message) {
1205
1125
  const obj = {};
@@ -1241,11 +1161,7 @@ exports.ListDeviceReply = {
1241
1161
  return message;
1242
1162
  },
1243
1163
  fromJSON(object) {
1244
- return {
1245
- devices: Array.isArray(object === null || object === void 0 ? void 0 : object.devices)
1246
- ? object.devices.map((e) => exports.Device.fromJSON(e))
1247
- : [],
1248
- };
1164
+ return { devices: Array.isArray(object === null || object === void 0 ? void 0 : object.devices) ? object.devices.map((e) => exports.Device.fromJSON(e)) : [] };
1249
1165
  },
1250
1166
  toJSON(message) {
1251
1167
  const obj = {};
@@ -1292,9 +1208,7 @@ exports.UserID = {
1292
1208
  return message;
1293
1209
  },
1294
1210
  fromJSON(object) {
1295
- return {
1296
- uid: isSet(object.uid) ? String(object.uid) : "",
1297
- };
1211
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1298
1212
  },
1299
1213
  toJSON(message) {
1300
1214
  const obj = {};
@@ -1463,10 +1377,8 @@ exports.ResetPasswordRequest = {
1463
1377
  toJSON(message) {
1464
1378
  const obj = {};
1465
1379
  message.uid !== undefined && (obj.uid = message.uid);
1466
- message.oldPassword !== undefined &&
1467
- (obj.oldPassword = message.oldPassword);
1468
- message.newPassword !== undefined &&
1469
- (obj.newPassword = message.newPassword);
1380
+ message.oldPassword !== undefined && (obj.oldPassword = message.oldPassword);
1381
+ message.newPassword !== undefined && (obj.newPassword = message.newPassword);
1470
1382
  return obj;
1471
1383
  },
1472
1384
  fromPartial(object) {
@@ -1506,9 +1418,7 @@ exports.DeleteUserRequest = {
1506
1418
  return message;
1507
1419
  },
1508
1420
  fromJSON(object) {
1509
- return {
1510
- uid: isSet(object.uid) ? String(object.uid) : "",
1511
- };
1421
+ return { uid: isSet(object.uid) ? String(object.uid) : "" };
1512
1422
  },
1513
1423
  toJSON(message) {
1514
1424
  const obj = {};
@@ -1626,8 +1536,7 @@ exports.ForceResetPasswordRequest = {
1626
1536
  toJSON(message) {
1627
1537
  const obj = {};
1628
1538
  message.uid !== undefined && (obj.uid = message.uid);
1629
- message.newPassword !== undefined &&
1630
- (obj.newPassword = message.newPassword);
1539
+ message.newPassword !== undefined && (obj.newPassword = message.newPassword);
1631
1540
  return obj;
1632
1541
  },
1633
1542
  fromPartial(object) {
@@ -1681,17 +1590,14 @@ exports.LogoutRequest = {
1681
1590
  return {
1682
1591
  uid: isSet(object.uid) ? String(object.uid) : "",
1683
1592
  udid: isSet(object.udid) ? String(object.udid) : "",
1684
- reason: isSet(object.reason)
1685
- ? logoutRequest_ReasonFromJSON(object.reason)
1686
- : 0,
1593
+ reason: isSet(object.reason) ? logoutRequest_ReasonFromJSON(object.reason) : 0,
1687
1594
  };
1688
1595
  },
1689
1596
  toJSON(message) {
1690
1597
  const obj = {};
1691
1598
  message.uid !== undefined && (obj.uid = message.uid);
1692
1599
  message.udid !== undefined && (obj.udid = message.udid);
1693
- message.reason !== undefined &&
1694
- (obj.reason = logoutRequest_ReasonToJSON(message.reason));
1600
+ message.reason !== undefined && (obj.reason = logoutRequest_ReasonToJSON(message.reason));
1695
1601
  return obj;
1696
1602
  },
1697
1603
  fromPartial(object) {
@@ -1781,9 +1687,7 @@ class HPortalSysClientImpl {
1781
1687
  }
1782
1688
  }
1783
1689
  exports.HPortalSysClientImpl = HPortalSysClientImpl;
1784
- exports.HPortalSysDesc = {
1785
- serviceName: "cloud.lazycat.apis.sys.HPortalSys",
1786
- };
1690
+ exports.HPortalSysDesc = { serviceName: "cloud.lazycat.apis.sys.HPortalSys" };
1787
1691
  exports.HPortalSysQueryLoginDesc = {
1788
1692
  methodName: "QueryLogin",
1789
1693
  service: exports.HPortalSysDesc,
@@ -2131,9 +2035,7 @@ class GrpcWebImpl {
2131
2035
  resolve(response.message);
2132
2036
  }
2133
2037
  else {
2134
- const err = new Error(response.statusMessage);
2135
- err.code = response.status;
2136
- err.metadata = response.trailers;
2038
+ const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
2137
2039
  reject(err);
2138
2040
  }
2139
2041
  },
@@ -2149,7 +2051,7 @@ class GrpcWebImpl {
2149
2051
  ? 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))
2150
2052
  : metadata || this.options.metadata;
2151
2053
  return new rxjs_1.Observable((observer) => {
2152
- const upStream = () => {
2054
+ const upStream = (() => {
2153
2055
  const client = grpc_web_1.grpc.invoke(methodDesc, {
2154
2056
  host: this.host,
2155
2057
  request,
@@ -2173,41 +2075,51 @@ class GrpcWebImpl {
2173
2075
  },
2174
2076
  });
2175
2077
  observer.add(() => client.close());
2176
- };
2078
+ });
2177
2079
  upStream();
2178
2080
  }).pipe((0, operators_1.share)());
2179
2081
  }
2180
2082
  }
2181
2083
  exports.GrpcWebImpl = GrpcWebImpl;
2182
2084
  var globalThis = (() => {
2183
- if (typeof globalThis !== "undefined")
2085
+ if (typeof globalThis !== "undefined") {
2184
2086
  return globalThis;
2185
- if (typeof self !== "undefined")
2087
+ }
2088
+ if (typeof self !== "undefined") {
2186
2089
  return self;
2187
- if (typeof window !== "undefined")
2090
+ }
2091
+ if (typeof window !== "undefined") {
2188
2092
  return window;
2189
- if (typeof global !== "undefined")
2093
+ }
2094
+ if (typeof global !== "undefined") {
2190
2095
  return global;
2096
+ }
2191
2097
  throw "Unable to locate global object";
2192
2098
  })();
2193
- const atob = globalThis.atob ||
2194
- ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
2195
2099
  function bytesFromBase64(b64) {
2196
- const bin = atob(b64);
2197
- const arr = new Uint8Array(bin.length);
2198
- for (let i = 0; i < bin.length; ++i) {
2199
- arr[i] = bin.charCodeAt(i);
2100
+ if (globalThis.Buffer) {
2101
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
2102
+ }
2103
+ else {
2104
+ const bin = globalThis.atob(b64);
2105
+ const arr = new Uint8Array(bin.length);
2106
+ for (let i = 0; i < bin.length; ++i) {
2107
+ arr[i] = bin.charCodeAt(i);
2108
+ }
2109
+ return arr;
2200
2110
  }
2201
- return arr;
2202
2111
  }
2203
- const btoa = globalThis.btoa ||
2204
- ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
2205
2112
  function base64FromBytes(arr) {
2206
- const bin = [];
2207
- arr.forEach((byte) => {
2208
- bin.push(String.fromCharCode(byte));
2209
- });
2210
- return btoa(bin.join(""));
2113
+ if (globalThis.Buffer) {
2114
+ return globalThis.Buffer.from(arr).toString("base64");
2115
+ }
2116
+ else {
2117
+ const bin = [];
2118
+ arr.forEach((byte) => {
2119
+ bin.push(String.fromCharCode(byte));
2120
+ });
2121
+ return globalThis.btoa(bin.join(""));
2122
+ }
2211
2123
  }
2212
2124
  function toTimestamp(date) {
2213
2125
  const seconds = date.getTime() / 1000;
@@ -2233,4 +2145,12 @@ function fromJsonTimestamp(o) {
2233
2145
  function isSet(value) {
2234
2146
  return value !== null && value !== undefined;
2235
2147
  }
2148
+ class GrpcWebError extends Error {
2149
+ constructor(message, code, metadata) {
2150
+ super(message);
2151
+ this.code = code;
2152
+ this.metadata = metadata;
2153
+ }
2154
+ }
2155
+ exports.GrpcWebError = GrpcWebError;
2236
2156
  //# sourceMappingURL=portal-server.js.map