@aseppxyzz12/baileys 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +2579 -0
  3. package/WAProto/AICommon/AICommon.js +19396 -0
  4. package/WAProto/AICommon/AICommon.proto +820 -0
  5. package/WAProto/Adv/Adv.js +1137 -0
  6. package/WAProto/Adv/Adv.proto +42 -0
  7. package/WAProto/BotMetadata/BotMetadata.js +8975 -0
  8. package/WAProto/BotMetadata/BotMetadata.proto +484 -0
  9. package/WAProto/Cert/Cert.js +893 -0
  10. package/WAProto/Cert/Cert.proto +30 -0
  11. package/WAProto/ChatLockSettings/ChatLockSettings.js +673 -0
  12. package/WAProto/ChatLockSettings/ChatLockSettings.proto +9 -0
  13. package/WAProto/CompanionReg/CompanionReg.js +2457 -0
  14. package/WAProto/CompanionReg/CompanionReg.proto +103 -0
  15. package/WAProto/DeviceCapabilities/DeviceCapabilities.js +846 -0
  16. package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +38 -0
  17. package/WAProto/E2E/E2E.js +78728 -0
  18. package/WAProto/E2E/E2E.proto +1970 -0
  19. package/WAProto/Ephemeral/Ephemeral.js +143 -0
  20. package/WAProto/Ephemeral/Ephemeral.proto +7 -0
  21. package/WAProto/HistorySync/HistorySync.js +95931 -0
  22. package/WAProto/HistorySync/HistorySync.proto +229 -0
  23. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +414 -0
  24. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +13 -0
  25. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +980 -0
  26. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +38 -0
  27. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +81185 -0
  28. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +88 -0
  29. package/WAProto/MmsRetry/MmsRetry.js +310 -0
  30. package/WAProto/MmsRetry/MmsRetry.proto +19 -0
  31. package/WAProto/Protocol/Protocol.js +399 -0
  32. package/WAProto/Protocol/Protocol.proto +22 -0
  33. package/WAProto/Reporting/Reporting.js +535 -0
  34. package/WAProto/Reporting/Reporting.proto +22 -0
  35. package/WAProto/ServerSync/ServerSync.js +1830 -0
  36. package/WAProto/ServerSync/ServerSync.proto +70 -0
  37. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +3267 -0
  38. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +95 -0
  39. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1140 -0
  40. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +44 -0
  41. package/WAProto/StatusAttributions/StatusAttributions.js +1604 -0
  42. package/WAProto/StatusAttributions/StatusAttributions.proto +89 -0
  43. package/WAProto/SyncAction/SyncAction.js +17424 -0
  44. package/WAProto/SyncAction/SyncAction.proto +663 -0
  45. package/WAProto/UserPassword/UserPassword.js +544 -0
  46. package/WAProto/UserPassword/UserPassword.proto +28 -0
  47. package/WAProto/VnameCert/VnameCert.js +1466 -0
  48. package/WAProto/VnameCert/VnameCert.proto +65 -0
  49. package/WAProto/Wa6/Wa6.js +4601 -0
  50. package/WAProto/Wa6/Wa6.proto +241 -0
  51. package/WAProto/Web/Web.js +90819 -0
  52. package/WAProto/Web/Web.proto +605 -0
  53. package/WAProto/index.js +30 -0
  54. package/engine-requirements.js +9 -0
  55. package/lib/Defaults/baileys-version.json +3 -0
  56. package/lib/Defaults/connection.js +39 -0
  57. package/lib/Defaults/constants.js +50 -0
  58. package/lib/Defaults/history.js +13 -0
  59. package/lib/Defaults/index.js +36 -0
  60. package/lib/Defaults/media.js +43 -0
  61. package/lib/Defaults/phonenumber-mcc.json +223 -0
  62. package/lib/Defaults/prefix.js +12 -0
  63. package/lib/Function/Download/tiktok.js +19 -0
  64. package/lib/Function/Tools/bypass.js +19 -0
  65. package/lib/Function/index.js +13 -0
  66. package/lib/Signal/Group/ciphertext-message.js +14 -0
  67. package/lib/Signal/Group/group-session-builder.js +46 -0
  68. package/lib/Signal/Group/group_cipher.js +104 -0
  69. package/lib/Signal/Group/index.js +42 -0
  70. package/lib/Signal/Group/keyhelper.js +21 -0
  71. package/lib/Signal/Group/queue-job.js +57 -0
  72. package/lib/Signal/Group/sender-chain-key.js +34 -0
  73. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  74. package/lib/Signal/Group/sender-key-message.js +78 -0
  75. package/lib/Signal/Group/sender-key-name.js +49 -0
  76. package/lib/Signal/Group/sender-key-record.js +45 -0
  77. package/lib/Signal/Group/sender-key-state.js +100 -0
  78. package/lib/Signal/Group/sender-message-key.js +28 -0
  79. package/lib/Signal/libsignal.js +364 -0
  80. package/lib/Signal/lid-mapping.js +164 -0
  81. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  82. package/lib/Socket/Client/index.js +31 -0
  83. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  84. package/lib/Socket/Client/types.js +12 -0
  85. package/lib/Socket/Client/web-socket-client.js +62 -0
  86. package/lib/Socket/Client/websocket.js +67 -0
  87. package/lib/Socket/business.js +291 -0
  88. package/lib/Socket/chats.js +874 -0
  89. package/lib/Socket/community.js +454 -0
  90. package/lib/Socket/dugong.js +658 -0
  91. package/lib/Socket/groups.js +357 -0
  92. package/lib/Socket/index.js +13 -0
  93. package/lib/Socket/messages-recv.js +1509 -0
  94. package/lib/Socket/messages-send.js +1505 -0
  95. package/lib/Socket/mex.js +54 -0
  96. package/lib/Socket/newsletter.js +171 -0
  97. package/lib/Socket/registration.js +167 -0
  98. package/lib/Socket/rich-content.js +279 -0
  99. package/lib/Socket/socket.js +905 -0
  100. package/lib/Socket/username.js +157 -0
  101. package/lib/Socket/usync.js +70 -0
  102. package/lib/Store/index.js +37 -0
  103. package/lib/Store/keyed-db.js +114 -0
  104. package/lib/Store/make-cache-manager-store.js +77 -0
  105. package/lib/Store/make-in-memory-store.js +423 -0
  106. package/lib/Store/make-ordered-dictionary.js +78 -0
  107. package/lib/Store/object-repository.js +26 -0
  108. package/lib/Types/Auth.js +2 -0
  109. package/lib/Types/Bussines.js +2 -0
  110. package/lib/Types/Call.js +2 -0
  111. package/lib/Types/Chat.js +10 -0
  112. package/lib/Types/Contact.js +2 -0
  113. package/lib/Types/Events.js +2 -0
  114. package/lib/Types/GroupMetadata.js +2 -0
  115. package/lib/Types/Label.js +25 -0
  116. package/lib/Types/LabelAssociation.js +4 -0
  117. package/lib/Types/Message.js +11 -0
  118. package/lib/Types/Mex.js +40 -0
  119. package/lib/Types/MexUpdates.js +15 -0
  120. package/lib/Types/Newsletter.js +32 -0
  121. package/lib/Types/Product.js +2 -0
  122. package/lib/Types/Signal.js +2 -0
  123. package/lib/Types/Socket.js +2 -0
  124. package/lib/Types/State.js +9 -0
  125. package/lib/Types/USync.js +2 -0
  126. package/lib/Types/index.js +60 -0
  127. package/lib/Utils/auth-utils.js +256 -0
  128. package/lib/Utils/baileys-event-stream.js +63 -0
  129. package/lib/Utils/bot-toolkit.js +455 -0
  130. package/lib/Utils/browser-utils.js +29 -0
  131. package/lib/Utils/business.js +233 -0
  132. package/lib/Utils/chat-utils.js +904 -0
  133. package/lib/Utils/companion-reg-client-utils.js +41 -0
  134. package/lib/Utils/crypto.js +144 -0
  135. package/lib/Utils/decode-wa-message.js +305 -0
  136. package/lib/Utils/event-buffer.js +555 -0
  137. package/lib/Utils/generics.js +411 -0
  138. package/lib/Utils/history.js +100 -0
  139. package/lib/Utils/identity-change-handler.js +53 -0
  140. package/lib/Utils/index.js +57 -0
  141. package/lib/Utils/link-preview.js +76 -0
  142. package/lib/Utils/logger.js +4 -0
  143. package/lib/Utils/lt-hash.js +45 -0
  144. package/lib/Utils/make-mutex.js +33 -0
  145. package/lib/Utils/message-composer.js +289 -0
  146. package/lib/Utils/message-retry-manager.js +134 -0
  147. package/lib/Utils/messages-media.js +806 -0
  148. package/lib/Utils/messages.js +1908 -0
  149. package/lib/Utils/noise-handler.js +157 -0
  150. package/lib/Utils/offline-node-processor.js +42 -0
  151. package/lib/Utils/pre-key-manager.js +86 -0
  152. package/lib/Utils/process-message.js +814 -0
  153. package/lib/Utils/reporting-utils.js +264 -0
  154. package/lib/Utils/signal.js +183 -0
  155. package/lib/Utils/stanza-ack.js +36 -0
  156. package/lib/Utils/sync-action-utils.js +52 -0
  157. package/lib/Utils/tc-token-utils.js +167 -0
  158. package/lib/Utils/use-multi-file-auth-state.js +104 -0
  159. package/lib/Utils/validate-connection.js +229 -0
  160. package/lib/Utils/vialeys-event-stream.js +41 -0
  161. package/lib/WABinary/constants.js +1308 -0
  162. package/lib/WABinary/decode.js +233 -0
  163. package/lib/WABinary/encode.js +212 -0
  164. package/lib/WABinary/generic-utils.js +124 -0
  165. package/lib/WABinary/index.js +36 -0
  166. package/lib/WABinary/jid-utils.js +101 -0
  167. package/lib/WABinary/types.js +2 -0
  168. package/lib/WAM/BinaryInfo.js +12 -0
  169. package/lib/WAM/constants.js +20491 -0
  170. package/lib/WAM/encode.js +148 -0
  171. package/lib/WAM/index.js +34 -0
  172. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +62 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.js +38 -0
  174. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +50 -0
  175. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +25 -0
  176. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +24 -0
  177. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +32 -0
  178. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  179. package/lib/WAUSync/Protocols/index.js +38 -0
  180. package/lib/WAUSync/USyncQuery.js +97 -0
  181. package/lib/WAUSync/USyncUser.js +33 -0
  182. package/lib/WAUSync/index.js +34 -0
  183. package/lib/index.js +113 -0
  184. package/lib/messages-send.js +1496 -0
  185. package/package.json +100 -0
@@ -0,0 +1,1466 @@
1
+ "use strict";
2
+ var $protobuf = require("protobufjs/minimal");
3
+ var $Reader = $protobuf.Reader,
4
+ $Writer = $protobuf.Writer,
5
+ $util = $protobuf.util;
6
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
7
+ $root.VnameCert = (function () {
8
+ var VnameCert = {};
9
+ VnameCert.BizIdentityInfo = (function () {
10
+ function BizIdentityInfo(properties) {
11
+ if (properties)
12
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
13
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
14
+ }
15
+ BizIdentityInfo.prototype.vlevel = null;
16
+ BizIdentityInfo.prototype.vnameCert = null;
17
+ BizIdentityInfo.prototype.signed = null;
18
+ BizIdentityInfo.prototype.revoked = null;
19
+ BizIdentityInfo.prototype.hostStorage = null;
20
+ BizIdentityInfo.prototype.actualActors = null;
21
+ BizIdentityInfo.prototype.privacyModeTs = null;
22
+ BizIdentityInfo.prototype.featureControls = null;
23
+ var $oneOfFields;
24
+ Object.defineProperty(BizIdentityInfo.prototype, "_vlevel", {
25
+ get: $util.oneOfGetter(($oneOfFields = ["vlevel"])),
26
+ set: $util.oneOfSetter($oneOfFields),
27
+ });
28
+ Object.defineProperty(BizIdentityInfo.prototype, "_vnameCert", {
29
+ get: $util.oneOfGetter(($oneOfFields = ["vnameCert"])),
30
+ set: $util.oneOfSetter($oneOfFields),
31
+ });
32
+ Object.defineProperty(BizIdentityInfo.prototype, "_signed", {
33
+ get: $util.oneOfGetter(($oneOfFields = ["signed"])),
34
+ set: $util.oneOfSetter($oneOfFields),
35
+ });
36
+ Object.defineProperty(BizIdentityInfo.prototype, "_revoked", {
37
+ get: $util.oneOfGetter(($oneOfFields = ["revoked"])),
38
+ set: $util.oneOfSetter($oneOfFields),
39
+ });
40
+ Object.defineProperty(BizIdentityInfo.prototype, "_hostStorage", {
41
+ get: $util.oneOfGetter(($oneOfFields = ["hostStorage"])),
42
+ set: $util.oneOfSetter($oneOfFields),
43
+ });
44
+ Object.defineProperty(BizIdentityInfo.prototype, "_actualActors", {
45
+ get: $util.oneOfGetter(($oneOfFields = ["actualActors"])),
46
+ set: $util.oneOfSetter($oneOfFields),
47
+ });
48
+ Object.defineProperty(BizIdentityInfo.prototype, "_privacyModeTs", {
49
+ get: $util.oneOfGetter(($oneOfFields = ["privacyModeTs"])),
50
+ set: $util.oneOfSetter($oneOfFields),
51
+ });
52
+ Object.defineProperty(BizIdentityInfo.prototype, "_featureControls", {
53
+ get: $util.oneOfGetter(($oneOfFields = ["featureControls"])),
54
+ set: $util.oneOfSetter($oneOfFields),
55
+ });
56
+ BizIdentityInfo.create = function create(properties) {
57
+ return new BizIdentityInfo(properties);
58
+ };
59
+ BizIdentityInfo.encode = function encode(message, writer) {
60
+ if (!writer) writer = $Writer.create();
61
+ if (message.vlevel != null && Object.hasOwnProperty.call(message, "vlevel"))
62
+ writer.uint32(8).int32(message.vlevel);
63
+ if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert"))
64
+ $root.VnameCert.VerifiedNameCertificate.encode(
65
+ message.vnameCert,
66
+ writer.uint32(18).fork()
67
+ ).ldelim();
68
+ if (message.signed != null && Object.hasOwnProperty.call(message, "signed"))
69
+ writer.uint32(24).bool(message.signed);
70
+ if (message.revoked != null && Object.hasOwnProperty.call(message, "revoked"))
71
+ writer.uint32(32).bool(message.revoked);
72
+ if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage"))
73
+ writer.uint32(40).int32(message.hostStorage);
74
+ if (message.actualActors != null && Object.hasOwnProperty.call(message, "actualActors"))
75
+ writer.uint32(48).int32(message.actualActors);
76
+ if (
77
+ message.privacyModeTs != null &&
78
+ Object.hasOwnProperty.call(message, "privacyModeTs")
79
+ )
80
+ writer.uint32(56).uint64(message.privacyModeTs);
81
+ if (
82
+ message.featureControls != null &&
83
+ Object.hasOwnProperty.call(message, "featureControls")
84
+ )
85
+ writer.uint32(64).uint64(message.featureControls);
86
+ return writer;
87
+ };
88
+ BizIdentityInfo.encodeDelimited = function encodeDelimited(message, writer) {
89
+ return this.encode(message, writer).ldelim();
90
+ };
91
+ BizIdentityInfo.decode = function decode(reader, length, error) {
92
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
93
+ var end = length === undefined ? reader.len : reader.pos + length,
94
+ message = new $root.VnameCert.BizIdentityInfo();
95
+ while (reader.pos < end) {
96
+ var tag = reader.uint32();
97
+ if (tag === error) break;
98
+ switch (tag >>> 3) {
99
+ case 1: {
100
+ message.vlevel = reader.int32();
101
+ break;
102
+ }
103
+ case 2: {
104
+ message.vnameCert = $root.VnameCert.VerifiedNameCertificate.decode(
105
+ reader,
106
+ reader.uint32()
107
+ );
108
+ break;
109
+ }
110
+ case 3: {
111
+ message.signed = reader.bool();
112
+ break;
113
+ }
114
+ case 4: {
115
+ message.revoked = reader.bool();
116
+ break;
117
+ }
118
+ case 5: {
119
+ message.hostStorage = reader.int32();
120
+ break;
121
+ }
122
+ case 6: {
123
+ message.actualActors = reader.int32();
124
+ break;
125
+ }
126
+ case 7: {
127
+ message.privacyModeTs = reader.uint64();
128
+ break;
129
+ }
130
+ case 8: {
131
+ message.featureControls = reader.uint64();
132
+ break;
133
+ }
134
+ default:
135
+ reader.skipType(tag & 7);
136
+ break;
137
+ }
138
+ }
139
+ return message;
140
+ };
141
+ BizIdentityInfo.decodeDelimited = function decodeDelimited(reader) {
142
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
143
+ return this.decode(reader, reader.uint32());
144
+ };
145
+ BizIdentityInfo.verify = function verify(message) {
146
+ if (typeof message !== "object" || message === null) return "object expected";
147
+ var properties = {};
148
+ if (message.vlevel != null && message.hasOwnProperty("vlevel")) {
149
+ properties._vlevel = 1;
150
+ switch (message.vlevel) {
151
+ default:
152
+ return "vlevel: enum value expected";
153
+ case 0:
154
+ case 1:
155
+ case 2:
156
+ break;
157
+ }
158
+ }
159
+ if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) {
160
+ properties._vnameCert = 1;
161
+ {
162
+ var error = $root.VnameCert.VerifiedNameCertificate.verify(message.vnameCert);
163
+ if (error) return "vnameCert." + error;
164
+ }
165
+ }
166
+ if (message.signed != null && message.hasOwnProperty("signed")) {
167
+ properties._signed = 1;
168
+ if (typeof message.signed !== "boolean") return "signed: boolean expected";
169
+ }
170
+ if (message.revoked != null && message.hasOwnProperty("revoked")) {
171
+ properties._revoked = 1;
172
+ if (typeof message.revoked !== "boolean") return "revoked: boolean expected";
173
+ }
174
+ if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) {
175
+ properties._hostStorage = 1;
176
+ switch (message.hostStorage) {
177
+ default:
178
+ return "hostStorage: enum value expected";
179
+ case 0:
180
+ case 1:
181
+ break;
182
+ }
183
+ }
184
+ if (message.actualActors != null && message.hasOwnProperty("actualActors")) {
185
+ properties._actualActors = 1;
186
+ switch (message.actualActors) {
187
+ default:
188
+ return "actualActors: enum value expected";
189
+ case 0:
190
+ case 1:
191
+ break;
192
+ }
193
+ }
194
+ if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) {
195
+ properties._privacyModeTs = 1;
196
+ if (
197
+ !$util.isInteger(message.privacyModeTs) &&
198
+ !(
199
+ message.privacyModeTs &&
200
+ $util.isInteger(message.privacyModeTs.low) &&
201
+ $util.isInteger(message.privacyModeTs.high)
202
+ )
203
+ )
204
+ return "privacyModeTs: integer|Long expected";
205
+ }
206
+ if (message.featureControls != null && message.hasOwnProperty("featureControls")) {
207
+ properties._featureControls = 1;
208
+ if (
209
+ !$util.isInteger(message.featureControls) &&
210
+ !(
211
+ message.featureControls &&
212
+ $util.isInteger(message.featureControls.low) &&
213
+ $util.isInteger(message.featureControls.high)
214
+ )
215
+ )
216
+ return "featureControls: integer|Long expected";
217
+ }
218
+ return null;
219
+ };
220
+ BizIdentityInfo.fromObject = function fromObject(object) {
221
+ if (object instanceof $root.VnameCert.BizIdentityInfo) return object;
222
+ var message = new $root.VnameCert.BizIdentityInfo();
223
+ switch (object.vlevel) {
224
+ default:
225
+ if (typeof object.vlevel === "number") {
226
+ message.vlevel = object.vlevel;
227
+ break;
228
+ }
229
+ break;
230
+ case "UNKNOWN":
231
+ case 0:
232
+ message.vlevel = 0;
233
+ break;
234
+ case "LOW":
235
+ case 1:
236
+ message.vlevel = 1;
237
+ break;
238
+ case "HIGH":
239
+ case 2:
240
+ message.vlevel = 2;
241
+ break;
242
+ }
243
+ if (object.vnameCert != null) {
244
+ if (typeof object.vnameCert !== "object")
245
+ throw TypeError(".VnameCert.BizIdentityInfo.vnameCert: object expected");
246
+ message.vnameCert = $root.VnameCert.VerifiedNameCertificate.fromObject(
247
+ object.vnameCert
248
+ );
249
+ }
250
+ if (object.signed != null) message.signed = Boolean(object.signed);
251
+ if (object.revoked != null) message.revoked = Boolean(object.revoked);
252
+ switch (object.hostStorage) {
253
+ default:
254
+ if (typeof object.hostStorage === "number") {
255
+ message.hostStorage = object.hostStorage;
256
+ break;
257
+ }
258
+ break;
259
+ case "ON_PREMISE":
260
+ case 0:
261
+ message.hostStorage = 0;
262
+ break;
263
+ case "FACEBOOK":
264
+ case 1:
265
+ message.hostStorage = 1;
266
+ break;
267
+ }
268
+ switch (object.actualActors) {
269
+ default:
270
+ if (typeof object.actualActors === "number") {
271
+ message.actualActors = object.actualActors;
272
+ break;
273
+ }
274
+ break;
275
+ case "SELF":
276
+ case 0:
277
+ message.actualActors = 0;
278
+ break;
279
+ case "BSP":
280
+ case 1:
281
+ message.actualActors = 1;
282
+ break;
283
+ }
284
+ if (object.privacyModeTs != null)
285
+ if ($util.Long)
286
+ (message.privacyModeTs = $util.Long.fromValue(object.privacyModeTs)).unsigned =
287
+ true;
288
+ else if (typeof object.privacyModeTs === "string")
289
+ message.privacyModeTs = parseInt(object.privacyModeTs, 10);
290
+ else if (typeof object.privacyModeTs === "number")
291
+ message.privacyModeTs = object.privacyModeTs;
292
+ else if (typeof object.privacyModeTs === "object")
293
+ message.privacyModeTs = new $util.LongBits(
294
+ object.privacyModeTs.low >>> 0,
295
+ object.privacyModeTs.high >>> 0
296
+ ).toNumber(true);
297
+ if (object.featureControls != null)
298
+ if ($util.Long)
299
+ (message.featureControls = $util.Long.fromValue(
300
+ object.featureControls
301
+ )).unsigned = true;
302
+ else if (typeof object.featureControls === "string")
303
+ message.featureControls = parseInt(object.featureControls, 10);
304
+ else if (typeof object.featureControls === "number")
305
+ message.featureControls = object.featureControls;
306
+ else if (typeof object.featureControls === "object")
307
+ message.featureControls = new $util.LongBits(
308
+ object.featureControls.low >>> 0,
309
+ object.featureControls.high >>> 0
310
+ ).toNumber(true);
311
+ return message;
312
+ };
313
+ BizIdentityInfo.toObject = function toObject(message, options) {
314
+ if (!options) options = {};
315
+ var object = {};
316
+ if (message.vlevel != null && message.hasOwnProperty("vlevel")) {
317
+ object.vlevel =
318
+ options.enums === String
319
+ ? $root.VnameCert.BizIdentityInfo.VerifiedLevelValue[message.vlevel] ===
320
+ undefined
321
+ ? message.vlevel
322
+ : $root.VnameCert.BizIdentityInfo.VerifiedLevelValue[message.vlevel]
323
+ : message.vlevel;
324
+ if (options.oneofs) object._vlevel = "vlevel";
325
+ }
326
+ if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) {
327
+ object.vnameCert = $root.VnameCert.VerifiedNameCertificate.toObject(
328
+ message.vnameCert,
329
+ options
330
+ );
331
+ if (options.oneofs) object._vnameCert = "vnameCert";
332
+ }
333
+ if (message.signed != null && message.hasOwnProperty("signed")) {
334
+ object.signed = message.signed;
335
+ if (options.oneofs) object._signed = "signed";
336
+ }
337
+ if (message.revoked != null && message.hasOwnProperty("revoked")) {
338
+ object.revoked = message.revoked;
339
+ if (options.oneofs) object._revoked = "revoked";
340
+ }
341
+ if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) {
342
+ object.hostStorage =
343
+ options.enums === String
344
+ ? $root.VnameCert.BizIdentityInfo.HostStorageType[message.hostStorage] ===
345
+ undefined
346
+ ? message.hostStorage
347
+ : $root.VnameCert.BizIdentityInfo.HostStorageType[message.hostStorage]
348
+ : message.hostStorage;
349
+ if (options.oneofs) object._hostStorage = "hostStorage";
350
+ }
351
+ if (message.actualActors != null && message.hasOwnProperty("actualActors")) {
352
+ object.actualActors =
353
+ options.enums === String
354
+ ? $root.VnameCert.BizIdentityInfo.ActualActorsType[message.actualActors] ===
355
+ undefined
356
+ ? message.actualActors
357
+ : $root.VnameCert.BizIdentityInfo.ActualActorsType[message.actualActors]
358
+ : message.actualActors;
359
+ if (options.oneofs) object._actualActors = "actualActors";
360
+ }
361
+ if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) {
362
+ if (typeof message.privacyModeTs === "number")
363
+ object.privacyModeTs =
364
+ options.longs === String
365
+ ? String(message.privacyModeTs)
366
+ : message.privacyModeTs;
367
+ else
368
+ object.privacyModeTs =
369
+ options.longs === String
370
+ ? $util.Long.prototype.toString.call(message.privacyModeTs)
371
+ : options.longs === Number
372
+ ? new $util.LongBits(
373
+ message.privacyModeTs.low >>> 0,
374
+ message.privacyModeTs.high >>> 0
375
+ ).toNumber(true)
376
+ : message.privacyModeTs;
377
+ if (options.oneofs) object._privacyModeTs = "privacyModeTs";
378
+ }
379
+ if (message.featureControls != null && message.hasOwnProperty("featureControls")) {
380
+ if (typeof message.featureControls === "number")
381
+ object.featureControls =
382
+ options.longs === String
383
+ ? String(message.featureControls)
384
+ : message.featureControls;
385
+ else
386
+ object.featureControls =
387
+ options.longs === String
388
+ ? $util.Long.prototype.toString.call(message.featureControls)
389
+ : options.longs === Number
390
+ ? new $util.LongBits(
391
+ message.featureControls.low >>> 0,
392
+ message.featureControls.high >>> 0
393
+ ).toNumber(true)
394
+ : message.featureControls;
395
+ if (options.oneofs) object._featureControls = "featureControls";
396
+ }
397
+ return object;
398
+ };
399
+ BizIdentityInfo.prototype.toJSON = function toJSON() {
400
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
401
+ };
402
+ BizIdentityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
403
+ if (typeUrlPrefix === undefined) {
404
+ typeUrlPrefix = "type.googleapis.com";
405
+ }
406
+ return typeUrlPrefix + "/VnameCert.BizIdentityInfo";
407
+ };
408
+ BizIdentityInfo.ActualActorsType = (function () {
409
+ var valuesById = {},
410
+ values = Object.create(valuesById);
411
+ values[(valuesById[0] = "SELF")] = 0;
412
+ values[(valuesById[1] = "BSP")] = 1;
413
+ return values;
414
+ })();
415
+ BizIdentityInfo.HostStorageType = (function () {
416
+ var valuesById = {},
417
+ values = Object.create(valuesById);
418
+ values[(valuesById[0] = "ON_PREMISE")] = 0;
419
+ values[(valuesById[1] = "FACEBOOK")] = 1;
420
+ return values;
421
+ })();
422
+ BizIdentityInfo.VerifiedLevelValue = (function () {
423
+ var valuesById = {},
424
+ values = Object.create(valuesById);
425
+ values[(valuesById[0] = "UNKNOWN")] = 0;
426
+ values[(valuesById[1] = "LOW")] = 1;
427
+ values[(valuesById[2] = "HIGH")] = 2;
428
+ return values;
429
+ })();
430
+ return BizIdentityInfo;
431
+ })();
432
+ VnameCert.BizAccountLinkInfo = (function () {
433
+ function BizAccountLinkInfo(properties) {
434
+ if (properties)
435
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
436
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
437
+ }
438
+ BizAccountLinkInfo.prototype.whatsappBizAcctFbid = null;
439
+ BizAccountLinkInfo.prototype.whatsappAcctNumber = null;
440
+ BizAccountLinkInfo.prototype.issueTime = null;
441
+ BizAccountLinkInfo.prototype.hostStorage = null;
442
+ BizAccountLinkInfo.prototype.accountType = null;
443
+ var $oneOfFields;
444
+ Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappBizAcctFbid", {
445
+ get: $util.oneOfGetter(($oneOfFields = ["whatsappBizAcctFbid"])),
446
+ set: $util.oneOfSetter($oneOfFields),
447
+ });
448
+ Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappAcctNumber", {
449
+ get: $util.oneOfGetter(($oneOfFields = ["whatsappAcctNumber"])),
450
+ set: $util.oneOfSetter($oneOfFields),
451
+ });
452
+ Object.defineProperty(BizAccountLinkInfo.prototype, "_issueTime", {
453
+ get: $util.oneOfGetter(($oneOfFields = ["issueTime"])),
454
+ set: $util.oneOfSetter($oneOfFields),
455
+ });
456
+ Object.defineProperty(BizAccountLinkInfo.prototype, "_hostStorage", {
457
+ get: $util.oneOfGetter(($oneOfFields = ["hostStorage"])),
458
+ set: $util.oneOfSetter($oneOfFields),
459
+ });
460
+ Object.defineProperty(BizAccountLinkInfo.prototype, "_accountType", {
461
+ get: $util.oneOfGetter(($oneOfFields = ["accountType"])),
462
+ set: $util.oneOfSetter($oneOfFields),
463
+ });
464
+ BizAccountLinkInfo.create = function create(properties) {
465
+ return new BizAccountLinkInfo(properties);
466
+ };
467
+ BizAccountLinkInfo.encode = function encode(message, writer) {
468
+ if (!writer) writer = $Writer.create();
469
+ if (
470
+ message.whatsappBizAcctFbid != null &&
471
+ Object.hasOwnProperty.call(message, "whatsappBizAcctFbid")
472
+ )
473
+ writer.uint32(8).uint64(message.whatsappBizAcctFbid);
474
+ if (
475
+ message.whatsappAcctNumber != null &&
476
+ Object.hasOwnProperty.call(message, "whatsappAcctNumber")
477
+ )
478
+ writer.uint32(18).string(message.whatsappAcctNumber);
479
+ if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime"))
480
+ writer.uint32(24).uint64(message.issueTime);
481
+ if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage"))
482
+ writer.uint32(32).int32(message.hostStorage);
483
+ if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType"))
484
+ writer.uint32(40).int32(message.accountType);
485
+ return writer;
486
+ };
487
+ BizAccountLinkInfo.encodeDelimited = function encodeDelimited(message, writer) {
488
+ return this.encode(message, writer).ldelim();
489
+ };
490
+ BizAccountLinkInfo.decode = function decode(reader, length, error) {
491
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
492
+ var end = length === undefined ? reader.len : reader.pos + length,
493
+ message = new $root.VnameCert.BizAccountLinkInfo();
494
+ while (reader.pos < end) {
495
+ var tag = reader.uint32();
496
+ if (tag === error) break;
497
+ switch (tag >>> 3) {
498
+ case 1: {
499
+ message.whatsappBizAcctFbid = reader.uint64();
500
+ break;
501
+ }
502
+ case 2: {
503
+ message.whatsappAcctNumber = reader.string();
504
+ break;
505
+ }
506
+ case 3: {
507
+ message.issueTime = reader.uint64();
508
+ break;
509
+ }
510
+ case 4: {
511
+ message.hostStorage = reader.int32();
512
+ break;
513
+ }
514
+ case 5: {
515
+ message.accountType = reader.int32();
516
+ break;
517
+ }
518
+ default:
519
+ reader.skipType(tag & 7);
520
+ break;
521
+ }
522
+ }
523
+ return message;
524
+ };
525
+ BizAccountLinkInfo.decodeDelimited = function decodeDelimited(reader) {
526
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
527
+ return this.decode(reader, reader.uint32());
528
+ };
529
+ BizAccountLinkInfo.verify = function verify(message) {
530
+ if (typeof message !== "object" || message === null) return "object expected";
531
+ var properties = {};
532
+ if (
533
+ message.whatsappBizAcctFbid != null &&
534
+ message.hasOwnProperty("whatsappBizAcctFbid")
535
+ ) {
536
+ properties._whatsappBizAcctFbid = 1;
537
+ if (
538
+ !$util.isInteger(message.whatsappBizAcctFbid) &&
539
+ !(
540
+ message.whatsappBizAcctFbid &&
541
+ $util.isInteger(message.whatsappBizAcctFbid.low) &&
542
+ $util.isInteger(message.whatsappBizAcctFbid.high)
543
+ )
544
+ )
545
+ return "whatsappBizAcctFbid: integer|Long expected";
546
+ }
547
+ if (
548
+ message.whatsappAcctNumber != null &&
549
+ message.hasOwnProperty("whatsappAcctNumber")
550
+ ) {
551
+ properties._whatsappAcctNumber = 1;
552
+ if (!$util.isString(message.whatsappAcctNumber))
553
+ return "whatsappAcctNumber: string expected";
554
+ }
555
+ if (message.issueTime != null && message.hasOwnProperty("issueTime")) {
556
+ properties._issueTime = 1;
557
+ if (
558
+ !$util.isInteger(message.issueTime) &&
559
+ !(
560
+ message.issueTime &&
561
+ $util.isInteger(message.issueTime.low) &&
562
+ $util.isInteger(message.issueTime.high)
563
+ )
564
+ )
565
+ return "issueTime: integer|Long expected";
566
+ }
567
+ if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) {
568
+ properties._hostStorage = 1;
569
+ switch (message.hostStorage) {
570
+ default:
571
+ return "hostStorage: enum value expected";
572
+ case 0:
573
+ case 1:
574
+ break;
575
+ }
576
+ }
577
+ if (message.accountType != null && message.hasOwnProperty("accountType")) {
578
+ properties._accountType = 1;
579
+ switch (message.accountType) {
580
+ default:
581
+ return "accountType: enum value expected";
582
+ case 0:
583
+ break;
584
+ }
585
+ }
586
+ return null;
587
+ };
588
+ BizAccountLinkInfo.fromObject = function fromObject(object) {
589
+ if (object instanceof $root.VnameCert.BizAccountLinkInfo) return object;
590
+ var message = new $root.VnameCert.BizAccountLinkInfo();
591
+ if (object.whatsappBizAcctFbid != null)
592
+ if ($util.Long)
593
+ (message.whatsappBizAcctFbid = $util.Long.fromValue(
594
+ object.whatsappBizAcctFbid
595
+ )).unsigned = true;
596
+ else if (typeof object.whatsappBizAcctFbid === "string")
597
+ message.whatsappBizAcctFbid = parseInt(object.whatsappBizAcctFbid, 10);
598
+ else if (typeof object.whatsappBizAcctFbid === "number")
599
+ message.whatsappBizAcctFbid = object.whatsappBizAcctFbid;
600
+ else if (typeof object.whatsappBizAcctFbid === "object")
601
+ message.whatsappBizAcctFbid = new $util.LongBits(
602
+ object.whatsappBizAcctFbid.low >>> 0,
603
+ object.whatsappBizAcctFbid.high >>> 0
604
+ ).toNumber(true);
605
+ if (object.whatsappAcctNumber != null)
606
+ message.whatsappAcctNumber = String(object.whatsappAcctNumber);
607
+ if (object.issueTime != null)
608
+ if ($util.Long)
609
+ (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true;
610
+ else if (typeof object.issueTime === "string")
611
+ message.issueTime = parseInt(object.issueTime, 10);
612
+ else if (typeof object.issueTime === "number") message.issueTime = object.issueTime;
613
+ else if (typeof object.issueTime === "object")
614
+ message.issueTime = new $util.LongBits(
615
+ object.issueTime.low >>> 0,
616
+ object.issueTime.high >>> 0
617
+ ).toNumber(true);
618
+ switch (object.hostStorage) {
619
+ default:
620
+ if (typeof object.hostStorage === "number") {
621
+ message.hostStorage = object.hostStorage;
622
+ break;
623
+ }
624
+ break;
625
+ case "ON_PREMISE":
626
+ case 0:
627
+ message.hostStorage = 0;
628
+ break;
629
+ case "FACEBOOK":
630
+ case 1:
631
+ message.hostStorage = 1;
632
+ break;
633
+ }
634
+ switch (object.accountType) {
635
+ default:
636
+ if (typeof object.accountType === "number") {
637
+ message.accountType = object.accountType;
638
+ break;
639
+ }
640
+ break;
641
+ case "ENTERPRISE":
642
+ case 0:
643
+ message.accountType = 0;
644
+ break;
645
+ }
646
+ return message;
647
+ };
648
+ BizAccountLinkInfo.toObject = function toObject(message, options) {
649
+ if (!options) options = {};
650
+ var object = {};
651
+ if (
652
+ message.whatsappBizAcctFbid != null &&
653
+ message.hasOwnProperty("whatsappBizAcctFbid")
654
+ ) {
655
+ if (typeof message.whatsappBizAcctFbid === "number")
656
+ object.whatsappBizAcctFbid =
657
+ options.longs === String
658
+ ? String(message.whatsappBizAcctFbid)
659
+ : message.whatsappBizAcctFbid;
660
+ else
661
+ object.whatsappBizAcctFbid =
662
+ options.longs === String
663
+ ? $util.Long.prototype.toString.call(message.whatsappBizAcctFbid)
664
+ : options.longs === Number
665
+ ? new $util.LongBits(
666
+ message.whatsappBizAcctFbid.low >>> 0,
667
+ message.whatsappBizAcctFbid.high >>> 0
668
+ ).toNumber(true)
669
+ : message.whatsappBizAcctFbid;
670
+ if (options.oneofs) object._whatsappBizAcctFbid = "whatsappBizAcctFbid";
671
+ }
672
+ if (
673
+ message.whatsappAcctNumber != null &&
674
+ message.hasOwnProperty("whatsappAcctNumber")
675
+ ) {
676
+ object.whatsappAcctNumber = message.whatsappAcctNumber;
677
+ if (options.oneofs) object._whatsappAcctNumber = "whatsappAcctNumber";
678
+ }
679
+ if (message.issueTime != null && message.hasOwnProperty("issueTime")) {
680
+ if (typeof message.issueTime === "number")
681
+ object.issueTime =
682
+ options.longs === String ? String(message.issueTime) : message.issueTime;
683
+ else
684
+ object.issueTime =
685
+ options.longs === String
686
+ ? $util.Long.prototype.toString.call(message.issueTime)
687
+ : options.longs === Number
688
+ ? new $util.LongBits(
689
+ message.issueTime.low >>> 0,
690
+ message.issueTime.high >>> 0
691
+ ).toNumber(true)
692
+ : message.issueTime;
693
+ if (options.oneofs) object._issueTime = "issueTime";
694
+ }
695
+ if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) {
696
+ object.hostStorage =
697
+ options.enums === String
698
+ ? $root.VnameCert.BizAccountLinkInfo.HostStorageType[
699
+ message.hostStorage
700
+ ] === undefined
701
+ ? message.hostStorage
702
+ : $root.VnameCert.BizAccountLinkInfo.HostStorageType[
703
+ message.hostStorage
704
+ ]
705
+ : message.hostStorage;
706
+ if (options.oneofs) object._hostStorage = "hostStorage";
707
+ }
708
+ if (message.accountType != null && message.hasOwnProperty("accountType")) {
709
+ object.accountType =
710
+ options.enums === String
711
+ ? $root.VnameCert.BizAccountLinkInfo.AccountType[message.accountType] ===
712
+ undefined
713
+ ? message.accountType
714
+ : $root.VnameCert.BizAccountLinkInfo.AccountType[message.accountType]
715
+ : message.accountType;
716
+ if (options.oneofs) object._accountType = "accountType";
717
+ }
718
+ return object;
719
+ };
720
+ BizAccountLinkInfo.prototype.toJSON = function toJSON() {
721
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
722
+ };
723
+ BizAccountLinkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
724
+ if (typeUrlPrefix === undefined) {
725
+ typeUrlPrefix = "type.googleapis.com";
726
+ }
727
+ return typeUrlPrefix + "/VnameCert.BizAccountLinkInfo";
728
+ };
729
+ BizAccountLinkInfo.AccountType = (function () {
730
+ var valuesById = {},
731
+ values = Object.create(valuesById);
732
+ values[(valuesById[0] = "ENTERPRISE")] = 0;
733
+ return values;
734
+ })();
735
+ BizAccountLinkInfo.HostStorageType = (function () {
736
+ var valuesById = {},
737
+ values = Object.create(valuesById);
738
+ values[(valuesById[0] = "ON_PREMISE")] = 0;
739
+ values[(valuesById[1] = "FACEBOOK")] = 1;
740
+ return values;
741
+ })();
742
+ return BizAccountLinkInfo;
743
+ })();
744
+ VnameCert.BizAccountPayload = (function () {
745
+ function BizAccountPayload(properties) {
746
+ if (properties)
747
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
748
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
749
+ }
750
+ BizAccountPayload.prototype.vnameCert = null;
751
+ BizAccountPayload.prototype.bizAcctLinkInfo = null;
752
+ var $oneOfFields;
753
+ Object.defineProperty(BizAccountPayload.prototype, "_vnameCert", {
754
+ get: $util.oneOfGetter(($oneOfFields = ["vnameCert"])),
755
+ set: $util.oneOfSetter($oneOfFields),
756
+ });
757
+ Object.defineProperty(BizAccountPayload.prototype, "_bizAcctLinkInfo", {
758
+ get: $util.oneOfGetter(($oneOfFields = ["bizAcctLinkInfo"])),
759
+ set: $util.oneOfSetter($oneOfFields),
760
+ });
761
+ BizAccountPayload.create = function create(properties) {
762
+ return new BizAccountPayload(properties);
763
+ };
764
+ BizAccountPayload.encode = function encode(message, writer) {
765
+ if (!writer) writer = $Writer.create();
766
+ if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert"))
767
+ $root.VnameCert.VerifiedNameCertificate.encode(
768
+ message.vnameCert,
769
+ writer.uint32(10).fork()
770
+ ).ldelim();
771
+ if (
772
+ message.bizAcctLinkInfo != null &&
773
+ Object.hasOwnProperty.call(message, "bizAcctLinkInfo")
774
+ )
775
+ writer.uint32(18).bytes(message.bizAcctLinkInfo);
776
+ return writer;
777
+ };
778
+ BizAccountPayload.encodeDelimited = function encodeDelimited(message, writer) {
779
+ return this.encode(message, writer).ldelim();
780
+ };
781
+ BizAccountPayload.decode = function decode(reader, length, error) {
782
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
783
+ var end = length === undefined ? reader.len : reader.pos + length,
784
+ message = new $root.VnameCert.BizAccountPayload();
785
+ while (reader.pos < end) {
786
+ var tag = reader.uint32();
787
+ if (tag === error) break;
788
+ switch (tag >>> 3) {
789
+ case 1: {
790
+ message.vnameCert = $root.VnameCert.VerifiedNameCertificate.decode(
791
+ reader,
792
+ reader.uint32()
793
+ );
794
+ break;
795
+ }
796
+ case 2: {
797
+ message.bizAcctLinkInfo = reader.bytes();
798
+ break;
799
+ }
800
+ default:
801
+ reader.skipType(tag & 7);
802
+ break;
803
+ }
804
+ }
805
+ return message;
806
+ };
807
+ BizAccountPayload.decodeDelimited = function decodeDelimited(reader) {
808
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
809
+ return this.decode(reader, reader.uint32());
810
+ };
811
+ BizAccountPayload.verify = function verify(message) {
812
+ if (typeof message !== "object" || message === null) return "object expected";
813
+ var properties = {};
814
+ if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) {
815
+ properties._vnameCert = 1;
816
+ {
817
+ var error = $root.VnameCert.VerifiedNameCertificate.verify(message.vnameCert);
818
+ if (error) return "vnameCert." + error;
819
+ }
820
+ }
821
+ if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) {
822
+ properties._bizAcctLinkInfo = 1;
823
+ if (
824
+ !(
825
+ (message.bizAcctLinkInfo &&
826
+ typeof message.bizAcctLinkInfo.length === "number") ||
827
+ $util.isString(message.bizAcctLinkInfo)
828
+ )
829
+ )
830
+ return "bizAcctLinkInfo: buffer expected";
831
+ }
832
+ return null;
833
+ };
834
+ BizAccountPayload.fromObject = function fromObject(object) {
835
+ if (object instanceof $root.VnameCert.BizAccountPayload) return object;
836
+ var message = new $root.VnameCert.BizAccountPayload();
837
+ if (object.vnameCert != null) {
838
+ if (typeof object.vnameCert !== "object")
839
+ throw TypeError(".VnameCert.BizAccountPayload.vnameCert: object expected");
840
+ message.vnameCert = $root.VnameCert.VerifiedNameCertificate.fromObject(
841
+ object.vnameCert
842
+ );
843
+ }
844
+ if (object.bizAcctLinkInfo != null)
845
+ if (typeof object.bizAcctLinkInfo === "string")
846
+ $util.base64.decode(
847
+ object.bizAcctLinkInfo,
848
+ (message.bizAcctLinkInfo = $util.newBuffer(
849
+ $util.base64.length(object.bizAcctLinkInfo)
850
+ )),
851
+ 0
852
+ );
853
+ else if (object.bizAcctLinkInfo.length >= 0)
854
+ message.bizAcctLinkInfo = object.bizAcctLinkInfo;
855
+ return message;
856
+ };
857
+ BizAccountPayload.toObject = function toObject(message, options) {
858
+ if (!options) options = {};
859
+ var object = {};
860
+ if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) {
861
+ object.vnameCert = $root.VnameCert.VerifiedNameCertificate.toObject(
862
+ message.vnameCert,
863
+ options
864
+ );
865
+ if (options.oneofs) object._vnameCert = "vnameCert";
866
+ }
867
+ if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) {
868
+ object.bizAcctLinkInfo =
869
+ options.bytes === String
870
+ ? $util.base64.encode(
871
+ message.bizAcctLinkInfo,
872
+ 0,
873
+ message.bizAcctLinkInfo.length
874
+ )
875
+ : options.bytes === Array
876
+ ? Array.prototype.slice.call(message.bizAcctLinkInfo)
877
+ : message.bizAcctLinkInfo;
878
+ if (options.oneofs) object._bizAcctLinkInfo = "bizAcctLinkInfo";
879
+ }
880
+ return object;
881
+ };
882
+ BizAccountPayload.prototype.toJSON = function toJSON() {
883
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
884
+ };
885
+ BizAccountPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
886
+ if (typeUrlPrefix === undefined) {
887
+ typeUrlPrefix = "type.googleapis.com";
888
+ }
889
+ return typeUrlPrefix + "/VnameCert.BizAccountPayload";
890
+ };
891
+ return BizAccountPayload;
892
+ })();
893
+ VnameCert.VerifiedNameCertificate = (function () {
894
+ function VerifiedNameCertificate(properties) {
895
+ if (properties)
896
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
897
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
898
+ }
899
+ VerifiedNameCertificate.prototype.details = null;
900
+ VerifiedNameCertificate.prototype.signature = null;
901
+ VerifiedNameCertificate.prototype.serverSignature = null;
902
+ var $oneOfFields;
903
+ Object.defineProperty(VerifiedNameCertificate.prototype, "_details", {
904
+ get: $util.oneOfGetter(($oneOfFields = ["details"])),
905
+ set: $util.oneOfSetter($oneOfFields),
906
+ });
907
+ Object.defineProperty(VerifiedNameCertificate.prototype, "_signature", {
908
+ get: $util.oneOfGetter(($oneOfFields = ["signature"])),
909
+ set: $util.oneOfSetter($oneOfFields),
910
+ });
911
+ Object.defineProperty(VerifiedNameCertificate.prototype, "_serverSignature", {
912
+ get: $util.oneOfGetter(($oneOfFields = ["serverSignature"])),
913
+ set: $util.oneOfSetter($oneOfFields),
914
+ });
915
+ VerifiedNameCertificate.create = function create(properties) {
916
+ return new VerifiedNameCertificate(properties);
917
+ };
918
+ VerifiedNameCertificate.encode = function encode(message, writer) {
919
+ if (!writer) writer = $Writer.create();
920
+ if (message.details != null && Object.hasOwnProperty.call(message, "details"))
921
+ writer.uint32(10).bytes(message.details);
922
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
923
+ writer.uint32(18).bytes(message.signature);
924
+ if (
925
+ message.serverSignature != null &&
926
+ Object.hasOwnProperty.call(message, "serverSignature")
927
+ )
928
+ writer.uint32(26).bytes(message.serverSignature);
929
+ return writer;
930
+ };
931
+ VerifiedNameCertificate.encodeDelimited = function encodeDelimited(message, writer) {
932
+ return this.encode(message, writer).ldelim();
933
+ };
934
+ VerifiedNameCertificate.decode = function decode(reader, length, error) {
935
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
936
+ var end = length === undefined ? reader.len : reader.pos + length,
937
+ message = new $root.VnameCert.VerifiedNameCertificate();
938
+ while (reader.pos < end) {
939
+ var tag = reader.uint32();
940
+ if (tag === error) break;
941
+ switch (tag >>> 3) {
942
+ case 1: {
943
+ message.details = reader.bytes();
944
+ break;
945
+ }
946
+ case 2: {
947
+ message.signature = reader.bytes();
948
+ break;
949
+ }
950
+ case 3: {
951
+ message.serverSignature = reader.bytes();
952
+ break;
953
+ }
954
+ default:
955
+ reader.skipType(tag & 7);
956
+ break;
957
+ }
958
+ }
959
+ return message;
960
+ };
961
+ VerifiedNameCertificate.decodeDelimited = function decodeDelimited(reader) {
962
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
963
+ return this.decode(reader, reader.uint32());
964
+ };
965
+ VerifiedNameCertificate.verify = function verify(message) {
966
+ if (typeof message !== "object" || message === null) return "object expected";
967
+ var properties = {};
968
+ if (message.details != null && message.hasOwnProperty("details")) {
969
+ properties._details = 1;
970
+ if (
971
+ !(
972
+ (message.details && typeof message.details.length === "number") ||
973
+ $util.isString(message.details)
974
+ )
975
+ )
976
+ return "details: buffer expected";
977
+ }
978
+ if (message.signature != null && message.hasOwnProperty("signature")) {
979
+ properties._signature = 1;
980
+ if (
981
+ !(
982
+ (message.signature && typeof message.signature.length === "number") ||
983
+ $util.isString(message.signature)
984
+ )
985
+ )
986
+ return "signature: buffer expected";
987
+ }
988
+ if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) {
989
+ properties._serverSignature = 1;
990
+ if (
991
+ !(
992
+ (message.serverSignature &&
993
+ typeof message.serverSignature.length === "number") ||
994
+ $util.isString(message.serverSignature)
995
+ )
996
+ )
997
+ return "serverSignature: buffer expected";
998
+ }
999
+ return null;
1000
+ };
1001
+ VerifiedNameCertificate.fromObject = function fromObject(object) {
1002
+ if (object instanceof $root.VnameCert.VerifiedNameCertificate) return object;
1003
+ var message = new $root.VnameCert.VerifiedNameCertificate();
1004
+ if (object.details != null)
1005
+ if (typeof object.details === "string")
1006
+ $util.base64.decode(
1007
+ object.details,
1008
+ (message.details = $util.newBuffer($util.base64.length(object.details))),
1009
+ 0
1010
+ );
1011
+ else if (object.details.length >= 0) message.details = object.details;
1012
+ if (object.signature != null)
1013
+ if (typeof object.signature === "string")
1014
+ $util.base64.decode(
1015
+ object.signature,
1016
+ (message.signature = $util.newBuffer(
1017
+ $util.base64.length(object.signature)
1018
+ )),
1019
+ 0
1020
+ );
1021
+ else if (object.signature.length >= 0) message.signature = object.signature;
1022
+ if (object.serverSignature != null)
1023
+ if (typeof object.serverSignature === "string")
1024
+ $util.base64.decode(
1025
+ object.serverSignature,
1026
+ (message.serverSignature = $util.newBuffer(
1027
+ $util.base64.length(object.serverSignature)
1028
+ )),
1029
+ 0
1030
+ );
1031
+ else if (object.serverSignature.length >= 0)
1032
+ message.serverSignature = object.serverSignature;
1033
+ return message;
1034
+ };
1035
+ VerifiedNameCertificate.toObject = function toObject(message, options) {
1036
+ if (!options) options = {};
1037
+ var object = {};
1038
+ if (message.details != null && message.hasOwnProperty("details")) {
1039
+ object.details =
1040
+ options.bytes === String
1041
+ ? $util.base64.encode(message.details, 0, message.details.length)
1042
+ : options.bytes === Array
1043
+ ? Array.prototype.slice.call(message.details)
1044
+ : message.details;
1045
+ if (options.oneofs) object._details = "details";
1046
+ }
1047
+ if (message.signature != null && message.hasOwnProperty("signature")) {
1048
+ object.signature =
1049
+ options.bytes === String
1050
+ ? $util.base64.encode(message.signature, 0, message.signature.length)
1051
+ : options.bytes === Array
1052
+ ? Array.prototype.slice.call(message.signature)
1053
+ : message.signature;
1054
+ if (options.oneofs) object._signature = "signature";
1055
+ }
1056
+ if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) {
1057
+ object.serverSignature =
1058
+ options.bytes === String
1059
+ ? $util.base64.encode(
1060
+ message.serverSignature,
1061
+ 0,
1062
+ message.serverSignature.length
1063
+ )
1064
+ : options.bytes === Array
1065
+ ? Array.prototype.slice.call(message.serverSignature)
1066
+ : message.serverSignature;
1067
+ if (options.oneofs) object._serverSignature = "serverSignature";
1068
+ }
1069
+ return object;
1070
+ };
1071
+ VerifiedNameCertificate.prototype.toJSON = function toJSON() {
1072
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1073
+ };
1074
+ VerifiedNameCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1075
+ if (typeUrlPrefix === undefined) {
1076
+ typeUrlPrefix = "type.googleapis.com";
1077
+ }
1078
+ return typeUrlPrefix + "/VnameCert.VerifiedNameCertificate";
1079
+ };
1080
+ VerifiedNameCertificate.Details = (function () {
1081
+ function Details(properties) {
1082
+ this.localizedNames = [];
1083
+ if (properties)
1084
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1085
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1086
+ }
1087
+ Details.prototype.serial = null;
1088
+ Details.prototype.issuer = null;
1089
+ Details.prototype.verifiedName = null;
1090
+ Details.prototype.localizedNames = $util.emptyArray;
1091
+ Details.prototype.issueTime = null;
1092
+ var $oneOfFields;
1093
+ Object.defineProperty(Details.prototype, "_serial", {
1094
+ get: $util.oneOfGetter(($oneOfFields = ["serial"])),
1095
+ set: $util.oneOfSetter($oneOfFields),
1096
+ });
1097
+ Object.defineProperty(Details.prototype, "_issuer", {
1098
+ get: $util.oneOfGetter(($oneOfFields = ["issuer"])),
1099
+ set: $util.oneOfSetter($oneOfFields),
1100
+ });
1101
+ Object.defineProperty(Details.prototype, "_verifiedName", {
1102
+ get: $util.oneOfGetter(($oneOfFields = ["verifiedName"])),
1103
+ set: $util.oneOfSetter($oneOfFields),
1104
+ });
1105
+ Object.defineProperty(Details.prototype, "_issueTime", {
1106
+ get: $util.oneOfGetter(($oneOfFields = ["issueTime"])),
1107
+ set: $util.oneOfSetter($oneOfFields),
1108
+ });
1109
+ Details.create = function create(properties) {
1110
+ return new Details(properties);
1111
+ };
1112
+ Details.encode = function encode(message, writer) {
1113
+ if (!writer) writer = $Writer.create();
1114
+ if (message.serial != null && Object.hasOwnProperty.call(message, "serial"))
1115
+ writer.uint32(8).uint64(message.serial);
1116
+ if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer"))
1117
+ writer.uint32(18).string(message.issuer);
1118
+ if (
1119
+ message.verifiedName != null &&
1120
+ Object.hasOwnProperty.call(message, "verifiedName")
1121
+ )
1122
+ writer.uint32(34).string(message.verifiedName);
1123
+ if (message.localizedNames != null && message.localizedNames.length)
1124
+ for (var i = 0; i < message.localizedNames.length; ++i)
1125
+ $root.VnameCert.LocalizedName.encode(
1126
+ message.localizedNames[i],
1127
+ writer.uint32(66).fork()
1128
+ ).ldelim();
1129
+ if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime"))
1130
+ writer.uint32(80).uint64(message.issueTime);
1131
+ return writer;
1132
+ };
1133
+ Details.encodeDelimited = function encodeDelimited(message, writer) {
1134
+ return this.encode(message, writer).ldelim();
1135
+ };
1136
+ Details.decode = function decode(reader, length, error) {
1137
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1138
+ var end = length === undefined ? reader.len : reader.pos + length,
1139
+ message = new $root.VnameCert.VerifiedNameCertificate.Details();
1140
+ while (reader.pos < end) {
1141
+ var tag = reader.uint32();
1142
+ if (tag === error) break;
1143
+ switch (tag >>> 3) {
1144
+ case 1: {
1145
+ message.serial = reader.uint64();
1146
+ break;
1147
+ }
1148
+ case 2: {
1149
+ message.issuer = reader.string();
1150
+ break;
1151
+ }
1152
+ case 4: {
1153
+ message.verifiedName = reader.string();
1154
+ break;
1155
+ }
1156
+ case 8: {
1157
+ if (!(message.localizedNames && message.localizedNames.length))
1158
+ message.localizedNames = [];
1159
+ message.localizedNames.push(
1160
+ $root.VnameCert.LocalizedName.decode(reader, reader.uint32())
1161
+ );
1162
+ break;
1163
+ }
1164
+ case 10: {
1165
+ message.issueTime = reader.uint64();
1166
+ break;
1167
+ }
1168
+ default:
1169
+ reader.skipType(tag & 7);
1170
+ break;
1171
+ }
1172
+ }
1173
+ return message;
1174
+ };
1175
+ Details.decodeDelimited = function decodeDelimited(reader) {
1176
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1177
+ return this.decode(reader, reader.uint32());
1178
+ };
1179
+ Details.verify = function verify(message) {
1180
+ if (typeof message !== "object" || message === null) return "object expected";
1181
+ var properties = {};
1182
+ if (message.serial != null && message.hasOwnProperty("serial")) {
1183
+ properties._serial = 1;
1184
+ if (
1185
+ !$util.isInteger(message.serial) &&
1186
+ !(
1187
+ message.serial &&
1188
+ $util.isInteger(message.serial.low) &&
1189
+ $util.isInteger(message.serial.high)
1190
+ )
1191
+ )
1192
+ return "serial: integer|Long expected";
1193
+ }
1194
+ if (message.issuer != null && message.hasOwnProperty("issuer")) {
1195
+ properties._issuer = 1;
1196
+ if (!$util.isString(message.issuer)) return "issuer: string expected";
1197
+ }
1198
+ if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) {
1199
+ properties._verifiedName = 1;
1200
+ if (!$util.isString(message.verifiedName))
1201
+ return "verifiedName: string expected";
1202
+ }
1203
+ if (message.localizedNames != null && message.hasOwnProperty("localizedNames")) {
1204
+ if (!Array.isArray(message.localizedNames))
1205
+ return "localizedNames: array expected";
1206
+ for (var i = 0; i < message.localizedNames.length; ++i) {
1207
+ var error = $root.VnameCert.LocalizedName.verify(message.localizedNames[i]);
1208
+ if (error) return "localizedNames." + error;
1209
+ }
1210
+ }
1211
+ if (message.issueTime != null && message.hasOwnProperty("issueTime")) {
1212
+ properties._issueTime = 1;
1213
+ if (
1214
+ !$util.isInteger(message.issueTime) &&
1215
+ !(
1216
+ message.issueTime &&
1217
+ $util.isInteger(message.issueTime.low) &&
1218
+ $util.isInteger(message.issueTime.high)
1219
+ )
1220
+ )
1221
+ return "issueTime: integer|Long expected";
1222
+ }
1223
+ return null;
1224
+ };
1225
+ Details.fromObject = function fromObject(object) {
1226
+ if (object instanceof $root.VnameCert.VerifiedNameCertificate.Details)
1227
+ return object;
1228
+ var message = new $root.VnameCert.VerifiedNameCertificate.Details();
1229
+ if (object.serial != null)
1230
+ if ($util.Long)
1231
+ (message.serial = $util.Long.fromValue(object.serial)).unsigned = true;
1232
+ else if (typeof object.serial === "string")
1233
+ message.serial = parseInt(object.serial, 10);
1234
+ else if (typeof object.serial === "number") message.serial = object.serial;
1235
+ else if (typeof object.serial === "object")
1236
+ message.serial = new $util.LongBits(
1237
+ object.serial.low >>> 0,
1238
+ object.serial.high >>> 0
1239
+ ).toNumber(true);
1240
+ if (object.issuer != null) message.issuer = String(object.issuer);
1241
+ if (object.verifiedName != null) message.verifiedName = String(object.verifiedName);
1242
+ if (object.localizedNames) {
1243
+ if (!Array.isArray(object.localizedNames))
1244
+ throw TypeError(
1245
+ ".VnameCert.VerifiedNameCertificate.Details.localizedNames: array expected"
1246
+ );
1247
+ message.localizedNames = [];
1248
+ for (var i = 0; i < object.localizedNames.length; ++i) {
1249
+ if (typeof object.localizedNames[i] !== "object")
1250
+ throw TypeError(
1251
+ ".VnameCert.VerifiedNameCertificate.Details.localizedNames: object expected"
1252
+ );
1253
+ message.localizedNames[i] = $root.VnameCert.LocalizedName.fromObject(
1254
+ object.localizedNames[i]
1255
+ );
1256
+ }
1257
+ }
1258
+ if (object.issueTime != null)
1259
+ if ($util.Long)
1260
+ (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned =
1261
+ true;
1262
+ else if (typeof object.issueTime === "string")
1263
+ message.issueTime = parseInt(object.issueTime, 10);
1264
+ else if (typeof object.issueTime === "number")
1265
+ message.issueTime = object.issueTime;
1266
+ else if (typeof object.issueTime === "object")
1267
+ message.issueTime = new $util.LongBits(
1268
+ object.issueTime.low >>> 0,
1269
+ object.issueTime.high >>> 0
1270
+ ).toNumber(true);
1271
+ return message;
1272
+ };
1273
+ Details.toObject = function toObject(message, options) {
1274
+ if (!options) options = {};
1275
+ var object = {};
1276
+ if (options.arrays || options.defaults) object.localizedNames = [];
1277
+ if (message.serial != null && message.hasOwnProperty("serial")) {
1278
+ if (typeof message.serial === "number")
1279
+ object.serial =
1280
+ options.longs === String ? String(message.serial) : message.serial;
1281
+ else
1282
+ object.serial =
1283
+ options.longs === String
1284
+ ? $util.Long.prototype.toString.call(message.serial)
1285
+ : options.longs === Number
1286
+ ? new $util.LongBits(
1287
+ message.serial.low >>> 0,
1288
+ message.serial.high >>> 0
1289
+ ).toNumber(true)
1290
+ : message.serial;
1291
+ if (options.oneofs) object._serial = "serial";
1292
+ }
1293
+ if (message.issuer != null && message.hasOwnProperty("issuer")) {
1294
+ object.issuer = message.issuer;
1295
+ if (options.oneofs) object._issuer = "issuer";
1296
+ }
1297
+ if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) {
1298
+ object.verifiedName = message.verifiedName;
1299
+ if (options.oneofs) object._verifiedName = "verifiedName";
1300
+ }
1301
+ if (message.localizedNames && message.localizedNames.length) {
1302
+ object.localizedNames = [];
1303
+ for (var j = 0; j < message.localizedNames.length; ++j)
1304
+ object.localizedNames[j] = $root.VnameCert.LocalizedName.toObject(
1305
+ message.localizedNames[j],
1306
+ options
1307
+ );
1308
+ }
1309
+ if (message.issueTime != null && message.hasOwnProperty("issueTime")) {
1310
+ if (typeof message.issueTime === "number")
1311
+ object.issueTime =
1312
+ options.longs === String
1313
+ ? String(message.issueTime)
1314
+ : message.issueTime;
1315
+ else
1316
+ object.issueTime =
1317
+ options.longs === String
1318
+ ? $util.Long.prototype.toString.call(message.issueTime)
1319
+ : options.longs === Number
1320
+ ? new $util.LongBits(
1321
+ message.issueTime.low >>> 0,
1322
+ message.issueTime.high >>> 0
1323
+ ).toNumber(true)
1324
+ : message.issueTime;
1325
+ if (options.oneofs) object._issueTime = "issueTime";
1326
+ }
1327
+ return object;
1328
+ };
1329
+ Details.prototype.toJSON = function toJSON() {
1330
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1331
+ };
1332
+ Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1333
+ if (typeUrlPrefix === undefined) {
1334
+ typeUrlPrefix = "type.googleapis.com";
1335
+ }
1336
+ return typeUrlPrefix + "/VnameCert.VerifiedNameCertificate.Details";
1337
+ };
1338
+ return Details;
1339
+ })();
1340
+ return VerifiedNameCertificate;
1341
+ })();
1342
+ VnameCert.LocalizedName = (function () {
1343
+ function LocalizedName(properties) {
1344
+ if (properties)
1345
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1346
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1347
+ }
1348
+ LocalizedName.prototype.lg = null;
1349
+ LocalizedName.prototype.lc = null;
1350
+ LocalizedName.prototype.verifiedName = null;
1351
+ var $oneOfFields;
1352
+ Object.defineProperty(LocalizedName.prototype, "_lg", {
1353
+ get: $util.oneOfGetter(($oneOfFields = ["lg"])),
1354
+ set: $util.oneOfSetter($oneOfFields),
1355
+ });
1356
+ Object.defineProperty(LocalizedName.prototype, "_lc", {
1357
+ get: $util.oneOfGetter(($oneOfFields = ["lc"])),
1358
+ set: $util.oneOfSetter($oneOfFields),
1359
+ });
1360
+ Object.defineProperty(LocalizedName.prototype, "_verifiedName", {
1361
+ get: $util.oneOfGetter(($oneOfFields = ["verifiedName"])),
1362
+ set: $util.oneOfSetter($oneOfFields),
1363
+ });
1364
+ LocalizedName.create = function create(properties) {
1365
+ return new LocalizedName(properties);
1366
+ };
1367
+ LocalizedName.encode = function encode(message, writer) {
1368
+ if (!writer) writer = $Writer.create();
1369
+ if (message.lg != null && Object.hasOwnProperty.call(message, "lg"))
1370
+ writer.uint32(10).string(message.lg);
1371
+ if (message.lc != null && Object.hasOwnProperty.call(message, "lc"))
1372
+ writer.uint32(18).string(message.lc);
1373
+ if (message.verifiedName != null && Object.hasOwnProperty.call(message, "verifiedName"))
1374
+ writer.uint32(26).string(message.verifiedName);
1375
+ return writer;
1376
+ };
1377
+ LocalizedName.encodeDelimited = function encodeDelimited(message, writer) {
1378
+ return this.encode(message, writer).ldelim();
1379
+ };
1380
+ LocalizedName.decode = function decode(reader, length, error) {
1381
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1382
+ var end = length === undefined ? reader.len : reader.pos + length,
1383
+ message = new $root.VnameCert.LocalizedName();
1384
+ while (reader.pos < end) {
1385
+ var tag = reader.uint32();
1386
+ if (tag === error) break;
1387
+ switch (tag >>> 3) {
1388
+ case 1: {
1389
+ message.lg = reader.string();
1390
+ break;
1391
+ }
1392
+ case 2: {
1393
+ message.lc = reader.string();
1394
+ break;
1395
+ }
1396
+ case 3: {
1397
+ message.verifiedName = reader.string();
1398
+ break;
1399
+ }
1400
+ default:
1401
+ reader.skipType(tag & 7);
1402
+ break;
1403
+ }
1404
+ }
1405
+ return message;
1406
+ };
1407
+ LocalizedName.decodeDelimited = function decodeDelimited(reader) {
1408
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1409
+ return this.decode(reader, reader.uint32());
1410
+ };
1411
+ LocalizedName.verify = function verify(message) {
1412
+ if (typeof message !== "object" || message === null) return "object expected";
1413
+ var properties = {};
1414
+ if (message.lg != null && message.hasOwnProperty("lg")) {
1415
+ properties._lg = 1;
1416
+ if (!$util.isString(message.lg)) return "lg: string expected";
1417
+ }
1418
+ if (message.lc != null && message.hasOwnProperty("lc")) {
1419
+ properties._lc = 1;
1420
+ if (!$util.isString(message.lc)) return "lc: string expected";
1421
+ }
1422
+ if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) {
1423
+ properties._verifiedName = 1;
1424
+ if (!$util.isString(message.verifiedName)) return "verifiedName: string expected";
1425
+ }
1426
+ return null;
1427
+ };
1428
+ LocalizedName.fromObject = function fromObject(object) {
1429
+ if (object instanceof $root.VnameCert.LocalizedName) return object;
1430
+ var message = new $root.VnameCert.LocalizedName();
1431
+ if (object.lg != null) message.lg = String(object.lg);
1432
+ if (object.lc != null) message.lc = String(object.lc);
1433
+ if (object.verifiedName != null) message.verifiedName = String(object.verifiedName);
1434
+ return message;
1435
+ };
1436
+ LocalizedName.toObject = function toObject(message, options) {
1437
+ if (!options) options = {};
1438
+ var object = {};
1439
+ if (message.lg != null && message.hasOwnProperty("lg")) {
1440
+ object.lg = message.lg;
1441
+ if (options.oneofs) object._lg = "lg";
1442
+ }
1443
+ if (message.lc != null && message.hasOwnProperty("lc")) {
1444
+ object.lc = message.lc;
1445
+ if (options.oneofs) object._lc = "lc";
1446
+ }
1447
+ if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) {
1448
+ object.verifiedName = message.verifiedName;
1449
+ if (options.oneofs) object._verifiedName = "verifiedName";
1450
+ }
1451
+ return object;
1452
+ };
1453
+ LocalizedName.prototype.toJSON = function toJSON() {
1454
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1455
+ };
1456
+ LocalizedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1457
+ if (typeUrlPrefix === undefined) {
1458
+ typeUrlPrefix = "type.googleapis.com";
1459
+ }
1460
+ return typeUrlPrefix + "/VnameCert.LocalizedName";
1461
+ };
1462
+ return LocalizedName;
1463
+ })();
1464
+ return VnameCert;
1465
+ })();
1466
+ module.exports = $root;