@lazycatcloud/sdk 0.1.457 → 0.1.459

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 (51) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/localdevice/ble.d.ts +414 -0
  6. package/dist/localdevice/ble.d.ts.map +1 -0
  7. package/dist/localdevice/ble.js +859 -0
  8. package/dist/localdevice/ble.js.map +1 -0
  9. package/dist/package.json +1 -1
  10. package/dist/sys/hal.d.ts +174 -0
  11. package/dist/sys/hal.d.ts.map +1 -1
  12. package/dist/sys/hal.js +553 -1
  13. package/dist/sys/hal.js.map +1 -1
  14. package/dist/sys/package_manager.d.ts +524 -214
  15. package/dist/sys/package_manager.d.ts.map +1 -1
  16. package/dist/sys/package_manager.js +741 -323
  17. package/dist/sys/package_manager.js.map +1 -1
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +1 -1
  20. package/dist/localdevice/clipboard.d.ts +0 -137
  21. package/dist/localdevice/clipboard.d.ts.map +0 -1
  22. package/dist/localdevice/clipboard.js +0 -433
  23. package/dist/localdevice/clipboard.js.map +0 -1
  24. package/dist/sys/OS_snapshot.d.ts +0 -585
  25. package/dist/sys/OS_snapshot.d.ts.map +0 -1
  26. package/dist/sys/OS_snapshot.js +0 -1543
  27. package/dist/sys/OS_snapshot.js.map +0 -1
  28. package/dist/sys/OS_upgrader.d.ts +0 -202
  29. package/dist/sys/OS_upgrader.d.ts.map +0 -1
  30. package/dist/sys/OS_upgrader.js +0 -639
  31. package/dist/sys/OS_upgrader.js.map +0 -1
  32. package/dist/sys/hc-core/hc-core.d.ts +0 -691
  33. package/dist/sys/hc-core/hc-core.d.ts.map +0 -1
  34. package/dist/sys/hc-core/hc-core.js +0 -1484
  35. package/dist/sys/hc-core/hc-core.js.map +0 -1
  36. package/dist/sys/installer.d.ts +0 -277
  37. package/dist/sys/installer.d.ts.map +0 -1
  38. package/dist/sys/installer.js +0 -796
  39. package/dist/sys/installer.js.map +0 -1
  40. package/dist/sys/osupgrader.d.ts +0 -256
  41. package/dist/sys/osupgrader.d.ts.map +0 -1
  42. package/dist/sys/osupgrader.js +0 -536
  43. package/dist/sys/osupgrader.js.map +0 -1
  44. package/dist/sys/portal-server/portal-server.d.ts +0 -947
  45. package/dist/sys/portal-server/portal-server.d.ts.map +0 -1
  46. package/dist/sys/portal-server/portal-server.js +0 -2756
  47. package/dist/sys/portal-server/portal-server.js.map +0 -1
  48. package/dist/sys/snapd.d.ts +0 -343
  49. package/dist/sys/snapd.d.ts.map +0 -1
  50. package/dist/sys/snapd.js +0 -798
  51. package/dist/sys/snapd.js.map +0 -1
package/dist/sys/hal.js CHANGED
@@ -3,14 +3,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GrpcWebError = exports.GrpcWebImpl = exports.FanServiceGetFanConfigDesc = exports.FanServiceSetFanConfigDesc = exports.FanServiceDesc = exports.FanServiceClientImpl = exports.HalServiceGetFanConfigDesc = exports.HalServiceSetFanConfigDesc = exports.HalServiceGetFanRpmDesc = exports.HalServiceGetButtonEventQueueDesc = exports.HalServiceSetSLedDesc = exports.HalServiceGetPLedDesc = exports.HalServiceSetPLedDesc = exports.HalServiceDesc = exports.HalServiceClientImpl = exports.FanRpm = exports.ButtonEventQueue_ButtonEvent = exports.ButtonEventQueue = exports.SLedState = exports.PLedState = exports.GetFanConfigResp = exports.GetFanConfigReq = exports.SetFanConfigResp = exports.SetFanConfigReq = exports.FanConfig = exports.buttonEventQueue_ButtonEventKindToJSON = exports.buttonEventQueue_ButtonEventKindFromJSON = exports.ButtonEventQueue_ButtonEventKind = exports.fanConfig_SpeedTypeToJSON = exports.fanConfig_SpeedTypeFromJSON = exports.FanConfig_SpeedType = void 0;
6
+ exports.GrpcWebError = exports.GrpcWebImpl = exports.FanServiceGetFanConfigDesc = exports.FanServiceSetFanConfigDesc = exports.FanServiceDesc = exports.FanServiceClientImpl = exports.HalServiceGetFanConfigDesc = exports.HalServiceSetFanConfigDesc = exports.HalServiceGetFanRpmDesc = exports.HalServiceSetPLedEffectDesc = exports.HalServiceTriggerWithButtonEventDesc = exports.HalServiceGetRawButtonEventDesc = exports.HalServiceGetButtonEventQueueDesc = exports.HalServiceSetSLedDesc = exports.HalServiceGetPLedDesc = exports.HalServiceSetPLedDesc = exports.HalServiceDesc = exports.HalServiceClientImpl = exports.FanRpm = exports.TriggerBtnRequest = exports.HIButtonEvent = exports.RawButtonEvent = exports.GetButtonEventRequest = exports.ButtonEventQueue_ButtonEvent = exports.ButtonEventQueue = exports.PLedEffect = exports.SLedState = exports.PLedState = exports.GetFanConfigResp = exports.GetFanConfigReq = exports.SetFanConfigResp = exports.SetFanConfigReq = exports.FanConfig = exports.rawButtonEvent_RawButtonKindToJSON = exports.rawButtonEvent_RawButtonKindFromJSON = exports.RawButtonEvent_RawButtonKind = exports.buttonEventQueue_ButtonEventKindToJSON = exports.buttonEventQueue_ButtonEventKindFromJSON = exports.ButtonEventQueue_ButtonEventKind = exports.pLedEffect_EffectToJSON = exports.pLedEffect_EffectFromJSON = exports.PLedEffect_Effect = exports.fanConfig_SpeedTypeToJSON = exports.fanConfig_SpeedTypeFromJSON = exports.FanConfig_SpeedType = exports.hIButtonKindToJSON = exports.hIButtonKindFromJSON = exports.HIButtonKind = void 0;
7
7
  /* eslint-disable */
8
8
  const grpc_web_1 = require("@improbable-eng/grpc-web");
9
9
  const browser_headers_1 = require("browser-headers");
10
10
  const long_1 = __importDefault(require("long"));
11
11
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
12
+ const rxjs_1 = require("rxjs");
13
+ const operators_1 = require("rxjs/operators");
12
14
  const empty_1 = require("../google/protobuf/empty");
13
15
  const timestamp_1 = require("../google/protobuf/timestamp");
16
+ var HIButtonKind;
17
+ (function (HIButtonKind) {
18
+ HIButtonKind[HIButtonKind["BUTTON_CLICK"] = 0] = "BUTTON_CLICK";
19
+ HIButtonKind[HIButtonKind["BUTTON_DOUBLE_CLICK"] = 1] = "BUTTON_DOUBLE_CLICK";
20
+ HIButtonKind[HIButtonKind["BUTTON_LONG_PRESS"] = 2] = "BUTTON_LONG_PRESS";
21
+ HIButtonKind[HIButtonKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
22
+ })(HIButtonKind = exports.HIButtonKind || (exports.HIButtonKind = {}));
23
+ function hIButtonKindFromJSON(object) {
24
+ switch (object) {
25
+ case 0:
26
+ case "BUTTON_CLICK":
27
+ return HIButtonKind.BUTTON_CLICK;
28
+ case 1:
29
+ case "BUTTON_DOUBLE_CLICK":
30
+ return HIButtonKind.BUTTON_DOUBLE_CLICK;
31
+ case 2:
32
+ case "BUTTON_LONG_PRESS":
33
+ return HIButtonKind.BUTTON_LONG_PRESS;
34
+ case -1:
35
+ case "UNRECOGNIZED":
36
+ default:
37
+ return HIButtonKind.UNRECOGNIZED;
38
+ }
39
+ }
40
+ exports.hIButtonKindFromJSON = hIButtonKindFromJSON;
41
+ function hIButtonKindToJSON(object) {
42
+ switch (object) {
43
+ case HIButtonKind.BUTTON_CLICK:
44
+ return "BUTTON_CLICK";
45
+ case HIButtonKind.BUTTON_DOUBLE_CLICK:
46
+ return "BUTTON_DOUBLE_CLICK";
47
+ case HIButtonKind.BUTTON_LONG_PRESS:
48
+ return "BUTTON_LONG_PRESS";
49
+ case HIButtonKind.UNRECOGNIZED:
50
+ default:
51
+ return "UNRECOGNIZED";
52
+ }
53
+ }
54
+ exports.hIButtonKindToJSON = hIButtonKindToJSON;
14
55
  /**
15
56
  * 静音模式:MANUAL , Percentage: 10 (较小值即可) 最低1000转左右
16
57
  * 智能模式:SMART , Percentage:100 (不需要),自动调节
@@ -57,6 +98,69 @@ function fanConfig_SpeedTypeToJSON(object) {
57
98
  }
58
99
  }
59
100
  exports.fanConfig_SpeedTypeToJSON = fanConfig_SpeedTypeToJSON;
101
+ var PLedEffect_Effect;
102
+ (function (PLedEffect_Effect) {
103
+ PLedEffect_Effect[PLedEffect_Effect["WAVE"] = 0] = "WAVE";
104
+ PLedEffect_Effect[PLedEffect_Effect["SEQUENTIAL_LTR"] = 1] = "SEQUENTIAL_LTR";
105
+ PLedEffect_Effect[PLedEffect_Effect["SEQUENTIAL_RTL"] = 2] = "SEQUENTIAL_RTL";
106
+ PLedEffect_Effect[PLedEffect_Effect["SWEEPING_LTR"] = 3] = "SWEEPING_LTR";
107
+ PLedEffect_Effect[PLedEffect_Effect["SWEEPING_RTL"] = 4] = "SWEEPING_RTL";
108
+ PLedEffect_Effect[PLedEffect_Effect["OSCILLATING"] = 5] = "OSCILLATING";
109
+ PLedEffect_Effect[PLedEffect_Effect["BLINK"] = 6] = "BLINK";
110
+ PLedEffect_Effect[PLedEffect_Effect["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
111
+ })(PLedEffect_Effect = exports.PLedEffect_Effect || (exports.PLedEffect_Effect = {}));
112
+ function pLedEffect_EffectFromJSON(object) {
113
+ switch (object) {
114
+ case 0:
115
+ case "WAVE":
116
+ return PLedEffect_Effect.WAVE;
117
+ case 1:
118
+ case "SEQUENTIAL_LTR":
119
+ return PLedEffect_Effect.SEQUENTIAL_LTR;
120
+ case 2:
121
+ case "SEQUENTIAL_RTL":
122
+ return PLedEffect_Effect.SEQUENTIAL_RTL;
123
+ case 3:
124
+ case "SWEEPING_LTR":
125
+ return PLedEffect_Effect.SWEEPING_LTR;
126
+ case 4:
127
+ case "SWEEPING_RTL":
128
+ return PLedEffect_Effect.SWEEPING_RTL;
129
+ case 5:
130
+ case "OSCILLATING":
131
+ return PLedEffect_Effect.OSCILLATING;
132
+ case 6:
133
+ case "BLINK":
134
+ return PLedEffect_Effect.BLINK;
135
+ case -1:
136
+ case "UNRECOGNIZED":
137
+ default:
138
+ return PLedEffect_Effect.UNRECOGNIZED;
139
+ }
140
+ }
141
+ exports.pLedEffect_EffectFromJSON = pLedEffect_EffectFromJSON;
142
+ function pLedEffect_EffectToJSON(object) {
143
+ switch (object) {
144
+ case PLedEffect_Effect.WAVE:
145
+ return "WAVE";
146
+ case PLedEffect_Effect.SEQUENTIAL_LTR:
147
+ return "SEQUENTIAL_LTR";
148
+ case PLedEffect_Effect.SEQUENTIAL_RTL:
149
+ return "SEQUENTIAL_RTL";
150
+ case PLedEffect_Effect.SWEEPING_LTR:
151
+ return "SWEEPING_LTR";
152
+ case PLedEffect_Effect.SWEEPING_RTL:
153
+ return "SWEEPING_RTL";
154
+ case PLedEffect_Effect.OSCILLATING:
155
+ return "OSCILLATING";
156
+ case PLedEffect_Effect.BLINK:
157
+ return "BLINK";
158
+ case PLedEffect_Effect.UNRECOGNIZED:
159
+ default:
160
+ return "UNRECOGNIZED";
161
+ }
162
+ }
163
+ exports.pLedEffect_EffectToJSON = pLedEffect_EffectToJSON;
60
164
  var ButtonEventQueue_ButtonEventKind;
61
165
  (function (ButtonEventQueue_ButtonEventKind) {
62
166
  /** BUTTON_DOWN - 按钮被按下 */
@@ -135,6 +239,39 @@ function buttonEventQueue_ButtonEventKindToJSON(object) {
135
239
  }
136
240
  }
137
241
  exports.buttonEventQueue_ButtonEventKindToJSON = buttonEventQueue_ButtonEventKindToJSON;
242
+ var RawButtonEvent_RawButtonKind;
243
+ (function (RawButtonEvent_RawButtonKind) {
244
+ RawButtonEvent_RawButtonKind[RawButtonEvent_RawButtonKind["BUTTON_DOWN"] = 0] = "BUTTON_DOWN";
245
+ RawButtonEvent_RawButtonKind[RawButtonEvent_RawButtonKind["BUTTON_UP"] = 1] = "BUTTON_UP";
246
+ RawButtonEvent_RawButtonKind[RawButtonEvent_RawButtonKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
247
+ })(RawButtonEvent_RawButtonKind = exports.RawButtonEvent_RawButtonKind || (exports.RawButtonEvent_RawButtonKind = {}));
248
+ function rawButtonEvent_RawButtonKindFromJSON(object) {
249
+ switch (object) {
250
+ case 0:
251
+ case "BUTTON_DOWN":
252
+ return RawButtonEvent_RawButtonKind.BUTTON_DOWN;
253
+ case 1:
254
+ case "BUTTON_UP":
255
+ return RawButtonEvent_RawButtonKind.BUTTON_UP;
256
+ case -1:
257
+ case "UNRECOGNIZED":
258
+ default:
259
+ return RawButtonEvent_RawButtonKind.UNRECOGNIZED;
260
+ }
261
+ }
262
+ exports.rawButtonEvent_RawButtonKindFromJSON = rawButtonEvent_RawButtonKindFromJSON;
263
+ function rawButtonEvent_RawButtonKindToJSON(object) {
264
+ switch (object) {
265
+ case RawButtonEvent_RawButtonKind.BUTTON_DOWN:
266
+ return "BUTTON_DOWN";
267
+ case RawButtonEvent_RawButtonKind.BUTTON_UP:
268
+ return "BUTTON_UP";
269
+ case RawButtonEvent_RawButtonKind.UNRECOGNIZED:
270
+ default:
271
+ return "UNRECOGNIZED";
272
+ }
273
+ }
274
+ exports.rawButtonEvent_RawButtonKindToJSON = rawButtonEvent_RawButtonKindToJSON;
138
275
  function createBaseFanConfig() {
139
276
  return { percentage: 0, speedType: 0 };
140
277
  }
@@ -499,6 +636,73 @@ exports.SLedState = {
499
636
  return message;
500
637
  },
501
638
  };
639
+ function createBasePLedEffect() {
640
+ return { effect: 0, speed: 0 };
641
+ }
642
+ exports.PLedEffect = {
643
+ encode(message, writer = minimal_1.default.Writer.create()) {
644
+ if (message.effect !== 0) {
645
+ writer.uint32(8).int32(message.effect);
646
+ }
647
+ if (message.speed !== 0) {
648
+ writer.uint32(16).int64(message.speed);
649
+ }
650
+ return writer;
651
+ },
652
+ decode(input, length) {
653
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
654
+ let end = length === undefined ? reader.len : reader.pos + length;
655
+ const message = createBasePLedEffect();
656
+ while (reader.pos < end) {
657
+ const tag = reader.uint32();
658
+ switch (tag >>> 3) {
659
+ case 1:
660
+ if (tag !== 8) {
661
+ break;
662
+ }
663
+ message.effect = reader.int32();
664
+ continue;
665
+ case 2:
666
+ if (tag !== 16) {
667
+ break;
668
+ }
669
+ message.speed = longToNumber(reader.int64());
670
+ continue;
671
+ }
672
+ if ((tag & 7) === 4 || tag === 0) {
673
+ break;
674
+ }
675
+ reader.skipType(tag & 7);
676
+ }
677
+ return message;
678
+ },
679
+ fromJSON(object) {
680
+ return {
681
+ effect: isSet(object.effect) ? pLedEffect_EffectFromJSON(object.effect) : 0,
682
+ speed: isSet(object.speed) ? Number(object.speed) : 0,
683
+ };
684
+ },
685
+ toJSON(message) {
686
+ const obj = {};
687
+ if (message.effect !== 0) {
688
+ obj.effect = pLedEffect_EffectToJSON(message.effect);
689
+ }
690
+ if (message.speed !== 0) {
691
+ obj.speed = Math.round(message.speed);
692
+ }
693
+ return obj;
694
+ },
695
+ create(base) {
696
+ return exports.PLedEffect.fromPartial(base !== null && base !== void 0 ? base : {});
697
+ },
698
+ fromPartial(object) {
699
+ var _a, _b;
700
+ const message = createBasePLedEffect();
701
+ message.effect = (_a = object.effect) !== null && _a !== void 0 ? _a : 0;
702
+ message.speed = (_b = object.speed) !== null && _b !== void 0 ? _b : 0;
703
+ return message;
704
+ },
705
+ };
502
706
  function createBaseButtonEventQueue() {
503
707
  return { queue: [] };
504
708
  }
@@ -620,6 +824,244 @@ exports.ButtonEventQueue_ButtonEvent = {
620
824
  return message;
621
825
  },
622
826
  };
827
+ function createBaseGetButtonEventRequest() {
828
+ return { SLedInteraction: false, PLedInteraction: false };
829
+ }
830
+ exports.GetButtonEventRequest = {
831
+ encode(message, writer = minimal_1.default.Writer.create()) {
832
+ if (message.SLedInteraction === true) {
833
+ writer.uint32(8).bool(message.SLedInteraction);
834
+ }
835
+ if (message.PLedInteraction === true) {
836
+ writer.uint32(16).bool(message.PLedInteraction);
837
+ }
838
+ return writer;
839
+ },
840
+ decode(input, length) {
841
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
842
+ let end = length === undefined ? reader.len : reader.pos + length;
843
+ const message = createBaseGetButtonEventRequest();
844
+ while (reader.pos < end) {
845
+ const tag = reader.uint32();
846
+ switch (tag >>> 3) {
847
+ case 1:
848
+ if (tag !== 8) {
849
+ break;
850
+ }
851
+ message.SLedInteraction = reader.bool();
852
+ continue;
853
+ case 2:
854
+ if (tag !== 16) {
855
+ break;
856
+ }
857
+ message.PLedInteraction = reader.bool();
858
+ continue;
859
+ }
860
+ if ((tag & 7) === 4 || tag === 0) {
861
+ break;
862
+ }
863
+ reader.skipType(tag & 7);
864
+ }
865
+ return message;
866
+ },
867
+ fromJSON(object) {
868
+ return {
869
+ SLedInteraction: isSet(object.SLedInteraction) ? Boolean(object.SLedInteraction) : false,
870
+ PLedInteraction: isSet(object.PLedInteraction) ? Boolean(object.PLedInteraction) : false,
871
+ };
872
+ },
873
+ toJSON(message) {
874
+ const obj = {};
875
+ if (message.SLedInteraction === true) {
876
+ obj.SLedInteraction = message.SLedInteraction;
877
+ }
878
+ if (message.PLedInteraction === true) {
879
+ obj.PLedInteraction = message.PLedInteraction;
880
+ }
881
+ return obj;
882
+ },
883
+ create(base) {
884
+ return exports.GetButtonEventRequest.fromPartial(base !== null && base !== void 0 ? base : {});
885
+ },
886
+ fromPartial(object) {
887
+ var _a, _b;
888
+ const message = createBaseGetButtonEventRequest();
889
+ message.SLedInteraction = (_a = object.SLedInteraction) !== null && _a !== void 0 ? _a : false;
890
+ message.PLedInteraction = (_b = object.PLedInteraction) !== null && _b !== void 0 ? _b : false;
891
+ return message;
892
+ },
893
+ };
894
+ function createBaseRawButtonEvent() {
895
+ return { kind: 0 };
896
+ }
897
+ exports.RawButtonEvent = {
898
+ encode(message, writer = minimal_1.default.Writer.create()) {
899
+ if (message.kind !== 0) {
900
+ writer.uint32(8).int32(message.kind);
901
+ }
902
+ return writer;
903
+ },
904
+ decode(input, length) {
905
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
906
+ let end = length === undefined ? reader.len : reader.pos + length;
907
+ const message = createBaseRawButtonEvent();
908
+ while (reader.pos < end) {
909
+ const tag = reader.uint32();
910
+ switch (tag >>> 3) {
911
+ case 1:
912
+ if (tag !== 8) {
913
+ break;
914
+ }
915
+ message.kind = reader.int32();
916
+ continue;
917
+ }
918
+ if ((tag & 7) === 4 || tag === 0) {
919
+ break;
920
+ }
921
+ reader.skipType(tag & 7);
922
+ }
923
+ return message;
924
+ },
925
+ fromJSON(object) {
926
+ return { kind: isSet(object.kind) ? rawButtonEvent_RawButtonKindFromJSON(object.kind) : 0 };
927
+ },
928
+ toJSON(message) {
929
+ const obj = {};
930
+ if (message.kind !== 0) {
931
+ obj.kind = rawButtonEvent_RawButtonKindToJSON(message.kind);
932
+ }
933
+ return obj;
934
+ },
935
+ create(base) {
936
+ return exports.RawButtonEvent.fromPartial(base !== null && base !== void 0 ? base : {});
937
+ },
938
+ fromPartial(object) {
939
+ var _a;
940
+ const message = createBaseRawButtonEvent();
941
+ message.kind = (_a = object.kind) !== null && _a !== void 0 ? _a : 0;
942
+ return message;
943
+ },
944
+ };
945
+ function createBaseHIButtonEvent() {
946
+ return { kind: 0 };
947
+ }
948
+ exports.HIButtonEvent = {
949
+ encode(message, writer = minimal_1.default.Writer.create()) {
950
+ if (message.kind !== 0) {
951
+ writer.uint32(8).int32(message.kind);
952
+ }
953
+ return writer;
954
+ },
955
+ decode(input, length) {
956
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
957
+ let end = length === undefined ? reader.len : reader.pos + length;
958
+ const message = createBaseHIButtonEvent();
959
+ while (reader.pos < end) {
960
+ const tag = reader.uint32();
961
+ switch (tag >>> 3) {
962
+ case 1:
963
+ if (tag !== 8) {
964
+ break;
965
+ }
966
+ message.kind = reader.int32();
967
+ continue;
968
+ }
969
+ if ((tag & 7) === 4 || tag === 0) {
970
+ break;
971
+ }
972
+ reader.skipType(tag & 7);
973
+ }
974
+ return message;
975
+ },
976
+ fromJSON(object) {
977
+ return { kind: isSet(object.kind) ? hIButtonKindFromJSON(object.kind) : 0 };
978
+ },
979
+ toJSON(message) {
980
+ const obj = {};
981
+ if (message.kind !== 0) {
982
+ obj.kind = hIButtonKindToJSON(message.kind);
983
+ }
984
+ return obj;
985
+ },
986
+ create(base) {
987
+ return exports.HIButtonEvent.fromPartial(base !== null && base !== void 0 ? base : {});
988
+ },
989
+ fromPartial(object) {
990
+ var _a;
991
+ const message = createBaseHIButtonEvent();
992
+ message.kind = (_a = object.kind) !== null && _a !== void 0 ? _a : 0;
993
+ return message;
994
+ },
995
+ };
996
+ function createBaseTriggerBtnRequest() {
997
+ return { kind: 0, reqOptions: undefined };
998
+ }
999
+ exports.TriggerBtnRequest = {
1000
+ encode(message, writer = minimal_1.default.Writer.create()) {
1001
+ if (message.kind !== 0) {
1002
+ writer.uint32(8).int32(message.kind);
1003
+ }
1004
+ if (message.reqOptions !== undefined) {
1005
+ exports.GetButtonEventRequest.encode(message.reqOptions, writer.uint32(18).fork()).ldelim();
1006
+ }
1007
+ return writer;
1008
+ },
1009
+ decode(input, length) {
1010
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1011
+ let end = length === undefined ? reader.len : reader.pos + length;
1012
+ const message = createBaseTriggerBtnRequest();
1013
+ while (reader.pos < end) {
1014
+ const tag = reader.uint32();
1015
+ switch (tag >>> 3) {
1016
+ case 1:
1017
+ if (tag !== 8) {
1018
+ break;
1019
+ }
1020
+ message.kind = reader.int32();
1021
+ continue;
1022
+ case 2:
1023
+ if (tag !== 18) {
1024
+ break;
1025
+ }
1026
+ message.reqOptions = exports.GetButtonEventRequest.decode(reader, reader.uint32());
1027
+ continue;
1028
+ }
1029
+ if ((tag & 7) === 4 || tag === 0) {
1030
+ break;
1031
+ }
1032
+ reader.skipType(tag & 7);
1033
+ }
1034
+ return message;
1035
+ },
1036
+ fromJSON(object) {
1037
+ return {
1038
+ kind: isSet(object.kind) ? hIButtonKindFromJSON(object.kind) : 0,
1039
+ reqOptions: isSet(object.reqOptions) ? exports.GetButtonEventRequest.fromJSON(object.reqOptions) : undefined,
1040
+ };
1041
+ },
1042
+ toJSON(message) {
1043
+ const obj = {};
1044
+ if (message.kind !== 0) {
1045
+ obj.kind = hIButtonKindToJSON(message.kind);
1046
+ }
1047
+ if (message.reqOptions !== undefined) {
1048
+ obj.reqOptions = exports.GetButtonEventRequest.toJSON(message.reqOptions);
1049
+ }
1050
+ return obj;
1051
+ },
1052
+ create(base) {
1053
+ return exports.TriggerBtnRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1054
+ },
1055
+ fromPartial(object) {
1056
+ var _a;
1057
+ const message = createBaseTriggerBtnRequest();
1058
+ message.kind = (_a = object.kind) !== null && _a !== void 0 ? _a : 0;
1059
+ message.reqOptions = (object.reqOptions !== undefined && object.reqOptions !== null)
1060
+ ? exports.GetButtonEventRequest.fromPartial(object.reqOptions)
1061
+ : undefined;
1062
+ return message;
1063
+ },
1064
+ };
623
1065
  function createBaseFanRpm() {
624
1066
  return { rpm: 0 };
625
1067
  }
@@ -678,6 +1120,9 @@ class HalServiceClientImpl {
678
1120
  this.GetPLed = this.GetPLed.bind(this);
679
1121
  this.SetSLed = this.SetSLed.bind(this);
680
1122
  this.GetButtonEventQueue = this.GetButtonEventQueue.bind(this);
1123
+ this.GetRawButtonEvent = this.GetRawButtonEvent.bind(this);
1124
+ this.TriggerWithButtonEvent = this.TriggerWithButtonEvent.bind(this);
1125
+ this.SetPLedEffect = this.SetPLedEffect.bind(this);
681
1126
  this.GetFanRpm = this.GetFanRpm.bind(this);
682
1127
  this.SetFanConfig = this.SetFanConfig.bind(this);
683
1128
  this.GetFanConfig = this.GetFanConfig.bind(this);
@@ -694,6 +1139,15 @@ class HalServiceClientImpl {
694
1139
  GetButtonEventQueue(request, metadata, abortSignal) {
695
1140
  return this.rpc.unary(exports.HalServiceGetButtonEventQueueDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
696
1141
  }
1142
+ GetRawButtonEvent(request, metadata, abortSignal) {
1143
+ return this.rpc.invoke(exports.HalServiceGetRawButtonEventDesc, exports.GetButtonEventRequest.fromPartial(request), metadata, abortSignal);
1144
+ }
1145
+ TriggerWithButtonEvent(request, metadata, abortSignal) {
1146
+ return this.rpc.unary(exports.HalServiceTriggerWithButtonEventDesc, exports.TriggerBtnRequest.fromPartial(request), metadata, abortSignal);
1147
+ }
1148
+ SetPLedEffect(request, metadata, abortSignal) {
1149
+ return this.rpc.invoke(exports.HalServiceSetPLedEffectDesc, exports.PLedEffect.fromPartial(request), metadata, abortSignal);
1150
+ }
697
1151
  GetFanRpm(request, metadata, abortSignal) {
698
1152
  return this.rpc.unary(exports.HalServiceGetFanRpmDesc, empty_1.Empty.fromPartial(request), metadata, abortSignal);
699
1153
  }
@@ -782,6 +1236,63 @@ exports.HalServiceGetButtonEventQueueDesc = {
782
1236
  },
783
1237
  },
784
1238
  };
1239
+ exports.HalServiceGetRawButtonEventDesc = {
1240
+ methodName: "GetRawButtonEvent",
1241
+ service: exports.HalServiceDesc,
1242
+ requestStream: false,
1243
+ responseStream: true,
1244
+ requestType: {
1245
+ serializeBinary() {
1246
+ return exports.GetButtonEventRequest.encode(this).finish();
1247
+ },
1248
+ },
1249
+ responseType: {
1250
+ deserializeBinary(data) {
1251
+ const value = exports.RawButtonEvent.decode(data);
1252
+ return Object.assign(Object.assign({}, value), { toObject() {
1253
+ return value;
1254
+ } });
1255
+ },
1256
+ },
1257
+ };
1258
+ exports.HalServiceTriggerWithButtonEventDesc = {
1259
+ methodName: "TriggerWithButtonEvent",
1260
+ service: exports.HalServiceDesc,
1261
+ requestStream: false,
1262
+ responseStream: false,
1263
+ requestType: {
1264
+ serializeBinary() {
1265
+ return exports.TriggerBtnRequest.encode(this).finish();
1266
+ },
1267
+ },
1268
+ responseType: {
1269
+ deserializeBinary(data) {
1270
+ const value = exports.HIButtonEvent.decode(data);
1271
+ return Object.assign(Object.assign({}, value), { toObject() {
1272
+ return value;
1273
+ } });
1274
+ },
1275
+ },
1276
+ };
1277
+ exports.HalServiceSetPLedEffectDesc = {
1278
+ methodName: "SetPLedEffect",
1279
+ service: exports.HalServiceDesc,
1280
+ requestStream: false,
1281
+ responseStream: true,
1282
+ requestType: {
1283
+ serializeBinary() {
1284
+ return exports.PLedEffect.encode(this).finish();
1285
+ },
1286
+ },
1287
+ responseType: {
1288
+ deserializeBinary(data) {
1289
+ const value = empty_1.Empty.decode(data);
1290
+ return Object.assign(Object.assign({}, value), { toObject() {
1291
+ return value;
1292
+ } });
1293
+ },
1294
+ },
1295
+ };
785
1296
  exports.HalServiceGetFanRpmDesc = {
786
1297
  methodName: "GetFanRpm",
787
1298
  service: exports.HalServiceDesc,
@@ -922,6 +1433,47 @@ class GrpcWebImpl {
922
1433
  }
923
1434
  });
924
1435
  }
1436
+ invoke(methodDesc, _request, metadata, abortSignal) {
1437
+ var _a, _b, _c;
1438
+ const upStreamCodes = (_a = this.options.upStreamRetryCodes) !== null && _a !== void 0 ? _a : [];
1439
+ const DEFAULT_TIMEOUT_TIME = 3000;
1440
+ const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
1441
+ const transport = (_b = this.options.streamingTransport) !== null && _b !== void 0 ? _b : this.options.transport;
1442
+ const maybeCombinedMetadata = metadata && this.options.metadata
1443
+ ? 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))
1444
+ : metadata !== null && metadata !== void 0 ? metadata : this.options.metadata;
1445
+ return new rxjs_1.Observable((observer) => {
1446
+ const upStream = () => {
1447
+ var _a;
1448
+ 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) => {
1449
+ if (code === 0) {
1450
+ observer.complete();
1451
+ }
1452
+ else if (upStreamCodes.includes(code)) {
1453
+ setTimeout(upStream, DEFAULT_TIMEOUT_TIME);
1454
+ }
1455
+ else {
1456
+ const err = new Error(message);
1457
+ err.code = code;
1458
+ err.metadata = trailers;
1459
+ observer.error(err);
1460
+ }
1461
+ } }));
1462
+ observer.add(() => {
1463
+ if (!abortSignal || !abortSignal.aborted) {
1464
+ return client.close();
1465
+ }
1466
+ });
1467
+ if (abortSignal) {
1468
+ abortSignal.addEventListener("abort", () => {
1469
+ observer.error(abortSignal.reason);
1470
+ client.close();
1471
+ });
1472
+ }
1473
+ };
1474
+ upStream();
1475
+ }).pipe((0, operators_1.share)());
1476
+ }
925
1477
  }
926
1478
  exports.GrpcWebImpl = GrpcWebImpl;
927
1479
  const tsProtoGlobalThis = (() => {