@fatehan/tsrp 1.6.16 → 1.6.17

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