@hiroosy/baileys-lite 0.3.4 → 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 (225) hide show
  1. package/WAProto/index.js +231 -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
@@ -0,0 +1,646 @@
1
+ "use strict";
2
+ function CallLogRecord(p) {
3
+ this.participants = [];
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
+ CallLogRecord.prototype.callResult = null;
10
+ CallLogRecord.prototype.isDndMode = null;
11
+ CallLogRecord.prototype.silenceReason = null;
12
+ CallLogRecord.prototype.duration = null;
13
+ CallLogRecord.prototype.startTime = null;
14
+ CallLogRecord.prototype.isIncoming = null;
15
+ CallLogRecord.prototype.isVideo = null;
16
+ CallLogRecord.prototype.isCallLink = null;
17
+ CallLogRecord.prototype.callLinkToken = null;
18
+ CallLogRecord.prototype.scheduledCallId = null;
19
+ CallLogRecord.prototype.callId = null;
20
+ CallLogRecord.prototype.callCreatorJid = null;
21
+ CallLogRecord.prototype.groupJid = null;
22
+ CallLogRecord.prototype.participants = $util.emptyArray;
23
+ CallLogRecord.prototype.callType = null;
24
+ let $oneOfFields;
25
+ Object.defineProperty(CallLogRecord.prototype, "_callResult", {
26
+ get: $util.oneOfGetter($oneOfFields = ["callResult"]),
27
+ set: $util.oneOfSetter($oneOfFields)
28
+ });
29
+ Object.defineProperty(CallLogRecord.prototype, "_isDndMode", {
30
+ get: $util.oneOfGetter($oneOfFields = ["isDndMode"]),
31
+ set: $util.oneOfSetter($oneOfFields)
32
+ });
33
+ Object.defineProperty(CallLogRecord.prototype, "_silenceReason", {
34
+ get: $util.oneOfGetter($oneOfFields = ["silenceReason"]),
35
+ set: $util.oneOfSetter($oneOfFields)
36
+ });
37
+ Object.defineProperty(CallLogRecord.prototype, "_duration", {
38
+ get: $util.oneOfGetter($oneOfFields = ["duration"]),
39
+ set: $util.oneOfSetter($oneOfFields)
40
+ });
41
+ Object.defineProperty(CallLogRecord.prototype, "_startTime", {
42
+ get: $util.oneOfGetter($oneOfFields = ["startTime"]),
43
+ set: $util.oneOfSetter($oneOfFields)
44
+ });
45
+ Object.defineProperty(CallLogRecord.prototype, "_isIncoming", {
46
+ get: $util.oneOfGetter($oneOfFields = ["isIncoming"]),
47
+ set: $util.oneOfSetter($oneOfFields)
48
+ });
49
+ Object.defineProperty(CallLogRecord.prototype, "_isVideo", {
50
+ get: $util.oneOfGetter($oneOfFields = ["isVideo"]),
51
+ set: $util.oneOfSetter($oneOfFields)
52
+ });
53
+ Object.defineProperty(CallLogRecord.prototype, "_isCallLink", {
54
+ get: $util.oneOfGetter($oneOfFields = ["isCallLink"]),
55
+ set: $util.oneOfSetter($oneOfFields)
56
+ });
57
+ Object.defineProperty(CallLogRecord.prototype, "_callLinkToken", {
58
+ get: $util.oneOfGetter($oneOfFields = ["callLinkToken"]),
59
+ set: $util.oneOfSetter($oneOfFields)
60
+ });
61
+ Object.defineProperty(CallLogRecord.prototype, "_scheduledCallId", {
62
+ get: $util.oneOfGetter($oneOfFields = ["scheduledCallId"]),
63
+ set: $util.oneOfSetter($oneOfFields)
64
+ });
65
+ Object.defineProperty(CallLogRecord.prototype, "_callId", {
66
+ get: $util.oneOfGetter($oneOfFields = ["callId"]),
67
+ set: $util.oneOfSetter($oneOfFields)
68
+ });
69
+ Object.defineProperty(CallLogRecord.prototype, "_callCreatorJid", {
70
+ get: $util.oneOfGetter($oneOfFields = ["callCreatorJid"]),
71
+ set: $util.oneOfSetter($oneOfFields)
72
+ });
73
+ Object.defineProperty(CallLogRecord.prototype, "_groupJid", {
74
+ get: $util.oneOfGetter($oneOfFields = ["groupJid"]),
75
+ set: $util.oneOfSetter($oneOfFields)
76
+ });
77
+ Object.defineProperty(CallLogRecord.prototype, "_callType", {
78
+ get: $util.oneOfGetter($oneOfFields = ["callType"]),
79
+ set: $util.oneOfSetter($oneOfFields)
80
+ });
81
+ CallLogRecord.create = function create(properties) {
82
+ return new CallLogRecord(properties);
83
+ };
84
+ CallLogRecord.encode = function encode(m, w) {
85
+ if (!w)
86
+ w = $Writer.create();
87
+ if (m.callResult != null && Object.hasOwnProperty.call(m, "callResult"))
88
+ w.uint32(8).int32(m.callResult);
89
+ if (m.isDndMode != null && Object.hasOwnProperty.call(m, "isDndMode"))
90
+ w.uint32(16).bool(m.isDndMode);
91
+ if (m.silenceReason != null && Object.hasOwnProperty.call(m, "silenceReason"))
92
+ w.uint32(24).int32(m.silenceReason);
93
+ if (m.duration != null && Object.hasOwnProperty.call(m, "duration"))
94
+ w.uint32(32).int64(m.duration);
95
+ if (m.startTime != null && Object.hasOwnProperty.call(m, "startTime"))
96
+ w.uint32(40).int64(m.startTime);
97
+ if (m.isIncoming != null && Object.hasOwnProperty.call(m, "isIncoming"))
98
+ w.uint32(48).bool(m.isIncoming);
99
+ if (m.isVideo != null && Object.hasOwnProperty.call(m, "isVideo"))
100
+ w.uint32(56).bool(m.isVideo);
101
+ if (m.isCallLink != null && Object.hasOwnProperty.call(m, "isCallLink"))
102
+ w.uint32(64).bool(m.isCallLink);
103
+ if (m.callLinkToken != null && Object.hasOwnProperty.call(m, "callLinkToken"))
104
+ w.uint32(74).string(m.callLinkToken);
105
+ if (m.scheduledCallId != null && Object.hasOwnProperty.call(m, "scheduledCallId"))
106
+ w.uint32(82).string(m.scheduledCallId);
107
+ if (m.callId != null && Object.hasOwnProperty.call(m, "callId"))
108
+ w.uint32(90).string(m.callId);
109
+ if (m.callCreatorJid != null && Object.hasOwnProperty.call(m, "callCreatorJid"))
110
+ w.uint32(98).string(m.callCreatorJid);
111
+ if (m.groupJid != null && Object.hasOwnProperty.call(m, "groupJid"))
112
+ w.uint32(106).string(m.groupJid);
113
+ if (m.participants != null && m.participants.length) {
114
+ for (var i = 0; i < m.participants.length; ++i)
115
+ $root.proto.CallLogRecord.ParticipantInfo.encode(m.participants[i], w.uint32(114).fork()).ldelim();
116
+ }
117
+ if (m.callType != null && Object.hasOwnProperty.call(m, "callType"))
118
+ w.uint32(120).int32(m.callType);
119
+ return w;
120
+ };
121
+ CallLogRecord.decode = function decode(r, l, e, n) {
122
+ if (!(r instanceof $Reader))
123
+ r = $Reader.create(r);
124
+ if (n === undefined)
125
+ n = 0;
126
+ if (n > $Reader.recursionLimit)
127
+ throw Error("maximum nesting depth exceeded");
128
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CallLogRecord();
129
+ while (r.pos < c) {
130
+ var t = r.uint32();
131
+ if (t === e)
132
+ break;
133
+ switch (t >>> 3) {
134
+ case 1: {
135
+ m.callResult = r.int32();
136
+ break;
137
+ }
138
+ case 2: {
139
+ m.isDndMode = r.bool();
140
+ break;
141
+ }
142
+ case 3: {
143
+ m.silenceReason = r.int32();
144
+ break;
145
+ }
146
+ case 4: {
147
+ m.duration = r.int64();
148
+ break;
149
+ }
150
+ case 5: {
151
+ m.startTime = r.int64();
152
+ break;
153
+ }
154
+ case 6: {
155
+ m.isIncoming = r.bool();
156
+ break;
157
+ }
158
+ case 7: {
159
+ m.isVideo = r.bool();
160
+ break;
161
+ }
162
+ case 8: {
163
+ m.isCallLink = r.bool();
164
+ break;
165
+ }
166
+ case 9: {
167
+ m.callLinkToken = r.string();
168
+ break;
169
+ }
170
+ case 10: {
171
+ m.scheduledCallId = r.string();
172
+ break;
173
+ }
174
+ case 11: {
175
+ m.callId = r.string();
176
+ break;
177
+ }
178
+ case 12: {
179
+ m.callCreatorJid = r.string();
180
+ break;
181
+ }
182
+ case 13: {
183
+ m.groupJid = r.string();
184
+ break;
185
+ }
186
+ case 14: {
187
+ if (!(m.participants && m.participants.length))
188
+ m.participants = [];
189
+ m.participants.push($root.proto.CallLogRecord.ParticipantInfo.decode(r, r.uint32(), undefined, n + 1));
190
+ break;
191
+ }
192
+ case 15: {
193
+ m.callType = r.int32();
194
+ break;
195
+ }
196
+ default:
197
+ r.skipType(t & 7, n);
198
+ break;
199
+ }
200
+ }
201
+ return m;
202
+ };
203
+ CallLogRecord.fromObject = function fromObject(d, n) {
204
+ if (d instanceof $root.proto.CallLogRecord)
205
+ return d;
206
+ if (n === undefined)
207
+ n = 0;
208
+ if (n > $util.recursionLimit)
209
+ throw Error("maximum nesting depth exceeded");
210
+ var m = new $root.proto.CallLogRecord();
211
+ switch (d.callResult) {
212
+ default:
213
+ if (typeof d.callResult === "number") {
214
+ m.callResult = d.callResult;
215
+ break;
216
+ }
217
+ break;
218
+ case "CONNECTED":
219
+ case 0:
220
+ m.callResult = 0;
221
+ break;
222
+ case "REJECTED":
223
+ case 1:
224
+ m.callResult = 1;
225
+ break;
226
+ case "CANCELLED":
227
+ case 2:
228
+ m.callResult = 2;
229
+ break;
230
+ case "ACCEPTEDELSEWHERE":
231
+ case 3:
232
+ m.callResult = 3;
233
+ break;
234
+ case "MISSED":
235
+ case 4:
236
+ m.callResult = 4;
237
+ break;
238
+ case "INVALID":
239
+ case 5:
240
+ m.callResult = 5;
241
+ break;
242
+ case "UNAVAILABLE":
243
+ case 6:
244
+ m.callResult = 6;
245
+ break;
246
+ case "UPCOMING":
247
+ case 7:
248
+ m.callResult = 7;
249
+ break;
250
+ case "FAILED":
251
+ case 8:
252
+ m.callResult = 8;
253
+ break;
254
+ case "ABANDONED":
255
+ case 9:
256
+ m.callResult = 9;
257
+ break;
258
+ case "ONGOING":
259
+ case 10:
260
+ m.callResult = 10;
261
+ break;
262
+ }
263
+ if (d.isDndMode != null) {
264
+ m.isDndMode = Boolean(d.isDndMode);
265
+ }
266
+ switch (d.silenceReason) {
267
+ default:
268
+ if (typeof d.silenceReason === "number") {
269
+ m.silenceReason = d.silenceReason;
270
+ break;
271
+ }
272
+ break;
273
+ case "NONE":
274
+ case 0:
275
+ m.silenceReason = 0;
276
+ break;
277
+ case "SCHEDULED":
278
+ case 1:
279
+ m.silenceReason = 1;
280
+ break;
281
+ case "PRIVACY":
282
+ case 2:
283
+ m.silenceReason = 2;
284
+ break;
285
+ case "LIGHTWEIGHT":
286
+ case 3:
287
+ m.silenceReason = 3;
288
+ break;
289
+ }
290
+ if (d.duration != null) {
291
+ if ($util.Long)
292
+ (m.duration = $util.Long.fromValue(d.duration)).unsigned = false;
293
+ else if (typeof d.duration === "string")
294
+ m.duration = parseInt(d.duration, 10);
295
+ else if (typeof d.duration === "number")
296
+ m.duration = d.duration;
297
+ else if (typeof d.duration === "object")
298
+ m.duration = new $util.LongBits(d.duration.low >>> 0, d.duration.high >>> 0).toNumber();
299
+ }
300
+ if (d.startTime != null) {
301
+ if ($util.Long)
302
+ (m.startTime = $util.Long.fromValue(d.startTime)).unsigned = false;
303
+ else if (typeof d.startTime === "string")
304
+ m.startTime = parseInt(d.startTime, 10);
305
+ else if (typeof d.startTime === "number")
306
+ m.startTime = d.startTime;
307
+ else if (typeof d.startTime === "object")
308
+ m.startTime = new $util.LongBits(d.startTime.low >>> 0, d.startTime.high >>> 0).toNumber();
309
+ }
310
+ if (d.isIncoming != null) {
311
+ m.isIncoming = Boolean(d.isIncoming);
312
+ }
313
+ if (d.isVideo != null) {
314
+ m.isVideo = Boolean(d.isVideo);
315
+ }
316
+ if (d.isCallLink != null) {
317
+ m.isCallLink = Boolean(d.isCallLink);
318
+ }
319
+ if (d.callLinkToken != null) {
320
+ m.callLinkToken = String(d.callLinkToken);
321
+ }
322
+ if (d.scheduledCallId != null) {
323
+ m.scheduledCallId = String(d.scheduledCallId);
324
+ }
325
+ if (d.callId != null) {
326
+ m.callId = String(d.callId);
327
+ }
328
+ if (d.callCreatorJid != null) {
329
+ m.callCreatorJid = String(d.callCreatorJid);
330
+ }
331
+ if (d.groupJid != null) {
332
+ m.groupJid = String(d.groupJid);
333
+ }
334
+ if (d.participants) {
335
+ if (!Array.isArray(d.participants))
336
+ throw TypeError(".proto.CallLogRecord.participants: array expected");
337
+ m.participants = [];
338
+ for (var i = 0; i < d.participants.length; ++i) {
339
+ if (typeof d.participants[i] !== "object")
340
+ throw TypeError(".proto.CallLogRecord.participants: object expected");
341
+ m.participants[i] = $root.proto.CallLogRecord.ParticipantInfo.fromObject(d.participants[i], n + 1);
342
+ }
343
+ }
344
+ switch (d.callType) {
345
+ default:
346
+ if (typeof d.callType === "number") {
347
+ m.callType = d.callType;
348
+ break;
349
+ }
350
+ break;
351
+ case "REGULAR":
352
+ case 0:
353
+ m.callType = 0;
354
+ break;
355
+ case "SCHEDULED_CALL":
356
+ case 1:
357
+ m.callType = 1;
358
+ break;
359
+ case "VOICE_CHAT":
360
+ case 2:
361
+ m.callType = 2;
362
+ break;
363
+ }
364
+ return m;
365
+ };
366
+ CallLogRecord.toObject = function toObject(m, o) {
367
+ if (!o)
368
+ o = {};
369
+ var d = {};
370
+ if (o.arrays || o.defaults) {
371
+ d.participants = [];
372
+ }
373
+ if (m.callResult != null && m.hasOwnProperty("callResult")) {
374
+ d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult;
375
+ if (o.oneofs)
376
+ d._callResult = "callResult";
377
+ }
378
+ if (m.isDndMode != null && m.hasOwnProperty("isDndMode")) {
379
+ d.isDndMode = m.isDndMode;
380
+ if (o.oneofs)
381
+ d._isDndMode = "isDndMode";
382
+ }
383
+ if (m.silenceReason != null && m.hasOwnProperty("silenceReason")) {
384
+ d.silenceReason = o.enums === String ? $root.proto.CallLogRecord.SilenceReason[m.silenceReason] === undefined ? m.silenceReason : $root.proto.CallLogRecord.SilenceReason[m.silenceReason] : m.silenceReason;
385
+ if (o.oneofs)
386
+ d._silenceReason = "silenceReason";
387
+ }
388
+ if (m.duration != null && m.hasOwnProperty("duration")) {
389
+ if (typeof m.duration === "number")
390
+ d.duration = o.longs === String ? String(m.duration) : m.duration;
391
+ else
392
+ d.duration = o.longs === String ? longToString(m.duration) : o.longs === Number ? longToNumber(m.duration) : m.duration;
393
+ if (o.oneofs)
394
+ d._duration = "duration";
395
+ }
396
+ if (m.startTime != null && m.hasOwnProperty("startTime")) {
397
+ if (typeof m.startTime === "number")
398
+ d.startTime = o.longs === String ? String(m.startTime) : m.startTime;
399
+ else
400
+ d.startTime = o.longs === String ? longToString(m.startTime) : o.longs === Number ? longToNumber(m.startTime) : m.startTime;
401
+ if (o.oneofs)
402
+ d._startTime = "startTime";
403
+ }
404
+ if (m.isIncoming != null && m.hasOwnProperty("isIncoming")) {
405
+ d.isIncoming = m.isIncoming;
406
+ if (o.oneofs)
407
+ d._isIncoming = "isIncoming";
408
+ }
409
+ if (m.isVideo != null && m.hasOwnProperty("isVideo")) {
410
+ d.isVideo = m.isVideo;
411
+ if (o.oneofs)
412
+ d._isVideo = "isVideo";
413
+ }
414
+ if (m.isCallLink != null && m.hasOwnProperty("isCallLink")) {
415
+ d.isCallLink = m.isCallLink;
416
+ if (o.oneofs)
417
+ d._isCallLink = "isCallLink";
418
+ }
419
+ if (m.callLinkToken != null && m.hasOwnProperty("callLinkToken")) {
420
+ d.callLinkToken = m.callLinkToken;
421
+ if (o.oneofs)
422
+ d._callLinkToken = "callLinkToken";
423
+ }
424
+ if (m.scheduledCallId != null && m.hasOwnProperty("scheduledCallId")) {
425
+ d.scheduledCallId = m.scheduledCallId;
426
+ if (o.oneofs)
427
+ d._scheduledCallId = "scheduledCallId";
428
+ }
429
+ if (m.callId != null && m.hasOwnProperty("callId")) {
430
+ d.callId = m.callId;
431
+ if (o.oneofs)
432
+ d._callId = "callId";
433
+ }
434
+ if (m.callCreatorJid != null && m.hasOwnProperty("callCreatorJid")) {
435
+ d.callCreatorJid = m.callCreatorJid;
436
+ if (o.oneofs)
437
+ d._callCreatorJid = "callCreatorJid";
438
+ }
439
+ if (m.groupJid != null && m.hasOwnProperty("groupJid")) {
440
+ d.groupJid = m.groupJid;
441
+ if (o.oneofs)
442
+ d._groupJid = "groupJid";
443
+ }
444
+ if (m.participants && m.participants.length) {
445
+ d.participants = [];
446
+ for (var j = 0; j < m.participants.length; ++j) {
447
+ d.participants[j] = $root.proto.CallLogRecord.ParticipantInfo.toObject(m.participants[j], o);
448
+ }
449
+ }
450
+ if (m.callType != null && m.hasOwnProperty("callType")) {
451
+ d.callType = o.enums === String ? $root.proto.CallLogRecord.CallType[m.callType] === undefined ? m.callType : $root.proto.CallLogRecord.CallType[m.callType] : m.callType;
452
+ if (o.oneofs)
453
+ d._callType = "callType";
454
+ }
455
+ return d;
456
+ };
457
+ CallLogRecord.prototype.toJSON = function toJSON() {
458
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
459
+ };
460
+ CallLogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
461
+ if (typeUrlPrefix === undefined) {
462
+ typeUrlPrefix = "type.googleapis.com";
463
+ }
464
+ return typeUrlPrefix + "/proto.CallLogRecord";
465
+ };
466
+ $lazy(CallLogRecord, "CallResult", function() {
467
+ const valuesById = {}, values = Object.create(valuesById);
468
+ values[valuesById[0] = "CONNECTED"] = 0;
469
+ values[valuesById[1] = "REJECTED"] = 1;
470
+ values[valuesById[2] = "CANCELLED"] = 2;
471
+ values[valuesById[3] = "ACCEPTEDELSEWHERE"] = 3;
472
+ values[valuesById[4] = "MISSED"] = 4;
473
+ values[valuesById[5] = "INVALID"] = 5;
474
+ values[valuesById[6] = "UNAVAILABLE"] = 6;
475
+ values[valuesById[7] = "UPCOMING"] = 7;
476
+ values[valuesById[8] = "FAILED"] = 8;
477
+ values[valuesById[9] = "ABANDONED"] = 9;
478
+ values[valuesById[10] = "ONGOING"] = 10;
479
+ return values;
480
+ });
481
+ $lazy(CallLogRecord, "CallType", function() {
482
+ const valuesById = {}, values = Object.create(valuesById);
483
+ values[valuesById[0] = "REGULAR"] = 0;
484
+ values[valuesById[1] = "SCHEDULED_CALL"] = 1;
485
+ values[valuesById[2] = "VOICE_CHAT"] = 2;
486
+ return values;
487
+ });
488
+ $lazy(CallLogRecord, "ParticipantInfo", function() {
489
+ function ParticipantInfo(p) {
490
+ if (p)
491
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
492
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
493
+ this[ks[i]] = p[ks[i]];
494
+ }
495
+ ParticipantInfo.prototype.userJid = null;
496
+ ParticipantInfo.prototype.callResult = null;
497
+ let $oneOfFields;
498
+ Object.defineProperty(ParticipantInfo.prototype, "_userJid", {
499
+ get: $util.oneOfGetter($oneOfFields = ["userJid"]),
500
+ set: $util.oneOfSetter($oneOfFields)
501
+ });
502
+ Object.defineProperty(ParticipantInfo.prototype, "_callResult", {
503
+ get: $util.oneOfGetter($oneOfFields = ["callResult"]),
504
+ set: $util.oneOfSetter($oneOfFields)
505
+ });
506
+ ParticipantInfo.create = function create(properties) {
507
+ return new ParticipantInfo(properties);
508
+ };
509
+ ParticipantInfo.encode = function encode(m, w) {
510
+ if (!w)
511
+ w = $Writer.create();
512
+ if (m.userJid != null && Object.hasOwnProperty.call(m, "userJid"))
513
+ w.uint32(10).string(m.userJid);
514
+ if (m.callResult != null && Object.hasOwnProperty.call(m, "callResult"))
515
+ w.uint32(16).int32(m.callResult);
516
+ return w;
517
+ };
518
+ ParticipantInfo.decode = function decode(r, l, e, n) {
519
+ if (!(r instanceof $Reader))
520
+ r = $Reader.create(r);
521
+ if (n === undefined)
522
+ n = 0;
523
+ if (n > $Reader.recursionLimit)
524
+ throw Error("maximum nesting depth exceeded");
525
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CallLogRecord.ParticipantInfo();
526
+ while (r.pos < c) {
527
+ var t = r.uint32();
528
+ if (t === e)
529
+ break;
530
+ switch (t >>> 3) {
531
+ case 1: {
532
+ m.userJid = r.string();
533
+ break;
534
+ }
535
+ case 2: {
536
+ m.callResult = r.int32();
537
+ break;
538
+ }
539
+ default:
540
+ r.skipType(t & 7, n);
541
+ break;
542
+ }
543
+ }
544
+ return m;
545
+ };
546
+ ParticipantInfo.fromObject = function fromObject(d, n) {
547
+ if (d instanceof $root.proto.CallLogRecord.ParticipantInfo)
548
+ return d;
549
+ if (n === undefined)
550
+ n = 0;
551
+ if (n > $util.recursionLimit)
552
+ throw Error("maximum nesting depth exceeded");
553
+ var m = new $root.proto.CallLogRecord.ParticipantInfo();
554
+ if (d.userJid != null) {
555
+ m.userJid = String(d.userJid);
556
+ }
557
+ switch (d.callResult) {
558
+ default:
559
+ if (typeof d.callResult === "number") {
560
+ m.callResult = d.callResult;
561
+ break;
562
+ }
563
+ break;
564
+ case "CONNECTED":
565
+ case 0:
566
+ m.callResult = 0;
567
+ break;
568
+ case "REJECTED":
569
+ case 1:
570
+ m.callResult = 1;
571
+ break;
572
+ case "CANCELLED":
573
+ case 2:
574
+ m.callResult = 2;
575
+ break;
576
+ case "ACCEPTEDELSEWHERE":
577
+ case 3:
578
+ m.callResult = 3;
579
+ break;
580
+ case "MISSED":
581
+ case 4:
582
+ m.callResult = 4;
583
+ break;
584
+ case "INVALID":
585
+ case 5:
586
+ m.callResult = 5;
587
+ break;
588
+ case "UNAVAILABLE":
589
+ case 6:
590
+ m.callResult = 6;
591
+ break;
592
+ case "UPCOMING":
593
+ case 7:
594
+ m.callResult = 7;
595
+ break;
596
+ case "FAILED":
597
+ case 8:
598
+ m.callResult = 8;
599
+ break;
600
+ case "ABANDONED":
601
+ case 9:
602
+ m.callResult = 9;
603
+ break;
604
+ case "ONGOING":
605
+ case 10:
606
+ m.callResult = 10;
607
+ break;
608
+ }
609
+ return m;
610
+ };
611
+ ParticipantInfo.toObject = function toObject(m, o) {
612
+ if (!o)
613
+ o = {};
614
+ var d = {};
615
+ if (m.userJid != null && m.hasOwnProperty("userJid")) {
616
+ d.userJid = m.userJid;
617
+ if (o.oneofs)
618
+ d._userJid = "userJid";
619
+ }
620
+ if (m.callResult != null && m.hasOwnProperty("callResult")) {
621
+ d.callResult = o.enums === String ? $root.proto.CallLogRecord.CallResult[m.callResult] === undefined ? m.callResult : $root.proto.CallLogRecord.CallResult[m.callResult] : m.callResult;
622
+ if (o.oneofs)
623
+ d._callResult = "callResult";
624
+ }
625
+ return d;
626
+ };
627
+ ParticipantInfo.prototype.toJSON = function toJSON() {
628
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
629
+ };
630
+ ParticipantInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
631
+ if (typeUrlPrefix === undefined) {
632
+ typeUrlPrefix = "type.googleapis.com";
633
+ }
634
+ return typeUrlPrefix + "/proto.CallLogRecord.ParticipantInfo";
635
+ };
636
+ return ParticipantInfo;
637
+ });
638
+ $lazy(CallLogRecord, "SilenceReason", function() {
639
+ const valuesById = {}, values = Object.create(valuesById);
640
+ values[valuesById[0] = "NONE"] = 0;
641
+ values[valuesById[1] = "SCHEDULED"] = 1;
642
+ values[valuesById[2] = "PRIVACY"] = 2;
643
+ values[valuesById[3] = "LIGHTWEIGHT"] = 3;
644
+ return values;
645
+ });
646
+ return CallLogRecord;