@fatehan/tsrp 1.5.3 → 1.5.4

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.
Files changed (76) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +8 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -1
  3. package/dist/fatehan/activities/workflow.js +66 -3
  4. package/dist/fatehan/apis/client.d.ts +1 -1
  5. package/dist/fatehan/apis/client.js +3 -3
  6. package/dist/fatehan/areas/area.js +2 -2
  7. package/dist/fatehan/devices/devices.js +2 -2
  8. package/dist/fatehan/devices/maintenance.js +2 -2
  9. package/dist/fatehan/financial/financial.js +2 -2
  10. package/dist/fatehan/google/protobuf/descriptor.d.ts +470 -39
  11. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -1
  12. package/dist/fatehan/google/protobuf/descriptor.js +1070 -57
  13. package/dist/fatehan/google/protobuf/duration.js +2 -2
  14. package/dist/fatehan/google/protobuf/field_mask.d.ts +16 -18
  15. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -1
  16. package/dist/fatehan/google/protobuf/field_mask.js +2 -2
  17. package/dist/fatehan/google/protobuf/timestamp.d.ts +10 -9
  18. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -1
  19. package/dist/fatehan/google/protobuf/timestamp.js +2 -2
  20. package/dist/fatehan/identities/authentication.d.ts +82 -6
  21. package/dist/fatehan/identities/authentication.d.ts.map +1 -1
  22. package/dist/fatehan/identities/authentication.js +575 -47
  23. package/dist/fatehan/identities/identities.d.ts +13 -1
  24. package/dist/fatehan/identities/identities.d.ts.map +1 -1
  25. package/dist/fatehan/identities/identities.js +15 -3
  26. package/dist/fatehan/models/fusion.js +2 -2
  27. package/dist/fatehan/models/models.js +2 -2
  28. package/dist/fatehan/notifies/notify.js +2 -2
  29. package/dist/fatehan/packets/{messages.d.ts → commands.d.ts} +58 -1
  30. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  31. package/dist/fatehan/packets/{messages.js → commands.js} +588 -3
  32. package/dist/fatehan/packets/dataModel.d.ts +188 -127
  33. package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
  34. package/dist/fatehan/packets/dataModel.js +1641 -1005
  35. package/dist/fatehan/packets/dataModule.js +2 -2
  36. package/dist/fatehan/packets/forge.d.ts +117 -0
  37. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  38. package/dist/fatehan/packets/forge.js +1079 -0
  39. package/dist/fatehan/services/api.d.ts +812 -26
  40. package/dist/fatehan/services/api.d.ts.map +1 -1
  41. package/dist/fatehan/services/api.js +8438 -244
  42. package/dist/fatehan/services/repositories.js +2 -2
  43. package/dist/fatehan/stream/stream.d.ts +224 -0
  44. package/dist/fatehan/stream/stream.d.ts.map +1 -0
  45. package/dist/fatehan/stream/stream.js +1416 -0
  46. package/dist/fatehan/trips/trip.d.ts +159 -159
  47. package/dist/fatehan/trips/trip.d.ts.map +1 -1
  48. package/dist/fatehan/trips/trip.js +169 -169
  49. package/dist/fatehan/utils/buf/validate/validate.js +2 -2
  50. package/dist/services.d.ts +65 -0
  51. package/dist/services.d.ts.map +1 -0
  52. package/dist/services.js +205 -0
  53. package/package.json +12 -12
  54. package/dist/api.d.ts +0 -36
  55. package/dist/api.d.ts.map +0 -1
  56. package/dist/api.js +0 -146
  57. package/dist/fatehan/activities/camera.d.ts +0 -95
  58. package/dist/fatehan/activities/camera.d.ts.map +0 -1
  59. package/dist/fatehan/activities/camera.js +0 -811
  60. package/dist/fatehan/google/protobuf/any.d.ts +0 -146
  61. package/dist/fatehan/google/protobuf/any.d.ts.map +0 -1
  62. package/dist/fatehan/google/protobuf/any.js +0 -104
  63. package/dist/fatehan/google/status.d.ts +0 -53
  64. package/dist/fatehan/google/status.d.ts.map +0 -1
  65. package/dist/fatehan/google/status.js +0 -95
  66. package/dist/fatehan/packets/messages.d.ts.map +0 -1
  67. package/dist/fatehan/reports/report.d.ts +0 -830
  68. package/dist/fatehan/reports/report.d.ts.map +0 -1
  69. package/dist/fatehan/reports/report.js +0 -8380
  70. package/dist/index.d.ts +0 -2
  71. package/dist/index.d.ts.map +0 -1
  72. package/dist/index.js +0 -1
  73. package/dist/report.d.ts +0 -29
  74. package/dist/report.d.ts.map +0 -1
  75. package/dist/report.js +0 -139
  76. package/readme.md +0 -26
@@ -0,0 +1,1079 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.1
5
+ // source: packets/forge.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import Long from "long";
9
+ import { Timestamp } from "../google/protobuf/timestamp";
10
+ export const protobufPackage = "com.fatehan.packets";
11
+ function createBaseRawStingWithProps() {
12
+ return { rawString: "", props: [] };
13
+ }
14
+ export const RawStingWithProps = {
15
+ encode(message, writer = new BinaryWriter()) {
16
+ if (message.rawString !== "") {
17
+ writer.uint32(10).string(message.rawString);
18
+ }
19
+ for (const v of message.props) {
20
+ writer.uint32(18).string(v);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
26
+ const end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseRawStingWithProps();
28
+ while (reader.pos < end) {
29
+ const tag = reader.uint32();
30
+ switch (tag >>> 3) {
31
+ case 1: {
32
+ if (tag !== 10) {
33
+ break;
34
+ }
35
+ message.rawString = reader.string();
36
+ continue;
37
+ }
38
+ case 2: {
39
+ if (tag !== 18) {
40
+ break;
41
+ }
42
+ message.props.push(reader.string());
43
+ continue;
44
+ }
45
+ }
46
+ if ((tag & 7) === 4 || tag === 0) {
47
+ break;
48
+ }
49
+ reader.skip(tag & 7);
50
+ }
51
+ return message;
52
+ },
53
+ create(base) {
54
+ return RawStingWithProps.fromPartial(base ?? {});
55
+ },
56
+ fromPartial(object) {
57
+ const message = createBaseRawStingWithProps();
58
+ message.rawString = object.rawString ?? "";
59
+ message.props = object.props?.map((e) => e) || [];
60
+ return message;
61
+ },
62
+ };
63
+ function createBaseForgeException() {
64
+ return { message: "", stacktrace: undefined };
65
+ }
66
+ export const ForgeException = {
67
+ encode(message, writer = new BinaryWriter()) {
68
+ if (message.message !== "") {
69
+ writer.uint32(10).string(message.message);
70
+ }
71
+ if (message.stacktrace !== undefined) {
72
+ writer.uint32(18).string(message.stacktrace);
73
+ }
74
+ return writer;
75
+ },
76
+ decode(input, length) {
77
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
78
+ const end = length === undefined ? reader.len : reader.pos + length;
79
+ const message = createBaseForgeException();
80
+ while (reader.pos < end) {
81
+ const tag = reader.uint32();
82
+ switch (tag >>> 3) {
83
+ case 1: {
84
+ if (tag !== 10) {
85
+ break;
86
+ }
87
+ message.message = reader.string();
88
+ continue;
89
+ }
90
+ case 2: {
91
+ if (tag !== 18) {
92
+ break;
93
+ }
94
+ message.stacktrace = reader.string();
95
+ continue;
96
+ }
97
+ }
98
+ if ((tag & 7) === 4 || tag === 0) {
99
+ break;
100
+ }
101
+ reader.skip(tag & 7);
102
+ }
103
+ return message;
104
+ },
105
+ create(base) {
106
+ return ForgeException.fromPartial(base ?? {});
107
+ },
108
+ fromPartial(object) {
109
+ const message = createBaseForgeException();
110
+ message.message = object.message ?? "";
111
+ message.stacktrace = object.stacktrace ?? undefined;
112
+ return message;
113
+ },
114
+ };
115
+ function createBaseJTTPlaybackUpdate() {
116
+ return { logicalNumber: 0, playbackControl: 0, control: [] };
117
+ }
118
+ export const JTTPlaybackUpdate = {
119
+ encode(message, writer = new BinaryWriter()) {
120
+ if (message.logicalNumber !== 0) {
121
+ writer.uint32(8).sint32(message.logicalNumber);
122
+ }
123
+ if (message.playbackControl !== 0) {
124
+ writer.uint32(16).sint32(message.playbackControl);
125
+ }
126
+ for (const v of message.control) {
127
+ JTTPlaybackUpdate_Control.encode(v, writer.uint32(26).fork()).join();
128
+ }
129
+ return writer;
130
+ },
131
+ decode(input, length) {
132
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
133
+ const end = length === undefined ? reader.len : reader.pos + length;
134
+ const message = createBaseJTTPlaybackUpdate();
135
+ while (reader.pos < end) {
136
+ const tag = reader.uint32();
137
+ switch (tag >>> 3) {
138
+ case 1: {
139
+ if (tag !== 8) {
140
+ break;
141
+ }
142
+ message.logicalNumber = reader.sint32();
143
+ continue;
144
+ }
145
+ case 2: {
146
+ if (tag !== 16) {
147
+ break;
148
+ }
149
+ message.playbackControl = reader.sint32();
150
+ continue;
151
+ }
152
+ case 3: {
153
+ if (tag !== 26) {
154
+ break;
155
+ }
156
+ message.control.push(JTTPlaybackUpdate_Control.decode(reader, reader.uint32()));
157
+ continue;
158
+ }
159
+ }
160
+ if ((tag & 7) === 4 || tag === 0) {
161
+ break;
162
+ }
163
+ reader.skip(tag & 7);
164
+ }
165
+ return message;
166
+ },
167
+ create(base) {
168
+ return JTTPlaybackUpdate.fromPartial(base ?? {});
169
+ },
170
+ fromPartial(object) {
171
+ const message = createBaseJTTPlaybackUpdate();
172
+ message.logicalNumber = object.logicalNumber ?? 0;
173
+ message.playbackControl = object.playbackControl ?? 0;
174
+ message.control = object.control?.map((e) => JTTPlaybackUpdate_Control.fromPartial(e)) || [];
175
+ return message;
176
+ },
177
+ };
178
+ function createBaseJTTPlaybackUpdate_Control() {
179
+ return { fastForward: 0, playbackPosition: undefined };
180
+ }
181
+ export const JTTPlaybackUpdate_Control = {
182
+ encode(message, writer = new BinaryWriter()) {
183
+ if (message.fastForward !== 0) {
184
+ writer.uint32(8).sint32(message.fastForward);
185
+ }
186
+ if (message.playbackPosition !== undefined) {
187
+ Timestamp.encode(toTimestamp(message.playbackPosition), writer.uint32(18).fork()).join();
188
+ }
189
+ return writer;
190
+ },
191
+ decode(input, length) {
192
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
193
+ const end = length === undefined ? reader.len : reader.pos + length;
194
+ const message = createBaseJTTPlaybackUpdate_Control();
195
+ while (reader.pos < end) {
196
+ const tag = reader.uint32();
197
+ switch (tag >>> 3) {
198
+ case 1: {
199
+ if (tag !== 8) {
200
+ break;
201
+ }
202
+ message.fastForward = reader.sint32();
203
+ continue;
204
+ }
205
+ case 2: {
206
+ if (tag !== 18) {
207
+ break;
208
+ }
209
+ message.playbackPosition = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
210
+ continue;
211
+ }
212
+ }
213
+ if ((tag & 7) === 4 || tag === 0) {
214
+ break;
215
+ }
216
+ reader.skip(tag & 7);
217
+ }
218
+ return message;
219
+ },
220
+ create(base) {
221
+ return JTTPlaybackUpdate_Control.fromPartial(base ?? {});
222
+ },
223
+ fromPartial(object) {
224
+ const message = createBaseJTTPlaybackUpdate_Control();
225
+ message.fastForward = object.fastForward ?? 0;
226
+ message.playbackPosition = object.playbackPosition ?? undefined;
227
+ return message;
228
+ },
229
+ };
230
+ function createBaseJTTQueryFileResponse() {
231
+ return { serialNo: 0, files: [] };
232
+ }
233
+ export const JTTQueryFileResponse = {
234
+ encode(message, writer = new BinaryWriter()) {
235
+ if (message.serialNo !== 0) {
236
+ writer.uint32(8).uint32(message.serialNo);
237
+ }
238
+ for (const v of message.files) {
239
+ JTTQueryFileResponse_File.encode(v, writer.uint32(18).fork()).join();
240
+ }
241
+ return writer;
242
+ },
243
+ decode(input, length) {
244
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
245
+ const end = length === undefined ? reader.len : reader.pos + length;
246
+ const message = createBaseJTTQueryFileResponse();
247
+ while (reader.pos < end) {
248
+ const tag = reader.uint32();
249
+ switch (tag >>> 3) {
250
+ case 1: {
251
+ if (tag !== 8) {
252
+ break;
253
+ }
254
+ message.serialNo = reader.uint32();
255
+ continue;
256
+ }
257
+ case 2: {
258
+ if (tag !== 18) {
259
+ break;
260
+ }
261
+ message.files.push(JTTQueryFileResponse_File.decode(reader, reader.uint32()));
262
+ continue;
263
+ }
264
+ }
265
+ if ((tag & 7) === 4 || tag === 0) {
266
+ break;
267
+ }
268
+ reader.skip(tag & 7);
269
+ }
270
+ return message;
271
+ },
272
+ create(base) {
273
+ return JTTQueryFileResponse.fromPartial(base ?? {});
274
+ },
275
+ fromPartial(object) {
276
+ const message = createBaseJTTQueryFileResponse();
277
+ message.serialNo = object.serialNo ?? 0;
278
+ message.files = object.files?.map((e) => JTTQueryFileResponse_File.fromPartial(e)) || [];
279
+ return message;
280
+ },
281
+ };
282
+ function createBaseJTTQueryFileResponse_File() {
283
+ return {
284
+ logicalNumber: 0,
285
+ startsAt: undefined,
286
+ finishesAt: undefined,
287
+ alarmSign: Long.UZERO,
288
+ audioVideoType: 0,
289
+ streamType: 0,
290
+ memoryType: 0,
291
+ fileSize: 0,
292
+ };
293
+ }
294
+ export const JTTQueryFileResponse_File = {
295
+ encode(message, writer = new BinaryWriter()) {
296
+ if (message.logicalNumber !== 0) {
297
+ writer.uint32(8).sint32(message.logicalNumber);
298
+ }
299
+ if (message.startsAt !== undefined) {
300
+ Timestamp.encode(toTimestamp(message.startsAt), writer.uint32(18).fork()).join();
301
+ }
302
+ if (message.finishesAt !== undefined) {
303
+ Timestamp.encode(toTimestamp(message.finishesAt), writer.uint32(26).fork()).join();
304
+ }
305
+ if (!message.alarmSign.equals(Long.UZERO)) {
306
+ writer.uint32(32).uint64(message.alarmSign.toString());
307
+ }
308
+ if (message.audioVideoType !== 0) {
309
+ writer.uint32(40).sint32(message.audioVideoType);
310
+ }
311
+ if (message.streamType !== 0) {
312
+ writer.uint32(48).sint32(message.streamType);
313
+ }
314
+ if (message.memoryType !== 0) {
315
+ writer.uint32(56).sint32(message.memoryType);
316
+ }
317
+ if (message.fileSize !== 0) {
318
+ writer.uint32(64).uint32(message.fileSize);
319
+ }
320
+ return writer;
321
+ },
322
+ decode(input, length) {
323
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
324
+ const end = length === undefined ? reader.len : reader.pos + length;
325
+ const message = createBaseJTTQueryFileResponse_File();
326
+ while (reader.pos < end) {
327
+ const tag = reader.uint32();
328
+ switch (tag >>> 3) {
329
+ case 1: {
330
+ if (tag !== 8) {
331
+ break;
332
+ }
333
+ message.logicalNumber = reader.sint32();
334
+ continue;
335
+ }
336
+ case 2: {
337
+ if (tag !== 18) {
338
+ break;
339
+ }
340
+ message.startsAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
341
+ continue;
342
+ }
343
+ case 3: {
344
+ if (tag !== 26) {
345
+ break;
346
+ }
347
+ message.finishesAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
348
+ continue;
349
+ }
350
+ case 4: {
351
+ if (tag !== 32) {
352
+ break;
353
+ }
354
+ message.alarmSign = Long.fromString(reader.uint64().toString(), true);
355
+ continue;
356
+ }
357
+ case 5: {
358
+ if (tag !== 40) {
359
+ break;
360
+ }
361
+ message.audioVideoType = reader.sint32();
362
+ continue;
363
+ }
364
+ case 6: {
365
+ if (tag !== 48) {
366
+ break;
367
+ }
368
+ message.streamType = reader.sint32();
369
+ continue;
370
+ }
371
+ case 7: {
372
+ if (tag !== 56) {
373
+ break;
374
+ }
375
+ message.memoryType = reader.sint32();
376
+ continue;
377
+ }
378
+ case 8: {
379
+ if (tag !== 64) {
380
+ break;
381
+ }
382
+ message.fileSize = reader.uint32();
383
+ continue;
384
+ }
385
+ }
386
+ if ((tag & 7) === 4 || tag === 0) {
387
+ break;
388
+ }
389
+ reader.skip(tag & 7);
390
+ }
391
+ return message;
392
+ },
393
+ create(base) {
394
+ return JTTQueryFileResponse_File.fromPartial(base ?? {});
395
+ },
396
+ fromPartial(object) {
397
+ const message = createBaseJTTQueryFileResponse_File();
398
+ message.logicalNumber = object.logicalNumber ?? 0;
399
+ message.startsAt = object.startsAt ?? undefined;
400
+ message.finishesAt = object.finishesAt ?? undefined;
401
+ message.alarmSign = (object.alarmSign !== undefined && object.alarmSign !== null)
402
+ ? Long.fromValue(object.alarmSign)
403
+ : Long.UZERO;
404
+ message.audioVideoType = object.audioVideoType ?? 0;
405
+ message.streamType = object.streamType ?? 0;
406
+ message.memoryType = object.memoryType ?? 0;
407
+ message.fileSize = object.fileSize ?? 0;
408
+ return message;
409
+ },
410
+ };
411
+ function createBaseJTTLiveStatusUpdate() {
412
+ return { logicalNumber: 0, packetLose: 0 };
413
+ }
414
+ export const JTTLiveStatusUpdate = {
415
+ encode(message, writer = new BinaryWriter()) {
416
+ if (message.logicalNumber !== 0) {
417
+ writer.uint32(8).sint32(message.logicalNumber);
418
+ }
419
+ if (message.packetLose !== 0) {
420
+ writer.uint32(16).sint32(message.packetLose);
421
+ }
422
+ return writer;
423
+ },
424
+ decode(input, length) {
425
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
426
+ const end = length === undefined ? reader.len : reader.pos + length;
427
+ const message = createBaseJTTLiveStatusUpdate();
428
+ while (reader.pos < end) {
429
+ const tag = reader.uint32();
430
+ switch (tag >>> 3) {
431
+ case 1: {
432
+ if (tag !== 8) {
433
+ break;
434
+ }
435
+ message.logicalNumber = reader.sint32();
436
+ continue;
437
+ }
438
+ case 2: {
439
+ if (tag !== 16) {
440
+ break;
441
+ }
442
+ message.packetLose = reader.sint32();
443
+ continue;
444
+ }
445
+ }
446
+ if ((tag & 7) === 4 || tag === 0) {
447
+ break;
448
+ }
449
+ reader.skip(tag & 7);
450
+ }
451
+ return message;
452
+ },
453
+ create(base) {
454
+ return JTTLiveStatusUpdate.fromPartial(base ?? {});
455
+ },
456
+ fromPartial(object) {
457
+ const message = createBaseJTTLiveStatusUpdate();
458
+ message.logicalNumber = object.logicalNumber ?? 0;
459
+ message.packetLose = object.packetLose ?? 0;
460
+ return message;
461
+ },
462
+ };
463
+ function createBaseJTTLiveRequest() {
464
+ return { ip: "", tcp: 0, udp: 0, logicalNumber: 0, typeOfData: 0, streamType: 0 };
465
+ }
466
+ export const JTTLiveRequest = {
467
+ encode(message, writer = new BinaryWriter()) {
468
+ if (message.ip !== "") {
469
+ writer.uint32(10).string(message.ip);
470
+ }
471
+ if (message.tcp !== 0) {
472
+ writer.uint32(16).uint32(message.tcp);
473
+ }
474
+ if (message.udp !== 0) {
475
+ writer.uint32(24).uint32(message.udp);
476
+ }
477
+ if (message.logicalNumber !== 0) {
478
+ writer.uint32(32).sint32(message.logicalNumber);
479
+ }
480
+ if (message.typeOfData !== 0) {
481
+ writer.uint32(40).sint32(message.typeOfData);
482
+ }
483
+ if (message.streamType !== 0) {
484
+ writer.uint32(48).sint32(message.streamType);
485
+ }
486
+ return writer;
487
+ },
488
+ decode(input, length) {
489
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
490
+ const end = length === undefined ? reader.len : reader.pos + length;
491
+ const message = createBaseJTTLiveRequest();
492
+ while (reader.pos < end) {
493
+ const tag = reader.uint32();
494
+ switch (tag >>> 3) {
495
+ case 1: {
496
+ if (tag !== 10) {
497
+ break;
498
+ }
499
+ message.ip = reader.string();
500
+ continue;
501
+ }
502
+ case 2: {
503
+ if (tag !== 16) {
504
+ break;
505
+ }
506
+ message.tcp = reader.uint32();
507
+ continue;
508
+ }
509
+ case 3: {
510
+ if (tag !== 24) {
511
+ break;
512
+ }
513
+ message.udp = reader.uint32();
514
+ continue;
515
+ }
516
+ case 4: {
517
+ if (tag !== 32) {
518
+ break;
519
+ }
520
+ message.logicalNumber = reader.sint32();
521
+ continue;
522
+ }
523
+ case 5: {
524
+ if (tag !== 40) {
525
+ break;
526
+ }
527
+ message.typeOfData = reader.sint32();
528
+ continue;
529
+ }
530
+ case 6: {
531
+ if (tag !== 48) {
532
+ break;
533
+ }
534
+ message.streamType = reader.sint32();
535
+ continue;
536
+ }
537
+ }
538
+ if ((tag & 7) === 4 || tag === 0) {
539
+ break;
540
+ }
541
+ reader.skip(tag & 7);
542
+ }
543
+ return message;
544
+ },
545
+ create(base) {
546
+ return JTTLiveRequest.fromPartial(base ?? {});
547
+ },
548
+ fromPartial(object) {
549
+ const message = createBaseJTTLiveRequest();
550
+ message.ip = object.ip ?? "";
551
+ message.tcp = object.tcp ?? 0;
552
+ message.udp = object.udp ?? 0;
553
+ message.logicalNumber = object.logicalNumber ?? 0;
554
+ message.typeOfData = object.typeOfData ?? 0;
555
+ message.streamType = object.streamType ?? 0;
556
+ return message;
557
+ },
558
+ };
559
+ function createBaseJTTLiveUpdate() {
560
+ return { logicalNumber: 0, controlInstruction: 0, closeAudioVideo: 0, switchStream: 0 };
561
+ }
562
+ export const JTTLiveUpdate = {
563
+ encode(message, writer = new BinaryWriter()) {
564
+ if (message.logicalNumber !== 0) {
565
+ writer.uint32(8).sint32(message.logicalNumber);
566
+ }
567
+ if (message.controlInstruction !== 0) {
568
+ writer.uint32(16).sint32(message.controlInstruction);
569
+ }
570
+ if (message.closeAudioVideo !== 0) {
571
+ writer.uint32(24).sint32(message.closeAudioVideo);
572
+ }
573
+ if (message.switchStream !== 0) {
574
+ writer.uint32(32).sint32(message.switchStream);
575
+ }
576
+ return writer;
577
+ },
578
+ decode(input, length) {
579
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
580
+ const end = length === undefined ? reader.len : reader.pos + length;
581
+ const message = createBaseJTTLiveUpdate();
582
+ while (reader.pos < end) {
583
+ const tag = reader.uint32();
584
+ switch (tag >>> 3) {
585
+ case 1: {
586
+ if (tag !== 8) {
587
+ break;
588
+ }
589
+ message.logicalNumber = reader.sint32();
590
+ continue;
591
+ }
592
+ case 2: {
593
+ if (tag !== 16) {
594
+ break;
595
+ }
596
+ message.controlInstruction = reader.sint32();
597
+ continue;
598
+ }
599
+ case 3: {
600
+ if (tag !== 24) {
601
+ break;
602
+ }
603
+ message.closeAudioVideo = reader.sint32();
604
+ continue;
605
+ }
606
+ case 4: {
607
+ if (tag !== 32) {
608
+ break;
609
+ }
610
+ message.switchStream = reader.sint32();
611
+ continue;
612
+ }
613
+ }
614
+ if ((tag & 7) === 4 || tag === 0) {
615
+ break;
616
+ }
617
+ reader.skip(tag & 7);
618
+ }
619
+ return message;
620
+ },
621
+ create(base) {
622
+ return JTTLiveUpdate.fromPartial(base ?? {});
623
+ },
624
+ fromPartial(object) {
625
+ const message = createBaseJTTLiveUpdate();
626
+ message.logicalNumber = object.logicalNumber ?? 0;
627
+ message.controlInstruction = object.controlInstruction ?? 0;
628
+ message.closeAudioVideo = object.closeAudioVideo ?? 0;
629
+ message.switchStream = object.switchStream ?? 0;
630
+ return message;
631
+ },
632
+ };
633
+ function createBaseJTTQueryFileRequest() {
634
+ return {
635
+ logicalNumber: 0,
636
+ startsAt: undefined,
637
+ finishesAt: undefined,
638
+ alarmSign: Long.UZERO,
639
+ audioVideoType: 0,
640
+ streamType: 0,
641
+ memoryType: 0,
642
+ };
643
+ }
644
+ export const JTTQueryFileRequest = {
645
+ encode(message, writer = new BinaryWriter()) {
646
+ if (message.logicalNumber !== 0) {
647
+ writer.uint32(8).sint32(message.logicalNumber);
648
+ }
649
+ if (message.startsAt !== undefined) {
650
+ Timestamp.encode(toTimestamp(message.startsAt), writer.uint32(18).fork()).join();
651
+ }
652
+ if (message.finishesAt !== undefined) {
653
+ Timestamp.encode(toTimestamp(message.finishesAt), writer.uint32(26).fork()).join();
654
+ }
655
+ if (!message.alarmSign.equals(Long.UZERO)) {
656
+ writer.uint32(32).uint64(message.alarmSign.toString());
657
+ }
658
+ if (message.audioVideoType !== 0) {
659
+ writer.uint32(40).sint32(message.audioVideoType);
660
+ }
661
+ if (message.streamType !== 0) {
662
+ writer.uint32(48).sint32(message.streamType);
663
+ }
664
+ if (message.memoryType !== 0) {
665
+ writer.uint32(56).sint32(message.memoryType);
666
+ }
667
+ return writer;
668
+ },
669
+ decode(input, length) {
670
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
671
+ const end = length === undefined ? reader.len : reader.pos + length;
672
+ const message = createBaseJTTQueryFileRequest();
673
+ while (reader.pos < end) {
674
+ const tag = reader.uint32();
675
+ switch (tag >>> 3) {
676
+ case 1: {
677
+ if (tag !== 8) {
678
+ break;
679
+ }
680
+ message.logicalNumber = reader.sint32();
681
+ continue;
682
+ }
683
+ case 2: {
684
+ if (tag !== 18) {
685
+ break;
686
+ }
687
+ message.startsAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
688
+ continue;
689
+ }
690
+ case 3: {
691
+ if (tag !== 26) {
692
+ break;
693
+ }
694
+ message.finishesAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
695
+ continue;
696
+ }
697
+ case 4: {
698
+ if (tag !== 32) {
699
+ break;
700
+ }
701
+ message.alarmSign = Long.fromString(reader.uint64().toString(), true);
702
+ continue;
703
+ }
704
+ case 5: {
705
+ if (tag !== 40) {
706
+ break;
707
+ }
708
+ message.audioVideoType = reader.sint32();
709
+ continue;
710
+ }
711
+ case 6: {
712
+ if (tag !== 48) {
713
+ break;
714
+ }
715
+ message.streamType = reader.sint32();
716
+ continue;
717
+ }
718
+ case 7: {
719
+ if (tag !== 56) {
720
+ break;
721
+ }
722
+ message.memoryType = reader.sint32();
723
+ continue;
724
+ }
725
+ }
726
+ if ((tag & 7) === 4 || tag === 0) {
727
+ break;
728
+ }
729
+ reader.skip(tag & 7);
730
+ }
731
+ return message;
732
+ },
733
+ create(base) {
734
+ return JTTQueryFileRequest.fromPartial(base ?? {});
735
+ },
736
+ fromPartial(object) {
737
+ const message = createBaseJTTQueryFileRequest();
738
+ message.logicalNumber = object.logicalNumber ?? 0;
739
+ message.startsAt = object.startsAt ?? undefined;
740
+ message.finishesAt = object.finishesAt ?? undefined;
741
+ message.alarmSign = (object.alarmSign !== undefined && object.alarmSign !== null)
742
+ ? Long.fromValue(object.alarmSign)
743
+ : Long.UZERO;
744
+ message.audioVideoType = object.audioVideoType ?? 0;
745
+ message.streamType = object.streamType ?? 0;
746
+ message.memoryType = object.memoryType ?? 0;
747
+ return message;
748
+ },
749
+ };
750
+ function createBaseJTTPlaybackRequest() {
751
+ return { ip: "", tcp: 0, udp: 0, logicalNumber: 0, files: [] };
752
+ }
753
+ export const JTTPlaybackRequest = {
754
+ encode(message, writer = new BinaryWriter()) {
755
+ if (message.ip !== "") {
756
+ writer.uint32(10).string(message.ip);
757
+ }
758
+ if (message.tcp !== 0) {
759
+ writer.uint32(16).uint32(message.tcp);
760
+ }
761
+ if (message.udp !== 0) {
762
+ writer.uint32(24).uint32(message.udp);
763
+ }
764
+ if (message.logicalNumber !== 0) {
765
+ writer.uint32(32).sint32(message.logicalNumber);
766
+ }
767
+ for (const v of message.files) {
768
+ JTTPlaybackRequest_Files.encode(v, writer.uint32(42).fork()).join();
769
+ }
770
+ return writer;
771
+ },
772
+ decode(input, length) {
773
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
774
+ const end = length === undefined ? reader.len : reader.pos + length;
775
+ const message = createBaseJTTPlaybackRequest();
776
+ while (reader.pos < end) {
777
+ const tag = reader.uint32();
778
+ switch (tag >>> 3) {
779
+ case 1: {
780
+ if (tag !== 10) {
781
+ break;
782
+ }
783
+ message.ip = reader.string();
784
+ continue;
785
+ }
786
+ case 2: {
787
+ if (tag !== 16) {
788
+ break;
789
+ }
790
+ message.tcp = reader.uint32();
791
+ continue;
792
+ }
793
+ case 3: {
794
+ if (tag !== 24) {
795
+ break;
796
+ }
797
+ message.udp = reader.uint32();
798
+ continue;
799
+ }
800
+ case 4: {
801
+ if (tag !== 32) {
802
+ break;
803
+ }
804
+ message.logicalNumber = reader.sint32();
805
+ continue;
806
+ }
807
+ case 5: {
808
+ if (tag !== 42) {
809
+ break;
810
+ }
811
+ message.files.push(JTTPlaybackRequest_Files.decode(reader, reader.uint32()));
812
+ continue;
813
+ }
814
+ }
815
+ if ((tag & 7) === 4 || tag === 0) {
816
+ break;
817
+ }
818
+ reader.skip(tag & 7);
819
+ }
820
+ return message;
821
+ },
822
+ create(base) {
823
+ return JTTPlaybackRequest.fromPartial(base ?? {});
824
+ },
825
+ fromPartial(object) {
826
+ const message = createBaseJTTPlaybackRequest();
827
+ message.ip = object.ip ?? "";
828
+ message.tcp = object.tcp ?? 0;
829
+ message.udp = object.udp ?? 0;
830
+ message.logicalNumber = object.logicalNumber ?? 0;
831
+ message.files = object.files?.map((e) => JTTPlaybackRequest_Files.fromPartial(e)) || [];
832
+ return message;
833
+ },
834
+ };
835
+ function createBaseJTTPlaybackRequest_Files() {
836
+ return {
837
+ audioVideoType: 0,
838
+ streamType: 0,
839
+ memoryType: 0,
840
+ playbackMethod: 0,
841
+ fastForwardRewind: 0,
842
+ startsAt: undefined,
843
+ finishesAt: undefined,
844
+ };
845
+ }
846
+ export const JTTPlaybackRequest_Files = {
847
+ encode(message, writer = new BinaryWriter()) {
848
+ if (message.audioVideoType !== 0) {
849
+ writer.uint32(8).sint32(message.audioVideoType);
850
+ }
851
+ if (message.streamType !== 0) {
852
+ writer.uint32(16).sint32(message.streamType);
853
+ }
854
+ if (message.memoryType !== 0) {
855
+ writer.uint32(24).sint32(message.memoryType);
856
+ }
857
+ if (message.playbackMethod !== 0) {
858
+ writer.uint32(32).sint32(message.playbackMethod);
859
+ }
860
+ if (message.fastForwardRewind !== 0) {
861
+ writer.uint32(40).sint32(message.fastForwardRewind);
862
+ }
863
+ if (message.startsAt !== undefined) {
864
+ Timestamp.encode(toTimestamp(message.startsAt), writer.uint32(50).fork()).join();
865
+ }
866
+ if (message.finishesAt !== undefined) {
867
+ Timestamp.encode(toTimestamp(message.finishesAt), writer.uint32(58).fork()).join();
868
+ }
869
+ return writer;
870
+ },
871
+ decode(input, length) {
872
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
873
+ const end = length === undefined ? reader.len : reader.pos + length;
874
+ const message = createBaseJTTPlaybackRequest_Files();
875
+ while (reader.pos < end) {
876
+ const tag = reader.uint32();
877
+ switch (tag >>> 3) {
878
+ case 1: {
879
+ if (tag !== 8) {
880
+ break;
881
+ }
882
+ message.audioVideoType = reader.sint32();
883
+ continue;
884
+ }
885
+ case 2: {
886
+ if (tag !== 16) {
887
+ break;
888
+ }
889
+ message.streamType = reader.sint32();
890
+ continue;
891
+ }
892
+ case 3: {
893
+ if (tag !== 24) {
894
+ break;
895
+ }
896
+ message.memoryType = reader.sint32();
897
+ continue;
898
+ }
899
+ case 4: {
900
+ if (tag !== 32) {
901
+ break;
902
+ }
903
+ message.playbackMethod = reader.sint32();
904
+ continue;
905
+ }
906
+ case 5: {
907
+ if (tag !== 40) {
908
+ break;
909
+ }
910
+ message.fastForwardRewind = reader.sint32();
911
+ continue;
912
+ }
913
+ case 6: {
914
+ if (tag !== 50) {
915
+ break;
916
+ }
917
+ message.startsAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
918
+ continue;
919
+ }
920
+ case 7: {
921
+ if (tag !== 58) {
922
+ break;
923
+ }
924
+ message.finishesAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
925
+ continue;
926
+ }
927
+ }
928
+ if ((tag & 7) === 4 || tag === 0) {
929
+ break;
930
+ }
931
+ reader.skip(tag & 7);
932
+ }
933
+ return message;
934
+ },
935
+ create(base) {
936
+ return JTTPlaybackRequest_Files.fromPartial(base ?? {});
937
+ },
938
+ fromPartial(object) {
939
+ const message = createBaseJTTPlaybackRequest_Files();
940
+ message.audioVideoType = object.audioVideoType ?? 0;
941
+ message.streamType = object.streamType ?? 0;
942
+ message.memoryType = object.memoryType ?? 0;
943
+ message.playbackMethod = object.playbackMethod ?? 0;
944
+ message.fastForwardRewind = object.fastForwardRewind ?? 0;
945
+ message.startsAt = object.startsAt ?? undefined;
946
+ message.finishesAt = object.finishesAt ?? undefined;
947
+ return message;
948
+ },
949
+ };
950
+ function createBaseRequestAlertMediaUpload() {
951
+ return {
952
+ ip: "",
953
+ tcp: 0,
954
+ udp: 0,
955
+ alarmId: new Uint8Array(0),
956
+ deviceId: Long.UZERO,
957
+ gpsTime: undefined,
958
+ reserve: new Uint8Array(0),
959
+ };
960
+ }
961
+ export const RequestAlertMediaUpload = {
962
+ encode(message, writer = new BinaryWriter()) {
963
+ if (message.ip !== "") {
964
+ writer.uint32(10).string(message.ip);
965
+ }
966
+ if (message.tcp !== 0) {
967
+ writer.uint32(16).uint32(message.tcp);
968
+ }
969
+ if (message.udp !== 0) {
970
+ writer.uint32(24).uint32(message.udp);
971
+ }
972
+ if (message.alarmId.length !== 0) {
973
+ writer.uint32(34).bytes(message.alarmId);
974
+ }
975
+ if (!message.deviceId.equals(Long.UZERO)) {
976
+ writer.uint32(40).uint64(message.deviceId.toString());
977
+ }
978
+ if (message.gpsTime !== undefined) {
979
+ Timestamp.encode(toTimestamp(message.gpsTime), writer.uint32(50).fork()).join();
980
+ }
981
+ if (message.reserve.length !== 0) {
982
+ writer.uint32(58).bytes(message.reserve);
983
+ }
984
+ return writer;
985
+ },
986
+ decode(input, length) {
987
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
988
+ const end = length === undefined ? reader.len : reader.pos + length;
989
+ const message = createBaseRequestAlertMediaUpload();
990
+ while (reader.pos < end) {
991
+ const tag = reader.uint32();
992
+ switch (tag >>> 3) {
993
+ case 1: {
994
+ if (tag !== 10) {
995
+ break;
996
+ }
997
+ message.ip = reader.string();
998
+ continue;
999
+ }
1000
+ case 2: {
1001
+ if (tag !== 16) {
1002
+ break;
1003
+ }
1004
+ message.tcp = reader.uint32();
1005
+ continue;
1006
+ }
1007
+ case 3: {
1008
+ if (tag !== 24) {
1009
+ break;
1010
+ }
1011
+ message.udp = reader.uint32();
1012
+ continue;
1013
+ }
1014
+ case 4: {
1015
+ if (tag !== 34) {
1016
+ break;
1017
+ }
1018
+ message.alarmId = reader.bytes();
1019
+ continue;
1020
+ }
1021
+ case 5: {
1022
+ if (tag !== 40) {
1023
+ break;
1024
+ }
1025
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
1026
+ continue;
1027
+ }
1028
+ case 6: {
1029
+ if (tag !== 50) {
1030
+ break;
1031
+ }
1032
+ message.gpsTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1033
+ continue;
1034
+ }
1035
+ case 7: {
1036
+ if (tag !== 58) {
1037
+ break;
1038
+ }
1039
+ message.reserve = reader.bytes();
1040
+ continue;
1041
+ }
1042
+ }
1043
+ if ((tag & 7) === 4 || tag === 0) {
1044
+ break;
1045
+ }
1046
+ reader.skip(tag & 7);
1047
+ }
1048
+ return message;
1049
+ },
1050
+ create(base) {
1051
+ return RequestAlertMediaUpload.fromPartial(base ?? {});
1052
+ },
1053
+ fromPartial(object) {
1054
+ const message = createBaseRequestAlertMediaUpload();
1055
+ message.ip = object.ip ?? "";
1056
+ message.tcp = object.tcp ?? 0;
1057
+ message.udp = object.udp ?? 0;
1058
+ message.alarmId = object.alarmId ?? new Uint8Array(0);
1059
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
1060
+ ? Long.fromValue(object.deviceId)
1061
+ : Long.UZERO;
1062
+ message.gpsTime = object.gpsTime ?? undefined;
1063
+ message.reserve = object.reserve ?? new Uint8Array(0);
1064
+ return message;
1065
+ },
1066
+ };
1067
+ function toTimestamp(date) {
1068
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
1069
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1070
+ return { seconds, nanos };
1071
+ }
1072
+ function fromTimestamp(t) {
1073
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
1074
+ millis += (t.nanos || 0) / 1_000_000;
1075
+ return new globalThis.Date(millis);
1076
+ }
1077
+ function numberToLong(number) {
1078
+ return Long.fromNumber(number);
1079
+ }