@fatehan/tsrp 1.0.10 → 1.0.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DashboardIndividualRequest, DashboardIndividualResponse, RouteReviewRequest, RouteReviewResponse, TripPerformanceRequest, TripPerformanceResponse, TripReportRequest, TripReportResponse } from "./fatehan/reports/report";
1
+ import { DashboardIndividualRequest, DashboardIndividualResponse, LogRequest, LogResponse, RouteReviewRequest, RouteReviewResponse, TripPerformanceRequest, TripPerformanceResponse, TripReportRequest, TripReportResponse } from "./fatehan/reports/report";
2
2
  export declare class ReportService {
3
3
  private readonly url;
4
4
  private readonly namespace;
@@ -8,5 +8,6 @@ export declare class ReportService {
8
8
  TripReport(request: TripReportRequest): Promise<TripReportResponse>;
9
9
  RouteReviewReport(request: RouteReviewRequest): Promise<RouteReviewResponse>;
10
10
  DashboardIndividual(request: DashboardIndividualRequest): Promise<DashboardIndividualResponse>;
11
+ LogReport(request: LogRequest): Promise<LogResponse>;
11
12
  }
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAAE,mBAAmB,EACvC,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAElC,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8C;IACxE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;IAcjE,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgBxF,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBnE,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgB5E,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAexG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,0BAA0B,EAC1B,2BAA2B,EAC3B,UAAU,EACV,WAAW,EACX,kBAAkB,EAAE,mBAAmB,EACvC,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAElC,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8C;IACxE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;IAcjE,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgBxF,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBnE,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgB5E,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAgB9F,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;CAe9D"}
package/dist/index.js CHANGED
@@ -77,5 +77,20 @@ class ReportService {
77
77
  }
78
78
  });
79
79
  }
80
+ LogReport(request) {
81
+ return new Promise(async (resolve, reject) => {
82
+ const response = await fetch(`${this.url}/${this.namespace}/LogReport`, {
83
+ method: "POST",
84
+ headers: this.headers,
85
+ body: report_1.LogRequest.encode(request).finish(),
86
+ });
87
+ if (response.ok) {
88
+ resolve(report_1.LogResponse.decode(new Uint8Array(await response.arrayBuffer())));
89
+ }
90
+ else {
91
+ reject(await response.text());
92
+ }
93
+ });
94
+ }
80
95
  }
81
96
  exports.ReportService = ReportService;
@@ -45,4 +45,15 @@ const report_1 = require("./fatehan/reports/report");
45
45
  });
46
46
  console.log("DashboardReport", res);
47
47
  });
48
+ (0, vitest_1.it)('LogReport', async () => {
49
+ let res = await c.LogReport({
50
+ deviceId: 124251414,
51
+ startedAt: new Date("2025-05-19 00:00:00"),
52
+ finishedAt: new Date("2025-05-220 00:00:00"),
53
+ limit: 50,
54
+ page: 1,
55
+ sort: -1,
56
+ });
57
+ console.log("LogReport", res);
58
+ });
48
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/google-protobuf": "^3.15.12",
30
- "@types/node": "^22.15.18",
30
+ "@types/node": "^22.15.19",
31
31
  "ts-node": "^10.9.2",
32
32
  "ts-proto": "^2.7.0",
33
33
  "typescript": "^5.8.3",
34
- "vitest": "^3.1.3"
34
+ "vitest": "^3.1.4"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@bufbuild/protobuf": "^2.4.0",