@fatehan/tsrp 1.0.28 → 1.0.30

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.
@@ -8,13 +8,121 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.DeviceStatusList = exports.PersonalAccessToken = exports.Person = exports.SinotrackCache = exports.HeartbeatCache = exports.IoList_ItemsEntry = exports.IoList = exports.Gallery = exports.protobufPackage = void 0;
11
+ exports.ShownIo = exports.DeviceIo = exports.SystemIo_UnknownEntry = exports.SystemIo = exports.SystemIoStyle = exports.TrialLog = exports.ChargeLog = exports.DeviceStatusList = exports.PersonalAccessToken = exports.Person = exports.SinotrackCache = exports.HeartbeatCache = exports.IoList_ItemsEntry = exports.IoList = exports.Gallery = exports.ChargeLog_Type = exports.SystemIoType = exports.protobufPackage = void 0;
12
+ exports.systemIoTypeFromJSON = systemIoTypeFromJSON;
13
+ exports.systemIoTypeToJSON = systemIoTypeToJSON;
14
+ exports.chargeLog_TypeFromJSON = chargeLog_TypeFromJSON;
15
+ exports.chargeLog_TypeToJSON = chargeLog_TypeToJSON;
12
16
  /* eslint-disable */
13
17
  const wire_1 = require("@bufbuild/protobuf/wire");
14
18
  const long_1 = __importDefault(require("long"));
15
19
  const timestamp_1 = require("../google/protobuf/timestamp");
16
20
  const dataModel_1 = require("../packets/dataModel");
17
21
  exports.protobufPackage = "com.fatehan.models";
22
+ var SystemIoType;
23
+ (function (SystemIoType) {
24
+ SystemIoType[SystemIoType["STRING"] = 0] = "STRING";
25
+ SystemIoType[SystemIoType["BOOLEAN"] = 1] = "BOOLEAN";
26
+ SystemIoType[SystemIoType["NUMERIC"] = 2] = "NUMERIC";
27
+ SystemIoType[SystemIoType["FLOAT"] = 3] = "FLOAT";
28
+ SystemIoType[SystemIoType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(SystemIoType || (exports.SystemIoType = SystemIoType = {}));
30
+ function systemIoTypeFromJSON(object) {
31
+ switch (object) {
32
+ case 0:
33
+ case "STRING":
34
+ return SystemIoType.STRING;
35
+ case 1:
36
+ case "BOOLEAN":
37
+ return SystemIoType.BOOLEAN;
38
+ case 2:
39
+ case "NUMERIC":
40
+ return SystemIoType.NUMERIC;
41
+ case 3:
42
+ case "FLOAT":
43
+ return SystemIoType.FLOAT;
44
+ case -1:
45
+ case "UNRECOGNIZED":
46
+ default:
47
+ return SystemIoType.UNRECOGNIZED;
48
+ }
49
+ }
50
+ function systemIoTypeToJSON(object) {
51
+ switch (object) {
52
+ case SystemIoType.STRING:
53
+ return "STRING";
54
+ case SystemIoType.BOOLEAN:
55
+ return "BOOLEAN";
56
+ case SystemIoType.NUMERIC:
57
+ return "NUMERIC";
58
+ case SystemIoType.FLOAT:
59
+ return "FLOAT";
60
+ case SystemIoType.UNRECOGNIZED:
61
+ default:
62
+ return "UNRECOGNIZED";
63
+ }
64
+ }
65
+ var ChargeLog_Type;
66
+ (function (ChargeLog_Type) {
67
+ ChargeLog_Type[ChargeLog_Type["None"] = 0] = "None";
68
+ ChargeLog_Type[ChargeLog_Type["Wallet"] = 1] = "Wallet";
69
+ ChargeLog_Type[ChargeLog_Type["Store"] = 2] = "Store";
70
+ ChargeLog_Type[ChargeLog_Type["Payment"] = 3] = "Payment";
71
+ ChargeLog_Type[ChargeLog_Type["FirstConnect"] = 4] = "FirstConnect";
72
+ ChargeLog_Type[ChargeLog_Type["Trial"] = 5] = "Trial";
73
+ ChargeLog_Type[ChargeLog_Type["Refund"] = 6] = "Refund";
74
+ ChargeLog_Type[ChargeLog_Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
75
+ })(ChargeLog_Type || (exports.ChargeLog_Type = ChargeLog_Type = {}));
76
+ function chargeLog_TypeFromJSON(object) {
77
+ switch (object) {
78
+ case 0:
79
+ case "None":
80
+ return ChargeLog_Type.None;
81
+ case 1:
82
+ case "Wallet":
83
+ return ChargeLog_Type.Wallet;
84
+ case 2:
85
+ case "Store":
86
+ return ChargeLog_Type.Store;
87
+ case 3:
88
+ case "Payment":
89
+ return ChargeLog_Type.Payment;
90
+ case 4:
91
+ case "FirstConnect":
92
+ return ChargeLog_Type.FirstConnect;
93
+ case 5:
94
+ case "Trial":
95
+ return ChargeLog_Type.Trial;
96
+ case 6:
97
+ case "Refund":
98
+ return ChargeLog_Type.Refund;
99
+ case -1:
100
+ case "UNRECOGNIZED":
101
+ default:
102
+ return ChargeLog_Type.UNRECOGNIZED;
103
+ }
104
+ }
105
+ function chargeLog_TypeToJSON(object) {
106
+ switch (object) {
107
+ case ChargeLog_Type.None:
108
+ return "None";
109
+ case ChargeLog_Type.Wallet:
110
+ return "Wallet";
111
+ case ChargeLog_Type.Store:
112
+ return "Store";
113
+ case ChargeLog_Type.Payment:
114
+ return "Payment";
115
+ case ChargeLog_Type.FirstConnect:
116
+ return "FirstConnect";
117
+ case ChargeLog_Type.Trial:
118
+ return "Trial";
119
+ case ChargeLog_Type.Refund:
120
+ return "Refund";
121
+ case ChargeLog_Type.UNRECOGNIZED:
122
+ default:
123
+ return "UNRECOGNIZED";
124
+ }
125
+ }
18
126
  function createBaseGallery() {
19
127
  return {
20
128
  id: long_1.default.UZERO,
@@ -1508,6 +1616,1226 @@ exports.DeviceStatusList = {
1508
1616
  return message;
1509
1617
  },
1510
1618
  };
1619
+ function createBaseChargeLog() {
1620
+ return {
1621
+ id: long_1.default.UZERO,
1622
+ userId: undefined,
1623
+ deviceId: long_1.default.UZERO,
1624
+ imei: long_1.default.UZERO,
1625
+ objectId: undefined,
1626
+ objectType: undefined,
1627
+ type: 0,
1628
+ description: undefined,
1629
+ ip: undefined,
1630
+ userAgent: undefined,
1631
+ previousExpiration: undefined,
1632
+ nextExpiration: undefined,
1633
+ isUnlimited: false,
1634
+ refund: false,
1635
+ createdAt: undefined,
1636
+ updatedAt: undefined,
1637
+ };
1638
+ }
1639
+ exports.ChargeLog = {
1640
+ encode(message, writer = new wire_1.BinaryWriter()) {
1641
+ if (!message.id.equals(long_1.default.UZERO)) {
1642
+ writer.uint32(8).uint64(message.id.toString());
1643
+ }
1644
+ if (message.userId !== undefined) {
1645
+ writer.uint32(16).uint64(message.userId.toString());
1646
+ }
1647
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
1648
+ writer.uint32(24).uint64(message.deviceId.toString());
1649
+ }
1650
+ if (!message.imei.equals(long_1.default.UZERO)) {
1651
+ writer.uint32(32).uint64(message.imei.toString());
1652
+ }
1653
+ if (message.objectId !== undefined) {
1654
+ writer.uint32(40).uint64(message.objectId.toString());
1655
+ }
1656
+ if (message.objectType !== undefined) {
1657
+ writer.uint32(50).string(message.objectType);
1658
+ }
1659
+ if (message.type !== 0) {
1660
+ writer.uint32(56).int32(message.type);
1661
+ }
1662
+ if (message.description !== undefined) {
1663
+ writer.uint32(66).string(message.description);
1664
+ }
1665
+ if (message.ip !== undefined) {
1666
+ writer.uint32(74).string(message.ip);
1667
+ }
1668
+ if (message.userAgent !== undefined) {
1669
+ writer.uint32(82).string(message.userAgent);
1670
+ }
1671
+ if (message.previousExpiration !== undefined) {
1672
+ timestamp_1.Timestamp.encode(toTimestamp(message.previousExpiration), writer.uint32(90).fork()).join();
1673
+ }
1674
+ if (message.nextExpiration !== undefined) {
1675
+ timestamp_1.Timestamp.encode(toTimestamp(message.nextExpiration), writer.uint32(98).fork()).join();
1676
+ }
1677
+ if (message.isUnlimited !== false) {
1678
+ writer.uint32(104).bool(message.isUnlimited);
1679
+ }
1680
+ if (message.refund !== false) {
1681
+ writer.uint32(112).bool(message.refund);
1682
+ }
1683
+ if (message.createdAt !== undefined) {
1684
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(122).fork()).join();
1685
+ }
1686
+ if (message.updatedAt !== undefined) {
1687
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(130).fork()).join();
1688
+ }
1689
+ return writer;
1690
+ },
1691
+ decode(input, length) {
1692
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1693
+ let end = length === undefined ? reader.len : reader.pos + length;
1694
+ const message = createBaseChargeLog();
1695
+ while (reader.pos < end) {
1696
+ const tag = reader.uint32();
1697
+ switch (tag >>> 3) {
1698
+ case 1: {
1699
+ if (tag !== 8) {
1700
+ break;
1701
+ }
1702
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
1703
+ continue;
1704
+ }
1705
+ case 2: {
1706
+ if (tag !== 16) {
1707
+ break;
1708
+ }
1709
+ message.userId = long_1.default.fromString(reader.uint64().toString(), true);
1710
+ continue;
1711
+ }
1712
+ case 3: {
1713
+ if (tag !== 24) {
1714
+ break;
1715
+ }
1716
+ message.deviceId = long_1.default.fromString(reader.uint64().toString(), true);
1717
+ continue;
1718
+ }
1719
+ case 4: {
1720
+ if (tag !== 32) {
1721
+ break;
1722
+ }
1723
+ message.imei = long_1.default.fromString(reader.uint64().toString(), true);
1724
+ continue;
1725
+ }
1726
+ case 5: {
1727
+ if (tag !== 40) {
1728
+ break;
1729
+ }
1730
+ message.objectId = long_1.default.fromString(reader.uint64().toString(), true);
1731
+ continue;
1732
+ }
1733
+ case 6: {
1734
+ if (tag !== 50) {
1735
+ break;
1736
+ }
1737
+ message.objectType = reader.string();
1738
+ continue;
1739
+ }
1740
+ case 7: {
1741
+ if (tag !== 56) {
1742
+ break;
1743
+ }
1744
+ message.type = reader.int32();
1745
+ continue;
1746
+ }
1747
+ case 8: {
1748
+ if (tag !== 66) {
1749
+ break;
1750
+ }
1751
+ message.description = reader.string();
1752
+ continue;
1753
+ }
1754
+ case 9: {
1755
+ if (tag !== 74) {
1756
+ break;
1757
+ }
1758
+ message.ip = reader.string();
1759
+ continue;
1760
+ }
1761
+ case 10: {
1762
+ if (tag !== 82) {
1763
+ break;
1764
+ }
1765
+ message.userAgent = reader.string();
1766
+ continue;
1767
+ }
1768
+ case 11: {
1769
+ if (tag !== 90) {
1770
+ break;
1771
+ }
1772
+ message.previousExpiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
1773
+ continue;
1774
+ }
1775
+ case 12: {
1776
+ if (tag !== 98) {
1777
+ break;
1778
+ }
1779
+ message.nextExpiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
1780
+ continue;
1781
+ }
1782
+ case 13: {
1783
+ if (tag !== 104) {
1784
+ break;
1785
+ }
1786
+ message.isUnlimited = reader.bool();
1787
+ continue;
1788
+ }
1789
+ case 14: {
1790
+ if (tag !== 112) {
1791
+ break;
1792
+ }
1793
+ message.refund = reader.bool();
1794
+ continue;
1795
+ }
1796
+ case 15: {
1797
+ if (tag !== 122) {
1798
+ break;
1799
+ }
1800
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
1801
+ continue;
1802
+ }
1803
+ case 16: {
1804
+ if (tag !== 130) {
1805
+ break;
1806
+ }
1807
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
1808
+ continue;
1809
+ }
1810
+ }
1811
+ if ((tag & 7) === 4 || tag === 0) {
1812
+ break;
1813
+ }
1814
+ reader.skip(tag & 7);
1815
+ }
1816
+ return message;
1817
+ },
1818
+ fromJSON(object) {
1819
+ return {
1820
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1821
+ userId: isSet(object.user_id) ? long_1.default.fromValue(object.user_id) : undefined,
1822
+ deviceId: isSet(object.device_id) ? long_1.default.fromValue(object.device_id) : long_1.default.UZERO,
1823
+ imei: isSet(object.imei) ? long_1.default.fromValue(object.imei) : long_1.default.UZERO,
1824
+ objectId: isSet(object.object_id) ? long_1.default.fromValue(object.object_id) : undefined,
1825
+ objectType: isSet(object.object_type) ? globalThis.String(object.object_type) : undefined,
1826
+ type: isSet(object.type) ? chargeLog_TypeFromJSON(object.type) : 0,
1827
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
1828
+ ip: isSet(object.ip) ? globalThis.String(object.ip) : undefined,
1829
+ userAgent: isSet(object.user_agent) ? globalThis.String(object.user_agent) : undefined,
1830
+ previousExpiration: isSet(object.previous_expiration) ? fromJsonTimestamp(object.previous_expiration) : undefined,
1831
+ nextExpiration: isSet(object.next_expiration) ? fromJsonTimestamp(object.next_expiration) : undefined,
1832
+ isUnlimited: isSet(object.is_unlimited) ? globalThis.Boolean(object.is_unlimited) : false,
1833
+ refund: isSet(object.refund) ? globalThis.Boolean(object.refund) : false,
1834
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
1835
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
1836
+ };
1837
+ },
1838
+ toJSON(message) {
1839
+ const obj = {};
1840
+ if (!message.id.equals(long_1.default.UZERO)) {
1841
+ obj.id = (message.id || long_1.default.UZERO).toString();
1842
+ }
1843
+ if (message.userId !== undefined) {
1844
+ obj.user_id = (message.userId || long_1.default.UZERO).toString();
1845
+ }
1846
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
1847
+ obj.device_id = (message.deviceId || long_1.default.UZERO).toString();
1848
+ }
1849
+ if (!message.imei.equals(long_1.default.UZERO)) {
1850
+ obj.imei = (message.imei || long_1.default.UZERO).toString();
1851
+ }
1852
+ if (message.objectId !== undefined) {
1853
+ obj.object_id = (message.objectId || long_1.default.UZERO).toString();
1854
+ }
1855
+ if (message.objectType !== undefined) {
1856
+ obj.object_type = message.objectType;
1857
+ }
1858
+ if (message.type !== 0) {
1859
+ obj.type = chargeLog_TypeToJSON(message.type);
1860
+ }
1861
+ if (message.description !== undefined) {
1862
+ obj.description = message.description;
1863
+ }
1864
+ if (message.ip !== undefined) {
1865
+ obj.ip = message.ip;
1866
+ }
1867
+ if (message.userAgent !== undefined) {
1868
+ obj.user_agent = message.userAgent;
1869
+ }
1870
+ if (message.previousExpiration !== undefined) {
1871
+ obj.previous_expiration = message.previousExpiration.toISOString();
1872
+ }
1873
+ if (message.nextExpiration !== undefined) {
1874
+ obj.next_expiration = message.nextExpiration.toISOString();
1875
+ }
1876
+ if (message.isUnlimited !== false) {
1877
+ obj.is_unlimited = message.isUnlimited;
1878
+ }
1879
+ if (message.refund !== false) {
1880
+ obj.refund = message.refund;
1881
+ }
1882
+ if (message.createdAt !== undefined) {
1883
+ obj.created_at = message.createdAt.toISOString();
1884
+ }
1885
+ if (message.updatedAt !== undefined) {
1886
+ obj.updated_at = message.updatedAt.toISOString();
1887
+ }
1888
+ return obj;
1889
+ },
1890
+ create(base) {
1891
+ return exports.ChargeLog.fromPartial(base !== null && base !== void 0 ? base : {});
1892
+ },
1893
+ fromPartial(object) {
1894
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1895
+ const message = createBaseChargeLog();
1896
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1897
+ message.userId = (object.userId !== undefined && object.userId !== null)
1898
+ ? long_1.default.fromValue(object.userId)
1899
+ : undefined;
1900
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
1901
+ ? long_1.default.fromValue(object.deviceId)
1902
+ : long_1.default.UZERO;
1903
+ message.imei = (object.imei !== undefined && object.imei !== null) ? long_1.default.fromValue(object.imei) : long_1.default.UZERO;
1904
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
1905
+ ? long_1.default.fromValue(object.objectId)
1906
+ : undefined;
1907
+ message.objectType = (_a = object.objectType) !== null && _a !== void 0 ? _a : undefined;
1908
+ message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
1909
+ message.description = (_c = object.description) !== null && _c !== void 0 ? _c : undefined;
1910
+ message.ip = (_d = object.ip) !== null && _d !== void 0 ? _d : undefined;
1911
+ message.userAgent = (_e = object.userAgent) !== null && _e !== void 0 ? _e : undefined;
1912
+ message.previousExpiration = (_f = object.previousExpiration) !== null && _f !== void 0 ? _f : undefined;
1913
+ message.nextExpiration = (_g = object.nextExpiration) !== null && _g !== void 0 ? _g : undefined;
1914
+ message.isUnlimited = (_h = object.isUnlimited) !== null && _h !== void 0 ? _h : false;
1915
+ message.refund = (_j = object.refund) !== null && _j !== void 0 ? _j : false;
1916
+ message.createdAt = (_k = object.createdAt) !== null && _k !== void 0 ? _k : undefined;
1917
+ message.updatedAt = (_l = object.updatedAt) !== null && _l !== void 0 ? _l : undefined;
1918
+ return message;
1919
+ },
1920
+ };
1921
+ function createBaseTrialLog() {
1922
+ return { id: long_1.default.UZERO, imei: long_1.default.UZERO, createdAt: undefined };
1923
+ }
1924
+ exports.TrialLog = {
1925
+ encode(message, writer = new wire_1.BinaryWriter()) {
1926
+ if (!message.id.equals(long_1.default.UZERO)) {
1927
+ writer.uint32(8).uint64(message.id.toString());
1928
+ }
1929
+ if (!message.imei.equals(long_1.default.UZERO)) {
1930
+ writer.uint32(16).uint64(message.imei.toString());
1931
+ }
1932
+ if (message.createdAt !== undefined) {
1933
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).join();
1934
+ }
1935
+ return writer;
1936
+ },
1937
+ decode(input, length) {
1938
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1939
+ let end = length === undefined ? reader.len : reader.pos + length;
1940
+ const message = createBaseTrialLog();
1941
+ while (reader.pos < end) {
1942
+ const tag = reader.uint32();
1943
+ switch (tag >>> 3) {
1944
+ case 1: {
1945
+ if (tag !== 8) {
1946
+ break;
1947
+ }
1948
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
1949
+ continue;
1950
+ }
1951
+ case 2: {
1952
+ if (tag !== 16) {
1953
+ break;
1954
+ }
1955
+ message.imei = long_1.default.fromString(reader.uint64().toString(), true);
1956
+ continue;
1957
+ }
1958
+ case 3: {
1959
+ if (tag !== 26) {
1960
+ break;
1961
+ }
1962
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
1963
+ continue;
1964
+ }
1965
+ }
1966
+ if ((tag & 7) === 4 || tag === 0) {
1967
+ break;
1968
+ }
1969
+ reader.skip(tag & 7);
1970
+ }
1971
+ return message;
1972
+ },
1973
+ fromJSON(object) {
1974
+ return {
1975
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1976
+ imei: isSet(object.imei) ? long_1.default.fromValue(object.imei) : long_1.default.UZERO,
1977
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
1978
+ };
1979
+ },
1980
+ toJSON(message) {
1981
+ const obj = {};
1982
+ if (!message.id.equals(long_1.default.UZERO)) {
1983
+ obj.id = (message.id || long_1.default.UZERO).toString();
1984
+ }
1985
+ if (!message.imei.equals(long_1.default.UZERO)) {
1986
+ obj.imei = (message.imei || long_1.default.UZERO).toString();
1987
+ }
1988
+ if (message.createdAt !== undefined) {
1989
+ obj.created_at = message.createdAt.toISOString();
1990
+ }
1991
+ return obj;
1992
+ },
1993
+ create(base) {
1994
+ return exports.TrialLog.fromPartial(base !== null && base !== void 0 ? base : {});
1995
+ },
1996
+ fromPartial(object) {
1997
+ var _a;
1998
+ const message = createBaseTrialLog();
1999
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2000
+ message.imei = (object.imei !== undefined && object.imei !== null) ? long_1.default.fromValue(object.imei) : long_1.default.UZERO;
2001
+ message.createdAt = (_a = object.createdAt) !== null && _a !== void 0 ? _a : undefined;
2002
+ return message;
2003
+ },
2004
+ };
2005
+ function createBaseSystemIoStyle() {
2006
+ return { icon: undefined, name: undefined, color: undefined };
2007
+ }
2008
+ exports.SystemIoStyle = {
2009
+ encode(message, writer = new wire_1.BinaryWriter()) {
2010
+ if (message.icon !== undefined) {
2011
+ writer.uint32(10).string(message.icon);
2012
+ }
2013
+ if (message.name !== undefined) {
2014
+ writer.uint32(18).string(message.name);
2015
+ }
2016
+ if (message.color !== undefined) {
2017
+ writer.uint32(26).string(message.color);
2018
+ }
2019
+ return writer;
2020
+ },
2021
+ decode(input, length) {
2022
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2023
+ let end = length === undefined ? reader.len : reader.pos + length;
2024
+ const message = createBaseSystemIoStyle();
2025
+ while (reader.pos < end) {
2026
+ const tag = reader.uint32();
2027
+ switch (tag >>> 3) {
2028
+ case 1: {
2029
+ if (tag !== 10) {
2030
+ break;
2031
+ }
2032
+ message.icon = reader.string();
2033
+ continue;
2034
+ }
2035
+ case 2: {
2036
+ if (tag !== 18) {
2037
+ break;
2038
+ }
2039
+ message.name = reader.string();
2040
+ continue;
2041
+ }
2042
+ case 3: {
2043
+ if (tag !== 26) {
2044
+ break;
2045
+ }
2046
+ message.color = reader.string();
2047
+ continue;
2048
+ }
2049
+ }
2050
+ if ((tag & 7) === 4 || tag === 0) {
2051
+ break;
2052
+ }
2053
+ reader.skip(tag & 7);
2054
+ }
2055
+ return message;
2056
+ },
2057
+ fromJSON(object) {
2058
+ return {
2059
+ icon: isSet(object.icon) ? globalThis.String(object.icon) : undefined,
2060
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
2061
+ color: isSet(object.color) ? globalThis.String(object.color) : undefined,
2062
+ };
2063
+ },
2064
+ toJSON(message) {
2065
+ const obj = {};
2066
+ if (message.icon !== undefined) {
2067
+ obj.icon = message.icon;
2068
+ }
2069
+ if (message.name !== undefined) {
2070
+ obj.name = message.name;
2071
+ }
2072
+ if (message.color !== undefined) {
2073
+ obj.color = message.color;
2074
+ }
2075
+ return obj;
2076
+ },
2077
+ create(base) {
2078
+ return exports.SystemIoStyle.fromPartial(base !== null && base !== void 0 ? base : {});
2079
+ },
2080
+ fromPartial(object) {
2081
+ var _a, _b, _c;
2082
+ const message = createBaseSystemIoStyle();
2083
+ message.icon = (_a = object.icon) !== null && _a !== void 0 ? _a : undefined;
2084
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : undefined;
2085
+ message.color = (_c = object.color) !== null && _c !== void 0 ? _c : undefined;
2086
+ return message;
2087
+ },
2088
+ };
2089
+ function createBaseSystemIo() {
2090
+ return {
2091
+ id: long_1.default.UZERO,
2092
+ key: "",
2093
+ name: "",
2094
+ type: 0,
2095
+ unit: undefined,
2096
+ description: undefined,
2097
+ activeStyle: undefined,
2098
+ inactiveStyle: undefined,
2099
+ active: false,
2100
+ graphable: false,
2101
+ sord: 0,
2102
+ hidden: [],
2103
+ unknown: {},
2104
+ createdBy: undefined,
2105
+ createdAt: undefined,
2106
+ updatedAt: undefined,
2107
+ };
2108
+ }
2109
+ exports.SystemIo = {
2110
+ encode(message, writer = new wire_1.BinaryWriter()) {
2111
+ if (!message.id.equals(long_1.default.UZERO)) {
2112
+ writer.uint32(8).uint64(message.id.toString());
2113
+ }
2114
+ if (message.key !== "") {
2115
+ writer.uint32(18).string(message.key);
2116
+ }
2117
+ if (message.name !== "") {
2118
+ writer.uint32(26).string(message.name);
2119
+ }
2120
+ if (message.type !== 0) {
2121
+ writer.uint32(136).int32(message.type);
2122
+ }
2123
+ if (message.unit !== undefined) {
2124
+ writer.uint32(34).string(message.unit);
2125
+ }
2126
+ if (message.description !== undefined) {
2127
+ writer.uint32(42).string(message.description);
2128
+ }
2129
+ if (message.activeStyle !== undefined) {
2130
+ exports.SystemIoStyle.encode(message.activeStyle, writer.uint32(50).fork()).join();
2131
+ }
2132
+ if (message.inactiveStyle !== undefined) {
2133
+ exports.SystemIoStyle.encode(message.inactiveStyle, writer.uint32(58).fork()).join();
2134
+ }
2135
+ if (message.active !== false) {
2136
+ writer.uint32(64).bool(message.active);
2137
+ }
2138
+ if (message.graphable !== false) {
2139
+ writer.uint32(72).bool(message.graphable);
2140
+ }
2141
+ if (message.sord !== 0) {
2142
+ writer.uint32(80).uint32(message.sord);
2143
+ }
2144
+ for (const v of message.hidden) {
2145
+ writer.uint32(90).string(v);
2146
+ }
2147
+ Object.entries(message.unknown).forEach(([key, value]) => {
2148
+ exports.SystemIo_UnknownEntry.encode({ key: key, value }, writer.uint32(98).fork()).join();
2149
+ });
2150
+ if (message.createdBy !== undefined) {
2151
+ writer.uint32(104).uint64(message.createdBy.toString());
2152
+ }
2153
+ if (message.createdAt !== undefined) {
2154
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
2155
+ }
2156
+ if (message.updatedAt !== undefined) {
2157
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(122).fork()).join();
2158
+ }
2159
+ return writer;
2160
+ },
2161
+ decode(input, length) {
2162
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2163
+ let end = length === undefined ? reader.len : reader.pos + length;
2164
+ const message = createBaseSystemIo();
2165
+ while (reader.pos < end) {
2166
+ const tag = reader.uint32();
2167
+ switch (tag >>> 3) {
2168
+ case 1: {
2169
+ if (tag !== 8) {
2170
+ break;
2171
+ }
2172
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
2173
+ continue;
2174
+ }
2175
+ case 2: {
2176
+ if (tag !== 18) {
2177
+ break;
2178
+ }
2179
+ message.key = reader.string();
2180
+ continue;
2181
+ }
2182
+ case 3: {
2183
+ if (tag !== 26) {
2184
+ break;
2185
+ }
2186
+ message.name = reader.string();
2187
+ continue;
2188
+ }
2189
+ case 17: {
2190
+ if (tag !== 136) {
2191
+ break;
2192
+ }
2193
+ message.type = reader.int32();
2194
+ continue;
2195
+ }
2196
+ case 4: {
2197
+ if (tag !== 34) {
2198
+ break;
2199
+ }
2200
+ message.unit = reader.string();
2201
+ continue;
2202
+ }
2203
+ case 5: {
2204
+ if (tag !== 42) {
2205
+ break;
2206
+ }
2207
+ message.description = reader.string();
2208
+ continue;
2209
+ }
2210
+ case 6: {
2211
+ if (tag !== 50) {
2212
+ break;
2213
+ }
2214
+ message.activeStyle = exports.SystemIoStyle.decode(reader, reader.uint32());
2215
+ continue;
2216
+ }
2217
+ case 7: {
2218
+ if (tag !== 58) {
2219
+ break;
2220
+ }
2221
+ message.inactiveStyle = exports.SystemIoStyle.decode(reader, reader.uint32());
2222
+ continue;
2223
+ }
2224
+ case 8: {
2225
+ if (tag !== 64) {
2226
+ break;
2227
+ }
2228
+ message.active = reader.bool();
2229
+ continue;
2230
+ }
2231
+ case 9: {
2232
+ if (tag !== 72) {
2233
+ break;
2234
+ }
2235
+ message.graphable = reader.bool();
2236
+ continue;
2237
+ }
2238
+ case 10: {
2239
+ if (tag !== 80) {
2240
+ break;
2241
+ }
2242
+ message.sord = reader.uint32();
2243
+ continue;
2244
+ }
2245
+ case 11: {
2246
+ if (tag !== 90) {
2247
+ break;
2248
+ }
2249
+ message.hidden.push(reader.string());
2250
+ continue;
2251
+ }
2252
+ case 12: {
2253
+ if (tag !== 98) {
2254
+ break;
2255
+ }
2256
+ const entry12 = exports.SystemIo_UnknownEntry.decode(reader, reader.uint32());
2257
+ if (entry12.value !== undefined) {
2258
+ message.unknown[entry12.key] = entry12.value;
2259
+ }
2260
+ continue;
2261
+ }
2262
+ case 13: {
2263
+ if (tag !== 104) {
2264
+ break;
2265
+ }
2266
+ message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
2267
+ continue;
2268
+ }
2269
+ case 14: {
2270
+ if (tag !== 114) {
2271
+ break;
2272
+ }
2273
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2274
+ continue;
2275
+ }
2276
+ case 15: {
2277
+ if (tag !== 122) {
2278
+ break;
2279
+ }
2280
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2281
+ continue;
2282
+ }
2283
+ }
2284
+ if ((tag & 7) === 4 || tag === 0) {
2285
+ break;
2286
+ }
2287
+ reader.skip(tag & 7);
2288
+ }
2289
+ return message;
2290
+ },
2291
+ fromJSON(object) {
2292
+ return {
2293
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2294
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
2295
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2296
+ type: isSet(object.type) ? systemIoTypeFromJSON(object.type) : 0,
2297
+ unit: isSet(object.unit) ? globalThis.String(object.unit) : undefined,
2298
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2299
+ activeStyle: isSet(object.active_style) ? exports.SystemIoStyle.fromJSON(object.active_style) : undefined,
2300
+ inactiveStyle: isSet(object.inactive_style) ? exports.SystemIoStyle.fromJSON(object.inactive_style) : undefined,
2301
+ active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
2302
+ graphable: isSet(object.graphable) ? globalThis.Boolean(object.graphable) : false,
2303
+ sord: isSet(object.sord) ? globalThis.Number(object.sord) : 0,
2304
+ hidden: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.hidden) ? object.hidden.map((e) => globalThis.String(e)) : [],
2305
+ unknown: isObject(object.unknown)
2306
+ ? Object.entries(object.unknown).reduce((acc, [key, value]) => {
2307
+ acc[key] = String(value);
2308
+ return acc;
2309
+ }, {})
2310
+ : {},
2311
+ createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2312
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2313
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2314
+ };
2315
+ },
2316
+ toJSON(message) {
2317
+ var _a;
2318
+ const obj = {};
2319
+ if (!message.id.equals(long_1.default.UZERO)) {
2320
+ obj.id = (message.id || long_1.default.UZERO).toString();
2321
+ }
2322
+ if (message.key !== "") {
2323
+ obj.key = message.key;
2324
+ }
2325
+ if (message.name !== "") {
2326
+ obj.name = message.name;
2327
+ }
2328
+ if (message.type !== 0) {
2329
+ obj.type = systemIoTypeToJSON(message.type);
2330
+ }
2331
+ if (message.unit !== undefined) {
2332
+ obj.unit = message.unit;
2333
+ }
2334
+ if (message.description !== undefined) {
2335
+ obj.description = message.description;
2336
+ }
2337
+ if (message.activeStyle !== undefined) {
2338
+ obj.active_style = exports.SystemIoStyle.toJSON(message.activeStyle);
2339
+ }
2340
+ if (message.inactiveStyle !== undefined) {
2341
+ obj.inactive_style = exports.SystemIoStyle.toJSON(message.inactiveStyle);
2342
+ }
2343
+ if (message.active !== false) {
2344
+ obj.active = message.active;
2345
+ }
2346
+ if (message.graphable !== false) {
2347
+ obj.graphable = message.graphable;
2348
+ }
2349
+ if (message.sord !== 0) {
2350
+ obj.sord = Math.round(message.sord);
2351
+ }
2352
+ if ((_a = message.hidden) === null || _a === void 0 ? void 0 : _a.length) {
2353
+ obj.hidden = message.hidden;
2354
+ }
2355
+ if (message.unknown) {
2356
+ const entries = Object.entries(message.unknown);
2357
+ if (entries.length > 0) {
2358
+ obj.unknown = {};
2359
+ entries.forEach(([k, v]) => {
2360
+ obj.unknown[k] = v;
2361
+ });
2362
+ }
2363
+ }
2364
+ if (message.createdBy !== undefined) {
2365
+ obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2366
+ }
2367
+ if (message.createdAt !== undefined) {
2368
+ obj.created_at = message.createdAt.toISOString();
2369
+ }
2370
+ if (message.updatedAt !== undefined) {
2371
+ obj.updated_at = message.updatedAt.toISOString();
2372
+ }
2373
+ return obj;
2374
+ },
2375
+ create(base) {
2376
+ return exports.SystemIo.fromPartial(base !== null && base !== void 0 ? base : {});
2377
+ },
2378
+ fromPartial(object) {
2379
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2380
+ const message = createBaseSystemIo();
2381
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2382
+ message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
2383
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
2384
+ message.type = (_c = object.type) !== null && _c !== void 0 ? _c : 0;
2385
+ message.unit = (_d = object.unit) !== null && _d !== void 0 ? _d : undefined;
2386
+ message.description = (_e = object.description) !== null && _e !== void 0 ? _e : undefined;
2387
+ message.activeStyle = (object.activeStyle !== undefined && object.activeStyle !== null)
2388
+ ? exports.SystemIoStyle.fromPartial(object.activeStyle)
2389
+ : undefined;
2390
+ message.inactiveStyle = (object.inactiveStyle !== undefined && object.inactiveStyle !== null)
2391
+ ? exports.SystemIoStyle.fromPartial(object.inactiveStyle)
2392
+ : undefined;
2393
+ message.active = (_f = object.active) !== null && _f !== void 0 ? _f : false;
2394
+ message.graphable = (_g = object.graphable) !== null && _g !== void 0 ? _g : false;
2395
+ message.sord = (_h = object.sord) !== null && _h !== void 0 ? _h : 0;
2396
+ message.hidden = ((_j = object.hidden) === null || _j === void 0 ? void 0 : _j.map((e) => e)) || [];
2397
+ message.unknown = Object.entries((_k = object.unknown) !== null && _k !== void 0 ? _k : {}).reduce((acc, [key, value]) => {
2398
+ if (value !== undefined) {
2399
+ acc[key] = globalThis.String(value);
2400
+ }
2401
+ return acc;
2402
+ }, {});
2403
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2404
+ ? long_1.default.fromValue(object.createdBy)
2405
+ : undefined;
2406
+ message.createdAt = (_l = object.createdAt) !== null && _l !== void 0 ? _l : undefined;
2407
+ message.updatedAt = (_m = object.updatedAt) !== null && _m !== void 0 ? _m : undefined;
2408
+ return message;
2409
+ },
2410
+ };
2411
+ function createBaseSystemIo_UnknownEntry() {
2412
+ return { key: "", value: "" };
2413
+ }
2414
+ exports.SystemIo_UnknownEntry = {
2415
+ encode(message, writer = new wire_1.BinaryWriter()) {
2416
+ if (message.key !== "") {
2417
+ writer.uint32(10).string(message.key);
2418
+ }
2419
+ if (message.value !== "") {
2420
+ writer.uint32(18).string(message.value);
2421
+ }
2422
+ return writer;
2423
+ },
2424
+ decode(input, length) {
2425
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2426
+ let end = length === undefined ? reader.len : reader.pos + length;
2427
+ const message = createBaseSystemIo_UnknownEntry();
2428
+ while (reader.pos < end) {
2429
+ const tag = reader.uint32();
2430
+ switch (tag >>> 3) {
2431
+ case 1: {
2432
+ if (tag !== 10) {
2433
+ break;
2434
+ }
2435
+ message.key = reader.string();
2436
+ continue;
2437
+ }
2438
+ case 2: {
2439
+ if (tag !== 18) {
2440
+ break;
2441
+ }
2442
+ message.value = reader.string();
2443
+ continue;
2444
+ }
2445
+ }
2446
+ if ((tag & 7) === 4 || tag === 0) {
2447
+ break;
2448
+ }
2449
+ reader.skip(tag & 7);
2450
+ }
2451
+ return message;
2452
+ },
2453
+ fromJSON(object) {
2454
+ return {
2455
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
2456
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
2457
+ };
2458
+ },
2459
+ toJSON(message) {
2460
+ const obj = {};
2461
+ if (message.key !== "") {
2462
+ obj.key = message.key;
2463
+ }
2464
+ if (message.value !== "") {
2465
+ obj.value = message.value;
2466
+ }
2467
+ return obj;
2468
+ },
2469
+ create(base) {
2470
+ return exports.SystemIo_UnknownEntry.fromPartial(base !== null && base !== void 0 ? base : {});
2471
+ },
2472
+ fromPartial(object) {
2473
+ var _a, _b;
2474
+ const message = createBaseSystemIo_UnknownEntry();
2475
+ message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
2476
+ message.value = (_b = object.value) !== null && _b !== void 0 ? _b : "";
2477
+ return message;
2478
+ },
2479
+ };
2480
+ function createBaseDeviceIo() {
2481
+ return {
2482
+ id: long_1.default.UZERO,
2483
+ deviceId: long_1.default.UZERO,
2484
+ organizationId: long_1.default.UZERO,
2485
+ name: "",
2486
+ unit: undefined,
2487
+ type: 0,
2488
+ description: undefined,
2489
+ formula: "",
2490
+ activeStyle: undefined,
2491
+ inactiveStyle: undefined,
2492
+ createdBy: undefined,
2493
+ createdAt: undefined,
2494
+ updatedAt: undefined,
2495
+ };
2496
+ }
2497
+ exports.DeviceIo = {
2498
+ encode(message, writer = new wire_1.BinaryWriter()) {
2499
+ if (!message.id.equals(long_1.default.UZERO)) {
2500
+ writer.uint32(8).uint64(message.id.toString());
2501
+ }
2502
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
2503
+ writer.uint32(16).uint64(message.deviceId.toString());
2504
+ }
2505
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
2506
+ writer.uint32(80).uint64(message.organizationId.toString());
2507
+ }
2508
+ if (message.name !== "") {
2509
+ writer.uint32(26).string(message.name);
2510
+ }
2511
+ if (message.unit !== undefined) {
2512
+ writer.uint32(34).string(message.unit);
2513
+ }
2514
+ if (message.type !== 0) {
2515
+ writer.uint32(40).int32(message.type);
2516
+ }
2517
+ if (message.description !== undefined) {
2518
+ writer.uint32(50).string(message.description);
2519
+ }
2520
+ if (message.formula !== "") {
2521
+ writer.uint32(90).string(message.formula);
2522
+ }
2523
+ if (message.activeStyle !== undefined) {
2524
+ exports.SystemIoStyle.encode(message.activeStyle, writer.uint32(98).fork()).join();
2525
+ }
2526
+ if (message.inactiveStyle !== undefined) {
2527
+ exports.SystemIoStyle.encode(message.inactiveStyle, writer.uint32(106).fork()).join();
2528
+ }
2529
+ if (message.createdBy !== undefined) {
2530
+ writer.uint32(56).uint64(message.createdBy.toString());
2531
+ }
2532
+ if (message.createdAt !== undefined) {
2533
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
2534
+ }
2535
+ if (message.updatedAt !== undefined) {
2536
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
2537
+ }
2538
+ return writer;
2539
+ },
2540
+ decode(input, length) {
2541
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2542
+ let end = length === undefined ? reader.len : reader.pos + length;
2543
+ const message = createBaseDeviceIo();
2544
+ while (reader.pos < end) {
2545
+ const tag = reader.uint32();
2546
+ switch (tag >>> 3) {
2547
+ case 1: {
2548
+ if (tag !== 8) {
2549
+ break;
2550
+ }
2551
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
2552
+ continue;
2553
+ }
2554
+ case 2: {
2555
+ if (tag !== 16) {
2556
+ break;
2557
+ }
2558
+ message.deviceId = long_1.default.fromString(reader.uint64().toString(), true);
2559
+ continue;
2560
+ }
2561
+ case 10: {
2562
+ if (tag !== 80) {
2563
+ break;
2564
+ }
2565
+ message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
2566
+ continue;
2567
+ }
2568
+ case 3: {
2569
+ if (tag !== 26) {
2570
+ break;
2571
+ }
2572
+ message.name = reader.string();
2573
+ continue;
2574
+ }
2575
+ case 4: {
2576
+ if (tag !== 34) {
2577
+ break;
2578
+ }
2579
+ message.unit = reader.string();
2580
+ continue;
2581
+ }
2582
+ case 5: {
2583
+ if (tag !== 40) {
2584
+ break;
2585
+ }
2586
+ message.type = reader.int32();
2587
+ continue;
2588
+ }
2589
+ case 6: {
2590
+ if (tag !== 50) {
2591
+ break;
2592
+ }
2593
+ message.description = reader.string();
2594
+ continue;
2595
+ }
2596
+ case 11: {
2597
+ if (tag !== 90) {
2598
+ break;
2599
+ }
2600
+ message.formula = reader.string();
2601
+ continue;
2602
+ }
2603
+ case 12: {
2604
+ if (tag !== 98) {
2605
+ break;
2606
+ }
2607
+ message.activeStyle = exports.SystemIoStyle.decode(reader, reader.uint32());
2608
+ continue;
2609
+ }
2610
+ case 13: {
2611
+ if (tag !== 106) {
2612
+ break;
2613
+ }
2614
+ message.inactiveStyle = exports.SystemIoStyle.decode(reader, reader.uint32());
2615
+ continue;
2616
+ }
2617
+ case 7: {
2618
+ if (tag !== 56) {
2619
+ break;
2620
+ }
2621
+ message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
2622
+ continue;
2623
+ }
2624
+ case 8: {
2625
+ if (tag !== 66) {
2626
+ break;
2627
+ }
2628
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2629
+ continue;
2630
+ }
2631
+ case 9: {
2632
+ if (tag !== 74) {
2633
+ break;
2634
+ }
2635
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2636
+ continue;
2637
+ }
2638
+ }
2639
+ if ((tag & 7) === 4 || tag === 0) {
2640
+ break;
2641
+ }
2642
+ reader.skip(tag & 7);
2643
+ }
2644
+ return message;
2645
+ },
2646
+ fromJSON(object) {
2647
+ return {
2648
+ id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2649
+ deviceId: isSet(object.device_id) ? long_1.default.fromValue(object.device_id) : long_1.default.UZERO,
2650
+ organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
2651
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2652
+ unit: isSet(object.unit) ? globalThis.String(object.unit) : undefined,
2653
+ type: isSet(object.type) ? systemIoTypeFromJSON(object.type) : 0,
2654
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2655
+ formula: isSet(object.formula) ? globalThis.String(object.formula) : "",
2656
+ activeStyle: isSet(object.active_style) ? exports.SystemIoStyle.fromJSON(object.active_style) : undefined,
2657
+ inactiveStyle: isSet(object.inactive_style) ? exports.SystemIoStyle.fromJSON(object.inactive_style) : undefined,
2658
+ createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2659
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2660
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2661
+ };
2662
+ },
2663
+ toJSON(message) {
2664
+ const obj = {};
2665
+ if (!message.id.equals(long_1.default.UZERO)) {
2666
+ obj.id = (message.id || long_1.default.UZERO).toString();
2667
+ }
2668
+ if (!message.deviceId.equals(long_1.default.UZERO)) {
2669
+ obj.device_id = (message.deviceId || long_1.default.UZERO).toString();
2670
+ }
2671
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
2672
+ obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
2673
+ }
2674
+ if (message.name !== "") {
2675
+ obj.name = message.name;
2676
+ }
2677
+ if (message.unit !== undefined) {
2678
+ obj.unit = message.unit;
2679
+ }
2680
+ if (message.type !== 0) {
2681
+ obj.type = systemIoTypeToJSON(message.type);
2682
+ }
2683
+ if (message.description !== undefined) {
2684
+ obj.description = message.description;
2685
+ }
2686
+ if (message.formula !== "") {
2687
+ obj.formula = message.formula;
2688
+ }
2689
+ if (message.activeStyle !== undefined) {
2690
+ obj.active_style = exports.SystemIoStyle.toJSON(message.activeStyle);
2691
+ }
2692
+ if (message.inactiveStyle !== undefined) {
2693
+ obj.inactive_style = exports.SystemIoStyle.toJSON(message.inactiveStyle);
2694
+ }
2695
+ if (message.createdBy !== undefined) {
2696
+ obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2697
+ }
2698
+ if (message.createdAt !== undefined) {
2699
+ obj.created_at = message.createdAt.toISOString();
2700
+ }
2701
+ if (message.updatedAt !== undefined) {
2702
+ obj.updated_at = message.updatedAt.toISOString();
2703
+ }
2704
+ return obj;
2705
+ },
2706
+ create(base) {
2707
+ return exports.DeviceIo.fromPartial(base !== null && base !== void 0 ? base : {});
2708
+ },
2709
+ fromPartial(object) {
2710
+ var _a, _b, _c, _d, _e, _f, _g;
2711
+ const message = createBaseDeviceIo();
2712
+ message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2713
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
2714
+ ? long_1.default.fromValue(object.deviceId)
2715
+ : long_1.default.UZERO;
2716
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2717
+ ? long_1.default.fromValue(object.organizationId)
2718
+ : long_1.default.UZERO;
2719
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2720
+ message.unit = (_b = object.unit) !== null && _b !== void 0 ? _b : undefined;
2721
+ message.type = (_c = object.type) !== null && _c !== void 0 ? _c : 0;
2722
+ message.description = (_d = object.description) !== null && _d !== void 0 ? _d : undefined;
2723
+ message.formula = (_e = object.formula) !== null && _e !== void 0 ? _e : "";
2724
+ message.activeStyle = (object.activeStyle !== undefined && object.activeStyle !== null)
2725
+ ? exports.SystemIoStyle.fromPartial(object.activeStyle)
2726
+ : undefined;
2727
+ message.inactiveStyle = (object.inactiveStyle !== undefined && object.inactiveStyle !== null)
2728
+ ? exports.SystemIoStyle.fromPartial(object.inactiveStyle)
2729
+ : undefined;
2730
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2731
+ ? long_1.default.fromValue(object.createdBy)
2732
+ : undefined;
2733
+ message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
2734
+ message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
2735
+ return message;
2736
+ },
2737
+ };
2738
+ function createBaseShownIo() {
2739
+ return { name: "", style: undefined, unit: undefined, description: undefined };
2740
+ }
2741
+ exports.ShownIo = {
2742
+ encode(message, writer = new wire_1.BinaryWriter()) {
2743
+ if (message.name !== "") {
2744
+ writer.uint32(10).string(message.name);
2745
+ }
2746
+ if (message.style !== undefined) {
2747
+ exports.SystemIoStyle.encode(message.style, writer.uint32(18).fork()).join();
2748
+ }
2749
+ if (message.unit !== undefined) {
2750
+ writer.uint32(26).string(message.unit);
2751
+ }
2752
+ if (message.description !== undefined) {
2753
+ writer.uint32(34).string(message.description);
2754
+ }
2755
+ return writer;
2756
+ },
2757
+ decode(input, length) {
2758
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2759
+ let end = length === undefined ? reader.len : reader.pos + length;
2760
+ const message = createBaseShownIo();
2761
+ while (reader.pos < end) {
2762
+ const tag = reader.uint32();
2763
+ switch (tag >>> 3) {
2764
+ case 1: {
2765
+ if (tag !== 10) {
2766
+ break;
2767
+ }
2768
+ message.name = reader.string();
2769
+ continue;
2770
+ }
2771
+ case 2: {
2772
+ if (tag !== 18) {
2773
+ break;
2774
+ }
2775
+ message.style = exports.SystemIoStyle.decode(reader, reader.uint32());
2776
+ continue;
2777
+ }
2778
+ case 3: {
2779
+ if (tag !== 26) {
2780
+ break;
2781
+ }
2782
+ message.unit = reader.string();
2783
+ continue;
2784
+ }
2785
+ case 4: {
2786
+ if (tag !== 34) {
2787
+ break;
2788
+ }
2789
+ message.description = reader.string();
2790
+ continue;
2791
+ }
2792
+ }
2793
+ if ((tag & 7) === 4 || tag === 0) {
2794
+ break;
2795
+ }
2796
+ reader.skip(tag & 7);
2797
+ }
2798
+ return message;
2799
+ },
2800
+ fromJSON(object) {
2801
+ return {
2802
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2803
+ style: isSet(object.style) ? exports.SystemIoStyle.fromJSON(object.style) : undefined,
2804
+ unit: isSet(object.unit) ? globalThis.String(object.unit) : undefined,
2805
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2806
+ };
2807
+ },
2808
+ toJSON(message) {
2809
+ const obj = {};
2810
+ if (message.name !== "") {
2811
+ obj.name = message.name;
2812
+ }
2813
+ if (message.style !== undefined) {
2814
+ obj.style = exports.SystemIoStyle.toJSON(message.style);
2815
+ }
2816
+ if (message.unit !== undefined) {
2817
+ obj.unit = message.unit;
2818
+ }
2819
+ if (message.description !== undefined) {
2820
+ obj.description = message.description;
2821
+ }
2822
+ return obj;
2823
+ },
2824
+ create(base) {
2825
+ return exports.ShownIo.fromPartial(base !== null && base !== void 0 ? base : {});
2826
+ },
2827
+ fromPartial(object) {
2828
+ var _a, _b, _c;
2829
+ const message = createBaseShownIo();
2830
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2831
+ message.style = (object.style !== undefined && object.style !== null)
2832
+ ? exports.SystemIoStyle.fromPartial(object.style)
2833
+ : undefined;
2834
+ message.unit = (_b = object.unit) !== null && _b !== void 0 ? _b : undefined;
2835
+ message.description = (_c = object.description) !== null && _c !== void 0 ? _c : undefined;
2836
+ return message;
2837
+ },
2838
+ };
1511
2839
  function bytesFromBase64(b64) {
1512
2840
  if (globalThis.Buffer) {
1513
2841
  return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));