@fatehan/tsrp 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fatehan/activities/workflow.d.ts +25 -5
- package/dist/fatehan/activities/workflow.d.ts.map +1 -1
- package/dist/fatehan/activities/workflow.js +439 -114
- package/dist/fatehan/packets/dataModel.d.ts +1 -1
- package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
- package/dist/fatehan/packets/dataModel.js +9 -9
- package/dist/fatehan/services/api.d.ts +9 -0
- package/dist/fatehan/services/api.d.ts.map +1 -1
- package/dist/fatehan/services/api.js +108 -1
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.NotificationTrigger = exports.PayambarReport = exports.DefaultReport = exports.DeviceModule = exports.AreaModule = exports.FlowModule = exports.FlowEvent = exports.Flow = exports.WorkflowTask = exports.Workflow = exports.NotificationTrigger_Via = exports.FlowEvent_TriggerEvent = exports.AreaEvent = exports.WorkflowStat = exports.protobufPackage = void 0;
|
|
11
|
+
exports.NotificationTrigger = exports.PayambarReport = exports.DefaultReport = exports.DeviceModule = exports.AreaModule = exports.PayambarBackground_Item = exports.PayambarBackground = exports.DefaultBackground = exports.FlowModule = exports.FlowEvent = exports.Flow = exports.WorkflowTask = exports.Workflow = exports.NotificationTrigger_Via = exports.FlowEvent_TriggerEvent = exports.AreaEvent = exports.WorkflowStat = exports.protobufPackage = void 0;
|
|
12
12
|
exports.workflowStatFromJSON = workflowStatFromJSON;
|
|
13
13
|
exports.workflowStatToJSON = workflowStatToJSON;
|
|
14
14
|
exports.areaEventFromJSON = areaEventFromJSON;
|
|
@@ -589,24 +589,42 @@ exports.WorkflowTask = {
|
|
|
589
589
|
},
|
|
590
590
|
};
|
|
591
591
|
function createBaseFlow() {
|
|
592
|
-
return {
|
|
592
|
+
return {
|
|
593
|
+
continuous: false,
|
|
594
|
+
lastGpsTime: long_1.default.ZERO,
|
|
595
|
+
events: [],
|
|
596
|
+
modules: [],
|
|
597
|
+
defaultReport: undefined,
|
|
598
|
+
payambarReport: undefined,
|
|
599
|
+
defaultBackground: undefined,
|
|
600
|
+
payambarBackground: undefined,
|
|
601
|
+
};
|
|
593
602
|
}
|
|
594
603
|
exports.Flow = {
|
|
595
604
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
596
605
|
if (message.continuous !== false) {
|
|
597
606
|
writer.uint32(8).bool(message.continuous);
|
|
598
607
|
}
|
|
608
|
+
if (!message.lastGpsTime.equals(long_1.default.ZERO)) {
|
|
609
|
+
writer.uint32(16).sint64(message.lastGpsTime.toString());
|
|
610
|
+
}
|
|
599
611
|
for (const v of message.events) {
|
|
600
|
-
exports.FlowEvent.encode(v, writer.uint32(
|
|
612
|
+
exports.FlowEvent.encode(v, writer.uint32(242).fork()).join();
|
|
601
613
|
}
|
|
602
614
|
for (const v of message.modules) {
|
|
603
|
-
exports.FlowModule.encode(v, writer.uint32(
|
|
615
|
+
exports.FlowModule.encode(v, writer.uint32(322).fork()).join();
|
|
604
616
|
}
|
|
605
617
|
if (message.defaultReport !== undefined) {
|
|
606
|
-
exports.DefaultReport.encode(message.defaultReport, writer.uint32(
|
|
618
|
+
exports.DefaultReport.encode(message.defaultReport, writer.uint32(330).fork()).join();
|
|
607
619
|
}
|
|
608
620
|
if (message.payambarReport !== undefined) {
|
|
609
|
-
exports.PayambarReport.encode(message.payambarReport, writer.uint32(
|
|
621
|
+
exports.PayambarReport.encode(message.payambarReport, writer.uint32(338).fork()).join();
|
|
622
|
+
}
|
|
623
|
+
if (message.defaultBackground !== undefined) {
|
|
624
|
+
exports.DefaultBackground.encode(message.defaultBackground, writer.uint32(490).fork()).join();
|
|
625
|
+
}
|
|
626
|
+
if (message.payambarBackground !== undefined) {
|
|
627
|
+
exports.PayambarBackground.encode(message.payambarBackground, writer.uint32(498).fork()).join();
|
|
610
628
|
}
|
|
611
629
|
return writer;
|
|
612
630
|
},
|
|
@@ -625,33 +643,54 @@ exports.Flow = {
|
|
|
625
643
|
continue;
|
|
626
644
|
}
|
|
627
645
|
case 2: {
|
|
628
|
-
if (tag !==
|
|
646
|
+
if (tag !== 16) {
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
message.lastGpsTime = long_1.default.fromString(reader.sint64().toString());
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
case 30: {
|
|
653
|
+
if (tag !== 242) {
|
|
629
654
|
break;
|
|
630
655
|
}
|
|
631
656
|
message.events.push(exports.FlowEvent.decode(reader, reader.uint32()));
|
|
632
657
|
continue;
|
|
633
658
|
}
|
|
634
|
-
case
|
|
635
|
-
if (tag !==
|
|
659
|
+
case 40: {
|
|
660
|
+
if (tag !== 322) {
|
|
636
661
|
break;
|
|
637
662
|
}
|
|
638
663
|
message.modules.push(exports.FlowModule.decode(reader, reader.uint32()));
|
|
639
664
|
continue;
|
|
640
665
|
}
|
|
641
|
-
case
|
|
642
|
-
if (tag !==
|
|
666
|
+
case 41: {
|
|
667
|
+
if (tag !== 330) {
|
|
643
668
|
break;
|
|
644
669
|
}
|
|
645
670
|
message.defaultReport = exports.DefaultReport.decode(reader, reader.uint32());
|
|
646
671
|
continue;
|
|
647
672
|
}
|
|
648
|
-
case
|
|
649
|
-
if (tag !==
|
|
673
|
+
case 42: {
|
|
674
|
+
if (tag !== 338) {
|
|
650
675
|
break;
|
|
651
676
|
}
|
|
652
677
|
message.payambarReport = exports.PayambarReport.decode(reader, reader.uint32());
|
|
653
678
|
continue;
|
|
654
679
|
}
|
|
680
|
+
case 61: {
|
|
681
|
+
if (tag !== 490) {
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
message.defaultBackground = exports.DefaultBackground.decode(reader, reader.uint32());
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
case 62: {
|
|
688
|
+
if (tag !== 498) {
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
message.payambarBackground = exports.PayambarBackground.decode(reader, reader.uint32());
|
|
692
|
+
continue;
|
|
693
|
+
}
|
|
655
694
|
}
|
|
656
695
|
if ((tag & 7) === 4 || tag === 0) {
|
|
657
696
|
break;
|
|
@@ -663,10 +702,17 @@ exports.Flow = {
|
|
|
663
702
|
fromJSON(object) {
|
|
664
703
|
return {
|
|
665
704
|
continuous: isSet(object.continuous) ? globalThis.Boolean(object.continuous) : false,
|
|
705
|
+
lastGpsTime: isSet(object.last_gps_time) ? long_1.default.fromValue(object.last_gps_time) : long_1.default.ZERO,
|
|
666
706
|
events: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.events) ? object.events.map((e) => exports.FlowEvent.fromJSON(e)) : [],
|
|
667
707
|
modules: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.modules) ? object.modules.map((e) => exports.FlowModule.fromJSON(e)) : [],
|
|
668
708
|
defaultReport: isSet(object.default_report) ? exports.DefaultReport.fromJSON(object.default_report) : undefined,
|
|
669
709
|
payambarReport: isSet(object.payambar_report) ? exports.PayambarReport.fromJSON(object.payambar_report) : undefined,
|
|
710
|
+
defaultBackground: isSet(object.default_background)
|
|
711
|
+
? exports.DefaultBackground.fromJSON(object.default_background)
|
|
712
|
+
: undefined,
|
|
713
|
+
payambarBackground: isSet(object.payambar_background)
|
|
714
|
+
? exports.PayambarBackground.fromJSON(object.payambar_background)
|
|
715
|
+
: undefined,
|
|
670
716
|
};
|
|
671
717
|
},
|
|
672
718
|
toJSON(message) {
|
|
@@ -675,6 +721,9 @@ exports.Flow = {
|
|
|
675
721
|
if (message.continuous !== false) {
|
|
676
722
|
obj.continuous = message.continuous;
|
|
677
723
|
}
|
|
724
|
+
if (!message.lastGpsTime.equals(long_1.default.ZERO)) {
|
|
725
|
+
obj.last_gps_time = (message.lastGpsTime || long_1.default.ZERO).toString();
|
|
726
|
+
}
|
|
678
727
|
if ((_a = message.events) === null || _a === void 0 ? void 0 : _a.length) {
|
|
679
728
|
obj.events = message.events.map((e) => exports.FlowEvent.toJSON(e));
|
|
680
729
|
}
|
|
@@ -687,6 +736,12 @@ exports.Flow = {
|
|
|
687
736
|
if (message.payambarReport !== undefined) {
|
|
688
737
|
obj.payambar_report = exports.PayambarReport.toJSON(message.payambarReport);
|
|
689
738
|
}
|
|
739
|
+
if (message.defaultBackground !== undefined) {
|
|
740
|
+
obj.default_background = exports.DefaultBackground.toJSON(message.defaultBackground);
|
|
741
|
+
}
|
|
742
|
+
if (message.payambarBackground !== undefined) {
|
|
743
|
+
obj.payambar_background = exports.PayambarBackground.toJSON(message.payambarBackground);
|
|
744
|
+
}
|
|
690
745
|
return obj;
|
|
691
746
|
},
|
|
692
747
|
create(base) {
|
|
@@ -696,6 +751,9 @@ exports.Flow = {
|
|
|
696
751
|
var _a, _b, _c;
|
|
697
752
|
const message = createBaseFlow();
|
|
698
753
|
message.continuous = (_a = object.continuous) !== null && _a !== void 0 ? _a : false;
|
|
754
|
+
message.lastGpsTime = (object.lastGpsTime !== undefined && object.lastGpsTime !== null)
|
|
755
|
+
? long_1.default.fromValue(object.lastGpsTime)
|
|
756
|
+
: long_1.default.ZERO;
|
|
699
757
|
message.events = ((_b = object.events) === null || _b === void 0 ? void 0 : _b.map((e) => exports.FlowEvent.fromPartial(e))) || [];
|
|
700
758
|
message.modules = ((_c = object.modules) === null || _c === void 0 ? void 0 : _c.map((e) => exports.FlowModule.fromPartial(e))) || [];
|
|
701
759
|
message.defaultReport = (object.defaultReport !== undefined && object.defaultReport !== null)
|
|
@@ -704,6 +762,12 @@ exports.Flow = {
|
|
|
704
762
|
message.payambarReport = (object.payambarReport !== undefined && object.payambarReport !== null)
|
|
705
763
|
? exports.PayambarReport.fromPartial(object.payambarReport)
|
|
706
764
|
: undefined;
|
|
765
|
+
message.defaultBackground = (object.defaultBackground !== undefined && object.defaultBackground !== null)
|
|
766
|
+
? exports.DefaultBackground.fromPartial(object.defaultBackground)
|
|
767
|
+
: undefined;
|
|
768
|
+
message.payambarBackground = (object.payambarBackground !== undefined && object.payambarBackground !== null)
|
|
769
|
+
? exports.PayambarBackground.fromPartial(object.payambarBackground)
|
|
770
|
+
: undefined;
|
|
707
771
|
return message;
|
|
708
772
|
},
|
|
709
773
|
};
|
|
@@ -867,6 +931,328 @@ exports.FlowModule = {
|
|
|
867
931
|
return message;
|
|
868
932
|
},
|
|
869
933
|
};
|
|
934
|
+
function createBaseDefaultBackground() {
|
|
935
|
+
return {};
|
|
936
|
+
}
|
|
937
|
+
exports.DefaultBackground = {
|
|
938
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
939
|
+
return writer;
|
|
940
|
+
},
|
|
941
|
+
decode(input, length) {
|
|
942
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
943
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
944
|
+
const message = createBaseDefaultBackground();
|
|
945
|
+
while (reader.pos < end) {
|
|
946
|
+
const tag = reader.uint32();
|
|
947
|
+
switch (tag >>> 3) {
|
|
948
|
+
}
|
|
949
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
950
|
+
break;
|
|
951
|
+
}
|
|
952
|
+
reader.skip(tag & 7);
|
|
953
|
+
}
|
|
954
|
+
return message;
|
|
955
|
+
},
|
|
956
|
+
fromJSON(_) {
|
|
957
|
+
return {};
|
|
958
|
+
},
|
|
959
|
+
toJSON(_) {
|
|
960
|
+
const obj = {};
|
|
961
|
+
return obj;
|
|
962
|
+
},
|
|
963
|
+
create(base) {
|
|
964
|
+
return exports.DefaultBackground.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
965
|
+
},
|
|
966
|
+
fromPartial(_) {
|
|
967
|
+
const message = createBaseDefaultBackground();
|
|
968
|
+
return message;
|
|
969
|
+
},
|
|
970
|
+
};
|
|
971
|
+
function createBasePayambarBackground() {
|
|
972
|
+
return { movingDuration: 0, idlingDuration: 0, parkingDuration: 0, towingDuration: 0, items: [] };
|
|
973
|
+
}
|
|
974
|
+
exports.PayambarBackground = {
|
|
975
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
976
|
+
if (message.movingDuration !== 0) {
|
|
977
|
+
writer.uint32(16).uint32(message.movingDuration);
|
|
978
|
+
}
|
|
979
|
+
if (message.idlingDuration !== 0) {
|
|
980
|
+
writer.uint32(24).uint32(message.idlingDuration);
|
|
981
|
+
}
|
|
982
|
+
if (message.parkingDuration !== 0) {
|
|
983
|
+
writer.uint32(32).uint32(message.parkingDuration);
|
|
984
|
+
}
|
|
985
|
+
if (message.towingDuration !== 0) {
|
|
986
|
+
writer.uint32(40).uint32(message.towingDuration);
|
|
987
|
+
}
|
|
988
|
+
for (const v of message.items) {
|
|
989
|
+
exports.PayambarBackground_Item.encode(v, writer.uint32(10).fork()).join();
|
|
990
|
+
}
|
|
991
|
+
return writer;
|
|
992
|
+
},
|
|
993
|
+
decode(input, length) {
|
|
994
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
995
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
996
|
+
const message = createBasePayambarBackground();
|
|
997
|
+
while (reader.pos < end) {
|
|
998
|
+
const tag = reader.uint32();
|
|
999
|
+
switch (tag >>> 3) {
|
|
1000
|
+
case 2: {
|
|
1001
|
+
if (tag !== 16) {
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
1004
|
+
message.movingDuration = reader.uint32();
|
|
1005
|
+
continue;
|
|
1006
|
+
}
|
|
1007
|
+
case 3: {
|
|
1008
|
+
if (tag !== 24) {
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
message.idlingDuration = reader.uint32();
|
|
1012
|
+
continue;
|
|
1013
|
+
}
|
|
1014
|
+
case 4: {
|
|
1015
|
+
if (tag !== 32) {
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
message.parkingDuration = reader.uint32();
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
case 5: {
|
|
1022
|
+
if (tag !== 40) {
|
|
1023
|
+
break;
|
|
1024
|
+
}
|
|
1025
|
+
message.towingDuration = reader.uint32();
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
case 1: {
|
|
1029
|
+
if (tag !== 10) {
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
message.items.push(exports.PayambarBackground_Item.decode(reader, reader.uint32()));
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
reader.skip(tag & 7);
|
|
1040
|
+
}
|
|
1041
|
+
return message;
|
|
1042
|
+
},
|
|
1043
|
+
fromJSON(object) {
|
|
1044
|
+
return {
|
|
1045
|
+
movingDuration: isSet(object.moving_duration) ? globalThis.Number(object.moving_duration) : 0,
|
|
1046
|
+
idlingDuration: isSet(object.idling_duration) ? globalThis.Number(object.idling_duration) : 0,
|
|
1047
|
+
parkingDuration: isSet(object.parking_duration) ? globalThis.Number(object.parking_duration) : 0,
|
|
1048
|
+
towingDuration: isSet(object.towing_duration) ? globalThis.Number(object.towing_duration) : 0,
|
|
1049
|
+
items: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.items)
|
|
1050
|
+
? object.items.map((e) => exports.PayambarBackground_Item.fromJSON(e))
|
|
1051
|
+
: [],
|
|
1052
|
+
};
|
|
1053
|
+
},
|
|
1054
|
+
toJSON(message) {
|
|
1055
|
+
var _a;
|
|
1056
|
+
const obj = {};
|
|
1057
|
+
if (message.movingDuration !== 0) {
|
|
1058
|
+
obj.moving_duration = Math.round(message.movingDuration);
|
|
1059
|
+
}
|
|
1060
|
+
if (message.idlingDuration !== 0) {
|
|
1061
|
+
obj.idling_duration = Math.round(message.idlingDuration);
|
|
1062
|
+
}
|
|
1063
|
+
if (message.parkingDuration !== 0) {
|
|
1064
|
+
obj.parking_duration = Math.round(message.parkingDuration);
|
|
1065
|
+
}
|
|
1066
|
+
if (message.towingDuration !== 0) {
|
|
1067
|
+
obj.towing_duration = Math.round(message.towingDuration);
|
|
1068
|
+
}
|
|
1069
|
+
if ((_a = message.items) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1070
|
+
obj.items = message.items.map((e) => exports.PayambarBackground_Item.toJSON(e));
|
|
1071
|
+
}
|
|
1072
|
+
return obj;
|
|
1073
|
+
},
|
|
1074
|
+
create(base) {
|
|
1075
|
+
return exports.PayambarBackground.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1076
|
+
},
|
|
1077
|
+
fromPartial(object) {
|
|
1078
|
+
var _a, _b, _c, _d, _e;
|
|
1079
|
+
const message = createBasePayambarBackground();
|
|
1080
|
+
message.movingDuration = (_a = object.movingDuration) !== null && _a !== void 0 ? _a : 0;
|
|
1081
|
+
message.idlingDuration = (_b = object.idlingDuration) !== null && _b !== void 0 ? _b : 0;
|
|
1082
|
+
message.parkingDuration = (_c = object.parkingDuration) !== null && _c !== void 0 ? _c : 0;
|
|
1083
|
+
message.towingDuration = (_d = object.towingDuration) !== null && _d !== void 0 ? _d : 0;
|
|
1084
|
+
message.items = ((_e = object.items) === null || _e === void 0 ? void 0 : _e.map((e) => exports.PayambarBackground_Item.fromPartial(e))) || [];
|
|
1085
|
+
return message;
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
function createBasePayambarBackground_Item() {
|
|
1089
|
+
return {
|
|
1090
|
+
latitude: 0,
|
|
1091
|
+
longitude: 0,
|
|
1092
|
+
fuelLevel: undefined,
|
|
1093
|
+
ble03Custom01: undefined,
|
|
1094
|
+
ble03Custom02: undefined,
|
|
1095
|
+
ble03Custom03: undefined,
|
|
1096
|
+
ble03Custom04: undefined,
|
|
1097
|
+
ble03Custom05: undefined,
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
exports.PayambarBackground_Item = {
|
|
1101
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1102
|
+
if (message.latitude !== 0) {
|
|
1103
|
+
writer.uint32(13).float(message.latitude);
|
|
1104
|
+
}
|
|
1105
|
+
if (message.longitude !== 0) {
|
|
1106
|
+
writer.uint32(21).float(message.longitude);
|
|
1107
|
+
}
|
|
1108
|
+
if (message.fuelLevel !== undefined) {
|
|
1109
|
+
writer.uint32(24).uint32(message.fuelLevel);
|
|
1110
|
+
}
|
|
1111
|
+
if (message.ble03Custom01 !== undefined) {
|
|
1112
|
+
writer.uint32(34).bytes(message.ble03Custom01);
|
|
1113
|
+
}
|
|
1114
|
+
if (message.ble03Custom02 !== undefined) {
|
|
1115
|
+
writer.uint32(40).uint32(message.ble03Custom02);
|
|
1116
|
+
}
|
|
1117
|
+
if (message.ble03Custom03 !== undefined) {
|
|
1118
|
+
writer.uint32(48).uint32(message.ble03Custom03);
|
|
1119
|
+
}
|
|
1120
|
+
if (message.ble03Custom04 !== undefined) {
|
|
1121
|
+
writer.uint32(56).uint32(message.ble03Custom04);
|
|
1122
|
+
}
|
|
1123
|
+
if (message.ble03Custom05 !== undefined) {
|
|
1124
|
+
writer.uint32(64).uint32(message.ble03Custom05);
|
|
1125
|
+
}
|
|
1126
|
+
return writer;
|
|
1127
|
+
},
|
|
1128
|
+
decode(input, length) {
|
|
1129
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1130
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1131
|
+
const message = createBasePayambarBackground_Item();
|
|
1132
|
+
while (reader.pos < end) {
|
|
1133
|
+
const tag = reader.uint32();
|
|
1134
|
+
switch (tag >>> 3) {
|
|
1135
|
+
case 1: {
|
|
1136
|
+
if (tag !== 13) {
|
|
1137
|
+
break;
|
|
1138
|
+
}
|
|
1139
|
+
message.latitude = reader.float();
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
case 2: {
|
|
1143
|
+
if (tag !== 21) {
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
message.longitude = reader.float();
|
|
1147
|
+
continue;
|
|
1148
|
+
}
|
|
1149
|
+
case 3: {
|
|
1150
|
+
if (tag !== 24) {
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
message.fuelLevel = reader.uint32();
|
|
1154
|
+
continue;
|
|
1155
|
+
}
|
|
1156
|
+
case 4: {
|
|
1157
|
+
if (tag !== 34) {
|
|
1158
|
+
break;
|
|
1159
|
+
}
|
|
1160
|
+
message.ble03Custom01 = reader.bytes();
|
|
1161
|
+
continue;
|
|
1162
|
+
}
|
|
1163
|
+
case 5: {
|
|
1164
|
+
if (tag !== 40) {
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
message.ble03Custom02 = reader.uint32();
|
|
1168
|
+
continue;
|
|
1169
|
+
}
|
|
1170
|
+
case 6: {
|
|
1171
|
+
if (tag !== 48) {
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
message.ble03Custom03 = reader.uint32();
|
|
1175
|
+
continue;
|
|
1176
|
+
}
|
|
1177
|
+
case 7: {
|
|
1178
|
+
if (tag !== 56) {
|
|
1179
|
+
break;
|
|
1180
|
+
}
|
|
1181
|
+
message.ble03Custom04 = reader.uint32();
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
case 8: {
|
|
1185
|
+
if (tag !== 64) {
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
message.ble03Custom05 = reader.uint32();
|
|
1189
|
+
continue;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
reader.skip(tag & 7);
|
|
1196
|
+
}
|
|
1197
|
+
return message;
|
|
1198
|
+
},
|
|
1199
|
+
fromJSON(object) {
|
|
1200
|
+
return {
|
|
1201
|
+
latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
|
|
1202
|
+
longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
|
|
1203
|
+
fuelLevel: isSet(object.fuel_level) ? globalThis.Number(object.fuel_level) : undefined,
|
|
1204
|
+
ble03Custom01: isSet(object.ble_03_custom_01) ? bytesFromBase64(object.ble_03_custom_01) : undefined,
|
|
1205
|
+
ble03Custom02: isSet(object.ble_03_custom_02) ? globalThis.Number(object.ble_03_custom_02) : undefined,
|
|
1206
|
+
ble03Custom03: isSet(object.ble_03_custom_03) ? globalThis.Number(object.ble_03_custom_03) : undefined,
|
|
1207
|
+
ble03Custom04: isSet(object.ble_03_custom_04) ? globalThis.Number(object.ble_03_custom_04) : undefined,
|
|
1208
|
+
ble03Custom05: isSet(object.ble_03_custom_05) ? globalThis.Number(object.ble_03_custom_05) : undefined,
|
|
1209
|
+
};
|
|
1210
|
+
},
|
|
1211
|
+
toJSON(message) {
|
|
1212
|
+
const obj = {};
|
|
1213
|
+
if (message.latitude !== 0) {
|
|
1214
|
+
obj.latitude = message.latitude;
|
|
1215
|
+
}
|
|
1216
|
+
if (message.longitude !== 0) {
|
|
1217
|
+
obj.longitude = message.longitude;
|
|
1218
|
+
}
|
|
1219
|
+
if (message.fuelLevel !== undefined) {
|
|
1220
|
+
obj.fuel_level = Math.round(message.fuelLevel);
|
|
1221
|
+
}
|
|
1222
|
+
if (message.ble03Custom01 !== undefined) {
|
|
1223
|
+
obj.ble_03_custom_01 = base64FromBytes(message.ble03Custom01);
|
|
1224
|
+
}
|
|
1225
|
+
if (message.ble03Custom02 !== undefined) {
|
|
1226
|
+
obj.ble_03_custom_02 = Math.round(message.ble03Custom02);
|
|
1227
|
+
}
|
|
1228
|
+
if (message.ble03Custom03 !== undefined) {
|
|
1229
|
+
obj.ble_03_custom_03 = Math.round(message.ble03Custom03);
|
|
1230
|
+
}
|
|
1231
|
+
if (message.ble03Custom04 !== undefined) {
|
|
1232
|
+
obj.ble_03_custom_04 = Math.round(message.ble03Custom04);
|
|
1233
|
+
}
|
|
1234
|
+
if (message.ble03Custom05 !== undefined) {
|
|
1235
|
+
obj.ble_03_custom_05 = Math.round(message.ble03Custom05);
|
|
1236
|
+
}
|
|
1237
|
+
return obj;
|
|
1238
|
+
},
|
|
1239
|
+
create(base) {
|
|
1240
|
+
return exports.PayambarBackground_Item.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1241
|
+
},
|
|
1242
|
+
fromPartial(object) {
|
|
1243
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1244
|
+
const message = createBasePayambarBackground_Item();
|
|
1245
|
+
message.latitude = (_a = object.latitude) !== null && _a !== void 0 ? _a : 0;
|
|
1246
|
+
message.longitude = (_b = object.longitude) !== null && _b !== void 0 ? _b : 0;
|
|
1247
|
+
message.fuelLevel = (_c = object.fuelLevel) !== null && _c !== void 0 ? _c : undefined;
|
|
1248
|
+
message.ble03Custom01 = (_d = object.ble03Custom01) !== null && _d !== void 0 ? _d : undefined;
|
|
1249
|
+
message.ble03Custom02 = (_e = object.ble03Custom02) !== null && _e !== void 0 ? _e : undefined;
|
|
1250
|
+
message.ble03Custom03 = (_f = object.ble03Custom03) !== null && _f !== void 0 ? _f : undefined;
|
|
1251
|
+
message.ble03Custom04 = (_g = object.ble03Custom04) !== null && _g !== void 0 ? _g : undefined;
|
|
1252
|
+
message.ble03Custom05 = (_h = object.ble03Custom05) !== null && _h !== void 0 ? _h : undefined;
|
|
1253
|
+
return message;
|
|
1254
|
+
},
|
|
1255
|
+
};
|
|
870
1256
|
function createBaseAreaModule() {
|
|
871
1257
|
return {
|
|
872
1258
|
starts: 0,
|
|
@@ -875,7 +1261,6 @@ function createBaseAreaModule() {
|
|
|
875
1261
|
running: false,
|
|
876
1262
|
startedAt: undefined,
|
|
877
1263
|
finishedAt: undefined,
|
|
878
|
-
lastGpsTime: undefined,
|
|
879
1264
|
totalMileageAtStart: undefined,
|
|
880
1265
|
totalMileageAtFinish: undefined,
|
|
881
1266
|
fuelConsumedAtStart: undefined,
|
|
@@ -911,9 +1296,6 @@ exports.AreaModule = {
|
|
|
911
1296
|
if (message.finishedAt !== undefined) {
|
|
912
1297
|
timestamp_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(50).fork()).join();
|
|
913
1298
|
}
|
|
914
|
-
if (message.lastGpsTime !== undefined) {
|
|
915
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.lastGpsTime), writer.uint32(170).fork()).join();
|
|
916
|
-
}
|
|
917
1299
|
if (message.totalMileageAtStart !== undefined) {
|
|
918
1300
|
writer.uint32(56).uint64(message.totalMileageAtStart.toString());
|
|
919
1301
|
}
|
|
@@ -1004,13 +1386,6 @@ exports.AreaModule = {
|
|
|
1004
1386
|
message.finishedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1005
1387
|
continue;
|
|
1006
1388
|
}
|
|
1007
|
-
case 21: {
|
|
1008
|
-
if (tag !== 170) {
|
|
1009
|
-
break;
|
|
1010
|
-
}
|
|
1011
|
-
message.lastGpsTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1012
|
-
continue;
|
|
1013
|
-
}
|
|
1014
1389
|
case 7: {
|
|
1015
1390
|
if (tag !== 56) {
|
|
1016
1391
|
break;
|
|
@@ -1118,7 +1493,6 @@ exports.AreaModule = {
|
|
|
1118
1493
|
running: isSet(object.running) ? globalThis.Boolean(object.running) : false,
|
|
1119
1494
|
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1120
1495
|
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1121
|
-
lastGpsTime: isSet(object.last_gps_time) ? fromJsonTimestamp(object.last_gps_time) : undefined,
|
|
1122
1496
|
totalMileageAtStart: isSet(object.total_mileage_at_start)
|
|
1123
1497
|
? long_1.default.fromValue(object.total_mileage_at_start)
|
|
1124
1498
|
: undefined,
|
|
@@ -1164,9 +1538,6 @@ exports.AreaModule = {
|
|
|
1164
1538
|
if (message.finishedAt !== undefined) {
|
|
1165
1539
|
obj.finished_at = message.finishedAt.toISOString();
|
|
1166
1540
|
}
|
|
1167
|
-
if (message.lastGpsTime !== undefined) {
|
|
1168
|
-
obj.last_gps_time = message.lastGpsTime.toISOString();
|
|
1169
|
-
}
|
|
1170
1541
|
if (message.totalMileageAtStart !== undefined) {
|
|
1171
1542
|
obj.total_mileage_at_start = (message.totalMileageAtStart || long_1.default.UZERO).toString();
|
|
1172
1543
|
}
|
|
@@ -1212,7 +1583,7 @@ exports.AreaModule = {
|
|
|
1212
1583
|
return exports.AreaModule.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1213
1584
|
},
|
|
1214
1585
|
fromPartial(object) {
|
|
1215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
1586
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1216
1587
|
const message = createBaseAreaModule();
|
|
1217
1588
|
message.starts = (_a = object.starts) !== null && _a !== void 0 ? _a : 0;
|
|
1218
1589
|
message.finishes = (_b = object.finishes) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -1222,24 +1593,23 @@ exports.AreaModule = {
|
|
|
1222
1593
|
message.running = (_c = object.running) !== null && _c !== void 0 ? _c : false;
|
|
1223
1594
|
message.startedAt = (_d = object.startedAt) !== null && _d !== void 0 ? _d : undefined;
|
|
1224
1595
|
message.finishedAt = (_e = object.finishedAt) !== null && _e !== void 0 ? _e : undefined;
|
|
1225
|
-
message.lastGpsTime = (_f = object.lastGpsTime) !== null && _f !== void 0 ? _f : undefined;
|
|
1226
1596
|
message.totalMileageAtStart = (object.totalMileageAtStart !== undefined && object.totalMileageAtStart !== null)
|
|
1227
1597
|
? long_1.default.fromValue(object.totalMileageAtStart)
|
|
1228
1598
|
: undefined;
|
|
1229
1599
|
message.totalMileageAtFinish = (object.totalMileageAtFinish !== undefined && object.totalMileageAtFinish !== null)
|
|
1230
1600
|
? long_1.default.fromValue(object.totalMileageAtFinish)
|
|
1231
1601
|
: undefined;
|
|
1232
|
-
message.fuelConsumedAtStart = (
|
|
1233
|
-
message.fuelConsumedAtFinish = (
|
|
1234
|
-
message.maxSpeed = (
|
|
1235
|
-
message.totalSpeed = (
|
|
1236
|
-
message.countSpeed = (
|
|
1237
|
-
message.duration = (
|
|
1238
|
-
message.movingDuration = (
|
|
1239
|
-
message.idlingDuration = (
|
|
1240
|
-
message.parkingDuration = (
|
|
1241
|
-
message.towingDuration = (
|
|
1242
|
-
message.minimumAcceptedDuration = (
|
|
1602
|
+
message.fuelConsumedAtStart = (_f = object.fuelConsumedAtStart) !== null && _f !== void 0 ? _f : undefined;
|
|
1603
|
+
message.fuelConsumedAtFinish = (_g = object.fuelConsumedAtFinish) !== null && _g !== void 0 ? _g : undefined;
|
|
1604
|
+
message.maxSpeed = (_h = object.maxSpeed) !== null && _h !== void 0 ? _h : 0;
|
|
1605
|
+
message.totalSpeed = (_j = object.totalSpeed) !== null && _j !== void 0 ? _j : 0;
|
|
1606
|
+
message.countSpeed = (_k = object.countSpeed) !== null && _k !== void 0 ? _k : 0;
|
|
1607
|
+
message.duration = (_l = object.duration) !== null && _l !== void 0 ? _l : 0;
|
|
1608
|
+
message.movingDuration = (_m = object.movingDuration) !== null && _m !== void 0 ? _m : 0;
|
|
1609
|
+
message.idlingDuration = (_o = object.idlingDuration) !== null && _o !== void 0 ? _o : 0;
|
|
1610
|
+
message.parkingDuration = (_p = object.parkingDuration) !== null && _p !== void 0 ? _p : 0;
|
|
1611
|
+
message.towingDuration = (_q = object.towingDuration) !== null && _q !== void 0 ? _q : 0;
|
|
1612
|
+
message.minimumAcceptedDuration = (_r = object.minimumAcceptedDuration) !== null && _r !== void 0 ? _r : undefined;
|
|
1243
1613
|
return message;
|
|
1244
1614
|
},
|
|
1245
1615
|
};
|
|
@@ -1619,17 +1989,7 @@ exports.DefaultReport = {
|
|
|
1619
1989
|
},
|
|
1620
1990
|
};
|
|
1621
1991
|
function createBasePayambarReport() {
|
|
1622
|
-
return {
|
|
1623
|
-
startedAt: undefined,
|
|
1624
|
-
finishedAt: undefined,
|
|
1625
|
-
mileage: 0,
|
|
1626
|
-
duration: 0,
|
|
1627
|
-
movingDuration: 0,
|
|
1628
|
-
idlingDuration: 0,
|
|
1629
|
-
parkingDuration: 0,
|
|
1630
|
-
towingDuration: 0,
|
|
1631
|
-
fuelUsage: 0,
|
|
1632
|
-
};
|
|
1992
|
+
return { startedAt: undefined, finishedAt: undefined, mileage: 0, duration: 0, fuelUsage: 0 };
|
|
1633
1993
|
}
|
|
1634
1994
|
exports.PayambarReport = {
|
|
1635
1995
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -1645,18 +2005,6 @@ exports.PayambarReport = {
|
|
|
1645
2005
|
if (message.duration !== 0) {
|
|
1646
2006
|
writer.uint32(64).uint32(message.duration);
|
|
1647
2007
|
}
|
|
1648
|
-
if (message.movingDuration !== 0) {
|
|
1649
|
-
writer.uint32(32).uint32(message.movingDuration);
|
|
1650
|
-
}
|
|
1651
|
-
if (message.idlingDuration !== 0) {
|
|
1652
|
-
writer.uint32(40).uint32(message.idlingDuration);
|
|
1653
|
-
}
|
|
1654
|
-
if (message.parkingDuration !== 0) {
|
|
1655
|
-
writer.uint32(48).uint32(message.parkingDuration);
|
|
1656
|
-
}
|
|
1657
|
-
if (message.towingDuration !== 0) {
|
|
1658
|
-
writer.uint32(72).uint32(message.towingDuration);
|
|
1659
|
-
}
|
|
1660
2008
|
if (message.fuelUsage !== 0) {
|
|
1661
2009
|
writer.uint32(56).uint32(message.fuelUsage);
|
|
1662
2010
|
}
|
|
@@ -1697,34 +2045,6 @@ exports.PayambarReport = {
|
|
|
1697
2045
|
message.duration = reader.uint32();
|
|
1698
2046
|
continue;
|
|
1699
2047
|
}
|
|
1700
|
-
case 4: {
|
|
1701
|
-
if (tag !== 32) {
|
|
1702
|
-
break;
|
|
1703
|
-
}
|
|
1704
|
-
message.movingDuration = reader.uint32();
|
|
1705
|
-
continue;
|
|
1706
|
-
}
|
|
1707
|
-
case 5: {
|
|
1708
|
-
if (tag !== 40) {
|
|
1709
|
-
break;
|
|
1710
|
-
}
|
|
1711
|
-
message.idlingDuration = reader.uint32();
|
|
1712
|
-
continue;
|
|
1713
|
-
}
|
|
1714
|
-
case 6: {
|
|
1715
|
-
if (tag !== 48) {
|
|
1716
|
-
break;
|
|
1717
|
-
}
|
|
1718
|
-
message.parkingDuration = reader.uint32();
|
|
1719
|
-
continue;
|
|
1720
|
-
}
|
|
1721
|
-
case 9: {
|
|
1722
|
-
if (tag !== 72) {
|
|
1723
|
-
break;
|
|
1724
|
-
}
|
|
1725
|
-
message.towingDuration = reader.uint32();
|
|
1726
|
-
continue;
|
|
1727
|
-
}
|
|
1728
2048
|
case 7: {
|
|
1729
2049
|
if (tag !== 56) {
|
|
1730
2050
|
break;
|
|
@@ -1746,10 +2066,6 @@ exports.PayambarReport = {
|
|
|
1746
2066
|
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1747
2067
|
mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : 0,
|
|
1748
2068
|
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
|
1749
|
-
movingDuration: isSet(object.moving_duration) ? globalThis.Number(object.moving_duration) : 0,
|
|
1750
|
-
idlingDuration: isSet(object.idling_duration) ? globalThis.Number(object.idling_duration) : 0,
|
|
1751
|
-
parkingDuration: isSet(object.parking_duration) ? globalThis.Number(object.parking_duration) : 0,
|
|
1752
|
-
towingDuration: isSet(object.towing_duration) ? globalThis.Number(object.towing_duration) : 0,
|
|
1753
2069
|
fuelUsage: isSet(object.fuel_usage) ? globalThis.Number(object.fuel_usage) : 0,
|
|
1754
2070
|
};
|
|
1755
2071
|
},
|
|
@@ -1767,18 +2083,6 @@ exports.PayambarReport = {
|
|
|
1767
2083
|
if (message.duration !== 0) {
|
|
1768
2084
|
obj.duration = Math.round(message.duration);
|
|
1769
2085
|
}
|
|
1770
|
-
if (message.movingDuration !== 0) {
|
|
1771
|
-
obj.moving_duration = Math.round(message.movingDuration);
|
|
1772
|
-
}
|
|
1773
|
-
if (message.idlingDuration !== 0) {
|
|
1774
|
-
obj.idling_duration = Math.round(message.idlingDuration);
|
|
1775
|
-
}
|
|
1776
|
-
if (message.parkingDuration !== 0) {
|
|
1777
|
-
obj.parking_duration = Math.round(message.parkingDuration);
|
|
1778
|
-
}
|
|
1779
|
-
if (message.towingDuration !== 0) {
|
|
1780
|
-
obj.towing_duration = Math.round(message.towingDuration);
|
|
1781
|
-
}
|
|
1782
2086
|
if (message.fuelUsage !== 0) {
|
|
1783
2087
|
obj.fuel_usage = Math.round(message.fuelUsage);
|
|
1784
2088
|
}
|
|
@@ -1788,17 +2092,13 @@ exports.PayambarReport = {
|
|
|
1788
2092
|
return exports.PayambarReport.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1789
2093
|
},
|
|
1790
2094
|
fromPartial(object) {
|
|
1791
|
-
var _a, _b, _c, _d, _e
|
|
2095
|
+
var _a, _b, _c, _d, _e;
|
|
1792
2096
|
const message = createBasePayambarReport();
|
|
1793
2097
|
message.startedAt = (_a = object.startedAt) !== null && _a !== void 0 ? _a : undefined;
|
|
1794
2098
|
message.finishedAt = (_b = object.finishedAt) !== null && _b !== void 0 ? _b : undefined;
|
|
1795
2099
|
message.mileage = (_c = object.mileage) !== null && _c !== void 0 ? _c : 0;
|
|
1796
2100
|
message.duration = (_d = object.duration) !== null && _d !== void 0 ? _d : 0;
|
|
1797
|
-
message.
|
|
1798
|
-
message.idlingDuration = (_f = object.idlingDuration) !== null && _f !== void 0 ? _f : 0;
|
|
1799
|
-
message.parkingDuration = (_g = object.parkingDuration) !== null && _g !== void 0 ? _g : 0;
|
|
1800
|
-
message.towingDuration = (_h = object.towingDuration) !== null && _h !== void 0 ? _h : 0;
|
|
1801
|
-
message.fuelUsage = (_j = object.fuelUsage) !== null && _j !== void 0 ? _j : 0;
|
|
2101
|
+
message.fuelUsage = (_e = object.fuelUsage) !== null && _e !== void 0 ? _e : 0;
|
|
1802
2102
|
return message;
|
|
1803
2103
|
},
|
|
1804
2104
|
};
|
|
@@ -1888,6 +2188,31 @@ exports.NotificationTrigger = {
|
|
|
1888
2188
|
return message;
|
|
1889
2189
|
},
|
|
1890
2190
|
};
|
|
2191
|
+
function bytesFromBase64(b64) {
|
|
2192
|
+
if (globalThis.Buffer) {
|
|
2193
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
2194
|
+
}
|
|
2195
|
+
else {
|
|
2196
|
+
const bin = globalThis.atob(b64);
|
|
2197
|
+
const arr = new Uint8Array(bin.length);
|
|
2198
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
2199
|
+
arr[i] = bin.charCodeAt(i);
|
|
2200
|
+
}
|
|
2201
|
+
return arr;
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
function base64FromBytes(arr) {
|
|
2205
|
+
if (globalThis.Buffer) {
|
|
2206
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
2207
|
+
}
|
|
2208
|
+
else {
|
|
2209
|
+
const bin = [];
|
|
2210
|
+
arr.forEach((byte) => {
|
|
2211
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
2212
|
+
});
|
|
2213
|
+
return globalThis.btoa(bin.join(""));
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
1891
2216
|
function toTimestamp(date) {
|
|
1892
2217
|
const seconds = numberToLong(Math.trunc(date.getTime() / 1000));
|
|
1893
2218
|
const nanos = (date.getTime() % 1000) * 1000000;
|