dcodeindra-baileyspro 2.3.9
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/LICENSE +21 -0
- package/README.md +2534 -0
- package/WAProto/Adv/Adv.d.ts +518 -0
- package/WAProto/Adv/Adv.js +1734 -0
- package/WAProto/Adv/Adv.proto +36 -0
- package/WAProto/BotMetadata/BotMetadata.d.ts +5745 -0
- package/WAProto/BotMetadata/BotMetadata.js +16291 -0
- package/WAProto/BotMetadata/BotMetadata.proto +463 -0
- package/WAProto/Cert/Cert.d.ts +497 -0
- package/WAProto/Cert/Cert.js +1503 -0
- package/WAProto/Cert/Cert.proto +28 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.d.ts +391 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.js +1155 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.proto +7 -0
- package/WAProto/CompanionReg/CompanionReg.d.ts +1055 -0
- package/WAProto/CompanionReg/CompanionReg.js +3532 -0
- package/WAProto/CompanionReg/CompanionReg.proto +89 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.d.ts +187 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.js +520 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +14 -0
- package/WAProto/E2E/E2E.d.ts +28417 -0
- package/WAProto/E2E/E2E.js +98438 -0
- package/WAProto/E2E/E2E.proto +2289 -0
- package/WAProto/Ephemeral/Ephemeral.d.ts +95 -0
- package/WAProto/Ephemeral/Ephemeral.js +269 -0
- package/WAProto/Ephemeral/Ephemeral.proto +6 -0
- package/WAProto/HistorySync/HistorySync.d.ts +40728 -0
- package/WAProto/HistorySync/HistorySync.js +142980 -0
- package/WAProto/HistorySync/HistorySync.proto +207 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.d.ts +189 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +585 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +11 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.d.ts +461 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +1559 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +37 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +29294 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +101732 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +76 -0
- package/WAProto/MmsRetry/MmsRetry.d.ts +200 -0
- package/WAProto/MmsRetry/MmsRetry.js +586 -0
- package/WAProto/MmsRetry/MmsRetry.proto +17 -0
- package/WAProto/Protocol/Protocol.d.ts +218 -0
- package/WAProto/Protocol/Protocol.js +701 -0
- package/WAProto/Protocol/Protocol.proto +20 -0
- package/WAProto/Reporting/Reporting.d.ts +301 -0
- package/WAProto/Reporting/Reporting.js +989 -0
- package/WAProto/Reporting/Reporting.proto +19 -0
- package/WAProto/ServerSync/ServerSync.d.ts +1050 -0
- package/WAProto/ServerSync/ServerSync.js +3176 -0
- package/WAProto/ServerSync/ServerSync.proto +59 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.d.ts +1507 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +4756 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +88 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.d.ts +617 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1940 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +38 -0
- package/WAProto/StatusAttributions/StatusAttributions.d.ts +636 -0
- package/WAProto/StatusAttributions/StatusAttributions.js +2037 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +61 -0
- package/WAProto/SyncAction/SyncAction.d.ts +7227 -0
- package/WAProto/SyncAction/SyncAction.js +22271 -0
- package/WAProto/SyncAction/SyncAction.proto +423 -0
- package/WAProto/UserPassword/UserPassword.d.ts +298 -0
- package/WAProto/UserPassword/UserPassword.js +898 -0
- package/WAProto/UserPassword/UserPassword.proto +27 -0
- package/WAProto/VnameCert/VnameCert.d.ts +658 -0
- package/WAProto/VnameCert/VnameCert.js +2225 -0
- package/WAProto/VnameCert/VnameCert.proto +60 -0
- package/WAProto/Wa6/Wa6.d.ts +1613 -0
- package/WAProto/Wa6/Wa6.js +6299 -0
- package/WAProto/Wa6/Wa6.proto +229 -0
- package/WAProto/Web/Web.d.ts +31718 -0
- package/WAProto/Web/Web.js +113402 -0
- package/WAProto/Web/Web.proto +545 -0
- package/WAProto/index.d.ts +49 -0
- package/WAProto/index.js +28 -0
- package/WASignalGroup/GroupProtocol.js +1771 -0
- package/WASignalGroup/ciphertext_message.js +10 -0
- package/WASignalGroup/group_cipher.js +103 -0
- package/WASignalGroup/group_session_builder.js +39 -0
- package/WASignalGroup/index.js +5 -0
- package/WASignalGroup/keyhelper.js +17 -0
- package/WASignalGroup/protobufs.js +2 -0
- package/WASignalGroup/queue_job.js +64 -0
- package/WASignalGroup/sender_chain_key.js +38 -0
- package/WASignalGroup/sender_key_distribution_message.js +68 -0
- package/WASignalGroup/sender_key_message.js +79 -0
- package/WASignalGroup/sender_key_name.js +59 -0
- package/WASignalGroup/sender_key_record.js +47 -0
- package/WASignalGroup/sender_key_state.js +110 -0
- package/WASignalGroup/sender_message_key.js +30 -0
- package/check-node-version.js +10 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +51 -0
- package/lib/Defaults/index.js +108 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/ciphertext-message.js +19 -0
- package/lib/Signal/Group/group-session-builder.d.ts +17 -0
- package/lib/Signal/Group/group-session-builder.js +72 -0
- package/lib/Signal/Group/group_cipher.d.ts +19 -0
- package/lib/Signal/Group/group_cipher.js +99 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/index.js +61 -0
- package/lib/Signal/Group/keyhelper.d.ts +16 -0
- package/lib/Signal/Group/keyhelper.js +66 -0
- package/lib/Signal/Group/queue-job.d.ts +1 -0
- package/lib/Signal/Group/queue-job.js +64 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.js +39 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +71 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.js +73 -0
- package/lib/Signal/Group/sender-key-name.d.ts +19 -0
- package/lib/Signal/Group/sender-key-name.js +59 -0
- package/lib/Signal/Group/sender-key-record.d.ts +32 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-record.ts +77 -0
- package/lib/Signal/Group/sender-key-state.d.ts +44 -0
- package/lib/Signal/Group/sender-key-state.js +104 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/Group/sender-message-key.js +33 -0
- package/lib/Signal/libsignal.d.ts +3 -0
- package/lib/Signal/libsignal.js +153 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/index.js +18 -0
- package/lib/Socket/Client/types.d.ts +15 -0
- package/lib/Socket/Client/types.js +14 -0
- package/lib/Socket/Client/websocket.d.ts +12 -0
- package/lib/Socket/Client/websocket.js +57 -0
- package/lib/Socket/business.d.ts +181 -0
- package/lib/Socket/business.js +259 -0
- package/lib/Socket/chats.d.ts +95 -0
- package/lib/Socket/chats.js +906 -0
- package/lib/Socket/community.d.ts +131 -0
- package/lib/Socket/community.js +369 -0
- package/lib/Socket/groups.d.ts +122 -0
- package/lib/Socket/groups.js +360 -0
- package/lib/Socket/index.d.ts +183 -0
- package/lib/Socket/index.js +10 -0
- package/lib/Socket/messages-recv.d.ts +170 -0
- package/lib/Socket/messages-recv.js +1074 -0
- package/lib/Socket/messages-send.d.ts +161 -0
- package/lib/Socket/messages-send.js +982 -0
- package/lib/Socket/newsletter.d.ts +140 -0
- package/lib/Socket/newsletter.js +242 -0
- package/lib/Socket/socket.d.ts +43 -0
- package/lib/Socket/socket.js +749 -0
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Socket/usync.js +71 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.js +20 -0
- package/lib/Store/make-cache-manager-store.d.ts +13 -0
- package/lib/Store/make-cache-manager-store.js +77 -0
- package/lib/Store/make-in-memory-store.d.ts +117 -0
- package/lib/Store/make-in-memory-store.js +420 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/make-ordered-dictionary.js +83 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +28 -0
- package/lib/Types/Auth.d.ts +103 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.d.ts +13 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.d.ts +115 -0
- package/lib/Types/Chat.js +6 -0
- package/lib/Types/Contact.d.ts +35 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.d.ts +208 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.d.ts +81 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.d.ts +46 -0
- package/lib/Types/Label.js +28 -0
- package/lib/Types/LabelAssociation.d.ts +29 -0
- package/lib/Types/LabelAssociation.js +10 -0
- package/lib/Types/Message.d.ts +480 -0
- package/lib/Types/Message.js +9 -0
- package/lib/Types/MexUpdates.d.ts +9 -0
- package/lib/Types/MexUpdates.js +18 -0
- package/lib/Types/Newsletter.d.ts +92 -0
- package/lib/Types/Newsletter.js +33 -0
- package/lib/Types/Product.d.ts +78 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.d.ts +57 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.d.ts +116 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.d.ts +27 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.d.ts +70 -0
- package/lib/Types/index.js +42 -0
- package/lib/Utils/auth-utils.d.ts +18 -0
- package/lib/Utils/auth-utils.js +198 -0
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +64 -0
- package/lib/Utils/business.d.ts +22 -0
- package/lib/Utils/business.js +243 -0
- package/lib/Utils/chat-utils.d.ts +72 -0
- package/lib/Utils/chat-utils.js +762 -0
- package/lib/Utils/crypto.d.ts +40 -0
- package/lib/Utils/crypto.js +150 -0
- package/lib/Utils/decode-wa-message.d.ts +252 -0
- package/lib/Utils/decode-wa-message.js +232 -0
- package/lib/Utils/event-buffer.d.ts +35 -0
- package/lib/Utils/event-buffer.js +539 -0
- package/lib/Utils/generics.d.ts +96 -0
- package/lib/Utils/generics.js +553 -0
- package/lib/Utils/history.d.ts +29 -0
- package/lib/Utils/history.js +109 -0
- package/lib/Utils/index.d.ts +19 -0
- package/lib/Utils/index.js +35 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.js +112 -0
- package/lib/Utils/logger.d.ts +11 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/lt-hash.js +53 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.js +45 -0
- package/lib/Utils/messages-media.d.ts +104 -0
- package/lib/Utils/messages-media.js +751 -0
- package/lib/Utils/messages.d.ts +80 -0
- package/lib/Utils/messages.js +1741 -0
- package/lib/Utils/noise-handler.d.ts +19 -0
- package/lib/Utils/noise-handler.js +150 -0
- package/lib/Utils/process-message.d.ts +41 -0
- package/lib/Utils/process-message.js +391 -0
- package/lib/Utils/signal.d.ts +33 -0
- package/lib/Utils/signal.js +154 -0
- package/lib/Utils/use-mongo-file-auth-state.d.ts +5 -0
- package/lib/Utils/use-mongo-file-auth-state.js +75 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-multi-file-auth-state.js +123 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-single-file-auth-state.js +75 -0
- package/lib/Utils/validate-connection.d.ts +10 -0
- package/lib/Utils/validate-connection.js +174 -0
- package/lib/WABinary/constants.d.ts +27 -0
- package/lib/WABinary/constants.js +45 -0
- package/lib/WABinary/decode.d.ts +6 -0
- package/lib/WABinary/decode.js +255 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/encode.js +243 -0
- package/lib/WABinary/generic-utils.d.ts +16 -0
- package/lib/WABinary/generic-utils.js +125 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +21 -0
- package/lib/WABinary/jid-utils.d.ts +34 -0
- package/lib/WABinary/jid-utils.js +73 -0
- package/lib/WABinary/types.d.ts +18 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.d.ts +16 -0
- package/lib/WAM/BinaryInfo.js +14 -0
- package/lib/WAM/constants.d.ts +39 -0
- package/lib/WAM/constants.js +15362 -0
- package/lib/WAM/encode.d.ts +2 -0
- package/lib/WAM/encode.js +156 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +19 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +60 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +58 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +31 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +26 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.js +22 -0
- package/lib/WAUSync/USyncQuery.d.ts +28 -0
- package/lib/WAUSync/USyncQuery.js +88 -0
- package/lib/WAUSync/USyncUser.d.ts +12 -0
- package/lib/WAUSync/USyncUser.js +27 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +45 -0
- package/package.json +63 -0
|
@@ -0,0 +1,1940 @@
|
|
|
1
|
+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
|
2
|
+
"use strict";
|
|
3
|
+
var $protobuf = require("protobufjs/minimal");
|
|
4
|
+
// Common aliases
|
|
5
|
+
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
6
|
+
// Exported root namespace
|
|
7
|
+
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
8
|
+
$root.SignalWhisperTextProtocol = (function() {
|
|
9
|
+
/**
|
|
10
|
+
* Namespace SignalWhisperTextProtocol.
|
|
11
|
+
* @exports SignalWhisperTextProtocol
|
|
12
|
+
* @namespace
|
|
13
|
+
*/
|
|
14
|
+
var SignalWhisperTextProtocol = {};
|
|
15
|
+
SignalWhisperTextProtocol.DeviceConsistencyCodeMessage = (function() {
|
|
16
|
+
/**
|
|
17
|
+
* Properties of a DeviceConsistencyCodeMessage.
|
|
18
|
+
* @memberof SignalWhisperTextProtocol
|
|
19
|
+
* @interface IDeviceConsistencyCodeMessage
|
|
20
|
+
* @property {number|null} [generation] DeviceConsistencyCodeMessage generation
|
|
21
|
+
* @property {Uint8Array|null} [signature] DeviceConsistencyCodeMessage signature
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new DeviceConsistencyCodeMessage.
|
|
25
|
+
* @memberof SignalWhisperTextProtocol
|
|
26
|
+
* @classdesc Represents a DeviceConsistencyCodeMessage.
|
|
27
|
+
* @implements IDeviceConsistencyCodeMessage
|
|
28
|
+
* @constructor
|
|
29
|
+
* @param {SignalWhisperTextProtocol.IDeviceConsistencyCodeMessage=} [properties] Properties to set
|
|
30
|
+
*/
|
|
31
|
+
function DeviceConsistencyCodeMessage(properties) {
|
|
32
|
+
if (properties)
|
|
33
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
34
|
+
if (properties[keys[i]] != null)
|
|
35
|
+
this[keys[i]] = properties[keys[i]];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* DeviceConsistencyCodeMessage generation.
|
|
39
|
+
* @member {number|null|undefined} generation
|
|
40
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
41
|
+
* @instance
|
|
42
|
+
*/
|
|
43
|
+
DeviceConsistencyCodeMessage.prototype.generation = null;
|
|
44
|
+
/**
|
|
45
|
+
* DeviceConsistencyCodeMessage signature.
|
|
46
|
+
* @member {Uint8Array|null|undefined} signature
|
|
47
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
48
|
+
* @instance
|
|
49
|
+
*/
|
|
50
|
+
DeviceConsistencyCodeMessage.prototype.signature = null;
|
|
51
|
+
// OneOf field names bound to virtual getters and setters
|
|
52
|
+
var $oneOfFields;
|
|
53
|
+
/**
|
|
54
|
+
* DeviceConsistencyCodeMessage _generation.
|
|
55
|
+
* @member {"generation"|undefined} _generation
|
|
56
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
57
|
+
* @instance
|
|
58
|
+
*/
|
|
59
|
+
Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_generation", {
|
|
60
|
+
get: $util.oneOfGetter($oneOfFields = ["generation"]),
|
|
61
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* DeviceConsistencyCodeMessage _signature.
|
|
65
|
+
* @member {"signature"|undefined} _signature
|
|
66
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
67
|
+
* @instance
|
|
68
|
+
*/
|
|
69
|
+
Object.defineProperty(DeviceConsistencyCodeMessage.prototype, "_signature", {
|
|
70
|
+
get: $util.oneOfGetter($oneOfFields = ["signature"]),
|
|
71
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new DeviceConsistencyCodeMessage instance using the specified properties.
|
|
75
|
+
* @function create
|
|
76
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
77
|
+
* @static
|
|
78
|
+
* @param {SignalWhisperTextProtocol.IDeviceConsistencyCodeMessage=} [properties] Properties to set
|
|
79
|
+
* @returns {SignalWhisperTextProtocol.DeviceConsistencyCodeMessage} DeviceConsistencyCodeMessage instance
|
|
80
|
+
*/
|
|
81
|
+
DeviceConsistencyCodeMessage.create = function create(properties) {
|
|
82
|
+
return new DeviceConsistencyCodeMessage(properties);
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Encodes the specified DeviceConsistencyCodeMessage message. Does not implicitly {@link SignalWhisperTextProtocol.DeviceConsistencyCodeMessage.verify|verify} messages.
|
|
86
|
+
* @function encode
|
|
87
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
88
|
+
* @static
|
|
89
|
+
* @param {SignalWhisperTextProtocol.IDeviceConsistencyCodeMessage} message DeviceConsistencyCodeMessage message or plain object to encode
|
|
90
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
91
|
+
* @returns {$protobuf.Writer} Writer
|
|
92
|
+
*/
|
|
93
|
+
DeviceConsistencyCodeMessage.encode = function encode(message, writer) {
|
|
94
|
+
if (!writer)
|
|
95
|
+
writer = $Writer.create();
|
|
96
|
+
if (message.generation != null && Object.hasOwnProperty.call(message, "generation"))
|
|
97
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.generation);
|
|
98
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
|
99
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature);
|
|
100
|
+
return writer;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Encodes the specified DeviceConsistencyCodeMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.DeviceConsistencyCodeMessage.verify|verify} messages.
|
|
104
|
+
* @function encodeDelimited
|
|
105
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
106
|
+
* @static
|
|
107
|
+
* @param {SignalWhisperTextProtocol.IDeviceConsistencyCodeMessage} message DeviceConsistencyCodeMessage message or plain object to encode
|
|
108
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
109
|
+
* @returns {$protobuf.Writer} Writer
|
|
110
|
+
*/
|
|
111
|
+
DeviceConsistencyCodeMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
112
|
+
return this.encode(message, writer).ldelim();
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Decodes a DeviceConsistencyCodeMessage message from the specified reader or buffer.
|
|
116
|
+
* @function decode
|
|
117
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
118
|
+
* @static
|
|
119
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
120
|
+
* @param {number} [length] Message length if known beforehand
|
|
121
|
+
* @returns {SignalWhisperTextProtocol.DeviceConsistencyCodeMessage} DeviceConsistencyCodeMessage
|
|
122
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
123
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
124
|
+
*/
|
|
125
|
+
DeviceConsistencyCodeMessage.decode = function decode(reader, length, error) {
|
|
126
|
+
if (!(reader instanceof $Reader))
|
|
127
|
+
reader = $Reader.create(reader);
|
|
128
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.DeviceConsistencyCodeMessage();
|
|
129
|
+
while (reader.pos < end) {
|
|
130
|
+
var tag = reader.uint32();
|
|
131
|
+
if (tag === error)
|
|
132
|
+
break;
|
|
133
|
+
switch (tag >>> 3) {
|
|
134
|
+
case 1: {
|
|
135
|
+
message.generation = reader.uint32();
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case 2: {
|
|
139
|
+
message.signature = reader.bytes();
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
default:
|
|
143
|
+
reader.skipType(tag & 7);
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return message;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Decodes a DeviceConsistencyCodeMessage message from the specified reader or buffer, length delimited.
|
|
151
|
+
* @function decodeDelimited
|
|
152
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
153
|
+
* @static
|
|
154
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
155
|
+
* @returns {SignalWhisperTextProtocol.DeviceConsistencyCodeMessage} DeviceConsistencyCodeMessage
|
|
156
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
157
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
158
|
+
*/
|
|
159
|
+
DeviceConsistencyCodeMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
160
|
+
if (!(reader instanceof $Reader))
|
|
161
|
+
reader = new $Reader(reader);
|
|
162
|
+
return this.decode(reader, reader.uint32());
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Verifies a DeviceConsistencyCodeMessage message.
|
|
166
|
+
* @function verify
|
|
167
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
168
|
+
* @static
|
|
169
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
170
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
171
|
+
*/
|
|
172
|
+
DeviceConsistencyCodeMessage.verify = function verify(message) {
|
|
173
|
+
if (typeof message !== "object" || message === null)
|
|
174
|
+
return "object expected";
|
|
175
|
+
var properties = {};
|
|
176
|
+
if (message.generation != null && message.hasOwnProperty("generation")) {
|
|
177
|
+
properties._generation = 1;
|
|
178
|
+
if (!$util.isInteger(message.generation))
|
|
179
|
+
return "generation: integer expected";
|
|
180
|
+
}
|
|
181
|
+
if (message.signature != null && message.hasOwnProperty("signature")) {
|
|
182
|
+
properties._signature = 1;
|
|
183
|
+
if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
|
|
184
|
+
return "signature: buffer expected";
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Creates a DeviceConsistencyCodeMessage message from a plain object. Also converts values to their respective internal types.
|
|
190
|
+
* @function fromObject
|
|
191
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
192
|
+
* @static
|
|
193
|
+
* @param {Object.<string,*>} object Plain object
|
|
194
|
+
* @returns {SignalWhisperTextProtocol.DeviceConsistencyCodeMessage} DeviceConsistencyCodeMessage
|
|
195
|
+
*/
|
|
196
|
+
DeviceConsistencyCodeMessage.fromObject = function fromObject(object) {
|
|
197
|
+
if (object instanceof $root.SignalWhisperTextProtocol.DeviceConsistencyCodeMessage)
|
|
198
|
+
return object;
|
|
199
|
+
var message = new $root.SignalWhisperTextProtocol.DeviceConsistencyCodeMessage();
|
|
200
|
+
if (object.generation != null)
|
|
201
|
+
message.generation = object.generation >>> 0;
|
|
202
|
+
if (object.signature != null)
|
|
203
|
+
if (typeof object.signature === "string")
|
|
204
|
+
$util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
|
|
205
|
+
else if (object.signature.length >= 0)
|
|
206
|
+
message.signature = object.signature;
|
|
207
|
+
return message;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Creates a plain object from a DeviceConsistencyCodeMessage message. Also converts values to other types if specified.
|
|
211
|
+
* @function toObject
|
|
212
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
213
|
+
* @static
|
|
214
|
+
* @param {SignalWhisperTextProtocol.DeviceConsistencyCodeMessage} message DeviceConsistencyCodeMessage
|
|
215
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
216
|
+
* @returns {Object.<string,*>} Plain object
|
|
217
|
+
*/
|
|
218
|
+
DeviceConsistencyCodeMessage.toObject = function toObject(message, options) {
|
|
219
|
+
if (!options)
|
|
220
|
+
options = {};
|
|
221
|
+
var object = {};
|
|
222
|
+
if (message.generation != null && message.hasOwnProperty("generation")) {
|
|
223
|
+
object.generation = message.generation;
|
|
224
|
+
if (options.oneofs)
|
|
225
|
+
object._generation = "generation";
|
|
226
|
+
}
|
|
227
|
+
if (message.signature != null && message.hasOwnProperty("signature")) {
|
|
228
|
+
object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
|
|
229
|
+
if (options.oneofs)
|
|
230
|
+
object._signature = "signature";
|
|
231
|
+
}
|
|
232
|
+
return object;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Converts this DeviceConsistencyCodeMessage to JSON.
|
|
236
|
+
* @function toJSON
|
|
237
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
238
|
+
* @instance
|
|
239
|
+
* @returns {Object.<string,*>} JSON object
|
|
240
|
+
*/
|
|
241
|
+
DeviceConsistencyCodeMessage.prototype.toJSON = function toJSON() {
|
|
242
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Gets the default type url for DeviceConsistencyCodeMessage
|
|
246
|
+
* @function getTypeUrl
|
|
247
|
+
* @memberof SignalWhisperTextProtocol.DeviceConsistencyCodeMessage
|
|
248
|
+
* @static
|
|
249
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
250
|
+
* @returns {string} The default type url
|
|
251
|
+
*/
|
|
252
|
+
DeviceConsistencyCodeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
253
|
+
if (typeUrlPrefix === undefined) {
|
|
254
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
255
|
+
}
|
|
256
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.DeviceConsistencyCodeMessage";
|
|
257
|
+
};
|
|
258
|
+
return DeviceConsistencyCodeMessage;
|
|
259
|
+
})();
|
|
260
|
+
SignalWhisperTextProtocol.SenderKeyDistributionMessage = (function() {
|
|
261
|
+
/**
|
|
262
|
+
* Properties of a SenderKeyDistributionMessage.
|
|
263
|
+
* @memberof SignalWhisperTextProtocol
|
|
264
|
+
* @interface ISenderKeyDistributionMessage
|
|
265
|
+
* @property {number|null} [id] SenderKeyDistributionMessage id
|
|
266
|
+
* @property {number|null} [iteration] SenderKeyDistributionMessage iteration
|
|
267
|
+
* @property {Uint8Array|null} [chainKey] SenderKeyDistributionMessage chainKey
|
|
268
|
+
* @property {Uint8Array|null} [signingKey] SenderKeyDistributionMessage signingKey
|
|
269
|
+
*/
|
|
270
|
+
/**
|
|
271
|
+
* Constructs a new SenderKeyDistributionMessage.
|
|
272
|
+
* @memberof SignalWhisperTextProtocol
|
|
273
|
+
* @classdesc Represents a SenderKeyDistributionMessage.
|
|
274
|
+
* @implements ISenderKeyDistributionMessage
|
|
275
|
+
* @constructor
|
|
276
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyDistributionMessage=} [properties] Properties to set
|
|
277
|
+
*/
|
|
278
|
+
function SenderKeyDistributionMessage(properties) {
|
|
279
|
+
if (properties)
|
|
280
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
281
|
+
if (properties[keys[i]] != null)
|
|
282
|
+
this[keys[i]] = properties[keys[i]];
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* SenderKeyDistributionMessage id.
|
|
286
|
+
* @member {number|null|undefined} id
|
|
287
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
288
|
+
* @instance
|
|
289
|
+
*/
|
|
290
|
+
SenderKeyDistributionMessage.prototype.id = null;
|
|
291
|
+
/**
|
|
292
|
+
* SenderKeyDistributionMessage iteration.
|
|
293
|
+
* @member {number|null|undefined} iteration
|
|
294
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
295
|
+
* @instance
|
|
296
|
+
*/
|
|
297
|
+
SenderKeyDistributionMessage.prototype.iteration = null;
|
|
298
|
+
/**
|
|
299
|
+
* SenderKeyDistributionMessage chainKey.
|
|
300
|
+
* @member {Uint8Array|null|undefined} chainKey
|
|
301
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
302
|
+
* @instance
|
|
303
|
+
*/
|
|
304
|
+
SenderKeyDistributionMessage.prototype.chainKey = null;
|
|
305
|
+
/**
|
|
306
|
+
* SenderKeyDistributionMessage signingKey.
|
|
307
|
+
* @member {Uint8Array|null|undefined} signingKey
|
|
308
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
309
|
+
* @instance
|
|
310
|
+
*/
|
|
311
|
+
SenderKeyDistributionMessage.prototype.signingKey = null;
|
|
312
|
+
// OneOf field names bound to virtual getters and setters
|
|
313
|
+
var $oneOfFields;
|
|
314
|
+
/**
|
|
315
|
+
* SenderKeyDistributionMessage _id.
|
|
316
|
+
* @member {"id"|undefined} _id
|
|
317
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
318
|
+
* @instance
|
|
319
|
+
*/
|
|
320
|
+
Object.defineProperty(SenderKeyDistributionMessage.prototype, "_id", {
|
|
321
|
+
get: $util.oneOfGetter($oneOfFields = ["id"]),
|
|
322
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* SenderKeyDistributionMessage _iteration.
|
|
326
|
+
* @member {"iteration"|undefined} _iteration
|
|
327
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
328
|
+
* @instance
|
|
329
|
+
*/
|
|
330
|
+
Object.defineProperty(SenderKeyDistributionMessage.prototype, "_iteration", {
|
|
331
|
+
get: $util.oneOfGetter($oneOfFields = ["iteration"]),
|
|
332
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* SenderKeyDistributionMessage _chainKey.
|
|
336
|
+
* @member {"chainKey"|undefined} _chainKey
|
|
337
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
338
|
+
* @instance
|
|
339
|
+
*/
|
|
340
|
+
Object.defineProperty(SenderKeyDistributionMessage.prototype, "_chainKey", {
|
|
341
|
+
get: $util.oneOfGetter($oneOfFields = ["chainKey"]),
|
|
342
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
343
|
+
});
|
|
344
|
+
/**
|
|
345
|
+
* SenderKeyDistributionMessage _signingKey.
|
|
346
|
+
* @member {"signingKey"|undefined} _signingKey
|
|
347
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
348
|
+
* @instance
|
|
349
|
+
*/
|
|
350
|
+
Object.defineProperty(SenderKeyDistributionMessage.prototype, "_signingKey", {
|
|
351
|
+
get: $util.oneOfGetter($oneOfFields = ["signingKey"]),
|
|
352
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
353
|
+
});
|
|
354
|
+
/**
|
|
355
|
+
* Creates a new SenderKeyDistributionMessage instance using the specified properties.
|
|
356
|
+
* @function create
|
|
357
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
358
|
+
* @static
|
|
359
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyDistributionMessage=} [properties] Properties to set
|
|
360
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyDistributionMessage} SenderKeyDistributionMessage instance
|
|
361
|
+
*/
|
|
362
|
+
SenderKeyDistributionMessage.create = function create(properties) {
|
|
363
|
+
return new SenderKeyDistributionMessage(properties);
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link SignalWhisperTextProtocol.SenderKeyDistributionMessage.verify|verify} messages.
|
|
367
|
+
* @function encode
|
|
368
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
369
|
+
* @static
|
|
370
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode
|
|
371
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
372
|
+
* @returns {$protobuf.Writer} Writer
|
|
373
|
+
*/
|
|
374
|
+
SenderKeyDistributionMessage.encode = function encode(message, writer) {
|
|
375
|
+
if (!writer)
|
|
376
|
+
writer = $Writer.create();
|
|
377
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
378
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.id);
|
|
379
|
+
if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration"))
|
|
380
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.iteration);
|
|
381
|
+
if (message.chainKey != null && Object.hasOwnProperty.call(message, "chainKey"))
|
|
382
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.chainKey);
|
|
383
|
+
if (message.signingKey != null && Object.hasOwnProperty.call(message, "signingKey"))
|
|
384
|
+
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signingKey);
|
|
385
|
+
return writer;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.SenderKeyDistributionMessage.verify|verify} messages.
|
|
389
|
+
* @function encodeDelimited
|
|
390
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
391
|
+
* @static
|
|
392
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode
|
|
393
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
394
|
+
* @returns {$protobuf.Writer} Writer
|
|
395
|
+
*/
|
|
396
|
+
SenderKeyDistributionMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
397
|
+
return this.encode(message, writer).ldelim();
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Decodes a SenderKeyDistributionMessage message from the specified reader or buffer.
|
|
401
|
+
* @function decode
|
|
402
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
403
|
+
* @static
|
|
404
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
405
|
+
* @param {number} [length] Message length if known beforehand
|
|
406
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyDistributionMessage} SenderKeyDistributionMessage
|
|
407
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
408
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
409
|
+
*/
|
|
410
|
+
SenderKeyDistributionMessage.decode = function decode(reader, length, error) {
|
|
411
|
+
if (!(reader instanceof $Reader))
|
|
412
|
+
reader = $Reader.create(reader);
|
|
413
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.SenderKeyDistributionMessage();
|
|
414
|
+
while (reader.pos < end) {
|
|
415
|
+
var tag = reader.uint32();
|
|
416
|
+
if (tag === error)
|
|
417
|
+
break;
|
|
418
|
+
switch (tag >>> 3) {
|
|
419
|
+
case 1: {
|
|
420
|
+
message.id = reader.uint32();
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
case 2: {
|
|
424
|
+
message.iteration = reader.uint32();
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
case 3: {
|
|
428
|
+
message.chainKey = reader.bytes();
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
case 4: {
|
|
432
|
+
message.signingKey = reader.bytes();
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
default:
|
|
436
|
+
reader.skipType(tag & 7);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return message;
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited.
|
|
444
|
+
* @function decodeDelimited
|
|
445
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
446
|
+
* @static
|
|
447
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
448
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyDistributionMessage} SenderKeyDistributionMessage
|
|
449
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
450
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
451
|
+
*/
|
|
452
|
+
SenderKeyDistributionMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
453
|
+
if (!(reader instanceof $Reader))
|
|
454
|
+
reader = new $Reader(reader);
|
|
455
|
+
return this.decode(reader, reader.uint32());
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Verifies a SenderKeyDistributionMessage message.
|
|
459
|
+
* @function verify
|
|
460
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
461
|
+
* @static
|
|
462
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
463
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
464
|
+
*/
|
|
465
|
+
SenderKeyDistributionMessage.verify = function verify(message) {
|
|
466
|
+
if (typeof message !== "object" || message === null)
|
|
467
|
+
return "object expected";
|
|
468
|
+
var properties = {};
|
|
469
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
470
|
+
properties._id = 1;
|
|
471
|
+
if (!$util.isInteger(message.id))
|
|
472
|
+
return "id: integer expected";
|
|
473
|
+
}
|
|
474
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
475
|
+
properties._iteration = 1;
|
|
476
|
+
if (!$util.isInteger(message.iteration))
|
|
477
|
+
return "iteration: integer expected";
|
|
478
|
+
}
|
|
479
|
+
if (message.chainKey != null && message.hasOwnProperty("chainKey")) {
|
|
480
|
+
properties._chainKey = 1;
|
|
481
|
+
if (!(message.chainKey && typeof message.chainKey.length === "number" || $util.isString(message.chainKey)))
|
|
482
|
+
return "chainKey: buffer expected";
|
|
483
|
+
}
|
|
484
|
+
if (message.signingKey != null && message.hasOwnProperty("signingKey")) {
|
|
485
|
+
properties._signingKey = 1;
|
|
486
|
+
if (!(message.signingKey && typeof message.signingKey.length === "number" || $util.isString(message.signingKey)))
|
|
487
|
+
return "signingKey: buffer expected";
|
|
488
|
+
}
|
|
489
|
+
return null;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types.
|
|
493
|
+
* @function fromObject
|
|
494
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
495
|
+
* @static
|
|
496
|
+
* @param {Object.<string,*>} object Plain object
|
|
497
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyDistributionMessage} SenderKeyDistributionMessage
|
|
498
|
+
*/
|
|
499
|
+
SenderKeyDistributionMessage.fromObject = function fromObject(object) {
|
|
500
|
+
if (object instanceof $root.SignalWhisperTextProtocol.SenderKeyDistributionMessage)
|
|
501
|
+
return object;
|
|
502
|
+
var message = new $root.SignalWhisperTextProtocol.SenderKeyDistributionMessage();
|
|
503
|
+
if (object.id != null)
|
|
504
|
+
message.id = object.id >>> 0;
|
|
505
|
+
if (object.iteration != null)
|
|
506
|
+
message.iteration = object.iteration >>> 0;
|
|
507
|
+
if (object.chainKey != null)
|
|
508
|
+
if (typeof object.chainKey === "string")
|
|
509
|
+
$util.base64.decode(object.chainKey, message.chainKey = $util.newBuffer($util.base64.length(object.chainKey)), 0);
|
|
510
|
+
else if (object.chainKey.length >= 0)
|
|
511
|
+
message.chainKey = object.chainKey;
|
|
512
|
+
if (object.signingKey != null)
|
|
513
|
+
if (typeof object.signingKey === "string")
|
|
514
|
+
$util.base64.decode(object.signingKey, message.signingKey = $util.newBuffer($util.base64.length(object.signingKey)), 0);
|
|
515
|
+
else if (object.signingKey.length >= 0)
|
|
516
|
+
message.signingKey = object.signingKey;
|
|
517
|
+
return message;
|
|
518
|
+
};
|
|
519
|
+
/**
|
|
520
|
+
* Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified.
|
|
521
|
+
* @function toObject
|
|
522
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
523
|
+
* @static
|
|
524
|
+
* @param {SignalWhisperTextProtocol.SenderKeyDistributionMessage} message SenderKeyDistributionMessage
|
|
525
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
526
|
+
* @returns {Object.<string,*>} Plain object
|
|
527
|
+
*/
|
|
528
|
+
SenderKeyDistributionMessage.toObject = function toObject(message, options) {
|
|
529
|
+
if (!options)
|
|
530
|
+
options = {};
|
|
531
|
+
var object = {};
|
|
532
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
533
|
+
object.id = message.id;
|
|
534
|
+
if (options.oneofs)
|
|
535
|
+
object._id = "id";
|
|
536
|
+
}
|
|
537
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
538
|
+
object.iteration = message.iteration;
|
|
539
|
+
if (options.oneofs)
|
|
540
|
+
object._iteration = "iteration";
|
|
541
|
+
}
|
|
542
|
+
if (message.chainKey != null && message.hasOwnProperty("chainKey")) {
|
|
543
|
+
object.chainKey = options.bytes === String ? $util.base64.encode(message.chainKey, 0, message.chainKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainKey) : message.chainKey;
|
|
544
|
+
if (options.oneofs)
|
|
545
|
+
object._chainKey = "chainKey";
|
|
546
|
+
}
|
|
547
|
+
if (message.signingKey != null && message.hasOwnProperty("signingKey")) {
|
|
548
|
+
object.signingKey = options.bytes === String ? $util.base64.encode(message.signingKey, 0, message.signingKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.signingKey) : message.signingKey;
|
|
549
|
+
if (options.oneofs)
|
|
550
|
+
object._signingKey = "signingKey";
|
|
551
|
+
}
|
|
552
|
+
return object;
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* Converts this SenderKeyDistributionMessage to JSON.
|
|
556
|
+
* @function toJSON
|
|
557
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
558
|
+
* @instance
|
|
559
|
+
* @returns {Object.<string,*>} JSON object
|
|
560
|
+
*/
|
|
561
|
+
SenderKeyDistributionMessage.prototype.toJSON = function toJSON() {
|
|
562
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* Gets the default type url for SenderKeyDistributionMessage
|
|
566
|
+
* @function getTypeUrl
|
|
567
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyDistributionMessage
|
|
568
|
+
* @static
|
|
569
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
570
|
+
* @returns {string} The default type url
|
|
571
|
+
*/
|
|
572
|
+
SenderKeyDistributionMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
573
|
+
if (typeUrlPrefix === undefined) {
|
|
574
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
575
|
+
}
|
|
576
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.SenderKeyDistributionMessage";
|
|
577
|
+
};
|
|
578
|
+
return SenderKeyDistributionMessage;
|
|
579
|
+
})();
|
|
580
|
+
SignalWhisperTextProtocol.SenderKeyMessage = (function() {
|
|
581
|
+
/**
|
|
582
|
+
* Properties of a SenderKeyMessage.
|
|
583
|
+
* @memberof SignalWhisperTextProtocol
|
|
584
|
+
* @interface ISenderKeyMessage
|
|
585
|
+
* @property {number|null} [id] SenderKeyMessage id
|
|
586
|
+
* @property {number|null} [iteration] SenderKeyMessage iteration
|
|
587
|
+
* @property {Uint8Array|null} [ciphertext] SenderKeyMessage ciphertext
|
|
588
|
+
*/
|
|
589
|
+
/**
|
|
590
|
+
* Constructs a new SenderKeyMessage.
|
|
591
|
+
* @memberof SignalWhisperTextProtocol
|
|
592
|
+
* @classdesc Represents a SenderKeyMessage.
|
|
593
|
+
* @implements ISenderKeyMessage
|
|
594
|
+
* @constructor
|
|
595
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyMessage=} [properties] Properties to set
|
|
596
|
+
*/
|
|
597
|
+
function SenderKeyMessage(properties) {
|
|
598
|
+
if (properties)
|
|
599
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
600
|
+
if (properties[keys[i]] != null)
|
|
601
|
+
this[keys[i]] = properties[keys[i]];
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* SenderKeyMessage id.
|
|
605
|
+
* @member {number|null|undefined} id
|
|
606
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
607
|
+
* @instance
|
|
608
|
+
*/
|
|
609
|
+
SenderKeyMessage.prototype.id = null;
|
|
610
|
+
/**
|
|
611
|
+
* SenderKeyMessage iteration.
|
|
612
|
+
* @member {number|null|undefined} iteration
|
|
613
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
614
|
+
* @instance
|
|
615
|
+
*/
|
|
616
|
+
SenderKeyMessage.prototype.iteration = null;
|
|
617
|
+
/**
|
|
618
|
+
* SenderKeyMessage ciphertext.
|
|
619
|
+
* @member {Uint8Array|null|undefined} ciphertext
|
|
620
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
621
|
+
* @instance
|
|
622
|
+
*/
|
|
623
|
+
SenderKeyMessage.prototype.ciphertext = null;
|
|
624
|
+
// OneOf field names bound to virtual getters and setters
|
|
625
|
+
var $oneOfFields;
|
|
626
|
+
/**
|
|
627
|
+
* SenderKeyMessage _id.
|
|
628
|
+
* @member {"id"|undefined} _id
|
|
629
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
630
|
+
* @instance
|
|
631
|
+
*/
|
|
632
|
+
Object.defineProperty(SenderKeyMessage.prototype, "_id", {
|
|
633
|
+
get: $util.oneOfGetter($oneOfFields = ["id"]),
|
|
634
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
635
|
+
});
|
|
636
|
+
/**
|
|
637
|
+
* SenderKeyMessage _iteration.
|
|
638
|
+
* @member {"iteration"|undefined} _iteration
|
|
639
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
640
|
+
* @instance
|
|
641
|
+
*/
|
|
642
|
+
Object.defineProperty(SenderKeyMessage.prototype, "_iteration", {
|
|
643
|
+
get: $util.oneOfGetter($oneOfFields = ["iteration"]),
|
|
644
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
645
|
+
});
|
|
646
|
+
/**
|
|
647
|
+
* SenderKeyMessage _ciphertext.
|
|
648
|
+
* @member {"ciphertext"|undefined} _ciphertext
|
|
649
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
650
|
+
* @instance
|
|
651
|
+
*/
|
|
652
|
+
Object.defineProperty(SenderKeyMessage.prototype, "_ciphertext", {
|
|
653
|
+
get: $util.oneOfGetter($oneOfFields = ["ciphertext"]),
|
|
654
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
655
|
+
});
|
|
656
|
+
/**
|
|
657
|
+
* Creates a new SenderKeyMessage instance using the specified properties.
|
|
658
|
+
* @function create
|
|
659
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
660
|
+
* @static
|
|
661
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyMessage=} [properties] Properties to set
|
|
662
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyMessage} SenderKeyMessage instance
|
|
663
|
+
*/
|
|
664
|
+
SenderKeyMessage.create = function create(properties) {
|
|
665
|
+
return new SenderKeyMessage(properties);
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* Encodes the specified SenderKeyMessage message. Does not implicitly {@link SignalWhisperTextProtocol.SenderKeyMessage.verify|verify} messages.
|
|
669
|
+
* @function encode
|
|
670
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
671
|
+
* @static
|
|
672
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyMessage} message SenderKeyMessage message or plain object to encode
|
|
673
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
674
|
+
* @returns {$protobuf.Writer} Writer
|
|
675
|
+
*/
|
|
676
|
+
SenderKeyMessage.encode = function encode(message, writer) {
|
|
677
|
+
if (!writer)
|
|
678
|
+
writer = $Writer.create();
|
|
679
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
680
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.id);
|
|
681
|
+
if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration"))
|
|
682
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.iteration);
|
|
683
|
+
if (message.ciphertext != null && Object.hasOwnProperty.call(message, "ciphertext"))
|
|
684
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ciphertext);
|
|
685
|
+
return writer;
|
|
686
|
+
};
|
|
687
|
+
/**
|
|
688
|
+
* Encodes the specified SenderKeyMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.SenderKeyMessage.verify|verify} messages.
|
|
689
|
+
* @function encodeDelimited
|
|
690
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
691
|
+
* @static
|
|
692
|
+
* @param {SignalWhisperTextProtocol.ISenderKeyMessage} message SenderKeyMessage message or plain object to encode
|
|
693
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
694
|
+
* @returns {$protobuf.Writer} Writer
|
|
695
|
+
*/
|
|
696
|
+
SenderKeyMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
697
|
+
return this.encode(message, writer).ldelim();
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* Decodes a SenderKeyMessage message from the specified reader or buffer.
|
|
701
|
+
* @function decode
|
|
702
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
703
|
+
* @static
|
|
704
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
705
|
+
* @param {number} [length] Message length if known beforehand
|
|
706
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyMessage} SenderKeyMessage
|
|
707
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
708
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
709
|
+
*/
|
|
710
|
+
SenderKeyMessage.decode = function decode(reader, length, error) {
|
|
711
|
+
if (!(reader instanceof $Reader))
|
|
712
|
+
reader = $Reader.create(reader);
|
|
713
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.SenderKeyMessage();
|
|
714
|
+
while (reader.pos < end) {
|
|
715
|
+
var tag = reader.uint32();
|
|
716
|
+
if (tag === error)
|
|
717
|
+
break;
|
|
718
|
+
switch (tag >>> 3) {
|
|
719
|
+
case 1: {
|
|
720
|
+
message.id = reader.uint32();
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
case 2: {
|
|
724
|
+
message.iteration = reader.uint32();
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case 3: {
|
|
728
|
+
message.ciphertext = reader.bytes();
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
default:
|
|
732
|
+
reader.skipType(tag & 7);
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return message;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* Decodes a SenderKeyMessage message from the specified reader or buffer, length delimited.
|
|
740
|
+
* @function decodeDelimited
|
|
741
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
742
|
+
* @static
|
|
743
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
744
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyMessage} SenderKeyMessage
|
|
745
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
746
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
747
|
+
*/
|
|
748
|
+
SenderKeyMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
749
|
+
if (!(reader instanceof $Reader))
|
|
750
|
+
reader = new $Reader(reader);
|
|
751
|
+
return this.decode(reader, reader.uint32());
|
|
752
|
+
};
|
|
753
|
+
/**
|
|
754
|
+
* Verifies a SenderKeyMessage message.
|
|
755
|
+
* @function verify
|
|
756
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
757
|
+
* @static
|
|
758
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
759
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
760
|
+
*/
|
|
761
|
+
SenderKeyMessage.verify = function verify(message) {
|
|
762
|
+
if (typeof message !== "object" || message === null)
|
|
763
|
+
return "object expected";
|
|
764
|
+
var properties = {};
|
|
765
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
766
|
+
properties._id = 1;
|
|
767
|
+
if (!$util.isInteger(message.id))
|
|
768
|
+
return "id: integer expected";
|
|
769
|
+
}
|
|
770
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
771
|
+
properties._iteration = 1;
|
|
772
|
+
if (!$util.isInteger(message.iteration))
|
|
773
|
+
return "iteration: integer expected";
|
|
774
|
+
}
|
|
775
|
+
if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) {
|
|
776
|
+
properties._ciphertext = 1;
|
|
777
|
+
if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext)))
|
|
778
|
+
return "ciphertext: buffer expected";
|
|
779
|
+
}
|
|
780
|
+
return null;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* Creates a SenderKeyMessage message from a plain object. Also converts values to their respective internal types.
|
|
784
|
+
* @function fromObject
|
|
785
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
786
|
+
* @static
|
|
787
|
+
* @param {Object.<string,*>} object Plain object
|
|
788
|
+
* @returns {SignalWhisperTextProtocol.SenderKeyMessage} SenderKeyMessage
|
|
789
|
+
*/
|
|
790
|
+
SenderKeyMessage.fromObject = function fromObject(object) {
|
|
791
|
+
if (object instanceof $root.SignalWhisperTextProtocol.SenderKeyMessage)
|
|
792
|
+
return object;
|
|
793
|
+
var message = new $root.SignalWhisperTextProtocol.SenderKeyMessage();
|
|
794
|
+
if (object.id != null)
|
|
795
|
+
message.id = object.id >>> 0;
|
|
796
|
+
if (object.iteration != null)
|
|
797
|
+
message.iteration = object.iteration >>> 0;
|
|
798
|
+
if (object.ciphertext != null)
|
|
799
|
+
if (typeof object.ciphertext === "string")
|
|
800
|
+
$util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0);
|
|
801
|
+
else if (object.ciphertext.length >= 0)
|
|
802
|
+
message.ciphertext = object.ciphertext;
|
|
803
|
+
return message;
|
|
804
|
+
};
|
|
805
|
+
/**
|
|
806
|
+
* Creates a plain object from a SenderKeyMessage message. Also converts values to other types if specified.
|
|
807
|
+
* @function toObject
|
|
808
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
809
|
+
* @static
|
|
810
|
+
* @param {SignalWhisperTextProtocol.SenderKeyMessage} message SenderKeyMessage
|
|
811
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
812
|
+
* @returns {Object.<string,*>} Plain object
|
|
813
|
+
*/
|
|
814
|
+
SenderKeyMessage.toObject = function toObject(message, options) {
|
|
815
|
+
if (!options)
|
|
816
|
+
options = {};
|
|
817
|
+
var object = {};
|
|
818
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
819
|
+
object.id = message.id;
|
|
820
|
+
if (options.oneofs)
|
|
821
|
+
object._id = "id";
|
|
822
|
+
}
|
|
823
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
824
|
+
object.iteration = message.iteration;
|
|
825
|
+
if (options.oneofs)
|
|
826
|
+
object._iteration = "iteration";
|
|
827
|
+
}
|
|
828
|
+
if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) {
|
|
829
|
+
object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext;
|
|
830
|
+
if (options.oneofs)
|
|
831
|
+
object._ciphertext = "ciphertext";
|
|
832
|
+
}
|
|
833
|
+
return object;
|
|
834
|
+
};
|
|
835
|
+
/**
|
|
836
|
+
* Converts this SenderKeyMessage to JSON.
|
|
837
|
+
* @function toJSON
|
|
838
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
839
|
+
* @instance
|
|
840
|
+
* @returns {Object.<string,*>} JSON object
|
|
841
|
+
*/
|
|
842
|
+
SenderKeyMessage.prototype.toJSON = function toJSON() {
|
|
843
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
844
|
+
};
|
|
845
|
+
/**
|
|
846
|
+
* Gets the default type url for SenderKeyMessage
|
|
847
|
+
* @function getTypeUrl
|
|
848
|
+
* @memberof SignalWhisperTextProtocol.SenderKeyMessage
|
|
849
|
+
* @static
|
|
850
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
851
|
+
* @returns {string} The default type url
|
|
852
|
+
*/
|
|
853
|
+
SenderKeyMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
854
|
+
if (typeUrlPrefix === undefined) {
|
|
855
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
856
|
+
}
|
|
857
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.SenderKeyMessage";
|
|
858
|
+
};
|
|
859
|
+
return SenderKeyMessage;
|
|
860
|
+
})();
|
|
861
|
+
SignalWhisperTextProtocol.KeyExchangeMessage = (function() {
|
|
862
|
+
/**
|
|
863
|
+
* Properties of a KeyExchangeMessage.
|
|
864
|
+
* @memberof SignalWhisperTextProtocol
|
|
865
|
+
* @interface IKeyExchangeMessage
|
|
866
|
+
* @property {number|null} [id] KeyExchangeMessage id
|
|
867
|
+
* @property {Uint8Array|null} [baseKey] KeyExchangeMessage baseKey
|
|
868
|
+
* @property {Uint8Array|null} [ratchetKey] KeyExchangeMessage ratchetKey
|
|
869
|
+
* @property {Uint8Array|null} [identityKey] KeyExchangeMessage identityKey
|
|
870
|
+
* @property {Uint8Array|null} [baseKeySignature] KeyExchangeMessage baseKeySignature
|
|
871
|
+
*/
|
|
872
|
+
/**
|
|
873
|
+
* Constructs a new KeyExchangeMessage.
|
|
874
|
+
* @memberof SignalWhisperTextProtocol
|
|
875
|
+
* @classdesc Represents a KeyExchangeMessage.
|
|
876
|
+
* @implements IKeyExchangeMessage
|
|
877
|
+
* @constructor
|
|
878
|
+
* @param {SignalWhisperTextProtocol.IKeyExchangeMessage=} [properties] Properties to set
|
|
879
|
+
*/
|
|
880
|
+
function KeyExchangeMessage(properties) {
|
|
881
|
+
if (properties)
|
|
882
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
883
|
+
if (properties[keys[i]] != null)
|
|
884
|
+
this[keys[i]] = properties[keys[i]];
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* KeyExchangeMessage id.
|
|
888
|
+
* @member {number|null|undefined} id
|
|
889
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
890
|
+
* @instance
|
|
891
|
+
*/
|
|
892
|
+
KeyExchangeMessage.prototype.id = null;
|
|
893
|
+
/**
|
|
894
|
+
* KeyExchangeMessage baseKey.
|
|
895
|
+
* @member {Uint8Array|null|undefined} baseKey
|
|
896
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
897
|
+
* @instance
|
|
898
|
+
*/
|
|
899
|
+
KeyExchangeMessage.prototype.baseKey = null;
|
|
900
|
+
/**
|
|
901
|
+
* KeyExchangeMessage ratchetKey.
|
|
902
|
+
* @member {Uint8Array|null|undefined} ratchetKey
|
|
903
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
904
|
+
* @instance
|
|
905
|
+
*/
|
|
906
|
+
KeyExchangeMessage.prototype.ratchetKey = null;
|
|
907
|
+
/**
|
|
908
|
+
* KeyExchangeMessage identityKey.
|
|
909
|
+
* @member {Uint8Array|null|undefined} identityKey
|
|
910
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
911
|
+
* @instance
|
|
912
|
+
*/
|
|
913
|
+
KeyExchangeMessage.prototype.identityKey = null;
|
|
914
|
+
/**
|
|
915
|
+
* KeyExchangeMessage baseKeySignature.
|
|
916
|
+
* @member {Uint8Array|null|undefined} baseKeySignature
|
|
917
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
918
|
+
* @instance
|
|
919
|
+
*/
|
|
920
|
+
KeyExchangeMessage.prototype.baseKeySignature = null;
|
|
921
|
+
// OneOf field names bound to virtual getters and setters
|
|
922
|
+
var $oneOfFields;
|
|
923
|
+
/**
|
|
924
|
+
* KeyExchangeMessage _id.
|
|
925
|
+
* @member {"id"|undefined} _id
|
|
926
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
927
|
+
* @instance
|
|
928
|
+
*/
|
|
929
|
+
Object.defineProperty(KeyExchangeMessage.prototype, "_id", {
|
|
930
|
+
get: $util.oneOfGetter($oneOfFields = ["id"]),
|
|
931
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
932
|
+
});
|
|
933
|
+
/**
|
|
934
|
+
* KeyExchangeMessage _baseKey.
|
|
935
|
+
* @member {"baseKey"|undefined} _baseKey
|
|
936
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
937
|
+
* @instance
|
|
938
|
+
*/
|
|
939
|
+
Object.defineProperty(KeyExchangeMessage.prototype, "_baseKey", {
|
|
940
|
+
get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
|
|
941
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
942
|
+
});
|
|
943
|
+
/**
|
|
944
|
+
* KeyExchangeMessage _ratchetKey.
|
|
945
|
+
* @member {"ratchetKey"|undefined} _ratchetKey
|
|
946
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
947
|
+
* @instance
|
|
948
|
+
*/
|
|
949
|
+
Object.defineProperty(KeyExchangeMessage.prototype, "_ratchetKey", {
|
|
950
|
+
get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]),
|
|
951
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
952
|
+
});
|
|
953
|
+
/**
|
|
954
|
+
* KeyExchangeMessage _identityKey.
|
|
955
|
+
* @member {"identityKey"|undefined} _identityKey
|
|
956
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
957
|
+
* @instance
|
|
958
|
+
*/
|
|
959
|
+
Object.defineProperty(KeyExchangeMessage.prototype, "_identityKey", {
|
|
960
|
+
get: $util.oneOfGetter($oneOfFields = ["identityKey"]),
|
|
961
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
962
|
+
});
|
|
963
|
+
/**
|
|
964
|
+
* KeyExchangeMessage _baseKeySignature.
|
|
965
|
+
* @member {"baseKeySignature"|undefined} _baseKeySignature
|
|
966
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
967
|
+
* @instance
|
|
968
|
+
*/
|
|
969
|
+
Object.defineProperty(KeyExchangeMessage.prototype, "_baseKeySignature", {
|
|
970
|
+
get: $util.oneOfGetter($oneOfFields = ["baseKeySignature"]),
|
|
971
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
972
|
+
});
|
|
973
|
+
/**
|
|
974
|
+
* Creates a new KeyExchangeMessage instance using the specified properties.
|
|
975
|
+
* @function create
|
|
976
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
977
|
+
* @static
|
|
978
|
+
* @param {SignalWhisperTextProtocol.IKeyExchangeMessage=} [properties] Properties to set
|
|
979
|
+
* @returns {SignalWhisperTextProtocol.KeyExchangeMessage} KeyExchangeMessage instance
|
|
980
|
+
*/
|
|
981
|
+
KeyExchangeMessage.create = function create(properties) {
|
|
982
|
+
return new KeyExchangeMessage(properties);
|
|
983
|
+
};
|
|
984
|
+
/**
|
|
985
|
+
* Encodes the specified KeyExchangeMessage message. Does not implicitly {@link SignalWhisperTextProtocol.KeyExchangeMessage.verify|verify} messages.
|
|
986
|
+
* @function encode
|
|
987
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
988
|
+
* @static
|
|
989
|
+
* @param {SignalWhisperTextProtocol.IKeyExchangeMessage} message KeyExchangeMessage message or plain object to encode
|
|
990
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
991
|
+
* @returns {$protobuf.Writer} Writer
|
|
992
|
+
*/
|
|
993
|
+
KeyExchangeMessage.encode = function encode(message, writer) {
|
|
994
|
+
if (!writer)
|
|
995
|
+
writer = $Writer.create();
|
|
996
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
997
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.id);
|
|
998
|
+
if (message.baseKey != null && Object.hasOwnProperty.call(message, "baseKey"))
|
|
999
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.baseKey);
|
|
1000
|
+
if (message.ratchetKey != null && Object.hasOwnProperty.call(message, "ratchetKey"))
|
|
1001
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ratchetKey);
|
|
1002
|
+
if (message.identityKey != null && Object.hasOwnProperty.call(message, "identityKey"))
|
|
1003
|
+
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.identityKey);
|
|
1004
|
+
if (message.baseKeySignature != null && Object.hasOwnProperty.call(message, "baseKeySignature"))
|
|
1005
|
+
writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.baseKeySignature);
|
|
1006
|
+
return writer;
|
|
1007
|
+
};
|
|
1008
|
+
/**
|
|
1009
|
+
* Encodes the specified KeyExchangeMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.KeyExchangeMessage.verify|verify} messages.
|
|
1010
|
+
* @function encodeDelimited
|
|
1011
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1012
|
+
* @static
|
|
1013
|
+
* @param {SignalWhisperTextProtocol.IKeyExchangeMessage} message KeyExchangeMessage message or plain object to encode
|
|
1014
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1015
|
+
* @returns {$protobuf.Writer} Writer
|
|
1016
|
+
*/
|
|
1017
|
+
KeyExchangeMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1018
|
+
return this.encode(message, writer).ldelim();
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* Decodes a KeyExchangeMessage message from the specified reader or buffer.
|
|
1022
|
+
* @function decode
|
|
1023
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1024
|
+
* @static
|
|
1025
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1026
|
+
* @param {number} [length] Message length if known beforehand
|
|
1027
|
+
* @returns {SignalWhisperTextProtocol.KeyExchangeMessage} KeyExchangeMessage
|
|
1028
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1029
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1030
|
+
*/
|
|
1031
|
+
KeyExchangeMessage.decode = function decode(reader, length, error) {
|
|
1032
|
+
if (!(reader instanceof $Reader))
|
|
1033
|
+
reader = $Reader.create(reader);
|
|
1034
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.KeyExchangeMessage();
|
|
1035
|
+
while (reader.pos < end) {
|
|
1036
|
+
var tag = reader.uint32();
|
|
1037
|
+
if (tag === error)
|
|
1038
|
+
break;
|
|
1039
|
+
switch (tag >>> 3) {
|
|
1040
|
+
case 1: {
|
|
1041
|
+
message.id = reader.uint32();
|
|
1042
|
+
break;
|
|
1043
|
+
}
|
|
1044
|
+
case 2: {
|
|
1045
|
+
message.baseKey = reader.bytes();
|
|
1046
|
+
break;
|
|
1047
|
+
}
|
|
1048
|
+
case 3: {
|
|
1049
|
+
message.ratchetKey = reader.bytes();
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
case 4: {
|
|
1053
|
+
message.identityKey = reader.bytes();
|
|
1054
|
+
break;
|
|
1055
|
+
}
|
|
1056
|
+
case 5: {
|
|
1057
|
+
message.baseKeySignature = reader.bytes();
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
default:
|
|
1061
|
+
reader.skipType(tag & 7);
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return message;
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* Decodes a KeyExchangeMessage message from the specified reader or buffer, length delimited.
|
|
1069
|
+
* @function decodeDelimited
|
|
1070
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1071
|
+
* @static
|
|
1072
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1073
|
+
* @returns {SignalWhisperTextProtocol.KeyExchangeMessage} KeyExchangeMessage
|
|
1074
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1075
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1076
|
+
*/
|
|
1077
|
+
KeyExchangeMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1078
|
+
if (!(reader instanceof $Reader))
|
|
1079
|
+
reader = new $Reader(reader);
|
|
1080
|
+
return this.decode(reader, reader.uint32());
|
|
1081
|
+
};
|
|
1082
|
+
/**
|
|
1083
|
+
* Verifies a KeyExchangeMessage message.
|
|
1084
|
+
* @function verify
|
|
1085
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1086
|
+
* @static
|
|
1087
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1088
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1089
|
+
*/
|
|
1090
|
+
KeyExchangeMessage.verify = function verify(message) {
|
|
1091
|
+
if (typeof message !== "object" || message === null)
|
|
1092
|
+
return "object expected";
|
|
1093
|
+
var properties = {};
|
|
1094
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1095
|
+
properties._id = 1;
|
|
1096
|
+
if (!$util.isInteger(message.id))
|
|
1097
|
+
return "id: integer expected";
|
|
1098
|
+
}
|
|
1099
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
1100
|
+
properties._baseKey = 1;
|
|
1101
|
+
if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey)))
|
|
1102
|
+
return "baseKey: buffer expected";
|
|
1103
|
+
}
|
|
1104
|
+
if (message.ratchetKey != null && message.hasOwnProperty("ratchetKey")) {
|
|
1105
|
+
properties._ratchetKey = 1;
|
|
1106
|
+
if (!(message.ratchetKey && typeof message.ratchetKey.length === "number" || $util.isString(message.ratchetKey)))
|
|
1107
|
+
return "ratchetKey: buffer expected";
|
|
1108
|
+
}
|
|
1109
|
+
if (message.identityKey != null && message.hasOwnProperty("identityKey")) {
|
|
1110
|
+
properties._identityKey = 1;
|
|
1111
|
+
if (!(message.identityKey && typeof message.identityKey.length === "number" || $util.isString(message.identityKey)))
|
|
1112
|
+
return "identityKey: buffer expected";
|
|
1113
|
+
}
|
|
1114
|
+
if (message.baseKeySignature != null && message.hasOwnProperty("baseKeySignature")) {
|
|
1115
|
+
properties._baseKeySignature = 1;
|
|
1116
|
+
if (!(message.baseKeySignature && typeof message.baseKeySignature.length === "number" || $util.isString(message.baseKeySignature)))
|
|
1117
|
+
return "baseKeySignature: buffer expected";
|
|
1118
|
+
}
|
|
1119
|
+
return null;
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* Creates a KeyExchangeMessage message from a plain object. Also converts values to their respective internal types.
|
|
1123
|
+
* @function fromObject
|
|
1124
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1125
|
+
* @static
|
|
1126
|
+
* @param {Object.<string,*>} object Plain object
|
|
1127
|
+
* @returns {SignalWhisperTextProtocol.KeyExchangeMessage} KeyExchangeMessage
|
|
1128
|
+
*/
|
|
1129
|
+
KeyExchangeMessage.fromObject = function fromObject(object) {
|
|
1130
|
+
if (object instanceof $root.SignalWhisperTextProtocol.KeyExchangeMessage)
|
|
1131
|
+
return object;
|
|
1132
|
+
var message = new $root.SignalWhisperTextProtocol.KeyExchangeMessage();
|
|
1133
|
+
if (object.id != null)
|
|
1134
|
+
message.id = object.id >>> 0;
|
|
1135
|
+
if (object.baseKey != null)
|
|
1136
|
+
if (typeof object.baseKey === "string")
|
|
1137
|
+
$util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0);
|
|
1138
|
+
else if (object.baseKey.length >= 0)
|
|
1139
|
+
message.baseKey = object.baseKey;
|
|
1140
|
+
if (object.ratchetKey != null)
|
|
1141
|
+
if (typeof object.ratchetKey === "string")
|
|
1142
|
+
$util.base64.decode(object.ratchetKey, message.ratchetKey = $util.newBuffer($util.base64.length(object.ratchetKey)), 0);
|
|
1143
|
+
else if (object.ratchetKey.length >= 0)
|
|
1144
|
+
message.ratchetKey = object.ratchetKey;
|
|
1145
|
+
if (object.identityKey != null)
|
|
1146
|
+
if (typeof object.identityKey === "string")
|
|
1147
|
+
$util.base64.decode(object.identityKey, message.identityKey = $util.newBuffer($util.base64.length(object.identityKey)), 0);
|
|
1148
|
+
else if (object.identityKey.length >= 0)
|
|
1149
|
+
message.identityKey = object.identityKey;
|
|
1150
|
+
if (object.baseKeySignature != null)
|
|
1151
|
+
if (typeof object.baseKeySignature === "string")
|
|
1152
|
+
$util.base64.decode(object.baseKeySignature, message.baseKeySignature = $util.newBuffer($util.base64.length(object.baseKeySignature)), 0);
|
|
1153
|
+
else if (object.baseKeySignature.length >= 0)
|
|
1154
|
+
message.baseKeySignature = object.baseKeySignature;
|
|
1155
|
+
return message;
|
|
1156
|
+
};
|
|
1157
|
+
/**
|
|
1158
|
+
* Creates a plain object from a KeyExchangeMessage message. Also converts values to other types if specified.
|
|
1159
|
+
* @function toObject
|
|
1160
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1161
|
+
* @static
|
|
1162
|
+
* @param {SignalWhisperTextProtocol.KeyExchangeMessage} message KeyExchangeMessage
|
|
1163
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1164
|
+
* @returns {Object.<string,*>} Plain object
|
|
1165
|
+
*/
|
|
1166
|
+
KeyExchangeMessage.toObject = function toObject(message, options) {
|
|
1167
|
+
if (!options)
|
|
1168
|
+
options = {};
|
|
1169
|
+
var object = {};
|
|
1170
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1171
|
+
object.id = message.id;
|
|
1172
|
+
if (options.oneofs)
|
|
1173
|
+
object._id = "id";
|
|
1174
|
+
}
|
|
1175
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
1176
|
+
object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey;
|
|
1177
|
+
if (options.oneofs)
|
|
1178
|
+
object._baseKey = "baseKey";
|
|
1179
|
+
}
|
|
1180
|
+
if (message.ratchetKey != null && message.hasOwnProperty("ratchetKey")) {
|
|
1181
|
+
object.ratchetKey = options.bytes === String ? $util.base64.encode(message.ratchetKey, 0, message.ratchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ratchetKey) : message.ratchetKey;
|
|
1182
|
+
if (options.oneofs)
|
|
1183
|
+
object._ratchetKey = "ratchetKey";
|
|
1184
|
+
}
|
|
1185
|
+
if (message.identityKey != null && message.hasOwnProperty("identityKey")) {
|
|
1186
|
+
object.identityKey = options.bytes === String ? $util.base64.encode(message.identityKey, 0, message.identityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityKey) : message.identityKey;
|
|
1187
|
+
if (options.oneofs)
|
|
1188
|
+
object._identityKey = "identityKey";
|
|
1189
|
+
}
|
|
1190
|
+
if (message.baseKeySignature != null && message.hasOwnProperty("baseKeySignature")) {
|
|
1191
|
+
object.baseKeySignature = options.bytes === String ? $util.base64.encode(message.baseKeySignature, 0, message.baseKeySignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKeySignature) : message.baseKeySignature;
|
|
1192
|
+
if (options.oneofs)
|
|
1193
|
+
object._baseKeySignature = "baseKeySignature";
|
|
1194
|
+
}
|
|
1195
|
+
return object;
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
1198
|
+
* Converts this KeyExchangeMessage to JSON.
|
|
1199
|
+
* @function toJSON
|
|
1200
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1201
|
+
* @instance
|
|
1202
|
+
* @returns {Object.<string,*>} JSON object
|
|
1203
|
+
*/
|
|
1204
|
+
KeyExchangeMessage.prototype.toJSON = function toJSON() {
|
|
1205
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Gets the default type url for KeyExchangeMessage
|
|
1209
|
+
* @function getTypeUrl
|
|
1210
|
+
* @memberof SignalWhisperTextProtocol.KeyExchangeMessage
|
|
1211
|
+
* @static
|
|
1212
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1213
|
+
* @returns {string} The default type url
|
|
1214
|
+
*/
|
|
1215
|
+
KeyExchangeMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1216
|
+
if (typeUrlPrefix === undefined) {
|
|
1217
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1218
|
+
}
|
|
1219
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.KeyExchangeMessage";
|
|
1220
|
+
};
|
|
1221
|
+
return KeyExchangeMessage;
|
|
1222
|
+
})();
|
|
1223
|
+
SignalWhisperTextProtocol.PreKeySignalMessage = (function() {
|
|
1224
|
+
/**
|
|
1225
|
+
* Properties of a PreKeySignalMessage.
|
|
1226
|
+
* @memberof SignalWhisperTextProtocol
|
|
1227
|
+
* @interface IPreKeySignalMessage
|
|
1228
|
+
* @property {number|null} [registrationId] PreKeySignalMessage registrationId
|
|
1229
|
+
* @property {number|null} [preKeyId] PreKeySignalMessage preKeyId
|
|
1230
|
+
* @property {number|null} [signedPreKeyId] PreKeySignalMessage signedPreKeyId
|
|
1231
|
+
* @property {Uint8Array|null} [baseKey] PreKeySignalMessage baseKey
|
|
1232
|
+
* @property {Uint8Array|null} [identityKey] PreKeySignalMessage identityKey
|
|
1233
|
+
* @property {Uint8Array|null} [message] PreKeySignalMessage message
|
|
1234
|
+
*/
|
|
1235
|
+
/**
|
|
1236
|
+
* Constructs a new PreKeySignalMessage.
|
|
1237
|
+
* @memberof SignalWhisperTextProtocol
|
|
1238
|
+
* @classdesc Represents a PreKeySignalMessage.
|
|
1239
|
+
* @implements IPreKeySignalMessage
|
|
1240
|
+
* @constructor
|
|
1241
|
+
* @param {SignalWhisperTextProtocol.IPreKeySignalMessage=} [properties] Properties to set
|
|
1242
|
+
*/
|
|
1243
|
+
function PreKeySignalMessage(properties) {
|
|
1244
|
+
if (properties)
|
|
1245
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1246
|
+
if (properties[keys[i]] != null)
|
|
1247
|
+
this[keys[i]] = properties[keys[i]];
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* PreKeySignalMessage registrationId.
|
|
1251
|
+
* @member {number|null|undefined} registrationId
|
|
1252
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1253
|
+
* @instance
|
|
1254
|
+
*/
|
|
1255
|
+
PreKeySignalMessage.prototype.registrationId = null;
|
|
1256
|
+
/**
|
|
1257
|
+
* PreKeySignalMessage preKeyId.
|
|
1258
|
+
* @member {number|null|undefined} preKeyId
|
|
1259
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1260
|
+
* @instance
|
|
1261
|
+
*/
|
|
1262
|
+
PreKeySignalMessage.prototype.preKeyId = null;
|
|
1263
|
+
/**
|
|
1264
|
+
* PreKeySignalMessage signedPreKeyId.
|
|
1265
|
+
* @member {number|null|undefined} signedPreKeyId
|
|
1266
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1267
|
+
* @instance
|
|
1268
|
+
*/
|
|
1269
|
+
PreKeySignalMessage.prototype.signedPreKeyId = null;
|
|
1270
|
+
/**
|
|
1271
|
+
* PreKeySignalMessage baseKey.
|
|
1272
|
+
* @member {Uint8Array|null|undefined} baseKey
|
|
1273
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1274
|
+
* @instance
|
|
1275
|
+
*/
|
|
1276
|
+
PreKeySignalMessage.prototype.baseKey = null;
|
|
1277
|
+
/**
|
|
1278
|
+
* PreKeySignalMessage identityKey.
|
|
1279
|
+
* @member {Uint8Array|null|undefined} identityKey
|
|
1280
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1281
|
+
* @instance
|
|
1282
|
+
*/
|
|
1283
|
+
PreKeySignalMessage.prototype.identityKey = null;
|
|
1284
|
+
/**
|
|
1285
|
+
* PreKeySignalMessage message.
|
|
1286
|
+
* @member {Uint8Array|null|undefined} message
|
|
1287
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1288
|
+
* @instance
|
|
1289
|
+
*/
|
|
1290
|
+
PreKeySignalMessage.prototype.message = null;
|
|
1291
|
+
// OneOf field names bound to virtual getters and setters
|
|
1292
|
+
var $oneOfFields;
|
|
1293
|
+
/**
|
|
1294
|
+
* PreKeySignalMessage _registrationId.
|
|
1295
|
+
* @member {"registrationId"|undefined} _registrationId
|
|
1296
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1297
|
+
* @instance
|
|
1298
|
+
*/
|
|
1299
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_registrationId", {
|
|
1300
|
+
get: $util.oneOfGetter($oneOfFields = ["registrationId"]),
|
|
1301
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1302
|
+
});
|
|
1303
|
+
/**
|
|
1304
|
+
* PreKeySignalMessage _preKeyId.
|
|
1305
|
+
* @member {"preKeyId"|undefined} _preKeyId
|
|
1306
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1307
|
+
* @instance
|
|
1308
|
+
*/
|
|
1309
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_preKeyId", {
|
|
1310
|
+
get: $util.oneOfGetter($oneOfFields = ["preKeyId"]),
|
|
1311
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1312
|
+
});
|
|
1313
|
+
/**
|
|
1314
|
+
* PreKeySignalMessage _signedPreKeyId.
|
|
1315
|
+
* @member {"signedPreKeyId"|undefined} _signedPreKeyId
|
|
1316
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1317
|
+
* @instance
|
|
1318
|
+
*/
|
|
1319
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_signedPreKeyId", {
|
|
1320
|
+
get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]),
|
|
1321
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1322
|
+
});
|
|
1323
|
+
/**
|
|
1324
|
+
* PreKeySignalMessage _baseKey.
|
|
1325
|
+
* @member {"baseKey"|undefined} _baseKey
|
|
1326
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1327
|
+
* @instance
|
|
1328
|
+
*/
|
|
1329
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_baseKey", {
|
|
1330
|
+
get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
|
|
1331
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1332
|
+
});
|
|
1333
|
+
/**
|
|
1334
|
+
* PreKeySignalMessage _identityKey.
|
|
1335
|
+
* @member {"identityKey"|undefined} _identityKey
|
|
1336
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1337
|
+
* @instance
|
|
1338
|
+
*/
|
|
1339
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_identityKey", {
|
|
1340
|
+
get: $util.oneOfGetter($oneOfFields = ["identityKey"]),
|
|
1341
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1342
|
+
});
|
|
1343
|
+
/**
|
|
1344
|
+
* PreKeySignalMessage _message.
|
|
1345
|
+
* @member {"message"|undefined} _message
|
|
1346
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1347
|
+
* @instance
|
|
1348
|
+
*/
|
|
1349
|
+
Object.defineProperty(PreKeySignalMessage.prototype, "_message", {
|
|
1350
|
+
get: $util.oneOfGetter($oneOfFields = ["message"]),
|
|
1351
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1352
|
+
});
|
|
1353
|
+
/**
|
|
1354
|
+
* Creates a new PreKeySignalMessage instance using the specified properties.
|
|
1355
|
+
* @function create
|
|
1356
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1357
|
+
* @static
|
|
1358
|
+
* @param {SignalWhisperTextProtocol.IPreKeySignalMessage=} [properties] Properties to set
|
|
1359
|
+
* @returns {SignalWhisperTextProtocol.PreKeySignalMessage} PreKeySignalMessage instance
|
|
1360
|
+
*/
|
|
1361
|
+
PreKeySignalMessage.create = function create(properties) {
|
|
1362
|
+
return new PreKeySignalMessage(properties);
|
|
1363
|
+
};
|
|
1364
|
+
/**
|
|
1365
|
+
* Encodes the specified PreKeySignalMessage message. Does not implicitly {@link SignalWhisperTextProtocol.PreKeySignalMessage.verify|verify} messages.
|
|
1366
|
+
* @function encode
|
|
1367
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1368
|
+
* @static
|
|
1369
|
+
* @param {SignalWhisperTextProtocol.IPreKeySignalMessage} message PreKeySignalMessage message or plain object to encode
|
|
1370
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1371
|
+
* @returns {$protobuf.Writer} Writer
|
|
1372
|
+
*/
|
|
1373
|
+
PreKeySignalMessage.encode = function encode(message, writer) {
|
|
1374
|
+
if (!writer)
|
|
1375
|
+
writer = $Writer.create();
|
|
1376
|
+
if (message.preKeyId != null && Object.hasOwnProperty.call(message, "preKeyId"))
|
|
1377
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.preKeyId);
|
|
1378
|
+
if (message.baseKey != null && Object.hasOwnProperty.call(message, "baseKey"))
|
|
1379
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.baseKey);
|
|
1380
|
+
if (message.identityKey != null && Object.hasOwnProperty.call(message, "identityKey"))
|
|
1381
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.identityKey);
|
|
1382
|
+
if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
|
1383
|
+
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.message);
|
|
1384
|
+
if (message.registrationId != null && Object.hasOwnProperty.call(message, "registrationId"))
|
|
1385
|
+
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.registrationId);
|
|
1386
|
+
if (message.signedPreKeyId != null && Object.hasOwnProperty.call(message, "signedPreKeyId"))
|
|
1387
|
+
writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.signedPreKeyId);
|
|
1388
|
+
return writer;
|
|
1389
|
+
};
|
|
1390
|
+
/**
|
|
1391
|
+
* Encodes the specified PreKeySignalMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.PreKeySignalMessage.verify|verify} messages.
|
|
1392
|
+
* @function encodeDelimited
|
|
1393
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1394
|
+
* @static
|
|
1395
|
+
* @param {SignalWhisperTextProtocol.IPreKeySignalMessage} message PreKeySignalMessage message or plain object to encode
|
|
1396
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1397
|
+
* @returns {$protobuf.Writer} Writer
|
|
1398
|
+
*/
|
|
1399
|
+
PreKeySignalMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1400
|
+
return this.encode(message, writer).ldelim();
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* Decodes a PreKeySignalMessage message from the specified reader or buffer.
|
|
1404
|
+
* @function decode
|
|
1405
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1406
|
+
* @static
|
|
1407
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1408
|
+
* @param {number} [length] Message length if known beforehand
|
|
1409
|
+
* @returns {SignalWhisperTextProtocol.PreKeySignalMessage} PreKeySignalMessage
|
|
1410
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1411
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1412
|
+
*/
|
|
1413
|
+
PreKeySignalMessage.decode = function decode(reader, length, error) {
|
|
1414
|
+
if (!(reader instanceof $Reader))
|
|
1415
|
+
reader = $Reader.create(reader);
|
|
1416
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.PreKeySignalMessage();
|
|
1417
|
+
while (reader.pos < end) {
|
|
1418
|
+
var tag = reader.uint32();
|
|
1419
|
+
if (tag === error)
|
|
1420
|
+
break;
|
|
1421
|
+
switch (tag >>> 3) {
|
|
1422
|
+
case 5: {
|
|
1423
|
+
message.registrationId = reader.uint32();
|
|
1424
|
+
break;
|
|
1425
|
+
}
|
|
1426
|
+
case 1: {
|
|
1427
|
+
message.preKeyId = reader.uint32();
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
case 6: {
|
|
1431
|
+
message.signedPreKeyId = reader.uint32();
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
1434
|
+
case 2: {
|
|
1435
|
+
message.baseKey = reader.bytes();
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
case 3: {
|
|
1439
|
+
message.identityKey = reader.bytes();
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
case 4: {
|
|
1443
|
+
message.message = reader.bytes();
|
|
1444
|
+
break;
|
|
1445
|
+
}
|
|
1446
|
+
default:
|
|
1447
|
+
reader.skipType(tag & 7);
|
|
1448
|
+
break;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
return message;
|
|
1452
|
+
};
|
|
1453
|
+
/**
|
|
1454
|
+
* Decodes a PreKeySignalMessage message from the specified reader or buffer, length delimited.
|
|
1455
|
+
* @function decodeDelimited
|
|
1456
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1457
|
+
* @static
|
|
1458
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1459
|
+
* @returns {SignalWhisperTextProtocol.PreKeySignalMessage} PreKeySignalMessage
|
|
1460
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1461
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1462
|
+
*/
|
|
1463
|
+
PreKeySignalMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1464
|
+
if (!(reader instanceof $Reader))
|
|
1465
|
+
reader = new $Reader(reader);
|
|
1466
|
+
return this.decode(reader, reader.uint32());
|
|
1467
|
+
};
|
|
1468
|
+
/**
|
|
1469
|
+
* Verifies a PreKeySignalMessage message.
|
|
1470
|
+
* @function verify
|
|
1471
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1472
|
+
* @static
|
|
1473
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1474
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1475
|
+
*/
|
|
1476
|
+
PreKeySignalMessage.verify = function verify(message) {
|
|
1477
|
+
if (typeof message !== "object" || message === null)
|
|
1478
|
+
return "object expected";
|
|
1479
|
+
var properties = {};
|
|
1480
|
+
if (message.registrationId != null && message.hasOwnProperty("registrationId")) {
|
|
1481
|
+
properties._registrationId = 1;
|
|
1482
|
+
if (!$util.isInteger(message.registrationId))
|
|
1483
|
+
return "registrationId: integer expected";
|
|
1484
|
+
}
|
|
1485
|
+
if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) {
|
|
1486
|
+
properties._preKeyId = 1;
|
|
1487
|
+
if (!$util.isInteger(message.preKeyId))
|
|
1488
|
+
return "preKeyId: integer expected";
|
|
1489
|
+
}
|
|
1490
|
+
if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) {
|
|
1491
|
+
properties._signedPreKeyId = 1;
|
|
1492
|
+
if (!$util.isInteger(message.signedPreKeyId))
|
|
1493
|
+
return "signedPreKeyId: integer expected";
|
|
1494
|
+
}
|
|
1495
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
1496
|
+
properties._baseKey = 1;
|
|
1497
|
+
if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey)))
|
|
1498
|
+
return "baseKey: buffer expected";
|
|
1499
|
+
}
|
|
1500
|
+
if (message.identityKey != null && message.hasOwnProperty("identityKey")) {
|
|
1501
|
+
properties._identityKey = 1;
|
|
1502
|
+
if (!(message.identityKey && typeof message.identityKey.length === "number" || $util.isString(message.identityKey)))
|
|
1503
|
+
return "identityKey: buffer expected";
|
|
1504
|
+
}
|
|
1505
|
+
if (message.message != null && message.hasOwnProperty("message")) {
|
|
1506
|
+
properties._message = 1;
|
|
1507
|
+
if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message)))
|
|
1508
|
+
return "message: buffer expected";
|
|
1509
|
+
}
|
|
1510
|
+
return null;
|
|
1511
|
+
};
|
|
1512
|
+
/**
|
|
1513
|
+
* Creates a PreKeySignalMessage message from a plain object. Also converts values to their respective internal types.
|
|
1514
|
+
* @function fromObject
|
|
1515
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1516
|
+
* @static
|
|
1517
|
+
* @param {Object.<string,*>} object Plain object
|
|
1518
|
+
* @returns {SignalWhisperTextProtocol.PreKeySignalMessage} PreKeySignalMessage
|
|
1519
|
+
*/
|
|
1520
|
+
PreKeySignalMessage.fromObject = function fromObject(object) {
|
|
1521
|
+
if (object instanceof $root.SignalWhisperTextProtocol.PreKeySignalMessage)
|
|
1522
|
+
return object;
|
|
1523
|
+
var message = new $root.SignalWhisperTextProtocol.PreKeySignalMessage();
|
|
1524
|
+
if (object.registrationId != null)
|
|
1525
|
+
message.registrationId = object.registrationId >>> 0;
|
|
1526
|
+
if (object.preKeyId != null)
|
|
1527
|
+
message.preKeyId = object.preKeyId >>> 0;
|
|
1528
|
+
if (object.signedPreKeyId != null)
|
|
1529
|
+
message.signedPreKeyId = object.signedPreKeyId >>> 0;
|
|
1530
|
+
if (object.baseKey != null)
|
|
1531
|
+
if (typeof object.baseKey === "string")
|
|
1532
|
+
$util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0);
|
|
1533
|
+
else if (object.baseKey.length >= 0)
|
|
1534
|
+
message.baseKey = object.baseKey;
|
|
1535
|
+
if (object.identityKey != null)
|
|
1536
|
+
if (typeof object.identityKey === "string")
|
|
1537
|
+
$util.base64.decode(object.identityKey, message.identityKey = $util.newBuffer($util.base64.length(object.identityKey)), 0);
|
|
1538
|
+
else if (object.identityKey.length >= 0)
|
|
1539
|
+
message.identityKey = object.identityKey;
|
|
1540
|
+
if (object.message != null)
|
|
1541
|
+
if (typeof object.message === "string")
|
|
1542
|
+
$util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0);
|
|
1543
|
+
else if (object.message.length >= 0)
|
|
1544
|
+
message.message = object.message;
|
|
1545
|
+
return message;
|
|
1546
|
+
};
|
|
1547
|
+
/**
|
|
1548
|
+
* Creates a plain object from a PreKeySignalMessage message. Also converts values to other types if specified.
|
|
1549
|
+
* @function toObject
|
|
1550
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1551
|
+
* @static
|
|
1552
|
+
* @param {SignalWhisperTextProtocol.PreKeySignalMessage} message PreKeySignalMessage
|
|
1553
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1554
|
+
* @returns {Object.<string,*>} Plain object
|
|
1555
|
+
*/
|
|
1556
|
+
PreKeySignalMessage.toObject = function toObject(message, options) {
|
|
1557
|
+
if (!options)
|
|
1558
|
+
options = {};
|
|
1559
|
+
var object = {};
|
|
1560
|
+
if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) {
|
|
1561
|
+
object.preKeyId = message.preKeyId;
|
|
1562
|
+
if (options.oneofs)
|
|
1563
|
+
object._preKeyId = "preKeyId";
|
|
1564
|
+
}
|
|
1565
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
1566
|
+
object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey;
|
|
1567
|
+
if (options.oneofs)
|
|
1568
|
+
object._baseKey = "baseKey";
|
|
1569
|
+
}
|
|
1570
|
+
if (message.identityKey != null && message.hasOwnProperty("identityKey")) {
|
|
1571
|
+
object.identityKey = options.bytes === String ? $util.base64.encode(message.identityKey, 0, message.identityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityKey) : message.identityKey;
|
|
1572
|
+
if (options.oneofs)
|
|
1573
|
+
object._identityKey = "identityKey";
|
|
1574
|
+
}
|
|
1575
|
+
if (message.message != null && message.hasOwnProperty("message")) {
|
|
1576
|
+
object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message;
|
|
1577
|
+
if (options.oneofs)
|
|
1578
|
+
object._message = "message";
|
|
1579
|
+
}
|
|
1580
|
+
if (message.registrationId != null && message.hasOwnProperty("registrationId")) {
|
|
1581
|
+
object.registrationId = message.registrationId;
|
|
1582
|
+
if (options.oneofs)
|
|
1583
|
+
object._registrationId = "registrationId";
|
|
1584
|
+
}
|
|
1585
|
+
if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) {
|
|
1586
|
+
object.signedPreKeyId = message.signedPreKeyId;
|
|
1587
|
+
if (options.oneofs)
|
|
1588
|
+
object._signedPreKeyId = "signedPreKeyId";
|
|
1589
|
+
}
|
|
1590
|
+
return object;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* Converts this PreKeySignalMessage to JSON.
|
|
1594
|
+
* @function toJSON
|
|
1595
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1596
|
+
* @instance
|
|
1597
|
+
* @returns {Object.<string,*>} JSON object
|
|
1598
|
+
*/
|
|
1599
|
+
PreKeySignalMessage.prototype.toJSON = function toJSON() {
|
|
1600
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* Gets the default type url for PreKeySignalMessage
|
|
1604
|
+
* @function getTypeUrl
|
|
1605
|
+
* @memberof SignalWhisperTextProtocol.PreKeySignalMessage
|
|
1606
|
+
* @static
|
|
1607
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1608
|
+
* @returns {string} The default type url
|
|
1609
|
+
*/
|
|
1610
|
+
PreKeySignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1611
|
+
if (typeUrlPrefix === undefined) {
|
|
1612
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1613
|
+
}
|
|
1614
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.PreKeySignalMessage";
|
|
1615
|
+
};
|
|
1616
|
+
return PreKeySignalMessage;
|
|
1617
|
+
})();
|
|
1618
|
+
SignalWhisperTextProtocol.SignalMessage = (function() {
|
|
1619
|
+
/**
|
|
1620
|
+
* Properties of a SignalMessage.
|
|
1621
|
+
* @memberof SignalWhisperTextProtocol
|
|
1622
|
+
* @interface ISignalMessage
|
|
1623
|
+
* @property {Uint8Array|null} [ratchetKey] SignalMessage ratchetKey
|
|
1624
|
+
* @property {number|null} [counter] SignalMessage counter
|
|
1625
|
+
* @property {number|null} [previousCounter] SignalMessage previousCounter
|
|
1626
|
+
* @property {Uint8Array|null} [ciphertext] SignalMessage ciphertext
|
|
1627
|
+
*/
|
|
1628
|
+
/**
|
|
1629
|
+
* Constructs a new SignalMessage.
|
|
1630
|
+
* @memberof SignalWhisperTextProtocol
|
|
1631
|
+
* @classdesc Represents a SignalMessage.
|
|
1632
|
+
* @implements ISignalMessage
|
|
1633
|
+
* @constructor
|
|
1634
|
+
* @param {SignalWhisperTextProtocol.ISignalMessage=} [properties] Properties to set
|
|
1635
|
+
*/
|
|
1636
|
+
function SignalMessage(properties) {
|
|
1637
|
+
if (properties)
|
|
1638
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1639
|
+
if (properties[keys[i]] != null)
|
|
1640
|
+
this[keys[i]] = properties[keys[i]];
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* SignalMessage ratchetKey.
|
|
1644
|
+
* @member {Uint8Array|null|undefined} ratchetKey
|
|
1645
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1646
|
+
* @instance
|
|
1647
|
+
*/
|
|
1648
|
+
SignalMessage.prototype.ratchetKey = null;
|
|
1649
|
+
/**
|
|
1650
|
+
* SignalMessage counter.
|
|
1651
|
+
* @member {number|null|undefined} counter
|
|
1652
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1653
|
+
* @instance
|
|
1654
|
+
*/
|
|
1655
|
+
SignalMessage.prototype.counter = null;
|
|
1656
|
+
/**
|
|
1657
|
+
* SignalMessage previousCounter.
|
|
1658
|
+
* @member {number|null|undefined} previousCounter
|
|
1659
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1660
|
+
* @instance
|
|
1661
|
+
*/
|
|
1662
|
+
SignalMessage.prototype.previousCounter = null;
|
|
1663
|
+
/**
|
|
1664
|
+
* SignalMessage ciphertext.
|
|
1665
|
+
* @member {Uint8Array|null|undefined} ciphertext
|
|
1666
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1667
|
+
* @instance
|
|
1668
|
+
*/
|
|
1669
|
+
SignalMessage.prototype.ciphertext = null;
|
|
1670
|
+
// OneOf field names bound to virtual getters and setters
|
|
1671
|
+
var $oneOfFields;
|
|
1672
|
+
/**
|
|
1673
|
+
* SignalMessage _ratchetKey.
|
|
1674
|
+
* @member {"ratchetKey"|undefined} _ratchetKey
|
|
1675
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1676
|
+
* @instance
|
|
1677
|
+
*/
|
|
1678
|
+
Object.defineProperty(SignalMessage.prototype, "_ratchetKey", {
|
|
1679
|
+
get: $util.oneOfGetter($oneOfFields = ["ratchetKey"]),
|
|
1680
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1681
|
+
});
|
|
1682
|
+
/**
|
|
1683
|
+
* SignalMessage _counter.
|
|
1684
|
+
* @member {"counter"|undefined} _counter
|
|
1685
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1686
|
+
* @instance
|
|
1687
|
+
*/
|
|
1688
|
+
Object.defineProperty(SignalMessage.prototype, "_counter", {
|
|
1689
|
+
get: $util.oneOfGetter($oneOfFields = ["counter"]),
|
|
1690
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1691
|
+
});
|
|
1692
|
+
/**
|
|
1693
|
+
* SignalMessage _previousCounter.
|
|
1694
|
+
* @member {"previousCounter"|undefined} _previousCounter
|
|
1695
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1696
|
+
* @instance
|
|
1697
|
+
*/
|
|
1698
|
+
Object.defineProperty(SignalMessage.prototype, "_previousCounter", {
|
|
1699
|
+
get: $util.oneOfGetter($oneOfFields = ["previousCounter"]),
|
|
1700
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1701
|
+
});
|
|
1702
|
+
/**
|
|
1703
|
+
* SignalMessage _ciphertext.
|
|
1704
|
+
* @member {"ciphertext"|undefined} _ciphertext
|
|
1705
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1706
|
+
* @instance
|
|
1707
|
+
*/
|
|
1708
|
+
Object.defineProperty(SignalMessage.prototype, "_ciphertext", {
|
|
1709
|
+
get: $util.oneOfGetter($oneOfFields = ["ciphertext"]),
|
|
1710
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1711
|
+
});
|
|
1712
|
+
/**
|
|
1713
|
+
* Creates a new SignalMessage instance using the specified properties.
|
|
1714
|
+
* @function create
|
|
1715
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1716
|
+
* @static
|
|
1717
|
+
* @param {SignalWhisperTextProtocol.ISignalMessage=} [properties] Properties to set
|
|
1718
|
+
* @returns {SignalWhisperTextProtocol.SignalMessage} SignalMessage instance
|
|
1719
|
+
*/
|
|
1720
|
+
SignalMessage.create = function create(properties) {
|
|
1721
|
+
return new SignalMessage(properties);
|
|
1722
|
+
};
|
|
1723
|
+
/**
|
|
1724
|
+
* Encodes the specified SignalMessage message. Does not implicitly {@link SignalWhisperTextProtocol.SignalMessage.verify|verify} messages.
|
|
1725
|
+
* @function encode
|
|
1726
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1727
|
+
* @static
|
|
1728
|
+
* @param {SignalWhisperTextProtocol.ISignalMessage} message SignalMessage message or plain object to encode
|
|
1729
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1730
|
+
* @returns {$protobuf.Writer} Writer
|
|
1731
|
+
*/
|
|
1732
|
+
SignalMessage.encode = function encode(message, writer) {
|
|
1733
|
+
if (!writer)
|
|
1734
|
+
writer = $Writer.create();
|
|
1735
|
+
if (message.ratchetKey != null && Object.hasOwnProperty.call(message, "ratchetKey"))
|
|
1736
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ratchetKey);
|
|
1737
|
+
if (message.counter != null && Object.hasOwnProperty.call(message, "counter"))
|
|
1738
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.counter);
|
|
1739
|
+
if (message.previousCounter != null && Object.hasOwnProperty.call(message, "previousCounter"))
|
|
1740
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.previousCounter);
|
|
1741
|
+
if (message.ciphertext != null && Object.hasOwnProperty.call(message, "ciphertext"))
|
|
1742
|
+
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.ciphertext);
|
|
1743
|
+
return writer;
|
|
1744
|
+
};
|
|
1745
|
+
/**
|
|
1746
|
+
* Encodes the specified SignalMessage message, length delimited. Does not implicitly {@link SignalWhisperTextProtocol.SignalMessage.verify|verify} messages.
|
|
1747
|
+
* @function encodeDelimited
|
|
1748
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1749
|
+
* @static
|
|
1750
|
+
* @param {SignalWhisperTextProtocol.ISignalMessage} message SignalMessage message or plain object to encode
|
|
1751
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1752
|
+
* @returns {$protobuf.Writer} Writer
|
|
1753
|
+
*/
|
|
1754
|
+
SignalMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1755
|
+
return this.encode(message, writer).ldelim();
|
|
1756
|
+
};
|
|
1757
|
+
/**
|
|
1758
|
+
* Decodes a SignalMessage message from the specified reader or buffer.
|
|
1759
|
+
* @function decode
|
|
1760
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1761
|
+
* @static
|
|
1762
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1763
|
+
* @param {number} [length] Message length if known beforehand
|
|
1764
|
+
* @returns {SignalWhisperTextProtocol.SignalMessage} SignalMessage
|
|
1765
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1766
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1767
|
+
*/
|
|
1768
|
+
SignalMessage.decode = function decode(reader, length, error) {
|
|
1769
|
+
if (!(reader instanceof $Reader))
|
|
1770
|
+
reader = $Reader.create(reader);
|
|
1771
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalWhisperTextProtocol.SignalMessage();
|
|
1772
|
+
while (reader.pos < end) {
|
|
1773
|
+
var tag = reader.uint32();
|
|
1774
|
+
if (tag === error)
|
|
1775
|
+
break;
|
|
1776
|
+
switch (tag >>> 3) {
|
|
1777
|
+
case 1: {
|
|
1778
|
+
message.ratchetKey = reader.bytes();
|
|
1779
|
+
break;
|
|
1780
|
+
}
|
|
1781
|
+
case 2: {
|
|
1782
|
+
message.counter = reader.uint32();
|
|
1783
|
+
break;
|
|
1784
|
+
}
|
|
1785
|
+
case 3: {
|
|
1786
|
+
message.previousCounter = reader.uint32();
|
|
1787
|
+
break;
|
|
1788
|
+
}
|
|
1789
|
+
case 4: {
|
|
1790
|
+
message.ciphertext = reader.bytes();
|
|
1791
|
+
break;
|
|
1792
|
+
}
|
|
1793
|
+
default:
|
|
1794
|
+
reader.skipType(tag & 7);
|
|
1795
|
+
break;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
return message;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Decodes a SignalMessage message from the specified reader or buffer, length delimited.
|
|
1802
|
+
* @function decodeDelimited
|
|
1803
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1804
|
+
* @static
|
|
1805
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1806
|
+
* @returns {SignalWhisperTextProtocol.SignalMessage} SignalMessage
|
|
1807
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1808
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1809
|
+
*/
|
|
1810
|
+
SignalMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1811
|
+
if (!(reader instanceof $Reader))
|
|
1812
|
+
reader = new $Reader(reader);
|
|
1813
|
+
return this.decode(reader, reader.uint32());
|
|
1814
|
+
};
|
|
1815
|
+
/**
|
|
1816
|
+
* Verifies a SignalMessage message.
|
|
1817
|
+
* @function verify
|
|
1818
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1819
|
+
* @static
|
|
1820
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1821
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1822
|
+
*/
|
|
1823
|
+
SignalMessage.verify = function verify(message) {
|
|
1824
|
+
if (typeof message !== "object" || message === null)
|
|
1825
|
+
return "object expected";
|
|
1826
|
+
var properties = {};
|
|
1827
|
+
if (message.ratchetKey != null && message.hasOwnProperty("ratchetKey")) {
|
|
1828
|
+
properties._ratchetKey = 1;
|
|
1829
|
+
if (!(message.ratchetKey && typeof message.ratchetKey.length === "number" || $util.isString(message.ratchetKey)))
|
|
1830
|
+
return "ratchetKey: buffer expected";
|
|
1831
|
+
}
|
|
1832
|
+
if (message.counter != null && message.hasOwnProperty("counter")) {
|
|
1833
|
+
properties._counter = 1;
|
|
1834
|
+
if (!$util.isInteger(message.counter))
|
|
1835
|
+
return "counter: integer expected";
|
|
1836
|
+
}
|
|
1837
|
+
if (message.previousCounter != null && message.hasOwnProperty("previousCounter")) {
|
|
1838
|
+
properties._previousCounter = 1;
|
|
1839
|
+
if (!$util.isInteger(message.previousCounter))
|
|
1840
|
+
return "previousCounter: integer expected";
|
|
1841
|
+
}
|
|
1842
|
+
if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) {
|
|
1843
|
+
properties._ciphertext = 1;
|
|
1844
|
+
if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext)))
|
|
1845
|
+
return "ciphertext: buffer expected";
|
|
1846
|
+
}
|
|
1847
|
+
return null;
|
|
1848
|
+
};
|
|
1849
|
+
/**
|
|
1850
|
+
* Creates a SignalMessage message from a plain object. Also converts values to their respective internal types.
|
|
1851
|
+
* @function fromObject
|
|
1852
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1853
|
+
* @static
|
|
1854
|
+
* @param {Object.<string,*>} object Plain object
|
|
1855
|
+
* @returns {SignalWhisperTextProtocol.SignalMessage} SignalMessage
|
|
1856
|
+
*/
|
|
1857
|
+
SignalMessage.fromObject = function fromObject(object) {
|
|
1858
|
+
if (object instanceof $root.SignalWhisperTextProtocol.SignalMessage)
|
|
1859
|
+
return object;
|
|
1860
|
+
var message = new $root.SignalWhisperTextProtocol.SignalMessage();
|
|
1861
|
+
if (object.ratchetKey != null)
|
|
1862
|
+
if (typeof object.ratchetKey === "string")
|
|
1863
|
+
$util.base64.decode(object.ratchetKey, message.ratchetKey = $util.newBuffer($util.base64.length(object.ratchetKey)), 0);
|
|
1864
|
+
else if (object.ratchetKey.length >= 0)
|
|
1865
|
+
message.ratchetKey = object.ratchetKey;
|
|
1866
|
+
if (object.counter != null)
|
|
1867
|
+
message.counter = object.counter >>> 0;
|
|
1868
|
+
if (object.previousCounter != null)
|
|
1869
|
+
message.previousCounter = object.previousCounter >>> 0;
|
|
1870
|
+
if (object.ciphertext != null)
|
|
1871
|
+
if (typeof object.ciphertext === "string")
|
|
1872
|
+
$util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0);
|
|
1873
|
+
else if (object.ciphertext.length >= 0)
|
|
1874
|
+
message.ciphertext = object.ciphertext;
|
|
1875
|
+
return message;
|
|
1876
|
+
};
|
|
1877
|
+
/**
|
|
1878
|
+
* Creates a plain object from a SignalMessage message. Also converts values to other types if specified.
|
|
1879
|
+
* @function toObject
|
|
1880
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1881
|
+
* @static
|
|
1882
|
+
* @param {SignalWhisperTextProtocol.SignalMessage} message SignalMessage
|
|
1883
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1884
|
+
* @returns {Object.<string,*>} Plain object
|
|
1885
|
+
*/
|
|
1886
|
+
SignalMessage.toObject = function toObject(message, options) {
|
|
1887
|
+
if (!options)
|
|
1888
|
+
options = {};
|
|
1889
|
+
var object = {};
|
|
1890
|
+
if (message.ratchetKey != null && message.hasOwnProperty("ratchetKey")) {
|
|
1891
|
+
object.ratchetKey = options.bytes === String ? $util.base64.encode(message.ratchetKey, 0, message.ratchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ratchetKey) : message.ratchetKey;
|
|
1892
|
+
if (options.oneofs)
|
|
1893
|
+
object._ratchetKey = "ratchetKey";
|
|
1894
|
+
}
|
|
1895
|
+
if (message.counter != null && message.hasOwnProperty("counter")) {
|
|
1896
|
+
object.counter = message.counter;
|
|
1897
|
+
if (options.oneofs)
|
|
1898
|
+
object._counter = "counter";
|
|
1899
|
+
}
|
|
1900
|
+
if (message.previousCounter != null && message.hasOwnProperty("previousCounter")) {
|
|
1901
|
+
object.previousCounter = message.previousCounter;
|
|
1902
|
+
if (options.oneofs)
|
|
1903
|
+
object._previousCounter = "previousCounter";
|
|
1904
|
+
}
|
|
1905
|
+
if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) {
|
|
1906
|
+
object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext;
|
|
1907
|
+
if (options.oneofs)
|
|
1908
|
+
object._ciphertext = "ciphertext";
|
|
1909
|
+
}
|
|
1910
|
+
return object;
|
|
1911
|
+
};
|
|
1912
|
+
/**
|
|
1913
|
+
* Converts this SignalMessage to JSON.
|
|
1914
|
+
* @function toJSON
|
|
1915
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1916
|
+
* @instance
|
|
1917
|
+
* @returns {Object.<string,*>} JSON object
|
|
1918
|
+
*/
|
|
1919
|
+
SignalMessage.prototype.toJSON = function toJSON() {
|
|
1920
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1921
|
+
};
|
|
1922
|
+
/**
|
|
1923
|
+
* Gets the default type url for SignalMessage
|
|
1924
|
+
* @function getTypeUrl
|
|
1925
|
+
* @memberof SignalWhisperTextProtocol.SignalMessage
|
|
1926
|
+
* @static
|
|
1927
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1928
|
+
* @returns {string} The default type url
|
|
1929
|
+
*/
|
|
1930
|
+
SignalMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1931
|
+
if (typeUrlPrefix === undefined) {
|
|
1932
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1933
|
+
}
|
|
1934
|
+
return typeUrlPrefix + "/SignalWhisperTextProtocol.SignalMessage";
|
|
1935
|
+
};
|
|
1936
|
+
return SignalMessage;
|
|
1937
|
+
})();
|
|
1938
|
+
return SignalWhisperTextProtocol;
|
|
1939
|
+
})();
|
|
1940
|
+
module.exports = $root;
|