@hiroosy/baileys-lite 0.3.4 → 0.3.6

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 (229) 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
  226. package/src/socket/messages-recv.js +3 -1
  227. package/src/socket/messages-send.js +25 -10
  228. package/src/socket/socket-core.js +53 -57
  229. package/src/utils/wa-protocol-core.js +3 -9
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ function EventResponse(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
+ EventResponse.prototype.eventResponseMessageKey = null;
9
+ EventResponse.prototype.timestampMs = null;
10
+ EventResponse.prototype.eventResponseMessage = null;
11
+ EventResponse.prototype.unread = null;
12
+ let $oneOfFields;
13
+ Object.defineProperty(EventResponse.prototype, "_eventResponseMessageKey", {
14
+ get: $util.oneOfGetter($oneOfFields = ["eventResponseMessageKey"]),
15
+ set: $util.oneOfSetter($oneOfFields)
16
+ });
17
+ Object.defineProperty(EventResponse.prototype, "_timestampMs", {
18
+ get: $util.oneOfGetter($oneOfFields = ["timestampMs"]),
19
+ set: $util.oneOfSetter($oneOfFields)
20
+ });
21
+ Object.defineProperty(EventResponse.prototype, "_eventResponseMessage", {
22
+ get: $util.oneOfGetter($oneOfFields = ["eventResponseMessage"]),
23
+ set: $util.oneOfSetter($oneOfFields)
24
+ });
25
+ Object.defineProperty(EventResponse.prototype, "_unread", {
26
+ get: $util.oneOfGetter($oneOfFields = ["unread"]),
27
+ set: $util.oneOfSetter($oneOfFields)
28
+ });
29
+ EventResponse.create = function create(properties) {
30
+ return new EventResponse(properties);
31
+ };
32
+ EventResponse.encode = function encode(m, w) {
33
+ if (!w)
34
+ w = $Writer.create();
35
+ if (m.eventResponseMessageKey != null && Object.hasOwnProperty.call(m, "eventResponseMessageKey"))
36
+ $root.proto.MessageKey.encode(m.eventResponseMessageKey, w.uint32(10).fork()).ldelim();
37
+ if (m.timestampMs != null && Object.hasOwnProperty.call(m, "timestampMs"))
38
+ w.uint32(16).int64(m.timestampMs);
39
+ if (m.eventResponseMessage != null && Object.hasOwnProperty.call(m, "eventResponseMessage"))
40
+ $root.proto.Message.EventResponseMessage.encode(m.eventResponseMessage, w.uint32(26).fork()).ldelim();
41
+ if (m.unread != null && Object.hasOwnProperty.call(m, "unread"))
42
+ w.uint32(32).bool(m.unread);
43
+ return w;
44
+ };
45
+ EventResponse.decode = function decode(r, l, e, n) {
46
+ if (!(r instanceof $Reader))
47
+ r = $Reader.create(r);
48
+ if (n === undefined)
49
+ n = 0;
50
+ if (n > $Reader.recursionLimit)
51
+ throw Error("maximum nesting depth exceeded");
52
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EventResponse();
53
+ while (r.pos < c) {
54
+ var t = r.uint32();
55
+ if (t === e)
56
+ break;
57
+ switch (t >>> 3) {
58
+ case 1: {
59
+ m.eventResponseMessageKey = $root.proto.MessageKey.decode(r, r.uint32(), undefined, n + 1);
60
+ break;
61
+ }
62
+ case 2: {
63
+ m.timestampMs = r.int64();
64
+ break;
65
+ }
66
+ case 3: {
67
+ m.eventResponseMessage = $root.proto.Message.EventResponseMessage.decode(r, r.uint32(), undefined, n + 1);
68
+ break;
69
+ }
70
+ case 4: {
71
+ m.unread = r.bool();
72
+ break;
73
+ }
74
+ default:
75
+ r.skipType(t & 7, n);
76
+ break;
77
+ }
78
+ }
79
+ return m;
80
+ };
81
+ EventResponse.fromObject = function fromObject(d, n) {
82
+ if (d instanceof $root.proto.EventResponse)
83
+ return d;
84
+ if (n === undefined)
85
+ n = 0;
86
+ if (n > $util.recursionLimit)
87
+ throw Error("maximum nesting depth exceeded");
88
+ var m = new $root.proto.EventResponse();
89
+ if (d.eventResponseMessageKey != null) {
90
+ if (typeof d.eventResponseMessageKey !== "object")
91
+ throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");
92
+ m.eventResponseMessageKey = $root.proto.MessageKey.fromObject(d.eventResponseMessageKey, n + 1);
93
+ }
94
+ if (d.timestampMs != null) {
95
+ if ($util.Long)
96
+ (m.timestampMs = $util.Long.fromValue(d.timestampMs)).unsigned = false;
97
+ else if (typeof d.timestampMs === "string")
98
+ m.timestampMs = parseInt(d.timestampMs, 10);
99
+ else if (typeof d.timestampMs === "number")
100
+ m.timestampMs = d.timestampMs;
101
+ else if (typeof d.timestampMs === "object")
102
+ m.timestampMs = new $util.LongBits(d.timestampMs.low >>> 0, d.timestampMs.high >>> 0).toNumber();
103
+ }
104
+ if (d.eventResponseMessage != null) {
105
+ if (typeof d.eventResponseMessage !== "object")
106
+ throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");
107
+ m.eventResponseMessage = $root.proto.Message.EventResponseMessage.fromObject(d.eventResponseMessage, n + 1);
108
+ }
109
+ if (d.unread != null) {
110
+ m.unread = Boolean(d.unread);
111
+ }
112
+ return m;
113
+ };
114
+ EventResponse.toObject = function toObject(m, o) {
115
+ if (!o)
116
+ o = {};
117
+ var d = {};
118
+ if (m.eventResponseMessageKey != null && m.hasOwnProperty("eventResponseMessageKey")) {
119
+ d.eventResponseMessageKey = $root.proto.MessageKey.toObject(m.eventResponseMessageKey, o);
120
+ if (o.oneofs)
121
+ d._eventResponseMessageKey = "eventResponseMessageKey";
122
+ }
123
+ if (m.timestampMs != null && m.hasOwnProperty("timestampMs")) {
124
+ if (typeof m.timestampMs === "number")
125
+ d.timestampMs = o.longs === String ? String(m.timestampMs) : m.timestampMs;
126
+ else
127
+ d.timestampMs = o.longs === String ? longToString(m.timestampMs) : o.longs === Number ? longToNumber(m.timestampMs) : m.timestampMs;
128
+ if (o.oneofs)
129
+ d._timestampMs = "timestampMs";
130
+ }
131
+ if (m.eventResponseMessage != null && m.hasOwnProperty("eventResponseMessage")) {
132
+ d.eventResponseMessage = $root.proto.Message.EventResponseMessage.toObject(m.eventResponseMessage, o);
133
+ if (o.oneofs)
134
+ d._eventResponseMessage = "eventResponseMessage";
135
+ }
136
+ if (m.unread != null && m.hasOwnProperty("unread")) {
137
+ d.unread = m.unread;
138
+ if (o.oneofs)
139
+ d._unread = "unread";
140
+ }
141
+ return d;
142
+ };
143
+ EventResponse.prototype.toJSON = function toJSON() {
144
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
145
+ };
146
+ EventResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
147
+ if (typeUrlPrefix === undefined) {
148
+ typeUrlPrefix = "type.googleapis.com";
149
+ }
150
+ return typeUrlPrefix + "/proto.EventResponse";
151
+ };
152
+ return EventResponse;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ function ExitCode(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
+ ExitCode.prototype.code = null;
9
+ ExitCode.prototype.text = null;
10
+ let $oneOfFields;
11
+ Object.defineProperty(ExitCode.prototype, "_code", {
12
+ get: $util.oneOfGetter($oneOfFields = ["code"]),
13
+ set: $util.oneOfSetter($oneOfFields)
14
+ });
15
+ Object.defineProperty(ExitCode.prototype, "_text", {
16
+ get: $util.oneOfGetter($oneOfFields = ["text"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ ExitCode.create = function create(properties) {
20
+ return new ExitCode(properties);
21
+ };
22
+ ExitCode.encode = function encode(m, w) {
23
+ if (!w)
24
+ w = $Writer.create();
25
+ if (m.code != null && Object.hasOwnProperty.call(m, "code"))
26
+ w.uint32(8).uint64(m.code);
27
+ if (m.text != null && Object.hasOwnProperty.call(m, "text"))
28
+ w.uint32(18).string(m.text);
29
+ return w;
30
+ };
31
+ ExitCode.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.ExitCode();
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.code = r.uint64();
46
+ break;
47
+ }
48
+ case 2: {
49
+ m.text = r.string();
50
+ break;
51
+ }
52
+ default:
53
+ r.skipType(t & 7, n);
54
+ break;
55
+ }
56
+ }
57
+ return m;
58
+ };
59
+ ExitCode.fromObject = function fromObject(d, n) {
60
+ if (d instanceof $root.proto.ExitCode)
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.ExitCode();
67
+ if (d.code != null) {
68
+ if ($util.Long)
69
+ (m.code = $util.Long.fromValue(d.code)).unsigned = true;
70
+ else if (typeof d.code === "string")
71
+ m.code = parseInt(d.code, 10);
72
+ else if (typeof d.code === "number")
73
+ m.code = d.code;
74
+ else if (typeof d.code === "object")
75
+ m.code = new $util.LongBits(d.code.low >>> 0, d.code.high >>> 0).toNumber(true);
76
+ }
77
+ if (d.text != null) {
78
+ m.text = String(d.text);
79
+ }
80
+ return m;
81
+ };
82
+ ExitCode.toObject = function toObject(m, o) {
83
+ if (!o)
84
+ o = {};
85
+ var d = {};
86
+ if (m.code != null && m.hasOwnProperty("code")) {
87
+ if (typeof m.code === "number")
88
+ d.code = o.longs === String ? String(m.code) : m.code;
89
+ else
90
+ d.code = o.longs === String ? longToString(m.code, true) : o.longs === Number ? longToNumber(m.code, true) : m.code;
91
+ if (o.oneofs)
92
+ d._code = "code";
93
+ }
94
+ if (m.text != null && m.hasOwnProperty("text")) {
95
+ d.text = m.text;
96
+ if (o.oneofs)
97
+ d._text = "text";
98
+ }
99
+ return d;
100
+ };
101
+ ExitCode.prototype.toJSON = function toJSON() {
102
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
103
+ };
104
+ ExitCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
105
+ if (typeUrlPrefix === undefined) {
106
+ typeUrlPrefix = "type.googleapis.com";
107
+ }
108
+ return typeUrlPrefix + "/proto.ExitCode";
109
+ };
110
+ return ExitCode;
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ function ExternalBlobReference(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
+ ExternalBlobReference.prototype.mediaKey = null;
9
+ ExternalBlobReference.prototype.directPath = null;
10
+ ExternalBlobReference.prototype.handle = null;
11
+ ExternalBlobReference.prototype.fileSizeBytes = null;
12
+ ExternalBlobReference.prototype.fileSha256 = null;
13
+ ExternalBlobReference.prototype.fileEncSha256 = null;
14
+ let $oneOfFields;
15
+ Object.defineProperty(ExternalBlobReference.prototype, "_mediaKey", {
16
+ get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ Object.defineProperty(ExternalBlobReference.prototype, "_directPath", {
20
+ get: $util.oneOfGetter($oneOfFields = ["directPath"]),
21
+ set: $util.oneOfSetter($oneOfFields)
22
+ });
23
+ Object.defineProperty(ExternalBlobReference.prototype, "_handle", {
24
+ get: $util.oneOfGetter($oneOfFields = ["handle"]),
25
+ set: $util.oneOfSetter($oneOfFields)
26
+ });
27
+ Object.defineProperty(ExternalBlobReference.prototype, "_fileSizeBytes", {
28
+ get: $util.oneOfGetter($oneOfFields = ["fileSizeBytes"]),
29
+ set: $util.oneOfSetter($oneOfFields)
30
+ });
31
+ Object.defineProperty(ExternalBlobReference.prototype, "_fileSha256", {
32
+ get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
33
+ set: $util.oneOfSetter($oneOfFields)
34
+ });
35
+ Object.defineProperty(ExternalBlobReference.prototype, "_fileEncSha256", {
36
+ get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
37
+ set: $util.oneOfSetter($oneOfFields)
38
+ });
39
+ ExternalBlobReference.create = function create(properties) {
40
+ return new ExternalBlobReference(properties);
41
+ };
42
+ ExternalBlobReference.encode = function encode(m, w) {
43
+ if (!w)
44
+ w = $Writer.create();
45
+ if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
46
+ w.uint32(10).bytes(m.mediaKey);
47
+ if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
48
+ w.uint32(18).string(m.directPath);
49
+ if (m.handle != null && Object.hasOwnProperty.call(m, "handle"))
50
+ w.uint32(26).string(m.handle);
51
+ if (m.fileSizeBytes != null && Object.hasOwnProperty.call(m, "fileSizeBytes"))
52
+ w.uint32(32).uint64(m.fileSizeBytes);
53
+ if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
54
+ w.uint32(42).bytes(m.fileSha256);
55
+ if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
56
+ w.uint32(50).bytes(m.fileEncSha256);
57
+ return w;
58
+ };
59
+ ExternalBlobReference.decode = function decode(r, l, e, n) {
60
+ if (!(r instanceof $Reader))
61
+ r = $Reader.create(r);
62
+ if (n === undefined)
63
+ n = 0;
64
+ if (n > $Reader.recursionLimit)
65
+ throw Error("maximum nesting depth exceeded");
66
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ExternalBlobReference();
67
+ while (r.pos < c) {
68
+ var t = r.uint32();
69
+ if (t === e)
70
+ break;
71
+ switch (t >>> 3) {
72
+ case 1: {
73
+ m.mediaKey = r.bytes();
74
+ break;
75
+ }
76
+ case 2: {
77
+ m.directPath = r.string();
78
+ break;
79
+ }
80
+ case 3: {
81
+ m.handle = r.string();
82
+ break;
83
+ }
84
+ case 4: {
85
+ m.fileSizeBytes = r.uint64();
86
+ break;
87
+ }
88
+ case 5: {
89
+ m.fileSha256 = r.bytes();
90
+ break;
91
+ }
92
+ case 6: {
93
+ m.fileEncSha256 = r.bytes();
94
+ break;
95
+ }
96
+ default:
97
+ r.skipType(t & 7, n);
98
+ break;
99
+ }
100
+ }
101
+ return m;
102
+ };
103
+ ExternalBlobReference.fromObject = function fromObject(d, n) {
104
+ if (d instanceof $root.proto.ExternalBlobReference)
105
+ return d;
106
+ if (n === undefined)
107
+ n = 0;
108
+ if (n > $util.recursionLimit)
109
+ throw Error("maximum nesting depth exceeded");
110
+ var m = new $root.proto.ExternalBlobReference();
111
+ if (d.mediaKey != null) {
112
+ if (typeof d.mediaKey === "string")
113
+ $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
114
+ else if (d.mediaKey.length >= 0)
115
+ m.mediaKey = d.mediaKey;
116
+ }
117
+ if (d.directPath != null) {
118
+ m.directPath = String(d.directPath);
119
+ }
120
+ if (d.handle != null) {
121
+ m.handle = String(d.handle);
122
+ }
123
+ if (d.fileSizeBytes != null) {
124
+ if ($util.Long)
125
+ (m.fileSizeBytes = $util.Long.fromValue(d.fileSizeBytes)).unsigned = true;
126
+ else if (typeof d.fileSizeBytes === "string")
127
+ m.fileSizeBytes = parseInt(d.fileSizeBytes, 10);
128
+ else if (typeof d.fileSizeBytes === "number")
129
+ m.fileSizeBytes = d.fileSizeBytes;
130
+ else if (typeof d.fileSizeBytes === "object")
131
+ m.fileSizeBytes = new $util.LongBits(d.fileSizeBytes.low >>> 0, d.fileSizeBytes.high >>> 0).toNumber(true);
132
+ }
133
+ if (d.fileSha256 != null) {
134
+ if (typeof d.fileSha256 === "string")
135
+ $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
136
+ else if (d.fileSha256.length >= 0)
137
+ m.fileSha256 = d.fileSha256;
138
+ }
139
+ if (d.fileEncSha256 != null) {
140
+ if (typeof d.fileEncSha256 === "string")
141
+ $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
142
+ else if (d.fileEncSha256.length >= 0)
143
+ m.fileEncSha256 = d.fileEncSha256;
144
+ }
145
+ return m;
146
+ };
147
+ ExternalBlobReference.toObject = function toObject(m, o) {
148
+ if (!o)
149
+ o = {};
150
+ var d = {};
151
+ if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
152
+ d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
153
+ if (o.oneofs)
154
+ d._mediaKey = "mediaKey";
155
+ }
156
+ if (m.directPath != null && m.hasOwnProperty("directPath")) {
157
+ d.directPath = m.directPath;
158
+ if (o.oneofs)
159
+ d._directPath = "directPath";
160
+ }
161
+ if (m.handle != null && m.hasOwnProperty("handle")) {
162
+ d.handle = m.handle;
163
+ if (o.oneofs)
164
+ d._handle = "handle";
165
+ }
166
+ if (m.fileSizeBytes != null && m.hasOwnProperty("fileSizeBytes")) {
167
+ if (typeof m.fileSizeBytes === "number")
168
+ d.fileSizeBytes = o.longs === String ? String(m.fileSizeBytes) : m.fileSizeBytes;
169
+ else
170
+ d.fileSizeBytes = o.longs === String ? longToString(m.fileSizeBytes, true) : o.longs === Number ? longToNumber(m.fileSizeBytes, true) : m.fileSizeBytes;
171
+ if (o.oneofs)
172
+ d._fileSizeBytes = "fileSizeBytes";
173
+ }
174
+ if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
175
+ d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
176
+ if (o.oneofs)
177
+ d._fileSha256 = "fileSha256";
178
+ }
179
+ if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
180
+ d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
181
+ if (o.oneofs)
182
+ d._fileEncSha256 = "fileEncSha256";
183
+ }
184
+ return d;
185
+ };
186
+ ExternalBlobReference.prototype.toJSON = function toJSON() {
187
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
188
+ };
189
+ ExternalBlobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
190
+ if (typeUrlPrefix === undefined) {
191
+ typeUrlPrefix = "type.googleapis.com";
192
+ }
193
+ return typeUrlPrefix + "/proto.ExternalBlobReference";
194
+ };
195
+ return ExternalBlobReference;
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ function Field(p) {
3
+ this.subfield = {};
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
+ Field.prototype.minVersion = null;
10
+ Field.prototype.maxVersion = null;
11
+ Field.prototype.notReportableMinVersion = null;
12
+ Field.prototype.isMessage = null;
13
+ Field.prototype.subfield = $util.emptyObject;
14
+ let $oneOfFields;
15
+ Object.defineProperty(Field.prototype, "_minVersion", {
16
+ get: $util.oneOfGetter($oneOfFields = ["minVersion"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ Object.defineProperty(Field.prototype, "_maxVersion", {
20
+ get: $util.oneOfGetter($oneOfFields = ["maxVersion"]),
21
+ set: $util.oneOfSetter($oneOfFields)
22
+ });
23
+ Object.defineProperty(Field.prototype, "_notReportableMinVersion", {
24
+ get: $util.oneOfGetter($oneOfFields = ["notReportableMinVersion"]),
25
+ set: $util.oneOfSetter($oneOfFields)
26
+ });
27
+ Object.defineProperty(Field.prototype, "_isMessage", {
28
+ get: $util.oneOfGetter($oneOfFields = ["isMessage"]),
29
+ set: $util.oneOfSetter($oneOfFields)
30
+ });
31
+ Field.create = function create(properties) {
32
+ return new Field(properties);
33
+ };
34
+ Field.encode = function encode(m, w) {
35
+ if (!w)
36
+ w = $Writer.create();
37
+ if (m.minVersion != null && Object.hasOwnProperty.call(m, "minVersion"))
38
+ w.uint32(8).uint32(m.minVersion);
39
+ if (m.maxVersion != null && Object.hasOwnProperty.call(m, "maxVersion"))
40
+ w.uint32(16).uint32(m.maxVersion);
41
+ if (m.notReportableMinVersion != null && Object.hasOwnProperty.call(m, "notReportableMinVersion"))
42
+ w.uint32(24).uint32(m.notReportableMinVersion);
43
+ if (m.isMessage != null && Object.hasOwnProperty.call(m, "isMessage"))
44
+ w.uint32(32).bool(m.isMessage);
45
+ if (m.subfield != null && Object.hasOwnProperty.call(m, "subfield")) {
46
+ for (var ks = Object.keys(m.subfield), i = 0; i < ks.length; ++i) {
47
+ w.uint32(42).fork().uint32(8).uint32(ks[i]);
48
+ $root.proto.Field.encode(m.subfield[ks[i]], w.uint32(18).fork()).ldelim().ldelim();
49
+ }
50
+ }
51
+ return w;
52
+ };
53
+ Field.decode = function decode(r, l, e, n) {
54
+ if (!(r instanceof $Reader))
55
+ r = $Reader.create(r);
56
+ if (n === undefined)
57
+ n = 0;
58
+ if (n > $Reader.recursionLimit)
59
+ throw Error("maximum nesting depth exceeded");
60
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Field(), k, value;
61
+ while (r.pos < c) {
62
+ var t = r.uint32();
63
+ if (t === e)
64
+ break;
65
+ switch (t >>> 3) {
66
+ case 1: {
67
+ m.minVersion = r.uint32();
68
+ break;
69
+ }
70
+ case 2: {
71
+ m.maxVersion = r.uint32();
72
+ break;
73
+ }
74
+ case 3: {
75
+ m.notReportableMinVersion = r.uint32();
76
+ break;
77
+ }
78
+ case 4: {
79
+ m.isMessage = r.bool();
80
+ break;
81
+ }
82
+ case 5: {
83
+ if (m.subfield === $util.emptyObject)
84
+ m.subfield = {};
85
+ var c2 = r.uint32() + r.pos;
86
+ k = 0;
87
+ value = null;
88
+ while (r.pos < c2) {
89
+ var tag2 = r.uint32();
90
+ switch (tag2 >>> 3) {
91
+ case 1:
92
+ k = r.uint32();
93
+ break;
94
+ case 2:
95
+ value = $root.proto.Field.decode(r, r.uint32(), undefined, n + 1);
96
+ break;
97
+ default:
98
+ r.skipType(tag2 & 7, n);
99
+ break;
100
+ }
101
+ }
102
+ m.subfield[k] = value;
103
+ break;
104
+ }
105
+ default:
106
+ r.skipType(t & 7, n);
107
+ break;
108
+ }
109
+ }
110
+ return m;
111
+ };
112
+ Field.fromObject = function fromObject(d, n) {
113
+ if (d instanceof $root.proto.Field)
114
+ return d;
115
+ if (n === undefined)
116
+ n = 0;
117
+ if (n > $util.recursionLimit)
118
+ throw Error("maximum nesting depth exceeded");
119
+ var m = new $root.proto.Field();
120
+ if (d.minVersion != null) {
121
+ m.minVersion = d.minVersion >>> 0;
122
+ }
123
+ if (d.maxVersion != null) {
124
+ m.maxVersion = d.maxVersion >>> 0;
125
+ }
126
+ if (d.notReportableMinVersion != null) {
127
+ m.notReportableMinVersion = d.notReportableMinVersion >>> 0;
128
+ }
129
+ if (d.isMessage != null) {
130
+ m.isMessage = Boolean(d.isMessage);
131
+ }
132
+ if (d.subfield) {
133
+ if (typeof d.subfield !== "object")
134
+ throw TypeError(".proto.Field.subfield: object expected");
135
+ m.subfield = {};
136
+ for (var ks = Object.keys(d.subfield), i = 0; i < ks.length; ++i) {
137
+ if (ks[i] === "__proto__")
138
+ $util.makeProp(m.subfield, ks[i]);
139
+ if (typeof d.subfield[ks[i]] !== "object")
140
+ throw TypeError(".proto.Field.subfield: object expected");
141
+ m.subfield[ks[i]] = $root.proto.Field.fromObject(d.subfield[ks[i]], n + 1);
142
+ }
143
+ }
144
+ return m;
145
+ };
146
+ Field.toObject = function toObject(m, o) {
147
+ if (!o)
148
+ o = {};
149
+ var d = {};
150
+ if (o.objects || o.defaults) {
151
+ d.subfield = {};
152
+ }
153
+ if (m.minVersion != null && m.hasOwnProperty("minVersion")) {
154
+ d.minVersion = m.minVersion;
155
+ if (o.oneofs)
156
+ d._minVersion = "minVersion";
157
+ }
158
+ if (m.maxVersion != null && m.hasOwnProperty("maxVersion")) {
159
+ d.maxVersion = m.maxVersion;
160
+ if (o.oneofs)
161
+ d._maxVersion = "maxVersion";
162
+ }
163
+ if (m.notReportableMinVersion != null && m.hasOwnProperty("notReportableMinVersion")) {
164
+ d.notReportableMinVersion = m.notReportableMinVersion;
165
+ if (o.oneofs)
166
+ d._notReportableMinVersion = "notReportableMinVersion";
167
+ }
168
+ if (m.isMessage != null && m.hasOwnProperty("isMessage")) {
169
+ d.isMessage = m.isMessage;
170
+ if (o.oneofs)
171
+ d._isMessage = "isMessage";
172
+ }
173
+ var ks2;
174
+ if (m.subfield && (ks2 = Object.keys(m.subfield)).length) {
175
+ d.subfield = {};
176
+ for (var j = 0; j < ks2.length; ++j) {
177
+ if (ks2[j] === "__proto__")
178
+ $util.makeProp(d.subfield, ks2[j]);
179
+ d.subfield[ks2[j]] = $root.proto.Field.toObject(m.subfield[ks2[j]], o);
180
+ }
181
+ }
182
+ return d;
183
+ };
184
+ Field.prototype.toJSON = function toJSON() {
185
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
186
+ };
187
+ Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
188
+ if (typeUrlPrefix === undefined) {
189
+ typeUrlPrefix = "type.googleapis.com";
190
+ }
191
+ return typeUrlPrefix + "/proto.Field";
192
+ };
193
+ return Field;