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