@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,305 @@
1
+ "use strict";
2
+ function MessageAddOn(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
+ MessageAddOn.prototype.messageAddOnType = null;
9
+ MessageAddOn.prototype.messageAddOn = null;
10
+ MessageAddOn.prototype.senderTimestampMs = null;
11
+ MessageAddOn.prototype.serverTimestampMs = null;
12
+ MessageAddOn.prototype.status = null;
13
+ MessageAddOn.prototype.addOnContextInfo = null;
14
+ MessageAddOn.prototype.messageAddOnKey = null;
15
+ MessageAddOn.prototype.legacyMessage = null;
16
+ let $oneOfFields;
17
+ Object.defineProperty(MessageAddOn.prototype, "_messageAddOnType", {
18
+ get: $util.oneOfGetter($oneOfFields = ["messageAddOnType"]),
19
+ set: $util.oneOfSetter($oneOfFields)
20
+ });
21
+ Object.defineProperty(MessageAddOn.prototype, "_messageAddOn", {
22
+ get: $util.oneOfGetter($oneOfFields = ["messageAddOn"]),
23
+ set: $util.oneOfSetter($oneOfFields)
24
+ });
25
+ Object.defineProperty(MessageAddOn.prototype, "_senderTimestampMs", {
26
+ get: $util.oneOfGetter($oneOfFields = ["senderTimestampMs"]),
27
+ set: $util.oneOfSetter($oneOfFields)
28
+ });
29
+ Object.defineProperty(MessageAddOn.prototype, "_serverTimestampMs", {
30
+ get: $util.oneOfGetter($oneOfFields = ["serverTimestampMs"]),
31
+ set: $util.oneOfSetter($oneOfFields)
32
+ });
33
+ Object.defineProperty(MessageAddOn.prototype, "_status", {
34
+ get: $util.oneOfGetter($oneOfFields = ["status"]),
35
+ set: $util.oneOfSetter($oneOfFields)
36
+ });
37
+ Object.defineProperty(MessageAddOn.prototype, "_addOnContextInfo", {
38
+ get: $util.oneOfGetter($oneOfFields = ["addOnContextInfo"]),
39
+ set: $util.oneOfSetter($oneOfFields)
40
+ });
41
+ Object.defineProperty(MessageAddOn.prototype, "_messageAddOnKey", {
42
+ get: $util.oneOfGetter($oneOfFields = ["messageAddOnKey"]),
43
+ set: $util.oneOfSetter($oneOfFields)
44
+ });
45
+ Object.defineProperty(MessageAddOn.prototype, "_legacyMessage", {
46
+ get: $util.oneOfGetter($oneOfFields = ["legacyMessage"]),
47
+ set: $util.oneOfSetter($oneOfFields)
48
+ });
49
+ MessageAddOn.create = function create(properties) {
50
+ return new MessageAddOn(properties);
51
+ };
52
+ MessageAddOn.encode = function encode(m, w) {
53
+ if (!w)
54
+ w = $Writer.create();
55
+ if (m.messageAddOnType != null && Object.hasOwnProperty.call(m, "messageAddOnType"))
56
+ w.uint32(8).int32(m.messageAddOnType);
57
+ if (m.messageAddOn != null && Object.hasOwnProperty.call(m, "messageAddOn"))
58
+ $root.proto.Message.encode(m.messageAddOn, w.uint32(18).fork()).ldelim();
59
+ if (m.senderTimestampMs != null && Object.hasOwnProperty.call(m, "senderTimestampMs"))
60
+ w.uint32(24).int64(m.senderTimestampMs);
61
+ if (m.serverTimestampMs != null && Object.hasOwnProperty.call(m, "serverTimestampMs"))
62
+ w.uint32(32).int64(m.serverTimestampMs);
63
+ if (m.status != null && Object.hasOwnProperty.call(m, "status"))
64
+ w.uint32(40).int32(m.status);
65
+ if (m.addOnContextInfo != null && Object.hasOwnProperty.call(m, "addOnContextInfo"))
66
+ $root.proto.MessageAddOnContextInfo.encode(m.addOnContextInfo, w.uint32(50).fork()).ldelim();
67
+ if (m.messageAddOnKey != null && Object.hasOwnProperty.call(m, "messageAddOnKey"))
68
+ $root.proto.MessageKey.encode(m.messageAddOnKey, w.uint32(58).fork()).ldelim();
69
+ if (m.legacyMessage != null && Object.hasOwnProperty.call(m, "legacyMessage"))
70
+ $root.proto.LegacyMessage.encode(m.legacyMessage, w.uint32(66).fork()).ldelim();
71
+ return w;
72
+ };
73
+ MessageAddOn.decode = function decode(r, l, e, n) {
74
+ if (!(r instanceof $Reader))
75
+ r = $Reader.create(r);
76
+ if (n === undefined)
77
+ n = 0;
78
+ if (n > $Reader.recursionLimit)
79
+ throw Error("maximum nesting depth exceeded");
80
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageAddOn();
81
+ while (r.pos < c) {
82
+ var t = r.uint32();
83
+ if (t === e)
84
+ break;
85
+ switch (t >>> 3) {
86
+ case 1: {
87
+ m.messageAddOnType = r.int32();
88
+ break;
89
+ }
90
+ case 2: {
91
+ m.messageAddOn = $root.proto.Message.decode(r, r.uint32(), undefined, n + 1);
92
+ break;
93
+ }
94
+ case 3: {
95
+ m.senderTimestampMs = r.int64();
96
+ break;
97
+ }
98
+ case 4: {
99
+ m.serverTimestampMs = r.int64();
100
+ break;
101
+ }
102
+ case 5: {
103
+ m.status = r.int32();
104
+ break;
105
+ }
106
+ case 6: {
107
+ m.addOnContextInfo = $root.proto.MessageAddOnContextInfo.decode(r, r.uint32(), undefined, n + 1);
108
+ break;
109
+ }
110
+ case 7: {
111
+ m.messageAddOnKey = $root.proto.MessageKey.decode(r, r.uint32(), undefined, n + 1);
112
+ break;
113
+ }
114
+ case 8: {
115
+ m.legacyMessage = $root.proto.LegacyMessage.decode(r, r.uint32(), undefined, n + 1);
116
+ break;
117
+ }
118
+ default:
119
+ r.skipType(t & 7, n);
120
+ break;
121
+ }
122
+ }
123
+ return m;
124
+ };
125
+ MessageAddOn.fromObject = function fromObject(d, n) {
126
+ if (d instanceof $root.proto.MessageAddOn)
127
+ return d;
128
+ if (n === undefined)
129
+ n = 0;
130
+ if (n > $util.recursionLimit)
131
+ throw Error("maximum nesting depth exceeded");
132
+ var m = new $root.proto.MessageAddOn();
133
+ switch (d.messageAddOnType) {
134
+ default:
135
+ if (typeof d.messageAddOnType === "number") {
136
+ m.messageAddOnType = d.messageAddOnType;
137
+ break;
138
+ }
139
+ break;
140
+ case "UNDEFINED":
141
+ case 0:
142
+ m.messageAddOnType = 0;
143
+ break;
144
+ case "REACTION":
145
+ case 1:
146
+ m.messageAddOnType = 1;
147
+ break;
148
+ case "EVENT_RESPONSE":
149
+ case 2:
150
+ m.messageAddOnType = 2;
151
+ break;
152
+ case "POLL_UPDATE":
153
+ case 3:
154
+ m.messageAddOnType = 3;
155
+ break;
156
+ case "PIN_IN_CHAT":
157
+ case 4:
158
+ m.messageAddOnType = 4;
159
+ break;
160
+ }
161
+ if (d.messageAddOn != null) {
162
+ if (typeof d.messageAddOn !== "object")
163
+ throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");
164
+ m.messageAddOn = $root.proto.Message.fromObject(d.messageAddOn, n + 1);
165
+ }
166
+ if (d.senderTimestampMs != null) {
167
+ if ($util.Long)
168
+ (m.senderTimestampMs = $util.Long.fromValue(d.senderTimestampMs)).unsigned = false;
169
+ else if (typeof d.senderTimestampMs === "string")
170
+ m.senderTimestampMs = parseInt(d.senderTimestampMs, 10);
171
+ else if (typeof d.senderTimestampMs === "number")
172
+ m.senderTimestampMs = d.senderTimestampMs;
173
+ else if (typeof d.senderTimestampMs === "object")
174
+ m.senderTimestampMs = new $util.LongBits(d.senderTimestampMs.low >>> 0, d.senderTimestampMs.high >>> 0).toNumber();
175
+ }
176
+ if (d.serverTimestampMs != null) {
177
+ if ($util.Long)
178
+ (m.serverTimestampMs = $util.Long.fromValue(d.serverTimestampMs)).unsigned = false;
179
+ else if (typeof d.serverTimestampMs === "string")
180
+ m.serverTimestampMs = parseInt(d.serverTimestampMs, 10);
181
+ else if (typeof d.serverTimestampMs === "number")
182
+ m.serverTimestampMs = d.serverTimestampMs;
183
+ else if (typeof d.serverTimestampMs === "object")
184
+ m.serverTimestampMs = new $util.LongBits(d.serverTimestampMs.low >>> 0, d.serverTimestampMs.high >>> 0).toNumber();
185
+ }
186
+ switch (d.status) {
187
+ default:
188
+ if (typeof d.status === "number") {
189
+ m.status = d.status;
190
+ break;
191
+ }
192
+ break;
193
+ case "ERROR":
194
+ case 0:
195
+ m.status = 0;
196
+ break;
197
+ case "PENDING":
198
+ case 1:
199
+ m.status = 1;
200
+ break;
201
+ case "SERVER_ACK":
202
+ case 2:
203
+ m.status = 2;
204
+ break;
205
+ case "DELIVERY_ACK":
206
+ case 3:
207
+ m.status = 3;
208
+ break;
209
+ case "READ":
210
+ case 4:
211
+ m.status = 4;
212
+ break;
213
+ case "PLAYED":
214
+ case 5:
215
+ m.status = 5;
216
+ break;
217
+ }
218
+ if (d.addOnContextInfo != null) {
219
+ if (typeof d.addOnContextInfo !== "object")
220
+ throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");
221
+ m.addOnContextInfo = $root.proto.MessageAddOnContextInfo.fromObject(d.addOnContextInfo, n + 1);
222
+ }
223
+ if (d.messageAddOnKey != null) {
224
+ if (typeof d.messageAddOnKey !== "object")
225
+ throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");
226
+ m.messageAddOnKey = $root.proto.MessageKey.fromObject(d.messageAddOnKey, n + 1);
227
+ }
228
+ if (d.legacyMessage != null) {
229
+ if (typeof d.legacyMessage !== "object")
230
+ throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");
231
+ m.legacyMessage = $root.proto.LegacyMessage.fromObject(d.legacyMessage, n + 1);
232
+ }
233
+ return m;
234
+ };
235
+ MessageAddOn.toObject = function toObject(m, o) {
236
+ if (!o)
237
+ o = {};
238
+ var d = {};
239
+ if (m.messageAddOnType != null && m.hasOwnProperty("messageAddOnType")) {
240
+ d.messageAddOnType = o.enums === String ? $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] === undefined ? m.messageAddOnType : $root.proto.MessageAddOn.MessageAddOnType[m.messageAddOnType] : m.messageAddOnType;
241
+ if (o.oneofs)
242
+ d._messageAddOnType = "messageAddOnType";
243
+ }
244
+ if (m.messageAddOn != null && m.hasOwnProperty("messageAddOn")) {
245
+ d.messageAddOn = $root.proto.Message.toObject(m.messageAddOn, o);
246
+ if (o.oneofs)
247
+ d._messageAddOn = "messageAddOn";
248
+ }
249
+ if (m.senderTimestampMs != null && m.hasOwnProperty("senderTimestampMs")) {
250
+ if (typeof m.senderTimestampMs === "number")
251
+ d.senderTimestampMs = o.longs === String ? String(m.senderTimestampMs) : m.senderTimestampMs;
252
+ else
253
+ d.senderTimestampMs = o.longs === String ? longToString(m.senderTimestampMs) : o.longs === Number ? longToNumber(m.senderTimestampMs) : m.senderTimestampMs;
254
+ if (o.oneofs)
255
+ d._senderTimestampMs = "senderTimestampMs";
256
+ }
257
+ if (m.serverTimestampMs != null && m.hasOwnProperty("serverTimestampMs")) {
258
+ if (typeof m.serverTimestampMs === "number")
259
+ d.serverTimestampMs = o.longs === String ? String(m.serverTimestampMs) : m.serverTimestampMs;
260
+ else
261
+ d.serverTimestampMs = o.longs === String ? longToString(m.serverTimestampMs) : o.longs === Number ? longToNumber(m.serverTimestampMs) : m.serverTimestampMs;
262
+ if (o.oneofs)
263
+ d._serverTimestampMs = "serverTimestampMs";
264
+ }
265
+ if (m.status != null && m.hasOwnProperty("status")) {
266
+ d.status = o.enums === String ? $root.proto.WebMessageInfo.Status[m.status] === undefined ? m.status : $root.proto.WebMessageInfo.Status[m.status] : m.status;
267
+ if (o.oneofs)
268
+ d._status = "status";
269
+ }
270
+ if (m.addOnContextInfo != null && m.hasOwnProperty("addOnContextInfo")) {
271
+ d.addOnContextInfo = $root.proto.MessageAddOnContextInfo.toObject(m.addOnContextInfo, o);
272
+ if (o.oneofs)
273
+ d._addOnContextInfo = "addOnContextInfo";
274
+ }
275
+ if (m.messageAddOnKey != null && m.hasOwnProperty("messageAddOnKey")) {
276
+ d.messageAddOnKey = $root.proto.MessageKey.toObject(m.messageAddOnKey, o);
277
+ if (o.oneofs)
278
+ d._messageAddOnKey = "messageAddOnKey";
279
+ }
280
+ if (m.legacyMessage != null && m.hasOwnProperty("legacyMessage")) {
281
+ d.legacyMessage = $root.proto.LegacyMessage.toObject(m.legacyMessage, o);
282
+ if (o.oneofs)
283
+ d._legacyMessage = "legacyMessage";
284
+ }
285
+ return d;
286
+ };
287
+ MessageAddOn.prototype.toJSON = function toJSON() {
288
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
289
+ };
290
+ MessageAddOn.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
291
+ if (typeUrlPrefix === undefined) {
292
+ typeUrlPrefix = "type.googleapis.com";
293
+ }
294
+ return typeUrlPrefix + "/proto.MessageAddOn";
295
+ };
296
+ $lazy(MessageAddOn, "MessageAddOnType", function() {
297
+ const valuesById = {}, values = Object.create(valuesById);
298
+ values[valuesById[0] = "UNDEFINED"] = 0;
299
+ values[valuesById[1] = "REACTION"] = 1;
300
+ values[valuesById[2] = "EVENT_RESPONSE"] = 2;
301
+ values[valuesById[3] = "POLL_UPDATE"] = 3;
302
+ values[valuesById[4] = "PIN_IN_CHAT"] = 4;
303
+ return values;
304
+ });
305
+ return MessageAddOn;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ function MessageAddOnContextInfo(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
+ MessageAddOnContextInfo.prototype.messageAddOnDurationInSecs = null;
9
+ MessageAddOnContextInfo.prototype.messageAddOnExpiryType = null;
10
+ let $oneOfFields;
11
+ Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnDurationInSecs", {
12
+ get: $util.oneOfGetter($oneOfFields = ["messageAddOnDurationInSecs"]),
13
+ set: $util.oneOfSetter($oneOfFields)
14
+ });
15
+ Object.defineProperty(MessageAddOnContextInfo.prototype, "_messageAddOnExpiryType", {
16
+ get: $util.oneOfGetter($oneOfFields = ["messageAddOnExpiryType"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ MessageAddOnContextInfo.create = function create(properties) {
20
+ return new MessageAddOnContextInfo(properties);
21
+ };
22
+ MessageAddOnContextInfo.encode = function encode(m, w) {
23
+ if (!w)
24
+ w = $Writer.create();
25
+ if (m.messageAddOnDurationInSecs != null && Object.hasOwnProperty.call(m, "messageAddOnDurationInSecs"))
26
+ w.uint32(8).uint32(m.messageAddOnDurationInSecs);
27
+ if (m.messageAddOnExpiryType != null && Object.hasOwnProperty.call(m, "messageAddOnExpiryType"))
28
+ w.uint32(16).int32(m.messageAddOnExpiryType);
29
+ return w;
30
+ };
31
+ MessageAddOnContextInfo.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.MessageAddOnContextInfo();
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.messageAddOnDurationInSecs = r.uint32();
46
+ break;
47
+ }
48
+ case 2: {
49
+ m.messageAddOnExpiryType = r.int32();
50
+ break;
51
+ }
52
+ default:
53
+ r.skipType(t & 7, n);
54
+ break;
55
+ }
56
+ }
57
+ return m;
58
+ };
59
+ MessageAddOnContextInfo.fromObject = function fromObject(d, n) {
60
+ if (d instanceof $root.proto.MessageAddOnContextInfo)
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.MessageAddOnContextInfo();
67
+ if (d.messageAddOnDurationInSecs != null) {
68
+ m.messageAddOnDurationInSecs = d.messageAddOnDurationInSecs >>> 0;
69
+ }
70
+ switch (d.messageAddOnExpiryType) {
71
+ default:
72
+ if (typeof d.messageAddOnExpiryType === "number") {
73
+ m.messageAddOnExpiryType = d.messageAddOnExpiryType;
74
+ break;
75
+ }
76
+ break;
77
+ case "STATIC":
78
+ case 1:
79
+ m.messageAddOnExpiryType = 1;
80
+ break;
81
+ case "DEPENDENT_ON_PARENT":
82
+ case 2:
83
+ m.messageAddOnExpiryType = 2;
84
+ break;
85
+ }
86
+ return m;
87
+ };
88
+ MessageAddOnContextInfo.toObject = function toObject(m, o) {
89
+ if (!o)
90
+ o = {};
91
+ var d = {};
92
+ if (m.messageAddOnDurationInSecs != null && m.hasOwnProperty("messageAddOnDurationInSecs")) {
93
+ d.messageAddOnDurationInSecs = m.messageAddOnDurationInSecs;
94
+ if (o.oneofs)
95
+ d._messageAddOnDurationInSecs = "messageAddOnDurationInSecs";
96
+ }
97
+ if (m.messageAddOnExpiryType != null && m.hasOwnProperty("messageAddOnExpiryType")) {
98
+ d.messageAddOnExpiryType = o.enums === String ? $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] === undefined ? m.messageAddOnExpiryType : $root.proto.MessageContextInfo.MessageAddonExpiryType[m.messageAddOnExpiryType] : m.messageAddOnExpiryType;
99
+ if (o.oneofs)
100
+ d._messageAddOnExpiryType = "messageAddOnExpiryType";
101
+ }
102
+ return d;
103
+ };
104
+ MessageAddOnContextInfo.prototype.toJSON = function toJSON() {
105
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
106
+ };
107
+ MessageAddOnContextInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
108
+ if (typeUrlPrefix === undefined) {
109
+ typeUrlPrefix = "type.googleapis.com";
110
+ }
111
+ return typeUrlPrefix + "/proto.MessageAddOnContextInfo";
112
+ };
113
+ return MessageAddOnContextInfo;
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ function MessageAssociation(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
+ MessageAssociation.prototype.associationType = null;
9
+ MessageAssociation.prototype.parentMessageKey = null;
10
+ MessageAssociation.prototype.messageIndex = null;
11
+ let $oneOfFields;
12
+ Object.defineProperty(MessageAssociation.prototype, "_associationType", {
13
+ get: $util.oneOfGetter($oneOfFields = ["associationType"]),
14
+ set: $util.oneOfSetter($oneOfFields)
15
+ });
16
+ Object.defineProperty(MessageAssociation.prototype, "_parentMessageKey", {
17
+ get: $util.oneOfGetter($oneOfFields = ["parentMessageKey"]),
18
+ set: $util.oneOfSetter($oneOfFields)
19
+ });
20
+ Object.defineProperty(MessageAssociation.prototype, "_messageIndex", {
21
+ get: $util.oneOfGetter($oneOfFields = ["messageIndex"]),
22
+ set: $util.oneOfSetter($oneOfFields)
23
+ });
24
+ MessageAssociation.create = function create(properties) {
25
+ return new MessageAssociation(properties);
26
+ };
27
+ MessageAssociation.encode = function encode(m, w) {
28
+ if (!w)
29
+ w = $Writer.create();
30
+ if (m.associationType != null && Object.hasOwnProperty.call(m, "associationType"))
31
+ w.uint32(8).int32(m.associationType);
32
+ if (m.parentMessageKey != null && Object.hasOwnProperty.call(m, "parentMessageKey"))
33
+ $root.proto.MessageKey.encode(m.parentMessageKey, w.uint32(18).fork()).ldelim();
34
+ if (m.messageIndex != null && Object.hasOwnProperty.call(m, "messageIndex"))
35
+ w.uint32(24).int32(m.messageIndex);
36
+ return w;
37
+ };
38
+ MessageAssociation.decode = function decode(r, l, e, n) {
39
+ if (!(r instanceof $Reader))
40
+ r = $Reader.create(r);
41
+ if (n === undefined)
42
+ n = 0;
43
+ if (n > $Reader.recursionLimit)
44
+ throw Error("maximum nesting depth exceeded");
45
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.MessageAssociation();
46
+ while (r.pos < c) {
47
+ var t = r.uint32();
48
+ if (t === e)
49
+ break;
50
+ switch (t >>> 3) {
51
+ case 1: {
52
+ m.associationType = r.int32();
53
+ break;
54
+ }
55
+ case 2: {
56
+ m.parentMessageKey = $root.proto.MessageKey.decode(r, r.uint32(), undefined, n + 1);
57
+ break;
58
+ }
59
+ case 3: {
60
+ m.messageIndex = r.int32();
61
+ break;
62
+ }
63
+ default:
64
+ r.skipType(t & 7, n);
65
+ break;
66
+ }
67
+ }
68
+ return m;
69
+ };
70
+ MessageAssociation.fromObject = function fromObject(d, n) {
71
+ if (d instanceof $root.proto.MessageAssociation)
72
+ return d;
73
+ if (n === undefined)
74
+ n = 0;
75
+ if (n > $util.recursionLimit)
76
+ throw Error("maximum nesting depth exceeded");
77
+ var m = new $root.proto.MessageAssociation();
78
+ switch (d.associationType) {
79
+ default:
80
+ if (typeof d.associationType === "number") {
81
+ m.associationType = d.associationType;
82
+ break;
83
+ }
84
+ break;
85
+ case "UNKNOWN":
86
+ case 0:
87
+ m.associationType = 0;
88
+ break;
89
+ case "MEDIA_ALBUM":
90
+ case 1:
91
+ m.associationType = 1;
92
+ break;
93
+ case "BOT_PLUGIN":
94
+ case 2:
95
+ m.associationType = 2;
96
+ break;
97
+ case "EVENT_COVER_IMAGE":
98
+ case 3:
99
+ m.associationType = 3;
100
+ break;
101
+ case "STATUS_POLL":
102
+ case 4:
103
+ m.associationType = 4;
104
+ break;
105
+ case "HD_VIDEO_DUAL_UPLOAD":
106
+ case 5:
107
+ m.associationType = 5;
108
+ break;
109
+ case "STATUS_EXTERNAL_RESHARE":
110
+ case 6:
111
+ m.associationType = 6;
112
+ break;
113
+ case "MEDIA_POLL":
114
+ case 7:
115
+ m.associationType = 7;
116
+ break;
117
+ case "STATUS_ADD_YOURS":
118
+ case 8:
119
+ m.associationType = 8;
120
+ break;
121
+ case "STATUS_NOTIFICATION":
122
+ case 9:
123
+ m.associationType = 9;
124
+ break;
125
+ case "HD_IMAGE_DUAL_UPLOAD":
126
+ case 10:
127
+ m.associationType = 10;
128
+ break;
129
+ case "STICKER_ANNOTATION":
130
+ case 11:
131
+ m.associationType = 11;
132
+ break;
133
+ case "MOTION_PHOTO":
134
+ case 12:
135
+ m.associationType = 12;
136
+ break;
137
+ case "STATUS_LINK_ACTION":
138
+ case 13:
139
+ m.associationType = 13;
140
+ break;
141
+ case "VIEW_ALL_REPLIES":
142
+ case 14:
143
+ m.associationType = 14;
144
+ break;
145
+ case "STATUS_ADD_YOURS_AI_IMAGINE":
146
+ case 15:
147
+ m.associationType = 15;
148
+ break;
149
+ case "STATUS_QUESTION":
150
+ case 16:
151
+ m.associationType = 16;
152
+ break;
153
+ case "STATUS_ADD_YOURS_DIWALI":
154
+ case 17:
155
+ m.associationType = 17;
156
+ break;
157
+ case "STATUS_REACTION":
158
+ case 18:
159
+ m.associationType = 18;
160
+ break;
161
+ case "HEVC_VIDEO_DUAL_UPLOAD":
162
+ case 19:
163
+ m.associationType = 19;
164
+ break;
165
+ case "POLL_ADD_OPTION":
166
+ case 20:
167
+ m.associationType = 20;
168
+ break;
169
+ }
170
+ if (d.parentMessageKey != null) {
171
+ if (typeof d.parentMessageKey !== "object")
172
+ throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");
173
+ m.parentMessageKey = $root.proto.MessageKey.fromObject(d.parentMessageKey, n + 1);
174
+ }
175
+ if (d.messageIndex != null) {
176
+ m.messageIndex = d.messageIndex | 0;
177
+ }
178
+ return m;
179
+ };
180
+ MessageAssociation.toObject = function toObject(m, o) {
181
+ if (!o)
182
+ o = {};
183
+ var d = {};
184
+ if (m.associationType != null && m.hasOwnProperty("associationType")) {
185
+ d.associationType = o.enums === String ? $root.proto.MessageAssociation.AssociationType[m.associationType] === undefined ? m.associationType : $root.proto.MessageAssociation.AssociationType[m.associationType] : m.associationType;
186
+ if (o.oneofs)
187
+ d._associationType = "associationType";
188
+ }
189
+ if (m.parentMessageKey != null && m.hasOwnProperty("parentMessageKey")) {
190
+ d.parentMessageKey = $root.proto.MessageKey.toObject(m.parentMessageKey, o);
191
+ if (o.oneofs)
192
+ d._parentMessageKey = "parentMessageKey";
193
+ }
194
+ if (m.messageIndex != null && m.hasOwnProperty("messageIndex")) {
195
+ d.messageIndex = m.messageIndex;
196
+ if (o.oneofs)
197
+ d._messageIndex = "messageIndex";
198
+ }
199
+ return d;
200
+ };
201
+ MessageAssociation.prototype.toJSON = function toJSON() {
202
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
203
+ };
204
+ MessageAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
205
+ if (typeUrlPrefix === undefined) {
206
+ typeUrlPrefix = "type.googleapis.com";
207
+ }
208
+ return typeUrlPrefix + "/proto.MessageAssociation";
209
+ };
210
+ $lazy(MessageAssociation, "AssociationType", function() {
211
+ const valuesById = {}, values = Object.create(valuesById);
212
+ values[valuesById[0] = "UNKNOWN"] = 0;
213
+ values[valuesById[1] = "MEDIA_ALBUM"] = 1;
214
+ values[valuesById[2] = "BOT_PLUGIN"] = 2;
215
+ values[valuesById[3] = "EVENT_COVER_IMAGE"] = 3;
216
+ values[valuesById[4] = "STATUS_POLL"] = 4;
217
+ values[valuesById[5] = "HD_VIDEO_DUAL_UPLOAD"] = 5;
218
+ values[valuesById[6] = "STATUS_EXTERNAL_RESHARE"] = 6;
219
+ values[valuesById[7] = "MEDIA_POLL"] = 7;
220
+ values[valuesById[8] = "STATUS_ADD_YOURS"] = 8;
221
+ values[valuesById[9] = "STATUS_NOTIFICATION"] = 9;
222
+ values[valuesById[10] = "HD_IMAGE_DUAL_UPLOAD"] = 10;
223
+ values[valuesById[11] = "STICKER_ANNOTATION"] = 11;
224
+ values[valuesById[12] = "MOTION_PHOTO"] = 12;
225
+ values[valuesById[13] = "STATUS_LINK_ACTION"] = 13;
226
+ values[valuesById[14] = "VIEW_ALL_REPLIES"] = 14;
227
+ values[valuesById[15] = "STATUS_ADD_YOURS_AI_IMAGINE"] = 15;
228
+ values[valuesById[16] = "STATUS_QUESTION"] = 16;
229
+ values[valuesById[17] = "STATUS_ADD_YOURS_DIWALI"] = 17;
230
+ values[valuesById[18] = "STATUS_REACTION"] = 18;
231
+ values[valuesById[19] = "HEVC_VIDEO_DUAL_UPLOAD"] = 19;
232
+ values[valuesById[20] = "POLL_ADD_OPTION"] = 20;
233
+ return values;
234
+ });
235
+ return MessageAssociation;