@fatehan/tsrp 1.0.24 → 1.0.26
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/areas/area.js +6 -6
- package/dist/fatehan/google/protobuf/timestamp.js +2 -2
- package/dist/fatehan/models/fusion.d.ts +37 -0
- package/dist/fatehan/models/fusion.d.ts.map +1 -1
- package/dist/fatehan/models/fusion.js +597 -9
- package/dist/fatehan/models/models.js +10 -10
- package/dist/fatehan/models/operation.js +6 -6
- package/dist/fatehan/notifies/notify.d.ts +3 -4
- package/dist/fatehan/notifies/notify.d.ts.map +1 -1
- package/dist/fatehan/notifies/notify.js +43 -59
- package/dist/fatehan/packets/dataModel.d.ts +82 -0
- package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
- package/dist/fatehan/packets/dataModel.js +1415 -64
- package/dist/fatehan/packets/messages.d.ts +9 -1
- package/dist/fatehan/packets/messages.d.ts.map +1 -1
- package/dist/fatehan/packets/messages.js +135 -55
- package/dist/fatehan/reports/report.js +81 -81
- package/dist/fatehan/trips/trip.d.ts +44 -0
- package/dist/fatehan/trips/trip.d.ts.map +1 -1
- package/dist/fatehan/trips/trip.js +289 -20
- package/package.json +3 -3
|
@@ -16,7 +16,6 @@ export interface CommandContent {
|
|
|
16
16
|
message?: string | undefined;
|
|
17
17
|
params: string[];
|
|
18
18
|
rawCommand?: string | undefined;
|
|
19
|
-
command: Uint8Array;
|
|
20
19
|
}
|
|
21
20
|
export interface CommandAkn {
|
|
22
21
|
code: number;
|
|
@@ -61,12 +60,21 @@ export interface CommandStruct {
|
|
|
61
60
|
createdAt?: Date | undefined;
|
|
62
61
|
updatedAt?: Date | undefined;
|
|
63
62
|
}
|
|
63
|
+
export interface DevicePoolRequestRefetch {
|
|
64
|
+
}
|
|
65
|
+
export interface DevicePoolRequest {
|
|
66
|
+
deviceId: Long;
|
|
67
|
+
requested?: Date | undefined;
|
|
68
|
+
requestRefetch?: DevicePoolRequestRefetch | undefined;
|
|
69
|
+
}
|
|
64
70
|
export declare const CommandContent: MessageFns<CommandContent>;
|
|
65
71
|
export declare const CommandAkn: MessageFns<CommandAkn>;
|
|
66
72
|
export declare const Command: MessageFns<Command>;
|
|
67
73
|
export declare const CommandValidation: MessageFns<CommandValidation>;
|
|
68
74
|
export declare const CommandFormat: MessageFns<CommandFormat>;
|
|
69
75
|
export declare const CommandStruct: MessageFns<CommandStruct>;
|
|
76
|
+
export declare const DevicePoolRequestRefetch: MessageFns<DevicePoolRequestRefetch>;
|
|
77
|
+
export declare const DevicePoolRequest: MessageFns<DevicePoolRequest>;
|
|
70
78
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
71
79
|
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 {} ? {
|
|
72
80
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/fatehan/packets/messages.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,KAAK,IAAI;IACT,IAAI,IAAI;IACR,YAAY,KAAK;CAClB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,GAAG,aAAa,CAmBhE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAcjE;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC7B,OAAO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AAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GACrD,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAAE,CAAC;AAgCnG,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.7.
|
|
4
|
+
// protoc-gen-ts_proto v2.7.0
|
|
5
5
|
// protoc v6.31.1
|
|
6
6
|
// source: packets/messages.proto
|
|
7
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.CommandStruct = exports.CommandFormat = exports.CommandValidation = exports.Command = exports.CommandAkn = exports.CommandContent = exports.CommandStatus = exports.protobufPackage = void 0;
|
|
11
|
+
exports.DevicePoolRequest = exports.DevicePoolRequestRefetch = exports.CommandStruct = exports.CommandFormat = exports.CommandValidation = exports.Command = exports.CommandAkn = exports.CommandContent = exports.CommandStatus = exports.protobufPackage = void 0;
|
|
12
12
|
exports.commandStatusFromJSON = commandStatusFromJSON;
|
|
13
13
|
exports.commandStatusToJSON = commandStatusToJSON;
|
|
14
14
|
/* eslint-disable */
|
|
@@ -60,14 +60,7 @@ function commandStatusToJSON(object) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function createBaseCommandContent() {
|
|
63
|
-
return {
|
|
64
|
-
deviceId: long_1.default.UZERO,
|
|
65
|
-
commandId: undefined,
|
|
66
|
-
message: undefined,
|
|
67
|
-
params: [],
|
|
68
|
-
rawCommand: undefined,
|
|
69
|
-
command: new Uint8Array(0),
|
|
70
|
-
};
|
|
63
|
+
return { deviceId: long_1.default.UZERO, commandId: undefined, message: undefined, params: [], rawCommand: undefined };
|
|
71
64
|
}
|
|
72
65
|
exports.CommandContent = {
|
|
73
66
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -86,14 +79,11 @@ exports.CommandContent = {
|
|
|
86
79
|
if (message.rawCommand !== undefined) {
|
|
87
80
|
writer.uint32(42).string(message.rawCommand);
|
|
88
81
|
}
|
|
89
|
-
if (message.command.length !== 0) {
|
|
90
|
-
writer.uint32(50).bytes(message.command);
|
|
91
|
-
}
|
|
92
82
|
return writer;
|
|
93
83
|
},
|
|
94
84
|
decode(input, length) {
|
|
95
85
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
96
|
-
|
|
86
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
87
|
const message = createBaseCommandContent();
|
|
98
88
|
while (reader.pos < end) {
|
|
99
89
|
const tag = reader.uint32();
|
|
@@ -133,13 +123,6 @@ exports.CommandContent = {
|
|
|
133
123
|
message.rawCommand = reader.string();
|
|
134
124
|
continue;
|
|
135
125
|
}
|
|
136
|
-
case 6: {
|
|
137
|
-
if (tag !== 50) {
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
message.command = reader.bytes();
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
126
|
}
|
|
144
127
|
if ((tag & 7) === 4 || tag === 0) {
|
|
145
128
|
break;
|
|
@@ -155,7 +138,6 @@ exports.CommandContent = {
|
|
|
155
138
|
message: isSet(object.message) ? globalThis.String(object.message) : undefined,
|
|
156
139
|
params: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.params) ? object.params.map((e) => globalThis.String(e)) : [],
|
|
157
140
|
rawCommand: isSet(object.raw_command) ? globalThis.String(object.raw_command) : undefined,
|
|
158
|
-
command: isSet(object.command) ? bytesFromBase64(object.command) : new Uint8Array(0),
|
|
159
141
|
};
|
|
160
142
|
},
|
|
161
143
|
toJSON(message) {
|
|
@@ -176,16 +158,13 @@ exports.CommandContent = {
|
|
|
176
158
|
if (message.rawCommand !== undefined) {
|
|
177
159
|
obj.raw_command = message.rawCommand;
|
|
178
160
|
}
|
|
179
|
-
if (message.command.length !== 0) {
|
|
180
|
-
obj.command = base64FromBytes(message.command);
|
|
181
|
-
}
|
|
182
161
|
return obj;
|
|
183
162
|
},
|
|
184
163
|
create(base) {
|
|
185
164
|
return exports.CommandContent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
186
165
|
},
|
|
187
166
|
fromPartial(object) {
|
|
188
|
-
var _a, _b, _c
|
|
167
|
+
var _a, _b, _c;
|
|
189
168
|
const message = createBaseCommandContent();
|
|
190
169
|
message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
|
|
191
170
|
? long_1.default.fromValue(object.deviceId)
|
|
@@ -196,7 +175,6 @@ exports.CommandContent = {
|
|
|
196
175
|
message.message = (_a = object.message) !== null && _a !== void 0 ? _a : undefined;
|
|
197
176
|
message.params = ((_b = object.params) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
|
|
198
177
|
message.rawCommand = (_c = object.rawCommand) !== null && _c !== void 0 ? _c : undefined;
|
|
199
|
-
message.command = (_d = object.command) !== null && _d !== void 0 ? _d : new Uint8Array(0);
|
|
200
178
|
return message;
|
|
201
179
|
},
|
|
202
180
|
};
|
|
@@ -215,7 +193,7 @@ exports.CommandAkn = {
|
|
|
215
193
|
},
|
|
216
194
|
decode(input, length) {
|
|
217
195
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
218
|
-
|
|
196
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
219
197
|
const message = createBaseCommandAkn();
|
|
220
198
|
while (reader.pos < end) {
|
|
221
199
|
const tag = reader.uint32();
|
|
@@ -319,7 +297,7 @@ exports.Command = {
|
|
|
319
297
|
},
|
|
320
298
|
decode(input, length) {
|
|
321
299
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
322
|
-
|
|
300
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
323
301
|
const message = createBaseCommand();
|
|
324
302
|
while (reader.pos < end) {
|
|
325
303
|
const tag = reader.uint32();
|
|
@@ -506,7 +484,7 @@ exports.CommandValidation = {
|
|
|
506
484
|
},
|
|
507
485
|
decode(input, length) {
|
|
508
486
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
509
|
-
|
|
487
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
510
488
|
const message = createBaseCommandValidation();
|
|
511
489
|
while (reader.pos < end) {
|
|
512
490
|
const tag = reader.uint32();
|
|
@@ -623,7 +601,7 @@ exports.CommandFormat = {
|
|
|
623
601
|
},
|
|
624
602
|
decode(input, length) {
|
|
625
603
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
626
|
-
|
|
604
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
627
605
|
const message = createBaseCommandFormat();
|
|
628
606
|
while (reader.pos < end) {
|
|
629
607
|
const tag = reader.uint32();
|
|
@@ -742,7 +720,7 @@ exports.CommandStruct = {
|
|
|
742
720
|
},
|
|
743
721
|
decode(input, length) {
|
|
744
722
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
745
|
-
|
|
723
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
746
724
|
const message = createBaseCommandStruct();
|
|
747
725
|
while (reader.pos < end) {
|
|
748
726
|
const tag = reader.uint32();
|
|
@@ -942,31 +920,133 @@ exports.CommandStruct = {
|
|
|
942
920
|
return message;
|
|
943
921
|
},
|
|
944
922
|
};
|
|
945
|
-
function
|
|
946
|
-
|
|
947
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
const bin = globalThis.atob(b64);
|
|
951
|
-
const arr = new Uint8Array(bin.length);
|
|
952
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
953
|
-
arr[i] = bin.charCodeAt(i);
|
|
954
|
-
}
|
|
955
|
-
return arr;
|
|
956
|
-
}
|
|
923
|
+
function createBaseDevicePoolRequestRefetch() {
|
|
924
|
+
return {};
|
|
957
925
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
return
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
926
|
+
exports.DevicePoolRequestRefetch = {
|
|
927
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
928
|
+
return writer;
|
|
929
|
+
},
|
|
930
|
+
decode(input, length) {
|
|
931
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
932
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
933
|
+
const message = createBaseDevicePoolRequestRefetch();
|
|
934
|
+
while (reader.pos < end) {
|
|
935
|
+
const tag = reader.uint32();
|
|
936
|
+
switch (tag >>> 3) {
|
|
937
|
+
}
|
|
938
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
939
|
+
break;
|
|
940
|
+
}
|
|
941
|
+
reader.skip(tag & 7);
|
|
942
|
+
}
|
|
943
|
+
return message;
|
|
944
|
+
},
|
|
945
|
+
fromJSON(_) {
|
|
946
|
+
return {};
|
|
947
|
+
},
|
|
948
|
+
toJSON(_) {
|
|
949
|
+
const obj = {};
|
|
950
|
+
return obj;
|
|
951
|
+
},
|
|
952
|
+
create(base) {
|
|
953
|
+
return exports.DevicePoolRequestRefetch.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
954
|
+
},
|
|
955
|
+
fromPartial(_) {
|
|
956
|
+
const message = createBaseDevicePoolRequestRefetch();
|
|
957
|
+
return message;
|
|
958
|
+
},
|
|
959
|
+
};
|
|
960
|
+
function createBaseDevicePoolRequest() {
|
|
961
|
+
return { deviceId: long_1.default.UZERO, requested: undefined, requestRefetch: undefined };
|
|
969
962
|
}
|
|
963
|
+
exports.DevicePoolRequest = {
|
|
964
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
965
|
+
if (!message.deviceId.equals(long_1.default.UZERO)) {
|
|
966
|
+
writer.uint32(8).uint64(message.deviceId.toString());
|
|
967
|
+
}
|
|
968
|
+
if (message.requested !== undefined) {
|
|
969
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.requested), writer.uint32(18).fork()).join();
|
|
970
|
+
}
|
|
971
|
+
if (message.requestRefetch !== undefined) {
|
|
972
|
+
exports.DevicePoolRequestRefetch.encode(message.requestRefetch, writer.uint32(26).fork()).join();
|
|
973
|
+
}
|
|
974
|
+
return writer;
|
|
975
|
+
},
|
|
976
|
+
decode(input, length) {
|
|
977
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
978
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
979
|
+
const message = createBaseDevicePoolRequest();
|
|
980
|
+
while (reader.pos < end) {
|
|
981
|
+
const tag = reader.uint32();
|
|
982
|
+
switch (tag >>> 3) {
|
|
983
|
+
case 1: {
|
|
984
|
+
if (tag !== 8) {
|
|
985
|
+
break;
|
|
986
|
+
}
|
|
987
|
+
message.deviceId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
case 2: {
|
|
991
|
+
if (tag !== 18) {
|
|
992
|
+
break;
|
|
993
|
+
}
|
|
994
|
+
message.requested = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
995
|
+
continue;
|
|
996
|
+
}
|
|
997
|
+
case 3: {
|
|
998
|
+
if (tag !== 26) {
|
|
999
|
+
break;
|
|
1000
|
+
}
|
|
1001
|
+
message.requestRefetch = exports.DevicePoolRequestRefetch.decode(reader, reader.uint32());
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
reader.skip(tag & 7);
|
|
1009
|
+
}
|
|
1010
|
+
return message;
|
|
1011
|
+
},
|
|
1012
|
+
fromJSON(object) {
|
|
1013
|
+
return {
|
|
1014
|
+
deviceId: isSet(object.device_id) ? long_1.default.fromValue(object.device_id) : long_1.default.UZERO,
|
|
1015
|
+
requested: isSet(object.requested) ? fromJsonTimestamp(object.requested) : undefined,
|
|
1016
|
+
requestRefetch: isSet(object.requestRefetch)
|
|
1017
|
+
? exports.DevicePoolRequestRefetch.fromJSON(object.requestRefetch)
|
|
1018
|
+
: undefined,
|
|
1019
|
+
};
|
|
1020
|
+
},
|
|
1021
|
+
toJSON(message) {
|
|
1022
|
+
const obj = {};
|
|
1023
|
+
if (!message.deviceId.equals(long_1.default.UZERO)) {
|
|
1024
|
+
obj.device_id = (message.deviceId || long_1.default.UZERO).toString();
|
|
1025
|
+
}
|
|
1026
|
+
if (message.requested !== undefined) {
|
|
1027
|
+
obj.requested = message.requested.toISOString();
|
|
1028
|
+
}
|
|
1029
|
+
if (message.requestRefetch !== undefined) {
|
|
1030
|
+
obj.requestRefetch = exports.DevicePoolRequestRefetch.toJSON(message.requestRefetch);
|
|
1031
|
+
}
|
|
1032
|
+
return obj;
|
|
1033
|
+
},
|
|
1034
|
+
create(base) {
|
|
1035
|
+
return exports.DevicePoolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1036
|
+
},
|
|
1037
|
+
fromPartial(object) {
|
|
1038
|
+
var _a;
|
|
1039
|
+
const message = createBaseDevicePoolRequest();
|
|
1040
|
+
message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
|
|
1041
|
+
? long_1.default.fromValue(object.deviceId)
|
|
1042
|
+
: long_1.default.UZERO;
|
|
1043
|
+
message.requested = (_a = object.requested) !== null && _a !== void 0 ? _a : undefined;
|
|
1044
|
+
message.requestRefetch = (object.requestRefetch !== undefined && object.requestRefetch !== null)
|
|
1045
|
+
? exports.DevicePoolRequestRefetch.fromPartial(object.requestRefetch)
|
|
1046
|
+
: undefined;
|
|
1047
|
+
return message;
|
|
1048
|
+
},
|
|
1049
|
+
};
|
|
970
1050
|
function toTimestamp(date) {
|
|
971
1051
|
const seconds = numberToLong(Math.trunc(date.getTime() / 1000));
|
|
972
1052
|
const nanos = (date.getTime() % 1000) * 1000000;
|