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,898 @@
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.UserPassword = (function() {
9
+ /**
10
+ * Namespace UserPassword.
11
+ * @exports UserPassword
12
+ * @namespace
13
+ */
14
+ var UserPassword = {};
15
+ UserPassword.UserPassword = (function() {
16
+ /**
17
+ * Properties of a UserPassword.
18
+ * @memberof UserPassword
19
+ * @interface IUserPassword
20
+ * @property {UserPassword.UserPassword.Encoding|null} [encoding] UserPassword encoding
21
+ * @property {UserPassword.UserPassword.Transformer|null} [transformer] UserPassword transformer
22
+ * @property {Array.<UserPassword.UserPassword.ITransformerArg>|null} [transformerArg] UserPassword transformerArg
23
+ * @property {Uint8Array|null} [transformedData] UserPassword transformedData
24
+ */
25
+ /**
26
+ * Constructs a new UserPassword.
27
+ * @memberof UserPassword
28
+ * @classdesc Represents a UserPassword.
29
+ * @implements IUserPassword
30
+ * @constructor
31
+ * @param {UserPassword.IUserPassword=} [properties] Properties to set
32
+ */
33
+ function UserPassword(properties) {
34
+ this.transformerArg = [];
35
+ if (properties)
36
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
37
+ if (properties[keys[i]] != null)
38
+ this[keys[i]] = properties[keys[i]];
39
+ }
40
+ /**
41
+ * UserPassword encoding.
42
+ * @member {UserPassword.UserPassword.Encoding|null|undefined} encoding
43
+ * @memberof UserPassword.UserPassword
44
+ * @instance
45
+ */
46
+ UserPassword.prototype.encoding = null;
47
+ /**
48
+ * UserPassword transformer.
49
+ * @member {UserPassword.UserPassword.Transformer|null|undefined} transformer
50
+ * @memberof UserPassword.UserPassword
51
+ * @instance
52
+ */
53
+ UserPassword.prototype.transformer = null;
54
+ /**
55
+ * UserPassword transformerArg.
56
+ * @member {Array.<UserPassword.UserPassword.ITransformerArg>} transformerArg
57
+ * @memberof UserPassword.UserPassword
58
+ * @instance
59
+ */
60
+ UserPassword.prototype.transformerArg = $util.emptyArray;
61
+ /**
62
+ * UserPassword transformedData.
63
+ * @member {Uint8Array|null|undefined} transformedData
64
+ * @memberof UserPassword.UserPassword
65
+ * @instance
66
+ */
67
+ UserPassword.prototype.transformedData = null;
68
+ // OneOf field names bound to virtual getters and setters
69
+ var $oneOfFields;
70
+ /**
71
+ * UserPassword _encoding.
72
+ * @member {"encoding"|undefined} _encoding
73
+ * @memberof UserPassword.UserPassword
74
+ * @instance
75
+ */
76
+ Object.defineProperty(UserPassword.prototype, "_encoding", {
77
+ get: $util.oneOfGetter($oneOfFields = ["encoding"]),
78
+ set: $util.oneOfSetter($oneOfFields)
79
+ });
80
+ /**
81
+ * UserPassword _transformer.
82
+ * @member {"transformer"|undefined} _transformer
83
+ * @memberof UserPassword.UserPassword
84
+ * @instance
85
+ */
86
+ Object.defineProperty(UserPassword.prototype, "_transformer", {
87
+ get: $util.oneOfGetter($oneOfFields = ["transformer"]),
88
+ set: $util.oneOfSetter($oneOfFields)
89
+ });
90
+ /**
91
+ * UserPassword _transformedData.
92
+ * @member {"transformedData"|undefined} _transformedData
93
+ * @memberof UserPassword.UserPassword
94
+ * @instance
95
+ */
96
+ Object.defineProperty(UserPassword.prototype, "_transformedData", {
97
+ get: $util.oneOfGetter($oneOfFields = ["transformedData"]),
98
+ set: $util.oneOfSetter($oneOfFields)
99
+ });
100
+ /**
101
+ * Creates a new UserPassword instance using the specified properties.
102
+ * @function create
103
+ * @memberof UserPassword.UserPassword
104
+ * @static
105
+ * @param {UserPassword.IUserPassword=} [properties] Properties to set
106
+ * @returns {UserPassword.UserPassword} UserPassword instance
107
+ */
108
+ UserPassword.create = function create(properties) {
109
+ return new UserPassword(properties);
110
+ };
111
+ /**
112
+ * Encodes the specified UserPassword message. Does not implicitly {@link UserPassword.UserPassword.verify|verify} messages.
113
+ * @function encode
114
+ * @memberof UserPassword.UserPassword
115
+ * @static
116
+ * @param {UserPassword.IUserPassword} message UserPassword message or plain object to encode
117
+ * @param {$protobuf.Writer} [writer] Writer to encode to
118
+ * @returns {$protobuf.Writer} Writer
119
+ */
120
+ UserPassword.encode = function encode(message, writer) {
121
+ if (!writer)
122
+ writer = $Writer.create();
123
+ if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
124
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
125
+ if (message.transformer != null && Object.hasOwnProperty.call(message, "transformer"))
126
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.transformer);
127
+ if (message.transformerArg != null && message.transformerArg.length)
128
+ for (var i = 0; i < message.transformerArg.length; ++i)
129
+ $root.UserPassword.UserPassword.TransformerArg.encode(message.transformerArg[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
130
+ if (message.transformedData != null && Object.hasOwnProperty.call(message, "transformedData"))
131
+ writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.transformedData);
132
+ return writer;
133
+ };
134
+ /**
135
+ * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link UserPassword.UserPassword.verify|verify} messages.
136
+ * @function encodeDelimited
137
+ * @memberof UserPassword.UserPassword
138
+ * @static
139
+ * @param {UserPassword.IUserPassword} message UserPassword message or plain object to encode
140
+ * @param {$protobuf.Writer} [writer] Writer to encode to
141
+ * @returns {$protobuf.Writer} Writer
142
+ */
143
+ UserPassword.encodeDelimited = function encodeDelimited(message, writer) {
144
+ return this.encode(message, writer).ldelim();
145
+ };
146
+ /**
147
+ * Decodes a UserPassword message from the specified reader or buffer.
148
+ * @function decode
149
+ * @memberof UserPassword.UserPassword
150
+ * @static
151
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
152
+ * @param {number} [length] Message length if known beforehand
153
+ * @returns {UserPassword.UserPassword} UserPassword
154
+ * @throws {Error} If the payload is not a reader or valid buffer
155
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
156
+ */
157
+ UserPassword.decode = function decode(reader, length, error) {
158
+ if (!(reader instanceof $Reader))
159
+ reader = $Reader.create(reader);
160
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword();
161
+ while (reader.pos < end) {
162
+ var tag = reader.uint32();
163
+ if (tag === error)
164
+ break;
165
+ switch (tag >>> 3) {
166
+ case 1: {
167
+ message.encoding = reader.int32();
168
+ break;
169
+ }
170
+ case 2: {
171
+ message.transformer = reader.int32();
172
+ break;
173
+ }
174
+ case 3: {
175
+ if (!(message.transformerArg && message.transformerArg.length))
176
+ message.transformerArg = [];
177
+ message.transformerArg.push($root.UserPassword.UserPassword.TransformerArg.decode(reader, reader.uint32()));
178
+ break;
179
+ }
180
+ case 4: {
181
+ message.transformedData = reader.bytes();
182
+ break;
183
+ }
184
+ default:
185
+ reader.skipType(tag & 7);
186
+ break;
187
+ }
188
+ }
189
+ return message;
190
+ };
191
+ /**
192
+ * Decodes a UserPassword message from the specified reader or buffer, length delimited.
193
+ * @function decodeDelimited
194
+ * @memberof UserPassword.UserPassword
195
+ * @static
196
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
197
+ * @returns {UserPassword.UserPassword} UserPassword
198
+ * @throws {Error} If the payload is not a reader or valid buffer
199
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
200
+ */
201
+ UserPassword.decodeDelimited = function decodeDelimited(reader) {
202
+ if (!(reader instanceof $Reader))
203
+ reader = new $Reader(reader);
204
+ return this.decode(reader, reader.uint32());
205
+ };
206
+ /**
207
+ * Verifies a UserPassword message.
208
+ * @function verify
209
+ * @memberof UserPassword.UserPassword
210
+ * @static
211
+ * @param {Object.<string,*>} message Plain object to verify
212
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
213
+ */
214
+ UserPassword.verify = function verify(message) {
215
+ if (typeof message !== "object" || message === null)
216
+ return "object expected";
217
+ var properties = {};
218
+ if (message.encoding != null && message.hasOwnProperty("encoding")) {
219
+ properties._encoding = 1;
220
+ switch (message.encoding) {
221
+ default:
222
+ return "encoding: enum value expected";
223
+ case 0:
224
+ case 1:
225
+ break;
226
+ }
227
+ }
228
+ if (message.transformer != null && message.hasOwnProperty("transformer")) {
229
+ properties._transformer = 1;
230
+ switch (message.transformer) {
231
+ default:
232
+ return "transformer: enum value expected";
233
+ case 0:
234
+ case 1:
235
+ case 2:
236
+ break;
237
+ }
238
+ }
239
+ if (message.transformerArg != null && message.hasOwnProperty("transformerArg")) {
240
+ if (!Array.isArray(message.transformerArg))
241
+ return "transformerArg: array expected";
242
+ for (var i = 0; i < message.transformerArg.length; ++i) {
243
+ var error = $root.UserPassword.UserPassword.TransformerArg.verify(message.transformerArg[i]);
244
+ if (error)
245
+ return "transformerArg." + error;
246
+ }
247
+ }
248
+ if (message.transformedData != null && message.hasOwnProperty("transformedData")) {
249
+ properties._transformedData = 1;
250
+ if (!(message.transformedData && typeof message.transformedData.length === "number" || $util.isString(message.transformedData)))
251
+ return "transformedData: buffer expected";
252
+ }
253
+ return null;
254
+ };
255
+ /**
256
+ * Creates a UserPassword message from a plain object. Also converts values to their respective internal types.
257
+ * @function fromObject
258
+ * @memberof UserPassword.UserPassword
259
+ * @static
260
+ * @param {Object.<string,*>} object Plain object
261
+ * @returns {UserPassword.UserPassword} UserPassword
262
+ */
263
+ UserPassword.fromObject = function fromObject(object) {
264
+ if (object instanceof $root.UserPassword.UserPassword)
265
+ return object;
266
+ var message = new $root.UserPassword.UserPassword();
267
+ switch (object.encoding) {
268
+ default:
269
+ if (typeof object.encoding === "number") {
270
+ message.encoding = object.encoding;
271
+ break;
272
+ }
273
+ break;
274
+ case "UTF8":
275
+ case 0:
276
+ message.encoding = 0;
277
+ break;
278
+ case "UTF8_BROKEN":
279
+ case 1:
280
+ message.encoding = 1;
281
+ break;
282
+ }
283
+ switch (object.transformer) {
284
+ default:
285
+ if (typeof object.transformer === "number") {
286
+ message.transformer = object.transformer;
287
+ break;
288
+ }
289
+ break;
290
+ case "NONE":
291
+ case 0:
292
+ message.transformer = 0;
293
+ break;
294
+ case "PBKDF2_HMAC_SHA512":
295
+ case 1:
296
+ message.transformer = 1;
297
+ break;
298
+ case "PBKDF2_HMAC_SHA384":
299
+ case 2:
300
+ message.transformer = 2;
301
+ break;
302
+ }
303
+ if (object.transformerArg) {
304
+ if (!Array.isArray(object.transformerArg))
305
+ throw TypeError(".UserPassword.UserPassword.transformerArg: array expected");
306
+ message.transformerArg = [];
307
+ for (var i = 0; i < object.transformerArg.length; ++i) {
308
+ if (typeof object.transformerArg[i] !== "object")
309
+ throw TypeError(".UserPassword.UserPassword.transformerArg: object expected");
310
+ message.transformerArg[i] = $root.UserPassword.UserPassword.TransformerArg.fromObject(object.transformerArg[i]);
311
+ }
312
+ }
313
+ if (object.transformedData != null)
314
+ if (typeof object.transformedData === "string")
315
+ $util.base64.decode(object.transformedData, message.transformedData = $util.newBuffer($util.base64.length(object.transformedData)), 0);
316
+ else if (object.transformedData.length >= 0)
317
+ message.transformedData = object.transformedData;
318
+ return message;
319
+ };
320
+ /**
321
+ * Creates a plain object from a UserPassword message. Also converts values to other types if specified.
322
+ * @function toObject
323
+ * @memberof UserPassword.UserPassword
324
+ * @static
325
+ * @param {UserPassword.UserPassword} message UserPassword
326
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
327
+ * @returns {Object.<string,*>} Plain object
328
+ */
329
+ UserPassword.toObject = function toObject(message, options) {
330
+ if (!options)
331
+ options = {};
332
+ var object = {};
333
+ if (options.arrays || options.defaults)
334
+ object.transformerArg = [];
335
+ if (message.encoding != null && message.hasOwnProperty("encoding")) {
336
+ object.encoding = options.enums === String ? $root.UserPassword.UserPassword.Encoding[message.encoding] === undefined ? message.encoding : $root.UserPassword.UserPassword.Encoding[message.encoding] : message.encoding;
337
+ if (options.oneofs)
338
+ object._encoding = "encoding";
339
+ }
340
+ if (message.transformer != null && message.hasOwnProperty("transformer")) {
341
+ object.transformer = options.enums === String ? $root.UserPassword.UserPassword.Transformer[message.transformer] === undefined ? message.transformer : $root.UserPassword.UserPassword.Transformer[message.transformer] : message.transformer;
342
+ if (options.oneofs)
343
+ object._transformer = "transformer";
344
+ }
345
+ if (message.transformerArg && message.transformerArg.length) {
346
+ object.transformerArg = [];
347
+ for (var j = 0; j < message.transformerArg.length; ++j)
348
+ object.transformerArg[j] = $root.UserPassword.UserPassword.TransformerArg.toObject(message.transformerArg[j], options);
349
+ }
350
+ if (message.transformedData != null && message.hasOwnProperty("transformedData")) {
351
+ 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;
352
+ if (options.oneofs)
353
+ object._transformedData = "transformedData";
354
+ }
355
+ return object;
356
+ };
357
+ /**
358
+ * Converts this UserPassword to JSON.
359
+ * @function toJSON
360
+ * @memberof UserPassword.UserPassword
361
+ * @instance
362
+ * @returns {Object.<string,*>} JSON object
363
+ */
364
+ UserPassword.prototype.toJSON = function toJSON() {
365
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
366
+ };
367
+ /**
368
+ * Gets the default type url for UserPassword
369
+ * @function getTypeUrl
370
+ * @memberof UserPassword.UserPassword
371
+ * @static
372
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
373
+ * @returns {string} The default type url
374
+ */
375
+ UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
376
+ if (typeUrlPrefix === undefined) {
377
+ typeUrlPrefix = "type.googleapis.com";
378
+ }
379
+ return typeUrlPrefix + "/UserPassword.UserPassword";
380
+ };
381
+ /**
382
+ * Encoding enum.
383
+ * @name UserPassword.UserPassword.Encoding
384
+ * @enum {number}
385
+ * @property {number} UTF8=0 UTF8 value
386
+ * @property {number} UTF8_BROKEN=1 UTF8_BROKEN value
387
+ */
388
+ UserPassword.Encoding = (function() {
389
+ var valuesById = {}, values = Object.create(valuesById);
390
+ values[valuesById[0] = "UTF8"] = 0;
391
+ values[valuesById[1] = "UTF8_BROKEN"] = 1;
392
+ return values;
393
+ })();
394
+ /**
395
+ * Transformer enum.
396
+ * @name UserPassword.UserPassword.Transformer
397
+ * @enum {number}
398
+ * @property {number} NONE=0 NONE value
399
+ * @property {number} PBKDF2_HMAC_SHA512=1 PBKDF2_HMAC_SHA512 value
400
+ * @property {number} PBKDF2_HMAC_SHA384=2 PBKDF2_HMAC_SHA384 value
401
+ */
402
+ UserPassword.Transformer = (function() {
403
+ var valuesById = {}, values = Object.create(valuesById);
404
+ values[valuesById[0] = "NONE"] = 0;
405
+ values[valuesById[1] = "PBKDF2_HMAC_SHA512"] = 1;
406
+ values[valuesById[2] = "PBKDF2_HMAC_SHA384"] = 2;
407
+ return values;
408
+ })();
409
+ UserPassword.TransformerArg = (function() {
410
+ /**
411
+ * Properties of a TransformerArg.
412
+ * @memberof UserPassword.UserPassword
413
+ * @interface ITransformerArg
414
+ * @property {string|null} [key] TransformerArg key
415
+ * @property {UserPassword.UserPassword.TransformerArg.IValue|null} [value] TransformerArg value
416
+ */
417
+ /**
418
+ * Constructs a new TransformerArg.
419
+ * @memberof UserPassword.UserPassword
420
+ * @classdesc Represents a TransformerArg.
421
+ * @implements ITransformerArg
422
+ * @constructor
423
+ * @param {UserPassword.UserPassword.ITransformerArg=} [properties] Properties to set
424
+ */
425
+ function TransformerArg(properties) {
426
+ if (properties)
427
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
428
+ if (properties[keys[i]] != null)
429
+ this[keys[i]] = properties[keys[i]];
430
+ }
431
+ /**
432
+ * TransformerArg key.
433
+ * @member {string|null|undefined} key
434
+ * @memberof UserPassword.UserPassword.TransformerArg
435
+ * @instance
436
+ */
437
+ TransformerArg.prototype.key = null;
438
+ /**
439
+ * TransformerArg value.
440
+ * @member {UserPassword.UserPassword.TransformerArg.IValue|null|undefined} value
441
+ * @memberof UserPassword.UserPassword.TransformerArg
442
+ * @instance
443
+ */
444
+ TransformerArg.prototype.value = null;
445
+ // OneOf field names bound to virtual getters and setters
446
+ var $oneOfFields;
447
+ /**
448
+ * TransformerArg _key.
449
+ * @member {"key"|undefined} _key
450
+ * @memberof UserPassword.UserPassword.TransformerArg
451
+ * @instance
452
+ */
453
+ Object.defineProperty(TransformerArg.prototype, "_key", {
454
+ get: $util.oneOfGetter($oneOfFields = ["key"]),
455
+ set: $util.oneOfSetter($oneOfFields)
456
+ });
457
+ /**
458
+ * TransformerArg _value.
459
+ * @member {"value"|undefined} _value
460
+ * @memberof UserPassword.UserPassword.TransformerArg
461
+ * @instance
462
+ */
463
+ Object.defineProperty(TransformerArg.prototype, "_value", {
464
+ get: $util.oneOfGetter($oneOfFields = ["value"]),
465
+ set: $util.oneOfSetter($oneOfFields)
466
+ });
467
+ /**
468
+ * Creates a new TransformerArg instance using the specified properties.
469
+ * @function create
470
+ * @memberof UserPassword.UserPassword.TransformerArg
471
+ * @static
472
+ * @param {UserPassword.UserPassword.ITransformerArg=} [properties] Properties to set
473
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg instance
474
+ */
475
+ TransformerArg.create = function create(properties) {
476
+ return new TransformerArg(properties);
477
+ };
478
+ /**
479
+ * Encodes the specified TransformerArg message. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.verify|verify} messages.
480
+ * @function encode
481
+ * @memberof UserPassword.UserPassword.TransformerArg
482
+ * @static
483
+ * @param {UserPassword.UserPassword.ITransformerArg} message TransformerArg message or plain object to encode
484
+ * @param {$protobuf.Writer} [writer] Writer to encode to
485
+ * @returns {$protobuf.Writer} Writer
486
+ */
487
+ TransformerArg.encode = function encode(message, writer) {
488
+ if (!writer)
489
+ writer = $Writer.create();
490
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
491
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
492
+ if (message.value != null && Object.hasOwnProperty.call(message, "value"))
493
+ $root.UserPassword.UserPassword.TransformerArg.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
494
+ return writer;
495
+ };
496
+ /**
497
+ * Encodes the specified TransformerArg message, length delimited. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.verify|verify} messages.
498
+ * @function encodeDelimited
499
+ * @memberof UserPassword.UserPassword.TransformerArg
500
+ * @static
501
+ * @param {UserPassword.UserPassword.ITransformerArg} message TransformerArg message or plain object to encode
502
+ * @param {$protobuf.Writer} [writer] Writer to encode to
503
+ * @returns {$protobuf.Writer} Writer
504
+ */
505
+ TransformerArg.encodeDelimited = function encodeDelimited(message, writer) {
506
+ return this.encode(message, writer).ldelim();
507
+ };
508
+ /**
509
+ * Decodes a TransformerArg message from the specified reader or buffer.
510
+ * @function decode
511
+ * @memberof UserPassword.UserPassword.TransformerArg
512
+ * @static
513
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
514
+ * @param {number} [length] Message length if known beforehand
515
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
516
+ * @throws {Error} If the payload is not a reader or valid buffer
517
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
518
+ */
519
+ TransformerArg.decode = function decode(reader, length, error) {
520
+ if (!(reader instanceof $Reader))
521
+ reader = $Reader.create(reader);
522
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword.TransformerArg();
523
+ while (reader.pos < end) {
524
+ var tag = reader.uint32();
525
+ if (tag === error)
526
+ break;
527
+ switch (tag >>> 3) {
528
+ case 1: {
529
+ message.key = reader.string();
530
+ break;
531
+ }
532
+ case 2: {
533
+ message.value = $root.UserPassword.UserPassword.TransformerArg.Value.decode(reader, reader.uint32());
534
+ break;
535
+ }
536
+ default:
537
+ reader.skipType(tag & 7);
538
+ break;
539
+ }
540
+ }
541
+ return message;
542
+ };
543
+ /**
544
+ * Decodes a TransformerArg message from the specified reader or buffer, length delimited.
545
+ * @function decodeDelimited
546
+ * @memberof UserPassword.UserPassword.TransformerArg
547
+ * @static
548
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
549
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
550
+ * @throws {Error} If the payload is not a reader or valid buffer
551
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
552
+ */
553
+ TransformerArg.decodeDelimited = function decodeDelimited(reader) {
554
+ if (!(reader instanceof $Reader))
555
+ reader = new $Reader(reader);
556
+ return this.decode(reader, reader.uint32());
557
+ };
558
+ /**
559
+ * Verifies a TransformerArg message.
560
+ * @function verify
561
+ * @memberof UserPassword.UserPassword.TransformerArg
562
+ * @static
563
+ * @param {Object.<string,*>} message Plain object to verify
564
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
565
+ */
566
+ TransformerArg.verify = function verify(message) {
567
+ if (typeof message !== "object" || message === null)
568
+ return "object expected";
569
+ var properties = {};
570
+ if (message.key != null && message.hasOwnProperty("key")) {
571
+ properties._key = 1;
572
+ if (!$util.isString(message.key))
573
+ return "key: string expected";
574
+ }
575
+ if (message.value != null && message.hasOwnProperty("value")) {
576
+ properties._value = 1;
577
+ {
578
+ var error = $root.UserPassword.UserPassword.TransformerArg.Value.verify(message.value);
579
+ if (error)
580
+ return "value." + error;
581
+ }
582
+ }
583
+ return null;
584
+ };
585
+ /**
586
+ * Creates a TransformerArg message from a plain object. Also converts values to their respective internal types.
587
+ * @function fromObject
588
+ * @memberof UserPassword.UserPassword.TransformerArg
589
+ * @static
590
+ * @param {Object.<string,*>} object Plain object
591
+ * @returns {UserPassword.UserPassword.TransformerArg} TransformerArg
592
+ */
593
+ TransformerArg.fromObject = function fromObject(object) {
594
+ if (object instanceof $root.UserPassword.UserPassword.TransformerArg)
595
+ return object;
596
+ var message = new $root.UserPassword.UserPassword.TransformerArg();
597
+ if (object.key != null)
598
+ message.key = String(object.key);
599
+ if (object.value != null) {
600
+ if (typeof object.value !== "object")
601
+ throw TypeError(".UserPassword.UserPassword.TransformerArg.value: object expected");
602
+ message.value = $root.UserPassword.UserPassword.TransformerArg.Value.fromObject(object.value);
603
+ }
604
+ return message;
605
+ };
606
+ /**
607
+ * Creates a plain object from a TransformerArg message. Also converts values to other types if specified.
608
+ * @function toObject
609
+ * @memberof UserPassword.UserPassword.TransformerArg
610
+ * @static
611
+ * @param {UserPassword.UserPassword.TransformerArg} message TransformerArg
612
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
613
+ * @returns {Object.<string,*>} Plain object
614
+ */
615
+ TransformerArg.toObject = function toObject(message, options) {
616
+ if (!options)
617
+ options = {};
618
+ var object = {};
619
+ if (message.key != null && message.hasOwnProperty("key")) {
620
+ object.key = message.key;
621
+ if (options.oneofs)
622
+ object._key = "key";
623
+ }
624
+ if (message.value != null && message.hasOwnProperty("value")) {
625
+ object.value = $root.UserPassword.UserPassword.TransformerArg.Value.toObject(message.value, options);
626
+ if (options.oneofs)
627
+ object._value = "value";
628
+ }
629
+ return object;
630
+ };
631
+ /**
632
+ * Converts this TransformerArg to JSON.
633
+ * @function toJSON
634
+ * @memberof UserPassword.UserPassword.TransformerArg
635
+ * @instance
636
+ * @returns {Object.<string,*>} JSON object
637
+ */
638
+ TransformerArg.prototype.toJSON = function toJSON() {
639
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
640
+ };
641
+ /**
642
+ * Gets the default type url for TransformerArg
643
+ * @function getTypeUrl
644
+ * @memberof UserPassword.UserPassword.TransformerArg
645
+ * @static
646
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
647
+ * @returns {string} The default type url
648
+ */
649
+ TransformerArg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
650
+ if (typeUrlPrefix === undefined) {
651
+ typeUrlPrefix = "type.googleapis.com";
652
+ }
653
+ return typeUrlPrefix + "/UserPassword.UserPassword.TransformerArg";
654
+ };
655
+ TransformerArg.Value = (function() {
656
+ /**
657
+ * Properties of a Value.
658
+ * @memberof UserPassword.UserPassword.TransformerArg
659
+ * @interface IValue
660
+ * @property {Uint8Array|null} [asBlob] Value asBlob
661
+ * @property {number|null} [asUnsignedInteger] Value asUnsignedInteger
662
+ */
663
+ /**
664
+ * Constructs a new Value.
665
+ * @memberof UserPassword.UserPassword.TransformerArg
666
+ * @classdesc Represents a Value.
667
+ * @implements IValue
668
+ * @constructor
669
+ * @param {UserPassword.UserPassword.TransformerArg.IValue=} [properties] Properties to set
670
+ */
671
+ function Value(properties) {
672
+ if (properties)
673
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
674
+ if (properties[keys[i]] != null)
675
+ this[keys[i]] = properties[keys[i]];
676
+ }
677
+ /**
678
+ * Value asBlob.
679
+ * @member {Uint8Array|null|undefined} asBlob
680
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
681
+ * @instance
682
+ */
683
+ Value.prototype.asBlob = null;
684
+ /**
685
+ * Value asUnsignedInteger.
686
+ * @member {number|null|undefined} asUnsignedInteger
687
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
688
+ * @instance
689
+ */
690
+ Value.prototype.asUnsignedInteger = null;
691
+ // OneOf field names bound to virtual getters and setters
692
+ var $oneOfFields;
693
+ /**
694
+ * Value value.
695
+ * @member {"asBlob"|"asUnsignedInteger"|undefined} value
696
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
697
+ * @instance
698
+ */
699
+ Object.defineProperty(Value.prototype, "value", {
700
+ get: $util.oneOfGetter($oneOfFields = ["asBlob", "asUnsignedInteger"]),
701
+ set: $util.oneOfSetter($oneOfFields)
702
+ });
703
+ /**
704
+ * Creates a new Value instance using the specified properties.
705
+ * @function create
706
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
707
+ * @static
708
+ * @param {UserPassword.UserPassword.TransformerArg.IValue=} [properties] Properties to set
709
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value instance
710
+ */
711
+ Value.create = function create(properties) {
712
+ return new Value(properties);
713
+ };
714
+ /**
715
+ * Encodes the specified Value message. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.Value.verify|verify} messages.
716
+ * @function encode
717
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
718
+ * @static
719
+ * @param {UserPassword.UserPassword.TransformerArg.IValue} message Value message or plain object to encode
720
+ * @param {$protobuf.Writer} [writer] Writer to encode to
721
+ * @returns {$protobuf.Writer} Writer
722
+ */
723
+ Value.encode = function encode(message, writer) {
724
+ if (!writer)
725
+ writer = $Writer.create();
726
+ if (message.asBlob != null && Object.hasOwnProperty.call(message, "asBlob"))
727
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.asBlob);
728
+ if (message.asUnsignedInteger != null && Object.hasOwnProperty.call(message, "asUnsignedInteger"))
729
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.asUnsignedInteger);
730
+ return writer;
731
+ };
732
+ /**
733
+ * Encodes the specified Value message, length delimited. Does not implicitly {@link UserPassword.UserPassword.TransformerArg.Value.verify|verify} messages.
734
+ * @function encodeDelimited
735
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
736
+ * @static
737
+ * @param {UserPassword.UserPassword.TransformerArg.IValue} message Value message or plain object to encode
738
+ * @param {$protobuf.Writer} [writer] Writer to encode to
739
+ * @returns {$protobuf.Writer} Writer
740
+ */
741
+ Value.encodeDelimited = function encodeDelimited(message, writer) {
742
+ return this.encode(message, writer).ldelim();
743
+ };
744
+ /**
745
+ * Decodes a Value message from the specified reader or buffer.
746
+ * @function decode
747
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
748
+ * @static
749
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
750
+ * @param {number} [length] Message length if known beforehand
751
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
752
+ * @throws {Error} If the payload is not a reader or valid buffer
753
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
754
+ */
755
+ Value.decode = function decode(reader, length, error) {
756
+ if (!(reader instanceof $Reader))
757
+ reader = $Reader.create(reader);
758
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserPassword.UserPassword.TransformerArg.Value();
759
+ while (reader.pos < end) {
760
+ var tag = reader.uint32();
761
+ if (tag === error)
762
+ break;
763
+ switch (tag >>> 3) {
764
+ case 1: {
765
+ message.asBlob = reader.bytes();
766
+ break;
767
+ }
768
+ case 2: {
769
+ message.asUnsignedInteger = reader.uint32();
770
+ break;
771
+ }
772
+ default:
773
+ reader.skipType(tag & 7);
774
+ break;
775
+ }
776
+ }
777
+ return message;
778
+ };
779
+ /**
780
+ * Decodes a Value message from the specified reader or buffer, length delimited.
781
+ * @function decodeDelimited
782
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
783
+ * @static
784
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
785
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
786
+ * @throws {Error} If the payload is not a reader or valid buffer
787
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
788
+ */
789
+ Value.decodeDelimited = function decodeDelimited(reader) {
790
+ if (!(reader instanceof $Reader))
791
+ reader = new $Reader(reader);
792
+ return this.decode(reader, reader.uint32());
793
+ };
794
+ /**
795
+ * Verifies a Value message.
796
+ * @function verify
797
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
798
+ * @static
799
+ * @param {Object.<string,*>} message Plain object to verify
800
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
801
+ */
802
+ Value.verify = function verify(message) {
803
+ if (typeof message !== "object" || message === null)
804
+ return "object expected";
805
+ var properties = {};
806
+ if (message.asBlob != null && message.hasOwnProperty("asBlob")) {
807
+ properties.value = 1;
808
+ if (!(message.asBlob && typeof message.asBlob.length === "number" || $util.isString(message.asBlob)))
809
+ return "asBlob: buffer expected";
810
+ }
811
+ if (message.asUnsignedInteger != null && message.hasOwnProperty("asUnsignedInteger")) {
812
+ if (properties.value === 1)
813
+ return "value: multiple values";
814
+ properties.value = 1;
815
+ if (!$util.isInteger(message.asUnsignedInteger))
816
+ return "asUnsignedInteger: integer expected";
817
+ }
818
+ return null;
819
+ };
820
+ /**
821
+ * Creates a Value message from a plain object. Also converts values to their respective internal types.
822
+ * @function fromObject
823
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
824
+ * @static
825
+ * @param {Object.<string,*>} object Plain object
826
+ * @returns {UserPassword.UserPassword.TransformerArg.Value} Value
827
+ */
828
+ Value.fromObject = function fromObject(object) {
829
+ if (object instanceof $root.UserPassword.UserPassword.TransformerArg.Value)
830
+ return object;
831
+ var message = new $root.UserPassword.UserPassword.TransformerArg.Value();
832
+ if (object.asBlob != null)
833
+ if (typeof object.asBlob === "string")
834
+ $util.base64.decode(object.asBlob, message.asBlob = $util.newBuffer($util.base64.length(object.asBlob)), 0);
835
+ else if (object.asBlob.length >= 0)
836
+ message.asBlob = object.asBlob;
837
+ if (object.asUnsignedInteger != null)
838
+ message.asUnsignedInteger = object.asUnsignedInteger >>> 0;
839
+ return message;
840
+ };
841
+ /**
842
+ * Creates a plain object from a Value message. Also converts values to other types if specified.
843
+ * @function toObject
844
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
845
+ * @static
846
+ * @param {UserPassword.UserPassword.TransformerArg.Value} message Value
847
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
848
+ * @returns {Object.<string,*>} Plain object
849
+ */
850
+ Value.toObject = function toObject(message, options) {
851
+ if (!options)
852
+ options = {};
853
+ var object = {};
854
+ if (message.asBlob != null && message.hasOwnProperty("asBlob")) {
855
+ 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;
856
+ if (options.oneofs)
857
+ object.value = "asBlob";
858
+ }
859
+ if (message.asUnsignedInteger != null && message.hasOwnProperty("asUnsignedInteger")) {
860
+ object.asUnsignedInteger = message.asUnsignedInteger;
861
+ if (options.oneofs)
862
+ object.value = "asUnsignedInteger";
863
+ }
864
+ return object;
865
+ };
866
+ /**
867
+ * Converts this Value to JSON.
868
+ * @function toJSON
869
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
870
+ * @instance
871
+ * @returns {Object.<string,*>} JSON object
872
+ */
873
+ Value.prototype.toJSON = function toJSON() {
874
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
875
+ };
876
+ /**
877
+ * Gets the default type url for Value
878
+ * @function getTypeUrl
879
+ * @memberof UserPassword.UserPassword.TransformerArg.Value
880
+ * @static
881
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
882
+ * @returns {string} The default type url
883
+ */
884
+ Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
885
+ if (typeUrlPrefix === undefined) {
886
+ typeUrlPrefix = "type.googleapis.com";
887
+ }
888
+ return typeUrlPrefix + "/UserPassword.UserPassword.TransformerArg.Value";
889
+ };
890
+ return Value;
891
+ })();
892
+ return TransformerArg;
893
+ })();
894
+ return UserPassword;
895
+ })();
896
+ return UserPassword;
897
+ })();
898
+ module.exports = $root;