dcodeindra-baileyspro 2.3.9

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 (286) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2534 -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/BotMetadata/BotMetadata.d.ts +5745 -0
  7. package/WAProto/BotMetadata/BotMetadata.js +16291 -0
  8. package/WAProto/BotMetadata/BotMetadata.proto +463 -0
  9. package/WAProto/Cert/Cert.d.ts +497 -0
  10. package/WAProto/Cert/Cert.js +1503 -0
  11. package/WAProto/Cert/Cert.proto +28 -0
  12. package/WAProto/ChatLockSettings/ChatLockSettings.d.ts +391 -0
  13. package/WAProto/ChatLockSettings/ChatLockSettings.js +1155 -0
  14. package/WAProto/ChatLockSettings/ChatLockSettings.proto +7 -0
  15. package/WAProto/CompanionReg/CompanionReg.d.ts +1055 -0
  16. package/WAProto/CompanionReg/CompanionReg.js +3532 -0
  17. package/WAProto/CompanionReg/CompanionReg.proto +89 -0
  18. package/WAProto/DeviceCapabilities/DeviceCapabilities.d.ts +187 -0
  19. package/WAProto/DeviceCapabilities/DeviceCapabilities.js +520 -0
  20. package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +14 -0
  21. package/WAProto/E2E/E2E.d.ts +28417 -0
  22. package/WAProto/E2E/E2E.js +98438 -0
  23. package/WAProto/E2E/E2E.proto +2289 -0
  24. package/WAProto/Ephemeral/Ephemeral.d.ts +95 -0
  25. package/WAProto/Ephemeral/Ephemeral.js +269 -0
  26. package/WAProto/Ephemeral/Ephemeral.proto +6 -0
  27. package/WAProto/HistorySync/HistorySync.d.ts +40728 -0
  28. package/WAProto/HistorySync/HistorySync.js +142980 -0
  29. package/WAProto/HistorySync/HistorySync.proto +207 -0
  30. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.d.ts +189 -0
  31. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +585 -0
  32. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +11 -0
  33. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.d.ts +461 -0
  34. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +1559 -0
  35. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +37 -0
  36. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +29294 -0
  37. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +101732 -0
  38. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +76 -0
  39. package/WAProto/MmsRetry/MmsRetry.d.ts +200 -0
  40. package/WAProto/MmsRetry/MmsRetry.js +586 -0
  41. package/WAProto/MmsRetry/MmsRetry.proto +17 -0
  42. package/WAProto/Protocol/Protocol.d.ts +218 -0
  43. package/WAProto/Protocol/Protocol.js +701 -0
  44. package/WAProto/Protocol/Protocol.proto +20 -0
  45. package/WAProto/Reporting/Reporting.d.ts +301 -0
  46. package/WAProto/Reporting/Reporting.js +989 -0
  47. package/WAProto/Reporting/Reporting.proto +19 -0
  48. package/WAProto/ServerSync/ServerSync.d.ts +1050 -0
  49. package/WAProto/ServerSync/ServerSync.js +3176 -0
  50. package/WAProto/ServerSync/ServerSync.proto +59 -0
  51. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.d.ts +1507 -0
  52. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +4756 -0
  53. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +88 -0
  54. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.d.ts +617 -0
  55. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1940 -0
  56. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +38 -0
  57. package/WAProto/StatusAttributions/StatusAttributions.d.ts +636 -0
  58. package/WAProto/StatusAttributions/StatusAttributions.js +2037 -0
  59. package/WAProto/StatusAttributions/StatusAttributions.proto +61 -0
  60. package/WAProto/SyncAction/SyncAction.d.ts +7227 -0
  61. package/WAProto/SyncAction/SyncAction.js +22271 -0
  62. package/WAProto/SyncAction/SyncAction.proto +423 -0
  63. package/WAProto/UserPassword/UserPassword.d.ts +298 -0
  64. package/WAProto/UserPassword/UserPassword.js +898 -0
  65. package/WAProto/UserPassword/UserPassword.proto +27 -0
  66. package/WAProto/VnameCert/VnameCert.d.ts +658 -0
  67. package/WAProto/VnameCert/VnameCert.js +2225 -0
  68. package/WAProto/VnameCert/VnameCert.proto +60 -0
  69. package/WAProto/Wa6/Wa6.d.ts +1613 -0
  70. package/WAProto/Wa6/Wa6.js +6299 -0
  71. package/WAProto/Wa6/Wa6.proto +229 -0
  72. package/WAProto/Web/Web.d.ts +31718 -0
  73. package/WAProto/Web/Web.js +113402 -0
  74. package/WAProto/Web/Web.proto +545 -0
  75. package/WAProto/index.d.ts +49 -0
  76. package/WAProto/index.js +28 -0
  77. package/WASignalGroup/GroupProtocol.js +1771 -0
  78. package/WASignalGroup/ciphertext_message.js +10 -0
  79. package/WASignalGroup/group_cipher.js +103 -0
  80. package/WASignalGroup/group_session_builder.js +39 -0
  81. package/WASignalGroup/index.js +5 -0
  82. package/WASignalGroup/keyhelper.js +17 -0
  83. package/WASignalGroup/protobufs.js +2 -0
  84. package/WASignalGroup/queue_job.js +64 -0
  85. package/WASignalGroup/sender_chain_key.js +38 -0
  86. package/WASignalGroup/sender_key_distribution_message.js +68 -0
  87. package/WASignalGroup/sender_key_message.js +79 -0
  88. package/WASignalGroup/sender_key_name.js +59 -0
  89. package/WASignalGroup/sender_key_record.js +47 -0
  90. package/WASignalGroup/sender_key_state.js +110 -0
  91. package/WASignalGroup/sender_message_key.js +30 -0
  92. package/check-node-version.js +10 -0
  93. package/lib/Defaults/baileys-version.json +3 -0
  94. package/lib/Defaults/index.d.ts +51 -0
  95. package/lib/Defaults/index.js +108 -0
  96. package/lib/Defaults/phonenumber-mcc.json +223 -0
  97. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  98. package/lib/Signal/Group/ciphertext-message.js +19 -0
  99. package/lib/Signal/Group/group-session-builder.d.ts +17 -0
  100. package/lib/Signal/Group/group-session-builder.js +72 -0
  101. package/lib/Signal/Group/group_cipher.d.ts +19 -0
  102. package/lib/Signal/Group/group_cipher.js +99 -0
  103. package/lib/Signal/Group/index.d.ts +11 -0
  104. package/lib/Signal/Group/index.js +61 -0
  105. package/lib/Signal/Group/keyhelper.d.ts +16 -0
  106. package/lib/Signal/Group/keyhelper.js +66 -0
  107. package/lib/Signal/Group/queue-job.d.ts +1 -0
  108. package/lib/Signal/Group/queue-job.js +64 -0
  109. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  110. package/lib/Signal/Group/sender-chain-key.js +39 -0
  111. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  112. package/lib/Signal/Group/sender-key-distribution-message.js +71 -0
  113. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  114. package/lib/Signal/Group/sender-key-message.js +73 -0
  115. package/lib/Signal/Group/sender-key-name.d.ts +19 -0
  116. package/lib/Signal/Group/sender-key-name.js +59 -0
  117. package/lib/Signal/Group/sender-key-record.d.ts +32 -0
  118. package/lib/Signal/Group/sender-key-record.js +53 -0
  119. package/lib/Signal/Group/sender-key-record.ts +77 -0
  120. package/lib/Signal/Group/sender-key-state.d.ts +44 -0
  121. package/lib/Signal/Group/sender-key-state.js +104 -0
  122. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  123. package/lib/Signal/Group/sender-message-key.js +33 -0
  124. package/lib/Signal/libsignal.d.ts +3 -0
  125. package/lib/Signal/libsignal.js +153 -0
  126. package/lib/Socket/Client/index.d.ts +2 -0
  127. package/lib/Socket/Client/index.js +18 -0
  128. package/lib/Socket/Client/types.d.ts +15 -0
  129. package/lib/Socket/Client/types.js +14 -0
  130. package/lib/Socket/Client/websocket.d.ts +12 -0
  131. package/lib/Socket/Client/websocket.js +57 -0
  132. package/lib/Socket/business.d.ts +181 -0
  133. package/lib/Socket/business.js +259 -0
  134. package/lib/Socket/chats.d.ts +95 -0
  135. package/lib/Socket/chats.js +906 -0
  136. package/lib/Socket/community.d.ts +131 -0
  137. package/lib/Socket/community.js +369 -0
  138. package/lib/Socket/groups.d.ts +122 -0
  139. package/lib/Socket/groups.js +360 -0
  140. package/lib/Socket/index.d.ts +183 -0
  141. package/lib/Socket/index.js +10 -0
  142. package/lib/Socket/messages-recv.d.ts +170 -0
  143. package/lib/Socket/messages-recv.js +1074 -0
  144. package/lib/Socket/messages-send.d.ts +161 -0
  145. package/lib/Socket/messages-send.js +982 -0
  146. package/lib/Socket/newsletter.d.ts +140 -0
  147. package/lib/Socket/newsletter.js +242 -0
  148. package/lib/Socket/socket.d.ts +43 -0
  149. package/lib/Socket/socket.js +749 -0
  150. package/lib/Socket/usync.d.ts +36 -0
  151. package/lib/Socket/usync.js +71 -0
  152. package/lib/Store/index.d.ts +4 -0
  153. package/lib/Store/index.js +20 -0
  154. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  155. package/lib/Store/make-cache-manager-store.js +77 -0
  156. package/lib/Store/make-in-memory-store.d.ts +117 -0
  157. package/lib/Store/make-in-memory-store.js +420 -0
  158. package/lib/Store/make-ordered-dictionary.d.ts +12 -0
  159. package/lib/Store/make-ordered-dictionary.js +83 -0
  160. package/lib/Store/object-repository.d.ts +10 -0
  161. package/lib/Store/object-repository.js +28 -0
  162. package/lib/Types/Auth.d.ts +103 -0
  163. package/lib/Types/Auth.js +2 -0
  164. package/lib/Types/Call.d.ts +13 -0
  165. package/lib/Types/Call.js +2 -0
  166. package/lib/Types/Chat.d.ts +115 -0
  167. package/lib/Types/Chat.js +6 -0
  168. package/lib/Types/Contact.d.ts +35 -0
  169. package/lib/Types/Contact.js +2 -0
  170. package/lib/Types/Events.d.ts +208 -0
  171. package/lib/Types/Events.js +2 -0
  172. package/lib/Types/GroupMetadata.d.ts +81 -0
  173. package/lib/Types/GroupMetadata.js +2 -0
  174. package/lib/Types/Label.d.ts +46 -0
  175. package/lib/Types/Label.js +28 -0
  176. package/lib/Types/LabelAssociation.d.ts +29 -0
  177. package/lib/Types/LabelAssociation.js +10 -0
  178. package/lib/Types/Message.d.ts +480 -0
  179. package/lib/Types/Message.js +9 -0
  180. package/lib/Types/MexUpdates.d.ts +9 -0
  181. package/lib/Types/MexUpdates.js +18 -0
  182. package/lib/Types/Newsletter.d.ts +92 -0
  183. package/lib/Types/Newsletter.js +33 -0
  184. package/lib/Types/Product.d.ts +78 -0
  185. package/lib/Types/Product.js +2 -0
  186. package/lib/Types/Signal.d.ts +57 -0
  187. package/lib/Types/Signal.js +2 -0
  188. package/lib/Types/Socket.d.ts +116 -0
  189. package/lib/Types/Socket.js +2 -0
  190. package/lib/Types/State.d.ts +27 -0
  191. package/lib/Types/State.js +2 -0
  192. package/lib/Types/USync.d.ts +25 -0
  193. package/lib/Types/USync.js +2 -0
  194. package/lib/Types/index.d.ts +70 -0
  195. package/lib/Types/index.js +42 -0
  196. package/lib/Utils/auth-utils.d.ts +18 -0
  197. package/lib/Utils/auth-utils.js +198 -0
  198. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  199. package/lib/Utils/baileys-event-stream.js +64 -0
  200. package/lib/Utils/business.d.ts +22 -0
  201. package/lib/Utils/business.js +243 -0
  202. package/lib/Utils/chat-utils.d.ts +72 -0
  203. package/lib/Utils/chat-utils.js +762 -0
  204. package/lib/Utils/crypto.d.ts +40 -0
  205. package/lib/Utils/crypto.js +150 -0
  206. package/lib/Utils/decode-wa-message.d.ts +252 -0
  207. package/lib/Utils/decode-wa-message.js +232 -0
  208. package/lib/Utils/event-buffer.d.ts +35 -0
  209. package/lib/Utils/event-buffer.js +539 -0
  210. package/lib/Utils/generics.d.ts +96 -0
  211. package/lib/Utils/generics.js +553 -0
  212. package/lib/Utils/history.d.ts +29 -0
  213. package/lib/Utils/history.js +109 -0
  214. package/lib/Utils/index.d.ts +19 -0
  215. package/lib/Utils/index.js +35 -0
  216. package/lib/Utils/link-preview.d.ts +21 -0
  217. package/lib/Utils/link-preview.js +112 -0
  218. package/lib/Utils/logger.d.ts +11 -0
  219. package/lib/Utils/logger.js +7 -0
  220. package/lib/Utils/lt-hash.d.ts +12 -0
  221. package/lib/Utils/lt-hash.js +53 -0
  222. package/lib/Utils/make-mutex.d.ts +7 -0
  223. package/lib/Utils/make-mutex.js +45 -0
  224. package/lib/Utils/messages-media.d.ts +104 -0
  225. package/lib/Utils/messages-media.js +751 -0
  226. package/lib/Utils/messages.d.ts +80 -0
  227. package/lib/Utils/messages.js +1741 -0
  228. package/lib/Utils/noise-handler.d.ts +19 -0
  229. package/lib/Utils/noise-handler.js +150 -0
  230. package/lib/Utils/process-message.d.ts +41 -0
  231. package/lib/Utils/process-message.js +391 -0
  232. package/lib/Utils/signal.d.ts +33 -0
  233. package/lib/Utils/signal.js +154 -0
  234. package/lib/Utils/use-mongo-file-auth-state.d.ts +5 -0
  235. package/lib/Utils/use-mongo-file-auth-state.js +75 -0
  236. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
  237. package/lib/Utils/use-multi-file-auth-state.js +123 -0
  238. package/lib/Utils/use-single-file-auth-state.d.ts +12 -0
  239. package/lib/Utils/use-single-file-auth-state.js +75 -0
  240. package/lib/Utils/validate-connection.d.ts +10 -0
  241. package/lib/Utils/validate-connection.js +174 -0
  242. package/lib/WABinary/constants.d.ts +27 -0
  243. package/lib/WABinary/constants.js +45 -0
  244. package/lib/WABinary/decode.d.ts +6 -0
  245. package/lib/WABinary/decode.js +255 -0
  246. package/lib/WABinary/encode.d.ts +2 -0
  247. package/lib/WABinary/encode.js +243 -0
  248. package/lib/WABinary/generic-utils.d.ts +16 -0
  249. package/lib/WABinary/generic-utils.js +125 -0
  250. package/lib/WABinary/index.d.ts +5 -0
  251. package/lib/WABinary/index.js +21 -0
  252. package/lib/WABinary/jid-utils.d.ts +34 -0
  253. package/lib/WABinary/jid-utils.js +73 -0
  254. package/lib/WABinary/types.d.ts +18 -0
  255. package/lib/WABinary/types.js +2 -0
  256. package/lib/WAM/BinaryInfo.d.ts +16 -0
  257. package/lib/WAM/BinaryInfo.js +14 -0
  258. package/lib/WAM/constants.d.ts +39 -0
  259. package/lib/WAM/constants.js +15362 -0
  260. package/lib/WAM/encode.d.ts +2 -0
  261. package/lib/WAM/encode.js +156 -0
  262. package/lib/WAM/index.d.ts +3 -0
  263. package/lib/WAM/index.js +19 -0
  264. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +25 -0
  265. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +60 -0
  266. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  267. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  268. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  269. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +58 -0
  270. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  271. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +31 -0
  272. package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +8 -0
  273. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +26 -0
  274. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  275. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  276. package/lib/WAUSync/Protocols/index.d.ts +6 -0
  277. package/lib/WAUSync/Protocols/index.js +22 -0
  278. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  279. package/lib/WAUSync/USyncQuery.js +88 -0
  280. package/lib/WAUSync/USyncUser.d.ts +12 -0
  281. package/lib/WAUSync/USyncUser.js +27 -0
  282. package/lib/WAUSync/index.d.ts +3 -0
  283. package/lib/WAUSync/index.js +19 -0
  284. package/lib/index.d.ts +13 -0
  285. package/lib/index.js +45 -0
  286. package/package.json +63 -0
@@ -0,0 +1,701 @@
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.Protocol = (function() {
9
+ /**
10
+ * Namespace Protocol.
11
+ * @exports Protocol
12
+ * @namespace
13
+ */
14
+ var Protocol = {};
15
+ Protocol.LimitSharing = (function() {
16
+ /**
17
+ * Properties of a LimitSharing.
18
+ * @memberof Protocol
19
+ * @interface ILimitSharing
20
+ * @property {boolean|null} [sharingLimited] LimitSharing sharingLimited
21
+ * @property {Protocol.LimitSharing.TriggerType|null} [trigger] LimitSharing trigger
22
+ * @property {number|Long|null} [limitSharingSettingTimestamp] LimitSharing limitSharingSettingTimestamp
23
+ * @property {boolean|null} [initiatedByMe] LimitSharing initiatedByMe
24
+ */
25
+ /**
26
+ * Constructs a new LimitSharing.
27
+ * @memberof Protocol
28
+ * @classdesc Represents a LimitSharing.
29
+ * @implements ILimitSharing
30
+ * @constructor
31
+ * @param {Protocol.ILimitSharing=} [properties] Properties to set
32
+ */
33
+ function LimitSharing(properties) {
34
+ if (properties)
35
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
36
+ if (properties[keys[i]] != null)
37
+ this[keys[i]] = properties[keys[i]];
38
+ }
39
+ /**
40
+ * LimitSharing sharingLimited.
41
+ * @member {boolean|null|undefined} sharingLimited
42
+ * @memberof Protocol.LimitSharing
43
+ * @instance
44
+ */
45
+ LimitSharing.prototype.sharingLimited = null;
46
+ /**
47
+ * LimitSharing trigger.
48
+ * @member {Protocol.LimitSharing.TriggerType|null|undefined} trigger
49
+ * @memberof Protocol.LimitSharing
50
+ * @instance
51
+ */
52
+ LimitSharing.prototype.trigger = null;
53
+ /**
54
+ * LimitSharing limitSharingSettingTimestamp.
55
+ * @member {number|Long|null|undefined} limitSharingSettingTimestamp
56
+ * @memberof Protocol.LimitSharing
57
+ * @instance
58
+ */
59
+ LimitSharing.prototype.limitSharingSettingTimestamp = null;
60
+ /**
61
+ * LimitSharing initiatedByMe.
62
+ * @member {boolean|null|undefined} initiatedByMe
63
+ * @memberof Protocol.LimitSharing
64
+ * @instance
65
+ */
66
+ LimitSharing.prototype.initiatedByMe = null;
67
+ // OneOf field names bound to virtual getters and setters
68
+ var $oneOfFields;
69
+ /**
70
+ * LimitSharing _sharingLimited.
71
+ * @member {"sharingLimited"|undefined} _sharingLimited
72
+ * @memberof Protocol.LimitSharing
73
+ * @instance
74
+ */
75
+ Object.defineProperty(LimitSharing.prototype, "_sharingLimited", {
76
+ get: $util.oneOfGetter($oneOfFields = ["sharingLimited"]),
77
+ set: $util.oneOfSetter($oneOfFields)
78
+ });
79
+ /**
80
+ * LimitSharing _trigger.
81
+ * @member {"trigger"|undefined} _trigger
82
+ * @memberof Protocol.LimitSharing
83
+ * @instance
84
+ */
85
+ Object.defineProperty(LimitSharing.prototype, "_trigger", {
86
+ get: $util.oneOfGetter($oneOfFields = ["trigger"]),
87
+ set: $util.oneOfSetter($oneOfFields)
88
+ });
89
+ /**
90
+ * LimitSharing _limitSharingSettingTimestamp.
91
+ * @member {"limitSharingSettingTimestamp"|undefined} _limitSharingSettingTimestamp
92
+ * @memberof Protocol.LimitSharing
93
+ * @instance
94
+ */
95
+ Object.defineProperty(LimitSharing.prototype, "_limitSharingSettingTimestamp", {
96
+ get: $util.oneOfGetter($oneOfFields = ["limitSharingSettingTimestamp"]),
97
+ set: $util.oneOfSetter($oneOfFields)
98
+ });
99
+ /**
100
+ * LimitSharing _initiatedByMe.
101
+ * @member {"initiatedByMe"|undefined} _initiatedByMe
102
+ * @memberof Protocol.LimitSharing
103
+ * @instance
104
+ */
105
+ Object.defineProperty(LimitSharing.prototype, "_initiatedByMe", {
106
+ get: $util.oneOfGetter($oneOfFields = ["initiatedByMe"]),
107
+ set: $util.oneOfSetter($oneOfFields)
108
+ });
109
+ /**
110
+ * Creates a new LimitSharing instance using the specified properties.
111
+ * @function create
112
+ * @memberof Protocol.LimitSharing
113
+ * @static
114
+ * @param {Protocol.ILimitSharing=} [properties] Properties to set
115
+ * @returns {Protocol.LimitSharing} LimitSharing instance
116
+ */
117
+ LimitSharing.create = function create(properties) {
118
+ return new LimitSharing(properties);
119
+ };
120
+ /**
121
+ * Encodes the specified LimitSharing message. Does not implicitly {@link Protocol.LimitSharing.verify|verify} messages.
122
+ * @function encode
123
+ * @memberof Protocol.LimitSharing
124
+ * @static
125
+ * @param {Protocol.ILimitSharing} message LimitSharing message or plain object to encode
126
+ * @param {$protobuf.Writer} [writer] Writer to encode to
127
+ * @returns {$protobuf.Writer} Writer
128
+ */
129
+ LimitSharing.encode = function encode(message, writer) {
130
+ if (!writer)
131
+ writer = $Writer.create();
132
+ if (message.sharingLimited != null && Object.hasOwnProperty.call(message, "sharingLimited"))
133
+ writer.uint32(/* id 1, wireType 0 =*/8).bool(message.sharingLimited);
134
+ if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger"))
135
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trigger);
136
+ if (message.limitSharingSettingTimestamp != null && Object.hasOwnProperty.call(message, "limitSharingSettingTimestamp"))
137
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.limitSharingSettingTimestamp);
138
+ if (message.initiatedByMe != null && Object.hasOwnProperty.call(message, "initiatedByMe"))
139
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.initiatedByMe);
140
+ return writer;
141
+ };
142
+ /**
143
+ * Encodes the specified LimitSharing message, length delimited. Does not implicitly {@link Protocol.LimitSharing.verify|verify} messages.
144
+ * @function encodeDelimited
145
+ * @memberof Protocol.LimitSharing
146
+ * @static
147
+ * @param {Protocol.ILimitSharing} message LimitSharing message or plain object to encode
148
+ * @param {$protobuf.Writer} [writer] Writer to encode to
149
+ * @returns {$protobuf.Writer} Writer
150
+ */
151
+ LimitSharing.encodeDelimited = function encodeDelimited(message, writer) {
152
+ return this.encode(message, writer).ldelim();
153
+ };
154
+ /**
155
+ * Decodes a LimitSharing message from the specified reader or buffer.
156
+ * @function decode
157
+ * @memberof Protocol.LimitSharing
158
+ * @static
159
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
160
+ * @param {number} [length] Message length if known beforehand
161
+ * @returns {Protocol.LimitSharing} LimitSharing
162
+ * @throws {Error} If the payload is not a reader or valid buffer
163
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
164
+ */
165
+ LimitSharing.decode = function decode(reader, length, error) {
166
+ if (!(reader instanceof $Reader))
167
+ reader = $Reader.create(reader);
168
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Protocol.LimitSharing();
169
+ while (reader.pos < end) {
170
+ var tag = reader.uint32();
171
+ if (tag === error)
172
+ break;
173
+ switch (tag >>> 3) {
174
+ case 1: {
175
+ message.sharingLimited = reader.bool();
176
+ break;
177
+ }
178
+ case 2: {
179
+ message.trigger = reader.int32();
180
+ break;
181
+ }
182
+ case 3: {
183
+ message.limitSharingSettingTimestamp = reader.int64();
184
+ break;
185
+ }
186
+ case 4: {
187
+ message.initiatedByMe = reader.bool();
188
+ break;
189
+ }
190
+ default:
191
+ reader.skipType(tag & 7);
192
+ break;
193
+ }
194
+ }
195
+ return message;
196
+ };
197
+ /**
198
+ * Decodes a LimitSharing message from the specified reader or buffer, length delimited.
199
+ * @function decodeDelimited
200
+ * @memberof Protocol.LimitSharing
201
+ * @static
202
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
203
+ * @returns {Protocol.LimitSharing} LimitSharing
204
+ * @throws {Error} If the payload is not a reader or valid buffer
205
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
206
+ */
207
+ LimitSharing.decodeDelimited = function decodeDelimited(reader) {
208
+ if (!(reader instanceof $Reader))
209
+ reader = new $Reader(reader);
210
+ return this.decode(reader, reader.uint32());
211
+ };
212
+ /**
213
+ * Verifies a LimitSharing message.
214
+ * @function verify
215
+ * @memberof Protocol.LimitSharing
216
+ * @static
217
+ * @param {Object.<string,*>} message Plain object to verify
218
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
219
+ */
220
+ LimitSharing.verify = function verify(message) {
221
+ if (typeof message !== "object" || message === null)
222
+ return "object expected";
223
+ var properties = {};
224
+ if (message.sharingLimited != null && message.hasOwnProperty("sharingLimited")) {
225
+ properties._sharingLimited = 1;
226
+ if (typeof message.sharingLimited !== "boolean")
227
+ return "sharingLimited: boolean expected";
228
+ }
229
+ if (message.trigger != null && message.hasOwnProperty("trigger")) {
230
+ properties._trigger = 1;
231
+ switch (message.trigger) {
232
+ default:
233
+ return "trigger: enum value expected";
234
+ case 0:
235
+ case 1:
236
+ case 2:
237
+ case 3:
238
+ break;
239
+ }
240
+ }
241
+ if (message.limitSharingSettingTimestamp != null && message.hasOwnProperty("limitSharingSettingTimestamp")) {
242
+ properties._limitSharingSettingTimestamp = 1;
243
+ if (!$util.isInteger(message.limitSharingSettingTimestamp) && !(message.limitSharingSettingTimestamp && $util.isInteger(message.limitSharingSettingTimestamp.low) && $util.isInteger(message.limitSharingSettingTimestamp.high)))
244
+ return "limitSharingSettingTimestamp: integer|Long expected";
245
+ }
246
+ if (message.initiatedByMe != null && message.hasOwnProperty("initiatedByMe")) {
247
+ properties._initiatedByMe = 1;
248
+ if (typeof message.initiatedByMe !== "boolean")
249
+ return "initiatedByMe: boolean expected";
250
+ }
251
+ return null;
252
+ };
253
+ /**
254
+ * Creates a LimitSharing message from a plain object. Also converts values to their respective internal types.
255
+ * @function fromObject
256
+ * @memberof Protocol.LimitSharing
257
+ * @static
258
+ * @param {Object.<string,*>} object Plain object
259
+ * @returns {Protocol.LimitSharing} LimitSharing
260
+ */
261
+ LimitSharing.fromObject = function fromObject(object) {
262
+ if (object instanceof $root.Protocol.LimitSharing)
263
+ return object;
264
+ var message = new $root.Protocol.LimitSharing();
265
+ if (object.sharingLimited != null)
266
+ message.sharingLimited = Boolean(object.sharingLimited);
267
+ switch (object.trigger) {
268
+ default:
269
+ if (typeof object.trigger === "number") {
270
+ message.trigger = object.trigger;
271
+ break;
272
+ }
273
+ break;
274
+ case "UNKNOWN":
275
+ case 0:
276
+ message.trigger = 0;
277
+ break;
278
+ case "CHAT_SETTING":
279
+ case 1:
280
+ message.trigger = 1;
281
+ break;
282
+ case "BIZ_SUPPORTS_FB_HOSTING":
283
+ case 2:
284
+ message.trigger = 2;
285
+ break;
286
+ case "UNKNOWN_GROUP":
287
+ case 3:
288
+ message.trigger = 3;
289
+ break;
290
+ }
291
+ if (object.limitSharingSettingTimestamp != null)
292
+ if ($util.Long)
293
+ (message.limitSharingSettingTimestamp = $util.Long.fromValue(object.limitSharingSettingTimestamp)).unsigned = false;
294
+ else if (typeof object.limitSharingSettingTimestamp === "string")
295
+ message.limitSharingSettingTimestamp = parseInt(object.limitSharingSettingTimestamp, 10);
296
+ else if (typeof object.limitSharingSettingTimestamp === "number")
297
+ message.limitSharingSettingTimestamp = object.limitSharingSettingTimestamp;
298
+ else if (typeof object.limitSharingSettingTimestamp === "object")
299
+ message.limitSharingSettingTimestamp = new $util.LongBits(object.limitSharingSettingTimestamp.low >>> 0, object.limitSharingSettingTimestamp.high >>> 0).toNumber();
300
+ if (object.initiatedByMe != null)
301
+ message.initiatedByMe = Boolean(object.initiatedByMe);
302
+ return message;
303
+ };
304
+ /**
305
+ * Creates a plain object from a LimitSharing message. Also converts values to other types if specified.
306
+ * @function toObject
307
+ * @memberof Protocol.LimitSharing
308
+ * @static
309
+ * @param {Protocol.LimitSharing} message LimitSharing
310
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
311
+ * @returns {Object.<string,*>} Plain object
312
+ */
313
+ LimitSharing.toObject = function toObject(message, options) {
314
+ if (!options)
315
+ options = {};
316
+ var object = {};
317
+ if (message.sharingLimited != null && message.hasOwnProperty("sharingLimited")) {
318
+ object.sharingLimited = message.sharingLimited;
319
+ if (options.oneofs)
320
+ object._sharingLimited = "sharingLimited";
321
+ }
322
+ if (message.trigger != null && message.hasOwnProperty("trigger")) {
323
+ object.trigger = options.enums === String ? $root.Protocol.LimitSharing.TriggerType[message.trigger] === undefined ? message.trigger : $root.Protocol.LimitSharing.TriggerType[message.trigger] : message.trigger;
324
+ if (options.oneofs)
325
+ object._trigger = "trigger";
326
+ }
327
+ if (message.limitSharingSettingTimestamp != null && message.hasOwnProperty("limitSharingSettingTimestamp")) {
328
+ if (typeof message.limitSharingSettingTimestamp === "number")
329
+ object.limitSharingSettingTimestamp = options.longs === String ? String(message.limitSharingSettingTimestamp) : message.limitSharingSettingTimestamp;
330
+ else
331
+ object.limitSharingSettingTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.limitSharingSettingTimestamp) : options.longs === Number ? new $util.LongBits(message.limitSharingSettingTimestamp.low >>> 0, message.limitSharingSettingTimestamp.high >>> 0).toNumber() : message.limitSharingSettingTimestamp;
332
+ if (options.oneofs)
333
+ object._limitSharingSettingTimestamp = "limitSharingSettingTimestamp";
334
+ }
335
+ if (message.initiatedByMe != null && message.hasOwnProperty("initiatedByMe")) {
336
+ object.initiatedByMe = message.initiatedByMe;
337
+ if (options.oneofs)
338
+ object._initiatedByMe = "initiatedByMe";
339
+ }
340
+ return object;
341
+ };
342
+ /**
343
+ * Converts this LimitSharing to JSON.
344
+ * @function toJSON
345
+ * @memberof Protocol.LimitSharing
346
+ * @instance
347
+ * @returns {Object.<string,*>} JSON object
348
+ */
349
+ LimitSharing.prototype.toJSON = function toJSON() {
350
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
351
+ };
352
+ /**
353
+ * Gets the default type url for LimitSharing
354
+ * @function getTypeUrl
355
+ * @memberof Protocol.LimitSharing
356
+ * @static
357
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
358
+ * @returns {string} The default type url
359
+ */
360
+ LimitSharing.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
361
+ if (typeUrlPrefix === undefined) {
362
+ typeUrlPrefix = "type.googleapis.com";
363
+ }
364
+ return typeUrlPrefix + "/Protocol.LimitSharing";
365
+ };
366
+ /**
367
+ * TriggerType enum.
368
+ * @name Protocol.LimitSharing.TriggerType
369
+ * @enum {number}
370
+ * @property {number} UNKNOWN=0 UNKNOWN value
371
+ * @property {number} CHAT_SETTING=1 CHAT_SETTING value
372
+ * @property {number} BIZ_SUPPORTS_FB_HOSTING=2 BIZ_SUPPORTS_FB_HOSTING value
373
+ * @property {number} UNKNOWN_GROUP=3 UNKNOWN_GROUP value
374
+ */
375
+ LimitSharing.TriggerType = (function() {
376
+ var valuesById = {}, values = Object.create(valuesById);
377
+ values[valuesById[0] = "UNKNOWN"] = 0;
378
+ values[valuesById[1] = "CHAT_SETTING"] = 1;
379
+ values[valuesById[2] = "BIZ_SUPPORTS_FB_HOSTING"] = 2;
380
+ values[valuesById[3] = "UNKNOWN_GROUP"] = 3;
381
+ return values;
382
+ })();
383
+ return LimitSharing;
384
+ })();
385
+ Protocol.MessageKey = (function() {
386
+ /**
387
+ * Properties of a MessageKey.
388
+ * @memberof Protocol
389
+ * @interface IMessageKey
390
+ * @property {string|null} [remoteJid] MessageKey remoteJid
391
+ * @property {boolean|null} [fromMe] MessageKey fromMe
392
+ * @property {string|null} [id] MessageKey id
393
+ * @property {string|null} [participant] MessageKey participant
394
+ */
395
+ /**
396
+ * Constructs a new MessageKey.
397
+ * @memberof Protocol
398
+ * @classdesc Represents a MessageKey.
399
+ * @implements IMessageKey
400
+ * @constructor
401
+ * @param {Protocol.IMessageKey=} [properties] Properties to set
402
+ */
403
+ function MessageKey(properties) {
404
+ if (properties)
405
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
406
+ if (properties[keys[i]] != null)
407
+ this[keys[i]] = properties[keys[i]];
408
+ }
409
+ /**
410
+ * MessageKey remoteJid.
411
+ * @member {string|null|undefined} remoteJid
412
+ * @memberof Protocol.MessageKey
413
+ * @instance
414
+ */
415
+ MessageKey.prototype.remoteJid = null;
416
+ /**
417
+ * MessageKey fromMe.
418
+ * @member {boolean|null|undefined} fromMe
419
+ * @memberof Protocol.MessageKey
420
+ * @instance
421
+ */
422
+ MessageKey.prototype.fromMe = null;
423
+ /**
424
+ * MessageKey id.
425
+ * @member {string|null|undefined} id
426
+ * @memberof Protocol.MessageKey
427
+ * @instance
428
+ */
429
+ MessageKey.prototype.id = null;
430
+ /**
431
+ * MessageKey participant.
432
+ * @member {string|null|undefined} participant
433
+ * @memberof Protocol.MessageKey
434
+ * @instance
435
+ */
436
+ MessageKey.prototype.participant = null;
437
+ // OneOf field names bound to virtual getters and setters
438
+ var $oneOfFields;
439
+ /**
440
+ * MessageKey _remoteJid.
441
+ * @member {"remoteJid"|undefined} _remoteJid
442
+ * @memberof Protocol.MessageKey
443
+ * @instance
444
+ */
445
+ Object.defineProperty(MessageKey.prototype, "_remoteJid", {
446
+ get: $util.oneOfGetter($oneOfFields = ["remoteJid"]),
447
+ set: $util.oneOfSetter($oneOfFields)
448
+ });
449
+ /**
450
+ * MessageKey _fromMe.
451
+ * @member {"fromMe"|undefined} _fromMe
452
+ * @memberof Protocol.MessageKey
453
+ * @instance
454
+ */
455
+ Object.defineProperty(MessageKey.prototype, "_fromMe", {
456
+ get: $util.oneOfGetter($oneOfFields = ["fromMe"]),
457
+ set: $util.oneOfSetter($oneOfFields)
458
+ });
459
+ /**
460
+ * MessageKey _id.
461
+ * @member {"id"|undefined} _id
462
+ * @memberof Protocol.MessageKey
463
+ * @instance
464
+ */
465
+ Object.defineProperty(MessageKey.prototype, "_id", {
466
+ get: $util.oneOfGetter($oneOfFields = ["id"]),
467
+ set: $util.oneOfSetter($oneOfFields)
468
+ });
469
+ /**
470
+ * MessageKey _participant.
471
+ * @member {"participant"|undefined} _participant
472
+ * @memberof Protocol.MessageKey
473
+ * @instance
474
+ */
475
+ Object.defineProperty(MessageKey.prototype, "_participant", {
476
+ get: $util.oneOfGetter($oneOfFields = ["participant"]),
477
+ set: $util.oneOfSetter($oneOfFields)
478
+ });
479
+ /**
480
+ * Creates a new MessageKey instance using the specified properties.
481
+ * @function create
482
+ * @memberof Protocol.MessageKey
483
+ * @static
484
+ * @param {Protocol.IMessageKey=} [properties] Properties to set
485
+ * @returns {Protocol.MessageKey} MessageKey instance
486
+ */
487
+ MessageKey.create = function create(properties) {
488
+ return new MessageKey(properties);
489
+ };
490
+ /**
491
+ * Encodes the specified MessageKey message. Does not implicitly {@link Protocol.MessageKey.verify|verify} messages.
492
+ * @function encode
493
+ * @memberof Protocol.MessageKey
494
+ * @static
495
+ * @param {Protocol.IMessageKey} message MessageKey message or plain object to encode
496
+ * @param {$protobuf.Writer} [writer] Writer to encode to
497
+ * @returns {$protobuf.Writer} Writer
498
+ */
499
+ MessageKey.encode = function encode(message, writer) {
500
+ if (!writer)
501
+ writer = $Writer.create();
502
+ if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid"))
503
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.remoteJid);
504
+ if (message.fromMe != null && Object.hasOwnProperty.call(message, "fromMe"))
505
+ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fromMe);
506
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
507
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.id);
508
+ if (message.participant != null && Object.hasOwnProperty.call(message, "participant"))
509
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant);
510
+ return writer;
511
+ };
512
+ /**
513
+ * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link Protocol.MessageKey.verify|verify} messages.
514
+ * @function encodeDelimited
515
+ * @memberof Protocol.MessageKey
516
+ * @static
517
+ * @param {Protocol.IMessageKey} message MessageKey message or plain object to encode
518
+ * @param {$protobuf.Writer} [writer] Writer to encode to
519
+ * @returns {$protobuf.Writer} Writer
520
+ */
521
+ MessageKey.encodeDelimited = function encodeDelimited(message, writer) {
522
+ return this.encode(message, writer).ldelim();
523
+ };
524
+ /**
525
+ * Decodes a MessageKey message from the specified reader or buffer.
526
+ * @function decode
527
+ * @memberof Protocol.MessageKey
528
+ * @static
529
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
530
+ * @param {number} [length] Message length if known beforehand
531
+ * @returns {Protocol.MessageKey} MessageKey
532
+ * @throws {Error} If the payload is not a reader or valid buffer
533
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
534
+ */
535
+ MessageKey.decode = function decode(reader, length, error) {
536
+ if (!(reader instanceof $Reader))
537
+ reader = $Reader.create(reader);
538
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Protocol.MessageKey();
539
+ while (reader.pos < end) {
540
+ var tag = reader.uint32();
541
+ if (tag === error)
542
+ break;
543
+ switch (tag >>> 3) {
544
+ case 1: {
545
+ message.remoteJid = reader.string();
546
+ break;
547
+ }
548
+ case 2: {
549
+ message.fromMe = reader.bool();
550
+ break;
551
+ }
552
+ case 3: {
553
+ message.id = reader.string();
554
+ break;
555
+ }
556
+ case 4: {
557
+ message.participant = reader.string();
558
+ break;
559
+ }
560
+ default:
561
+ reader.skipType(tag & 7);
562
+ break;
563
+ }
564
+ }
565
+ return message;
566
+ };
567
+ /**
568
+ * Decodes a MessageKey message from the specified reader or buffer, length delimited.
569
+ * @function decodeDelimited
570
+ * @memberof Protocol.MessageKey
571
+ * @static
572
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
573
+ * @returns {Protocol.MessageKey} MessageKey
574
+ * @throws {Error} If the payload is not a reader or valid buffer
575
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
576
+ */
577
+ MessageKey.decodeDelimited = function decodeDelimited(reader) {
578
+ if (!(reader instanceof $Reader))
579
+ reader = new $Reader(reader);
580
+ return this.decode(reader, reader.uint32());
581
+ };
582
+ /**
583
+ * Verifies a MessageKey message.
584
+ * @function verify
585
+ * @memberof Protocol.MessageKey
586
+ * @static
587
+ * @param {Object.<string,*>} message Plain object to verify
588
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
589
+ */
590
+ MessageKey.verify = function verify(message) {
591
+ if (typeof message !== "object" || message === null)
592
+ return "object expected";
593
+ var properties = {};
594
+ if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) {
595
+ properties._remoteJid = 1;
596
+ if (!$util.isString(message.remoteJid))
597
+ return "remoteJid: string expected";
598
+ }
599
+ if (message.fromMe != null && message.hasOwnProperty("fromMe")) {
600
+ properties._fromMe = 1;
601
+ if (typeof message.fromMe !== "boolean")
602
+ return "fromMe: boolean expected";
603
+ }
604
+ if (message.id != null && message.hasOwnProperty("id")) {
605
+ properties._id = 1;
606
+ if (!$util.isString(message.id))
607
+ return "id: string expected";
608
+ }
609
+ if (message.participant != null && message.hasOwnProperty("participant")) {
610
+ properties._participant = 1;
611
+ if (!$util.isString(message.participant))
612
+ return "participant: string expected";
613
+ }
614
+ return null;
615
+ };
616
+ /**
617
+ * Creates a MessageKey message from a plain object. Also converts values to their respective internal types.
618
+ * @function fromObject
619
+ * @memberof Protocol.MessageKey
620
+ * @static
621
+ * @param {Object.<string,*>} object Plain object
622
+ * @returns {Protocol.MessageKey} MessageKey
623
+ */
624
+ MessageKey.fromObject = function fromObject(object) {
625
+ if (object instanceof $root.Protocol.MessageKey)
626
+ return object;
627
+ var message = new $root.Protocol.MessageKey();
628
+ if (object.remoteJid != null)
629
+ message.remoteJid = String(object.remoteJid);
630
+ if (object.fromMe != null)
631
+ message.fromMe = Boolean(object.fromMe);
632
+ if (object.id != null)
633
+ message.id = String(object.id);
634
+ if (object.participant != null)
635
+ message.participant = String(object.participant);
636
+ return message;
637
+ };
638
+ /**
639
+ * Creates a plain object from a MessageKey message. Also converts values to other types if specified.
640
+ * @function toObject
641
+ * @memberof Protocol.MessageKey
642
+ * @static
643
+ * @param {Protocol.MessageKey} message MessageKey
644
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
645
+ * @returns {Object.<string,*>} Plain object
646
+ */
647
+ MessageKey.toObject = function toObject(message, options) {
648
+ if (!options)
649
+ options = {};
650
+ var object = {};
651
+ if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) {
652
+ object.remoteJid = message.remoteJid;
653
+ if (options.oneofs)
654
+ object._remoteJid = "remoteJid";
655
+ }
656
+ if (message.fromMe != null && message.hasOwnProperty("fromMe")) {
657
+ object.fromMe = message.fromMe;
658
+ if (options.oneofs)
659
+ object._fromMe = "fromMe";
660
+ }
661
+ if (message.id != null && message.hasOwnProperty("id")) {
662
+ object.id = message.id;
663
+ if (options.oneofs)
664
+ object._id = "id";
665
+ }
666
+ if (message.participant != null && message.hasOwnProperty("participant")) {
667
+ object.participant = message.participant;
668
+ if (options.oneofs)
669
+ object._participant = "participant";
670
+ }
671
+ return object;
672
+ };
673
+ /**
674
+ * Converts this MessageKey to JSON.
675
+ * @function toJSON
676
+ * @memberof Protocol.MessageKey
677
+ * @instance
678
+ * @returns {Object.<string,*>} JSON object
679
+ */
680
+ MessageKey.prototype.toJSON = function toJSON() {
681
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
682
+ };
683
+ /**
684
+ * Gets the default type url for MessageKey
685
+ * @function getTypeUrl
686
+ * @memberof Protocol.MessageKey
687
+ * @static
688
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
689
+ * @returns {string} The default type url
690
+ */
691
+ MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
692
+ if (typeUrlPrefix === undefined) {
693
+ typeUrlPrefix = "type.googleapis.com";
694
+ }
695
+ return typeUrlPrefix + "/Protocol.MessageKey";
696
+ };
697
+ return MessageKey;
698
+ })();
699
+ return Protocol;
700
+ })();
701
+ module.exports = $root;