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,1155 @@
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.ChatLockSettings = (function() {
9
+ /**
10
+ * Namespace ChatLockSettings.
11
+ * @exports ChatLockSettings
12
+ * @namespace
13
+ */
14
+ var ChatLockSettings = {};
15
+ ChatLockSettings.ChatLockSettings = (function() {
16
+ /**
17
+ * Properties of a ChatLockSettings.
18
+ * @memberof ChatLockSettings
19
+ * @interface IChatLockSettings
20
+ * @property {boolean|null} [hideLockedChats] ChatLockSettings hideLockedChats
21
+ * @property {UserPassword.IUserPassword|null} [secretCode] ChatLockSettings secretCode
22
+ */
23
+ /**
24
+ * Constructs a new ChatLockSettings.
25
+ * @memberof ChatLockSettings
26
+ * @classdesc Represents a ChatLockSettings.
27
+ * @implements IChatLockSettings
28
+ * @constructor
29
+ * @param {ChatLockSettings.IChatLockSettings=} [properties] Properties to set
30
+ */
31
+ function ChatLockSettings(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
+ * ChatLockSettings hideLockedChats.
39
+ * @member {boolean|null|undefined} hideLockedChats
40
+ * @memberof ChatLockSettings.ChatLockSettings
41
+ * @instance
42
+ */
43
+ ChatLockSettings.prototype.hideLockedChats = null;
44
+ /**
45
+ * ChatLockSettings secretCode.
46
+ * @member {UserPassword.IUserPassword|null|undefined} secretCode
47
+ * @memberof ChatLockSettings.ChatLockSettings
48
+ * @instance
49
+ */
50
+ ChatLockSettings.prototype.secretCode = null;
51
+ // OneOf field names bound to virtual getters and setters
52
+ var $oneOfFields;
53
+ /**
54
+ * ChatLockSettings _hideLockedChats.
55
+ * @member {"hideLockedChats"|undefined} _hideLockedChats
56
+ * @memberof ChatLockSettings.ChatLockSettings
57
+ * @instance
58
+ */
59
+ Object.defineProperty(ChatLockSettings.prototype, "_hideLockedChats", {
60
+ get: $util.oneOfGetter($oneOfFields = ["hideLockedChats"]),
61
+ set: $util.oneOfSetter($oneOfFields)
62
+ });
63
+ /**
64
+ * ChatLockSettings _secretCode.
65
+ * @member {"secretCode"|undefined} _secretCode
66
+ * @memberof ChatLockSettings.ChatLockSettings
67
+ * @instance
68
+ */
69
+ Object.defineProperty(ChatLockSettings.prototype, "_secretCode", {
70
+ get: $util.oneOfGetter($oneOfFields = ["secretCode"]),
71
+ set: $util.oneOfSetter($oneOfFields)
72
+ });
73
+ /**
74
+ * Creates a new ChatLockSettings instance using the specified properties.
75
+ * @function create
76
+ * @memberof ChatLockSettings.ChatLockSettings
77
+ * @static
78
+ * @param {ChatLockSettings.IChatLockSettings=} [properties] Properties to set
79
+ * @returns {ChatLockSettings.ChatLockSettings} ChatLockSettings instance
80
+ */
81
+ ChatLockSettings.create = function create(properties) {
82
+ return new ChatLockSettings(properties);
83
+ };
84
+ /**
85
+ * Encodes the specified ChatLockSettings message. Does not implicitly {@link ChatLockSettings.ChatLockSettings.verify|verify} messages.
86
+ * @function encode
87
+ * @memberof ChatLockSettings.ChatLockSettings
88
+ * @static
89
+ * @param {ChatLockSettings.IChatLockSettings} message ChatLockSettings message or plain object to encode
90
+ * @param {$protobuf.Writer} [writer] Writer to encode to
91
+ * @returns {$protobuf.Writer} Writer
92
+ */
93
+ ChatLockSettings.encode = function encode(message, writer) {
94
+ if (!writer)
95
+ writer = $Writer.create();
96
+ if (message.hideLockedChats != null && Object.hasOwnProperty.call(message, "hideLockedChats"))
97
+ writer.uint32(/* id 1, wireType 0 =*/8).bool(message.hideLockedChats);
98
+ if (message.secretCode != null && Object.hasOwnProperty.call(message, "secretCode"))
99
+ $root.UserPassword.UserPassword.encode(message.secretCode, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
100
+ return writer;
101
+ };
102
+ /**
103
+ * Encodes the specified ChatLockSettings message, length delimited. Does not implicitly {@link ChatLockSettings.ChatLockSettings.verify|verify} messages.
104
+ * @function encodeDelimited
105
+ * @memberof ChatLockSettings.ChatLockSettings
106
+ * @static
107
+ * @param {ChatLockSettings.IChatLockSettings} message ChatLockSettings message or plain object to encode
108
+ * @param {$protobuf.Writer} [writer] Writer to encode to
109
+ * @returns {$protobuf.Writer} Writer
110
+ */
111
+ ChatLockSettings.encodeDelimited = function encodeDelimited(message, writer) {
112
+ return this.encode(message, writer).ldelim();
113
+ };
114
+ /**
115
+ * Decodes a ChatLockSettings message from the specified reader or buffer.
116
+ * @function decode
117
+ * @memberof ChatLockSettings.ChatLockSettings
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 {ChatLockSettings.ChatLockSettings} ChatLockSettings
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
+ ChatLockSettings.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.ChatLockSettings.ChatLockSettings();
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.hideLockedChats = reader.bool();
136
+ break;
137
+ }
138
+ case 2: {
139
+ message.secretCode = $root.UserPassword.UserPassword.decode(reader, reader.uint32());
140
+ break;
141
+ }
142
+ default:
143
+ reader.skipType(tag & 7);
144
+ break;
145
+ }
146
+ }
147
+ return message;
148
+ };
149
+ /**
150
+ * Decodes a ChatLockSettings message from the specified reader or buffer, length delimited.
151
+ * @function decodeDelimited
152
+ * @memberof ChatLockSettings.ChatLockSettings
153
+ * @static
154
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
155
+ * @returns {ChatLockSettings.ChatLockSettings} ChatLockSettings
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
+ ChatLockSettings.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 ChatLockSettings message.
166
+ * @function verify
167
+ * @memberof ChatLockSettings.ChatLockSettings
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
+ ChatLockSettings.verify = function verify(message) {
173
+ if (typeof message !== "object" || message === null)
174
+ return "object expected";
175
+ var properties = {};
176
+ if (message.hideLockedChats != null && message.hasOwnProperty("hideLockedChats")) {
177
+ properties._hideLockedChats = 1;
178
+ if (typeof message.hideLockedChats !== "boolean")
179
+ return "hideLockedChats: boolean expected";
180
+ }
181
+ if (message.secretCode != null && message.hasOwnProperty("secretCode")) {
182
+ properties._secretCode = 1;
183
+ {
184
+ var error = $root.UserPassword.UserPassword.verify(message.secretCode);
185
+ if (error)
186
+ return "secretCode." + error;
187
+ }
188
+ }
189
+ return null;
190
+ };
191
+ /**
192
+ * Creates a ChatLockSettings message from a plain object. Also converts values to their respective internal types.
193
+ * @function fromObject
194
+ * @memberof ChatLockSettings.ChatLockSettings
195
+ * @static
196
+ * @param {Object.<string,*>} object Plain object
197
+ * @returns {ChatLockSettings.ChatLockSettings} ChatLockSettings
198
+ */
199
+ ChatLockSettings.fromObject = function fromObject(object) {
200
+ if (object instanceof $root.ChatLockSettings.ChatLockSettings)
201
+ return object;
202
+ var message = new $root.ChatLockSettings.ChatLockSettings();
203
+ if (object.hideLockedChats != null)
204
+ message.hideLockedChats = Boolean(object.hideLockedChats);
205
+ if (object.secretCode != null) {
206
+ if (typeof object.secretCode !== "object")
207
+ throw TypeError(".ChatLockSettings.ChatLockSettings.secretCode: object expected");
208
+ message.secretCode = $root.UserPassword.UserPassword.fromObject(object.secretCode);
209
+ }
210
+ return message;
211
+ };
212
+ /**
213
+ * Creates a plain object from a ChatLockSettings message. Also converts values to other types if specified.
214
+ * @function toObject
215
+ * @memberof ChatLockSettings.ChatLockSettings
216
+ * @static
217
+ * @param {ChatLockSettings.ChatLockSettings} message ChatLockSettings
218
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
219
+ * @returns {Object.<string,*>} Plain object
220
+ */
221
+ ChatLockSettings.toObject = function toObject(message, options) {
222
+ if (!options)
223
+ options = {};
224
+ var object = {};
225
+ if (message.hideLockedChats != null && message.hasOwnProperty("hideLockedChats")) {
226
+ object.hideLockedChats = message.hideLockedChats;
227
+ if (options.oneofs)
228
+ object._hideLockedChats = "hideLockedChats";
229
+ }
230
+ if (message.secretCode != null && message.hasOwnProperty("secretCode")) {
231
+ object.secretCode = $root.UserPassword.UserPassword.toObject(message.secretCode, options);
232
+ if (options.oneofs)
233
+ object._secretCode = "secretCode";
234
+ }
235
+ return object;
236
+ };
237
+ /**
238
+ * Converts this ChatLockSettings to JSON.
239
+ * @function toJSON
240
+ * @memberof ChatLockSettings.ChatLockSettings
241
+ * @instance
242
+ * @returns {Object.<string,*>} JSON object
243
+ */
244
+ ChatLockSettings.prototype.toJSON = function toJSON() {
245
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
246
+ };
247
+ /**
248
+ * Gets the default type url for ChatLockSettings
249
+ * @function getTypeUrl
250
+ * @memberof ChatLockSettings.ChatLockSettings
251
+ * @static
252
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
253
+ * @returns {string} The default type url
254
+ */
255
+ ChatLockSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
256
+ if (typeUrlPrefix === undefined) {
257
+ typeUrlPrefix = "type.googleapis.com";
258
+ }
259
+ return typeUrlPrefix + "/ChatLockSettings.ChatLockSettings";
260
+ };
261
+ return ChatLockSettings;
262
+ })();
263
+ return ChatLockSettings;
264
+ })();
265
+ $root.UserPassword = (function() {
266
+ /**
267
+ * Namespace UserPassword.
268
+ * @exports UserPassword
269
+ * @namespace
270
+ */
271
+ var UserPassword = {};
272
+ UserPassword.UserPassword = (function() {
273
+ /**
274
+ * Properties of a UserPassword.
275
+ * @memberof UserPassword
276
+ * @interface IUserPassword
277
+ * @property {UserPassword.UserPassword.Encoding|null} [encoding] UserPassword encoding
278
+ * @property {UserPassword.UserPassword.Transformer|null} [transformer] UserPassword transformer
279
+ * @property {Array.<UserPassword.UserPassword.ITransformerArg>|null} [transformerArg] UserPassword transformerArg
280
+ * @property {Uint8Array|null} [transformedData] UserPassword transformedData
281
+ */
282
+ /**
283
+ * Constructs a new UserPassword.
284
+ * @memberof UserPassword
285
+ * @classdesc Represents a UserPassword.
286
+ * @implements IUserPassword
287
+ * @constructor
288
+ * @param {UserPassword.IUserPassword=} [properties] Properties to set
289
+ */
290
+ function UserPassword(properties) {
291
+ this.transformerArg = [];
292
+ if (properties)
293
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
294
+ if (properties[keys[i]] != null)
295
+ this[keys[i]] = properties[keys[i]];
296
+ }
297
+ /**
298
+ * UserPassword encoding.
299
+ * @member {UserPassword.UserPassword.Encoding|null|undefined} encoding
300
+ * @memberof UserPassword.UserPassword
301
+ * @instance
302
+ */
303
+ UserPassword.prototype.encoding = null;
304
+ /**
305
+ * UserPassword transformer.
306
+ * @member {UserPassword.UserPassword.Transformer|null|undefined} transformer
307
+ * @memberof UserPassword.UserPassword
308
+ * @instance
309
+ */
310
+ UserPassword.prototype.transformer = null;
311
+ /**
312
+ * UserPassword transformerArg.
313
+ * @member {Array.<UserPassword.UserPassword.ITransformerArg>} transformerArg
314
+ * @memberof UserPassword.UserPassword
315
+ * @instance
316
+ */
317
+ UserPassword.prototype.transformerArg = $util.emptyArray;
318
+ /**
319
+ * UserPassword transformedData.
320
+ * @member {Uint8Array|null|undefined} transformedData
321
+ * @memberof UserPassword.UserPassword
322
+ * @instance
323
+ */
324
+ UserPassword.prototype.transformedData = null;
325
+ // OneOf field names bound to virtual getters and setters
326
+ var $oneOfFields;
327
+ /**
328
+ * UserPassword _encoding.
329
+ * @member {"encoding"|undefined} _encoding
330
+ * @memberof UserPassword.UserPassword
331
+ * @instance
332
+ */
333
+ Object.defineProperty(UserPassword.prototype, "_encoding", {
334
+ get: $util.oneOfGetter($oneOfFields = ["encoding"]),
335
+ set: $util.oneOfSetter($oneOfFields)
336
+ });
337
+ /**
338
+ * UserPassword _transformer.
339
+ * @member {"transformer"|undefined} _transformer
340
+ * @memberof UserPassword.UserPassword
341
+ * @instance
342
+ */
343
+ Object.defineProperty(UserPassword.prototype, "_transformer", {
344
+ get: $util.oneOfGetter($oneOfFields = ["transformer"]),
345
+ set: $util.oneOfSetter($oneOfFields)
346
+ });
347
+ /**
348
+ * UserPassword _transformedData.
349
+ * @member {"transformedData"|undefined} _transformedData
350
+ * @memberof UserPassword.UserPassword
351
+ * @instance
352
+ */
353
+ Object.defineProperty(UserPassword.prototype, "_transformedData", {
354
+ get: $util.oneOfGetter($oneOfFields = ["transformedData"]),
355
+ set: $util.oneOfSetter($oneOfFields)
356
+ });
357
+ /**
358
+ * Creates a new UserPassword instance using the specified properties.
359
+ * @function create
360
+ * @memberof UserPassword.UserPassword
361
+ * @static
362
+ * @param {UserPassword.IUserPassword=} [properties] Properties to set
363
+ * @returns {UserPassword.UserPassword} UserPassword instance
364
+ */
365
+ UserPassword.create = function create(properties) {
366
+ return new UserPassword(properties);
367
+ };
368
+ /**
369
+ * Encodes the specified UserPassword message. Does not implicitly {@link UserPassword.UserPassword.verify|verify} messages.
370
+ * @function encode
371
+ * @memberof UserPassword.UserPassword
372
+ * @static
373
+ * @param {UserPassword.IUserPassword} message UserPassword message or plain object to encode
374
+ * @param {$protobuf.Writer} [writer] Writer to encode to
375
+ * @returns {$protobuf.Writer} Writer
376
+ */
377
+ UserPassword.encode = function encode(message, writer) {
378
+ if (!writer)
379
+ writer = $Writer.create();
380
+ if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
381
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
382
+ if (message.transformer != null && Object.hasOwnProperty.call(message, "transformer"))
383
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.transformer);
384
+ if (message.transformerArg != null && message.transformerArg.length)
385
+ for (var i = 0; i < message.transformerArg.length; ++i)
386
+ $root.UserPassword.UserPassword.TransformerArg.encode(message.transformerArg[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
387
+ if (message.transformedData != null && Object.hasOwnProperty.call(message, "transformedData"))
388
+ writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.transformedData);
389
+ return writer;
390
+ };
391
+ /**
392
+ * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link UserPassword.UserPassword.verify|verify} messages.
393
+ * @function encodeDelimited
394
+ * @memberof UserPassword.UserPassword
395
+ * @static
396
+ * @param {UserPassword.IUserPassword} message UserPassword message or plain object to encode
397
+ * @param {$protobuf.Writer} [writer] Writer to encode to
398
+ * @returns {$protobuf.Writer} Writer
399
+ */
400
+ UserPassword.encodeDelimited = function encodeDelimited(message, writer) {
401
+ return this.encode(message, writer).ldelim();
402
+ };
403
+ /**
404
+ * Decodes a UserPassword message from the specified reader or buffer.
405
+ * @function decode
406
+ * @memberof UserPassword.UserPassword
407
+ * @static
408
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
409
+ * @param {number} [length] Message length if known beforehand
410
+ * @returns {UserPassword.UserPassword} UserPassword
411
+ * @throws {Error} If the payload is not a reader or valid buffer
412
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
413
+ */
414
+ UserPassword.decode = function decode(reader, length, error) {
415
+ if (!(reader instanceof $Reader))
416
+ reader = $Reader.create(reader);
417
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword();
418
+ while (reader.pos < end) {
419
+ var tag = reader.uint32();
420
+ if (tag === error)
421
+ break;
422
+ switch (tag >>> 3) {
423
+ case 1: {
424
+ message.encoding = reader.int32();
425
+ break;
426
+ }
427
+ case 2: {
428
+ message.transformer = reader.int32();
429
+ break;
430
+ }
431
+ case 3: {
432
+ if (!(message.transformerArg && message.transformerArg.length))
433
+ message.transformerArg = [];
434
+ message.transformerArg.push($root.UserPassword.UserPassword.TransformerArg.decode(reader, reader.uint32()));
435
+ break;
436
+ }
437
+ case 4: {
438
+ message.transformedData = reader.bytes();
439
+ break;
440
+ }
441
+ default:
442
+ reader.skipType(tag & 7);
443
+ break;
444
+ }
445
+ }
446
+ return message;
447
+ };
448
+ /**
449
+ * Decodes a UserPassword message from the specified reader or buffer, length delimited.
450
+ * @function decodeDelimited
451
+ * @memberof UserPassword.UserPassword
452
+ * @static
453
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
454
+ * @returns {UserPassword.UserPassword} UserPassword
455
+ * @throws {Error} If the payload is not a reader or valid buffer
456
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
457
+ */
458
+ UserPassword.decodeDelimited = function decodeDelimited(reader) {
459
+ if (!(reader instanceof $Reader))
460
+ reader = new $Reader(reader);
461
+ return this.decode(reader, reader.uint32());
462
+ };
463
+ /**
464
+ * Verifies a UserPassword message.
465
+ * @function verify
466
+ * @memberof UserPassword.UserPassword
467
+ * @static
468
+ * @param {Object.<string,*>} message Plain object to verify
469
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
470
+ */
471
+ UserPassword.verify = function verify(message) {
472
+ if (typeof message !== "object" || message === null)
473
+ return "object expected";
474
+ var properties = {};
475
+ if (message.encoding != null && message.hasOwnProperty("encoding")) {
476
+ properties._encoding = 1;
477
+ switch (message.encoding) {
478
+ default:
479
+ return "encoding: enum value expected";
480
+ case 0:
481
+ case 1:
482
+ break;
483
+ }
484
+ }
485
+ if (message.transformer != null && message.hasOwnProperty("transformer")) {
486
+ properties._transformer = 1;
487
+ switch (message.transformer) {
488
+ default:
489
+ return "transformer: enum value expected";
490
+ case 0:
491
+ case 1:
492
+ case 2:
493
+ break;
494
+ }
495
+ }
496
+ if (message.transformerArg != null && message.hasOwnProperty("transformerArg")) {
497
+ if (!Array.isArray(message.transformerArg))
498
+ return "transformerArg: array expected";
499
+ for (var i = 0; i < message.transformerArg.length; ++i) {
500
+ var error = $root.UserPassword.UserPassword.TransformerArg.verify(message.transformerArg[i]);
501
+ if (error)
502
+ return "transformerArg." + error;
503
+ }
504
+ }
505
+ if (message.transformedData != null && message.hasOwnProperty("transformedData")) {
506
+ properties._transformedData = 1;
507
+ if (!(message.transformedData && typeof message.transformedData.length === "number" || $util.isString(message.transformedData)))
508
+ return "transformedData: buffer expected";
509
+ }
510
+ return null;
511
+ };
512
+ /**
513
+ * Creates a UserPassword message from a plain object. Also converts values to their respective internal types.
514
+ * @function fromObject
515
+ * @memberof UserPassword.UserPassword
516
+ * @static
517
+ * @param {Object.<string,*>} object Plain object
518
+ * @returns {UserPassword.UserPassword} UserPassword
519
+ */
520
+ UserPassword.fromObject = function fromObject(object) {
521
+ if (object instanceof $root.UserPassword.UserPassword)
522
+ return object;
523
+ var message = new $root.UserPassword.UserPassword();
524
+ switch (object.encoding) {
525
+ default:
526
+ if (typeof object.encoding === "number") {
527
+ message.encoding = object.encoding;
528
+ break;
529
+ }
530
+ break;
531
+ case "UTF8":
532
+ case 0:
533
+ message.encoding = 0;
534
+ break;
535
+ case "UTF8_BROKEN":
536
+ case 1:
537
+ message.encoding = 1;
538
+ break;
539
+ }
540
+ switch (object.transformer) {
541
+ default:
542
+ if (typeof object.transformer === "number") {
543
+ message.transformer = object.transformer;
544
+ break;
545
+ }
546
+ break;
547
+ case "NONE":
548
+ case 0:
549
+ message.transformer = 0;
550
+ break;
551
+ case "PBKDF2_HMAC_SHA512":
552
+ case 1:
553
+ message.transformer = 1;
554
+ break;
555
+ case "PBKDF2_HMAC_SHA384":
556
+ case 2:
557
+ message.transformer = 2;
558
+ break;
559
+ }
560
+ if (object.transformerArg) {
561
+ if (!Array.isArray(object.transformerArg))
562
+ throw TypeError(".UserPassword.UserPassword.transformerArg: array expected");
563
+ message.transformerArg = [];
564
+ for (var i = 0; i < object.transformerArg.length; ++i) {
565
+ if (typeof object.transformerArg[i] !== "object")
566
+ throw TypeError(".UserPassword.UserPassword.transformerArg: object expected");
567
+ message.transformerArg[i] = $root.UserPassword.UserPassword.TransformerArg.fromObject(object.transformerArg[i]);
568
+ }
569
+ }
570
+ if (object.transformedData != null)
571
+ if (typeof object.transformedData === "string")
572
+ $util.base64.decode(object.transformedData, message.transformedData = $util.newBuffer($util.base64.length(object.transformedData)), 0);
573
+ else if (object.transformedData.length >= 0)
574
+ message.transformedData = object.transformedData;
575
+ return message;
576
+ };
577
+ /**
578
+ * Creates a plain object from a UserPassword message. Also converts values to other types if specified.
579
+ * @function toObject
580
+ * @memberof UserPassword.UserPassword
581
+ * @static
582
+ * @param {UserPassword.UserPassword} message UserPassword
583
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
584
+ * @returns {Object.<string,*>} Plain object
585
+ */
586
+ UserPassword.toObject = function toObject(message, options) {
587
+ if (!options)
588
+ options = {};
589
+ var object = {};
590
+ if (options.arrays || options.defaults)
591
+ object.transformerArg = [];
592
+ if (message.encoding != null && message.hasOwnProperty("encoding")) {
593
+ object.encoding = options.enums === String ? $root.UserPassword.UserPassword.Encoding[message.encoding] === undefined ? message.encoding : $root.UserPassword.UserPassword.Encoding[message.encoding] : message.encoding;
594
+ if (options.oneofs)
595
+ object._encoding = "encoding";
596
+ }
597
+ if (message.transformer != null && message.hasOwnProperty("transformer")) {
598
+ object.transformer = options.enums === String ? $root.UserPassword.UserPassword.Transformer[message.transformer] === undefined ? message.transformer : $root.UserPassword.UserPassword.Transformer[message.transformer] : message.transformer;
599
+ if (options.oneofs)
600
+ object._transformer = "transformer";
601
+ }
602
+ if (message.transformerArg && message.transformerArg.length) {
603
+ object.transformerArg = [];
604
+ for (var j = 0; j < message.transformerArg.length; ++j)
605
+ object.transformerArg[j] = $root.UserPassword.UserPassword.TransformerArg.toObject(message.transformerArg[j], options);
606
+ }
607
+ if (message.transformedData != null && message.hasOwnProperty("transformedData")) {
608
+ object.transformedData = options.bytes === String ? $util.base64.encode(message.transformedData, 0, message.transformedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.transformedData) : message.transformedData;
609
+ if (options.oneofs)
610
+ object._transformedData = "transformedData";
611
+ }
612
+ return object;
613
+ };
614
+ /**
615
+ * Converts this UserPassword to JSON.
616
+ * @function toJSON
617
+ * @memberof UserPassword.UserPassword
618
+ * @instance
619
+ * @returns {Object.<string,*>} JSON object
620
+ */
621
+ UserPassword.prototype.toJSON = function toJSON() {
622
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
623
+ };
624
+ /**
625
+ * Gets the default type url for UserPassword
626
+ * @function getTypeUrl
627
+ * @memberof UserPassword.UserPassword
628
+ * @static
629
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
630
+ * @returns {string} The default type url
631
+ */
632
+ UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
633
+ if (typeUrlPrefix === undefined) {
634
+ typeUrlPrefix = "type.googleapis.com";
635
+ }
636
+ return typeUrlPrefix + "/UserPassword.UserPassword";
637
+ };
638
+ /**
639
+ * Encoding enum.
640
+ * @name UserPassword.UserPassword.Encoding
641
+ * @enum {number}
642
+ * @property {number} UTF8=0 UTF8 value
643
+ * @property {number} UTF8_BROKEN=1 UTF8_BROKEN value
644
+ */
645
+ UserPassword.Encoding = (function() {
646
+ var valuesById = {}, values = Object.create(valuesById);
647
+ values[valuesById[0] = "UTF8"] = 0;
648
+ values[valuesById[1] = "UTF8_BROKEN"] = 1;
649
+ return values;
650
+ })();
651
+ /**
652
+ * Transformer enum.
653
+ * @name UserPassword.UserPassword.Transformer
654
+ * @enum {number}
655
+ * @property {number} NONE=0 NONE value
656
+ * @property {number} PBKDF2_HMAC_SHA512=1 PBKDF2_HMAC_SHA512 value
657
+ * @property {number} PBKDF2_HMAC_SHA384=2 PBKDF2_HMAC_SHA384 value
658
+ */
659
+ UserPassword.Transformer = (function() {
660
+ var valuesById = {}, values = Object.create(valuesById);
661
+ values[valuesById[0] = "NONE"] = 0;
662
+ values[valuesById[1] = "PBKDF2_HMAC_SHA512"] = 1;
663
+ values[valuesById[2] = "PBKDF2_HMAC_SHA384"] = 2;
664
+ return values;
665
+ })();
666
+ UserPassword.TransformerArg = (function() {
667
+ /**
668
+ * Properties of a TransformerArg.
669
+ * @memberof UserPassword.UserPassword
670
+ * @interface ITransformerArg
671
+ * @property {string|null} [key] TransformerArg key
672
+ * @property {UserPassword.UserPassword.TransformerArg.IValue|null} [value] TransformerArg value
673
+ */
674
+ /**
675
+ * Constructs a new TransformerArg.
676
+ * @memberof UserPassword.UserPassword
677
+ * @classdesc Represents a TransformerArg.
678
+ * @implements ITransformerArg
679
+ * @constructor
680
+ * @param {UserPassword.UserPassword.ITransformerArg=} [properties] Properties to set
681
+ */
682
+ function TransformerArg(properties) {
683
+ if (properties)
684
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
685
+ if (properties[keys[i]] != null)
686
+ this[keys[i]] = properties[keys[i]];
687
+ }
688
+ /**
689
+ * TransformerArg key.
690
+ * @member {string|null|undefined} key
691
+ * @memberof UserPassword.UserPassword.TransformerArg
692
+ * @instance
693
+ */
694
+ TransformerArg.prototype.key = null;
695
+ /**
696
+ * TransformerArg value.
697
+ * @member {UserPassword.UserPassword.TransformerArg.IValue|null|undefined} value
698
+ * @memberof UserPassword.UserPassword.TransformerArg
699
+ * @instance
700
+ */
701
+ TransformerArg.prototype.value = null;
702
+ // OneOf field names bound to virtual getters and setters
703
+ var $oneOfFields;
704
+ /**
705
+ * TransformerArg _key.
706
+ * @member {"key"|undefined} _key
707
+ * @memberof UserPassword.UserPassword.TransformerArg
708
+ * @instance
709
+ */
710
+ Object.defineProperty(TransformerArg.prototype, "_key", {
711
+ get: $util.oneOfGetter($oneOfFields = ["key"]),
712
+ set: $util.oneOfSetter($oneOfFields)
713
+ });
714
+ /**
715
+ * TransformerArg _value.
716
+ * @member {"value"|undefined} _value
717
+ * @memberof UserPassword.UserPassword.TransformerArg
718
+ * @instance
719
+ */
720
+ Object.defineProperty(TransformerArg.prototype, "_value", {
721
+ get: $util.oneOfGetter($oneOfFields = ["value"]),
722
+ set: $util.oneOfSetter($oneOfFields)
723
+ });
724
+ /**
725
+ * Creates a new TransformerArg instance using the specified properties.
726
+ * @function create
727
+ * @memberof UserPassword.UserPassword.TransformerArg
728
+ * @static
729
+ * @param {UserPassword.UserPassword.ITransformerArg=} [properties] Properties to set
730
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg instance
731
+ */
732
+ TransformerArg.create = function create(properties) {
733
+ return new TransformerArg(properties);
734
+ };
735
+ /**
736
+ * Encodes the specified TransformerArg message. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.verify|verify} messages.
737
+ * @function encode
738
+ * @memberof UserPassword.UserPassword.TransformerArg
739
+ * @static
740
+ * @param {UserPassword.UserPassword.ITransformerArg} message TransformerArg message or plain object to encode
741
+ * @param {$protobuf.Writer} [writer] Writer to encode to
742
+ * @returns {$protobuf.Writer} Writer
743
+ */
744
+ TransformerArg.encode = function encode(message, writer) {
745
+ if (!writer)
746
+ writer = $Writer.create();
747
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
748
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
749
+ if (message.value != null && Object.hasOwnProperty.call(message, "value"))
750
+ $root.UserPassword.UserPassword.TransformerArg.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
751
+ return writer;
752
+ };
753
+ /**
754
+ * Encodes the specified TransformerArg message, length delimited. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.verify|verify} messages.
755
+ * @function encodeDelimited
756
+ * @memberof UserPassword.UserPassword.TransformerArg
757
+ * @static
758
+ * @param {UserPassword.UserPassword.ITransformerArg} message TransformerArg message or plain object to encode
759
+ * @param {$protobuf.Writer} [writer] Writer to encode to
760
+ * @returns {$protobuf.Writer} Writer
761
+ */
762
+ TransformerArg.encodeDelimited = function encodeDelimited(message, writer) {
763
+ return this.encode(message, writer).ldelim();
764
+ };
765
+ /**
766
+ * Decodes a TransformerArg message from the specified reader or buffer.
767
+ * @function decode
768
+ * @memberof UserPassword.UserPassword.TransformerArg
769
+ * @static
770
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
771
+ * @param {number} [length] Message length if known beforehand
772
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
773
+ * @throws {Error} If the payload is not a reader or valid buffer
774
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
775
+ */
776
+ TransformerArg.decode = function decode(reader, length, error) {
777
+ if (!(reader instanceof $Reader))
778
+ reader = $Reader.create(reader);
779
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword.TransformerArg();
780
+ while (reader.pos < end) {
781
+ var tag = reader.uint32();
782
+ if (tag === error)
783
+ break;
784
+ switch (tag >>> 3) {
785
+ case 1: {
786
+ message.key = reader.string();
787
+ break;
788
+ }
789
+ case 2: {
790
+ message.value = $root.UserPassword.UserPassword.TransformerArg.Value.decode(reader, reader.uint32());
791
+ break;
792
+ }
793
+ default:
794
+ reader.skipType(tag & 7);
795
+ break;
796
+ }
797
+ }
798
+ return message;
799
+ };
800
+ /**
801
+ * Decodes a TransformerArg message from the specified reader or buffer, length delimited.
802
+ * @function decodeDelimited
803
+ * @memberof UserPassword.UserPassword.TransformerArg
804
+ * @static
805
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
806
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
807
+ * @throws {Error} If the payload is not a reader or valid buffer
808
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
809
+ */
810
+ TransformerArg.decodeDelimited = function decodeDelimited(reader) {
811
+ if (!(reader instanceof $Reader))
812
+ reader = new $Reader(reader);
813
+ return this.decode(reader, reader.uint32());
814
+ };
815
+ /**
816
+ * Verifies a TransformerArg message.
817
+ * @function verify
818
+ * @memberof UserPassword.UserPassword.TransformerArg
819
+ * @static
820
+ * @param {Object.<string,*>} message Plain object to verify
821
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
822
+ */
823
+ TransformerArg.verify = function verify(message) {
824
+ if (typeof message !== "object" || message === null)
825
+ return "object expected";
826
+ var properties = {};
827
+ if (message.key != null && message.hasOwnProperty("key")) {
828
+ properties._key = 1;
829
+ if (!$util.isString(message.key))
830
+ return "key: string expected";
831
+ }
832
+ if (message.value != null && message.hasOwnProperty("value")) {
833
+ properties._value = 1;
834
+ {
835
+ var error = $root.UserPassword.UserPassword.TransformerArg.Value.verify(message.value);
836
+ if (error)
837
+ return "value." + error;
838
+ }
839
+ }
840
+ return null;
841
+ };
842
+ /**
843
+ * Creates a TransformerArg message from a plain object. Also converts values to their respective internal types.
844
+ * @function fromObject
845
+ * @memberof UserPassword.UserPassword.TransformerArg
846
+ * @static
847
+ * @param {Object.<string,*>} object Plain object
848
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
849
+ */
850
+ TransformerArg.fromObject = function fromObject(object) {
851
+ if (object instanceof $root.UserPassword.UserPassword.TransformerArg)
852
+ return object;
853
+ var message = new $root.UserPassword.UserPassword.TransformerArg();
854
+ if (object.key != null)
855
+ message.key = String(object.key);
856
+ if (object.value != null) {
857
+ if (typeof object.value !== "object")
858
+ throw TypeError(".UserPassword.UserPassword.TransformerArg.value: object expected");
859
+ message.value = $root.UserPassword.UserPassword.TransformerArg.Value.fromObject(object.value);
860
+ }
861
+ return message;
862
+ };
863
+ /**
864
+ * Creates a plain object from a TransformerArg message. Also converts values to other types if specified.
865
+ * @function toObject
866
+ * @memberof UserPassword.UserPassword.TransformerArg
867
+ * @static
868
+ * @param {UserPassword.UserPassword.TransformerArg} message TransformerArg
869
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
870
+ * @returns {Object.<string,*>} Plain object
871
+ */
872
+ TransformerArg.toObject = function toObject(message, options) {
873
+ if (!options)
874
+ options = {};
875
+ var object = {};
876
+ if (message.key != null && message.hasOwnProperty("key")) {
877
+ object.key = message.key;
878
+ if (options.oneofs)
879
+ object._key = "key";
880
+ }
881
+ if (message.value != null && message.hasOwnProperty("value")) {
882
+ object.value = $root.UserPassword.UserPassword.TransformerArg.Value.toObject(message.value, options);
883
+ if (options.oneofs)
884
+ object._value = "value";
885
+ }
886
+ return object;
887
+ };
888
+ /**
889
+ * Converts this TransformerArg to JSON.
890
+ * @function toJSON
891
+ * @memberof UserPassword.UserPassword.TransformerArg
892
+ * @instance
893
+ * @returns {Object.<string,*>} JSON object
894
+ */
895
+ TransformerArg.prototype.toJSON = function toJSON() {
896
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
897
+ };
898
+ /**
899
+ * Gets the default type url for TransformerArg
900
+ * @function getTypeUrl
901
+ * @memberof UserPassword.UserPassword.TransformerArg
902
+ * @static
903
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
904
+ * @returns {string} The default type url
905
+ */
906
+ TransformerArg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
907
+ if (typeUrlPrefix === undefined) {
908
+ typeUrlPrefix = "type.googleapis.com";
909
+ }
910
+ return typeUrlPrefix + "/UserPassword.UserPassword.TransformerArg";
911
+ };
912
+ TransformerArg.Value = (function() {
913
+ /**
914
+ * Properties of a Value.
915
+ * @memberof UserPassword.UserPassword.TransformerArg
916
+ * @interface IValue
917
+ * @property {Uint8Array|null} [asBlob] Value asBlob
918
+ * @property {number|null} [asUnsignedInteger] Value asUnsignedInteger
919
+ */
920
+ /**
921
+ * Constructs a new Value.
922
+ * @memberof UserPassword.UserPassword.TransformerArg
923
+ * @classdesc Represents a Value.
924
+ * @implements IValue
925
+ * @constructor
926
+ * @param {UserPassword.UserPassword.TransformerArg.IValue=} [properties] Properties to set
927
+ */
928
+ function Value(properties) {
929
+ if (properties)
930
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
931
+ if (properties[keys[i]] != null)
932
+ this[keys[i]] = properties[keys[i]];
933
+ }
934
+ /**
935
+ * Value asBlob.
936
+ * @member {Uint8Array|null|undefined} asBlob
937
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
938
+ * @instance
939
+ */
940
+ Value.prototype.asBlob = null;
941
+ /**
942
+ * Value asUnsignedInteger.
943
+ * @member {number|null|undefined} asUnsignedInteger
944
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
945
+ * @instance
946
+ */
947
+ Value.prototype.asUnsignedInteger = null;
948
+ // OneOf field names bound to virtual getters and setters
949
+ var $oneOfFields;
950
+ /**
951
+ * Value value.
952
+ * @member {"asBlob"|"asUnsignedInteger"|undefined} value
953
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
954
+ * @instance
955
+ */
956
+ Object.defineProperty(Value.prototype, "value", {
957
+ get: $util.oneOfGetter($oneOfFields = ["asBlob", "asUnsignedInteger"]),
958
+ set: $util.oneOfSetter($oneOfFields)
959
+ });
960
+ /**
961
+ * Creates a new Value instance using the specified properties.
962
+ * @function create
963
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
964
+ * @static
965
+ * @param {UserPassword.UserPassword.TransformerArg.IValue=} [properties] Properties to set
966
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value instance
967
+ */
968
+ Value.create = function create(properties) {
969
+ return new Value(properties);
970
+ };
971
+ /**
972
+ * Encodes the specified Value message. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.Value.verify|verify} messages.
973
+ * @function encode
974
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
975
+ * @static
976
+ * @param {UserPassword.UserPassword.TransformerArg.IValue} message Value message or plain object to encode
977
+ * @param {$protobuf.Writer} [writer] Writer to encode to
978
+ * @returns {$protobuf.Writer} Writer
979
+ */
980
+ Value.encode = function encode(message, writer) {
981
+ if (!writer)
982
+ writer = $Writer.create();
983
+ if (message.asBlob != null && Object.hasOwnProperty.call(message, "asBlob"))
984
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.asBlob);
985
+ if (message.asUnsignedInteger != null && Object.hasOwnProperty.call(message, "asUnsignedInteger"))
986
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.asUnsignedInteger);
987
+ return writer;
988
+ };
989
+ /**
990
+ * Encodes the specified Value message, length delimited. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.Value.verify|verify} messages.
991
+ * @function encodeDelimited
992
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
993
+ * @static
994
+ * @param {UserPassword.UserPassword.TransformerArg.IValue} message Value message or plain object to encode
995
+ * @param {$protobuf.Writer} [writer] Writer to encode to
996
+ * @returns {$protobuf.Writer} Writer
997
+ */
998
+ Value.encodeDelimited = function encodeDelimited(message, writer) {
999
+ return this.encode(message, writer).ldelim();
1000
+ };
1001
+ /**
1002
+ * Decodes a Value message from the specified reader or buffer.
1003
+ * @function decode
1004
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1005
+ * @static
1006
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1007
+ * @param {number} [length] Message length if known beforehand
1008
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
1009
+ * @throws {Error} If the payload is not a reader or valid buffer
1010
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1011
+ */
1012
+ Value.decode = function decode(reader, length, error) {
1013
+ if (!(reader instanceof $Reader))
1014
+ reader = $Reader.create(reader);
1015
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword.TransformerArg.Value();
1016
+ while (reader.pos < end) {
1017
+ var tag = reader.uint32();
1018
+ if (tag === error)
1019
+ break;
1020
+ switch (tag >>> 3) {
1021
+ case 1: {
1022
+ message.asBlob = reader.bytes();
1023
+ break;
1024
+ }
1025
+ case 2: {
1026
+ message.asUnsignedInteger = reader.uint32();
1027
+ break;
1028
+ }
1029
+ default:
1030
+ reader.skipType(tag & 7);
1031
+ break;
1032
+ }
1033
+ }
1034
+ return message;
1035
+ };
1036
+ /**
1037
+ * Decodes a Value message from the specified reader or buffer, length delimited.
1038
+ * @function decodeDelimited
1039
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1040
+ * @static
1041
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1042
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
1043
+ * @throws {Error} If the payload is not a reader or valid buffer
1044
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1045
+ */
1046
+ Value.decodeDelimited = function decodeDelimited(reader) {
1047
+ if (!(reader instanceof $Reader))
1048
+ reader = new $Reader(reader);
1049
+ return this.decode(reader, reader.uint32());
1050
+ };
1051
+ /**
1052
+ * Verifies a Value message.
1053
+ * @function verify
1054
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1055
+ * @static
1056
+ * @param {Object.<string,*>} message Plain object to verify
1057
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1058
+ */
1059
+ Value.verify = function verify(message) {
1060
+ if (typeof message !== "object" || message === null)
1061
+ return "object expected";
1062
+ var properties = {};
1063
+ if (message.asBlob != null && message.hasOwnProperty("asBlob")) {
1064
+ properties.value = 1;
1065
+ if (!(message.asBlob && typeof message.asBlob.length === "number" || $util.isString(message.asBlob)))
1066
+ return "asBlob: buffer expected";
1067
+ }
1068
+ if (message.asUnsignedInteger != null && message.hasOwnProperty("asUnsignedInteger")) {
1069
+ if (properties.value === 1)
1070
+ return "value: multiple values";
1071
+ properties.value = 1;
1072
+ if (!$util.isInteger(message.asUnsignedInteger))
1073
+ return "asUnsignedInteger: integer expected";
1074
+ }
1075
+ return null;
1076
+ };
1077
+ /**
1078
+ * Creates a Value message from a plain object. Also converts values to their respective internal types.
1079
+ * @function fromObject
1080
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1081
+ * @static
1082
+ * @param {Object.<string,*>} object Plain object
1083
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
1084
+ */
1085
+ Value.fromObject = function fromObject(object) {
1086
+ if (object instanceof $root.UserPassword.UserPassword.TransformerArg.Value)
1087
+ return object;
1088
+ var message = new $root.UserPassword.UserPassword.TransformerArg.Value();
1089
+ if (object.asBlob != null)
1090
+ if (typeof object.asBlob === "string")
1091
+ $util.base64.decode(object.asBlob, message.asBlob = $util.newBuffer($util.base64.length(object.asBlob)), 0);
1092
+ else if (object.asBlob.length >= 0)
1093
+ message.asBlob = object.asBlob;
1094
+ if (object.asUnsignedInteger != null)
1095
+ message.asUnsignedInteger = object.asUnsignedInteger >>> 0;
1096
+ return message;
1097
+ };
1098
+ /**
1099
+ * Creates a plain object from a Value message. Also converts values to other types if specified.
1100
+ * @function toObject
1101
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1102
+ * @static
1103
+ * @param {UserPassword.UserPassword.TransformerArg.Value} message Value
1104
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1105
+ * @returns {Object.<string,*>} Plain object
1106
+ */
1107
+ Value.toObject = function toObject(message, options) {
1108
+ if (!options)
1109
+ options = {};
1110
+ var object = {};
1111
+ if (message.asBlob != null && message.hasOwnProperty("asBlob")) {
1112
+ object.asBlob = options.bytes === String ? $util.base64.encode(message.asBlob, 0, message.asBlob.length) : options.bytes === Array ? Array.prototype.slice.call(message.asBlob) : message.asBlob;
1113
+ if (options.oneofs)
1114
+ object.value = "asBlob";
1115
+ }
1116
+ if (message.asUnsignedInteger != null && message.hasOwnProperty("asUnsignedInteger")) {
1117
+ object.asUnsignedInteger = message.asUnsignedInteger;
1118
+ if (options.oneofs)
1119
+ object.value = "asUnsignedInteger";
1120
+ }
1121
+ return object;
1122
+ };
1123
+ /**
1124
+ * Converts this Value to JSON.
1125
+ * @function toJSON
1126
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1127
+ * @instance
1128
+ * @returns {Object.<string,*>} JSON object
1129
+ */
1130
+ Value.prototype.toJSON = function toJSON() {
1131
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1132
+ };
1133
+ /**
1134
+ * Gets the default type url for Value
1135
+ * @function getTypeUrl
1136
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
1137
+ * @static
1138
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1139
+ * @returns {string} The default type url
1140
+ */
1141
+ Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1142
+ if (typeUrlPrefix === undefined) {
1143
+ typeUrlPrefix = "type.googleapis.com";
1144
+ }
1145
+ return typeUrlPrefix + "/UserPassword.UserPassword.TransformerArg.Value";
1146
+ };
1147
+ return Value;
1148
+ })();
1149
+ return TransformerArg;
1150
+ })();
1151
+ return UserPassword;
1152
+ })();
1153
+ return UserPassword;
1154
+ })();
1155
+ module.exports = $root;