@fatehan/tsrp 1.6.17 → 1.6.19

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 +1610 -0
  56. package/dist/fatehan/packets/dataModel.d.ts.map +1 -0
  57. package/dist/fatehan/packets/dataModel.js +14947 -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 +1220 -0
  65. package/dist/fatehan/services/api.d.ts.map +1 -0
  66. package/dist/fatehan/services/api.js +12660 -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,761 @@
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: areas/area.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 { Organization } from "../identities/identities";
11
+ export const protobufPackage = "com.fatehan.areas";
12
+ /** AreaType defines the shape of the area. */
13
+ export var AreaType;
14
+ (function (AreaType) {
15
+ AreaType[AreaType["CIRCLE"] = 0] = "CIRCLE";
16
+ AreaType[AreaType["POLYGON"] = 1] = "POLYGON";
17
+ AreaType[AreaType["RECTANGLE"] = 2] = "RECTANGLE";
18
+ AreaType[AreaType["MARKER"] = 4] = "MARKER";
19
+ AreaType[AreaType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
+ })(AreaType || (AreaType = {}));
21
+ function createBasePoint() {
22
+ return { latitude: 0, longitude: 0 };
23
+ }
24
+ export const Point = {
25
+ encode(message, writer = new BinaryWriter()) {
26
+ if (message.latitude !== 0) {
27
+ writer.uint32(13).float(message.latitude);
28
+ }
29
+ if (message.longitude !== 0) {
30
+ writer.uint32(21).float(message.longitude);
31
+ }
32
+ return writer;
33
+ },
34
+ decode(input, length) {
35
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
36
+ const end = length === undefined ? reader.len : reader.pos + length;
37
+ const message = createBasePoint();
38
+ while (reader.pos < end) {
39
+ const tag = reader.uint32();
40
+ switch (tag >>> 3) {
41
+ case 1: {
42
+ if (tag !== 13) {
43
+ break;
44
+ }
45
+ message.latitude = reader.float();
46
+ continue;
47
+ }
48
+ case 2: {
49
+ if (tag !== 21) {
50
+ break;
51
+ }
52
+ message.longitude = reader.float();
53
+ continue;
54
+ }
55
+ }
56
+ if ((tag & 7) === 4 || tag === 0) {
57
+ break;
58
+ }
59
+ reader.skip(tag & 7);
60
+ }
61
+ return message;
62
+ },
63
+ create(base) {
64
+ return Point.fromPartial(base ?? {});
65
+ },
66
+ fromPartial(object) {
67
+ const message = createBasePoint();
68
+ message.latitude = object.latitude ?? 0;
69
+ message.longitude = object.longitude ?? 0;
70
+ return message;
71
+ },
72
+ };
73
+ function createBaseArea() {
74
+ return {
75
+ id: Long.UZERO,
76
+ type: 0,
77
+ name: undefined,
78
+ organizationId: Long.UZERO,
79
+ radius: undefined,
80
+ color: undefined,
81
+ createdBy: undefined,
82
+ updatedBy: undefined,
83
+ categoryId: undefined,
84
+ createdAt: undefined,
85
+ updatedAt: undefined,
86
+ category: undefined,
87
+ organization: undefined,
88
+ coordinates: [],
89
+ };
90
+ }
91
+ export const Area = {
92
+ encode(message, writer = new BinaryWriter()) {
93
+ if (!message.id.equals(Long.UZERO)) {
94
+ writer.uint32(8).uint64(message.id.toString());
95
+ }
96
+ if (message.type !== 0) {
97
+ writer.uint32(16).int32(message.type);
98
+ }
99
+ if (message.name !== undefined) {
100
+ writer.uint32(26).string(message.name);
101
+ }
102
+ if (!message.organizationId.equals(Long.UZERO)) {
103
+ writer.uint32(32).uint64(message.organizationId.toString());
104
+ }
105
+ if (message.radius !== undefined) {
106
+ writer.uint32(45).float(message.radius);
107
+ }
108
+ if (message.color !== undefined) {
109
+ writer.uint32(50).string(message.color);
110
+ }
111
+ if (message.createdBy !== undefined) {
112
+ writer.uint32(56).uint64(message.createdBy.toString());
113
+ }
114
+ if (message.updatedBy !== undefined) {
115
+ writer.uint32(64).uint64(message.updatedBy.toString());
116
+ }
117
+ if (message.categoryId !== undefined) {
118
+ writer.uint32(72).uint64(message.categoryId.toString());
119
+ }
120
+ if (message.createdAt !== undefined) {
121
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
122
+ }
123
+ if (message.updatedAt !== undefined) {
124
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
125
+ }
126
+ if (message.category !== undefined) {
127
+ AreaCategory.encode(message.category, writer.uint32(106).fork()).join();
128
+ }
129
+ if (message.organization !== undefined) {
130
+ Organization.encode(message.organization, writer.uint32(114).fork()).join();
131
+ }
132
+ for (const v of message.coordinates) {
133
+ Point.encode(v, writer.uint32(98).fork()).join();
134
+ }
135
+ return writer;
136
+ },
137
+ decode(input, length) {
138
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
139
+ const end = length === undefined ? reader.len : reader.pos + length;
140
+ const message = createBaseArea();
141
+ while (reader.pos < end) {
142
+ const tag = reader.uint32();
143
+ switch (tag >>> 3) {
144
+ case 1: {
145
+ if (tag !== 8) {
146
+ break;
147
+ }
148
+ message.id = Long.fromString(reader.uint64().toString(), true);
149
+ continue;
150
+ }
151
+ case 2: {
152
+ if (tag !== 16) {
153
+ break;
154
+ }
155
+ message.type = reader.int32();
156
+ continue;
157
+ }
158
+ case 3: {
159
+ if (tag !== 26) {
160
+ break;
161
+ }
162
+ message.name = reader.string();
163
+ continue;
164
+ }
165
+ case 4: {
166
+ if (tag !== 32) {
167
+ break;
168
+ }
169
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
170
+ continue;
171
+ }
172
+ case 5: {
173
+ if (tag !== 45) {
174
+ break;
175
+ }
176
+ message.radius = reader.float();
177
+ continue;
178
+ }
179
+ case 6: {
180
+ if (tag !== 50) {
181
+ break;
182
+ }
183
+ message.color = reader.string();
184
+ continue;
185
+ }
186
+ case 7: {
187
+ if (tag !== 56) {
188
+ break;
189
+ }
190
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
191
+ continue;
192
+ }
193
+ case 8: {
194
+ if (tag !== 64) {
195
+ break;
196
+ }
197
+ message.updatedBy = Long.fromString(reader.uint64().toString(), true);
198
+ continue;
199
+ }
200
+ case 9: {
201
+ if (tag !== 72) {
202
+ break;
203
+ }
204
+ message.categoryId = Long.fromString(reader.uint64().toString(), true);
205
+ continue;
206
+ }
207
+ case 10: {
208
+ if (tag !== 82) {
209
+ break;
210
+ }
211
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
212
+ continue;
213
+ }
214
+ case 11: {
215
+ if (tag !== 90) {
216
+ break;
217
+ }
218
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
219
+ continue;
220
+ }
221
+ case 13: {
222
+ if (tag !== 106) {
223
+ break;
224
+ }
225
+ message.category = AreaCategory.decode(reader, reader.uint32());
226
+ continue;
227
+ }
228
+ case 14: {
229
+ if (tag !== 114) {
230
+ break;
231
+ }
232
+ message.organization = Organization.decode(reader, reader.uint32());
233
+ continue;
234
+ }
235
+ case 12: {
236
+ if (tag !== 98) {
237
+ break;
238
+ }
239
+ message.coordinates.push(Point.decode(reader, reader.uint32()));
240
+ continue;
241
+ }
242
+ }
243
+ if ((tag & 7) === 4 || tag === 0) {
244
+ break;
245
+ }
246
+ reader.skip(tag & 7);
247
+ }
248
+ return message;
249
+ },
250
+ create(base) {
251
+ return Area.fromPartial(base ?? {});
252
+ },
253
+ fromPartial(object) {
254
+ const message = createBaseArea();
255
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
256
+ message.type = object.type ?? 0;
257
+ message.name = object.name ?? undefined;
258
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
259
+ ? Long.fromValue(object.organizationId)
260
+ : Long.UZERO;
261
+ message.radius = object.radius ?? undefined;
262
+ message.color = object.color ?? undefined;
263
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
264
+ ? Long.fromValue(object.createdBy)
265
+ : undefined;
266
+ message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
267
+ ? Long.fromValue(object.updatedBy)
268
+ : undefined;
269
+ message.categoryId = (object.categoryId !== undefined && object.categoryId !== null)
270
+ ? Long.fromValue(object.categoryId)
271
+ : undefined;
272
+ message.createdAt = object.createdAt ?? undefined;
273
+ message.updatedAt = object.updatedAt ?? undefined;
274
+ message.category = (object.category !== undefined && object.category !== null)
275
+ ? AreaCategory.fromPartial(object.category)
276
+ : undefined;
277
+ message.organization = (object.organization !== undefined && object.organization !== null)
278
+ ? Organization.fromPartial(object.organization)
279
+ : undefined;
280
+ message.coordinates = object.coordinates?.map((e) => Point.fromPartial(e)) || [];
281
+ return message;
282
+ },
283
+ };
284
+ function createBaseWorkCycle() {
285
+ return {
286
+ deviceId: Long.UZERO,
287
+ deviceName: "",
288
+ start: undefined,
289
+ finish: undefined,
290
+ area: undefined,
291
+ startedAt: undefined,
292
+ finishedAt: undefined,
293
+ mileage: 0,
294
+ duration: 0,
295
+ };
296
+ }
297
+ export const WorkCycle = {
298
+ encode(message, writer = new BinaryWriter()) {
299
+ if (!message.deviceId.equals(Long.UZERO)) {
300
+ writer.uint32(8).uint64(message.deviceId.toString());
301
+ }
302
+ if (message.deviceName !== "") {
303
+ writer.uint32(18).string(message.deviceName);
304
+ }
305
+ if (message.start !== undefined) {
306
+ WorkCycle_Event.encode(message.start, writer.uint32(26).fork()).join();
307
+ }
308
+ if (message.finish !== undefined) {
309
+ WorkCycle_Event.encode(message.finish, writer.uint32(34).fork()).join();
310
+ }
311
+ if (message.area !== undefined) {
312
+ WorkCycle_Event.encode(message.area, writer.uint32(42).fork()).join();
313
+ }
314
+ if (message.startedAt !== undefined) {
315
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(50).fork()).join();
316
+ }
317
+ if (message.finishedAt !== undefined) {
318
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(58).fork()).join();
319
+ }
320
+ if (message.mileage !== 0) {
321
+ writer.uint32(64).uint32(message.mileage);
322
+ }
323
+ if (message.duration !== 0) {
324
+ writer.uint32(72).uint32(message.duration);
325
+ }
326
+ return writer;
327
+ },
328
+ decode(input, length) {
329
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
330
+ const end = length === undefined ? reader.len : reader.pos + length;
331
+ const message = createBaseWorkCycle();
332
+ while (reader.pos < end) {
333
+ const tag = reader.uint32();
334
+ switch (tag >>> 3) {
335
+ case 1: {
336
+ if (tag !== 8) {
337
+ break;
338
+ }
339
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
340
+ continue;
341
+ }
342
+ case 2: {
343
+ if (tag !== 18) {
344
+ break;
345
+ }
346
+ message.deviceName = reader.string();
347
+ continue;
348
+ }
349
+ case 3: {
350
+ if (tag !== 26) {
351
+ break;
352
+ }
353
+ message.start = WorkCycle_Event.decode(reader, reader.uint32());
354
+ continue;
355
+ }
356
+ case 4: {
357
+ if (tag !== 34) {
358
+ break;
359
+ }
360
+ message.finish = WorkCycle_Event.decode(reader, reader.uint32());
361
+ continue;
362
+ }
363
+ case 5: {
364
+ if (tag !== 42) {
365
+ break;
366
+ }
367
+ message.area = WorkCycle_Event.decode(reader, reader.uint32());
368
+ continue;
369
+ }
370
+ case 6: {
371
+ if (tag !== 50) {
372
+ break;
373
+ }
374
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
375
+ continue;
376
+ }
377
+ case 7: {
378
+ if (tag !== 58) {
379
+ break;
380
+ }
381
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
382
+ continue;
383
+ }
384
+ case 8: {
385
+ if (tag !== 64) {
386
+ break;
387
+ }
388
+ message.mileage = reader.uint32();
389
+ continue;
390
+ }
391
+ case 9: {
392
+ if (tag !== 72) {
393
+ break;
394
+ }
395
+ message.duration = reader.uint32();
396
+ continue;
397
+ }
398
+ }
399
+ if ((tag & 7) === 4 || tag === 0) {
400
+ break;
401
+ }
402
+ reader.skip(tag & 7);
403
+ }
404
+ return message;
405
+ },
406
+ create(base) {
407
+ return WorkCycle.fromPartial(base ?? {});
408
+ },
409
+ fromPartial(object) {
410
+ const message = createBaseWorkCycle();
411
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
412
+ ? Long.fromValue(object.deviceId)
413
+ : Long.UZERO;
414
+ message.deviceName = object.deviceName ?? "";
415
+ message.start = (object.start !== undefined && object.start !== null)
416
+ ? WorkCycle_Event.fromPartial(object.start)
417
+ : undefined;
418
+ message.finish = (object.finish !== undefined && object.finish !== null)
419
+ ? WorkCycle_Event.fromPartial(object.finish)
420
+ : undefined;
421
+ message.area = (object.area !== undefined && object.area !== null)
422
+ ? WorkCycle_Event.fromPartial(object.area)
423
+ : undefined;
424
+ message.startedAt = object.startedAt ?? undefined;
425
+ message.finishedAt = object.finishedAt ?? undefined;
426
+ message.mileage = object.mileage ?? 0;
427
+ message.duration = object.duration ?? 0;
428
+ return message;
429
+ },
430
+ };
431
+ function createBaseWorkCycle_Event() {
432
+ return {
433
+ id: Long.UZERO,
434
+ name: undefined,
435
+ enteredPoint: undefined,
436
+ enteredAt: undefined,
437
+ exitedPoint: undefined,
438
+ exitedAt: undefined,
439
+ mileage: 0,
440
+ duration: 0,
441
+ };
442
+ }
443
+ export const WorkCycle_Event = {
444
+ encode(message, writer = new BinaryWriter()) {
445
+ if (!message.id.equals(Long.UZERO)) {
446
+ writer.uint32(8).uint64(message.id.toString());
447
+ }
448
+ if (message.name !== undefined) {
449
+ writer.uint32(18).string(message.name);
450
+ }
451
+ if (message.enteredPoint !== undefined) {
452
+ Point.encode(message.enteredPoint, writer.uint32(26).fork()).join();
453
+ }
454
+ if (message.enteredAt !== undefined) {
455
+ Timestamp.encode(toTimestamp(message.enteredAt), writer.uint32(34).fork()).join();
456
+ }
457
+ if (message.exitedPoint !== undefined) {
458
+ Point.encode(message.exitedPoint, writer.uint32(42).fork()).join();
459
+ }
460
+ if (message.exitedAt !== undefined) {
461
+ Timestamp.encode(toTimestamp(message.exitedAt), writer.uint32(50).fork()).join();
462
+ }
463
+ if (message.mileage !== 0) {
464
+ writer.uint32(56).uint32(message.mileage);
465
+ }
466
+ if (message.duration !== 0) {
467
+ writer.uint32(64).uint32(message.duration);
468
+ }
469
+ return writer;
470
+ },
471
+ decode(input, length) {
472
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
473
+ const end = length === undefined ? reader.len : reader.pos + length;
474
+ const message = createBaseWorkCycle_Event();
475
+ while (reader.pos < end) {
476
+ const tag = reader.uint32();
477
+ switch (tag >>> 3) {
478
+ case 1: {
479
+ if (tag !== 8) {
480
+ break;
481
+ }
482
+ message.id = Long.fromString(reader.uint64().toString(), true);
483
+ continue;
484
+ }
485
+ case 2: {
486
+ if (tag !== 18) {
487
+ break;
488
+ }
489
+ message.name = reader.string();
490
+ continue;
491
+ }
492
+ case 3: {
493
+ if (tag !== 26) {
494
+ break;
495
+ }
496
+ message.enteredPoint = Point.decode(reader, reader.uint32());
497
+ continue;
498
+ }
499
+ case 4: {
500
+ if (tag !== 34) {
501
+ break;
502
+ }
503
+ message.enteredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
504
+ continue;
505
+ }
506
+ case 5: {
507
+ if (tag !== 42) {
508
+ break;
509
+ }
510
+ message.exitedPoint = Point.decode(reader, reader.uint32());
511
+ continue;
512
+ }
513
+ case 6: {
514
+ if (tag !== 50) {
515
+ break;
516
+ }
517
+ message.exitedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
518
+ continue;
519
+ }
520
+ case 7: {
521
+ if (tag !== 56) {
522
+ break;
523
+ }
524
+ message.mileage = reader.uint32();
525
+ continue;
526
+ }
527
+ case 8: {
528
+ if (tag !== 64) {
529
+ break;
530
+ }
531
+ message.duration = reader.uint32();
532
+ continue;
533
+ }
534
+ }
535
+ if ((tag & 7) === 4 || tag === 0) {
536
+ break;
537
+ }
538
+ reader.skip(tag & 7);
539
+ }
540
+ return message;
541
+ },
542
+ create(base) {
543
+ return WorkCycle_Event.fromPartial(base ?? {});
544
+ },
545
+ fromPartial(object) {
546
+ const message = createBaseWorkCycle_Event();
547
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
548
+ message.name = object.name ?? undefined;
549
+ message.enteredPoint = (object.enteredPoint !== undefined && object.enteredPoint !== null)
550
+ ? Point.fromPartial(object.enteredPoint)
551
+ : undefined;
552
+ message.enteredAt = object.enteredAt ?? undefined;
553
+ message.exitedPoint = (object.exitedPoint !== undefined && object.exitedPoint !== null)
554
+ ? Point.fromPartial(object.exitedPoint)
555
+ : undefined;
556
+ message.exitedAt = object.exitedAt ?? undefined;
557
+ message.mileage = object.mileage ?? 0;
558
+ message.duration = object.duration ?? 0;
559
+ return message;
560
+ },
561
+ };
562
+ function createBaseAreaAlertIsRunning() {
563
+ return { isRunning: false, latest: Long.ZERO };
564
+ }
565
+ export const AreaAlertIsRunning = {
566
+ encode(message, writer = new BinaryWriter()) {
567
+ if (message.isRunning !== false) {
568
+ writer.uint32(8).bool(message.isRunning);
569
+ }
570
+ if (!message.latest.equals(Long.ZERO)) {
571
+ writer.uint32(16).sint64(message.latest.toString());
572
+ }
573
+ return writer;
574
+ },
575
+ decode(input, length) {
576
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
577
+ const end = length === undefined ? reader.len : reader.pos + length;
578
+ const message = createBaseAreaAlertIsRunning();
579
+ while (reader.pos < end) {
580
+ const tag = reader.uint32();
581
+ switch (tag >>> 3) {
582
+ case 1: {
583
+ if (tag !== 8) {
584
+ break;
585
+ }
586
+ message.isRunning = reader.bool();
587
+ continue;
588
+ }
589
+ case 2: {
590
+ if (tag !== 16) {
591
+ break;
592
+ }
593
+ message.latest = Long.fromString(reader.sint64().toString());
594
+ continue;
595
+ }
596
+ }
597
+ if ((tag & 7) === 4 || tag === 0) {
598
+ break;
599
+ }
600
+ reader.skip(tag & 7);
601
+ }
602
+ return message;
603
+ },
604
+ create(base) {
605
+ return AreaAlertIsRunning.fromPartial(base ?? {});
606
+ },
607
+ fromPartial(object) {
608
+ const message = createBaseAreaAlertIsRunning();
609
+ message.isRunning = object.isRunning ?? false;
610
+ message.latest = (object.latest !== undefined && object.latest !== null)
611
+ ? Long.fromValue(object.latest)
612
+ : Long.ZERO;
613
+ return message;
614
+ },
615
+ };
616
+ function createBaseAreaCategory() {
617
+ return {
618
+ id: Long.UZERO,
619
+ name: "",
620
+ show: false,
621
+ organizationId: Long.UZERO,
622
+ createdBy: undefined,
623
+ updatedBy: undefined,
624
+ createdAt: undefined,
625
+ updatedAt: undefined,
626
+ };
627
+ }
628
+ export const AreaCategory = {
629
+ encode(message, writer = new BinaryWriter()) {
630
+ if (!message.id.equals(Long.UZERO)) {
631
+ writer.uint32(8).uint64(message.id.toString());
632
+ }
633
+ if (message.name !== "") {
634
+ writer.uint32(18).string(message.name);
635
+ }
636
+ if (message.show !== false) {
637
+ writer.uint32(24).bool(message.show);
638
+ }
639
+ if (!message.organizationId.equals(Long.UZERO)) {
640
+ writer.uint32(32).uint64(message.organizationId.toString());
641
+ }
642
+ if (message.createdBy !== undefined) {
643
+ writer.uint32(40).uint64(message.createdBy.toString());
644
+ }
645
+ if (message.updatedBy !== undefined) {
646
+ writer.uint32(48).uint64(message.updatedBy.toString());
647
+ }
648
+ if (message.createdAt !== undefined) {
649
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
650
+ }
651
+ if (message.updatedAt !== undefined) {
652
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
653
+ }
654
+ return writer;
655
+ },
656
+ decode(input, length) {
657
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
658
+ const end = length === undefined ? reader.len : reader.pos + length;
659
+ const message = createBaseAreaCategory();
660
+ while (reader.pos < end) {
661
+ const tag = reader.uint32();
662
+ switch (tag >>> 3) {
663
+ case 1: {
664
+ if (tag !== 8) {
665
+ break;
666
+ }
667
+ message.id = Long.fromString(reader.uint64().toString(), true);
668
+ continue;
669
+ }
670
+ case 2: {
671
+ if (tag !== 18) {
672
+ break;
673
+ }
674
+ message.name = reader.string();
675
+ continue;
676
+ }
677
+ case 3: {
678
+ if (tag !== 24) {
679
+ break;
680
+ }
681
+ message.show = reader.bool();
682
+ continue;
683
+ }
684
+ case 4: {
685
+ if (tag !== 32) {
686
+ break;
687
+ }
688
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
689
+ continue;
690
+ }
691
+ case 5: {
692
+ if (tag !== 40) {
693
+ break;
694
+ }
695
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
696
+ continue;
697
+ }
698
+ case 6: {
699
+ if (tag !== 48) {
700
+ break;
701
+ }
702
+ message.updatedBy = Long.fromString(reader.uint64().toString(), true);
703
+ continue;
704
+ }
705
+ case 7: {
706
+ if (tag !== 58) {
707
+ break;
708
+ }
709
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
710
+ continue;
711
+ }
712
+ case 8: {
713
+ if (tag !== 66) {
714
+ break;
715
+ }
716
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
717
+ continue;
718
+ }
719
+ }
720
+ if ((tag & 7) === 4 || tag === 0) {
721
+ break;
722
+ }
723
+ reader.skip(tag & 7);
724
+ }
725
+ return message;
726
+ },
727
+ create(base) {
728
+ return AreaCategory.fromPartial(base ?? {});
729
+ },
730
+ fromPartial(object) {
731
+ const message = createBaseAreaCategory();
732
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
733
+ message.name = object.name ?? "";
734
+ message.show = object.show ?? false;
735
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
736
+ ? Long.fromValue(object.organizationId)
737
+ : Long.UZERO;
738
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
739
+ ? Long.fromValue(object.createdBy)
740
+ : undefined;
741
+ message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
742
+ ? Long.fromValue(object.updatedBy)
743
+ : undefined;
744
+ message.createdAt = object.createdAt ?? undefined;
745
+ message.updatedAt = object.updatedAt ?? undefined;
746
+ return message;
747
+ },
748
+ };
749
+ function toTimestamp(date) {
750
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
751
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
752
+ return { seconds, nanos };
753
+ }
754
+ function fromTimestamp(t) {
755
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
756
+ millis += (t.nanos || 0) / 1_000_000;
757
+ return new globalThis.Date(millis);
758
+ }
759
+ function numberToLong(number) {
760
+ return Long.fromNumber(number);
761
+ }