@owvision/station-interface-ts 0.0.1
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/README.md +58 -0
- package/dist/generated/recorder.d.ts +205 -0
- package/dist/generated/recorder.d.ts.map +1 -0
- package/dist/generated/recorder.js +1018 -0
- package/dist/generated/recorder.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -0
- package/src/generated/recorder.ts +1373 -0
- package/src/index.ts +57 -0
- package/tsconfig.json +44 -0
|
@@ -0,0 +1,1373 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v6.33.3
|
|
5
|
+
// source: recorder.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import {
|
|
10
|
+
type CallOptions,
|
|
11
|
+
type ChannelCredentials,
|
|
12
|
+
Client,
|
|
13
|
+
type ClientOptions,
|
|
14
|
+
type ClientUnaryCall,
|
|
15
|
+
type handleUnaryCall,
|
|
16
|
+
makeGenericClientConstructor,
|
|
17
|
+
type Metadata,
|
|
18
|
+
type ServiceError,
|
|
19
|
+
type UntypedServiceImplementation,
|
|
20
|
+
} from "@grpc/grpc-js";
|
|
21
|
+
|
|
22
|
+
export const protobufPackage = "recorder";
|
|
23
|
+
|
|
24
|
+
export interface PingMessage {
|
|
25
|
+
randomId: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GetStationRequest {
|
|
29
|
+
stationId: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface UpdateSensorsRequest {
|
|
33
|
+
updates: UpdateSensorRequest[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface UpdateSensorRequest {
|
|
37
|
+
sensorId: number;
|
|
38
|
+
newState: SensorState | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UpdateSensorsResponse {
|
|
42
|
+
errors: string[];
|
|
43
|
+
processed: number[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface UpdateStationRequest {
|
|
47
|
+
stationId: number;
|
|
48
|
+
definition: StationDefinition | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface GetStationDefinitionRequest {
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface StationDefinition {
|
|
55
|
+
name: string;
|
|
56
|
+
sensors: SensorDefinition[];
|
|
57
|
+
longitude: number;
|
|
58
|
+
latitude: number;
|
|
59
|
+
version: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SensorDefinition {
|
|
63
|
+
name: string;
|
|
64
|
+
element: string;
|
|
65
|
+
recordIntervalSeconds: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface Station {
|
|
69
|
+
id: number;
|
|
70
|
+
sensors: Sensor[];
|
|
71
|
+
version: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface Sensor {
|
|
75
|
+
id: number;
|
|
76
|
+
name: string;
|
|
77
|
+
recordIntervalSeconds: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface GetSensorStateRequest {
|
|
81
|
+
name: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface SensorState {
|
|
85
|
+
unitId: string;
|
|
86
|
+
value?: number | undefined;
|
|
87
|
+
createdAt: number;
|
|
88
|
+
intervalStart?: number | undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function createBasePingMessage(): PingMessage {
|
|
92
|
+
return { randomId: 0 };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const PingMessage: MessageFns<PingMessage> = {
|
|
96
|
+
encode(message: PingMessage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
97
|
+
if (message.randomId !== 0) {
|
|
98
|
+
writer.uint32(8).int64(message.randomId);
|
|
99
|
+
}
|
|
100
|
+
return writer;
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
decode(input: BinaryReader | Uint8Array, length?: number): PingMessage {
|
|
104
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
105
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
106
|
+
const message = createBasePingMessage();
|
|
107
|
+
while (reader.pos < end) {
|
|
108
|
+
const tag = reader.uint32();
|
|
109
|
+
switch (tag >>> 3) {
|
|
110
|
+
case 1: {
|
|
111
|
+
if (tag !== 8) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message.randomId = longToNumber(reader.int64());
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
reader.skip(tag & 7);
|
|
123
|
+
}
|
|
124
|
+
return message;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
fromJSON(object: any): PingMessage {
|
|
128
|
+
return { randomId: isSet(object.randomId) ? globalThis.Number(object.randomId) : 0 };
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
toJSON(message: PingMessage): unknown {
|
|
132
|
+
const obj: any = {};
|
|
133
|
+
if (message.randomId !== 0) {
|
|
134
|
+
obj.randomId = Math.round(message.randomId);
|
|
135
|
+
}
|
|
136
|
+
return obj;
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
create<I extends Exact<DeepPartial<PingMessage>, I>>(base?: I): PingMessage {
|
|
140
|
+
return PingMessage.fromPartial(base ?? ({} as any));
|
|
141
|
+
},
|
|
142
|
+
fromPartial<I extends Exact<DeepPartial<PingMessage>, I>>(object: I): PingMessage {
|
|
143
|
+
const message = createBasePingMessage();
|
|
144
|
+
message.randomId = object.randomId ?? 0;
|
|
145
|
+
return message;
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
function createBaseGetStationRequest(): GetStationRequest {
|
|
150
|
+
return { stationId: 0 };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const GetStationRequest: MessageFns<GetStationRequest> = {
|
|
154
|
+
encode(message: GetStationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
155
|
+
if (message.stationId !== 0) {
|
|
156
|
+
writer.uint32(8).int64(message.stationId);
|
|
157
|
+
}
|
|
158
|
+
return writer;
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetStationRequest {
|
|
162
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
163
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
164
|
+
const message = createBaseGetStationRequest();
|
|
165
|
+
while (reader.pos < end) {
|
|
166
|
+
const tag = reader.uint32();
|
|
167
|
+
switch (tag >>> 3) {
|
|
168
|
+
case 1: {
|
|
169
|
+
if (tag !== 8) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
message.stationId = longToNumber(reader.int64());
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
reader.skip(tag & 7);
|
|
181
|
+
}
|
|
182
|
+
return message;
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
fromJSON(object: any): GetStationRequest {
|
|
186
|
+
return { stationId: isSet(object.stationId) ? globalThis.Number(object.stationId) : 0 };
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
toJSON(message: GetStationRequest): unknown {
|
|
190
|
+
const obj: any = {};
|
|
191
|
+
if (message.stationId !== 0) {
|
|
192
|
+
obj.stationId = Math.round(message.stationId);
|
|
193
|
+
}
|
|
194
|
+
return obj;
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
create<I extends Exact<DeepPartial<GetStationRequest>, I>>(base?: I): GetStationRequest {
|
|
198
|
+
return GetStationRequest.fromPartial(base ?? ({} as any));
|
|
199
|
+
},
|
|
200
|
+
fromPartial<I extends Exact<DeepPartial<GetStationRequest>, I>>(object: I): GetStationRequest {
|
|
201
|
+
const message = createBaseGetStationRequest();
|
|
202
|
+
message.stationId = object.stationId ?? 0;
|
|
203
|
+
return message;
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
function createBaseUpdateSensorsRequest(): UpdateSensorsRequest {
|
|
208
|
+
return { updates: [] };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export const UpdateSensorsRequest: MessageFns<UpdateSensorsRequest> = {
|
|
212
|
+
encode(message: UpdateSensorsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
213
|
+
for (const v of message.updates) {
|
|
214
|
+
UpdateSensorRequest.encode(v!, writer.uint32(10).fork()).join();
|
|
215
|
+
}
|
|
216
|
+
return writer;
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateSensorsRequest {
|
|
220
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
221
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
222
|
+
const message = createBaseUpdateSensorsRequest();
|
|
223
|
+
while (reader.pos < end) {
|
|
224
|
+
const tag = reader.uint32();
|
|
225
|
+
switch (tag >>> 3) {
|
|
226
|
+
case 1: {
|
|
227
|
+
if (tag !== 10) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
message.updates.push(UpdateSensorRequest.decode(reader, reader.uint32()));
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
reader.skip(tag & 7);
|
|
239
|
+
}
|
|
240
|
+
return message;
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
fromJSON(object: any): UpdateSensorsRequest {
|
|
244
|
+
return {
|
|
245
|
+
updates: globalThis.Array.isArray(object?.updates)
|
|
246
|
+
? object.updates.map((e: any) => UpdateSensorRequest.fromJSON(e))
|
|
247
|
+
: [],
|
|
248
|
+
};
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
toJSON(message: UpdateSensorsRequest): unknown {
|
|
252
|
+
const obj: any = {};
|
|
253
|
+
if (message.updates?.length) {
|
|
254
|
+
obj.updates = message.updates.map((e) => UpdateSensorRequest.toJSON(e));
|
|
255
|
+
}
|
|
256
|
+
return obj;
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
create<I extends Exact<DeepPartial<UpdateSensorsRequest>, I>>(base?: I): UpdateSensorsRequest {
|
|
260
|
+
return UpdateSensorsRequest.fromPartial(base ?? ({} as any));
|
|
261
|
+
},
|
|
262
|
+
fromPartial<I extends Exact<DeepPartial<UpdateSensorsRequest>, I>>(object: I): UpdateSensorsRequest {
|
|
263
|
+
const message = createBaseUpdateSensorsRequest();
|
|
264
|
+
message.updates = object.updates?.map((e) => UpdateSensorRequest.fromPartial(e)) || [];
|
|
265
|
+
return message;
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
function createBaseUpdateSensorRequest(): UpdateSensorRequest {
|
|
270
|
+
return { sensorId: 0, newState: undefined };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export const UpdateSensorRequest: MessageFns<UpdateSensorRequest> = {
|
|
274
|
+
encode(message: UpdateSensorRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
275
|
+
if (message.sensorId !== 0) {
|
|
276
|
+
writer.uint32(8).int64(message.sensorId);
|
|
277
|
+
}
|
|
278
|
+
if (message.newState !== undefined) {
|
|
279
|
+
SensorState.encode(message.newState, writer.uint32(18).fork()).join();
|
|
280
|
+
}
|
|
281
|
+
return writer;
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateSensorRequest {
|
|
285
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
286
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
287
|
+
const message = createBaseUpdateSensorRequest();
|
|
288
|
+
while (reader.pos < end) {
|
|
289
|
+
const tag = reader.uint32();
|
|
290
|
+
switch (tag >>> 3) {
|
|
291
|
+
case 1: {
|
|
292
|
+
if (tag !== 8) {
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
message.sensorId = longToNumber(reader.int64());
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
case 2: {
|
|
300
|
+
if (tag !== 18) {
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
message.newState = SensorState.decode(reader, reader.uint32());
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
reader.skip(tag & 7);
|
|
312
|
+
}
|
|
313
|
+
return message;
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
fromJSON(object: any): UpdateSensorRequest {
|
|
317
|
+
return {
|
|
318
|
+
sensorId: isSet(object.sensorId) ? globalThis.Number(object.sensorId) : 0,
|
|
319
|
+
newState: isSet(object.newState) ? SensorState.fromJSON(object.newState) : undefined,
|
|
320
|
+
};
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
toJSON(message: UpdateSensorRequest): unknown {
|
|
324
|
+
const obj: any = {};
|
|
325
|
+
if (message.sensorId !== 0) {
|
|
326
|
+
obj.sensorId = Math.round(message.sensorId);
|
|
327
|
+
}
|
|
328
|
+
if (message.newState !== undefined) {
|
|
329
|
+
obj.newState = SensorState.toJSON(message.newState);
|
|
330
|
+
}
|
|
331
|
+
return obj;
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
create<I extends Exact<DeepPartial<UpdateSensorRequest>, I>>(base?: I): UpdateSensorRequest {
|
|
335
|
+
return UpdateSensorRequest.fromPartial(base ?? ({} as any));
|
|
336
|
+
},
|
|
337
|
+
fromPartial<I extends Exact<DeepPartial<UpdateSensorRequest>, I>>(object: I): UpdateSensorRequest {
|
|
338
|
+
const message = createBaseUpdateSensorRequest();
|
|
339
|
+
message.sensorId = object.sensorId ?? 0;
|
|
340
|
+
message.newState = (object.newState !== undefined && object.newState !== null)
|
|
341
|
+
? SensorState.fromPartial(object.newState)
|
|
342
|
+
: undefined;
|
|
343
|
+
return message;
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
function createBaseUpdateSensorsResponse(): UpdateSensorsResponse {
|
|
348
|
+
return { errors: [], processed: [] };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export const UpdateSensorsResponse: MessageFns<UpdateSensorsResponse> = {
|
|
352
|
+
encode(message: UpdateSensorsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
353
|
+
for (const v of message.errors) {
|
|
354
|
+
writer.uint32(10).string(v!);
|
|
355
|
+
}
|
|
356
|
+
writer.uint32(18).fork();
|
|
357
|
+
for (const v of message.processed) {
|
|
358
|
+
writer.int32(v);
|
|
359
|
+
}
|
|
360
|
+
writer.join();
|
|
361
|
+
return writer;
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateSensorsResponse {
|
|
365
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
366
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
367
|
+
const message = createBaseUpdateSensorsResponse();
|
|
368
|
+
while (reader.pos < end) {
|
|
369
|
+
const tag = reader.uint32();
|
|
370
|
+
switch (tag >>> 3) {
|
|
371
|
+
case 1: {
|
|
372
|
+
if (tag !== 10) {
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
message.errors.push(reader.string());
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
case 2: {
|
|
380
|
+
if (tag === 16) {
|
|
381
|
+
message.processed.push(reader.int32());
|
|
382
|
+
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (tag === 18) {
|
|
387
|
+
const end2 = reader.uint32() + reader.pos;
|
|
388
|
+
while (reader.pos < end2) {
|
|
389
|
+
message.processed.push(reader.int32());
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
reader.skip(tag & 7);
|
|
402
|
+
}
|
|
403
|
+
return message;
|
|
404
|
+
},
|
|
405
|
+
|
|
406
|
+
fromJSON(object: any): UpdateSensorsResponse {
|
|
407
|
+
return {
|
|
408
|
+
errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => globalThis.String(e)) : [],
|
|
409
|
+
processed: globalThis.Array.isArray(object?.processed)
|
|
410
|
+
? object.processed.map((e: any) => globalThis.Number(e))
|
|
411
|
+
: [],
|
|
412
|
+
};
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
toJSON(message: UpdateSensorsResponse): unknown {
|
|
416
|
+
const obj: any = {};
|
|
417
|
+
if (message.errors?.length) {
|
|
418
|
+
obj.errors = message.errors;
|
|
419
|
+
}
|
|
420
|
+
if (message.processed?.length) {
|
|
421
|
+
obj.processed = message.processed.map((e) => Math.round(e));
|
|
422
|
+
}
|
|
423
|
+
return obj;
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
create<I extends Exact<DeepPartial<UpdateSensorsResponse>, I>>(base?: I): UpdateSensorsResponse {
|
|
427
|
+
return UpdateSensorsResponse.fromPartial(base ?? ({} as any));
|
|
428
|
+
},
|
|
429
|
+
fromPartial<I extends Exact<DeepPartial<UpdateSensorsResponse>, I>>(object: I): UpdateSensorsResponse {
|
|
430
|
+
const message = createBaseUpdateSensorsResponse();
|
|
431
|
+
message.errors = object.errors?.map((e) => e) || [];
|
|
432
|
+
message.processed = object.processed?.map((e) => e) || [];
|
|
433
|
+
return message;
|
|
434
|
+
},
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
function createBaseUpdateStationRequest(): UpdateStationRequest {
|
|
438
|
+
return { stationId: 0, definition: undefined };
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export const UpdateStationRequest: MessageFns<UpdateStationRequest> = {
|
|
442
|
+
encode(message: UpdateStationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
443
|
+
if (message.stationId !== 0) {
|
|
444
|
+
writer.uint32(8).int64(message.stationId);
|
|
445
|
+
}
|
|
446
|
+
if (message.definition !== undefined) {
|
|
447
|
+
StationDefinition.encode(message.definition, writer.uint32(18).fork()).join();
|
|
448
|
+
}
|
|
449
|
+
return writer;
|
|
450
|
+
},
|
|
451
|
+
|
|
452
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateStationRequest {
|
|
453
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
454
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
455
|
+
const message = createBaseUpdateStationRequest();
|
|
456
|
+
while (reader.pos < end) {
|
|
457
|
+
const tag = reader.uint32();
|
|
458
|
+
switch (tag >>> 3) {
|
|
459
|
+
case 1: {
|
|
460
|
+
if (tag !== 8) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
message.stationId = longToNumber(reader.int64());
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
case 2: {
|
|
468
|
+
if (tag !== 18) {
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
message.definition = StationDefinition.decode(reader, reader.uint32());
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
reader.skip(tag & 7);
|
|
480
|
+
}
|
|
481
|
+
return message;
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
fromJSON(object: any): UpdateStationRequest {
|
|
485
|
+
return {
|
|
486
|
+
stationId: isSet(object.stationId) ? globalThis.Number(object.stationId) : 0,
|
|
487
|
+
definition: isSet(object.definition) ? StationDefinition.fromJSON(object.definition) : undefined,
|
|
488
|
+
};
|
|
489
|
+
},
|
|
490
|
+
|
|
491
|
+
toJSON(message: UpdateStationRequest): unknown {
|
|
492
|
+
const obj: any = {};
|
|
493
|
+
if (message.stationId !== 0) {
|
|
494
|
+
obj.stationId = Math.round(message.stationId);
|
|
495
|
+
}
|
|
496
|
+
if (message.definition !== undefined) {
|
|
497
|
+
obj.definition = StationDefinition.toJSON(message.definition);
|
|
498
|
+
}
|
|
499
|
+
return obj;
|
|
500
|
+
},
|
|
501
|
+
|
|
502
|
+
create<I extends Exact<DeepPartial<UpdateStationRequest>, I>>(base?: I): UpdateStationRequest {
|
|
503
|
+
return UpdateStationRequest.fromPartial(base ?? ({} as any));
|
|
504
|
+
},
|
|
505
|
+
fromPartial<I extends Exact<DeepPartial<UpdateStationRequest>, I>>(object: I): UpdateStationRequest {
|
|
506
|
+
const message = createBaseUpdateStationRequest();
|
|
507
|
+
message.stationId = object.stationId ?? 0;
|
|
508
|
+
message.definition = (object.definition !== undefined && object.definition !== null)
|
|
509
|
+
? StationDefinition.fromPartial(object.definition)
|
|
510
|
+
: undefined;
|
|
511
|
+
return message;
|
|
512
|
+
},
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
function createBaseGetStationDefinitionRequest(): GetStationDefinitionRequest {
|
|
516
|
+
return {};
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export const GetStationDefinitionRequest: MessageFns<GetStationDefinitionRequest> = {
|
|
520
|
+
encode(_: GetStationDefinitionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
521
|
+
return writer;
|
|
522
|
+
},
|
|
523
|
+
|
|
524
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetStationDefinitionRequest {
|
|
525
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
526
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
527
|
+
const message = createBaseGetStationDefinitionRequest();
|
|
528
|
+
while (reader.pos < end) {
|
|
529
|
+
const tag = reader.uint32();
|
|
530
|
+
switch (tag >>> 3) {
|
|
531
|
+
}
|
|
532
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
reader.skip(tag & 7);
|
|
536
|
+
}
|
|
537
|
+
return message;
|
|
538
|
+
},
|
|
539
|
+
|
|
540
|
+
fromJSON(_: any): GetStationDefinitionRequest {
|
|
541
|
+
return {};
|
|
542
|
+
},
|
|
543
|
+
|
|
544
|
+
toJSON(_: GetStationDefinitionRequest): unknown {
|
|
545
|
+
const obj: any = {};
|
|
546
|
+
return obj;
|
|
547
|
+
},
|
|
548
|
+
|
|
549
|
+
create<I extends Exact<DeepPartial<GetStationDefinitionRequest>, I>>(base?: I): GetStationDefinitionRequest {
|
|
550
|
+
return GetStationDefinitionRequest.fromPartial(base ?? ({} as any));
|
|
551
|
+
},
|
|
552
|
+
fromPartial<I extends Exact<DeepPartial<GetStationDefinitionRequest>, I>>(_: I): GetStationDefinitionRequest {
|
|
553
|
+
const message = createBaseGetStationDefinitionRequest();
|
|
554
|
+
return message;
|
|
555
|
+
},
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
function createBaseStationDefinition(): StationDefinition {
|
|
559
|
+
return { name: "", sensors: [], longitude: 0, latitude: 0, version: 0 };
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export const StationDefinition: MessageFns<StationDefinition> = {
|
|
563
|
+
encode(message: StationDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
564
|
+
if (message.name !== "") {
|
|
565
|
+
writer.uint32(10).string(message.name);
|
|
566
|
+
}
|
|
567
|
+
for (const v of message.sensors) {
|
|
568
|
+
SensorDefinition.encode(v!, writer.uint32(18).fork()).join();
|
|
569
|
+
}
|
|
570
|
+
if (message.longitude !== 0) {
|
|
571
|
+
writer.uint32(25).double(message.longitude);
|
|
572
|
+
}
|
|
573
|
+
if (message.latitude !== 0) {
|
|
574
|
+
writer.uint32(33).double(message.latitude);
|
|
575
|
+
}
|
|
576
|
+
if (message.version !== 0) {
|
|
577
|
+
writer.uint32(40).int32(message.version);
|
|
578
|
+
}
|
|
579
|
+
return writer;
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StationDefinition {
|
|
583
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
584
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
585
|
+
const message = createBaseStationDefinition();
|
|
586
|
+
while (reader.pos < end) {
|
|
587
|
+
const tag = reader.uint32();
|
|
588
|
+
switch (tag >>> 3) {
|
|
589
|
+
case 1: {
|
|
590
|
+
if (tag !== 10) {
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
message.name = reader.string();
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
case 2: {
|
|
598
|
+
if (tag !== 18) {
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
message.sensors.push(SensorDefinition.decode(reader, reader.uint32()));
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
case 3: {
|
|
606
|
+
if (tag !== 25) {
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
message.longitude = reader.double();
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
case 4: {
|
|
614
|
+
if (tag !== 33) {
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
message.latitude = reader.double();
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
case 5: {
|
|
622
|
+
if (tag !== 40) {
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
message.version = reader.int32();
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
reader.skip(tag & 7);
|
|
634
|
+
}
|
|
635
|
+
return message;
|
|
636
|
+
},
|
|
637
|
+
|
|
638
|
+
fromJSON(object: any): StationDefinition {
|
|
639
|
+
return {
|
|
640
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
641
|
+
sensors: globalThis.Array.isArray(object?.sensors)
|
|
642
|
+
? object.sensors.map((e: any) => SensorDefinition.fromJSON(e))
|
|
643
|
+
: [],
|
|
644
|
+
longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
|
|
645
|
+
latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
|
|
646
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
647
|
+
};
|
|
648
|
+
},
|
|
649
|
+
|
|
650
|
+
toJSON(message: StationDefinition): unknown {
|
|
651
|
+
const obj: any = {};
|
|
652
|
+
if (message.name !== "") {
|
|
653
|
+
obj.name = message.name;
|
|
654
|
+
}
|
|
655
|
+
if (message.sensors?.length) {
|
|
656
|
+
obj.sensors = message.sensors.map((e) => SensorDefinition.toJSON(e));
|
|
657
|
+
}
|
|
658
|
+
if (message.longitude !== 0) {
|
|
659
|
+
obj.longitude = message.longitude;
|
|
660
|
+
}
|
|
661
|
+
if (message.latitude !== 0) {
|
|
662
|
+
obj.latitude = message.latitude;
|
|
663
|
+
}
|
|
664
|
+
if (message.version !== 0) {
|
|
665
|
+
obj.version = Math.round(message.version);
|
|
666
|
+
}
|
|
667
|
+
return obj;
|
|
668
|
+
},
|
|
669
|
+
|
|
670
|
+
create<I extends Exact<DeepPartial<StationDefinition>, I>>(base?: I): StationDefinition {
|
|
671
|
+
return StationDefinition.fromPartial(base ?? ({} as any));
|
|
672
|
+
},
|
|
673
|
+
fromPartial<I extends Exact<DeepPartial<StationDefinition>, I>>(object: I): StationDefinition {
|
|
674
|
+
const message = createBaseStationDefinition();
|
|
675
|
+
message.name = object.name ?? "";
|
|
676
|
+
message.sensors = object.sensors?.map((e) => SensorDefinition.fromPartial(e)) || [];
|
|
677
|
+
message.longitude = object.longitude ?? 0;
|
|
678
|
+
message.latitude = object.latitude ?? 0;
|
|
679
|
+
message.version = object.version ?? 0;
|
|
680
|
+
return message;
|
|
681
|
+
},
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
function createBaseSensorDefinition(): SensorDefinition {
|
|
685
|
+
return { name: "", element: "", recordIntervalSeconds: 0 };
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export const SensorDefinition: MessageFns<SensorDefinition> = {
|
|
689
|
+
encode(message: SensorDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
690
|
+
if (message.name !== "") {
|
|
691
|
+
writer.uint32(10).string(message.name);
|
|
692
|
+
}
|
|
693
|
+
if (message.element !== "") {
|
|
694
|
+
writer.uint32(18).string(message.element);
|
|
695
|
+
}
|
|
696
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
697
|
+
writer.uint32(24).int64(message.recordIntervalSeconds);
|
|
698
|
+
}
|
|
699
|
+
return writer;
|
|
700
|
+
},
|
|
701
|
+
|
|
702
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SensorDefinition {
|
|
703
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
704
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
705
|
+
const message = createBaseSensorDefinition();
|
|
706
|
+
while (reader.pos < end) {
|
|
707
|
+
const tag = reader.uint32();
|
|
708
|
+
switch (tag >>> 3) {
|
|
709
|
+
case 1: {
|
|
710
|
+
if (tag !== 10) {
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
message.name = reader.string();
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
case 2: {
|
|
718
|
+
if (tag !== 18) {
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
message.element = reader.string();
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
case 3: {
|
|
726
|
+
if (tag !== 24) {
|
|
727
|
+
break;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
message.recordIntervalSeconds = longToNumber(reader.int64());
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
735
|
+
break;
|
|
736
|
+
}
|
|
737
|
+
reader.skip(tag & 7);
|
|
738
|
+
}
|
|
739
|
+
return message;
|
|
740
|
+
},
|
|
741
|
+
|
|
742
|
+
fromJSON(object: any): SensorDefinition {
|
|
743
|
+
return {
|
|
744
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
745
|
+
element: isSet(object.element) ? globalThis.String(object.element) : "",
|
|
746
|
+
recordIntervalSeconds: isSet(object.recordIntervalSeconds) ? globalThis.Number(object.recordIntervalSeconds) : 0,
|
|
747
|
+
};
|
|
748
|
+
},
|
|
749
|
+
|
|
750
|
+
toJSON(message: SensorDefinition): unknown {
|
|
751
|
+
const obj: any = {};
|
|
752
|
+
if (message.name !== "") {
|
|
753
|
+
obj.name = message.name;
|
|
754
|
+
}
|
|
755
|
+
if (message.element !== "") {
|
|
756
|
+
obj.element = message.element;
|
|
757
|
+
}
|
|
758
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
759
|
+
obj.recordIntervalSeconds = Math.round(message.recordIntervalSeconds);
|
|
760
|
+
}
|
|
761
|
+
return obj;
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
create<I extends Exact<DeepPartial<SensorDefinition>, I>>(base?: I): SensorDefinition {
|
|
765
|
+
return SensorDefinition.fromPartial(base ?? ({} as any));
|
|
766
|
+
},
|
|
767
|
+
fromPartial<I extends Exact<DeepPartial<SensorDefinition>, I>>(object: I): SensorDefinition {
|
|
768
|
+
const message = createBaseSensorDefinition();
|
|
769
|
+
message.name = object.name ?? "";
|
|
770
|
+
message.element = object.element ?? "";
|
|
771
|
+
message.recordIntervalSeconds = object.recordIntervalSeconds ?? 0;
|
|
772
|
+
return message;
|
|
773
|
+
},
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
function createBaseStation(): Station {
|
|
777
|
+
return { id: 0, sensors: [], version: 0 };
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export const Station: MessageFns<Station> = {
|
|
781
|
+
encode(message: Station, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
782
|
+
if (message.id !== 0) {
|
|
783
|
+
writer.uint32(8).int64(message.id);
|
|
784
|
+
}
|
|
785
|
+
for (const v of message.sensors) {
|
|
786
|
+
Sensor.encode(v!, writer.uint32(18).fork()).join();
|
|
787
|
+
}
|
|
788
|
+
if (message.version !== 0) {
|
|
789
|
+
writer.uint32(24).int32(message.version);
|
|
790
|
+
}
|
|
791
|
+
return writer;
|
|
792
|
+
},
|
|
793
|
+
|
|
794
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Station {
|
|
795
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
796
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
797
|
+
const message = createBaseStation();
|
|
798
|
+
while (reader.pos < end) {
|
|
799
|
+
const tag = reader.uint32();
|
|
800
|
+
switch (tag >>> 3) {
|
|
801
|
+
case 1: {
|
|
802
|
+
if (tag !== 8) {
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
message.id = longToNumber(reader.int64());
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
case 2: {
|
|
810
|
+
if (tag !== 18) {
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
message.sensors.push(Sensor.decode(reader, reader.uint32()));
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
case 3: {
|
|
818
|
+
if (tag !== 24) {
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
message.version = reader.int32();
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
reader.skip(tag & 7);
|
|
830
|
+
}
|
|
831
|
+
return message;
|
|
832
|
+
},
|
|
833
|
+
|
|
834
|
+
fromJSON(object: any): Station {
|
|
835
|
+
return {
|
|
836
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
837
|
+
sensors: globalThis.Array.isArray(object?.sensors) ? object.sensors.map((e: any) => Sensor.fromJSON(e)) : [],
|
|
838
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
839
|
+
};
|
|
840
|
+
},
|
|
841
|
+
|
|
842
|
+
toJSON(message: Station): unknown {
|
|
843
|
+
const obj: any = {};
|
|
844
|
+
if (message.id !== 0) {
|
|
845
|
+
obj.id = Math.round(message.id);
|
|
846
|
+
}
|
|
847
|
+
if (message.sensors?.length) {
|
|
848
|
+
obj.sensors = message.sensors.map((e) => Sensor.toJSON(e));
|
|
849
|
+
}
|
|
850
|
+
if (message.version !== 0) {
|
|
851
|
+
obj.version = Math.round(message.version);
|
|
852
|
+
}
|
|
853
|
+
return obj;
|
|
854
|
+
},
|
|
855
|
+
|
|
856
|
+
create<I extends Exact<DeepPartial<Station>, I>>(base?: I): Station {
|
|
857
|
+
return Station.fromPartial(base ?? ({} as any));
|
|
858
|
+
},
|
|
859
|
+
fromPartial<I extends Exact<DeepPartial<Station>, I>>(object: I): Station {
|
|
860
|
+
const message = createBaseStation();
|
|
861
|
+
message.id = object.id ?? 0;
|
|
862
|
+
message.sensors = object.sensors?.map((e) => Sensor.fromPartial(e)) || [];
|
|
863
|
+
message.version = object.version ?? 0;
|
|
864
|
+
return message;
|
|
865
|
+
},
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
function createBaseSensor(): Sensor {
|
|
869
|
+
return { id: 0, name: "", recordIntervalSeconds: 0 };
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export const Sensor: MessageFns<Sensor> = {
|
|
873
|
+
encode(message: Sensor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
874
|
+
if (message.id !== 0) {
|
|
875
|
+
writer.uint32(8).int64(message.id);
|
|
876
|
+
}
|
|
877
|
+
if (message.name !== "") {
|
|
878
|
+
writer.uint32(18).string(message.name);
|
|
879
|
+
}
|
|
880
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
881
|
+
writer.uint32(24).int64(message.recordIntervalSeconds);
|
|
882
|
+
}
|
|
883
|
+
return writer;
|
|
884
|
+
},
|
|
885
|
+
|
|
886
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Sensor {
|
|
887
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
888
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
889
|
+
const message = createBaseSensor();
|
|
890
|
+
while (reader.pos < end) {
|
|
891
|
+
const tag = reader.uint32();
|
|
892
|
+
switch (tag >>> 3) {
|
|
893
|
+
case 1: {
|
|
894
|
+
if (tag !== 8) {
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
message.id = longToNumber(reader.int64());
|
|
899
|
+
continue;
|
|
900
|
+
}
|
|
901
|
+
case 2: {
|
|
902
|
+
if (tag !== 18) {
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
message.name = reader.string();
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
case 3: {
|
|
910
|
+
if (tag !== 24) {
|
|
911
|
+
break;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
message.recordIntervalSeconds = longToNumber(reader.int64());
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
reader.skip(tag & 7);
|
|
922
|
+
}
|
|
923
|
+
return message;
|
|
924
|
+
},
|
|
925
|
+
|
|
926
|
+
fromJSON(object: any): Sensor {
|
|
927
|
+
return {
|
|
928
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
929
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
930
|
+
recordIntervalSeconds: isSet(object.recordIntervalSeconds) ? globalThis.Number(object.recordIntervalSeconds) : 0,
|
|
931
|
+
};
|
|
932
|
+
},
|
|
933
|
+
|
|
934
|
+
toJSON(message: Sensor): unknown {
|
|
935
|
+
const obj: any = {};
|
|
936
|
+
if (message.id !== 0) {
|
|
937
|
+
obj.id = Math.round(message.id);
|
|
938
|
+
}
|
|
939
|
+
if (message.name !== "") {
|
|
940
|
+
obj.name = message.name;
|
|
941
|
+
}
|
|
942
|
+
if (message.recordIntervalSeconds !== 0) {
|
|
943
|
+
obj.recordIntervalSeconds = Math.round(message.recordIntervalSeconds);
|
|
944
|
+
}
|
|
945
|
+
return obj;
|
|
946
|
+
},
|
|
947
|
+
|
|
948
|
+
create<I extends Exact<DeepPartial<Sensor>, I>>(base?: I): Sensor {
|
|
949
|
+
return Sensor.fromPartial(base ?? ({} as any));
|
|
950
|
+
},
|
|
951
|
+
fromPartial<I extends Exact<DeepPartial<Sensor>, I>>(object: I): Sensor {
|
|
952
|
+
const message = createBaseSensor();
|
|
953
|
+
message.id = object.id ?? 0;
|
|
954
|
+
message.name = object.name ?? "";
|
|
955
|
+
message.recordIntervalSeconds = object.recordIntervalSeconds ?? 0;
|
|
956
|
+
return message;
|
|
957
|
+
},
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
function createBaseGetSensorStateRequest(): GetSensorStateRequest {
|
|
961
|
+
return { name: "" };
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
export const GetSensorStateRequest: MessageFns<GetSensorStateRequest> = {
|
|
965
|
+
encode(message: GetSensorStateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
966
|
+
if (message.name !== "") {
|
|
967
|
+
writer.uint32(10).string(message.name);
|
|
968
|
+
}
|
|
969
|
+
return writer;
|
|
970
|
+
},
|
|
971
|
+
|
|
972
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSensorStateRequest {
|
|
973
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
974
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
975
|
+
const message = createBaseGetSensorStateRequest();
|
|
976
|
+
while (reader.pos < end) {
|
|
977
|
+
const tag = reader.uint32();
|
|
978
|
+
switch (tag >>> 3) {
|
|
979
|
+
case 1: {
|
|
980
|
+
if (tag !== 10) {
|
|
981
|
+
break;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
message.name = reader.string();
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
reader.skip(tag & 7);
|
|
992
|
+
}
|
|
993
|
+
return message;
|
|
994
|
+
},
|
|
995
|
+
|
|
996
|
+
fromJSON(object: any): GetSensorStateRequest {
|
|
997
|
+
return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
|
|
998
|
+
},
|
|
999
|
+
|
|
1000
|
+
toJSON(message: GetSensorStateRequest): unknown {
|
|
1001
|
+
const obj: any = {};
|
|
1002
|
+
if (message.name !== "") {
|
|
1003
|
+
obj.name = message.name;
|
|
1004
|
+
}
|
|
1005
|
+
return obj;
|
|
1006
|
+
},
|
|
1007
|
+
|
|
1008
|
+
create<I extends Exact<DeepPartial<GetSensorStateRequest>, I>>(base?: I): GetSensorStateRequest {
|
|
1009
|
+
return GetSensorStateRequest.fromPartial(base ?? ({} as any));
|
|
1010
|
+
},
|
|
1011
|
+
fromPartial<I extends Exact<DeepPartial<GetSensorStateRequest>, I>>(object: I): GetSensorStateRequest {
|
|
1012
|
+
const message = createBaseGetSensorStateRequest();
|
|
1013
|
+
message.name = object.name ?? "";
|
|
1014
|
+
return message;
|
|
1015
|
+
},
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
function createBaseSensorState(): SensorState {
|
|
1019
|
+
return { unitId: "", value: undefined, createdAt: 0, intervalStart: undefined };
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
export const SensorState: MessageFns<SensorState> = {
|
|
1023
|
+
encode(message: SensorState, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1024
|
+
if (message.unitId !== "") {
|
|
1025
|
+
writer.uint32(18).string(message.unitId);
|
|
1026
|
+
}
|
|
1027
|
+
if (message.value !== undefined) {
|
|
1028
|
+
writer.uint32(25).double(message.value);
|
|
1029
|
+
}
|
|
1030
|
+
if (message.createdAt !== 0) {
|
|
1031
|
+
writer.uint32(32).int64(message.createdAt);
|
|
1032
|
+
}
|
|
1033
|
+
if (message.intervalStart !== undefined) {
|
|
1034
|
+
writer.uint32(40).int64(message.intervalStart);
|
|
1035
|
+
}
|
|
1036
|
+
return writer;
|
|
1037
|
+
},
|
|
1038
|
+
|
|
1039
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SensorState {
|
|
1040
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1041
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1042
|
+
const message = createBaseSensorState();
|
|
1043
|
+
while (reader.pos < end) {
|
|
1044
|
+
const tag = reader.uint32();
|
|
1045
|
+
switch (tag >>> 3) {
|
|
1046
|
+
case 2: {
|
|
1047
|
+
if (tag !== 18) {
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
message.unitId = reader.string();
|
|
1052
|
+
continue;
|
|
1053
|
+
}
|
|
1054
|
+
case 3: {
|
|
1055
|
+
if (tag !== 25) {
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
message.value = reader.double();
|
|
1060
|
+
continue;
|
|
1061
|
+
}
|
|
1062
|
+
case 4: {
|
|
1063
|
+
if (tag !== 32) {
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
message.createdAt = longToNumber(reader.int64());
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
case 5: {
|
|
1071
|
+
if (tag !== 40) {
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
message.intervalStart = longToNumber(reader.int64());
|
|
1076
|
+
continue;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
reader.skip(tag & 7);
|
|
1083
|
+
}
|
|
1084
|
+
return message;
|
|
1085
|
+
},
|
|
1086
|
+
|
|
1087
|
+
fromJSON(object: any): SensorState {
|
|
1088
|
+
return {
|
|
1089
|
+
unitId: isSet(object.unitId) ? globalThis.String(object.unitId) : "",
|
|
1090
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : undefined,
|
|
1091
|
+
createdAt: isSet(object.createdAt) ? globalThis.Number(object.createdAt) : 0,
|
|
1092
|
+
intervalStart: isSet(object.intervalStart) ? globalThis.Number(object.intervalStart) : undefined,
|
|
1093
|
+
};
|
|
1094
|
+
},
|
|
1095
|
+
|
|
1096
|
+
toJSON(message: SensorState): unknown {
|
|
1097
|
+
const obj: any = {};
|
|
1098
|
+
if (message.unitId !== "") {
|
|
1099
|
+
obj.unitId = message.unitId;
|
|
1100
|
+
}
|
|
1101
|
+
if (message.value !== undefined) {
|
|
1102
|
+
obj.value = message.value;
|
|
1103
|
+
}
|
|
1104
|
+
if (message.createdAt !== 0) {
|
|
1105
|
+
obj.createdAt = Math.round(message.createdAt);
|
|
1106
|
+
}
|
|
1107
|
+
if (message.intervalStart !== undefined) {
|
|
1108
|
+
obj.intervalStart = Math.round(message.intervalStart);
|
|
1109
|
+
}
|
|
1110
|
+
return obj;
|
|
1111
|
+
},
|
|
1112
|
+
|
|
1113
|
+
create<I extends Exact<DeepPartial<SensorState>, I>>(base?: I): SensorState {
|
|
1114
|
+
return SensorState.fromPartial(base ?? ({} as any));
|
|
1115
|
+
},
|
|
1116
|
+
fromPartial<I extends Exact<DeepPartial<SensorState>, I>>(object: I): SensorState {
|
|
1117
|
+
const message = createBaseSensorState();
|
|
1118
|
+
message.unitId = object.unitId ?? "";
|
|
1119
|
+
message.value = object.value ?? undefined;
|
|
1120
|
+
message.createdAt = object.createdAt ?? 0;
|
|
1121
|
+
message.intervalStart = object.intervalStart ?? undefined;
|
|
1122
|
+
return message;
|
|
1123
|
+
},
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
export type DaemonServiceService = typeof DaemonServiceService;
|
|
1127
|
+
export const DaemonServiceService = {
|
|
1128
|
+
createStation: {
|
|
1129
|
+
path: "/recorder.DaemonService/CreateStation",
|
|
1130
|
+
requestStream: false,
|
|
1131
|
+
responseStream: false,
|
|
1132
|
+
requestSerialize: (value: StationDefinition): Buffer => Buffer.from(StationDefinition.encode(value).finish()),
|
|
1133
|
+
requestDeserialize: (value: Buffer): StationDefinition => StationDefinition.decode(value),
|
|
1134
|
+
responseSerialize: (value: Station): Buffer => Buffer.from(Station.encode(value).finish()),
|
|
1135
|
+
responseDeserialize: (value: Buffer): Station => Station.decode(value),
|
|
1136
|
+
},
|
|
1137
|
+
getStation: {
|
|
1138
|
+
path: "/recorder.DaemonService/GetStation",
|
|
1139
|
+
requestStream: false,
|
|
1140
|
+
responseStream: false,
|
|
1141
|
+
requestSerialize: (value: GetStationRequest): Buffer => Buffer.from(GetStationRequest.encode(value).finish()),
|
|
1142
|
+
requestDeserialize: (value: Buffer): GetStationRequest => GetStationRequest.decode(value),
|
|
1143
|
+
responseSerialize: (value: Station): Buffer => Buffer.from(Station.encode(value).finish()),
|
|
1144
|
+
responseDeserialize: (value: Buffer): Station => Station.decode(value),
|
|
1145
|
+
},
|
|
1146
|
+
updateStation: {
|
|
1147
|
+
path: "/recorder.DaemonService/UpdateStation",
|
|
1148
|
+
requestStream: false,
|
|
1149
|
+
responseStream: false,
|
|
1150
|
+
requestSerialize: (value: UpdateStationRequest): Buffer => Buffer.from(UpdateStationRequest.encode(value).finish()),
|
|
1151
|
+
requestDeserialize: (value: Buffer): UpdateStationRequest => UpdateStationRequest.decode(value),
|
|
1152
|
+
responseSerialize: (value: Station): Buffer => Buffer.from(Station.encode(value).finish()),
|
|
1153
|
+
responseDeserialize: (value: Buffer): Station => Station.decode(value),
|
|
1154
|
+
},
|
|
1155
|
+
updateSensors: {
|
|
1156
|
+
path: "/recorder.DaemonService/UpdateSensors",
|
|
1157
|
+
requestStream: false,
|
|
1158
|
+
responseStream: false,
|
|
1159
|
+
requestSerialize: (value: UpdateSensorsRequest): Buffer => Buffer.from(UpdateSensorsRequest.encode(value).finish()),
|
|
1160
|
+
requestDeserialize: (value: Buffer): UpdateSensorsRequest => UpdateSensorsRequest.decode(value),
|
|
1161
|
+
responseSerialize: (value: UpdateSensorsResponse): Buffer =>
|
|
1162
|
+
Buffer.from(UpdateSensorsResponse.encode(value).finish()),
|
|
1163
|
+
responseDeserialize: (value: Buffer): UpdateSensorsResponse => UpdateSensorsResponse.decode(value),
|
|
1164
|
+
},
|
|
1165
|
+
ping: {
|
|
1166
|
+
path: "/recorder.DaemonService/Ping",
|
|
1167
|
+
requestStream: false,
|
|
1168
|
+
responseStream: false,
|
|
1169
|
+
requestSerialize: (value: PingMessage): Buffer => Buffer.from(PingMessage.encode(value).finish()),
|
|
1170
|
+
requestDeserialize: (value: Buffer): PingMessage => PingMessage.decode(value),
|
|
1171
|
+
responseSerialize: (value: PingMessage): Buffer => Buffer.from(PingMessage.encode(value).finish()),
|
|
1172
|
+
responseDeserialize: (value: Buffer): PingMessage => PingMessage.decode(value),
|
|
1173
|
+
},
|
|
1174
|
+
} as const;
|
|
1175
|
+
|
|
1176
|
+
export interface DaemonServiceServer extends UntypedServiceImplementation {
|
|
1177
|
+
createStation: handleUnaryCall<StationDefinition, Station>;
|
|
1178
|
+
getStation: handleUnaryCall<GetStationRequest, Station>;
|
|
1179
|
+
updateStation: handleUnaryCall<UpdateStationRequest, Station>;
|
|
1180
|
+
updateSensors: handleUnaryCall<UpdateSensorsRequest, UpdateSensorsResponse>;
|
|
1181
|
+
ping: handleUnaryCall<PingMessage, PingMessage>;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export interface DaemonServiceClient extends Client {
|
|
1185
|
+
createStation(
|
|
1186
|
+
request: StationDefinition,
|
|
1187
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1188
|
+
): ClientUnaryCall;
|
|
1189
|
+
createStation(
|
|
1190
|
+
request: StationDefinition,
|
|
1191
|
+
metadata: Metadata,
|
|
1192
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1193
|
+
): ClientUnaryCall;
|
|
1194
|
+
createStation(
|
|
1195
|
+
request: StationDefinition,
|
|
1196
|
+
metadata: Metadata,
|
|
1197
|
+
options: Partial<CallOptions>,
|
|
1198
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1199
|
+
): ClientUnaryCall;
|
|
1200
|
+
getStation(
|
|
1201
|
+
request: GetStationRequest,
|
|
1202
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1203
|
+
): ClientUnaryCall;
|
|
1204
|
+
getStation(
|
|
1205
|
+
request: GetStationRequest,
|
|
1206
|
+
metadata: Metadata,
|
|
1207
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1208
|
+
): ClientUnaryCall;
|
|
1209
|
+
getStation(
|
|
1210
|
+
request: GetStationRequest,
|
|
1211
|
+
metadata: Metadata,
|
|
1212
|
+
options: Partial<CallOptions>,
|
|
1213
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1214
|
+
): ClientUnaryCall;
|
|
1215
|
+
updateStation(
|
|
1216
|
+
request: UpdateStationRequest,
|
|
1217
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1218
|
+
): ClientUnaryCall;
|
|
1219
|
+
updateStation(
|
|
1220
|
+
request: UpdateStationRequest,
|
|
1221
|
+
metadata: Metadata,
|
|
1222
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1223
|
+
): ClientUnaryCall;
|
|
1224
|
+
updateStation(
|
|
1225
|
+
request: UpdateStationRequest,
|
|
1226
|
+
metadata: Metadata,
|
|
1227
|
+
options: Partial<CallOptions>,
|
|
1228
|
+
callback: (error: ServiceError | null, response: Station) => void,
|
|
1229
|
+
): ClientUnaryCall;
|
|
1230
|
+
updateSensors(
|
|
1231
|
+
request: UpdateSensorsRequest,
|
|
1232
|
+
callback: (error: ServiceError | null, response: UpdateSensorsResponse) => void,
|
|
1233
|
+
): ClientUnaryCall;
|
|
1234
|
+
updateSensors(
|
|
1235
|
+
request: UpdateSensorsRequest,
|
|
1236
|
+
metadata: Metadata,
|
|
1237
|
+
callback: (error: ServiceError | null, response: UpdateSensorsResponse) => void,
|
|
1238
|
+
): ClientUnaryCall;
|
|
1239
|
+
updateSensors(
|
|
1240
|
+
request: UpdateSensorsRequest,
|
|
1241
|
+
metadata: Metadata,
|
|
1242
|
+
options: Partial<CallOptions>,
|
|
1243
|
+
callback: (error: ServiceError | null, response: UpdateSensorsResponse) => void,
|
|
1244
|
+
): ClientUnaryCall;
|
|
1245
|
+
ping(request: PingMessage, callback: (error: ServiceError | null, response: PingMessage) => void): ClientUnaryCall;
|
|
1246
|
+
ping(
|
|
1247
|
+
request: PingMessage,
|
|
1248
|
+
metadata: Metadata,
|
|
1249
|
+
callback: (error: ServiceError | null, response: PingMessage) => void,
|
|
1250
|
+
): ClientUnaryCall;
|
|
1251
|
+
ping(
|
|
1252
|
+
request: PingMessage,
|
|
1253
|
+
metadata: Metadata,
|
|
1254
|
+
options: Partial<CallOptions>,
|
|
1255
|
+
callback: (error: ServiceError | null, response: PingMessage) => void,
|
|
1256
|
+
): ClientUnaryCall;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
export const DaemonServiceClient = makeGenericClientConstructor(
|
|
1260
|
+
DaemonServiceService,
|
|
1261
|
+
"recorder.DaemonService",
|
|
1262
|
+
) as unknown as {
|
|
1263
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): DaemonServiceClient;
|
|
1264
|
+
service: typeof DaemonServiceService;
|
|
1265
|
+
serviceName: string;
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
export type StationInterfaceService = typeof StationInterfaceService;
|
|
1269
|
+
export const StationInterfaceService = {
|
|
1270
|
+
getStationDefinition: {
|
|
1271
|
+
path: "/recorder.StationInterface/GetStationDefinition",
|
|
1272
|
+
requestStream: false,
|
|
1273
|
+
responseStream: false,
|
|
1274
|
+
requestSerialize: (value: GetStationDefinitionRequest): Buffer =>
|
|
1275
|
+
Buffer.from(GetStationDefinitionRequest.encode(value).finish()),
|
|
1276
|
+
requestDeserialize: (value: Buffer): GetStationDefinitionRequest => GetStationDefinitionRequest.decode(value),
|
|
1277
|
+
responseSerialize: (value: StationDefinition): Buffer => Buffer.from(StationDefinition.encode(value).finish()),
|
|
1278
|
+
responseDeserialize: (value: Buffer): StationDefinition => StationDefinition.decode(value),
|
|
1279
|
+
},
|
|
1280
|
+
getSensorState: {
|
|
1281
|
+
path: "/recorder.StationInterface/GetSensorState",
|
|
1282
|
+
requestStream: false,
|
|
1283
|
+
responseStream: false,
|
|
1284
|
+
requestSerialize: (value: GetSensorStateRequest): Buffer =>
|
|
1285
|
+
Buffer.from(GetSensorStateRequest.encode(value).finish()),
|
|
1286
|
+
requestDeserialize: (value: Buffer): GetSensorStateRequest => GetSensorStateRequest.decode(value),
|
|
1287
|
+
responseSerialize: (value: SensorState): Buffer => Buffer.from(SensorState.encode(value).finish()),
|
|
1288
|
+
responseDeserialize: (value: Buffer): SensorState => SensorState.decode(value),
|
|
1289
|
+
},
|
|
1290
|
+
} as const;
|
|
1291
|
+
|
|
1292
|
+
export interface StationInterfaceServer extends UntypedServiceImplementation {
|
|
1293
|
+
getStationDefinition: handleUnaryCall<GetStationDefinitionRequest, StationDefinition>;
|
|
1294
|
+
getSensorState: handleUnaryCall<GetSensorStateRequest, SensorState>;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
export interface StationInterfaceClient extends Client {
|
|
1298
|
+
getStationDefinition(
|
|
1299
|
+
request: GetStationDefinitionRequest,
|
|
1300
|
+
callback: (error: ServiceError | null, response: StationDefinition) => void,
|
|
1301
|
+
): ClientUnaryCall;
|
|
1302
|
+
getStationDefinition(
|
|
1303
|
+
request: GetStationDefinitionRequest,
|
|
1304
|
+
metadata: Metadata,
|
|
1305
|
+
callback: (error: ServiceError | null, response: StationDefinition) => void,
|
|
1306
|
+
): ClientUnaryCall;
|
|
1307
|
+
getStationDefinition(
|
|
1308
|
+
request: GetStationDefinitionRequest,
|
|
1309
|
+
metadata: Metadata,
|
|
1310
|
+
options: Partial<CallOptions>,
|
|
1311
|
+
callback: (error: ServiceError | null, response: StationDefinition) => void,
|
|
1312
|
+
): ClientUnaryCall;
|
|
1313
|
+
getSensorState(
|
|
1314
|
+
request: GetSensorStateRequest,
|
|
1315
|
+
callback: (error: ServiceError | null, response: SensorState) => void,
|
|
1316
|
+
): ClientUnaryCall;
|
|
1317
|
+
getSensorState(
|
|
1318
|
+
request: GetSensorStateRequest,
|
|
1319
|
+
metadata: Metadata,
|
|
1320
|
+
callback: (error: ServiceError | null, response: SensorState) => void,
|
|
1321
|
+
): ClientUnaryCall;
|
|
1322
|
+
getSensorState(
|
|
1323
|
+
request: GetSensorStateRequest,
|
|
1324
|
+
metadata: Metadata,
|
|
1325
|
+
options: Partial<CallOptions>,
|
|
1326
|
+
callback: (error: ServiceError | null, response: SensorState) => void,
|
|
1327
|
+
): ClientUnaryCall;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
export const StationInterfaceClient = makeGenericClientConstructor(
|
|
1331
|
+
StationInterfaceService,
|
|
1332
|
+
"recorder.StationInterface",
|
|
1333
|
+
) as unknown as {
|
|
1334
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): StationInterfaceClient;
|
|
1335
|
+
service: typeof StationInterfaceService;
|
|
1336
|
+
serviceName: string;
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1340
|
+
|
|
1341
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
1342
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
1343
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
1344
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1345
|
+
: Partial<T>;
|
|
1346
|
+
|
|
1347
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1348
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
1349
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
1350
|
+
|
|
1351
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
1352
|
+
const num = globalThis.Number(int64.toString());
|
|
1353
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1354
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1355
|
+
}
|
|
1356
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1357
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1358
|
+
}
|
|
1359
|
+
return num;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
function isSet(value: any): boolean {
|
|
1363
|
+
return value !== null && value !== undefined;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export interface MessageFns<T> {
|
|
1367
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1368
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1369
|
+
fromJSON(object: any): T;
|
|
1370
|
+
toJSON(message: T): unknown;
|
|
1371
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
1372
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
1373
|
+
}
|