@fatehan/tsrp 1.1.0 → 1.1.2

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,265 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview gRPC-Web generated client stub for fatehan
4
- * @enhanceable
5
- * @public
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || (function () {
24
- var ownKeys = function(o) {
25
- ownKeys = Object.getOwnPropertyNames || function (o) {
26
- var ar = [];
27
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
- return ar;
29
- };
30
- return ownKeys(o);
31
- };
32
- return function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- })();
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.ReportServiceClient = void 0;
42
- // Code generated by protoc-gen-grpc-web. DO NOT EDIT.
43
- // versions:
44
- // protoc-gen-grpc-web v1.5.0
45
- // protoc v3.21.12
46
- // source: reports/report.proto
47
- /* eslint-disable */
48
- // @ts-nocheck
49
- const grpcWeb = __importStar(require("grpc-web"));
50
- const reports_report_pb = __importStar(require("../reports/report_pb")); // proto import: "reports/report.proto"
51
- const packets_dataModel_pb = __importStar(require("../packets/dataModel_pb")); // proto import: "packets/dataModel.proto"
52
- class ReportServiceClient {
53
- constructor(hostname, credentials, options) {
54
- this.methodDescriptorTraffixReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TraffixReport', grpcWeb.MethodType.UNARY, reports_report_pb.TraffixRequest, reports_report_pb.TraffixResponse, (request) => {
55
- return request.serializeBinary();
56
- }, reports_report_pb.TraffixResponse.deserializeBinary);
57
- this.methodDescriptorAreaSummaryReviewReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/AreaSummaryReviewReport', grpcWeb.MethodType.SERVER_STREAMING, reports_report_pb.AreaSummaryReviewRequest, reports_report_pb.AreaSummaryReviewResponse, (request) => {
58
- return request.serializeBinary();
59
- }, reports_report_pb.AreaSummaryReviewResponse.deserializeBinary);
60
- this.methodDescriptorAreaSplitterReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/AreaSplitterReport', grpcWeb.MethodType.UNARY, reports_report_pb.AreaSplitterRequest, reports_report_pb.AreaSplitterResponse, (request) => {
61
- return request.serializeBinary();
62
- }, reports_report_pb.AreaSplitterResponse.deserializeBinary);
63
- this.methodDescriptorShiftReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/ShiftReport', grpcWeb.MethodType.UNARY, reports_report_pb.ShiftRequest, reports_report_pb.ShiftResponse, (request) => {
64
- return request.serializeBinary();
65
- }, reports_report_pb.ShiftResponse.deserializeBinary);
66
- this.methodDescriptorTripsReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TripsReport', grpcWeb.MethodType.UNARY, reports_report_pb.TripsRequest, reports_report_pb.TripsResponse, (request) => {
67
- return request.serializeBinary();
68
- }, reports_report_pb.TripsResponse.deserializeBinary);
69
- this.methodDescriptorTrafficReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TrafficReport', grpcWeb.MethodType.UNARY, reports_report_pb.TrafficRequest, reports_report_pb.TrafficResponse, (request) => {
70
- return request.serializeBinary();
71
- }, reports_report_pb.TrafficResponse.deserializeBinary);
72
- this.methodDescriptorAttendanceReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/AttendanceReport', grpcWeb.MethodType.UNARY, reports_report_pb.AttendanceRequest, reports_report_pb.AttendanceResponse, (request) => {
73
- return request.serializeBinary();
74
- }, reports_report_pb.AttendanceResponse.deserializeBinary);
75
- this.methodDescriptorAttendanceXReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/AttendanceXReport', grpcWeb.MethodType.UNARY, reports_report_pb.AttendanceXRequest, reports_report_pb.AttendanceResponse, (request) => {
76
- return request.serializeBinary();
77
- }, reports_report_pb.AttendanceResponse.deserializeBinary);
78
- this.methodDescriptorDailyTrafficReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/DailyTrafficReport', grpcWeb.MethodType.UNARY, reports_report_pb.DailyTrafficRequest, reports_report_pb.DailyTrafficResponse, (request) => {
79
- return request.serializeBinary();
80
- }, reports_report_pb.DailyTrafficResponse.deserializeBinary);
81
- this.methodDescriptorTripsSummaryReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TripsSummaryReport', grpcWeb.MethodType.UNARY, reports_report_pb.TripsSummaryRequest, reports_report_pb.TripsSummaryResponse, (request) => {
82
- return request.serializeBinary();
83
- }, reports_report_pb.TripsSummaryResponse.deserializeBinary);
84
- this.methodDescriptorShiftSummaryReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/ShiftSummaryReport', grpcWeb.MethodType.UNARY, reports_report_pb.ShiftSummaryRequest, reports_report_pb.ShiftSummaryResponse, (request) => {
85
- return request.serializeBinary();
86
- }, reports_report_pb.ShiftSummaryResponse.deserializeBinary);
87
- this.methodDescriptorDeviceDataCountReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/DeviceDataCountReport', grpcWeb.MethodType.UNARY, reports_report_pb.DeviceDataCountRequest, reports_report_pb.DeviceDataCountResponse, (request) => {
88
- return request.serializeBinary();
89
- }, reports_report_pb.DeviceDataCountResponse.deserializeBinary);
90
- this.methodDescriptorTripReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TripReport', grpcWeb.MethodType.UNARY, reports_report_pb.TripReportRequest, reports_report_pb.TripReportResponse, (request) => {
91
- return request.serializeBinary();
92
- }, reports_report_pb.TripReportResponse.deserializeBinary);
93
- this.methodDescriptorLatestDataModel = new grpcWeb.MethodDescriptor('/fatehan.ReportService/LatestDataModel', grpcWeb.MethodType.UNARY, reports_report_pb.LatestDataModelRequest, packets_dataModel_pb.Data, (request) => {
94
- return request.serializeBinary();
95
- }, packets_dataModel_pb.Data.deserializeBinary);
96
- this.methodDescriptorMaintenanceReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/MaintenanceReport', grpcWeb.MethodType.UNARY, reports_report_pb.MaintenanceRequest, reports_report_pb.MaintenanceResponse, (request) => {
97
- return request.serializeBinary();
98
- }, reports_report_pb.MaintenanceResponse.deserializeBinary);
99
- this.methodDescriptorDeviceDataReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/DeviceDataReport', grpcWeb.MethodType.SERVER_STREAMING, reports_report_pb.DeviceDataRequest, reports_report_pb.DeviceDataResponse, (request) => {
100
- return request.serializeBinary();
101
- }, reports_report_pb.DeviceDataResponse.deserializeBinary);
102
- this.methodDescriptorRouteReviewReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/RouteReviewReport', grpcWeb.MethodType.SERVER_STREAMING, reports_report_pb.RouteReviewRequest, reports_report_pb.RouteReviewResponse, (request) => {
103
- return request.serializeBinary();
104
- }, reports_report_pb.RouteReviewResponse.deserializeBinary);
105
- this.methodDescriptorTripPerformanceReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/TripPerformanceReport', grpcWeb.MethodType.UNARY, reports_report_pb.TripPerformanceRequest, reports_report_pb.TripPerformanceResponse, (request) => {
106
- return request.serializeBinary();
107
- }, reports_report_pb.TripPerformanceResponse.deserializeBinary);
108
- this.methodDescriptorEnvironmentalReport = new grpcWeb.MethodDescriptor('/fatehan.ReportService/EnvironmentalReport', grpcWeb.MethodType.SERVER_STREAMING, reports_report_pb.EnvironmentalRequest, reports_report_pb.EnvironmentalResponse, (request) => {
109
- return request.serializeBinary();
110
- }, reports_report_pb.EnvironmentalResponse.deserializeBinary);
111
- this.methodDescriptorDashboardIndividual = new grpcWeb.MethodDescriptor('/fatehan.ReportService/DashboardIndividual', grpcWeb.MethodType.SERVER_STREAMING, reports_report_pb.DashboardIndividualRequest, reports_report_pb.DashboardIndividualResponse, (request) => {
112
- return request.serializeBinary();
113
- }, reports_report_pb.DashboardIndividualResponse.deserializeBinary);
114
- if (!options)
115
- options = {};
116
- if (!credentials)
117
- credentials = {};
118
- options['format'] = 'text';
119
- this.client_ = new grpcWeb.GrpcWebClientBase(options);
120
- this.hostname_ = hostname.replace(/\/+$/, '');
121
- this.credentials_ = credentials;
122
- this.options_ = options;
123
- }
124
- traffixReport(request, metadata, callback) {
125
- if (callback !== undefined) {
126
- return this.client_.rpcCall(this.hostname_ +
127
- '/fatehan.ReportService/TraffixReport', request, metadata || {}, this.methodDescriptorTraffixReport, callback);
128
- }
129
- return this.client_.unaryCall(this.hostname_ +
130
- '/fatehan.ReportService/TraffixReport', request, metadata || {}, this.methodDescriptorTraffixReport);
131
- }
132
- areaSummaryReviewReport(request, metadata) {
133
- return this.client_.serverStreaming(this.hostname_ +
134
- '/fatehan.ReportService/AreaSummaryReviewReport', request, metadata || {}, this.methodDescriptorAreaSummaryReviewReport);
135
- }
136
- areaSplitterReport(request, metadata, callback) {
137
- if (callback !== undefined) {
138
- return this.client_.rpcCall(this.hostname_ +
139
- '/fatehan.ReportService/AreaSplitterReport', request, metadata || {}, this.methodDescriptorAreaSplitterReport, callback);
140
- }
141
- return this.client_.unaryCall(this.hostname_ +
142
- '/fatehan.ReportService/AreaSplitterReport', request, metadata || {}, this.methodDescriptorAreaSplitterReport);
143
- }
144
- shiftReport(request, metadata, callback) {
145
- if (callback !== undefined) {
146
- return this.client_.rpcCall(this.hostname_ +
147
- '/fatehan.ReportService/ShiftReport', request, metadata || {}, this.methodDescriptorShiftReport, callback);
148
- }
149
- return this.client_.unaryCall(this.hostname_ +
150
- '/fatehan.ReportService/ShiftReport', request, metadata || {}, this.methodDescriptorShiftReport);
151
- }
152
- tripsReport(request, metadata, callback) {
153
- if (callback !== undefined) {
154
- return this.client_.rpcCall(this.hostname_ +
155
- '/fatehan.ReportService/TripsReport', request, metadata || {}, this.methodDescriptorTripsReport, callback);
156
- }
157
- return this.client_.unaryCall(this.hostname_ +
158
- '/fatehan.ReportService/TripsReport', request, metadata || {}, this.methodDescriptorTripsReport);
159
- }
160
- trafficReport(request, metadata, callback) {
161
- if (callback !== undefined) {
162
- return this.client_.rpcCall(this.hostname_ +
163
- '/fatehan.ReportService/TrafficReport', request, metadata || {}, this.methodDescriptorTrafficReport, callback);
164
- }
165
- return this.client_.unaryCall(this.hostname_ +
166
- '/fatehan.ReportService/TrafficReport', request, metadata || {}, this.methodDescriptorTrafficReport);
167
- }
168
- attendanceReport(request, metadata, callback) {
169
- if (callback !== undefined) {
170
- return this.client_.rpcCall(this.hostname_ +
171
- '/fatehan.ReportService/AttendanceReport', request, metadata || {}, this.methodDescriptorAttendanceReport, callback);
172
- }
173
- return this.client_.unaryCall(this.hostname_ +
174
- '/fatehan.ReportService/AttendanceReport', request, metadata || {}, this.methodDescriptorAttendanceReport);
175
- }
176
- attendanceXReport(request, metadata, callback) {
177
- if (callback !== undefined) {
178
- return this.client_.rpcCall(this.hostname_ +
179
- '/fatehan.ReportService/AttendanceXReport', request, metadata || {}, this.methodDescriptorAttendanceXReport, callback);
180
- }
181
- return this.client_.unaryCall(this.hostname_ +
182
- '/fatehan.ReportService/AttendanceXReport', request, metadata || {}, this.methodDescriptorAttendanceXReport);
183
- }
184
- dailyTrafficReport(request, metadata, callback) {
185
- if (callback !== undefined) {
186
- return this.client_.rpcCall(this.hostname_ +
187
- '/fatehan.ReportService/DailyTrafficReport', request, metadata || {}, this.methodDescriptorDailyTrafficReport, callback);
188
- }
189
- return this.client_.unaryCall(this.hostname_ +
190
- '/fatehan.ReportService/DailyTrafficReport', request, metadata || {}, this.methodDescriptorDailyTrafficReport);
191
- }
192
- tripsSummaryReport(request, metadata, callback) {
193
- if (callback !== undefined) {
194
- return this.client_.rpcCall(this.hostname_ +
195
- '/fatehan.ReportService/TripsSummaryReport', request, metadata || {}, this.methodDescriptorTripsSummaryReport, callback);
196
- }
197
- return this.client_.unaryCall(this.hostname_ +
198
- '/fatehan.ReportService/TripsSummaryReport', request, metadata || {}, this.methodDescriptorTripsSummaryReport);
199
- }
200
- shiftSummaryReport(request, metadata, callback) {
201
- if (callback !== undefined) {
202
- return this.client_.rpcCall(this.hostname_ +
203
- '/fatehan.ReportService/ShiftSummaryReport', request, metadata || {}, this.methodDescriptorShiftSummaryReport, callback);
204
- }
205
- return this.client_.unaryCall(this.hostname_ +
206
- '/fatehan.ReportService/ShiftSummaryReport', request, metadata || {}, this.methodDescriptorShiftSummaryReport);
207
- }
208
- deviceDataCountReport(request, metadata, callback) {
209
- if (callback !== undefined) {
210
- return this.client_.rpcCall(this.hostname_ +
211
- '/fatehan.ReportService/DeviceDataCountReport', request, metadata || {}, this.methodDescriptorDeviceDataCountReport, callback);
212
- }
213
- return this.client_.unaryCall(this.hostname_ +
214
- '/fatehan.ReportService/DeviceDataCountReport', request, metadata || {}, this.methodDescriptorDeviceDataCountReport);
215
- }
216
- tripReport(request, metadata, callback) {
217
- if (callback !== undefined) {
218
- return this.client_.rpcCall(this.hostname_ +
219
- '/fatehan.ReportService/TripReport', request, metadata || {}, this.methodDescriptorTripReport, callback);
220
- }
221
- return this.client_.unaryCall(this.hostname_ +
222
- '/fatehan.ReportService/TripReport', request, metadata || {}, this.methodDescriptorTripReport);
223
- }
224
- latestDataModel(request, metadata, callback) {
225
- if (callback !== undefined) {
226
- return this.client_.rpcCall(this.hostname_ +
227
- '/fatehan.ReportService/LatestDataModel', request, metadata || {}, this.methodDescriptorLatestDataModel, callback);
228
- }
229
- return this.client_.unaryCall(this.hostname_ +
230
- '/fatehan.ReportService/LatestDataModel', request, metadata || {}, this.methodDescriptorLatestDataModel);
231
- }
232
- maintenanceReport(request, metadata, callback) {
233
- if (callback !== undefined) {
234
- return this.client_.rpcCall(this.hostname_ +
235
- '/fatehan.ReportService/MaintenanceReport', request, metadata || {}, this.methodDescriptorMaintenanceReport, callback);
236
- }
237
- return this.client_.unaryCall(this.hostname_ +
238
- '/fatehan.ReportService/MaintenanceReport', request, metadata || {}, this.methodDescriptorMaintenanceReport);
239
- }
240
- deviceDataReport(request, metadata) {
241
- return this.client_.serverStreaming(this.hostname_ +
242
- '/fatehan.ReportService/DeviceDataReport', request, metadata || {}, this.methodDescriptorDeviceDataReport);
243
- }
244
- routeReviewReport(request, metadata) {
245
- return this.client_.serverStreaming(this.hostname_ +
246
- '/fatehan.ReportService/RouteReviewReport', request, metadata || {}, this.methodDescriptorRouteReviewReport);
247
- }
248
- tripPerformanceReport(request, metadata, callback) {
249
- if (callback !== undefined) {
250
- return this.client_.rpcCall(this.hostname_ +
251
- '/fatehan.ReportService/TripPerformanceReport', request, metadata || {}, this.methodDescriptorTripPerformanceReport, callback);
252
- }
253
- return this.client_.unaryCall(this.hostname_ +
254
- '/fatehan.ReportService/TripPerformanceReport', request, metadata || {}, this.methodDescriptorTripPerformanceReport);
255
- }
256
- environmentalReport(request, metadata) {
257
- return this.client_.serverStreaming(this.hostname_ +
258
- '/fatehan.ReportService/EnvironmentalReport', request, metadata || {}, this.methodDescriptorEnvironmentalReport);
259
- }
260
- dashboardIndividual(request, metadata) {
261
- return this.client_.serverStreaming(this.hostname_ +
262
- '/fatehan.ReportService/DashboardIndividual', request, metadata || {}, this.methodDescriptorDashboardIndividual);
263
- }
264
- }
265
- exports.ReportServiceClient = ReportServiceClient;
package/dist/index.d.ts DELETED
@@ -1,24 +0,0 @@
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 { ShownIo, SystemIo } from "./fatehan/models/models";
3
- import { Data } from "./fatehan/packets/dataModel";
4
- export declare class ReportService {
5
- private readonly url;
6
- private readonly namespace;
7
- private readonly headers;
8
- constructor(url: string, authorization?: string, organizationId?: string);
9
- RouteStopReport(request: RouteStopRequest): Promise<RouteStopResponse>;
10
- TripPerformanceReport(request: TripPerformanceRequest): Promise<TripPerformanceResponse>;
11
- TripReport(request: TripReportRequest): Promise<TripReportResponse>;
12
- RouteReviewReport(request: RouteReviewRequest): Promise<RouteReviewResponse>;
13
- DashboardIndividual(request: DashboardIndividualRequest): Promise<DashboardIndividualResponse>;
14
- LogReport(request: LogRequest): Promise<LogResponse>;
15
- DataReport(request: DeviceDataRequest): Promise<DeviceDataResponse>;
16
- AreaSummaryReviewReport(request: AreaSummaryReviewRequest): Promise<AreaSummaryReviewResponse>;
17
- WorkCycleReport(request: WorkCycleRequest): Promise<WorkCycleResponse>;
18
- CommandHistoryReport(request: CommandHistoryRequest): Promise<CommandHistoryResponse>;
19
- ChartReport(request: ChartRequest, responses: (chunk: ChartResponse) => void): Promise<void>;
20
- SystemIoReport(request: SystemIoRequest): Promise<SystemIoResponse>;
21
- SystemIoCast(systemIo: SystemIo[] | null, deviceIo: SystemIo[], data: Data): Promise<ShownIo[]>;
22
- Matin(): Promise<void>;
23
- }
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGnD,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+C;IACzE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;IAcjE,eAAe,CACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC;IAyBtB,qBAAqB,CAC1B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAyB5B,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAyBnE,iBAAiB,CACtB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAyBxB,mBAAmB,CACxB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAyBhC,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAuBpD,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAyBnE,uBAAuB,CAC5B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IAwB9B,eAAe,CACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC;IAwBtB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmB/E,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI;IAiClF,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6B7D,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAgB/F,KAAK;CAGnB"}
package/dist/index.js DELETED
@@ -1,248 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ReportService = void 0;
7
- const report_1 = require("./fatehan/reports/report");
8
- const system_io_1 = require("./store/system.io");
9
- const system_io_2 = __importDefault(require("./system.io"));
10
- class ReportService {
11
- constructor(url, authorization, organizationId) {
12
- this.namespace = "com.fatehan.reports.ReportService";
13
- this.url = url;
14
- this.headers = {
15
- "Content-Type": "application/octet-stream",
16
- Accept: "application/octet-stream",
17
- };
18
- if (authorization) {
19
- this.headers["Authorization"] = "Bearer " + authorization;
20
- }
21
- if (organizationId) {
22
- this.headers["Organization-Id"] = organizationId;
23
- }
24
- }
25
- RouteStopReport(request) {
26
- return new Promise(async (resolve, reject) => {
27
- const response = await fetch(`${this.url}/${this.namespace}/RouteStopReport`, {
28
- method: "POST",
29
- headers: this.headers,
30
- body: report_1.RouteStopRequest.encode(request).finish(),
31
- });
32
- if (response.ok) {
33
- resolve(report_1.RouteStopResponse.decode(new Uint8Array(await response.arrayBuffer())));
34
- }
35
- else {
36
- reject(await response.text());
37
- }
38
- });
39
- }
40
- TripPerformanceReport(request) {
41
- return new Promise(async (resolve, reject) => {
42
- const response = await fetch(`${this.url}/${this.namespace}/TripPerformanceReport`, {
43
- method: "POST",
44
- headers: this.headers,
45
- body: report_1.TripPerformanceRequest.encode(request).finish(),
46
- });
47
- if (response.ok) {
48
- resolve(report_1.TripPerformanceResponse.decode(new Uint8Array(await response.arrayBuffer())));
49
- }
50
- else {
51
- reject(await response.text());
52
- }
53
- });
54
- }
55
- TripReport(request) {
56
- return new Promise(async (resolve, reject) => {
57
- const response = await fetch(`${this.url}/${this.namespace}/TripReport`, {
58
- method: "POST",
59
- headers: this.headers,
60
- body: report_1.TripReportRequest.encode(request).finish(),
61
- });
62
- if (response.ok) {
63
- resolve(report_1.TripReportResponse.decode(new Uint8Array(await response.arrayBuffer())));
64
- }
65
- else {
66
- reject(await response.text());
67
- }
68
- });
69
- }
70
- RouteReviewReport(request) {
71
- return new Promise(async (resolve, reject) => {
72
- const response = await fetch(`${this.url}/${this.namespace}/RouteReviewReport`, {
73
- method: "POST",
74
- headers: this.headers,
75
- body: report_1.RouteReviewRequest.encode(request).finish(),
76
- });
77
- if (response.ok) {
78
- resolve(report_1.RouteReviewResponse.decode(new Uint8Array(await response.arrayBuffer())));
79
- }
80
- else {
81
- reject(await response.text());
82
- }
83
- });
84
- }
85
- DashboardIndividual(request) {
86
- return new Promise(async (resolve, reject) => {
87
- const response = await fetch(`${this.url}/${this.namespace}/DashboardIndividual`, {
88
- method: "POST",
89
- headers: this.headers,
90
- body: report_1.DashboardIndividualRequest.encode(request).finish(),
91
- });
92
- if (response.ok) {
93
- resolve(report_1.DashboardIndividualResponse.decode(new Uint8Array(await response.arrayBuffer())));
94
- }
95
- else {
96
- reject(await response.text());
97
- }
98
- });
99
- }
100
- LogReport(request) {
101
- return new Promise(async (resolve, reject) => {
102
- const response = await fetch(`${this.url}/${this.namespace}/LogReport`, {
103
- method: "POST",
104
- headers: this.headers,
105
- body: report_1.LogRequest.encode(request).finish(),
106
- });
107
- if (response.ok) {
108
- resolve(report_1.LogResponse.decode(new Uint8Array(await response.arrayBuffer())));
109
- }
110
- else {
111
- reject(await response.text());
112
- }
113
- });
114
- }
115
- DataReport(request) {
116
- return new Promise(async (resolve, reject) => {
117
- const response = await fetch(`${this.url}/${this.namespace}/DeviceDataReport`, {
118
- method: "POST",
119
- headers: this.headers,
120
- body: report_1.DeviceDataRequest.encode(request).finish(),
121
- });
122
- if (response.ok) {
123
- resolve(report_1.DeviceDataResponse.decode(new Uint8Array(await response.arrayBuffer())));
124
- }
125
- else {
126
- reject(await response.text());
127
- }
128
- });
129
- }
130
- AreaSummaryReviewReport(request) {
131
- return new Promise(async (resolve, reject) => {
132
- const response = await fetch(`${this.url}/${this.namespace}/AreaSummaryReviewReport`, {
133
- method: "POST",
134
- headers: this.headers,
135
- body: report_1.AreaSummaryReviewRequest.encode(request).finish(),
136
- });
137
- if (response.ok) {
138
- resolve(report_1.AreaSummaryReviewResponse.decode(new Uint8Array(await response.arrayBuffer())));
139
- }
140
- else {
141
- reject(await response.text());
142
- }
143
- });
144
- }
145
- WorkCycleReport(request) {
146
- return new Promise(async (resolve, reject) => {
147
- const response = await fetch(`${this.url}/${this.namespace}/WorkCycleReport`, {
148
- method: "POST",
149
- headers: this.headers,
150
- body: report_1.WorkCycleRequest.encode(request).finish(),
151
- });
152
- if (response.ok) {
153
- resolve(report_1.WorkCycleResponse.decode(new Uint8Array(await response.arrayBuffer())));
154
- }
155
- else {
156
- reject(await response.text());
157
- }
158
- });
159
- }
160
- CommandHistoryReport(request) {
161
- return new Promise(async (resolve, reject) => {
162
- const response = await fetch(`${this.url}/${this.namespace}/CommandHistoryReport`, {
163
- method: "POST",
164
- headers: this.headers,
165
- body: report_1.CommandHistoryRequest.encode(request).finish(),
166
- });
167
- if (response.ok) {
168
- resolve(report_1.CommandHistoryResponse.decode(new Uint8Array(await response.arrayBuffer())));
169
- }
170
- else {
171
- reject(await response.text());
172
- }
173
- });
174
- }
175
- async ChartReport(request, responses) {
176
- const res = await fetch(`${this.url}/${this.namespace}/ChartReport`, {
177
- method: "POST",
178
- headers: this.headers,
179
- body: report_1.ChartRequest.encode(request).finish(),
180
- });
181
- if (res.body == null) {
182
- console.error("request body is empty");
183
- return;
184
- }
185
- const reader = res.body.getReader();
186
- let buffer = new Uint8Array(0);
187
- while (true) {
188
- const { done, value } = await reader.read();
189
- if (done)
190
- break;
191
- const tmp = new Uint8Array(buffer.length + value.length);
192
- tmp.set(buffer);
193
- tmp.set(value, buffer.length);
194
- buffer = tmp;
195
- while (buffer.length >= 4) {
196
- const msgLen = new DataView(buffer.buffer).getUint32(0);
197
- if (buffer.length < 4 + msgLen)
198
- break;
199
- responses(report_1.ChartResponse.decode(buffer.slice(4, 4 + msgLen)));
200
- buffer = buffer.slice(4 + msgLen);
201
- }
202
- }
203
- }
204
- SystemIoReport(request) {
205
- return new Promise(async (resolve, reject) => {
206
- let systemIo = (0, system_io_1.getSystemIoCache)();
207
- if (systemIo != null) {
208
- resolve({
209
- cost: 0,
210
- ios: systemIo,
211
- records: systemIo.length,
212
- });
213
- return;
214
- }
215
- const response = await fetch(`${this.url}/${this.namespace}/SystemIoReport`, {
216
- method: "POST",
217
- headers: this.headers,
218
- body: report_1.SystemIoRequest.encode(request).finish(),
219
- });
220
- if (response.ok) {
221
- let systemIo = report_1.SystemIoResponse.decode(new Uint8Array(await response.arrayBuffer()));
222
- (0, system_io_1.setSystemIoCache)(systemIo.ios);
223
- resolve(systemIo);
224
- }
225
- else {
226
- reject(await response.text());
227
- }
228
- });
229
- }
230
- async SystemIoCast(systemIo, deviceIo, data) {
231
- return new Promise(async (resolve) => {
232
- if (systemIo == null) {
233
- let result = await this.SystemIoReport({});
234
- if (result == null || result.ios == null || result.ios.length == 0) {
235
- resolve([]);
236
- return;
237
- }
238
- systemIo = result.ios;
239
- }
240
- resolve((0, system_io_2.default)(systemIo, deviceIo, data));
241
- return;
242
- });
243
- }
244
- async Matin() {
245
- return;
246
- }
247
- }
248
- exports.ReportService = ReportService;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}