@fatehan/tsrp 1.0.18 → 1.0.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 (34) hide show
  1. package/dist/fatehan/areas/area.d.ts +21 -20
  2. package/dist/fatehan/areas/area.d.ts.map +1 -1
  3. package/dist/fatehan/areas/area.js +95 -86
  4. package/dist/fatehan/google/protobuf/timestamp.d.ts +3 -2
  5. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -1
  6. package/dist/fatehan/google/protobuf/timestamp.js +16 -20
  7. package/dist/fatehan/models/fusion.d.ts +15 -14
  8. package/dist/fatehan/models/fusion.d.ts.map +1 -1
  9. package/dist/fatehan/models/fusion.js +150 -135
  10. package/dist/fatehan/models/models.d.ts +25 -24
  11. package/dist/fatehan/models/models.d.ts.map +1 -1
  12. package/dist/fatehan/models/models.js +182 -159
  13. package/dist/fatehan/models/operation.d.ts +26 -25
  14. package/dist/fatehan/models/operation.d.ts.map +1 -1
  15. package/dist/fatehan/models/operation.js +111 -96
  16. package/dist/fatehan/notifies/notify.d.ts +23 -22
  17. package/dist/fatehan/notifies/notify.d.ts.map +1 -1
  18. package/dist/fatehan/notifies/notify.js +172 -146
  19. package/dist/fatehan/packets/dataModel.d.ts +63 -62
  20. package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
  21. package/dist/fatehan/packets/dataModel.js +617 -541
  22. package/dist/fatehan/packets/messages.d.ts +22 -21
  23. package/dist/fatehan/packets/messages.d.ts.map +1 -1
  24. package/dist/fatehan/packets/messages.js +157 -136
  25. package/dist/fatehan/reports/report.d.ts +219 -222
  26. package/dist/fatehan/reports/report.d.ts.map +1 -1
  27. package/dist/fatehan/reports/report.js +1335 -1161
  28. package/dist/fatehan/trips/trip.d.ts +29 -28
  29. package/dist/fatehan/trips/trip.d.ts.map +1 -1
  30. package/dist/fatehan/trips/trip.js +153 -146
  31. package/dist/index.js +1 -1
  32. package/dist/index.test.js +12 -8
  33. package/package.json +4 -2
  34. package/readme.md +1 -1
@@ -4,17 +4,21 @@
4
4
  // protoc-gen-ts_proto v2.7.0
5
5
  // protoc v6.31.1
6
6
  // source: models/models.proto
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
7
10
  Object.defineProperty(exports, "__esModule", { value: true });
8
11
  exports.DeviceStatusList = exports.PersonalAccessToken = exports.Person = exports.SinotrackCache = exports.HeartbeatSR03Cache = exports.HeartbeatCache = exports.IoList_ItemsEntry = exports.IoList = exports.Gallery = exports.protobufPackage = void 0;
9
12
  /* eslint-disable */
10
13
  const wire_1 = require("@bufbuild/protobuf/wire");
14
+ const long_1 = __importDefault(require("long"));
11
15
  const timestamp_1 = require("../google/protobuf/timestamp");
12
16
  const dataModel_1 = require("../packets/dataModel");
13
17
  exports.protobufPackage = "com.fatehan.models";
14
18
  function createBaseGallery() {
15
19
  return {
16
- id: 0,
17
- deviceId: 0,
20
+ id: long_1.default.UZERO,
21
+ deviceId: long_1.default.UZERO,
18
22
  identificationNo: new Uint8Array(0),
19
23
  type: 0,
20
24
  storage: "",
@@ -28,11 +32,11 @@ function createBaseGallery() {
28
32
  }
29
33
  exports.Gallery = {
30
34
  encode(message, writer = new wire_1.BinaryWriter()) {
31
- if (message.id !== 0) {
32
- writer.uint32(8).uint64(message.id);
35
+ if (!message.id.equals(long_1.default.UZERO)) {
36
+ writer.uint32(8).uint64(message.id.toString());
33
37
  }
34
- if (message.deviceId !== 0) {
35
- writer.uint32(16).uint64(message.deviceId);
38
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
39
+ writer.uint32(16).uint64(message.deviceId.toString());
36
40
  }
37
41
  if (message.identificationNo.length !== 0) {
38
42
  writer.uint32(26).bytes(message.identificationNo);
@@ -74,14 +78,14 @@ exports.Gallery = {
74
78
  if (tag !== 8) {
75
79
  break;
76
80
  }
77
- message.id = longToNumber(reader.uint64());
81
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
78
82
  continue;
79
83
  }
80
84
  case 2: {
81
85
  if (tag !== 16) {
82
86
  break;
83
87
  }
84
- message.deviceId = longToNumber(reader.uint64());
88
+ message.deviceId = long_1.default.fromString(reader.uint64().toString(), true);
85
89
  continue;
86
90
  }
87
91
  case 3: {
@@ -157,8 +161,8 @@ exports.Gallery = {
157
161
  },
158
162
  fromJSON(object) {
159
163
  return {
160
- id: isSet(object.id) ? globalThis.Number(object.id) : 0,
161
- deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
164
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
165
+ deviceId: isSet(object.device_id) ? long_1.default.fromValue(object.device_id) : long_1.default.UZERO,
162
166
  identificationNo: isSet(object.identification_no) ? bytesFromBase64(object.identification_no) : new Uint8Array(0),
163
167
  type: isSet(object.type) ? (0, dataModel_1.fileTypeFromJSON)(object.type) : 0,
164
168
  storage: isSet(object.storage) ? globalThis.String(object.storage) : "",
@@ -172,11 +176,11 @@ exports.Gallery = {
172
176
  },
173
177
  toJSON(message) {
174
178
  const obj = {};
175
- if (message.id !== 0) {
176
- obj.id = Math.round(message.id);
179
+ if (!message.id.equals(long_1.default.UZERO)) {
180
+ obj.id = (message.id || long_1.default.UZERO).toString();
177
181
  }
178
- if (message.deviceId !== 0) {
179
- obj.device_id = Math.round(message.deviceId);
182
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
183
+ obj.device_id = (message.deviceId || long_1.default.UZERO).toString();
180
184
  }
181
185
  if (message.identificationNo.length !== 0) {
182
186
  obj.identification_no = base64FromBytes(message.identificationNo);
@@ -211,21 +215,23 @@ exports.Gallery = {
211
215
  return exports.Gallery.fromPartial(base !== null && base !== void 0 ? base : {});
212
216
  },
213
217
  fromPartial(object) {
214
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
218
+ var _a, _b, _c, _d, _e, _f, _g, _h;
215
219
  const message = createBaseGallery();
216
- message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
217
- message.deviceId = (_b = object.deviceId) !== null && _b !== void 0 ? _b : 0;
218
- message.identificationNo = (_c = object.identificationNo) !== null && _c !== void 0 ? _c : new Uint8Array(0);
219
- message.type = (_d = object.type) !== null && _d !== void 0 ? _d : 0;
220
- message.storage = (_e = object.storage) !== null && _e !== void 0 ? _e : "";
221
- message.path = (_f = object.path) !== null && _f !== void 0 ? _f : "";
222
- message.mime = (_g = object.mime) !== null && _g !== void 0 ? _g : "";
223
- message.codec = (_h = object.codec) !== null && _h !== void 0 ? _h : undefined;
224
- message.size = (_j = object.size) !== null && _j !== void 0 ? _j : 0;
220
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
221
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
222
+ ? long_1.default.fromValue(object.deviceId)
223
+ : long_1.default.UZERO;
224
+ message.identificationNo = (_a = object.identificationNo) !== null && _a !== void 0 ? _a : new Uint8Array(0);
225
+ message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
226
+ message.storage = (_c = object.storage) !== null && _c !== void 0 ? _c : "";
227
+ message.path = (_d = object.path) !== null && _d !== void 0 ? _d : "";
228
+ message.mime = (_e = object.mime) !== null && _e !== void 0 ? _e : "";
229
+ message.codec = (_f = object.codec) !== null && _f !== void 0 ? _f : undefined;
230
+ message.size = (_g = object.size) !== null && _g !== void 0 ? _g : 0;
225
231
  message.location = (object.location !== undefined && object.location !== null)
226
232
  ? dataModel_1.Data.fromPartial(object.location)
227
233
  : undefined;
228
- message.createdAt = (_k = object.createdAt) !== null && _k !== void 0 ? _k : undefined;
234
+ message.createdAt = (_h = object.createdAt) !== null && _h !== void 0 ? _h : undefined;
229
235
  return message;
230
236
  },
231
237
  };
@@ -400,13 +406,13 @@ exports.HeartbeatCache = {
400
406
  writer.uint32(32).uint32(message.externalVoltage);
401
407
  }
402
408
  if (message.commandId !== undefined) {
403
- writer.uint32(40).uint64(message.commandId);
409
+ writer.uint32(40).uint64(message.commandId.toString());
404
410
  }
405
411
  if (message.command !== undefined) {
406
412
  writer.uint32(50).string(message.command);
407
413
  }
408
414
  if (message.mileage !== undefined) {
409
- writer.uint32(56).uint64(message.mileage);
415
+ writer.uint32(56).uint64(message.mileage.toString());
410
416
  }
411
417
  if (message.terminalId !== undefined) {
412
418
  writer.uint32(64).uint32(message.terminalId);
@@ -458,7 +464,7 @@ exports.HeartbeatCache = {
458
464
  if (tag !== 40) {
459
465
  break;
460
466
  }
461
- message.commandId = longToNumber(reader.uint64());
467
+ message.commandId = long_1.default.fromString(reader.uint64().toString(), true);
462
468
  continue;
463
469
  }
464
470
  case 6: {
@@ -472,7 +478,7 @@ exports.HeartbeatCache = {
472
478
  if (tag !== 56) {
473
479
  break;
474
480
  }
475
- message.mileage = longToNumber(reader.uint64());
481
+ message.mileage = long_1.default.fromString(reader.uint64().toString(), true);
476
482
  continue;
477
483
  }
478
484
  case 8: {
@@ -510,9 +516,9 @@ exports.HeartbeatCache = {
510
516
  gsm: isSet(object.gsm) ? globalThis.Number(object.gsm) : undefined,
511
517
  batteryPercent: isSet(object.battery_percent) ? globalThis.Number(object.battery_percent) : undefined,
512
518
  externalVoltage: isSet(object.external_voltage) ? globalThis.Number(object.external_voltage) : undefined,
513
- commandId: isSet(object.command_id) ? globalThis.Number(object.command_id) : undefined,
519
+ commandId: isSet(object.command_id) ? long_1.default.fromValue(object.command_id) : undefined,
514
520
  command: isSet(object.command) ? globalThis.String(object.command) : undefined,
515
- mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : undefined,
521
+ mileage: isSet(object.mileage) ? long_1.default.fromValue(object.mileage) : undefined,
516
522
  terminalId: isSet(object.terminal_id) ? globalThis.Number(object.terminal_id) : undefined,
517
523
  temperature: isSet(object.temperature) ? globalThis.Number(object.temperature) : undefined,
518
524
  ai1: isSet(object.ai_1) ? globalThis.Number(object.ai_1) : undefined,
@@ -533,13 +539,13 @@ exports.HeartbeatCache = {
533
539
  obj.external_voltage = Math.round(message.externalVoltage);
534
540
  }
535
541
  if (message.commandId !== undefined) {
536
- obj.command_id = Math.round(message.commandId);
542
+ obj.command_id = (message.commandId || long_1.default.UZERO).toString();
537
543
  }
538
544
  if (message.command !== undefined) {
539
545
  obj.command = message.command;
540
546
  }
541
547
  if (message.mileage !== undefined) {
542
- obj.mileage = Math.round(message.mileage);
548
+ obj.mileage = (message.mileage || long_1.default.UZERO).toString();
543
549
  }
544
550
  if (message.terminalId !== undefined) {
545
551
  obj.terminal_id = Math.round(message.terminalId);
@@ -556,18 +562,22 @@ exports.HeartbeatCache = {
556
562
  return exports.HeartbeatCache.fromPartial(base !== null && base !== void 0 ? base : {});
557
563
  },
558
564
  fromPartial(object) {
559
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
565
+ var _a, _b, _c, _d, _e, _f, _g, _h;
560
566
  const message = createBaseHeartbeatCache();
561
567
  message.ignition = (_a = object.ignition) !== null && _a !== void 0 ? _a : undefined;
562
568
  message.gsm = (_b = object.gsm) !== null && _b !== void 0 ? _b : undefined;
563
569
  message.batteryPercent = (_c = object.batteryPercent) !== null && _c !== void 0 ? _c : undefined;
564
570
  message.externalVoltage = (_d = object.externalVoltage) !== null && _d !== void 0 ? _d : undefined;
565
- message.commandId = (_e = object.commandId) !== null && _e !== void 0 ? _e : undefined;
566
- message.command = (_f = object.command) !== null && _f !== void 0 ? _f : undefined;
567
- message.mileage = (_g = object.mileage) !== null && _g !== void 0 ? _g : undefined;
568
- message.terminalId = (_h = object.terminalId) !== null && _h !== void 0 ? _h : undefined;
569
- message.temperature = (_j = object.temperature) !== null && _j !== void 0 ? _j : undefined;
570
- message.ai1 = (_k = object.ai1) !== null && _k !== void 0 ? _k : undefined;
571
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
572
+ ? long_1.default.fromValue(object.commandId)
573
+ : undefined;
574
+ message.command = (_e = object.command) !== null && _e !== void 0 ? _e : undefined;
575
+ message.mileage = (object.mileage !== undefined && object.mileage !== null)
576
+ ? long_1.default.fromValue(object.mileage)
577
+ : undefined;
578
+ message.terminalId = (_f = object.terminalId) !== null && _f !== void 0 ? _f : undefined;
579
+ message.temperature = (_g = object.temperature) !== null && _g !== void 0 ? _g : undefined;
580
+ message.ai1 = (_h = object.ai1) !== null && _h !== void 0 ? _h : undefined;
571
581
  return message;
572
582
  },
573
583
  };
@@ -642,12 +652,12 @@ exports.HeartbeatSR03Cache = {
642
652
  },
643
653
  };
644
654
  function createBaseSinotrackCache() {
645
- return { gpsTime: 0, fuelUsedGps: undefined, ignition: undefined, commandId: undefined, command: undefined };
655
+ return { gpsTime: long_1.default.ZERO, fuelUsedGps: undefined, ignition: undefined, commandId: undefined, command: undefined };
646
656
  }
647
657
  exports.SinotrackCache = {
648
658
  encode(message, writer = new wire_1.BinaryWriter()) {
649
- if (message.gpsTime !== 0) {
650
- writer.uint32(8).int64(message.gpsTime);
659
+ if (!message.gpsTime.equals(long_1.default.ZERO)) {
660
+ writer.uint32(8).int64(message.gpsTime.toString());
651
661
  }
652
662
  if (message.fuelUsedGps !== undefined) {
653
663
  writer.uint32(16).uint32(message.fuelUsedGps);
@@ -656,7 +666,7 @@ exports.SinotrackCache = {
656
666
  writer.uint32(24).bool(message.ignition);
657
667
  }
658
668
  if (message.commandId !== undefined) {
659
- writer.uint32(40).uint64(message.commandId);
669
+ writer.uint32(40).uint64(message.commandId.toString());
660
670
  }
661
671
  if (message.command !== undefined) {
662
672
  writer.uint32(50).string(message.command);
@@ -674,7 +684,7 @@ exports.SinotrackCache = {
674
684
  if (tag !== 8) {
675
685
  break;
676
686
  }
677
- message.gpsTime = longToNumber(reader.int64());
687
+ message.gpsTime = long_1.default.fromString(reader.int64().toString());
678
688
  continue;
679
689
  }
680
690
  case 2: {
@@ -695,7 +705,7 @@ exports.SinotrackCache = {
695
705
  if (tag !== 40) {
696
706
  break;
697
707
  }
698
- message.commandId = longToNumber(reader.uint64());
708
+ message.commandId = long_1.default.fromString(reader.uint64().toString(), true);
699
709
  continue;
700
710
  }
701
711
  case 6: {
@@ -715,17 +725,17 @@ exports.SinotrackCache = {
715
725
  },
716
726
  fromJSON(object) {
717
727
  return {
718
- gpsTime: isSet(object.gps_time) ? globalThis.Number(object.gps_time) : 0,
728
+ gpsTime: isSet(object.gps_time) ? long_1.default.fromValue(object.gps_time) : long_1.default.ZERO,
719
729
  fuelUsedGps: isSet(object.fuel_used_gps) ? globalThis.Number(object.fuel_used_gps) : undefined,
720
730
  ignition: isSet(object.ignition) ? globalThis.Boolean(object.ignition) : undefined,
721
- commandId: isSet(object.command_id) ? globalThis.Number(object.command_id) : undefined,
731
+ commandId: isSet(object.command_id) ? long_1.default.fromValue(object.command_id) : undefined,
722
732
  command: isSet(object.command) ? globalThis.String(object.command) : undefined,
723
733
  };
724
734
  },
725
735
  toJSON(message) {
726
736
  const obj = {};
727
- if (message.gpsTime !== 0) {
728
- obj.gps_time = Math.round(message.gpsTime);
737
+ if (!message.gpsTime.equals(long_1.default.ZERO)) {
738
+ obj.gps_time = (message.gpsTime || long_1.default.ZERO).toString();
729
739
  }
730
740
  if (message.fuelUsedGps !== undefined) {
731
741
  obj.fuel_used_gps = Math.round(message.fuelUsedGps);
@@ -734,7 +744,7 @@ exports.SinotrackCache = {
734
744
  obj.ignition = message.ignition;
735
745
  }
736
746
  if (message.commandId !== undefined) {
737
- obj.command_id = Math.round(message.commandId);
747
+ obj.command_id = (message.commandId || long_1.default.UZERO).toString();
738
748
  }
739
749
  if (message.command !== undefined) {
740
750
  obj.command = message.command;
@@ -745,21 +755,25 @@ exports.SinotrackCache = {
745
755
  return exports.SinotrackCache.fromPartial(base !== null && base !== void 0 ? base : {});
746
756
  },
747
757
  fromPartial(object) {
748
- var _a, _b, _c, _d, _e;
758
+ var _a, _b, _c;
749
759
  const message = createBaseSinotrackCache();
750
- message.gpsTime = (_a = object.gpsTime) !== null && _a !== void 0 ? _a : 0;
751
- message.fuelUsedGps = (_b = object.fuelUsedGps) !== null && _b !== void 0 ? _b : undefined;
752
- message.ignition = (_c = object.ignition) !== null && _c !== void 0 ? _c : undefined;
753
- message.commandId = (_d = object.commandId) !== null && _d !== void 0 ? _d : undefined;
754
- message.command = (_e = object.command) !== null && _e !== void 0 ? _e : undefined;
760
+ message.gpsTime = (object.gpsTime !== undefined && object.gpsTime !== null)
761
+ ? long_1.default.fromValue(object.gpsTime)
762
+ : long_1.default.ZERO;
763
+ message.fuelUsedGps = (_a = object.fuelUsedGps) !== null && _a !== void 0 ? _a : undefined;
764
+ message.ignition = (_b = object.ignition) !== null && _b !== void 0 ? _b : undefined;
765
+ message.commandId = (object.commandId !== undefined && object.commandId !== null)
766
+ ? long_1.default.fromValue(object.commandId)
767
+ : undefined;
768
+ message.command = (_c = object.command) !== null && _c !== void 0 ? _c : undefined;
755
769
  return message;
756
770
  },
757
771
  };
758
772
  function createBasePerson() {
759
773
  return {
760
- id: 0,
774
+ id: long_1.default.UZERO,
761
775
  type: 0,
762
- organizationId: 0,
776
+ organizationId: long_1.default.UZERO,
763
777
  roleId: undefined,
764
778
  userId: undefined,
765
779
  partnerId: undefined,
@@ -782,29 +796,29 @@ function createBasePerson() {
782
796
  }
783
797
  exports.Person = {
784
798
  encode(message, writer = new wire_1.BinaryWriter()) {
785
- if (message.id !== 0) {
786
- writer.uint32(8).uint64(message.id);
799
+ if (!message.id.equals(long_1.default.UZERO)) {
800
+ writer.uint32(8).uint64(message.id.toString());
787
801
  }
788
802
  if (message.type !== 0) {
789
803
  writer.uint32(16).uint32(message.type);
790
804
  }
791
- if (message.organizationId !== 0) {
792
- writer.uint32(24).uint64(message.organizationId);
805
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
806
+ writer.uint32(24).uint64(message.organizationId.toString());
793
807
  }
794
808
  if (message.roleId !== undefined) {
795
- writer.uint32(32).uint64(message.roleId);
809
+ writer.uint32(32).uint64(message.roleId.toString());
796
810
  }
797
811
  if (message.userId !== undefined) {
798
- writer.uint32(40).uint64(message.userId);
812
+ writer.uint32(40).uint64(message.userId.toString());
799
813
  }
800
814
  if (message.partnerId !== undefined) {
801
- writer.uint32(48).uint64(message.partnerId);
815
+ writer.uint32(48).uint64(message.partnerId.toString());
802
816
  }
803
817
  if (message.createdUserId !== undefined) {
804
- writer.uint32(56).uint64(message.createdUserId);
818
+ writer.uint32(56).uint64(message.createdUserId.toString());
805
819
  }
806
820
  if (message.updatedUserId !== undefined) {
807
- writer.uint32(64).uint64(message.updatedUserId);
821
+ writer.uint32(64).uint64(message.updatedUserId.toString());
808
822
  }
809
823
  if (message.isComplete !== false) {
810
824
  writer.uint32(72).bool(message.isComplete);
@@ -858,7 +872,7 @@ exports.Person = {
858
872
  if (tag !== 8) {
859
873
  break;
860
874
  }
861
- message.id = longToNumber(reader.uint64());
875
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
862
876
  continue;
863
877
  }
864
878
  case 2: {
@@ -872,42 +886,42 @@ exports.Person = {
872
886
  if (tag !== 24) {
873
887
  break;
874
888
  }
875
- message.organizationId = longToNumber(reader.uint64());
889
+ message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
876
890
  continue;
877
891
  }
878
892
  case 4: {
879
893
  if (tag !== 32) {
880
894
  break;
881
895
  }
882
- message.roleId = longToNumber(reader.uint64());
896
+ message.roleId = long_1.default.fromString(reader.uint64().toString(), true);
883
897
  continue;
884
898
  }
885
899
  case 5: {
886
900
  if (tag !== 40) {
887
901
  break;
888
902
  }
889
- message.userId = longToNumber(reader.uint64());
903
+ message.userId = long_1.default.fromString(reader.uint64().toString(), true);
890
904
  continue;
891
905
  }
892
906
  case 6: {
893
907
  if (tag !== 48) {
894
908
  break;
895
909
  }
896
- message.partnerId = longToNumber(reader.uint64());
910
+ message.partnerId = long_1.default.fromString(reader.uint64().toString(), true);
897
911
  continue;
898
912
  }
899
913
  case 7: {
900
914
  if (tag !== 56) {
901
915
  break;
902
916
  }
903
- message.createdUserId = longToNumber(reader.uint64());
917
+ message.createdUserId = long_1.default.fromString(reader.uint64().toString(), true);
904
918
  continue;
905
919
  }
906
920
  case 8: {
907
921
  if (tag !== 64) {
908
922
  break;
909
923
  }
910
- message.updatedUserId = longToNumber(reader.uint64());
924
+ message.updatedUserId = long_1.default.fromString(reader.uint64().toString(), true);
911
925
  continue;
912
926
  }
913
927
  case 9: {
@@ -1011,14 +1025,14 @@ exports.Person = {
1011
1025
  },
1012
1026
  fromJSON(object) {
1013
1027
  return {
1014
- id: isSet(object.id) ? globalThis.Number(object.id) : 0,
1028
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1015
1029
  type: isSet(object.type) ? globalThis.Number(object.type) : 0,
1016
- organizationId: isSet(object.organization_id) ? globalThis.Number(object.organization_id) : 0,
1017
- roleId: isSet(object.role_id) ? globalThis.Number(object.role_id) : undefined,
1018
- userId: isSet(object.user_id) ? globalThis.Number(object.user_id) : undefined,
1019
- partnerId: isSet(object.partner_id) ? globalThis.Number(object.partner_id) : undefined,
1020
- createdUserId: isSet(object.created_by) ? globalThis.Number(object.created_by) : undefined,
1021
- updatedUserId: isSet(object.updated_by) ? globalThis.Number(object.updated_by) : undefined,
1030
+ organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
1031
+ roleId: isSet(object.role_id) ? long_1.default.fromValue(object.role_id) : undefined,
1032
+ userId: isSet(object.user_id) ? long_1.default.fromValue(object.user_id) : undefined,
1033
+ partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : undefined,
1034
+ createdUserId: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
1035
+ updatedUserId: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
1022
1036
  isComplete: isSet(object.is_complete) ? globalThis.Boolean(object.is_complete) : false,
1023
1037
  name: isSet(object.name) ? globalThis.String(object.name) : undefined,
1024
1038
  image: isSet(object.image) ? globalThis.String(object.image) : undefined,
@@ -1038,29 +1052,29 @@ exports.Person = {
1038
1052
  },
1039
1053
  toJSON(message) {
1040
1054
  const obj = {};
1041
- if (message.id !== 0) {
1042
- obj.id = Math.round(message.id);
1055
+ if (!message.id.equals(long_1.default.UZERO)) {
1056
+ obj.id = (message.id || long_1.default.UZERO).toString();
1043
1057
  }
1044
1058
  if (message.type !== 0) {
1045
1059
  obj.type = Math.round(message.type);
1046
1060
  }
1047
- if (message.organizationId !== 0) {
1048
- obj.organization_id = Math.round(message.organizationId);
1061
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
1062
+ obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
1049
1063
  }
1050
1064
  if (message.roleId !== undefined) {
1051
- obj.role_id = Math.round(message.roleId);
1065
+ obj.role_id = (message.roleId || long_1.default.UZERO).toString();
1052
1066
  }
1053
1067
  if (message.userId !== undefined) {
1054
- obj.user_id = Math.round(message.userId);
1068
+ obj.user_id = (message.userId || long_1.default.UZERO).toString();
1055
1069
  }
1056
1070
  if (message.partnerId !== undefined) {
1057
- obj.partner_id = Math.round(message.partnerId);
1071
+ obj.partner_id = (message.partnerId || long_1.default.UZERO).toString();
1058
1072
  }
1059
1073
  if (message.createdUserId !== undefined) {
1060
- obj.created_by = Math.round(message.createdUserId);
1074
+ obj.created_by = (message.createdUserId || long_1.default.UZERO).toString();
1061
1075
  }
1062
1076
  if (message.updatedUserId !== undefined) {
1063
- obj.updated_by = Math.round(message.updatedUserId);
1077
+ obj.updated_by = (message.updatedUserId || long_1.default.UZERO).toString();
1064
1078
  }
1065
1079
  if (message.isComplete !== false) {
1066
1080
  obj.is_complete = message.isComplete;
@@ -1107,37 +1121,49 @@ exports.Person = {
1107
1121
  return exports.Person.fromPartial(base !== null && base !== void 0 ? base : {});
1108
1122
  },
1109
1123
  fromPartial(object) {
1110
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
1124
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1111
1125
  const message = createBasePerson();
1112
- message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
1113
- message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
1114
- message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : 0;
1115
- message.roleId = (_d = object.roleId) !== null && _d !== void 0 ? _d : undefined;
1116
- message.userId = (_e = object.userId) !== null && _e !== void 0 ? _e : undefined;
1117
- message.partnerId = (_f = object.partnerId) !== null && _f !== void 0 ? _f : undefined;
1118
- message.createdUserId = (_g = object.createdUserId) !== null && _g !== void 0 ? _g : undefined;
1119
- message.updatedUserId = (_h = object.updatedUserId) !== null && _h !== void 0 ? _h : undefined;
1120
- message.isComplete = (_j = object.isComplete) !== null && _j !== void 0 ? _j : false;
1121
- message.name = (_k = object.name) !== null && _k !== void 0 ? _k : undefined;
1122
- message.image = (_l = object.image) !== null && _l !== void 0 ? _l : undefined;
1123
- message.nationalId = (_m = object.nationalId) !== null && _m !== void 0 ? _m : undefined;
1124
- message.economicalId = (_o = object.economicalId) !== null && _o !== void 0 ? _o : undefined;
1125
- message.identificationNumber = (_p = object.identificationNumber) !== null && _p !== void 0 ? _p : undefined;
1126
- message.postalCode = (_q = object.postalCode) !== null && _q !== void 0 ? _q : undefined;
1127
- message.address = (_r = object.address) !== null && _r !== void 0 ? _r : undefined;
1128
- message.birthDate = (_s = object.birthDate) !== null && _s !== void 0 ? _s : undefined;
1129
- message.contactMobile = (_t = object.contactMobile) !== null && _t !== void 0 ? _t : undefined;
1130
- message.contactPhone = (_u = object.contactPhone) !== null && _u !== void 0 ? _u : undefined;
1131
- message.createdAt = (_v = object.createdAt) !== null && _v !== void 0 ? _v : undefined;
1132
- message.updatedAt = (_w = object.updatedAt) !== null && _w !== void 0 ? _w : undefined;
1126
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1127
+ message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0;
1128
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1129
+ ? long_1.default.fromValue(object.organizationId)
1130
+ : long_1.default.UZERO;
1131
+ message.roleId = (object.roleId !== undefined && object.roleId !== null)
1132
+ ? long_1.default.fromValue(object.roleId)
1133
+ : undefined;
1134
+ message.userId = (object.userId !== undefined && object.userId !== null)
1135
+ ? long_1.default.fromValue(object.userId)
1136
+ : undefined;
1137
+ message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
1138
+ ? long_1.default.fromValue(object.partnerId)
1139
+ : undefined;
1140
+ message.createdUserId = (object.createdUserId !== undefined && object.createdUserId !== null)
1141
+ ? long_1.default.fromValue(object.createdUserId)
1142
+ : undefined;
1143
+ message.updatedUserId = (object.updatedUserId !== undefined && object.updatedUserId !== null)
1144
+ ? long_1.default.fromValue(object.updatedUserId)
1145
+ : undefined;
1146
+ message.isComplete = (_b = object.isComplete) !== null && _b !== void 0 ? _b : false;
1147
+ message.name = (_c = object.name) !== null && _c !== void 0 ? _c : undefined;
1148
+ message.image = (_d = object.image) !== null && _d !== void 0 ? _d : undefined;
1149
+ message.nationalId = (_e = object.nationalId) !== null && _e !== void 0 ? _e : undefined;
1150
+ message.economicalId = (_f = object.economicalId) !== null && _f !== void 0 ? _f : undefined;
1151
+ message.identificationNumber = (_g = object.identificationNumber) !== null && _g !== void 0 ? _g : undefined;
1152
+ message.postalCode = (_h = object.postalCode) !== null && _h !== void 0 ? _h : undefined;
1153
+ message.address = (_j = object.address) !== null && _j !== void 0 ? _j : undefined;
1154
+ message.birthDate = (_k = object.birthDate) !== null && _k !== void 0 ? _k : undefined;
1155
+ message.contactMobile = (_l = object.contactMobile) !== null && _l !== void 0 ? _l : undefined;
1156
+ message.contactPhone = (_m = object.contactPhone) !== null && _m !== void 0 ? _m : undefined;
1157
+ message.createdAt = (_o = object.createdAt) !== null && _o !== void 0 ? _o : undefined;
1158
+ message.updatedAt = (_p = object.updatedAt) !== null && _p !== void 0 ? _p : undefined;
1133
1159
  return message;
1134
1160
  },
1135
1161
  };
1136
1162
  function createBasePersonalAccessToken() {
1137
1163
  return {
1138
- id: 0,
1164
+ id: long_1.default.UZERO,
1139
1165
  tokenableType: "",
1140
- tokenableId: 0,
1166
+ tokenableId: long_1.default.UZERO,
1141
1167
  name: "",
1142
1168
  token: "",
1143
1169
  abilities: undefined,
@@ -1155,14 +1181,14 @@ function createBasePersonalAccessToken() {
1155
1181
  }
1156
1182
  exports.PersonalAccessToken = {
1157
1183
  encode(message, writer = new wire_1.BinaryWriter()) {
1158
- if (message.id !== 0) {
1159
- writer.uint32(8).uint64(message.id);
1184
+ if (!message.id.equals(long_1.default.UZERO)) {
1185
+ writer.uint32(8).uint64(message.id.toString());
1160
1186
  }
1161
1187
  if (message.tokenableType !== "") {
1162
1188
  writer.uint32(18).string(message.tokenableType);
1163
1189
  }
1164
- if (message.tokenableId !== 0) {
1165
- writer.uint32(24).uint64(message.tokenableId);
1190
+ if (!message.tokenableId.equals(long_1.default.UZERO)) {
1191
+ writer.uint32(24).uint64(message.tokenableId.toString());
1166
1192
  }
1167
1193
  if (message.name !== "") {
1168
1194
  writer.uint32(34).string(message.name);
@@ -1183,7 +1209,7 @@ exports.PersonalAccessToken = {
1183
1209
  writer.uint32(74).string(message.domain);
1184
1210
  }
1185
1211
  if (message.partnerId !== undefined) {
1186
- writer.uint32(80).uint64(message.partnerId);
1212
+ writer.uint32(80).uint64(message.partnerId.toString());
1187
1213
  }
1188
1214
  if (message.userAgent !== undefined) {
1189
1215
  writer.uint32(90).string(message.userAgent);
@@ -1216,7 +1242,7 @@ exports.PersonalAccessToken = {
1216
1242
  if (tag !== 8) {
1217
1243
  break;
1218
1244
  }
1219
- message.id = longToNumber(reader.uint64());
1245
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
1220
1246
  continue;
1221
1247
  }
1222
1248
  case 2: {
@@ -1230,7 +1256,7 @@ exports.PersonalAccessToken = {
1230
1256
  if (tag !== 24) {
1231
1257
  break;
1232
1258
  }
1233
- message.tokenableId = longToNumber(reader.uint64());
1259
+ message.tokenableId = long_1.default.fromString(reader.uint64().toString(), true);
1234
1260
  continue;
1235
1261
  }
1236
1262
  case 4: {
@@ -1279,7 +1305,7 @@ exports.PersonalAccessToken = {
1279
1305
  if (tag !== 80) {
1280
1306
  break;
1281
1307
  }
1282
- message.partnerId = longToNumber(reader.uint64());
1308
+ message.partnerId = long_1.default.fromString(reader.uint64().toString(), true);
1283
1309
  continue;
1284
1310
  }
1285
1311
  case 11: {
@@ -1334,16 +1360,16 @@ exports.PersonalAccessToken = {
1334
1360
  },
1335
1361
  fromJSON(object) {
1336
1362
  return {
1337
- id: isSet(object.id) ? globalThis.Number(object.id) : 0,
1363
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1338
1364
  tokenableType: isSet(object.tokenable_type) ? globalThis.String(object.tokenable_type) : "",
1339
- tokenableId: isSet(object.tokenable_id) ? globalThis.Number(object.tokenable_id) : 0,
1365
+ tokenableId: isSet(object.tokenable_id) ? long_1.default.fromValue(object.tokenable_id) : long_1.default.UZERO,
1340
1366
  name: isSet(object.name) ? globalThis.String(object.name) : "",
1341
1367
  token: isSet(object.token) ? globalThis.String(object.token) : "",
1342
1368
  abilities: isSet(object.abilities) ? globalThis.String(object.abilities) : undefined,
1343
1369
  fcm: isSet(object.fcm) ? globalThis.String(object.fcm) : undefined,
1344
1370
  ip: isSet(object.ip) ? globalThis.String(object.ip) : undefined,
1345
1371
  domain: isSet(object.domain) ? globalThis.String(object.domain) : undefined,
1346
- partnerId: isSet(object.partner_id) ? globalThis.Number(object.partner_id) : undefined,
1372
+ partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : undefined,
1347
1373
  userAgent: isSet(object.user_agent) ? globalThis.String(object.user_agent) : undefined,
1348
1374
  deviceType: isSet(object.device_type) ? globalThis.String(object.device_type) : "",
1349
1375
  lastUsedAt: isSet(object.last_used_at) ? fromJsonTimestamp(object.last_used_at) : undefined,
@@ -1354,14 +1380,14 @@ exports.PersonalAccessToken = {
1354
1380
  },
1355
1381
  toJSON(message) {
1356
1382
  const obj = {};
1357
- if (message.id !== 0) {
1358
- obj.id = Math.round(message.id);
1383
+ if (!message.id.equals(long_1.default.UZERO)) {
1384
+ obj.id = (message.id || long_1.default.UZERO).toString();
1359
1385
  }
1360
1386
  if (message.tokenableType !== "") {
1361
1387
  obj.tokenable_type = message.tokenableType;
1362
1388
  }
1363
- if (message.tokenableId !== 0) {
1364
- obj.tokenable_id = Math.round(message.tokenableId);
1389
+ if (!message.tokenableId.equals(long_1.default.UZERO)) {
1390
+ obj.tokenable_id = (message.tokenableId || long_1.default.UZERO).toString();
1365
1391
  }
1366
1392
  if (message.name !== "") {
1367
1393
  obj.name = message.name;
@@ -1382,7 +1408,7 @@ exports.PersonalAccessToken = {
1382
1408
  obj.domain = message.domain;
1383
1409
  }
1384
1410
  if (message.partnerId !== undefined) {
1385
- obj.partner_id = Math.round(message.partnerId);
1411
+ obj.partner_id = (message.partnerId || long_1.default.UZERO).toString();
1386
1412
  }
1387
1413
  if (message.userAgent !== undefined) {
1388
1414
  obj.user_agent = message.userAgent;
@@ -1408,24 +1434,28 @@ exports.PersonalAccessToken = {
1408
1434
  return exports.PersonalAccessToken.fromPartial(base !== null && base !== void 0 ? base : {});
1409
1435
  },
1410
1436
  fromPartial(object) {
1411
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1437
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1412
1438
  const message = createBasePersonalAccessToken();
1413
- message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
1414
- message.tokenableType = (_b = object.tokenableType) !== null && _b !== void 0 ? _b : "";
1415
- message.tokenableId = (_c = object.tokenableId) !== null && _c !== void 0 ? _c : 0;
1416
- message.name = (_d = object.name) !== null && _d !== void 0 ? _d : "";
1417
- message.token = (_e = object.token) !== null && _e !== void 0 ? _e : "";
1418
- message.abilities = (_f = object.abilities) !== null && _f !== void 0 ? _f : undefined;
1419
- message.fcm = (_g = object.fcm) !== null && _g !== void 0 ? _g : undefined;
1420
- message.ip = (_h = object.ip) !== null && _h !== void 0 ? _h : undefined;
1421
- message.domain = (_j = object.domain) !== null && _j !== void 0 ? _j : undefined;
1422
- message.partnerId = (_k = object.partnerId) !== null && _k !== void 0 ? _k : undefined;
1423
- message.userAgent = (_l = object.userAgent) !== null && _l !== void 0 ? _l : undefined;
1424
- message.deviceType = (_m = object.deviceType) !== null && _m !== void 0 ? _m : "";
1425
- message.lastUsedAt = (_o = object.lastUsedAt) !== null && _o !== void 0 ? _o : undefined;
1426
- message.expiresAt = (_p = object.expiresAt) !== null && _p !== void 0 ? _p : undefined;
1427
- message.createdAt = (_q = object.createdAt) !== null && _q !== void 0 ? _q : undefined;
1428
- message.updatedAt = (_r = object.updatedAt) !== null && _r !== void 0 ? _r : undefined;
1439
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1440
+ message.tokenableType = (_a = object.tokenableType) !== null && _a !== void 0 ? _a : "";
1441
+ message.tokenableId = (object.tokenableId !== undefined && object.tokenableId !== null)
1442
+ ? long_1.default.fromValue(object.tokenableId)
1443
+ : long_1.default.UZERO;
1444
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
1445
+ message.token = (_c = object.token) !== null && _c !== void 0 ? _c : "";
1446
+ message.abilities = (_d = object.abilities) !== null && _d !== void 0 ? _d : undefined;
1447
+ message.fcm = (_e = object.fcm) !== null && _e !== void 0 ? _e : undefined;
1448
+ message.ip = (_f = object.ip) !== null && _f !== void 0 ? _f : undefined;
1449
+ message.domain = (_g = object.domain) !== null && _g !== void 0 ? _g : undefined;
1450
+ message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
1451
+ ? long_1.default.fromValue(object.partnerId)
1452
+ : undefined;
1453
+ message.userAgent = (_h = object.userAgent) !== null && _h !== void 0 ? _h : undefined;
1454
+ message.deviceType = (_j = object.deviceType) !== null && _j !== void 0 ? _j : "";
1455
+ message.lastUsedAt = (_k = object.lastUsedAt) !== null && _k !== void 0 ? _k : undefined;
1456
+ message.expiresAt = (_l = object.expiresAt) !== null && _l !== void 0 ? _l : undefined;
1457
+ message.createdAt = (_m = object.createdAt) !== null && _m !== void 0 ? _m : undefined;
1458
+ message.updatedAt = (_o = object.updatedAt) !== null && _o !== void 0 ? _o : undefined;
1429
1459
  return message;
1430
1460
  },
1431
1461
  };
@@ -1540,12 +1570,12 @@ function base64FromBytes(arr) {
1540
1570
  }
1541
1571
  }
1542
1572
  function toTimestamp(date) {
1543
- const seconds = Math.trunc(date.getTime() / 1000);
1573
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1000));
1544
1574
  const nanos = (date.getTime() % 1000) * 1000000;
1545
1575
  return { seconds, nanos };
1546
1576
  }
1547
1577
  function fromTimestamp(t) {
1548
- let millis = (t.seconds || 0) * 1000;
1578
+ let millis = (t.seconds.toNumber() || 0) * 1000;
1549
1579
  millis += (t.nanos || 0) / 1000000;
1550
1580
  return new globalThis.Date(millis);
1551
1581
  }
@@ -1560,15 +1590,8 @@ function fromJsonTimestamp(o) {
1560
1590
  return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
1561
1591
  }
1562
1592
  }
1563
- function longToNumber(int64) {
1564
- const num = globalThis.Number(int64.toString());
1565
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1566
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1567
- }
1568
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1569
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1570
- }
1571
- return num;
1593
+ function numberToLong(number) {
1594
+ return long_1.default.fromNumber(number);
1572
1595
  }
1573
1596
  function isObject(value) {
1574
1597
  return typeof value === "object" && value !== null;