@hiroosy/baileys-lite 0.3.3 → 0.3.5

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 (242) hide show
  1. package/WAProto/index.js +247 -113252
  2. package/WAProto/parts/ADVDeviceIdentity.part +201 -0
  3. package/WAProto/parts/ADVEncryptionType.part +6 -0
  4. package/WAProto/parts/ADVKeyIndexList.part +201 -0
  5. package/WAProto/parts/ADVSignedDeviceIdentity.part +150 -0
  6. package/WAProto/parts/ADVSignedDeviceIdentityHMAC.part +142 -0
  7. package/WAProto/parts/ADVSignedKeyIndexList.part +128 -0
  8. package/WAProto/parts/AIHomeState.part +405 -0
  9. package/WAProto/parts/AIMediaCollectionMessage.part +119 -0
  10. package/WAProto/parts/AIMediaCollectionMetadata.part +100 -0
  11. package/WAProto/parts/AIMetadataOperation.part +83 -0
  12. package/WAProto/parts/AIQueryFanout.part +133 -0
  13. package/WAProto/parts/AIRegenerateMetadata.part +112 -0
  14. package/WAProto/parts/AIRichResponseCodeMetadata.part +252 -0
  15. package/WAProto/parts/AIRichResponseContentItemsMetadata.part +354 -0
  16. package/WAProto/parts/AIRichResponseDynamicMetadata.part +172 -0
  17. package/WAProto/parts/AIRichResponseGridImageMetadata.part +114 -0
  18. package/WAProto/parts/AIRichResponseImageURL.part +119 -0
  19. package/WAProto/parts/AIRichResponseInlineImageMetadata.part +164 -0
  20. package/WAProto/parts/AIRichResponseLatexMetadata.part +346 -0
  21. package/WAProto/parts/AIRichResponseMapMetadata.part +346 -0
  22. package/WAProto/parts/AIRichResponseMessage.part +167 -0
  23. package/WAProto/parts/AIRichResponseMessageType.part +5 -0
  24. package/WAProto/parts/AIRichResponseSubMessage.part +313 -0
  25. package/WAProto/parts/AIRichResponseSubMessageType.part +13 -0
  26. package/WAProto/parts/AIRichResponseTableMetadata.part +223 -0
  27. package/WAProto/parts/AIRichResponseUnifiedResponse.part +84 -0
  28. package/WAProto/parts/AISubscriptionRequestType.part +7 -0
  29. package/WAProto/parts/AISubscriptionUpsellMetadata.part +102 -0
  30. package/WAProto/parts/AIThreadInfo.part +316 -0
  31. package/WAProto/parts/Account.part +138 -0
  32. package/WAProto/parts/ActionLink.part +100 -0
  33. package/WAProto/parts/AutoDownloadSettings.part +138 -0
  34. package/WAProto/parts/AvatarUserSettings.part +100 -0
  35. package/WAProto/parts/BizAccountLinkInfo.part +210 -0
  36. package/WAProto/parts/BizAccountPayload.part +105 -0
  37. package/WAProto/parts/BizIdentityInfo.part +298 -0
  38. package/WAProto/parts/BotAgeCollectionMetadata.part +138 -0
  39. package/WAProto/parts/BotAgentDeepLinkMetadata.part +81 -0
  40. package/WAProto/parts/BotAgentMetadata.part +83 -0
  41. package/WAProto/parts/BotCapabilityMetadata.part +437 -0
  42. package/WAProto/parts/BotCommandMetadata.part +119 -0
  43. package/WAProto/parts/BotDocumentMessageMetadata.part +100 -0
  44. package/WAProto/parts/BotFeedbackMessage.part +1366 -0
  45. package/WAProto/parts/BotGroupMetadata.part +92 -0
  46. package/WAProto/parts/BotGroupParticipantMetadata.part +81 -0
  47. package/WAProto/parts/BotImagineMetadata.part +134 -0
  48. package/WAProto/parts/BotInfrastructureDiagnostics.part +148 -0
  49. package/WAProto/parts/BotLinkedAccount.part +95 -0
  50. package/WAProto/parts/BotLinkedAccountsMetadata.part +134 -0
  51. package/WAProto/parts/BotMediaMetadata.part +229 -0
  52. package/WAProto/parts/BotMemoryFact.part +100 -0
  53. package/WAProto/parts/BotMemoryMetadata.part +141 -0
  54. package/WAProto/parts/BotMemuMetadata.part +92 -0
  55. package/WAProto/parts/BotMessageOrigin.part +95 -0
  56. package/WAProto/parts/BotMessageOriginMetadata.part +92 -0
  57. package/WAProto/parts/BotMessageSharingInfo.part +297 -0
  58. package/WAProto/parts/BotMetadata.part +934 -0
  59. package/WAProto/parts/BotMetricsEntryPoint.part +51 -0
  60. package/WAProto/parts/BotMetricsMetadata.part +341 -0
  61. package/WAProto/parts/BotMetricsThreadEntryPoint.part +8 -0
  62. package/WAProto/parts/BotModeSelectionMetadata.part +151 -0
  63. package/WAProto/parts/BotModelMetadata.part +167 -0
  64. package/WAProto/parts/BotPluginMetadata.part +379 -0
  65. package/WAProto/parts/BotProgressIndicatorMetadata.part +837 -0
  66. package/WAProto/parts/BotPromotionMessageMetadata.part +124 -0
  67. package/WAProto/parts/BotPromptSuggestion.part +100 -0
  68. package/WAProto/parts/BotPromptSuggestions.part +92 -0
  69. package/WAProto/parts/BotPttPromptMetadata.part +81 -0
  70. package/WAProto/parts/BotQuotaMetadata.part +241 -0
  71. package/WAProto/parts/BotReminderMetadata.part +232 -0
  72. package/WAProto/parts/BotRenderingConfigMetadata.part +100 -0
  73. package/WAProto/parts/BotRenderingMetadata.part +203 -0
  74. package/WAProto/parts/BotResolvedToolCallMetadata.part +100 -0
  75. package/WAProto/parts/BotSessionMetadata.part +137 -0
  76. package/WAProto/parts/BotSessionSource.part +11 -0
  77. package/WAProto/parts/BotSignatureVerificationMetadata.part +92 -0
  78. package/WAProto/parts/BotSignatureVerificationUseCaseProof.part +183 -0
  79. package/WAProto/parts/BotSourcesMetadata.part +322 -0
  80. package/WAProto/parts/BotSuggestedPromptMetadata.part +150 -0
  81. package/WAProto/parts/BotUnifiedResponseMutation.part +339 -0
  82. package/WAProto/parts/CallLogRecord.part +646 -0
  83. package/WAProto/parts/CertChain.part +392 -0
  84. package/WAProto/parts/ChatLockSettings.part +102 -0
  85. package/WAProto/parts/ChatRowOpaqueData.part +712 -0
  86. package/WAProto/parts/Citation.part +119 -0
  87. package/WAProto/parts/ClientPairingProps.part +160 -0
  88. package/WAProto/parts/ClientPayload.part +2892 -0
  89. package/WAProto/parts/CollectionName.part +9 -0
  90. package/WAProto/parts/CommentMetadata.part +102 -0
  91. package/WAProto/parts/CompanionCommitment.part +84 -0
  92. package/WAProto/parts/CompanionEphemeralIdentity.part +227 -0
  93. package/WAProto/parts/Config.part +136 -0
  94. package/WAProto/parts/ContextInfo.part +4137 -0
  95. package/WAProto/parts/Conversation.part +1472 -0
  96. package/WAProto/parts/DeviceCapabilities.part +670 -0
  97. package/WAProto/parts/DeviceConsistencyCodeMessage.part +103 -0
  98. package/WAProto/parts/DeviceListMetadata.part +306 -0
  99. package/WAProto/parts/DeviceProps.part +982 -0
  100. package/WAProto/parts/DisappearingMode.part +206 -0
  101. package/WAProto/parts/EmbeddedContent.part +100 -0
  102. package/WAProto/parts/EmbeddedMessage.part +102 -0
  103. package/WAProto/parts/EmbeddedMusic.part +370 -0
  104. package/WAProto/parts/EncryptedPairingRequest.part +106 -0
  105. package/WAProto/parts/EphemeralSetting.part +110 -0
  106. package/WAProto/parts/EventAdditionalMetadata.part +81 -0
  107. package/WAProto/parts/EventResponse.part +152 -0
  108. package/WAProto/parts/ExitCode.part +110 -0
  109. package/WAProto/parts/ExternalBlobReference.part +195 -0
  110. package/WAProto/parts/Field.part +193 -0
  111. package/WAProto/parts/ForwardedAIBotMessageInfo.part +119 -0
  112. package/WAProto/parts/GlobalSettings.part +497 -0
  113. package/WAProto/parts/GroupHistoryBundleInfo.part +141 -0
  114. package/WAProto/parts/GroupHistoryIndividualMessageInfo.part +102 -0
  115. package/WAProto/parts/GroupMention.part +100 -0
  116. package/WAProto/parts/GroupParticipant.part +142 -0
  117. package/WAProto/parts/GroupRootKeyShare.part +92 -0
  118. package/WAProto/parts/GroupRootKeyShareEntry.part +161 -0
  119. package/WAProto/parts/HandshakeMessage.part +815 -0
  120. package/WAProto/parts/HatchMetadataSync.part +132 -0
  121. package/WAProto/parts/HistorySync.part +605 -0
  122. package/WAProto/parts/HistorySyncMsg.part +112 -0
  123. package/WAProto/parts/HydratedTemplateButton.part +501 -0
  124. package/WAProto/parts/IdentityKeyPairStructure.part +106 -0
  125. package/WAProto/parts/InThreadSurveyMetadata.part +779 -0
  126. package/WAProto/parts/InlineContact.part +157 -0
  127. package/WAProto/parts/InteractiveAnnotation.part +246 -0
  128. package/WAProto/parts/InteractiveMessageAdditionalMetadata.part +81 -0
  129. package/WAProto/parts/KeepInChat.part +225 -0
  130. package/WAProto/parts/KeepType.part +6 -0
  131. package/WAProto/parts/KeyExchangeMessage.part +169 -0
  132. package/WAProto/parts/KeyId.part +84 -0
  133. package/WAProto/parts/LIDMigrationMapping.part +149 -0
  134. package/WAProto/parts/LIDMigrationMappingSyncMessage.part +84 -0
  135. package/WAProto/parts/LIDMigrationMappingSyncPayload.part +122 -0
  136. package/WAProto/parts/LegacyMessage.part +104 -0
  137. package/WAProto/parts/LimitSharing.part +177 -0
  138. package/WAProto/parts/LocalizedName.part +119 -0
  139. package/WAProto/parts/Location.part +119 -0
  140. package/WAProto/parts/MediaData.part +81 -0
  141. package/WAProto/parts/MediaDomainInfo.part +120 -0
  142. package/WAProto/parts/MediaKeyDomain.part +6 -0
  143. package/WAProto/parts/MediaNotifyMessage.part +132 -0
  144. package/WAProto/parts/MediaRetryNotification.part +170 -0
  145. package/WAProto/parts/MediaVisibility.part +6 -0
  146. package/WAProto/parts/MemberLabel.part +110 -0
  147. package/WAProto/parts/Message.part +32376 -0
  148. package/WAProto/parts/MessageAddOn.part +305 -0
  149. package/WAProto/parts/MessageAddOnContextInfo.part +113 -0
  150. package/WAProto/parts/MessageAssociation.part +235 -0
  151. package/WAProto/parts/MessageContextInfo.part +451 -0
  152. package/WAProto/parts/MessageKey.part +138 -0
  153. package/WAProto/parts/MessageSecretMessage.part +125 -0
  154. package/WAProto/parts/Money.part +129 -0
  155. package/WAProto/parts/MsgOpaqueData.part +1732 -0
  156. package/WAProto/parts/MsgRowOpaqueData.part +104 -0
  157. package/WAProto/parts/MutationProps.part +89 -0
  158. package/WAProto/parts/NoiseCertificate.part +277 -0
  159. package/WAProto/parts/NotificationMessageInfo.part +152 -0
  160. package/WAProto/parts/NotificationSettings.part +176 -0
  161. package/WAProto/parts/PairingRequest.part +128 -0
  162. package/WAProto/parts/PastParticipant.part +148 -0
  163. package/WAProto/parts/PastParticipants.part +112 -0
  164. package/WAProto/parts/PatchDebugData.part +358 -0
  165. package/WAProto/parts/PaymentBackground.part +460 -0
  166. package/WAProto/parts/PaymentInfo.part +602 -0
  167. package/WAProto/parts/PhoneNumberToLIDMapping.part +100 -0
  168. package/WAProto/parts/PhotoChange.part +125 -0
  169. package/WAProto/parts/PinInChat.part +205 -0
  170. package/WAProto/parts/Point.part +138 -0
  171. package/WAProto/parts/PollAdditionalMetadata.part +216 -0
  172. package/WAProto/parts/PollEncValue.part +106 -0
  173. package/WAProto/parts/PollUpdate.part +202 -0
  174. package/WAProto/parts/PreKeyRecordStructure.part +125 -0
  175. package/WAProto/parts/PreKeySignalMessage.part +185 -0
  176. package/WAProto/parts/PremiumMessageInfo.part +81 -0
  177. package/WAProto/parts/PrimaryEphemeralIdentity.part +106 -0
  178. package/WAProto/parts/PrivacySystemMessage.part +6 -0
  179. package/WAProto/parts/ProcessedVideo.part +266 -0
  180. package/WAProto/parts/ProloguePayload.part +105 -0
  181. package/WAProto/parts/Pushname.part +100 -0
  182. package/WAProto/parts/QuarantinedMessage.part +103 -0
  183. package/WAProto/parts/Reaction.part +169 -0
  184. package/WAProto/parts/RecentEmojiWeight.part +100 -0
  185. package/WAProto/parts/RecordStructure.part +114 -0
  186. package/WAProto/parts/Reportable.part +138 -0
  187. package/WAProto/parts/ReportingTokenInfo.part +84 -0
  188. package/WAProto/parts/ScheduledMessageMetadata.part +132 -0
  189. package/WAProto/parts/SenderKeyDistributionMessage.part +144 -0
  190. package/WAProto/parts/SenderKeyMessage.part +122 -0
  191. package/WAProto/parts/SenderKeyRecordStructure.part +92 -0
  192. package/WAProto/parts/SenderKeyStateStructure.part +469 -0
  193. package/WAProto/parts/ServerErrorReceipt.part +81 -0
  194. package/WAProto/parts/SessionStructure.part +1087 -0
  195. package/WAProto/parts/SessionTransparencyMetadata.part +132 -0
  196. package/WAProto/parts/SessionTransparencyType.part +5 -0
  197. package/WAProto/parts/SignalMessage.part +144 -0
  198. package/WAProto/parts/SignedPreKeyRecordStructure.part +176 -0
  199. package/WAProto/parts/StatusAttribution.part +1235 -0
  200. package/WAProto/parts/StatusMentionMessage.part +83 -0
  201. package/WAProto/parts/StatusPSA.part +121 -0
  202. package/WAProto/parts/StickerMetadata.part +357 -0
  203. package/WAProto/parts/SyncActionData.part +146 -0
  204. package/WAProto/parts/SyncActionValue.part +12959 -0
  205. package/WAProto/parts/SyncdIndex.part +84 -0
  206. package/WAProto/parts/SyncdMutation.part +121 -0
  207. package/WAProto/parts/SyncdMutations.part +92 -0
  208. package/WAProto/parts/SyncdPatch.part +262 -0
  209. package/WAProto/parts/SyncdRecord.part +125 -0
  210. package/WAProto/parts/SyncdSnapshot.part +157 -0
  211. package/WAProto/parts/SyncdValue.part +84 -0
  212. package/WAProto/parts/SyncdVersion.part +91 -0
  213. package/WAProto/parts/TapLinkAction.part +100 -0
  214. package/WAProto/parts/TemplateButton.part +449 -0
  215. package/WAProto/parts/ThreadID.part +126 -0
  216. package/WAProto/parts/UrlTrackingMap.part +231 -0
  217. package/WAProto/parts/UserPassword.part +399 -0
  218. package/WAProto/parts/UserReceipt.part +221 -0
  219. package/WAProto/parts/VerifiedNameCertificate.part +318 -0
  220. package/WAProto/parts/WallpaperSettings.part +119 -0
  221. package/WAProto/parts/WebFeatures.part +1870 -0
  222. package/WAProto/parts/WebLinkRenderConfig.part +5 -0
  223. package/WAProto/parts/WebMessageInfo.part +2851 -0
  224. package/WAProto/parts/WebNotificationsInfo.part +160 -0
  225. package/package.json +1 -1
  226. package/src/binary/wa-binary.js +4 -2
  227. package/src/defaults.js +2 -1
  228. package/src/foundation/cache.js +99 -24
  229. package/src/foundation/memory.js +103 -0
  230. package/src/signal/libsignal.js +1 -8
  231. package/src/signal/signal-repository.js +6 -4
  232. package/src/socket/chats.js +2 -0
  233. package/src/socket/messages-recv.js +5 -3
  234. package/src/socket/messages-send.js +2 -2
  235. package/src/socket/socket-core.js +3 -0
  236. package/src/utils/auth-state-core.js +2 -1
  237. package/src/utils/chat-sync.js +4 -0
  238. package/src/utils/media.js +13 -8
  239. package/src/utils/message-processing.js +22 -6
  240. package/src/utils/wa-protocol-core.js +6 -5
  241. package/src/wam/wam-constants.js +22 -22851
  242. package/src/wam/wam-data.json +1 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ function BotGroupMetadata(p) {
3
+ this.participantsMetadata = [];
4
+ if (p)
5
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
6
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
7
+ this[ks[i]] = p[ks[i]];
8
+ }
9
+ BotGroupMetadata.prototype.participantsMetadata = $util.emptyArray;
10
+ BotGroupMetadata.create = function create(properties) {
11
+ return new BotGroupMetadata(properties);
12
+ };
13
+ BotGroupMetadata.encode = function encode(m, w) {
14
+ if (!w)
15
+ w = $Writer.create();
16
+ if (m.participantsMetadata != null && m.participantsMetadata.length) {
17
+ for (var i = 0; i < m.participantsMetadata.length; ++i)
18
+ $root.proto.BotGroupParticipantMetadata.encode(m.participantsMetadata[i], w.uint32(10).fork()).ldelim();
19
+ }
20
+ return w;
21
+ };
22
+ BotGroupMetadata.decode = function decode(r, l, e, n) {
23
+ if (!(r instanceof $Reader))
24
+ r = $Reader.create(r);
25
+ if (n === undefined)
26
+ n = 0;
27
+ if (n > $Reader.recursionLimit)
28
+ throw Error("maximum nesting depth exceeded");
29
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotGroupMetadata();
30
+ while (r.pos < c) {
31
+ var t = r.uint32();
32
+ if (t === e)
33
+ break;
34
+ switch (t >>> 3) {
35
+ case 1: {
36
+ if (!(m.participantsMetadata && m.participantsMetadata.length))
37
+ m.participantsMetadata = [];
38
+ m.participantsMetadata.push($root.proto.BotGroupParticipantMetadata.decode(r, r.uint32(), undefined, n + 1));
39
+ break;
40
+ }
41
+ default:
42
+ r.skipType(t & 7, n);
43
+ break;
44
+ }
45
+ }
46
+ return m;
47
+ };
48
+ BotGroupMetadata.fromObject = function fromObject(d, n) {
49
+ if (d instanceof $root.proto.BotGroupMetadata)
50
+ return d;
51
+ if (n === undefined)
52
+ n = 0;
53
+ if (n > $util.recursionLimit)
54
+ throw Error("maximum nesting depth exceeded");
55
+ var m = new $root.proto.BotGroupMetadata();
56
+ if (d.participantsMetadata) {
57
+ if (!Array.isArray(d.participantsMetadata))
58
+ throw TypeError(".proto.BotGroupMetadata.participantsMetadata: array expected");
59
+ m.participantsMetadata = [];
60
+ for (var i = 0; i < d.participantsMetadata.length; ++i) {
61
+ if (typeof d.participantsMetadata[i] !== "object")
62
+ throw TypeError(".proto.BotGroupMetadata.participantsMetadata: object expected");
63
+ m.participantsMetadata[i] = $root.proto.BotGroupParticipantMetadata.fromObject(d.participantsMetadata[i], n + 1);
64
+ }
65
+ }
66
+ return m;
67
+ };
68
+ BotGroupMetadata.toObject = function toObject(m, o) {
69
+ if (!o)
70
+ o = {};
71
+ var d = {};
72
+ if (o.arrays || o.defaults) {
73
+ d.participantsMetadata = [];
74
+ }
75
+ if (m.participantsMetadata && m.participantsMetadata.length) {
76
+ d.participantsMetadata = [];
77
+ for (var j = 0; j < m.participantsMetadata.length; ++j) {
78
+ d.participantsMetadata[j] = $root.proto.BotGroupParticipantMetadata.toObject(m.participantsMetadata[j], o);
79
+ }
80
+ }
81
+ return d;
82
+ };
83
+ BotGroupMetadata.prototype.toJSON = function toJSON() {
84
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
85
+ };
86
+ BotGroupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
87
+ if (typeUrlPrefix === undefined) {
88
+ typeUrlPrefix = "type.googleapis.com";
89
+ }
90
+ return typeUrlPrefix + "/proto.BotGroupMetadata";
91
+ };
92
+ return BotGroupMetadata;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ function BotGroupParticipantMetadata(p) {
3
+ if (p)
4
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
5
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
6
+ this[ks[i]] = p[ks[i]];
7
+ }
8
+ BotGroupParticipantMetadata.prototype.botFbid = null;
9
+ let $oneOfFields;
10
+ Object.defineProperty(BotGroupParticipantMetadata.prototype, "_botFbid", {
11
+ get: $util.oneOfGetter($oneOfFields = ["botFbid"]),
12
+ set: $util.oneOfSetter($oneOfFields)
13
+ });
14
+ BotGroupParticipantMetadata.create = function create(properties) {
15
+ return new BotGroupParticipantMetadata(properties);
16
+ };
17
+ BotGroupParticipantMetadata.encode = function encode(m, w) {
18
+ if (!w)
19
+ w = $Writer.create();
20
+ if (m.botFbid != null && Object.hasOwnProperty.call(m, "botFbid"))
21
+ w.uint32(10).string(m.botFbid);
22
+ return w;
23
+ };
24
+ BotGroupParticipantMetadata.decode = function decode(r, l, e, n) {
25
+ if (!(r instanceof $Reader))
26
+ r = $Reader.create(r);
27
+ if (n === undefined)
28
+ n = 0;
29
+ if (n > $Reader.recursionLimit)
30
+ throw Error("maximum nesting depth exceeded");
31
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotGroupParticipantMetadata();
32
+ while (r.pos < c) {
33
+ var t = r.uint32();
34
+ if (t === e)
35
+ break;
36
+ switch (t >>> 3) {
37
+ case 1: {
38
+ m.botFbid = r.string();
39
+ break;
40
+ }
41
+ default:
42
+ r.skipType(t & 7, n);
43
+ break;
44
+ }
45
+ }
46
+ return m;
47
+ };
48
+ BotGroupParticipantMetadata.fromObject = function fromObject(d, n) {
49
+ if (d instanceof $root.proto.BotGroupParticipantMetadata)
50
+ return d;
51
+ if (n === undefined)
52
+ n = 0;
53
+ if (n > $util.recursionLimit)
54
+ throw Error("maximum nesting depth exceeded");
55
+ var m = new $root.proto.BotGroupParticipantMetadata();
56
+ if (d.botFbid != null) {
57
+ m.botFbid = String(d.botFbid);
58
+ }
59
+ return m;
60
+ };
61
+ BotGroupParticipantMetadata.toObject = function toObject(m, o) {
62
+ if (!o)
63
+ o = {};
64
+ var d = {};
65
+ if (m.botFbid != null && m.hasOwnProperty("botFbid")) {
66
+ d.botFbid = m.botFbid;
67
+ if (o.oneofs)
68
+ d._botFbid = "botFbid";
69
+ }
70
+ return d;
71
+ };
72
+ BotGroupParticipantMetadata.prototype.toJSON = function toJSON() {
73
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
74
+ };
75
+ BotGroupParticipantMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
76
+ if (typeUrlPrefix === undefined) {
77
+ typeUrlPrefix = "type.googleapis.com";
78
+ }
79
+ return typeUrlPrefix + "/proto.BotGroupParticipantMetadata";
80
+ };
81
+ return BotGroupParticipantMetadata;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ function BotImagineMetadata(p) {
3
+ if (p)
4
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
5
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
6
+ this[ks[i]] = p[ks[i]];
7
+ }
8
+ BotImagineMetadata.prototype.imagineType = null;
9
+ BotImagineMetadata.prototype.shortPrompt = null;
10
+ let $oneOfFields;
11
+ Object.defineProperty(BotImagineMetadata.prototype, "_imagineType", {
12
+ get: $util.oneOfGetter($oneOfFields = ["imagineType"]),
13
+ set: $util.oneOfSetter($oneOfFields)
14
+ });
15
+ Object.defineProperty(BotImagineMetadata.prototype, "_shortPrompt", {
16
+ get: $util.oneOfGetter($oneOfFields = ["shortPrompt"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ BotImagineMetadata.create = function create(properties) {
20
+ return new BotImagineMetadata(properties);
21
+ };
22
+ BotImagineMetadata.encode = function encode(m, w) {
23
+ if (!w)
24
+ w = $Writer.create();
25
+ if (m.imagineType != null && Object.hasOwnProperty.call(m, "imagineType"))
26
+ w.uint32(8).int32(m.imagineType);
27
+ if (m.shortPrompt != null && Object.hasOwnProperty.call(m, "shortPrompt"))
28
+ w.uint32(18).string(m.shortPrompt);
29
+ return w;
30
+ };
31
+ BotImagineMetadata.decode = function decode(r, l, e, n) {
32
+ if (!(r instanceof $Reader))
33
+ r = $Reader.create(r);
34
+ if (n === undefined)
35
+ n = 0;
36
+ if (n > $Reader.recursionLimit)
37
+ throw Error("maximum nesting depth exceeded");
38
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotImagineMetadata();
39
+ while (r.pos < c) {
40
+ var t = r.uint32();
41
+ if (t === e)
42
+ break;
43
+ switch (t >>> 3) {
44
+ case 1: {
45
+ m.imagineType = r.int32();
46
+ break;
47
+ }
48
+ case 2: {
49
+ m.shortPrompt = r.string();
50
+ break;
51
+ }
52
+ default:
53
+ r.skipType(t & 7, n);
54
+ break;
55
+ }
56
+ }
57
+ return m;
58
+ };
59
+ BotImagineMetadata.fromObject = function fromObject(d, n) {
60
+ if (d instanceof $root.proto.BotImagineMetadata)
61
+ return d;
62
+ if (n === undefined)
63
+ n = 0;
64
+ if (n > $util.recursionLimit)
65
+ throw Error("maximum nesting depth exceeded");
66
+ var m = new $root.proto.BotImagineMetadata();
67
+ switch (d.imagineType) {
68
+ default:
69
+ if (typeof d.imagineType === "number") {
70
+ m.imagineType = d.imagineType;
71
+ break;
72
+ }
73
+ break;
74
+ case "UNKNOWN":
75
+ case 0:
76
+ m.imagineType = 0;
77
+ break;
78
+ case "IMAGINE":
79
+ case 1:
80
+ m.imagineType = 1;
81
+ break;
82
+ case "MEMU":
83
+ case 2:
84
+ m.imagineType = 2;
85
+ break;
86
+ case "FLASH":
87
+ case 3:
88
+ m.imagineType = 3;
89
+ break;
90
+ case "EDIT":
91
+ case 4:
92
+ m.imagineType = 4;
93
+ break;
94
+ }
95
+ if (d.shortPrompt != null) {
96
+ m.shortPrompt = String(d.shortPrompt);
97
+ }
98
+ return m;
99
+ };
100
+ BotImagineMetadata.toObject = function toObject(m, o) {
101
+ if (!o)
102
+ o = {};
103
+ var d = {};
104
+ if (m.imagineType != null && m.hasOwnProperty("imagineType")) {
105
+ d.imagineType = o.enums === String ? $root.proto.BotImagineMetadata.ImagineType[m.imagineType] === undefined ? m.imagineType : $root.proto.BotImagineMetadata.ImagineType[m.imagineType] : m.imagineType;
106
+ if (o.oneofs)
107
+ d._imagineType = "imagineType";
108
+ }
109
+ if (m.shortPrompt != null && m.hasOwnProperty("shortPrompt")) {
110
+ d.shortPrompt = m.shortPrompt;
111
+ if (o.oneofs)
112
+ d._shortPrompt = "shortPrompt";
113
+ }
114
+ return d;
115
+ };
116
+ BotImagineMetadata.prototype.toJSON = function toJSON() {
117
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
118
+ };
119
+ BotImagineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
120
+ if (typeUrlPrefix === undefined) {
121
+ typeUrlPrefix = "type.googleapis.com";
122
+ }
123
+ return typeUrlPrefix + "/proto.BotImagineMetadata";
124
+ };
125
+ $lazy(BotImagineMetadata, "ImagineType", function() {
126
+ const valuesById = {}, values = Object.create(valuesById);
127
+ values[valuesById[0] = "UNKNOWN"] = 0;
128
+ values[valuesById[1] = "IMAGINE"] = 1;
129
+ values[valuesById[2] = "MEMU"] = 2;
130
+ values[valuesById[3] = "FLASH"] = 3;
131
+ values[valuesById[4] = "EDIT"] = 4;
132
+ return values;
133
+ });
134
+ return BotImagineMetadata;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ function BotInfrastructureDiagnostics(p) {
3
+ this.toolsUsed = [];
4
+ if (p)
5
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
6
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
7
+ this[ks[i]] = p[ks[i]];
8
+ }
9
+ BotInfrastructureDiagnostics.prototype.botBackend = null;
10
+ BotInfrastructureDiagnostics.prototype.toolsUsed = $util.emptyArray;
11
+ BotInfrastructureDiagnostics.prototype.isThinking = null;
12
+ let $oneOfFields;
13
+ Object.defineProperty(BotInfrastructureDiagnostics.prototype, "_botBackend", {
14
+ get: $util.oneOfGetter($oneOfFields = ["botBackend"]),
15
+ set: $util.oneOfSetter($oneOfFields)
16
+ });
17
+ Object.defineProperty(BotInfrastructureDiagnostics.prototype, "_isThinking", {
18
+ get: $util.oneOfGetter($oneOfFields = ["isThinking"]),
19
+ set: $util.oneOfSetter($oneOfFields)
20
+ });
21
+ BotInfrastructureDiagnostics.create = function create(properties) {
22
+ return new BotInfrastructureDiagnostics(properties);
23
+ };
24
+ BotInfrastructureDiagnostics.encode = function encode(m, w) {
25
+ if (!w)
26
+ w = $Writer.create();
27
+ if (m.botBackend != null && Object.hasOwnProperty.call(m, "botBackend"))
28
+ w.uint32(8).int32(m.botBackend);
29
+ if (m.toolsUsed != null && m.toolsUsed.length) {
30
+ for (var i = 0; i < m.toolsUsed.length; ++i)
31
+ w.uint32(18).string(m.toolsUsed[i]);
32
+ }
33
+ if (m.isThinking != null && Object.hasOwnProperty.call(m, "isThinking"))
34
+ w.uint32(24).bool(m.isThinking);
35
+ return w;
36
+ };
37
+ BotInfrastructureDiagnostics.decode = function decode(r, l, e, n) {
38
+ if (!(r instanceof $Reader))
39
+ r = $Reader.create(r);
40
+ if (n === undefined)
41
+ n = 0;
42
+ if (n > $Reader.recursionLimit)
43
+ throw Error("maximum nesting depth exceeded");
44
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotInfrastructureDiagnostics();
45
+ while (r.pos < c) {
46
+ var t = r.uint32();
47
+ if (t === e)
48
+ break;
49
+ switch (t >>> 3) {
50
+ case 1: {
51
+ m.botBackend = r.int32();
52
+ break;
53
+ }
54
+ case 2: {
55
+ if (!(m.toolsUsed && m.toolsUsed.length))
56
+ m.toolsUsed = [];
57
+ m.toolsUsed.push(r.string());
58
+ break;
59
+ }
60
+ case 3: {
61
+ m.isThinking = r.bool();
62
+ break;
63
+ }
64
+ default:
65
+ r.skipType(t & 7, n);
66
+ break;
67
+ }
68
+ }
69
+ return m;
70
+ };
71
+ BotInfrastructureDiagnostics.fromObject = function fromObject(d, n) {
72
+ if (d instanceof $root.proto.BotInfrastructureDiagnostics)
73
+ return d;
74
+ if (n === undefined)
75
+ n = 0;
76
+ if (n > $util.recursionLimit)
77
+ throw Error("maximum nesting depth exceeded");
78
+ var m = new $root.proto.BotInfrastructureDiagnostics();
79
+ switch (d.botBackend) {
80
+ default:
81
+ if (typeof d.botBackend === "number") {
82
+ m.botBackend = d.botBackend;
83
+ break;
84
+ }
85
+ break;
86
+ case "AAPI":
87
+ case 0:
88
+ m.botBackend = 0;
89
+ break;
90
+ case "CLIPPY":
91
+ case 1:
92
+ m.botBackend = 1;
93
+ break;
94
+ }
95
+ if (d.toolsUsed) {
96
+ if (!Array.isArray(d.toolsUsed))
97
+ throw TypeError(".proto.BotInfrastructureDiagnostics.toolsUsed: array expected");
98
+ m.toolsUsed = [];
99
+ for (var i = 0; i < d.toolsUsed.length; ++i) {
100
+ m.toolsUsed[i] = String(d.toolsUsed[i]);
101
+ }
102
+ }
103
+ if (d.isThinking != null) {
104
+ m.isThinking = Boolean(d.isThinking);
105
+ }
106
+ return m;
107
+ };
108
+ BotInfrastructureDiagnostics.toObject = function toObject(m, o) {
109
+ if (!o)
110
+ o = {};
111
+ var d = {};
112
+ if (o.arrays || o.defaults) {
113
+ d.toolsUsed = [];
114
+ }
115
+ if (m.botBackend != null && m.hasOwnProperty("botBackend")) {
116
+ d.botBackend = o.enums === String ? $root.proto.BotInfrastructureDiagnostics.BotBackend[m.botBackend] === undefined ? m.botBackend : $root.proto.BotInfrastructureDiagnostics.BotBackend[m.botBackend] : m.botBackend;
117
+ if (o.oneofs)
118
+ d._botBackend = "botBackend";
119
+ }
120
+ if (m.toolsUsed && m.toolsUsed.length) {
121
+ d.toolsUsed = [];
122
+ for (var j = 0; j < m.toolsUsed.length; ++j) {
123
+ d.toolsUsed[j] = m.toolsUsed[j];
124
+ }
125
+ }
126
+ if (m.isThinking != null && m.hasOwnProperty("isThinking")) {
127
+ d.isThinking = m.isThinking;
128
+ if (o.oneofs)
129
+ d._isThinking = "isThinking";
130
+ }
131
+ return d;
132
+ };
133
+ BotInfrastructureDiagnostics.prototype.toJSON = function toJSON() {
134
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
135
+ };
136
+ BotInfrastructureDiagnostics.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
137
+ if (typeUrlPrefix === undefined) {
138
+ typeUrlPrefix = "type.googleapis.com";
139
+ }
140
+ return typeUrlPrefix + "/proto.BotInfrastructureDiagnostics";
141
+ };
142
+ $lazy(BotInfrastructureDiagnostics, "BotBackend", function() {
143
+ const valuesById = {}, values = Object.create(valuesById);
144
+ values[valuesById[0] = "AAPI"] = 0;
145
+ values[valuesById[1] = "CLIPPY"] = 1;
146
+ return values;
147
+ });
148
+ return BotInfrastructureDiagnostics;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ function BotLinkedAccount(p) {
3
+ if (p)
4
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
5
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
6
+ this[ks[i]] = p[ks[i]];
7
+ }
8
+ BotLinkedAccount.prototype.type = null;
9
+ let $oneOfFields;
10
+ Object.defineProperty(BotLinkedAccount.prototype, "_type", {
11
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
12
+ set: $util.oneOfSetter($oneOfFields)
13
+ });
14
+ BotLinkedAccount.create = function create(properties) {
15
+ return new BotLinkedAccount(properties);
16
+ };
17
+ BotLinkedAccount.encode = function encode(m, w) {
18
+ if (!w)
19
+ w = $Writer.create();
20
+ if (m.type != null && Object.hasOwnProperty.call(m, "type"))
21
+ w.uint32(8).int32(m.type);
22
+ return w;
23
+ };
24
+ BotLinkedAccount.decode = function decode(r, l, e, n) {
25
+ if (!(r instanceof $Reader))
26
+ r = $Reader.create(r);
27
+ if (n === undefined)
28
+ n = 0;
29
+ if (n > $Reader.recursionLimit)
30
+ throw Error("maximum nesting depth exceeded");
31
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotLinkedAccount();
32
+ while (r.pos < c) {
33
+ var t = r.uint32();
34
+ if (t === e)
35
+ break;
36
+ switch (t >>> 3) {
37
+ case 1: {
38
+ m.type = r.int32();
39
+ break;
40
+ }
41
+ default:
42
+ r.skipType(t & 7, n);
43
+ break;
44
+ }
45
+ }
46
+ return m;
47
+ };
48
+ BotLinkedAccount.fromObject = function fromObject(d, n) {
49
+ if (d instanceof $root.proto.BotLinkedAccount)
50
+ return d;
51
+ if (n === undefined)
52
+ n = 0;
53
+ if (n > $util.recursionLimit)
54
+ throw Error("maximum nesting depth exceeded");
55
+ var m = new $root.proto.BotLinkedAccount();
56
+ switch (d.type) {
57
+ default:
58
+ if (typeof d.type === "number") {
59
+ m.type = d.type;
60
+ break;
61
+ }
62
+ break;
63
+ case "BOT_LINKED_ACCOUNT_TYPE_1P":
64
+ case 0:
65
+ m.type = 0;
66
+ break;
67
+ }
68
+ return m;
69
+ };
70
+ BotLinkedAccount.toObject = function toObject(m, o) {
71
+ if (!o)
72
+ o = {};
73
+ var d = {};
74
+ if (m.type != null && m.hasOwnProperty("type")) {
75
+ d.type = o.enums === String ? $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] === undefined ? m.type : $root.proto.BotLinkedAccount.BotLinkedAccountType[m.type] : m.type;
76
+ if (o.oneofs)
77
+ d._type = "type";
78
+ }
79
+ return d;
80
+ };
81
+ BotLinkedAccount.prototype.toJSON = function toJSON() {
82
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
83
+ };
84
+ BotLinkedAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
85
+ if (typeUrlPrefix === undefined) {
86
+ typeUrlPrefix = "type.googleapis.com";
87
+ }
88
+ return typeUrlPrefix + "/proto.BotLinkedAccount";
89
+ };
90
+ $lazy(BotLinkedAccount, "BotLinkedAccountType", function() {
91
+ const valuesById = {}, values = Object.create(valuesById);
92
+ values[valuesById[0] = "BOT_LINKED_ACCOUNT_TYPE_1P"] = 0;
93
+ return values;
94
+ });
95
+ return BotLinkedAccount;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ function BotLinkedAccountsMetadata(p) {
3
+ this.accounts = [];
4
+ if (p)
5
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
6
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
7
+ this[ks[i]] = p[ks[i]];
8
+ }
9
+ BotLinkedAccountsMetadata.prototype.accounts = $util.emptyArray;
10
+ BotLinkedAccountsMetadata.prototype.acAuthTokens = null;
11
+ BotLinkedAccountsMetadata.prototype.acErrorCode = null;
12
+ let $oneOfFields;
13
+ Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acAuthTokens", {
14
+ get: $util.oneOfGetter($oneOfFields = ["acAuthTokens"]),
15
+ set: $util.oneOfSetter($oneOfFields)
16
+ });
17
+ Object.defineProperty(BotLinkedAccountsMetadata.prototype, "_acErrorCode", {
18
+ get: $util.oneOfGetter($oneOfFields = ["acErrorCode"]),
19
+ set: $util.oneOfSetter($oneOfFields)
20
+ });
21
+ BotLinkedAccountsMetadata.create = function create(properties) {
22
+ return new BotLinkedAccountsMetadata(properties);
23
+ };
24
+ BotLinkedAccountsMetadata.encode = function encode(m, w) {
25
+ if (!w)
26
+ w = $Writer.create();
27
+ if (m.accounts != null && m.accounts.length) {
28
+ for (var i = 0; i < m.accounts.length; ++i)
29
+ $root.proto.BotLinkedAccount.encode(m.accounts[i], w.uint32(10).fork()).ldelim();
30
+ }
31
+ if (m.acAuthTokens != null && Object.hasOwnProperty.call(m, "acAuthTokens"))
32
+ w.uint32(18).bytes(m.acAuthTokens);
33
+ if (m.acErrorCode != null && Object.hasOwnProperty.call(m, "acErrorCode"))
34
+ w.uint32(24).int32(m.acErrorCode);
35
+ return w;
36
+ };
37
+ BotLinkedAccountsMetadata.decode = function decode(r, l, e, n) {
38
+ if (!(r instanceof $Reader))
39
+ r = $Reader.create(r);
40
+ if (n === undefined)
41
+ n = 0;
42
+ if (n > $Reader.recursionLimit)
43
+ throw Error("maximum nesting depth exceeded");
44
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BotLinkedAccountsMetadata();
45
+ while (r.pos < c) {
46
+ var t = r.uint32();
47
+ if (t === e)
48
+ break;
49
+ switch (t >>> 3) {
50
+ case 1: {
51
+ if (!(m.accounts && m.accounts.length))
52
+ m.accounts = [];
53
+ m.accounts.push($root.proto.BotLinkedAccount.decode(r, r.uint32(), undefined, n + 1));
54
+ break;
55
+ }
56
+ case 2: {
57
+ m.acAuthTokens = r.bytes();
58
+ break;
59
+ }
60
+ case 3: {
61
+ m.acErrorCode = r.int32();
62
+ break;
63
+ }
64
+ default:
65
+ r.skipType(t & 7, n);
66
+ break;
67
+ }
68
+ }
69
+ return m;
70
+ };
71
+ BotLinkedAccountsMetadata.fromObject = function fromObject(d, n) {
72
+ if (d instanceof $root.proto.BotLinkedAccountsMetadata)
73
+ return d;
74
+ if (n === undefined)
75
+ n = 0;
76
+ if (n > $util.recursionLimit)
77
+ throw Error("maximum nesting depth exceeded");
78
+ var m = new $root.proto.BotLinkedAccountsMetadata();
79
+ if (d.accounts) {
80
+ if (!Array.isArray(d.accounts))
81
+ throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");
82
+ m.accounts = [];
83
+ for (var i = 0; i < d.accounts.length; ++i) {
84
+ if (typeof d.accounts[i] !== "object")
85
+ throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: object expected");
86
+ m.accounts[i] = $root.proto.BotLinkedAccount.fromObject(d.accounts[i], n + 1);
87
+ }
88
+ }
89
+ if (d.acAuthTokens != null) {
90
+ if (typeof d.acAuthTokens === "string")
91
+ $util.base64.decode(d.acAuthTokens, m.acAuthTokens = $util.newBuffer($util.base64.length(d.acAuthTokens)), 0);
92
+ else if (d.acAuthTokens.length >= 0)
93
+ m.acAuthTokens = d.acAuthTokens;
94
+ }
95
+ if (d.acErrorCode != null) {
96
+ m.acErrorCode = d.acErrorCode | 0;
97
+ }
98
+ return m;
99
+ };
100
+ BotLinkedAccountsMetadata.toObject = function toObject(m, o) {
101
+ if (!o)
102
+ o = {};
103
+ var d = {};
104
+ if (o.arrays || o.defaults) {
105
+ d.accounts = [];
106
+ }
107
+ if (m.accounts && m.accounts.length) {
108
+ d.accounts = [];
109
+ for (var j = 0; j < m.accounts.length; ++j) {
110
+ d.accounts[j] = $root.proto.BotLinkedAccount.toObject(m.accounts[j], o);
111
+ }
112
+ }
113
+ if (m.acAuthTokens != null && m.hasOwnProperty("acAuthTokens")) {
114
+ d.acAuthTokens = o.bytes === String ? $util.base64.encode(m.acAuthTokens, 0, m.acAuthTokens.length) : o.bytes === Array ? Array.prototype.slice.call(m.acAuthTokens) : m.acAuthTokens;
115
+ if (o.oneofs)
116
+ d._acAuthTokens = "acAuthTokens";
117
+ }
118
+ if (m.acErrorCode != null && m.hasOwnProperty("acErrorCode")) {
119
+ d.acErrorCode = m.acErrorCode;
120
+ if (o.oneofs)
121
+ d._acErrorCode = "acErrorCode";
122
+ }
123
+ return d;
124
+ };
125
+ BotLinkedAccountsMetadata.prototype.toJSON = function toJSON() {
126
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
127
+ };
128
+ BotLinkedAccountsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
129
+ if (typeUrlPrefix === undefined) {
130
+ typeUrlPrefix = "type.googleapis.com";
131
+ }
132
+ return typeUrlPrefix + "/proto.BotLinkedAccountsMetadata";
133
+ };
134
+ return BotLinkedAccountsMetadata;