@fatehan/tsrp 1.0.40 → 1.0.42

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.
@@ -1,7 +1,7 @@
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.0
4
+ // protoc-gen-ts_proto v2.7.5
5
5
  // protoc v6.31.1
6
6
  // source: trips/trip.proto
7
7
  var __importDefault = (this && this.__importDefault) || function (mod) {
@@ -1123,7 +1123,7 @@ exports.Monthly = {
1123
1123
  },
1124
1124
  decode(input, length) {
1125
1125
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1126
- let end = length === undefined ? reader.len : reader.pos + length;
1126
+ const end = length === undefined ? reader.len : reader.pos + length;
1127
1127
  const message = createBaseMonthly();
1128
1128
  while (reader.pos < end) {
1129
1129
  const tag = reader.uint32();
@@ -1413,7 +1413,7 @@ exports.MonthlyCompact = {
1413
1413
  },
1414
1414
  decode(input, length) {
1415
1415
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1416
- let end = length === undefined ? reader.len : reader.pos + length;
1416
+ const end = length === undefined ? reader.len : reader.pos + length;
1417
1417
  const message = createBaseMonthlyCompact();
1418
1418
  while (reader.pos < end) {
1419
1419
  const tag = reader.uint32();
@@ -1709,7 +1709,7 @@ exports.MonthlyCompact_GreenDrivingEntry = {
1709
1709
  },
1710
1710
  decode(input, length) {
1711
1711
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1712
- let end = length === undefined ? reader.len : reader.pos + length;
1712
+ const end = length === undefined ? reader.len : reader.pos + length;
1713
1713
  const message = createBaseMonthlyCompact_GreenDrivingEntry();
1714
1714
  while (reader.pos < end) {
1715
1715
  const tag = reader.uint32();
@@ -1778,7 +1778,7 @@ exports.MonthlyCompact_TemperatureEntry = {
1778
1778
  },
1779
1779
  decode(input, length) {
1780
1780
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1781
- let end = length === undefined ? reader.len : reader.pos + length;
1781
+ const end = length === undefined ? reader.len : reader.pos + length;
1782
1782
  const message = createBaseMonthlyCompact_TemperatureEntry();
1783
1783
  while (reader.pos < end) {
1784
1784
  const tag = reader.uint32();
@@ -1847,7 +1847,7 @@ exports.MonthlyCompact_HumidityEntry = {
1847
1847
  },
1848
1848
  decode(input, length) {
1849
1849
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1850
- let end = length === undefined ? reader.len : reader.pos + length;
1850
+ const end = length === undefined ? reader.len : reader.pos + length;
1851
1851
  const message = createBaseMonthlyCompact_HumidityEntry();
1852
1852
  while (reader.pos < end) {
1853
1853
  const tag = reader.uint32();
@@ -1916,7 +1916,7 @@ exports.MonthlyCompact_CrashesEntry = {
1916
1916
  },
1917
1917
  decode(input, length) {
1918
1918
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1919
- let end = length === undefined ? reader.len : reader.pos + length;
1919
+ const end = length === undefined ? reader.len : reader.pos + length;
1920
1920
  const message = createBaseMonthlyCompact_CrashesEntry();
1921
1921
  while (reader.pos < end) {
1922
1922
  const tag = reader.uint32();
@@ -1985,7 +1985,7 @@ exports.MonthlyCompact_SpeedsEntry = {
1985
1985
  },
1986
1986
  decode(input, length) {
1987
1987
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1988
- let end = length === undefined ? reader.len : reader.pos + length;
1988
+ const end = length === undefined ? reader.len : reader.pos + length;
1989
1989
  const message = createBaseMonthlyCompact_SpeedsEntry();
1990
1990
  while (reader.pos < end) {
1991
1991
  const tag = reader.uint32();
@@ -2115,7 +2115,7 @@ exports.Trip = {
2115
2115
  },
2116
2116
  decode(input, length) {
2117
2117
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2118
- let end = length === undefined ? reader.len : reader.pos + length;
2118
+ const end = length === undefined ? reader.len : reader.pos + length;
2119
2119
  const message = createBaseTrip();
2120
2120
  while (reader.pos < end) {
2121
2121
  const tag = reader.uint32();
@@ -2422,7 +2422,7 @@ exports.TripCompact = {
2422
2422
  },
2423
2423
  decode(input, length) {
2424
2424
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2425
- let end = length === undefined ? reader.len : reader.pos + length;
2425
+ const end = length === undefined ? reader.len : reader.pos + length;
2426
2426
  const message = createBaseTripCompact();
2427
2427
  while (reader.pos < end) {
2428
2428
  const tag = reader.uint32();
@@ -2782,7 +2782,7 @@ exports.TripCompact_GreenDrivingEntry = {
2782
2782
  },
2783
2783
  decode(input, length) {
2784
2784
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2785
- let end = length === undefined ? reader.len : reader.pos + length;
2785
+ const end = length === undefined ? reader.len : reader.pos + length;
2786
2786
  const message = createBaseTripCompact_GreenDrivingEntry();
2787
2787
  while (reader.pos < end) {
2788
2788
  const tag = reader.uint32();
@@ -2851,7 +2851,7 @@ exports.TripCompact_TemperatureEntry = {
2851
2851
  },
2852
2852
  decode(input, length) {
2853
2853
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2854
- let end = length === undefined ? reader.len : reader.pos + length;
2854
+ const end = length === undefined ? reader.len : reader.pos + length;
2855
2855
  const message = createBaseTripCompact_TemperatureEntry();
2856
2856
  while (reader.pos < end) {
2857
2857
  const tag = reader.uint32();
@@ -2920,7 +2920,7 @@ exports.TripCompact_HumidityEntry = {
2920
2920
  },
2921
2921
  decode(input, length) {
2922
2922
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2923
- let end = length === undefined ? reader.len : reader.pos + length;
2923
+ const end = length === undefined ? reader.len : reader.pos + length;
2924
2924
  const message = createBaseTripCompact_HumidityEntry();
2925
2925
  while (reader.pos < end) {
2926
2926
  const tag = reader.uint32();
@@ -2989,7 +2989,7 @@ exports.TripCompact_CrashesEntry = {
2989
2989
  },
2990
2990
  decode(input, length) {
2991
2991
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2992
- let end = length === undefined ? reader.len : reader.pos + length;
2992
+ const end = length === undefined ? reader.len : reader.pos + length;
2993
2993
  const message = createBaseTripCompact_CrashesEntry();
2994
2994
  while (reader.pos < end) {
2995
2995
  const tag = reader.uint32();
@@ -3058,7 +3058,7 @@ exports.TripCompact_SpeedsEntry = {
3058
3058
  },
3059
3059
  decode(input, length) {
3060
3060
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3061
- let end = length === undefined ? reader.len : reader.pos + length;
3061
+ const end = length === undefined ? reader.len : reader.pos + length;
3062
3062
  const message = createBaseTripCompact_SpeedsEntry();
3063
3063
  while (reader.pos < end) {
3064
3064
  const tag = reader.uint32();
@@ -3132,7 +3132,7 @@ exports.TripPoint = {
3132
3132
  },
3133
3133
  decode(input, length) {
3134
3134
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3135
- let end = length === undefined ? reader.len : reader.pos + length;
3135
+ const end = length === undefined ? reader.len : reader.pos + length;
3136
3136
  const message = createBaseTripPoint();
3137
3137
  while (reader.pos < end) {
3138
3138
  const tag = reader.uint32();
@@ -3213,7 +3213,7 @@ exports.TripDurationStat = {
3213
3213
  },
3214
3214
  decode(input, length) {
3215
3215
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3216
- let end = length === undefined ? reader.len : reader.pos + length;
3216
+ const end = length === undefined ? reader.len : reader.pos + length;
3217
3217
  const message = createBaseTripDurationStat();
3218
3218
  while (reader.pos < end) {
3219
3219
  const tag = reader.uint32();
@@ -3413,7 +3413,7 @@ exports.FusionTrip = {
3413
3413
  },
3414
3414
  decode(input, length) {
3415
3415
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3416
- let end = length === undefined ? reader.len : reader.pos + length;
3416
+ const end = length === undefined ? reader.len : reader.pos + length;
3417
3417
  const message = createBaseFusionTrip();
3418
3418
  while (reader.pos < end) {
3419
3419
  const tag = reader.uint32();
@@ -3877,7 +3877,7 @@ exports.TripTask = {
3877
3877
  },
3878
3878
  decode(input, length) {
3879
3879
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3880
- let end = length === undefined ? reader.len : reader.pos + length;
3880
+ const end = length === undefined ? reader.len : reader.pos + length;
3881
3881
  const message = createBaseTripTask();
3882
3882
  while (reader.pos < end) {
3883
3883
  const tag = reader.uint32();
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AreaSummaryReviewRequest, AreaSummaryReviewResponse, ChartRequest, ChartResponse, CommandHistoryRequest, CommandHistoryResponse, DashboardIndividualRequest, DashboardIndividualResponse, DeviceDataRequest, DeviceDataResponse, LogRequest, LogResponse, RouteReviewRequest, RouteReviewResponse, RouteStopRequest, RouteStopResponse, SystemIoRequest, SystemIoResponse, TripPerformanceRequest, TripPerformanceResponse, TripReportRequest, TripReportResponse, WorkCycleRequest, WorkCycleResponse } from "./fatehan/reports/report";
2
- import { DeviceIo, ShownIo, SystemIo } from "./fatehan/models/models";
2
+ import { ShownIo, SystemIo } from "./fatehan/models/models";
3
3
  import { Data } from "./fatehan/packets/dataModel";
4
4
  export declare class ReportService {
5
5
  private readonly url;
@@ -18,7 +18,7 @@ export declare class ReportService {
18
18
  CommandHistoryReport(request: CommandHistoryRequest): Promise<CommandHistoryResponse>;
19
19
  ChartReport(request: ChartRequest, responses: (chunk: ChartResponse) => void): Promise<void>;
20
20
  SystemIoReport(request: SystemIoRequest): Promise<SystemIoResponse>;
21
- SystemIoCast(systemIo: SystemIo[] | null, deviceIo: DeviceIo[], data: Data): Promise<ShownIo[]>;
21
+ SystemIoCast(systemIo: SystemIo[] | null, deviceIo: SystemIo[], data: Data): Promise<ShownIo[]>;
22
22
  Matin(): Promise<void>;
23
23
  }
24
24
  //# sourceMappingUR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AE,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAgB/F,KAAK;CAGnB"}
@@ -7,8 +7,8 @@ const vitest_1 = require("vitest");
7
7
  const index_1 = require("./index");
8
8
  const report_1 = require("./fatehan/reports/report");
9
9
  const long_1 = __importDefault(require("long"));
10
- const models_1 = require("./fatehan/models/models");
11
10
  const system_io_1 = __importDefault(require("./system.io"));
11
+ const models_1 = require("./fatehan/models/models");
12
12
  (0, vitest_1.describe)("ReportService", () => {
13
13
  let url = "http://report.myavl.ir:1272";
14
14
  let token = "5|gvRWOzVBVN3a6Q7iajws2uV9TEVELEK81H3RCpzO85369b27";
@@ -94,7 +94,7 @@ const system_io_1 = __importDefault(require("./system.io"));
94
94
  deviceIds: [long_1.default.fromInt(119926)],
95
95
  ios: ["Speed", "Compact.IoElement.ExternalVoltage"],
96
96
  startedAt: new Date("2025-06-28 00:00:00"),
97
- finishedAt: new Date("2025-06-30 00:00:00")
97
+ finishedAt: new Date("2025-06-30 00:00:00"),
98
98
  }, (chunk) => {
99
99
  console.log(report_1.ChartResponse.toJSON(chunk));
100
100
  });
@@ -103,20 +103,25 @@ const system_io_1 = __importDefault(require("./system.io"));
103
103
  let devIo = {
104
104
  formula: "($speed / 3.6)",
105
105
  name: "سرعت",
106
- type: models_1.SystemIoType.FLOAT,
106
+ type: models_1.SystemIo_SystemIoType.FLOAT,
107
107
  activeStyle: {
108
108
  color: "#3a3a3a",
109
- name: "سرعت"
109
+ name: "سرعت",
110
110
  },
111
111
  inactiveStyle: {
112
- color: '#a3a3a3',
113
- name: "سرعت"
112
+ color: "#a3a3a3",
113
+ name: "سرعت",
114
114
  },
115
115
  description: "سرعت خودرو",
116
116
  unit: "m/h",
117
117
  deviceId: long_1.default.fromNumber(7744),
118
118
  organizationId: long_1.default.fromNumber(7744),
119
119
  id: long_1.default.fromNumber(1),
120
+ active: true,
121
+ graphable: true,
122
+ sord: 1,
123
+ hidden: [],
124
+ unknown: {}
120
125
  };
121
126
  let systemIos = await c.SystemIoReport({});
122
127
  let result = (0, system_io_1.default)(systemIos.ios, [devIo], {
@@ -366,9 +371,7 @@ const system_io_1 = __importDefault(require("./system.io"));
366
371
  obdOemElements: undefined,
367
372
  bleSensorsIoElements: undefined,
368
373
  canAdaptersElements: undefined,
369
- alerts: [
370
- 0,
371
- ],
374
+ alerts: [0],
372
375
  alertValues: {},
373
376
  adas: undefined,
374
377
  fms: undefined,
@@ -1,5 +1,5 @@
1
- import { DeviceIo, ShownIo, SystemIo } from "./fatehan/models/models";
1
+ import { ShownIo, SystemIo } from "./fatehan/models/models";
2
2
  import { Data } from "./fatehan/packets/dataModel";
3
- declare const SystemIoCast: (systemIo: SystemIo[], deviceIo: DeviceIo[], data: Data) => ShownIo[];
3
+ declare const SystemIoCast: (systemIo: SystemIo[], deviceIo: SystemIo[], data: Data) => ShownIo[];
4
4
  export default SystemIoCast;
5
5
  //# sourceMappingURL=system.io.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EAET,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,EAwDT,CAAC;AAuBF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EAET,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,EA6DT,CAAC;AAuBF,eAAe,YAAY,CAAC"}
package/dist/system.io.js CHANGED
@@ -3,28 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const models_1 = require("./fatehan/models/models");
4
4
  const SystemIoCast = (systemIo, deviceIo, data) => {
5
5
  let list = [];
6
- for (let i = 0; i < systemIo.length; i++) {
7
- const value = getNestedPropertyValue(data, systemIo[i].key);
8
- let style = systemIo[i].activeStyle;
9
- if (systemIo[i].type === models_1.SystemIoType.BOOLEAN) {
10
- style =
11
- value === "false"
12
- ? systemIo[i].inactiveStyle
13
- : systemIo[i].activeStyle;
14
- }
15
- if (value != null) {
16
- list.push({
17
- value: value,
18
- name: systemIo[i].name,
19
- unit: systemIo[i].unit,
20
- style: style,
21
- description: systemIo[i].description,
22
- });
23
- }
24
- }
25
- for (let i = 0; i < deviceIo.length; i++) {
26
- let items = extractVariables(deviceIo[i].formula);
27
- let formula = deviceIo[i].formula;
6
+ const tempSystemIo = [...systemIo, ...deviceIo].sort((a, b) => a.sord - b.sord);
7
+ tempSystemIo.forEach((io) => {
8
+ let items = extractVariables(io.formula);
9
+ let formula = io.formula;
28
10
  let hasIos = true;
29
11
  for (let i = 0; i < items.length; i++) {
30
12
  const value = getNestedPropertyValue(data, items[i]);
@@ -34,23 +16,41 @@ const SystemIoCast = (systemIo, deviceIo, data) => {
34
16
  }
35
17
  formula = formula.replace(new RegExp("\\$" + items[i], "g"), value);
36
18
  }
37
- if (!hasIos) {
38
- continue;
39
- }
40
- const value = eval(formula);
41
- let style = deviceIo[i].activeStyle;
42
- if (deviceIo[i].type === models_1.SystemIoType.BOOLEAN) {
43
- style =
44
- value === "false" || value === false ? deviceIo[i].inactiveStyle : deviceIo[i].activeStyle;
19
+ if (hasIos) {
20
+ const value = eval(formula);
21
+ let style = io.activeStyle;
22
+ if (io.type === models_1.SystemIo_SystemIoType.BOOLEAN) {
23
+ style =
24
+ value === "false" || value === false
25
+ ? io.inactiveStyle
26
+ : io.activeStyle;
27
+ }
28
+ let newValue = value;
29
+ for (const key in io.unknown) {
30
+ if (value.toString().equals(key)) {
31
+ newValue = io.unknown[key];
32
+ }
33
+ }
34
+ let hidden = false;
35
+ io.hidden.forEach((item) => {
36
+ if (newValue.toString().equals(item)) {
37
+ hidden = true;
38
+ }
39
+ });
40
+ if (!hidden) {
41
+ list.push({
42
+ name: io.name,
43
+ style: style,
44
+ unit: io.unit,
45
+ description: io.description,
46
+ value: newValue,
47
+ active: io.active,
48
+ graphable: io.graphable,
49
+ sord: io.sord,
50
+ });
51
+ }
45
52
  }
46
- list.push({
47
- value: value,
48
- name: deviceIo[i].name,
49
- unit: deviceIo[i].unit,
50
- style: style,
51
- description: deviceIo[i].description,
52
- });
53
- }
53
+ });
54
54
  return list;
55
55
  };
56
56
  function extractVariables(str) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
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.0.13",
31
+ "@types/node": "^24.1.0",
32
32
  "ts-node": "^10.9.2",
33
33
  "ts-proto": "^2.7.5",
34
34
  "typescript": "^5.8.3",
package/readme.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ```cmd
6
6
  protoc \
7
- --plugin=protoc-gen-ts_proto=/usr/bin/protoc-gen-ts_proto \
7
+ --plugin=protoc-gen-ts_proto=$(which protoc-gen-ts_proto) \
8
8
  -I ./src/fatehan \
9
9
  -I ../protocols \
10
10
  --ts_proto_out=./src/fatehan \