@fatehan/tsrp 1.1.10 → 1.1.11
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/api.test.js
CHANGED
|
@@ -8,8 +8,11 @@ const api_1 = require("./api");
|
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
(0, vitest_1.describe)("ApiService", () => {
|
|
10
10
|
let url = "https://beta.myavl.ir/gapi";
|
|
11
|
-
let token = "
|
|
12
|
-
let organization = "
|
|
11
|
+
let token = "172|ofr8rAzW4WobrXeZb5mzRputv6GIpbK3KdWDU4ged2ca871c";
|
|
12
|
+
let organization = "1000001";
|
|
13
|
+
// let url: string = "http://127.0.0.1:4333";
|
|
14
|
+
// let token: string = "157|HruYqS4J5V2Yj1Hu9IISH4CEQfl4TkujKFUzobnlef550974";
|
|
15
|
+
// let organization: string = "1012494";
|
|
13
16
|
let c = new api_1.ApiService(url, token, organization);
|
|
14
17
|
(0, vitest_1.it)("MeIndex", async () => {
|
|
15
18
|
let res = await c.MeIndex({
|
|
@@ -47,6 +47,7 @@ export interface Flow {
|
|
|
47
47
|
events: FlowEvent[];
|
|
48
48
|
modules: FlowModule[];
|
|
49
49
|
defaultReport?: DefaultReport | undefined;
|
|
50
|
+
payambarReport?: PayambarReport | undefined;
|
|
50
51
|
}
|
|
51
52
|
export interface FlowEvent {
|
|
52
53
|
event: FlowEvent_TriggerEvent;
|
|
@@ -72,12 +73,19 @@ export interface AreaModule {
|
|
|
72
73
|
running: boolean;
|
|
73
74
|
startedAt?: Date | undefined;
|
|
74
75
|
finishedAt?: Date | undefined;
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
lastGpsTime?: Date | undefined;
|
|
77
|
+
totalMileageAtStart?: Long | undefined;
|
|
78
|
+
totalMileageAtFinish?: Long | undefined;
|
|
79
|
+
fuelConsumedAtStart?: number | undefined;
|
|
80
|
+
fuelConsumedAtFinish?: number | undefined;
|
|
77
81
|
maxSpeed: number;
|
|
78
82
|
totalSpeed: number;
|
|
79
83
|
countSpeed: number;
|
|
80
84
|
duration: number;
|
|
85
|
+
movingDuration: number;
|
|
86
|
+
idlingDuration: number;
|
|
87
|
+
parkingDuration: number;
|
|
88
|
+
towingDuration: number;
|
|
81
89
|
/** these are only accepted when both starts and finishes are not none * */
|
|
82
90
|
minimumAcceptedDuration?: number | undefined;
|
|
83
91
|
}
|
|
@@ -90,8 +98,8 @@ export interface DeviceModule {
|
|
|
90
98
|
running: boolean;
|
|
91
99
|
startedAt?: Date | undefined;
|
|
92
100
|
finishedAt?: Date | undefined;
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
totalMileageAtStart?: Long | undefined;
|
|
102
|
+
totalMileageAtFinish?: Long | undefined;
|
|
95
103
|
maxSpeed: number;
|
|
96
104
|
totalSpeed: number;
|
|
97
105
|
countSpeed: number;
|
|
@@ -105,6 +113,17 @@ export interface DefaultReport {
|
|
|
105
113
|
startedAt?: Date | undefined;
|
|
106
114
|
finishedAt?: Date | undefined;
|
|
107
115
|
}
|
|
116
|
+
export interface PayambarReport {
|
|
117
|
+
startedAt?: Date | undefined;
|
|
118
|
+
finishedAt?: Date | undefined;
|
|
119
|
+
mileage: number;
|
|
120
|
+
duration: number;
|
|
121
|
+
movingDuration: number;
|
|
122
|
+
idlingDuration: number;
|
|
123
|
+
parkingDuration: number;
|
|
124
|
+
towingDuration: number;
|
|
125
|
+
fuelUsage: number;
|
|
126
|
+
}
|
|
108
127
|
export interface NotificationTrigger {
|
|
109
128
|
userId: Long;
|
|
110
129
|
title: string;
|
|
@@ -127,6 +146,7 @@ export declare const FlowModule: MessageFns<FlowModule>;
|
|
|
127
146
|
export declare const AreaModule: MessageFns<AreaModule>;
|
|
128
147
|
export declare const DeviceModule: MessageFns<DeviceModule>;
|
|
129
148
|
export declare const DefaultReport: MessageFns<DefaultReport>;
|
|
149
|
+
export declare const PayambarReport: MessageFns<PayambarReport>;
|
|
130
150
|
export declare const NotificationTrigger: MessageFns<NotificationTrigger>;
|
|
131
151
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
132
152
|
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/fatehan/activities/workflow.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,YAAY,KAAK;CAClB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY,CAmB9D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAc/D;AAED,oBAAY,SAAS;IACnB,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;IACR,YAAY,KAAK;CAClB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,CAgBxD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAYzD;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,IAAI,CAAC;IACT,cAAc,EAAE,IAAI,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC7B,SAAS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AI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxD,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;CAC/D"}
|
|
@@ -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.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.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,7 +589,7 @@ exports.WorkflowTask = {
|
|
|
589
589
|
},
|
|
590
590
|
};
|
|
591
591
|
function createBaseFlow() {
|
|
592
|
-
return { continuous: false, events: [], modules: [], defaultReport: undefined };
|
|
592
|
+
return { continuous: false, events: [], modules: [], defaultReport: undefined, payambarReport: undefined };
|
|
593
593
|
}
|
|
594
594
|
exports.Flow = {
|
|
595
595
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -605,6 +605,9 @@ exports.Flow = {
|
|
|
605
605
|
if (message.defaultReport !== undefined) {
|
|
606
606
|
exports.DefaultReport.encode(message.defaultReport, writer.uint32(34).fork()).join();
|
|
607
607
|
}
|
|
608
|
+
if (message.payambarReport !== undefined) {
|
|
609
|
+
exports.PayambarReport.encode(message.payambarReport, writer.uint32(42).fork()).join();
|
|
610
|
+
}
|
|
608
611
|
return writer;
|
|
609
612
|
},
|
|
610
613
|
decode(input, length) {
|
|
@@ -642,6 +645,13 @@ exports.Flow = {
|
|
|
642
645
|
message.defaultReport = exports.DefaultReport.decode(reader, reader.uint32());
|
|
643
646
|
continue;
|
|
644
647
|
}
|
|
648
|
+
case 5: {
|
|
649
|
+
if (tag !== 42) {
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
message.payambarReport = exports.PayambarReport.decode(reader, reader.uint32());
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
645
655
|
}
|
|
646
656
|
if ((tag & 7) === 4 || tag === 0) {
|
|
647
657
|
break;
|
|
@@ -656,6 +666,7 @@ exports.Flow = {
|
|
|
656
666
|
events: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.events) ? object.events.map((e) => exports.FlowEvent.fromJSON(e)) : [],
|
|
657
667
|
modules: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.modules) ? object.modules.map((e) => exports.FlowModule.fromJSON(e)) : [],
|
|
658
668
|
defaultReport: isSet(object.default_report) ? exports.DefaultReport.fromJSON(object.default_report) : undefined,
|
|
669
|
+
payambarReport: isSet(object.payambar_report) ? exports.PayambarReport.fromJSON(object.payambar_report) : undefined,
|
|
659
670
|
};
|
|
660
671
|
},
|
|
661
672
|
toJSON(message) {
|
|
@@ -673,6 +684,9 @@ exports.Flow = {
|
|
|
673
684
|
if (message.defaultReport !== undefined) {
|
|
674
685
|
obj.default_report = exports.DefaultReport.toJSON(message.defaultReport);
|
|
675
686
|
}
|
|
687
|
+
if (message.payambarReport !== undefined) {
|
|
688
|
+
obj.payambar_report = exports.PayambarReport.toJSON(message.payambarReport);
|
|
689
|
+
}
|
|
676
690
|
return obj;
|
|
677
691
|
},
|
|
678
692
|
create(base) {
|
|
@@ -687,6 +701,9 @@ exports.Flow = {
|
|
|
687
701
|
message.defaultReport = (object.defaultReport !== undefined && object.defaultReport !== null)
|
|
688
702
|
? exports.DefaultReport.fromPartial(object.defaultReport)
|
|
689
703
|
: undefined;
|
|
704
|
+
message.payambarReport = (object.payambarReport !== undefined && object.payambarReport !== null)
|
|
705
|
+
? exports.PayambarReport.fromPartial(object.payambarReport)
|
|
706
|
+
: undefined;
|
|
690
707
|
return message;
|
|
691
708
|
},
|
|
692
709
|
};
|
|
@@ -858,12 +875,19 @@ function createBaseAreaModule() {
|
|
|
858
875
|
running: false,
|
|
859
876
|
startedAt: undefined,
|
|
860
877
|
finishedAt: undefined,
|
|
861
|
-
|
|
862
|
-
|
|
878
|
+
lastGpsTime: undefined,
|
|
879
|
+
totalMileageAtStart: undefined,
|
|
880
|
+
totalMileageAtFinish: undefined,
|
|
881
|
+
fuelConsumedAtStart: undefined,
|
|
882
|
+
fuelConsumedAtFinish: undefined,
|
|
863
883
|
maxSpeed: 0,
|
|
864
884
|
totalSpeed: 0,
|
|
865
885
|
countSpeed: 0,
|
|
866
886
|
duration: 0,
|
|
887
|
+
movingDuration: 0,
|
|
888
|
+
idlingDuration: 0,
|
|
889
|
+
parkingDuration: 0,
|
|
890
|
+
towingDuration: 0,
|
|
867
891
|
minimumAcceptedDuration: undefined,
|
|
868
892
|
};
|
|
869
893
|
}
|
|
@@ -887,11 +911,20 @@ exports.AreaModule = {
|
|
|
887
911
|
if (message.finishedAt !== undefined) {
|
|
888
912
|
timestamp_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(50).fork()).join();
|
|
889
913
|
}
|
|
890
|
-
if (message.
|
|
891
|
-
writer.uint32(
|
|
914
|
+
if (message.lastGpsTime !== undefined) {
|
|
915
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.lastGpsTime), writer.uint32(170).fork()).join();
|
|
916
|
+
}
|
|
917
|
+
if (message.totalMileageAtStart !== undefined) {
|
|
918
|
+
writer.uint32(56).uint64(message.totalMileageAtStart.toString());
|
|
919
|
+
}
|
|
920
|
+
if (message.totalMileageAtFinish !== undefined) {
|
|
921
|
+
writer.uint32(64).uint64(message.totalMileageAtFinish.toString());
|
|
922
|
+
}
|
|
923
|
+
if (message.fuelConsumedAtStart !== undefined) {
|
|
924
|
+
writer.uint32(120).uint32(message.fuelConsumedAtStart);
|
|
892
925
|
}
|
|
893
|
-
if (message.
|
|
894
|
-
writer.uint32(
|
|
926
|
+
if (message.fuelConsumedAtFinish !== undefined) {
|
|
927
|
+
writer.uint32(128).uint32(message.fuelConsumedAtFinish);
|
|
895
928
|
}
|
|
896
929
|
if (message.maxSpeed !== 0) {
|
|
897
930
|
writer.uint32(72).uint32(message.maxSpeed);
|
|
@@ -905,6 +938,18 @@ exports.AreaModule = {
|
|
|
905
938
|
if (message.duration !== 0) {
|
|
906
939
|
writer.uint32(96).uint32(message.duration);
|
|
907
940
|
}
|
|
941
|
+
if (message.movingDuration !== 0) {
|
|
942
|
+
writer.uint32(152).uint32(message.movingDuration);
|
|
943
|
+
}
|
|
944
|
+
if (message.idlingDuration !== 0) {
|
|
945
|
+
writer.uint32(160).uint32(message.idlingDuration);
|
|
946
|
+
}
|
|
947
|
+
if (message.parkingDuration !== 0) {
|
|
948
|
+
writer.uint32(136).uint32(message.parkingDuration);
|
|
949
|
+
}
|
|
950
|
+
if (message.towingDuration !== 0) {
|
|
951
|
+
writer.uint32(144).uint32(message.towingDuration);
|
|
952
|
+
}
|
|
908
953
|
if (message.minimumAcceptedDuration !== undefined) {
|
|
909
954
|
writer.uint32(104).uint32(message.minimumAcceptedDuration);
|
|
910
955
|
}
|
|
@@ -959,18 +1004,39 @@ exports.AreaModule = {
|
|
|
959
1004
|
message.finishedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
960
1005
|
continue;
|
|
961
1006
|
}
|
|
1007
|
+
case 21: {
|
|
1008
|
+
if (tag !== 170) {
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
message.lastGpsTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1012
|
+
continue;
|
|
1013
|
+
}
|
|
962
1014
|
case 7: {
|
|
963
1015
|
if (tag !== 56) {
|
|
964
1016
|
break;
|
|
965
1017
|
}
|
|
966
|
-
message.
|
|
1018
|
+
message.totalMileageAtStart = long_1.default.fromString(reader.uint64().toString(), true);
|
|
967
1019
|
continue;
|
|
968
1020
|
}
|
|
969
1021
|
case 8: {
|
|
970
1022
|
if (tag !== 64) {
|
|
971
1023
|
break;
|
|
972
1024
|
}
|
|
973
|
-
message.
|
|
1025
|
+
message.totalMileageAtFinish = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
case 15: {
|
|
1029
|
+
if (tag !== 120) {
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
message.fuelConsumedAtStart = reader.uint32();
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
case 16: {
|
|
1036
|
+
if (tag !== 128) {
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
message.fuelConsumedAtFinish = reader.uint32();
|
|
974
1040
|
continue;
|
|
975
1041
|
}
|
|
976
1042
|
case 9: {
|
|
@@ -1001,6 +1067,34 @@ exports.AreaModule = {
|
|
|
1001
1067
|
message.duration = reader.uint32();
|
|
1002
1068
|
continue;
|
|
1003
1069
|
}
|
|
1070
|
+
case 19: {
|
|
1071
|
+
if (tag !== 152) {
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
message.movingDuration = reader.uint32();
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
case 20: {
|
|
1078
|
+
if (tag !== 160) {
|
|
1079
|
+
break;
|
|
1080
|
+
}
|
|
1081
|
+
message.idlingDuration = reader.uint32();
|
|
1082
|
+
continue;
|
|
1083
|
+
}
|
|
1084
|
+
case 17: {
|
|
1085
|
+
if (tag !== 136) {
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
message.parkingDuration = reader.uint32();
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1091
|
+
case 18: {
|
|
1092
|
+
if (tag !== 144) {
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
message.towingDuration = reader.uint32();
|
|
1096
|
+
continue;
|
|
1097
|
+
}
|
|
1004
1098
|
case 13: {
|
|
1005
1099
|
if (tag !== 104) {
|
|
1006
1100
|
break;
|
|
@@ -1024,16 +1118,27 @@ exports.AreaModule = {
|
|
|
1024
1118
|
running: isSet(object.running) ? globalThis.Boolean(object.running) : false,
|
|
1025
1119
|
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1026
1120
|
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1027
|
-
|
|
1028
|
-
|
|
1121
|
+
lastGpsTime: isSet(object.last_gps_time) ? fromJsonTimestamp(object.last_gps_time) : undefined,
|
|
1122
|
+
totalMileageAtStart: isSet(object.total_mileage_at_start)
|
|
1123
|
+
? long_1.default.fromValue(object.total_mileage_at_start)
|
|
1124
|
+
: undefined,
|
|
1125
|
+
totalMileageAtFinish: isSet(object.total_mileage_at_finish)
|
|
1126
|
+
? long_1.default.fromValue(object.total_mileage_at_finish)
|
|
1029
1127
|
: undefined,
|
|
1030
|
-
|
|
1031
|
-
?
|
|
1128
|
+
fuelConsumedAtStart: isSet(object.fuel_consumed_at_start)
|
|
1129
|
+
? globalThis.Number(object.fuel_consumed_at_start)
|
|
1130
|
+
: undefined,
|
|
1131
|
+
fuelConsumedAtFinish: isSet(object.fuel_consumed_at_finish)
|
|
1132
|
+
? globalThis.Number(object.fuel_consumed_at_finish)
|
|
1032
1133
|
: undefined,
|
|
1033
1134
|
maxSpeed: isSet(object.max_speed) ? globalThis.Number(object.max_speed) : 0,
|
|
1034
1135
|
totalSpeed: isSet(object.total_speed) ? globalThis.Number(object.total_speed) : 0,
|
|
1035
1136
|
countSpeed: isSet(object.count_speed) ? globalThis.Number(object.count_speed) : 0,
|
|
1036
1137
|
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
|
1138
|
+
movingDuration: isSet(object.moving_duration) ? globalThis.Number(object.moving_duration) : 0,
|
|
1139
|
+
idlingDuration: isSet(object.idling_duration) ? globalThis.Number(object.idling_duration) : 0,
|
|
1140
|
+
parkingDuration: isSet(object.parking_duration) ? globalThis.Number(object.parking_duration) : 0,
|
|
1141
|
+
towingDuration: isSet(object.towing_duration) ? globalThis.Number(object.towing_duration) : 0,
|
|
1037
1142
|
minimumAcceptedDuration: isSet(object.minimum_accepted_duration)
|
|
1038
1143
|
? globalThis.Number(object.minimum_accepted_duration)
|
|
1039
1144
|
: undefined,
|
|
@@ -1059,11 +1164,20 @@ exports.AreaModule = {
|
|
|
1059
1164
|
if (message.finishedAt !== undefined) {
|
|
1060
1165
|
obj.finished_at = message.finishedAt.toISOString();
|
|
1061
1166
|
}
|
|
1062
|
-
if (message.
|
|
1063
|
-
obj.
|
|
1167
|
+
if (message.lastGpsTime !== undefined) {
|
|
1168
|
+
obj.last_gps_time = message.lastGpsTime.toISOString();
|
|
1169
|
+
}
|
|
1170
|
+
if (message.totalMileageAtStart !== undefined) {
|
|
1171
|
+
obj.total_mileage_at_start = (message.totalMileageAtStart || long_1.default.UZERO).toString();
|
|
1064
1172
|
}
|
|
1065
|
-
if (message.
|
|
1066
|
-
obj.
|
|
1173
|
+
if (message.totalMileageAtFinish !== undefined) {
|
|
1174
|
+
obj.total_mileage_at_finish = (message.totalMileageAtFinish || long_1.default.UZERO).toString();
|
|
1175
|
+
}
|
|
1176
|
+
if (message.fuelConsumedAtStart !== undefined) {
|
|
1177
|
+
obj.fuel_consumed_at_start = Math.round(message.fuelConsumedAtStart);
|
|
1178
|
+
}
|
|
1179
|
+
if (message.fuelConsumedAtFinish !== undefined) {
|
|
1180
|
+
obj.fuel_consumed_at_finish = Math.round(message.fuelConsumedAtFinish);
|
|
1067
1181
|
}
|
|
1068
1182
|
if (message.maxSpeed !== 0) {
|
|
1069
1183
|
obj.max_speed = Math.round(message.maxSpeed);
|
|
@@ -1077,6 +1191,18 @@ exports.AreaModule = {
|
|
|
1077
1191
|
if (message.duration !== 0) {
|
|
1078
1192
|
obj.duration = Math.round(message.duration);
|
|
1079
1193
|
}
|
|
1194
|
+
if (message.movingDuration !== 0) {
|
|
1195
|
+
obj.moving_duration = Math.round(message.movingDuration);
|
|
1196
|
+
}
|
|
1197
|
+
if (message.idlingDuration !== 0) {
|
|
1198
|
+
obj.idling_duration = Math.round(message.idlingDuration);
|
|
1199
|
+
}
|
|
1200
|
+
if (message.parkingDuration !== 0) {
|
|
1201
|
+
obj.parking_duration = Math.round(message.parkingDuration);
|
|
1202
|
+
}
|
|
1203
|
+
if (message.towingDuration !== 0) {
|
|
1204
|
+
obj.towing_duration = Math.round(message.towingDuration);
|
|
1205
|
+
}
|
|
1080
1206
|
if (message.minimumAcceptedDuration !== undefined) {
|
|
1081
1207
|
obj.minimum_accepted_duration = Math.round(message.minimumAcceptedDuration);
|
|
1082
1208
|
}
|
|
@@ -1086,7 +1212,7 @@ exports.AreaModule = {
|
|
|
1086
1212
|
return exports.AreaModule.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1087
1213
|
},
|
|
1088
1214
|
fromPartial(object) {
|
|
1089
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
1090
1216
|
const message = createBaseAreaModule();
|
|
1091
1217
|
message.starts = (_a = object.starts) !== null && _a !== void 0 ? _a : 0;
|
|
1092
1218
|
message.finishes = (_b = object.finishes) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -1096,17 +1222,24 @@ exports.AreaModule = {
|
|
|
1096
1222
|
message.running = (_c = object.running) !== null && _c !== void 0 ? _c : false;
|
|
1097
1223
|
message.startedAt = (_d = object.startedAt) !== null && _d !== void 0 ? _d : undefined;
|
|
1098
1224
|
message.finishedAt = (_e = object.finishedAt) !== null && _e !== void 0 ? _e : undefined;
|
|
1099
|
-
message.
|
|
1100
|
-
|
|
1225
|
+
message.lastGpsTime = (_f = object.lastGpsTime) !== null && _f !== void 0 ? _f : undefined;
|
|
1226
|
+
message.totalMileageAtStart = (object.totalMileageAtStart !== undefined && object.totalMileageAtStart !== null)
|
|
1227
|
+
? long_1.default.fromValue(object.totalMileageAtStart)
|
|
1101
1228
|
: undefined;
|
|
1102
|
-
message.
|
|
1103
|
-
? long_1.default.fromValue(object.
|
|
1229
|
+
message.totalMileageAtFinish = (object.totalMileageAtFinish !== undefined && object.totalMileageAtFinish !== null)
|
|
1230
|
+
? long_1.default.fromValue(object.totalMileageAtFinish)
|
|
1104
1231
|
: undefined;
|
|
1105
|
-
message.
|
|
1106
|
-
message.
|
|
1107
|
-
message.
|
|
1108
|
-
message.
|
|
1109
|
-
message.
|
|
1232
|
+
message.fuelConsumedAtStart = (_g = object.fuelConsumedAtStart) !== null && _g !== void 0 ? _g : undefined;
|
|
1233
|
+
message.fuelConsumedAtFinish = (_h = object.fuelConsumedAtFinish) !== null && _h !== void 0 ? _h : undefined;
|
|
1234
|
+
message.maxSpeed = (_j = object.maxSpeed) !== null && _j !== void 0 ? _j : 0;
|
|
1235
|
+
message.totalSpeed = (_k = object.totalSpeed) !== null && _k !== void 0 ? _k : 0;
|
|
1236
|
+
message.countSpeed = (_l = object.countSpeed) !== null && _l !== void 0 ? _l : 0;
|
|
1237
|
+
message.duration = (_m = object.duration) !== null && _m !== void 0 ? _m : 0;
|
|
1238
|
+
message.movingDuration = (_o = object.movingDuration) !== null && _o !== void 0 ? _o : 0;
|
|
1239
|
+
message.idlingDuration = (_p = object.idlingDuration) !== null && _p !== void 0 ? _p : 0;
|
|
1240
|
+
message.parkingDuration = (_q = object.parkingDuration) !== null && _q !== void 0 ? _q : 0;
|
|
1241
|
+
message.towingDuration = (_r = object.towingDuration) !== null && _r !== void 0 ? _r : 0;
|
|
1242
|
+
message.minimumAcceptedDuration = (_s = object.minimumAcceptedDuration) !== null && _s !== void 0 ? _s : undefined;
|
|
1110
1243
|
return message;
|
|
1111
1244
|
},
|
|
1112
1245
|
};
|
|
@@ -1119,8 +1252,8 @@ function createBaseDeviceModule() {
|
|
|
1119
1252
|
running: false,
|
|
1120
1253
|
startedAt: undefined,
|
|
1121
1254
|
finishedAt: undefined,
|
|
1122
|
-
|
|
1123
|
-
|
|
1255
|
+
totalMileageAtStart: undefined,
|
|
1256
|
+
totalMileageAtFinish: undefined,
|
|
1124
1257
|
maxSpeed: 0,
|
|
1125
1258
|
totalSpeed: 0,
|
|
1126
1259
|
countSpeed: 0,
|
|
@@ -1151,11 +1284,11 @@ exports.DeviceModule = {
|
|
|
1151
1284
|
if (message.finishedAt !== undefined) {
|
|
1152
1285
|
timestamp_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(50).fork()).join();
|
|
1153
1286
|
}
|
|
1154
|
-
if (message.
|
|
1155
|
-
writer.uint32(56).uint64(message.
|
|
1287
|
+
if (message.totalMileageAtStart !== undefined) {
|
|
1288
|
+
writer.uint32(56).uint64(message.totalMileageAtStart.toString());
|
|
1156
1289
|
}
|
|
1157
|
-
if (message.
|
|
1158
|
-
writer.uint32(64).uint64(message.
|
|
1290
|
+
if (message.totalMileageAtFinish !== undefined) {
|
|
1291
|
+
writer.uint32(64).uint64(message.totalMileageAtFinish.toString());
|
|
1159
1292
|
}
|
|
1160
1293
|
if (message.maxSpeed !== 0) {
|
|
1161
1294
|
writer.uint32(72).uint32(message.maxSpeed);
|
|
@@ -1234,14 +1367,14 @@ exports.DeviceModule = {
|
|
|
1234
1367
|
if (tag !== 56) {
|
|
1235
1368
|
break;
|
|
1236
1369
|
}
|
|
1237
|
-
message.
|
|
1370
|
+
message.totalMileageAtStart = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1238
1371
|
continue;
|
|
1239
1372
|
}
|
|
1240
1373
|
case 8: {
|
|
1241
1374
|
if (tag !== 64) {
|
|
1242
1375
|
break;
|
|
1243
1376
|
}
|
|
1244
|
-
message.
|
|
1377
|
+
message.totalMileageAtFinish = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1245
1378
|
continue;
|
|
1246
1379
|
}
|
|
1247
1380
|
case 9: {
|
|
@@ -1296,11 +1429,11 @@ exports.DeviceModule = {
|
|
|
1296
1429
|
running: isSet(object.running) ? globalThis.Boolean(object.running) : false,
|
|
1297
1430
|
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1298
1431
|
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1299
|
-
|
|
1300
|
-
? long_1.default.fromValue(object.
|
|
1432
|
+
totalMileageAtStart: isSet(object.total_mileage_at_start)
|
|
1433
|
+
? long_1.default.fromValue(object.total_mileage_at_start)
|
|
1301
1434
|
: undefined,
|
|
1302
|
-
|
|
1303
|
-
? long_1.default.fromValue(object.
|
|
1435
|
+
totalMileageAtFinish: isSet(object.total_mileage_at_finish)
|
|
1436
|
+
? long_1.default.fromValue(object.total_mileage_at_finish)
|
|
1304
1437
|
: undefined,
|
|
1305
1438
|
maxSpeed: isSet(object.max_speed) ? globalThis.Number(object.max_speed) : 0,
|
|
1306
1439
|
totalSpeed: isSet(object.total_speed) ? globalThis.Number(object.total_speed) : 0,
|
|
@@ -1334,11 +1467,11 @@ exports.DeviceModule = {
|
|
|
1334
1467
|
if (message.finishedAt !== undefined) {
|
|
1335
1468
|
obj.finished_at = message.finishedAt.toISOString();
|
|
1336
1469
|
}
|
|
1337
|
-
if (message.
|
|
1338
|
-
obj.
|
|
1470
|
+
if (message.totalMileageAtStart !== undefined) {
|
|
1471
|
+
obj.total_mileage_at_start = (message.totalMileageAtStart || long_1.default.UZERO).toString();
|
|
1339
1472
|
}
|
|
1340
|
-
if (message.
|
|
1341
|
-
obj.
|
|
1473
|
+
if (message.totalMileageAtFinish !== undefined) {
|
|
1474
|
+
obj.total_mileage_at_finish = (message.totalMileageAtFinish || long_1.default.UZERO).toString();
|
|
1342
1475
|
}
|
|
1343
1476
|
if (message.maxSpeed !== 0) {
|
|
1344
1477
|
obj.max_speed = Math.round(message.maxSpeed);
|
|
@@ -1372,11 +1505,11 @@ exports.DeviceModule = {
|
|
|
1372
1505
|
message.running = (_d = object.running) !== null && _d !== void 0 ? _d : false;
|
|
1373
1506
|
message.startedAt = (_e = object.startedAt) !== null && _e !== void 0 ? _e : undefined;
|
|
1374
1507
|
message.finishedAt = (_f = object.finishedAt) !== null && _f !== void 0 ? _f : undefined;
|
|
1375
|
-
message.
|
|
1376
|
-
? long_1.default.fromValue(object.
|
|
1508
|
+
message.totalMileageAtStart = (object.totalMileageAtStart !== undefined && object.totalMileageAtStart !== null)
|
|
1509
|
+
? long_1.default.fromValue(object.totalMileageAtStart)
|
|
1377
1510
|
: undefined;
|
|
1378
|
-
message.
|
|
1379
|
-
? long_1.default.fromValue(object.
|
|
1511
|
+
message.totalMileageAtFinish = (object.totalMileageAtFinish !== undefined && object.totalMileageAtFinish !== null)
|
|
1512
|
+
? long_1.default.fromValue(object.totalMileageAtFinish)
|
|
1380
1513
|
: undefined;
|
|
1381
1514
|
message.maxSpeed = (_g = object.maxSpeed) !== null && _g !== void 0 ? _g : 0;
|
|
1382
1515
|
message.totalSpeed = (_h = object.totalSpeed) !== null && _h !== void 0 ? _h : 0;
|
|
@@ -1452,8 +1585,8 @@ exports.DefaultReport = {
|
|
|
1452
1585
|
return {
|
|
1453
1586
|
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
|
1454
1587
|
mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : 0,
|
|
1455
|
-
startedAt: isSet(object.
|
|
1456
|
-
finishedAt: isSet(object.
|
|
1588
|
+
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1589
|
+
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1457
1590
|
};
|
|
1458
1591
|
},
|
|
1459
1592
|
toJSON(message) {
|
|
@@ -1465,10 +1598,10 @@ exports.DefaultReport = {
|
|
|
1465
1598
|
obj.mileage = Math.round(message.mileage);
|
|
1466
1599
|
}
|
|
1467
1600
|
if (message.startedAt !== undefined) {
|
|
1468
|
-
obj.
|
|
1601
|
+
obj.started_at = message.startedAt.toISOString();
|
|
1469
1602
|
}
|
|
1470
1603
|
if (message.finishedAt !== undefined) {
|
|
1471
|
-
obj.
|
|
1604
|
+
obj.finished_at = message.finishedAt.toISOString();
|
|
1472
1605
|
}
|
|
1473
1606
|
return obj;
|
|
1474
1607
|
},
|
|
@@ -1485,6 +1618,190 @@ exports.DefaultReport = {
|
|
|
1485
1618
|
return message;
|
|
1486
1619
|
},
|
|
1487
1620
|
};
|
|
1621
|
+
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
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
exports.PayambarReport = {
|
|
1635
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1636
|
+
if (message.startedAt !== undefined) {
|
|
1637
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(10).fork()).join();
|
|
1638
|
+
}
|
|
1639
|
+
if (message.finishedAt !== undefined) {
|
|
1640
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(18).fork()).join();
|
|
1641
|
+
}
|
|
1642
|
+
if (message.mileage !== 0) {
|
|
1643
|
+
writer.uint32(24).uint32(message.mileage);
|
|
1644
|
+
}
|
|
1645
|
+
if (message.duration !== 0) {
|
|
1646
|
+
writer.uint32(64).uint32(message.duration);
|
|
1647
|
+
}
|
|
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
|
+
if (message.fuelUsage !== 0) {
|
|
1661
|
+
writer.uint32(56).uint32(message.fuelUsage);
|
|
1662
|
+
}
|
|
1663
|
+
return writer;
|
|
1664
|
+
},
|
|
1665
|
+
decode(input, length) {
|
|
1666
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1667
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1668
|
+
const message = createBasePayambarReport();
|
|
1669
|
+
while (reader.pos < end) {
|
|
1670
|
+
const tag = reader.uint32();
|
|
1671
|
+
switch (tag >>> 3) {
|
|
1672
|
+
case 1: {
|
|
1673
|
+
if (tag !== 10) {
|
|
1674
|
+
break;
|
|
1675
|
+
}
|
|
1676
|
+
message.startedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1677
|
+
continue;
|
|
1678
|
+
}
|
|
1679
|
+
case 2: {
|
|
1680
|
+
if (tag !== 18) {
|
|
1681
|
+
break;
|
|
1682
|
+
}
|
|
1683
|
+
message.finishedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1684
|
+
continue;
|
|
1685
|
+
}
|
|
1686
|
+
case 3: {
|
|
1687
|
+
if (tag !== 24) {
|
|
1688
|
+
break;
|
|
1689
|
+
}
|
|
1690
|
+
message.mileage = reader.uint32();
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
case 8: {
|
|
1694
|
+
if (tag !== 64) {
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
message.duration = reader.uint32();
|
|
1698
|
+
continue;
|
|
1699
|
+
}
|
|
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
|
+
case 7: {
|
|
1729
|
+
if (tag !== 56) {
|
|
1730
|
+
break;
|
|
1731
|
+
}
|
|
1732
|
+
message.fuelUsage = reader.uint32();
|
|
1733
|
+
continue;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1737
|
+
break;
|
|
1738
|
+
}
|
|
1739
|
+
reader.skip(tag & 7);
|
|
1740
|
+
}
|
|
1741
|
+
return message;
|
|
1742
|
+
},
|
|
1743
|
+
fromJSON(object) {
|
|
1744
|
+
return {
|
|
1745
|
+
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1746
|
+
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1747
|
+
mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : 0,
|
|
1748
|
+
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
|
+
fuelUsage: isSet(object.fuel_usage) ? globalThis.Number(object.fuel_usage) : 0,
|
|
1754
|
+
};
|
|
1755
|
+
},
|
|
1756
|
+
toJSON(message) {
|
|
1757
|
+
const obj = {};
|
|
1758
|
+
if (message.startedAt !== undefined) {
|
|
1759
|
+
obj.started_at = message.startedAt.toISOString();
|
|
1760
|
+
}
|
|
1761
|
+
if (message.finishedAt !== undefined) {
|
|
1762
|
+
obj.finished_at = message.finishedAt.toISOString();
|
|
1763
|
+
}
|
|
1764
|
+
if (message.mileage !== 0) {
|
|
1765
|
+
obj.mileage = Math.round(message.mileage);
|
|
1766
|
+
}
|
|
1767
|
+
if (message.duration !== 0) {
|
|
1768
|
+
obj.duration = Math.round(message.duration);
|
|
1769
|
+
}
|
|
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
|
+
if (message.fuelUsage !== 0) {
|
|
1783
|
+
obj.fuel_usage = Math.round(message.fuelUsage);
|
|
1784
|
+
}
|
|
1785
|
+
return obj;
|
|
1786
|
+
},
|
|
1787
|
+
create(base) {
|
|
1788
|
+
return exports.PayambarReport.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1789
|
+
},
|
|
1790
|
+
fromPartial(object) {
|
|
1791
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1792
|
+
const message = createBasePayambarReport();
|
|
1793
|
+
message.startedAt = (_a = object.startedAt) !== null && _a !== void 0 ? _a : undefined;
|
|
1794
|
+
message.finishedAt = (_b = object.finishedAt) !== null && _b !== void 0 ? _b : undefined;
|
|
1795
|
+
message.mileage = (_c = object.mileage) !== null && _c !== void 0 ? _c : 0;
|
|
1796
|
+
message.duration = (_d = object.duration) !== null && _d !== void 0 ? _d : 0;
|
|
1797
|
+
message.movingDuration = (_e = object.movingDuration) !== null && _e !== void 0 ? _e : 0;
|
|
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;
|
|
1802
|
+
return message;
|
|
1803
|
+
},
|
|
1804
|
+
};
|
|
1488
1805
|
function createBaseNotificationTrigger() {
|
|
1489
1806
|
return { userId: long_1.default.UZERO, title: "", body: undefined };
|
|
1490
1807
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fatehan/tsrp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "fatehan main models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/google-protobuf": "^3.15.12",
|
|
30
30
|
"@types/long": "^5.0.0",
|
|
31
|
-
"@types/node": "^24.3.
|
|
31
|
+
"@types/node": "^24.3.3",
|
|
32
32
|
"ts-node": "^10.9.2",
|
|
33
33
|
"ts-proto": "^2.7.7",
|
|
34
34
|
"typescript": "^5.9.2",
|