@fatehan/tsrp 1.5.3 → 1.5.5
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 +8 -0
- package/dist/fatehan/activities/workflow.d.ts.map +1 -1
- package/dist/fatehan/activities/workflow.js +66 -3
- package/dist/fatehan/apis/client.d.ts +1 -1
- package/dist/fatehan/apis/client.js +3 -3
- package/dist/fatehan/areas/area.js +2 -2
- package/dist/fatehan/devices/devices.js +2 -2
- package/dist/fatehan/devices/maintenance.js +2 -2
- package/dist/fatehan/financial/financial.js +2 -2
- package/dist/fatehan/google/protobuf/descriptor.d.ts +470 -39
- package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -1
- package/dist/fatehan/google/protobuf/descriptor.js +1070 -57
- package/dist/fatehan/google/protobuf/duration.js +2 -2
- package/dist/fatehan/google/protobuf/field_mask.d.ts +16 -18
- package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -1
- package/dist/fatehan/google/protobuf/field_mask.js +2 -2
- package/dist/fatehan/google/protobuf/timestamp.d.ts +10 -9
- package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -1
- package/dist/fatehan/google/protobuf/timestamp.js +2 -2
- package/dist/fatehan/identities/authentication.d.ts +82 -6
- package/dist/fatehan/identities/authentication.d.ts.map +1 -1
- package/dist/fatehan/identities/authentication.js +575 -47
- package/dist/fatehan/identities/identities.d.ts +13 -1
- package/dist/fatehan/identities/identities.d.ts.map +1 -1
- package/dist/fatehan/identities/identities.js +15 -3
- package/dist/fatehan/models/fusion.js +2 -2
- package/dist/fatehan/models/models.js +2 -2
- package/dist/fatehan/notifies/notify.js +2 -2
- package/dist/fatehan/packets/{messages.d.ts → commands.d.ts} +58 -1
- package/dist/fatehan/packets/commands.d.ts.map +1 -0
- package/dist/fatehan/packets/{messages.js → commands.js} +588 -3
- package/dist/fatehan/packets/dataModel.d.ts +189 -127
- package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
- package/dist/fatehan/packets/dataModel.js +1642 -1005
- package/dist/fatehan/packets/dataModule.js +2 -2
- package/dist/fatehan/packets/forge.d.ts +117 -0
- package/dist/fatehan/packets/forge.d.ts.map +1 -0
- package/dist/fatehan/packets/forge.js +1079 -0
- package/dist/fatehan/services/api.d.ts +813 -26
- package/dist/fatehan/services/api.d.ts.map +1 -1
- package/dist/fatehan/services/api.js +8452 -244
- package/dist/fatehan/services/repositories.js +2 -2
- package/dist/fatehan/stream/stream.d.ts +224 -0
- package/dist/fatehan/stream/stream.d.ts.map +1 -0
- package/dist/fatehan/stream/stream.js +1416 -0
- package/dist/fatehan/trips/trip.d.ts +159 -159
- package/dist/fatehan/trips/trip.d.ts.map +1 -1
- package/dist/fatehan/trips/trip.js +169 -169
- package/dist/fatehan/utils/buf/validate/validate.js +2 -2
- package/dist/services.d.ts +65 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/services.js +205 -0
- package/package.json +12 -12
- package/dist/api.d.ts +0 -36
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -146
- package/dist/fatehan/activities/camera.d.ts +0 -95
- package/dist/fatehan/activities/camera.d.ts.map +0 -1
- package/dist/fatehan/activities/camera.js +0 -811
- package/dist/fatehan/google/protobuf/any.d.ts +0 -146
- package/dist/fatehan/google/protobuf/any.d.ts.map +0 -1
- package/dist/fatehan/google/protobuf/any.js +0 -104
- package/dist/fatehan/google/status.d.ts +0 -53
- package/dist/fatehan/google/status.d.ts.map +0 -1
- package/dist/fatehan/google/status.js +0 -95
- package/dist/fatehan/packets/messages.d.ts.map +0 -1
- package/dist/fatehan/reports/report.d.ts +0 -830
- package/dist/fatehan/reports/report.d.ts.map +0 -1
- package/dist/fatehan/reports/report.js +0 -8380
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1
- package/dist/report.d.ts +0 -29
- package/dist/report.d.ts.map +0 -1
- package/dist/report.js +0 -139
- package/readme.md +0 -26
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/report.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { HeaderProvider } from ".";
|
|
2
|
-
export declare class ApiError extends Error {
|
|
3
|
-
status: number;
|
|
4
|
-
constructor(status: number, message: string);
|
|
5
|
-
}
|
|
6
|
-
export declare class ReportService {
|
|
7
|
-
private readonly url;
|
|
8
|
-
private readonly namespace;
|
|
9
|
-
private readonly getDynamicHeaders;
|
|
10
|
-
constructor(url: string, headerProvider: HeaderProvider);
|
|
11
|
-
private _call;
|
|
12
|
-
RouteStopReport(request: import("./fatehan/reports/report").RouteStopRequest): Promise<import("./fatehan/reports/report").RouteStopResponse>;
|
|
13
|
-
TripPerformanceReport(request: import("./fatehan/reports/report").TripPerformanceRequest): Promise<import("./fatehan/reports/report").TripPerformanceResponse>;
|
|
14
|
-
TripReport(request: import("./fatehan/reports/report").TripReportRequest): Promise<import("./fatehan/reports/report").TripReportResponse>;
|
|
15
|
-
RouteReviewReport(request: import("./fatehan/reports/report").RouteReviewRequest): Promise<import("./fatehan/reports/report").RouteReviewResponse>;
|
|
16
|
-
DashboardIndividual(request: import("./fatehan/reports/report").DashboardIndividualRequest): Promise<import("./fatehan/reports/report").DashboardIndividualResponse>;
|
|
17
|
-
LogReport(request: import("./fatehan/reports/report").LogRequest): Promise<import("./fatehan/reports/report").LogResponse>;
|
|
18
|
-
DataReport(request: import("./fatehan/reports/report").DeviceDataRequest): Promise<import("./fatehan/reports/report").DeviceDataResponse>;
|
|
19
|
-
AreaSummaryReviewReport(request: import("./fatehan/reports/report").AreaSummaryReviewRequest): Promise<import("./fatehan/reports/report").AreaSummaryReviewResponse>;
|
|
20
|
-
WorkCycleReport(request: import("./fatehan/reports/report").WorkCycleRequest): Promise<import("./fatehan/reports/report").WorkCycleResponse>;
|
|
21
|
-
DriverBehaviorReport(request: import("./fatehan/reports/report").DriverBehaviorReportRequest): Promise<import("./fatehan/reports/report").DriverBehaviorReportResponse>;
|
|
22
|
-
CommandHistoryReport(request: import("./fatehan/reports/report").CommandHistoryRequest): Promise<import("./fatehan/reports/report").CommandHistoryResponse>;
|
|
23
|
-
WorkflowReport(request: import("./fatehan/reports/report").WorkflowRequest): Promise<import("./fatehan/reports/report").WorkflowResponse>;
|
|
24
|
-
ChartReport(request: import("./fatehan/reports/report").ChartRequest, responses: (chunk: import("./fatehan/reports/report").ChartResponse) => void, onError: (error: {
|
|
25
|
-
status: number;
|
|
26
|
-
message: string;
|
|
27
|
-
}) => void): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=report.d.ts.map
|
package/dist/report.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,qBAAa,QAAS,SAAQ,KAAK;IAC1B,MAAM,EAAE,MAAM,CAAC;gBACV,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI5C;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+C;IACzE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;gBAEvC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc;YAKzC,KAAK;IA6BN,eAAe,CAC1B,OAAO,EAAE,OAAO,0BAA0B,EAAE,gBAAgB,GAC3D,OAAO,CAAC,OAAO,0BAA0B,EA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D,OAAO,CAAC,OAAO,0BAA0B,EAAE,gBAAgB,CAAC;IAYlD,WAAW,CACtB,OAAO,EAAE,OAAO,0BAA0B,EAAE,YAAY,EACxD,SAAS,EAAE,CACT,KAAK,EAAE,OAAO,0BAA0B,EAAE,aAAa,KACpD,IAAI,EACT,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;CA4DhE"}
|
package/dist/report.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
export class ApiError extends Error {
|
|
2
|
-
status;
|
|
3
|
-
constructor(status, message) {
|
|
4
|
-
super(message);
|
|
5
|
-
this.status = status;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export class ReportService {
|
|
9
|
-
url;
|
|
10
|
-
namespace = "com.fatehan.reports.ReportService";
|
|
11
|
-
getDynamicHeaders;
|
|
12
|
-
constructor(url, headerProvider) {
|
|
13
|
-
this.url = url;
|
|
14
|
-
this.getDynamicHeaders = headerProvider;
|
|
15
|
-
}
|
|
16
|
-
async _call(methodName, request, encoder, decoder) {
|
|
17
|
-
const dynamicHeaders = await this.getDynamicHeaders();
|
|
18
|
-
const headers = {
|
|
19
|
-
"Content-Type": "application/octet-stream",
|
|
20
|
-
Accept: "application/octet-stream",
|
|
21
|
-
...dynamicHeaders,
|
|
22
|
-
};
|
|
23
|
-
const response = await fetch(`${this.url}/${this.namespace}/${methodName}`, {
|
|
24
|
-
method: "POST",
|
|
25
|
-
headers: headers,
|
|
26
|
-
body: new Uint8Array(encoder.encode(request).finish()),
|
|
27
|
-
});
|
|
28
|
-
if (response.ok) {
|
|
29
|
-
const buffer = await response.arrayBuffer();
|
|
30
|
-
return decoder.decode(new Uint8Array(buffer));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const errorText = await response.text();
|
|
34
|
-
throw new ApiError(response.status, errorText || response.statusText);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async RouteStopReport(request) {
|
|
38
|
-
const { RouteStopRequest, RouteStopResponse } = await import("./fatehan/reports/report");
|
|
39
|
-
return this._call("RouteStopReport", request, RouteStopRequest, RouteStopResponse);
|
|
40
|
-
}
|
|
41
|
-
async TripPerformanceReport(request) {
|
|
42
|
-
const { TripPerformanceRequest, TripPerformanceResponse } = await import("./fatehan/reports/report");
|
|
43
|
-
return this._call("TripPerformanceReport", request, TripPerformanceRequest, TripPerformanceResponse);
|
|
44
|
-
}
|
|
45
|
-
async TripReport(request) {
|
|
46
|
-
const { TripReportRequest, TripReportResponse } = await import("./fatehan/reports/report");
|
|
47
|
-
return this._call("TripReport", request, TripReportRequest, TripReportResponse);
|
|
48
|
-
}
|
|
49
|
-
async RouteReviewReport(request) {
|
|
50
|
-
const { RouteReviewRequest, RouteReviewResponse } = await import("./fatehan/reports/report");
|
|
51
|
-
return this._call("RouteReviewReport", request, RouteReviewRequest, RouteReviewResponse);
|
|
52
|
-
}
|
|
53
|
-
async DashboardIndividual(request) {
|
|
54
|
-
const { DashboardIndividualRequest, DashboardIndividualResponse } = await import("./fatehan/reports/report");
|
|
55
|
-
return this._call("DashboardIndividual", request, DashboardIndividualRequest, DashboardIndividualResponse);
|
|
56
|
-
}
|
|
57
|
-
async LogReport(request) {
|
|
58
|
-
const { LogRequest, LogResponse } = await import("./fatehan/reports/report");
|
|
59
|
-
return this._call("LogReport", request, LogRequest, LogResponse);
|
|
60
|
-
}
|
|
61
|
-
async DataReport(request) {
|
|
62
|
-
const { DeviceDataRequest, DeviceDataResponse } = await import("./fatehan/reports/report");
|
|
63
|
-
return this._call("DeviceDataReport", request, DeviceDataRequest, DeviceDataResponse);
|
|
64
|
-
}
|
|
65
|
-
async AreaSummaryReviewReport(request) {
|
|
66
|
-
const { AreaSummaryReviewRequest, AreaSummaryReviewResponse } = await import("./fatehan/reports/report");
|
|
67
|
-
return this._call("AreaSummaryReviewReport", request, AreaSummaryReviewRequest, AreaSummaryReviewResponse);
|
|
68
|
-
}
|
|
69
|
-
async WorkCycleReport(request) {
|
|
70
|
-
const { WorkCycleRequest, WorkCycleResponse } = await import("./fatehan/reports/report");
|
|
71
|
-
return this._call("WorkCycleReport", request, WorkCycleRequest, WorkCycleResponse);
|
|
72
|
-
}
|
|
73
|
-
async DriverBehaviorReport(request) {
|
|
74
|
-
const { DriverBehaviorReportRequest, DriverBehaviorReportResponse } = await import("./fatehan/reports/report");
|
|
75
|
-
return this._call("DriverBehaviorReport", request, DriverBehaviorReportRequest, DriverBehaviorReportResponse);
|
|
76
|
-
}
|
|
77
|
-
async CommandHistoryReport(request) {
|
|
78
|
-
const { CommandHistoryRequest, CommandHistoryResponse } = await import("./fatehan/reports/report");
|
|
79
|
-
return this._call("CommandHistoryReport", request, CommandHistoryRequest, CommandHistoryResponse);
|
|
80
|
-
}
|
|
81
|
-
async WorkflowReport(request) {
|
|
82
|
-
const { WorkflowRequest, WorkflowResponse } = await import("./fatehan/reports/report");
|
|
83
|
-
return this._call("WorkflowReport", request, WorkflowRequest, WorkflowResponse);
|
|
84
|
-
}
|
|
85
|
-
async ChartReport(request, responses, onError) {
|
|
86
|
-
try {
|
|
87
|
-
const { ChartRequest, ChartResponse } = await import("./fatehan/reports/report");
|
|
88
|
-
const dynamicHeaders = await this.getDynamicHeaders();
|
|
89
|
-
const headers = {
|
|
90
|
-
"Content-Type": "application/octet-stream",
|
|
91
|
-
Accept: "application/octet-stream",
|
|
92
|
-
...dynamicHeaders,
|
|
93
|
-
};
|
|
94
|
-
const res = await fetch(`${this.url}/${this.namespace}/ChartReport`, {
|
|
95
|
-
method: "POST",
|
|
96
|
-
headers: headers,
|
|
97
|
-
body: new Uint8Array(ChartRequest.encode(request).finish()),
|
|
98
|
-
});
|
|
99
|
-
if (!res.ok) {
|
|
100
|
-
const errorText = await res.text();
|
|
101
|
-
onError({ status: res.status, message: errorText || res.statusText });
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (res.body == null) {
|
|
105
|
-
console.error("ChartReport response body is null.");
|
|
106
|
-
onError({ status: 500, message: "Response body is null" });
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const reader = res.body.getReader();
|
|
110
|
-
let buffer = new Uint8Array(0);
|
|
111
|
-
while (true) {
|
|
112
|
-
const { done, value } = await reader.read();
|
|
113
|
-
if (done)
|
|
114
|
-
break;
|
|
115
|
-
const tmp = new Uint8Array(buffer.length + value.length);
|
|
116
|
-
tmp.set(buffer);
|
|
117
|
-
tmp.set(value, buffer.length);
|
|
118
|
-
buffer = tmp;
|
|
119
|
-
while (buffer.length >= 4) {
|
|
120
|
-
const msgLen = new DataView(buffer.buffer).getUint32(0);
|
|
121
|
-
if (buffer.length < 4 + msgLen)
|
|
122
|
-
break;
|
|
123
|
-
const message = buffer.slice(4, 4 + msgLen);
|
|
124
|
-
responses(ChartResponse.decode(message));
|
|
125
|
-
buffer = buffer.slice(4 + msgLen);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e) {
|
|
130
|
-
console.error("ChartReport failed:", e);
|
|
131
|
-
if (e instanceof Error) {
|
|
132
|
-
onError({ status: 500, message: e.message });
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
onError({ status: 500, message: "An unknown error occurred" });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
package/readme.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# WSTS - Fatehan TypeScript Report Service
|
|
2
|
-
|
|
3
|
-
## Without GRPC
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
protoc \
|
|
7
|
-
--plugin=protoc-gen-ts_proto=$(which protoc-gen-ts_proto) \
|
|
8
|
-
-I ./src/fatehan \
|
|
9
|
-
-I ../protocols \
|
|
10
|
-
--ts_proto_out=./src/fatehan \
|
|
11
|
-
--ts_proto_opt=outputServices=none,outputClientImpl=false,esModuleInterop=true,outputEncodeMethods=true,outputJsonMethods=true,useOptionals=messages,forceLong=long \
|
|
12
|
-
../protocols/**/*.proto
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Build
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm run build
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Deploy
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm version patch
|
|
25
|
-
npm publish
|
|
26
|
-
```
|