@fatehan/tsrp 1.0.17 → 1.0.18

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.
@@ -14,6 +14,8 @@ export interface CommandContent {
14
14
  commandId?: number | undefined;
15
15
  message?: string | undefined;
16
16
  params: string[];
17
+ rawCommand?: string | undefined;
18
+ command: Uint8Array;
17
19
  }
18
20
  export interface CommandAkn {
19
21
  code: number;
@@ -31,9 +33,39 @@ export interface Command {
31
33
  createdAt: Date | undefined;
32
34
  updatedAt: Date | undefined;
33
35
  }
36
+ export interface CommandValidation {
37
+ max: number;
38
+ min: number;
39
+ name: string;
40
+ type: string;
41
+ description: string;
42
+ isRequired: boolean;
43
+ }
44
+ export interface CommandFormat {
45
+ structure: string;
46
+ parameters: CommandValidation[];
47
+ }
48
+ export interface CommandStruct {
49
+ id: number;
50
+ trackerId: number;
51
+ userCreatedId?: number | undefined;
52
+ userUpdatedId?: number | undefined;
53
+ organizationId?: number | undefined;
54
+ name: string;
55
+ sortOrder: number;
56
+ visible: number;
57
+ description?: string | undefined;
58
+ sms?: CommandFormat | undefined;
59
+ grpc?: CommandFormat | undefined;
60
+ createdAt?: Date | undefined;
61
+ updatedAt?: Date | undefined;
62
+ }
34
63
  export declare const CommandContent: MessageFns<CommandContent>;
35
64
  export declare const CommandAkn: MessageFns<CommandAkn>;
36
65
  export declare const Command: MessageFns<Command>;
66
+ export declare const CommandValidation: MessageFns<CommandValidation>;
67
+ export declare const CommandFormat: MessageFns<CommandFormat>;
68
+ export declare const CommandStruct: MessageFns<CommandStruct>;
37
69
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
38
70
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
39
71
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d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CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAAE,CAAC;AAuCnG,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxD,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;CAC/D"}
@@ -2,10 +2,10 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.7.0
5
- // protoc v3.21.12
5
+ // protoc v6.31.1
6
6
  // source: packets/messages.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Command = exports.CommandAkn = exports.CommandContent = exports.CommandStatus = exports.protobufPackage = void 0;
8
+ exports.CommandStruct = exports.CommandFormat = exports.CommandValidation = exports.Command = exports.CommandAkn = exports.CommandContent = exports.CommandStatus = exports.protobufPackage = void 0;
9
9
  exports.commandStatusFromJSON = commandStatusFromJSON;
10
10
  exports.commandStatusToJSON = commandStatusToJSON;
11
11
  /* eslint-disable */
@@ -56,7 +56,14 @@ function commandStatusToJSON(object) {
56
56
  }
57
57
  }
58
58
  function createBaseCommandContent() {
59
- return { deviceId: 0, commandId: undefined, message: undefined, params: [] };
59
+ return {
60
+ deviceId: 0,
61
+ commandId: undefined,
62
+ message: undefined,
63
+ params: [],
64
+ rawCommand: undefined,
65
+ command: new Uint8Array(0),
66
+ };
60
67
  }
61
68
  exports.CommandContent = {
62
69
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -72,6 +79,12 @@ exports.CommandContent = {
72
79
  for (const v of message.params) {
73
80
  writer.uint32(34).string(v);
74
81
  }
82
+ if (message.rawCommand !== undefined) {
83
+ writer.uint32(42).string(message.rawCommand);
84
+ }
85
+ if (message.command.length !== 0) {
86
+ writer.uint32(50).bytes(message.command);
87
+ }
75
88
  return writer;
76
89
  },
77
90
  decode(input, length) {
@@ -109,6 +122,20 @@ exports.CommandContent = {
109
122
  message.params.push(reader.string());
110
123
  continue;
111
124
  }
125
+ case 5: {
126
+ if (tag !== 42) {
127
+ break;
128
+ }
129
+ message.rawCommand = reader.string();
130
+ continue;
131
+ }
132
+ case 6: {
133
+ if (tag !== 50) {
134
+ break;
135
+ }
136
+ message.command = reader.bytes();
137
+ continue;
138
+ }
112
139
  }
113
140
  if ((tag & 7) === 4 || tag === 0) {
114
141
  break;
@@ -123,6 +150,8 @@ exports.CommandContent = {
123
150
  commandId: isSet(object.command_id) ? globalThis.Number(object.command_id) : undefined,
124
151
  message: isSet(object.message) ? globalThis.String(object.message) : undefined,
125
152
  params: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.params) ? object.params.map((e) => globalThis.String(e)) : [],
153
+ rawCommand: isSet(object.raw_command) ? globalThis.String(object.raw_command) : undefined,
154
+ command: isSet(object.command) ? bytesFromBase64(object.command) : new Uint8Array(0),
126
155
  };
127
156
  },
128
157
  toJSON(message) {
@@ -140,18 +169,26 @@ exports.CommandContent = {
140
169
  if ((_a = message.params) === null || _a === void 0 ? void 0 : _a.length) {
141
170
  obj.params = message.params;
142
171
  }
172
+ if (message.rawCommand !== undefined) {
173
+ obj.raw_command = message.rawCommand;
174
+ }
175
+ if (message.command.length !== 0) {
176
+ obj.command = base64FromBytes(message.command);
177
+ }
143
178
  return obj;
144
179
  },
145
180
  create(base) {
146
181
  return exports.CommandContent.fromPartial(base !== null && base !== void 0 ? base : {});
147
182
  },
148
183
  fromPartial(object) {
149
- var _a, _b, _c, _d;
184
+ var _a, _b, _c, _d, _e, _f;
150
185
  const message = createBaseCommandContent();
151
186
  message.deviceId = (_a = object.deviceId) !== null && _a !== void 0 ? _a : 0;
152
187
  message.commandId = (_b = object.commandId) !== null && _b !== void 0 ? _b : undefined;
153
188
  message.message = (_c = object.message) !== null && _c !== void 0 ? _c : undefined;
154
189
  message.params = ((_d = object.params) === null || _d === void 0 ? void 0 : _d.map((e) => e)) || [];
190
+ message.rawCommand = (_e = object.rawCommand) !== null && _e !== void 0 ? _e : undefined;
191
+ message.command = (_f = object.command) !== null && _f !== void 0 ? _f : new Uint8Array(0);
155
192
  return message;
156
193
  },
157
194
  };
@@ -426,6 +463,482 @@ exports.Command = {
426
463
  return message;
427
464
  },
428
465
  };
466
+ function createBaseCommandValidation() {
467
+ return { max: 0, min: 0, name: "", type: "", description: "", isRequired: false };
468
+ }
469
+ exports.CommandValidation = {
470
+ encode(message, writer = new wire_1.BinaryWriter()) {
471
+ if (message.max !== 0) {
472
+ writer.uint32(8).sint64(message.max);
473
+ }
474
+ if (message.min !== 0) {
475
+ writer.uint32(16).sint64(message.min);
476
+ }
477
+ if (message.name !== "") {
478
+ writer.uint32(26).string(message.name);
479
+ }
480
+ if (message.type !== "") {
481
+ writer.uint32(34).string(message.type);
482
+ }
483
+ if (message.description !== "") {
484
+ writer.uint32(42).string(message.description);
485
+ }
486
+ if (message.isRequired !== false) {
487
+ writer.uint32(48).bool(message.isRequired);
488
+ }
489
+ return writer;
490
+ },
491
+ decode(input, length) {
492
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
493
+ let end = length === undefined ? reader.len : reader.pos + length;
494
+ const message = createBaseCommandValidation();
495
+ while (reader.pos < end) {
496
+ const tag = reader.uint32();
497
+ switch (tag >>> 3) {
498
+ case 1: {
499
+ if (tag !== 8) {
500
+ break;
501
+ }
502
+ message.max = longToNumber(reader.sint64());
503
+ continue;
504
+ }
505
+ case 2: {
506
+ if (tag !== 16) {
507
+ break;
508
+ }
509
+ message.min = longToNumber(reader.sint64());
510
+ continue;
511
+ }
512
+ case 3: {
513
+ if (tag !== 26) {
514
+ break;
515
+ }
516
+ message.name = reader.string();
517
+ continue;
518
+ }
519
+ case 4: {
520
+ if (tag !== 34) {
521
+ break;
522
+ }
523
+ message.type = reader.string();
524
+ continue;
525
+ }
526
+ case 5: {
527
+ if (tag !== 42) {
528
+ break;
529
+ }
530
+ message.description = reader.string();
531
+ continue;
532
+ }
533
+ case 6: {
534
+ if (tag !== 48) {
535
+ break;
536
+ }
537
+ message.isRequired = reader.bool();
538
+ continue;
539
+ }
540
+ }
541
+ if ((tag & 7) === 4 || tag === 0) {
542
+ break;
543
+ }
544
+ reader.skip(tag & 7);
545
+ }
546
+ return message;
547
+ },
548
+ fromJSON(object) {
549
+ return {
550
+ max: isSet(object.max) ? globalThis.Number(object.max) : 0,
551
+ min: isSet(object.min) ? globalThis.Number(object.min) : 0,
552
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
553
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
554
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
555
+ isRequired: isSet(object.is_required) ? globalThis.Boolean(object.is_required) : false,
556
+ };
557
+ },
558
+ toJSON(message) {
559
+ const obj = {};
560
+ if (message.max !== 0) {
561
+ obj.max = Math.round(message.max);
562
+ }
563
+ if (message.min !== 0) {
564
+ obj.min = Math.round(message.min);
565
+ }
566
+ if (message.name !== "") {
567
+ obj.name = message.name;
568
+ }
569
+ if (message.type !== "") {
570
+ obj.type = message.type;
571
+ }
572
+ if (message.description !== "") {
573
+ obj.description = message.description;
574
+ }
575
+ if (message.isRequired !== false) {
576
+ obj.is_required = message.isRequired;
577
+ }
578
+ return obj;
579
+ },
580
+ create(base) {
581
+ return exports.CommandValidation.fromPartial(base !== null && base !== void 0 ? base : {});
582
+ },
583
+ fromPartial(object) {
584
+ var _a, _b, _c, _d, _e, _f;
585
+ const message = createBaseCommandValidation();
586
+ message.max = (_a = object.max) !== null && _a !== void 0 ? _a : 0;
587
+ message.min = (_b = object.min) !== null && _b !== void 0 ? _b : 0;
588
+ message.name = (_c = object.name) !== null && _c !== void 0 ? _c : "";
589
+ message.type = (_d = object.type) !== null && _d !== void 0 ? _d : "";
590
+ message.description = (_e = object.description) !== null && _e !== void 0 ? _e : "";
591
+ message.isRequired = (_f = object.isRequired) !== null && _f !== void 0 ? _f : false;
592
+ return message;
593
+ },
594
+ };
595
+ function createBaseCommandFormat() {
596
+ return { structure: "", parameters: [] };
597
+ }
598
+ exports.CommandFormat = {
599
+ encode(message, writer = new wire_1.BinaryWriter()) {
600
+ if (message.structure !== "") {
601
+ writer.uint32(10).string(message.structure);
602
+ }
603
+ for (const v of message.parameters) {
604
+ exports.CommandValidation.encode(v, writer.uint32(18).fork()).join();
605
+ }
606
+ return writer;
607
+ },
608
+ decode(input, length) {
609
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
610
+ let end = length === undefined ? reader.len : reader.pos + length;
611
+ const message = createBaseCommandFormat();
612
+ while (reader.pos < end) {
613
+ const tag = reader.uint32();
614
+ switch (tag >>> 3) {
615
+ case 1: {
616
+ if (tag !== 10) {
617
+ break;
618
+ }
619
+ message.structure = reader.string();
620
+ continue;
621
+ }
622
+ case 2: {
623
+ if (tag !== 18) {
624
+ break;
625
+ }
626
+ message.parameters.push(exports.CommandValidation.decode(reader, reader.uint32()));
627
+ continue;
628
+ }
629
+ }
630
+ if ((tag & 7) === 4 || tag === 0) {
631
+ break;
632
+ }
633
+ reader.skip(tag & 7);
634
+ }
635
+ return message;
636
+ },
637
+ fromJSON(object) {
638
+ return {
639
+ structure: isSet(object.structure) ? globalThis.String(object.structure) : "",
640
+ parameters: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.parameters)
641
+ ? object.parameters.map((e) => exports.CommandValidation.fromJSON(e))
642
+ : [],
643
+ };
644
+ },
645
+ toJSON(message) {
646
+ var _a;
647
+ const obj = {};
648
+ if (message.structure !== "") {
649
+ obj.structure = message.structure;
650
+ }
651
+ if ((_a = message.parameters) === null || _a === void 0 ? void 0 : _a.length) {
652
+ obj.parameters = message.parameters.map((e) => exports.CommandValidation.toJSON(e));
653
+ }
654
+ return obj;
655
+ },
656
+ create(base) {
657
+ return exports.CommandFormat.fromPartial(base !== null && base !== void 0 ? base : {});
658
+ },
659
+ fromPartial(object) {
660
+ var _a, _b;
661
+ const message = createBaseCommandFormat();
662
+ message.structure = (_a = object.structure) !== null && _a !== void 0 ? _a : "";
663
+ message.parameters = ((_b = object.parameters) === null || _b === void 0 ? void 0 : _b.map((e) => exports.CommandValidation.fromPartial(e))) || [];
664
+ return message;
665
+ },
666
+ };
667
+ function createBaseCommandStruct() {
668
+ return {
669
+ id: 0,
670
+ trackerId: 0,
671
+ userCreatedId: undefined,
672
+ userUpdatedId: undefined,
673
+ organizationId: undefined,
674
+ name: "",
675
+ sortOrder: 0,
676
+ visible: 0,
677
+ description: undefined,
678
+ sms: undefined,
679
+ grpc: undefined,
680
+ createdAt: undefined,
681
+ updatedAt: undefined,
682
+ };
683
+ }
684
+ exports.CommandStruct = {
685
+ encode(message, writer = new wire_1.BinaryWriter()) {
686
+ if (message.id !== 0) {
687
+ writer.uint32(8).uint64(message.id);
688
+ }
689
+ if (message.trackerId !== 0) {
690
+ writer.uint32(16).uint64(message.trackerId);
691
+ }
692
+ if (message.userCreatedId !== undefined) {
693
+ writer.uint32(24).uint64(message.userCreatedId);
694
+ }
695
+ if (message.userUpdatedId !== undefined) {
696
+ writer.uint32(32).uint64(message.userUpdatedId);
697
+ }
698
+ if (message.organizationId !== undefined) {
699
+ writer.uint32(40).uint64(message.organizationId);
700
+ }
701
+ if (message.name !== "") {
702
+ writer.uint32(50).string(message.name);
703
+ }
704
+ if (message.sortOrder !== 0) {
705
+ writer.uint32(56).uint64(message.sortOrder);
706
+ }
707
+ if (message.visible !== 0) {
708
+ writer.uint32(64).uint64(message.visible);
709
+ }
710
+ if (message.description !== undefined) {
711
+ writer.uint32(74).string(message.description);
712
+ }
713
+ if (message.sms !== undefined) {
714
+ exports.CommandFormat.encode(message.sms, writer.uint32(82).fork()).join();
715
+ }
716
+ if (message.grpc !== undefined) {
717
+ exports.CommandFormat.encode(message.grpc, writer.uint32(90).fork()).join();
718
+ }
719
+ if (message.createdAt !== undefined) {
720
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(98).fork()).join();
721
+ }
722
+ if (message.updatedAt !== undefined) {
723
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(106).fork()).join();
724
+ }
725
+ return writer;
726
+ },
727
+ decode(input, length) {
728
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
729
+ let end = length === undefined ? reader.len : reader.pos + length;
730
+ const message = createBaseCommandStruct();
731
+ while (reader.pos < end) {
732
+ const tag = reader.uint32();
733
+ switch (tag >>> 3) {
734
+ case 1: {
735
+ if (tag !== 8) {
736
+ break;
737
+ }
738
+ message.id = longToNumber(reader.uint64());
739
+ continue;
740
+ }
741
+ case 2: {
742
+ if (tag !== 16) {
743
+ break;
744
+ }
745
+ message.trackerId = longToNumber(reader.uint64());
746
+ continue;
747
+ }
748
+ case 3: {
749
+ if (tag !== 24) {
750
+ break;
751
+ }
752
+ message.userCreatedId = longToNumber(reader.uint64());
753
+ continue;
754
+ }
755
+ case 4: {
756
+ if (tag !== 32) {
757
+ break;
758
+ }
759
+ message.userUpdatedId = longToNumber(reader.uint64());
760
+ continue;
761
+ }
762
+ case 5: {
763
+ if (tag !== 40) {
764
+ break;
765
+ }
766
+ message.organizationId = longToNumber(reader.uint64());
767
+ continue;
768
+ }
769
+ case 6: {
770
+ if (tag !== 50) {
771
+ break;
772
+ }
773
+ message.name = reader.string();
774
+ continue;
775
+ }
776
+ case 7: {
777
+ if (tag !== 56) {
778
+ break;
779
+ }
780
+ message.sortOrder = longToNumber(reader.uint64());
781
+ continue;
782
+ }
783
+ case 8: {
784
+ if (tag !== 64) {
785
+ break;
786
+ }
787
+ message.visible = longToNumber(reader.uint64());
788
+ continue;
789
+ }
790
+ case 9: {
791
+ if (tag !== 74) {
792
+ break;
793
+ }
794
+ message.description = reader.string();
795
+ continue;
796
+ }
797
+ case 10: {
798
+ if (tag !== 82) {
799
+ break;
800
+ }
801
+ message.sms = exports.CommandFormat.decode(reader, reader.uint32());
802
+ continue;
803
+ }
804
+ case 11: {
805
+ if (tag !== 90) {
806
+ break;
807
+ }
808
+ message.grpc = exports.CommandFormat.decode(reader, reader.uint32());
809
+ continue;
810
+ }
811
+ case 12: {
812
+ if (tag !== 98) {
813
+ break;
814
+ }
815
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
816
+ continue;
817
+ }
818
+ case 13: {
819
+ if (tag !== 106) {
820
+ break;
821
+ }
822
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
823
+ continue;
824
+ }
825
+ }
826
+ if ((tag & 7) === 4 || tag === 0) {
827
+ break;
828
+ }
829
+ reader.skip(tag & 7);
830
+ }
831
+ return message;
832
+ },
833
+ fromJSON(object) {
834
+ return {
835
+ id: isSet(object.id) ? globalThis.Number(object.id) : 0,
836
+ trackerId: isSet(object.tracker_id) ? globalThis.Number(object.tracker_id) : 0,
837
+ userCreatedId: isSet(object.created_by) ? globalThis.Number(object.created_by) : undefined,
838
+ userUpdatedId: isSet(object.updated_by) ? globalThis.Number(object.updated_by) : undefined,
839
+ organizationId: isSet(object.organization_id) ? globalThis.Number(object.organization_id) : undefined,
840
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
841
+ sortOrder: isSet(object.sord) ? globalThis.Number(object.sord) : 0,
842
+ visible: isSet(object.visible) ? globalThis.Number(object.visible) : 0,
843
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
844
+ sms: isSet(object.sms) ? exports.CommandFormat.fromJSON(object.sms) : undefined,
845
+ grpc: isSet(object.grpc) ? exports.CommandFormat.fromJSON(object.grpc) : undefined,
846
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
847
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
848
+ };
849
+ },
850
+ toJSON(message) {
851
+ const obj = {};
852
+ if (message.id !== 0) {
853
+ obj.id = Math.round(message.id);
854
+ }
855
+ if (message.trackerId !== 0) {
856
+ obj.tracker_id = Math.round(message.trackerId);
857
+ }
858
+ if (message.userCreatedId !== undefined) {
859
+ obj.created_by = Math.round(message.userCreatedId);
860
+ }
861
+ if (message.userUpdatedId !== undefined) {
862
+ obj.updated_by = Math.round(message.userUpdatedId);
863
+ }
864
+ if (message.organizationId !== undefined) {
865
+ obj.organization_id = Math.round(message.organizationId);
866
+ }
867
+ if (message.name !== "") {
868
+ obj.name = message.name;
869
+ }
870
+ if (message.sortOrder !== 0) {
871
+ obj.sord = Math.round(message.sortOrder);
872
+ }
873
+ if (message.visible !== 0) {
874
+ obj.visible = Math.round(message.visible);
875
+ }
876
+ if (message.description !== undefined) {
877
+ obj.description = message.description;
878
+ }
879
+ if (message.sms !== undefined) {
880
+ obj.sms = exports.CommandFormat.toJSON(message.sms);
881
+ }
882
+ if (message.grpc !== undefined) {
883
+ obj.grpc = exports.CommandFormat.toJSON(message.grpc);
884
+ }
885
+ if (message.createdAt !== undefined) {
886
+ obj.created_at = message.createdAt.toISOString();
887
+ }
888
+ if (message.updatedAt !== undefined) {
889
+ obj.updated_at = message.updatedAt.toISOString();
890
+ }
891
+ return obj;
892
+ },
893
+ create(base) {
894
+ return exports.CommandStruct.fromPartial(base !== null && base !== void 0 ? base : {});
895
+ },
896
+ fromPartial(object) {
897
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
898
+ const message = createBaseCommandStruct();
899
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
900
+ message.trackerId = (_b = object.trackerId) !== null && _b !== void 0 ? _b : 0;
901
+ message.userCreatedId = (_c = object.userCreatedId) !== null && _c !== void 0 ? _c : undefined;
902
+ message.userUpdatedId = (_d = object.userUpdatedId) !== null && _d !== void 0 ? _d : undefined;
903
+ message.organizationId = (_e = object.organizationId) !== null && _e !== void 0 ? _e : undefined;
904
+ message.name = (_f = object.name) !== null && _f !== void 0 ? _f : "";
905
+ message.sortOrder = (_g = object.sortOrder) !== null && _g !== void 0 ? _g : 0;
906
+ message.visible = (_h = object.visible) !== null && _h !== void 0 ? _h : 0;
907
+ message.description = (_j = object.description) !== null && _j !== void 0 ? _j : undefined;
908
+ message.sms = (object.sms !== undefined && object.sms !== null) ? exports.CommandFormat.fromPartial(object.sms) : undefined;
909
+ message.grpc = (object.grpc !== undefined && object.grpc !== null)
910
+ ? exports.CommandFormat.fromPartial(object.grpc)
911
+ : undefined;
912
+ message.createdAt = (_k = object.createdAt) !== null && _k !== void 0 ? _k : undefined;
913
+ message.updatedAt = (_l = object.updatedAt) !== null && _l !== void 0 ? _l : undefined;
914
+ return message;
915
+ },
916
+ };
917
+ function bytesFromBase64(b64) {
918
+ if (globalThis.Buffer) {
919
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
920
+ }
921
+ else {
922
+ const bin = globalThis.atob(b64);
923
+ const arr = new Uint8Array(bin.length);
924
+ for (let i = 0; i < bin.length; ++i) {
925
+ arr[i] = bin.charCodeAt(i);
926
+ }
927
+ return arr;
928
+ }
929
+ }
930
+ function base64FromBytes(arr) {
931
+ if (globalThis.Buffer) {
932
+ return globalThis.Buffer.from(arr).toString("base64");
933
+ }
934
+ else {
935
+ const bin = [];
936
+ arr.forEach((byte) => {
937
+ bin.push(globalThis.String.fromCharCode(byte));
938
+ });
939
+ return globalThis.btoa(bin.join(""));
940
+ }
941
+ }
429
942
  function toTimestamp(date) {
430
943
  const seconds = Math.trunc(date.getTime() / 1000);
431
944
  const nanos = (date.getTime() % 1000) * 1000000;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.7.0
5
- // protoc v3.21.12
5
+ // protoc v6.31.1
6
6
  // source: reports/report.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Traffix_Event = exports.Traffix = exports.TraffixResponse = exports.DashboardIndividualRequest = exports.DashboardIndividualResponse_SpeedsEntry = exports.DashboardIndividualResponse_GreenDrivingEntry = exports.DashboardIndividualResponse_Environmental_HumidityEntry = exports.DashboardIndividualResponse_Environmental_TemperatureEntry = exports.DashboardIndividualResponse_Environmental = exports.DashboardIndividualResponse = exports.LatestDataModelRequest = exports.TripPerformance_SpeedsEntry = exports.TripPerformance_CrashesEntry = exports.TripPerformance_HumidityEntry = exports.TripPerformance_TemperatureEntry = exports.TripPerformance_DrivingEntry = exports.TripPerformance_Average = exports.TripPerformance = exports.TripPerformanceResponse = exports.TripPerformanceRequest = exports.MaintenanceResponse_Device = exports.MaintenanceResponse_Service = exports.MaintenanceResponse_Group = exports.MaintenanceResponse_List = exports.MaintenanceResponse_Cost = exports.MaintenanceResponse = exports.MaintenanceRequest = exports.AreaSplitterResponse_Record = exports.AreaSplitterResponse_Area = exports.AreaSplitterResponse = exports.AreaSplitterRequest = exports.TripReportRequest = exports.WorkCycleResponse = exports.WorkCycleRequest = exports.TripsSummaryRequest_GroupBy = exports.AttendanceResponse_EventType = exports.TrafficResponse_Traffic_EventType = exports.AreaReviewResponse_AreaReview_AreaEventType = exports.AreaSummaryReviewResponse_trafficType = exports.AreaSummaryReviewRequest_AreaSourceEnum = exports.AreaSummaryReviewRequest_ScopeEnum = exports.AreaSummaryReviewRequest_GroupEnum = exports.EnvironmentalRequest_EnvironmentalFieldEnum = exports.Traffix_Event_Type = exports.TripPerformanceRequest_GroupBy = exports.MaintenanceRequest_GroupBy = exports.StopCalculateIo = exports.RouteStopType = exports.Source = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.7.0
5
- // protoc v3.21.12
5
+ // protoc v6.31.1
6
6
  // source: trips/trip.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.TripTask = exports.FusionTrip = exports.TripDurationStat = exports.TripPoint = exports.TripCompact_SpeedsEntry = exports.TripCompact_CrashesEntry = exports.TripCompact_HumidityEntry = exports.TripCompact_TemperatureEntry = exports.TripCompact_GreenDrivingEntry = exports.TripCompact = exports.Trip = exports.MonthlyCompact_SpeedsEntry = exports.MonthlyCompact_CrashesEntry = exports.MonthlyCompact_HumidityEntry = exports.MonthlyCompact_TemperatureEntry = exports.MonthlyCompact_GreenDrivingEntry = exports.MonthlyCompact = exports.Monthly = exports.TripTask_EventType = exports.TemperatureEnum = exports.HumidityEnum = exports.GreenDrivingTypeEnum = exports.CrashEnum = exports.protobufPackage = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",