@fatehan/tsrp 1.6.20 → 1.6.22

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 (88) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +219 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -0
  3. package/dist/fatehan/activities/workflow.js +1941 -0
  4. package/dist/fatehan/activities/workshift.d.ts +140 -0
  5. package/dist/fatehan/activities/workshift.d.ts.map +1 -0
  6. package/dist/fatehan/activities/workshift.js +1244 -0
  7. package/dist/fatehan/apis/client.d.ts +246 -0
  8. package/dist/fatehan/apis/client.d.ts.map +1 -0
  9. package/dist/fatehan/apis/client.js +2572 -0
  10. package/dist/fatehan/areas/area.d.ts +96 -0
  11. package/dist/fatehan/areas/area.d.ts.map +1 -0
  12. package/dist/fatehan/areas/area.js +761 -0
  13. package/dist/fatehan/devices/devices.d.ts +256 -0
  14. package/dist/fatehan/devices/devices.d.ts.map +1 -0
  15. package/dist/fatehan/devices/devices.js +2730 -0
  16. package/dist/fatehan/devices/maintenance.d.ts +64 -0
  17. package/dist/fatehan/devices/maintenance.d.ts.map +1 -0
  18. package/dist/fatehan/devices/maintenance.js +484 -0
  19. package/dist/fatehan/financial/financial.d.ts +162 -0
  20. package/dist/fatehan/financial/financial.d.ts.map +1 -0
  21. package/dist/fatehan/financial/financial.js +1701 -0
  22. package/dist/fatehan/google/protobuf/descriptor.d.ts +1303 -0
  23. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -0
  24. package/dist/fatehan/google/protobuf/descriptor.js +3467 -0
  25. package/dist/fatehan/google/protobuf/duration.d.ts +99 -0
  26. package/dist/fatehan/google/protobuf/duration.d.ts.map +1 -0
  27. package/dist/fatehan/google/protobuf/duration.js +63 -0
  28. package/dist/fatehan/google/protobuf/field_mask.d.ts +228 -0
  29. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -0
  30. package/dist/fatehan/google/protobuf/field_mask.js +57 -0
  31. package/dist/fatehan/google/protobuf/timestamp.d.ts +129 -0
  32. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -0
  33. package/dist/fatehan/google/protobuf/timestamp.js +63 -0
  34. package/dist/fatehan/identities/authentication.d.ts +164 -0
  35. package/dist/fatehan/identities/authentication.d.ts.map +1 -0
  36. package/dist/fatehan/identities/authentication.js +1291 -0
  37. package/dist/fatehan/identities/identities.d.ts +969 -0
  38. package/dist/fatehan/identities/identities.d.ts.map +1 -0
  39. package/dist/fatehan/identities/identities.js +2993 -0
  40. package/dist/fatehan/models/fusion.d.ts +149 -0
  41. package/dist/fatehan/models/fusion.d.ts.map +1 -0
  42. package/dist/fatehan/models/fusion.js +1531 -0
  43. package/dist/fatehan/models/models.d.ts +162 -0
  44. package/dist/fatehan/models/models.d.ts.map +1 -0
  45. package/dist/fatehan/models/models.js +1486 -0
  46. package/dist/fatehan/notifies/direct.d.ts +85 -0
  47. package/dist/fatehan/notifies/direct.d.ts.map +1 -0
  48. package/dist/fatehan/notifies/direct.js +669 -0
  49. package/dist/fatehan/notifies/notify.d.ts +232 -0
  50. package/dist/fatehan/notifies/notify.d.ts.map +1 -0
  51. package/dist/fatehan/notifies/notify.js +1958 -0
  52. package/dist/fatehan/packets/commands.d.ts +150 -0
  53. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  54. package/dist/fatehan/packets/commands.js +1364 -0
  55. package/dist/fatehan/packets/dataModel.d.ts +1611 -0
  56. package/dist/fatehan/packets/dataModel.d.ts.map +1 -0
  57. package/dist/fatehan/packets/dataModel.js +14961 -0
  58. package/dist/fatehan/packets/dataModule.d.ts +61 -0
  59. package/dist/fatehan/packets/dataModule.d.ts.map +1 -0
  60. package/dist/fatehan/packets/dataModule.js +386 -0
  61. package/dist/fatehan/packets/forge.d.ts +142 -0
  62. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  63. package/dist/fatehan/packets/forge.js +1339 -0
  64. package/dist/fatehan/services/api.d.ts +1222 -0
  65. package/dist/fatehan/services/api.d.ts.map +1 -0
  66. package/dist/fatehan/services/api.js +12689 -0
  67. package/dist/fatehan/services/repositories.d.ts +78 -0
  68. package/dist/fatehan/services/repositories.d.ts.map +1 -0
  69. package/dist/fatehan/services/repositories.js +620 -0
  70. package/dist/fatehan/stream/stream.d.ts +224 -0
  71. package/dist/fatehan/stream/stream.d.ts.map +1 -0
  72. package/dist/fatehan/stream/stream.js +1416 -0
  73. package/dist/fatehan/trips/trip.d.ts +325 -0
  74. package/dist/fatehan/trips/trip.d.ts.map +1 -0
  75. package/dist/fatehan/trips/trip.js +1635 -0
  76. package/dist/fatehan/utils/buf/validate/validate.d.ts +3520 -0
  77. package/dist/fatehan/utils/buf/validate/validate.d.ts.map +1 -0
  78. package/dist/fatehan/utils/buf/validate/validate.js +4248 -0
  79. package/dist/services.d.ts +79 -0
  80. package/dist/services.d.ts.map +1 -0
  81. package/dist/services.js +245 -0
  82. package/dist/store/system.io.d.ts +6 -0
  83. package/dist/store/system.io.d.ts.map +1 -0
  84. package/dist/store/system.io.js +14 -0
  85. package/dist/system.io.d.ts +6 -0
  86. package/dist/system.io.d.ts.map +1 -0
  87. package/dist/system.io.js +208 -0
  88. package/package.json +1 -1
@@ -0,0 +1,1958 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v7.34.1
5
+ // source: notifies/notify.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
+ import { Receiver } from "../identities/identities";
11
+ export const protobufPackage = "com.fatehan.notifies";
12
+ export var Via;
13
+ (function (Via) {
14
+ Via[Via["NONE"] = 0] = "NONE";
15
+ Via[Via["SMS"] = 1] = "SMS";
16
+ Via[Via["FCM"] = 2] = "FCM";
17
+ Via[Via["EMAIL"] = 3] = "EMAIL";
18
+ Via[Via["DATABASE"] = 4] = "DATABASE";
19
+ Via[Via["CALL"] = 5] = "CALL";
20
+ Via[Via["WEBHOOK"] = 6] = "WEBHOOK";
21
+ Via[Via["DIRECT"] = 7] = "DIRECT";
22
+ Via[Via["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(Via || (Via = {}));
24
+ export var ObjectType;
25
+ (function (ObjectType) {
26
+ ObjectType[ObjectType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
27
+ ObjectType[ObjectType["DEVICE"] = 1] = "DEVICE";
28
+ ObjectType[ObjectType["USER"] = 2] = "USER";
29
+ ObjectType[ObjectType["OPERATION"] = 3] = "OPERATION";
30
+ ObjectType[ObjectType["WORKFLOW_TASK"] = 4] = "WORKFLOW_TASK";
31
+ ObjectType[ObjectType["MAINTENANCE"] = 5] = "MAINTENANCE";
32
+ ObjectType[ObjectType["EVENT"] = 6] = "EVENT";
33
+ ObjectType[ObjectType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
34
+ })(ObjectType || (ObjectType = {}));
35
+ export var AreaEventType;
36
+ (function (AreaEventType) {
37
+ AreaEventType[AreaEventType["AREA_EXIT"] = 0] = "AREA_EXIT";
38
+ AreaEventType[AreaEventType["AREA_ENTER"] = 1] = "AREA_ENTER";
39
+ AreaEventType[AreaEventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
40
+ })(AreaEventType || (AreaEventType = {}));
41
+ export var AnalogEventType;
42
+ (function (AnalogEventType) {
43
+ AnalogEventType[AnalogEventType["ANALOG_EQUAL"] = 0] = "ANALOG_EQUAL";
44
+ AnalogEventType[AnalogEventType["ANALOG_RISE_ABOVE"] = 1] = "ANALOG_RISE_ABOVE";
45
+ AnalogEventType[AnalogEventType["ANALOG_FALL_BELOW"] = 2] = "ANALOG_FALL_BELOW";
46
+ AnalogEventType[AnalogEventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
47
+ })(AnalogEventType || (AnalogEventType = {}));
48
+ export var TriggerGate;
49
+ (function (TriggerGate) {
50
+ TriggerGate[TriggerGate["TRIGGER_GATE_AND"] = 0] = "TRIGGER_GATE_AND";
51
+ TriggerGate[TriggerGate["TRIGGER_GATE_OR"] = 1] = "TRIGGER_GATE_OR";
52
+ TriggerGate[TriggerGate["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
53
+ })(TriggerGate || (TriggerGate = {}));
54
+ export var NotifyJob_Priority;
55
+ (function (NotifyJob_Priority) {
56
+ NotifyJob_Priority[NotifyJob_Priority["LOW"] = 0] = "LOW";
57
+ NotifyJob_Priority[NotifyJob_Priority["MEDIUM"] = 1] = "MEDIUM";
58
+ NotifyJob_Priority[NotifyJob_Priority["HIGH"] = 2] = "HIGH";
59
+ NotifyJob_Priority[NotifyJob_Priority["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
60
+ })(NotifyJob_Priority || (NotifyJob_Priority = {}));
61
+ function createBaseNotifyJob() {
62
+ return { id: Long.UZERO, userId: Long.UZERO, retries: 0, priority: 0, notify: undefined, via: [] };
63
+ }
64
+ export const NotifyJob = {
65
+ encode(message, writer = new BinaryWriter()) {
66
+ if (!message.id.equals(Long.UZERO)) {
67
+ writer.uint32(8).uint64(message.id.toString());
68
+ }
69
+ if (!message.userId.equals(Long.UZERO)) {
70
+ writer.uint32(16).uint64(message.userId.toString());
71
+ }
72
+ if (message.retries !== 0) {
73
+ writer.uint32(24).uint32(message.retries);
74
+ }
75
+ if (message.priority !== 0) {
76
+ writer.uint32(32).int32(message.priority);
77
+ }
78
+ if (message.notify !== undefined) {
79
+ Notify.encode(message.notify, writer.uint32(42).fork()).join();
80
+ }
81
+ writer.uint32(98).fork();
82
+ for (const v of message.via) {
83
+ writer.int32(v);
84
+ }
85
+ writer.join();
86
+ return writer;
87
+ },
88
+ decode(input, length) {
89
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
90
+ const end = length === undefined ? reader.len : reader.pos + length;
91
+ const message = createBaseNotifyJob();
92
+ while (reader.pos < end) {
93
+ const tag = reader.uint32();
94
+ switch (tag >>> 3) {
95
+ case 1: {
96
+ if (tag !== 8) {
97
+ break;
98
+ }
99
+ message.id = Long.fromString(reader.uint64().toString(), true);
100
+ continue;
101
+ }
102
+ case 2: {
103
+ if (tag !== 16) {
104
+ break;
105
+ }
106
+ message.userId = Long.fromString(reader.uint64().toString(), true);
107
+ continue;
108
+ }
109
+ case 3: {
110
+ if (tag !== 24) {
111
+ break;
112
+ }
113
+ message.retries = reader.uint32();
114
+ continue;
115
+ }
116
+ case 4: {
117
+ if (tag !== 32) {
118
+ break;
119
+ }
120
+ message.priority = reader.int32();
121
+ continue;
122
+ }
123
+ case 5: {
124
+ if (tag !== 42) {
125
+ break;
126
+ }
127
+ message.notify = Notify.decode(reader, reader.uint32());
128
+ continue;
129
+ }
130
+ case 12: {
131
+ if (tag === 96) {
132
+ message.via.push(reader.int32());
133
+ continue;
134
+ }
135
+ if (tag === 98) {
136
+ const end2 = reader.uint32() + reader.pos;
137
+ while (reader.pos < end2) {
138
+ message.via.push(reader.int32());
139
+ }
140
+ continue;
141
+ }
142
+ break;
143
+ }
144
+ }
145
+ if ((tag & 7) === 4 || tag === 0) {
146
+ break;
147
+ }
148
+ reader.skip(tag & 7);
149
+ }
150
+ return message;
151
+ },
152
+ create(base) {
153
+ return NotifyJob.fromPartial(base ?? {});
154
+ },
155
+ fromPartial(object) {
156
+ const message = createBaseNotifyJob();
157
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
158
+ message.userId = (object.userId !== undefined && object.userId !== null)
159
+ ? Long.fromValue(object.userId)
160
+ : Long.UZERO;
161
+ message.retries = object.retries ?? 0;
162
+ message.priority = object.priority ?? 0;
163
+ message.notify = (object.notify !== undefined && object.notify !== null)
164
+ ? Notify.fromPartial(object.notify)
165
+ : undefined;
166
+ message.via = object.via?.map((e) => e) || [];
167
+ return message;
168
+ },
169
+ };
170
+ function createBaseNotify() {
171
+ return {
172
+ title: "",
173
+ body: undefined,
174
+ sound: undefined,
175
+ image: undefined,
176
+ icon: undefined,
177
+ receiver: undefined,
178
+ deviceId: undefined,
179
+ objectId: undefined,
180
+ objectType: 0,
181
+ timestamp: undefined,
182
+ data: {},
183
+ };
184
+ }
185
+ export const Notify = {
186
+ encode(message, writer = new BinaryWriter()) {
187
+ if (message.title !== "") {
188
+ writer.uint32(10).string(message.title);
189
+ }
190
+ if (message.body !== undefined) {
191
+ writer.uint32(18).string(message.body);
192
+ }
193
+ if (message.sound !== undefined) {
194
+ writer.uint32(26).string(message.sound);
195
+ }
196
+ if (message.image !== undefined) {
197
+ writer.uint32(34).string(message.image);
198
+ }
199
+ if (message.icon !== undefined) {
200
+ writer.uint32(42).string(message.icon);
201
+ }
202
+ if (message.receiver !== undefined) {
203
+ Receiver.encode(message.receiver, writer.uint32(50).fork()).join();
204
+ }
205
+ if (message.deviceId !== undefined) {
206
+ writer.uint32(56).uint64(message.deviceId.toString());
207
+ }
208
+ if (message.objectId !== undefined) {
209
+ writer.uint32(64).uint64(message.objectId.toString());
210
+ }
211
+ if (message.objectType !== 0) {
212
+ writer.uint32(72).int32(message.objectType);
213
+ }
214
+ if (message.timestamp !== undefined) {
215
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(82).fork()).join();
216
+ }
217
+ globalThis.Object.entries(message.data).forEach(([key, value]) => {
218
+ Notify_DataEntry.encode({ key: key, value }, writer.uint32(90).fork()).join();
219
+ });
220
+ return writer;
221
+ },
222
+ decode(input, length) {
223
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
224
+ const end = length === undefined ? reader.len : reader.pos + length;
225
+ const message = createBaseNotify();
226
+ while (reader.pos < end) {
227
+ const tag = reader.uint32();
228
+ switch (tag >>> 3) {
229
+ case 1: {
230
+ if (tag !== 10) {
231
+ break;
232
+ }
233
+ message.title = reader.string();
234
+ continue;
235
+ }
236
+ case 2: {
237
+ if (tag !== 18) {
238
+ break;
239
+ }
240
+ message.body = reader.string();
241
+ continue;
242
+ }
243
+ case 3: {
244
+ if (tag !== 26) {
245
+ break;
246
+ }
247
+ message.sound = reader.string();
248
+ continue;
249
+ }
250
+ case 4: {
251
+ if (tag !== 34) {
252
+ break;
253
+ }
254
+ message.image = reader.string();
255
+ continue;
256
+ }
257
+ case 5: {
258
+ if (tag !== 42) {
259
+ break;
260
+ }
261
+ message.icon = reader.string();
262
+ continue;
263
+ }
264
+ case 6: {
265
+ if (tag !== 50) {
266
+ break;
267
+ }
268
+ message.receiver = Receiver.decode(reader, reader.uint32());
269
+ continue;
270
+ }
271
+ case 7: {
272
+ if (tag !== 56) {
273
+ break;
274
+ }
275
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
276
+ continue;
277
+ }
278
+ case 8: {
279
+ if (tag !== 64) {
280
+ break;
281
+ }
282
+ message.objectId = Long.fromString(reader.uint64().toString(), true);
283
+ continue;
284
+ }
285
+ case 9: {
286
+ if (tag !== 72) {
287
+ break;
288
+ }
289
+ message.objectType = reader.int32();
290
+ continue;
291
+ }
292
+ case 10: {
293
+ if (tag !== 82) {
294
+ break;
295
+ }
296
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
297
+ continue;
298
+ }
299
+ case 11: {
300
+ if (tag !== 90) {
301
+ break;
302
+ }
303
+ const entry11 = Notify_DataEntry.decode(reader, reader.uint32());
304
+ if (entry11.value !== undefined) {
305
+ message.data[entry11.key] = entry11.value;
306
+ }
307
+ continue;
308
+ }
309
+ }
310
+ if ((tag & 7) === 4 || tag === 0) {
311
+ break;
312
+ }
313
+ reader.skip(tag & 7);
314
+ }
315
+ return message;
316
+ },
317
+ create(base) {
318
+ return Notify.fromPartial(base ?? {});
319
+ },
320
+ fromPartial(object) {
321
+ const message = createBaseNotify();
322
+ message.title = object.title ?? "";
323
+ message.body = object.body ?? undefined;
324
+ message.sound = object.sound ?? undefined;
325
+ message.image = object.image ?? undefined;
326
+ message.icon = object.icon ?? undefined;
327
+ message.receiver = (object.receiver !== undefined && object.receiver !== null)
328
+ ? Receiver.fromPartial(object.receiver)
329
+ : undefined;
330
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
331
+ ? Long.fromValue(object.deviceId)
332
+ : undefined;
333
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
334
+ ? Long.fromValue(object.objectId)
335
+ : undefined;
336
+ message.objectType = object.objectType ?? 0;
337
+ message.timestamp = object.timestamp ?? undefined;
338
+ message.data = globalThis.Object.entries(object.data ?? {}).reduce((acc, [key, value]) => {
339
+ if (value !== undefined) {
340
+ acc[key] = globalThis.String(value);
341
+ }
342
+ return acc;
343
+ }, {});
344
+ return message;
345
+ },
346
+ };
347
+ function createBaseNotify_DataEntry() {
348
+ return { key: "", value: "" };
349
+ }
350
+ export const Notify_DataEntry = {
351
+ encode(message, writer = new BinaryWriter()) {
352
+ if (message.key !== "") {
353
+ writer.uint32(10).string(message.key);
354
+ }
355
+ if (message.value !== "") {
356
+ writer.uint32(18).string(message.value);
357
+ }
358
+ return writer;
359
+ },
360
+ decode(input, length) {
361
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
362
+ const end = length === undefined ? reader.len : reader.pos + length;
363
+ const message = createBaseNotify_DataEntry();
364
+ while (reader.pos < end) {
365
+ const tag = reader.uint32();
366
+ switch (tag >>> 3) {
367
+ case 1: {
368
+ if (tag !== 10) {
369
+ break;
370
+ }
371
+ message.key = reader.string();
372
+ continue;
373
+ }
374
+ case 2: {
375
+ if (tag !== 18) {
376
+ break;
377
+ }
378
+ message.value = reader.string();
379
+ continue;
380
+ }
381
+ }
382
+ if ((tag & 7) === 4 || tag === 0) {
383
+ break;
384
+ }
385
+ reader.skip(tag & 7);
386
+ }
387
+ return message;
388
+ },
389
+ create(base) {
390
+ return Notify_DataEntry.fromPartial(base ?? {});
391
+ },
392
+ fromPartial(object) {
393
+ const message = createBaseNotify_DataEntry();
394
+ message.key = object.key ?? "";
395
+ message.value = object.value ?? "";
396
+ return message;
397
+ },
398
+ };
399
+ function createBaseNotification() {
400
+ return { id: "", userId: Long.UZERO, payload: undefined, via: [], createdAt: undefined, readAt: undefined };
401
+ }
402
+ export const Notification = {
403
+ encode(message, writer = new BinaryWriter()) {
404
+ if (message.id !== "") {
405
+ writer.uint32(10).string(message.id);
406
+ }
407
+ if (!message.userId.equals(Long.UZERO)) {
408
+ writer.uint32(16).uint64(message.userId.toString());
409
+ }
410
+ if (message.payload !== undefined) {
411
+ Notify.encode(message.payload, writer.uint32(26).fork()).join();
412
+ }
413
+ writer.uint32(34).fork();
414
+ for (const v of message.via) {
415
+ writer.int32(v);
416
+ }
417
+ writer.join();
418
+ if (message.createdAt !== undefined) {
419
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
420
+ }
421
+ if (message.readAt !== undefined) {
422
+ Timestamp.encode(toTimestamp(message.readAt), writer.uint32(50).fork()).join();
423
+ }
424
+ return writer;
425
+ },
426
+ decode(input, length) {
427
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
428
+ const end = length === undefined ? reader.len : reader.pos + length;
429
+ const message = createBaseNotification();
430
+ while (reader.pos < end) {
431
+ const tag = reader.uint32();
432
+ switch (tag >>> 3) {
433
+ case 1: {
434
+ if (tag !== 10) {
435
+ break;
436
+ }
437
+ message.id = reader.string();
438
+ continue;
439
+ }
440
+ case 2: {
441
+ if (tag !== 16) {
442
+ break;
443
+ }
444
+ message.userId = Long.fromString(reader.uint64().toString(), true);
445
+ continue;
446
+ }
447
+ case 3: {
448
+ if (tag !== 26) {
449
+ break;
450
+ }
451
+ message.payload = Notify.decode(reader, reader.uint32());
452
+ continue;
453
+ }
454
+ case 4: {
455
+ if (tag === 32) {
456
+ message.via.push(reader.int32());
457
+ continue;
458
+ }
459
+ if (tag === 34) {
460
+ const end2 = reader.uint32() + reader.pos;
461
+ while (reader.pos < end2) {
462
+ message.via.push(reader.int32());
463
+ }
464
+ continue;
465
+ }
466
+ break;
467
+ }
468
+ case 5: {
469
+ if (tag !== 42) {
470
+ break;
471
+ }
472
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
473
+ continue;
474
+ }
475
+ case 6: {
476
+ if (tag !== 50) {
477
+ break;
478
+ }
479
+ message.readAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
480
+ continue;
481
+ }
482
+ }
483
+ if ((tag & 7) === 4 || tag === 0) {
484
+ break;
485
+ }
486
+ reader.skip(tag & 7);
487
+ }
488
+ return message;
489
+ },
490
+ create(base) {
491
+ return Notification.fromPartial(base ?? {});
492
+ },
493
+ fromPartial(object) {
494
+ const message = createBaseNotification();
495
+ message.id = object.id ?? "";
496
+ message.userId = (object.userId !== undefined && object.userId !== null)
497
+ ? Long.fromValue(object.userId)
498
+ : Long.UZERO;
499
+ message.payload = (object.payload !== undefined && object.payload !== null)
500
+ ? Notify.fromPartial(object.payload)
501
+ : undefined;
502
+ message.via = object.via?.map((e) => e) || [];
503
+ message.createdAt = object.createdAt ?? undefined;
504
+ message.readAt = object.readAt ?? undefined;
505
+ return message;
506
+ },
507
+ };
508
+ function createBaseEvent() {
509
+ return {
510
+ id: Long.UZERO,
511
+ userId: Long.UZERO,
512
+ deviceId: Long.UZERO,
513
+ organizationId: Long.UZERO,
514
+ createdBy: undefined,
515
+ name: "",
516
+ eventData: undefined,
517
+ status: false,
518
+ createdAt: undefined,
519
+ updatedAt: undefined,
520
+ };
521
+ }
522
+ export const Event = {
523
+ encode(message, writer = new BinaryWriter()) {
524
+ if (!message.id.equals(Long.UZERO)) {
525
+ writer.uint32(8).uint64(message.id.toString());
526
+ }
527
+ if (!message.userId.equals(Long.UZERO)) {
528
+ writer.uint32(16).uint64(message.userId.toString());
529
+ }
530
+ if (!message.deviceId.equals(Long.UZERO)) {
531
+ writer.uint32(24).uint64(message.deviceId.toString());
532
+ }
533
+ if (!message.organizationId.equals(Long.UZERO)) {
534
+ writer.uint32(32).uint64(message.organizationId.toString());
535
+ }
536
+ if (message.createdBy !== undefined) {
537
+ writer.uint32(40).uint64(message.createdBy.toString());
538
+ }
539
+ if (message.name !== "") {
540
+ writer.uint32(50).string(message.name);
541
+ }
542
+ if (message.eventData !== undefined) {
543
+ EventData.encode(message.eventData, writer.uint32(58).fork()).join();
544
+ }
545
+ if (message.status !== false) {
546
+ writer.uint32(72).bool(message.status);
547
+ }
548
+ if (message.createdAt !== undefined) {
549
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
550
+ }
551
+ if (message.updatedAt !== undefined) {
552
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
553
+ }
554
+ return writer;
555
+ },
556
+ decode(input, length) {
557
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
558
+ const end = length === undefined ? reader.len : reader.pos + length;
559
+ const message = createBaseEvent();
560
+ while (reader.pos < end) {
561
+ const tag = reader.uint32();
562
+ switch (tag >>> 3) {
563
+ case 1: {
564
+ if (tag !== 8) {
565
+ break;
566
+ }
567
+ message.id = Long.fromString(reader.uint64().toString(), true);
568
+ continue;
569
+ }
570
+ case 2: {
571
+ if (tag !== 16) {
572
+ break;
573
+ }
574
+ message.userId = Long.fromString(reader.uint64().toString(), true);
575
+ continue;
576
+ }
577
+ case 3: {
578
+ if (tag !== 24) {
579
+ break;
580
+ }
581
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
582
+ continue;
583
+ }
584
+ case 4: {
585
+ if (tag !== 32) {
586
+ break;
587
+ }
588
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
589
+ continue;
590
+ }
591
+ case 5: {
592
+ if (tag !== 40) {
593
+ break;
594
+ }
595
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
596
+ continue;
597
+ }
598
+ case 6: {
599
+ if (tag !== 50) {
600
+ break;
601
+ }
602
+ message.name = reader.string();
603
+ continue;
604
+ }
605
+ case 7: {
606
+ if (tag !== 58) {
607
+ break;
608
+ }
609
+ message.eventData = EventData.decode(reader, reader.uint32());
610
+ continue;
611
+ }
612
+ case 9: {
613
+ if (tag !== 72) {
614
+ break;
615
+ }
616
+ message.status = reader.bool();
617
+ continue;
618
+ }
619
+ case 10: {
620
+ if (tag !== 82) {
621
+ break;
622
+ }
623
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
624
+ continue;
625
+ }
626
+ case 11: {
627
+ if (tag !== 90) {
628
+ break;
629
+ }
630
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
631
+ continue;
632
+ }
633
+ }
634
+ if ((tag & 7) === 4 || tag === 0) {
635
+ break;
636
+ }
637
+ reader.skip(tag & 7);
638
+ }
639
+ return message;
640
+ },
641
+ create(base) {
642
+ return Event.fromPartial(base ?? {});
643
+ },
644
+ fromPartial(object) {
645
+ const message = createBaseEvent();
646
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
647
+ message.userId = (object.userId !== undefined && object.userId !== null)
648
+ ? Long.fromValue(object.userId)
649
+ : Long.UZERO;
650
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
651
+ ? Long.fromValue(object.deviceId)
652
+ : Long.UZERO;
653
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
654
+ ? Long.fromValue(object.organizationId)
655
+ : Long.UZERO;
656
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
657
+ ? Long.fromValue(object.createdBy)
658
+ : undefined;
659
+ message.name = object.name ?? "";
660
+ message.eventData = (object.eventData !== undefined && object.eventData !== null)
661
+ ? EventData.fromPartial(object.eventData)
662
+ : undefined;
663
+ message.status = object.status ?? false;
664
+ message.createdAt = object.createdAt ?? undefined;
665
+ message.updatedAt = object.updatedAt ?? undefined;
666
+ return message;
667
+ },
668
+ };
669
+ function createBaseEventList() {
670
+ return { total: 0, currentPage: 0, lastPage: 0, perPage: 0, events: [] };
671
+ }
672
+ export const EventList = {
673
+ encode(message, writer = new BinaryWriter()) {
674
+ if (message.total !== 0) {
675
+ writer.uint32(8).uint32(message.total);
676
+ }
677
+ if (message.currentPage !== 0) {
678
+ writer.uint32(16).uint32(message.currentPage);
679
+ }
680
+ if (message.lastPage !== 0) {
681
+ writer.uint32(24).uint32(message.lastPage);
682
+ }
683
+ if (message.perPage !== 0) {
684
+ writer.uint32(32).uint32(message.perPage);
685
+ }
686
+ for (const v of message.events) {
687
+ Event.encode(v, writer.uint32(42).fork()).join();
688
+ }
689
+ return writer;
690
+ },
691
+ decode(input, length) {
692
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
693
+ const end = length === undefined ? reader.len : reader.pos + length;
694
+ const message = createBaseEventList();
695
+ while (reader.pos < end) {
696
+ const tag = reader.uint32();
697
+ switch (tag >>> 3) {
698
+ case 1: {
699
+ if (tag !== 8) {
700
+ break;
701
+ }
702
+ message.total = reader.uint32();
703
+ continue;
704
+ }
705
+ case 2: {
706
+ if (tag !== 16) {
707
+ break;
708
+ }
709
+ message.currentPage = reader.uint32();
710
+ continue;
711
+ }
712
+ case 3: {
713
+ if (tag !== 24) {
714
+ break;
715
+ }
716
+ message.lastPage = reader.uint32();
717
+ continue;
718
+ }
719
+ case 4: {
720
+ if (tag !== 32) {
721
+ break;
722
+ }
723
+ message.perPage = reader.uint32();
724
+ continue;
725
+ }
726
+ case 5: {
727
+ if (tag !== 42) {
728
+ break;
729
+ }
730
+ message.events.push(Event.decode(reader, reader.uint32()));
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
+ create(base) {
742
+ return EventList.fromPartial(base ?? {});
743
+ },
744
+ fromPartial(object) {
745
+ const message = createBaseEventList();
746
+ message.total = object.total ?? 0;
747
+ message.currentPage = object.currentPage ?? 0;
748
+ message.lastPage = object.lastPage ?? 0;
749
+ message.perPage = object.perPage ?? 0;
750
+ message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
751
+ return message;
752
+ },
753
+ };
754
+ function createBaseEventTemplate() {
755
+ return {
756
+ id: Long.UZERO,
757
+ organizationId: undefined,
758
+ createdBy: undefined,
759
+ name: "",
760
+ eventData: undefined,
761
+ createdAt: undefined,
762
+ updatedAt: undefined,
763
+ };
764
+ }
765
+ export const EventTemplate = {
766
+ encode(message, writer = new BinaryWriter()) {
767
+ if (!message.id.equals(Long.UZERO)) {
768
+ writer.uint32(8).uint64(message.id.toString());
769
+ }
770
+ if (message.organizationId !== undefined) {
771
+ writer.uint32(16).uint64(message.organizationId.toString());
772
+ }
773
+ if (message.createdBy !== undefined) {
774
+ writer.uint32(24).uint64(message.createdBy.toString());
775
+ }
776
+ if (message.name !== "") {
777
+ writer.uint32(34).string(message.name);
778
+ }
779
+ if (message.eventData !== undefined) {
780
+ EventData.encode(message.eventData, writer.uint32(42).fork()).join();
781
+ }
782
+ if (message.createdAt !== undefined) {
783
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
784
+ }
785
+ if (message.updatedAt !== undefined) {
786
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(58).fork()).join();
787
+ }
788
+ return writer;
789
+ },
790
+ decode(input, length) {
791
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
792
+ const end = length === undefined ? reader.len : reader.pos + length;
793
+ const message = createBaseEventTemplate();
794
+ while (reader.pos < end) {
795
+ const tag = reader.uint32();
796
+ switch (tag >>> 3) {
797
+ case 1: {
798
+ if (tag !== 8) {
799
+ break;
800
+ }
801
+ message.id = Long.fromString(reader.uint64().toString(), true);
802
+ continue;
803
+ }
804
+ case 2: {
805
+ if (tag !== 16) {
806
+ break;
807
+ }
808
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
809
+ continue;
810
+ }
811
+ case 3: {
812
+ if (tag !== 24) {
813
+ break;
814
+ }
815
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
816
+ continue;
817
+ }
818
+ case 4: {
819
+ if (tag !== 34) {
820
+ break;
821
+ }
822
+ message.name = reader.string();
823
+ continue;
824
+ }
825
+ case 5: {
826
+ if (tag !== 42) {
827
+ break;
828
+ }
829
+ message.eventData = EventData.decode(reader, reader.uint32());
830
+ continue;
831
+ }
832
+ case 6: {
833
+ if (tag !== 50) {
834
+ break;
835
+ }
836
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
837
+ continue;
838
+ }
839
+ case 7: {
840
+ if (tag !== 58) {
841
+ break;
842
+ }
843
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
844
+ continue;
845
+ }
846
+ }
847
+ if ((tag & 7) === 4 || tag === 0) {
848
+ break;
849
+ }
850
+ reader.skip(tag & 7);
851
+ }
852
+ return message;
853
+ },
854
+ create(base) {
855
+ return EventTemplate.fromPartial(base ?? {});
856
+ },
857
+ fromPartial(object) {
858
+ const message = createBaseEventTemplate();
859
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
860
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
861
+ ? Long.fromValue(object.organizationId)
862
+ : undefined;
863
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
864
+ ? Long.fromValue(object.createdBy)
865
+ : undefined;
866
+ message.name = object.name ?? "";
867
+ message.eventData = (object.eventData !== undefined && object.eventData !== null)
868
+ ? EventData.fromPartial(object.eventData)
869
+ : undefined;
870
+ message.createdAt = object.createdAt ?? undefined;
871
+ message.updatedAt = object.updatedAt ?? undefined;
872
+ return message;
873
+ },
874
+ };
875
+ function createBaseEventData() {
876
+ return {
877
+ continuous: false,
878
+ blindFilter: false,
879
+ notify: undefined,
880
+ triggerGate: 0,
881
+ muteMask: [],
882
+ eventModules: [],
883
+ via: [],
884
+ templateId: undefined,
885
+ };
886
+ }
887
+ export const EventData = {
888
+ encode(message, writer = new BinaryWriter()) {
889
+ if (message.continuous !== false) {
890
+ writer.uint32(8).bool(message.continuous);
891
+ }
892
+ if (message.blindFilter !== false) {
893
+ writer.uint32(16).bool(message.blindFilter);
894
+ }
895
+ if (message.notify !== undefined) {
896
+ AlertNotify.encode(message.notify, writer.uint32(26).fork()).join();
897
+ }
898
+ if (message.triggerGate !== 0) {
899
+ writer.uint32(32).int32(message.triggerGate);
900
+ }
901
+ for (const v of message.muteMask) {
902
+ MuteMask.encode(v, writer.uint32(42).fork()).join();
903
+ }
904
+ for (const v of message.eventModules) {
905
+ EventModule.encode(v, writer.uint32(50).fork()).join();
906
+ }
907
+ writer.uint32(58).fork();
908
+ for (const v of message.via) {
909
+ writer.int32(v);
910
+ }
911
+ writer.join();
912
+ if (message.templateId !== undefined) {
913
+ writer.uint32(64).uint64(message.templateId.toString());
914
+ }
915
+ return writer;
916
+ },
917
+ decode(input, length) {
918
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
919
+ const end = length === undefined ? reader.len : reader.pos + length;
920
+ const message = createBaseEventData();
921
+ while (reader.pos < end) {
922
+ const tag = reader.uint32();
923
+ switch (tag >>> 3) {
924
+ case 1: {
925
+ if (tag !== 8) {
926
+ break;
927
+ }
928
+ message.continuous = reader.bool();
929
+ continue;
930
+ }
931
+ case 2: {
932
+ if (tag !== 16) {
933
+ break;
934
+ }
935
+ message.blindFilter = reader.bool();
936
+ continue;
937
+ }
938
+ case 3: {
939
+ if (tag !== 26) {
940
+ break;
941
+ }
942
+ message.notify = AlertNotify.decode(reader, reader.uint32());
943
+ continue;
944
+ }
945
+ case 4: {
946
+ if (tag !== 32) {
947
+ break;
948
+ }
949
+ message.triggerGate = reader.int32();
950
+ continue;
951
+ }
952
+ case 5: {
953
+ if (tag !== 42) {
954
+ break;
955
+ }
956
+ message.muteMask.push(MuteMask.decode(reader, reader.uint32()));
957
+ continue;
958
+ }
959
+ case 6: {
960
+ if (tag !== 50) {
961
+ break;
962
+ }
963
+ message.eventModules.push(EventModule.decode(reader, reader.uint32()));
964
+ continue;
965
+ }
966
+ case 7: {
967
+ if (tag === 56) {
968
+ message.via.push(reader.int32());
969
+ continue;
970
+ }
971
+ if (tag === 58) {
972
+ const end2 = reader.uint32() + reader.pos;
973
+ while (reader.pos < end2) {
974
+ message.via.push(reader.int32());
975
+ }
976
+ continue;
977
+ }
978
+ break;
979
+ }
980
+ case 8: {
981
+ if (tag !== 64) {
982
+ break;
983
+ }
984
+ message.templateId = Long.fromString(reader.uint64().toString(), true);
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
+ create(base) {
996
+ return EventData.fromPartial(base ?? {});
997
+ },
998
+ fromPartial(object) {
999
+ const message = createBaseEventData();
1000
+ message.continuous = object.continuous ?? false;
1001
+ message.blindFilter = object.blindFilter ?? false;
1002
+ message.notify = (object.notify !== undefined && object.notify !== null)
1003
+ ? AlertNotify.fromPartial(object.notify)
1004
+ : undefined;
1005
+ message.triggerGate = object.triggerGate ?? 0;
1006
+ message.muteMask = object.muteMask?.map((e) => MuteMask.fromPartial(e)) || [];
1007
+ message.eventModules = object.eventModules?.map((e) => EventModule.fromPartial(e)) || [];
1008
+ message.via = object.via?.map((e) => e) || [];
1009
+ message.templateId = (object.templateId !== undefined && object.templateId !== null)
1010
+ ? Long.fromValue(object.templateId)
1011
+ : undefined;
1012
+ return message;
1013
+ },
1014
+ };
1015
+ function createBaseMuteMask() {
1016
+ return { dayOfMonth: undefined, dayOfWeek: undefined, fromSeconds: undefined, toSeconds: undefined };
1017
+ }
1018
+ export const MuteMask = {
1019
+ encode(message, writer = new BinaryWriter()) {
1020
+ if (message.dayOfMonth !== undefined) {
1021
+ writer.uint32(8).uint32(message.dayOfMonth);
1022
+ }
1023
+ if (message.dayOfWeek !== undefined) {
1024
+ writer.uint32(16).uint32(message.dayOfWeek);
1025
+ }
1026
+ if (message.fromSeconds !== undefined) {
1027
+ writer.uint32(24).uint32(message.fromSeconds);
1028
+ }
1029
+ if (message.toSeconds !== undefined) {
1030
+ writer.uint32(32).uint32(message.toSeconds);
1031
+ }
1032
+ return writer;
1033
+ },
1034
+ decode(input, length) {
1035
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1036
+ const end = length === undefined ? reader.len : reader.pos + length;
1037
+ const message = createBaseMuteMask();
1038
+ while (reader.pos < end) {
1039
+ const tag = reader.uint32();
1040
+ switch (tag >>> 3) {
1041
+ case 1: {
1042
+ if (tag !== 8) {
1043
+ break;
1044
+ }
1045
+ message.dayOfMonth = reader.uint32();
1046
+ continue;
1047
+ }
1048
+ case 2: {
1049
+ if (tag !== 16) {
1050
+ break;
1051
+ }
1052
+ message.dayOfWeek = reader.uint32();
1053
+ continue;
1054
+ }
1055
+ case 3: {
1056
+ if (tag !== 24) {
1057
+ break;
1058
+ }
1059
+ message.fromSeconds = reader.uint32();
1060
+ continue;
1061
+ }
1062
+ case 4: {
1063
+ if (tag !== 32) {
1064
+ break;
1065
+ }
1066
+ message.toSeconds = reader.uint32();
1067
+ continue;
1068
+ }
1069
+ }
1070
+ if ((tag & 7) === 4 || tag === 0) {
1071
+ break;
1072
+ }
1073
+ reader.skip(tag & 7);
1074
+ }
1075
+ return message;
1076
+ },
1077
+ create(base) {
1078
+ return MuteMask.fromPartial(base ?? {});
1079
+ },
1080
+ fromPartial(object) {
1081
+ const message = createBaseMuteMask();
1082
+ message.dayOfMonth = object.dayOfMonth ?? undefined;
1083
+ message.dayOfWeek = object.dayOfWeek ?? undefined;
1084
+ message.fromSeconds = object.fromSeconds ?? undefined;
1085
+ message.toSeconds = object.toSeconds ?? undefined;
1086
+ return message;
1087
+ },
1088
+ };
1089
+ function createBaseAlertNotify() {
1090
+ return { title: "", body: undefined, sound: undefined, image: undefined, icon: undefined };
1091
+ }
1092
+ export const AlertNotify = {
1093
+ encode(message, writer = new BinaryWriter()) {
1094
+ if (message.title !== "") {
1095
+ writer.uint32(10).string(message.title);
1096
+ }
1097
+ if (message.body !== undefined) {
1098
+ writer.uint32(18).string(message.body);
1099
+ }
1100
+ if (message.sound !== undefined) {
1101
+ writer.uint32(26).string(message.sound);
1102
+ }
1103
+ if (message.image !== undefined) {
1104
+ writer.uint32(34).string(message.image);
1105
+ }
1106
+ if (message.icon !== undefined) {
1107
+ writer.uint32(42).string(message.icon);
1108
+ }
1109
+ return writer;
1110
+ },
1111
+ decode(input, length) {
1112
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1113
+ const end = length === undefined ? reader.len : reader.pos + length;
1114
+ const message = createBaseAlertNotify();
1115
+ while (reader.pos < end) {
1116
+ const tag = reader.uint32();
1117
+ switch (tag >>> 3) {
1118
+ case 1: {
1119
+ if (tag !== 10) {
1120
+ break;
1121
+ }
1122
+ message.title = reader.string();
1123
+ continue;
1124
+ }
1125
+ case 2: {
1126
+ if (tag !== 18) {
1127
+ break;
1128
+ }
1129
+ message.body = reader.string();
1130
+ continue;
1131
+ }
1132
+ case 3: {
1133
+ if (tag !== 26) {
1134
+ break;
1135
+ }
1136
+ message.sound = reader.string();
1137
+ continue;
1138
+ }
1139
+ case 4: {
1140
+ if (tag !== 34) {
1141
+ break;
1142
+ }
1143
+ message.image = reader.string();
1144
+ continue;
1145
+ }
1146
+ case 5: {
1147
+ if (tag !== 42) {
1148
+ break;
1149
+ }
1150
+ message.icon = reader.string();
1151
+ continue;
1152
+ }
1153
+ }
1154
+ if ((tag & 7) === 4 || tag === 0) {
1155
+ break;
1156
+ }
1157
+ reader.skip(tag & 7);
1158
+ }
1159
+ return message;
1160
+ },
1161
+ create(base) {
1162
+ return AlertNotify.fromPartial(base ?? {});
1163
+ },
1164
+ fromPartial(object) {
1165
+ const message = createBaseAlertNotify();
1166
+ message.title = object.title ?? "";
1167
+ message.body = object.body ?? undefined;
1168
+ message.sound = object.sound ?? undefined;
1169
+ message.image = object.image ?? undefined;
1170
+ message.icon = object.icon ?? undefined;
1171
+ return message;
1172
+ },
1173
+ };
1174
+ function createBaseAreaEvent() {
1175
+ return { areaId: Long.UZERO, eventType: 0 };
1176
+ }
1177
+ export const AreaEvent = {
1178
+ encode(message, writer = new BinaryWriter()) {
1179
+ if (!message.areaId.equals(Long.UZERO)) {
1180
+ writer.uint32(8).uint64(message.areaId.toString());
1181
+ }
1182
+ if (message.eventType !== 0) {
1183
+ writer.uint32(16).int32(message.eventType);
1184
+ }
1185
+ return writer;
1186
+ },
1187
+ decode(input, length) {
1188
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1189
+ const end = length === undefined ? reader.len : reader.pos + length;
1190
+ const message = createBaseAreaEvent();
1191
+ while (reader.pos < end) {
1192
+ const tag = reader.uint32();
1193
+ switch (tag >>> 3) {
1194
+ case 1: {
1195
+ if (tag !== 8) {
1196
+ break;
1197
+ }
1198
+ message.areaId = Long.fromString(reader.uint64().toString(), true);
1199
+ continue;
1200
+ }
1201
+ case 2: {
1202
+ if (tag !== 16) {
1203
+ break;
1204
+ }
1205
+ message.eventType = reader.int32();
1206
+ continue;
1207
+ }
1208
+ }
1209
+ if ((tag & 7) === 4 || tag === 0) {
1210
+ break;
1211
+ }
1212
+ reader.skip(tag & 7);
1213
+ }
1214
+ return message;
1215
+ },
1216
+ create(base) {
1217
+ return AreaEvent.fromPartial(base ?? {});
1218
+ },
1219
+ fromPartial(object) {
1220
+ const message = createBaseAreaEvent();
1221
+ message.areaId = (object.areaId !== undefined && object.areaId !== null)
1222
+ ? Long.fromValue(object.areaId)
1223
+ : Long.UZERO;
1224
+ message.eventType = object.eventType ?? 0;
1225
+ return message;
1226
+ },
1227
+ };
1228
+ function createBaseDigitalEvent() {
1229
+ return { trigger: false, io: "" };
1230
+ }
1231
+ export const DigitalEvent = {
1232
+ encode(message, writer = new BinaryWriter()) {
1233
+ if (message.trigger !== false) {
1234
+ writer.uint32(8).bool(message.trigger);
1235
+ }
1236
+ if (message.io !== "") {
1237
+ writer.uint32(18).string(message.io);
1238
+ }
1239
+ return writer;
1240
+ },
1241
+ decode(input, length) {
1242
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1243
+ const end = length === undefined ? reader.len : reader.pos + length;
1244
+ const message = createBaseDigitalEvent();
1245
+ while (reader.pos < end) {
1246
+ const tag = reader.uint32();
1247
+ switch (tag >>> 3) {
1248
+ case 1: {
1249
+ if (tag !== 8) {
1250
+ break;
1251
+ }
1252
+ message.trigger = reader.bool();
1253
+ continue;
1254
+ }
1255
+ case 2: {
1256
+ if (tag !== 18) {
1257
+ break;
1258
+ }
1259
+ message.io = reader.string();
1260
+ continue;
1261
+ }
1262
+ }
1263
+ if ((tag & 7) === 4 || tag === 0) {
1264
+ break;
1265
+ }
1266
+ reader.skip(tag & 7);
1267
+ }
1268
+ return message;
1269
+ },
1270
+ create(base) {
1271
+ return DigitalEvent.fromPartial(base ?? {});
1272
+ },
1273
+ fromPartial(object) {
1274
+ const message = createBaseDigitalEvent();
1275
+ message.trigger = object.trigger ?? false;
1276
+ message.io = object.io ?? "";
1277
+ return message;
1278
+ },
1279
+ };
1280
+ function createBaseAnalogEvent() {
1281
+ return { value: 0, io: "", type: 0, tolerancePercent: undefined };
1282
+ }
1283
+ export const AnalogEvent = {
1284
+ encode(message, writer = new BinaryWriter()) {
1285
+ if (message.value !== 0) {
1286
+ writer.uint32(9).double(message.value);
1287
+ }
1288
+ if (message.io !== "") {
1289
+ writer.uint32(18).string(message.io);
1290
+ }
1291
+ if (message.type !== 0) {
1292
+ writer.uint32(24).int32(message.type);
1293
+ }
1294
+ if (message.tolerancePercent !== undefined) {
1295
+ writer.uint32(32).uint32(message.tolerancePercent);
1296
+ }
1297
+ return writer;
1298
+ },
1299
+ decode(input, length) {
1300
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1301
+ const end = length === undefined ? reader.len : reader.pos + length;
1302
+ const message = createBaseAnalogEvent();
1303
+ while (reader.pos < end) {
1304
+ const tag = reader.uint32();
1305
+ switch (tag >>> 3) {
1306
+ case 1: {
1307
+ if (tag !== 9) {
1308
+ break;
1309
+ }
1310
+ message.value = reader.double();
1311
+ continue;
1312
+ }
1313
+ case 2: {
1314
+ if (tag !== 18) {
1315
+ break;
1316
+ }
1317
+ message.io = reader.string();
1318
+ continue;
1319
+ }
1320
+ case 3: {
1321
+ if (tag !== 24) {
1322
+ break;
1323
+ }
1324
+ message.type = reader.int32();
1325
+ continue;
1326
+ }
1327
+ case 4: {
1328
+ if (tag !== 32) {
1329
+ break;
1330
+ }
1331
+ message.tolerancePercent = reader.uint32();
1332
+ continue;
1333
+ }
1334
+ }
1335
+ if ((tag & 7) === 4 || tag === 0) {
1336
+ break;
1337
+ }
1338
+ reader.skip(tag & 7);
1339
+ }
1340
+ return message;
1341
+ },
1342
+ create(base) {
1343
+ return AnalogEvent.fromPartial(base ?? {});
1344
+ },
1345
+ fromPartial(object) {
1346
+ const message = createBaseAnalogEvent();
1347
+ message.value = object.value ?? 0;
1348
+ message.io = object.io ?? "";
1349
+ message.type = object.type ?? 0;
1350
+ message.tolerancePercent = object.tolerancePercent ?? undefined;
1351
+ return message;
1352
+ },
1353
+ };
1354
+ function createBaseFormulaEvent() {
1355
+ return { formula: "" };
1356
+ }
1357
+ export const FormulaEvent = {
1358
+ encode(message, writer = new BinaryWriter()) {
1359
+ if (message.formula !== "") {
1360
+ writer.uint32(10).string(message.formula);
1361
+ }
1362
+ return writer;
1363
+ },
1364
+ decode(input, length) {
1365
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1366
+ const end = length === undefined ? reader.len : reader.pos + length;
1367
+ const message = createBaseFormulaEvent();
1368
+ while (reader.pos < end) {
1369
+ const tag = reader.uint32();
1370
+ switch (tag >>> 3) {
1371
+ case 1: {
1372
+ if (tag !== 10) {
1373
+ break;
1374
+ }
1375
+ message.formula = reader.string();
1376
+ continue;
1377
+ }
1378
+ }
1379
+ if ((tag & 7) === 4 || tag === 0) {
1380
+ break;
1381
+ }
1382
+ reader.skip(tag & 7);
1383
+ }
1384
+ return message;
1385
+ },
1386
+ create(base) {
1387
+ return FormulaEvent.fromPartial(base ?? {});
1388
+ },
1389
+ fromPartial(object) {
1390
+ const message = createBaseFormulaEvent();
1391
+ message.formula = object.formula ?? "";
1392
+ return message;
1393
+ },
1394
+ };
1395
+ function createBaseProtocolEvent() {
1396
+ return { alert: 0 };
1397
+ }
1398
+ export const ProtocolEvent = {
1399
+ encode(message, writer = new BinaryWriter()) {
1400
+ if (message.alert !== 0) {
1401
+ writer.uint32(8).int32(message.alert);
1402
+ }
1403
+ return writer;
1404
+ },
1405
+ decode(input, length) {
1406
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1407
+ const end = length === undefined ? reader.len : reader.pos + length;
1408
+ const message = createBaseProtocolEvent();
1409
+ while (reader.pos < end) {
1410
+ const tag = reader.uint32();
1411
+ switch (tag >>> 3) {
1412
+ case 1: {
1413
+ if (tag !== 8) {
1414
+ break;
1415
+ }
1416
+ message.alert = reader.int32();
1417
+ continue;
1418
+ }
1419
+ }
1420
+ if ((tag & 7) === 4 || tag === 0) {
1421
+ break;
1422
+ }
1423
+ reader.skip(tag & 7);
1424
+ }
1425
+ return message;
1426
+ },
1427
+ create(base) {
1428
+ return ProtocolEvent.fromPartial(base ?? {});
1429
+ },
1430
+ fromPartial(object) {
1431
+ const message = createBaseProtocolEvent();
1432
+ message.alert = object.alert ?? 0;
1433
+ return message;
1434
+ },
1435
+ };
1436
+ function createBaseSpeedEvent() {
1437
+ return { speedLimit: 0 };
1438
+ }
1439
+ export const SpeedEvent = {
1440
+ encode(message, writer = new BinaryWriter()) {
1441
+ if (message.speedLimit !== 0) {
1442
+ writer.uint32(8).uint32(message.speedLimit);
1443
+ }
1444
+ return writer;
1445
+ },
1446
+ decode(input, length) {
1447
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1448
+ const end = length === undefined ? reader.len : reader.pos + length;
1449
+ const message = createBaseSpeedEvent();
1450
+ while (reader.pos < end) {
1451
+ const tag = reader.uint32();
1452
+ switch (tag >>> 3) {
1453
+ case 1: {
1454
+ if (tag !== 8) {
1455
+ break;
1456
+ }
1457
+ message.speedLimit = reader.uint32();
1458
+ continue;
1459
+ }
1460
+ }
1461
+ if ((tag & 7) === 4 || tag === 0) {
1462
+ break;
1463
+ }
1464
+ reader.skip(tag & 7);
1465
+ }
1466
+ return message;
1467
+ },
1468
+ create(base) {
1469
+ return SpeedEvent.fromPartial(base ?? {});
1470
+ },
1471
+ fromPartial(object) {
1472
+ const message = createBaseSpeedEvent();
1473
+ message.speedLimit = object.speedLimit ?? 0;
1474
+ return message;
1475
+ },
1476
+ };
1477
+ function createBaseIgnitionEvent() {
1478
+ return { ignitionOn: false, ignitionOff: false };
1479
+ }
1480
+ export const IgnitionEvent = {
1481
+ encode(message, writer = new BinaryWriter()) {
1482
+ if (message.ignitionOn !== false) {
1483
+ writer.uint32(8).bool(message.ignitionOn);
1484
+ }
1485
+ if (message.ignitionOff !== false) {
1486
+ writer.uint32(16).bool(message.ignitionOff);
1487
+ }
1488
+ return writer;
1489
+ },
1490
+ decode(input, length) {
1491
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1492
+ const end = length === undefined ? reader.len : reader.pos + length;
1493
+ const message = createBaseIgnitionEvent();
1494
+ while (reader.pos < end) {
1495
+ const tag = reader.uint32();
1496
+ switch (tag >>> 3) {
1497
+ case 1: {
1498
+ if (tag !== 8) {
1499
+ break;
1500
+ }
1501
+ message.ignitionOn = reader.bool();
1502
+ continue;
1503
+ }
1504
+ case 2: {
1505
+ if (tag !== 16) {
1506
+ break;
1507
+ }
1508
+ message.ignitionOff = reader.bool();
1509
+ continue;
1510
+ }
1511
+ }
1512
+ if ((tag & 7) === 4 || tag === 0) {
1513
+ break;
1514
+ }
1515
+ reader.skip(tag & 7);
1516
+ }
1517
+ return message;
1518
+ },
1519
+ create(base) {
1520
+ return IgnitionEvent.fromPartial(base ?? {});
1521
+ },
1522
+ fromPartial(object) {
1523
+ const message = createBaseIgnitionEvent();
1524
+ message.ignitionOn = object.ignitionOn ?? false;
1525
+ message.ignitionOff = object.ignitionOff ?? false;
1526
+ return message;
1527
+ },
1528
+ };
1529
+ function createBaseBatteryEvent() {
1530
+ return { percentBelow: 0 };
1531
+ }
1532
+ export const BatteryEvent = {
1533
+ encode(message, writer = new BinaryWriter()) {
1534
+ if (message.percentBelow !== 0) {
1535
+ writer.uint32(8).uint32(message.percentBelow);
1536
+ }
1537
+ return writer;
1538
+ },
1539
+ decode(input, length) {
1540
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1541
+ const end = length === undefined ? reader.len : reader.pos + length;
1542
+ const message = createBaseBatteryEvent();
1543
+ while (reader.pos < end) {
1544
+ const tag = reader.uint32();
1545
+ switch (tag >>> 3) {
1546
+ case 1: {
1547
+ if (tag !== 8) {
1548
+ break;
1549
+ }
1550
+ message.percentBelow = reader.uint32();
1551
+ continue;
1552
+ }
1553
+ }
1554
+ if ((tag & 7) === 4 || tag === 0) {
1555
+ break;
1556
+ }
1557
+ reader.skip(tag & 7);
1558
+ }
1559
+ return message;
1560
+ },
1561
+ create(base) {
1562
+ return BatteryEvent.fromPartial(base ?? {});
1563
+ },
1564
+ fromPartial(object) {
1565
+ const message = createBaseBatteryEvent();
1566
+ message.percentBelow = object.percentBelow ?? 0;
1567
+ return message;
1568
+ },
1569
+ };
1570
+ function createBaseOfflineEvent() {
1571
+ return { seconds: Long.ZERO };
1572
+ }
1573
+ export const OfflineEvent = {
1574
+ encode(message, writer = new BinaryWriter()) {
1575
+ if (!message.seconds.equals(Long.ZERO)) {
1576
+ writer.uint32(8).int64(message.seconds.toString());
1577
+ }
1578
+ return writer;
1579
+ },
1580
+ decode(input, length) {
1581
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1582
+ const end = length === undefined ? reader.len : reader.pos + length;
1583
+ const message = createBaseOfflineEvent();
1584
+ while (reader.pos < end) {
1585
+ const tag = reader.uint32();
1586
+ switch (tag >>> 3) {
1587
+ case 1: {
1588
+ if (tag !== 8) {
1589
+ break;
1590
+ }
1591
+ message.seconds = Long.fromString(reader.int64().toString());
1592
+ continue;
1593
+ }
1594
+ }
1595
+ if ((tag & 7) === 4 || tag === 0) {
1596
+ break;
1597
+ }
1598
+ reader.skip(tag & 7);
1599
+ }
1600
+ return message;
1601
+ },
1602
+ create(base) {
1603
+ return OfflineEvent.fromPartial(base ?? {});
1604
+ },
1605
+ fromPartial(object) {
1606
+ const message = createBaseOfflineEvent();
1607
+ message.seconds = (object.seconds !== undefined && object.seconds !== null)
1608
+ ? Long.fromValue(object.seconds)
1609
+ : Long.ZERO;
1610
+ return message;
1611
+ },
1612
+ };
1613
+ function createBaseGpsEvent() {
1614
+ return { satellitesBelow: 0 };
1615
+ }
1616
+ export const GpsEvent = {
1617
+ encode(message, writer = new BinaryWriter()) {
1618
+ if (message.satellitesBelow !== 0) {
1619
+ writer.uint32(8).uint32(message.satellitesBelow);
1620
+ }
1621
+ return writer;
1622
+ },
1623
+ decode(input, length) {
1624
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1625
+ const end = length === undefined ? reader.len : reader.pos + length;
1626
+ const message = createBaseGpsEvent();
1627
+ while (reader.pos < end) {
1628
+ const tag = reader.uint32();
1629
+ switch (tag >>> 3) {
1630
+ case 1: {
1631
+ if (tag !== 8) {
1632
+ break;
1633
+ }
1634
+ message.satellitesBelow = reader.uint32();
1635
+ continue;
1636
+ }
1637
+ }
1638
+ if ((tag & 7) === 4 || tag === 0) {
1639
+ break;
1640
+ }
1641
+ reader.skip(tag & 7);
1642
+ }
1643
+ return message;
1644
+ },
1645
+ create(base) {
1646
+ return GpsEvent.fromPartial(base ?? {});
1647
+ },
1648
+ fromPartial(object) {
1649
+ const message = createBaseGpsEvent();
1650
+ message.satellitesBelow = object.satellitesBelow ?? 0;
1651
+ return message;
1652
+ },
1653
+ };
1654
+ function createBaseGsmEvent() {
1655
+ return { signalBelow: 0 };
1656
+ }
1657
+ export const GsmEvent = {
1658
+ encode(message, writer = new BinaryWriter()) {
1659
+ if (message.signalBelow !== 0) {
1660
+ writer.uint32(8).uint32(message.signalBelow);
1661
+ }
1662
+ return writer;
1663
+ },
1664
+ decode(input, length) {
1665
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1666
+ const end = length === undefined ? reader.len : reader.pos + length;
1667
+ const message = createBaseGsmEvent();
1668
+ while (reader.pos < end) {
1669
+ const tag = reader.uint32();
1670
+ switch (tag >>> 3) {
1671
+ case 1: {
1672
+ if (tag !== 8) {
1673
+ break;
1674
+ }
1675
+ message.signalBelow = reader.uint32();
1676
+ continue;
1677
+ }
1678
+ }
1679
+ if ((tag & 7) === 4 || tag === 0) {
1680
+ break;
1681
+ }
1682
+ reader.skip(tag & 7);
1683
+ }
1684
+ return message;
1685
+ },
1686
+ create(base) {
1687
+ return GsmEvent.fromPartial(base ?? {});
1688
+ },
1689
+ fromPartial(object) {
1690
+ const message = createBaseGsmEvent();
1691
+ message.signalBelow = object.signalBelow ?? 0;
1692
+ return message;
1693
+ },
1694
+ };
1695
+ function createBaseEventModule() {
1696
+ return {
1697
+ forceToFill: false,
1698
+ areaEvent: undefined,
1699
+ digitalEvent: undefined,
1700
+ analogEvent: undefined,
1701
+ formulaEvent: undefined,
1702
+ protocolEvent: undefined,
1703
+ speedEvent: undefined,
1704
+ ignitionEvent: undefined,
1705
+ batteryEvent: undefined,
1706
+ offlineEvent: undefined,
1707
+ gpsEvent: undefined,
1708
+ gsmEvent: undefined,
1709
+ };
1710
+ }
1711
+ export const EventModule = {
1712
+ encode(message, writer = new BinaryWriter()) {
1713
+ if (message.forceToFill !== false) {
1714
+ writer.uint32(8).bool(message.forceToFill);
1715
+ }
1716
+ if (message.areaEvent !== undefined) {
1717
+ AreaEvent.encode(message.areaEvent, writer.uint32(170).fork()).join();
1718
+ }
1719
+ if (message.digitalEvent !== undefined) {
1720
+ DigitalEvent.encode(message.digitalEvent, writer.uint32(178).fork()).join();
1721
+ }
1722
+ if (message.analogEvent !== undefined) {
1723
+ AnalogEvent.encode(message.analogEvent, writer.uint32(186).fork()).join();
1724
+ }
1725
+ if (message.formulaEvent !== undefined) {
1726
+ FormulaEvent.encode(message.formulaEvent, writer.uint32(194).fork()).join();
1727
+ }
1728
+ if (message.protocolEvent !== undefined) {
1729
+ ProtocolEvent.encode(message.protocolEvent, writer.uint32(202).fork()).join();
1730
+ }
1731
+ if (message.speedEvent !== undefined) {
1732
+ SpeedEvent.encode(message.speedEvent, writer.uint32(210).fork()).join();
1733
+ }
1734
+ if (message.ignitionEvent !== undefined) {
1735
+ IgnitionEvent.encode(message.ignitionEvent, writer.uint32(218).fork()).join();
1736
+ }
1737
+ if (message.batteryEvent !== undefined) {
1738
+ BatteryEvent.encode(message.batteryEvent, writer.uint32(226).fork()).join();
1739
+ }
1740
+ if (message.offlineEvent !== undefined) {
1741
+ OfflineEvent.encode(message.offlineEvent, writer.uint32(234).fork()).join();
1742
+ }
1743
+ if (message.gpsEvent !== undefined) {
1744
+ GpsEvent.encode(message.gpsEvent, writer.uint32(242).fork()).join();
1745
+ }
1746
+ if (message.gsmEvent !== undefined) {
1747
+ GsmEvent.encode(message.gsmEvent, writer.uint32(250).fork()).join();
1748
+ }
1749
+ return writer;
1750
+ },
1751
+ decode(input, length) {
1752
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1753
+ const end = length === undefined ? reader.len : reader.pos + length;
1754
+ const message = createBaseEventModule();
1755
+ while (reader.pos < end) {
1756
+ const tag = reader.uint32();
1757
+ switch (tag >>> 3) {
1758
+ case 1: {
1759
+ if (tag !== 8) {
1760
+ break;
1761
+ }
1762
+ message.forceToFill = reader.bool();
1763
+ continue;
1764
+ }
1765
+ case 21: {
1766
+ if (tag !== 170) {
1767
+ break;
1768
+ }
1769
+ message.areaEvent = AreaEvent.decode(reader, reader.uint32());
1770
+ continue;
1771
+ }
1772
+ case 22: {
1773
+ if (tag !== 178) {
1774
+ break;
1775
+ }
1776
+ message.digitalEvent = DigitalEvent.decode(reader, reader.uint32());
1777
+ continue;
1778
+ }
1779
+ case 23: {
1780
+ if (tag !== 186) {
1781
+ break;
1782
+ }
1783
+ message.analogEvent = AnalogEvent.decode(reader, reader.uint32());
1784
+ continue;
1785
+ }
1786
+ case 24: {
1787
+ if (tag !== 194) {
1788
+ break;
1789
+ }
1790
+ message.formulaEvent = FormulaEvent.decode(reader, reader.uint32());
1791
+ continue;
1792
+ }
1793
+ case 25: {
1794
+ if (tag !== 202) {
1795
+ break;
1796
+ }
1797
+ message.protocolEvent = ProtocolEvent.decode(reader, reader.uint32());
1798
+ continue;
1799
+ }
1800
+ case 26: {
1801
+ if (tag !== 210) {
1802
+ break;
1803
+ }
1804
+ message.speedEvent = SpeedEvent.decode(reader, reader.uint32());
1805
+ continue;
1806
+ }
1807
+ case 27: {
1808
+ if (tag !== 218) {
1809
+ break;
1810
+ }
1811
+ message.ignitionEvent = IgnitionEvent.decode(reader, reader.uint32());
1812
+ continue;
1813
+ }
1814
+ case 28: {
1815
+ if (tag !== 226) {
1816
+ break;
1817
+ }
1818
+ message.batteryEvent = BatteryEvent.decode(reader, reader.uint32());
1819
+ continue;
1820
+ }
1821
+ case 29: {
1822
+ if (tag !== 234) {
1823
+ break;
1824
+ }
1825
+ message.offlineEvent = OfflineEvent.decode(reader, reader.uint32());
1826
+ continue;
1827
+ }
1828
+ case 30: {
1829
+ if (tag !== 242) {
1830
+ break;
1831
+ }
1832
+ message.gpsEvent = GpsEvent.decode(reader, reader.uint32());
1833
+ continue;
1834
+ }
1835
+ case 31: {
1836
+ if (tag !== 250) {
1837
+ break;
1838
+ }
1839
+ message.gsmEvent = GsmEvent.decode(reader, reader.uint32());
1840
+ continue;
1841
+ }
1842
+ }
1843
+ if ((tag & 7) === 4 || tag === 0) {
1844
+ break;
1845
+ }
1846
+ reader.skip(tag & 7);
1847
+ }
1848
+ return message;
1849
+ },
1850
+ create(base) {
1851
+ return EventModule.fromPartial(base ?? {});
1852
+ },
1853
+ fromPartial(object) {
1854
+ const message = createBaseEventModule();
1855
+ message.forceToFill = object.forceToFill ?? false;
1856
+ message.areaEvent = (object.areaEvent !== undefined && object.areaEvent !== null)
1857
+ ? AreaEvent.fromPartial(object.areaEvent)
1858
+ : undefined;
1859
+ message.digitalEvent = (object.digitalEvent !== undefined && object.digitalEvent !== null)
1860
+ ? DigitalEvent.fromPartial(object.digitalEvent)
1861
+ : undefined;
1862
+ message.analogEvent = (object.analogEvent !== undefined && object.analogEvent !== null)
1863
+ ? AnalogEvent.fromPartial(object.analogEvent)
1864
+ : undefined;
1865
+ message.formulaEvent = (object.formulaEvent !== undefined && object.formulaEvent !== null)
1866
+ ? FormulaEvent.fromPartial(object.formulaEvent)
1867
+ : undefined;
1868
+ message.protocolEvent = (object.protocolEvent !== undefined && object.protocolEvent !== null)
1869
+ ? ProtocolEvent.fromPartial(object.protocolEvent)
1870
+ : undefined;
1871
+ message.speedEvent = (object.speedEvent !== undefined && object.speedEvent !== null)
1872
+ ? SpeedEvent.fromPartial(object.speedEvent)
1873
+ : undefined;
1874
+ message.ignitionEvent = (object.ignitionEvent !== undefined && object.ignitionEvent !== null)
1875
+ ? IgnitionEvent.fromPartial(object.ignitionEvent)
1876
+ : undefined;
1877
+ message.batteryEvent = (object.batteryEvent !== undefined && object.batteryEvent !== null)
1878
+ ? BatteryEvent.fromPartial(object.batteryEvent)
1879
+ : undefined;
1880
+ message.offlineEvent = (object.offlineEvent !== undefined && object.offlineEvent !== null)
1881
+ ? OfflineEvent.fromPartial(object.offlineEvent)
1882
+ : undefined;
1883
+ message.gpsEvent = (object.gpsEvent !== undefined && object.gpsEvent !== null)
1884
+ ? GpsEvent.fromPartial(object.gpsEvent)
1885
+ : undefined;
1886
+ message.gsmEvent = (object.gsmEvent !== undefined && object.gsmEvent !== null)
1887
+ ? GsmEvent.fromPartial(object.gsmEvent)
1888
+ : undefined;
1889
+ return message;
1890
+ },
1891
+ };
1892
+ function createBaseIsRunningCache() {
1893
+ return { isRunning: false, notifiedAt: Long.ZERO };
1894
+ }
1895
+ export const IsRunningCache = {
1896
+ encode(message, writer = new BinaryWriter()) {
1897
+ if (message.isRunning !== false) {
1898
+ writer.uint32(8).bool(message.isRunning);
1899
+ }
1900
+ if (!message.notifiedAt.equals(Long.ZERO)) {
1901
+ writer.uint32(16).int64(message.notifiedAt.toString());
1902
+ }
1903
+ return writer;
1904
+ },
1905
+ decode(input, length) {
1906
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1907
+ const end = length === undefined ? reader.len : reader.pos + length;
1908
+ const message = createBaseIsRunningCache();
1909
+ while (reader.pos < end) {
1910
+ const tag = reader.uint32();
1911
+ switch (tag >>> 3) {
1912
+ case 1: {
1913
+ if (tag !== 8) {
1914
+ break;
1915
+ }
1916
+ message.isRunning = reader.bool();
1917
+ continue;
1918
+ }
1919
+ case 2: {
1920
+ if (tag !== 16) {
1921
+ break;
1922
+ }
1923
+ message.notifiedAt = Long.fromString(reader.int64().toString());
1924
+ continue;
1925
+ }
1926
+ }
1927
+ if ((tag & 7) === 4 || tag === 0) {
1928
+ break;
1929
+ }
1930
+ reader.skip(tag & 7);
1931
+ }
1932
+ return message;
1933
+ },
1934
+ create(base) {
1935
+ return IsRunningCache.fromPartial(base ?? {});
1936
+ },
1937
+ fromPartial(object) {
1938
+ const message = createBaseIsRunningCache();
1939
+ message.isRunning = object.isRunning ?? false;
1940
+ message.notifiedAt = (object.notifiedAt !== undefined && object.notifiedAt !== null)
1941
+ ? Long.fromValue(object.notifiedAt)
1942
+ : Long.ZERO;
1943
+ return message;
1944
+ },
1945
+ };
1946
+ function toTimestamp(date) {
1947
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
1948
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1949
+ return { seconds, nanos };
1950
+ }
1951
+ function fromTimestamp(t) {
1952
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
1953
+ millis += (t.nanos || 0) / 1_000_000;
1954
+ return new globalThis.Date(millis);
1955
+ }
1956
+ function numberToLong(number) {
1957
+ return Long.fromNumber(number);
1958
+ }