@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,1416 @@
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: stream/stream.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.stream";
11
+ /** JTT device stream type */
12
+ export var JTTStreamType;
13
+ (function (JTTStreamType) {
14
+ JTTStreamType[JTTStreamType["MAIN_STREAM"] = 0] = "MAIN_STREAM";
15
+ JTTStreamType[JTTStreamType["SUB_STREAM"] = 1] = "SUB_STREAM";
16
+ JTTStreamType[JTTStreamType["ALL_STREAM"] = 2] = "ALL_STREAM";
17
+ JTTStreamType[JTTStreamType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(JTTStreamType || (JTTStreamType = {}));
19
+ /** JTT device available resource types */
20
+ export var JTTResourceType;
21
+ (function (JTTResourceType) {
22
+ /** AUDIO_VIDEO_RESOURCE_TYPE - Close the audio and video data related to this channel; */
23
+ JTTResourceType[JTTResourceType["AUDIO_VIDEO_RESOURCE_TYPE"] = 0] = "AUDIO_VIDEO_RESOURCE_TYPE";
24
+ /** AUDIO_RESOURCE_TYPE - only turn off the audio related to this channel, and keep the video related to this channel */
25
+ JTTResourceType[JTTResourceType["AUDIO_RESOURCE_TYPE"] = 1] = "AUDIO_RESOURCE_TYPE";
26
+ /** VIDEO_RESOURCE_TYPE - only turn off the video related to this channel, and keep the audio related to this channel */
27
+ JTTResourceType[JTTResourceType["VIDEO_RESOURCE_TYPE"] = 2] = "VIDEO_RESOURCE_TYPE";
28
+ /** UNSPECIFIED_RESOURCE_TYPE - audio and video or audio only or video only */
29
+ JTTResourceType[JTTResourceType["UNSPECIFIED_RESOURCE_TYPE"] = 3] = "UNSPECIFIED_RESOURCE_TYPE";
30
+ JTTResourceType[JTTResourceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
31
+ })(JTTResourceType || (JTTResourceType = {}));
32
+ export var JTTMemoryType;
33
+ (function (JTTMemoryType) {
34
+ JTTMemoryType[JTTMemoryType["UNSPECIFIED_MEMORY"] = 0] = "UNSPECIFIED_MEMORY";
35
+ JTTMemoryType[JTTMemoryType["MAIN_MEMORY"] = 1] = "MAIN_MEMORY";
36
+ JTTMemoryType[JTTMemoryType["DISASTER_MEMORY"] = 2] = "DISASTER_MEMORY";
37
+ JTTMemoryType[JTTMemoryType["ALL_MEMORY"] = 3] = "ALL_MEMORY";
38
+ JTTMemoryType[JTTMemoryType["BACKUP_MEMORY"] = 4] = "BACKUP_MEMORY";
39
+ JTTMemoryType[JTTMemoryType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
40
+ })(JTTMemoryType || (JTTMemoryType = {}));
41
+ export var JTTPlaybackMethod;
42
+ (function (JTTPlaybackMethod) {
43
+ JTTPlaybackMethod[JTTPlaybackMethod["NORMAL_PLAYBACK"] = 0] = "NORMAL_PLAYBACK";
44
+ JTTPlaybackMethod[JTTPlaybackMethod["FAST_FORWARD_PLAYBACK"] = 1] = "FAST_FORWARD_PLAYBACK";
45
+ JTTPlaybackMethod[JTTPlaybackMethod["KEY_FRAME_REWIND_PLAYBACK"] = 2] = "KEY_FRAME_REWIND_PLAYBACK";
46
+ JTTPlaybackMethod[JTTPlaybackMethod["KEY_FRAME_PLAYBACK"] = 3] = "KEY_FRAME_PLAYBACK";
47
+ JTTPlaybackMethod[JTTPlaybackMethod["SINGLE_FRAME_PLAYBACK"] = 4] = "SINGLE_FRAME_PLAYBACK";
48
+ JTTPlaybackMethod[JTTPlaybackMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
49
+ })(JTTPlaybackMethod || (JTTPlaybackMethod = {}));
50
+ export var Control;
51
+ (function (Control) {
52
+ Control[Control["START_CONTROL"] = 0] = "START_CONTROL";
53
+ Control[Control["PAUSE_CONTROL"] = 1] = "PAUSE_CONTROL";
54
+ Control[Control["CLOSE_CONTROL"] = 2] = "CLOSE_CONTROL";
55
+ Control[Control["FAST_FORWARD_CONTROL"] = 3] = "FAST_FORWARD_CONTROL";
56
+ Control[Control["REWIND_CONTROL"] = 4] = "REWIND_CONTROL";
57
+ Control[Control["DRAG_CONTROL"] = 5] = "DRAG_CONTROL";
58
+ Control[Control["KEY_FRAME_CONTROL"] = 6] = "KEY_FRAME_CONTROL";
59
+ Control[Control["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
60
+ })(Control || (Control = {}));
61
+ export var PlaySpeed;
62
+ (function (PlaySpeed) {
63
+ PlaySpeed[PlaySpeed["X1_SPEED"] = 0] = "X1_SPEED";
64
+ PlaySpeed[PlaySpeed["X2_SPEED"] = 1] = "X2_SPEED";
65
+ PlaySpeed[PlaySpeed["X4_SPEED"] = 2] = "X4_SPEED";
66
+ PlaySpeed[PlaySpeed["X8_SPEED"] = 3] = "X8_SPEED";
67
+ PlaySpeed[PlaySpeed["X16_SPEED"] = 4] = "X16_SPEED";
68
+ PlaySpeed[PlaySpeed["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
69
+ })(PlaySpeed || (PlaySpeed = {}));
70
+ export var LiveRequest_JTT_TypeOfData;
71
+ (function (LiveRequest_JTT_TypeOfData) {
72
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["AUDIO_VIDEO"] = 0] = "AUDIO_VIDEO";
73
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["VIDEO"] = 1] = "VIDEO";
74
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["TWO_WAY_INTERCOM"] = 2] = "TWO_WAY_INTERCOM";
75
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["MONITOR"] = 3] = "MONITOR";
76
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["CENTRAL_BROADCAST"] = 4] = "CENTRAL_BROADCAST";
77
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["TRANSPARENT"] = 5] = "TRANSPARENT";
78
+ LiveRequest_JTT_TypeOfData[LiveRequest_JTT_TypeOfData["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
79
+ })(LiveRequest_JTT_TypeOfData || (LiveRequest_JTT_TypeOfData = {}));
80
+ export var PlaybackUpdateState_State;
81
+ (function (PlaybackUpdateState_State) {
82
+ PlaybackUpdateState_State[PlaybackUpdateState_State["UNSPECIFIED"] = 0] = "UNSPECIFIED";
83
+ PlaybackUpdateState_State[PlaybackUpdateState_State["PAUSE"] = 1] = "PAUSE";
84
+ PlaybackUpdateState_State[PlaybackUpdateState_State["PLAY"] = 2] = "PLAY";
85
+ PlaybackUpdateState_State[PlaybackUpdateState_State["STOP"] = 3] = "STOP";
86
+ PlaybackUpdateState_State[PlaybackUpdateState_State["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
87
+ })(PlaybackUpdateState_State || (PlaybackUpdateState_State = {}));
88
+ function createBaseRequest() {
89
+ return {
90
+ deviceId: Long.UZERO,
91
+ protocol: 0,
92
+ live: undefined,
93
+ update: undefined,
94
+ playback: undefined,
95
+ queryFiles: undefined,
96
+ playbackUpdateState: undefined,
97
+ playbackUpdateCurrentTime: undefined,
98
+ };
99
+ }
100
+ export const Request = {
101
+ encode(message, writer = new BinaryWriter()) {
102
+ if (!message.deviceId.equals(Long.UZERO)) {
103
+ writer.uint32(8).uint64(message.deviceId.toString());
104
+ }
105
+ if (message.protocol !== 0) {
106
+ writer.uint32(16).int32(message.protocol);
107
+ }
108
+ if (message.live !== undefined) {
109
+ LiveRequest.encode(message.live, writer.uint32(90).fork()).join();
110
+ }
111
+ if (message.update !== undefined) {
112
+ LiveUpdateRequest.encode(message.update, writer.uint32(98).fork()).join();
113
+ }
114
+ if (message.playback !== undefined) {
115
+ PlaybackRequest.encode(message.playback, writer.uint32(106).fork()).join();
116
+ }
117
+ if (message.queryFiles !== undefined) {
118
+ FileListQueryRequest.encode(message.queryFiles, writer.uint32(114).fork()).join();
119
+ }
120
+ if (message.playbackUpdateState !== undefined) {
121
+ PlaybackUpdateState.encode(message.playbackUpdateState, writer.uint32(122).fork()).join();
122
+ }
123
+ if (message.playbackUpdateCurrentTime !== undefined) {
124
+ PlaybackUpdateCurrentTime.encode(message.playbackUpdateCurrentTime, writer.uint32(130).fork()).join();
125
+ }
126
+ return writer;
127
+ },
128
+ decode(input, length) {
129
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
130
+ const end = length === undefined ? reader.len : reader.pos + length;
131
+ const message = createBaseRequest();
132
+ while (reader.pos < end) {
133
+ const tag = reader.uint32();
134
+ switch (tag >>> 3) {
135
+ case 1: {
136
+ if (tag !== 8) {
137
+ break;
138
+ }
139
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
140
+ continue;
141
+ }
142
+ case 2: {
143
+ if (tag !== 16) {
144
+ break;
145
+ }
146
+ message.protocol = reader.int32();
147
+ continue;
148
+ }
149
+ case 11: {
150
+ if (tag !== 90) {
151
+ break;
152
+ }
153
+ message.live = LiveRequest.decode(reader, reader.uint32());
154
+ continue;
155
+ }
156
+ case 12: {
157
+ if (tag !== 98) {
158
+ break;
159
+ }
160
+ message.update = LiveUpdateRequest.decode(reader, reader.uint32());
161
+ continue;
162
+ }
163
+ case 13: {
164
+ if (tag !== 106) {
165
+ break;
166
+ }
167
+ message.playback = PlaybackRequest.decode(reader, reader.uint32());
168
+ continue;
169
+ }
170
+ case 14: {
171
+ if (tag !== 114) {
172
+ break;
173
+ }
174
+ message.queryFiles = FileListQueryRequest.decode(reader, reader.uint32());
175
+ continue;
176
+ }
177
+ case 15: {
178
+ if (tag !== 122) {
179
+ break;
180
+ }
181
+ message.playbackUpdateState = PlaybackUpdateState.decode(reader, reader.uint32());
182
+ continue;
183
+ }
184
+ case 16: {
185
+ if (tag !== 130) {
186
+ break;
187
+ }
188
+ message.playbackUpdateCurrentTime = PlaybackUpdateCurrentTime.decode(reader, reader.uint32());
189
+ continue;
190
+ }
191
+ }
192
+ if ((tag & 7) === 4 || tag === 0) {
193
+ break;
194
+ }
195
+ reader.skip(tag & 7);
196
+ }
197
+ return message;
198
+ },
199
+ create(base) {
200
+ return Request.fromPartial(base ?? {});
201
+ },
202
+ fromPartial(object) {
203
+ const message = createBaseRequest();
204
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
205
+ ? Long.fromValue(object.deviceId)
206
+ : Long.UZERO;
207
+ message.protocol = object.protocol ?? 0;
208
+ message.live = (object.live !== undefined && object.live !== null)
209
+ ? LiveRequest.fromPartial(object.live)
210
+ : undefined;
211
+ message.update = (object.update !== undefined && object.update !== null)
212
+ ? LiveUpdateRequest.fromPartial(object.update)
213
+ : undefined;
214
+ message.playback = (object.playback !== undefined && object.playback !== null)
215
+ ? PlaybackRequest.fromPartial(object.playback)
216
+ : undefined;
217
+ message.queryFiles = (object.queryFiles !== undefined && object.queryFiles !== null)
218
+ ? FileListQueryRequest.fromPartial(object.queryFiles)
219
+ : undefined;
220
+ message.playbackUpdateState = (object.playbackUpdateState !== undefined && object.playbackUpdateState !== null)
221
+ ? PlaybackUpdateState.fromPartial(object.playbackUpdateState)
222
+ : undefined;
223
+ message.playbackUpdateCurrentTime =
224
+ (object.playbackUpdateCurrentTime !== undefined && object.playbackUpdateCurrentTime !== null)
225
+ ? PlaybackUpdateCurrentTime.fromPartial(object.playbackUpdateCurrentTime)
226
+ : undefined;
227
+ return message;
228
+ },
229
+ };
230
+ function createBaseExceptionResponse() {
231
+ return { message: "", stacktrace: undefined };
232
+ }
233
+ export const ExceptionResponse = {
234
+ encode(message, writer = new BinaryWriter()) {
235
+ if (message.message !== "") {
236
+ writer.uint32(10).string(message.message);
237
+ }
238
+ if (message.stacktrace !== undefined) {
239
+ writer.uint32(18).string(message.stacktrace);
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 = createBaseExceptionResponse();
247
+ while (reader.pos < end) {
248
+ const tag = reader.uint32();
249
+ switch (tag >>> 3) {
250
+ case 1: {
251
+ if (tag !== 10) {
252
+ break;
253
+ }
254
+ message.message = reader.string();
255
+ continue;
256
+ }
257
+ case 2: {
258
+ if (tag !== 18) {
259
+ break;
260
+ }
261
+ message.stacktrace = reader.string();
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 ExceptionResponse.fromPartial(base ?? {});
274
+ },
275
+ fromPartial(object) {
276
+ const message = createBaseExceptionResponse();
277
+ message.message = object.message ?? "";
278
+ message.stacktrace = object.stacktrace ?? undefined;
279
+ return message;
280
+ },
281
+ };
282
+ function createBaseResponse() {
283
+ return {
284
+ deviceId: Long.UZERO,
285
+ liveStatusUpdates: undefined,
286
+ files: undefined,
287
+ rawMessage: undefined,
288
+ exception: undefined,
289
+ };
290
+ }
291
+ export const Response = {
292
+ encode(message, writer = new BinaryWriter()) {
293
+ if (!message.deviceId.equals(Long.UZERO)) {
294
+ writer.uint32(8).uint64(message.deviceId.toString());
295
+ }
296
+ if (message.liveStatusUpdates !== undefined) {
297
+ LiveStatusResponse.encode(message.liveStatusUpdates, writer.uint32(90).fork()).join();
298
+ }
299
+ if (message.files !== undefined) {
300
+ FileListQueryResponse.encode(message.files, writer.uint32(98).fork()).join();
301
+ }
302
+ if (message.rawMessage !== undefined) {
303
+ writer.uint32(106).string(message.rawMessage);
304
+ }
305
+ if (message.exception !== undefined) {
306
+ ExceptionResponse.encode(message.exception, writer.uint32(114).fork()).join();
307
+ }
308
+ return writer;
309
+ },
310
+ decode(input, length) {
311
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
312
+ const end = length === undefined ? reader.len : reader.pos + length;
313
+ const message = createBaseResponse();
314
+ while (reader.pos < end) {
315
+ const tag = reader.uint32();
316
+ switch (tag >>> 3) {
317
+ case 1: {
318
+ if (tag !== 8) {
319
+ break;
320
+ }
321
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
322
+ continue;
323
+ }
324
+ case 11: {
325
+ if (tag !== 90) {
326
+ break;
327
+ }
328
+ message.liveStatusUpdates = LiveStatusResponse.decode(reader, reader.uint32());
329
+ continue;
330
+ }
331
+ case 12: {
332
+ if (tag !== 98) {
333
+ break;
334
+ }
335
+ message.files = FileListQueryResponse.decode(reader, reader.uint32());
336
+ continue;
337
+ }
338
+ case 13: {
339
+ if (tag !== 106) {
340
+ break;
341
+ }
342
+ message.rawMessage = reader.string();
343
+ continue;
344
+ }
345
+ case 14: {
346
+ if (tag !== 114) {
347
+ break;
348
+ }
349
+ message.exception = ExceptionResponse.decode(reader, reader.uint32());
350
+ continue;
351
+ }
352
+ }
353
+ if ((tag & 7) === 4 || tag === 0) {
354
+ break;
355
+ }
356
+ reader.skip(tag & 7);
357
+ }
358
+ return message;
359
+ },
360
+ create(base) {
361
+ return Response.fromPartial(base ?? {});
362
+ },
363
+ fromPartial(object) {
364
+ const message = createBaseResponse();
365
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
366
+ ? Long.fromValue(object.deviceId)
367
+ : Long.UZERO;
368
+ message.liveStatusUpdates = (object.liveStatusUpdates !== undefined && object.liveStatusUpdates !== null)
369
+ ? LiveStatusResponse.fromPartial(object.liveStatusUpdates)
370
+ : undefined;
371
+ message.files = (object.files !== undefined && object.files !== null)
372
+ ? FileListQueryResponse.fromPartial(object.files)
373
+ : undefined;
374
+ message.rawMessage = object.rawMessage ?? undefined;
375
+ message.exception = (object.exception !== undefined && object.exception !== null)
376
+ ? ExceptionResponse.fromPartial(object.exception)
377
+ : undefined;
378
+ return message;
379
+ },
380
+ };
381
+ function createBaseServer() {
382
+ return { serverIp: "", serverTcpPort: 0, serverUdpPort: 0 };
383
+ }
384
+ export const Server = {
385
+ encode(message, writer = new BinaryWriter()) {
386
+ if (message.serverIp !== "") {
387
+ writer.uint32(10).string(message.serverIp);
388
+ }
389
+ if (message.serverTcpPort !== 0) {
390
+ writer.uint32(16).uint32(message.serverTcpPort);
391
+ }
392
+ if (message.serverUdpPort !== 0) {
393
+ writer.uint32(24).uint32(message.serverUdpPort);
394
+ }
395
+ return writer;
396
+ },
397
+ decode(input, length) {
398
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
399
+ const end = length === undefined ? reader.len : reader.pos + length;
400
+ const message = createBaseServer();
401
+ while (reader.pos < end) {
402
+ const tag = reader.uint32();
403
+ switch (tag >>> 3) {
404
+ case 1: {
405
+ if (tag !== 10) {
406
+ break;
407
+ }
408
+ message.serverIp = reader.string();
409
+ continue;
410
+ }
411
+ case 2: {
412
+ if (tag !== 16) {
413
+ break;
414
+ }
415
+ message.serverTcpPort = reader.uint32();
416
+ continue;
417
+ }
418
+ case 3: {
419
+ if (tag !== 24) {
420
+ break;
421
+ }
422
+ message.serverUdpPort = reader.uint32();
423
+ continue;
424
+ }
425
+ }
426
+ if ((tag & 7) === 4 || tag === 0) {
427
+ break;
428
+ }
429
+ reader.skip(tag & 7);
430
+ }
431
+ return message;
432
+ },
433
+ create(base) {
434
+ return Server.fromPartial(base ?? {});
435
+ },
436
+ fromPartial(object) {
437
+ const message = createBaseServer();
438
+ message.serverIp = object.serverIp ?? "";
439
+ message.serverTcpPort = object.serverTcpPort ?? 0;
440
+ message.serverUdpPort = object.serverUdpPort ?? 0;
441
+ return message;
442
+ },
443
+ };
444
+ function createBaseLiveRequest() {
445
+ return { cameraId: 0, server: undefined, jtt: undefined };
446
+ }
447
+ export const LiveRequest = {
448
+ encode(message, writer = new BinaryWriter()) {
449
+ if (message.cameraId !== 0) {
450
+ writer.uint32(8).sint32(message.cameraId);
451
+ }
452
+ if (message.server !== undefined) {
453
+ Server.encode(message.server, writer.uint32(18).fork()).join();
454
+ }
455
+ if (message.jtt !== undefined) {
456
+ LiveRequest_JTT.encode(message.jtt, writer.uint32(90).fork()).join();
457
+ }
458
+ return writer;
459
+ },
460
+ decode(input, length) {
461
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
462
+ const end = length === undefined ? reader.len : reader.pos + length;
463
+ const message = createBaseLiveRequest();
464
+ while (reader.pos < end) {
465
+ const tag = reader.uint32();
466
+ switch (tag >>> 3) {
467
+ case 1: {
468
+ if (tag !== 8) {
469
+ break;
470
+ }
471
+ message.cameraId = reader.sint32();
472
+ continue;
473
+ }
474
+ case 2: {
475
+ if (tag !== 18) {
476
+ break;
477
+ }
478
+ message.server = Server.decode(reader, reader.uint32());
479
+ continue;
480
+ }
481
+ case 11: {
482
+ if (tag !== 90) {
483
+ break;
484
+ }
485
+ message.jtt = LiveRequest_JTT.decode(reader, reader.uint32());
486
+ continue;
487
+ }
488
+ }
489
+ if ((tag & 7) === 4 || tag === 0) {
490
+ break;
491
+ }
492
+ reader.skip(tag & 7);
493
+ }
494
+ return message;
495
+ },
496
+ create(base) {
497
+ return LiveRequest.fromPartial(base ?? {});
498
+ },
499
+ fromPartial(object) {
500
+ const message = createBaseLiveRequest();
501
+ message.cameraId = object.cameraId ?? 0;
502
+ message.server = (object.server !== undefined && object.server !== null)
503
+ ? Server.fromPartial(object.server)
504
+ : undefined;
505
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
506
+ ? LiveRequest_JTT.fromPartial(object.jtt)
507
+ : undefined;
508
+ return message;
509
+ },
510
+ };
511
+ function createBaseLiveRequest_JTT() {
512
+ return { typeOfData: 0, streamType: 0 };
513
+ }
514
+ export const LiveRequest_JTT = {
515
+ encode(message, writer = new BinaryWriter()) {
516
+ if (message.typeOfData !== 0) {
517
+ writer.uint32(8).int32(message.typeOfData);
518
+ }
519
+ if (message.streamType !== 0) {
520
+ writer.uint32(16).int32(message.streamType);
521
+ }
522
+ return writer;
523
+ },
524
+ decode(input, length) {
525
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
526
+ const end = length === undefined ? reader.len : reader.pos + length;
527
+ const message = createBaseLiveRequest_JTT();
528
+ while (reader.pos < end) {
529
+ const tag = reader.uint32();
530
+ switch (tag >>> 3) {
531
+ case 1: {
532
+ if (tag !== 8) {
533
+ break;
534
+ }
535
+ message.typeOfData = reader.int32();
536
+ continue;
537
+ }
538
+ case 2: {
539
+ if (tag !== 16) {
540
+ break;
541
+ }
542
+ message.streamType = reader.int32();
543
+ continue;
544
+ }
545
+ }
546
+ if ((tag & 7) === 4 || tag === 0) {
547
+ break;
548
+ }
549
+ reader.skip(tag & 7);
550
+ }
551
+ return message;
552
+ },
553
+ create(base) {
554
+ return LiveRequest_JTT.fromPartial(base ?? {});
555
+ },
556
+ fromPartial(object) {
557
+ const message = createBaseLiveRequest_JTT();
558
+ message.typeOfData = object.typeOfData ?? 0;
559
+ message.streamType = object.streamType ?? 0;
560
+ return message;
561
+ },
562
+ };
563
+ function createBaseLiveUpdateRequest() {
564
+ return { cameraId: 0, jtt: undefined };
565
+ }
566
+ export const LiveUpdateRequest = {
567
+ encode(message, writer = new BinaryWriter()) {
568
+ if (message.cameraId !== 0) {
569
+ writer.uint32(8).sint32(message.cameraId);
570
+ }
571
+ if (message.jtt !== undefined) {
572
+ LiveUpdateRequest_JTT.encode(message.jtt, writer.uint32(90).fork()).join();
573
+ }
574
+ return writer;
575
+ },
576
+ decode(input, length) {
577
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
578
+ const end = length === undefined ? reader.len : reader.pos + length;
579
+ const message = createBaseLiveUpdateRequest();
580
+ while (reader.pos < end) {
581
+ const tag = reader.uint32();
582
+ switch (tag >>> 3) {
583
+ case 1: {
584
+ if (tag !== 8) {
585
+ break;
586
+ }
587
+ message.cameraId = reader.sint32();
588
+ continue;
589
+ }
590
+ case 11: {
591
+ if (tag !== 90) {
592
+ break;
593
+ }
594
+ message.jtt = LiveUpdateRequest_JTT.decode(reader, reader.uint32());
595
+ continue;
596
+ }
597
+ }
598
+ if ((tag & 7) === 4 || tag === 0) {
599
+ break;
600
+ }
601
+ reader.skip(tag & 7);
602
+ }
603
+ return message;
604
+ },
605
+ create(base) {
606
+ return LiveUpdateRequest.fromPartial(base ?? {});
607
+ },
608
+ fromPartial(object) {
609
+ const message = createBaseLiveUpdateRequest();
610
+ message.cameraId = object.cameraId ?? 0;
611
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
612
+ ? LiveUpdateRequest_JTT.fromPartial(object.jtt)
613
+ : undefined;
614
+ return message;
615
+ },
616
+ };
617
+ function createBaseLiveUpdateRequest_JTT() {
618
+ return { closeAudioVideoType: 0, streamType: 0 };
619
+ }
620
+ export const LiveUpdateRequest_JTT = {
621
+ encode(message, writer = new BinaryWriter()) {
622
+ if (message.closeAudioVideoType !== 0) {
623
+ writer.uint32(8).int32(message.closeAudioVideoType);
624
+ }
625
+ if (message.streamType !== 0) {
626
+ writer.uint32(16).int32(message.streamType);
627
+ }
628
+ return writer;
629
+ },
630
+ decode(input, length) {
631
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
632
+ const end = length === undefined ? reader.len : reader.pos + length;
633
+ const message = createBaseLiveUpdateRequest_JTT();
634
+ while (reader.pos < end) {
635
+ const tag = reader.uint32();
636
+ switch (tag >>> 3) {
637
+ case 1: {
638
+ if (tag !== 8) {
639
+ break;
640
+ }
641
+ message.closeAudioVideoType = reader.int32();
642
+ continue;
643
+ }
644
+ case 2: {
645
+ if (tag !== 16) {
646
+ break;
647
+ }
648
+ message.streamType = reader.int32();
649
+ continue;
650
+ }
651
+ }
652
+ if ((tag & 7) === 4 || tag === 0) {
653
+ break;
654
+ }
655
+ reader.skip(tag & 7);
656
+ }
657
+ return message;
658
+ },
659
+ create(base) {
660
+ return LiveUpdateRequest_JTT.fromPartial(base ?? {});
661
+ },
662
+ fromPartial(object) {
663
+ const message = createBaseLiveUpdateRequest_JTT();
664
+ message.closeAudioVideoType = object.closeAudioVideoType ?? 0;
665
+ message.streamType = object.streamType ?? 0;
666
+ return message;
667
+ },
668
+ };
669
+ function createBaseLiveStatusResponse() {
670
+ return { jtt: undefined };
671
+ }
672
+ export const LiveStatusResponse = {
673
+ encode(message, writer = new BinaryWriter()) {
674
+ if (message.jtt !== undefined) {
675
+ LiveStatusResponse_JTT.encode(message.jtt, writer.uint32(10).fork()).join();
676
+ }
677
+ return writer;
678
+ },
679
+ decode(input, length) {
680
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
681
+ const end = length === undefined ? reader.len : reader.pos + length;
682
+ const message = createBaseLiveStatusResponse();
683
+ while (reader.pos < end) {
684
+ const tag = reader.uint32();
685
+ switch (tag >>> 3) {
686
+ case 1: {
687
+ if (tag !== 10) {
688
+ break;
689
+ }
690
+ message.jtt = LiveStatusResponse_JTT.decode(reader, reader.uint32());
691
+ continue;
692
+ }
693
+ }
694
+ if ((tag & 7) === 4 || tag === 0) {
695
+ break;
696
+ }
697
+ reader.skip(tag & 7);
698
+ }
699
+ return message;
700
+ },
701
+ create(base) {
702
+ return LiveStatusResponse.fromPartial(base ?? {});
703
+ },
704
+ fromPartial(object) {
705
+ const message = createBaseLiveStatusResponse();
706
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
707
+ ? LiveStatusResponse_JTT.fromPartial(object.jtt)
708
+ : undefined;
709
+ return message;
710
+ },
711
+ };
712
+ function createBaseLiveStatusResponse_JTT() {
713
+ return { channelNo: 0, packetLose: 0 };
714
+ }
715
+ export const LiveStatusResponse_JTT = {
716
+ encode(message, writer = new BinaryWriter()) {
717
+ if (message.channelNo !== 0) {
718
+ writer.uint32(8).sint32(message.channelNo);
719
+ }
720
+ if (message.packetLose !== 0) {
721
+ writer.uint32(16).sint32(message.packetLose);
722
+ }
723
+ return writer;
724
+ },
725
+ decode(input, length) {
726
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
727
+ const end = length === undefined ? reader.len : reader.pos + length;
728
+ const message = createBaseLiveStatusResponse_JTT();
729
+ while (reader.pos < end) {
730
+ const tag = reader.uint32();
731
+ switch (tag >>> 3) {
732
+ case 1: {
733
+ if (tag !== 8) {
734
+ break;
735
+ }
736
+ message.channelNo = reader.sint32();
737
+ continue;
738
+ }
739
+ case 2: {
740
+ if (tag !== 16) {
741
+ break;
742
+ }
743
+ message.packetLose = reader.sint32();
744
+ continue;
745
+ }
746
+ }
747
+ if ((tag & 7) === 4 || tag === 0) {
748
+ break;
749
+ }
750
+ reader.skip(tag & 7);
751
+ }
752
+ return message;
753
+ },
754
+ create(base) {
755
+ return LiveStatusResponse_JTT.fromPartial(base ?? {});
756
+ },
757
+ fromPartial(object) {
758
+ const message = createBaseLiveStatusResponse_JTT();
759
+ message.channelNo = object.channelNo ?? 0;
760
+ message.packetLose = object.packetLose ?? 0;
761
+ return message;
762
+ },
763
+ };
764
+ function createBaseFileListQueryRequest() {
765
+ return { cameraId: 0, startedAt: undefined, finishedAt: undefined, jtt: undefined };
766
+ }
767
+ export const FileListQueryRequest = {
768
+ encode(message, writer = new BinaryWriter()) {
769
+ if (message.cameraId !== 0) {
770
+ writer.uint32(8).sint32(message.cameraId);
771
+ }
772
+ if (message.startedAt !== undefined) {
773
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(18).fork()).join();
774
+ }
775
+ if (message.finishedAt !== undefined) {
776
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(26).fork()).join();
777
+ }
778
+ if (message.jtt !== undefined) {
779
+ FileListQueryRequest_JTT.encode(message.jtt, writer.uint32(90).fork()).join();
780
+ }
781
+ return writer;
782
+ },
783
+ decode(input, length) {
784
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
785
+ const end = length === undefined ? reader.len : reader.pos + length;
786
+ const message = createBaseFileListQueryRequest();
787
+ while (reader.pos < end) {
788
+ const tag = reader.uint32();
789
+ switch (tag >>> 3) {
790
+ case 1: {
791
+ if (tag !== 8) {
792
+ break;
793
+ }
794
+ message.cameraId = reader.sint32();
795
+ continue;
796
+ }
797
+ case 2: {
798
+ if (tag !== 18) {
799
+ break;
800
+ }
801
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
802
+ continue;
803
+ }
804
+ case 3: {
805
+ if (tag !== 26) {
806
+ break;
807
+ }
808
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
809
+ continue;
810
+ }
811
+ case 11: {
812
+ if (tag !== 90) {
813
+ break;
814
+ }
815
+ message.jtt = FileListQueryRequest_JTT.decode(reader, reader.uint32());
816
+ continue;
817
+ }
818
+ }
819
+ if ((tag & 7) === 4 || tag === 0) {
820
+ break;
821
+ }
822
+ reader.skip(tag & 7);
823
+ }
824
+ return message;
825
+ },
826
+ create(base) {
827
+ return FileListQueryRequest.fromPartial(base ?? {});
828
+ },
829
+ fromPartial(object) {
830
+ const message = createBaseFileListQueryRequest();
831
+ message.cameraId = object.cameraId ?? 0;
832
+ message.startedAt = object.startedAt ?? undefined;
833
+ message.finishedAt = object.finishedAt ?? undefined;
834
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
835
+ ? FileListQueryRequest_JTT.fromPartial(object.jtt)
836
+ : undefined;
837
+ return message;
838
+ },
839
+ };
840
+ function createBaseFileListQueryRequest_JTT() {
841
+ return { alarmSign: Long.UZERO, mediaType: 0, streamType: 0, memoryType: 0 };
842
+ }
843
+ export const FileListQueryRequest_JTT = {
844
+ encode(message, writer = new BinaryWriter()) {
845
+ if (!message.alarmSign.equals(Long.UZERO)) {
846
+ writer.uint32(8).uint64(message.alarmSign.toString());
847
+ }
848
+ if (message.mediaType !== 0) {
849
+ writer.uint32(16).int32(message.mediaType);
850
+ }
851
+ if (message.streamType !== 0) {
852
+ writer.uint32(24).int32(message.streamType);
853
+ }
854
+ if (message.memoryType !== 0) {
855
+ writer.uint32(32).int32(message.memoryType);
856
+ }
857
+ return writer;
858
+ },
859
+ decode(input, length) {
860
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
861
+ const end = length === undefined ? reader.len : reader.pos + length;
862
+ const message = createBaseFileListQueryRequest_JTT();
863
+ while (reader.pos < end) {
864
+ const tag = reader.uint32();
865
+ switch (tag >>> 3) {
866
+ case 1: {
867
+ if (tag !== 8) {
868
+ break;
869
+ }
870
+ message.alarmSign = Long.fromString(reader.uint64().toString(), true);
871
+ continue;
872
+ }
873
+ case 2: {
874
+ if (tag !== 16) {
875
+ break;
876
+ }
877
+ message.mediaType = reader.int32();
878
+ continue;
879
+ }
880
+ case 3: {
881
+ if (tag !== 24) {
882
+ break;
883
+ }
884
+ message.streamType = reader.int32();
885
+ continue;
886
+ }
887
+ case 4: {
888
+ if (tag !== 32) {
889
+ break;
890
+ }
891
+ message.memoryType = reader.int32();
892
+ continue;
893
+ }
894
+ }
895
+ if ((tag & 7) === 4 || tag === 0) {
896
+ break;
897
+ }
898
+ reader.skip(tag & 7);
899
+ }
900
+ return message;
901
+ },
902
+ create(base) {
903
+ return FileListQueryRequest_JTT.fromPartial(base ?? {});
904
+ },
905
+ fromPartial(object) {
906
+ const message = createBaseFileListQueryRequest_JTT();
907
+ message.alarmSign = (object.alarmSign !== undefined && object.alarmSign !== null)
908
+ ? Long.fromValue(object.alarmSign)
909
+ : Long.UZERO;
910
+ message.mediaType = object.mediaType ?? 0;
911
+ message.streamType = object.streamType ?? 0;
912
+ message.memoryType = object.memoryType ?? 0;
913
+ return message;
914
+ },
915
+ };
916
+ function createBaseFileListQueryResponse() {
917
+ return { serialNo: 0, files: [] };
918
+ }
919
+ export const FileListQueryResponse = {
920
+ encode(message, writer = new BinaryWriter()) {
921
+ if (message.serialNo !== 0) {
922
+ writer.uint32(8).sint32(message.serialNo);
923
+ }
924
+ for (const v of message.files) {
925
+ FileListQueryResponse_File.encode(v, writer.uint32(18).fork()).join();
926
+ }
927
+ return writer;
928
+ },
929
+ decode(input, length) {
930
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
931
+ const end = length === undefined ? reader.len : reader.pos + length;
932
+ const message = createBaseFileListQueryResponse();
933
+ while (reader.pos < end) {
934
+ const tag = reader.uint32();
935
+ switch (tag >>> 3) {
936
+ case 1: {
937
+ if (tag !== 8) {
938
+ break;
939
+ }
940
+ message.serialNo = reader.sint32();
941
+ continue;
942
+ }
943
+ case 2: {
944
+ if (tag !== 18) {
945
+ break;
946
+ }
947
+ message.files.push(FileListQueryResponse_File.decode(reader, reader.uint32()));
948
+ continue;
949
+ }
950
+ }
951
+ if ((tag & 7) === 4 || tag === 0) {
952
+ break;
953
+ }
954
+ reader.skip(tag & 7);
955
+ }
956
+ return message;
957
+ },
958
+ create(base) {
959
+ return FileListQueryResponse.fromPartial(base ?? {});
960
+ },
961
+ fromPartial(object) {
962
+ const message = createBaseFileListQueryResponse();
963
+ message.serialNo = object.serialNo ?? 0;
964
+ message.files = object.files?.map((e) => FileListQueryResponse_File.fromPartial(e)) || [];
965
+ return message;
966
+ },
967
+ };
968
+ function createBaseFileListQueryResponse_JTT() {
969
+ return { alarmSign: Long.UZERO, resourceType: 0, streamType: 0, memoryType: 0 };
970
+ }
971
+ export const FileListQueryResponse_JTT = {
972
+ encode(message, writer = new BinaryWriter()) {
973
+ if (!message.alarmSign.equals(Long.UZERO)) {
974
+ writer.uint32(8).uint64(message.alarmSign.toString());
975
+ }
976
+ if (message.resourceType !== 0) {
977
+ writer.uint32(16).int32(message.resourceType);
978
+ }
979
+ if (message.streamType !== 0) {
980
+ writer.uint32(24).int32(message.streamType);
981
+ }
982
+ if (message.memoryType !== 0) {
983
+ writer.uint32(32).int32(message.memoryType);
984
+ }
985
+ return writer;
986
+ },
987
+ decode(input, length) {
988
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
989
+ const end = length === undefined ? reader.len : reader.pos + length;
990
+ const message = createBaseFileListQueryResponse_JTT();
991
+ while (reader.pos < end) {
992
+ const tag = reader.uint32();
993
+ switch (tag >>> 3) {
994
+ case 1: {
995
+ if (tag !== 8) {
996
+ break;
997
+ }
998
+ message.alarmSign = Long.fromString(reader.uint64().toString(), true);
999
+ continue;
1000
+ }
1001
+ case 2: {
1002
+ if (tag !== 16) {
1003
+ break;
1004
+ }
1005
+ message.resourceType = reader.int32();
1006
+ continue;
1007
+ }
1008
+ case 3: {
1009
+ if (tag !== 24) {
1010
+ break;
1011
+ }
1012
+ message.streamType = reader.int32();
1013
+ continue;
1014
+ }
1015
+ case 4: {
1016
+ if (tag !== 32) {
1017
+ break;
1018
+ }
1019
+ message.memoryType = reader.int32();
1020
+ continue;
1021
+ }
1022
+ }
1023
+ if ((tag & 7) === 4 || tag === 0) {
1024
+ break;
1025
+ }
1026
+ reader.skip(tag & 7);
1027
+ }
1028
+ return message;
1029
+ },
1030
+ create(base) {
1031
+ return FileListQueryResponse_JTT.fromPartial(base ?? {});
1032
+ },
1033
+ fromPartial(object) {
1034
+ const message = createBaseFileListQueryResponse_JTT();
1035
+ message.alarmSign = (object.alarmSign !== undefined && object.alarmSign !== null)
1036
+ ? Long.fromValue(object.alarmSign)
1037
+ : Long.UZERO;
1038
+ message.resourceType = object.resourceType ?? 0;
1039
+ message.streamType = object.streamType ?? 0;
1040
+ message.memoryType = object.memoryType ?? 0;
1041
+ return message;
1042
+ },
1043
+ };
1044
+ function createBaseFileListQueryResponse_File() {
1045
+ return { startedAt: undefined, finishedAt: undefined, fileSize: 0, jtt: undefined };
1046
+ }
1047
+ export const FileListQueryResponse_File = {
1048
+ encode(message, writer = new BinaryWriter()) {
1049
+ if (message.startedAt !== undefined) {
1050
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(10).fork()).join();
1051
+ }
1052
+ if (message.finishedAt !== undefined) {
1053
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(18).fork()).join();
1054
+ }
1055
+ if (message.fileSize !== 0) {
1056
+ writer.uint32(24).uint32(message.fileSize);
1057
+ }
1058
+ if (message.jtt !== undefined) {
1059
+ FileListQueryResponse_JTT.encode(message.jtt, writer.uint32(90).fork()).join();
1060
+ }
1061
+ return writer;
1062
+ },
1063
+ decode(input, length) {
1064
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1065
+ const end = length === undefined ? reader.len : reader.pos + length;
1066
+ const message = createBaseFileListQueryResponse_File();
1067
+ while (reader.pos < end) {
1068
+ const tag = reader.uint32();
1069
+ switch (tag >>> 3) {
1070
+ case 1: {
1071
+ if (tag !== 10) {
1072
+ break;
1073
+ }
1074
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1075
+ continue;
1076
+ }
1077
+ case 2: {
1078
+ if (tag !== 18) {
1079
+ break;
1080
+ }
1081
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1082
+ continue;
1083
+ }
1084
+ case 3: {
1085
+ if (tag !== 24) {
1086
+ break;
1087
+ }
1088
+ message.fileSize = reader.uint32();
1089
+ continue;
1090
+ }
1091
+ case 11: {
1092
+ if (tag !== 90) {
1093
+ break;
1094
+ }
1095
+ message.jtt = FileListQueryResponse_JTT.decode(reader, reader.uint32());
1096
+ continue;
1097
+ }
1098
+ }
1099
+ if ((tag & 7) === 4 || tag === 0) {
1100
+ break;
1101
+ }
1102
+ reader.skip(tag & 7);
1103
+ }
1104
+ return message;
1105
+ },
1106
+ create(base) {
1107
+ return FileListQueryResponse_File.fromPartial(base ?? {});
1108
+ },
1109
+ fromPartial(object) {
1110
+ const message = createBaseFileListQueryResponse_File();
1111
+ message.startedAt = object.startedAt ?? undefined;
1112
+ message.finishedAt = object.finishedAt ?? undefined;
1113
+ message.fileSize = object.fileSize ?? 0;
1114
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
1115
+ ? FileListQueryResponse_JTT.fromPartial(object.jtt)
1116
+ : undefined;
1117
+ return message;
1118
+ },
1119
+ };
1120
+ function createBasePlaybackRequest() {
1121
+ return { cameraId: Long.UZERO, startedAt: undefined, finishedAt: undefined, server: undefined, jtt: undefined };
1122
+ }
1123
+ export const PlaybackRequest = {
1124
+ encode(message, writer = new BinaryWriter()) {
1125
+ if (!message.cameraId.equals(Long.UZERO)) {
1126
+ writer.uint32(8).uint64(message.cameraId.toString());
1127
+ }
1128
+ if (message.startedAt !== undefined) {
1129
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(18).fork()).join();
1130
+ }
1131
+ if (message.finishedAt !== undefined) {
1132
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(26).fork()).join();
1133
+ }
1134
+ if (message.server !== undefined) {
1135
+ Server.encode(message.server, writer.uint32(34).fork()).join();
1136
+ }
1137
+ if (message.jtt !== undefined) {
1138
+ PlaybackRequest_JTT.encode(message.jtt, writer.uint32(90).fork()).join();
1139
+ }
1140
+ return writer;
1141
+ },
1142
+ decode(input, length) {
1143
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1144
+ const end = length === undefined ? reader.len : reader.pos + length;
1145
+ const message = createBasePlaybackRequest();
1146
+ while (reader.pos < end) {
1147
+ const tag = reader.uint32();
1148
+ switch (tag >>> 3) {
1149
+ case 1: {
1150
+ if (tag !== 8) {
1151
+ break;
1152
+ }
1153
+ message.cameraId = Long.fromString(reader.uint64().toString(), true);
1154
+ continue;
1155
+ }
1156
+ case 2: {
1157
+ if (tag !== 18) {
1158
+ break;
1159
+ }
1160
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1161
+ continue;
1162
+ }
1163
+ case 3: {
1164
+ if (tag !== 26) {
1165
+ break;
1166
+ }
1167
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1168
+ continue;
1169
+ }
1170
+ case 4: {
1171
+ if (tag !== 34) {
1172
+ break;
1173
+ }
1174
+ message.server = Server.decode(reader, reader.uint32());
1175
+ continue;
1176
+ }
1177
+ case 11: {
1178
+ if (tag !== 90) {
1179
+ break;
1180
+ }
1181
+ message.jtt = PlaybackRequest_JTT.decode(reader, reader.uint32());
1182
+ continue;
1183
+ }
1184
+ }
1185
+ if ((tag & 7) === 4 || tag === 0) {
1186
+ break;
1187
+ }
1188
+ reader.skip(tag & 7);
1189
+ }
1190
+ return message;
1191
+ },
1192
+ create(base) {
1193
+ return PlaybackRequest.fromPartial(base ?? {});
1194
+ },
1195
+ fromPartial(object) {
1196
+ const message = createBasePlaybackRequest();
1197
+ message.cameraId = (object.cameraId !== undefined && object.cameraId !== null)
1198
+ ? Long.fromValue(object.cameraId)
1199
+ : Long.UZERO;
1200
+ message.startedAt = object.startedAt ?? undefined;
1201
+ message.finishedAt = object.finishedAt ?? undefined;
1202
+ message.server = (object.server !== undefined && object.server !== null)
1203
+ ? Server.fromPartial(object.server)
1204
+ : undefined;
1205
+ message.jtt = (object.jtt !== undefined && object.jtt !== null)
1206
+ ? PlaybackRequest_JTT.fromPartial(object.jtt)
1207
+ : undefined;
1208
+ return message;
1209
+ },
1210
+ };
1211
+ function createBasePlaybackRequest_JTT() {
1212
+ return { resourceType: 0, streamType: 0, memoryType: 0, playbackMethod: 0, playSpeed: 0 };
1213
+ }
1214
+ export const PlaybackRequest_JTT = {
1215
+ encode(message, writer = new BinaryWriter()) {
1216
+ if (message.resourceType !== 0) {
1217
+ writer.uint32(8).int32(message.resourceType);
1218
+ }
1219
+ if (message.streamType !== 0) {
1220
+ writer.uint32(16).int32(message.streamType);
1221
+ }
1222
+ if (message.memoryType !== 0) {
1223
+ writer.uint32(24).int32(message.memoryType);
1224
+ }
1225
+ if (message.playbackMethod !== 0) {
1226
+ writer.uint32(32).int32(message.playbackMethod);
1227
+ }
1228
+ if (message.playSpeed !== 0) {
1229
+ writer.uint32(40).int32(message.playSpeed);
1230
+ }
1231
+ return writer;
1232
+ },
1233
+ decode(input, length) {
1234
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1235
+ const end = length === undefined ? reader.len : reader.pos + length;
1236
+ const message = createBasePlaybackRequest_JTT();
1237
+ while (reader.pos < end) {
1238
+ const tag = reader.uint32();
1239
+ switch (tag >>> 3) {
1240
+ case 1: {
1241
+ if (tag !== 8) {
1242
+ break;
1243
+ }
1244
+ message.resourceType = reader.int32();
1245
+ continue;
1246
+ }
1247
+ case 2: {
1248
+ if (tag !== 16) {
1249
+ break;
1250
+ }
1251
+ message.streamType = reader.int32();
1252
+ continue;
1253
+ }
1254
+ case 3: {
1255
+ if (tag !== 24) {
1256
+ break;
1257
+ }
1258
+ message.memoryType = reader.int32();
1259
+ continue;
1260
+ }
1261
+ case 4: {
1262
+ if (tag !== 32) {
1263
+ break;
1264
+ }
1265
+ message.playbackMethod = reader.int32();
1266
+ continue;
1267
+ }
1268
+ case 5: {
1269
+ if (tag !== 40) {
1270
+ break;
1271
+ }
1272
+ message.playSpeed = reader.int32();
1273
+ continue;
1274
+ }
1275
+ }
1276
+ if ((tag & 7) === 4 || tag === 0) {
1277
+ break;
1278
+ }
1279
+ reader.skip(tag & 7);
1280
+ }
1281
+ return message;
1282
+ },
1283
+ create(base) {
1284
+ return PlaybackRequest_JTT.fromPartial(base ?? {});
1285
+ },
1286
+ fromPartial(object) {
1287
+ const message = createBasePlaybackRequest_JTT();
1288
+ message.resourceType = object.resourceType ?? 0;
1289
+ message.streamType = object.streamType ?? 0;
1290
+ message.memoryType = object.memoryType ?? 0;
1291
+ message.playbackMethod = object.playbackMethod ?? 0;
1292
+ message.playSpeed = object.playSpeed ?? 0;
1293
+ return message;
1294
+ },
1295
+ };
1296
+ function createBasePlaybackUpdateState() {
1297
+ return { cameraId: Long.UZERO, state: 0 };
1298
+ }
1299
+ export const PlaybackUpdateState = {
1300
+ encode(message, writer = new BinaryWriter()) {
1301
+ if (!message.cameraId.equals(Long.UZERO)) {
1302
+ writer.uint32(8).uint64(message.cameraId.toString());
1303
+ }
1304
+ if (message.state !== 0) {
1305
+ writer.uint32(16).int32(message.state);
1306
+ }
1307
+ return writer;
1308
+ },
1309
+ decode(input, length) {
1310
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1311
+ const end = length === undefined ? reader.len : reader.pos + length;
1312
+ const message = createBasePlaybackUpdateState();
1313
+ while (reader.pos < end) {
1314
+ const tag = reader.uint32();
1315
+ switch (tag >>> 3) {
1316
+ case 1: {
1317
+ if (tag !== 8) {
1318
+ break;
1319
+ }
1320
+ message.cameraId = Long.fromString(reader.uint64().toString(), true);
1321
+ continue;
1322
+ }
1323
+ case 2: {
1324
+ if (tag !== 16) {
1325
+ break;
1326
+ }
1327
+ message.state = reader.int32();
1328
+ continue;
1329
+ }
1330
+ }
1331
+ if ((tag & 7) === 4 || tag === 0) {
1332
+ break;
1333
+ }
1334
+ reader.skip(tag & 7);
1335
+ }
1336
+ return message;
1337
+ },
1338
+ create(base) {
1339
+ return PlaybackUpdateState.fromPartial(base ?? {});
1340
+ },
1341
+ fromPartial(object) {
1342
+ const message = createBasePlaybackUpdateState();
1343
+ message.cameraId = (object.cameraId !== undefined && object.cameraId !== null)
1344
+ ? Long.fromValue(object.cameraId)
1345
+ : Long.UZERO;
1346
+ message.state = object.state ?? 0;
1347
+ return message;
1348
+ },
1349
+ };
1350
+ function createBasePlaybackUpdateCurrentTime() {
1351
+ return { cameraId: Long.UZERO, currentTime: undefined };
1352
+ }
1353
+ export const PlaybackUpdateCurrentTime = {
1354
+ encode(message, writer = new BinaryWriter()) {
1355
+ if (!message.cameraId.equals(Long.UZERO)) {
1356
+ writer.uint32(8).uint64(message.cameraId.toString());
1357
+ }
1358
+ if (message.currentTime !== undefined) {
1359
+ Timestamp.encode(toTimestamp(message.currentTime), writer.uint32(18).fork()).join();
1360
+ }
1361
+ return writer;
1362
+ },
1363
+ decode(input, length) {
1364
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1365
+ const end = length === undefined ? reader.len : reader.pos + length;
1366
+ const message = createBasePlaybackUpdateCurrentTime();
1367
+ while (reader.pos < end) {
1368
+ const tag = reader.uint32();
1369
+ switch (tag >>> 3) {
1370
+ case 1: {
1371
+ if (tag !== 8) {
1372
+ break;
1373
+ }
1374
+ message.cameraId = Long.fromString(reader.uint64().toString(), true);
1375
+ continue;
1376
+ }
1377
+ case 2: {
1378
+ if (tag !== 18) {
1379
+ break;
1380
+ }
1381
+ message.currentTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1382
+ continue;
1383
+ }
1384
+ }
1385
+ if ((tag & 7) === 4 || tag === 0) {
1386
+ break;
1387
+ }
1388
+ reader.skip(tag & 7);
1389
+ }
1390
+ return message;
1391
+ },
1392
+ create(base) {
1393
+ return PlaybackUpdateCurrentTime.fromPartial(base ?? {});
1394
+ },
1395
+ fromPartial(object) {
1396
+ const message = createBasePlaybackUpdateCurrentTime();
1397
+ message.cameraId = (object.cameraId !== undefined && object.cameraId !== null)
1398
+ ? Long.fromValue(object.cameraId)
1399
+ : Long.UZERO;
1400
+ message.currentTime = object.currentTime ?? undefined;
1401
+ return message;
1402
+ },
1403
+ };
1404
+ function toTimestamp(date) {
1405
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
1406
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1407
+ return { seconds, nanos };
1408
+ }
1409
+ function fromTimestamp(t) {
1410
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
1411
+ millis += (t.nanos || 0) / 1_000_000;
1412
+ return new globalThis.Date(millis);
1413
+ }
1414
+ function numberToLong(number) {
1415
+ return Long.fromNumber(number);
1416
+ }