sanka-baileyss 1.4.8

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 (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2520 -0
  3. package/WAProto/Adv/Adv.d.ts +518 -0
  4. package/WAProto/Adv/Adv.js +1734 -0
  5. package/WAProto/Adv/Adv.proto +36 -0
  6. package/WAProto/Cert/Cert.d.ts +497 -0
  7. package/WAProto/Cert/Cert.js +1503 -0
  8. package/WAProto/Cert/Cert.proto +28 -0
  9. package/WAProto/ChatLockSettings/ChatLockSettings.d.ts +391 -0
  10. package/WAProto/ChatLockSettings/ChatLockSettings.js +1155 -0
  11. package/WAProto/ChatLockSettings/ChatLockSettings.proto +7 -0
  12. package/WAProto/CompanionReg/CompanionReg.d.ts +1049 -0
  13. package/WAProto/CompanionReg/CompanionReg.js +3496 -0
  14. package/WAProto/CompanionReg/CompanionReg.proto +88 -0
  15. package/WAProto/DeviceCapabilities/DeviceCapabilities.d.ts +187 -0
  16. package/WAProto/DeviceCapabilities/DeviceCapabilities.js +520 -0
  17. package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +14 -0
  18. package/WAProto/E2E/E2E.d.ts +27989 -0
  19. package/WAProto/E2E/E2E.js +97013 -0
  20. package/WAProto/E2E/E2E.proto +2256 -0
  21. package/WAProto/Ephemeral/Ephemeral.d.ts +95 -0
  22. package/WAProto/Ephemeral/Ephemeral.js +269 -0
  23. package/WAProto/Ephemeral/Ephemeral.proto +6 -0
  24. package/WAProto/HistorySync/HistorySync.d.ts +40300 -0
  25. package/WAProto/HistorySync/HistorySync.js +141555 -0
  26. package/WAProto/HistorySync/HistorySync.proto +207 -0
  27. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.d.ts +189 -0
  28. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +585 -0
  29. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +11 -0
  30. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.d.ts +461 -0
  31. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +1559 -0
  32. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +37 -0
  33. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +28866 -0
  34. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +100307 -0
  35. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +76 -0
  36. package/WAProto/MmsRetry/MmsRetry.d.ts +200 -0
  37. package/WAProto/MmsRetry/MmsRetry.js +586 -0
  38. package/WAProto/MmsRetry/MmsRetry.proto +17 -0
  39. package/WAProto/Protocol/Protocol.d.ts +218 -0
  40. package/WAProto/Protocol/Protocol.js +701 -0
  41. package/WAProto/Protocol/Protocol.proto +20 -0
  42. package/WAProto/Reporting/Reporting.d.ts +301 -0
  43. package/WAProto/Reporting/Reporting.js +989 -0
  44. package/WAProto/Reporting/Reporting.proto +19 -0
  45. package/WAProto/ServerSync/ServerSync.d.ts +1050 -0
  46. package/WAProto/ServerSync/ServerSync.js +3176 -0
  47. package/WAProto/ServerSync/ServerSync.proto +59 -0
  48. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.d.ts +1507 -0
  49. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +4756 -0
  50. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +88 -0
  51. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.d.ts +617 -0
  52. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1940 -0
  53. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +38 -0
  54. package/WAProto/StatusAttributions/StatusAttributions.d.ts +544 -0
  55. package/WAProto/StatusAttributions/StatusAttributions.js +1769 -0
  56. package/WAProto/StatusAttributions/StatusAttributions.proto +53 -0
  57. package/WAProto/SyncAction/SyncAction.d.ts +7227 -0
  58. package/WAProto/SyncAction/SyncAction.js +22271 -0
  59. package/WAProto/SyncAction/SyncAction.proto +423 -0
  60. package/WAProto/UserPassword/UserPassword.d.ts +298 -0
  61. package/WAProto/UserPassword/UserPassword.js +898 -0
  62. package/WAProto/UserPassword/UserPassword.proto +27 -0
  63. package/WAProto/VnameCert/VnameCert.d.ts +658 -0
  64. package/WAProto/VnameCert/VnameCert.js +2225 -0
  65. package/WAProto/VnameCert/VnameCert.proto +60 -0
  66. package/WAProto/Wa6/Wa6.d.ts +1613 -0
  67. package/WAProto/Wa6/Wa6.js +6299 -0
  68. package/WAProto/Wa6/Wa6.proto +229 -0
  69. package/WAProto/Web/Web.d.ts +31290 -0
  70. package/WAProto/Web/Web.js +111977 -0
  71. package/WAProto/Web/Web.proto +545 -0
  72. package/WAProto/index.d.ts +49 -0
  73. package/WAProto/index.js +28 -0
  74. package/WASignalGroup/GroupProtocol.js +1771 -0
  75. package/WASignalGroup/ciphertext_message.js +10 -0
  76. package/WASignalGroup/group_cipher.js +103 -0
  77. package/WASignalGroup/group_session_builder.js +39 -0
  78. package/WASignalGroup/index.js +5 -0
  79. package/WASignalGroup/keyhelper.js +17 -0
  80. package/WASignalGroup/protobufs.js +2 -0
  81. package/WASignalGroup/queue_job.js +64 -0
  82. package/WASignalGroup/sender_chain_key.js +38 -0
  83. package/WASignalGroup/sender_key_distribution_message.js +68 -0
  84. package/WASignalGroup/sender_key_message.js +79 -0
  85. package/WASignalGroup/sender_key_name.js +59 -0
  86. package/WASignalGroup/sender_key_record.js +47 -0
  87. package/WASignalGroup/sender_key_state.js +110 -0
  88. package/WASignalGroup/sender_message_key.js +30 -0
  89. package/check-node-version.js +10 -0
  90. package/lib/Defaults/baileys-version.json +3 -0
  91. package/lib/Defaults/index.d.ts +51 -0
  92. package/lib/Defaults/index.js +108 -0
  93. package/lib/Defaults/phonenumber-mcc.json +223 -0
  94. package/lib/Signal/libsignal.d.ts +3 -0
  95. package/lib/Signal/libsignal.js +153 -0
  96. package/lib/Socket/Client/index.d.ts +2 -0
  97. package/lib/Socket/Client/index.js +18 -0
  98. package/lib/Socket/Client/types.d.ts +15 -0
  99. package/lib/Socket/Client/types.js +14 -0
  100. package/lib/Socket/Client/websocket.d.ts +12 -0
  101. package/lib/Socket/Client/websocket.js +57 -0
  102. package/lib/Socket/business.d.ts +181 -0
  103. package/lib/Socket/business.js +259 -0
  104. package/lib/Socket/chats.d.ts +95 -0
  105. package/lib/Socket/chats.js +906 -0
  106. package/lib/Socket/groups.d.ts +128 -0
  107. package/lib/Socket/groups.js +307 -0
  108. package/lib/Socket/index.d.ts +183 -0
  109. package/lib/Socket/index.js +10 -0
  110. package/lib/Socket/messages-recv.d.ts +170 -0
  111. package/lib/Socket/messages-recv.js +1072 -0
  112. package/lib/Socket/messages-send.d.ts +161 -0
  113. package/lib/Socket/messages-send.js +984 -0
  114. package/lib/Socket/newsletter.d.ts +140 -0
  115. package/lib/Socket/newsletter.js +242 -0
  116. package/lib/Socket/socket.d.ts +43 -0
  117. package/lib/Socket/socket.js +651 -0
  118. package/lib/Socket/usync.d.ts +36 -0
  119. package/lib/Socket/usync.js +71 -0
  120. package/lib/Store/index.d.ts +4 -0
  121. package/lib/Store/index.js +20 -0
  122. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  123. package/lib/Store/make-cache-manager-store.js +85 -0
  124. package/lib/Store/make-in-memory-store.d.ts +117 -0
  125. package/lib/Store/make-in-memory-store.js +420 -0
  126. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  127. package/lib/Store/make-ordered-dictionary.js +83 -0
  128. package/lib/Store/object-repository.d.ts +10 -0
  129. package/lib/Store/object-repository.js +28 -0
  130. package/lib/Types/Auth.d.ts +103 -0
  131. package/lib/Types/Auth.js +2 -0
  132. package/lib/Types/Call.d.ts +13 -0
  133. package/lib/Types/Call.js +2 -0
  134. package/lib/Types/Chat.d.ts +115 -0
  135. package/lib/Types/Chat.js +6 -0
  136. package/lib/Types/Contact.d.ts +24 -0
  137. package/lib/Types/Contact.js +2 -0
  138. package/lib/Types/Events.d.ts +208 -0
  139. package/lib/Types/Events.js +2 -0
  140. package/lib/Types/GroupMetadata.d.ts +58 -0
  141. package/lib/Types/GroupMetadata.js +2 -0
  142. package/lib/Types/Label.d.ts +46 -0
  143. package/lib/Types/Label.js +28 -0
  144. package/lib/Types/LabelAssociation.d.ts +29 -0
  145. package/lib/Types/LabelAssociation.js +10 -0
  146. package/lib/Types/Message.d.ts +391 -0
  147. package/lib/Types/Message.js +9 -0
  148. package/lib/Types/Newsletter.d.ts +92 -0
  149. package/lib/Types/Newsletter.js +33 -0
  150. package/lib/Types/Product.d.ts +78 -0
  151. package/lib/Types/Product.js +2 -0
  152. package/lib/Types/Signal.d.ts +57 -0
  153. package/lib/Types/Signal.js +2 -0
  154. package/lib/Types/Socket.d.ts +116 -0
  155. package/lib/Types/Socket.js +2 -0
  156. package/lib/Types/State.d.ts +27 -0
  157. package/lib/Types/State.js +2 -0
  158. package/lib/Types/USync.d.ts +25 -0
  159. package/lib/Types/USync.js +2 -0
  160. package/lib/Types/index.d.ts +70 -0
  161. package/lib/Types/index.js +42 -0
  162. package/lib/Utils/auth-utils.d.ts +18 -0
  163. package/lib/Utils/auth-utils.js +198 -0
  164. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  165. package/lib/Utils/baileys-event-stream.js +64 -0
  166. package/lib/Utils/business.d.ts +22 -0
  167. package/lib/Utils/business.js +239 -0
  168. package/lib/Utils/chat-utils.d.ts +70 -0
  169. package/lib/Utils/chat-utils.js +754 -0
  170. package/lib/Utils/crypto.d.ts +40 -0
  171. package/lib/Utils/crypto.js +150 -0
  172. package/lib/Utils/decode-wa-message.d.ts +36 -0
  173. package/lib/Utils/decode-wa-message.js +228 -0
  174. package/lib/Utils/event-buffer.d.ts +35 -0
  175. package/lib/Utils/event-buffer.js +539 -0
  176. package/lib/Utils/generics.d.ts +96 -0
  177. package/lib/Utils/generics.js +553 -0
  178. package/lib/Utils/history.d.ts +19 -0
  179. package/lib/Utils/history.js +93 -0
  180. package/lib/Utils/index.d.ts +19 -0
  181. package/lib/Utils/index.js +35 -0
  182. package/lib/Utils/link-preview.d.ts +21 -0
  183. package/lib/Utils/link-preview.js +112 -0
  184. package/lib/Utils/logger.d.ts +11 -0
  185. package/lib/Utils/logger.js +7 -0
  186. package/lib/Utils/lt-hash.d.ts +12 -0
  187. package/lib/Utils/lt-hash.js +53 -0
  188. package/lib/Utils/make-mutex.d.ts +7 -0
  189. package/lib/Utils/make-mutex.js +45 -0
  190. package/lib/Utils/messages-media.d.ts +104 -0
  191. package/lib/Utils/messages-media.js +751 -0
  192. package/lib/Utils/messages.d.ts +80 -0
  193. package/lib/Utils/messages.js +1371 -0
  194. package/lib/Utils/noise-handler.d.ts +19 -0
  195. package/lib/Utils/noise-handler.js +150 -0
  196. package/lib/Utils/process-message.d.ts +41 -0
  197. package/lib/Utils/process-message.js +378 -0
  198. package/lib/Utils/signal.d.ts +33 -0
  199. package/lib/Utils/signal.js +154 -0
  200. package/lib/Utils/use-mongo-file-auth-state.d.ts +5 -0
  201. package/lib/Utils/use-mongo-file-auth-state.js +75 -0
  202. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
  203. package/lib/Utils/use-multi-file-auth-state.js +123 -0
  204. package/lib/Utils/use-single-file-auth-state.d.ts +12 -0
  205. package/lib/Utils/use-single-file-auth-state.js +75 -0
  206. package/lib/Utils/validate-connection.d.ts +10 -0
  207. package/lib/Utils/validate-connection.js +174 -0
  208. package/lib/WABinary/constants.d.ts +27 -0
  209. package/lib/WABinary/constants.js +45 -0
  210. package/lib/WABinary/decode.d.ts +6 -0
  211. package/lib/WABinary/decode.js +255 -0
  212. package/lib/WABinary/encode.d.ts +2 -0
  213. package/lib/WABinary/encode.js +243 -0
  214. package/lib/WABinary/generic-utils.d.ts +16 -0
  215. package/lib/WABinary/generic-utils.js +125 -0
  216. package/lib/WABinary/index.d.ts +5 -0
  217. package/lib/WABinary/index.js +21 -0
  218. package/lib/WABinary/jid-utils.d.ts +34 -0
  219. package/lib/WABinary/jid-utils.js +73 -0
  220. package/lib/WABinary/types.d.ts +18 -0
  221. package/lib/WABinary/types.js +2 -0
  222. package/lib/WAM/BinaryInfo.d.ts +16 -0
  223. package/lib/WAM/BinaryInfo.js +14 -0
  224. package/lib/WAM/constants.d.ts +39 -0
  225. package/lib/WAM/constants.js +15362 -0
  226. package/lib/WAM/encode.d.ts +2 -0
  227. package/lib/WAM/encode.js +156 -0
  228. package/lib/WAM/index.d.ts +3 -0
  229. package/lib/WAM/index.js +19 -0
  230. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +25 -0
  231. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +60 -0
  232. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  233. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  234. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  235. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +58 -0
  236. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  237. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +31 -0
  238. package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +8 -0
  239. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +26 -0
  240. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  241. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  242. package/lib/WAUSync/Protocols/index.d.ts +6 -0
  243. package/lib/WAUSync/Protocols/index.js +22 -0
  244. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  245. package/lib/WAUSync/USyncQuery.js +88 -0
  246. package/lib/WAUSync/USyncUser.d.ts +12 -0
  247. package/lib/WAUSync/USyncUser.js +27 -0
  248. package/lib/WAUSync/index.d.ts +3 -0
  249. package/lib/WAUSync/index.js +19 -0
  250. package/lib/index.d.ts +13 -0
  251. package/lib/index.js +9 -0
  252. package/package.json +66 -0
@@ -0,0 +1,3496 @@
1
+ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
+ "use strict";
3
+ var $protobuf = require("protobufjs/minimal");
4
+ // Common aliases
5
+ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
6
+ // Exported root namespace
7
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
8
+ $root.CompanionReg = (function() {
9
+ /**
10
+ * Namespace CompanionReg.
11
+ * @exports CompanionReg
12
+ * @namespace
13
+ */
14
+ var CompanionReg = {};
15
+ CompanionReg.ClientPairingProps = (function() {
16
+ /**
17
+ * Properties of a ClientPairingProps.
18
+ * @memberof CompanionReg
19
+ * @interface IClientPairingProps
20
+ * @property {boolean|null} [isChatDbLidMigrated] ClientPairingProps isChatDbLidMigrated
21
+ * @property {boolean|null} [isSyncdPureLidSession] ClientPairingProps isSyncdPureLidSession
22
+ */
23
+ /**
24
+ * Constructs a new ClientPairingProps.
25
+ * @memberof CompanionReg
26
+ * @classdesc Represents a ClientPairingProps.
27
+ * @implements IClientPairingProps
28
+ * @constructor
29
+ * @param {CompanionReg.IClientPairingProps=} [properties] Properties to set
30
+ */
31
+ function ClientPairingProps(properties) {
32
+ if (properties)
33
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
34
+ if (properties[keys[i]] != null)
35
+ this[keys[i]] = properties[keys[i]];
36
+ }
37
+ /**
38
+ * ClientPairingProps isChatDbLidMigrated.
39
+ * @member {boolean|null|undefined} isChatDbLidMigrated
40
+ * @memberof CompanionReg.ClientPairingProps
41
+ * @instance
42
+ */
43
+ ClientPairingProps.prototype.isChatDbLidMigrated = null;
44
+ /**
45
+ * ClientPairingProps isSyncdPureLidSession.
46
+ * @member {boolean|null|undefined} isSyncdPureLidSession
47
+ * @memberof CompanionReg.ClientPairingProps
48
+ * @instance
49
+ */
50
+ ClientPairingProps.prototype.isSyncdPureLidSession = null;
51
+ // OneOf field names bound to virtual getters and setters
52
+ var $oneOfFields;
53
+ /**
54
+ * ClientPairingProps _isChatDbLidMigrated.
55
+ * @member {"isChatDbLidMigrated"|undefined} _isChatDbLidMigrated
56
+ * @memberof CompanionReg.ClientPairingProps
57
+ * @instance
58
+ */
59
+ Object.defineProperty(ClientPairingProps.prototype, "_isChatDbLidMigrated", {
60
+ get: $util.oneOfGetter($oneOfFields = ["isChatDbLidMigrated"]),
61
+ set: $util.oneOfSetter($oneOfFields)
62
+ });
63
+ /**
64
+ * ClientPairingProps _isSyncdPureLidSession.
65
+ * @member {"isSyncdPureLidSession"|undefined} _isSyncdPureLidSession
66
+ * @memberof CompanionReg.ClientPairingProps
67
+ * @instance
68
+ */
69
+ Object.defineProperty(ClientPairingProps.prototype, "_isSyncdPureLidSession", {
70
+ get: $util.oneOfGetter($oneOfFields = ["isSyncdPureLidSession"]),
71
+ set: $util.oneOfSetter($oneOfFields)
72
+ });
73
+ /**
74
+ * Creates a new ClientPairingProps instance using the specified properties.
75
+ * @function create
76
+ * @memberof CompanionReg.ClientPairingProps
77
+ * @static
78
+ * @param {CompanionReg.IClientPairingProps=} [properties] Properties to set
79
+ * @returns {CompanionReg.ClientPairingProps} ClientPairingProps instance
80
+ */
81
+ ClientPairingProps.create = function create(properties) {
82
+ return new ClientPairingProps(properties);
83
+ };
84
+ /**
85
+ * Encodes the specified ClientPairingProps message. Does not implicitly {@link CompanionReg.ClientPairingProps.verify|verify} messages.
86
+ * @function encode
87
+ * @memberof CompanionReg.ClientPairingProps
88
+ * @static
89
+ * @param {CompanionReg.IClientPairingProps} message ClientPairingProps message or plain object to encode
90
+ * @param {$protobuf.Writer} [writer] Writer to encode to
91
+ * @returns {$protobuf.Writer} Writer
92
+ */
93
+ ClientPairingProps.encode = function encode(message, writer) {
94
+ if (!writer)
95
+ writer = $Writer.create();
96
+ if (message.isChatDbLidMigrated != null && Object.hasOwnProperty.call(message, "isChatDbLidMigrated"))
97
+ writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isChatDbLidMigrated);
98
+ if (message.isSyncdPureLidSession != null && Object.hasOwnProperty.call(message, "isSyncdPureLidSession"))
99
+ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isSyncdPureLidSession);
100
+ return writer;
101
+ };
102
+ /**
103
+ * Encodes the specified ClientPairingProps message, length delimited. Does not implicitly {@link CompanionReg.ClientPairingProps.verify|verify} messages.
104
+ * @function encodeDelimited
105
+ * @memberof CompanionReg.ClientPairingProps
106
+ * @static
107
+ * @param {CompanionReg.IClientPairingProps} message ClientPairingProps message or plain object to encode
108
+ * @param {$protobuf.Writer} [writer] Writer to encode to
109
+ * @returns {$protobuf.Writer} Writer
110
+ */
111
+ ClientPairingProps.encodeDelimited = function encodeDelimited(message, writer) {
112
+ return this.encode(message, writer).ldelim();
113
+ };
114
+ /**
115
+ * Decodes a ClientPairingProps message from the specified reader or buffer.
116
+ * @function decode
117
+ * @memberof CompanionReg.ClientPairingProps
118
+ * @static
119
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
120
+ * @param {number} [length] Message length if known beforehand
121
+ * @returns {CompanionReg.ClientPairingProps} ClientPairingProps
122
+ * @throws {Error} If the payload is not a reader or valid buffer
123
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
124
+ */
125
+ ClientPairingProps.decode = function decode(reader, length, error) {
126
+ if (!(reader instanceof $Reader))
127
+ reader = $Reader.create(reader);
128
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.ClientPairingProps();
129
+ while (reader.pos < end) {
130
+ var tag = reader.uint32();
131
+ if (tag === error)
132
+ break;
133
+ switch (tag >>> 3) {
134
+ case 1: {
135
+ message.isChatDbLidMigrated = reader.bool();
136
+ break;
137
+ }
138
+ case 2: {
139
+ message.isSyncdPureLidSession = reader.bool();
140
+ break;
141
+ }
142
+ default:
143
+ reader.skipType(tag & 7);
144
+ break;
145
+ }
146
+ }
147
+ return message;
148
+ };
149
+ /**
150
+ * Decodes a ClientPairingProps message from the specified reader or buffer, length delimited.
151
+ * @function decodeDelimited
152
+ * @memberof CompanionReg.ClientPairingProps
153
+ * @static
154
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
155
+ * @returns {CompanionReg.ClientPairingProps} ClientPairingProps
156
+ * @throws {Error} If the payload is not a reader or valid buffer
157
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
158
+ */
159
+ ClientPairingProps.decodeDelimited = function decodeDelimited(reader) {
160
+ if (!(reader instanceof $Reader))
161
+ reader = new $Reader(reader);
162
+ return this.decode(reader, reader.uint32());
163
+ };
164
+ /**
165
+ * Verifies a ClientPairingProps message.
166
+ * @function verify
167
+ * @memberof CompanionReg.ClientPairingProps
168
+ * @static
169
+ * @param {Object.<string,*>} message Plain object to verify
170
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
171
+ */
172
+ ClientPairingProps.verify = function verify(message) {
173
+ if (typeof message !== "object" || message === null)
174
+ return "object expected";
175
+ var properties = {};
176
+ if (message.isChatDbLidMigrated != null && message.hasOwnProperty("isChatDbLidMigrated")) {
177
+ properties._isChatDbLidMigrated = 1;
178
+ if (typeof message.isChatDbLidMigrated !== "boolean")
179
+ return "isChatDbLidMigrated: boolean expected";
180
+ }
181
+ if (message.isSyncdPureLidSession != null && message.hasOwnProperty("isSyncdPureLidSession")) {
182
+ properties._isSyncdPureLidSession = 1;
183
+ if (typeof message.isSyncdPureLidSession !== "boolean")
184
+ return "isSyncdPureLidSession: boolean expected";
185
+ }
186
+ return null;
187
+ };
188
+ /**
189
+ * Creates a ClientPairingProps message from a plain object. Also converts values to their respective internal types.
190
+ * @function fromObject
191
+ * @memberof CompanionReg.ClientPairingProps
192
+ * @static
193
+ * @param {Object.<string,*>} object Plain object
194
+ * @returns {CompanionReg.ClientPairingProps} ClientPairingProps
195
+ */
196
+ ClientPairingProps.fromObject = function fromObject(object) {
197
+ if (object instanceof $root.CompanionReg.ClientPairingProps)
198
+ return object;
199
+ var message = new $root.CompanionReg.ClientPairingProps();
200
+ if (object.isChatDbLidMigrated != null)
201
+ message.isChatDbLidMigrated = Boolean(object.isChatDbLidMigrated);
202
+ if (object.isSyncdPureLidSession != null)
203
+ message.isSyncdPureLidSession = Boolean(object.isSyncdPureLidSession);
204
+ return message;
205
+ };
206
+ /**
207
+ * Creates a plain object from a ClientPairingProps message. Also converts values to other types if specified.
208
+ * @function toObject
209
+ * @memberof CompanionReg.ClientPairingProps
210
+ * @static
211
+ * @param {CompanionReg.ClientPairingProps} message ClientPairingProps
212
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
213
+ * @returns {Object.<string,*>} Plain object
214
+ */
215
+ ClientPairingProps.toObject = function toObject(message, options) {
216
+ if (!options)
217
+ options = {};
218
+ var object = {};
219
+ if (message.isChatDbLidMigrated != null && message.hasOwnProperty("isChatDbLidMigrated")) {
220
+ object.isChatDbLidMigrated = message.isChatDbLidMigrated;
221
+ if (options.oneofs)
222
+ object._isChatDbLidMigrated = "isChatDbLidMigrated";
223
+ }
224
+ if (message.isSyncdPureLidSession != null && message.hasOwnProperty("isSyncdPureLidSession")) {
225
+ object.isSyncdPureLidSession = message.isSyncdPureLidSession;
226
+ if (options.oneofs)
227
+ object._isSyncdPureLidSession = "isSyncdPureLidSession";
228
+ }
229
+ return object;
230
+ };
231
+ /**
232
+ * Converts this ClientPairingProps to JSON.
233
+ * @function toJSON
234
+ * @memberof CompanionReg.ClientPairingProps
235
+ * @instance
236
+ * @returns {Object.<string,*>} JSON object
237
+ */
238
+ ClientPairingProps.prototype.toJSON = function toJSON() {
239
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
240
+ };
241
+ /**
242
+ * Gets the default type url for ClientPairingProps
243
+ * @function getTypeUrl
244
+ * @memberof CompanionReg.ClientPairingProps
245
+ * @static
246
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
247
+ * @returns {string} The default type url
248
+ */
249
+ ClientPairingProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
250
+ if (typeUrlPrefix === undefined) {
251
+ typeUrlPrefix = "type.googleapis.com";
252
+ }
253
+ return typeUrlPrefix + "/CompanionReg.ClientPairingProps";
254
+ };
255
+ return ClientPairingProps;
256
+ })();
257
+ CompanionReg.EncryptedPairingRequest = (function() {
258
+ /**
259
+ * Properties of an EncryptedPairingRequest.
260
+ * @memberof CompanionReg
261
+ * @interface IEncryptedPairingRequest
262
+ * @property {Uint8Array|null} [encryptedPayload] EncryptedPairingRequest encryptedPayload
263
+ * @property {Uint8Array|null} [iv] EncryptedPairingRequest iv
264
+ */
265
+ /**
266
+ * Constructs a new EncryptedPairingRequest.
267
+ * @memberof CompanionReg
268
+ * @classdesc Represents an EncryptedPairingRequest.
269
+ * @implements IEncryptedPairingRequest
270
+ * @constructor
271
+ * @param {CompanionReg.IEncryptedPairingRequest=} [properties] Properties to set
272
+ */
273
+ function EncryptedPairingRequest(properties) {
274
+ if (properties)
275
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
276
+ if (properties[keys[i]] != null)
277
+ this[keys[i]] = properties[keys[i]];
278
+ }
279
+ /**
280
+ * EncryptedPairingRequest encryptedPayload.
281
+ * @member {Uint8Array|null|undefined} encryptedPayload
282
+ * @memberof CompanionReg.EncryptedPairingRequest
283
+ * @instance
284
+ */
285
+ EncryptedPairingRequest.prototype.encryptedPayload = null;
286
+ /**
287
+ * EncryptedPairingRequest iv.
288
+ * @member {Uint8Array|null|undefined} iv
289
+ * @memberof CompanionReg.EncryptedPairingRequest
290
+ * @instance
291
+ */
292
+ EncryptedPairingRequest.prototype.iv = null;
293
+ // OneOf field names bound to virtual getters and setters
294
+ var $oneOfFields;
295
+ /**
296
+ * EncryptedPairingRequest _encryptedPayload.
297
+ * @member {"encryptedPayload"|undefined} _encryptedPayload
298
+ * @memberof CompanionReg.EncryptedPairingRequest
299
+ * @instance
300
+ */
301
+ Object.defineProperty(EncryptedPairingRequest.prototype, "_encryptedPayload", {
302
+ get: $util.oneOfGetter($oneOfFields = ["encryptedPayload"]),
303
+ set: $util.oneOfSetter($oneOfFields)
304
+ });
305
+ /**
306
+ * EncryptedPairingRequest _iv.
307
+ * @member {"iv"|undefined} _iv
308
+ * @memberof CompanionReg.EncryptedPairingRequest
309
+ * @instance
310
+ */
311
+ Object.defineProperty(EncryptedPairingRequest.prototype, "_iv", {
312
+ get: $util.oneOfGetter($oneOfFields = ["iv"]),
313
+ set: $util.oneOfSetter($oneOfFields)
314
+ });
315
+ /**
316
+ * Creates a new EncryptedPairingRequest instance using the specified properties.
317
+ * @function create
318
+ * @memberof CompanionReg.EncryptedPairingRequest
319
+ * @static
320
+ * @param {CompanionReg.IEncryptedPairingRequest=} [properties] Properties to set
321
+ * @returns {CompanionReg.EncryptedPairingRequest} EncryptedPairingRequest instance
322
+ */
323
+ EncryptedPairingRequest.create = function create(properties) {
324
+ return new EncryptedPairingRequest(properties);
325
+ };
326
+ /**
327
+ * Encodes the specified EncryptedPairingRequest message. Does not implicitly {@link CompanionReg.EncryptedPairingRequest.verify|verify} messages.
328
+ * @function encode
329
+ * @memberof CompanionReg.EncryptedPairingRequest
330
+ * @static
331
+ * @param {CompanionReg.IEncryptedPairingRequest} message EncryptedPairingRequest message or plain object to encode
332
+ * @param {$protobuf.Writer} [writer] Writer to encode to
333
+ * @returns {$protobuf.Writer} Writer
334
+ */
335
+ EncryptedPairingRequest.encode = function encode(message, writer) {
336
+ if (!writer)
337
+ writer = $Writer.create();
338
+ if (message.encryptedPayload != null && Object.hasOwnProperty.call(message, "encryptedPayload"))
339
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encryptedPayload);
340
+ if (message.iv != null && Object.hasOwnProperty.call(message, "iv"))
341
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.iv);
342
+ return writer;
343
+ };
344
+ /**
345
+ * Encodes the specified EncryptedPairingRequest message, length delimited. Does not implicitly {@link CompanionReg.EncryptedPairingRequest.verify|verify} messages.
346
+ * @function encodeDelimited
347
+ * @memberof CompanionReg.EncryptedPairingRequest
348
+ * @static
349
+ * @param {CompanionReg.IEncryptedPairingRequest} message EncryptedPairingRequest message or plain object to encode
350
+ * @param {$protobuf.Writer} [writer] Writer to encode to
351
+ * @returns {$protobuf.Writer} Writer
352
+ */
353
+ EncryptedPairingRequest.encodeDelimited = function encodeDelimited(message, writer) {
354
+ return this.encode(message, writer).ldelim();
355
+ };
356
+ /**
357
+ * Decodes an EncryptedPairingRequest message from the specified reader or buffer.
358
+ * @function decode
359
+ * @memberof CompanionReg.EncryptedPairingRequest
360
+ * @static
361
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
362
+ * @param {number} [length] Message length if known beforehand
363
+ * @returns {CompanionReg.EncryptedPairingRequest} EncryptedPairingRequest
364
+ * @throws {Error} If the payload is not a reader or valid buffer
365
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
366
+ */
367
+ EncryptedPairingRequest.decode = function decode(reader, length, error) {
368
+ if (!(reader instanceof $Reader))
369
+ reader = $Reader.create(reader);
370
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.EncryptedPairingRequest();
371
+ while (reader.pos < end) {
372
+ var tag = reader.uint32();
373
+ if (tag === error)
374
+ break;
375
+ switch (tag >>> 3) {
376
+ case 1: {
377
+ message.encryptedPayload = reader.bytes();
378
+ break;
379
+ }
380
+ case 2: {
381
+ message.iv = reader.bytes();
382
+ break;
383
+ }
384
+ default:
385
+ reader.skipType(tag & 7);
386
+ break;
387
+ }
388
+ }
389
+ return message;
390
+ };
391
+ /**
392
+ * Decodes an EncryptedPairingRequest message from the specified reader or buffer, length delimited.
393
+ * @function decodeDelimited
394
+ * @memberof CompanionReg.EncryptedPairingRequest
395
+ * @static
396
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
397
+ * @returns {CompanionReg.EncryptedPairingRequest} EncryptedPairingRequest
398
+ * @throws {Error} If the payload is not a reader or valid buffer
399
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
400
+ */
401
+ EncryptedPairingRequest.decodeDelimited = function decodeDelimited(reader) {
402
+ if (!(reader instanceof $Reader))
403
+ reader = new $Reader(reader);
404
+ return this.decode(reader, reader.uint32());
405
+ };
406
+ /**
407
+ * Verifies an EncryptedPairingRequest message.
408
+ * @function verify
409
+ * @memberof CompanionReg.EncryptedPairingRequest
410
+ * @static
411
+ * @param {Object.<string,*>} message Plain object to verify
412
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
413
+ */
414
+ EncryptedPairingRequest.verify = function verify(message) {
415
+ if (typeof message !== "object" || message === null)
416
+ return "object expected";
417
+ var properties = {};
418
+ if (message.encryptedPayload != null && message.hasOwnProperty("encryptedPayload")) {
419
+ properties._encryptedPayload = 1;
420
+ if (!(message.encryptedPayload && typeof message.encryptedPayload.length === "number" || $util.isString(message.encryptedPayload)))
421
+ return "encryptedPayload: buffer expected";
422
+ }
423
+ if (message.iv != null && message.hasOwnProperty("iv")) {
424
+ properties._iv = 1;
425
+ if (!(message.iv && typeof message.iv.length === "number" || $util.isString(message.iv)))
426
+ return "iv: buffer expected";
427
+ }
428
+ return null;
429
+ };
430
+ /**
431
+ * Creates an EncryptedPairingRequest message from a plain object. Also converts values to their respective internal types.
432
+ * @function fromObject
433
+ * @memberof CompanionReg.EncryptedPairingRequest
434
+ * @static
435
+ * @param {Object.<string,*>} object Plain object
436
+ * @returns {CompanionReg.EncryptedPairingRequest} EncryptedPairingRequest
437
+ */
438
+ EncryptedPairingRequest.fromObject = function fromObject(object) {
439
+ if (object instanceof $root.CompanionReg.EncryptedPairingRequest)
440
+ return object;
441
+ var message = new $root.CompanionReg.EncryptedPairingRequest();
442
+ if (object.encryptedPayload != null)
443
+ if (typeof object.encryptedPayload === "string")
444
+ $util.base64.decode(object.encryptedPayload, message.encryptedPayload = $util.newBuffer($util.base64.length(object.encryptedPayload)), 0);
445
+ else if (object.encryptedPayload.length >= 0)
446
+ message.encryptedPayload = object.encryptedPayload;
447
+ if (object.iv != null)
448
+ if (typeof object.iv === "string")
449
+ $util.base64.decode(object.iv, message.iv = $util.newBuffer($util.base64.length(object.iv)), 0);
450
+ else if (object.iv.length >= 0)
451
+ message.iv = object.iv;
452
+ return message;
453
+ };
454
+ /**
455
+ * Creates a plain object from an EncryptedPairingRequest message. Also converts values to other types if specified.
456
+ * @function toObject
457
+ * @memberof CompanionReg.EncryptedPairingRequest
458
+ * @static
459
+ * @param {CompanionReg.EncryptedPairingRequest} message EncryptedPairingRequest
460
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
461
+ * @returns {Object.<string,*>} Plain object
462
+ */
463
+ EncryptedPairingRequest.toObject = function toObject(message, options) {
464
+ if (!options)
465
+ options = {};
466
+ var object = {};
467
+ if (message.encryptedPayload != null && message.hasOwnProperty("encryptedPayload")) {
468
+ object.encryptedPayload = options.bytes === String ? $util.base64.encode(message.encryptedPayload, 0, message.encryptedPayload.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedPayload) : message.encryptedPayload;
469
+ if (options.oneofs)
470
+ object._encryptedPayload = "encryptedPayload";
471
+ }
472
+ if (message.iv != null && message.hasOwnProperty("iv")) {
473
+ object.iv = options.bytes === String ? $util.base64.encode(message.iv, 0, message.iv.length) : options.bytes === Array ? Array.prototype.slice.call(message.iv) : message.iv;
474
+ if (options.oneofs)
475
+ object._iv = "iv";
476
+ }
477
+ return object;
478
+ };
479
+ /**
480
+ * Converts this EncryptedPairingRequest to JSON.
481
+ * @function toJSON
482
+ * @memberof CompanionReg.EncryptedPairingRequest
483
+ * @instance
484
+ * @returns {Object.<string,*>} JSON object
485
+ */
486
+ EncryptedPairingRequest.prototype.toJSON = function toJSON() {
487
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
488
+ };
489
+ /**
490
+ * Gets the default type url for EncryptedPairingRequest
491
+ * @function getTypeUrl
492
+ * @memberof CompanionReg.EncryptedPairingRequest
493
+ * @static
494
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
495
+ * @returns {string} The default type url
496
+ */
497
+ EncryptedPairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
498
+ if (typeUrlPrefix === undefined) {
499
+ typeUrlPrefix = "type.googleapis.com";
500
+ }
501
+ return typeUrlPrefix + "/CompanionReg.EncryptedPairingRequest";
502
+ };
503
+ return EncryptedPairingRequest;
504
+ })();
505
+ CompanionReg.PairingRequest = (function() {
506
+ /**
507
+ * Properties of a PairingRequest.
508
+ * @memberof CompanionReg
509
+ * @interface IPairingRequest
510
+ * @property {Uint8Array|null} [companionPublicKey] PairingRequest companionPublicKey
511
+ * @property {Uint8Array|null} [companionIdentityKey] PairingRequest companionIdentityKey
512
+ * @property {Uint8Array|null} [advSecret] PairingRequest advSecret
513
+ */
514
+ /**
515
+ * Constructs a new PairingRequest.
516
+ * @memberof CompanionReg
517
+ * @classdesc Represents a PairingRequest.
518
+ * @implements IPairingRequest
519
+ * @constructor
520
+ * @param {CompanionReg.IPairingRequest=} [properties] Properties to set
521
+ */
522
+ function PairingRequest(properties) {
523
+ if (properties)
524
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
525
+ if (properties[keys[i]] != null)
526
+ this[keys[i]] = properties[keys[i]];
527
+ }
528
+ /**
529
+ * PairingRequest companionPublicKey.
530
+ * @member {Uint8Array|null|undefined} companionPublicKey
531
+ * @memberof CompanionReg.PairingRequest
532
+ * @instance
533
+ */
534
+ PairingRequest.prototype.companionPublicKey = null;
535
+ /**
536
+ * PairingRequest companionIdentityKey.
537
+ * @member {Uint8Array|null|undefined} companionIdentityKey
538
+ * @memberof CompanionReg.PairingRequest
539
+ * @instance
540
+ */
541
+ PairingRequest.prototype.companionIdentityKey = null;
542
+ /**
543
+ * PairingRequest advSecret.
544
+ * @member {Uint8Array|null|undefined} advSecret
545
+ * @memberof CompanionReg.PairingRequest
546
+ * @instance
547
+ */
548
+ PairingRequest.prototype.advSecret = null;
549
+ // OneOf field names bound to virtual getters and setters
550
+ var $oneOfFields;
551
+ /**
552
+ * PairingRequest _companionPublicKey.
553
+ * @member {"companionPublicKey"|undefined} _companionPublicKey
554
+ * @memberof CompanionReg.PairingRequest
555
+ * @instance
556
+ */
557
+ Object.defineProperty(PairingRequest.prototype, "_companionPublicKey", {
558
+ get: $util.oneOfGetter($oneOfFields = ["companionPublicKey"]),
559
+ set: $util.oneOfSetter($oneOfFields)
560
+ });
561
+ /**
562
+ * PairingRequest _companionIdentityKey.
563
+ * @member {"companionIdentityKey"|undefined} _companionIdentityKey
564
+ * @memberof CompanionReg.PairingRequest
565
+ * @instance
566
+ */
567
+ Object.defineProperty(PairingRequest.prototype, "_companionIdentityKey", {
568
+ get: $util.oneOfGetter($oneOfFields = ["companionIdentityKey"]),
569
+ set: $util.oneOfSetter($oneOfFields)
570
+ });
571
+ /**
572
+ * PairingRequest _advSecret.
573
+ * @member {"advSecret"|undefined} _advSecret
574
+ * @memberof CompanionReg.PairingRequest
575
+ * @instance
576
+ */
577
+ Object.defineProperty(PairingRequest.prototype, "_advSecret", {
578
+ get: $util.oneOfGetter($oneOfFields = ["advSecret"]),
579
+ set: $util.oneOfSetter($oneOfFields)
580
+ });
581
+ /**
582
+ * Creates a new PairingRequest instance using the specified properties.
583
+ * @function create
584
+ * @memberof CompanionReg.PairingRequest
585
+ * @static
586
+ * @param {CompanionReg.IPairingRequest=} [properties] Properties to set
587
+ * @returns {CompanionReg.PairingRequest} PairingRequest instance
588
+ */
589
+ PairingRequest.create = function create(properties) {
590
+ return new PairingRequest(properties);
591
+ };
592
+ /**
593
+ * Encodes the specified PairingRequest message. Does not implicitly {@link CompanionReg.PairingRequest.verify|verify} messages.
594
+ * @function encode
595
+ * @memberof CompanionReg.PairingRequest
596
+ * @static
597
+ * @param {CompanionReg.IPairingRequest} message PairingRequest message or plain object to encode
598
+ * @param {$protobuf.Writer} [writer] Writer to encode to
599
+ * @returns {$protobuf.Writer} Writer
600
+ */
601
+ PairingRequest.encode = function encode(message, writer) {
602
+ if (!writer)
603
+ writer = $Writer.create();
604
+ if (message.companionPublicKey != null && Object.hasOwnProperty.call(message, "companionPublicKey"))
605
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.companionPublicKey);
606
+ if (message.companionIdentityKey != null && Object.hasOwnProperty.call(message, "companionIdentityKey"))
607
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.companionIdentityKey);
608
+ if (message.advSecret != null && Object.hasOwnProperty.call(message, "advSecret"))
609
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.advSecret);
610
+ return writer;
611
+ };
612
+ /**
613
+ * Encodes the specified PairingRequest message, length delimited. Does not implicitly {@link CompanionReg.PairingRequest.verify|verify} messages.
614
+ * @function encodeDelimited
615
+ * @memberof CompanionReg.PairingRequest
616
+ * @static
617
+ * @param {CompanionReg.IPairingRequest} message PairingRequest message or plain object to encode
618
+ * @param {$protobuf.Writer} [writer] Writer to encode to
619
+ * @returns {$protobuf.Writer} Writer
620
+ */
621
+ PairingRequest.encodeDelimited = function encodeDelimited(message, writer) {
622
+ return this.encode(message, writer).ldelim();
623
+ };
624
+ /**
625
+ * Decodes a PairingRequest message from the specified reader or buffer.
626
+ * @function decode
627
+ * @memberof CompanionReg.PairingRequest
628
+ * @static
629
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
630
+ * @param {number} [length] Message length if known beforehand
631
+ * @returns {CompanionReg.PairingRequest} PairingRequest
632
+ * @throws {Error} If the payload is not a reader or valid buffer
633
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
634
+ */
635
+ PairingRequest.decode = function decode(reader, length, error) {
636
+ if (!(reader instanceof $Reader))
637
+ reader = $Reader.create(reader);
638
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.PairingRequest();
639
+ while (reader.pos < end) {
640
+ var tag = reader.uint32();
641
+ if (tag === error)
642
+ break;
643
+ switch (tag >>> 3) {
644
+ case 1: {
645
+ message.companionPublicKey = reader.bytes();
646
+ break;
647
+ }
648
+ case 2: {
649
+ message.companionIdentityKey = reader.bytes();
650
+ break;
651
+ }
652
+ case 3: {
653
+ message.advSecret = reader.bytes();
654
+ break;
655
+ }
656
+ default:
657
+ reader.skipType(tag & 7);
658
+ break;
659
+ }
660
+ }
661
+ return message;
662
+ };
663
+ /**
664
+ * Decodes a PairingRequest message from the specified reader or buffer, length delimited.
665
+ * @function decodeDelimited
666
+ * @memberof CompanionReg.PairingRequest
667
+ * @static
668
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
669
+ * @returns {CompanionReg.PairingRequest} PairingRequest
670
+ * @throws {Error} If the payload is not a reader or valid buffer
671
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
672
+ */
673
+ PairingRequest.decodeDelimited = function decodeDelimited(reader) {
674
+ if (!(reader instanceof $Reader))
675
+ reader = new $Reader(reader);
676
+ return this.decode(reader, reader.uint32());
677
+ };
678
+ /**
679
+ * Verifies a PairingRequest message.
680
+ * @function verify
681
+ * @memberof CompanionReg.PairingRequest
682
+ * @static
683
+ * @param {Object.<string,*>} message Plain object to verify
684
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
685
+ */
686
+ PairingRequest.verify = function verify(message) {
687
+ if (typeof message !== "object" || message === null)
688
+ return "object expected";
689
+ var properties = {};
690
+ if (message.companionPublicKey != null && message.hasOwnProperty("companionPublicKey")) {
691
+ properties._companionPublicKey = 1;
692
+ if (!(message.companionPublicKey && typeof message.companionPublicKey.length === "number" || $util.isString(message.companionPublicKey)))
693
+ return "companionPublicKey: buffer expected";
694
+ }
695
+ if (message.companionIdentityKey != null && message.hasOwnProperty("companionIdentityKey")) {
696
+ properties._companionIdentityKey = 1;
697
+ if (!(message.companionIdentityKey && typeof message.companionIdentityKey.length === "number" || $util.isString(message.companionIdentityKey)))
698
+ return "companionIdentityKey: buffer expected";
699
+ }
700
+ if (message.advSecret != null && message.hasOwnProperty("advSecret")) {
701
+ properties._advSecret = 1;
702
+ if (!(message.advSecret && typeof message.advSecret.length === "number" || $util.isString(message.advSecret)))
703
+ return "advSecret: buffer expected";
704
+ }
705
+ return null;
706
+ };
707
+ /**
708
+ * Creates a PairingRequest message from a plain object. Also converts values to their respective internal types.
709
+ * @function fromObject
710
+ * @memberof CompanionReg.PairingRequest
711
+ * @static
712
+ * @param {Object.<string,*>} object Plain object
713
+ * @returns {CompanionReg.PairingRequest} PairingRequest
714
+ */
715
+ PairingRequest.fromObject = function fromObject(object) {
716
+ if (object instanceof $root.CompanionReg.PairingRequest)
717
+ return object;
718
+ var message = new $root.CompanionReg.PairingRequest();
719
+ if (object.companionPublicKey != null)
720
+ if (typeof object.companionPublicKey === "string")
721
+ $util.base64.decode(object.companionPublicKey, message.companionPublicKey = $util.newBuffer($util.base64.length(object.companionPublicKey)), 0);
722
+ else if (object.companionPublicKey.length >= 0)
723
+ message.companionPublicKey = object.companionPublicKey;
724
+ if (object.companionIdentityKey != null)
725
+ if (typeof object.companionIdentityKey === "string")
726
+ $util.base64.decode(object.companionIdentityKey, message.companionIdentityKey = $util.newBuffer($util.base64.length(object.companionIdentityKey)), 0);
727
+ else if (object.companionIdentityKey.length >= 0)
728
+ message.companionIdentityKey = object.companionIdentityKey;
729
+ if (object.advSecret != null)
730
+ if (typeof object.advSecret === "string")
731
+ $util.base64.decode(object.advSecret, message.advSecret = $util.newBuffer($util.base64.length(object.advSecret)), 0);
732
+ else if (object.advSecret.length >= 0)
733
+ message.advSecret = object.advSecret;
734
+ return message;
735
+ };
736
+ /**
737
+ * Creates a plain object from a PairingRequest message. Also converts values to other types if specified.
738
+ * @function toObject
739
+ * @memberof CompanionReg.PairingRequest
740
+ * @static
741
+ * @param {CompanionReg.PairingRequest} message PairingRequest
742
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
743
+ * @returns {Object.<string,*>} Plain object
744
+ */
745
+ PairingRequest.toObject = function toObject(message, options) {
746
+ if (!options)
747
+ options = {};
748
+ var object = {};
749
+ if (message.companionPublicKey != null && message.hasOwnProperty("companionPublicKey")) {
750
+ object.companionPublicKey = options.bytes === String ? $util.base64.encode(message.companionPublicKey, 0, message.companionPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.companionPublicKey) : message.companionPublicKey;
751
+ if (options.oneofs)
752
+ object._companionPublicKey = "companionPublicKey";
753
+ }
754
+ if (message.companionIdentityKey != null && message.hasOwnProperty("companionIdentityKey")) {
755
+ object.companionIdentityKey = options.bytes === String ? $util.base64.encode(message.companionIdentityKey, 0, message.companionIdentityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.companionIdentityKey) : message.companionIdentityKey;
756
+ if (options.oneofs)
757
+ object._companionIdentityKey = "companionIdentityKey";
758
+ }
759
+ if (message.advSecret != null && message.hasOwnProperty("advSecret")) {
760
+ object.advSecret = options.bytes === String ? $util.base64.encode(message.advSecret, 0, message.advSecret.length) : options.bytes === Array ? Array.prototype.slice.call(message.advSecret) : message.advSecret;
761
+ if (options.oneofs)
762
+ object._advSecret = "advSecret";
763
+ }
764
+ return object;
765
+ };
766
+ /**
767
+ * Converts this PairingRequest to JSON.
768
+ * @function toJSON
769
+ * @memberof CompanionReg.PairingRequest
770
+ * @instance
771
+ * @returns {Object.<string,*>} JSON object
772
+ */
773
+ PairingRequest.prototype.toJSON = function toJSON() {
774
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
775
+ };
776
+ /**
777
+ * Gets the default type url for PairingRequest
778
+ * @function getTypeUrl
779
+ * @memberof CompanionReg.PairingRequest
780
+ * @static
781
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
782
+ * @returns {string} The default type url
783
+ */
784
+ PairingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
785
+ if (typeUrlPrefix === undefined) {
786
+ typeUrlPrefix = "type.googleapis.com";
787
+ }
788
+ return typeUrlPrefix + "/CompanionReg.PairingRequest";
789
+ };
790
+ return PairingRequest;
791
+ })();
792
+ CompanionReg.PrimaryEphemeralIdentity = (function() {
793
+ /**
794
+ * Properties of a PrimaryEphemeralIdentity.
795
+ * @memberof CompanionReg
796
+ * @interface IPrimaryEphemeralIdentity
797
+ * @property {Uint8Array|null} [publicKey] PrimaryEphemeralIdentity publicKey
798
+ * @property {Uint8Array|null} [nonce] PrimaryEphemeralIdentity nonce
799
+ */
800
+ /**
801
+ * Constructs a new PrimaryEphemeralIdentity.
802
+ * @memberof CompanionReg
803
+ * @classdesc Represents a PrimaryEphemeralIdentity.
804
+ * @implements IPrimaryEphemeralIdentity
805
+ * @constructor
806
+ * @param {CompanionReg.IPrimaryEphemeralIdentity=} [properties] Properties to set
807
+ */
808
+ function PrimaryEphemeralIdentity(properties) {
809
+ if (properties)
810
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
811
+ if (properties[keys[i]] != null)
812
+ this[keys[i]] = properties[keys[i]];
813
+ }
814
+ /**
815
+ * PrimaryEphemeralIdentity publicKey.
816
+ * @member {Uint8Array|null|undefined} publicKey
817
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
818
+ * @instance
819
+ */
820
+ PrimaryEphemeralIdentity.prototype.publicKey = null;
821
+ /**
822
+ * PrimaryEphemeralIdentity nonce.
823
+ * @member {Uint8Array|null|undefined} nonce
824
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
825
+ * @instance
826
+ */
827
+ PrimaryEphemeralIdentity.prototype.nonce = null;
828
+ // OneOf field names bound to virtual getters and setters
829
+ var $oneOfFields;
830
+ /**
831
+ * PrimaryEphemeralIdentity _publicKey.
832
+ * @member {"publicKey"|undefined} _publicKey
833
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
834
+ * @instance
835
+ */
836
+ Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_publicKey", {
837
+ get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
838
+ set: $util.oneOfSetter($oneOfFields)
839
+ });
840
+ /**
841
+ * PrimaryEphemeralIdentity _nonce.
842
+ * @member {"nonce"|undefined} _nonce
843
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
844
+ * @instance
845
+ */
846
+ Object.defineProperty(PrimaryEphemeralIdentity.prototype, "_nonce", {
847
+ get: $util.oneOfGetter($oneOfFields = ["nonce"]),
848
+ set: $util.oneOfSetter($oneOfFields)
849
+ });
850
+ /**
851
+ * Creates a new PrimaryEphemeralIdentity instance using the specified properties.
852
+ * @function create
853
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
854
+ * @static
855
+ * @param {CompanionReg.IPrimaryEphemeralIdentity=} [properties] Properties to set
856
+ * @returns {CompanionReg.PrimaryEphemeralIdentity} PrimaryEphemeralIdentity instance
857
+ */
858
+ PrimaryEphemeralIdentity.create = function create(properties) {
859
+ return new PrimaryEphemeralIdentity(properties);
860
+ };
861
+ /**
862
+ * Encodes the specified PrimaryEphemeralIdentity message. Does not implicitly {@link CompanionReg.PrimaryEphemeralIdentity.verify|verify} messages.
863
+ * @function encode
864
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
865
+ * @static
866
+ * @param {CompanionReg.IPrimaryEphemeralIdentity} message PrimaryEphemeralIdentity message or plain object to encode
867
+ * @param {$protobuf.Writer} [writer] Writer to encode to
868
+ * @returns {$protobuf.Writer} Writer
869
+ */
870
+ PrimaryEphemeralIdentity.encode = function encode(message, writer) {
871
+ if (!writer)
872
+ writer = $Writer.create();
873
+ if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
874
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKey);
875
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
876
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.nonce);
877
+ return writer;
878
+ };
879
+ /**
880
+ * Encodes the specified PrimaryEphemeralIdentity message, length delimited. Does not implicitly {@link CompanionReg.PrimaryEphemeralIdentity.verify|verify} messages.
881
+ * @function encodeDelimited
882
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
883
+ * @static
884
+ * @param {CompanionReg.IPrimaryEphemeralIdentity} message PrimaryEphemeralIdentity message or plain object to encode
885
+ * @param {$protobuf.Writer} [writer] Writer to encode to
886
+ * @returns {$protobuf.Writer} Writer
887
+ */
888
+ PrimaryEphemeralIdentity.encodeDelimited = function encodeDelimited(message, writer) {
889
+ return this.encode(message, writer).ldelim();
890
+ };
891
+ /**
892
+ * Decodes a PrimaryEphemeralIdentity message from the specified reader or buffer.
893
+ * @function decode
894
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
895
+ * @static
896
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
897
+ * @param {number} [length] Message length if known beforehand
898
+ * @returns {CompanionReg.PrimaryEphemeralIdentity} PrimaryEphemeralIdentity
899
+ * @throws {Error} If the payload is not a reader or valid buffer
900
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
901
+ */
902
+ PrimaryEphemeralIdentity.decode = function decode(reader, length, error) {
903
+ if (!(reader instanceof $Reader))
904
+ reader = $Reader.create(reader);
905
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.PrimaryEphemeralIdentity();
906
+ while (reader.pos < end) {
907
+ var tag = reader.uint32();
908
+ if (tag === error)
909
+ break;
910
+ switch (tag >>> 3) {
911
+ case 1: {
912
+ message.publicKey = reader.bytes();
913
+ break;
914
+ }
915
+ case 2: {
916
+ message.nonce = reader.bytes();
917
+ break;
918
+ }
919
+ default:
920
+ reader.skipType(tag & 7);
921
+ break;
922
+ }
923
+ }
924
+ return message;
925
+ };
926
+ /**
927
+ * Decodes a PrimaryEphemeralIdentity message from the specified reader or buffer, length delimited.
928
+ * @function decodeDelimited
929
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
930
+ * @static
931
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
932
+ * @returns {CompanionReg.PrimaryEphemeralIdentity} PrimaryEphemeralIdentity
933
+ * @throws {Error} If the payload is not a reader or valid buffer
934
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
935
+ */
936
+ PrimaryEphemeralIdentity.decodeDelimited = function decodeDelimited(reader) {
937
+ if (!(reader instanceof $Reader))
938
+ reader = new $Reader(reader);
939
+ return this.decode(reader, reader.uint32());
940
+ };
941
+ /**
942
+ * Verifies a PrimaryEphemeralIdentity message.
943
+ * @function verify
944
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
945
+ * @static
946
+ * @param {Object.<string,*>} message Plain object to verify
947
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
948
+ */
949
+ PrimaryEphemeralIdentity.verify = function verify(message) {
950
+ if (typeof message !== "object" || message === null)
951
+ return "object expected";
952
+ var properties = {};
953
+ if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
954
+ properties._publicKey = 1;
955
+ if (!(message.publicKey && typeof message.publicKey.length === "number" || $util.isString(message.publicKey)))
956
+ return "publicKey: buffer expected";
957
+ }
958
+ if (message.nonce != null && message.hasOwnProperty("nonce")) {
959
+ properties._nonce = 1;
960
+ if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
961
+ return "nonce: buffer expected";
962
+ }
963
+ return null;
964
+ };
965
+ /**
966
+ * Creates a PrimaryEphemeralIdentity message from a plain object. Also converts values to their respective internal types.
967
+ * @function fromObject
968
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
969
+ * @static
970
+ * @param {Object.<string,*>} object Plain object
971
+ * @returns {CompanionReg.PrimaryEphemeralIdentity} PrimaryEphemeralIdentity
972
+ */
973
+ PrimaryEphemeralIdentity.fromObject = function fromObject(object) {
974
+ if (object instanceof $root.CompanionReg.PrimaryEphemeralIdentity)
975
+ return object;
976
+ var message = new $root.CompanionReg.PrimaryEphemeralIdentity();
977
+ if (object.publicKey != null)
978
+ if (typeof object.publicKey === "string")
979
+ $util.base64.decode(object.publicKey, message.publicKey = $util.newBuffer($util.base64.length(object.publicKey)), 0);
980
+ else if (object.publicKey.length >= 0)
981
+ message.publicKey = object.publicKey;
982
+ if (object.nonce != null)
983
+ if (typeof object.nonce === "string")
984
+ $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
985
+ else if (object.nonce.length >= 0)
986
+ message.nonce = object.nonce;
987
+ return message;
988
+ };
989
+ /**
990
+ * Creates a plain object from a PrimaryEphemeralIdentity message. Also converts values to other types if specified.
991
+ * @function toObject
992
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
993
+ * @static
994
+ * @param {CompanionReg.PrimaryEphemeralIdentity} message PrimaryEphemeralIdentity
995
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
996
+ * @returns {Object.<string,*>} Plain object
997
+ */
998
+ PrimaryEphemeralIdentity.toObject = function toObject(message, options) {
999
+ if (!options)
1000
+ options = {};
1001
+ var object = {};
1002
+ if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
1003
+ object.publicKey = options.bytes === String ? $util.base64.encode(message.publicKey, 0, message.publicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKey) : message.publicKey;
1004
+ if (options.oneofs)
1005
+ object._publicKey = "publicKey";
1006
+ }
1007
+ if (message.nonce != null && message.hasOwnProperty("nonce")) {
1008
+ object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
1009
+ if (options.oneofs)
1010
+ object._nonce = "nonce";
1011
+ }
1012
+ return object;
1013
+ };
1014
+ /**
1015
+ * Converts this PrimaryEphemeralIdentity to JSON.
1016
+ * @function toJSON
1017
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
1018
+ * @instance
1019
+ * @returns {Object.<string,*>} JSON object
1020
+ */
1021
+ PrimaryEphemeralIdentity.prototype.toJSON = function toJSON() {
1022
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1023
+ };
1024
+ /**
1025
+ * Gets the default type url for PrimaryEphemeralIdentity
1026
+ * @function getTypeUrl
1027
+ * @memberof CompanionReg.PrimaryEphemeralIdentity
1028
+ * @static
1029
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1030
+ * @returns {string} The default type url
1031
+ */
1032
+ PrimaryEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1033
+ if (typeUrlPrefix === undefined) {
1034
+ typeUrlPrefix = "type.googleapis.com";
1035
+ }
1036
+ return typeUrlPrefix + "/CompanionReg.PrimaryEphemeralIdentity";
1037
+ };
1038
+ return PrimaryEphemeralIdentity;
1039
+ })();
1040
+ CompanionReg.ProloguePayload = (function() {
1041
+ /**
1042
+ * Properties of a ProloguePayload.
1043
+ * @memberof CompanionReg
1044
+ * @interface IProloguePayload
1045
+ * @property {Uint8Array|null} [companionEphemeralIdentity] ProloguePayload companionEphemeralIdentity
1046
+ * @property {CompanionReg.ICompanionCommitment|null} [commitment] ProloguePayload commitment
1047
+ */
1048
+ /**
1049
+ * Constructs a new ProloguePayload.
1050
+ * @memberof CompanionReg
1051
+ * @classdesc Represents a ProloguePayload.
1052
+ * @implements IProloguePayload
1053
+ * @constructor
1054
+ * @param {CompanionReg.IProloguePayload=} [properties] Properties to set
1055
+ */
1056
+ function ProloguePayload(properties) {
1057
+ if (properties)
1058
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1059
+ if (properties[keys[i]] != null)
1060
+ this[keys[i]] = properties[keys[i]];
1061
+ }
1062
+ /**
1063
+ * ProloguePayload companionEphemeralIdentity.
1064
+ * @member {Uint8Array|null|undefined} companionEphemeralIdentity
1065
+ * @memberof CompanionReg.ProloguePayload
1066
+ * @instance
1067
+ */
1068
+ ProloguePayload.prototype.companionEphemeralIdentity = null;
1069
+ /**
1070
+ * ProloguePayload commitment.
1071
+ * @member {CompanionReg.ICompanionCommitment|null|undefined} commitment
1072
+ * @memberof CompanionReg.ProloguePayload
1073
+ * @instance
1074
+ */
1075
+ ProloguePayload.prototype.commitment = null;
1076
+ // OneOf field names bound to virtual getters and setters
1077
+ var $oneOfFields;
1078
+ /**
1079
+ * ProloguePayload _companionEphemeralIdentity.
1080
+ * @member {"companionEphemeralIdentity"|undefined} _companionEphemeralIdentity
1081
+ * @memberof CompanionReg.ProloguePayload
1082
+ * @instance
1083
+ */
1084
+ Object.defineProperty(ProloguePayload.prototype, "_companionEphemeralIdentity", {
1085
+ get: $util.oneOfGetter($oneOfFields = ["companionEphemeralIdentity"]),
1086
+ set: $util.oneOfSetter($oneOfFields)
1087
+ });
1088
+ /**
1089
+ * ProloguePayload _commitment.
1090
+ * @member {"commitment"|undefined} _commitment
1091
+ * @memberof CompanionReg.ProloguePayload
1092
+ * @instance
1093
+ */
1094
+ Object.defineProperty(ProloguePayload.prototype, "_commitment", {
1095
+ get: $util.oneOfGetter($oneOfFields = ["commitment"]),
1096
+ set: $util.oneOfSetter($oneOfFields)
1097
+ });
1098
+ /**
1099
+ * Creates a new ProloguePayload instance using the specified properties.
1100
+ * @function create
1101
+ * @memberof CompanionReg.ProloguePayload
1102
+ * @static
1103
+ * @param {CompanionReg.IProloguePayload=} [properties] Properties to set
1104
+ * @returns {CompanionReg.ProloguePayload} ProloguePayload instance
1105
+ */
1106
+ ProloguePayload.create = function create(properties) {
1107
+ return new ProloguePayload(properties);
1108
+ };
1109
+ /**
1110
+ * Encodes the specified ProloguePayload message. Does not implicitly {@link CompanionReg.ProloguePayload.verify|verify} messages.
1111
+ * @function encode
1112
+ * @memberof CompanionReg.ProloguePayload
1113
+ * @static
1114
+ * @param {CompanionReg.IProloguePayload} message ProloguePayload message or plain object to encode
1115
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1116
+ * @returns {$protobuf.Writer} Writer
1117
+ */
1118
+ ProloguePayload.encode = function encode(message, writer) {
1119
+ if (!writer)
1120
+ writer = $Writer.create();
1121
+ if (message.companionEphemeralIdentity != null && Object.hasOwnProperty.call(message, "companionEphemeralIdentity"))
1122
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.companionEphemeralIdentity);
1123
+ if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment"))
1124
+ $root.CompanionReg.CompanionCommitment.encode(message.commitment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1125
+ return writer;
1126
+ };
1127
+ /**
1128
+ * Encodes the specified ProloguePayload message, length delimited. Does not implicitly {@link CompanionReg.ProloguePayload.verify|verify} messages.
1129
+ * @function encodeDelimited
1130
+ * @memberof CompanionReg.ProloguePayload
1131
+ * @static
1132
+ * @param {CompanionReg.IProloguePayload} message ProloguePayload message or plain object to encode
1133
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1134
+ * @returns {$protobuf.Writer} Writer
1135
+ */
1136
+ ProloguePayload.encodeDelimited = function encodeDelimited(message, writer) {
1137
+ return this.encode(message, writer).ldelim();
1138
+ };
1139
+ /**
1140
+ * Decodes a ProloguePayload message from the specified reader or buffer.
1141
+ * @function decode
1142
+ * @memberof CompanionReg.ProloguePayload
1143
+ * @static
1144
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1145
+ * @param {number} [length] Message length if known beforehand
1146
+ * @returns {CompanionReg.ProloguePayload} ProloguePayload
1147
+ * @throws {Error} If the payload is not a reader or valid buffer
1148
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1149
+ */
1150
+ ProloguePayload.decode = function decode(reader, length, error) {
1151
+ if (!(reader instanceof $Reader))
1152
+ reader = $Reader.create(reader);
1153
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.ProloguePayload();
1154
+ while (reader.pos < end) {
1155
+ var tag = reader.uint32();
1156
+ if (tag === error)
1157
+ break;
1158
+ switch (tag >>> 3) {
1159
+ case 1: {
1160
+ message.companionEphemeralIdentity = reader.bytes();
1161
+ break;
1162
+ }
1163
+ case 2: {
1164
+ message.commitment = $root.CompanionReg.CompanionCommitment.decode(reader, reader.uint32());
1165
+ break;
1166
+ }
1167
+ default:
1168
+ reader.skipType(tag & 7);
1169
+ break;
1170
+ }
1171
+ }
1172
+ return message;
1173
+ };
1174
+ /**
1175
+ * Decodes a ProloguePayload message from the specified reader or buffer, length delimited.
1176
+ * @function decodeDelimited
1177
+ * @memberof CompanionReg.ProloguePayload
1178
+ * @static
1179
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1180
+ * @returns {CompanionReg.ProloguePayload} ProloguePayload
1181
+ * @throws {Error} If the payload is not a reader or valid buffer
1182
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1183
+ */
1184
+ ProloguePayload.decodeDelimited = function decodeDelimited(reader) {
1185
+ if (!(reader instanceof $Reader))
1186
+ reader = new $Reader(reader);
1187
+ return this.decode(reader, reader.uint32());
1188
+ };
1189
+ /**
1190
+ * Verifies a ProloguePayload message.
1191
+ * @function verify
1192
+ * @memberof CompanionReg.ProloguePayload
1193
+ * @static
1194
+ * @param {Object.<string,*>} message Plain object to verify
1195
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1196
+ */
1197
+ ProloguePayload.verify = function verify(message) {
1198
+ if (typeof message !== "object" || message === null)
1199
+ return "object expected";
1200
+ var properties = {};
1201
+ if (message.companionEphemeralIdentity != null && message.hasOwnProperty("companionEphemeralIdentity")) {
1202
+ properties._companionEphemeralIdentity = 1;
1203
+ if (!(message.companionEphemeralIdentity && typeof message.companionEphemeralIdentity.length === "number" || $util.isString(message.companionEphemeralIdentity)))
1204
+ return "companionEphemeralIdentity: buffer expected";
1205
+ }
1206
+ if (message.commitment != null && message.hasOwnProperty("commitment")) {
1207
+ properties._commitment = 1;
1208
+ {
1209
+ var error = $root.CompanionReg.CompanionCommitment.verify(message.commitment);
1210
+ if (error)
1211
+ return "commitment." + error;
1212
+ }
1213
+ }
1214
+ return null;
1215
+ };
1216
+ /**
1217
+ * Creates a ProloguePayload message from a plain object. Also converts values to their respective internal types.
1218
+ * @function fromObject
1219
+ * @memberof CompanionReg.ProloguePayload
1220
+ * @static
1221
+ * @param {Object.<string,*>} object Plain object
1222
+ * @returns {CompanionReg.ProloguePayload} ProloguePayload
1223
+ */
1224
+ ProloguePayload.fromObject = function fromObject(object) {
1225
+ if (object instanceof $root.CompanionReg.ProloguePayload)
1226
+ return object;
1227
+ var message = new $root.CompanionReg.ProloguePayload();
1228
+ if (object.companionEphemeralIdentity != null)
1229
+ if (typeof object.companionEphemeralIdentity === "string")
1230
+ $util.base64.decode(object.companionEphemeralIdentity, message.companionEphemeralIdentity = $util.newBuffer($util.base64.length(object.companionEphemeralIdentity)), 0);
1231
+ else if (object.companionEphemeralIdentity.length >= 0)
1232
+ message.companionEphemeralIdentity = object.companionEphemeralIdentity;
1233
+ if (object.commitment != null) {
1234
+ if (typeof object.commitment !== "object")
1235
+ throw TypeError(".CompanionReg.ProloguePayload.commitment: object expected");
1236
+ message.commitment = $root.CompanionReg.CompanionCommitment.fromObject(object.commitment);
1237
+ }
1238
+ return message;
1239
+ };
1240
+ /**
1241
+ * Creates a plain object from a ProloguePayload message. Also converts values to other types if specified.
1242
+ * @function toObject
1243
+ * @memberof CompanionReg.ProloguePayload
1244
+ * @static
1245
+ * @param {CompanionReg.ProloguePayload} message ProloguePayload
1246
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1247
+ * @returns {Object.<string,*>} Plain object
1248
+ */
1249
+ ProloguePayload.toObject = function toObject(message, options) {
1250
+ if (!options)
1251
+ options = {};
1252
+ var object = {};
1253
+ if (message.companionEphemeralIdentity != null && message.hasOwnProperty("companionEphemeralIdentity")) {
1254
+ object.companionEphemeralIdentity = options.bytes === String ? $util.base64.encode(message.companionEphemeralIdentity, 0, message.companionEphemeralIdentity.length) : options.bytes === Array ? Array.prototype.slice.call(message.companionEphemeralIdentity) : message.companionEphemeralIdentity;
1255
+ if (options.oneofs)
1256
+ object._companionEphemeralIdentity = "companionEphemeralIdentity";
1257
+ }
1258
+ if (message.commitment != null && message.hasOwnProperty("commitment")) {
1259
+ object.commitment = $root.CompanionReg.CompanionCommitment.toObject(message.commitment, options);
1260
+ if (options.oneofs)
1261
+ object._commitment = "commitment";
1262
+ }
1263
+ return object;
1264
+ };
1265
+ /**
1266
+ * Converts this ProloguePayload to JSON.
1267
+ * @function toJSON
1268
+ * @memberof CompanionReg.ProloguePayload
1269
+ * @instance
1270
+ * @returns {Object.<string,*>} JSON object
1271
+ */
1272
+ ProloguePayload.prototype.toJSON = function toJSON() {
1273
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1274
+ };
1275
+ /**
1276
+ * Gets the default type url for ProloguePayload
1277
+ * @function getTypeUrl
1278
+ * @memberof CompanionReg.ProloguePayload
1279
+ * @static
1280
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1281
+ * @returns {string} The default type url
1282
+ */
1283
+ ProloguePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1284
+ if (typeUrlPrefix === undefined) {
1285
+ typeUrlPrefix = "type.googleapis.com";
1286
+ }
1287
+ return typeUrlPrefix + "/CompanionReg.ProloguePayload";
1288
+ };
1289
+ return ProloguePayload;
1290
+ })();
1291
+ CompanionReg.CompanionCommitment = (function() {
1292
+ /**
1293
+ * Properties of a CompanionCommitment.
1294
+ * @memberof CompanionReg
1295
+ * @interface ICompanionCommitment
1296
+ * @property {Uint8Array|null} [hash] CompanionCommitment hash
1297
+ */
1298
+ /**
1299
+ * Constructs a new CompanionCommitment.
1300
+ * @memberof CompanionReg
1301
+ * @classdesc Represents a CompanionCommitment.
1302
+ * @implements ICompanionCommitment
1303
+ * @constructor
1304
+ * @param {CompanionReg.ICompanionCommitment=} [properties] Properties to set
1305
+ */
1306
+ function CompanionCommitment(properties) {
1307
+ if (properties)
1308
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1309
+ if (properties[keys[i]] != null)
1310
+ this[keys[i]] = properties[keys[i]];
1311
+ }
1312
+ /**
1313
+ * CompanionCommitment hash.
1314
+ * @member {Uint8Array|null|undefined} hash
1315
+ * @memberof CompanionReg.CompanionCommitment
1316
+ * @instance
1317
+ */
1318
+ CompanionCommitment.prototype.hash = null;
1319
+ // OneOf field names bound to virtual getters and setters
1320
+ var $oneOfFields;
1321
+ /**
1322
+ * CompanionCommitment _hash.
1323
+ * @member {"hash"|undefined} _hash
1324
+ * @memberof CompanionReg.CompanionCommitment
1325
+ * @instance
1326
+ */
1327
+ Object.defineProperty(CompanionCommitment.prototype, "_hash", {
1328
+ get: $util.oneOfGetter($oneOfFields = ["hash"]),
1329
+ set: $util.oneOfSetter($oneOfFields)
1330
+ });
1331
+ /**
1332
+ * Creates a new CompanionCommitment instance using the specified properties.
1333
+ * @function create
1334
+ * @memberof CompanionReg.CompanionCommitment
1335
+ * @static
1336
+ * @param {CompanionReg.ICompanionCommitment=} [properties] Properties to set
1337
+ * @returns {CompanionReg.CompanionCommitment} CompanionCommitment instance
1338
+ */
1339
+ CompanionCommitment.create = function create(properties) {
1340
+ return new CompanionCommitment(properties);
1341
+ };
1342
+ /**
1343
+ * Encodes the specified CompanionCommitment message. Does not implicitly {@link CompanionReg.CompanionCommitment.verify|verify} messages.
1344
+ * @function encode
1345
+ * @memberof CompanionReg.CompanionCommitment
1346
+ * @static
1347
+ * @param {CompanionReg.ICompanionCommitment} message CompanionCommitment message or plain object to encode
1348
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1349
+ * @returns {$protobuf.Writer} Writer
1350
+ */
1351
+ CompanionCommitment.encode = function encode(message, writer) {
1352
+ if (!writer)
1353
+ writer = $Writer.create();
1354
+ if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
1355
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash);
1356
+ return writer;
1357
+ };
1358
+ /**
1359
+ * Encodes the specified CompanionCommitment message, length delimited. Does not implicitly {@link CompanionReg.CompanionCommitment.verify|verify} messages.
1360
+ * @function encodeDelimited
1361
+ * @memberof CompanionReg.CompanionCommitment
1362
+ * @static
1363
+ * @param {CompanionReg.ICompanionCommitment} message CompanionCommitment message or plain object to encode
1364
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1365
+ * @returns {$protobuf.Writer} Writer
1366
+ */
1367
+ CompanionCommitment.encodeDelimited = function encodeDelimited(message, writer) {
1368
+ return this.encode(message, writer).ldelim();
1369
+ };
1370
+ /**
1371
+ * Decodes a CompanionCommitment message from the specified reader or buffer.
1372
+ * @function decode
1373
+ * @memberof CompanionReg.CompanionCommitment
1374
+ * @static
1375
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1376
+ * @param {number} [length] Message length if known beforehand
1377
+ * @returns {CompanionReg.CompanionCommitment} CompanionCommitment
1378
+ * @throws {Error} If the payload is not a reader or valid buffer
1379
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1380
+ */
1381
+ CompanionCommitment.decode = function decode(reader, length, error) {
1382
+ if (!(reader instanceof $Reader))
1383
+ reader = $Reader.create(reader);
1384
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.CompanionCommitment();
1385
+ while (reader.pos < end) {
1386
+ var tag = reader.uint32();
1387
+ if (tag === error)
1388
+ break;
1389
+ switch (tag >>> 3) {
1390
+ case 1: {
1391
+ message.hash = reader.bytes();
1392
+ break;
1393
+ }
1394
+ default:
1395
+ reader.skipType(tag & 7);
1396
+ break;
1397
+ }
1398
+ }
1399
+ return message;
1400
+ };
1401
+ /**
1402
+ * Decodes a CompanionCommitment message from the specified reader or buffer, length delimited.
1403
+ * @function decodeDelimited
1404
+ * @memberof CompanionReg.CompanionCommitment
1405
+ * @static
1406
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1407
+ * @returns {CompanionReg.CompanionCommitment} CompanionCommitment
1408
+ * @throws {Error} If the payload is not a reader or valid buffer
1409
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1410
+ */
1411
+ CompanionCommitment.decodeDelimited = function decodeDelimited(reader) {
1412
+ if (!(reader instanceof $Reader))
1413
+ reader = new $Reader(reader);
1414
+ return this.decode(reader, reader.uint32());
1415
+ };
1416
+ /**
1417
+ * Verifies a CompanionCommitment message.
1418
+ * @function verify
1419
+ * @memberof CompanionReg.CompanionCommitment
1420
+ * @static
1421
+ * @param {Object.<string,*>} message Plain object to verify
1422
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1423
+ */
1424
+ CompanionCommitment.verify = function verify(message) {
1425
+ if (typeof message !== "object" || message === null)
1426
+ return "object expected";
1427
+ var properties = {};
1428
+ if (message.hash != null && message.hasOwnProperty("hash")) {
1429
+ properties._hash = 1;
1430
+ if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
1431
+ return "hash: buffer expected";
1432
+ }
1433
+ return null;
1434
+ };
1435
+ /**
1436
+ * Creates a CompanionCommitment message from a plain object. Also converts values to their respective internal types.
1437
+ * @function fromObject
1438
+ * @memberof CompanionReg.CompanionCommitment
1439
+ * @static
1440
+ * @param {Object.<string,*>} object Plain object
1441
+ * @returns {CompanionReg.CompanionCommitment} CompanionCommitment
1442
+ */
1443
+ CompanionCommitment.fromObject = function fromObject(object) {
1444
+ if (object instanceof $root.CompanionReg.CompanionCommitment)
1445
+ return object;
1446
+ var message = new $root.CompanionReg.CompanionCommitment();
1447
+ if (object.hash != null)
1448
+ if (typeof object.hash === "string")
1449
+ $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
1450
+ else if (object.hash.length >= 0)
1451
+ message.hash = object.hash;
1452
+ return message;
1453
+ };
1454
+ /**
1455
+ * Creates a plain object from a CompanionCommitment message. Also converts values to other types if specified.
1456
+ * @function toObject
1457
+ * @memberof CompanionReg.CompanionCommitment
1458
+ * @static
1459
+ * @param {CompanionReg.CompanionCommitment} message CompanionCommitment
1460
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1461
+ * @returns {Object.<string,*>} Plain object
1462
+ */
1463
+ CompanionCommitment.toObject = function toObject(message, options) {
1464
+ if (!options)
1465
+ options = {};
1466
+ var object = {};
1467
+ if (message.hash != null && message.hasOwnProperty("hash")) {
1468
+ object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
1469
+ if (options.oneofs)
1470
+ object._hash = "hash";
1471
+ }
1472
+ return object;
1473
+ };
1474
+ /**
1475
+ * Converts this CompanionCommitment to JSON.
1476
+ * @function toJSON
1477
+ * @memberof CompanionReg.CompanionCommitment
1478
+ * @instance
1479
+ * @returns {Object.<string,*>} JSON object
1480
+ */
1481
+ CompanionCommitment.prototype.toJSON = function toJSON() {
1482
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1483
+ };
1484
+ /**
1485
+ * Gets the default type url for CompanionCommitment
1486
+ * @function getTypeUrl
1487
+ * @memberof CompanionReg.CompanionCommitment
1488
+ * @static
1489
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1490
+ * @returns {string} The default type url
1491
+ */
1492
+ CompanionCommitment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1493
+ if (typeUrlPrefix === undefined) {
1494
+ typeUrlPrefix = "type.googleapis.com";
1495
+ }
1496
+ return typeUrlPrefix + "/CompanionReg.CompanionCommitment";
1497
+ };
1498
+ return CompanionCommitment;
1499
+ })();
1500
+ CompanionReg.CompanionEphemeralIdentity = (function() {
1501
+ /**
1502
+ * Properties of a CompanionEphemeralIdentity.
1503
+ * @memberof CompanionReg
1504
+ * @interface ICompanionEphemeralIdentity
1505
+ * @property {Uint8Array|null} [publicKey] CompanionEphemeralIdentity publicKey
1506
+ * @property {CompanionReg.DeviceProps.PlatformType|null} [deviceType] CompanionEphemeralIdentity deviceType
1507
+ * @property {string|null} [ref] CompanionEphemeralIdentity ref
1508
+ */
1509
+ /**
1510
+ * Constructs a new CompanionEphemeralIdentity.
1511
+ * @memberof CompanionReg
1512
+ * @classdesc Represents a CompanionEphemeralIdentity.
1513
+ * @implements ICompanionEphemeralIdentity
1514
+ * @constructor
1515
+ * @param {CompanionReg.ICompanionEphemeralIdentity=} [properties] Properties to set
1516
+ */
1517
+ function CompanionEphemeralIdentity(properties) {
1518
+ if (properties)
1519
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1520
+ if (properties[keys[i]] != null)
1521
+ this[keys[i]] = properties[keys[i]];
1522
+ }
1523
+ /**
1524
+ * CompanionEphemeralIdentity publicKey.
1525
+ * @member {Uint8Array|null|undefined} publicKey
1526
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1527
+ * @instance
1528
+ */
1529
+ CompanionEphemeralIdentity.prototype.publicKey = null;
1530
+ /**
1531
+ * CompanionEphemeralIdentity deviceType.
1532
+ * @member {CompanionReg.DeviceProps.PlatformType|null|undefined} deviceType
1533
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1534
+ * @instance
1535
+ */
1536
+ CompanionEphemeralIdentity.prototype.deviceType = null;
1537
+ /**
1538
+ * CompanionEphemeralIdentity ref.
1539
+ * @member {string|null|undefined} ref
1540
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1541
+ * @instance
1542
+ */
1543
+ CompanionEphemeralIdentity.prototype.ref = null;
1544
+ // OneOf field names bound to virtual getters and setters
1545
+ var $oneOfFields;
1546
+ /**
1547
+ * CompanionEphemeralIdentity _publicKey.
1548
+ * @member {"publicKey"|undefined} _publicKey
1549
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1550
+ * @instance
1551
+ */
1552
+ Object.defineProperty(CompanionEphemeralIdentity.prototype, "_publicKey", {
1553
+ get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
1554
+ set: $util.oneOfSetter($oneOfFields)
1555
+ });
1556
+ /**
1557
+ * CompanionEphemeralIdentity _deviceType.
1558
+ * @member {"deviceType"|undefined} _deviceType
1559
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1560
+ * @instance
1561
+ */
1562
+ Object.defineProperty(CompanionEphemeralIdentity.prototype, "_deviceType", {
1563
+ get: $util.oneOfGetter($oneOfFields = ["deviceType"]),
1564
+ set: $util.oneOfSetter($oneOfFields)
1565
+ });
1566
+ /**
1567
+ * CompanionEphemeralIdentity _ref.
1568
+ * @member {"ref"|undefined} _ref
1569
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1570
+ * @instance
1571
+ */
1572
+ Object.defineProperty(CompanionEphemeralIdentity.prototype, "_ref", {
1573
+ get: $util.oneOfGetter($oneOfFields = ["ref"]),
1574
+ set: $util.oneOfSetter($oneOfFields)
1575
+ });
1576
+ /**
1577
+ * Creates a new CompanionEphemeralIdentity instance using the specified properties.
1578
+ * @function create
1579
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1580
+ * @static
1581
+ * @param {CompanionReg.ICompanionEphemeralIdentity=} [properties] Properties to set
1582
+ * @returns {CompanionReg.CompanionEphemeralIdentity} CompanionEphemeralIdentity instance
1583
+ */
1584
+ CompanionEphemeralIdentity.create = function create(properties) {
1585
+ return new CompanionEphemeralIdentity(properties);
1586
+ };
1587
+ /**
1588
+ * Encodes the specified CompanionEphemeralIdentity message. Does not implicitly {@link CompanionReg.CompanionEphemeralIdentity.verify|verify} messages.
1589
+ * @function encode
1590
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1591
+ * @static
1592
+ * @param {CompanionReg.ICompanionEphemeralIdentity} message CompanionEphemeralIdentity message or plain object to encode
1593
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1594
+ * @returns {$protobuf.Writer} Writer
1595
+ */
1596
+ CompanionEphemeralIdentity.encode = function encode(message, writer) {
1597
+ if (!writer)
1598
+ writer = $Writer.create();
1599
+ if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
1600
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKey);
1601
+ if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType"))
1602
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.deviceType);
1603
+ if (message.ref != null && Object.hasOwnProperty.call(message, "ref"))
1604
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.ref);
1605
+ return writer;
1606
+ };
1607
+ /**
1608
+ * Encodes the specified CompanionEphemeralIdentity message, length delimited. Does not implicitly {@link CompanionReg.CompanionEphemeralIdentity.verify|verify} messages.
1609
+ * @function encodeDelimited
1610
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1611
+ * @static
1612
+ * @param {CompanionReg.ICompanionEphemeralIdentity} message CompanionEphemeralIdentity message or plain object to encode
1613
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1614
+ * @returns {$protobuf.Writer} Writer
1615
+ */
1616
+ CompanionEphemeralIdentity.encodeDelimited = function encodeDelimited(message, writer) {
1617
+ return this.encode(message, writer).ldelim();
1618
+ };
1619
+ /**
1620
+ * Decodes a CompanionEphemeralIdentity message from the specified reader or buffer.
1621
+ * @function decode
1622
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1623
+ * @static
1624
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1625
+ * @param {number} [length] Message length if known beforehand
1626
+ * @returns {CompanionReg.CompanionEphemeralIdentity} CompanionEphemeralIdentity
1627
+ * @throws {Error} If the payload is not a reader or valid buffer
1628
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1629
+ */
1630
+ CompanionEphemeralIdentity.decode = function decode(reader, length, error) {
1631
+ if (!(reader instanceof $Reader))
1632
+ reader = $Reader.create(reader);
1633
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.CompanionEphemeralIdentity();
1634
+ while (reader.pos < end) {
1635
+ var tag = reader.uint32();
1636
+ if (tag === error)
1637
+ break;
1638
+ switch (tag >>> 3) {
1639
+ case 1: {
1640
+ message.publicKey = reader.bytes();
1641
+ break;
1642
+ }
1643
+ case 2: {
1644
+ message.deviceType = reader.int32();
1645
+ break;
1646
+ }
1647
+ case 3: {
1648
+ message.ref = reader.string();
1649
+ break;
1650
+ }
1651
+ default:
1652
+ reader.skipType(tag & 7);
1653
+ break;
1654
+ }
1655
+ }
1656
+ return message;
1657
+ };
1658
+ /**
1659
+ * Decodes a CompanionEphemeralIdentity message from the specified reader or buffer, length delimited.
1660
+ * @function decodeDelimited
1661
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1662
+ * @static
1663
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1664
+ * @returns {CompanionReg.CompanionEphemeralIdentity} CompanionEphemeralIdentity
1665
+ * @throws {Error} If the payload is not a reader or valid buffer
1666
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1667
+ */
1668
+ CompanionEphemeralIdentity.decodeDelimited = function decodeDelimited(reader) {
1669
+ if (!(reader instanceof $Reader))
1670
+ reader = new $Reader(reader);
1671
+ return this.decode(reader, reader.uint32());
1672
+ };
1673
+ /**
1674
+ * Verifies a CompanionEphemeralIdentity message.
1675
+ * @function verify
1676
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1677
+ * @static
1678
+ * @param {Object.<string,*>} message Plain object to verify
1679
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1680
+ */
1681
+ CompanionEphemeralIdentity.verify = function verify(message) {
1682
+ if (typeof message !== "object" || message === null)
1683
+ return "object expected";
1684
+ var properties = {};
1685
+ if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
1686
+ properties._publicKey = 1;
1687
+ if (!(message.publicKey && typeof message.publicKey.length === "number" || $util.isString(message.publicKey)))
1688
+ return "publicKey: buffer expected";
1689
+ }
1690
+ if (message.deviceType != null && message.hasOwnProperty("deviceType")) {
1691
+ properties._deviceType = 1;
1692
+ switch (message.deviceType) {
1693
+ default:
1694
+ return "deviceType: enum value expected";
1695
+ case 0:
1696
+ case 1:
1697
+ case 2:
1698
+ case 3:
1699
+ case 4:
1700
+ case 5:
1701
+ case 6:
1702
+ case 7:
1703
+ case 8:
1704
+ case 9:
1705
+ case 10:
1706
+ case 11:
1707
+ case 12:
1708
+ case 13:
1709
+ case 14:
1710
+ case 15:
1711
+ case 16:
1712
+ case 17:
1713
+ case 18:
1714
+ case 19:
1715
+ case 20:
1716
+ case 21:
1717
+ case 22:
1718
+ case 23:
1719
+ case 24:
1720
+ break;
1721
+ }
1722
+ }
1723
+ if (message.ref != null && message.hasOwnProperty("ref")) {
1724
+ properties._ref = 1;
1725
+ if (!$util.isString(message.ref))
1726
+ return "ref: string expected";
1727
+ }
1728
+ return null;
1729
+ };
1730
+ /**
1731
+ * Creates a CompanionEphemeralIdentity message from a plain object. Also converts values to their respective internal types.
1732
+ * @function fromObject
1733
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1734
+ * @static
1735
+ * @param {Object.<string,*>} object Plain object
1736
+ * @returns {CompanionReg.CompanionEphemeralIdentity} CompanionEphemeralIdentity
1737
+ */
1738
+ CompanionEphemeralIdentity.fromObject = function fromObject(object) {
1739
+ if (object instanceof $root.CompanionReg.CompanionEphemeralIdentity)
1740
+ return object;
1741
+ var message = new $root.CompanionReg.CompanionEphemeralIdentity();
1742
+ if (object.publicKey != null)
1743
+ if (typeof object.publicKey === "string")
1744
+ $util.base64.decode(object.publicKey, message.publicKey = $util.newBuffer($util.base64.length(object.publicKey)), 0);
1745
+ else if (object.publicKey.length >= 0)
1746
+ message.publicKey = object.publicKey;
1747
+ switch (object.deviceType) {
1748
+ default:
1749
+ if (typeof object.deviceType === "number") {
1750
+ message.deviceType = object.deviceType;
1751
+ break;
1752
+ }
1753
+ break;
1754
+ case "UNKNOWN":
1755
+ case 0:
1756
+ message.deviceType = 0;
1757
+ break;
1758
+ case "CHROME":
1759
+ case 1:
1760
+ message.deviceType = 1;
1761
+ break;
1762
+ case "FIREFOX":
1763
+ case 2:
1764
+ message.deviceType = 2;
1765
+ break;
1766
+ case "IE":
1767
+ case 3:
1768
+ message.deviceType = 3;
1769
+ break;
1770
+ case "OPERA":
1771
+ case 4:
1772
+ message.deviceType = 4;
1773
+ break;
1774
+ case "SAFARI":
1775
+ case 5:
1776
+ message.deviceType = 5;
1777
+ break;
1778
+ case "EDGE":
1779
+ case 6:
1780
+ message.deviceType = 6;
1781
+ break;
1782
+ case "DESKTOP":
1783
+ case 7:
1784
+ message.deviceType = 7;
1785
+ break;
1786
+ case "IPAD":
1787
+ case 8:
1788
+ message.deviceType = 8;
1789
+ break;
1790
+ case "ANDROID_TABLET":
1791
+ case 9:
1792
+ message.deviceType = 9;
1793
+ break;
1794
+ case "OHANA":
1795
+ case 10:
1796
+ message.deviceType = 10;
1797
+ break;
1798
+ case "ALOHA":
1799
+ case 11:
1800
+ message.deviceType = 11;
1801
+ break;
1802
+ case "CATALINA":
1803
+ case 12:
1804
+ message.deviceType = 12;
1805
+ break;
1806
+ case "TCL_TV":
1807
+ case 13:
1808
+ message.deviceType = 13;
1809
+ break;
1810
+ case "IOS_PHONE":
1811
+ case 14:
1812
+ message.deviceType = 14;
1813
+ break;
1814
+ case "IOS_CATALYST":
1815
+ case 15:
1816
+ message.deviceType = 15;
1817
+ break;
1818
+ case "ANDROID_PHONE":
1819
+ case 16:
1820
+ message.deviceType = 16;
1821
+ break;
1822
+ case "ANDROID_AMBIGUOUS":
1823
+ case 17:
1824
+ message.deviceType = 17;
1825
+ break;
1826
+ case "WEAR_OS":
1827
+ case 18:
1828
+ message.deviceType = 18;
1829
+ break;
1830
+ case "AR_WRIST":
1831
+ case 19:
1832
+ message.deviceType = 19;
1833
+ break;
1834
+ case "AR_DEVICE":
1835
+ case 20:
1836
+ message.deviceType = 20;
1837
+ break;
1838
+ case "UWP":
1839
+ case 21:
1840
+ message.deviceType = 21;
1841
+ break;
1842
+ case "VR":
1843
+ case 22:
1844
+ message.deviceType = 22;
1845
+ break;
1846
+ case "CLOUD_API":
1847
+ case 23:
1848
+ message.deviceType = 23;
1849
+ break;
1850
+ case "SMARTGLASSES":
1851
+ case 24:
1852
+ message.deviceType = 24;
1853
+ break;
1854
+ }
1855
+ if (object.ref != null)
1856
+ message.ref = String(object.ref);
1857
+ return message;
1858
+ };
1859
+ /**
1860
+ * Creates a plain object from a CompanionEphemeralIdentity message. Also converts values to other types if specified.
1861
+ * @function toObject
1862
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1863
+ * @static
1864
+ * @param {CompanionReg.CompanionEphemeralIdentity} message CompanionEphemeralIdentity
1865
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1866
+ * @returns {Object.<string,*>} Plain object
1867
+ */
1868
+ CompanionEphemeralIdentity.toObject = function toObject(message, options) {
1869
+ if (!options)
1870
+ options = {};
1871
+ var object = {};
1872
+ if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
1873
+ object.publicKey = options.bytes === String ? $util.base64.encode(message.publicKey, 0, message.publicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKey) : message.publicKey;
1874
+ if (options.oneofs)
1875
+ object._publicKey = "publicKey";
1876
+ }
1877
+ if (message.deviceType != null && message.hasOwnProperty("deviceType")) {
1878
+ object.deviceType = options.enums === String ? $root.CompanionReg.DeviceProps.PlatformType[message.deviceType] === undefined ? message.deviceType : $root.CompanionReg.DeviceProps.PlatformType[message.deviceType] : message.deviceType;
1879
+ if (options.oneofs)
1880
+ object._deviceType = "deviceType";
1881
+ }
1882
+ if (message.ref != null && message.hasOwnProperty("ref")) {
1883
+ object.ref = message.ref;
1884
+ if (options.oneofs)
1885
+ object._ref = "ref";
1886
+ }
1887
+ return object;
1888
+ };
1889
+ /**
1890
+ * Converts this CompanionEphemeralIdentity to JSON.
1891
+ * @function toJSON
1892
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1893
+ * @instance
1894
+ * @returns {Object.<string,*>} JSON object
1895
+ */
1896
+ CompanionEphemeralIdentity.prototype.toJSON = function toJSON() {
1897
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1898
+ };
1899
+ /**
1900
+ * Gets the default type url for CompanionEphemeralIdentity
1901
+ * @function getTypeUrl
1902
+ * @memberof CompanionReg.CompanionEphemeralIdentity
1903
+ * @static
1904
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1905
+ * @returns {string} The default type url
1906
+ */
1907
+ CompanionEphemeralIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1908
+ if (typeUrlPrefix === undefined) {
1909
+ typeUrlPrefix = "type.googleapis.com";
1910
+ }
1911
+ return typeUrlPrefix + "/CompanionReg.CompanionEphemeralIdentity";
1912
+ };
1913
+ return CompanionEphemeralIdentity;
1914
+ })();
1915
+ CompanionReg.DeviceProps = (function() {
1916
+ /**
1917
+ * Properties of a DeviceProps.
1918
+ * @memberof CompanionReg
1919
+ * @interface IDeviceProps
1920
+ * @property {string|null} [os] DeviceProps os
1921
+ * @property {CompanionReg.DeviceProps.IAppVersion|null} [version] DeviceProps version
1922
+ * @property {CompanionReg.DeviceProps.PlatformType|null} [platformType] DeviceProps platformType
1923
+ * @property {boolean|null} [requireFullSync] DeviceProps requireFullSync
1924
+ * @property {CompanionReg.DeviceProps.IHistorySyncConfig|null} [historySyncConfig] DeviceProps historySyncConfig
1925
+ */
1926
+ /**
1927
+ * Constructs a new DeviceProps.
1928
+ * @memberof CompanionReg
1929
+ * @classdesc Represents a DeviceProps.
1930
+ * @implements IDeviceProps
1931
+ * @constructor
1932
+ * @param {CompanionReg.IDeviceProps=} [properties] Properties to set
1933
+ */
1934
+ function DeviceProps(properties) {
1935
+ if (properties)
1936
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1937
+ if (properties[keys[i]] != null)
1938
+ this[keys[i]] = properties[keys[i]];
1939
+ }
1940
+ /**
1941
+ * DeviceProps os.
1942
+ * @member {string|null|undefined} os
1943
+ * @memberof CompanionReg.DeviceProps
1944
+ * @instance
1945
+ */
1946
+ DeviceProps.prototype.os = null;
1947
+ /**
1948
+ * DeviceProps version.
1949
+ * @member {CompanionReg.DeviceProps.IAppVersion|null|undefined} version
1950
+ * @memberof CompanionReg.DeviceProps
1951
+ * @instance
1952
+ */
1953
+ DeviceProps.prototype.version = null;
1954
+ /**
1955
+ * DeviceProps platformType.
1956
+ * @member {CompanionReg.DeviceProps.PlatformType|null|undefined} platformType
1957
+ * @memberof CompanionReg.DeviceProps
1958
+ * @instance
1959
+ */
1960
+ DeviceProps.prototype.platformType = null;
1961
+ /**
1962
+ * DeviceProps requireFullSync.
1963
+ * @member {boolean|null|undefined} requireFullSync
1964
+ * @memberof CompanionReg.DeviceProps
1965
+ * @instance
1966
+ */
1967
+ DeviceProps.prototype.requireFullSync = null;
1968
+ /**
1969
+ * DeviceProps historySyncConfig.
1970
+ * @member {CompanionReg.DeviceProps.IHistorySyncConfig|null|undefined} historySyncConfig
1971
+ * @memberof CompanionReg.DeviceProps
1972
+ * @instance
1973
+ */
1974
+ DeviceProps.prototype.historySyncConfig = null;
1975
+ // OneOf field names bound to virtual getters and setters
1976
+ var $oneOfFields;
1977
+ /**
1978
+ * DeviceProps _os.
1979
+ * @member {"os"|undefined} _os
1980
+ * @memberof CompanionReg.DeviceProps
1981
+ * @instance
1982
+ */
1983
+ Object.defineProperty(DeviceProps.prototype, "_os", {
1984
+ get: $util.oneOfGetter($oneOfFields = ["os"]),
1985
+ set: $util.oneOfSetter($oneOfFields)
1986
+ });
1987
+ /**
1988
+ * DeviceProps _version.
1989
+ * @member {"version"|undefined} _version
1990
+ * @memberof CompanionReg.DeviceProps
1991
+ * @instance
1992
+ */
1993
+ Object.defineProperty(DeviceProps.prototype, "_version", {
1994
+ get: $util.oneOfGetter($oneOfFields = ["version"]),
1995
+ set: $util.oneOfSetter($oneOfFields)
1996
+ });
1997
+ /**
1998
+ * DeviceProps _platformType.
1999
+ * @member {"platformType"|undefined} _platformType
2000
+ * @memberof CompanionReg.DeviceProps
2001
+ * @instance
2002
+ */
2003
+ Object.defineProperty(DeviceProps.prototype, "_platformType", {
2004
+ get: $util.oneOfGetter($oneOfFields = ["platformType"]),
2005
+ set: $util.oneOfSetter($oneOfFields)
2006
+ });
2007
+ /**
2008
+ * DeviceProps _requireFullSync.
2009
+ * @member {"requireFullSync"|undefined} _requireFullSync
2010
+ * @memberof CompanionReg.DeviceProps
2011
+ * @instance
2012
+ */
2013
+ Object.defineProperty(DeviceProps.prototype, "_requireFullSync", {
2014
+ get: $util.oneOfGetter($oneOfFields = ["requireFullSync"]),
2015
+ set: $util.oneOfSetter($oneOfFields)
2016
+ });
2017
+ /**
2018
+ * DeviceProps _historySyncConfig.
2019
+ * @member {"historySyncConfig"|undefined} _historySyncConfig
2020
+ * @memberof CompanionReg.DeviceProps
2021
+ * @instance
2022
+ */
2023
+ Object.defineProperty(DeviceProps.prototype, "_historySyncConfig", {
2024
+ get: $util.oneOfGetter($oneOfFields = ["historySyncConfig"]),
2025
+ set: $util.oneOfSetter($oneOfFields)
2026
+ });
2027
+ /**
2028
+ * Creates a new DeviceProps instance using the specified properties.
2029
+ * @function create
2030
+ * @memberof CompanionReg.DeviceProps
2031
+ * @static
2032
+ * @param {CompanionReg.IDeviceProps=} [properties] Properties to set
2033
+ * @returns {CompanionReg.DeviceProps} DeviceProps instance
2034
+ */
2035
+ DeviceProps.create = function create(properties) {
2036
+ return new DeviceProps(properties);
2037
+ };
2038
+ /**
2039
+ * Encodes the specified DeviceProps message. Does not implicitly {@link CompanionReg.DeviceProps.verify|verify} messages.
2040
+ * @function encode
2041
+ * @memberof CompanionReg.DeviceProps
2042
+ * @static
2043
+ * @param {CompanionReg.IDeviceProps} message DeviceProps message or plain object to encode
2044
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2045
+ * @returns {$protobuf.Writer} Writer
2046
+ */
2047
+ DeviceProps.encode = function encode(message, writer) {
2048
+ if (!writer)
2049
+ writer = $Writer.create();
2050
+ if (message.os != null && Object.hasOwnProperty.call(message, "os"))
2051
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.os);
2052
+ if (message.version != null && Object.hasOwnProperty.call(message, "version"))
2053
+ $root.CompanionReg.DeviceProps.AppVersion.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2054
+ if (message.platformType != null && Object.hasOwnProperty.call(message, "platformType"))
2055
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.platformType);
2056
+ if (message.requireFullSync != null && Object.hasOwnProperty.call(message, "requireFullSync"))
2057
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requireFullSync);
2058
+ if (message.historySyncConfig != null && Object.hasOwnProperty.call(message, "historySyncConfig"))
2059
+ $root.CompanionReg.DeviceProps.HistorySyncConfig.encode(message.historySyncConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
2060
+ return writer;
2061
+ };
2062
+ /**
2063
+ * Encodes the specified DeviceProps message, length delimited. Does not implicitly {@link CompanionReg.DeviceProps.verify|verify} messages.
2064
+ * @function encodeDelimited
2065
+ * @memberof CompanionReg.DeviceProps
2066
+ * @static
2067
+ * @param {CompanionReg.IDeviceProps} message DeviceProps message or plain object to encode
2068
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2069
+ * @returns {$protobuf.Writer} Writer
2070
+ */
2071
+ DeviceProps.encodeDelimited = function encodeDelimited(message, writer) {
2072
+ return this.encode(message, writer).ldelim();
2073
+ };
2074
+ /**
2075
+ * Decodes a DeviceProps message from the specified reader or buffer.
2076
+ * @function decode
2077
+ * @memberof CompanionReg.DeviceProps
2078
+ * @static
2079
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2080
+ * @param {number} [length] Message length if known beforehand
2081
+ * @returns {CompanionReg.DeviceProps} DeviceProps
2082
+ * @throws {Error} If the payload is not a reader or valid buffer
2083
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2084
+ */
2085
+ DeviceProps.decode = function decode(reader, length, error) {
2086
+ if (!(reader instanceof $Reader))
2087
+ reader = $Reader.create(reader);
2088
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.DeviceProps();
2089
+ while (reader.pos < end) {
2090
+ var tag = reader.uint32();
2091
+ if (tag === error)
2092
+ break;
2093
+ switch (tag >>> 3) {
2094
+ case 1: {
2095
+ message.os = reader.string();
2096
+ break;
2097
+ }
2098
+ case 2: {
2099
+ message.version = $root.CompanionReg.DeviceProps.AppVersion.decode(reader, reader.uint32());
2100
+ break;
2101
+ }
2102
+ case 3: {
2103
+ message.platformType = reader.int32();
2104
+ break;
2105
+ }
2106
+ case 4: {
2107
+ message.requireFullSync = reader.bool();
2108
+ break;
2109
+ }
2110
+ case 5: {
2111
+ message.historySyncConfig = $root.CompanionReg.DeviceProps.HistorySyncConfig.decode(reader, reader.uint32());
2112
+ break;
2113
+ }
2114
+ default:
2115
+ reader.skipType(tag & 7);
2116
+ break;
2117
+ }
2118
+ }
2119
+ return message;
2120
+ };
2121
+ /**
2122
+ * Decodes a DeviceProps message from the specified reader or buffer, length delimited.
2123
+ * @function decodeDelimited
2124
+ * @memberof CompanionReg.DeviceProps
2125
+ * @static
2126
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2127
+ * @returns {CompanionReg.DeviceProps} DeviceProps
2128
+ * @throws {Error} If the payload is not a reader or valid buffer
2129
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2130
+ */
2131
+ DeviceProps.decodeDelimited = function decodeDelimited(reader) {
2132
+ if (!(reader instanceof $Reader))
2133
+ reader = new $Reader(reader);
2134
+ return this.decode(reader, reader.uint32());
2135
+ };
2136
+ /**
2137
+ * Verifies a DeviceProps message.
2138
+ * @function verify
2139
+ * @memberof CompanionReg.DeviceProps
2140
+ * @static
2141
+ * @param {Object.<string,*>} message Plain object to verify
2142
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2143
+ */
2144
+ DeviceProps.verify = function verify(message) {
2145
+ if (typeof message !== "object" || message === null)
2146
+ return "object expected";
2147
+ var properties = {};
2148
+ if (message.os != null && message.hasOwnProperty("os")) {
2149
+ properties._os = 1;
2150
+ if (!$util.isString(message.os))
2151
+ return "os: string expected";
2152
+ }
2153
+ if (message.version != null && message.hasOwnProperty("version")) {
2154
+ properties._version = 1;
2155
+ {
2156
+ var error = $root.CompanionReg.DeviceProps.AppVersion.verify(message.version);
2157
+ if (error)
2158
+ return "version." + error;
2159
+ }
2160
+ }
2161
+ if (message.platformType != null && message.hasOwnProperty("platformType")) {
2162
+ properties._platformType = 1;
2163
+ switch (message.platformType) {
2164
+ default:
2165
+ return "platformType: enum value expected";
2166
+ case 0:
2167
+ case 1:
2168
+ case 2:
2169
+ case 3:
2170
+ case 4:
2171
+ case 5:
2172
+ case 6:
2173
+ case 7:
2174
+ case 8:
2175
+ case 9:
2176
+ case 10:
2177
+ case 11:
2178
+ case 12:
2179
+ case 13:
2180
+ case 14:
2181
+ case 15:
2182
+ case 16:
2183
+ case 17:
2184
+ case 18:
2185
+ case 19:
2186
+ case 20:
2187
+ case 21:
2188
+ case 22:
2189
+ case 23:
2190
+ case 24:
2191
+ break;
2192
+ }
2193
+ }
2194
+ if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) {
2195
+ properties._requireFullSync = 1;
2196
+ if (typeof message.requireFullSync !== "boolean")
2197
+ return "requireFullSync: boolean expected";
2198
+ }
2199
+ if (message.historySyncConfig != null && message.hasOwnProperty("historySyncConfig")) {
2200
+ properties._historySyncConfig = 1;
2201
+ {
2202
+ var error = $root.CompanionReg.DeviceProps.HistorySyncConfig.verify(message.historySyncConfig);
2203
+ if (error)
2204
+ return "historySyncConfig." + error;
2205
+ }
2206
+ }
2207
+ return null;
2208
+ };
2209
+ /**
2210
+ * Creates a DeviceProps message from a plain object. Also converts values to their respective internal types.
2211
+ * @function fromObject
2212
+ * @memberof CompanionReg.DeviceProps
2213
+ * @static
2214
+ * @param {Object.<string,*>} object Plain object
2215
+ * @returns {CompanionReg.DeviceProps} DeviceProps
2216
+ */
2217
+ DeviceProps.fromObject = function fromObject(object) {
2218
+ if (object instanceof $root.CompanionReg.DeviceProps)
2219
+ return object;
2220
+ var message = new $root.CompanionReg.DeviceProps();
2221
+ if (object.os != null)
2222
+ message.os = String(object.os);
2223
+ if (object.version != null) {
2224
+ if (typeof object.version !== "object")
2225
+ throw TypeError(".CompanionReg.DeviceProps.version: object expected");
2226
+ message.version = $root.CompanionReg.DeviceProps.AppVersion.fromObject(object.version);
2227
+ }
2228
+ switch (object.platformType) {
2229
+ default:
2230
+ if (typeof object.platformType === "number") {
2231
+ message.platformType = object.platformType;
2232
+ break;
2233
+ }
2234
+ break;
2235
+ case "UNKNOWN":
2236
+ case 0:
2237
+ message.platformType = 0;
2238
+ break;
2239
+ case "CHROME":
2240
+ case 1:
2241
+ message.platformType = 1;
2242
+ break;
2243
+ case "FIREFOX":
2244
+ case 2:
2245
+ message.platformType = 2;
2246
+ break;
2247
+ case "IE":
2248
+ case 3:
2249
+ message.platformType = 3;
2250
+ break;
2251
+ case "OPERA":
2252
+ case 4:
2253
+ message.platformType = 4;
2254
+ break;
2255
+ case "SAFARI":
2256
+ case 5:
2257
+ message.platformType = 5;
2258
+ break;
2259
+ case "EDGE":
2260
+ case 6:
2261
+ message.platformType = 6;
2262
+ break;
2263
+ case "DESKTOP":
2264
+ case 7:
2265
+ message.platformType = 7;
2266
+ break;
2267
+ case "IPAD":
2268
+ case 8:
2269
+ message.platformType = 8;
2270
+ break;
2271
+ case "ANDROID_TABLET":
2272
+ case 9:
2273
+ message.platformType = 9;
2274
+ break;
2275
+ case "OHANA":
2276
+ case 10:
2277
+ message.platformType = 10;
2278
+ break;
2279
+ case "ALOHA":
2280
+ case 11:
2281
+ message.platformType = 11;
2282
+ break;
2283
+ case "CATALINA":
2284
+ case 12:
2285
+ message.platformType = 12;
2286
+ break;
2287
+ case "TCL_TV":
2288
+ case 13:
2289
+ message.platformType = 13;
2290
+ break;
2291
+ case "IOS_PHONE":
2292
+ case 14:
2293
+ message.platformType = 14;
2294
+ break;
2295
+ case "IOS_CATALYST":
2296
+ case 15:
2297
+ message.platformType = 15;
2298
+ break;
2299
+ case "ANDROID_PHONE":
2300
+ case 16:
2301
+ message.platformType = 16;
2302
+ break;
2303
+ case "ANDROID_AMBIGUOUS":
2304
+ case 17:
2305
+ message.platformType = 17;
2306
+ break;
2307
+ case "WEAR_OS":
2308
+ case 18:
2309
+ message.platformType = 18;
2310
+ break;
2311
+ case "AR_WRIST":
2312
+ case 19:
2313
+ message.platformType = 19;
2314
+ break;
2315
+ case "AR_DEVICE":
2316
+ case 20:
2317
+ message.platformType = 20;
2318
+ break;
2319
+ case "UWP":
2320
+ case 21:
2321
+ message.platformType = 21;
2322
+ break;
2323
+ case "VR":
2324
+ case 22:
2325
+ message.platformType = 22;
2326
+ break;
2327
+ case "CLOUD_API":
2328
+ case 23:
2329
+ message.platformType = 23;
2330
+ break;
2331
+ case "SMARTGLASSES":
2332
+ case 24:
2333
+ message.platformType = 24;
2334
+ break;
2335
+ }
2336
+ if (object.requireFullSync != null)
2337
+ message.requireFullSync = Boolean(object.requireFullSync);
2338
+ if (object.historySyncConfig != null) {
2339
+ if (typeof object.historySyncConfig !== "object")
2340
+ throw TypeError(".CompanionReg.DeviceProps.historySyncConfig: object expected");
2341
+ message.historySyncConfig = $root.CompanionReg.DeviceProps.HistorySyncConfig.fromObject(object.historySyncConfig);
2342
+ }
2343
+ return message;
2344
+ };
2345
+ /**
2346
+ * Creates a plain object from a DeviceProps message. Also converts values to other types if specified.
2347
+ * @function toObject
2348
+ * @memberof CompanionReg.DeviceProps
2349
+ * @static
2350
+ * @param {CompanionReg.DeviceProps} message DeviceProps
2351
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2352
+ * @returns {Object.<string,*>} Plain object
2353
+ */
2354
+ DeviceProps.toObject = function toObject(message, options) {
2355
+ if (!options)
2356
+ options = {};
2357
+ var object = {};
2358
+ if (message.os != null && message.hasOwnProperty("os")) {
2359
+ object.os = message.os;
2360
+ if (options.oneofs)
2361
+ object._os = "os";
2362
+ }
2363
+ if (message.version != null && message.hasOwnProperty("version")) {
2364
+ object.version = $root.CompanionReg.DeviceProps.AppVersion.toObject(message.version, options);
2365
+ if (options.oneofs)
2366
+ object._version = "version";
2367
+ }
2368
+ if (message.platformType != null && message.hasOwnProperty("platformType")) {
2369
+ object.platformType = options.enums === String ? $root.CompanionReg.DeviceProps.PlatformType[message.platformType] === undefined ? message.platformType : $root.CompanionReg.DeviceProps.PlatformType[message.platformType] : message.platformType;
2370
+ if (options.oneofs)
2371
+ object._platformType = "platformType";
2372
+ }
2373
+ if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) {
2374
+ object.requireFullSync = message.requireFullSync;
2375
+ if (options.oneofs)
2376
+ object._requireFullSync = "requireFullSync";
2377
+ }
2378
+ if (message.historySyncConfig != null && message.hasOwnProperty("historySyncConfig")) {
2379
+ object.historySyncConfig = $root.CompanionReg.DeviceProps.HistorySyncConfig.toObject(message.historySyncConfig, options);
2380
+ if (options.oneofs)
2381
+ object._historySyncConfig = "historySyncConfig";
2382
+ }
2383
+ return object;
2384
+ };
2385
+ /**
2386
+ * Converts this DeviceProps to JSON.
2387
+ * @function toJSON
2388
+ * @memberof CompanionReg.DeviceProps
2389
+ * @instance
2390
+ * @returns {Object.<string,*>} JSON object
2391
+ */
2392
+ DeviceProps.prototype.toJSON = function toJSON() {
2393
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2394
+ };
2395
+ /**
2396
+ * Gets the default type url for DeviceProps
2397
+ * @function getTypeUrl
2398
+ * @memberof CompanionReg.DeviceProps
2399
+ * @static
2400
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2401
+ * @returns {string} The default type url
2402
+ */
2403
+ DeviceProps.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2404
+ if (typeUrlPrefix === undefined) {
2405
+ typeUrlPrefix = "type.googleapis.com";
2406
+ }
2407
+ return typeUrlPrefix + "/CompanionReg.DeviceProps";
2408
+ };
2409
+ DeviceProps.AppVersion = (function() {
2410
+ /**
2411
+ * Properties of an AppVersion.
2412
+ * @memberof CompanionReg.DeviceProps
2413
+ * @interface IAppVersion
2414
+ * @property {number|null} [primary] AppVersion primary
2415
+ * @property {number|null} [secondary] AppVersion secondary
2416
+ * @property {number|null} [tertiary] AppVersion tertiary
2417
+ * @property {number|null} [quaternary] AppVersion quaternary
2418
+ * @property {number|null} [quinary] AppVersion quinary
2419
+ */
2420
+ /**
2421
+ * Constructs a new AppVersion.
2422
+ * @memberof CompanionReg.DeviceProps
2423
+ * @classdesc Represents an AppVersion.
2424
+ * @implements IAppVersion
2425
+ * @constructor
2426
+ * @param {CompanionReg.DeviceProps.IAppVersion=} [properties] Properties to set
2427
+ */
2428
+ function AppVersion(properties) {
2429
+ if (properties)
2430
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2431
+ if (properties[keys[i]] != null)
2432
+ this[keys[i]] = properties[keys[i]];
2433
+ }
2434
+ /**
2435
+ * AppVersion primary.
2436
+ * @member {number|null|undefined} primary
2437
+ * @memberof CompanionReg.DeviceProps.AppVersion
2438
+ * @instance
2439
+ */
2440
+ AppVersion.prototype.primary = null;
2441
+ /**
2442
+ * AppVersion secondary.
2443
+ * @member {number|null|undefined} secondary
2444
+ * @memberof CompanionReg.DeviceProps.AppVersion
2445
+ * @instance
2446
+ */
2447
+ AppVersion.prototype.secondary = null;
2448
+ /**
2449
+ * AppVersion tertiary.
2450
+ * @member {number|null|undefined} tertiary
2451
+ * @memberof CompanionReg.DeviceProps.AppVersion
2452
+ * @instance
2453
+ */
2454
+ AppVersion.prototype.tertiary = null;
2455
+ /**
2456
+ * AppVersion quaternary.
2457
+ * @member {number|null|undefined} quaternary
2458
+ * @memberof CompanionReg.DeviceProps.AppVersion
2459
+ * @instance
2460
+ */
2461
+ AppVersion.prototype.quaternary = null;
2462
+ /**
2463
+ * AppVersion quinary.
2464
+ * @member {number|null|undefined} quinary
2465
+ * @memberof CompanionReg.DeviceProps.AppVersion
2466
+ * @instance
2467
+ */
2468
+ AppVersion.prototype.quinary = null;
2469
+ // OneOf field names bound to virtual getters and setters
2470
+ var $oneOfFields;
2471
+ /**
2472
+ * AppVersion _primary.
2473
+ * @member {"primary"|undefined} _primary
2474
+ * @memberof CompanionReg.DeviceProps.AppVersion
2475
+ * @instance
2476
+ */
2477
+ Object.defineProperty(AppVersion.prototype, "_primary", {
2478
+ get: $util.oneOfGetter($oneOfFields = ["primary"]),
2479
+ set: $util.oneOfSetter($oneOfFields)
2480
+ });
2481
+ /**
2482
+ * AppVersion _secondary.
2483
+ * @member {"secondary"|undefined} _secondary
2484
+ * @memberof CompanionReg.DeviceProps.AppVersion
2485
+ * @instance
2486
+ */
2487
+ Object.defineProperty(AppVersion.prototype, "_secondary", {
2488
+ get: $util.oneOfGetter($oneOfFields = ["secondary"]),
2489
+ set: $util.oneOfSetter($oneOfFields)
2490
+ });
2491
+ /**
2492
+ * AppVersion _tertiary.
2493
+ * @member {"tertiary"|undefined} _tertiary
2494
+ * @memberof CompanionReg.DeviceProps.AppVersion
2495
+ * @instance
2496
+ */
2497
+ Object.defineProperty(AppVersion.prototype, "_tertiary", {
2498
+ get: $util.oneOfGetter($oneOfFields = ["tertiary"]),
2499
+ set: $util.oneOfSetter($oneOfFields)
2500
+ });
2501
+ /**
2502
+ * AppVersion _quaternary.
2503
+ * @member {"quaternary"|undefined} _quaternary
2504
+ * @memberof CompanionReg.DeviceProps.AppVersion
2505
+ * @instance
2506
+ */
2507
+ Object.defineProperty(AppVersion.prototype, "_quaternary", {
2508
+ get: $util.oneOfGetter($oneOfFields = ["quaternary"]),
2509
+ set: $util.oneOfSetter($oneOfFields)
2510
+ });
2511
+ /**
2512
+ * AppVersion _quinary.
2513
+ * @member {"quinary"|undefined} _quinary
2514
+ * @memberof CompanionReg.DeviceProps.AppVersion
2515
+ * @instance
2516
+ */
2517
+ Object.defineProperty(AppVersion.prototype, "_quinary", {
2518
+ get: $util.oneOfGetter($oneOfFields = ["quinary"]),
2519
+ set: $util.oneOfSetter($oneOfFields)
2520
+ });
2521
+ /**
2522
+ * Creates a new AppVersion instance using the specified properties.
2523
+ * @function create
2524
+ * @memberof CompanionReg.DeviceProps.AppVersion
2525
+ * @static
2526
+ * @param {CompanionReg.DeviceProps.IAppVersion=} [properties] Properties to set
2527
+ * @returns {CompanionReg.DeviceProps.AppVersion} AppVersion instance
2528
+ */
2529
+ AppVersion.create = function create(properties) {
2530
+ return new AppVersion(properties);
2531
+ };
2532
+ /**
2533
+ * Encodes the specified AppVersion message. Does not implicitly {@link CompanionReg.DeviceProps.AppVersion.verify|verify} messages.
2534
+ * @function encode
2535
+ * @memberof CompanionReg.DeviceProps.AppVersion
2536
+ * @static
2537
+ * @param {CompanionReg.DeviceProps.IAppVersion} message AppVersion message or plain object to encode
2538
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2539
+ * @returns {$protobuf.Writer} Writer
2540
+ */
2541
+ AppVersion.encode = function encode(message, writer) {
2542
+ if (!writer)
2543
+ writer = $Writer.create();
2544
+ if (message.primary != null && Object.hasOwnProperty.call(message, "primary"))
2545
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.primary);
2546
+ if (message.secondary != null && Object.hasOwnProperty.call(message, "secondary"))
2547
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.secondary);
2548
+ if (message.tertiary != null && Object.hasOwnProperty.call(message, "tertiary"))
2549
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.tertiary);
2550
+ if (message.quaternary != null && Object.hasOwnProperty.call(message, "quaternary"))
2551
+ writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.quaternary);
2552
+ if (message.quinary != null && Object.hasOwnProperty.call(message, "quinary"))
2553
+ writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.quinary);
2554
+ return writer;
2555
+ };
2556
+ /**
2557
+ * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link CompanionReg.DeviceProps.AppVersion.verify|verify} messages.
2558
+ * @function encodeDelimited
2559
+ * @memberof CompanionReg.DeviceProps.AppVersion
2560
+ * @static
2561
+ * @param {CompanionReg.DeviceProps.IAppVersion} message AppVersion message or plain object to encode
2562
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2563
+ * @returns {$protobuf.Writer} Writer
2564
+ */
2565
+ AppVersion.encodeDelimited = function encodeDelimited(message, writer) {
2566
+ return this.encode(message, writer).ldelim();
2567
+ };
2568
+ /**
2569
+ * Decodes an AppVersion message from the specified reader or buffer.
2570
+ * @function decode
2571
+ * @memberof CompanionReg.DeviceProps.AppVersion
2572
+ * @static
2573
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2574
+ * @param {number} [length] Message length if known beforehand
2575
+ * @returns {CompanionReg.DeviceProps.AppVersion} AppVersion
2576
+ * @throws {Error} If the payload is not a reader or valid buffer
2577
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2578
+ */
2579
+ AppVersion.decode = function decode(reader, length, error) {
2580
+ if (!(reader instanceof $Reader))
2581
+ reader = $Reader.create(reader);
2582
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.DeviceProps.AppVersion();
2583
+ while (reader.pos < end) {
2584
+ var tag = reader.uint32();
2585
+ if (tag === error)
2586
+ break;
2587
+ switch (tag >>> 3) {
2588
+ case 1: {
2589
+ message.primary = reader.uint32();
2590
+ break;
2591
+ }
2592
+ case 2: {
2593
+ message.secondary = reader.uint32();
2594
+ break;
2595
+ }
2596
+ case 3: {
2597
+ message.tertiary = reader.uint32();
2598
+ break;
2599
+ }
2600
+ case 4: {
2601
+ message.quaternary = reader.uint32();
2602
+ break;
2603
+ }
2604
+ case 5: {
2605
+ message.quinary = reader.uint32();
2606
+ break;
2607
+ }
2608
+ default:
2609
+ reader.skipType(tag & 7);
2610
+ break;
2611
+ }
2612
+ }
2613
+ return message;
2614
+ };
2615
+ /**
2616
+ * Decodes an AppVersion message from the specified reader or buffer, length delimited.
2617
+ * @function decodeDelimited
2618
+ * @memberof CompanionReg.DeviceProps.AppVersion
2619
+ * @static
2620
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2621
+ * @returns {CompanionReg.DeviceProps.AppVersion} AppVersion
2622
+ * @throws {Error} If the payload is not a reader or valid buffer
2623
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2624
+ */
2625
+ AppVersion.decodeDelimited = function decodeDelimited(reader) {
2626
+ if (!(reader instanceof $Reader))
2627
+ reader = new $Reader(reader);
2628
+ return this.decode(reader, reader.uint32());
2629
+ };
2630
+ /**
2631
+ * Verifies an AppVersion message.
2632
+ * @function verify
2633
+ * @memberof CompanionReg.DeviceProps.AppVersion
2634
+ * @static
2635
+ * @param {Object.<string,*>} message Plain object to verify
2636
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2637
+ */
2638
+ AppVersion.verify = function verify(message) {
2639
+ if (typeof message !== "object" || message === null)
2640
+ return "object expected";
2641
+ var properties = {};
2642
+ if (message.primary != null && message.hasOwnProperty("primary")) {
2643
+ properties._primary = 1;
2644
+ if (!$util.isInteger(message.primary))
2645
+ return "primary: integer expected";
2646
+ }
2647
+ if (message.secondary != null && message.hasOwnProperty("secondary")) {
2648
+ properties._secondary = 1;
2649
+ if (!$util.isInteger(message.secondary))
2650
+ return "secondary: integer expected";
2651
+ }
2652
+ if (message.tertiary != null && message.hasOwnProperty("tertiary")) {
2653
+ properties._tertiary = 1;
2654
+ if (!$util.isInteger(message.tertiary))
2655
+ return "tertiary: integer expected";
2656
+ }
2657
+ if (message.quaternary != null && message.hasOwnProperty("quaternary")) {
2658
+ properties._quaternary = 1;
2659
+ if (!$util.isInteger(message.quaternary))
2660
+ return "quaternary: integer expected";
2661
+ }
2662
+ if (message.quinary != null && message.hasOwnProperty("quinary")) {
2663
+ properties._quinary = 1;
2664
+ if (!$util.isInteger(message.quinary))
2665
+ return "quinary: integer expected";
2666
+ }
2667
+ return null;
2668
+ };
2669
+ /**
2670
+ * Creates an AppVersion message from a plain object. Also converts values to their respective internal types.
2671
+ * @function fromObject
2672
+ * @memberof CompanionReg.DeviceProps.AppVersion
2673
+ * @static
2674
+ * @param {Object.<string,*>} object Plain object
2675
+ * @returns {CompanionReg.DeviceProps.AppVersion} AppVersion
2676
+ */
2677
+ AppVersion.fromObject = function fromObject(object) {
2678
+ if (object instanceof $root.CompanionReg.DeviceProps.AppVersion)
2679
+ return object;
2680
+ var message = new $root.CompanionReg.DeviceProps.AppVersion();
2681
+ if (object.primary != null)
2682
+ message.primary = object.primary >>> 0;
2683
+ if (object.secondary != null)
2684
+ message.secondary = object.secondary >>> 0;
2685
+ if (object.tertiary != null)
2686
+ message.tertiary = object.tertiary >>> 0;
2687
+ if (object.quaternary != null)
2688
+ message.quaternary = object.quaternary >>> 0;
2689
+ if (object.quinary != null)
2690
+ message.quinary = object.quinary >>> 0;
2691
+ return message;
2692
+ };
2693
+ /**
2694
+ * Creates a plain object from an AppVersion message. Also converts values to other types if specified.
2695
+ * @function toObject
2696
+ * @memberof CompanionReg.DeviceProps.AppVersion
2697
+ * @static
2698
+ * @param {CompanionReg.DeviceProps.AppVersion} message AppVersion
2699
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2700
+ * @returns {Object.<string,*>} Plain object
2701
+ */
2702
+ AppVersion.toObject = function toObject(message, options) {
2703
+ if (!options)
2704
+ options = {};
2705
+ var object = {};
2706
+ if (message.primary != null && message.hasOwnProperty("primary")) {
2707
+ object.primary = message.primary;
2708
+ if (options.oneofs)
2709
+ object._primary = "primary";
2710
+ }
2711
+ if (message.secondary != null && message.hasOwnProperty("secondary")) {
2712
+ object.secondary = message.secondary;
2713
+ if (options.oneofs)
2714
+ object._secondary = "secondary";
2715
+ }
2716
+ if (message.tertiary != null && message.hasOwnProperty("tertiary")) {
2717
+ object.tertiary = message.tertiary;
2718
+ if (options.oneofs)
2719
+ object._tertiary = "tertiary";
2720
+ }
2721
+ if (message.quaternary != null && message.hasOwnProperty("quaternary")) {
2722
+ object.quaternary = message.quaternary;
2723
+ if (options.oneofs)
2724
+ object._quaternary = "quaternary";
2725
+ }
2726
+ if (message.quinary != null && message.hasOwnProperty("quinary")) {
2727
+ object.quinary = message.quinary;
2728
+ if (options.oneofs)
2729
+ object._quinary = "quinary";
2730
+ }
2731
+ return object;
2732
+ };
2733
+ /**
2734
+ * Converts this AppVersion to JSON.
2735
+ * @function toJSON
2736
+ * @memberof CompanionReg.DeviceProps.AppVersion
2737
+ * @instance
2738
+ * @returns {Object.<string,*>} JSON object
2739
+ */
2740
+ AppVersion.prototype.toJSON = function toJSON() {
2741
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2742
+ };
2743
+ /**
2744
+ * Gets the default type url for AppVersion
2745
+ * @function getTypeUrl
2746
+ * @memberof CompanionReg.DeviceProps.AppVersion
2747
+ * @static
2748
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2749
+ * @returns {string} The default type url
2750
+ */
2751
+ AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2752
+ if (typeUrlPrefix === undefined) {
2753
+ typeUrlPrefix = "type.googleapis.com";
2754
+ }
2755
+ return typeUrlPrefix + "/CompanionReg.DeviceProps.AppVersion";
2756
+ };
2757
+ return AppVersion;
2758
+ })();
2759
+ DeviceProps.HistorySyncConfig = (function() {
2760
+ /**
2761
+ * Properties of a HistorySyncConfig.
2762
+ * @memberof CompanionReg.DeviceProps
2763
+ * @interface IHistorySyncConfig
2764
+ * @property {number|null} [fullSyncDaysLimit] HistorySyncConfig fullSyncDaysLimit
2765
+ * @property {number|null} [fullSyncSizeMbLimit] HistorySyncConfig fullSyncSizeMbLimit
2766
+ * @property {number|null} [storageQuotaMb] HistorySyncConfig storageQuotaMb
2767
+ * @property {boolean|null} [inlineInitialPayloadInE2EeMsg] HistorySyncConfig inlineInitialPayloadInE2EeMsg
2768
+ * @property {number|null} [recentSyncDaysLimit] HistorySyncConfig recentSyncDaysLimit
2769
+ * @property {boolean|null} [supportCallLogHistory] HistorySyncConfig supportCallLogHistory
2770
+ * @property {boolean|null} [supportBotUserAgentChatHistory] HistorySyncConfig supportBotUserAgentChatHistory
2771
+ * @property {boolean|null} [supportCagReactionsAndPolls] HistorySyncConfig supportCagReactionsAndPolls
2772
+ * @property {boolean|null} [supportBizHostedMsg] HistorySyncConfig supportBizHostedMsg
2773
+ * @property {boolean|null} [supportRecentSyncChunkMessageCountTuning] HistorySyncConfig supportRecentSyncChunkMessageCountTuning
2774
+ * @property {boolean|null} [supportHostedGroupMsg] HistorySyncConfig supportHostedGroupMsg
2775
+ * @property {boolean|null} [supportFbidBotChatHistory] HistorySyncConfig supportFbidBotChatHistory
2776
+ * @property {boolean|null} [supportAddOnHistorySyncMigration] HistorySyncConfig supportAddOnHistorySyncMigration
2777
+ * @property {boolean|null} [supportMessageAssociation] HistorySyncConfig supportMessageAssociation
2778
+ */
2779
+ /**
2780
+ * Constructs a new HistorySyncConfig.
2781
+ * @memberof CompanionReg.DeviceProps
2782
+ * @classdesc Represents a HistorySyncConfig.
2783
+ * @implements IHistorySyncConfig
2784
+ * @constructor
2785
+ * @param {CompanionReg.DeviceProps.IHistorySyncConfig=} [properties] Properties to set
2786
+ */
2787
+ function HistorySyncConfig(properties) {
2788
+ if (properties)
2789
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2790
+ if (properties[keys[i]] != null)
2791
+ this[keys[i]] = properties[keys[i]];
2792
+ }
2793
+ /**
2794
+ * HistorySyncConfig fullSyncDaysLimit.
2795
+ * @member {number|null|undefined} fullSyncDaysLimit
2796
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2797
+ * @instance
2798
+ */
2799
+ HistorySyncConfig.prototype.fullSyncDaysLimit = null;
2800
+ /**
2801
+ * HistorySyncConfig fullSyncSizeMbLimit.
2802
+ * @member {number|null|undefined} fullSyncSizeMbLimit
2803
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2804
+ * @instance
2805
+ */
2806
+ HistorySyncConfig.prototype.fullSyncSizeMbLimit = null;
2807
+ /**
2808
+ * HistorySyncConfig storageQuotaMb.
2809
+ * @member {number|null|undefined} storageQuotaMb
2810
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2811
+ * @instance
2812
+ */
2813
+ HistorySyncConfig.prototype.storageQuotaMb = null;
2814
+ /**
2815
+ * HistorySyncConfig inlineInitialPayloadInE2EeMsg.
2816
+ * @member {boolean|null|undefined} inlineInitialPayloadInE2EeMsg
2817
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2818
+ * @instance
2819
+ */
2820
+ HistorySyncConfig.prototype.inlineInitialPayloadInE2EeMsg = null;
2821
+ /**
2822
+ * HistorySyncConfig recentSyncDaysLimit.
2823
+ * @member {number|null|undefined} recentSyncDaysLimit
2824
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2825
+ * @instance
2826
+ */
2827
+ HistorySyncConfig.prototype.recentSyncDaysLimit = null;
2828
+ /**
2829
+ * HistorySyncConfig supportCallLogHistory.
2830
+ * @member {boolean|null|undefined} supportCallLogHistory
2831
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2832
+ * @instance
2833
+ */
2834
+ HistorySyncConfig.prototype.supportCallLogHistory = null;
2835
+ /**
2836
+ * HistorySyncConfig supportBotUserAgentChatHistory.
2837
+ * @member {boolean|null|undefined} supportBotUserAgentChatHistory
2838
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2839
+ * @instance
2840
+ */
2841
+ HistorySyncConfig.prototype.supportBotUserAgentChatHistory = null;
2842
+ /**
2843
+ * HistorySyncConfig supportCagReactionsAndPolls.
2844
+ * @member {boolean|null|undefined} supportCagReactionsAndPolls
2845
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2846
+ * @instance
2847
+ */
2848
+ HistorySyncConfig.prototype.supportCagReactionsAndPolls = null;
2849
+ /**
2850
+ * HistorySyncConfig supportBizHostedMsg.
2851
+ * @member {boolean|null|undefined} supportBizHostedMsg
2852
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2853
+ * @instance
2854
+ */
2855
+ HistorySyncConfig.prototype.supportBizHostedMsg = null;
2856
+ /**
2857
+ * HistorySyncConfig supportRecentSyncChunkMessageCountTuning.
2858
+ * @member {boolean|null|undefined} supportRecentSyncChunkMessageCountTuning
2859
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2860
+ * @instance
2861
+ */
2862
+ HistorySyncConfig.prototype.supportRecentSyncChunkMessageCountTuning = null;
2863
+ /**
2864
+ * HistorySyncConfig supportHostedGroupMsg.
2865
+ * @member {boolean|null|undefined} supportHostedGroupMsg
2866
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2867
+ * @instance
2868
+ */
2869
+ HistorySyncConfig.prototype.supportHostedGroupMsg = null;
2870
+ /**
2871
+ * HistorySyncConfig supportFbidBotChatHistory.
2872
+ * @member {boolean|null|undefined} supportFbidBotChatHistory
2873
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2874
+ * @instance
2875
+ */
2876
+ HistorySyncConfig.prototype.supportFbidBotChatHistory = null;
2877
+ /**
2878
+ * HistorySyncConfig supportAddOnHistorySyncMigration.
2879
+ * @member {boolean|null|undefined} supportAddOnHistorySyncMigration
2880
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2881
+ * @instance
2882
+ */
2883
+ HistorySyncConfig.prototype.supportAddOnHistorySyncMigration = null;
2884
+ /**
2885
+ * HistorySyncConfig supportMessageAssociation.
2886
+ * @member {boolean|null|undefined} supportMessageAssociation
2887
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2888
+ * @instance
2889
+ */
2890
+ HistorySyncConfig.prototype.supportMessageAssociation = null;
2891
+ // OneOf field names bound to virtual getters and setters
2892
+ var $oneOfFields;
2893
+ /**
2894
+ * HistorySyncConfig _fullSyncDaysLimit.
2895
+ * @member {"fullSyncDaysLimit"|undefined} _fullSyncDaysLimit
2896
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2897
+ * @instance
2898
+ */
2899
+ Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncDaysLimit", {
2900
+ get: $util.oneOfGetter($oneOfFields = ["fullSyncDaysLimit"]),
2901
+ set: $util.oneOfSetter($oneOfFields)
2902
+ });
2903
+ /**
2904
+ * HistorySyncConfig _fullSyncSizeMbLimit.
2905
+ * @member {"fullSyncSizeMbLimit"|undefined} _fullSyncSizeMbLimit
2906
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2907
+ * @instance
2908
+ */
2909
+ Object.defineProperty(HistorySyncConfig.prototype, "_fullSyncSizeMbLimit", {
2910
+ get: $util.oneOfGetter($oneOfFields = ["fullSyncSizeMbLimit"]),
2911
+ set: $util.oneOfSetter($oneOfFields)
2912
+ });
2913
+ /**
2914
+ * HistorySyncConfig _storageQuotaMb.
2915
+ * @member {"storageQuotaMb"|undefined} _storageQuotaMb
2916
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2917
+ * @instance
2918
+ */
2919
+ Object.defineProperty(HistorySyncConfig.prototype, "_storageQuotaMb", {
2920
+ get: $util.oneOfGetter($oneOfFields = ["storageQuotaMb"]),
2921
+ set: $util.oneOfSetter($oneOfFields)
2922
+ });
2923
+ /**
2924
+ * HistorySyncConfig _inlineInitialPayloadInE2EeMsg.
2925
+ * @member {"inlineInitialPayloadInE2EeMsg"|undefined} _inlineInitialPayloadInE2EeMsg
2926
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2927
+ * @instance
2928
+ */
2929
+ Object.defineProperty(HistorySyncConfig.prototype, "_inlineInitialPayloadInE2EeMsg", {
2930
+ get: $util.oneOfGetter($oneOfFields = ["inlineInitialPayloadInE2EeMsg"]),
2931
+ set: $util.oneOfSetter($oneOfFields)
2932
+ });
2933
+ /**
2934
+ * HistorySyncConfig _recentSyncDaysLimit.
2935
+ * @member {"recentSyncDaysLimit"|undefined} _recentSyncDaysLimit
2936
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2937
+ * @instance
2938
+ */
2939
+ Object.defineProperty(HistorySyncConfig.prototype, "_recentSyncDaysLimit", {
2940
+ get: $util.oneOfGetter($oneOfFields = ["recentSyncDaysLimit"]),
2941
+ set: $util.oneOfSetter($oneOfFields)
2942
+ });
2943
+ /**
2944
+ * HistorySyncConfig _supportCallLogHistory.
2945
+ * @member {"supportCallLogHistory"|undefined} _supportCallLogHistory
2946
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2947
+ * @instance
2948
+ */
2949
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportCallLogHistory", {
2950
+ get: $util.oneOfGetter($oneOfFields = ["supportCallLogHistory"]),
2951
+ set: $util.oneOfSetter($oneOfFields)
2952
+ });
2953
+ /**
2954
+ * HistorySyncConfig _supportBotUserAgentChatHistory.
2955
+ * @member {"supportBotUserAgentChatHistory"|undefined} _supportBotUserAgentChatHistory
2956
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2957
+ * @instance
2958
+ */
2959
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportBotUserAgentChatHistory", {
2960
+ get: $util.oneOfGetter($oneOfFields = ["supportBotUserAgentChatHistory"]),
2961
+ set: $util.oneOfSetter($oneOfFields)
2962
+ });
2963
+ /**
2964
+ * HistorySyncConfig _supportCagReactionsAndPolls.
2965
+ * @member {"supportCagReactionsAndPolls"|undefined} _supportCagReactionsAndPolls
2966
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2967
+ * @instance
2968
+ */
2969
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportCagReactionsAndPolls", {
2970
+ get: $util.oneOfGetter($oneOfFields = ["supportCagReactionsAndPolls"]),
2971
+ set: $util.oneOfSetter($oneOfFields)
2972
+ });
2973
+ /**
2974
+ * HistorySyncConfig _supportBizHostedMsg.
2975
+ * @member {"supportBizHostedMsg"|undefined} _supportBizHostedMsg
2976
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2977
+ * @instance
2978
+ */
2979
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportBizHostedMsg", {
2980
+ get: $util.oneOfGetter($oneOfFields = ["supportBizHostedMsg"]),
2981
+ set: $util.oneOfSetter($oneOfFields)
2982
+ });
2983
+ /**
2984
+ * HistorySyncConfig _supportRecentSyncChunkMessageCountTuning.
2985
+ * @member {"supportRecentSyncChunkMessageCountTuning"|undefined} _supportRecentSyncChunkMessageCountTuning
2986
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2987
+ * @instance
2988
+ */
2989
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportRecentSyncChunkMessageCountTuning", {
2990
+ get: $util.oneOfGetter($oneOfFields = ["supportRecentSyncChunkMessageCountTuning"]),
2991
+ set: $util.oneOfSetter($oneOfFields)
2992
+ });
2993
+ /**
2994
+ * HistorySyncConfig _supportHostedGroupMsg.
2995
+ * @member {"supportHostedGroupMsg"|undefined} _supportHostedGroupMsg
2996
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
2997
+ * @instance
2998
+ */
2999
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportHostedGroupMsg", {
3000
+ get: $util.oneOfGetter($oneOfFields = ["supportHostedGroupMsg"]),
3001
+ set: $util.oneOfSetter($oneOfFields)
3002
+ });
3003
+ /**
3004
+ * HistorySyncConfig _supportFbidBotChatHistory.
3005
+ * @member {"supportFbidBotChatHistory"|undefined} _supportFbidBotChatHistory
3006
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3007
+ * @instance
3008
+ */
3009
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportFbidBotChatHistory", {
3010
+ get: $util.oneOfGetter($oneOfFields = ["supportFbidBotChatHistory"]),
3011
+ set: $util.oneOfSetter($oneOfFields)
3012
+ });
3013
+ /**
3014
+ * HistorySyncConfig _supportAddOnHistorySyncMigration.
3015
+ * @member {"supportAddOnHistorySyncMigration"|undefined} _supportAddOnHistorySyncMigration
3016
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3017
+ * @instance
3018
+ */
3019
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportAddOnHistorySyncMigration", {
3020
+ get: $util.oneOfGetter($oneOfFields = ["supportAddOnHistorySyncMigration"]),
3021
+ set: $util.oneOfSetter($oneOfFields)
3022
+ });
3023
+ /**
3024
+ * HistorySyncConfig _supportMessageAssociation.
3025
+ * @member {"supportMessageAssociation"|undefined} _supportMessageAssociation
3026
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3027
+ * @instance
3028
+ */
3029
+ Object.defineProperty(HistorySyncConfig.prototype, "_supportMessageAssociation", {
3030
+ get: $util.oneOfGetter($oneOfFields = ["supportMessageAssociation"]),
3031
+ set: $util.oneOfSetter($oneOfFields)
3032
+ });
3033
+ /**
3034
+ * Creates a new HistorySyncConfig instance using the specified properties.
3035
+ * @function create
3036
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3037
+ * @static
3038
+ * @param {CompanionReg.DeviceProps.IHistorySyncConfig=} [properties] Properties to set
3039
+ * @returns {CompanionReg.DeviceProps.HistorySyncConfig} HistorySyncConfig instance
3040
+ */
3041
+ HistorySyncConfig.create = function create(properties) {
3042
+ return new HistorySyncConfig(properties);
3043
+ };
3044
+ /**
3045
+ * Encodes the specified HistorySyncConfig message. Does not implicitly {@link CompanionReg.DeviceProps.HistorySyncConfig.verify|verify} messages.
3046
+ * @function encode
3047
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3048
+ * @static
3049
+ * @param {CompanionReg.DeviceProps.IHistorySyncConfig} message HistorySyncConfig message or plain object to encode
3050
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3051
+ * @returns {$protobuf.Writer} Writer
3052
+ */
3053
+ HistorySyncConfig.encode = function encode(message, writer) {
3054
+ if (!writer)
3055
+ writer = $Writer.create();
3056
+ if (message.fullSyncDaysLimit != null && Object.hasOwnProperty.call(message, "fullSyncDaysLimit"))
3057
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.fullSyncDaysLimit);
3058
+ if (message.fullSyncSizeMbLimit != null && Object.hasOwnProperty.call(message, "fullSyncSizeMbLimit"))
3059
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.fullSyncSizeMbLimit);
3060
+ if (message.storageQuotaMb != null && Object.hasOwnProperty.call(message, "storageQuotaMb"))
3061
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.storageQuotaMb);
3062
+ if (message.inlineInitialPayloadInE2EeMsg != null && Object.hasOwnProperty.call(message, "inlineInitialPayloadInE2EeMsg"))
3063
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.inlineInitialPayloadInE2EeMsg);
3064
+ if (message.recentSyncDaysLimit != null && Object.hasOwnProperty.call(message, "recentSyncDaysLimit"))
3065
+ writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.recentSyncDaysLimit);
3066
+ if (message.supportCallLogHistory != null && Object.hasOwnProperty.call(message, "supportCallLogHistory"))
3067
+ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.supportCallLogHistory);
3068
+ if (message.supportBotUserAgentChatHistory != null && Object.hasOwnProperty.call(message, "supportBotUserAgentChatHistory"))
3069
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.supportBotUserAgentChatHistory);
3070
+ if (message.supportCagReactionsAndPolls != null && Object.hasOwnProperty.call(message, "supportCagReactionsAndPolls"))
3071
+ writer.uint32(/* id 8, wireType 0 =*/64).bool(message.supportCagReactionsAndPolls);
3072
+ if (message.supportBizHostedMsg != null && Object.hasOwnProperty.call(message, "supportBizHostedMsg"))
3073
+ writer.uint32(/* id 9, wireType 0 =*/72).bool(message.supportBizHostedMsg);
3074
+ if (message.supportRecentSyncChunkMessageCountTuning != null && Object.hasOwnProperty.call(message, "supportRecentSyncChunkMessageCountTuning"))
3075
+ writer.uint32(/* id 10, wireType 0 =*/80).bool(message.supportRecentSyncChunkMessageCountTuning);
3076
+ if (message.supportHostedGroupMsg != null && Object.hasOwnProperty.call(message, "supportHostedGroupMsg"))
3077
+ writer.uint32(/* id 11, wireType 0 =*/88).bool(message.supportHostedGroupMsg);
3078
+ if (message.supportFbidBotChatHistory != null && Object.hasOwnProperty.call(message, "supportFbidBotChatHistory"))
3079
+ writer.uint32(/* id 12, wireType 0 =*/96).bool(message.supportFbidBotChatHistory);
3080
+ if (message.supportAddOnHistorySyncMigration != null && Object.hasOwnProperty.call(message, "supportAddOnHistorySyncMigration"))
3081
+ writer.uint32(/* id 13, wireType 0 =*/104).bool(message.supportAddOnHistorySyncMigration);
3082
+ if (message.supportMessageAssociation != null && Object.hasOwnProperty.call(message, "supportMessageAssociation"))
3083
+ writer.uint32(/* id 14, wireType 0 =*/112).bool(message.supportMessageAssociation);
3084
+ return writer;
3085
+ };
3086
+ /**
3087
+ * Encodes the specified HistorySyncConfig message, length delimited. Does not implicitly {@link CompanionReg.DeviceProps.HistorySyncConfig.verify|verify} messages.
3088
+ * @function encodeDelimited
3089
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3090
+ * @static
3091
+ * @param {CompanionReg.DeviceProps.IHistorySyncConfig} message HistorySyncConfig message or plain object to encode
3092
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3093
+ * @returns {$protobuf.Writer} Writer
3094
+ */
3095
+ HistorySyncConfig.encodeDelimited = function encodeDelimited(message, writer) {
3096
+ return this.encode(message, writer).ldelim();
3097
+ };
3098
+ /**
3099
+ * Decodes a HistorySyncConfig message from the specified reader or buffer.
3100
+ * @function decode
3101
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3102
+ * @static
3103
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3104
+ * @param {number} [length] Message length if known beforehand
3105
+ * @returns {CompanionReg.DeviceProps.HistorySyncConfig} HistorySyncConfig
3106
+ * @throws {Error} If the payload is not a reader or valid buffer
3107
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3108
+ */
3109
+ HistorySyncConfig.decode = function decode(reader, length, error) {
3110
+ if (!(reader instanceof $Reader))
3111
+ reader = $Reader.create(reader);
3112
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CompanionReg.DeviceProps.HistorySyncConfig();
3113
+ while (reader.pos < end) {
3114
+ var tag = reader.uint32();
3115
+ if (tag === error)
3116
+ break;
3117
+ switch (tag >>> 3) {
3118
+ case 1: {
3119
+ message.fullSyncDaysLimit = reader.uint32();
3120
+ break;
3121
+ }
3122
+ case 2: {
3123
+ message.fullSyncSizeMbLimit = reader.uint32();
3124
+ break;
3125
+ }
3126
+ case 3: {
3127
+ message.storageQuotaMb = reader.uint32();
3128
+ break;
3129
+ }
3130
+ case 4: {
3131
+ message.inlineInitialPayloadInE2EeMsg = reader.bool();
3132
+ break;
3133
+ }
3134
+ case 5: {
3135
+ message.recentSyncDaysLimit = reader.uint32();
3136
+ break;
3137
+ }
3138
+ case 6: {
3139
+ message.supportCallLogHistory = reader.bool();
3140
+ break;
3141
+ }
3142
+ case 7: {
3143
+ message.supportBotUserAgentChatHistory = reader.bool();
3144
+ break;
3145
+ }
3146
+ case 8: {
3147
+ message.supportCagReactionsAndPolls = reader.bool();
3148
+ break;
3149
+ }
3150
+ case 9: {
3151
+ message.supportBizHostedMsg = reader.bool();
3152
+ break;
3153
+ }
3154
+ case 10: {
3155
+ message.supportRecentSyncChunkMessageCountTuning = reader.bool();
3156
+ break;
3157
+ }
3158
+ case 11: {
3159
+ message.supportHostedGroupMsg = reader.bool();
3160
+ break;
3161
+ }
3162
+ case 12: {
3163
+ message.supportFbidBotChatHistory = reader.bool();
3164
+ break;
3165
+ }
3166
+ case 13: {
3167
+ message.supportAddOnHistorySyncMigration = reader.bool();
3168
+ break;
3169
+ }
3170
+ case 14: {
3171
+ message.supportMessageAssociation = reader.bool();
3172
+ break;
3173
+ }
3174
+ default:
3175
+ reader.skipType(tag & 7);
3176
+ break;
3177
+ }
3178
+ }
3179
+ return message;
3180
+ };
3181
+ /**
3182
+ * Decodes a HistorySyncConfig message from the specified reader or buffer, length delimited.
3183
+ * @function decodeDelimited
3184
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3185
+ * @static
3186
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3187
+ * @returns {CompanionReg.DeviceProps.HistorySyncConfig} HistorySyncConfig
3188
+ * @throws {Error} If the payload is not a reader or valid buffer
3189
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3190
+ */
3191
+ HistorySyncConfig.decodeDelimited = function decodeDelimited(reader) {
3192
+ if (!(reader instanceof $Reader))
3193
+ reader = new $Reader(reader);
3194
+ return this.decode(reader, reader.uint32());
3195
+ };
3196
+ /**
3197
+ * Verifies a HistorySyncConfig message.
3198
+ * @function verify
3199
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3200
+ * @static
3201
+ * @param {Object.<string,*>} message Plain object to verify
3202
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3203
+ */
3204
+ HistorySyncConfig.verify = function verify(message) {
3205
+ if (typeof message !== "object" || message === null)
3206
+ return "object expected";
3207
+ var properties = {};
3208
+ if (message.fullSyncDaysLimit != null && message.hasOwnProperty("fullSyncDaysLimit")) {
3209
+ properties._fullSyncDaysLimit = 1;
3210
+ if (!$util.isInteger(message.fullSyncDaysLimit))
3211
+ return "fullSyncDaysLimit: integer expected";
3212
+ }
3213
+ if (message.fullSyncSizeMbLimit != null && message.hasOwnProperty("fullSyncSizeMbLimit")) {
3214
+ properties._fullSyncSizeMbLimit = 1;
3215
+ if (!$util.isInteger(message.fullSyncSizeMbLimit))
3216
+ return "fullSyncSizeMbLimit: integer expected";
3217
+ }
3218
+ if (message.storageQuotaMb != null && message.hasOwnProperty("storageQuotaMb")) {
3219
+ properties._storageQuotaMb = 1;
3220
+ if (!$util.isInteger(message.storageQuotaMb))
3221
+ return "storageQuotaMb: integer expected";
3222
+ }
3223
+ if (message.inlineInitialPayloadInE2EeMsg != null && message.hasOwnProperty("inlineInitialPayloadInE2EeMsg")) {
3224
+ properties._inlineInitialPayloadInE2EeMsg = 1;
3225
+ if (typeof message.inlineInitialPayloadInE2EeMsg !== "boolean")
3226
+ return "inlineInitialPayloadInE2EeMsg: boolean expected";
3227
+ }
3228
+ if (message.recentSyncDaysLimit != null && message.hasOwnProperty("recentSyncDaysLimit")) {
3229
+ properties._recentSyncDaysLimit = 1;
3230
+ if (!$util.isInteger(message.recentSyncDaysLimit))
3231
+ return "recentSyncDaysLimit: integer expected";
3232
+ }
3233
+ if (message.supportCallLogHistory != null && message.hasOwnProperty("supportCallLogHistory")) {
3234
+ properties._supportCallLogHistory = 1;
3235
+ if (typeof message.supportCallLogHistory !== "boolean")
3236
+ return "supportCallLogHistory: boolean expected";
3237
+ }
3238
+ if (message.supportBotUserAgentChatHistory != null && message.hasOwnProperty("supportBotUserAgentChatHistory")) {
3239
+ properties._supportBotUserAgentChatHistory = 1;
3240
+ if (typeof message.supportBotUserAgentChatHistory !== "boolean")
3241
+ return "supportBotUserAgentChatHistory: boolean expected";
3242
+ }
3243
+ if (message.supportCagReactionsAndPolls != null && message.hasOwnProperty("supportCagReactionsAndPolls")) {
3244
+ properties._supportCagReactionsAndPolls = 1;
3245
+ if (typeof message.supportCagReactionsAndPolls !== "boolean")
3246
+ return "supportCagReactionsAndPolls: boolean expected";
3247
+ }
3248
+ if (message.supportBizHostedMsg != null && message.hasOwnProperty("supportBizHostedMsg")) {
3249
+ properties._supportBizHostedMsg = 1;
3250
+ if (typeof message.supportBizHostedMsg !== "boolean")
3251
+ return "supportBizHostedMsg: boolean expected";
3252
+ }
3253
+ if (message.supportRecentSyncChunkMessageCountTuning != null && message.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")) {
3254
+ properties._supportRecentSyncChunkMessageCountTuning = 1;
3255
+ if (typeof message.supportRecentSyncChunkMessageCountTuning !== "boolean")
3256
+ return "supportRecentSyncChunkMessageCountTuning: boolean expected";
3257
+ }
3258
+ if (message.supportHostedGroupMsg != null && message.hasOwnProperty("supportHostedGroupMsg")) {
3259
+ properties._supportHostedGroupMsg = 1;
3260
+ if (typeof message.supportHostedGroupMsg !== "boolean")
3261
+ return "supportHostedGroupMsg: boolean expected";
3262
+ }
3263
+ if (message.supportFbidBotChatHistory != null && message.hasOwnProperty("supportFbidBotChatHistory")) {
3264
+ properties._supportFbidBotChatHistory = 1;
3265
+ if (typeof message.supportFbidBotChatHistory !== "boolean")
3266
+ return "supportFbidBotChatHistory: boolean expected";
3267
+ }
3268
+ if (message.supportAddOnHistorySyncMigration != null && message.hasOwnProperty("supportAddOnHistorySyncMigration")) {
3269
+ properties._supportAddOnHistorySyncMigration = 1;
3270
+ if (typeof message.supportAddOnHistorySyncMigration !== "boolean")
3271
+ return "supportAddOnHistorySyncMigration: boolean expected";
3272
+ }
3273
+ if (message.supportMessageAssociation != null && message.hasOwnProperty("supportMessageAssociation")) {
3274
+ properties._supportMessageAssociation = 1;
3275
+ if (typeof message.supportMessageAssociation !== "boolean")
3276
+ return "supportMessageAssociation: boolean expected";
3277
+ }
3278
+ return null;
3279
+ };
3280
+ /**
3281
+ * Creates a HistorySyncConfig message from a plain object. Also converts values to their respective internal types.
3282
+ * @function fromObject
3283
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3284
+ * @static
3285
+ * @param {Object.<string,*>} object Plain object
3286
+ * @returns {CompanionReg.DeviceProps.HistorySyncConfig} HistorySyncConfig
3287
+ */
3288
+ HistorySyncConfig.fromObject = function fromObject(object) {
3289
+ if (object instanceof $root.CompanionReg.DeviceProps.HistorySyncConfig)
3290
+ return object;
3291
+ var message = new $root.CompanionReg.DeviceProps.HistorySyncConfig();
3292
+ if (object.fullSyncDaysLimit != null)
3293
+ message.fullSyncDaysLimit = object.fullSyncDaysLimit >>> 0;
3294
+ if (object.fullSyncSizeMbLimit != null)
3295
+ message.fullSyncSizeMbLimit = object.fullSyncSizeMbLimit >>> 0;
3296
+ if (object.storageQuotaMb != null)
3297
+ message.storageQuotaMb = object.storageQuotaMb >>> 0;
3298
+ if (object.inlineInitialPayloadInE2EeMsg != null)
3299
+ message.inlineInitialPayloadInE2EeMsg = Boolean(object.inlineInitialPayloadInE2EeMsg);
3300
+ if (object.recentSyncDaysLimit != null)
3301
+ message.recentSyncDaysLimit = object.recentSyncDaysLimit >>> 0;
3302
+ if (object.supportCallLogHistory != null)
3303
+ message.supportCallLogHistory = Boolean(object.supportCallLogHistory);
3304
+ if (object.supportBotUserAgentChatHistory != null)
3305
+ message.supportBotUserAgentChatHistory = Boolean(object.supportBotUserAgentChatHistory);
3306
+ if (object.supportCagReactionsAndPolls != null)
3307
+ message.supportCagReactionsAndPolls = Boolean(object.supportCagReactionsAndPolls);
3308
+ if (object.supportBizHostedMsg != null)
3309
+ message.supportBizHostedMsg = Boolean(object.supportBizHostedMsg);
3310
+ if (object.supportRecentSyncChunkMessageCountTuning != null)
3311
+ message.supportRecentSyncChunkMessageCountTuning = Boolean(object.supportRecentSyncChunkMessageCountTuning);
3312
+ if (object.supportHostedGroupMsg != null)
3313
+ message.supportHostedGroupMsg = Boolean(object.supportHostedGroupMsg);
3314
+ if (object.supportFbidBotChatHistory != null)
3315
+ message.supportFbidBotChatHistory = Boolean(object.supportFbidBotChatHistory);
3316
+ if (object.supportAddOnHistorySyncMigration != null)
3317
+ message.supportAddOnHistorySyncMigration = Boolean(object.supportAddOnHistorySyncMigration);
3318
+ if (object.supportMessageAssociation != null)
3319
+ message.supportMessageAssociation = Boolean(object.supportMessageAssociation);
3320
+ return message;
3321
+ };
3322
+ /**
3323
+ * Creates a plain object from a HistorySyncConfig message. Also converts values to other types if specified.
3324
+ * @function toObject
3325
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3326
+ * @static
3327
+ * @param {CompanionReg.DeviceProps.HistorySyncConfig} message HistorySyncConfig
3328
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3329
+ * @returns {Object.<string,*>} Plain object
3330
+ */
3331
+ HistorySyncConfig.toObject = function toObject(message, options) {
3332
+ if (!options)
3333
+ options = {};
3334
+ var object = {};
3335
+ if (message.fullSyncDaysLimit != null && message.hasOwnProperty("fullSyncDaysLimit")) {
3336
+ object.fullSyncDaysLimit = message.fullSyncDaysLimit;
3337
+ if (options.oneofs)
3338
+ object._fullSyncDaysLimit = "fullSyncDaysLimit";
3339
+ }
3340
+ if (message.fullSyncSizeMbLimit != null && message.hasOwnProperty("fullSyncSizeMbLimit")) {
3341
+ object.fullSyncSizeMbLimit = message.fullSyncSizeMbLimit;
3342
+ if (options.oneofs)
3343
+ object._fullSyncSizeMbLimit = "fullSyncSizeMbLimit";
3344
+ }
3345
+ if (message.storageQuotaMb != null && message.hasOwnProperty("storageQuotaMb")) {
3346
+ object.storageQuotaMb = message.storageQuotaMb;
3347
+ if (options.oneofs)
3348
+ object._storageQuotaMb = "storageQuotaMb";
3349
+ }
3350
+ if (message.inlineInitialPayloadInE2EeMsg != null && message.hasOwnProperty("inlineInitialPayloadInE2EeMsg")) {
3351
+ object.inlineInitialPayloadInE2EeMsg = message.inlineInitialPayloadInE2EeMsg;
3352
+ if (options.oneofs)
3353
+ object._inlineInitialPayloadInE2EeMsg = "inlineInitialPayloadInE2EeMsg";
3354
+ }
3355
+ if (message.recentSyncDaysLimit != null && message.hasOwnProperty("recentSyncDaysLimit")) {
3356
+ object.recentSyncDaysLimit = message.recentSyncDaysLimit;
3357
+ if (options.oneofs)
3358
+ object._recentSyncDaysLimit = "recentSyncDaysLimit";
3359
+ }
3360
+ if (message.supportCallLogHistory != null && message.hasOwnProperty("supportCallLogHistory")) {
3361
+ object.supportCallLogHistory = message.supportCallLogHistory;
3362
+ if (options.oneofs)
3363
+ object._supportCallLogHistory = "supportCallLogHistory";
3364
+ }
3365
+ if (message.supportBotUserAgentChatHistory != null && message.hasOwnProperty("supportBotUserAgentChatHistory")) {
3366
+ object.supportBotUserAgentChatHistory = message.supportBotUserAgentChatHistory;
3367
+ if (options.oneofs)
3368
+ object._supportBotUserAgentChatHistory = "supportBotUserAgentChatHistory";
3369
+ }
3370
+ if (message.supportCagReactionsAndPolls != null && message.hasOwnProperty("supportCagReactionsAndPolls")) {
3371
+ object.supportCagReactionsAndPolls = message.supportCagReactionsAndPolls;
3372
+ if (options.oneofs)
3373
+ object._supportCagReactionsAndPolls = "supportCagReactionsAndPolls";
3374
+ }
3375
+ if (message.supportBizHostedMsg != null && message.hasOwnProperty("supportBizHostedMsg")) {
3376
+ object.supportBizHostedMsg = message.supportBizHostedMsg;
3377
+ if (options.oneofs)
3378
+ object._supportBizHostedMsg = "supportBizHostedMsg";
3379
+ }
3380
+ if (message.supportRecentSyncChunkMessageCountTuning != null && message.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")) {
3381
+ object.supportRecentSyncChunkMessageCountTuning = message.supportRecentSyncChunkMessageCountTuning;
3382
+ if (options.oneofs)
3383
+ object._supportRecentSyncChunkMessageCountTuning = "supportRecentSyncChunkMessageCountTuning";
3384
+ }
3385
+ if (message.supportHostedGroupMsg != null && message.hasOwnProperty("supportHostedGroupMsg")) {
3386
+ object.supportHostedGroupMsg = message.supportHostedGroupMsg;
3387
+ if (options.oneofs)
3388
+ object._supportHostedGroupMsg = "supportHostedGroupMsg";
3389
+ }
3390
+ if (message.supportFbidBotChatHistory != null && message.hasOwnProperty("supportFbidBotChatHistory")) {
3391
+ object.supportFbidBotChatHistory = message.supportFbidBotChatHistory;
3392
+ if (options.oneofs)
3393
+ object._supportFbidBotChatHistory = "supportFbidBotChatHistory";
3394
+ }
3395
+ if (message.supportAddOnHistorySyncMigration != null && message.hasOwnProperty("supportAddOnHistorySyncMigration")) {
3396
+ object.supportAddOnHistorySyncMigration = message.supportAddOnHistorySyncMigration;
3397
+ if (options.oneofs)
3398
+ object._supportAddOnHistorySyncMigration = "supportAddOnHistorySyncMigration";
3399
+ }
3400
+ if (message.supportMessageAssociation != null && message.hasOwnProperty("supportMessageAssociation")) {
3401
+ object.supportMessageAssociation = message.supportMessageAssociation;
3402
+ if (options.oneofs)
3403
+ object._supportMessageAssociation = "supportMessageAssociation";
3404
+ }
3405
+ return object;
3406
+ };
3407
+ /**
3408
+ * Converts this HistorySyncConfig to JSON.
3409
+ * @function toJSON
3410
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3411
+ * @instance
3412
+ * @returns {Object.<string,*>} JSON object
3413
+ */
3414
+ HistorySyncConfig.prototype.toJSON = function toJSON() {
3415
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3416
+ };
3417
+ /**
3418
+ * Gets the default type url for HistorySyncConfig
3419
+ * @function getTypeUrl
3420
+ * @memberof CompanionReg.DeviceProps.HistorySyncConfig
3421
+ * @static
3422
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3423
+ * @returns {string} The default type url
3424
+ */
3425
+ HistorySyncConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3426
+ if (typeUrlPrefix === undefined) {
3427
+ typeUrlPrefix = "type.googleapis.com";
3428
+ }
3429
+ return typeUrlPrefix + "/CompanionReg.DeviceProps.HistorySyncConfig";
3430
+ };
3431
+ return HistorySyncConfig;
3432
+ })();
3433
+ /**
3434
+ * PlatformType enum.
3435
+ * @name CompanionReg.DeviceProps.PlatformType
3436
+ * @enum {number}
3437
+ * @property {number} UNKNOWN=0 UNKNOWN value
3438
+ * @property {number} CHROME=1 CHROME value
3439
+ * @property {number} FIREFOX=2 FIREFOX value
3440
+ * @property {number} IE=3 IE value
3441
+ * @property {number} OPERA=4 OPERA value
3442
+ * @property {number} SAFARI=5 SAFARI value
3443
+ * @property {number} EDGE=6 EDGE value
3444
+ * @property {number} DESKTOP=7 DESKTOP value
3445
+ * @property {number} IPAD=8 IPAD value
3446
+ * @property {number} ANDROID_TABLET=9 ANDROID_TABLET value
3447
+ * @property {number} OHANA=10 OHANA value
3448
+ * @property {number} ALOHA=11 ALOHA value
3449
+ * @property {number} CATALINA=12 CATALINA value
3450
+ * @property {number} TCL_TV=13 TCL_TV value
3451
+ * @property {number} IOS_PHONE=14 IOS_PHONE value
3452
+ * @property {number} IOS_CATALYST=15 IOS_CATALYST value
3453
+ * @property {number} ANDROID_PHONE=16 ANDROID_PHONE value
3454
+ * @property {number} ANDROID_AMBIGUOUS=17 ANDROID_AMBIGUOUS value
3455
+ * @property {number} WEAR_OS=18 WEAR_OS value
3456
+ * @property {number} AR_WRIST=19 AR_WRIST value
3457
+ * @property {number} AR_DEVICE=20 AR_DEVICE value
3458
+ * @property {number} UWP=21 UWP value
3459
+ * @property {number} VR=22 VR value
3460
+ * @property {number} CLOUD_API=23 CLOUD_API value
3461
+ * @property {number} SMARTGLASSES=24 SMARTGLASSES value
3462
+ */
3463
+ DeviceProps.PlatformType = (function() {
3464
+ var valuesById = {}, values = Object.create(valuesById);
3465
+ values[valuesById[0] = "UNKNOWN"] = 0;
3466
+ values[valuesById[1] = "CHROME"] = 1;
3467
+ values[valuesById[2] = "FIREFOX"] = 2;
3468
+ values[valuesById[3] = "IE"] = 3;
3469
+ values[valuesById[4] = "OPERA"] = 4;
3470
+ values[valuesById[5] = "SAFARI"] = 5;
3471
+ values[valuesById[6] = "EDGE"] = 6;
3472
+ values[valuesById[7] = "DESKTOP"] = 7;
3473
+ values[valuesById[8] = "IPAD"] = 8;
3474
+ values[valuesById[9] = "ANDROID_TABLET"] = 9;
3475
+ values[valuesById[10] = "OHANA"] = 10;
3476
+ values[valuesById[11] = "ALOHA"] = 11;
3477
+ values[valuesById[12] = "CATALINA"] = 12;
3478
+ values[valuesById[13] = "TCL_TV"] = 13;
3479
+ values[valuesById[14] = "IOS_PHONE"] = 14;
3480
+ values[valuesById[15] = "IOS_CATALYST"] = 15;
3481
+ values[valuesById[16] = "ANDROID_PHONE"] = 16;
3482
+ values[valuesById[17] = "ANDROID_AMBIGUOUS"] = 17;
3483
+ values[valuesById[18] = "WEAR_OS"] = 18;
3484
+ values[valuesById[19] = "AR_WRIST"] = 19;
3485
+ values[valuesById[20] = "AR_DEVICE"] = 20;
3486
+ values[valuesById[21] = "UWP"] = 21;
3487
+ values[valuesById[22] = "VR"] = 22;
3488
+ values[valuesById[23] = "CLOUD_API"] = 23;
3489
+ values[valuesById[24] = "SMARTGLASSES"] = 24;
3490
+ return values;
3491
+ })();
3492
+ return DeviceProps;
3493
+ })();
3494
+ return CompanionReg;
3495
+ })();
3496
+ module.exports = $root;