@fatehan/tsrp 1.6.20 → 1.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +219 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -0
  3. package/dist/fatehan/activities/workflow.js +1941 -0
  4. package/dist/fatehan/activities/workshift.d.ts +140 -0
  5. package/dist/fatehan/activities/workshift.d.ts.map +1 -0
  6. package/dist/fatehan/activities/workshift.js +1244 -0
  7. package/dist/fatehan/apis/client.d.ts +246 -0
  8. package/dist/fatehan/apis/client.d.ts.map +1 -0
  9. package/dist/fatehan/apis/client.js +2572 -0
  10. package/dist/fatehan/areas/area.d.ts +96 -0
  11. package/dist/fatehan/areas/area.d.ts.map +1 -0
  12. package/dist/fatehan/areas/area.js +761 -0
  13. package/dist/fatehan/devices/devices.d.ts +256 -0
  14. package/dist/fatehan/devices/devices.d.ts.map +1 -0
  15. package/dist/fatehan/devices/devices.js +2730 -0
  16. package/dist/fatehan/devices/maintenance.d.ts +64 -0
  17. package/dist/fatehan/devices/maintenance.d.ts.map +1 -0
  18. package/dist/fatehan/devices/maintenance.js +484 -0
  19. package/dist/fatehan/financial/financial.d.ts +162 -0
  20. package/dist/fatehan/financial/financial.d.ts.map +1 -0
  21. package/dist/fatehan/financial/financial.js +1701 -0
  22. package/dist/fatehan/google/protobuf/descriptor.d.ts +1303 -0
  23. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -0
  24. package/dist/fatehan/google/protobuf/descriptor.js +3467 -0
  25. package/dist/fatehan/google/protobuf/duration.d.ts +99 -0
  26. package/dist/fatehan/google/protobuf/duration.d.ts.map +1 -0
  27. package/dist/fatehan/google/protobuf/duration.js +63 -0
  28. package/dist/fatehan/google/protobuf/field_mask.d.ts +228 -0
  29. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -0
  30. package/dist/fatehan/google/protobuf/field_mask.js +57 -0
  31. package/dist/fatehan/google/protobuf/timestamp.d.ts +129 -0
  32. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -0
  33. package/dist/fatehan/google/protobuf/timestamp.js +63 -0
  34. package/dist/fatehan/identities/authentication.d.ts +164 -0
  35. package/dist/fatehan/identities/authentication.d.ts.map +1 -0
  36. package/dist/fatehan/identities/authentication.js +1291 -0
  37. package/dist/fatehan/identities/identities.d.ts +969 -0
  38. package/dist/fatehan/identities/identities.d.ts.map +1 -0
  39. package/dist/fatehan/identities/identities.js +2993 -0
  40. package/dist/fatehan/models/fusion.d.ts +149 -0
  41. package/dist/fatehan/models/fusion.d.ts.map +1 -0
  42. package/dist/fatehan/models/fusion.js +1531 -0
  43. package/dist/fatehan/models/models.d.ts +162 -0
  44. package/dist/fatehan/models/models.d.ts.map +1 -0
  45. package/dist/fatehan/models/models.js +1486 -0
  46. package/dist/fatehan/notifies/direct.d.ts +85 -0
  47. package/dist/fatehan/notifies/direct.d.ts.map +1 -0
  48. package/dist/fatehan/notifies/direct.js +669 -0
  49. package/dist/fatehan/notifies/notify.d.ts +232 -0
  50. package/dist/fatehan/notifies/notify.d.ts.map +1 -0
  51. package/dist/fatehan/notifies/notify.js +1958 -0
  52. package/dist/fatehan/packets/commands.d.ts +150 -0
  53. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  54. package/dist/fatehan/packets/commands.js +1364 -0
  55. package/dist/fatehan/packets/dataModel.d.ts +1611 -0
  56. package/dist/fatehan/packets/dataModel.d.ts.map +1 -0
  57. package/dist/fatehan/packets/dataModel.js +14961 -0
  58. package/dist/fatehan/packets/dataModule.d.ts +61 -0
  59. package/dist/fatehan/packets/dataModule.d.ts.map +1 -0
  60. package/dist/fatehan/packets/dataModule.js +386 -0
  61. package/dist/fatehan/packets/forge.d.ts +142 -0
  62. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  63. package/dist/fatehan/packets/forge.js +1339 -0
  64. package/dist/fatehan/services/api.d.ts +1221 -0
  65. package/dist/fatehan/services/api.d.ts.map +1 -0
  66. package/dist/fatehan/services/api.js +12678 -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,1364 @@
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: packets/commands.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import Long from "long";
9
+ import { Timestamp } from "../google/protobuf/timestamp";
10
+ export const protobufPackage = "com.fatehan.packets";
11
+ export var CommandStatus;
12
+ (function (CommandStatus) {
13
+ CommandStatus[CommandStatus["PENDING"] = 0] = "PENDING";
14
+ CommandStatus[CommandStatus["OFFLINE"] = 1] = "OFFLINE";
15
+ CommandStatus[CommandStatus["ERROR"] = 2] = "ERROR";
16
+ CommandStatus[CommandStatus["SENT"] = 3] = "SENT";
17
+ CommandStatus[CommandStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(CommandStatus || (CommandStatus = {}));
19
+ export var GroupCommandState;
20
+ (function (GroupCommandState) {
21
+ GroupCommandState[GroupCommandState["QUEUED"] = 0] = "QUEUED";
22
+ GroupCommandState[GroupCommandState["SENDING"] = 1] = "SENDING";
23
+ GroupCommandState[GroupCommandState["FINISHED"] = 2] = "FINISHED";
24
+ GroupCommandState[GroupCommandState["STOPPED"] = 3] = "STOPPED";
25
+ GroupCommandState[GroupCommandState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(GroupCommandState || (GroupCommandState = {}));
27
+ function createBaseCommandContent() {
28
+ return { deviceId: Long.UZERO, commandId: undefined, message: undefined, params: [], rawCommand: undefined };
29
+ }
30
+ export const CommandContent = {
31
+ encode(message, writer = new BinaryWriter()) {
32
+ if (!message.deviceId.equals(Long.UZERO)) {
33
+ writer.uint32(8).uint64(message.deviceId.toString());
34
+ }
35
+ if (message.commandId !== undefined) {
36
+ writer.uint32(16).uint64(message.commandId.toString());
37
+ }
38
+ if (message.message !== undefined) {
39
+ writer.uint32(26).string(message.message);
40
+ }
41
+ for (const v of message.params) {
42
+ writer.uint32(34).string(v);
43
+ }
44
+ if (message.rawCommand !== undefined) {
45
+ writer.uint32(42).string(message.rawCommand);
46
+ }
47
+ return writer;
48
+ },
49
+ decode(input, length) {
50
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
51
+ const end = length === undefined ? reader.len : reader.pos + length;
52
+ const message = createBaseCommandContent();
53
+ while (reader.pos < end) {
54
+ const tag = reader.uint32();
55
+ switch (tag >>> 3) {
56
+ case 1: {
57
+ if (tag !== 8) {
58
+ break;
59
+ }
60
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
61
+ continue;
62
+ }
63
+ case 2: {
64
+ if (tag !== 16) {
65
+ break;
66
+ }
67
+ message.commandId = Long.fromString(reader.uint64().toString(), true);
68
+ continue;
69
+ }
70
+ case 3: {
71
+ if (tag !== 26) {
72
+ break;
73
+ }
74
+ message.message = reader.string();
75
+ continue;
76
+ }
77
+ case 4: {
78
+ if (tag !== 34) {
79
+ break;
80
+ }
81
+ message.params.push(reader.string());
82
+ continue;
83
+ }
84
+ case 5: {
85
+ if (tag !== 42) {
86
+ break;
87
+ }
88
+ message.rawCommand = reader.string();
89
+ continue;
90
+ }
91
+ }
92
+ if ((tag & 7) === 4 || tag === 0) {
93
+ break;
94
+ }
95
+ reader.skip(tag & 7);
96
+ }
97
+ return message;
98
+ },
99
+ create(base) {
100
+ return CommandContent.fromPartial(base ?? {});
101
+ },
102
+ fromPartial(object) {
103
+ const message = createBaseCommandContent();
104
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
105
+ ? Long.fromValue(object.deviceId)
106
+ : Long.UZERO;
107
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
108
+ ? Long.fromValue(object.commandId)
109
+ : undefined;
110
+ message.message = object.message ?? undefined;
111
+ message.params = object.params?.map((e) => e) || [];
112
+ message.rawCommand = object.rawCommand ?? undefined;
113
+ return message;
114
+ },
115
+ };
116
+ function createBaseCommandAkn() {
117
+ return { code: 0, message: "" };
118
+ }
119
+ export const CommandAkn = {
120
+ encode(message, writer = new BinaryWriter()) {
121
+ if (message.code !== 0) {
122
+ writer.uint32(8).sint32(message.code);
123
+ }
124
+ if (message.message !== "") {
125
+ writer.uint32(18).string(message.message);
126
+ }
127
+ return writer;
128
+ },
129
+ decode(input, length) {
130
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
131
+ const end = length === undefined ? reader.len : reader.pos + length;
132
+ const message = createBaseCommandAkn();
133
+ while (reader.pos < end) {
134
+ const tag = reader.uint32();
135
+ switch (tag >>> 3) {
136
+ case 1: {
137
+ if (tag !== 8) {
138
+ break;
139
+ }
140
+ message.code = reader.sint32();
141
+ continue;
142
+ }
143
+ case 2: {
144
+ if (tag !== 18) {
145
+ break;
146
+ }
147
+ message.message = reader.string();
148
+ continue;
149
+ }
150
+ }
151
+ if ((tag & 7) === 4 || tag === 0) {
152
+ break;
153
+ }
154
+ reader.skip(tag & 7);
155
+ }
156
+ return message;
157
+ },
158
+ create(base) {
159
+ return CommandAkn.fromPartial(base ?? {});
160
+ },
161
+ fromPartial(object) {
162
+ const message = createBaseCommandAkn();
163
+ message.code = object.code ?? 0;
164
+ message.message = object.message ?? "";
165
+ return message;
166
+ },
167
+ };
168
+ function createBaseCommand() {
169
+ return {
170
+ id: Long.UZERO,
171
+ deviceId: Long.UZERO,
172
+ userId: undefined,
173
+ commandId: undefined,
174
+ replyId: undefined,
175
+ groupCommandId: undefined,
176
+ status: 0,
177
+ command: undefined,
178
+ akn: undefined,
179
+ createdAt: undefined,
180
+ updatedAt: undefined,
181
+ };
182
+ }
183
+ export const Command = {
184
+ encode(message, writer = new BinaryWriter()) {
185
+ if (!message.id.equals(Long.UZERO)) {
186
+ writer.uint32(8).uint64(message.id.toString());
187
+ }
188
+ if (!message.deviceId.equals(Long.UZERO)) {
189
+ writer.uint32(16).uint64(message.deviceId.toString());
190
+ }
191
+ if (message.userId !== undefined) {
192
+ writer.uint32(24).uint64(message.userId.toString());
193
+ }
194
+ if (message.commandId !== undefined) {
195
+ writer.uint32(32).uint64(message.commandId.toString());
196
+ }
197
+ if (message.replyId !== undefined) {
198
+ writer.uint32(40).uint64(message.replyId.toString());
199
+ }
200
+ if (message.groupCommandId !== undefined) {
201
+ writer.uint32(88).uint64(message.groupCommandId.toString());
202
+ }
203
+ if (message.status !== 0) {
204
+ writer.uint32(48).int32(message.status);
205
+ }
206
+ if (message.command !== undefined) {
207
+ CommandContent.encode(message.command, writer.uint32(58).fork()).join();
208
+ }
209
+ if (message.akn !== undefined) {
210
+ CommandAkn.encode(message.akn, writer.uint32(66).fork()).join();
211
+ }
212
+ if (message.createdAt !== undefined) {
213
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
214
+ }
215
+ if (message.updatedAt !== undefined) {
216
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(82).fork()).join();
217
+ }
218
+ return writer;
219
+ },
220
+ decode(input, length) {
221
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
222
+ const end = length === undefined ? reader.len : reader.pos + length;
223
+ const message = createBaseCommand();
224
+ while (reader.pos < end) {
225
+ const tag = reader.uint32();
226
+ switch (tag >>> 3) {
227
+ case 1: {
228
+ if (tag !== 8) {
229
+ break;
230
+ }
231
+ message.id = Long.fromString(reader.uint64().toString(), true);
232
+ continue;
233
+ }
234
+ case 2: {
235
+ if (tag !== 16) {
236
+ break;
237
+ }
238
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
239
+ continue;
240
+ }
241
+ case 3: {
242
+ if (tag !== 24) {
243
+ break;
244
+ }
245
+ message.userId = Long.fromString(reader.uint64().toString(), true);
246
+ continue;
247
+ }
248
+ case 4: {
249
+ if (tag !== 32) {
250
+ break;
251
+ }
252
+ message.commandId = Long.fromString(reader.uint64().toString(), true);
253
+ continue;
254
+ }
255
+ case 5: {
256
+ if (tag !== 40) {
257
+ break;
258
+ }
259
+ message.replyId = Long.fromString(reader.uint64().toString(), true);
260
+ continue;
261
+ }
262
+ case 11: {
263
+ if (tag !== 88) {
264
+ break;
265
+ }
266
+ message.groupCommandId = Long.fromString(reader.uint64().toString(), true);
267
+ continue;
268
+ }
269
+ case 6: {
270
+ if (tag !== 48) {
271
+ break;
272
+ }
273
+ message.status = reader.int32();
274
+ continue;
275
+ }
276
+ case 7: {
277
+ if (tag !== 58) {
278
+ break;
279
+ }
280
+ message.command = CommandContent.decode(reader, reader.uint32());
281
+ continue;
282
+ }
283
+ case 8: {
284
+ if (tag !== 66) {
285
+ break;
286
+ }
287
+ message.akn = CommandAkn.decode(reader, reader.uint32());
288
+ continue;
289
+ }
290
+ case 9: {
291
+ if (tag !== 74) {
292
+ break;
293
+ }
294
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
295
+ continue;
296
+ }
297
+ case 10: {
298
+ if (tag !== 82) {
299
+ break;
300
+ }
301
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
302
+ continue;
303
+ }
304
+ }
305
+ if ((tag & 7) === 4 || tag === 0) {
306
+ break;
307
+ }
308
+ reader.skip(tag & 7);
309
+ }
310
+ return message;
311
+ },
312
+ create(base) {
313
+ return Command.fromPartial(base ?? {});
314
+ },
315
+ fromPartial(object) {
316
+ const message = createBaseCommand();
317
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
318
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
319
+ ? Long.fromValue(object.deviceId)
320
+ : Long.UZERO;
321
+ message.userId = (object.userId !== undefined && object.userId !== null)
322
+ ? Long.fromValue(object.userId)
323
+ : undefined;
324
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
325
+ ? Long.fromValue(object.commandId)
326
+ : undefined;
327
+ message.replyId = (object.replyId !== undefined && object.replyId !== null)
328
+ ? Long.fromValue(object.replyId)
329
+ : undefined;
330
+ message.groupCommandId = (object.groupCommandId !== undefined && object.groupCommandId !== null)
331
+ ? Long.fromValue(object.groupCommandId)
332
+ : undefined;
333
+ message.status = object.status ?? 0;
334
+ message.command = (object.command !== undefined && object.command !== null)
335
+ ? CommandContent.fromPartial(object.command)
336
+ : undefined;
337
+ message.akn = (object.akn !== undefined && object.akn !== null) ? CommandAkn.fromPartial(object.akn) : undefined;
338
+ message.createdAt = object.createdAt ?? undefined;
339
+ message.updatedAt = object.updatedAt ?? undefined;
340
+ return message;
341
+ },
342
+ };
343
+ function createBaseCommandValidation() {
344
+ return { max: Long.ZERO, min: Long.ZERO, name: "", type: "", description: "", isRequired: undefined };
345
+ }
346
+ export const CommandValidation = {
347
+ encode(message, writer = new BinaryWriter()) {
348
+ if (!message.max.equals(Long.ZERO)) {
349
+ writer.uint32(8).sint64(message.max.toString());
350
+ }
351
+ if (!message.min.equals(Long.ZERO)) {
352
+ writer.uint32(16).sint64(message.min.toString());
353
+ }
354
+ if (message.name !== "") {
355
+ writer.uint32(26).string(message.name);
356
+ }
357
+ if (message.type !== "") {
358
+ writer.uint32(34).string(message.type);
359
+ }
360
+ if (message.description !== "") {
361
+ writer.uint32(42).string(message.description);
362
+ }
363
+ if (message.isRequired !== undefined) {
364
+ writer.uint32(48).bool(message.isRequired);
365
+ }
366
+ return writer;
367
+ },
368
+ decode(input, length) {
369
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
370
+ const end = length === undefined ? reader.len : reader.pos + length;
371
+ const message = createBaseCommandValidation();
372
+ while (reader.pos < end) {
373
+ const tag = reader.uint32();
374
+ switch (tag >>> 3) {
375
+ case 1: {
376
+ if (tag !== 8) {
377
+ break;
378
+ }
379
+ message.max = Long.fromString(reader.sint64().toString());
380
+ continue;
381
+ }
382
+ case 2: {
383
+ if (tag !== 16) {
384
+ break;
385
+ }
386
+ message.min = Long.fromString(reader.sint64().toString());
387
+ continue;
388
+ }
389
+ case 3: {
390
+ if (tag !== 26) {
391
+ break;
392
+ }
393
+ message.name = reader.string();
394
+ continue;
395
+ }
396
+ case 4: {
397
+ if (tag !== 34) {
398
+ break;
399
+ }
400
+ message.type = reader.string();
401
+ continue;
402
+ }
403
+ case 5: {
404
+ if (tag !== 42) {
405
+ break;
406
+ }
407
+ message.description = reader.string();
408
+ continue;
409
+ }
410
+ case 6: {
411
+ if (tag !== 48) {
412
+ break;
413
+ }
414
+ message.isRequired = reader.bool();
415
+ continue;
416
+ }
417
+ }
418
+ if ((tag & 7) === 4 || tag === 0) {
419
+ break;
420
+ }
421
+ reader.skip(tag & 7);
422
+ }
423
+ return message;
424
+ },
425
+ create(base) {
426
+ return CommandValidation.fromPartial(base ?? {});
427
+ },
428
+ fromPartial(object) {
429
+ const message = createBaseCommandValidation();
430
+ message.max = (object.max !== undefined && object.max !== null) ? Long.fromValue(object.max) : Long.ZERO;
431
+ message.min = (object.min !== undefined && object.min !== null) ? Long.fromValue(object.min) : Long.ZERO;
432
+ message.name = object.name ?? "";
433
+ message.type = object.type ?? "";
434
+ message.description = object.description ?? "";
435
+ message.isRequired = object.isRequired ?? undefined;
436
+ return message;
437
+ },
438
+ };
439
+ function createBaseCommandFormat() {
440
+ return { structure: "", parameters: [] };
441
+ }
442
+ export const CommandFormat = {
443
+ encode(message, writer = new BinaryWriter()) {
444
+ if (message.structure !== "") {
445
+ writer.uint32(10).string(message.structure);
446
+ }
447
+ for (const v of message.parameters) {
448
+ CommandValidation.encode(v, writer.uint32(18).fork()).join();
449
+ }
450
+ return writer;
451
+ },
452
+ decode(input, length) {
453
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
454
+ const end = length === undefined ? reader.len : reader.pos + length;
455
+ const message = createBaseCommandFormat();
456
+ while (reader.pos < end) {
457
+ const tag = reader.uint32();
458
+ switch (tag >>> 3) {
459
+ case 1: {
460
+ if (tag !== 10) {
461
+ break;
462
+ }
463
+ message.structure = reader.string();
464
+ continue;
465
+ }
466
+ case 2: {
467
+ if (tag !== 18) {
468
+ break;
469
+ }
470
+ message.parameters.push(CommandValidation.decode(reader, reader.uint32()));
471
+ continue;
472
+ }
473
+ }
474
+ if ((tag & 7) === 4 || tag === 0) {
475
+ break;
476
+ }
477
+ reader.skip(tag & 7);
478
+ }
479
+ return message;
480
+ },
481
+ create(base) {
482
+ return CommandFormat.fromPartial(base ?? {});
483
+ },
484
+ fromPartial(object) {
485
+ const message = createBaseCommandFormat();
486
+ message.structure = object.structure ?? "";
487
+ message.parameters = object.parameters?.map((e) => CommandValidation.fromPartial(e)) || [];
488
+ return message;
489
+ },
490
+ };
491
+ function createBaseCommandStruct() {
492
+ return {
493
+ id: Long.UZERO,
494
+ trackerId: Long.UZERO,
495
+ userCreatedId: undefined,
496
+ userUpdatedId: undefined,
497
+ organizationId: undefined,
498
+ name: "",
499
+ sortOrder: Long.UZERO,
500
+ visible: Long.UZERO,
501
+ description: undefined,
502
+ sms: undefined,
503
+ gprs: undefined,
504
+ createdAt: undefined,
505
+ updatedAt: undefined,
506
+ };
507
+ }
508
+ export const CommandStruct = {
509
+ encode(message, writer = new BinaryWriter()) {
510
+ if (!message.id.equals(Long.UZERO)) {
511
+ writer.uint32(8).uint64(message.id.toString());
512
+ }
513
+ if (!message.trackerId.equals(Long.UZERO)) {
514
+ writer.uint32(16).uint64(message.trackerId.toString());
515
+ }
516
+ if (message.userCreatedId !== undefined) {
517
+ writer.uint32(24).uint64(message.userCreatedId.toString());
518
+ }
519
+ if (message.userUpdatedId !== undefined) {
520
+ writer.uint32(32).uint64(message.userUpdatedId.toString());
521
+ }
522
+ if (message.organizationId !== undefined) {
523
+ writer.uint32(40).uint64(message.organizationId.toString());
524
+ }
525
+ if (message.name !== "") {
526
+ writer.uint32(50).string(message.name);
527
+ }
528
+ if (!message.sortOrder.equals(Long.UZERO)) {
529
+ writer.uint32(56).uint64(message.sortOrder.toString());
530
+ }
531
+ if (!message.visible.equals(Long.UZERO)) {
532
+ writer.uint32(64).uint64(message.visible.toString());
533
+ }
534
+ if (message.description !== undefined) {
535
+ writer.uint32(74).string(message.description);
536
+ }
537
+ if (message.sms !== undefined) {
538
+ CommandFormat.encode(message.sms, writer.uint32(82).fork()).join();
539
+ }
540
+ if (message.gprs !== undefined) {
541
+ CommandFormat.encode(message.gprs, writer.uint32(90).fork()).join();
542
+ }
543
+ if (message.createdAt !== undefined) {
544
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(98).fork()).join();
545
+ }
546
+ if (message.updatedAt !== undefined) {
547
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(106).fork()).join();
548
+ }
549
+ return writer;
550
+ },
551
+ decode(input, length) {
552
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
553
+ const end = length === undefined ? reader.len : reader.pos + length;
554
+ const message = createBaseCommandStruct();
555
+ while (reader.pos < end) {
556
+ const tag = reader.uint32();
557
+ switch (tag >>> 3) {
558
+ case 1: {
559
+ if (tag !== 8) {
560
+ break;
561
+ }
562
+ message.id = Long.fromString(reader.uint64().toString(), true);
563
+ continue;
564
+ }
565
+ case 2: {
566
+ if (tag !== 16) {
567
+ break;
568
+ }
569
+ message.trackerId = Long.fromString(reader.uint64().toString(), true);
570
+ continue;
571
+ }
572
+ case 3: {
573
+ if (tag !== 24) {
574
+ break;
575
+ }
576
+ message.userCreatedId = Long.fromString(reader.uint64().toString(), true);
577
+ continue;
578
+ }
579
+ case 4: {
580
+ if (tag !== 32) {
581
+ break;
582
+ }
583
+ message.userUpdatedId = Long.fromString(reader.uint64().toString(), true);
584
+ continue;
585
+ }
586
+ case 5: {
587
+ if (tag !== 40) {
588
+ break;
589
+ }
590
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
591
+ continue;
592
+ }
593
+ case 6: {
594
+ if (tag !== 50) {
595
+ break;
596
+ }
597
+ message.name = reader.string();
598
+ continue;
599
+ }
600
+ case 7: {
601
+ if (tag !== 56) {
602
+ break;
603
+ }
604
+ message.sortOrder = Long.fromString(reader.uint64().toString(), true);
605
+ continue;
606
+ }
607
+ case 8: {
608
+ if (tag !== 64) {
609
+ break;
610
+ }
611
+ message.visible = Long.fromString(reader.uint64().toString(), true);
612
+ continue;
613
+ }
614
+ case 9: {
615
+ if (tag !== 74) {
616
+ break;
617
+ }
618
+ message.description = reader.string();
619
+ continue;
620
+ }
621
+ case 10: {
622
+ if (tag !== 82) {
623
+ break;
624
+ }
625
+ message.sms = CommandFormat.decode(reader, reader.uint32());
626
+ continue;
627
+ }
628
+ case 11: {
629
+ if (tag !== 90) {
630
+ break;
631
+ }
632
+ message.gprs = CommandFormat.decode(reader, reader.uint32());
633
+ continue;
634
+ }
635
+ case 12: {
636
+ if (tag !== 98) {
637
+ break;
638
+ }
639
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
640
+ continue;
641
+ }
642
+ case 13: {
643
+ if (tag !== 106) {
644
+ break;
645
+ }
646
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
647
+ continue;
648
+ }
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 CommandStruct.fromPartial(base ?? {});
659
+ },
660
+ fromPartial(object) {
661
+ const message = createBaseCommandStruct();
662
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
663
+ message.trackerId = (object.trackerId !== undefined && object.trackerId !== null)
664
+ ? Long.fromValue(object.trackerId)
665
+ : Long.UZERO;
666
+ message.userCreatedId = (object.userCreatedId !== undefined && object.userCreatedId !== null)
667
+ ? Long.fromValue(object.userCreatedId)
668
+ : undefined;
669
+ message.userUpdatedId = (object.userUpdatedId !== undefined && object.userUpdatedId !== null)
670
+ ? Long.fromValue(object.userUpdatedId)
671
+ : undefined;
672
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
673
+ ? Long.fromValue(object.organizationId)
674
+ : undefined;
675
+ message.name = object.name ?? "";
676
+ message.sortOrder = (object.sortOrder !== undefined && object.sortOrder !== null)
677
+ ? Long.fromValue(object.sortOrder)
678
+ : Long.UZERO;
679
+ message.visible = (object.visible !== undefined && object.visible !== null)
680
+ ? Long.fromValue(object.visible)
681
+ : Long.UZERO;
682
+ message.description = object.description ?? undefined;
683
+ message.sms = (object.sms !== undefined && object.sms !== null) ? CommandFormat.fromPartial(object.sms) : undefined;
684
+ message.gprs = (object.gprs !== undefined && object.gprs !== null)
685
+ ? CommandFormat.fromPartial(object.gprs)
686
+ : undefined;
687
+ message.createdAt = object.createdAt ?? undefined;
688
+ message.updatedAt = object.updatedAt ?? undefined;
689
+ return message;
690
+ },
691
+ };
692
+ function createBaseDevicePoolRequestRefetch() {
693
+ return {};
694
+ }
695
+ export const DevicePoolRequestRefetch = {
696
+ encode(_, writer = new BinaryWriter()) {
697
+ return writer;
698
+ },
699
+ decode(input, length) {
700
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
701
+ const end = length === undefined ? reader.len : reader.pos + length;
702
+ const message = createBaseDevicePoolRequestRefetch();
703
+ while (reader.pos < end) {
704
+ const tag = reader.uint32();
705
+ switch (tag >>> 3) {
706
+ }
707
+ if ((tag & 7) === 4 || tag === 0) {
708
+ break;
709
+ }
710
+ reader.skip(tag & 7);
711
+ }
712
+ return message;
713
+ },
714
+ create(base) {
715
+ return DevicePoolRequestRefetch.fromPartial(base ?? {});
716
+ },
717
+ fromPartial(_) {
718
+ const message = createBaseDevicePoolRequestRefetch();
719
+ return message;
720
+ },
721
+ };
722
+ function createBaseDevicePoolRequest() {
723
+ return { deviceId: Long.UZERO, requested: undefined, requestRefetch: undefined };
724
+ }
725
+ export const DevicePoolRequest = {
726
+ encode(message, writer = new BinaryWriter()) {
727
+ if (!message.deviceId.equals(Long.UZERO)) {
728
+ writer.uint32(8).uint64(message.deviceId.toString());
729
+ }
730
+ if (message.requested !== undefined) {
731
+ Timestamp.encode(toTimestamp(message.requested), writer.uint32(18).fork()).join();
732
+ }
733
+ if (message.requestRefetch !== undefined) {
734
+ DevicePoolRequestRefetch.encode(message.requestRefetch, writer.uint32(26).fork()).join();
735
+ }
736
+ return writer;
737
+ },
738
+ decode(input, length) {
739
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
740
+ const end = length === undefined ? reader.len : reader.pos + length;
741
+ const message = createBaseDevicePoolRequest();
742
+ while (reader.pos < end) {
743
+ const tag = reader.uint32();
744
+ switch (tag >>> 3) {
745
+ case 1: {
746
+ if (tag !== 8) {
747
+ break;
748
+ }
749
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
750
+ continue;
751
+ }
752
+ case 2: {
753
+ if (tag !== 18) {
754
+ break;
755
+ }
756
+ message.requested = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
757
+ continue;
758
+ }
759
+ case 3: {
760
+ if (tag !== 26) {
761
+ break;
762
+ }
763
+ message.requestRefetch = DevicePoolRequestRefetch.decode(reader, reader.uint32());
764
+ continue;
765
+ }
766
+ }
767
+ if ((tag & 7) === 4 || tag === 0) {
768
+ break;
769
+ }
770
+ reader.skip(tag & 7);
771
+ }
772
+ return message;
773
+ },
774
+ create(base) {
775
+ return DevicePoolRequest.fromPartial(base ?? {});
776
+ },
777
+ fromPartial(object) {
778
+ const message = createBaseDevicePoolRequest();
779
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
780
+ ? Long.fromValue(object.deviceId)
781
+ : Long.UZERO;
782
+ message.requested = object.requested ?? undefined;
783
+ message.requestRefetch = (object.requestRefetch !== undefined && object.requestRefetch !== null)
784
+ ? DevicePoolRequestRefetch.fromPartial(object.requestRefetch)
785
+ : undefined;
786
+ return message;
787
+ },
788
+ };
789
+ function createBaseGroupCommandCreateRequest() {
790
+ return { commandId: Long.UZERO, rawCommand: "", trackerId: Long.UZERO, organizationId: Long.UZERO, deviceIds: [] };
791
+ }
792
+ export const GroupCommandCreateRequest = {
793
+ encode(message, writer = new BinaryWriter()) {
794
+ if (!message.commandId.equals(Long.UZERO)) {
795
+ writer.uint32(8).uint64(message.commandId.toString());
796
+ }
797
+ if (message.rawCommand !== "") {
798
+ writer.uint32(18).string(message.rawCommand);
799
+ }
800
+ if (!message.trackerId.equals(Long.UZERO)) {
801
+ writer.uint32(24).uint64(message.trackerId.toString());
802
+ }
803
+ if (!message.organizationId.equals(Long.UZERO)) {
804
+ writer.uint32(32).uint64(message.organizationId.toString());
805
+ }
806
+ writer.uint32(42).fork();
807
+ for (const v of message.deviceIds) {
808
+ writer.uint64(v.toString());
809
+ }
810
+ writer.join();
811
+ return writer;
812
+ },
813
+ decode(input, length) {
814
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
815
+ const end = length === undefined ? reader.len : reader.pos + length;
816
+ const message = createBaseGroupCommandCreateRequest();
817
+ while (reader.pos < end) {
818
+ const tag = reader.uint32();
819
+ switch (tag >>> 3) {
820
+ case 1: {
821
+ if (tag !== 8) {
822
+ break;
823
+ }
824
+ message.commandId = Long.fromString(reader.uint64().toString(), true);
825
+ continue;
826
+ }
827
+ case 2: {
828
+ if (tag !== 18) {
829
+ break;
830
+ }
831
+ message.rawCommand = reader.string();
832
+ continue;
833
+ }
834
+ case 3: {
835
+ if (tag !== 24) {
836
+ break;
837
+ }
838
+ message.trackerId = Long.fromString(reader.uint64().toString(), true);
839
+ continue;
840
+ }
841
+ case 4: {
842
+ if (tag !== 32) {
843
+ break;
844
+ }
845
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
846
+ continue;
847
+ }
848
+ case 5: {
849
+ if (tag === 40) {
850
+ message.deviceIds.push(Long.fromString(reader.uint64().toString(), true));
851
+ continue;
852
+ }
853
+ if (tag === 42) {
854
+ const end2 = reader.uint32() + reader.pos;
855
+ while (reader.pos < end2) {
856
+ message.deviceIds.push(Long.fromString(reader.uint64().toString(), true));
857
+ }
858
+ continue;
859
+ }
860
+ break;
861
+ }
862
+ }
863
+ if ((tag & 7) === 4 || tag === 0) {
864
+ break;
865
+ }
866
+ reader.skip(tag & 7);
867
+ }
868
+ return message;
869
+ },
870
+ create(base) {
871
+ return GroupCommandCreateRequest.fromPartial(base ?? {});
872
+ },
873
+ fromPartial(object) {
874
+ const message = createBaseGroupCommandCreateRequest();
875
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
876
+ ? Long.fromValue(object.commandId)
877
+ : Long.UZERO;
878
+ message.rawCommand = object.rawCommand ?? "";
879
+ message.trackerId = (object.trackerId !== undefined && object.trackerId !== null)
880
+ ? Long.fromValue(object.trackerId)
881
+ : Long.UZERO;
882
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
883
+ ? Long.fromValue(object.organizationId)
884
+ : Long.UZERO;
885
+ message.deviceIds = object.deviceIds?.map((e) => Long.fromValue(e)) || [];
886
+ return message;
887
+ },
888
+ };
889
+ function createBaseGroupCommand() {
890
+ return {
891
+ id: Long.UZERO,
892
+ commandId: Long.UZERO,
893
+ organizationId: Long.UZERO,
894
+ trackerId: Long.UZERO,
895
+ createdBy: Long.UZERO,
896
+ rawCommand: "",
897
+ queries: undefined,
898
+ state: 0,
899
+ startedAt: undefined,
900
+ finishedAt: undefined,
901
+ createdAt: undefined,
902
+ updatedAt: undefined,
903
+ };
904
+ }
905
+ export const GroupCommand = {
906
+ encode(message, writer = new BinaryWriter()) {
907
+ if (!message.id.equals(Long.UZERO)) {
908
+ writer.uint32(8).uint64(message.id.toString());
909
+ }
910
+ if (!message.commandId.equals(Long.UZERO)) {
911
+ writer.uint32(16).uint64(message.commandId.toString());
912
+ }
913
+ if (!message.organizationId.equals(Long.UZERO)) {
914
+ writer.uint32(24).uint64(message.organizationId.toString());
915
+ }
916
+ if (!message.trackerId.equals(Long.UZERO)) {
917
+ writer.uint32(32).uint64(message.trackerId.toString());
918
+ }
919
+ if (!message.createdBy.equals(Long.UZERO)) {
920
+ writer.uint32(40).uint64(message.createdBy.toString());
921
+ }
922
+ if (message.rawCommand !== "") {
923
+ writer.uint32(50).string(message.rawCommand);
924
+ }
925
+ if (message.queries !== undefined) {
926
+ GroupCommand_Queries.encode(message.queries, writer.uint32(58).fork()).join();
927
+ }
928
+ if (message.state !== 0) {
929
+ writer.uint32(64).int32(message.state);
930
+ }
931
+ if (message.startedAt !== undefined) {
932
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(74).fork()).join();
933
+ }
934
+ if (message.finishedAt !== undefined) {
935
+ Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(82).fork()).join();
936
+ }
937
+ if (message.createdAt !== undefined) {
938
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(90).fork()).join();
939
+ }
940
+ if (message.updatedAt !== undefined) {
941
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(98).fork()).join();
942
+ }
943
+ return writer;
944
+ },
945
+ decode(input, length) {
946
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
947
+ const end = length === undefined ? reader.len : reader.pos + length;
948
+ const message = createBaseGroupCommand();
949
+ while (reader.pos < end) {
950
+ const tag = reader.uint32();
951
+ switch (tag >>> 3) {
952
+ case 1: {
953
+ if (tag !== 8) {
954
+ break;
955
+ }
956
+ message.id = Long.fromString(reader.uint64().toString(), true);
957
+ continue;
958
+ }
959
+ case 2: {
960
+ if (tag !== 16) {
961
+ break;
962
+ }
963
+ message.commandId = Long.fromString(reader.uint64().toString(), true);
964
+ continue;
965
+ }
966
+ case 3: {
967
+ if (tag !== 24) {
968
+ break;
969
+ }
970
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
971
+ continue;
972
+ }
973
+ case 4: {
974
+ if (tag !== 32) {
975
+ break;
976
+ }
977
+ message.trackerId = Long.fromString(reader.uint64().toString(), true);
978
+ continue;
979
+ }
980
+ case 5: {
981
+ if (tag !== 40) {
982
+ break;
983
+ }
984
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
985
+ continue;
986
+ }
987
+ case 6: {
988
+ if (tag !== 50) {
989
+ break;
990
+ }
991
+ message.rawCommand = reader.string();
992
+ continue;
993
+ }
994
+ case 7: {
995
+ if (tag !== 58) {
996
+ break;
997
+ }
998
+ message.queries = GroupCommand_Queries.decode(reader, reader.uint32());
999
+ continue;
1000
+ }
1001
+ case 8: {
1002
+ if (tag !== 64) {
1003
+ break;
1004
+ }
1005
+ message.state = reader.int32();
1006
+ continue;
1007
+ }
1008
+ case 9: {
1009
+ if (tag !== 74) {
1010
+ break;
1011
+ }
1012
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1013
+ continue;
1014
+ }
1015
+ case 10: {
1016
+ if (tag !== 82) {
1017
+ break;
1018
+ }
1019
+ message.finishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1020
+ continue;
1021
+ }
1022
+ case 11: {
1023
+ if (tag !== 90) {
1024
+ break;
1025
+ }
1026
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1027
+ continue;
1028
+ }
1029
+ case 12: {
1030
+ if (tag !== 98) {
1031
+ break;
1032
+ }
1033
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1034
+ continue;
1035
+ }
1036
+ }
1037
+ if ((tag & 7) === 4 || tag === 0) {
1038
+ break;
1039
+ }
1040
+ reader.skip(tag & 7);
1041
+ }
1042
+ return message;
1043
+ },
1044
+ create(base) {
1045
+ return GroupCommand.fromPartial(base ?? {});
1046
+ },
1047
+ fromPartial(object) {
1048
+ const message = createBaseGroupCommand();
1049
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1050
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
1051
+ ? Long.fromValue(object.commandId)
1052
+ : Long.UZERO;
1053
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1054
+ ? Long.fromValue(object.organizationId)
1055
+ : Long.UZERO;
1056
+ message.trackerId = (object.trackerId !== undefined && object.trackerId !== null)
1057
+ ? Long.fromValue(object.trackerId)
1058
+ : Long.UZERO;
1059
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1060
+ ? Long.fromValue(object.createdBy)
1061
+ : Long.UZERO;
1062
+ message.rawCommand = object.rawCommand ?? "";
1063
+ message.queries = (object.queries !== undefined && object.queries !== null)
1064
+ ? GroupCommand_Queries.fromPartial(object.queries)
1065
+ : undefined;
1066
+ message.state = object.state ?? 0;
1067
+ message.startedAt = object.startedAt ?? undefined;
1068
+ message.finishedAt = object.finishedAt ?? undefined;
1069
+ message.createdAt = object.createdAt ?? undefined;
1070
+ message.updatedAt = object.updatedAt ?? undefined;
1071
+ return message;
1072
+ },
1073
+ };
1074
+ function createBaseGroupCommand_Queries() {
1075
+ return { request: undefined, organizationGeneration: "", trackerGeneration: "" };
1076
+ }
1077
+ export const GroupCommand_Queries = {
1078
+ encode(message, writer = new BinaryWriter()) {
1079
+ if (message.request !== undefined) {
1080
+ GroupCommandCreateRequest.encode(message.request, writer.uint32(10).fork()).join();
1081
+ }
1082
+ if (message.organizationGeneration !== "") {
1083
+ writer.uint32(18).string(message.organizationGeneration);
1084
+ }
1085
+ if (message.trackerGeneration !== "") {
1086
+ writer.uint32(26).string(message.trackerGeneration);
1087
+ }
1088
+ return writer;
1089
+ },
1090
+ decode(input, length) {
1091
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1092
+ const end = length === undefined ? reader.len : reader.pos + length;
1093
+ const message = createBaseGroupCommand_Queries();
1094
+ while (reader.pos < end) {
1095
+ const tag = reader.uint32();
1096
+ switch (tag >>> 3) {
1097
+ case 1: {
1098
+ if (tag !== 10) {
1099
+ break;
1100
+ }
1101
+ message.request = GroupCommandCreateRequest.decode(reader, reader.uint32());
1102
+ continue;
1103
+ }
1104
+ case 2: {
1105
+ if (tag !== 18) {
1106
+ break;
1107
+ }
1108
+ message.organizationGeneration = reader.string();
1109
+ continue;
1110
+ }
1111
+ case 3: {
1112
+ if (tag !== 26) {
1113
+ break;
1114
+ }
1115
+ message.trackerGeneration = reader.string();
1116
+ continue;
1117
+ }
1118
+ }
1119
+ if ((tag & 7) === 4 || tag === 0) {
1120
+ break;
1121
+ }
1122
+ reader.skip(tag & 7);
1123
+ }
1124
+ return message;
1125
+ },
1126
+ create(base) {
1127
+ return GroupCommand_Queries.fromPartial(base ?? {});
1128
+ },
1129
+ fromPartial(object) {
1130
+ const message = createBaseGroupCommand_Queries();
1131
+ message.request = (object.request !== undefined && object.request !== null)
1132
+ ? GroupCommandCreateRequest.fromPartial(object.request)
1133
+ : undefined;
1134
+ message.organizationGeneration = object.organizationGeneration ?? "";
1135
+ message.trackerGeneration = object.trackerGeneration ?? "";
1136
+ return message;
1137
+ },
1138
+ };
1139
+ function createBaseGroupCommandShowRequest() {
1140
+ return { groupCommandId: Long.UZERO };
1141
+ }
1142
+ export const GroupCommandShowRequest = {
1143
+ encode(message, writer = new BinaryWriter()) {
1144
+ if (!message.groupCommandId.equals(Long.UZERO)) {
1145
+ writer.uint32(8).uint64(message.groupCommandId.toString());
1146
+ }
1147
+ return writer;
1148
+ },
1149
+ decode(input, length) {
1150
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1151
+ const end = length === undefined ? reader.len : reader.pos + length;
1152
+ const message = createBaseGroupCommandShowRequest();
1153
+ while (reader.pos < end) {
1154
+ const tag = reader.uint32();
1155
+ switch (tag >>> 3) {
1156
+ case 1: {
1157
+ if (tag !== 8) {
1158
+ break;
1159
+ }
1160
+ message.groupCommandId = Long.fromString(reader.uint64().toString(), true);
1161
+ continue;
1162
+ }
1163
+ }
1164
+ if ((tag & 7) === 4 || tag === 0) {
1165
+ break;
1166
+ }
1167
+ reader.skip(tag & 7);
1168
+ }
1169
+ return message;
1170
+ },
1171
+ create(base) {
1172
+ return GroupCommandShowRequest.fromPartial(base ?? {});
1173
+ },
1174
+ fromPartial(object) {
1175
+ const message = createBaseGroupCommandShowRequest();
1176
+ message.groupCommandId = (object.groupCommandId !== undefined && object.groupCommandId !== null)
1177
+ ? Long.fromValue(object.groupCommandId)
1178
+ : Long.UZERO;
1179
+ return message;
1180
+ },
1181
+ };
1182
+ function createBaseGroupCommandListRequest() {
1183
+ return { organizationId: undefined, trackerId: undefined, createdBy: undefined, page: undefined, perPage: undefined };
1184
+ }
1185
+ export const GroupCommandListRequest = {
1186
+ encode(message, writer = new BinaryWriter()) {
1187
+ if (message.organizationId !== undefined) {
1188
+ writer.uint32(8).uint32(message.organizationId);
1189
+ }
1190
+ if (message.trackerId !== undefined) {
1191
+ writer.uint32(16).uint32(message.trackerId);
1192
+ }
1193
+ if (message.createdBy !== undefined) {
1194
+ writer.uint32(24).uint32(message.createdBy);
1195
+ }
1196
+ if (message.page !== undefined) {
1197
+ writer.uint32(32).uint32(message.page);
1198
+ }
1199
+ if (message.perPage !== undefined) {
1200
+ writer.uint32(40).uint32(message.perPage);
1201
+ }
1202
+ return writer;
1203
+ },
1204
+ decode(input, length) {
1205
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1206
+ const end = length === undefined ? reader.len : reader.pos + length;
1207
+ const message = createBaseGroupCommandListRequest();
1208
+ while (reader.pos < end) {
1209
+ const tag = reader.uint32();
1210
+ switch (tag >>> 3) {
1211
+ case 1: {
1212
+ if (tag !== 8) {
1213
+ break;
1214
+ }
1215
+ message.organizationId = reader.uint32();
1216
+ continue;
1217
+ }
1218
+ case 2: {
1219
+ if (tag !== 16) {
1220
+ break;
1221
+ }
1222
+ message.trackerId = reader.uint32();
1223
+ continue;
1224
+ }
1225
+ case 3: {
1226
+ if (tag !== 24) {
1227
+ break;
1228
+ }
1229
+ message.createdBy = reader.uint32();
1230
+ continue;
1231
+ }
1232
+ case 4: {
1233
+ if (tag !== 32) {
1234
+ break;
1235
+ }
1236
+ message.page = reader.uint32();
1237
+ continue;
1238
+ }
1239
+ case 5: {
1240
+ if (tag !== 40) {
1241
+ break;
1242
+ }
1243
+ message.perPage = reader.uint32();
1244
+ continue;
1245
+ }
1246
+ }
1247
+ if ((tag & 7) === 4 || tag === 0) {
1248
+ break;
1249
+ }
1250
+ reader.skip(tag & 7);
1251
+ }
1252
+ return message;
1253
+ },
1254
+ create(base) {
1255
+ return GroupCommandListRequest.fromPartial(base ?? {});
1256
+ },
1257
+ fromPartial(object) {
1258
+ const message = createBaseGroupCommandListRequest();
1259
+ message.organizationId = object.organizationId ?? undefined;
1260
+ message.trackerId = object.trackerId ?? undefined;
1261
+ message.createdBy = object.createdBy ?? undefined;
1262
+ message.page = object.page ?? undefined;
1263
+ message.perPage = object.perPage ?? undefined;
1264
+ return message;
1265
+ },
1266
+ };
1267
+ function createBaseGroupCommandListResponse() {
1268
+ return { total: 0, currentPage: 0, lastPage: 0, perPage: 0, commands: [] };
1269
+ }
1270
+ export const GroupCommandListResponse = {
1271
+ encode(message, writer = new BinaryWriter()) {
1272
+ if (message.total !== 0) {
1273
+ writer.uint32(8).uint32(message.total);
1274
+ }
1275
+ if (message.currentPage !== 0) {
1276
+ writer.uint32(16).uint32(message.currentPage);
1277
+ }
1278
+ if (message.lastPage !== 0) {
1279
+ writer.uint32(24).uint32(message.lastPage);
1280
+ }
1281
+ if (message.perPage !== 0) {
1282
+ writer.uint32(32).uint32(message.perPage);
1283
+ }
1284
+ for (const v of message.commands) {
1285
+ GroupCommand.encode(v, writer.uint32(42).fork()).join();
1286
+ }
1287
+ return writer;
1288
+ },
1289
+ decode(input, length) {
1290
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1291
+ const end = length === undefined ? reader.len : reader.pos + length;
1292
+ const message = createBaseGroupCommandListResponse();
1293
+ while (reader.pos < end) {
1294
+ const tag = reader.uint32();
1295
+ switch (tag >>> 3) {
1296
+ case 1: {
1297
+ if (tag !== 8) {
1298
+ break;
1299
+ }
1300
+ message.total = reader.uint32();
1301
+ continue;
1302
+ }
1303
+ case 2: {
1304
+ if (tag !== 16) {
1305
+ break;
1306
+ }
1307
+ message.currentPage = reader.uint32();
1308
+ continue;
1309
+ }
1310
+ case 3: {
1311
+ if (tag !== 24) {
1312
+ break;
1313
+ }
1314
+ message.lastPage = reader.uint32();
1315
+ continue;
1316
+ }
1317
+ case 4: {
1318
+ if (tag !== 32) {
1319
+ break;
1320
+ }
1321
+ message.perPage = reader.uint32();
1322
+ continue;
1323
+ }
1324
+ case 5: {
1325
+ if (tag !== 42) {
1326
+ break;
1327
+ }
1328
+ message.commands.push(GroupCommand.decode(reader, reader.uint32()));
1329
+ continue;
1330
+ }
1331
+ }
1332
+ if ((tag & 7) === 4 || tag === 0) {
1333
+ break;
1334
+ }
1335
+ reader.skip(tag & 7);
1336
+ }
1337
+ return message;
1338
+ },
1339
+ create(base) {
1340
+ return GroupCommandListResponse.fromPartial(base ?? {});
1341
+ },
1342
+ fromPartial(object) {
1343
+ const message = createBaseGroupCommandListResponse();
1344
+ message.total = object.total ?? 0;
1345
+ message.currentPage = object.currentPage ?? 0;
1346
+ message.lastPage = object.lastPage ?? 0;
1347
+ message.perPage = object.perPage ?? 0;
1348
+ message.commands = object.commands?.map((e) => GroupCommand.fromPartial(e)) || [];
1349
+ return message;
1350
+ },
1351
+ };
1352
+ function toTimestamp(date) {
1353
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
1354
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1355
+ return { seconds, nanos };
1356
+ }
1357
+ function fromTimestamp(t) {
1358
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
1359
+ millis += (t.nanos || 0) / 1_000_000;
1360
+ return new globalThis.Date(millis);
1361
+ }
1362
+ function numberToLong(number) {
1363
+ return Long.fromNumber(number);
1364
+ }